Gray Code to Binary Converter



A gray code-to-binary converter is a digital circuit that can translate a gray code into an equivalent pure binary code. Thus, a gray code to binary converter takes a gray code as input and gives a pure binary code as output.

The truth table of a 3-bit gray code to binary code converter is given below −

Gray CodeBinary Code
G2G1G0B2B1B0
000000
001001
010011
011010
100111
101110
110100
111101

Let us obtain the Boolean expression for the binary output bits. For this, we will simplify the truth table using the K-map technique.

K-Map for Binary Bit B0

The K-map simplification for the binary output bit B0 is shown in the following figure.

K-Map for Binary Bit B0

The Boolean expression for the binary bit B0 will be,

$$\mathrm{B_{0} \: = \: \overline{G_{2}} \: \overline{G_{1}} \: G_{0} \: + \: \overline{G_{2}} \: G_{1} \: \overline{G_{0}} \: + \: G_{2} \: \overline{G_{1}} \: \overline{G_{0}}\: + \: G_{2} \: G_{1} \: G_{0}}$$

We can further simplify this expression as follows,

$$\mathrm{\Rightarrow \: B_{0} \: = \: \overline{G_{2}} \: (\overline{G_{1}} \: G_{0} \: + \: G_{1} \: \overline{G_{0}}) \: + \: G_{2} \: (\overline{G_{1}} \: \overline{G_{0}}\: + \: G_{1} \: G_{0})}$$

$$\mathrm{\Rightarrow \: B_{0} \: = \: \overline{G_{2}} \: ( G_{0} \: \oplus \: G_{1}) \: + \: G_{2} \: \overline{(G_{0} \: \oplus \: G_{1})}}$$

$$\mathrm{B_{0} \: = \: G_{0} \: \oplus \: G_{1} \: \oplus \: G_{2}}$$

This is the simplified expression for the binary bit B0.

K-Map for Binary Bit B1

The K-map simplification for the binary output B1 is shown below.

K-Map for Binary Bit B1

The Boolean expression for the binary bit B1 is,

$$\mathrm{B_{1} \: = \: G_{2} \: \overline{G_{1}} \: + \: \overline{G_{2}} \: G_{1} \: = \: G_{1} \: \oplus \: G_{2}}$$

K-Map for Binary Bit B2

The following figure shows the K-map simplification for the binary bit B2.

K-Map for Binary Bit B2

From this K-Map, we obtain the following Boolean expression −

$$\mathrm{B_{2} \: = \: G_{2}}$$

The logic circuit implementation of this 3-bit gray to binary code converter is shown in the following figure.

K-Map for Binary Bit B3

This logic circuit can translate a 3-bit gray code into an equivalent 3-bit binary code. We can also follow the same procedure to implement a gray code to binary code converter for any number of bits.