Best Answer

To convert Gray code to binary code you must be familiar with the logical XOR operator. XOR outputs a 1 bit if either of two input bits is 1, but not both. The truth table for XOR, for all possible inputs p and q, is as follows:

p q output

0 0 0

0 1 1

1 0 1

1 1 0

The algorithm to convert from Gray code to binary code is as follows:

Step 1: Fix the most-significant bit, the MSB, which is always the same for both codes. If there are no more bits, we're done, otherwise proceed to step 2.

Step 2: XOR the most recently fixed binary bit with the next available Gray bit. Fix the result as the next binary bit.

Step 3: If there is at least one more Gray bit available, go to step 2. Otherwise we're done.

Therefore, to convert 10101111 from Gray to binary, we proceed as follows:

Gray = 10101111

Fix MSB = 1

1 XOR 0 = 1

1 XOR 1 = 0

0 XOR 0 = 0

0 XOR 1 = 1

1 XOR 1 = 0

0 XOR 1 = 1

1 XOR 1 = 1

Thus: Binary = 11010101

Note that we carry the fixed bit (the bold bit) onto the next line as the l-value (left operand) of XOR. The r-value (right operand) of XOR is always the next available Gray bit after the MSB. Reading the fixed bits from top to bottom reveals the binary code.

We can also write this as follows:

Gray = 10101111

Binary = 1 XOR 0 = 1 XOR 1 = 0 XOR 0 = 0 XOR 1 = 1 XOR 1 = 0 XOR 1 = 1 XOR 1 = 1

Reading the fixed (bold) bits left to right reveals the binary code.

Study guides

☆☆

Q: Convert the gray code 10101111 to binary?

Write your answer...

Submit

Still have questions?

Continue Learning about Other Math

I do not believe that is a valid binary number. All binary numbers must be divisible by 8

A cloudy day is one that is overcast, where the sun shines infrequently if at all. As a Hink-Pink, that's "gray day."

An average Gray whale, a typical car, an average hippopotamus, anything 30,000 lbs.

The Enterprise Center in Richmond, Virginia, USA. Inspired by Star Trek. *the actual geographic point is on the grounds of the Faison School for Autism, 1701 Byrd Avenue, across Markel Rd. from the rather ugly round Enterprise Center (Markel Building). The hammered aluminum exterior has oxidized and on most days is a dull gray.

The total amount of data (including the start and stop bit) in an 8-bit, 1024× 1024 image, is (1024)2×[8+2] bits. The total time required to transmit this image over a 56K baud link is (512)^2 ×[8+2]/300 =8738.1 sec or about 145.6 min.

Related questions

1001011

110111101

just add 3 to the number which you want ti convert into gray code

The best way is with a lookup table.

To convert a gray code to binary1.write the the MSB bit as the MSB of the binary.2.if the 2nd grey bit is 0,then the 2nd binary bit is the same as the first binary bit.... and if the grey bit is 1 the 2nd binary bit is the complement of the first binary bit3.step 2 is repeated for every bit....EXAMPLE:the binary of the grey code 1110011 is 1011101

Its often done in hardware with a lookup ROM, or in software with a lookup table.

The Gray Code is a type of binary code developed by a programmer named Frank Gray. Gray code is a binary numeral system that differ than normal binary code, and is used widely to detect errors in software.

The reflected binary code, also known as Gray codeafter Frank Gray, is a binary numeral system where two successive values differ in only one bit.Here is an example of a 4-bit Gray code:0000000100110010011001110101010011001101111111101010101110011000

10111

gray code is one which changes one bit at a time but binary code is one which changes one or more bit at a time. for example three bit binary and gray code the left one is binary and the right one is gray code.binary gray000 000001 001010 011011 010100 110101 111110 101111 100000 000

help PLA use convert excess-3 to gray code

Gray code is where only one bit changes at a time. Binary code is where one or more bits change at a time. An example, for three bits, with binary on the left and gray on the right, with the changing bits underlined...000 000001 001010 011011 010100 110101 111110 101111 100000 000 Repeating...The advantage of binary code is that it is easy to convert to a numeric value. The advantage of gray code is that it makes very stable position digitizers, because only one bit changes at a time, resulting in uncertainty of only one bit.

People also asked