6.3.1 · D3 · HinglishInterconnects, Buses & SoC

Worked examplesBus topologies and arbitration

2,745 words12 min read↑ Read in English

6.3.1 · D3 · Hardware › Interconnects, Buses & SoC › Bus topologies and arbitration

Yeh page Bus topologies and arbitration ki practice ground hai. Parent note ne tumhe ideas diye: shared buses, crossbars, fixed-priority aur round-robin arbitration, time-division multiplexing (TDM). Yahan hum compute karte hain — aur deliberately corners dhundte hain: sabse chhota system, sabse bada, tie, starving master, fully-loaded slot table.

Koi bhi number chhune se pehle, vocabulary pin down kar lete hain taaki kuch bhi bina explain ke use na ho.


Scenario matrix

Is topic ka har sawal in cells mein se kisi ek mein aata hai. Neeche ke worked examples mein label hai ki woh kaun si cell cover karte hain, aur milke poori table fill karte hain.

Cell Scenario class Jo corner yeh stress karta hai
A Shared-bus bandwidth split kaafi masters, ek pipe — bottleneck
B Crossbar switch count & aggregate BW quadratic hardware growth; cap
C Degenerate crossbar ( ya ) jab crossbar ek plain wire ban jaata hai
D Fixed-priority worst-case latency starving lowest-priority master
E Round-robin bounded latency guarantee, aur "just-missed-my-turn" worst case
F TDM bandwidth allocation fractional slot shares; unused-slot waste
G Single-master edge () arbitration jab koi ladhne wala hi nahi
H Real-world word problem mixed: topology + scheme choose karo, justify karo
I Exam-style twist ek "fair-lagta" scheme jo phir bhi starve karta hai

Cells examples se map hote hain: A→Ex1, B→Ex2, C→Ex3, D→Ex4, E→Ex5, F→Ex6, G→Ex7, H→Ex8, I→Ex9.


Worked examples

Example 1 — Shared bus, bandwidth split (Cell A)

Forecast: Padhne se pehle per-master number guess karo. 100 MB/s se zyada ya kam?

  1. Shared resource identify karo. Yeh step kyun? Shared bus par ek time mein sirf ek transaction hoti hai (time-division multiplexing). Zyada masters hone se total multiply nahi hota — woh divide ho jaata hai.
  2. Split apply karo. Saturated per-master share hai Yeh step kyun? masters baari-baari equal turns lete hain, to har ek pipe ka ek-daswan hissa dekhta hai.
  3. Compute karo. .

Verify: Sanity check — 10 masters 13.3 MB/s MB/s . Parts milke poore pipe ke barabar hain. ✓ (Yeh bilkul wahi "13 MB/s per device" figure hai jo parent ke PCI example mein thi.)


Example 2 — Crossbar: switches aur aggregate bandwidth (Cell B)

Forecast: Switch count guess karo — kya yeh 7 hai, 11, ya kuch bada?

Figure dekho: har master row har slave column ko cross karti hai, aur har crossing par ek switch (●) baith ta hai.

Figure — Bus topologies and arbitration
  1. Crossings count karo. Yeh step kyun? Har master ko har slave tak ek independent path chahiye, isliye switches ek grid banate hain.
  2. Concurrency cap lagao. Yeh step kyun? Do masters ek hi slave ko ek saath share nahi kar sakte — isliye simultaneous transfers ki sankhya kabhi bhi aur mein se chhote se zyada nahi ho sakti.
  3. Aggregate bandwidth. Un 4 concurrent links mein se har ek full speed par chalta hai:

Verify: Sirf 4 slaves hain, isliye ek saath zyada se zyada 4 transfers land ho sakti hain — bandwidth slaves se bottleneck ho rahi hai, 7 masters se nahi. Agar hum (galti se) use karte to 140 GB/s claim karte, jo impossible hai: 3 masters ke paas likhne ki jagah hi nahi hoti. asli kaam kar raha hai. ✓


Example 3 — Degenerate crossbar (Cell C)

Forecast: Kya crossbar yahan bhi help karta hai, ya collapse ho gaya?

  1. Switch count. switches — sirf ek column. Yeh step kyun? Ek slave hone par grid mein sirf ek destination column hoti hai.
  2. Concurrency cap. . Yeh step kyun? Sab same slave chahte hain, isliye ek waqt mein sirf ek transfer proceed kar sakti hai.
  3. Aggregate bandwidth. .

Verify: Ek slave ke saath crossbar koi parallelism offer nahi karta — yeh ek shared bus mein degenerate ho jaata hai jiske aage single slave ke liye ek arbiter hai. 5 masters ko exactly Example 1 jaisa split karte hain. To crossbar tab hi fayda karta hai jab ho. ✓ Yeh woh degenerate corner hai jo un logon ko pakadta hai jo assume karte hain "crossbar = hamesha parallel."


Example 4 — Fixed-priority worst-case latency (Cell D)

Forecast: Kya ka wait bounded hai ya infinite?

  1. Queue mein aage kaun jaata hai, list karo. Yeh step kyun? Fixed priority hamesha sabse bade requester ko pehle serve karta hai. tab serve hota hai jab koi bhi higher master request nahi kar raha.
  2. Higher-priority transactions sum karo. higher masters ke saath, har ek ke liye: agar aur se pehle exactly ek-ek baar bus chahte hain.
  3. Ab pathological case. Yeh step kyun? Agar continuously re-request karta rahe, to step 1 kabhi clear nahi hota — ka wait unbounded (starvation) hai. 8 µs figure tabhi kaam aata hai jab higher masters ki demand finite ho.

Verify: Units: , ek time — correct. Aur doosre half ka honest answer hai: fixed priority bottom master ko koi latency bound nahi deta. Yahi wajah hai ki parent "debug port indefinitely wait karta hai" flag karta hai. ✓


