6.3.1 · D2Interconnects, Buses & SoC

Visual walkthrough — Bus topologies and arbitration

1,960 words9 min readBack to topic

The parent note dropped a clean-looking result on you:

for round-robin arbitration. But where does that number come from? Why not , or ? And what is really measuring? This page rebuilds that inequality from the very first idea — no symbol used before it is drawn.


Step 0 — The words before the symbols

Before any formula, we agree on plain-language meanings and pin each to a picture.

We will call the number of masters . So is just how many devices are in the circle — a plain counting number like .

Figure — Bus topologies and arbitration

In the figure: four rounded boxes () all reach for one horizontal bar — the bus. The referee (the small circle in the middle) can only wave one of them through at a time. Everyone else waits. That "waiting" is the whole subject of this page.


Step 1 — Turning "circular order" into a pointer

WHAT. Round-robin means: after a master finishes, the next master in a fixed circle gets the first chance. We encode "whose turn it is" with a single number , a pointer.

WHY a pointer and not a priority list? Because the rule is positional, not importance-based. Nobody is permanently first. The only thing that matters is "where the pointer is standing right now." One integer captures that completely.

PICTURE.

Figure — Bus topologies and arbitration

The four masters sit on a clock face. The arrow is , the pointer, currently aimed at . The tiny curved arrow shows the only motion allowed: after a turn, steps one seat clockwise.

Why do we need the modulo? Because there is no "seat ." Seats are numbered — that's seats total. guarantees the pointer only ever names a real seat.


Step 2 — What "one turn costs" — defining

WHAT. Each transaction takes some time. Different transactions take different times, but there is a longest possible one. We name that ceiling .

WHY a maximum and not an average? We are asking a worst-case question ("how long can I be forced to wait?"). Worst case means: assume every master ahead of you took the slowest legal transaction. Averages would answer a different question (typical wait). For real-time guarantees, only the ceiling is safe.

PICTURE.

Figure — Bus topologies and arbitration

Three transactions of different lengths sit on a timeline. A dashed line marks — the tallest one. Every real transaction fits under that line:

  • — the actual length of some real turn.
  • — the promise: no single turn ever runs longer than this.

This ceiling is what lets us later multiply instead of adding a messy list of different times.


Step 3 — The unlucky moment: "I just missed my turn"

WHAT. To find the worst wait for a chosen master — call it — we place it in the unluckiest possible situation.

WHY this exact moment? The pointer just passed seat one tick ago, at the very instant decided it wanted the bus. So must now wait for the pointer to travel the entire rest of the circle and come all the way back around to seat .

PICTURE.

Figure — Bus topologies and arbitration

The pointer (red) sits just past (shaded). The green arc shows the journey the pointer must still make before it points at again. That arc is the full waiting time we are about to measure.


Step 4 — Counting exactly how many masters go ahead

WHAT. List the seats the pointer visits before returning to .

WHY count them explicitly? Because the answer is earned by counting, not guessed. We literally enumerate the queue.

PICTURE.

Figure — Bus topologies and arbitration

Starting just past , the pointer visits, in order:

  • — the seat right after .
  • — the seat right before (the last one ahead of us). Check: , exactly the seat behind . Good — that's the last competitor.

Count the list: the offsets run . That is exactly masters. This is where the comes from — it is the number of other seats in the circle. ( seats total, minus your own = others.)


Step 5 — Replacing the sum with the ceiling: the bound appears

WHAT. Swap every unknown for the ceiling from Step 2.

WHY are we allowed to? Because in Step 2 we proved every term is . Replacing each term in a sum by something at least as big can only make the sum bigger or equal — never smaller. So the result is a safe upper bound.

PICTURE.

Figure — Bus topologies and arbitration

The uneven bars of the true sum are all "lifted" to the same height . The total area only grows. Now every one of the bars has identical height, so adding them is just multiplication:


Step 6 — The edge cases (never leave a scenario unshown)

WHAT. Check the boundary values of and the "nobody else is asking" case.

PICTURE.

Figure — Bus topologies and arbitration
Case What happens Formula check
One master, alone. No competition. . Wait is zero — correct.
You and one rival. — wait for at most one other turn. Sensible.
Idle skip Some seats ahead don't actually want the bus. Arbiter skips silent seats immediately, so real wait is often far below the bound. The still holds — it's a worst case, not the typical case.
Large Many masters. Wait grows linearly: . This is round-robin's cost — fairness gets slow when the circle is big. Compare a [[Crossbar

The one-picture summary

Figure — Bus topologies and arbitration

The single figure threads the whole story: the pointer just passed (Step 3) → it must visit the seats ahead (Step 4) → each visit is capped at (Step 2) → stacking caps gives the total (Step 5) → and the corner collapses the whole thing to zero (Step 6).

Recall Feynman retelling — say it like a story

Picture four friends sharing one swing. There's a rule: after you swing, the next friend in the circle gets the swing — a pointer just steps around the ring. Now suppose you just missed the pointer the moment you wanted a turn. How long, at worst, do you wait? You must let the pointer walk past everyone else first — that's the three other friends, i.e. of them. Each of them might take the longest allowed turn, . So your worst wait is three long turns: friends times each. And if you were alone on the swing? , so — no wait, which is obviously right. That's the entire formula, and it can never let you wait longer than it says.

Recall Quick self-check

Where does the come from? ::: It is the count of other masters ahead of you in the worst case — all seats minus your own. Why and not the average transaction time? ::: We want a worst-case guarantee; only the ceiling is safe for real-time deadlines. What does do in ? ::: It wraps the pointer from the last seat back to seat 0, closing the line into a circle. Why doesn't your own turn count in the wait? ::: Your turn is the reward at the end of the wait, not part of it. What does the formula give at , and why is that the correct sanity check? ::: Zero — a lone master waits for nobody, so any correct formula must vanish here.

See also: Bus protocols and signals · Cache coherence · PCIe architecture · 6.3.01 Bus topologies and arbitration (Hinglish)