Timing analysis and CDC
In a 16-word-deep asynchronous FIFO, why are the write and read pointers made 5 bits, one bit more than the address?
- ABecause 5 bits are needed to represent the addresses of 16 words
- BSo that when the pointers match, empty (same lap) can be distinguished from full (one lap apart)
- CTo use the extra bit as parity for detecting pointer errors
Show answer and explanation
Answer: B. So that when the pointers match, empty (same lap) can be distinguished from full (one lap apart)
The addresses of 16 words fit in 4 bits, but with 4-bit pointers alone, when the read and write addresses match it is impossible to tell whether the FIFO is empty because everything has been read, or full because writing has gone a full lap and caught up. Adding a fifth bit that indicates the lap means that, comparing in binary, the FIFO is empty when all 5 bits match and full when only the MSB differs. With Gray code pointers, the comparison for full is slightly different. The bit is not used as parity.