Pipelining Formula Sheet for GATE: Speedup, CPI and Hazard Revision Notes

Revise pipeline timing from first principles, then use one consistent five-stage example to calculate speedup, efficiency, CPI and throughput with and without stalls.

KnowledgeGate Team

Exam prep & CS education

Updated 1 Dec 20265 min read
Pipelining Formula Sheet for GATE: Speedup, CPI and Hazard Revision Notes

Pipelining numericals become confusing when a speedup formula is mixed with latency and throughput, fill and drain cycles are omitted, or a hazard penalty is added twice. Keep cycle count separate from cycle time, keep every unit visible, and use the five-stage calculation below to derive speedup, CPI and throughput with and without stalls.

Pipelining formula sheet: define the symbols before substituting

Use n for instructions, k for stages, d_i for stage i's combinational delay, t_r for pipeline-register overhead, and S for total inserted stalls in the stated stream. Use Pipelining in Computer Architecture: Speedup and Hazards when you need the five-stage model and hazard families. For numeric checks, keep the symbol definitions and finite-stream formulas together.

Quantity

Formula

Pipeline clock period

t_clk = max(d_i) + t_r

Ideal pipeline cycles

k + n - 1

Actual pipeline cycles

k + n - 1 + S

Pipeline time

T_pipe = (k + n - 1 + S)t_clk

Non-pipelined time, for the stated single-cycle reference

T_nonpipe = n(sum(d_i) + t_r)

Speedup

T_nonpipe / T_pipe

Exact finite-stream CPI

(k + n - 1 + S) / n

Finite-stream throughput

n / T_pipe

One-instruction pipeline latency

kt_clk

Conventional efficiency

Speedup / k

With equal stage delay t, zero register overhead, and no stalls, Speedup = nk/(k+n-1). It approaches k only as n grows. This shortcut does not apply to unequal stages.

Pipeline timing: fill, steady state and drain

Trace the five stages IF, ID, EX, MEM, WB. Instruction I1 occupies cycles 1 to 5, I2 occupies cycles 2 to 6, and I6 occupies cycles 6 to 10. Without stalls, the first result appears after k cycles and the nth after k+n-1 cycles. The final k-1 cycles after the nth fetch are the drain, so k+n-1 includes both fill and drain.

Once full, this scalar pipeline ideally completes one instruction per cycle. That is throughput. One instruction still needs five cycles from entry to exit. Its latency can exceed the non-pipelined latency because each cycle follows the slowest stage plus register overhead.

Five-stage pipeline timing grid showing instructions I1 through I6 moving diagonally across cycles 1–10.

Pipelining speedup: fully worked five-stage example

Take stage delays of 80, 120, 90, 150, 110 ps, register overhead 10 ps, k=5, and n=20.

  1. Add the stage delays: sum(d_i) = 80+120+90+150+110 = 550 ps.

  2. The single-cycle non-pipelined reference clock is 550+10 = 560 ps, so T_nonpipe = 20 x 560 = 11,200 ps.

  3. The pipeline clock uses the slowest stage: t_clk = 150+10 = 160 ps.

  4. With no stalls, cycles are 5+20-1 = 24, so T_pipe = 24 x 160 = 3,840 ps.

  5. Speedup is 11,200/3,840 = 2.9167, or about 2.92x. Efficiency is 2.9167/5 = 0.5833, or 58.33%.

  6. Finite throughput is 20/3.84 ns = 5.21 GIPS. Once full, no-stall throughput is 1/0.16 ns = 6.25 GIPS.

  7. One instruction takes 5 x 160 = 800 ps in the pipeline, versus 560 ps without it. The stream finishes sooner, but the instruction does not.