Example 5 — Round-robin bounded latency (Cell E)

Forecast: Kya round-robin ka bound hoga, , ya ?

Figure circular counter dikhata hai jo turns distribute karta hai.

Figure — Bus topologies and arbitration
  1. "Just-missed" worst case set up karo. Yeh step kyun? Master sabse zyada tab wait karta hai jab uski turn abhi-abhi nikal gayi ho — ab baaki sab pehle jaate hain phir uski baari aati hai.
  2. Beech mein aane wale masters count karo. Modulo- order mein, masters pehle jaate hain — yeh masters hain.
  3. Per-turn cap se multiply karo.

Verify: Har master ke paas ab 9 µs ki finite guarantee hai — koi starvation nahi, unlike Example 4 jahan forever wait kar sakta tha. Iska price: ek busy master idle ones ke peeche wait karta hai. Units check: . ✓


Example 6 — TDM slot allocation (Cell F)

Forecast: Kya teen shares milke poore 800 MB/s banengi, ya kuch bandwidth stranded rahegi?

  1. Slot fraction → bandwidth. Yeh step kyun? Ek master poora pipe sirf apne slots ke dauran leta hai; ek poore cycle mein yeh total ka fraction dekhta hai.
  2. Har ek compute karo.
  3. Slot conservation check karo. . Yeh step kyun? Agar assigned slots cycle exactly fill karte hain, to koi slot idle nahi aur koi bandwidth waste nahi hoti.

Verify: Bandwidths ka sum — poora pipe account ho gaya, kuch stranded nahi. Agar hum sirf 7 slots assign karte, ek slot ( MB/s) har cycle mein idle rehta, chahe koi master desperate ho — TDM ki rigidity ka cost. ✓


Example 7 — Single master, (Cell G)

Forecast: Kya yahan arbitration ka koi matlab bhi hai?

  1. ko round-robin bound mein plug karo. Yeh step kyun? Circle mein aur koi hai hi nahi, isliye master kabhi wait nahi karta.
  2. Arbiter logic ki zaroorat. Yeh step kyun? Ek requester ke saath koi conflict resolve karna hi nahi hai — grant permanently high tied ho sakta hai. Zero arbitration gates chahiye.

Verify: Ek single-master bus ko koi arbiter nahi chahiye aur zero contention latency hai — woh degenerate baseline jis tak har scheme ko reduce hona chahiye. Dono formulas ( fixed priority ke liye 0 higher masters ke saath, aur round-robin ke liye ) correctly par collapse karte hain. ✓


Example 8 — Real-world word problem: topology choose karo (Cell H)

Forecast: Shared bus par crossbar ka speed-up factor guess karo.

  1. Shared-bus throughput. Sab 5 masters ek pipe split karte hain: total, each (Cell A logic).
  2. Crossbar throughput. Yeh step kyun? Independent masters alag-alag banks hit karte hue concurrently run karte hain, tak:
  3. Speed-up. . Crossbar paanchguna jeetta hai kyunki accesses alag slaves par hain.
  4. Arbitration choice. Yeh step kyun? Audio DMA ko ek guaranteed deadline chahiye. Fixed priority isko starve kar sakta hai agar yeh low priority par hai; round-robin uski wait tak bound karta hai; TDM isko ek reserved slot deta hai isliye uski bandwidth deadline-guaranteed hai. TDM choose karo (ya round-robin with reserved share) — hard-real-time master ke liye kabhi plain fixed priority nahi.

Verify: Shared GB/s each vs crossbar GB/s aggregate; aur speed-up , exactly jaisa theory predict karta hai. Units sab GB/s. ✓


Example 9 — Exam twist: "fair-lagta" scheme jo phir bhi starve karta hai (Cell I)

Forecast: True round-robin waits bound karta hai — kya yeh variant bhi karta hai?

  1. Scan trace karo. Yeh step kyun? "Master 0 se resume karo" yahi trap hai: har grant ke baad pointer par reset hota hai, ke successor par nahi. To scan order hamesha upar se hota hai.
  2. Greedy master follow karo. hamesha request karta hai aur hamesha pehle scan hota hai → ko har single round mein grant milta hai. Jab tak active hai scan kabhi tak nahi pahuncha.
  3. Diagnose karo. Yeh disguise mein fixed priority hai — reset woh "starting point rotate karo" property destroy kar deta hai jo real round-robin ko fair banati hai. ka wait unbounded hai → starvation.
  4. Fix. Master ko grant karne ke baad, start pointer par advance karo taaki already-served master line ke peeche chala jaaye. Tab bound restore ho jaata hai.

Verify: Broken variant: wait karta hai (starves). Correct rotating variant: bound . "0 se resume vs se resume" ek single word fair ko unfair mein flip kar deta hai — classic exam gotcha. ✓


Recall

Round-robin worst-case wait masters ke liye, per-turn cap
Crossbar switch count masters aur slaves ke liye
Crossbar peak concurrent transfers
TDM bandwidth ek master ke liye jiske paas slots mein se slots hain, pipe par
Fixed priority ek real-time master ke liye unsafe kyun ho sakti hai
lowest-priority master indefinitely starve kar sakta hai (unbounded latency)
wala crossbar kya ban jaata hai
ek plain shared bus (koi parallelism nahi, )

Connections

  • Parent: Bus topologies and arbitration
  • Deeper mesh interconnects: Network-on-Chip
  • Point-to-point at scale: PCIe architecture
  • Masters kaun hote hain aksar: DMA, aur slaves kaise respond karte hain: Memory controllers
  • Neeche signalling: Bus protocols and signals
  • Shared reads complicated kyun ho jaate hain: Cache coherence