Hardware interview practice
Model a round-robin arbiter
Implement a parameterized round-robin reference model. Given a Boolean request vector, return the next granted index and rotate priority after a grant.
Reviewed example
Work through one case
Input
N=4, next_priority=0; request vector ports {1,3}; evaluate twice, then evaluate no requestsExpected output
grants=1 then 3; next_priority becomes 0; idle returns -1 and leaves priority at 0The circular scan resumes after each winner and an idle cycle does not rotate priority.
What to cover
Requirements
- Search at most one complete wrap around the requester vector.
- Return -1 and preserve the priority pointer when no requester is active.
- After granting index i, begin the next search at i + 1 modulo N.
- Validate the request-vector width.
