Sub topic 15
Microprogrammed Control Units and the Control Store
Assume you know binary numbers, registers, memory, and basic register-transfer notation. This chapter explains how a processor can implement instruction execution with a stored sequence of small control instructions.
The basic idea
A control unit produces signals such as:
- Load the memory address register from the program counter.
- Read memory into the memory data register.
- Select an ALU operation.
- Load a destination register.
- Update the program counter.
In a microprogrammed control unit, these signals are specified by microinstructions. A microinstruction is a control word whose bits select datapath actions. A sequence of microinstructions implements one machine instruction.
The microinstructions are stored in a special memory called the control store. The control address register, or CAR, selects the current microinstruction. A microprogram sequencer then chooses the address of the next microinstruction.
Microinstruction fields
A typical microinstruction contains:
| Field | Purpose |
|---|---|
| Control field | Activates datapath and memory signals |
| Condition field | Selects a status condition to test |
| Next-address field | Supplies a possible next microinstruction address |
| Sequencing field | Chooses sequential, branch, or mapped sequencing |
For example, a fetch microprogram might perform these register transfers:
MAR <- PCMDR <- M[MAR], PC <- PC + 1IR <- MDR- Branch to the routine selected by the opcode in
IR
The first address of an instruction's microprogram can be found by mapping the opcode to a control-store address. The sequencer may also branch based on a zero flag, carry flag, interrupt request, or an indirect-address bit.
Horizontal and vertical microinstructions
A horizontal microinstruction has many control bits. Each bit can directly activate one signal, so several independent actions can occur in the same clock cycle. This gives fast execution but produces a wide control word.
A vertical microinstruction encodes control choices into fields. A decoder converts each field into signals. It uses fewer bits but may allow fewer simultaneous actions and may require extra decoding time.
A control store with 1,024 entries and 80-bit microinstructions requires:
1,024 × 80 = 81,920 bits = 10,240 bytes
The control store is separate from the programmer-visible main memory. Changing it changes how the processor implements instructions, not the program's data memory.
Small sequencing example
control_store = {
10: ("MAR <- PC", 11),
11: ("MDR <- M[MAR]; PC <- PC + 1", 12),
12: ("IR <- MDR", 100),
100: ("R1 <- R1 + R2", 0),
}
address = 10
while address != 0:
action, address = control_store[address]
print(action)The value 100 represents the starting address of the microprogram for the decoded machine instruction. Address 0 ends this demonstration.
Common errors
- Counting main-memory words instead of control-store entries when sizing control memory.
- Forgetting that the next-address field needs enough bits for every control-store entry.
- Treating a vertical field as if every bit directly controlled the datapath.
- Assuming every microinstruction must perform only one register transfer.
- Confusing carry-based branching with signed-overflow branching.
Exercise
A control store has 2,048 entries, and each microinstruction is 48 bits wide. How many bytes are required?
Show answer
The required size is 2,048 × 48 = 98,304 bits. Dividing by 8 gives 12,288 bytes, or 12 KiB.