| Author |
Message |
lakshman.ar
Joined: 29 Nov 2006 Posts: 89 Helped: 8
|
13 Nov 2007 8:38 fifo pointers - Y only gray code pointers are used ??? |
|
|
|
|
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 ????
|
|
| Back to top |
|
 |
Google AdSense

|
13 Nov 2007 8:38 Ads |
|
|
|
|
|
|
| Back to top |
|
 |
wkong_zhu
Joined: 13 Nov 2004 Posts: 171 Helped: 2
|
13 Nov 2007 9:11 fifo pointers - Y only gray code pointers are used ??? |
|
|
|
|
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.
|
|
| Back to top |
|
 |
lakshman.ar
Joined: 29 Nov 2006 Posts: 89 Helped: 8
|
13 Nov 2007 9:15 fifo pointers - Y only gray code pointers are used ??? |
|
|
|
|
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 " ....
|
|
| Back to top |
|
 |
kanagavel_docs
Joined: 18 Aug 2007 Posts: 40 Helped: 7
|
13 Nov 2007 9:20 Re: fifo pointers - Y only gray code pointers are used ??? |
|
|
|
|
Without synchronizing we can compare the pointers asynchronously to generate FULL/EMPTY signals.
Regards,
Kanags
|
|
| Back to top |
|
 |
vlsi_whiz
Joined: 12 Nov 2005 Posts: 171 Helped: 24
|
13 Nov 2007 10:48 Re: fifo pointers - Y only gray code pointers are used ??? |
|
|
|
|
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.
|
|
| Back to top |
|
 |
donald007
Joined: 28 Aug 2007 Posts: 11 Helped: 1 Location: TAIWAN
|
13 Nov 2007 16:22 fifo pointers - Y only gray code pointers are used ??? |
|
|
|
|
The reason of using gray code is that multi-bit synchronization problems.
Only one bit change.
|
|
| Back to top |
|
 |