Skip to content
GATEiit

GATE CSE · Computer Organization and Architecture

Design of control unit: hardwired and microprogrammed

How the control unit generates control signals: micro-operations of the instruction cycle, hardwired control, microprogrammed control, horizontal and vertical microinstructions, and the control-word and control-memory size calculations GATE asks.

Before you start

This topic comes before: I/O interface: interrupt and DMA

Concept notes

1. Micro-operations and the instruction cycle

The control unit (CU) issues control signals (register load enables, ALU function selects, memory read and write, bus gates) in the right order. Each clock step performs one or more micro-operations, register transfers such as MAR←PC.

The instruction cycle is fetch, decode, operand fetch, execute, write back (and an interrupt check). A typical fetch on a machine with a memory address register (MAR) and memory data register (MDR):

Step Micro-operations
T0 MAR←PC
T1 MDR←M[MAR], PC←PC+1
T2 IR←MDR

Micro-operations can share a step only if they do not conflict: they must not need the same bus or register in the same cycle, and one must not need a value the other is still producing. PC←PC+1 fits in T1 because the PC has already been copied into MAR.

The CU's inputs are the opcode in IR, the step (timing) signal, status flags and external signals such as interrupts. Its outputs are the control signals. There are two ways to build it: hardwired and microprogrammed.

2. Hardwired control

A hardwired control unit generates control signals with fixed combinational logic.

  • A step (sequence) counter counts clock cycles within an instruction. A k-bit counter feeding a k-to-2k decoder gives timing signals T0,…,T2k−1.
  • An opcode decoder turns the opcode into one line per instruction.
  • Each control signal is a sum-of-products of timing lines, opcode lines and flags, for example PCinc=T1 or ALUadd=T3⋅ADD.
  • At the end of an instruction the counter is cleared.

Strengths: fastest possible signal generation; small for a simple instruction set. Weaknesses: the logic must be redesigned to change or add instructions; it becomes complex for large, irregular instruction sets.

RISC processors, with few simple fixed-format instructions, are usually hardwired.

3. Microprogrammed control

A microprogrammed control unit stores control words in a control memory (usually ROM). Each word is a microinstruction; the microinstructions for one machine instruction form its microroutine. All microroutines together are the microprogram (firmware).

Parts:

  • Control address register (CAR), also called the micro-PC: address of the next microinstruction.
  • Mapping logic: turns the opcode into the start address of its microroutine.
  • Sequencer: chooses the next CAR value: CAR + 1, a branch address from the microinstruction (if the selected condition holds), the mapped opcode address, or a return address.

A microinstruction typically has three fields: control signals  ∣  condition select  ∣  next address

  • Next address needs ⌈log⁡2W⌉ bits for a control memory of W words.
  • Condition select picks one of c branch conditions (often including “always”), needing ⌈log⁡2c⌉ bits.

Control memory size =W×(word width) bits.

Changing an instruction means changing ROM contents, not logic, so microprogramming suits large CISC instruction sets. It is slower because every step needs a control memory read.

Opcode in IRMapping logicSequencer(next-address MUX)CAR (micro PC)Control memory (ROM)Status flagscontrol signalsnext addr
Microprogrammed control unit: the sequencer loads CAR, control memory outputs signals and the next address

4. Horizontal and vertical microinstructions

Horizontal microinstructions use one bit per control signal. Any combination of signals can be active together, so parallelism is maximum and no decoding is needed, but words are wide.

Vertical microinstructions encode groups of signals. Signals that are never active together (mutually exclusive, for example the ALU's add, subtract and AND) form a group. A group of n signals is encoded in a field of ⌈log⁡2(n+1)⌉ bits when the field also needs a “no signal” code, or ⌈log⁡2n⌉ bits when one of the n is always active. Read the question to see which applies. Each field drives a decoder, so words are narrow but there is a decoding delay and less parallelism.

Horizontal Vertical
Control field 1 bit per signal encoded fields
Word width large small
Parallel signals any combination one per group
Decoding hardware none decoder per field
Speed faster slower

Hardwired vs microprogrammed

Hardwired Microprogrammed
Speed faster slower (control memory read)
Changing instructions redesign logic rewrite microcode
Suits RISC, simple ISA CISC, large ISA
Design cost for complex ISA high lower

Formulas to remember

Next-address fieldW = number of words in control memory
⌈log⁡2W⌉
Horizontal microinstruction widths control signals, c selectable conditions
w=s+⌈log⁡2c⌉+⌈log⁡2W⌉
Vertical field for a group of n signalsUse ⌈log⁡2n⌉ if the field never needs a no-signal code
⌈log⁡2(n+1)⌉
Control memory size
W×w bits
Timing signals from a k-bit step counter
2k

Common mistakes

  • Forgetting the “always” or “none” code when sizing a condition or encoded field.
  • Using log⁡2n for an encoded group when the question needs a no-signal code, or the reverse; read which applies.
  • Leaving out the next-address field when computing the microinstruction width.
  • Saying microprogrammed control is faster; every step costs a control memory read.
  • Placing two micro-operations in one step when one depends on the other's result.

Worked examples

Try each step yourself, then reveal the working.

Example 1: Width of a horizontal microinstruction

numerical

A microprogrammed CPU has 40 control signals, a control memory of 1024 words, and can branch on any one of 7 status flags or unconditionally. Microinstructions are horizontal, with fields for control signals, condition select and next address. Find the microinstruction width and the control memory size in bits.

  1. Step 1: Size the control field.

    Try it on paper first.

Example 2: Saving bits with vertical encoding

numerical

31 control signals fall into four mutually exclusive groups of sizes 4, 9, 15 and 3. In each group at most one signal is active, and it may be that none is. How many bits does the control field need with vertical encoding, compared with horizontal?

  1. Step 1: How many codes does a group of n signals need?

    Try it on paper first.

Example 3: Size of the control memory address

numerical

A CPU has 64 machine instructions. Each has its own microroutine of 6 microinstructions, and all share a fetch microroutine of 4 microinstructions. How many bits does the next-address field need?

  1. Step 1: Count the microinstructions.

    Try it on paper first.

Example 4: Which micro-operations can share a step?

conceptual

In the fetch sequence, why can PC←PC+1 run in the same step as the memory read MDR←M[MAR], but IR←MDR cannot?

  1. Step 1: What does the memory read depend on?

    Try it on paper first.

Previous year questions

2 official GATE CSE questions on this topic, newest first.

Practise these 2 PYQs →

Topic test

10 questions: up to 2 official PYQs and original practice questions, with GATE marking (MCQ wrong answers lose marks). Score 60% or more to pass. A new set is drawn each time.

Mark as mastered

Loading your progress…

My revision notes

Notes written by the GATEiit team against the official GATE CSE syllabus; being checked by a reviewer. Updated 2026-11-21. Spotted a mistake? Use Report an issue on any question, or contact us.