BIT151 Microprocessor and Computer Architecture

Microprocessor and Computer ArchitectureUnit 49 min read

Control Unit Design: Hardwired vs. Microprogrammed Control

Unit 4 of Microprocessor and Computer Architecture explores how control units execute instructions—either through hardwired logic (fast, fixed) or microprogrammed control (flexible, software-like). Learn their architectures, advantages, and real-world trade-offs in processors like 8085, with visual comparisons and exam

TAKEAWAYS:

  • Control units decode and execute instructions via hardwired logic (combinational circuits) or microprogrammed control (stored microinstructions in ROM).
  • Hardwired control is faster but less flexible; microprogrammed control is slower but easier to modify for new instructions.
  • The 8085 microprocessor uses a hardwired control unit with functional units like ALU, registers, and a 3-state bus interface.
  • Microinstructions in microprogrammed control break down complex instructions into smaller steps stored in Control ROM (CR-ROM).
  • Control signals (e.g., MEMW, IORQ) coordinate data flow between CPU, memory, and I/O devices in both designs.
  • Exam focus: Draw block diagrams, compare designs in tables, and explain how microprogramming simplifies complex instruction sets.

What is a Control Unit?

The control unit (CU) is the "brain" of the CPU that:

  • Fetches instructions from memory.
  • Decodes them into control signals.
  • Coordinates data movement between ALU, registers, memory, and I/O.
  • Manages the clock cycle and instruction pipeline.

Without the CU, the CPU would be a collection of disconnected components—no program could run!

How Instructions Flow

sequenceDiagram
    participant CU as Control Unit
    participant PC as Program Counter
    participant IR as Instruction Register
    participant MU as Memory Unit
    participant ALU as ALU
    CU->>PC: Fetch next address
    PC->>MU: Send address
    MU-->>IR: Return instruction (e.g., "ADD B")
    IR->>CU: Decode instruction
    CU->>ALU: Send control signals (e.g., "Add A and B")
    ALU-->>CU: Return result
    CU->>MU: Write result to memory

1. Hardwired Control Unit

Hardwired control uses combinational logic circuits (AND, OR, NOT gates) to generate control signals directly from the opcode of an instruction.

Block Diagram of Hardwired Control Unit

Key Components

Component Function
Instruction Register (IR) Holds the current instruction opcode.
Decoder Converts opcode into a unique binary pattern.
Control Logic Combinational circuits (gates) generate control signals for each opcode.
Control Signals Signals like ALUOp, MemRead, IORQ control data flow.

Advantages

  • Speed: No extra memory access (microinstructions are hardwired).
  • Simplicity: Direct mapping from opcode to control signals.
  • Lower Power: No need for additional memory (ROM) to store microprograms.

Disadvantages

  • Rigid: Changing instruction set requires rewiring the control logic.
  • Complex: Designing control signals for complex instructions is error-prone.
  • No Flexibility: Cannot support new instructions without hardware changes.

Example: 8085 Hardwired Control

The 8085 microprocessor uses a hardwired control unit to generate signals like:

  • HLT (Halt)
  • INTR (Interrupt Request)
  • ALE (Address Latch Enable)
  • WR (Write)

2. Microprogrammed Control Unit

Microprogrammed control uses a Control ROM (CR-ROM) to store microinstructions that break down complex instructions into smaller steps.

Block Diagram of Microprogrammed Control Unit

Key Components

Component Function
Control ROM (CR-ROM) Stores microinstructions (firmware) for each opcode.
Microaddress Register Holds the address of the next microinstruction.
Microinstruction Register Holds the current microinstruction being executed.
Microsequencer Generates the next microaddress (sequential or conditional).

Microinstruction Format

A microinstruction typically includes:

  1. Control Field: Signals for ALU, registers, memory (e.g., Add A and B).
  2. Next Microaddress Field: Address of the next microinstruction (for sequencing).

Example Microinstruction Format:

