Skip to main content

Computer Organization

Datapath & Control

Know how register file, ALU, and muxes connect — and whether control is hardwired or microcoded.

~3 hrs ~0.5–1 mark · Moderate 10 samples · 10 practice · 10 cards

GATE CSE datapath and control — ALU, register file, buses, multi-cycle timing, hardwired vs microprogrammed control, with samples and drills.

Learning outcomes

  • Describe ALU, register file, mux, and bus roles in a simple datapath
  • Contrast hardwired and microprogrammed control units with horizontal/vertical microcode
  • Explain why a single shared bus serializes transfers into extra clock cycles
  • Connect ALU flags (Z, N, C, V) to conditional branches

Datapath building blocks

  • Datapath = the hardware that stores and transforms data: register file, ALU, muxes, temporary registers, and buses to memory/I/O.
  • ALU performs arithmetic/logic. Its status flags typically include Z (zero), N/S (negative/sign), C (carry), V (signed overflow) — these feed conditional branches and the status word.
  • Register file: array of GPRs with read/write ports. Two read ports + one write port is a common textbook model for R-type ops.
  • Multiplexers choose which source drives an ALU input, a bus, or a register write-back path. Control signals are literally the mux selects and register enables.
  • MAR/MDR interface memory; PC/IR are special-purpose registers still part of the larger datapath story.
BlockRoleTypical control
Register fileHold operands / resultsRegWrite, read/write select
ALUCompute / compareALUOp
MuxRoute one of several inputsSelect lines
BusShared transfer pathBus enable / tri-state
MAR/MDRMemory address / dataMemRead / MemWrite

Worked example

Problem. Why does an R-type ADD need two register reads and one write?

Solution. Two source operands are read from the register file, the ALU adds them, and the destination register is written on write-back — hence two read ports and one write enable.

Datapath blocks register file ALU muxes MAR MDR and control unit
Control signals are literally mux selects and register/memory enables.

Buses, multi-cycle timing & transfers

  • A bus is a shared set of wires. On a single-bus datapath, only one producer can drive the bus at a time — transfers that need two values must be serialized across clocks (or use a temporary register).
  • Multi-bus / multi-port designs allow more parallelism (e.g., two operands onto ALU inputs in one cycle) at higher hardware cost.
  • Multi-cycle CPU: each instruction is broken into steps (fetch, decode, execute, …), each taking one or more clocks. CPI > 1 even without hazards.
  • Control must assert the right enables each cycle: e.g., memory write needs address on MAR, data on MDR, and MemWrite — often over consecutive cycles on a single bus.
  • Temporary registers (A, B, ALUOut in textbook multi-cycle) hold values between steps when the bus is busy.

Worked example

Problem. On a single-bus machine, move R1→R2 and also feed the ALU from R3 in the same cycle — possible?

Solution. Usually not: one bus cannot carry two independent values at once. Expect two cycles or a second bus/port.

Single shared bus forcing serialized register and ALU transfers
One bus → one driver per cycle — two values usually need two clocks.

Hardwired vs microprogrammed control

  • Control unit generates the control signals that steer the datapath each cycle/step.
  • Hardwired control: combinational logic and a finite-state machine built from gates/PLAs — typically faster (no microcode fetch), but painful to modify when the ISA changes.
  • Microprogrammed control: control words live in a control store (microcode memory). A micro-PC sequences microinstructions; changing behaviour often means rewriting microcode.
  • Horizontal microcode: wide words, each bit (or small field) directly drives a control line — flexible parallelism, large store.
  • Vertical microcode: narrower encoded fields that are decoded into control signals — denser store, potentially more decode delay.
  • GATE focus: speed vs flexibility trade-off; “easier to add instructions” almost always points to microprogrammed.
Control styleStrengthTrade-off
HardwiredLow latency / speedHard to change; complex FSM
MicroprogrammedFlexibility / easier ISA editsControl-store access latency
Horizontal microcodeExplicit parallel controlsWide words, large store
Vertical microcodeCompact encodingExtra decode; less explicit

