128-Bit Asynchronous Gray Code FIFO Using Verilog HDL
128-Bit Asynchronous Gray Code FIFO Using Verilog HDL
FIFO, short for "First in First Out," indicates that the data
values written first will be read first. In asynchronous FIFOs, Fig 1. Design of Asynchronous FIFO
two pointers, namely the read and write pointer, keep track of
the addresses where data is to be written and read. The write
B. Modules in Asynchronous FIFO
pointer points to the address where the next data value is to
be written, while the read pointer points to the address from
where the next data value is to be read. In asynchronous An asynchronous FIFO design is divided into several
FIFOs, the read operation is done in the read clock cycle, sections, with each section developed as an independent
whereas the write operation is done in the write clock cycle. module. The top-level module then instantiates these
The read and write pointers are incremented after each clock modules and connects them through the appropriate signal
cycle to point to the next address, allowing the read and write lines[8]. The design consists of the following modules:
of data values, respectively. If the read and write operations
are done using the same clock signal, such types of FIFOs are
known as Synchronous FIFOs.
1660
Authorized licensed use limited to: Zhejiang University. Downloaded on July 30,2025 at 02:14:30 UTC from IEEE Xplore. Restrictions apply.
979-8-3303-6810-9/24/$31.00 ©2024 IEEE
2nd International Conference on IoT, Communication & Automation Technology
I.Dual Port RAM Memory Module synchronized with the read clock domain.
The read pointer and the write clock domain are synchronized
II.Read Pointer Module
by the write synchronizer module. It receives a 5-bit read
III.Write Pointer Module pointer, which the write pointer uses to ascertain the FULL
FIFO's conditions. The write synchronizer is made up of two
IV.Read Synchronizer
D flip-flops that are synced with the writing clock domain,
V.Write Synchronizer same like the read synchronizer.[10]
C. EMPTY AND FULL CONDITIONS
I.Dual Port RAM Memory Module Read and write pointers are shown here, each of them
RAM memory with two ports for simultaneous reading and comprises a module that provides some level of operational
writing.This is in contrast to a single port RAM where only significance or effectiveness to the respective pointer. No
one operation can be performed at a particular clock cycle, sooner does the reader and the writer both place their writing
either a read operation or a write operation instruments on the table to rest than they notice that their
This model of FIFO uses a Dual Port RAM Memory with a respective document is similarly parked. When the read
size of 16 bytes, where each location can store 8 bits. pointer reaches the write pointer and tries to perform reading,
However, with minor modifications to the code, the size of the empty flag signal, read out of the read clock domain, is
the RAM Memory can be increased to 32 bytes, 128 bytes, 1 raised indicating that the FIFO is empty. At the same time, it
Megabyte, and so on. The module of the Dual Port RAM means the FIFO memory is full and the full flag from the
Memory is named as "memory_FIFO". [9] write clock domain will turn on, meaning the CPU write
The write operation is performed using the clock cycle of 10 pointer is as fast as the read pointer to a FIFO system. This
ns, which is provided using the testbench with the help of a adds a level of control that is necessary especially when one
"write_clk" signal line. Before performing the write is dealing with read and write operations so that there is no
operation, the module checks two conditions: whether the data loss or data overwrite[11].
FIFO is full or not, and whether the write enable signal is high The read pointer is contained in the FIFO memory with the
or not. If the FIFO is not full and the write enable signal is help of the read address, while the pointer module is
high, then the data is written into the FIFO Memory. The concerned with the FIFO write address and the FIFO write
address where the data is to be written is provided by the full flag. Read and write synchronizers make it possible to
write pointer. avoid mismatch in pointers of the two domains and thus
enable synchronization of operations. They also have control
over other operational aspects of the FIFO such as write_reset
II. Write and Read pointers Moduls and read_reset.
In the design, a Write pointer module is incorporated. In the
write clock domain, all the FIFO logic that is created is I. FIFO Empty Conditions
moved to the write pointer module, wherein the storage write
pointer module is designed. The storage write pointer module To elaborate more, there are two D flip-flops in the read
employs a gray code counter. There is transmitted to the synchronizer module which are used to synchronize the gray
FIFO memory a 4-bit write address which indicates the code version of the read pointer to the domain of the write
address to which the data values will be written to. Thus, the clock. This time, its gray code equivalent of the synchronized
binary address is increased in count by one bit to form a 5bit read pointer within the write synchronizer module is
pointer. This 5 bit pointer is then converted to gray code and subjected to a comparison. The method uses the initial two
fed to the read synchronizer[12]. There is thus also provided bits of the read pointer's gray code counterpart and compares
in the structure a read pointer module which is used to them with the last two bits of the gray code counterpart of the
indicate the address from which data is to be retrieved from write pointer[13]. If the first two bits match, the still unused
FIFO memory. There are also contained in the read pointer portion of the read pointer will have its bits compared to the
module all the FIFO logic that is generated in the read clock corresponding bits of the write pointer. A high empty flag is
domain and hence a complete circuit. The read pointer set which indicates that FIFO unattains its full status if all the
module fairly adds in gray code counter. The read address, bits are equal.
which is transmitted to the FIFO memory, is a 4-bit address II. FIFO Full Conditions
that pinpoints to the clock for which the data values are to be
fetched. The binary address is also appended with an When the write pointer catches up to the read pointer, the
additional bit, making it a 5-bit pointer, much likewrite memory is said to be full; when the pointers' MSBs differ and
pointer. After that, this 5-bit pointer is translated into gray the write pointer's last bits are in sync with the read pointer,
code and sent to the write synchronizer. the memory is said to be empty. The "write_synchronizer"
module uses two synchronizers to move the read pointer to
III. Write and Read Synchronizers the read clock domain. The write pointer's gray code and the
There are two synchronizers in use: the write and read write sync data that was obtained from the write synchronizer
synchronizers. The write pointer is synchronized into the read are compared[14]. The write pointer's gray code and the first
clock domain by the read synchronizer module. It is given a two bits are compared to see if they are equal. Because the
5-bit write pointer, which the read pointer uses to provide the fifth bit, which was added to convert the binary write pointer
circumstances necessary for an empty file system. Two D- to grey code, is '0,' the write_sync[4:3] bits are inverted to
flip flops make up the read synchronizer module, and they are verify this equality.
Name Value
tƌŝƚĞͺĐůŬ ϭ
The On-Chip Power Report (Table III) breaks down a chip's
tƌŝƚĞͺŝŶĐƌĞŵĞŶƚ Ϭ device static and dynamic power consumption. The chip's
overall power consumption is displayed in the table along
tƌŝƚĞͺĚĂƚĂϭϮϳ͗Ϭ ϬϬϬϬϬϬϬϬϬϬϬϬϬϬϬϬϬϬϬϬϬϬϬϬϬϬϬϬϬϬϬϬϬϯϭ with the percentages of power consumed by signals, logic,
tƌŝƚĞͺĨƵůů Ϭ
TABLE III : ON-CHIP POWER REPORT
tƌŝƚĞͺƚŚƌĞƐŚŽůĚ Ϭ
KŶͲŚŝƉWŽǁĞƌ
ƌĞĂĚͺĐůŬ Ϭ WĂƌĂŵĞƚĞƌ
sĂůƵĞ
ƌĞĂĚͺƌĞƐĞƚ ϭ
^ŝŐŶĂůƐ Ϭ͘ϮϱϬt;ϭϬйͿ
ƌĞĂĚͺŝŶĐƌĞŵĞŶƚ ϭ
ĞǀŝĐĞ >ŽŐŝĐ Ϭ͘ϭǁ;ϲйͿ Ϯ͘ϰϵϲt
ƌĞĂĚͺĚĂƚĂϭϮϳ͗Ϭ ϬϬϬϬϬϬϬϬϬϬϬϬϬϬϬϬϬϬϬϬϬϬϬϬϬϬϬϬϬϬϬϬϬϮϮ
LJŶĂŵŝĐ ;ϵϲйͿ
/ͬK Ϯ͘Ϭϴϳt;ϴϰйͿ
ƌĞĂĚͺĞŵƉƚLJ ϭ
ƌĞĂĚͺƚŚƌĞƐŚŽůĚ Ϭ ĞǀŝĐĞ^ƚĂƟĐ Ϭ͘ϬϵϮt;ϰйͿ
KŶͲŚŝƉ
WŽǁĞƌ
WĂƌĂŵĞƚĞƌ ^ůŝĐĞ >hd >hd
^ůŝĐĞ >hdĂƐ
ZĞŐŝƐƚĞƌƐ ^ůŝĐĞ ĂƐ &ůŝƉ
>hdƐ DĞŵŽƌLJ
>ŽŐŝĐ WĂŝƌƐ
ĮĨŽͺŵĞŵŽƌLJͺĂƌƌĂLJ Ϯϵ ϰϴ ϭϴ Ϯϭ ϴ ϭϭ
ŵĞŵŽƌLJͺĮĨŽ ϴ ϴ ϱ Ϭ ϴ Ϭ
ƌĞĂĚͺƉŽŝŶƚĞƌ ϭϬ ϭϬ ϴ ϭϬ Ϭ ϱ
ǁƌŝƚĞͺƉŽŝŶƚĞƌ ϭϭ ϭϬ ϳ ϭϭ Ϭ ϲ
ǁƌŝƚĞͺƐLJŶĐƌŽŶŝnjĞƌ Ϭ ϭϬ ϱ Ϭ Ϭ Ϭ
ƌĞĂĚͺƐLJŶĐƌŽŶŝnjĞƌ Ϭ ϭϬ ϯ Ϭ Ϭ Ϭ
J. Power Report
In the Power Report, the analysis of power consumption of
the implemented netlist is performed comprehensively. It
includes the information about the total power consumption Figure 3
of the design and the distribution of power by modules, Fig. 3 (a) Reported Data of FIFO verification using D-Flip
signals, and I/O ports relative to the resources utilized. The Flop [20], (b) simulation result
report also includes parameters that estimate the activity of
the modules and signal for the purpose of finding out the The resultant value is evolved after verifying and analysis of
dynamic power consumption of the design[19]. system data processed. It act as source for developing
functional approach of various terms and value sustained for
WŽǁĞƌZĞƉŽƌƚ resulting quality outcomes. As determined at proposed
WĂƌĂŵĞƚĞƌ system function it define value of certain stages of functional
sĂůƵĞ
value determined to act according with objectives. It has
dŽƚĂůKŶͲŚŝƉWŽǁĞƌ Ϯ͘ϱϴϴt resulted with functional value cornered with distinct attribute
:ƵŶĐƟŽŶdĞŵƉĞƌĂƚƵƌĞ ϯϲ͘ϴǑ of managing activity evolves by test bench approach.
dŚĞƌŵĂůDĂƌŐŝŶ ϲϯ͘ϮǑ;ϭϯ͘ϳtͿ