Stages & the Pipelined Datapath
A datapath question (“divide the MIPS execution into stages and diagram the pipelined datapath”) appears on the final. The trick is the pipeline registers between stages.
1. Each stage in detail
2. Pipeline registers — the key to overlap
In a pipeline, five instructions are in flight at once, each in a different stage. Each instruction's partial results (the fetched instruction, register values, the ALU output…) must be remembered so the next stage can use them on the next clock edge. That's the job of the four pipeline registers:
PREV/NEXT — the stage that writes it and the stage that reads it. So ID/EX holds what ID produced for EX to consume. 3. Single-cycle vs pipelined datapath
The datapath hardware is nearly the same. The difference: the pipelined version inserts a register after every stage, turning one long combinational path into five short clocked segments.
One instruction flows through PC → InstrMem → Registers → ALU → DataMem → Registers in a single clock cycle. The clock must be long enough for the whole chain.
The same chain is cut into 5 segments by IF/ID, ID/EX, EX/MEM, MEM/WB. Each segment runs in one (short) cycle, and five instructions occupy the five segments simultaneously.
The staircase, labelled with the datapath resource used
- List the 5 stages and the hardware each uses.
- Name the 4 pipeline registers and say why they exist (carry results forward).
- Explain the single-cycle → pipelined change: insert a register after each stage.