Interviews
FIFOs and Arbitration Interview Questions
Practise the question, then the follow-ups an interviewer asks next.
Start with a Question TreeAI Mock Interview
- 7
- Question trees
- 45
- Follow-ups
- 61
- Wrong answers explained
- 13
- Runnable on a simulator
Flagship Questions · With follow-ups
Question Trees
Each question opens into the follow-ups an interviewer asks next, the wrong answers people give, and what a fresher's and a senior's answer sound like.
-
A Fixed-Priority Arbiter Under Load
Requester 0 asks on every other cycle and requester 3 asks every cycle, for 100 cycles. How many grants does each get from this arbiter? 5 follow-ups · 7 pitfalls · 2 runnable -
Writing a Round-Robin Arbiter
Write a 4-requester round-robin arbiter. After a requester wins, it should have the lowest priority next time. 6 follow-ups · 7 pitfalls · 3 runnable- Likely at AMD
- Likely at Intel
-
What Fair Arbitration Really Means
Two masters share a bus through a round-robin arbiter. One sends 1-beat packets and the other sends 8-beat packets. Is the bus shared fairly? 4 follow-ups · 8 pitfalls · 1 runnable -
The Extra Pointer Bit in a FIFO
This 8-entry FIFO uses 4-bit pointers for 3 address bits. Why the extra bit? When arefullandemptytrue? 12 follow-ups · 15 pitfalls · 3 runnable -
Sizing a FIFO from Burst Arithmetic
A source writes a burst of 32 words, one per cycle. The reader waits 4 cycles before its first read, then reads one word every 2 cycles. How deep must the FIFO be? Write the calculation so it works for any burst. 6 follow-ups · 8 pitfalls · 2 runnable -
Inside an Asynchronous FIFO
Draw an asynchronous FIFO between two unrelated clocks. What crosses between the domains, and how are full and empty computed? 7 follow-ups · 9 pitfalls · 1 runnable- Asked at AMD
-
Defending the FIFO You Designed
Walk me through the FIFO in your last project. What were the rare cases, and how do you know it handles them? 5 follow-ups · 7 pitfalls · 1 runnable
No question matches these filters.
Quick revision · One flat list
Question Bank
All 34 FIFOs and Arbitration questions, main and follow-up. Open a track, then a topic. Answer out loud first, then open the short answer.
Jump to a Track
34 questions · 6 topicsFIFOs and Arbitration
A Fixed-Priority Arbiter Under Load5
Requester 0 asks on every other cycle and requester 3 asks every cycle, for 100 cycles. How many grants does each get from this arbiter? L0L1
Requester 0 wins every cycle it asks, so it gets 50 grants. Requester 3 wins only in the cycles where requester 0 is quiet, which is the other 50. The if-else chain is a priority encoder: each later branch is reached only when all earlier requests are low. If requester 0 asked every cycle, requester 3 would get nothing.
QuestionPractise A Fixed-Priority Arbiter Under Load →Why is a fixed-priority arbiter the same as a priority encoder, and how can you write it without a chain of ifs? L0L1
Both pick the lowest-numbered active input. In two's complement, req & -req keeps only the lowest set bit, which is exactly the grant. Synthesis gives about the same gates for either form, so choose the one the team reads most easily.
Compare fixed priority with round robin. When would you choose each? L1
Fixed priority is tiny, has no state, and gives a guaranteed fast response to the top requester. But it can starve the rest. Round robin needs a little state and gives each active requester a turn within N grants. Use fixed priority for rare urgent requests and round robin for peers that share a resource.
Follow-upPractise Fixed Priority Versus Round Robin →You have one urgent requester and eight normal ones. How would you combine the two schemes? L2
Use two levels. The urgent requester has fixed priority over a round robin of the eight. To stop it from starving everyone, limit it. Use a maximum request rate, or let one normal grant through after a few urgent ones. Then you can state a worst-case wait for both classes.
Follow-upPractise Mixing Urgent and Normal Requesters →What if the grant must come from a flop because it drives a long path? L1L2
Register the grant, so it is valid one cycle after the request. The requester must then hold its request until it sees the grant. The arbiter must not grant a requester that has already dropped its request. Latency grows by a cycle, which matters for short transfers.
Follow-upPractise A Registered Grant →Writing a Round-Robin Arbiter5
Write a 4-requester round-robin arbiter. After a requester wins, it should have the lowest priority next time. L1L2
Keep a mask of the requesters above the last winner. First look for the lowest requester inside the mask. If there is none, wrap around and take the lowest requester overall. After each grant, set the mask to the bits above the winner. The pointer moves only on a grant, so an idle cycle changes nothing.
QuestionPractise Writing a Round-Robin Arbiter →Why must the round-robin pointer move only when a grant is given? L1
Round robin promises that the winner goes to the back of the queue. Suppose the pointer moves on cycles with no grant, or past idle requesters. Then some requester ends up first more often than the others. Tying the update to the winner keeps the promise for any request pattern.
Follow-upPractise Why Priority Moves Only on a Grant →What if a grant must be held for a multi-cycle transfer? L2
Lock the grant until the transfer ends, for example on a last signal. Update the mask only when the lock is released. Otherwise the arbiter may switch owners in the middle of a burst. The lock also means the worst-case wait now depends on the longest transfer.
Compare the mask arbiter with an arbiter that rotates the request vector, uses a fixed-priority encoder, and rotates the grant back. L2
Both give the same grants. The rotate form needs two barrel shifters, which grow with N times log N and add depth. The mask form uses two fixed-priority searches and a mux, which map well to fast carry-style logic. For small N either is fine; for large N the mask form is usually smaller and faster.
Follow-upPractise Mask Arbiter Versus Rotate-and-Encode →The arbiter must now serve 64 requesters at a high clock. What changes? L2L3
The lowest-bit search across 64 bits becomes the critical path. One option is a tree of small arbiters: eight groups of eight, with a round robin over the groups. Another is a pipelined arbiter that grants one cycle later. The tree changes fairness slightly, because each group gets an equal share regardless of how many requesters it has.
Follow-upPractise Round Robin for Many Requesters →What Fair Arbitration Really Means5
Two masters share a bus through a round-robin arbiter. One sends 1-beat packets and the other sends 8-beat packets. Is the bus shared fairly? L3
Fair in grants, not in bandwidth. Round robin gives each master one packet per turn, so the 8-beat master gets 8 of every 9 beats. If the goal is equal bandwidth, the arbiter must count beats, for example with deficit round robin or weights. Start by asking what "fair" means in the spec: grants, bandwidth, or a bounded latency.
QuestionPractise What Fair Arbitration Really Means →Compare weighted round robin with deficit round robin. L3
Weighted round robin gives each master a fixed number of grants per round. It suits equal-size transfers, but long packets still skew the bandwidth. Deficit round robin gives each master a budget of beats per turn and carries any unused budget to the next turn. So bandwidth follows the weights even with mixed packet sizes, at the cost of a counter per master.
Follow-upPractise Weighted Round Robin Versus Deficit Round Robin →Why does round robin give a latency bound, and what sets it? L2L3
A waiting master is served before any other master gets a second turn. So it waits at most one turn for each of the other N - 1 masters. The bound in cycles is the sum of their longest transfers. That is why long bursts hurt everyone's worst-case latency, and why buses limit burst length.
Follow-upPractise The Worst-Case Wait Under Round Robin →What if one master sends 256-beat bursts and another needs an answer within 50 cycles? L3
Round robin cannot meet that, because one turn of the long master already lasts 256 cycles. Split long bursts into shorter ones at the master or the interconnect, or give the urgent master priority with a rate limit. Splitting costs some efficiency, because each burst pays its own address overhead.
Follow-upPractise Limiting Burst Length for Latency →How would you verify that an interconnect arbiter meets its fairness and latency goals? L3L4
Turn each goal into a measurable check. For starvation, assert that every request is granted within a bound. For bandwidth, measure each master's share over a window under saturating traffic. For latency, record the worst wait per master. Then cover the hard patterns: all masters busy, one master idle then sudden, and mixed burst sizes.
Follow-upPractise Verifying Fairness on an Interconnect →The Extra Pointer Bit in a FIFO10
This 8-entry FIFO uses 4-bit pointers for 3 address bits. Why the extra bit? When are full and empty true? L1
With only address bits, equal pointers mean either empty or full, and you cannot tell which. The extra bit tells whether the pointer has wrapped an odd or even number of times. Equal pointers, extra bit included, mean empty. Equal address bits with different extra bits mean the writer is one whole lap ahead: full. So all 8 entries are usable with no counter.
QuestionPractise The Extra Pointer Bit in a FIFO →Compare keeping a level counter with using the extra pointer bit. L1L2
A level counter gives full, empty and the fill level directly, and it works for any depth. It costs a counter and an adder that updates on reads and writes. The extra bit costs one flop per pointer, but it needs a power-of-two depth. Only the extra-bit style carries over to an asynchronous FIFO, where no single counter can see both clocks.
Follow-upPractise A Level Counter Versus the Extra Pointer Bit →Draw an asynchronous FIFO between two unrelated clocks. What crosses between the domains, and how are full and empty computed? L2L3
The memory is written in the write domain and read in the read domain. Only the two pointers cross, each Gray-coded and through two flops. The write side compares its pointer with the synchronized read pointer to compute full. The read side compares the other way to compute empty. Each side sees the other pointer late, so a flag can stay on too long, but it is never wrongly off.
QuestionPractise Inside an Asynchronous FIFO →Why is it acceptable that the write side sees the read pointer a few cycles late? L2
A late read pointer looks like fewer reads than really happened. So the write side thinks the FIFO is fuller than it is, and full may stay high a little too long. It never thinks there is space that is not there. The same reasoning makes empty late but safe on the read side.
Follow-upPractise Why Async FIFO Flags Are Late but Safe →What if the source needs a warning before full, because it takes 3 cycles to stop? L2L3
Raise almost-full when the free space drops to the number of words the source can still send after the warning. Here that is 3, plus any cycles the flag itself takes to reach the source. In an asynchronous FIFO, the flag is already pessimistic, which adds a little margin at no extra cost.
Follow-upPractise Setting an Almost-Full Threshold →Compare a Gray-coded value with a request/acknowledge handshake for carrying a multi-bit value across clock domains. L2
Gray code changes one bit per step, so a value caught mid-change is either the old or the new one. It suits counters that move by one, such as FIFO pointers. A handshake holds any data stable while a synchronized request crosses and an acknowledge comes back. It carries any value, but takes several cycles per transfer. Choose Gray for streaming pointers, and a handshake or FIFO for occasional wide data.
Follow-upPractise Gray-Code Pointers vs a Handshake for Multi-Bit Crossings →The FIFO uses Gray pointers and two-flop synchronizers. How could it still fail in silicon? L3
Gray code assumes the bits arrive close together. If the wires of one pointer differ by more than about a clock period, two steps can mix. Logic between the Gray register and the synchronizer can glitch. And a Gray pointer that is computed but not registered can show several bits changing.
Follow-upPractise Breaking a Gray Pointer Crossing →How do you sign off clock domain crossings on an SoC with dozens of clocks? L3L4
Start with structural analysis: define the clocks and their relationships. Then let the tool find every crossing and check that each has the right synchronizer for its type. Next comes protocol checking: each scheme's rules, such as hold times and Gray steps, become assertions in formal and simulation. Add reconvergence checks and reviewed waivers. Use metastability injection in simulation to expose designs that assume exact timing.
Follow-upPractise CDC Sign-Off on a Many-Clock SoC →Why might you register full and empty instead of computing them from the pointers? L2
Combinational flags sit after a pointer compare, and the other block uses them in its own logic in the same cycle. That makes a long path across two blocks. Registered flags start that path at a flop. The cost is that you compute next-cycle flags from the next pointer values, which is easy to get wrong at the boundaries.
Follow-upPractise Why FIFO Flags Are Often Registered →What if the FIFO must be 6 entries deep? L2
The address bits no longer wrap by themselves at the end of the memory. Each pointer must wrap by compare: back to 0 after 5. Then track full with a lap bit that flips on each wrap, or keep a level counter. Many teams just round up to 8 when the area allows.
Follow-upPractise A FIFO Whose Depth Is Not a Power of Two →Sizing a FIFO from Burst Arithmetic4
A source writes a burst of 32 words, one per cycle. The reader waits 4 cycles before its first read, then reads one word every 2 cycles. How deep must the FIFO be? Write the calculation so it works for any burst. L1L2
The FIFO must hold the highest level reached during the burst. Count words written minus words read, cycle by cycle, and take the peak. Here 32 words go in and 14 come out during the burst, so the depth is 18. The run writes that count as a function, then simulates the traffic and sees a peak of 18 with no overflow.
QuestionPractise Sizing a FIFO from Burst Arithmetic →Why can no FIFO depth be correct if the writer is faster than the reader forever? L1
A FIFO stores the difference between what came in and what went out. If the writer is faster on average, that difference grows without limit. A FIFO only absorbs bursts: periods of faster writing followed by idle time. For a steady rate mismatch you need backpressure, not depth.
Follow-upPractise Why a FIFO Needs a Maximum Burst →What if the writer runs at 200 MHz and the reader at 150 MHz, with a 120-word burst? L2
Work in time, not cycles. The burst lasts 120 / 200 MHz = 600 ns. In that time the reader takes about 150 MHz x 600 ns = 90 words, so about 30 must be stored. In an asynchronous FIFO, add the synchronizer delay on the pointers. That is a few cycles in which the reader cannot see new data yet.
Follow-upPractise FIFO Depth Across Two Clocks →Compare sizing the FIFO for the worst burst with letting it apply backpressure to the source. L2
A FIFO sized for the worst burst never stalls the source, which matters when the source cannot wait, such as a sensor. Backpressure keeps the FIFO small, but the source must be able to pause, and throughput drops while it waits. Many designs use both: enough depth for normal bursts, and a ready or credit signal for the rest.
Follow-upPractise A Deeper FIFO Versus Backpressure →Defending the FIFO You Designed5
Walk me through the FIFO in your last project. What were the rare cases, and how do you know it handles them? L1L2L3
Start with the spec: depth and why, widths, and what happens on a write at full and a read at empty. Then name the corners: write at full, read at empty, both at the same edge, wrap-around, and reset with data inside. For each, say what the design does and which test or assertion proves it. Finish with what you would add next, such as formal checks on the flags.
QuestionPractise Defending the FIFO You Designed →The FIFO is full, and a read and a write arrive at the same edge. What should happen? L1L2
It is a design choice, and the spec must state it. The simple rule refuses the write, because full was high before the edge. A more efficient rule accepts it, because the read frees a slot in the same cycle. The second rule makes full depend on rd_en, which can create a long path back into the reader.
What if the FIFO is empty and a read and a write arrive at the same edge? L1L2
With the usual rule, the read is refused, because empty was high before the edge, and the write goes in. The word comes out one cycle later. A first-word-fall-through design shows the new word on the output soon after. It still counts as read only when rd_en is high and the FIFO is not empty.
Compare checking your FIFO with assertions inside the RTL and with a scoreboard in the testbench. L2
Assertions in the RTL check local rules every cycle: never full and empty together, and no pointer move on a refused write. They also go to formal tools. A scoreboard checks the data end to end: every word out equals the word in, in order. The two catch different bugs, so a solid FIFO has both.
Follow-upPractise FIFO Assertions Versus a Scoreboard →How do you reset a FIFO that still holds data, and what changes for an asynchronous FIFO? L2L3
In one clock domain, resetting both pointers empties the FIFO. The RAM contents can stay, because nothing reads them. In an asynchronous FIFO, each side resets in its own domain. For a few cycles, one side may see the other's old pointer. Hold both sides in reset together, or block traffic until both resets have released.
Follow-upPractise Resetting a FIFO That Holds Data →Your Review Queue
Saved review reminders are coming soon.