Computing Library › Digital Logic & Circuits
Digital Logic & Circuits

Control Unit

The control unit decodes instructions and generates the signals that steer the datapath through each step of execution.

What it does

The control unit is the part of a processor that decides what happens each cycle. It reads the current instruction, and often status flags, and produces the control signals, mux selects, register-write enables, ALU operation codes, and memory commands, that direct the datapath.

As a state machine

Kronos motion — control room

The control unit is naturally a finite state machine. It sequences through the steps of executing an instruction, fetch, decode, execute, and so on, asserting the right signals in each state and choosing the next state from the opcode and conditions.

Hardwired control

In a hardwired control unit the signals are produced by fixed combinational logic and a state machine designed directly in gates. This is fast and compact but hard to change, since altering the instruction set means redesigning the logic.

Microprogrammed control

An alternative stores the control signals for each step as words in a small memory, a microprogram. Each instruction triggers a sequence of these microinstructions. This is easier to modify and extend, at the cost of the extra memory and a step to read it, and suits complex instruction sets.

Relation to the datapath

Control and datapath are the two halves of a CPU: the datapath holds and transforms data, and the control unit tells it exactly what to do and when. Their clean separation is a central principle of processor design.