Advertisement
Home›Topics›FIFO Depth Calculation
VLSI INTERVIEW PREP · CDC

FIFO Depth Calculation Formula

By EcrioniX · 24 Sep 2026 · ~6 min read

Calculating the minimum depth of an asynchronous FIFO is one of the most frequently asked questions in VLSI and ASIC design interviews. Get the calculation wrong in silicon, and your chip drops data. Here is the definitive formula and how to solve it step-by-step.

1. Why Do We Calculate FIFO Depth?

An asynchronous FIFO connects a fast clock domain to a slow clock domain (or vice versa). Because the clocks operate at different speeds, data might arrive in bursts much faster than the receiving side can read it out.

The FIFO acts as a buffer (an elastic reservoir). The "Depth" of the FIFO is the number of memory slots required to absorb the maximum possible burst of incoming data without overflowing, giving the slower read side enough time to catch up.

2. The Standard Formula

To find the minimum safe depth, we must look at the worst-case scenario: maximum back-to-back writes, combined with the slowest possible reads.

Min Depth = Burst_Size - (Burst_Size / F_wr) * F_rd

Let's break down these terms:

The Intuition Behind the Math

The formula is simply computing: "How many items did I write?" MINUS "How many items did I manage to read out while the writing was happening?" The remaining un-read items must be stored in the FIFO!

Advertisement

3. A Classic Interview Example

Question: You are writing data at 100 MHz and reading at 40 MHz. The data comes in bursts of 120 items continuously. What is the minimum FIFO depth required?

Step-by-Step Solution:

  1. Identify the burst size: Burst_Size = 120
  2. Identify frequencies: F_wr = 100 MHz, F_rd = 40 MHz
  3. Calculate time taken for the burst: Time = Burst_Size / F_wr = 120 / 100 MHz = 1.2 microseconds
  4. Calculate items read during that time: Items_Read = Time * F_rd = 1.2 us * 40 MHz = 48 items
  5. Calculate items left over: Leftover = 120 (written) - 48 (read) = 72 items

Answer: The absolute minimum FIFO depth is 72. (In industry, you would round this up to the nearest power of two, which is 128, because RAMs are instantiated in powers of two).

100 MHz TX Domain FIFO Depth: 72+ 40 MHz RX Domain 120 items 48 read out
Visualizing the worst-case burst accumulation inside the FIFO.

4. The "Idle Cycles" Trick Question

Interviewers love to make the scenario more complex by adding idle cycles.

Advanced Scenario

"Write frequency is 100MHz, Read frequency is 100MHz. The writer sends 80 items every 100 clock cycles. The reader reads 8 items every 10 clock cycles. What is the minimum depth?"

Wait, if both are 100MHz, shouldn't the depth be 0? No. You must calculate the worst-case continuous burst.

The worst case occurs when the writer goes idle for 20 cycles, writes 80 back-to-back, and then immediately writes 80 back-to-back in the next 100-cycle window! The actual Burst_Size is 160. Always identify the absolute worst-case packing of data before applying the formula.

5. High-Yield Interview Q&A

Q: What happens if write frequency and read frequency are exactly equal (and continuous)?

A: Theoretically, if F_wr = F_rd and data is continuous, a depth of 1 is sufficient. However, in physical silicon, clock jitter, phase skew, and synchronizer latency mean you always need a minimum depth of 4 to 8 to prevent false "Full" flags.

Q: Why do we always round FIFO depth up to a power of 2?

A: Asynchronous FIFOs use Gray code counters to pass the read/write pointers across clock domains. Gray code naturally wraps around cleanly only when the maximum value is a power of 2 (e.g., 0 to 15, or 0 to 127). Standard SRAM macros are also generated in powers of two.

Advertisement