Timing analysis and CDC
Why are the write and read pointers of an asynchronous FIFO converted to Gray code before being synchronized into the other domain?
- ABecause Gray code halves the number of bits, so fewer synchronizers are needed
- BBecause only one bit changes per increment, so even if captured mid-change the result is the correct value from before or after the increment
- CBecause Gray-coded signals do not go metastable, so synchronization becomes unnecessary
Show answer and explanation
Answer: B. Because only one bit changes per increment, so even if captured mid-change the result is the correct value from before or after the increment
A binary pointer can change multiple bits at once, as in 0111 to 1000, so synchronizing each bit separately can yield a completely unrelated value. With Gray code only one bit changes per increment, so even if that bit goes metastable and resolves to either the old or new value, the result is the value from before or after the increment. The receiver merely sees a slightly stale value, so the FIFO does not break. The number of bits does not change, and metastability itself can still occur, so synchronizers are still required.