0% found this document useful (0 votes)
2K views6 pages

Verify Binary To Gray and Gray To Binary Conversion Using NAND Gates Only

Mohan Raam S designed combinational logic circuits to convert between binary and gray codes using only NAND gates. The circuits were simulated and the results confirmed correct conversions between the two codes. Binary to gray conversion was achieved by XORing each bit with the previous bit, while gray to binary conversion involved XORing all bits or copying/inverting the previous bit depending on the current bit value. The applications of gray codes in areas like analog to digital conversion and minimizing errors were also discussed.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2K views6 pages

Verify Binary To Gray and Gray To Binary Conversion Using NAND Gates Only

Mohan Raam S designed combinational logic circuits to convert between binary and gray codes using only NAND gates. The circuits were simulated and the results confirmed correct conversions between the two codes. Binary to gray conversion was achieved by XORing each bit with the previous bit, while gray to binary conversion involved XORing all bits or copying/inverting the previous bit depending on the current bit value. The applications of gray codes in areas like analog to digital conversion and minimizing errors were also discussed.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

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.

You might also like