Logic circuits
Which is a characteristic of Gray code?
- AEach decimal digit is represented by 4 bits
- BIt detects errors with a parity bit
- COnly one bit changes between adjacent values
Show answer and explanation
Answer: C. Only one bit changes between adjacent values
Gray code changes exactly one bit between adjacent values and can be computed from binary B as B XOR (B >> 1). Because multiple bits never change at once, it avoids reading spurious intermediate values in rotary-encoder position sensing and when passing FIFO pointers between circuits on different clocks. For FIFO pointers, this requires that the pointer advance by one at a time and wrap around with a power-of-two period. Karnaugh map cells are also ordered in Gray code. Encoding each decimal digit in four bits is BCD.