Professional Documents
Culture Documents
Fifo
Fifo
KRISTI SHARMA
Contents:
•Definition
•Synchronous
•Asynchronous
Definition
FIFO stands
for ‘First In,
First Out’, an
abstraction in
ways of
organizing and
manipulation
of data relative
to time and
prioritization.
Synchronous FIFO
Write_data_in Read_data_out
raddr
waddr
w_en
r_en
CLK Read_enable
Reset
r_clk
w_en
r_en
raddr
waddr
w_ptr w_ptr
r_clk
SYNC
w_clk
reset
reset reset
FIFO WRITE
FIFO READ
CONTROL
CONTROL
write_ena read_en
ble able
full empty
w_clk
Detailed Discussion
Dual port memory=2^n
locations.
If waddr=raddr, the FIFO is
In FIFO control module, either empty or full. To
pointers are used to distinguish between them,
determine memory an additional pointer bit is
addresses, full status, used. Therefore, it is
empty status and FIFO Convenient to have n+1
occupancy. pointer bits.
The write pointer is
incremented for each write
operation. The read pointer
works in the same way. Hence if (wptr[n]=rptr[n]),
the FIFO is empty, and if
(wptr[n]!=rptr[n]) the FIFO
is full.
…Detailed Discussion contd
FIFO occupancy is calculated from pointer values. MSB is
used for performing the calculation.
waddr[n]=raddr[n] : fifo_size = wptr[n-1:0] – rptr[n-1:0]
waddr[n]!=raddr[n] : fifo_size = 2^n –(rptr[n-1:0] - wptr[n-
1:0])
11 11 11
10 10 10
01
00