Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Model a round-robin arbiter

Hardware interview practice

Model a round-robin arbiter

MediumReference ModelsPYTHON

Implement a parameterized round-robin reference model. Given a Boolean request vector, return the next granted index and rotate priority after a grant.

Try it in the question bankReason first. Then compare.

Keep this exact question selected while you check your answer and review the full solution.

Practice this question →
Reviewed example

Work through one case

Input
N=4, next_priority=0; request vector ports {1,3}; evaluate twice, then evaluate no requests
Expected output
grants=1 then 3; next_priority becomes 0; idle returns -1 and leaves priority at 0

The circular scan resumes after each winner and an idle cycle does not rotate priority.

What to cover

Requirements

  1. Search at most one complete wrap around the requester vector.
  2. Return -1 and preserve the priority pointer when no requester is active.
  3. After granting index i, begin the next search at i + 1 modulo N.
  4. Validate the request-vector width.
Continue practicing

Related questions

ArbitersArbitrate fairly between two requesters→
asic.fyi · Learn silicon end to end.info@asic.fyi