# How to decide on the depth of the FIFO according to the speed of the two sides?

Status
Not open for further replies.

#### varkylin

##### Junior Member level 2 Hi all:
How do i decide the depth of the FIFO according to the speed of the two sides.
thank you very much

##### Member level 5 Re: depth of the FIFO

The depth of the fifo should be such that there would not be an overflow when you have high speed write clk and a low speed read clk.

#### shavakmm

##### Member level 4 Re: depth of the FIFO

Size of the FIFO basically refers to the amount of data available at a given time. In asynchronous FIFO this depends on both read and write clock domain frequencies and number of data written and read (data rate). Data rate can vary depending on the two clock domain operation and requirement (and of course frequency!). The worst case condition is the maximum data rate difference between read and write clock. This can happen when data rate of writing operation is maximum and for read operation data rate is minimum.

Let fwrite--> be the frequency of write clock domain
Fread--> be the frequency of read clock domain.
Bmax--> burst of data written or maximum number of data bytes can be written
Bwrite--> number of bytes that is written per clock cycle
Bread-->number of bytes that is read per clock cycle

Then FIFO size can be given by,

If number of bytes read or written per clock cycle is one then we have,

In our case, fwrite=10 MHz

Let Bmax=2 then Fsize=2-[(2*2.5)/10] =2-0.5=1.5~2

If Bmax=5, then Fsize=5-[(5*2.5)/10]=5-1.25=3.75~4.

• Thethrulz

### Thethrulz

Points: 2

#### lubee

##### Junior Member level 2 Re: depth of the FIFO

yeah,i do agree with the bro. of the 4th floor.

#### foster_cn

##### Member level 4 depth of the FIFO

I think, the FIFO size is not decided by the speed of the two side, normally is depend on the burst size the maximum fetch size. and how is the exact depth, is case by case.

#### master_picengineer

##### Banned depth of the FIFO

This question has been posted in this forum many times. Try to find this posts.

Status
Not open for further replies.