Exercises — Deep pipelining trade-offs
This page is a self-test ladder. Each problem states its difficulty level (L1 → L5). Try it with the Solution callout collapsed, then open it to check every step. All numbers are machine-verified.
Before we start, let us make sure every symbol used below is already earned — nothing here appears without a plain-words meaning first.
See Deep pipelining trade-offs for the full derivations these problems drill.
Level 1 — Recognition
Problem 1.1
State, in one sentence each, what , , , and mean, and write the formula linking them.
Recall Solution 1.1
- = number of pipeline stages (a positive integer, ).
- = combinational logic delay of one stage.
- = fixed per-stage pipeline-register overhead (does not shrink with ).
- = clock period = time of one tick.
- Link: What this says: as we add stages, the first term shrinks but the second never does.
Problem 1.2
A pipeline has ns of logic split into stages, with ns. Find , , and (in MHz).
Recall Solution 1.2
- ns.
- ns.
- MHz. Why 1000? 1 ns s, so Hz MHz.
Problem 1.3
True or false: "Adding more pipeline stages always lowers ." Explain using the formula.
Recall Solution 1.3
False (in practice), true only in the idealised logic-only model. In the pure model , raising shrinks , so keeps falling — but only asymptotically toward , never below it. In reality logic is not infinitely divisible (atomic stages), so past some depth the slowest stage stops shrinking and flattens. So the honest answer is: it never increases in the ideal model, but the benefit vanishes.
Level 2 — Application
Problem 2.1
Unpipelined logic ns, register overhead ns, perfect balance. Compute the ideal speedup for , , and stages. Round to two decimals.
Recall Solution 2.1
Why this formula? Unpipelined, one instruction takes the whole to finish. A full -stage pipeline, once its stages are all busy, retires one instruction every clock tick — i.e. one every . So the time per instruction drops from to , and speedup is the ratio of those two per-instruction times: That is why sits on top and one cycle sits on the bottom — we are comparing "seconds per instruction, before vs after."
- : ; speedup .
- : ; speedup .
- : ; speedup . What it looks like — read Figure s01: the blue curve is this speedup versus . The three coloured dots mark our answers (orange , green , gray ). Notice the gap between the green and gray dots is not double the gap between orange and green — the curve is bending toward the dashed red ceiling. That bend IS diminishing returns, made visible.

Problem 2.2
Using the result above, quantify the "diminishing returns": we made the pipeline deeper — by what factor did ideal speedup actually grow?
Recall Solution 2.2
Deeper by . Speedup grew by . So the hardware depth buys only the speed. The missing is eaten by , which is now of every cycle (vs at ). On the figure: this is exactly the vertical distance from the gray dot down to where a straight line from the orange dot would have landed — the shortfall is the red ceiling pulling the curve flat.
Problem 2.3
A design has ns and ns. What is the maximum possible clock frequency (the asymptotic limit as ), in MHz?
Recall Solution 2.3
As , , so ns. Why there is a ceiling: you can never make a cycle shorter than the register handoff itself. This is the wall deep pipelining runs into. (This limit is a mathematical ; real is a finite integer, so you only ever approach 2 GHz.)
Level 3 — Analysis
Problem 3.1
Branches occur every 5 instructions; prediction accuracy is 90%; misprediction penalty is cycles. Compute the effective CPI for a 5-stage and a 20-stage pipeline (ignore data hazards).
Recall Solution 3.1
Fraction of instructions that are branches . Mispredicted fraction per instruction. Stall CPI .
- 5-stage: ⇒ CPI .
- 20-stage: ⇒ CPI . What it looks like: each mispredict flushes the whole pipeline; a longer pipe throws away more in-flight work. See Branch Prediction and Pipeline Hazards.
Problem 3.2
The 20-stage pipeline runs its clock faster than the 5-stage one. Using the CPIs from 3.1, find the effective speedup (throughput ratio). Did the frequency pay off?
Recall Solution 3.2
Throughput . Verdict: the clock delivers only throughput. The CPI grew from 1.08 to 1.38 ( worse), erasing about a quarter of the frequency win. See Superscalar Architectures for the complementary lever (raising IPC instead of ).
Problem 3.3
At what branch prediction accuracy would the 20-stage pipeline's control-stall CPI equal the 5-stage pipeline's control-stall CPI from 3.1 (which was 0.08)? Keep branch frequency and penalty .
Recall Solution 3.3
Set . Meaning: to keep the 20-stage pipe's control stalls as low as the 5-stage pipe's, prediction must climb from 90% to ~97.9%. This is exactly why deep pipelines demand excellent branch prediction — the accuracy requirement rises with depth.
Level 4 — Synthesis
Problem 4.1
Dynamic power is . A deeper pipeline raises by . If voltage is held constant and capacitance is held constant, by what factor does dynamic power rise? Then, if the designer drops by 10% (to ) to compensate, what is the net power factor?
Recall Solution 4.1
Constant : , so power rises by . With : power scales as , so factor . Interpretation: even after a 10% voltage cut, power still climbs 21.5%. Voltage reduction (the lever behind Dynamic Voltage and Frequency Scaling (DVFS)) softens but does not erase the power cost of going faster, because power depends on squared but on only linearly.
Problem 4.2 — Pentium 4 Prescott reconstruction
Northwood (20 stages) vs Prescott (31 stages): Prescott raised frequency by but its CPI also rose by . (a) Compute the net performance factor. (b) If power rose by as well, compute performance-per-watt relative to Northwood.
Recall Solution 4.2
(a) Performance : No net gain — the frequency win was exactly cancelled by the CPI loss. This is the "deep-pipeline wall." (b) Performance-per-watt . Verdict: same speed, the power ⇒ efficiency dropped to two-thirds. This is why Intel abandoned the deep-pipeline path for the Core microarchitecture. See Pentium 4 vs Core Microarchitecture.
Problem 4.3
Combine two effects. Take ns, ns. Define throughput index where MHz and (from the branch model of 3.1). Compute for and identify which maximises throughput.
Recall Solution 4.3
Why this index? tells you ticks-per-second, tells you ticks-per-instruction, so = instructions-per-second — the actual useful-work rate. Dividing cancels the "cycle" unit and leaves work-per-time, which is precisely what we want to maximise. We evaluate it only at whole-number because stages are integers. Compute each (frequency in MHz, CPI dimensionless, in MHz-per-instruction-cycle):
- : , CPI , .
- : , CPI , .
- : , CPI , .
- : , CPI , . Result: within this range still rises with (peaks at ) — because 90% prediction keeps CPI growth mild. The peak moves to smaller once you add data hazards and worse prediction. The lesson: the optimal depth depends entirely on how steeply CPI climbs. Read Figure s02: the blue curve is this very with no atomic floor — it keeps climbing across our whole range, which is why the naive model never tells you to stop.

