Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutRoadmapCareersInternshipsFAQContactPrivacyTerms
Skip to lesson

Course contents

  • How to Use This Puzzle Bank
  • SystemVerilog Language Puzzles25
  • Difficulty Guide
  • Full Topic Map
  • Interview-Day Tips
  • Study Route: One Week Before the Interview
  • Study Route: Two Weeks
  • Study Route: Four Weeks (Full Course)4
  • OOP & Testbench Puzzles25
  • Concurrency & Timing Puzzles25
  • Randomization & Constraint Puzzles25
  • SVA Assertion Puzzles25
  • Functional Coverage Puzzles25
  • Logic & Aptitude Puzzles25
  • Scenario & Debug Puzzles25
  • UVM Testbench Puzzles25
  • Clock, Reset & CDC Puzzles25
  • Bus and Interface Protocol Puzzles25
    • Valid/Ready Handshake Puzzles
    • APB Protocol Puzzles
    • AXI Protocol Puzzles
    • FIFO, Arbitration and Credit Puzzles
      • Sizing a FIFO for a Rate Mismatch Burst
      • Empty and Full With Simultaneous Read and Write
      • Full and Empty From Gray-Coded Pointers
      • Round-Robin Grants and the Starved Requester
      • Credit Window vs Round-Trip Time
      • Circular Wait Between Two Full Queues
    • Bus and Interface Protocol Puzzles: Tricky Q&A
  • Interview Prep: Puzzle Rounds7
  • DV Puzzle Cheatsheet
Loading lesson

←FIFO, Arbitration and Credit Puzzles
  1. Topics
  2. DV Interview Puzzles
  3. Bus and Interface Protocol Puzzles
  4. FIFO, Arbitration and Credit Puzzles
  5. Sizing a FIFO for a Rate Mismatch Burst
On this page

    VLSI DV Interview PuzzlesAll levels

    Sizing a FIFO for a Rate Mismatch Burst

    A producer writes a burst of 64 words, one word every 10 ns (100 MHz). The consumer reads one word every 20 ns (50 MHz) whenever the FIFO is non-empty, starting 10 ns after the first write. No other traffic. Ideal model: no synchronizer latency, and when a read and a write fall at the same instant the read frees its slot first. What is the minimum depth so nothing is lost?

    Puzzle

    Difficulty: Easy · Puzzle 1 of 6 · Topic: FIFO, Arbitration and Credit Puzzles

    A producer writes a burst of 64 words, one word every 10 ns (100 MHz). The consumer reads one word every 20 ns (50 MHz) whenever the FIFO is non-empty, starting 10 ns after the first write. No other traffic. Ideal model: no synchronizer latency, and when a read and a write fall at the same instant the read frees its slot first. What is the minimum depth so nothing is lost?

    Code

    design.sv
    // producer clock: 100 MHz, 1 word per clock for 64 clocks
    // consumer clock:  50 MHz, 1 word per clock whenever not empty
    // question: minimum FIFO depth (words) with no overflow

    Hint

    Count the words written and read at the end of the burst; the peak occupancy is at the last write.

    Step-by-step solution

    Diagram
    1) The burst takes 64 x 10 ns = 640 ns.
    2) In that time the consumer reads about 640 / 20 = 32 words.
    3) Peak occupancy = written - read = 64 - 32 = 32 words (reached around the last write).
    4) The formula is depth = burst x (1 - fr/fw) = 64 x (1 - 0.5) = 32. The Python model steps the time line in 1 ns and finds the same peak.

    Answer

    Answer: 32 words in the ideal model.

    How this was checked

    Checked by running a model of the rule in a Python model. A time-stepped Python model (reader starts 10 ns after the first write) reproduces the closed-form depth of 32.

    Why candidates get it wrong

    Using the full burst length (64) forgets that the reader drains during the burst; using the formula with the ratio inverted gives 64 x (1 - 2) = negative. And the ideal number is a minimum: an asynchronous FIFO's write side sees the read pointer several write clocks late, so real designs add margin for the synchronizer delay and round up (Gray-coded FIFOs also need a power-of-two depth).

    Interviewer follow-up

    How would the required depth change if the consumer could not start until the whole burst had arrived? Model answer: It becomes the full burst, 64 words, because nothing is drained during the burst. The formula assumes the reader runs concurrently.

    Related topics

    • Back to FIFO, Arbitration and Credit Puzzles

    • Bus and Interface Protocol Puzzles section

    Previous

    279 / 293

    Next: Empty and Full With Simultaneous Read and Write

    Up next

    Up nextEmpty and Full With Simultaneous Read and Write

    Sign in to save progress

    Practice this lessonPrevious lessonReport an error

    See also

    • Full and Empty From Gray-Coded Pointers
    • Round-Robin Grants and the Starved Requester
    • Credit Window vs Round-Trip Time