Identify the code sequence: 1010 1011 1001 1000
2023
Identify the code sequence:
1010
1011
1001
1000
Answer: C. Gray — Concept A 4-bit code is identified by the mapping rule that generates its words, not merely by whether the words are legal patterns. In the binary-reflected…
- A.
BCD
- B.
Excess-3
- C.
Gray
- D.
Excess-3 Gray
Attempted by 501 students.
Show answer & explanation
Correct answer: C
Concept
A 4-bit code is identified by the mapping rule that generates its words, not merely by whether the words are legal patterns. In the binary-reflected Gray code the word for an integer n is n XOR (n >> 1), and its defining property is unit distance: successive integers differ in exactly one bit position. Excess-3 is an unweighted decimal digit code in which a digit d is written as the plain 4-bit binary of d + 3, and successive digits there are not unit distance. So the test is: under which rule do the listed words form a run of successive values?
Application: decode the four listed words under each rule
Listed word | Gray code of | Excess-3 digit |
|---|---|---|
1010 | 12 | 7 |
1011 | 13 | 8 |
1001 | 14 | 6 |
1000 | 15 | 5 |
Under the Gray rule the four words are the codes of 12, 13, 14 and 15, taken in ascending order. Under the Excess-3 rule they are the digits 7, 8, 6 and 5, which is not a run; Excess-3 for 5, 6, 7, 8 taken in order would be 1000, 1001, 1010, 1011, which is not the order listed.
Unit-distance check on the listed order
1010 to 1011: only the rightmost bit changes.
1011 to 1001: only the second bit from the right changes.
1001 to 1000: only the rightmost bit changes.
Exactly one bit changes at every step, which is the property that defines a Gray code counting sequence.
Cross-check the remaining codes
BCD assigns words only to 0000 through 1001, so 1010 and 1011 carry no BCD meaning at all.
Excess-3 does contain all four words, but they decode to the digits 7, 8, 6, 5, which form no run, and Excess-3 is not unit distance (1001 to 1010 changes two bits).
Excess-3 Gray uses only the words 0010, 0110, 0111, 0101, 0100, 1100, 1101, 1111, 1110 and 1010, so 1011, 1001 and 1000 never occur in it.
Result
The listed sequence 1010, 1011, 1001, 1000 is the Gray code: the binary-reflected Gray words for 12, 13, 14 and 15.