Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

fifo pointers - Y only gray code pointers are used ???

Status
Not open for further replies.

lakshman.ar

Member level 5
Joined
Nov 29, 2006
Messages
87
Helped
12
Reputation
24
Reaction score
4
Trophy points
1,288
Location
Bangalore
Activity points
1,849
hi every1,

this is a question which was asked in the interview !!

why do v use only "gray code" pointers as read pointers and write pointers while implementing FIFO ???? .... y not binary ????
 

if you implement an async fifo, you must use gray code fifo pointer to aviod metastable or glitch problems.

eg: ptr[3:0] is binary code, when a state change, the 4 bits are not changed at the same time. so there may be some time that ptr turns to be a transition state.(4'b101 -> 4'b110, there may be 4'b100 or 4'b111 states). that will make your async logic to judge fifo empty/full fail.
 

1) meta-stable
2)glitches ... anything els ????

cos 4 the same answer, the reply was
"apart 4m this wat els is important ???? .. u are missing some major things " ....
 

Without synchronizing we can compare the pointers asynchronously to generate FULL/EMPTY signals.

Regards,
Kanags
 

When designing asynch FIFOs, we must use Gray style pointers to avoid errors when comparing the read and write pointers.

To compare the read pointer with the write pointer for Full flag, we need to take the read pointer to the write clock domain.

When this is done using binary style pointers, the read pinter address value changes more than one bit and thus can lead to errors when comparing the pointers. When using Gray style logic, the bit change is limited to only one-bit and thus the comparison errors are eliminated or minimized.

This is the main reason why gray style pointers are used rather than binary.
 

The reason of using gray code is that multi-bit synchronization problems.
Only one bit change.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top