Sub topic 16
Horizontal and Vertical Microinstructions
A microinstruction is a control word stored in the control store of a microprogrammed control unit. It specifies the control signals needed during one internal processor step. This chapter assumes that you know registers, buses, memory, and basic instruction fetch and execution.
A machine instruction such as ADD R1, R2 is implemented by a sequence of microinstructions. Each microinstruction may transfer data between registers, select an ALU operation, read memory, or choose the next microinstruction address.
Horizontal microinstructions
A horizontal microinstruction has many control bits. Usually, one bit directly represents one control signal. If the processor has 40 independent control signals, a horizontal control word may contain about 40 bits.
For example, a word might contain fields for:
- Register output enables
- Register load enables
- ALU operation
- Memory read or write
- Bus selection
- Next-address control
Several non-conflicting signals can be asserted in the same microinstruction. For example:
MARout, MDRin, MemoryReadThis can transfer an address to the memory address register and start a memory read in one step, if the datapath supports those actions.
Horizontal control has these properties:
| Property | Horizontal microinstructions |
|---|---|
| Word width | Large |
| Signal encoding | Mostly one bit per signal |
| Parallel actions | High |
| Control-store size | Larger |
| Decoding delay | Low |
The wide word makes the control unit fast because little decoding is required. Its cost is a larger control memory.
Vertical microinstructions
A vertical microinstruction encodes control signals into fields. Instead of assigning one bit to every register, a field may contain a binary code selecting one register. Another field may select the ALU operation.
For example:
Source = R1
Destination = R2
ALU = ADD
Memory = NONEIf eight registers are possible sources, the source field needs only 3 bits because 2^3 = 8. A decoder converts that code into the corresponding control signal.
Vertical control has these properties:
| Property | Vertical microinstructions |
|---|---|
| Word width | Small |
| Signal encoding | Field-based |
| Parallel actions | Limited by field structure |
| Control-store size | Smaller |
| Decoding delay | Higher |
A single field normally selects one option. Therefore, vertical encoding can prevent two actions that hardware could otherwise perform simultaneously. Designers may add separate fields when more parallelism is needed.
Control-store sizing
If a microprogram contains M microinstructions and each microinstruction has W bits, the control store requires:
M × W bitsFor example, 512 microinstructions of 36 bits each require:
512 × 36 = 18,432 bitsWhen solving a GATE problem, first determine whether the stated format uses one bit per signal or encoded fields. Do not count every possible signal as a separate bit when the question describes a decoder.
Exercise
A control unit has 16 possible ALU operations and eight possible source registers. How many bits are required for these two vertical fields?
Show answer
The ALU field needs 4 bits because 2^4 = 16. The source field needs 3 bits because 2^3 = 8. Together, they require 7 bits.