The control unit is the CPU's director. It doesn't store or compute data itself. In every clock cycle it sets the control signals: which registers load, what each multiplexer selects, what the ALU does, and whether memory reads or writes. The datapath then does exactly that at the clock edge.
Under the hood it's a finite state machine:
- its state is the current step, such as F1, F2, F3 (fetch), D (decode), E1, E2 (execute);
- its inputs are the decoded opcode from the IR and status bits like the zero flag;
- its outputs are the control signals.
There are two classic ways to build one:
- Hardwired: gates compute each signal from the state and opcode. Fast, but every change is a redesign.
- Microprogrammed: the signals for each step are stored as words in a small ROM, the control store. Slower per step, but easy to change.
Either way, the control unit's job is to answer two questions per cycle: which register changes, and where its new value comes from.