Difference between binary pointer and gray code pointer

Dec 06, 2019

Difference between binary pointer and gray code pointer

(1) Due to the handshake synchronization, the pointer can have multiple bits change at the same time, and the binary pointer can jump over an arbitrary length each time it moves, which brings convenience to the implementation of some functions of the FIFO (for example, the hardware directly controls the FIFO from the cache An error packet is discarded in the data stream); and the Gray code pointer can generally only move upward or downward.

(3) Compared with direct synchronization, synchronization by handshake requires multiple clock cycles, so the full-empty judgment of binary pointers is more "conservative" than the full-empty judgment of Gray code pointers; for designing a FIFO with a large capacity and composed of memory, It is said that the space lost due to conservative judgment can be ignored; but for a small FIFO, this "conservative" may not be acceptable. For example, a FIFO consisting of 8 registers. For a pointer encoded in Gray code, in the worst case, when the FIFO is judged to be full by the writer, there are actually only five data stored in it (using a two-level synchronizer, it may take three Synchronization of two cycles, and read operations occur within these three cycles); For pointers with binary encoding, when the FIFO is judged to be full, there may be only three data in the FIFO or less (using a two-stage synchronizer, In the best case, five cycles of handshake are required, and read operations occur in all five cycles).


Send Inquiry