Digital Electronics DigitalElectronics:Principles,DevicesandApplications AnilK. Maini ©2007JohnWiley&Sons,Ltd. ISBN: 978-0-470-03214-5 Digital Electronics Principles, Devices and Applications Anil K. Maini Defence Research and Development Organization (DRDO), India Copyright©2007 JohnWiley&SonsLtd,TheAtrium,SouthernGate,Chichester, WestSussexPO198SQ,England Telephone (cid:2)+44(cid:3)1243779777 Email(forordersandcustomerserviceenquiries):[email protected] VisitourHomePageonwww.wiley.com AllRightsReserved.Nopartofthispublicationmaybereproduced,storedinaretrievalsystemortransmittedin anyformorbyanymeans,electronic,mechanical,photocopying,recording,scanningorotherwise,exceptunder thetermsoftheCopyright,DesignsandPatentsAct1988orunderthetermsofalicenceissuedbytheCopyright LicensingAgencyLtd,90TottenhamCourtRoad,LondonW1T4LP,UK,withoutthepermissioninwritingof thePublisher.RequeststothePublishershouldbeaddressedtothePermissionsDepartment,JohnWiley&Sons Ltd,TheAtrium,SouthernGate,Chichester,WestSussexPO198SQ,England,oremailedto [email protected],orfaxedto(+44)1243770620. Designationsusedbycompaniestodistinguishtheirproductsareoftenclaimedastrademarks.Allbrandnames andproductnamesusedinthisbookaretradenames,servicemarks,trademarksorregisteredtrademarksoftheir respectiveowners.ThePublisherisnotassociatedwithanyproductorvendormentionedinthisbook. Thispublicationisdesignedtoprovideaccurateandauthoritativeinformationinregardtothesubjectmatter covered.ItissoldontheunderstandingthatthePublisherisnotengagedinrenderingprofessionalservices.If professionaladviceorotherexpertassistanceisrequired,theservicesofacompetentprofessionalshouldbe sought. OtherWileyEditorialOffices JohnWiley&SonsInc.,111RiverStreet,Hoboken,NJ07030,USA Jossey-Bass,989MarketStreet,SanFrancisco,CA94103-1741,USA Wiley-VCHVerlagGmbH,Boschstr.12,D-69469Weinheim,Germany JohnWiley&SonsAustraliaLtd,42McDougallStreet,Milton,Queensland4064,Australia JohnWiley&Sons(Asia)PteLtd,2ClementiLoop#02-01,JinXingDistripark,Singapore129809 JohnWiley&SonsCanadaLtd,6045FreemontBlvd,Mississauga,ONT,CanadaL5R4J3 Wileyalsopublishesitsbooksinavarietyofelectronicformats.Somecontentthatappearsinprintmaynotbe availableinelectronicbooks. AnniversaryLogoDesign:RichardJ.Pacifico LibraryofCongressCataloginginPublicationData Maini,AnilKumar. Digitalelectronics:principles,devices,andapplications/AnilKumarMaini. p. cm. Includesbibliographicalreferencesandindex. ISBN978-0-470-03214-5(Cloth) 1. Digitalelectronics. I. Title. TK7868.D5M2752007 621.381—dc22 2007020666 BritishLibraryCataloguinginPublicationData AcataloguerecordforthisbookisavailablefromtheBritishLibrary ISBN978-0-470-03214-5(HB) Typesetin9/11ptTimesbyIntegraSoftwareServicesPvt.Ltd,Pondicherry,India PrintedandboundinGreatBritainbyAntonyRoweLtd,Chippenham,Wiltshire Thisbookisprintedonacid-freepaperresponsiblymanufacturedfromsustainableforestryinwhich atleasttwotreesareplantedforeachoneusedforpaperproduction. In the loving memory of my father, Shri Sukhdev Raj Maini, who has been a source of inspiration,courageandstrengthtometofaceallchallengesinlife,andaboveallinstilled in me the value of helping people to make this world a better place. Anil K. Maini Contents Preface xxi 1 NumberSystems 1 1.1 AnalogueVersusDigital 1 1.2 IntroductiontoNumberSystems 2 1.3 DecimalNumberSystem 2 1.4 BinaryNumberSystem 3 1.4.1 Advantages 3 1.5 OctalNumberSystem 4 1.6 HexadecimalNumberSystem 4 1.7 NumberSystems–SomeCommonTerms 4 1.7.1 BinaryNumberSystem 4 1.7.2 DecimalNumberSystem 5 1.7.3 OctalNumberSystem 5 1.7.4 HexadecimalNumberSystem 5 1.8 NumberRepresentationinBinary 5 1.8.1 Sign-BitMagnitude 5 1.8.2 1’sComplement 6 1.8.3 2’sComplement 6 1.9 FindingtheDecimalEquivalent 6 1.9.1 Binary-to-DecimalConversion 6 1.9.2 Octal-to-DecimalConversion 6 1.9.3 Hexadecimal-to-DecimalConversion 7 1.10 Decimal-to-BinaryConversion 7 1.11 Decimal-to-OctalConversion 8 1.12 Decimal-to-HexadecimalConversion 9 1.13 Binary–OctalandOctal–BinaryConversions 9 1.14 Hex–BinaryandBinary–HexConversions 10 1.15 Hex–OctalandOctal–HexConversions 10 1.16 TheFourAxioms 11 1.17 Floating-PointNumbers 12 1.17.1 RangeofNumbersandPrecision 13 1.17.2 Floating-PointNumberFormats 13 viii Contents ReviewQuestions 17 Problems 17 FurtherReading 18 2 BinaryCodes 19 2.1 BinaryCodedDecimal 19 2.1.1 BCD-to-BinaryConversion 20 2.1.2 Binary-to-BCDConversion 20 2.1.3 Higher-DensityBCDEncoding 21 2.1.4 PackedandUnpackedBCDNumbers 21 2.2 Excess-3Code 21 2.3 GrayCode 23 2.3.1 Binary–GrayCodeConversion 24 2.3.2 GrayCode–BinaryConversion 25 2.3.3 n-aryGrayCode 25 2.3.4 Applications 25 2.4 AlphanumericCodes 27 2.4.1 ASCIIcode 28 2.4.2 EBCDICcode 31 2.4.3 Unicode 37 2.5 Seven-segmentDisplayCode 38 2.6 ErrorDetectionandCorrectionCodes 40 2.6.1 ParityCode 41 2.6.2 RepetitionCode 41 2.6.3 CyclicRedundancyCheckCode 41 2.6.4 HammingCode 42 ReviewQuestions 44 Problems 45 FurtherReading 45 3 DigitalArithmetic 47 3.1 BasicRulesofBinaryAdditionandSubtraction 47 3.2 AdditionofLarger-BitBinaryNumbers 49 3.2.1 AdditionUsingthe2’sComplementMethod 49 3.3 SubtractionofLarger-BitBinaryNumbers 52 3.3.1 SubtractionUsing2’sComplementArithmetic 53 3.4 BCDAdditionandSubtractioninExcess-3Code 57 3.4.1 Addition 57 3.4.2 Subtraction 57 3.5 BinaryMultiplication 58 3.5.1 RepeatedLeft-ShiftandAddAlgorithm 59 3.5.2 RepeatedAddandRight-ShiftAlgorithm 59 3.6 BinaryDivision 60 3.6.1 RepeatedRight-ShiftandSubtractAlgorithm 61 3.6.2 RepeatedSubtractandLeft-ShiftAlgorithm 62 3.7 Floating-PointArithmetic 64 3.7.1 AdditionandSubtraction 65 3.7.2 MultiplicationandDivision 65 Contents ix ReviewQuestions 67 Problems 68 FurtherReading 68 4 LogicGatesandRelatedDevices 69 4.1 PositiveandNegativeLogic 69 4.2 TruthTable 70 4.3 LogicGates 71 4.3.1 ORGate 71 4.3.2 ANDGate 73 4.3.3 NOTGate 75 4.3.4 EXCLUSIVE-ORGate 76 4.3.5 NANDGate 79 4.3.6 NORGate 79 4.3.7 EXCLUSIVE-NORGate 80 4.3.8 INHIBITGate 82 4.4 UniversalGates 85 4.5 GateswithOpenCollector/DrainOutputs 85 4.6 TristateLogicGates 87 4.7 AND-OR-INVERTGates 87 4.8 SchmittGates 88 4.9 SpecialOutputGates 91 4.10 Fan-OutofLogicGates 95 4.11 BuffersandTransceivers 98 4.12 IEEE/ANSIStandardSymbols 100 4.12.1 IEEE/ANSIStandards–SalientFeatures 100 4.12.2 ANSISymbolsforLogicGateICs 101 4.13 SomeCommonApplicationsofLogicGates 102 4.13.1 ORGate 103 4.13.2 ANDGate 104 4.13.3 EX-OR/EX-NORGate 104 4.13.4 Inverter 105 4.14 Application-RelevantInformation 107 ReviewQuestions 109 Problems 110 FurtherReading 114 5 LogicFamilies 115 5.1 LogicFamilies–SignificanceandTypes 115 5.1.1 Significance 115 5.1.2 TypesofLogicFamily 116 5.2 CharacteristicParameters 118 5.3 TransistorTransistorLogic(TTL) 124 5.3.1 StandardTTL 125 5.3.2 OtherLogicGatesinStandardTTL 127 5.3.3 Low-PowerTTL 133 5.3.4 High-PowerTTL(74H/54H) 134 5.3.5 SchottkyTTL(74S/54S) 135 x Contents 5.3.6 Low-PowerSchottkyTTL(74LS/54LS) 136 5.3.7 AdvancedLow-PowerSchottkyTTL(74ALS/54ALS) 137 5.3.8 AdvancedSchottkyTTL(74AS/54AS) 139 5.3.9 FairchildAdvancedSchottkyTTL(74F/54F) 140 5.3.10 FloatingandUnusedInputs 141 5.3.11 CurrentTransientsandPowerSupplyDecoupling 142 5.4 EmitterCoupledLogic(ECL) 147 5.4.1 DifferentSubfamilies 147 5.4.2 LogicGateImplementationinECL 148 5.4.3 SalientFeaturesofECL 150 5.5 CMOSLogicFamily 151 5.5.1 CircuitImplementationofLogicFunctions 151 5.5.2 CMOSSubfamilies 165 5.6 BiCMOSLogic 170 5.6.1 BiCMOSInverter 171 5.6.2 BiCMOSNAND 171 5.7 NMOSandPMOSLogic 172 5.7.1 PMOSLogic 173 5.7.2 NMOSLogic 174 5.8 IntegratedInjectionLogic(I2L)Family 174 5.9 ComparisonofDifferentLogicFamilies 176 5.10 GuidelinestoUsingTTLDevices 176 5.11 GuidelinestoHandlingandUsingCMOSDevices 179 5.12 InterfacingwithDifferentLogicFamilies 179 5.12.1 CMOS-to-TTLInterface 179 5.12.2 TTL-to-CMOSInterface 180 5.12.3 TTL-to-ECLandECL-to-TTLInterfaces 180 5.12.4 CMOS-to-ECLandECL-to-CMOSInterfaces 183 5.13 ClassificationofDigitalICs 183 5.14 Application-RelevantInformation 184 ReviewQuestions 185 Problems 185 FurtherReading 187 6 BooleanAlgebraandSimplificationTechniques 189 6.1 IntroductiontoBooleanAlgebra 189 6.1.1 Variables,LiteralsandTermsinBooleanExpressions 190 6.1.2 EquivalentandComplementofBooleanExpressions 190 6.1.3 DualofaBooleanExpression 191 6.2 PostulatesofBooleanAlgebra 192 6.3 TheoremsofBooleanAlgebra 192 6.3.1 Theorem1(Operationswith‘0’and‘1’) 192 6.3.2 Theorem2(Operationswith‘0’and‘1’) 193 6.3.3 Theorem3(IdempotentorIdentityLaws) 193 6.3.4 Theorem4(ComplementationLaw) 193 6.3.5 Theorem5(CommutativeLaws) 194 6.3.6 Theorem6(AssociativeLaws) 194 6.3.7 Theorem7(DistributiveLaws) 195 Contents xi 6.3.8 Theorem8 196 6.3.9 Theorem9 197 6.3.10 Theorem10(AbsorptionLaworRedundancyLaw) 197 6.3.11 Theorem11 197 6.3.12 Theorem12(ConsensusTheorem) 198 6.3.13 Theorem13(DeMorgan’sTheorem) 199 6.3.14 Theorem14(TranspositionTheorem) 200 6.3.15 Theorem15 201 6.3.16 Theorem16 201 6.3.17 Theorem17(InvolutionLaw) 202 6.4 SimplificationTechniques 204 6.4.1 Sum-of-ProductsBooleanExpressions 204 6.4.2 Product-of-SumsExpressions 205 6.4.3 ExpandedFormsofBooleanExpressions 206 6.4.4 CanonicalFormofBooleanExpressions 206 6.4.5 (cid:2)and(cid:3) Nomenclature 207 6.5 Quine–McCluskeyTabularMethod 208 6.5.1 TabularMethodforMulti-OutputFunctions 212 6.6 KarnaughMapMethod 216 6.6.1 ConstructionofaKarnaughMap 216 6.6.2 KarnaughMapforBooleanExpressionswithaLargerNumberof Variables 222 6.6.3 KarnaughMapsforMulti-OutputFunctions 225 ReviewQuestions 230 Problems 230 FurtherReading 231 7 ArithmeticCircuits 233 7.1 CombinationalCircuits 233 7.2 ImplementingCombinationalLogic 235 7.3 ArithmeticCircuits–BasicBuildingBlocks 236 7.3.1 Half-Adder 236 7.3.2 FullAdder 237 7.3.3 Half-Subtractor 240 7.3.4 FullSubtractor 242 7.3.5 ControlledInverter 244 7.4 Adder–Subtractor 245 7.5 BCDAdder 246 7.6 CarryPropagation–Look-AheadCarryGenerator 254 7.7 ArithmeticLogicUnit(ALU) 260 7.8 Multipliers 260 7.9 MagnitudeComparator 261 7.9.1 CascadingMagnitudeComparators 263 7.10 Application-RelevantInformation 266 ReviewQuestions 266 Problems 267 FurtherReading 268