Binary To Gray and Gray To Binary Converter

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

EXPERIMENT No.

3
AIM: To Analyse and Implement

Binary to Gray and Gray to Binary code converters using Logic gates.

APPARATUS: Digital trainer kits, Logic gate IC 7486 (XOR Gate), Connecting wires.

THEORY:

a. Binary to Gray and Gray to Binary code converters using Logic gates.

Binary to Gray Code converter: Consider Binary code bits B0, B1, B2, B3 as inputs and Gray
code bits G0, G1, G2, and G3 as outputs. For converting binary to gray code, the MSB is noted.
This MSB is added to the bit in next position. The sums are recorded and carry if any generated
is discarded. This procedure is repeated till last bit of binary number is reached. The Karnaugh
maps will be used for gray code outputs (G0, G1, G2, and G3) value calculation. So, find minimal
expressions for G0, G1, G2, and G3 and realize these using logic gates.

Fig 3.1: Binary to Gray Code Converter

Gray to Binary Code converter: Consider Gray code bits G0, G1, G2, and G3 as inputs and
Binary code bits B0, B1, B2, and B3 as outputs. For converting gray to binary code, the MSB is
noted. This MSB is added to the bit in next position. The sums are recorded and carry if any
generated is discarded. This sum is further added to the bit in next position and sums are
recorded and carry if any generated is discarded procedure is repeated till last bit of gray code
is reached. The Karnaugh maps will be used for Binary code outputs (B0, B1, B2, and B3) value
calculation. So, find minimal expressions for B0, B1, B2, and B3 and realize these using logic
gates.
Fig 3.2: Gray to Binary Code Converter

Table 3.1: Truth Table of Binary to Gray Code Converter

Sr
No. BINARY CODE GRAY CODE

B0 B1 B2 B3 G0 G1 G2 G3

1. 0 0 0 0 0 0 0 0

2. 0 0 0 1 0 0 0 1

3. 0 0 1 0 0 0 1 1

4. 0 0 1 1 0 0 1 0

5. 0 1 0 0 0 1 0 0

6. 0 1 0 1 0 1 0 1

7. 0 1 1 0 0 1 1 1

8. 0 1 1 1 0 1 1 0

9. 1 0 0 0 1 1 0 0

10. 1 0 0 1 1 1 0 1
11. 1 0 1 0 1 1 1 1

12. 1 0 1 1 1 1 1 0

13. 1 1 0 0 1 0 1 0

14. 1 1 0 1 1 0 1 1

15. 1 1 1 0 1 0 0 1

16. 1 1 1 1 1 0 0 0

You might also like