5.2.3 · D3 · HinglishProcessor Datapath & Pipelining

Worked examplesClassic 5-stage pipeline (IF - ID - EX - MEM - WB)

3,128 words14 min read↑ Read in English

5.2.3 · D3 · Hardware › Processor Datapath & Pipelining › Classic 5-stage pipeline (IF - ID - EX - MEM - WB)

Yeh deep dive Classic 5-stage pipeline ke timing formulas ko itna drill karta hai ki koi bhi case aapko surprise na kar sake. Hum har symbol ko zero se build karte hain, phir scenario matrix ke har cell ka ek worked example walk karte hain.


Symbols ko zero se banana

Koi bhi arithmetic se pehle, yahan har woh letter hai jo hum use karenge. Koi bhi symbol jo abhi tak aapne nahi dekha, use kabhi allow nahi kiya jaayega.


Scenario matrix

Is topic ke har timing question ko inhi cells mein se kisi ek mein daala ja sakta hai. Neeche ke worked examples mein har ek ke saath [Cell X] tag hai taaki aap dekh sako ki coverage total hai.

Cell Scenario class Jis twist ko test karta hai
A Bada , balanced stages Speedup → (ideal limit)
B Chhota Fill cost dominate karta hai; speedup se bahut neeche
C (degenerate) Pure latency; pipelining yahan haarta hai
D Unbalanced stage delays Ek slow stage baaki sab ke slots waste karta hai
E Deeper pipeline, same kaam Latch overhead gain kha jaata hai (diminishing returns)
F Limiting case Prove karo ki cap exactly hai
G Real-world word problem English → teen equations mein translate karo
H Exam twist: superpipeline vs. cost Jab zyada stages hurt karte hain

Worked examples

Cell A — bada stream, balanced stages

Cell B — ek chhota stream

Cell C — degenerate single instruction

Cell D — unbalanced stages

Cell E — deeper pipe, same total kaam

Cell F — limit, proven

Cell G — real-world word problem

Cell H — exam twist: jab zyada stages hurt karte hain


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. Matrix ke har cell ka ek worked example hai.


Active recall

For a k-stage pipeline running N instructions with no stalls, how many cycles?
— k cycles pipe fill karne ke liye, phir har cycle mein ek complete hoti hai.
Why does a single instruction (N=1) run slower pipelined?
Use phir bhi saare k stages traverse karne padte hain, aur latch overhead d har stage mein ek baar pay hoti hai (k·d), sirf ek baar ki jagah.
In Example 4, why is speedup 3.5× and not 5×?
Stages unbalanced hain; clock sabse slow stage ke hisaab se set hoti hai (200 ps + 20), jisse WB jaise fast stages mein slots waste hote hain.
Why doesn't doubling the number of stages double throughput?
Latch overhead d har stage ke liye fixed hai; jab stages chhoti hoti hain, d, ka ek bada fraction ban jaata hai.
What is the large-N speedup limit and why?
k× — fill cost (k−1) N ke relative negligible ho jaata hai, sirf k overlapped instructions bachti hain.
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 sirf ek baar latch karta hai (ek d); pipeline k baar latch karti hai (k·d).