Sub topic 3
What the control unit does
This chapter assumes you know binary and hexadecimal numbers, basic logic gates, multiplexers, flip-flops, registers, and the fetch-decode-execute cycle.
The job of the control unit
The control unit (CU) directs the datapath. It reads the opcode in the instruction register (IR), decodes it, and emits control signals such as "load R1", "select ALU add", or "read memory" in each clock cycle. The datapath (registers, ALU, and buses) performs the arithmetic and moves data. It does nothing useful until the CU tells it what to do.
Each instruction runs as a sequence of register transfers. A fetch step, for example, looks like this:
T0: MAR <- PC
T1: MDR <- M[MAR], PC <- PC + 1
T2: IR <- MDRHardwired control units
A hardwired control unit generates control signals with fixed combinational logic. The opcode and a timing counter (a counter of clock steps within one instruction) feed a decoder. Each control signal is a Boolean function of these inputs.
Hardwired control is fast because signals come directly from gates. Changing an instruction requires redesigning the logic.
Microprogrammed control units and the control store
A microprogrammed control unit stores control signals as microinstructions in a small memory called the control store. Each machine instruction maps to a microprogram, a sequence of microinstructions. A micro-program counter selects the next word, and a microinstruction register holds the current one. Its bits drive the control signals.
The control store size equals the number of microinstructions times the width of each word.
Horizontal and vertical microinstructions
A horizontal microinstruction has one bit per control signal. No decoding is needed, so many signals fire in parallel, but each word is wide. A vertical microinstruction packs signals into encoded fields that a small decoder expands. Vertical words are narrow, but the decoder adds delay and limits parallelism.
| Format | Word width | Decoding needed | Parallelism |
|---|---|---|---|
| Horizontal | Wide | No | High |
| Vertical | Narrow | Yes | Low |
Choosing between hardwired and microprogrammed control
Hardwired control suits simple, fast instruction sets, typically RISC designs. Microprogrammed control suits complex instruction sets (CISC), where many instructions share steps and the design must be easy to修正 patch. Microprogramming trades some speed for flexibility.
Worked GATE-style problem pattern
GATE questions often ask for control store size. Consider a control store with 512 microinstructions of 40 bits each:
- Total bits: 512 × 40 = 20480 bits
- Bytes: 20480 ÷ 8 = 2560 bytes
Exercise
A microprogrammed control store holds 1024 microinstructions, each 24 bits wide. What is its size in bytes?
Show answer
1024 × 24 = 24576 bits, and 24576 ÷ 8 = 3072 bytes.