Phase 1.02
The Central Processing Unit (CPU)
Detailed internal structure: Control Unit, ALU, and the register set.
The CPU executes instructions through its internal subsystems:
Major Components
- Control Unit (CU): The manager. It handles control signals, directs data flow, and manages the instruction cycle. It does not perform actual data processing.
- Arithmetic Logic Unit (ALU): The worker. It performs math (ADD, SUB) and comparisons (AND, OR, NOT).
- Registers: Ultra-fast internal storage locations.
Detailed Register Set
| Register | Full Name | Purpose |
|---|---|---|
| PC | Program Counter | Holds the address of the NEXT instruction to be fetched. |
| ACC | Accumulator | Stores intermediate results of ALU calculations. |
| IR | Instruction Register | Holds the actual current instruction being executed. |
| MAR | Memory Address Register | Holds the memory address for a read/write operation. |
| MDR | Memory Data Register | Holds the actual data being transferred to/from memory. |
| SP | Stack Pointer | Tracks the top of the program stack (used for function calls). |
| Flags | Status Register | Bits representing outcomes (Zero, Carry, Overflow, Sign). |
System Clock
Generates pulses at a fixed rate (GHz) to synchronize all internal operations. One "clock cycle" is the smallest unit of time for a CPU operation.
Technical Terms Breakdown
Control Unit (CU)
Directs the operation of the processor. It tells the memory, ALU, and I/O how to respond to instructions.
ALU
Performs all calculations and logical decisions.
Accumulator (ACC)
A general-purpose register that stores the output of the ALU.
Flags/Status Register
Contains individual bits (Z, C, S, V) that indicate the results of the last operation.