Hardwired vs Microprogrammed Control Unit for GATE: Microinstruction Sizing Numericals Solved

Separate the qualitative comparison from the sizing numerical. Two worked control-store examples show exactly where every microinstruction bit comes from.

KnowledgeGate Team

Exam prep & CS education

Updated 22 Jul 20267 min read

Control-unit questions have two halves. The first asks whether hardwired or microprogrammed control is faster and easier to modify. The second gives signal counts and control-memory words, then asks you to size every field.

The numerical becomes straightforward once you refuse to jump to a logarithm too early. First identify the control, condition-select and next-address fields, then size each from the count it represents.

1. What the control unit does

The datapath contains registers, buses, the ALU and the paths that move values among them. The control unit tells it what to do in each clock step: select an ALU operation, load a register, place a register on a bus, start a memory read, or choose the next state.

An instruction therefore expands into a sequence of smaller control steps. An add might fetch the instruction, decode it, read operands, select addition in the ALU and write the result, with the control unit generating the right signals at every step.

There are two broad implementation styles:

  • Hardwired control derives the signals through fixed sequential logic.

  • Microprogrammed control reads encoded control steps, called microinstructions, from control memory.

Instruction encoding sits around this machinery: Addressing Modes and Instruction Formats bridges the instruction a programmer writes and the control actions inside the processor.

2. Hardwired versus microprogrammed control

Hardwired control unit

A hardwired controller uses gates, decoders, flip-flops and a state counter or state machine. The current instruction, timing state and condition flags feed combinational logic that produces control signals.

Its strengths are speed and directness. There is no control-memory access before the signals are available. Its weakness is rigidity. Changing the instruction behaviour can require redesigning the logic, and a large irregular instruction set can make that logic difficult to manage.

Hardwired control is commonly associated with RISC-style designs, whose regular instructions suit fixed logic. Treat that as an association, not a rule that classifies every real processor.

Microprogrammed control unit

A microprogrammed controller stores control words in a control memory. A microprogram counter selects a microinstruction, its control field drives the datapath, and its sequencing fields choose the next microinstruction.

Changing microcode changes the control sequence without rebuilding fixed logic, which is why microprogrammed designs are easier to modify. The trade-off is the control-store read and any decoding before signals reach the datapath. The association here is with CISC-style instruction sets, whose instructions need longer and less regular sequences.

Hardwired vs microprogrammed at a glance

Property

Hardwired

Microprogrammed

Signal generation

Fixed sequential logic

Microinstructions read from control memory

Speed

Faster, nothing to read first

Pays a control-store access, plus any decoding

Changing instruction behaviour

Redesign the logic

Rewrite the microcode

Irregular instruction sets

Logic becomes hard to manage

Absorbed as longer microprograms

Typical association

RISC-style designs

CISC-style designs

The one-line memory hook: hardwired favours speed, microprogrammed favours flexibility. Pipeline control adds another timing dimension, covered in Pipelining in Computer Architecture.

3. Anatomy of a microinstruction

A GATE sizing problem usually exposes three logical fields:

  1. Control field: identifies the datapath control signals to assert.

  2. Condition-select field: identifies which status or condition flag the sequencer should test.

  3. Next-address field: identifies a destination word in control memory.

The total width is:

Microinstruction width = control-field bits + condition-select bits + next-address bits

The counts behind those fields are different. A question may give 100 control signals, 8 flags and 4096 control words. Using log2 100 for every field would mix three unrelated quantities.

Whenever a field must encode N distinct choices, its size is ceil(log2 N) bits. Use the ceiling because a fraction of a bit is impossible. If a single encoded control field also needs a no-operation code, it has N + 1 choices.

4. Horizontal versus vertical microinstructions

In a horizontal microinstruction, the control word has one bit per control signal, and a 1 asserts that signal. Several independent signals can be asserted in the same microinstruction, so horizontal microcode exposes substantial parallelism. It is wide and uses more control memory, but needs little or no decoding.

If there are m control signals:

Horizontal control-field width = m bits

In a vertical microinstruction, signals are encoded. A decoder turns a short code into a selected control action. If all m signals are mutually exclusive and one no-operation code is required:

Vertical control-field width = ceil(log2(m + 1)) bits

That fully encoded model cannot assert two of those mutually exclusive signals at once. Practical formats divide signals into groups, one encoded field per group, so compatible actions can occur together. Follow the grouping the question states rather than assuming one universal format.

