XOR and XNOR - Digilent Learn

文章推薦指數: 80 %
投票人數:10人

Truth tables for 2 and 3 input XNOR functions are shown in Fig. 2, and it can be seen that for each combination of inputs, the output is the inverse of the ... Backtothelist Share: XORandXNOR Circuits Digital XOR XNOR XORandXNOR TheExclusiveOR(orXOR)relationship$F=A\oplusB$isdefinedby thetruthtablesshowninFig.1andtheequivalenttwo-variablelogic expressions$F_{SOP}=A\cdot\overline{B}+\overline{A}\cdotB$and $F_{POS}=(A+B)\cdot(\overline{A}+\overline{B})$. Figure1.XORtruthtable($F=A\oplusB$,$F'=A\oplusB\oplusC$). TheXORfunctionisfrequentlyusedindigitalcircuitstomanipulate signalsthatrepresentbinarynumbers—thesecircuitswillbe presentedinalatermodule.Fornow,notetheXORoutputisasserted wheneveranoddnumberofinputsareasserted.This“odddetector” natureoftheXORrelationshipholdsforanynumberofinputs. CompoundXORfunctionslike$F=A\oplus(B\cdotC)$canalwaysbe writteninanequivalentSOPorPOSforms:$F_{SOP}=A\cdot \overline{B\cdotC}+\overline{A}\cdot(B\cdotC)$and$F_{POS}= (A+B\cdotC)\cdot(\overline{A}+\overline{B\cdotC})$. TheXNORfunctionistheinverseoftheXORfunction.Sincetheoutput ofa2-inputXNORisassertedwhenbothinputsarethesame,itis sometimesreferredtoastheEquivalencefunction(EQV),butthisname ismisleadingbecauseitdoesnotholdforthreeormorevariables (i.e.,theoutputofa3-inputXNORisnotassertedwheneverallthree inputsarethesame).Truthtablesfor2and3inputXNORfunctions areshowninFig.2,anditcanbeseenthatforeachcombinationofinputs, theoutputistheinverseoftheXORtruthtablesabove.TheExclusive NOR(orXNOR)relationship$F=\overline{A\oplusB}$showninthe truthtableshastheequivalenttwo-variablelogicexpressions: $F_{SOP}=\overline{A}\cdot\overline{B}+A\cdotB$and$F_{POS}= (\overline{A}+B)\cdot(A+\overline{B})$. Figure2.Xnortruthtable($F=\overline{A\oplusB}$,$F'=\overline{A\oplusB\oplusC}$). IfeithertheAorBinputsareintheXNORtruthtableinverted, thenXORoutputsareproduced;thatis,$F=\overline{A\oplusB}$ producesthesamelogicoutputas$F=\overline{A}\oplusB$or$F=A \oplus\overline{B}$.IfboththeAandBinputsareinverted,XNOR outputsarestillproduced:$F=\overline{A\oplusB}$producesthe sameoutputas$F=\overline{\overline{A}\oplus\overline{B}}$. ThissamepropertyholdsfortheXORfunction—invertinganysingle inputvariablewillresultinXNORfunction,andinvertingtwoinputs willagainproducetheXORfunction.Infact,thispropertycanbe generalizedtoXOR/XNORfunctionsofanynumberofinputs:anysingle inputinversionchangesthefunctionoutputbetweentheXORandXNOR functions;anytwoinputsignalinversionsdoesnotchangefunction outputs;anythreeinputsignalinversionschangesthefunctionoutput betweentheXORandXNORfunctions,etc.Moresuccinctly,invertingan oddnumberofinputschangesanXORtoanXNORandvice-versa, invertinganevennumberofinputschangesnothing,andinvertingthe entirefunctionhasthesameeffectasinvertingasingleinput.Some representativecasesareshown.\[\begin{align} F=\overline{A\oplusB\oplusC}&\iffF=\overline{A}\oplusB\oplusC &\iffF=\overline{A}\oplus\overline{B}\oplus\overline{C}\\ F=A\oplusB\oplusC&\iffF=\overline{A}\oplus\overline{B}\oplusC &\iffF=\overline{A\oplus\overline{B}\oplusC}\end{align}\]An evenmoresuccinctdescriptionoftheXORandXNORfunctionoutputs canbedrawnfromthepropertiesdiscussed.TheXORoutputis assertedwheneveranoddnumberofinputsareasserted,andtheXNOR isassertedwheneveranevennumberofinputsareasserted:theXORis anodddetector,andtheXNORanevendetector.Thisveryuseful propertywillbeexploitedindataerrordetectioncircuitsdiscussed later. XORandXNORgatesymbolsareshownbelowinFig.3.CMOScircuitsforeither functioncanbecanbuiltfromjust6transistors,butthosecircuitshavesome undesirablefeatures.Moretypically,XORandXNORlogicgatesare builtfromthreeNANDgatesandtwoinverters,andsotake16 transistors. Figure3.CMOSimplementationofXORandXNORgates. AusefulapplicationoftheXORfunctionisthe“controlledinverter” circuitillustratedbelowinFig.4.Thetruthtable,deriveddirectlyfromthe XORtruthtable,usesanXORgatewithoneinputtiedtoasignal named“control”.Whencontrolisa'1'theinputAisinverted,but whencontrolisa'0'Aissimplypassedthroughthelogicgate withoutmodification.Thiscontrolledinversionfunctionwillbe usefulinlaterwork. Figure4.XORgatecanbethoughtofasacontrolledinverter. ImportantIdeas TheXORoutputisassertedwheneveranoddnumberofinputsare asserted,andtheXNORisassertedwheneveranevennumberofinputs areasserted:theXORisanodddetector,andtheXNOR,aneven detector. Anyoddnumberofinputinversionchangesthefunctionoutputbetween theXORandXNORfunctions;anyevennumberofinputsignal inversionsdoesnotchangefunctionoutputs;anythreeinputsignal inversionschangesthefunctionoutput Xorgatecanbeusedasa“controlledinverter”. Otherproductandcompanynamesmentionedherein aretrademarksortradenamesoftheirrespectivecompanies.©2014 DigilentInc.Allrightsreserved.



請為這篇文章評分?