COA Notes
CPU control unit design, functions, control signal generation, and coordination of processor operations.
Introduction
If the ALU is the muscle of the CPU, the control unit is the brain. It doesn't compute anything itself — instead, it orchestrates everything else. The control unit reads each instruction, figures out what needs to happen, and then generates the precise sequence of electrical signals that make it happen. Every register transfer, every ALU operation, every memory access is triggered by a control signal from the control unit.
Functions of the Control Unit
The control unit is responsible for:
- Instruction fetching: Initiating memory reads to get the next instruction
- Instruction decoding: Interpreting the opcode to determine the required operation
- Sequencing: Determining the order of micro-operations
- Control signal generation: Producing signals that activate datapath components
- Handling exceptions: Responding to interrupts and error conditions
Control Signals Generated
The control unit generates signals for:
Register Control
- Register select (which register to read from or write to)
- Register load (enable writing to a register)
- Register output enable (connect register to bus)
ALU Control
- Operation select (ADD, SUB, AND, OR, etc.)
- Carry input (for subtraction or multi-word arithmetic)
Memory Control
- Memory read (MAR → address bus, receive data on data bus)
- Memory write (MAR → address bus, MBR → data bus)
Bus Control
- Bus enables (which component drives each bus)
- Multiplexer selects (routing data through the datapath)
Sequencing
- PC load (for branches — load new address into PC)
- PC increment (advance to next instruction)
- Timing signals (T0, T1, T2... marking each micro-step)
Control Unit Inputs and Outputs
How the Control Unit Works
Step 1: Fetch Phase
The control unit always starts by fetching the next instruction:
- Asserts: PC→MAR, Memory_Read, MBR→IR, PC_increment
- After this, the instruction is in IR and PC points to the next instruction
Step 2: Decode Phase
The control unit examines the opcode field of IR:
- Determines instruction type (arithmetic, branch, load, store, etc.)
- Sets up the sequence of control signals for execution
- If needed, calculates effective address
Step 3: Execute Phase
Depends entirely on the instruction type:
- ADD R1,R2,R3: Assert "R2→BusA, R3→BusB, ALU=ADD, Result→R1, Load_R1"
- LOAD R1,[X]: Assert "X→MAR, Memory_Read, MBR→R1, Load_R1"
- BEQ label: Check Zero flag; if set, assert "label→PC, Load_PC"
Control Unit Design Approaches
Hardwired Control Unit
Control signals generated directly by combinational logic circuits:
- Inputs: opcode bits + timing counter + flags
- Outputs: all control signals
- Fast (minimal propagation delay)
- Inflexible (changing behavior requires redesigning circuits)
- Used in: RISC processors (simpler instruction sets)
Microprogrammed Control Unit
Control signals stored in a special control memory as microinstructions:
- Each machine instruction maps to a sequence of microinstructions
- Microinstructions specify which control signals to assert each cycle
- Flexible (modify behavior by changing the control memory)
- Slightly slower (extra memory read per micro-step)
- Used in: CISC processors (complex instruction sets)
Timing and Sequencing
The control unit uses a timing mechanism (counter or state machine) to track which micro-step is currently executing:
| Timing Counter: T0 | T1 → T2 → T3 → T4 → ... → T0 (reset) |
| T0 | Fetch - MAR ← PC |
| T1 | Fetch - MBR ← M[MAR], PC ← PC+1 |
| T2 | Decode - IR ← MBR, generate control based on opcode |
| T3 | Execute - (depends on instruction) |
| T4 | Execute - (continues if needed) |
The number of T-states per instruction varies by instruction complexity:
- Simple register ADD: T0-T3 (4 cycles)
- Memory LOAD: T0-T5 (6 cycles)
- Branch: T0-T4 (5 cycles, potentially)
Control Signals Timing Example
For instruction ADD R3, R1, R2 (R3 ← R1 + R2):
| Cycle | Control Signals Asserted | Action |
|---|---|---|
| T0 | PC_out, MAR_in | MAR ← PC |
| T1 | MEM_read, MBR_out, IR_in, PC_inc | IR ← M[MAR], PC++ |
| T2 | R1_out_A, R2_out_B, ALU_ADD | ALU inputs ready |
| T3 | ALU_result_out, R3_in | R3 ← ALU output |
Key Takeaways
- The control unit is the coordinator — it generates all signals that drive the datapath
- It takes inputs from the IR (what instruction), clock (when), and flags (conditions)
- It outputs control signals to registers, ALU, memory, and buses
- Two implementation approaches: hardwired (fast, rigid) and microprogrammed (flexible, slower)
- Timing counter tracks which micro-step is executing within each instruction
- Every machine instruction is decomposed into a sequence of timed micro-operations
- The control unit's design directly determines how many cycles each instruction takes
Exam Focus
Revise definitions, diagrams, examples, and short-answer points for Control Unit.
Interview Use
Prepare one clear explanation, one practical example, and one common mistake for this Computer Organization & Architecture topic.
Search Terms
computer-organization, computer organization & architecture, computer, organization, cpu, control, unit, control unit
Related Computer Organization & Architecture Topics