Inside the CPU
ALU, CU, registers — the three internal units.
Every CPU contains:
1. Arithmetic and Logic Unit (ALU).
- Performs arithmetic operations (+, −, ×, ÷).
- Performs logical operations (AND, OR, NOT, comparisons).
- The 'doer' of computation.
2. Control Unit (CU).
- Fetches instructions from RAM.
- Decodes what each instruction means.
- Directs the flow of data between ALU, registers and memory.
- Coordinates the Fetch-Decode-Execute cycle — the basic operation of every CPU.
3. Registers.
- Tiny, ultra-fast storage locations inside the CPU.
- Hold the current instruction, operands, results and addresses.
- The fastest memory in the entire computer (sub-nanosecond access).
Plus the cache hierarchy:
- L1 cache — smallest, fastest (per core).
- L2 cache — larger, slightly slower (per core).
- L3 cache — largest, slower (shared between cores).