6.a. Design and Implementation of Binary To Gray Code Converters Using Logic Gates

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

Experiment No:6 Date:

6.a. Design and implementation of Binary to gray code converters


using logic gates
AIM:
1. To design and implementation of Binary to gray code converters using Multisim.
2. Hardware Implementation of the same with NI Analog Discovery 2.

APPARATUS REQUIRED

S.No Apparatus Type Range Quantity


1) IC IC 7486 1

2) LED 4

3) Switch 4

4) DC Power Source 1

5) NI Analog Discovery 2

6) Wires As Required

THEORY
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 2n-1 rows, and putting the MSB of 0 above the axis and the MSB of 1 below the
axis.
PROCEDURE
1. Open Multisim.
2. Select file → New → Blank and recent → select Blank and click create button on the
bottom right corner of the window opened.
3. Select the components by pressing ctrl+W.
4. Select Master database, select group as TTL, select Family as 74STD,Select 7486N
from component.

5. Multi-section component being placed, a dialog box appears as shown in the figure
below:

6. Click A, you will get one Xor gate. It will be labelled as U1A.
7. Again you will get Multi-section option in that you select B from label U1.

8. Like wise try to get another Xor gate.


9. Select the Switch from master database and select group as basic to get components.
10. Select the DC Power Source from master database, Group-Source, Family-Power
Source, Component -DC Power.
11. Double the DC Power to change Voltage as 5V.
12. Select the DC Power Source from master database, Group-Source, Family-Power
Source, Component -Ground.
13. Select the LED from master database, Group-Basic, Family-3D_Virtual, Component -
Led1_Red.
14. Place all the components, connect the components via wire to get the circuit diagram
as below.
CIRCUIT DIAGRAM:

15. Run the simulation change the value of the switches to verify the truth table.

Truth Table
BINARY GRAY CODE
B3 B2 B1 B0 G3 G2 G1 G0
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
G3 = ∑(8,9,10,11,12,13,14,15) G2 = ∑(4,5,6,7,8,9,10,11)

G1= ∑(2,3,4,5,10.,11,12,13) G0 = ∑(1,2,3,5,6,9,10,13,14)

Binary to Gray code converter Using XOR Gates Only


6.b.Design and implementation of Gray to Binary code converters
using logic gates
AIM:
1. To design and implementation of Gray to Binary code converters using Multisim.
2. Hardware Implementation of the same with NI Analog Discovery 2.

PROCEDURE:
Follow the same procedure as for Binary to gray to complete the circuit diagram as below.

CIRCUIT DIAGRAM:
Truth Table
GRAY CODE BINARY CODE
G3 G2 G1 G0 B3 B2 B1 B0
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 1
0 1 0 1 0 1 1 0
0 1 1 0 0 1 0 0
0 1 1 1 0 1 0 1
1 0 0 0 1 1 1 1
1 0 0 1 1 1 1 0
1 0 1 0 1 1 0 0
1 0 1 1 1 1 0 1
1 1 0 0 1 0 0 0
1 1 0 1 1 0 0 1
1 1 1 0 1 0 1 1
1 1 1 1 1 0 1 0
6.C. Hardware Implementation of Code Converters Using
NI Analog Discovery 2

Introduction to NI Analog Discovery 2(AD 2):

Gives students access to a 100 MS/s oscilloscope, a logic analyzer, and six other instruments
in a pocket-sized lab device.

The Analog Discovery 2 transforms any PC into an electrical engineering workstation. This
USB-powered device enables students to build and test analog and digital circuits in any
environment with the functionality of traditional benchtop instruments. In addition to the 100
MS/s two-channel oscilloscope, the Analog Discovery 2 provides a two-channel waveform
generator, 16-channel logic analyzer, 16-channel digital pattern generator, spectrum analyzer,
network analyzer, voltmeter, and ±5 VDC adjustable power supplies.
AIM:
Hardware Implementation of the same with NI Analog Discovery 2.

APPARATUS REQUIRED

S.No Apparatus Type Range Quantity


1) IC IC 7486 1

2) NI Analog Discovery 2

3) Wires As Required

PROCEDURE:
1. Build the Binary to Gray and Vice Versa Circuit in the breadboard.
2. Use the below pin diagram for circuit connection in breadboard.
3. Use the above pin connection from AD2.
4. Red wire belongs to power. Take a wire connect to red wire and wire it to pin 14.
5. Black wire belongs to ground. Take a wire connect to Black wire and wire it to pin 7.
6. Use Pin 0- Pin 3 of AD2 as Input.
7. Connect Pin 0- Pin 3 of AD2 to B0,B1,B2,B3.
8. Use Pin 4- Pin 7 of AD2 as Output.
9. Connect Pin 4- Pin 7 of AD2 to G0,G1,G2,G3.
10. Search the application in PC for Waveform 2015.
11. In the above window click the Supplies Instrument.

12. Use only positive supply. Change the voltage as 5.


13. Click Master Enable button to enable the Instrument.
14. In the Welcome tab, select Static IO Instrument to open.

15. Configure Digital I/O signal into a switch by selecting 0, Switch, Push/Pull (1/0) as
seen in Figure below for DIO 0-DIO3

16. Run both Static IO and Power Supplies Instrument.


17. Verify the truth table by changing the switch position.

RESULT
Thus, design and implementation of Binary to gray code converters and Vice Versa
using logic gates using Multisim and NI Analog Discovery 2.

You might also like