Math, asked by alexadsouza8655, 1 year ago

Convert binary number 100101 to gray code

Answers

Answered by sulakshitbhardp28ebq
12
i hope u will understand
Attachments:
Answered by roshinik1219
3

Given:

  • A binary code 100101 is given.

To Find:

  • Convert binary number into gray code.

Solution:

  1. The MSB is kept the same. As the MSB of the binary is 1, the MSB of the gray code will be 1 as well (first gray bit) .
  2. Next, take the XOR of the first and the second binary bit. The first bit is 1, and the second bit is 0. The bits are different so the resultant gray bit will be 1 (second gray bit)
  3. Next, take the XOR of the second and third binary bit. The second bit is 0, and the third bit is 0. These bits are same so the resultant gray bit will be 0 (third gray bit)
  4. Next, take the XOR of third and fourth binary bit. The third bit is 0, and the fourth bit is 1. The bits are different so the resultant gray bit will be 1 (fourth gray bit)
  5. Next, take the XOR of fourth and fifth binary bit. The fourth bit is 1, and the fifth bit is 0. The bits are different so the resultant gray bit will be 1 (fourth gray bit)
  6. Lastly, take the XOR of the fifth and sixth binary bit. The fifth bit is 0, and the sixth bit is 1. These bits are different so the resultant gray bit will be 1 (fifth gray bit)
  7. Hence the result of binary to gray code conversion of 100101 is complete, and the equivalent gray code is 110111.
Similar questions