Professional Documents
Culture Documents
He-2 - Ade
He-2 - Ade
DEPT.ofComputerScienceEngineering
SRMIST,Kattankulathur–603203
SubCode&Name:18CSS201J-ANALOGANDDIGITALELECTRONICS
ExperimentNo 06
TitleofExperiment
Design and implementation of Binary to gray code
convertersandviceversausinglogicgates
Nameofthecandidate VAKAMALLASRIRAMCHARANREDDY
SERIN SAJ
RegisterNumber RA2011003010965
DateofExperiment 03-11-2021
MarkSplitUp
S.No Description MaximumMark MarkObtained
1 OralViva/OnlineQuiz 5
2 CircuitConnectionandExecution 10
3 Verificationoftruthtable 5
Total 20
StaffSignaturewithdate
6.a. DesignandimplementationofBinarytograycode
convertersusinglogicgates
AIM
1. TodesignandimplementationofBinarytograycodeconvertersusingMultisim-online
software.
2. HardwareImplementationofthesamewithvirtualLab-IITBombay
SOFTWAREREQUIRED
https://www.multisim.com/
APPARATUSREQUIRED
S.No Apparatus Type Range Quantity
1 IC IC7486 1
2 LED 4
3 Switch 4
4 DCPowerSource 1
5 Multisimonline
virtuallabIITBombay
6 Wires AsRequired
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.Thesuccessivegray
codediffersinone-bitpositiononlythatmeansitisaunitdistancecode.Itisalsoreferredas
cyclic code. It is not suitable for arithmetic operations. It is the most popular of the unit
distancecodes.Itisalsoareflectivecode.Ann-bitGraycodecanbeobtainedbyreflecting
an n-1-bit codeaboutanaxisafter2n-1rows,andputtingtheMSBof0abovetheaxisand
theMSBof1belowtheaxis.ThismethodusesanEx-ORgatetoperformamongthebinary
bits.Inthisconversionmethod,takedowntheMSBbitofthepresentbinarynumber,asthe
primarybitorMSBbitofthegraycodenumberissimilartothebinarynumber.
To get the straight gray coded bits for generatingthecorrespondinggraycodeddigit
for thegivenbinarydigits,addtheprimarydigitortheMSBdigitofbinarynumbertoward
the second digit & note downtheproductnexttotheprimarybitofgraycode,andaddthe
next binary bit to third bit then note down the product next to the 2nd
bit of gray code.
Similarly, followthisprocedureuntilthefinalbinarybitaswellasnotedowntheoutcomes
dependingon E
X-ORlogicoperation togeneratethecorrespondinggraycodedbinarydigit.
PROCEDURE
1. OpenMultisim.Signin.
2. Openanewcircuitfile
3. Selectthecomponents
• Gotodigital,choosedigitalconstants
• Gotodigital,chooseXOR2inputgate
• Gotoindicator,chooseLEDbulbs
• Gotoschematicconnectors,chooseground
4. Duplicatethecomponentsandconnectthemaspercircuitdiagram.
5. Fromanalysisandannotationchoosedigitalprobeandplacethemwherethe
outputbitsaretobeseen
6. Runthesimulationandverifytheoutput
7. Tochangetheinputvalues,varythevaluesofhighandlowonthedigitalconstantsand
verifythecompletetruthtableillustratedbelow.
CIRCUITDIAGRAM:
TRUTHTABLE
BINARY GRAYCODE
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)
BinarytoGraycodeconverterUsingXORGatesOnly
SIMULATIONDIAGRAM:
6.b.DesignandimplementationofGraytoBinarycodeconvertersusinglogic
gates
AIM
TodesignandimplementationofGraytoBinarycodeconvertersusingMultisim.
SOFTWAREREQUIRED
https://www.multisim.com/
PROCEDURE
1. OpenMultisim.Signin.
2. Openanewcircuitfile
3. Selectthecomponents
• Gotodigital,choosedigitalconstants
• Gotodigital,chooseXOR2inputgate
• Gotoindicator,chooseLEDbulbs
• Gotoschematicconnectors,chooseground
4. Duplicatethecomponentsandconnectthemaspercircuitdiagram.
5. Fromanalysisandannotationchoosedigitalprobeandplacethemwherethe
outputbitsaretobeseen
6. Runthesimulationandverifytheoutput
7. Tochangetheinputvalues,varythevaluesofhighandlowonthedigitalconstantsand
verifythecompletetruthtableillustratedbelow.
CIRCUITDIAGRAM
ALTERNATEWAY
PROCEDURE:
1. OpenMultisim.
2. Selectfilenavigationmenu→
Newfile
3. Selectthecomponents
a. GotosourcechooseDCsourceandgiveitsvalueas5V
b. GotodigitalchooseXOR2inputgate
c. Gotopassivechooseresistorandgiveitsvalueas100Ω.
d. Gotoschematicconnectorsandchooseground
4. Duplicatethecomponentsandconnectthemaspercircuitdiagram.
5. Fromanalysisandannotationchoosedigitalprobeandplacethemwherethe
output
bitsaretobeseen.
6. Runthesimulationandverifytheoutput
7. Tochangetheinputvaluesconnectittothedcsourceorconnectittogroundandverify
the
completetruthtablegivenbelow.
TRUTHTABLE
GRAYCODE BINARYCODE
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
GraytoBinarycodeconverterUsingXORGatesOnly
SIMULATIONDIAGRAM:
AnalogDiscovery2
Theory:
IntroductiontoNIAnalogDiscovery2(AD2):
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
environmentwiththefunctionalityoftraditionalbenchtopinstruments.Inadditiontothe100MS/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±5VDCadjustablepowersupplies.
IntroductiontoVirtualLab–IITBombay
The objective of VLabsDev is to involve the community to re-think on the best practices
regardingpedagogy,storyboards,labmanuals,documentationandthetechnologiesforbuilding
ahigh-qualitysimulator.
The main activities of the VLabsDevportalcurrentlyarecontentcreationthroughcommunity,
hosting the community created content, the source codes, hackathons for code and content
development,eventsforinstructorsforpedagogyandstoryboarddesign.
TheacademiccommunityofstudentsandinstructorsfromEngineering,ScienceandPolytechnic
institutes are the potentialstakeholdersaswellasthebeneficiaries.Theobjectiveistoprovide
qualityVirtualLabexperiencesforeducation.
The data collected through major universities in India indicates that, there are over 500 Labs
which need to be created;(only~120labsoftheMHRDVirtualLabsprojectareavailablefor
use).Therefore,thereexistsahugegapinthesyllabuswhichhastobefilledbythecommunity
itself.
AIM:
HardwareImplementationofthecodeconverterusingNIAnalogDiscovery2.
APPARATUSREQUIRED
S.No Apparatus Types Range Quantity
1 IC IC7486
2 NIAnalogDiscovery2
3 Wires AsRequired
4 Breadboard 1
PROCEDURE:
1.BuildtheBinarytoGrayandViceVersaCircuitinthebreadboard.
2.Usethebelowpindiagramforcircuitconnectioninbreadboard.
3.UsetheabovepinconnectionfromAD2.
4.Redwirebelongstopower.Takeawireconnecttoredwireandwireittopin14.
5.Blackwirebelongstoground.TakeawireconnecttoBlackwireandwireittopin7.
6.UsePin0-Pin3ofAD2asInput.
7.ConnectPin0-Pin3ofAD2toB0,B1,B2,B3.
8.UsePin4-Pin7ofAD2asOutput.
9.ConnectPin4-Pin7ofAD2toG0,G1,G2,G3.
10.SearchtheapplicationinPCforWaveform2015.
11.IntheabovewindowclicktheSuppliesInstrument.
12.Useonlypositivesupply.Changethevoltageas5.
13.ClickMasterEnablebuttontoenabletheInstrument.
14.IntheWelcometab,selectStaticIOInstrumenttoopen.
15ConfigureDigitalI/Osignalintoaswitchbyselecting0,Switch,Push/Pull(1/0)asseenin
FigurebelowforDIO0-DIO3
16.RunbothStaticIOandPowerSuppliesInstrument.
17.Verifythetruthtablebychangingtheswitchposition.
ConnectionDiagram
RESULT
Thus,designandimplementationofBinarytograycodeconvertersandViceVersausing
logicgatesusingMultisimandNIAnalogDiscovery2.