Level 5 — Mastery
Problem 5.1 — Derive the true optimum with imbalance
Suppose logic cannot be split below an atomic floor: the slowest stage is where ns is an unsplittable operation (e.g. a cache access, see Instruction Pipelining Basics). With ns and ns, find the smallest beyond which adding stages gives zero frequency benefit.
Recall Solution 5.1
Frequency stops improving once falls to the atomic floor , i.e. once : Integer-stage step: is not a legal stage count — must be a whole number. We round up to the next integer, , because that is the first integer at which actually holds (at , , so the floor is not yet reached). For , the slowest stage is stuck at ns, so ns and freezes at MHz no matter how many more stages you add — but CPI keeps rising with . So past , deeper is strictly worse. This is stage imbalance turning "harmless" into "harmful."
Problem 5.2 — Full throughput optimisation
Use and . Compute the throughput index at and state the true optimal depth.
Recall Solution 5.2
Why the appears now: the clock is set by the slowest stage, and no stage can be faster than the atomic floor ns. So the logic part of the cycle is : it follows while that is above , then clamps at . Evaluate only at integer :
- : , floor not yet active, so ns, MHz; CPI ; .
- : , floor now active, so ns, MHz; CPI ; .
- : floor active, MHz (frozen); CPI ; .
- : floor active, MHz (frozen); CPI ; . True optimal depth . Reading down the list, climbs as we reach the floor, then falls once frequency is frozen but CPI keeps rising. The maximum sits exactly at — the first integer where the atomic floor caps the clock. Beyond it, you pay more registers and more hazard stalls for zero extra frequency, so throughput can only drop. This is the honest sweet spot: push depth up to the floor, then stop.
Problem 5.3 — Design judgement
A rival team proposes doubling depth from 17 to 34 stages, promising "double the frequency." Given the model in 5.2, write a two-line rebuttal with numbers.
Recall Solution 5.3
Rebuttal: Frequency does not double — the slowest atomic stage is already at the ns floor, so stays pinned at MHz from onward; doubling to 34 changes by . Meanwhile CPI rises from to , so throughput falls from to — a 20% loss — plus roughly double the register power. Doubling depth here is all cost, no benefit.
Recall Self-check summary (cloze)
The clock period is ::: The quantity that actually measures performance is ::: throughput As in the ideal model, is bounded by ::: Branch misprediction penalty in a -stage pipe is ::: cycles The true depth limit appears when hits the ::: atomic (unsplittable) stage floor , i.e.