Computer Organization
Datapath & Control
Know how register file, ALU, and muxes connect — and whether control is hardwired or microcoded.
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.
| Block | Role | Typical control |
|---|---|---|
| Register file | Hold operands / results | RegWrite, read/write select |
| ALU | Compute / compare | ALUOp |
| Mux | Route one of several inputs | Select lines |
| Bus | Shared transfer path | Bus enable / tri-state |
| MAR/MDR | Memory address / data | MemRead / 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.
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.
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 style | Strength | Trade-off |
|---|---|---|
| Hardwired | Low latency / speed | Hard to change; complex FSM |
| Microprogrammed | Flexibility / easier ISA edits | Control-store access latency |
| Horizontal microcode | Explicit parallel controls | Wide words, large store |
| Vertical microcode | Compact encoding | Extra 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.
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.
10 GATE-style MCQs for Datapath & Control with full explanations. Attempt each question before revealing the answer.
ALU flags are typically used for:
Show answer & explanation
Answer: B
Z/N/C/V feed conditions and status.
Microprogrammed control main advantage:
Show answer & explanation
Answer: B
Change microcode instead of rewiring.
Hardwired control is generally:
Show answer & explanation
Answer: B
Speed vs flexibility trade-off.
A mux in the datapath primarily:
Show answer & explanation
Answer: B
Multiplexers route values.
Single shared bus often implies:
Show answer & explanation
Answer: B
One bus → one transfer at a time.
Register file provides:
Show answer & explanation
Answer: B
GPRs live in the register file.
Vertical microcode typically:
Show answer & explanation
Answer: B
Encoded/narrower control words.
Control unit’s job is to:
Show answer & explanation
Answer: B
Orchestrates datapath operations.
Overflow flag V relates to:
Show answer & explanation
Answer: A
V indicates signed overflow.
Multi-cycle datapath means:
Show answer & explanation
Answer: B
Steps of an instruction take several cycles.
Extra page-specific practice beyond the GATE samples. Attempt all 10, then reveal answers to check your reasoning.
Fastest control style typically:
Show answer & explanation
Answer: B) Hardwired
No microcode fetch latency.
Branch-if-zero checks:
Show answer & explanation
Answer: B) Z flag
Zero flag.
ALU stands for:
Show answer & explanation
Answer: B) Arithmetic Logic Unit
Standard expansion.
Microcode store is part of:
Show answer & explanation
Answer: B) Microprogrammed control unit
Holds control words.
Two-operand add on a single-bus CPU may need:
Show answer & explanation
Answer: B) Multiple cycles to move operands/result
Bus serialization.
Enable signal on a register typically:
Show answer & explanation
Answer: B) Allows write/update on clock
Register load enable.
Datapath without control signals would:
Show answer & explanation
Answer: B) Not know when/what to transfer
Control orchestrates the datapath.
Carry flag C is useful for:
Show answer & explanation
Answer: A) Unsigned overflow / multi-precision
Carry out of ALU.
Flexible ISA extension favours:
Show answer & explanation
Answer: B) Microprogrammed control
Easier to change microcode.
Status register stores:
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.
Hover a card to reveal the answer with a 3D flip. On touch devices, tap the card or use Show answer.