2026-07-19
A fixed-priority arbiter is trivially small — a priority encoder picks the lowest-indexed requester. It's also trivially unfair: if requester 0 hammers the bus, requesters 4-7 starve forever. A full round-robin arbiter fixes this by rotating a "last-served" pointer, but the pointer register plus the rotating logic adds area and a critical path through a barrel shifter. The masked priority arbiter (also called a programmable priority arbiter) is the compromise: it uses two fixed-priority arbiters and one mask register to get round-robin behavior at roughly 1.3× the area of a plain priority encoder.
The trick: keep a mask M that hides requests already served this round. Compute two grants in parallel — grant_hi from the masked requests (req & M) and grant_lo from the raw requests. If any masked request exists, use grant_hi; otherwise fall through to grant_lo (a new round). After granting bit i, update the mask to M = ~((grant << 1) - 1) — clear all bits at or below the winner, so next cycle they can't win again until the mask wraps.
Worked example, 4 requesters: requests = 1111, mask starts 1111.
1111, grant bit 0. New mask = 1110.1110, grant bit 1. New mask = 1100.1100, grant bit 2. New mask = 1000.1000, grant bit 3. New mask = 0000.0000 (empty) → fall through to raw, grant bit 0, mask resets to 1110.Every requester gets served exactly once per round. This is weak fairness: bounded waiting time of N-1 cycles for N requesters, without a rotating pointer or barrel shifter.
Real-world use: AMBA AXI interconnects and NoC routers use masked priority arbiters at every crossbar switch point. A 16-port switch has 16 arbiters (one per output), each 16 bits wide — using round-robin state machines would cost 16 × (16-bit pointer + 16:1 barrel shifter) versus 16 × (two 16-bit priority encoders + 16-bit mask reg). The mask approach saves roughly 30% area and one gate of critical path.
Rule of thumb: a masked arbiter's critical path is 2 × log₂(N) gates for the priority encoders plus one 2:1 mux. A pointer-based round-robin adds another log₂(N) gates for the rotator — significant when N ≥ 8 and the arbiter sits in a single-cycle bus-grant loop.
