You are on page 1of 7

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

DUAL PORT MEMORY

raddr
waddr

w_en

r_en
CLK Read_enable

Reset

Write_enable FIFO CONTROL


Fifo_occup Empty
ancy
Full
Asynchronous FIFO
Write_data_in Read_data_out
DUAL PORT MEMORY

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

fifo_occ r_ptr r_ptr fifo_occ


SYNC
u_in u_out

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

You might also like