Logic Gates - Learn About Electronics

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

The number of gates per IC varies depending on the number of inputs per gate. Two−input gates are common, but if only a single input is required, such as in ... Learnaboutelectronics DigitalElectronics HOME CIRCUITS&RESISTORS ACTHEORY SEMICONDUCTORS AMPLIFIERS OSCILLATORS POWERSUPPLIES DIGITALELECTRONICS TheWeb Thissite 1.NumberSystems 2.DigitalLogic 3.LogicFamilies 4.CombinationalLogic 5.SequentialLogic 2.0Introduction 2.1LogicGates 2.2CombinationalLogic 2.3BooleanAlgebra 2.4KarnaughMaps 2.5Quiz Module2.1 DigitalLogic Whatyou´lllearninModule2.1 Afterstudyingthissection,youshouldbeableto: Describetheactionoflogicgates. •AND,OR,NAND,NOR,NOT,XORandXNOR. •UsingBooleanexpressions. •Usingtruthtables. Understandtheuseofuniversalgates. •NAND. •NOR. Recognisecommon74seriesICscontainingstandardlogicgates.   LogicGates SevenBasicLogicGates Fig.2.1.1ANSI&IECGateSymbols Digitalelectronicsreliesontheactionsofjustseventypesoflogicgates,calledAND,OR,NAND(NotAND),NOR(NotOR),XOR(ExclusiveOR)XNOR(ExclusiveNOR)andNOT. Fig.2.1.1illustratesaselectionofthebasiclogicgatesthatareavailablefromanumberofmanufacturersinstandardfamiliesofintegratedcircuits.EachlogicfamilyisdesignedsothatgatesandotherlogicICswithinthatfamily(andotherrelatedfamilies)canbeeasilycombined,andbuiltintolargerlogiccircuitstocarryoutcomplexfunctionswiththeminimumofadditionalcomponents. Inbinarylogicthereareonlytwostatesallowed,1and0or‘onandoff’.thewordNOTintheworldofbinarylogicthereforemeans‘theoppositeof’.Ifsomethingisnot1itmustbe0,ifitisnoton,itmustbeoff.SoNAND(notAND)simplymeansthataNANDgateperformstheoppositefunctiontoanANDgate. Alogicgateisasmalltransistorcircuit,basicallyatypeofamplifier,whichisimplementedindifferentformswithinanintegratedcircuit.Eachtypeofgatehasoneormore(mostoftentwo)inputsandoneoutput. Theprincipleofoperationisthatthecircuitoperatesonjusttwovoltagelevels,calledlogic0andlogic1.Thesevaluesarerepresentedbytwodifferentvoltagelevels.In5voltlogic,1isideallyrepresentedby5Vand0by0V,andin3.3Vlogic1isideallyrepresentedby3.3Vandlogic0by0V.Wheneitherofthesevoltagelevelsisappliedtotheinputs,theoutputofthegaterespondsbyassuminga1ora0level,dependingontheparticularlogicofthegate.Thelogicrulesforeachtypeofgatecanbedescribedindifferentways;byawrittendescriptionoftheaction,byatruthtable,orbyaBooleanalgebrastatement. BooleanStatements Fig.2.1.2BooleanSymbolsforGates TheactionsofanyofthesegatescanalsobedescribedusingBooleanstatements.Theseuselettersfromthebeginningofthealphabet,suchasA,B,Cetc.toindicateinputs,andlettersfromthesecondhalfofthealphabet,verycommonlyXorY(andsometimesQorP)tolabelanoutput.Thelettershavenomeaninginthemselves,otherthanjusttolabelthevariouspointsinthecircuit.ThelettersarethenlinkedbyaBooleansymbolindicatingthelogicalactionofthegate. The•symbolindicatesANDalthoughinmanycasesthe•maybeomitted.(A•BmayalsobewrittenasABorA.B) +indicatesOR ⊕indicatesXOR(ExclusiveOR) Althoughthesymbols•and+arethesameasthoseusedinnormalalgebratoindicateproduct(multiplication)andsum(addition)respectively,inbinarylogicthe+symboldoesnotexactlycorrespondtosum.Indigitallogic1+(OR)1=1,butthebinarysumof1+1=102,thereforeindigitallogic+mustalwaysbeconsideredasOR. Threefurthertypesoflogicgategiveanoutputthatisaninvertedversionofthethreebasicgatefunctionslistedabove,andtheseareindicatedbyabardrawnaboveastatementusingtheAND,OR,orXORsymbolstoindicateNAND,NORandXNOR. A•BmeansAANDBbutA•BmeansANANDB TheactionofanyofthegatescanthereforbedescribedbyusingitsBooleanequation. Forexample,anANDgategivesanoutputoflogic1wheninputAANDinputBareatlogic1,butaNANDgatewouldgivealogic0outputforthesameinputconditions.AlsowheretheANDgategivesalogiczeroforaparticularinputcombination,theNANDgatewouldgivealogic1.The‘N’inthegate’sname,orthebarabovetheBooleanexpressionthereforeindicatesthattheoutputlogicis‘inverted’.IndigitallogicNANDis‘NOT’AND,ortheoppositeofAND.SimilarlyNORis‘NOT’OR,andXNORis‘NOT’XOR. DescribingtheActionofLogicGates Alternativelytheactionofanyofthe7typesoflogicgatecanbedescribedusingawrittendescriptionofitslogicfunction. TheANDgateoutputisatlogic1when,&onlywhenallitsinputsareatlogic1,otherwisetheoutputisatlogic0. TheORgateoutputisatelogic1whenoneormoreofitsinputsareatlogic1.Ifallitsinputsareatlogic1,theoutputisatlogic0. TheNANDgateoutputisatlogic0when&onlywhenallitsinputsareatlogic1.Otherwisetheoutputisatlogic0. TheNORgateoutputisatlogic0whenoneormoreofitsinputsareatlogic1.Ifallofitsinputsareatlogic0,theoutputisatlogic1. TheXORgateoutputisatlogic1whenandonlyoneofitsinputsisatlogic1.Otherwisetheoutputisatlogic0. TheXNORgateoutputisatlogic0whenoneandonlyoneofitsinputsisatlogic1Otherwisetheoutputisatlogic1.(ItisthereforesimilartotheXORgate,butitsoutputisinverted). TheNOTgateoutputisatlogic0whenitsonlyinputisatlogic1,andatlogic1whenitsonlyinputisatlogic0.ForthisreasonitisoftencalledanINVERTER. divclass="clearit"> Fig.2.1.3TruthTables TruthTables Anotherusefulwaytodescribetheactionofadigitalgate(orawholedigitalcicuit)istouseatruthtable.Eachtableconsistsoftwoormorecolumns,onecolumnforeachinputoroutput;thenumberoflinesinthecolumnwillbeenoughtorecordallpossiblelogicstatesforthatinputoroutput.Fig.2.1.3illustratestwotypicaltruthtablesforciruitsofdifferentlevelsofcomplexity. Thetoptableisforasimpletwoinputandgate.ThishastwoinputslabelledAandBandonecolumn(X)fortheoutput.Comparingthetruthtablewiththewrittendescriptionin"DescribingtheActionofLogicGates"(above)itcanbeseenthatthetruthtablefollowsthewrittendescriptionbyshowingthatoutputXisatlogic1onlywheninputsAandBareatlogic1,otherwise(wherethethreeupperlinesare00,01and10)theoutputislogic0. ThesecondtableinFig.2.1.3describesamorecomplexcircuit(offiveNANDgatesmimicingaXORgate).NoticethatnowthetruthtableisexpandedtoillustratethelogiclevelsatfourfurtherinputsoroutputsinadditiontoinputsAandBbeforethefinaloutputXisillustratedintherighthandcolumn.Suchcomplextablescanbeofgreatvalueinbothdigitalcircuitdesignorfaultfinding. ANDGate NANDGate ORGate NORGate XORGate XNORGate NOTGate Fig.2.1.4LogicGateAnimations(Clickanygate) LogicGateAnimations InFig2.1.4youcancheckouttheoperationofthebasiclogicgatesforyourself.Thegateanimationsallowyoutochooseanyoneofthe7basicgatesandseeanewpagewithananimatedimageofthegateinoperation.Usetheanimationtobecomefamiliarwiththeoperationofeachofthegates.Toreturntothispage,justclosethepageshowingtheanimation. Toeasilyunderstandmorecomplexdigitalcircuitsitisimportanttodevelopagoodmentalpictureoftheexpectedoutputfromeachgateforanypossibleinput. TheanimationsavailableinFig.2.1.4alsoshowhowthesevenbasiclogicfunctionscanbedescribedusinga‘truthtable’toshowtherelationshipbetweentheoutput(X)andallpossibleinputcombinationsforinputsAandB,shownasafourvaluebinarycountfrom00to11.Eachanimateddiagramshowstheinputandoutputconditionsforoneofthesevenlogicfunctionsinitstwoinputform.Sometypesofgatehowever,arealsoavailablewithmore(e.g.3to13)inputs.Forthesegatesthetruthtableswouldneedtobeextendedtoincludeallpossibleinputconditions. UniversalGates BecausegatesaremanufacturedinICform,typicallycontainingtwotosixgatesofthesametype,itisoftenuneconomicaltouseacompleteICofsixgatestoperformaparticularlogicfunction.Abettersolutionmaybetousejustasingletypeofgatetoperformanyofthelogicoperationsrequired.Twotypesofgate,NANDandNORareoftenusedtoperformthefunctionsofanyoftheotherstandardgates,byconnectinganumberofeitherofthese‘universal’gatesinacombinationalcircuit.Althoughitmaynotseemefficienttouseseveraluniversalgatestoperformthefunctionofasinglegate,ifthereareanumberofunusedgatesinoneormoreNANDandNORICs,thesecanbeusedtoperformotherfunctionssuchasANDorORratherthanusingextraICstoperformthatfunction.ThistechniqueisespeciallyusefulinthedesignofcomplexICswherewholecircuitswithintheICcanbefabricatedusingasingletypeofgate. Fig.2.1.5atogshowshowNANDgatescanbeusedtoobtainanyofthestandardfunctions,usingonlythissinglegatetype. Fig2.1.5CreatinganyLogicFunctionUsingNANDGates NOTFunction a.ConnectingtheinputsoftheNANDgatetogethercreatesaNOTfunction. b.AlternativelytheNOTfunctioncanbeachievedbyusingonly1inputandconnectingtheotherinputpermanentlytologic1. ANDFunction c.AddingtheNOTfunction(aninverter)totheoutputofaNANDgatecreatesanANDfunction. ORFunction d.InvertingtheinputstoaNANDgatecreatesanORfunction. NORFunction e.UsingaNOTfunctiontoinverttheoutputofanORfunctioncreatesaNORfunction. XORfunction f.FourNANDgates(asingleIC)connectedasshowncreatesanXORfunction(andaQuadNANDICisabout15%cheaperthanaQuadXORIC). XNORFunction g.InvertingtheoutputoftheXORfunctioncreatesanXNORfunction. SimilarconversionscanbeachievedusingNORgates,butasNANDgatesaregenerallytheleastexpensiveICs,theconversionsshowninFig.2.1.5aremorefrequentlyused.Thereasonforsuchconversionsisusuallycost.Thismaynotseemveryusefulsincenoneofthebasic74seriesICsareexpensive,butwhenseveralthousandunitsofaparticularcircuitaretobemanufactured,thesmallsavingsincostandspaceonprintedcircuitboardsbymaximisingtheuseofotherwiseunusedgatesinmultigateICscanbecomeveryimportant.   Fig.2.1.6LogicGatesFromthe74seriesTTLICFamily LogicICs Typically,standardlogicgatesareavailablein14pinor16pinDIL(dualinline)chips.ThenumberofgatesperICvariesdependingonthenumberofinputspergate.Two−inputgatesarecommon,butifonlyasingleinputisrequired,suchasinthe7404NOT(orinverter)gates,a14pinICcanaccommodate6(orHex)gates.Thegreatestnumberofinputsonasinglegateisonthe7413313inputNANDgate,whichisaccommodatedina16pinpackage. DataSheets 7400Quad2inputNANDgates 7402Quad2inputNORgates 7404HexNOTgates(Inverters) 7408Quad2inputANDgates 7432Quad2inputORgates 7486Quad2inputXORgates 747266Quad2inputXNORgates 74133Single13inputNANDgate TopofPage ©2007−2022EricCoatesMABSc.(Hons) Allrightsreserved. (Revision15.0029thDecember2020) 



請為這篇文章評分?