| 15 bits (Control Signals) | 11 bits (Next Microaddress) |

Comparison: Hardwired vs. Microprogrammed Control

Feature Hardwired Control Microprogrammed Control
Speed Faster (direct logic) Slower (ROM access delay)
Flexibility Rigid (hardware changes needed) Flexible (software-like changes)
Complexity High (manual design of control logic) Lower (microprogramming abstracts details)
Power Consumption Lower Higher (extra memory access)
Cost Lower (no ROM) Higher (requires CR-ROM)
Example Use Case 8085, early CPUs Modern CPUs (e.g., x86 for complex ops)

How Microprogramming Works: A Worked Example

Problem: Execute ADD B in 8085

Assume the 8085 uses microprogramming (simplified for explanation).

Step 1: Fetch the Instruction

  1. PC sends address to memory.
  2. Memory returns ADD B (opcode 00000100).
  3. IR loads 00000100.

Step 2: Microprogrammed Execution

The microprogram for ADD B might look like this (stored in CR-ROM):

Microinstruction Control Signals Next Address
1 Load B into ALU input 2
2 Add A and B (ALUOp=ADD) 3
3 Store result in A 4
4 Increment PC 5 (end)

Trace:

  1. Microaddress 0: Start (loaded by opcode decoder).
  2. Microaddress 1: Load B into ALU input.
  3. Microaddress 2: ALU performs A + B.
  4. Microaddress 3: Write result back to A.
  5. Microaddress 4: Increment PC to fetch next instruction.

In the Real World

  1. eSewa (Nepal)

    • Idea Used: Microprogrammed Control in Payment Processing
    • When you pay a bill via eSewa, the backend server’s CPU uses a microprogrammed control unit to execute complex financial transactions (e.g., deducting from your wallet, updating the merchant’s account). Microprogramming allows the system to handle variable transaction types (e.g., electricity, phone recharge) without hardware changes.
  2. WhatsApp (Global)

    • Idea Used: Hardwired Control for Real-Time Messaging
    • WhatsApp’s servers use hardwired control units in their CPUs to process millions of messages per second. The speed of hardwired logic ensures low latency in delivering messages globally. For example, when you send a photo, the CPU’s hardwired control unit quickly manages:
      • Data fetching from memory.
      • Compression/decompression signals.
      • Network I/O control signals (IORQ).
  3. NTC (Nepal Telecom) Network Routers

    • Idea Used: Microprogrammed Control for Routing Protocols
    • NTC’s routers use microprogrammed control units to execute dynamic routing algorithms (e.g., OSPF, BGP). When a new route is discovered, the microprogrammed CU can update the routing table without changing hardware, making the network adaptable to failures or new connections.

Exam Tip: How to Score Full Marks

  1. Draw Block Diagrams Clearly

    • Label every component (e.g., IR, Decoder, CR-ROM).
    • Use arrows to show data flow (e.g., IR → Decoder → Control Signals).
    • Example: For hardwired control, show the combinational logic block explicitly.
  2. Compare Hardwired vs. Microprogrammed in Tables

    • Examiners love structured comparisons. Use the table above as a template.
    • Highlight trade-offs (e.g., "Hardwired is faster but rigid").
  3. Explain Microinstructions Step-by-Step

    • For questions like "Explain microprogrammed control," break it into:
      • Fetch microinstruction from CR-ROM.
      • Execute control signals.
      • Generate next address (sequential or conditional).
  4. Relate to 8085

    • If asked about 8085 control unit, mention:
      • It uses hardwired control.
      • Key signals: HLT, INTR, ALE.
      • No microprogramming (unlike modern CPUs).
  5. Avoid Vague Statements

    • ❌ "Microprogramming is better."
    • ✅ "Microprogramming is better for flexibility (e.g., adding new instructions) but slower due to ROM access."

Based on the TU BIT syllabus for Microprocessor and Computer Architecture (BIT151), unit 4.

Discussion

Loading…