Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help me calculate the size of FIFO needed

Status
Not open for further replies.

ASIC_intl

Banned
Full Member level 5
Joined
Jan 18, 2008
Messages
260
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,298
Activity points
0
Suppose Data is coming at the input of a FIFO with an average rate of 50 words per 100 clocks (average write rate). The MAXIMUM rate of data coming to FIFO input is 7 words per 10 clocks. The reading rate at the reading side of the FIFO is that in two clock cycles it can read one word only. Among the two clock cyles for reading the reading operation of the single word occurs only in first clock cycle and not in second clock cycle.Can u calculte the size of FIFO needed for this?
 

FIFO problem

Lets consider the worst case scenario,

Atmost 7 words can come per 10 cycles. Lets say starting from fifo empty, we saw 7 cycles each having a word then followed by 3 cycles with no word - so that maximum word rate holds true.

So at 7th cycle, we are writing 7th word into the fifo. By this time the read side had 7 cycles to read ( assuming synchronous fifo). When the first word was written on 1st cycle, read side can read it at 2nd cycle at the earliest. So in 6th cycle, its reading 3rd word, and 4th word would be read in 8th cycle.

So going back to 7th cycle, when write side gets 7th word, there are 6(written)- 2 ( read) entries in fifo. So minimum depth that it should have is 4 + 1 ( being written in 7th fifo) in order to not overflow or cause write side to stall.
 

Re: FIFO problem

Hi rjainv

But after first 10 clock cycles the situation is 5 words have been read and 2 words are still there to be read in your size of 5 of the FIFO. Now again in next 10 cycles the worst case i.e. 7 words/ 10 cycles may occur and it can continue for upto first 40 cycles to maintain an average write rate of 50 words per 100 clock cycles. IN that case the size of 5 for the FIFO will not be an accurate value.


Please note that reading occurs as one word per two cycles. It is not necessarily that reading shoud occur in the first cycle among the two cycles as mentioned in my question. It is a mistake in the question.
 

Re: FIFO problem

Yes you are right. I later realized that i had not taken correct worst case scenario.

Worst case scenario would be that write side writes maximum 50 words in 71 cycles, and by 71st cycle, read side would have read minimum 34 words ( read side saw word available in 2nd cycle, but started reading only second cycle of two cycle phase, i.e. 3rd cycle as counted from global count ).

So fifo sizing needs to be 50-34 = 16.
 

Re: FIFO problem

i think minimum fifo depth size is 4. we should consider maximum rate.So, we can write only 7 words in 10 clk cycles.This can be random so in 20 clk cycles we can write maximum 14 words. in reading side,only 10 words are read in 20 clk cycles..so minimum depth is 4.

correct me if i am wrong
 

Re: FIFO problem

I think solution by jainv is correct
 

FIFO problem

Hi guys ,
I have a different Solution for the same question .

As the Qst says at rate of 50 bytes in 100 clks , and the max rate is 7 per 10 clks ,so we need minimum of 71 clks to complete 50 bytes .

and these 71 clks can be at any stage like 0-71 , 10-81 ,20-91,29-100,

After 1st 100 clks again in 101-200 clks period another 50 bytes write will happen

So best case scenario will be when In the first 0-100 period the write happens in 29-100 clks and in the second 101-200 period 101 -172 ,
So in this duration from 29-172 , we will have continous data coming of 100 bytes in total 142 clks

but in read side , we can read only 71 bytes in 142 clks at the rate of 1 byte in two clocks , so out of 100 we can read 71 , remaing 29 wil be left ,so 29 will be the depth .

My answer is 29 ,
Please correct me if i am wrong !!!
 
FIFO problem

Hi all,
I think sreekanthb4u's scenario is the worst case.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top