Shri Vile Parle Kelavani Mandal’s
INSTITUTE OF TECHNOLOGY
Dhule (M.S.)
Subject: Analog and Digital Electronics Laboratory. (BTEEEL411) Remarks
Name: __________________________________________ Roll No: _______________
Class: _________________ Branch: _______________ Division: ______________
Exp. No: _______________ Date : / /20 Signature
Title: Design and implementation of various code converters and its applications.
Objective: Realization of binary to gray code conversion & vice versa.
Components required: Trainer kit, patch cords.
Theory:
Binary to Gray Code Converter:
The logical circuit which converts binary code to equivalent gray code is known as binary to gray code
converter. 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 not suitable for arithmetic
operations. It is the most popular of the unit distance codes. It is also a reflective code. An n-bit Gray
code can be obtained by reflecting an n-1 bit code about an axis after 2 n-1 rows, and putting the MSB of 0
above the axis and the MSB of 1 below the axis.
Table 1: Binary to Gray conversion Truth-Table
Binary Inputs Gray Outputs
B
B3 B2 B0 G3 G2 G1 G0
1
0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 1
0 0 1 0 0 0 1 1
0 0 1 1 0 0 1 0
0 1 0 0 0 1 1 0
0 1 0 1 0 1 1 1
0 1 1 0 0 1 0 1
0 1 1 1 0 1 0 0
1 0 0 0 1 1 0 0
1 0 0 1 1 1 0 1
1 0 1 0 1 1 1 1
1 0 1 1 1 1 1 0
1 1 0 0 1 0 1 0
1 1 0 1 1 0 1 1
1 1 1 0 1 0 0 1
1 1 1 1 1 0 0 0
K-Map is used to obtain the conversion equations as shown below
Fig. 1: K-Map for Binary to Gray Code Conversion
Fig. 2: Binary to Gray Code Converter
Gray to Binary Code Converter:
In gray to binary code converter, input is a multiplies gray code and output is its equivalent binary code.
Let us consider a 4 bit gray to binary code converter. To design a 4 bit gray to binary code converter, first
of all draw a conversion table.
Table 2: Binary to Gray conversion Truth-Table
Gray Inputs
Binary Outputs
B
G3 G2 G1 G0 B3 B1 B0
2
0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 1
0 0 1 1 0 0 1 0
0 0 1 0 0 0 1 1
0 1 1 0 0 1 0 0
0 1 1 1 0 1 0 1
0 1 0 1 0 1 1 0
0 1 0 0 0 1 1 1
1 1 0 0 1 0 0 0
1 1 0 1 1 0 0 1
1 1 1 1 1 0 1 0
1 1 1 0 1 0 1 1
1 0 1 0 1 1 0 0
1 0 1 1 1 1 0 1
1 0 0 1 1 1 1 0
1 0 0 0 1 1 1 1
K-Map is used to obtain the conversion equations as shown below
Fig. 3: K-Map for Gray to Binary Code Conversion
Fig. 4: Gray to Binary Code Converter
Procedure:
1. Check the components for their working.
2. Insert the appropriate IC into the IC base.
3. Rig up the circuit as shown in the logic circuit diagram.
4. Apply various input data to the logic circuit via the input logic switches.
5. Note down the corresponding output and verify the truth table.
Concussion: Hence, implementation of binary to gray and gray to binary code converter is studied.