Binary to Gray Code Converter



A binary-to-gray code converter is a type of code converter that can translate a binary code into its equivalent gray code.

The binary-to-gray code converter accepts a binary number as input and produces a corresponding gray code as output.

Here is the truth table explaining the operation of a 4-bit binary-to-gray code converter.

Binary Code Gray Code
B3 B2 B1 B0 G3 G2 G1 G0
0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 1
0 0 1 0 0 0 1 1
0 0 1 1 0 0 1 0
0 1 0 0 0 1 1 0
0 1 0 1 0 1 1 1
0 1 1 0 0 1 0 1
0 1 1 1 0 1 0 0
1 0 0 0 1 1 0 0
1 0 0 1 1 1 0 1
1 0 1 0 1 1 1 1
1 0 1 1 1 1 1 0
1 1 0 0 1 0 1 0
1 1 0 1 1 0 1 1
1 1 1 0 1 0 0 1
1 1 1 1 1 0 0 0

Let us derive the Boolean expressions for the gray code output bits. For this, we will simplify the truth table using the K-map technique.

K-Map for Gray Code Bit G0

The K-Map simplification to obtain the Boolean expression for the gray code bit G0 is shown in the following figure.

K-Map for Gray Code Bit G0

Hence, the Boolean expression for the gray code bit G0 is,

G0=¯B1B0+ B1¯B0=B0B1

K-Map for Gray Code Bit G1

The K-Map simplification for the gray code bit G1 is shown below −

K-Map for Gray Code Bit G1

Thus, the Boolean expression for the gray code bit G1 is,

G1=¯B2B1+ B2¯B1=B1B2

K-Map for Gray Code Bit G2

The K-Map simplification for the gray code bit G2 is depicted in the following figure −

K-Map for Gray Code Bit G2

The Boolean expression for the gray code bit G2 will be,

G2=¯B3B2+ B3¯B2=B2B3

K-Map for Gray Code Bit G3

The K-Map simplification for the gray code bit G3 is shown in the following figure −

K-Map for Gray Code Bit G3

Hence, the Boolean expression for the gray code bit G3 is,

G3=B3

Let us now utilize these Boolean expressions to implement the logic circuit of the binary-to-gray code converter.

The following figure shows the logic circuit diagram of a 4-bit binary code to gray code converter −

K-Map for Gray Code Bit G4

This circuit can convert a 4-bit binary number into an equivalent gray code.

We can follow the same procedure to design a binary-to-gray code converter for any number of bits.

Advertisements