Wednesday, July 8, 2009

FIFO Depth Calculation



We know that FIFO is useful for synchronizing between two clock domains .

In the case of FIFO ,FIFO depth calculation is very important. If we didn't calculate the depth of FIFO properly there is a chance to miss the data( information ).

You can find different equations & solutions from various website .

Here i am trying to explain FIFO depth calculation by a simple example.


Assume that Write Clock Frequency WClk = 200 Mhz
Read Clock Frequency RClk = 100 Mhz
No of data per 100 WClk cycle (Data rate including delay) = 80 data

So

WClk = 200Mhz = 5ns
RClk = 100 Mhz = 10ns

Total Time Taken for writing 80 data = 80*5 = 400ns .
But Time Taken for reading 80 data = 80*10 = 800 ns .

So difference b/w data write & read
same no of data = 800 -400 = 400 ns .


ie we want to store 400ns data to some position.Otherwise data will over write .

How many data will write this 400ns time = 400ns/5ns = 80 .

We have to store this 80 Data .

So we can say that FIFO should have minimum depth of 80 .