Insert exactly six stalls into the same stream. Cycles become 24+6 = 30, so time is 30 x 160 = 4,800 ps. Exact finite-stream CPI is 30/20 = 1.50. Speedup falls to 11,200/4,800 = 2.3333, about 2.33x, and finite throughput becomes 20/4.8 ns = 4.17 GIPS. Pipelining in COA: Speedup, Hazards & GATE Examples covers unequal-stage timing and combined branch/load-use penalties. The stated stage values make the no-stall and six-stall finite-stream comparison explicit.

Three-bar comparison of non-pipelined and pipelined execution times, cycles, speedups and finite throughputs.

Pipeline hazards: convert each penalty into CPI

For a long stream, CPI_actual = CPI_base + stalls per instruction. A hazard affecting fraction f with penalty p adds fp. For branch fraction f_b, misprediction fraction m, and penalty p_b, the addition is f_b m p_b. Add penalties only when the question defines separate expected costs.

Suppose base CPI is 1. Load-use hazards affect 25% of instructions and cost one stall each, adding 0.25 x 1 = 0.25. Branches form 20% of instructions, 10% of those branches are mispredicted, and each miss costs three cycles. Their addition is 0.20 x 0.10 x 3 = 0.06. Therefore, CPI = 1+0.25+0.06 = 1.31.

At a 160 ps clock, average time per instruction is 1.31 x 160 = 209.6 ps. Steady throughput is 1/209.6 ps = 4.77 GIPS.

RAW, WAR and WAW are dependencies. A dependency becomes a hazard only when pipeline timing creates a conflict. An in-order five-stage pipeline most commonly exposes RAW hazards. Structural hazards come from resource conflicts, while control hazards come from changes in instruction flow. Use Hazards and Timing: 10 Solved MCQs and NATs for contextual practice.

Pipelining formula traps: five checks before finalising an answer

  1. Omitting fill and drain: include the k-1 term, giving k+n-1 ideal cycles.

  2. Using average stage delay: the pipeline clock uses max(d_i), not the average.

  3. Forgetting register overhead: add t_r to the slowest stage delay.

  4. Treating k as exact speedup: k is an ideal asymptotic limit, not the finite-stream answer.

  5. Confusing latency and throughput: track one instruction for latency and the completed stream for throughput.

Exact finite-stream CPI includes the initial fill and final drain through (k+n-1+S)/n. Steady-state CPI usually ignores the initial k-1 cycles. A question may give total stalls S, or it may give frequency multiplied by penalty. Convert once, not twice.

Keep units visible: 160 ps = 0.16 ns, so 1/0.16 ns = 6.25 x 10^9 cycles per second. Speedup has no unit, CPI is cycles per instruction, time remains in ps or ns, and throughput is instructions per second.

Pipelining in GATE CS: the question patterns to rehearse

The archived official GATE 2026 CS syllabus lists Instruction Pipelining and Pipeline Hazards under Computer Organization and Architecture. That scope statement does not establish current weightage, marks, question counts, or any future exam pattern.

Four stable problem types are worth rehearsing:

  • choose the clock period from unequal stage delays;

  • find completion time for n instructions;

  • compare finite-stream and asymptotic speedup;

  • compute stall or branch penalties from a timing chart.

The GATE CS Exam Preparation page places this topic in the broader preparation path. Use it alongside the formula sheet when you want to separate general pipelining practice from GATE previous-year material.

Pipelining revision: the 10-minute final pass

Use three short passes. First, write the six core relationships for clock period, ideal cycles, actual cycles, pipeline time, speedup and CPI from memory. Second, recompute the 20-instruction example until 24 no-stall cycles and 30 cycles with six stalls are immediate. Third, solve one no-stall question, one data-hazard question, and one branch-penalty question.

The short version is: find t_clk, count cycles, add stalls once, multiply, and only then calculate speedup, CPI or throughput. A pipeline improves completion rate, not automatically the latency of one instruction.

For full-subject preparation, GATE Guidance by Sanchit Sir is the structured next step. If you only need this topic, keep the formula sheet beside you and solve targeted questions until each distinction is automatic.