Control Unit

Hardwired vs microprogrammed control units—the brain that orchestrates the CPU.

The control unit is the conductor of the CPU orchestra. It reads the current instruction from the instruction register, decodes the opcode, and generates the sequence of control signals that direct data through the ALU, registers, and memory. There are two main approaches: hardwired control (fast, built from combinational logic) and microprogrammed control (flexible, using a lookup table in ROM).

Objectives

  • Explain the role of the control unit in the CPU datapath
  • List the control signals for a simple CPU (ALU op, register write, memory read/write, MUX selects)
  • Design a hardwired control unit using combinational logic
  • Design a microprogrammed control unit using a control ROM
  • Compare hardwired vs microprogrammed approaches

Key Takeaways

  • Control unit generates signals that direct data flow through the CPU
  • Hardwired: combinational logic from opcode → fast but inflexible
  • Microprogrammed: ROM-stored sequences → flexible but slower
  • Each instruction requires a specific set of control signal values
  • RISC CPUs favor hardwired; complex CISC CPUs use microprogramming

Applications

  • RISC-V Control: Simple hardwired control for the open-source RISC-V ISA.
  • x86 Microcode: Intel/AMD CPUs use microcode to implement complex x86 instructions.
  • Microcode Updates: CPU firmware patches can fix bugs by updating microcode ROM.
  • CPU Emulation: Microprogrammed control enables one CPU to emulate another's ISA.

Practice Problems

Problem 1: For an ADD R1, R2, R3 instruction, what control signals are needed?

Problem 2: LOAD R1, [R2] needs how many cycles in a multi-cycle CPU?

Problem 3: Why is hardwired control faster than microprogrammed?

Problem 4: A CPU has 32 control signals. How wide is each microinstruction word in horizontal microprogramming?