5.2.11 · D5Processor Datapath & Pipelining

Question bank — Deep pipelining trade-offs

2,144 words10 min readBack to topic

This is a concept-trap question bank for the parent topic. Each item below is a one-line reveal: read the prompt, answer it in your head, then peek. The goal is not arithmetic (that lives in the worked-example pages) — it is catching the wrong intuitions that deep pipelining quietly invites.

Before we start, the handful of symbols we lean on constantly, in plain language:

  • Stage — one work-station on the assembly line; one instruction sits in one stage per clock tick.
  • (un-pipelined total logic delay) — the time it takes to do all the instruction's combinational work in one long block, before we cut it into stages. Think of it as the whole pizza-making time end to end, with no hand-offs.
  • — the number of stages we cut into.
  • (per-stage logic delay) — the combinational work left in one stage. If we split evenly, then ; we also write for the same thing when emphasising it is logic only, not register cost.
  • (register overhead) — the fixed per-stage tax to hand work between stages: .
  • Cycle time () — how long one tick lasts, set by the slowest stage's logic plus that overhead: .
  • (clock frequency) — how many ticks happen per second; it is simply one divided by the cycle time, . A shorter cycle means a bigger .
  • CPI — cycles per instruction; how many ticks, on average, each instruction really costs once stalls and flushes are counted.
  • IPC (instructions per cycle) — the flip side of CPI, ; how much useful work finishes per tick. Deep pipelines tend to raise but lower IPC.
  • Throughput — real delivered performance, equal to (equivalently ). Both and CPI matter, which is the whole moral of this page.
  • (load capacitance) and (supply voltage) — in the dynamic-power law , is how much electrical charge the circuit must swing each switch (more registers means more ) and is the voltage it swings through.

Figure 1 (below) plots that speedup curve. Trace it with your finger: the magenta line climbs steeply at small , then bends and hugs the violet dashed ceiling , while the orange dotted "ideal" line (the fantasy where ) keeps rising forever. The gap between magenta and orange is the register tax. Every "diminishing returns" answer on this page is really pointing at that bend.

Figure — Deep pipelining trade-offs

Figure 2 (below) shows the other half of the story. Each bar is how many instructions a single wrong branch guess throws away — height . Watch it rise as a straight line: 4 flushed at 5 stages, 30 at 31. Frequency (Figure 1) gives, hazards (Figure 2) take back — and the taking grows faster and faster with depth.

Figure — Deep pipelining trade-offs

True or false — justify

