Name:Mohan Raam S
Reg no:19F026
STUDY OF BINARY TO GRAY AND GRAY TO BINARY CONVERSION USING NAND GATES
Ex.No: 4
Date: 23-11-2020
AIM :
Verify Binary to Gray and Gray to Binary conversion using NAND gates only.
COMPONENTS REQUIRED:
IC - 7400
THEORY :
1) Binary to Gray conversion :
1. The Most Significant Bit (MSB) of the gray code is always equal to the MSB of
the given binary code.
2. Other bits of the output gray code can be obtained by Ex-ORing binary code
bit at that index and previous index.
There are four inputs and four outputs. The input variable are defined as B 3,
B2, B1, B0 and the output variables are defined as G3, G2, G1, G0. From the
truth table, combinational circuit is designed.The logical expressions are
defined as :
B3 = G3
B2 ⊕ B3 = G2
B1 ⊕ B2 = G1
B0 ⊕ B1 = G0
Name:Mohan Raam S
Reg no:19F026
Figure-1: Binary to Gray Code Converter Circuit
Figure-2: Binary to Gray Code Converter Truth Table
Name:Mohan Raam S
Reg no:19F026
2) Gray to binary conversion :
1.The Most Significant Bit (MSB) of the binary code is always equal to the MSB of
the given binary number.
2.Other bits of the output binary code can be obtained by checking gray code bit at
that index. If current gray code bit is 0, then copy previous binary code bit, else copy
invert of previous binary code bit.
There are four inputs and four outputs. The input variable are defined as G 3, G2, G1,
G0 and the output variables are defined as B3, B2, B1, B0. From the truth table,
combinational circuit is designed.The logical expressions are defined as :
G0 ⊕ G1 ⊕ G2 ⊕ G3 = B0
G1 ⊕ G2 ⊕ G3 = B1
G2 ⊕ G3 = B2
G3 = B3
Figure-3: Gray to Binary Code Converter Circuit
Figure-4: Gray to Binary Code Converter Truth Table
Name:Mohan Raam S
Reg no:19F026
Simulation results:
Binary to Gray:
Name:Mohan Raam S
Reg no:19F026
Simulation -2:
Gray to Binary:
Name:Mohan Raam S
Reg no:19F026
APPLICATION:
Gray codes are widely used to prevent spurious output from electromechanical switches.
To facilitate error correction in digital communications.
The main applications include being used in analog to digital converters.
Gray code is used to minimize errors in converting analog signals to digital signals.
Useful in clock domain crossing.
INFERENCE:
The usage and limitations of code conversions is learned via the circuit simulationsusing various
IC’s
RESULT :
Thus Binary to Gray and Gray to Binary conversion using NAND gates
have been realized practically using ICs.