Pipeline Registers and Latches
You'll learn how special storage elements between pipeline stages hold intermediate data and make overlapped instruction execution possible.
What Are Pipeline Registers?
In the classic five-stage pipeline (Fetch, Decode, Execute, Memory, Write-Back), each stage needs to pass its results to the next stage. Pipeline registers (also called pipeline latches) are small, fast storage units placed between consecutive stages that hold intermediate values from one clock cycle to the next.
Think of an assembly line building cars: when one station finishes installing wheels, those partially-built cars must physically move to the next station. Pipeline registers serve this exact purpose for instruction data—they're the "conveyor belt spots" that hold work-in-progress between stations.
How They Enable Overlapped Execution
Without pipeline registers, stages would interfere with each other. Imagine if the Decode stage immediately overwrote the data the Fetch stage just produced—the next instruction would be lost!
Pipeline registers solve this by:
- Capturing outputs from one stage at the clock edge
- Holding values stable during the next clock cycle
- Isolating stages so each can work on different instructions simultaneously
For example, the IF/ID register (between Fetch and Decode) might store the fetched instruction bits and updated program counter. The ID/EX register holds decoded operation codes and register values. Each register preserves its stage's results while that stage moves on to process the next instruction.
The Timing Advantage
These registers synchronize the pipeline to the clock. Every tick, all stages save their results and grab new inputs simultaneously, creating a perfectly orchestrated flow where multiple instructions advance in lockstep.
Key Takeaway: Pipeline registers are the storage elements between pipeline stages that preserve intermediate results, enabling multiple instructions to be processed simultaneously without data corruption.