Binary to Gray code conversion

The Binary to Gray code converter is a logical circuit that is used to convert the binary code into its equivalent Gray code. By putting the MSB of 1 below the axis and the MSB of 1 above the axis and reflecting the (n-1) bit code about an axis after 2 n-1 rows, we can obtain the n-bit gray code.

The 4-bit binary to gray code conversion table is as follows:

Decimal Number 4-bit Binary Code 4-bit Gray Code
ABCD G1G2G3G4
0 0000 0000
1 0001 0001
2 0010 0011
3 0011 0010
4 0100 0110
5 0101 0111
6 0110 0101
7 0111 0100
8 1000 1100
9 1001 1101
10 1010 1111
11 1011 1110
12 1100 1010
13 1101 1011
14 1110 1001
15 1111 1000

In 4-bit gray code, the 3-bit code is reflected against the axis drawn after the 2 4-1 -1 th =8 th row.

Binary <a href=to Gray code conversion" />

How to Convert Binary to Gray Code

Example

Suppose we have a binary number 01101, which we want to convert into Gray code. There are the following steps which need to perform this conversion:

Binary <a href=to Gray code conversion" />

Gray to Binary Code Conversion

The Gray to Binary code converter is a logical circuit that is used to convert the gray code into its equivalent binary code. There is the following circuit used to convert the Gray code to binary number.

Binary <a href=to Gray code conversion" />

Just like Binary to Gray code conversion; it is also a very simple process. There are the following steps used to convert the Gray code into binary.

Binary <a href=to Gray code conversion" />

Gray Code to Binary Conversion Example

Suppose we have the Gray code 01011, which we want to convert into a binary number. There are the following steps which we need to perform for the conversion:

The bits of 4-bit Gray code are considered as G4G3G2G1. Now from the conversion table,