A 20-stage pipeline runs 4× faster than a 5-stage one at the same logic
False — frequency rises only if the slowest stage shrinks 4×, and register overhead is a fixed tax that eats a bigger share as stages thin, so the speedup is well under 4× (this is exactly the bend in Figure 1).
Making each stage do less work always shortens the clock period
False — it shortens the logic part , but stay put, so once is tiny the period stops shrinking (register-limited regime — the flat part of Figure 1).
The purely analytical model says "deeper is always better"
True — differentiating the cycle-time function with respect to gives , which is always negative, so period keeps falling; the model is wrong because it ignores hazards and power, not because the math is.
Branch misprediction penalty is a fixed 4 cycles regardless of depth
False — the penalty is roughly cycles because you flush every instruction fetched behind the branch; a 20-stage pipeline throws away ~19, a 31-stage one ~30 (this is Figure 2's straight climb).
Doubling frequency doubles throughput, all else equal
True as a principle — throughput is , so if CPI is held fixed, doubling does double it; the trap is that deep pipelining rarely holds CPI fixed (more stalls and flushes push CPI up), so in practice the doubling is partly cancelled.
Adding pipeline registers costs power even when the pipeline is idle
True — the clock network must still toggle all register banks every tick, which is why Pentium 4 spent 30–40% of its power just distributing the clock.
Perfect stage balance is achievable if you just divide the logic evenly
False — some operations are atomic (a cache access, a TLB lookup) and cannot be cut mid-way, so real stage delays are uneven and the longest one sets the clock.
Higher clock frequency alone made Pentium 4 Prescott faster than Northwood
False — frequency rose ~1.5× but CPI worsened ~1.5× from the longer misprediction penalty, so per-clock performance landed near 1.0× — essentially flat.
With perfect branch prediction, deep pipelining has no downside
False — even at 100% prediction you still pay register overhead, stage-imbalance waste, and quadratically-scaling clock/register power.
The register overhead includes clock skew
True — ; skew is the arrival-time mismatch of the clock edge across registers, a real fixed cost each stage must budget for.

Spot the error

"10 ns logic split into 10 stages gives exactly 1 ns cycle time."
Error — with ns and the logic per stage is ns, but the cycle is ; also real logic won't split into ten equal 1 ns pieces, so the longest stage governs.
"Deeper pipelines are always slower because hazards dominate."
Error — deeper pipelines usually raise frequency; whether they are net slower depends on whether the CPI penalty outweighs that frequency gain, which is a trade-off, not a guarantee.
"Speedup from a -stage pipeline approaches as ."
Error — with even splitting , approaches , a fixed ceiling set by register delay, not (magenta bends away from orange in Figure 1).
"A data hazard in a 31-stage pipeline is the same 1–2 cycle stall as in a 5-stage one."
Error — an operand may not be ready for many more stages downstream, so bypassing gets more complex and residual stalls grow; the 1–2 cycle figure is a 5-stage artifact.
"Reducing voltage cancels the extra power of a deeper pipeline entirely."
Error — in the dynamic-power law (with = load capacitance, = supply voltage), lowering helps, but the added registers raise and the higher raises , so it only partly offsets a genuinely larger power draw — the technique of trading against is DVFS, Dynamic Voltage and Frequency Scaling, covered in Dynamic Voltage and Frequency Scaling (DVFS).
"CPI of 1 means the pipeline is optimal."
Error — CPI counts cycles per instruction but ignores how long each cycle is; a slow, low-CPI design can lose to a fast, higher-CPI one because performance is .
"Forwarding paths grow linearly with pipeline depth."
Error — the number of potential source-to-destination bypasses scales like , which is a big reason deep pipelines are hard to verify.

Why questions

Why does register overhead cap the speedup instead of hazards, in the idealized model?
Because the ideal model assumes no hazards and perfect balance, the only surviving fixed cost is — so as grows the logic term vanishes and the curve flattens onto the violet ceiling in Figure 1; hazards only enter the realistic model.
Why did Intel abandon the deep-pipeline path for the Core architecture?
Because Prescott hit the "deep-pipeline wall" you can read off both figures at once — Figure 1's frequency gains had flattened while Figure 2's flush penalty ballooned to ~30, so falling IPC plus ~115 W power gave near-zero net gain; Core went shallower (~14 stages) but wider to raise IPC — see Pentium 4 vs Core Microarchitecture.
Why does a deeper pipeline make Branch Prediction more important, not less?
Because the misprediction penalty is the height of the bar in Figure 2 (), each wrong guess costs far more as depth grows, so the same accuracy silently loses more throughput — better prediction is needed just to stand still.
Why do memory stages resist being sliced thinner?
Because a cache or TLB access is atomic and variable-latency (a hit and a miss take very different times); you cannot pause halfway through an access, so that stage forms a hard floor on how short a stage can be, capping how far right you can usefully travel along Figure 1.
Why is "more stages = higher IPC" the wrong expectation?
Because extra stages raise frequency (, Figure 1), not IPC; IPC usually falls with depth as the growing flush penalty (Figure 2) and extra stalls push CPI up — exactly what dropped Prescott's IPC from ~1.5 to ~1.0.
Why does the clock network dominate power in very deep pipelines?
Because every one of the register banks is clocked every cycle at a high , so in both the capacitance (more registers) and climb together — see Clock Distribution and Skew.
Why can a superscalar design beat a deeper scalar one at the same frequency?
Because issuing several instructions per cycle attacks CPI directly (raising IPC, more useful work per tick), whereas deepening the pipe attacks while worsening CPI — often a better trade in the balance.

Edge cases

What happens to speedup when ?
Then and exactly — this is the orange dotted "ideal" line in Figure 1 that never bends — which is why is the single term that pulls the real (magenta) curve down toward its ceiling.
What is the pipeline period when logic delay ?
It flattens to — the register-limited regime, the flat right end of Figure 1 — so adding more stages gains essentially nothing.
For a 2-stage pipeline () versus un-pipelined, does the formula still show a gain?
Yes — , which is above 1 whenever ; but note a "1-stage pipeline" () is just the un-pipelined logic plus one register, so it is slightly slower — pipelining only pays once .
If branch prediction were perfect (100%), does the control-hazard penalty vanish for any ?
Yes, the misprediction term (the Figure 2 bars) goes to zero regardless of depth — but data hazards, stage imbalance, and register/power costs remain, so depth still has limits.
Where does the empirical sweet spot –15 come from?
It is where the two figures cross in importance: by –15 Figure 1's frequency curve has already captured most of its 2–3× gain (register overhead is a tolerable ~10–20% of the cycle), while Figure 2's flush penalty is still small enough that a 95%+ predictor keeps CPI in check — push past that and hazard/power costs grow faster than the flattening frequency benefit, so measured throughput turns over. It is an empirical balance of real designs, not a clean closed-form root.
What throughput trend appears as grows past that sweet spot?
Frequency gains flatten (Figure 1's ceiling) while hazard penalties keep climbing (Figure 2's straight line), so throughput peaks and then decreases — the diminishing-then-negative returns region.
Recall Fastest gut-check

Real performance is ==throughput == (with the clock frequency), not alone — deep pipelining always raises the numerator but usually raises the denominator too, and register overhead caps how far the numerator can go via .