The Gray code for decimal number 2 is:
2016
The Gray code for decimal number 2 is:
- A.
0010
- B.
1000
- C.
0011
- D.
0101
Attempted by 45 students.
Show answer & explanation
Correct answer: C
Decimal 2 in 4-bit binary is 0010. To convert binary to Gray code, keep the MSB the same and XOR each pair of adjacent binary bits: 0, 0⊕1 = 1, and 1⊕0 = 1. Thus, 0010 converts to Gray code 0011.