Class Notes – CPU (Central Processing Unit)
Course: Computer Architecture / Computer Science
Date: [Insert Date]
Professor: [Insert Name]
1. Definition
CPU (Central Processing Unit) is the “brain” of the computer, responsible for
executing instructions from programs.
It performs arithmetic, logic, control, and input/output operations.
Core components: ALU (Arithmetic Logic Unit), Control Unit, Registers.
2. CPU Components
A. Arithmetic Logic Unit (ALU)
Performs all arithmetic operations (addition, subtraction, multiplication,
division).
Performs logic operations (AND, OR, NOT, XOR).
Handles comparison operations (>, <, =).
Temporary results stored in registers.
B. Control Unit (CU)
Directs the operation of the CPU and coordinates other components.
Responsible for:
Instruction fetch: retrieves instruction from memory
Instruction decode: determines what operation is required
Execution control: signals ALU, memory, and I/O units to act
Ensures proper timing and sequencing of operations.
C. Registers
Small, high-speed storage locations inside the CPU.
Types:
General-purpose registers: temporary storage for operands/results
Special-purpose registers: program counter (PC), instruction register (IR), stack
pointer (SP)
D. Cache Memory
Small, fast memory inside or near the CPU to reduce memory access time.
Levels: L1 (smallest, fastest), L2, L3 (larger, slower)
Stores frequently used instructions and data.
3. CPU Functions
Fetch: retrieve instructions from main memory (RAM).
Decode: interpret the instruction to determine required action.
Execute: perform the operation via ALU or other components.
Store/Write-back: write the result back to registers or memory.
This sequence is called the Fetch-Decode-Execute Cycle.
4. CPU Performance Factors
Clock Speed: measured in GHz; higher → more instructions per second
Number of Cores: multi-core CPUs can execute multiple instructions simultaneously
Cache Size: larger cache reduces memory access delays
Instruction Set Architecture (ISA): defines the CPU’s supported instructions
Pipelining: allows overlapping of instruction stages for faster throughput
5. Types of CPUs
Single-core CPU: processes one instruction at a time
Multi-core CPU: multiple cores → parallel processing → better multitasking
CISC (Complex Instruction Set Computer): large set of complex instructions (e.g.,
Intel x86)
RISC (Reduced Instruction Set Computer): simpler instructions, faster execution per
cycle (e.g., ARM)
Hybrid CPUs: combination of high-performance and high-efficiency cores
6. CPU Instruction Types
Data Movement Instructions: load, store, move
Arithmetic Instructions: add, subtract, multiply, divide
Logic Instructions: AND, OR, XOR, NOT
Control Instructions: jump, branch, call, return
Input/Output Instructions: interact with peripherals
7. CPU Architecture Concepts
Von Neumann Architecture: single memory for instructions and data; sequential
execution
Harvard Architecture: separate memory for instructions and data → faster access
Pipeline Architecture: instructions broken into stages (fetch, decode, execute) for
overlapping execution
Superscalar Architecture: multiple instructions per clock cycle
8. Modern CPU Features
Hyper-threading / SMT (Simultaneous Multithreading): logical cores per physical
core
Integrated Graphics Processing Unit (iGPU): basic graphics processing within CPU
Thermal Management: CPU throttling to prevent overheating
Overclocking: running CPU above rated speed for performance boost (increases
heat/power use)
9. CPU vs GPU
Feature CPU GPU
Purpose General-purpose computing Parallel computation, graphics
Cores Few, complex cores Hundreds/thousands, simple cores
Speed High clock speed Lower clock speed, many cores
Memory Small cache Large VRAM for graphics
Best for Sequential tasks Parallel tasks (rendering, ML)
10. Summary
CPU is the central component responsible for computation in a computer.
It executes instructions using the ALU, Control Unit, and Registers.
Performance depends on clock speed, cores, cache, and architecture.
Modern CPUs incorporate pipelining, multi-threading, and integrated GPUs.
Understanding CPU architecture is crucial for computer design, programming, and
optimization.