Timing analysis and CDC

What is the 4-bit binary value 0110 (decimal 6) converted to Gray code?

  1. A0111
  2. B0100
  3. C0101
Show answer and explanation

Answer: C. 0101

Binary-to-Gray conversion XORs each bit with the bit above it (the most significant bit is kept as is). As a formula, g = b XOR (b >> 1). XORing 0110 with 0011, its one-bit right shift, gives 0110 XOR 0011 = 0101. 0111 is the Gray code for 5 and 0100 for 7, the values on either side of 6. Counting 5→6→7 gives 0111→0101→0100, confirming that only one bit changes between adjacent values.

Practice this topic Back to topic

Books on Timing analysis and CDC Ad

As an Amazon Associate I earn from qualifying purchases.

More Timing analysis and CDC questions

  1. In a 16-word-deep asynchronous FIFO, why are the write and read pointers made 5 bits, one bit more than the address?
  2. 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?
  3. In an asynchronous FIFO, the other side's pointer is used after synchronization, so the pointer value seen is 2–3 cycles stale. What effect does this delay have on full/empty detection?
  4. In an asynchronous FIFO with a 100 MHz write side and an 80 MHz read side, the write side writes a 100-word burst at one word per cycle and the read side reads one word per cycle. There is ample idle time between bursts. What is the minimum depth needed to avoid overflow (ignore synchronization delay)?
  5. The write side writes a 120-word burst at one word per cycle at 200 MHz. The read side, on a 150 MHz clock, reads one word in only 2 out of every 3 cycles. What is the minimum depth needed to avoid overflow (ignore synchronization delay)?