Timing analysis and CDC
In a 16-word-deep asynchronous FIFO with 5-bit Gray code pointers, what is the correct condition for detecting full on the write side?
- AThe top 2 bits of the write pointer and the synchronized read pointer are each opposite, and the lower 3 bits match
- BAll 5 bits of the write pointer and the synchronized read pointer match
- COnly the MSB of the write pointer and the synchronized read pointer is opposite, and all lower 4 bits match
Show answer and explanation
Answer: A. The top 2 bits of the write pointer and the synchronized read pointer are each opposite, and the lower 3 bits match
In binary, full is the state where the write pointer is exactly 16 ahead of the read pointer, differing only in the MSB. Converted to Gray code, the MSB is still inverted, the second bit, formed by XOR with the MSB, is inverted along with it, and the lower 3 bits are the same. For example, if the read pointer is 00000, the write pointer when full is 11000. Only the MSB being opposite is the condition for binary pointers, and all 5 bits matching is the condition for empty.