"Kim Enkovaara" <
[email protected]> wrote in message
news:
[email protected]. ..
> Symon wrote:
>
>> "bijoy" <[email protected]> wrote in message
>>>Hi In designing asynchronous FIFOs we have to use Gray code read/write
>>>pointers.
>>
>> Well, no, you don't _HAVE_ to. You can use ordinary binary counters just
>> fine, as long as you design the clock domain crossing bit properly.
>
> But crossing the clock domain with binary counter is hard to do correctly,
> it needs some kind of handshake protocol. It's not enough to just put
> dual flops to each counter bit like with gray coding.
A useful compromise is to have counters in binary, so you can have fast
arithmetic, and then convert from binary to Gray-code, cross the clock
domain, and then convert back again to do the pointer comparison. While
there is some latency, it is usually easier than a bi-directional handshake.
Cheers,
-Ben-