FIFO, First-In First-Out Memory

Jamil Khatib


Generic VHDL FIFO core


Top level design:

The First-In First-Out Memory stores the data in queue order so the first input element goes out the first.

Design Approach:

My design depends on the use of dual port memory and generation of both read and write pointers as the addresses for each port.

Depending on this approach my system is divided into four functional blocks as shown in figure 1. This division can be used by almost all other approaches that I am going to discuss two of them later.


  
Figure 1: System Block Diagram

Interface:

Signal Name Signal Type Description Notes

DATA_IN[7:0]

input bus input data to be stored  

DATA[7:0]

output bus output data  

RE

input read enable signal Active High
WE input write enable signal Active High
SYSCLK input system global clock  
RESET input system global reset Active Low
HALF_FULL output half full signal Active high
FULL output full signal no further write attempts are enabled Active High
EMPTY output Empty signal no further read attempts are enabled Active High


Controller Block:

The controller part determines and generates the valid read and write signals depending on both the flags and the system read and write requests.

RE EMPTY RE_MEM

0

0 0
0 1 0
1 0 1
1 1 0

   


Table 1: Read Operation truth table

WE FULL WE_MEM

0

0 0
0 1 0
1 0 1
1 1 0

   

Table 2: Write Operation truth table


Address generation Block:

This block generates both pointers to the next address to be read and to be written.

Interface:

Signal Name Signal Type Description Notes
CLK input system global clock  
RESET input system global reset Active Low
RE input read enable signal Active High
WE input write enable signal Active High
W_ADDR[7:0] output bus The Write pointer  
R_ADDR[7:0] output bus The Read pointer  

     

Implementation:


Dual port memory block:

This block is the storage core of the FIFO.

Interface:

Signal Name Signal Type Description Notes

CLK

input system global clock  
RESET input system global reset Active Low
RE_MEM input read enable signal Active High
WE_MEM input write enable signal Active High
WA[7:0] input bus The Write address  
RA[7:0] input bus The Read address  
DIN[7:0] input bus The input data  
DOUT[7:0] output bus The output data.  

     

Implementation:


The Flags Block:

This block is one of the most problematic blocks. This block generates the required flags that control and validate the read and write signals. It generates three signals, the FULL signal, which indicates that the FIFO is Full and so no further write operation should be attempted. The HALF_FULL signal which is just an indication that Half the FIFO is full or empty. Finally the EMPTY signal that indicates that the FIFO is empty and no further read operation should be attempted unless a single byte is written to the FIFO.

Interface:

Signal Name Signal Type Description Notes

CLK

input system global clock  
RESET input system global reset Active Low
RE input read enable signal Active High
WE input write enable signal Active High
FULL output Full flag active high
HALF_FULL output half full flag active high
EMPTY output empty flag active high

     

Implementation:


  
Figure 2: Read and write Pinters Block Diagram


Improvements and other approaches:

The Flag generation block can be implemented differently by comparing both the Read and Write addresses without adding the Extra counter. In this way the size of the system will decrease.

Another way of implementing the memory core is by using a single port memory and make an arbitration between the read and write operation. This approach will decrease the system size specially for FPGAs and it also decreases the speed of the system.

Array of shift registers can be used to implement the memory core block while a controller is used to control the shift operation. So the input data goes to the first register while the output data goes from the last register. The input data should be shifted down to the last empty register.

The controller can be implemented with self-timed design technique which make the system much faster.


References and circuits


About this document ...

FIFO, First-In First-Out Memory

This document was generated using the LaTeX2HTML translator Version 98.1 release (February 19th, 1998)

Copyright © 1993, 1994, 1995, 1996, 1997, Nikos Drakos, Computer Based Learning Unit, University of Leeds.

The command line arguments were:
latex2html -split 1 -ps_images FIFO.

The translation was initiated by Jamil Khatib on 1999-03-28


Jamil Khatib
1999-03-28
1