The Gray code for decimal number 2 is:

2016

The Gray code for decimal number 2 is:

  1. A.

    0010

  2. B.

    1000

  3. C.

    0011

  4. 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.

Explore the full course: Btsc Lab Assistant