Control Unit Design & RISC vs CISC
Hardwired vs Microprogrammed Control Units, Horizontal vs Vertical Microprogramming, RISC vs CISC comparison
- Understand Hardwired control unit design (Combinational logic & State tables)
- Master Microprogrammed control units, Control Memory, and Microinstructions
- Differentiate Horizontal and Vertical microprogramming schemes
- Perform complete architectural comparison between RISC and CISC
π― Weightage: 5.2% β Compact but conceptually dense; hardwired vs microprogrammed CU is a recurring theory favorite.
1 Instruction Types
1.1 Instruction Register (IR) Role
- The Instruction Register (IR) holds the currently fetched instruction, which the Control Unit (CU) decodes to determine what operation to perform.
- The CU examines the opcode bits in IR (and often a special mode/identifier bit) to decide the instruction category and generate the appropriate sequence of control signals.
1 ββββββββββββββββββββββββββββ2 β Instruction Register β3 β (holds current instr.) β4 βββββββββββββββ¬βββββββββββββββ5 βΌ6 ββββββββββββββββββββββββββββ7 β Control Unit (CU) β8 β Decodes opcode β generates β9 β control signals in sequenceβ10 ββββββββββββββββββββββββββββ1.2 Categorization of Instructions
| Category | Description | Identifying Bit Pattern (typical) |
|---|---|---|
| π΅ Memory-Reference Instructions | Operate on data stored in MEMORY (e.g., LOAD, STORE, ADD from memory) | Opcode β 111 (in classic Basic Computer design) |
| π’ Register-Reference Instructions | Operate entirely WITHIN CPU registers (e.g., clear AC, complement AC, increment AC) β no memory access | Opcode = 111 AND leftmost bit of address field (I bit) = 0 |
| π‘ I/O Instructions | Handle communication with input/output devices (e.g., input character, output character, check flags) | Opcode = 111 AND leftmost bit of address field (I bit) = 1 |
π£ This 3-way classification is based on the classic "Basic Computer" model (Mano's design) β a very frequently referenced teaching model in COA syllabi.
1.3 Memory Reference Instruction Format & Execution
1βββββ¬βββββββββββ¬βββββββββββββββββββββ2β I β Opcode β Address (Operand) β3βββββ΄βββββββββββ΄βββββββββββββββββββββ4 1-bit 3-bit 12-bit (example widths)- I bit (Indirect bit): If I = 0 β Direct addressing (address field IS the operand address); If I = 1 β Indirect addressing (address field points to a location holding the real operand address).
- Execution sequence for a memory-reference instruction (e.g.,
ADD):
1 1. Fetch instruction into IR (using PC, MAR, MBR)2 2. Decode opcode β identify it as a memory-reference instruction3 3. If I = 1: perform indirect step β fetch the effective address from memory4 4. Compute/obtain Effective Address (EA)5 5. Fetch operand from Memory[EA]6 6. Execute the operation (e.g., AC β AC + Memory[EA])### β οΈ Common Traps & Exam Tips - π Register-Reference and I/O instructions do NOT need an Effective Address computation β since they operate on registers/devices directly, not memory; only Memory-Reference instructions need the extra indirect/EA step. - π In the classic Basic Computer model, the Opcode = 111 pattern is the SHARED signal for BOTH Register-Reference and I/O instructions β the I bit (not opcode) is what further distinguishes between them. This is a very common point of confusion. - π The I bit governs INDIRECT vs DIRECT addressing ONLY for memory-reference instructions β don't confuse its role there with its (different) role of distinguishing register-reference vs I/O instructions when opcode = 111.
2 Hardwired & Microprogrammed Control Unit
2.1 Hardwired Control Unit
- Control signals are generated using fixed combinational logic circuits (AND/OR gates, decoders, flip-flops) wired directly to produce the correct signal sequence for each instruction.
- Two common design approaches:
- State Table / Sequence Counter Based: A counter (sequence counter, SC) steps through a fixed sequence of states (T0, T1, T2, ...), and combinational logic maps
(current state + opcode + flags)β control signals. - Combinational Logic Based: Control outputs are directly derived from Boolean equations involving the opcode bits, timing signals, and status flags β essentially a big combinational circuit with no explicit stored "program."
1ββββββββββββββ ββββββββββββββββββββββββββ2β Opcode ββββββΊβ β3β Timing (T0..Tn)βββΊβ Combinational Logic ββββββΊ Control Signals4β Flags ββββββΊβ (AND/OR gates, decoders) β5ββββββββββββββ ββββββββββββββββββββββββββ2.2 Microprogrammed Control Unit
- Control signals are generated by executing a "microprogram" stored in a special, fast memory called Control Memory (CM) β each control signal pattern for one micro-step is called a microinstruction.
- Control Memory (CM): A ROM/fast memory holding all microinstructions for every machine instruction supported.
- Microinstruction Format: Typically contains control-signal bit fields + a next-address field (to determine which microinstruction executes next β supports branching within the microprogram).
1βββββββββββββββββββββββββββββββ2β Control Memory (CM) β3β βββββββββββββββββββββββββ β4β β Microinstruction 1 β β5β β Microinstruction 2 β β6β β ... β β7β βββββββββββββββββββββββββ β8ββββββββββββββββ¬βββββββββββββββββ9 βΌ10 Control Address Register (CAR)11 β12 βΌ13 Decoded β Control Signals2.3 Horizontal vs Vertical Microprogramming
| Feature | π¦ Horizontal Microprogramming | π§ Vertical Microprogramming |
|---|---|---|
| Encoding | Minimal/no encoding β each bit directly controls ONE signal | Highly encoded β bits are grouped and DECODED to produce signals |
| Microinstruction word length | Longer (wide word, one bit per control line) | Shorter (compact, encoded fields) |
| Parallelism | High β multiple control signals can be activated simultaneously | Low β typically only one operation specified per microinstruction (needs decoding, less parallelism) |
| Speed | Faster execution (no decoding delay) | Slower (decoding logic adds delay) |
| Control Memory size | Larger (wide words) | Smaller (narrow, compact words) |
| Flexibility/complexity | Simpler to design conceptually, but hardware-heavy | More complex decode hardware, but memory-efficient |
2.4 Detailed Comparison: Hardwired vs Microprogrammed CU
| Feature | β‘ Hardwired CU | πΎ Microprogrammed CU |
|---|---|---|
| Speed | Faster (direct combinational logic, no memory lookup) | Slower (control memory access adds delay) |
| Flexibility | Low β modifying control logic requires REDESIGNING circuits | High β modifying control logic means simply REWRITING microprogram in CM |
| Cost | Cheaper for simple/small instruction sets | More expensive (needs control memory hardware) but economical for complex/large instruction sets |
| Design Complexity | Complex to design for large instruction sets (logic explosion) | Simpler, systematic design even for large/complex instruction sets |
| Ease of Modification | Difficult (hardware change needed) | Easy (just update microcode/firmware) |
| Best suited for | RISC processors (few, simple instructions, need for speed) | CISC processors (many, complex instructions, need for flexibility) |
Solved Numericals
Q1. A control memory has 2048 microinstructions, each 20 bits wide. Find the size of the control address register (CAR) and total control memory size in bits.
Solution
: CAR width = logβ(2048) = 11 bits Total CM size = 2048 Γ 20 = 40,960 bits (40 Kbits)
Q2. A microinstruction has the following fields: Control signals = 12 bits, Next-address field = 8 bits, Condition-select field = 2 bits. Find the total microinstruction word length.
Solution
: Total = 12 + 8 + 2 = 22 bits
Q3. A CPU supports 64 machine-level instructions, each requiring an average of 10 microinstructions. Estimate the minimum number of words needed in Control Memory.
Solution
: Total microinstructions β 64 Γ 10 = 640 words (minimum CM capacity needed, ignoring shared/reused microroutines)
Q4. If the Control Memory in Q3 has 640 words, how many bits are needed for the Control Address Register (CAR)/Next-address field to address all of them?
Solution
: Bits needed = βlogβ(640)β = β9.32β = 10 bits
Q5. A horizontally microprogrammed CU has 40 independent control signals (1 bit each, unencoded). Find the minimum microinstruction width required for the control-signal portion.
Solution
: Since horizontal microprogramming uses ONE bit per signal (no encoding), width = 40 bits
Q6. The same 40 control signals are grouped into 8 mutually-exclusive groups of 5 signals each (only 1 signal active per group at a time) using vertical (encoded) microprogramming. Find the minimum control-signal field width needed.
Solution
: Each group of 5 mutually exclusive signals needs logβ(5) β 3 bits (to encode 5 possibilities, needs βlogβ5β=3 bits) per group. Total width = 8 groups Γ 3 bits = 24 bits (a significant reduction from 40 bits in horizontal encoding β demonstrating vertical microprogramming's compactness).
### β οΈ Common Traps & Exam Tips - π CAR (Control Address Register) width = logβ(Number of Microinstructions) β directly parallels the address-line formula from memory chip design (Chapter 9.2) β same underlying math, different context. - π Horizontal = wide + fast + unencoded; Vertical = narrow + slower + encoded β a frequently tested direct-opposite pairing; remember "Horizontal" sounds "wide" (like a horizontal line spanning many bits). - π Hardwired CU is preferred for speed-critical, simple instruction sets (RISC); Microprogrammed CU is preferred for flexible, complex instruction sets (CISC) β this pairing connects directly to the RISC vs CISC discussion in Section 3.
3 RISC vs CISC Architecture
3.1 Full Detailed Comparison
| Feature | π© RISC (Reduced Instruction Set Computer) | π₯ CISC (Complex Instruction Set Computer) |
|---|---|---|
| Instruction set size | Small, simple instruction set | Large, complex instruction set |
| Addressing modes | Few (simple) addressing modes | Many, complex addressing modes |
| Instruction format | Fixed-length, uniform format | Variable-length, non-uniform format |
| Execution model | Register-to-register (LOAD/STORE architecture β only LOAD/STORE access memory) | Memory-to-memory operations directly permitted in many instructions |
| CPI (Cycles Per Instruction) | Low, typically close to 1 (ideal for pipelining) | Higher, varies significantly per instruction (some complex instructions take many cycles) |
| Pipelining suitability | Excellent β uniform instruction format & simple decode make deep pipelining easy | Poor β variable-length/complex instructions complicate pipelining |
| Hardware complexity | Simpler hardware/control unit (often hardwired CU) | Complex hardware/control unit (often microprogrammed CU) |
| Software/Compiler complexity | Compiler does MORE work (must generate more instructions for complex operations) | Compiler does LESS work (can use single complex instructions directly) |
| Number of registers | Typically MORE general-purpose registers | Typically FEWER general-purpose registers |
| Code size (program length) | Larger (more instructions needed per task) | Smaller (fewer, denser instructions per task) |
| Examples | MIPS, ARM, RISC-V, SPARC, IBM 801 (historical pioneer) | Intel x86, VAX, Motorola 68000 |
3.2 Historical Context and Modern Relevance
- CISC emerged first (1960sβ70s) β the philosophy was to make instructions do MORE work per instruction, reducing the number of instructions per program, since memory was slow/expensive and reducing memory traffic mattered greatly.
- RISC emerged (late 1970sβ80s, pioneered by IBM 801 β recall from Chapter 9.4) as a reaction: with faster memory and the rise of pipelining/compiler optimization, a SIMPLER, uniform, pipeline-friendly instruction set could achieve HIGHER overall performance despite needing more instructions per task.
- Modern relevance: Most modern processors are hybrids β e.g., modern x86 CPUs (CISC ISA) internally translate/decode complex instructions into simpler RISC-like micro-operations (micro-ops) that are then pipelined/executed using RISC-style internal hardware β blending the code-density benefits of CISC with the pipelining/performance benefits of RISC.
- ARM (RISC-based) dominates mobile/embedded computing due to its power efficiency and simple, pipeline-friendly design; x86 (CISC-based, internally RISC-like) still dominates desktop/server computing due to decades of software compatibility.
### β οΈ Common Traps & Exam Tips - π RISC = LOAD/STORE architecture β only LOAD and STORE instructions access memory; ALL other operations work purely on registers β a defining, frequently tested characteristic. - π CPI ranking: RISC generally has LOWER, more UNIFORM CPI (ideal β 1); CISC has HIGHER, more VARIABLE CPI β directly tested alongside pipelining-suitability questions. - π Don't assume "RISC = always fewer total instructions in a program" β it's the OPPOSITE: RISC programs typically need MORE instructions (since each does less), but execute them FASTER overall due to pipelining efficiency and low CPI. - π Modern CPUs are rarely "pure" RISC or CISC β remember the hybrid fact: x86 (CISC ISA) uses RISC-style micro-ops internally β a commonly tested "trick" fact in advanced conceptual questions.
Quick Revision Summary
1βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ2 INSTRUCTION CATEGORIES (Basic Computer Model)3 Memory-Reference β Opcode β 111 (needs EA computation, I-bit = direct/indirect)4 Register-Reference β Opcode = 111, I-bit = 05 I/O Instruction β Opcode = 111, I-bit = 16
7 CONTROL UNIT DESIGN FORMULAS8 CAR width (bits) = logβ(Number of Microinstructions)9 Total Control Memory = Number of Microinstructions Γ Microinstruction Width10 Horizontal ΞΌprog width = 1 bit per independent control signal (unencoded)11 Vertical ΞΌprog width = logβ(signals per mutually-exclusive group), summed per group (encoded)12
13 HARDWIRED vs MICROPROGRAMMED14 Hardwired β Faster, Cheaper (simple ISA), Hard to modify β suits RISC15 Microprogrammed β Slower, Costlier, Easy to modify β suits CISC16
17 RISC vs CISC18 RISC β Small fixed instructions, LOAD/STORE only, CPIβ1, great pipelining, more registers19 CISC β Large variable instructions, memory-to-memory ops, high/variable CPI, poor pipelining20βββββββββββββββββββββββββββββββββββββββββββββββββββββββββKey Conceptual Recap
- IR holds the current instruction; CU decodes it into Memory-Reference, Register-Reference, or I/O categories (classic Basic Computer model: opcode 111 splits into Register-Reference/I-O via the I-bit).
- Hardwired CU: fixed combinational logic, fast, cheap for simple ISAs, hard to change β natural fit for RISC.
- Microprogrammed CU: control memory + microinstructions, flexible, easy to update, natural fit for CISC.
- Horizontal microprogramming: wide, unencoded, fast, parallel; Vertical microprogramming: narrow, encoded, slower, more compact.
- RISC vs CISC: RISC = simple/uniform/fast-pipelined/LOAD-STORE-only/low CPI; CISC = complex/variable/memory-to-memory/high CPI β modern CPUs blend both (CISC ISA + RISC-style internal micro-ops).
Mastery check
How well can you recall this?
Finished this lesson?