You are on page 1of 6

Experiment No: 6 Page No:22

Ref: GNITS/DSD/6 G.N.I.T.S – ETM DEPARTMENT

Realize and Design 4 bit gray to binary and binary to


gray code converters

Aim:To study and implementation of 4 bit gray to binary and binary to gray
code conversion.

Apparatus:
1) Trainer kit
2) Patch chords
3) Power supply

Theory:
The availability of a large variety of codes for the same discrete
elements of information results in the use of different codes by different
digital system. It is sometimes necessary to use the output of one system as
the input to another. A conversion circuit must be inserted between the two
systems if each uses different codes for the same information. Thus, a code
converter is a circuit that makes the two systems compatible even though
each uses a different binary code.
Code Converter: A logic circuit used to convert information coded in one
form to another form is called code converter. And the logical circuit which
converts binary code to equivalent gray code is known as binary to gray
code converter.
A binary code represents data using a two-symbol system. The two-symbol
system used is often "0" and "1" from the binary number system. n bits are
required to represent in 2n quantities in binary code.
The Gray code is a non weighted code. The successive gray code differs in
one bit position only that means it is a unit distance code. It is also referred
as cyclic code. It is also a reflective code. Gray codes are used in many
applications in design of digital systems. The logic diagram for binary code to
gray code converter. Here we are using IC 74LS86 XOR gate IC’s for
implementing the logic diagram.

Lab Incharge HOD, ETM


Experiment No: 6 Page No:23
Ref: GNITS/DSD/6 G.N.I.T.S – ETM DEPARTMENT

Binary to Gray Code Conversion Procedure:

Gray to Binary Code Conversion Procedure:

The pin diagram (74LS86):


Experiment No: 6 Page No:24
Ref: GNITS/DSD/6 G.N.I.T.S – ETM DEPARTMENT

Figure (1) IC 74LS86

Logic diagram:

Figure (2) binary to gray Logic

Procedure (Binary to gray):

1) The inputs are B0, B1, B2 and B3 connected to the logic switches.
2) The outputs are G0, G1, G2 and G3 connected to the led indication.
3) Now switch on the trainer kit.
4) By applying the binary inputs through the logic switches observe the
outputs G0, G1, G2 and G3 led indication.
5) Note down the outputs in a truth table.
Experiment No: 6 Page No:25
Ref: GNITS/DSD/6 G.N.I.T.S – ETM DEPARTMENT

Truth table:

The logic for the Binary to Gray code converter is

Logic diagram:
Experiment No: 6 Page No:26
Ref: GNITS/DSD/6 G.N.I.T.S – ETM DEPARTMENT

Procedure (Gray to binary):

1) The inputs are G0, G1, G2 and G3 connected to the logic switches.
2) The outputs are B0, B1, B2 and B3 connected to the led indication.
3) Now switch on the trainer kit.
4) By applying the gray inputs through the logic switches observe the
outputs B0, B1, B2 and B3 led indication.
5) Note down the outputs in a truth table.

The logic for the Gray to Binary code converter is


Experiment No: 6 Page No:27
Ref: GNITS/DSD/6 G.N.I.T.S – ETM DEPARTMENT

Truth table:

Decimal Inputs Outputs


G3 G2 G1 G0 B3 B2 B1 B0
0 0 0 0 0 0 0 0 0
1 0 0 1 0 0 0 0 1
2 0 0 1 0 0 0 1 1
3 0 0 1 1 0 0 1 0
4 0 1 0 0 0 1 1 1
5 0 1 0 1 0 1 1 0
6 0 1 1 0 0 1 0 0
7 0 1 1 1 0 1 0 1
8 1 0 0 0 1 1 1 1
9 1 0 0 1 1 1 1 0
10 1 0 1 0 1 1 0 0
11 1 0 1 1 1 1 0 1
12 1 1 0 0 1 0 0 0
13 1 1 0 1 1 0 0 1
14 1 1 1 0 1 0 1 1
15 1 1 1 1 1 0 1 0

Result: Hence the Binary to Gray and Gray to Binary code conversion is
verified.

Reasoning Questions

1. What is Binary Code ?


2. Define Gray Code?
3. Give the procedure of binary to gray code conversion?
4. How do you convert gray code to binary code?
5. What are the applications of Gray code?

You might also like