Question bank — Pipeline registers and control signals
Before we start, three vocabulary anchors we lean on constantly.
Stage — one worker in the 5-worker assembly line: Fetch → Decode → Execute → Memory → Write-back (short: IF, ID, EX, MEM, WB).
Pipeline register — the tray (a bank of edge-triggered flip-flops — see Clocking and edge-triggered flip-flops) sitting between two workers, latching everything on the clock edge. "Latch" = "freeze the value now so the next worker reads it next cycle." There are exactly four, each named after the two stages it straddles:
| Register | Sits between | Look at the picture |
|---|---|---|
| IF/ID | Fetch → Decode | the first tray |
| ID/EX | Decode → Execute | the second tray |
| EX/MEM | Execute → Memory | the third tray |
| MEM/WB | Memory → Write-back | the fourth tray |
Control bundle — the control unit (in ID) produces many 1-bit "sticky notes" (RegWrite, MemRead, ALUSrc, …). We group them by which stage finally uses them, and call each group a bundle:
- EX bundle —
ALUSrc,ALUOp,RegDst(used in Execute) - MEM bundle —
MemRead,MemWrite,Branch(used in Memory) - WB bundle —
RegWrite,MemtoReg(used in Write-back)
The picture below shows all four trays, and how the three bundles are dropped off one by one as an instruction marches right. Refer back to it whenever a name below feels unfamiliar.

True or false — justify
Every pipeline register stores exactly the same set of fields.
There is a pipeline register after the Write-back stage.
Control signals are generated independently in each stage from that stage's local logic.
The RegWrite signal is used in the same cycle it is generated.
A pipeline register that carries a control signal drops that signal after the consuming stage.
The destination register number is only needed in the Decode stage where it is read from the instruction.
Widening a pipeline register with fields no later stage reads is harmless, just wasteful.
PC+4 can be discarded once the Fetch stage is done with it.
Spot the error
"Stage 5 (WB) inspects the opcode to decide whether to write the register file."
RegWrite bit carried in MEM/WB instead."Since EX doesn't use RegWrite, we can safely drop it at EX/MEM."
"The write-back writes to the register named in whatever instruction is currently in IF/ID."
"We recompute the branch target in the Memory stage from the current instruction's immediate."
"The EX/MEM register must carry the sign-extended immediate so MEM can use it."
"Because the pipeline has 5 stages, we need 5 pipeline registers for symmetry."
"Control signals for the MEM stage should be generated in the MEM stage to keep them fresh."
Why questions
Why can't we simply re-decode the opcode in every stage instead of carrying control signals?
Why are control signals split into EX, MEM, and WB bundles rather than kept as one lump?
Why must every value a later stage needs be latched, even if the current stage ignores it?
Why does forwarding (see Forwarding and stalling) read its operands from the pipeline registers rather than from the register file?
Why does the Zero flag from the ALU get latched into EX/MEM?
Why does putting control signals inside the pipeline registers automatically keep each instruction's paperwork with itself?
Edge cases
For a nop (no-operation), what should the control bundles hold as they travel?
RegWrite, MemWrite — must be 0 so the nop writes nothing; the bits still ride the registers, they just carry a "do nothing" instruction.When a hazard forces a stall, what is injected into the ID/EX control field?
RegWrite=0, MemWrite=0) so the stalled slot behaves like a nop and commits no state, while earlier stages hold their values (see Pipeline hazards).When a branch is mispredicted, what must happen to the wrong-path instructions already in IF/ID and ID/EX?
RegWrite/MemWrite never fire and no wrong-path state is committed (this is a control hazard, see Pipeline hazards).Why does a flush zero the control fields but not bother clearing the data fields?
RegWrite=MemWrite=0, whatever garbage sits in the data fields is never written anywhere, so only the control bits must be squashed.An R-type instruction has no memory access — does it still carry MEM-bundle signals?
MemRead=MemWrite=0; the fields exist for every instruction, and a non-memory op simply sets them inactive rather than omitting them.A sw (store) writes no register — is its dest-reg # field still latched?
RegWrite=0, so whatever number sits there is harmlessly ignored.At the very first clock edges after reset, the pipeline registers hold undefined values — why is that safe only in a properly reset design?
RegWrite=MemWrite=0 at power-up; without such resettable flops the garbage control bits could trigger spurious writes, so real designs give the control registers an explicit reset even when the data fields have none.If two instructions need the same physical pipeline register slot in the same cycle, what has gone wrong?
Connections
- Parent: Pipeline registers and control signals — the machinery these traps test
- Forwarding and stalling — why reading operands straight out of these registers matters
- Pipeline hazards — bubbles and flushes are just zeroed control bundles in the registers
- Control unit design — where the three bundles are born
- Clocking and edge-triggered flip-flops — the reset and latching behaviour behind every tray