Worked example

Problem. A vendor wants to add a new complex instruction with minimal silicon respins. Prefer hardwired or microprogrammed?

Solution. Microprogrammed — update the control store rather than redesign hardwired FSM logic.

Comparison of hardwired FSM control versus microprogrammed control store
Easier ISA edits almost always points to microprogrammed control.

GATE exam tricks — datapath

  • If two values must cross a single bus, expect at least two cycles (or a structural conflict).
  • Branch-on-zero uses the Z flag from a prior ALU/compare — not from the cache or PC alone.
  • Microprogrammed “easier ISA changes” is a frequent correct option versus hardwired.
  • V flag = signed overflow; C = unsigned carry/borrow — don’t swap them in MCQs.
  • MemRead/MemWrite, RegWrite, ALUSrc, PCSrc-style signals are the vocabulary of datapath control questions.
  • Pipelined datapaths reuse the same blocks with pipeline registers between stages — control becomes per-stage (covered in Pipelining).

Exam tips

  • Single-bus ⇒ serialize transfers.
  • Flags come from ALU, not from PC.
  • Hardwired = speed; microprogrammed = flexibility.
  • Horizontal = wide/explicit; vertical = encoded/narrow.
  • List the enables needed for a memory write before counting cycles.
Exam pattern · 10 questions

GATE sample questions & answers

10 GATE-style MCQs for Datapath & Control with full explanations. Attempt each question before revealing the answer.

Q1 Flags

ALU flags are typically used for:

  • A) Cache tags
  • B) Conditional branches / status
  • C) Disk geometry
  • D) DMA length only
Show answer & explanation

Answer: B

Z/N/C/V feed conditions and status.

Q2 Microprogrammed

Microprogrammed control main advantage:

  • A) Always fastest
  • B) Easier modification / flexibility
  • C) No memory
  • D) No ALU
Show answer & explanation

Answer: B

Change microcode instead of rewiring.

Q3 Hardwired

Hardwired control is generally:

  • A) Slower always
  • B) Faster but less flexible
  • C) Identical to microcode
  • D) Only for I/O
Show answer & explanation

Answer: B

Speed vs flexibility trade-off.

Q4 Mux

A mux in the datapath primarily:

  • A) Adds numbers
  • B) Selects one input onto a path
  • C) Stores microcode
  • D) Refreshes DRAM
Show answer & explanation

Answer: B

Multiplexers route values.

Q5 Bus

Single shared bus often implies:

  • A) Infinite parallelism
  • B) Serialized transfers / more cycles
  • C) No control unit
  • D) No registers
Show answer & explanation

Answer: B

One bus → one transfer at a time.

Q6 Register file

Register file provides:

  • A) Only disk blocks
  • B) Fast on-chip registers for operands
  • C) Main memory DRAM
  • D) Only PC
Show answer & explanation

Answer: B

GPRs live in the register file.

Q7 Microcode styles

Vertical microcode typically:

  • A) Uses wider unencoded fields
  • B) Encodes control in fewer bits
  • C) Removes ALU
  • D) Is DMA
Show answer & explanation

Answer: B

Encoded/narrower control words.

Q8 Control

Control unit’s job is to:

  • A) Only add
  • B) Generate control signals each cycle/step
  • C) Replace cache
  • D) Run the OS
Show answer & explanation

Answer: B

Orchestrates datapath operations.

Q9 Flags

Overflow flag V relates to:

  • A) Signed arithmetic overflow
  • B) Cache miss
  • C) Page fault only
  • D) DMA done
Show answer & explanation

Answer: A

V indicates signed overflow.

Q10 Multi-cycle

Multi-cycle datapath means:

  • A) One clock for entire program
  • B) Instruction steps across multiple clocks
  • C) No clocks
  • D) Only pipelining
Show answer & explanation

Answer: B

Steps of an instruction take several cycles.

