Difficulty: Easy
Correct Answer: gray code
Explanation:
Introduction / Context:
When analog positions are digitized or when counters transition between adjacent values, changing many bits at once can create ambiguity due to timing skew. Gray code addresses this by ensuring only one bit changes between consecutive values, minimizing error during transitions. This property is fundamental in encoders, state machines, and error resistant communication of incremental positions.
Given Data / Assumptions:
Concept / Approach:
Gray code is constructed so that g[n] = b[n] and g[i] = b[i] XOR b[i+1] when derived from binary b, or via reflective construction. The essential outcome is that adjacent integers map to words with Hamming distance 1. Excess 3 and 8421 (pure binary) do not enforce single bit adjacency; many transitions flip multiple bits, which can lead to transient misreads in hardware.
Step-by-Step Solution:
Verification / Alternative check:
Enumerate a 3-bit Gray sequence: 000, 001, 011, 010, 110, 111, 101, 100. Each consecutive pair differs by one bit, confirming the property.
Why Other Options Are Wrong:
Excess 3 and 8421 are positional and often flip multiple bits between successive values. 'Algebraic code' is not a standard discrete code with this property. Hence Gray code is correct.
Common Pitfalls:
Confusing Gray code ordering with binary order, or assuming Gray is simply a renamed binary code without adjacency guarantees.
Final Answer:
gray code
Discussion & Comments