Convert 10111011 to its equivalent gray code.


Q.) Convert 10111011 to its equivalent gray code.

Subject: digital circuit and system

To convert a binary number to its equivalent Gray code, you can follow these steps:

  1. Write down the binary number.
  2. The most significant bit (MSB) of the Gray code is the same as the MSB of the binary number.
  3. For each subsequent bit in the Gray code, perform an exclusive OR (XOR) operation between the current bit and the bit to its left in the original binary number.

Let's apply these steps to convert the binary number 10111011 to Gray code:

  1. Write down the binary number:
   Binary: 1 0 1 1 1 0 1 1
  1. The MSB of the Gray code is the same as the MSB of the binary number:
   Binary: 1 0 1 1 1 0 1 1
   Gray:   1
  1. Perform XOR operations for each subsequent bit:
  • For the second bit: XOR the first and second bits of the binary number (1 XOR 0 = 1)
  • For the third bit: XOR the second and third bits of the binary number (0 XOR 1 = 1)
  • For the fourth bit: XOR the third and fourth bits of the binary number (1 XOR 1 = 0)
  • For the fifth bit: XOR the fourth and fifth bits of the binary number (1 XOR 1 = 0)
  • For the sixth bit: XOR the fifth and sixth bits of the binary number (1 XOR 0 = 1)
  • For the seventh bit: XOR the sixth and seventh bits of the binary number (0 XOR 1 = 1)
  • For the eighth bit: XOR the seventh and eighth bits of the binary number (1 XOR 1 = 0)

The XOR operation can be represented by the following truth table:

A (Input 1) B (Input 2) A XOR B (Result)
0 0 0
0 1 1
1 0 1
1 1 0

Now, let's apply the XOR operation to each pair of bits:

   Binary: 1 0 1 1 1 0 1 1
   XOR:      1 1 0 0 1 1 0
   Gray:   1 1 1 0 0 1 1 0

So, the equivalent Gray code for the binary number 10111011 is 11100110.

Here's the step-by-step conversion in a more visual format:

Binary Number XOR Operation (for Gray code) Gray Code
1 - 1
0 1 XOR 0 = 1 1
1 0 XOR 1 = 1 1
1 1 XOR 1 = 0 0
1 1 XOR 1 = 0 0
0 1 XOR 0 = 1 1
1 0 XOR 1 = 1 1
1 1 XOR 1 = 0 0

Therefore, the final Gray code is 11100110.