Topic drill · 10 questions

10 practice questions — Datapath & Control

Extra page-specific practice beyond the GATE samples. Attempt all 10, then reveal answers to check your reasoning.

P1

Fastest control style typically:

  • A) Microprogrammed
  • B) Hardwired
  • C) Interpreted OS
  • D) DMA control only
Show answer & explanation

Answer: B) Hardwired

No microcode fetch latency.

P2

Branch-if-zero checks:

  • A) Cache dirty bit
  • B) Z flag
  • C) Disk busy
  • D) TLB only
Show answer & explanation

Answer: B) Z flag

Zero flag.

P3

ALU stands for:

  • A) Address Lookup Unit
  • B) Arithmetic Logic Unit
  • C) Async Latch Unit
  • D) Array Load Utility
Show answer & explanation

Answer: B) Arithmetic Logic Unit

Standard expansion.

P4

Microcode store is part of:

  • A) Disk RAID
  • B) Microprogrammed control unit
  • C) Only L3 cache
  • D) DMA buffer only
Show answer & explanation

Answer: B) Microprogrammed control unit

Holds control words.

P5

Two-operand add on a single-bus CPU may need:

  • A) 0 cycles
  • B) Multiple cycles to move operands/result
  • C) Infinite cycles
  • D) No ALU
Show answer & explanation

Answer: B) Multiple cycles to move operands/result

Bus serialization.

P6

Enable signal on a register typically:

  • A) Deletes memory
  • B) Allows write/update on clock
  • C) Sets cache size
  • D) Starts DMA forever
Show answer & explanation

Answer: B) Allows write/update on clock

Register load enable.

P7

Datapath without control signals would:

  • A) Still run programs
  • B) Not know when/what to transfer
  • C) Autogenerate ISA
  • D) Replace PC
Show answer & explanation

Answer: B) Not know when/what to transfer

Control orchestrates the datapath.

P8

Carry flag C is useful for:

  • A) Unsigned overflow / multi-precision
  • B) Only virtual memory
  • C) Only interrupts
  • D) Disk sectors
Show answer & explanation

Answer: A) Unsigned overflow / multi-precision

Carry out of ALU.

P9

Flexible ISA extension favours:

  • A) Hardwired only
  • B) Microprogrammed control
  • C) Removing ALU
  • D) Larger disks only
Show answer & explanation

Answer: B) Microprogrammed control

Easier to change microcode.

P10

Status register stores:

  • A) Only PC
  • B) Condition flags / processor state bits
  • C) Entire DRAM
  • D) Only opcode
Show answer & explanation

Answer: B) Condition flags / processor state bits

Flags and status bits.

Topic FAQs

What is a datapath?

The network of registers, ALU, muxes, and buses that moves and transforms data under control signals.

Why prefer hardwired control in high-performance CPUs?

Lower control latency — no microcode fetch — at the cost of harder design changes.

What do ALU flags Z, N, C, and V mean?

Z = result zero; N = result negative (sign); C = carry out; V = signed overflow.

What is the main advantage of microprogrammed control?

Flexibility — ISA/control changes can be made by updating microcode instead of redesigning hardwired logic.

Quick revision · 10 cards

10 flashcards — Datapath & Control

Hover a card to reveal the answer with a 3D flip. On touch devices, tap the card or use Show answer.

Q1 How do hardwired and microprogrammed control units differ for GATE?
Q2 What is the main role of a multiplexer in a CPU datapath?
Q3 Where does the zero flag (Z) used by conditional branches come from?
Q4 Why does a single shared bus often increase the number of clock cycles for an instruction?
Q5 What does the control unit output each cycle or micro-step?
Q6 What does the CPU register file store?
Q7 What is characteristic of horizontal microcode?
Q8 What does the overflow flag V indicate?
Q9 What does “multi-cycle datapath” mean for a single instruction?
Q10 Why does microprogrammed control make ISA changes easier than hardwired control?