Property

Horizontal

Vertical

Control encoding

One bit per signal

Encoded signal or signal group

Word width

Larger

Smaller

Decoder

Little or none

Required

Parallel signal assertion

High

Limited by field grouping

Control memory

Larger

Smaller

Control-path speed

Usually faster

Usually slower due to decoding

5. Two worked microinstruction sizing numericals

Numerical 1: 100 signals, 8 flags, 4096 control words

Suppose a microprogrammed unit has:

  • 100 distinct control signals

  • 8 status flags, with one flag selected for a test

  • 4096 microinstructions in control memory

Start with the fields not affected by horizontal or vertical encoding.

There are 8 possible flags:

Condition-select bits = log2 8 = 3 bits

The control memory has 4096 = 2^12 words:

Next-address bits = log2 4096 = 12 bits

For a horizontal format, one bit represents each of the 100 control signals:

Horizontal control-field width = 100 bits

Horizontal microinstruction width = 100 + 3 + 12 = 115 bits

The whole horizontal control memory is:

4096 words x 115 bits/word = 471,040 bits

Check the multiplication by splitting 115:

4096 x 100 = 409,600

4096 x 15 = 61,440

409,600 + 61,440 = 471,040 bits

For a fully encoded vertical control field, assume all 100 signals are mutually exclusive and include one no-operation code. That creates 101 choices:

Vertical control-field width = ceil(log2 101) = 7 bits

Six bits provide only 64 codes, while seven provide 128, so seven is the minimum.

Vertical microinstruction width = 7 + 3 + 12 = 22 bits

The vertical control memory would be:

4096 x 22 = 90,112 bits

Horizontal words are 115 bits wide and allow direct parallel control. Fully encoded vertical words are only 22 bits wide but require decoding and the stated mutual-exclusion assumption.

a microinstruction split left to right into a control field, condition-select field and next-address field, showing horizontal control = 100 bits and total width 100 + 3 + 12 = 115 bits, vertical control = 7 encoded bits for 101 choices and total width 7 + 3 + 12 = 22 bits, condition select = 3 bits for 1 of 8 flags, next address = 12 bits for 1 of 4096 words, and horizontal control memory = 4096 x 115 = 471,040 bits.

Numerical 2: 64 signals, 16 flags, 2048 control words

Same three fields, different counts. With 16 flags the condition-select field needs log2 16 = 4 bits, and 2048 = 2^11 control words need an 11-bit next-address field.

Horizontal microinstruction width = 64 + 4 + 11 = 79 bits

A fully encoded vertical field covers 64 signals plus one no-operation code, so 65 choices. Six bits give only 64 codes, so the field needs ceil(log2 65) = 7 bits.

Vertical microinstruction width = 7 + 4 + 11 = 22 bits

The two control stores hold 2048 x 79 = 161,792 bits and 2048 x 22 = 45,056 bits. Notice that the vertical control field stayed at 7 bits across both numericals: 65 choices and 101 choices both fall inside the 65-to-128 range that seven bits covers.

6. Traps and how GATE tests control units

  • The next-address field comes from the number of control-memory words, not the number of control signals.

  • An encoded field needs the ceiling of the logarithm. log2 100 is not an integer, so 7 bits is the floor even before a no-operation code enters.

  • When the format requires no-operation as a separate choice, count signals + 1 before taking the logarithm.

  • Do not forget the condition-select field. It is separate from the next address even though both participate in sequencing.

  • Vertical encoding is not automatically superior. It saves memory but adds decoding and can restrict parallel control actions.

  • Control-memory capacity is number of words x bits per word. State the answer in bits unless the question requests bytes.

KnowledgeGate's Computer Organization set runs to more than 1,700 questions, with enough width-and-sizing practice among them to make these traps automatic. Marks and weightage shift from year to year, so take those from the official GATE portal.

7. Short version and next step

Hardwired control is fast and difficult to modify. Microprogrammed control is flexible but pays for a control-store access and possible decoding. For a sizing question, write control + condition select + next address, then calculate each field from its own count.

Set yourself one more: 200 control signals, 4 flags and 1024 control words. Horizontal comes to 212 bits, fully encoded vertical to 20 bits. Once every field is automatic, drill control-unit numericals in the GATE Test Series and use the GATE preparation category to connect control design with the rest of Computer Architecture.