7.3 Microprogrammed Control Units: Horizontal vs Vertical Micro-Instructions
💡 Core Intuition: Software Inside Silicon
As computer architectures evolved throughout the 1950s and 1960s, instruction sets grew dramatically in complexity. Implementing hundreds of multi-byte, multi-addressing-mode instructions purely with combinational AND-OR logic gates (hardwired control) resulted in an unmaintainable "rat's nest" of silicon interconnects. A single bug or instruction format revision required scrap-heaping physical silicon masks and redesigning the entire chip layout.
In 1951, Maurice Wilkes proposed an elegant, revolutionary paradigm: Microprogramming.
Instead of generating control signals through fixed physical wiring, treat the control unit as an internal computer within a computer. The hardware control signals required for each clock cycle are stored as binary words (micro-instructions) inside a specialized, ultra-fast read-only memory called Control Memory (CM).
🍳 The Everyday Analogy: The Digital Synthesizer vs. The Piano
- Hardwired Control is an Acoustic Piano: When you press key C4, a physical felt hammer strikes steel strings directly. It produces sound at the speed of mechanical physics (zero latency). But if you want the piano to sound like an electric guitar or an orchestral flute, you must throw the piano away and rebuild a completely different acoustic instrument.
- Microprogrammed Control is a Digital MIDI Synthesizer: When you press key C4, a processor looks up a row of binary data in a memory bank (the sound sample / microcode word), which tells the digital-to-analog converter exactly how to shape the audio waveforms.
- To add a new instrument or patch a flawed tone, you do not touch a soldering iron—you simply load a new firmware file into the synthesizer's memory!
- The trade-off: Looking up sound samples in memory takes a few extra clock cycles compared to a mechanical hammer strike.
Microprogrammed Control Address & Execution Pipeline
How opcodes map into control memory addresses to drive datapath control vectors
Opcode Mapping Logic
Translates machine instruction opcode bits into the base address of its microcode routine.
Control Address Register (CAR)
Holds the k-bit address of the next micro-instruction to be read from ROM.
Control Memory (CM / ROM)
Fast on-die memory storing the pre-programmed microcode words.
Control Data Register (CDR)
Latches the active micro-instruction; asserts datapath enables and feeds next-address sequencer.
💻 Bridging to Computer Science
In a microprogrammed architecture:
- A Micro-operation is an atomic hardware action (e.g., or ).
- A Micro-instruction is a control word stored in Control Memory whose bit pattern specifies one or more micro-operations to be executed simultaneously during a single clock cycle, along with sequencing information.
- A Micro-program (or Microcode Routine) is a sequential routine of micro-instructions that implements the complete fetch, decode, and execution lifecycle of a single machine-language instruction.
🏛️ Architecture of a Microprogrammed Control Unit
A microprogrammed control unit is structured around four primary hardware units:
Microprogrammed Control Unit Hardware Organization
Core architectural building blocks coordinating microcode sequencing and execution
Control Memory (CM / ROM)
2^k Words x W Bits- Dedicated ultra-fast read-only storage holding all machine micro-routines.
- Stores fetch, indirect, and execution micro-instruction sequences.
- Cycle time matches the CPU execution clock for zero wait-state reads.
Control Address Register (CAR)
k Bits Wide- The microcode equivalent of the Program Counter (PC).
- Holds the k-bit physical address pointing to the active micro-instruction in CM.
- Synchronously advances via CAR + 1 or loads jump/mapping target addresses.
Control Data Register (CDR / CBR)
W Bits Wide- Also designated as the Control Buffer Register (CBR) or Micro-Instruction Register.
- Latches the micro-instruction word read from Control Memory on the clock edge.
- Partitions bits into datapath control enables and sequencer branch fields.
Microprogram Sequencer
Next-Address Logic- Arbitrates and selects among four next-address sources driving the CAR.
- Supports sequential increment, conditional branch, subroutine call, and opcode mapping.
- Interfaces directly with processor status condition flags (Z, S, C, V).
Microprogram Sequencing Logic & Address Sources
The Microprogram Sequencer generates the next CAR address by multiplexing four distinct inputs:
Four Next-Address Sources in the Microprogram Sequencer
Sequential Step (CAR + 1)
Advances linearly to the next consecutive micro-instruction in the current micro-routine.
Branch / Jump Target
Loads the target address field directly from the Control Data Register when a branch condition is met.
Opcode Mapping Logic
Transforms the machine instruction opcode into the starting address of its corresponding microcode routine.
Subroutine Return (SBR)
Restores the return address popped from the Subroutine Register after completing a shared micro-subroutine.
Opcode Mapping Mechanics
When an instruction is fetched into the processor's Instruction Register (), the control unit must jump to the beginning of that instruction's specific micro-routine in Control Memory.
In a computer with a 4-bit opcode () and a 7-bit CAR ( in control memory), a simple mapping logic circuit prepends a and appends to the opcode:
This maps 16 distinct opcodes to starting addresses in Control Memory, allocating up to 4 micro-instructions per routine! If a routine requires more than 4 micro-instructions, it can branch to an unmapped upper memory space ().
🔀 Horizontal vs. Vertical Microprogramming
The structure of the micro-instruction control field establishes the fundamental classification of microprogrammed control units:
Horizontal vs. Vertical Microprogramming Paradigms
The fundamental architectural trade-off between control word width and hardware decoder latency
Horizontal Microprogramming
- •Every control signal in the CPU has a dedicated 1-bit position in the control word.
- •Extremely wide control words (typically 50 to 128+ bits).
- •Maximum degree of parallelism: multiple non-conflicting control signals assert in one cycle.
- •Zero decoding hardware: control bits connect directly to register enables and ALU pins.
- •Fastest micro-execution time, but lower memory storage efficiency.
Vertical Microprogramming
- •Mutually exclusive control signals are grouped and binary-encoded into compact fields.
- •Narrow control words (typically 16 to 32 bits).
- •Restricted parallelism: at most one signal per group can be active per clock cycle.
- •Requires external decoders at the output of the Control Data Register.
- •Highly compact control memory, but introduces decoder propagation delay.
Anatomy of Micro-Instruction Formats
1. Horizontal Micro-Instruction Format
In pure horizontal microprogramming, no decoding is performed. For a processor with hardware control signals:
Horizontal Micro-Instruction Word Layout
Unencoded direct control bit vector with integrated sequencer branch logic
Unencoded direct control outputs driving datapath signals (PC_out, AR_in, DR_load, ALU_add) with zero decoding delay.
2. Vertical Micro-Instruction Format
In vertical microprogramming, control signals that can never be asserted simultaneously (mutually exclusive signals, such as bus drivers or ALU functions) are grouped together.
If group contains control signals, we must encode both the active signals plus one state representing No-Operation (NOP):
Hardware Invariant: The extra state is strictly mandatory so that the group can remain inactive () when none of its control signals are needed during a cycle.
Vertical Encoded Micro-Instruction Word Layout
Encoded functional control fields with dedicated external decoders and sequencer branch fields
Decoded via 4x16 external decoder into 15 distinct arithmetic/logic micro-operations plus 1 NOP code.
Detailed Architectural Trade-Off Matrix
| Metric / Parameter | Horizontal Microprogramming | Vertical Microprogramming |
|---|---|---|
| Control Word Width | Very Wide () | Narrow () |
| Degree of Parallelism | Maximum (All independent signals active) | Low / Restricted (At most 1 signal per group) |
| Control Memory Size (Bits) | Large () | Small () |
| Decoding Circuitry Required | None (Direct bit-to-pin wiring) | Required (Decoders for each group) |
| Propagation Delay Overhead | Zero decoding delay () | Adds decoder latency () |
| Execution Cycle Speed | Faster per micro-instruction | Slower due to sequentialization |
| Design Flexibility | High (Any signal can be added) | Moderate (Adding signals alters field widths) |
| Primary Domain | VLIW, high-speed DSPs, signal processors | CISC processors, cost-constrained microcontrollers |
🗄️ Two-Level Control Store: Nano-Programming
In complex CISC processors (such as the Motorola 68000), analyzing horizontal control memory reveals massive redundancy: across thousands of micro-instructions, only a small subset of distinct control signal combinations are ever used.
To eliminate this redundancy without sacrificing horizontal parallelism, designers invented Nano-Programming (Two-Level Control Store):
Two-Level Nano-Programming Architecture
Decoupling microcode sequencing from wide horizontal control vector generation
Micro-Store (μROM)
Stores W words containing next-address sequencing fields and a narrow pointer (Nano-Address).
Nano-Store (NanoROM)
Stores only U unique control words (U << W), holding the full C-bit horizontal control vector.
Processor Datapath
Directly asserts unencoded control signals across ALU, bus multiplexers, and register latches.
Architectural Mechanics
- Level 1: Micro-Store (ROM):
- Contains words (total number of micro-instructions in all routines).
- Each word does not contain control signals. Instead, it contains a short pointer: the Nano-Address pointing to a unique entry in Level 2, plus next-address sequencing fields.
- Level 2: Nano-Store (NanoROM):
- Contains only the unique horizontal control words actually used by the processor ().
- Each word is bits wide (the full horizontal control width).
For a system with total micro-instructions, unique control vectors, and horizontal control word width :
When , , and :
- Single-Level CM: ().
- Two-Level CM: ().
- Silicon Area Reduction = !
🏭 Real-World Production Context: Modern Microcode Engines
In modern computing, microprogramming is the linchpin enabling the survival and security of the x86 ecosystem:
Real-World CPU Control Unit Hierarchy
How modern processor architectures blend hardwired speed with microcode patchability.
Operating System & BIOS Microcode Update Engine
Linux and Windows kernel loaders apply cryptographically signed Intel/AMD microcode patches directly into CPU SRAM at boot time to patch hardware security vulnerabilities.
Microcode Sequencer ROM (Intel Raptor Lake / AMD Zen 4 MSROM)
Complex x86 instructions (e.g., string copy MOVS, task switch, context save) invoke multi-hundred cycle microcode routines stored in on-die high-density ROM.
Hardwired RISC Execution Core
90%+ of typical application instructions (ADD, MOV, XOR, JMP) bypass the microcode ROM completely, translated by 4-wide hardwired fast-path decoders in 1 cycle.
📐 Numerical Applications & Worked Examples
Example 1: Control Memory Sizing for Horizontal Microprogrammed Processor
Problem Statement
A microprogrammed control unit must support distinct machine instructions. Statistical profiling reveals that each instruction requires an average of micro-operations.
The hardware architecture has the following specifications:
- The system must test distinct status flag conditions for conditional branching.
- The execution datapath requires individual, independent control signals.
- Horizontal microprogramming is employed with a single-address field format for branch control logic.
Determine:
- The total number of words required in Control Memory.
- The number of bits required in the Control Address Register (CAR).
- The bit-width of each field (Control, Condition, Next Address) and the total width of the micro-instruction control word.
- The total capacity of the Control Memory expressed in both bits and Bytes.
Step-by-Step Solution
1. Total Words in Control Memory: The total number of micro-instructions that must be stored across all 256 instruction routines is:
2. Bit-Width of Control Address Register (CAR): To uniquely address memory locations:
3. Field Allocation of the Micro-Instruction Control Word: In a single-address format, the control word consists of three fields:
-
Control Signal Field: Horizontal microprogramming assigns per control signal. For 48 control signals:
-
Condition / Status Select Field: To select one of 16 status flags via a multiplexer:
-
Next Address Field: Must hold a complete Control Memory address to execute conditional branches:
Total Control Word Width:
4. Total Control Memory Capacity:
Example 2: Vertical Microprogramming Grouping & Bit Compression Analysis
Problem Statement
A processor control unit requires distinct control signals. Detailed timing and datapath analysis reveals that these signals can be partitioned into mutually exclusive groups, such that within any group, at most one signal is ever active during any clock cycle.
The number of signals assigned to each group is specified as follows:
| Group | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Number of Signals () |
- Calculate the number of bits required for each group's field in the vertical micro-instruction word (accounting for the inactive / NOP state).
- Calculate the total number of bits required in the vertical control signal field.
- Compare this with the bit requirement of a pure horizontal control field, and determine the bit compression ratio achieved by vertical encoding.
Step-by-Step Solution
1. Bit Width Derivation per Group: Each group of signals requires an idle state (NOP), requiring bits:
- Group :
- Group :
- Group :
- Group :
- Group :
- Group :
- Group :
- Group :
- Group :
- Group :
2. Total Vertical Control Field Width: Sum the bits across all 10 encoded groups:
3. Compression Comparison:
-
Horizontal Control Width:
-
Bit Reduction:
-
Compression Ratio:
Vertical microprogramming achieves a reduction in the control field width, drastically shrinking control memory silicon footprint at the expense of adding ten small decoders () at the output stage.
Example 3: Microinstruction Field Allocation & CAR Sizing
Problem Statement
A processor architecture has the following two microprogrammed control unit design specifications:
Part A: A CPU executes an instruction set of instructions, where every instruction requires exactly clock cycles to execute. The control unit must generate distinct control signals. A horizontal microprogrammed control unit is designed using a single-address field format for branch control logic. Calculate the minimum size of the Control Word and the Control Address Register (CAR).
Part B: The microinstructions stored in the control memory of a processor have a total width of . Each microinstruction is divided into three fields:
- A micro-operation field of .
- A next-address field of .
- A MUX select field of .
There are status bits connected to the inputs of the condition multiplexer. Calculate the values of and , and determine the maximum size of the Control Memory in number of words.
Step-by-Step Solution
Part A Solution:
-
Calculate total micro-instructions across all routines:
-
Calculate CAR width: Since :
-
Calculate Control Word width: Horizontal microprogramming uses per control signal (), and the single-address field matches the CAR width ():
The minimum size of the Control Word is , and the Control Address Register is .
Part B Solution:
-
Determine MUX select field (): The condition multiplexer selects among status bits:
-
Determine next-address field (): The total microinstruction width is 26 bits:
-
Determine Control Memory size in number of words: With an address field of , the control memory can address:
Summary of Part B: , , and Control Memory size is .
🎯 Exam & Interview Pitfall Check
-
Why is an extra NOP state strictly mandatory when grouping control signals in vertical microprogramming?
- In any given clock cycle, a particular functional group (e.g., ALU operations or Memory write operations) might not need to perform any action at all. If a field of signals is encoded using bits without an idle code, the decoder will constantly assert one of the control signals in every cycle, causing catastrophic unintended hardware operations. The state allows code to represent "No Operation (NOP)".
-
What is the functional difference between the Program Counter (PC) and the Control Address Register (CAR)?
- The Program Counter (PC) holds the main memory address of the next machine instruction (macro-instruction) in the user's program. The Control Address Register (CAR) holds the internal Control Memory (ROM) address of the next micro-instruction within the microcode routine executing the current machine instruction.
-
How does Nano-programming achieve such dramatic memory savings in complex processors?
- In CISC processors with wide control words (), most micro-instructions repeat identical control combinations. Nano-programming separates sequencing from control pattern generation: Level 1 (ROM) stores only short pointers (nano-addresses) and branch targets, while Level 2 (NanoROM) stores a single master copy of each unique horizontal control vector, eliminating repetitive wide-word storage.
- Trap 1: Forgetting to add 1 for NOP when calculating vertical field bit-widths.
- If a group has signals, calculating is incorrect! Eight signals plus one NOP state equals states, which requires . Forgetting the NOP state is the single most common numerical error in control unit examinations.
- Trap 2: Confusing microcode patchability with software application execution.
- While microcode can be updated by OS kernel patches to fix CPU hardware errata, microcode does not execute out of standard DRAM main memory. It is loaded into high-speed on-die static RAM (SRAM) registers within the CPU control unit that intercept instruction decoding.
- Trap 3: Assuming vertical microprogramming allows multiple signals from the same group to be active simultaneously.
- By definition, a single -bit field decoded by an binary decoder can activate at most one output line at any time. If two control signals must ever be asserted in the same clock cycle, they cannot be placed in the same vertical group!