Exercises — Flynn's taxonomy (SISD - SIMD - MIMD)
6.1.1 · D4· Hardware › Parallelism & Multicore › Flynn's taxonomy (SISD - SIMD - MIMD)
Yeh page ek self-test ladder hai. Har rung pichle se harder hai. Solution cover karo, problem try karo, phir reveal karo. Agar koi word ya symbol naya lage, toh hum usse zero se build karenge pehle use karne se.
Quick vocabulary jo tumhe chahiye hogi (sab parent Flynn's taxonomy (SISD - SIMD - MIMD) se):
Charon boxes bas do yes/no questions hain — "ek ya bahut saari instructions?" aur "ek ya bahut saare data streams?" — inko cross karo. Yeh grid hai taaki tum sab charon ek nazar mein dekh sako use karne se pehle:

Grid padhna: horizontal axis instruction question hai (Single baayi taraf, Multiple daayein); vertical axis data question hai (Single neeche, Multiple upar). Charon cells mein se har ek ek architecture hai. Top-left / bottom-right diagonal note karo: SISD (plain serial CPU) aur MIMD (bahut saare full cores) do "everyday" machines hain; SIMD (top-left column, many data) vector/GPU box hai; MISD (bottom-right, greyed) woh rare theoretical box hai jiske liye hum speedup formulas nahi banayenge.
Level 1 — Recognition
Exercise 1.1
Har machine ko SISD, SIMD, MISD, ya MIMD classify karo:
(a) Ek Arduino Uno ek loop chala raha hai.
(b) Ek GPU ek add instruction se do 1024-element arrays add kar raha hai.
(c) Ek 8-core desktop ek saath browser, music player, aur compiler chala raha hai.
(d) Chaar flight computers har ek ek alag safety algorithm usi sensor reading par chala rahe hain, answer par vote kar rahe hain.
Recall Solution
Hum kya dekhte hain: instruction streams count karo (kitne alag programs) aur data streams (kitne independent data items).
- (a) Ek program, ek data item at a time → SISD.
- (b) Ek
addinstruction 1024 data pairs par broadcast → SIMD. - (c) Kai cores, har ek ka apna program aur data → MIMD.
- (d) Bahut saari alag instructions, lekin sab usi ek data stream par kaam karte hain → MISD (woh rare, mostly theoretical box — yahan uski ek real niche mein, fault-tolerant voting).
Exercise 1.2
Blanks bharo: "S____D means Single Instruction, Multiple Data. Iska speedup ____-level parallelism se aata hai, ____-level parallelism se nahi."
Recall Solution
- SIMD.
- Data-level parallelism (same op, bahut saara data).
- Task-level parallelism nahi (yeh MIMD ka kaam hai).
Exercise 1.3
MISD box (Exercise 1.1(d)) koi time speedup kyun nahi deta, chahe chaar computers ek saath chal rahe hon? Iska point kya hai?
Recall Solution
Speedup kyun nahi: charon computers usi ek data stream ko process karte hain — koi kaam split nahi ho raha, toh job jaldi finish nahi hoti. Speedup ke liye accelerated time ko shrink karna chahiye; yahan hota nahi, toh speedup . Iska actual point: reliability, speed nahi. Chaar alag algorithms ek input par vote karke ek doosre ke bugs aur hardware faults pakad lete hain (avionics mein use hota hai). Isliye MISD hamari grid par ek niche/theoretical box rehta hai — yeh safety kharidta hai, performance nahi, toh neeche wale speedup formulas iske liye apply nahi hote.
Level 2 — Application
Exercise 2.1
Ek SISD CPU ek 16-element array add karta hai. Ek ADD mein lagta hai. Total kitna time lagega? (Yahan = data items ki sankhya = 16.)
Recall Solution
kyun? SISD mein har add, agle se pehle finish hona chahiye (chalte sum ka pichle result par dependency hai), toh times add up hote hain.
Exercise 2.2
Ek SIMD unit mein 4 lanes hain. Woh usi 16-element array ko add karta hai (independent adds, koi running dependency nahi). Ek broadcast add mein lagta hai. Kitne broadcasts honge, aur total time aur speedup kya hoga?
Recall Solution
Step — kitne broadcasts? Har broadcast ek saath 4 lanes handle karta hai.

Exercise 2.3
Wahi 4-lane SIMD unit, lekin ab 18 elements hain. Kitne broadcasts? Last broadcast mein kitne fraction lanes waste honge?
Recall Solution
Ceiling kyun? 18, 4 se divide nahi hota, toh hume ek partial final group chahiye. Yaad karo upar round karta hai. Last broadcast mein sirf items hain, lanes idle rehte hain. Us broadcast ka wasted fraction .
Level 3 — Analysis
Exercise 3.1
Ek program 90% parallelizable hai (). Amdahl's Law kehta hai (yahan = cores ki sankhya) cores aur cores ke saath speedup compute karo.
Recall Solution
Har piece ka matlab: serial part hai jo kabhi speed up nahi hota; parallel part hai jo cores badhne par shrink hota hai. : : term , toh Infinite cores ke saath bhi tum se aage nahi ja sakte — serial 10% ek hard ceiling hai.
Exercise 3.2
Neeche ka curve ke liye Amdahl's speedup ko core count ke against plot karta hai. Pehle figure study karo, phir jawab do: zyaada cores add karne par ek point ke baad almost kuch kyun nahi milta?

Jawab dene se pehle figure padhna: horizontal axis = cores ki sankhya hai; vertical axis speedup hai. Blue curve ke liye hai. Orange dot hamara answer mark karta hai (). Red dashed horizontal line ceiling hai. Notice karo blue curve pehle steeply rise karta hai, phir bend ho jaata hai aur red line se chipak jaata hai bina kabhi touch kiye.
Recall Solution
Kyun flatten hona zaroori hai: pehle ke cores runtime ka ek bada chunk remove karte hain; baad ke cores already-tiny parallel remainder ko shave karte hain jabki fixed serial slice untouched rehta hai. Algebra mein, as grows, toh — constant serial term dominate karta hai aur curve us ceiling par level off hota hai. Orange dot () already red ceiling ka roughly ek-tehai tak pahunch chuka hai; 8 cores pe double karne se barely kuch hota hai, jo exactly woh flattening hai jo picture dikhati hai.
Exercise 3.3
Do designs ek fixed job finish karte hain:
- Design A: 8-lane SIMD, program 100% data-parallel.
- Design B: 8-core MIMD, program sirf 60% parallel (). Kaun faster hai (higher speedup)? Kitna zyaada?
Recall Solution
SIMD (A): 100% parallel, 8 lanes → ideal speedup (yeh edge case hai: ). MIMD (B): A jeet ta hai, aur yahan B se faster hai.
Level 4 — Synthesis
Exercise 4.1
Tumhe 1000 identical particles render karne hain (har ek par same physics equation) aur ek AI opponent (bilkul alag algorithm) chalana hai. Kaun sa architecture kis part ke liye, aur kyun?
Recall Solution
Particles: 1000 data items par same instruction → SIMD (ek GPU). Yeh textbook data parallelism hai. AI opponent: ek distinct algorithm, unrelated instructions → isko apna khud ka MIMD core do (ek CPU thread). Real systems dono karte hain: MIMD CPU cores kaam dispatch karte hain, jinmein se ek SIMD GPU drive karta hai. Dono classifications rivals nahi hain; yeh stack hote hain.
Exercise 4.2
Ek job ek core par 100 ms mein chalti hai. Uska 30 ms stubbornly serial hai. Sabse bada kya hai, aur par best possible speedup kya hai?
Recall Solution
Symbols ke baare mein note: yahan baseline runtime ko normalize karke karna convenient hai. Hum us normalized whole ko kehte hain (ek fresh symbol — ise vocabulary se , single-operation time, se confuse mat karo). ke fractions phir parallel/serial shares hain. find karo: parallel time ms, toh Ceiling: Kitna bhi hardware ho, ms se tez finish nahi hoga — serial 30 ms floor hai.
Level 5 — Mastery
Exercise 5.1
Design target: ek workload ko exactly speed up karna. Measurement dikhata hai . (a) Kya reachable bhi hai? (b) Agar haan, toh kitne cores chahiye?
Recall Solution
(a) Pehle ceiling check. . Kyunki , target reachable hai. (b) ke liye Amdahl solve karo given . Hum ko ek-ek motivated step mein isolate karte hain: Step 1 — dono sides flip karo. 5 ka speedup matlab neeche ka bracket ke barabar hona chahiye; fraction invert karna bas yeh padhta hai "agar whole 5 hai, toh part one-fifth hai." Toh Step 2 — serial term alag karo. Fixed (serial slice) cores se affect nahi hota, toh hum ise side mein rakhte hain taaki dekh sakein parallel term ka kya contribute karna chahiye: Step 3 — solve karo. Parallel kaam ko tak squeeze karna hai, aur squeeze factor hai, toh : Tumhe 17 cores chahiye. (Kam hoge toh target miss hoga; yeh exact break-even hai.)
Exercise 5.2
Combined machine: ek program apna 40% time ek SIMD-friendly loop mein spend karta hai (8 lanes, ideal), 40% MIMD-parallel tasks mein 4 cores par ( us part ke andar), aur 20% purely serial hai. Poore serial baseline ko normalized time lo. Total speedup find karo.
Recall Solution
Idea — har slice ko apne factor se shrink karo, phir times add karo. (Sab slices normalized baseline ke fractions hain; yeh ek fresh normalization symbol hai, single-operation time nahi.)
- Serial slice: , speedup 1 → time .
- SIMD slice: , speedup 8 → time .
- MIMD slice: , speedup 4 → time . Naya total time . Overall speedup (baseline time over accelerated time ). Serial 20% leftover time dominate karta hai — Amdahl ka lesson teen streams tak generalize hua.
Recall Ek-line self-check
Woh kaun si single quantity hai jo har MIMD speedup ko cap karti hai chahe kitne bhi cores hon? ::: Serial fraction ; ceiling hai.