5.2.3 · D3Processor Datapath & Pipelining

Worked examples — Classic 5-stage pipeline (IF - ID - EX - MEM - WB)

2,863 words13 min readBack to topic

This deep dive drills the timing formulas of the Classic 5-stage pipeline until no case can surprise you. We build every symbol from zero, then walk one worked example per scenario cell.


Building the symbols from zero

Before any arithmetic, here is every letter we will use. A symbol you have not met yet is never allowed.


The scenario matrix

Every timing question this topic can throw is one of these cells. The worked examples below each carry a [Cell X] tag so you can see the coverage is total.

Cell Scenario class The twist it tests
A Large , balanced stages Speedup → (the ideal limit)
B Small Fill cost dominates; speedup far below
C (degenerate) Pure latency; pipelining loses here
D Unbalanced stage delays One slow stage wastes the others' slots
E Deeper pipeline, same work Latch overhead eats the gain (diminishing returns)
F Limiting case Prove the cap is exactly
G Real-world word problem Translate English → the three equations
H Exam twist: superpipeline vs. cost When more stages hurt

Worked examples

Cell A — large stream, balanced stages

Cell B — a short stream

Cell C — the degenerate single instruction

Cell D — unbalanced stages

Cell E — deeper pipe, same total work

Cell F — the limit, proven

Cell G — real-world word problem

Cell H — exam twist: when more stages hurt


Recall Coverage self-check

Ex 1 → A · Ex 2 → B · Ex 3 → C · Ex 4 → D · Ex 5 → E · Ex 6 → F · Ex 7 → G · Ex 8 → H. Every matrix cell has a worked example.


Active recall

For a k-stage pipeline running N instructions with no stalls, how many cycles?
— k to fill, then one completes per cycle.
Why does a single instruction (N=1) run slower pipelined?
It still traverses all k stages, and pays latch overhead d once per stage (k·d) instead of once total.
In Example 4, why is speedup 3.5× and not 5×?
Stages are unbalanced; the clock is set by the slowest (200 ps + 20), wasting slots in faster stages like WB.
Why doesn't doubling the number of stages double throughput?
Latch overhead d is fixed per stage; as stages shrink, d becomes a larger fraction of .
What is the large-N speedup limit and why?
k× — the fill cost (k−1) becomes negligible relative to N, leaving k overlapped instructions.
Which formula must you use for small N instead of the k-limit?
.
How many times does a single-cycle machine latch per instruction, versus a k-stage pipeline?
Single-cycle latches once (one d); the pipeline latches k times (k·d).