You are on page 1of 1

File: /home/satej/fodepth

Page 1 of 1

The logic is very simple. I will expalin it in a non technical way. Suppose there is a person A and B. Now A can throw 10 mangoes at an instant of time. But B can catch only 6 mangoes at the same amount of time (remember this is very important i.e the phrase same amount of time which i have written above. This will help in calculating the FIFO size). So he cannot catch remaining 4 mangoes from A. So he require a bag of size 4. This is the funda behind the FIFO size/depth calculation. In technical terms i will explain Asssume sender as Person A Assume Receiver as Person B. Assume FIFO as a bag. Sender is writing a data to FIFO and receiver is reading some data from FIFO. If sender writes 10 data in 't' time and receiver reads 6 data in the same 't' time then FIFO size is 10-6=4. FIFO has two frequency one is sender frequency(fs) and the receiver frequency (fr). fs=1/Ts; fr=1/Tr; Now sender wants to transmit M words of data But FIFO can take only n words of data in Ts time. So the time taken to transmit M words is M/n*Ts That is sender wants M/n*Ts time to write M words of data into FIFO. But our receiver can receive/read 'p' words in Tr time interval. In Tr times receiver can read p words So in M/n*Ts time how many words can receiver read. It is (M/n*Ts*p)/Tr words the receiver can read. Till now what did we do. We calculated how much time we want to write M words of data into FIFO. In the same amount of time how much data can our FIFO read. so simply subtract the the data read from FIFO to the data written into the FIFO. Here the data written into the FIFO is M words Data read from the FIFO is (M/n*Ts*p)/Tr words. So FIFO size is = M-(M/n*Ts*p)/Tr This is equivalent to our example 10 - 6. Deduce this u will get Fifo size= M ( n * fs - &nbspp *fr ) / (n *fs ) Where M= Max number of bytes that the sender can send n= No of bytes that the sender sends per clock fs= sender clock frequency p= No of bytes that receiver can receive per clock fr = receiver clock frequency

You might also like