Upload
others
View
41
Download
28
Embed Size (px)
Citation preview
All-in-OneElectronicsGuideAcomprehensiveelectronicsoverviewforelectronicsengineers,technicians,students,educators,hobbyists,andanyoneelsewhowantstolearnaboutelectronics
Yourcompletepracticalguidetounderstandingandutilizingmodernelectronics!By:CammenChanC&CGroupofCompaniesLLC.PublishedbyC&CGroupofCompaniesLLC.Copyright2015.Allrightsreserved.
Nopartofthispublicationmaybereproduced,storedinaretrievalsystem,ortransmittedinanyformorbyanymeans,electronic,mechanical,photocopying,recording,orotherwise,withoutthepriorwrittenpermissionofthepublisher.
Website:http://www.ALLinOneElectronicsGuide.comE-mail:[email protected]:http://www.facebook.com/ALLinOneElectronicsGuideTwitter:http://www.twitter.com/ai1_electronicsAlltrademarksmentionedhereinarepropertyoftheirrespectivecompanies.
BookCoverEditor:FloraGillisBookEditor:PriscillaP.FloresBookCoverDesigner:KristinFleminghttp://www.kristinfleming.com/
ISBN-10:1479117374ISBN-13:978-1479117376PrintedintheUnitedStatesofAmerica
III
AbouttheAuthor
CammenChanhasbeenworkingintheelectronicsindustrysince1996.AfterreceivinghisbachelorofsciencedegreeinelectronicengineeringtechnologyfromtheWentworthInstituteofTechnologyandmasterofsciencedegreeinelectricalengineeringfromBostonUniversity,hebeganhisengineeringcareeratIBMMicroelectronics,thenworkedatAnalogDevicesInc.,NationalSemiconductor,andseveraltechnologystartups.HehasoneUSpatentinventionintheareaofnanotechnology.Since2009,CammenhasalsobeenanadjunctfacultymemberatanumberofUScollegesanduniversitiesincludingITTTechnicalInstitute,DeVryUniversity,WesternInternationalUniversity,UniversityofAdvancingTechnology,ChandlerGilbertCommunityCollege,RemingtonCollege,andExcelsiorCollege.Heteacheselectronicsengineeringtechnology,informationtechnology,mathematics,andemergingtechnologies.Cammenhastaughtallthesubjectsinthisbookinvariousformatssuchason-site,online,andblendedclasses.Currently,CammenisatechnicaltrainingengineeratMicrochipTechnologyinthePhoenixarea.
IV
Introduction
Thesemiconductorindustryisabigbusiness.Theelectronicsindustryisevenbigger.ThesemiconductorindustryalonewasaUS$300billionplusindustryin2012.Thelong-termtrendofelectronicsisbrightandpromising.Withincreasinguseofelectronicdevicesinconsumer,commercial,andindustrialproductsandsystems,theelectronicsindustryisalwaysgrowing.Ifyouareconsideringbecominganelectronicsengineer,thisbookgivesyouthetechnicalskillsneededto“pass”thetechnicalpartsofinterviewsandtheconfidencetoincreaseyourchancesofgettingemployed.Ifyouarealreadyanelectronicstechnicianorengineer,thisbookimprovesyourabilitytoperformatthehighestlevelatworkintheelectronicsfield.Ifyouwanttobeamicroelectronicsengineerorarealreadyone,youwillfindthemicroelectronics-relatedcontentsinthisbookapplicabletoyourwork.Ifyouareaneducatorteachingelectronics,thisbookistheperfectreferenceforyouandyourstudentswithstep-by-steptechnicalexamplesandquizzes.Ifyouareanelectronicshobbyist,thisbookofferssampledelectroniccircuits(electroniccomponentsconnectedwitheachotherbywiresortraces)youcanapplytoyourdesign.Foreveryoneelseinterestedinlearningaboutelectronics,thisbookprovidesastrongfoundationofwhatyouneedtoknowwhenworkingwithelectronics.
Thechaptersaredividedintovariouselectronicprincipleslevels,frombasictoadvanced,alongwithpracticalcircuitsandquizzes.Answersprovidestep-by-stepexplanationsofhowandwhytheanswerswerederived.Examplesandcircuitsinlaterchaptersbuilduponpreviouschapters,thuscreatingaconsistentflowoflearningandagradualaccumulationofknowledge.Thelevelofmathematicsismoderatewithouttediousandcomplicatedmathmodelsandformulas.Forstudentsmajoringinelectricalengineering,thisbookismorethanyourtypicalacademicelectronicstextbookthatoverwhelmsyouwithexcessivetheories,formulas,andequations.Instead,thematerialcoveredinthisbookiseasytoread,withplentyofdiagrams,pictures,waveforms,andgraphs,andiseasytounderstand.Accuratelyrepresentingournon-idealworld,thisbook’stechnicalcontentsgreatlydifferfrommostacademictextbooks’false“ideal”perspective.Thecontentisinjectedwithrealworldquantitiesandcharacteristics.Forexperiencedelectronicsprofessionals,educators,andhobbyists,thisbookaffordsagoodrealitycheckandcomprehensivereviewtoassistyourcareeroryourstudents,tobetterprepareforyournextjobinterview,andtoinspireyournextelectronicsprojects.
V
HowThisBookIsOrganized
Chapter1:DirectCurrent(DC)
First,learndirectcurrent(DC)theories.Then,applytheminpracticalcircuits.Basicelectricalparameters,concepts,andtheoriesarecovered.ThischaptercloseswithpracticalDCcircuits.
Chapter2:Diodes
Zeroinondiode,thebuildingblockoftransistors.Thischapterexplainsnotonlywhatadiodeismadeofbutalsotherealworldcharacteristicsofdiodeandsomepracticaldiodecircuits.
Chapter3:AlternatingCurrent(AC)
AftercomprehendingDCanddiodes,learnaboutAC,anothercriticalelectronicsconcept.Fromhigh-powerelectricplantstocomputersandwirelesscommunications,ACoperationstakeplaceincountlesselectronicsystems.GetagoodholdonACdefinitions,commonACparameters,capacitors,inductors,andsimpleACcircuits.
Chapter4:AnalogElectronics
Analogelectronicsuseasubstantialamountofanalogquantities.Transistorsandoperationalamplifiers(op-amp)arethebuildingblocksofmainstreamelectroniccircuitsandsystems.BipolarandComplimentary-Metal-Oxide-Semiconductor(CMOS)arethemostcommontypesoftransistors.Bipolartransistorsconsistoftwodiodes.Ontheotherhand,CMOSdoesnotcontainanyactivediodes.Althoughgermanium,gallium,andarsenidecanbeusedtobuildtransistors,bothbipolarandCMOStransistorsprimarilyusesiliconastherawmaterial.Performancedifferencesbetweenrawmaterialstypesmustbeconsideredtochoosethecorrecttransistortype.CMOSandbipolartransistorshavesimilarvoltageandcurrentcharacteristicswithmajordifferencesinfundamentaloperation.Asolidunderstandingofthesedifferencesisessentialforanalyzinganddesigningtransistorsandop-ampcircuits.
Chapter5:DigitalElectronics
Basicdigitalelectronicsrequireanin-depthunderstandingofdigitalquantities,high(1)andlow(0)logiclevel,logicgates,andcircuits.Itisconsiderablythebestsemiconductortechnologychoiceforhigh-speeddesignandoperations.Incomparisontoanalogquantities,thesimpletwolevels(1and0)offerdistinctadvantagesoveranalogtechnologysuchaslowernoise.Forcostreasons,digitalelectronicspresentagoodcaseforusingCMOStransistortechnologyindigitalsystems.CMOStransistorsaremadeindeepsub-microscopicscalewithadvancedchipmanufacturingcapability,whilemanufacturingthroughputscontinuestoincreaseexorbitantly.Forhighspeed,high-
densitydigitaldesignssuchasApplicationSpecificIntegratedCircuit(ASIC),FieldProgrammableGateArray(FPGA),ormicroprocessors,digitaldesignersoftenusesoftwaretowriteprograms/codeforgeneratingCMOSdesign.UsingVHDLorVerilog,instead
VIHowThisBookIsOrganized
ofmanuallyplacingtransistorsindividuallyinschematicsasinanalogdesign,digitalcircuitsaregeneratedtorepresentthefunctionalandbehavioralmodelsandoperationsofthetargetCMOSdesign.Inrecentyears,BiCMOSprocesshasgainedpopularity.Asitsnameimplies,thisprocesscombinesbothbipolarandCMOSdevices,offeringthebestofboth.
Chapter6:Communications
Electroniccommunicationsaretechnology.Itisanenormousbusinesses.Radios,cellphones,homeandbusinesscomputersconnectedtotheinternetbyusingeitherwiredorwirelessconnectionsarejustsomeexamples.Thevastmajorityofthistechnologyisonlypossibleduetotheadvanceddevelopmentofelectroniccommunicationsystems.Additionally,amplitudemodulation,frequencymodulation,andphaselockedloopswillbediscussedinthischapter.Understandingbasiccommunicationtheories,techniques,andparameterswillgreatlyassistyourworkinthecommunicationsengineeringfield.thefoundationofwiredindustrywithitsmarketandwirelesscommunications
coveringbothconsumersand
Chapter7:Microcontrollers
Microcontrollersiliconchipshavefoundtheirwayintoavarietyofelectronicproducts.Oneautomobilealonehasanaverageofeightymicrocontrollerscontrollingtheengine,steeringwheelcontrols,GPS,audiosystems,powerseats,andothers.Microcontrollersareembeddedinmanyconsumerandindustrialelectronicsincludingpersonalcomputers,TVsets,homeappliances,children’stoys,motorcontrol,securitysystems,andmanymore.Thefinalproductsthatusemicrocontrollersareembeddedsystems.Thesedevicesarefieldprogrammable:theyallowsystemdesignerstoprogramthechiptotheneedsofaspecificapplication,whilelettingendusersperformalimitedamountofmodification.Forexample,anenduserturningonamicrowaveovenisactually“programming”thetimer.However,theenduserdoesnothaveaccesstothesourcecodeonthemicrocontroller,hencethename“embeddedsystems.”Moreover,thesamemicrocontrollercanbeusedinmultipledesigns.Forinstance,dishwashersandrefrigeratorsusethesamemicrocontrollerwitheachdesignhavingitsownspecificcodedownloadedtothemicrocontroller,resultingintwocompletelydifferentapplications.Themicrocontroller’sfieldprogrammingcapabilitiesallowsmanyapplicationstobedesignedataverylowcost.Comprehendingmicrocontrollerarchitectureandbasicprogrammingtechniqueswillprepareyoutoexcelinthisfield.
Chapter8:ProgrammableLogicControllers
ProgrammableLogicControllers(PLCs)arewidelyusedinapplications.Thus,itisworthwhiletostudytheminadditiontoconsumer-basedsystems.TypesandusesofPLCsarecoveredfirst,followedbyaninsidelookatPLCs.Ladderlogicprogramming,agraphicalprogrammingtechnique,istheheartofPLCs.Inaddition,afterexploringpracticalPLCprogramsandapplications,thechaptercloseswithPLCstroubleshootingtechniquesandfuturedevelopment.
HowThisBookIsOrganizedVII
industrialandcommercial
Chapter9:MentalMath
Ifyouhavetouseacalculatortosolve1/1k=1m,youareprobablynotmakingagoodimpressiononinterviewersorevencoworkers.Usingmentalmathtodeciphersimplearithmeticanswersdemonstratessolidmathematic,analytic,andproblemsolvingcapabilities.Youcanlearnsimpletechniquestoimproveyourmentalmathabilityforcalculatingelectronicsarithmetic.
Chapter1:DirectCurrent(DC)______________________________-1
Current________________________________________________________________________-1Resistor________________________________________________________________________-1Voltage________________________________________________________________________-5Definition_______________________________________________________________________-5Ohm’sLaw______________________________________________________________________-6Power_________________________________________________________________________-7VoltageSourceandSchematic______________________________________________________-7CurrentSourceandSchematics_____________________________________________________-8Electrons_______________________________________________________________________-8CurrentversusElectrons___________________________________________________________-9Kirchhoff’sVoltageLaw(KVL)______________________________________________________-9Kirchhoff’sCurrentLaw(KCL)______________________________________________________-11ParallelCircuit
__________________________________________________________________-11ParallelResistorRule____________________________________________________________-12SeriesResistorRule______________________________________________________________-13CurrentDividerRule_____________________________________________________________-15VoltageDivider_________________________________________________________________-16SuperpositionTheorems__________________________________________________________-19DCCircuits_____________________________________________________________________-22ICPackages____________________________________________________________________-24Summary______________________________________________________________________-33Quiz__________________________________________________________________________-33
Chapter2:Diodes_______________________________________-37
P-NJunctions___________________________________________________________________-37Forward-BiasedandReverse-Biased________________________________________________-40DiodeI-VCurve_________________________________________________________________-42
XTableofContents
DiodeCircuits__________________________________________________________________-43Summary______________________________________________________________________-47Quiz__________________________________________________________________________-48
Chapter3:AlternatingCurrent(AC)_________________________-49
SineWave_____________________________________________________________________-49FrequencyandTime_____________________________________________________________-50PeakVoltagevs.Peak-to-PeakVoltage______________________________________________-52DutyCycle_____________________________________________________________________-52
Vrms_________________________________________________________________________-54Impedance,Resistance,andReactance______________________________________________-54Capacitors_____________________________________________________________________-55XCversusFrequency_____________________________________________________________-56SimpleCapacitorCircuit__________________________________________________________-57I(∆t)=C(∆V)___________________________________________________________________-59CapacitorChargingandDischargingCircuit___________________________________________-60ParallelCapacitorRule___________________________________________________________-63SeriesCapacitorRule____________________________________________________________-63PowerRatioindB_______________________________________________________________-64RCSeriesCircuit________________________________________________________________-64–20dBperDecade______________________________________________________________-65Low-PassFilter_________________________________________________________________-68PhaseShift____________________________________________________________________-69Radian________________________________________________________________________-70ICE___________________________________________________________________________-71Inductors______________________________________________________________________-73XLversusFrequency_____________________________________________________________-74V(∆t)=L(∆I)___________________________________________________________________-75ELI___________________________________________________________________________-77QFactor_______________________________________________________________________-77ParallelInductorRule____________________________________________________________-78SeriesInductorRule_____________________________________________________________-79High-PassFilter_________________________________________________________________-80RealLandC____________________________________________________________________-83
PracticalACCircuits_____________________________________________________________-85RingingandBounce_____________________________________________________________-86InductiveLoad__________________________________________________________________-87DiodeClamp___________________________________________________________________-88SeriesRLCCircuit_______________________________________________________________-89LRCParallel(Tank)Circuit_________________________________________________________-91Transformers___________________________________________________________________-93Half-WaveRectifier______________________________________________________________-95SwitchingversusLinearRegulators_________________________________________________-97BuckRegulator_________________________________________________________________-97Summary_____________________________________________________________________-100Quiz_________________________________________________________________________-101
Chapter4:AnalogElectronics____________________________-105
WhatIsAnalog?_______________________________________________________________-105AnalogICMarket______________________________________________________________-106WhatAreTransistorsMadeOf?___________________________________________________-107NPNandPNP__________________________________________________________________-108NPNandPNPSymbols__________________________________________________________-109TransistorCross-Section_________________________________________________________-110BipolarTransistorTerminalImpedance_____________________________________________-111IC,IB,IE,andBeta(β)___________________________________________________________-111
XIITableofContents
VBE_________________________________________________________________________-113IE=IC+IB____________________________________________________________________-113ICversusVCECurve
____________________________________________________________-114CommonEmitterAmplifier______________________________________________________-115CommonCollectorAmplifier(EmitterFollower)______________________________________-118CommonBaseAmplifier_________________________________________________________-120Single-EndedAmplifierTopologiesSummary________________________________________-121Tranconductance(Gm),Small-SignalModels________________________________________-121CommonEmitterAmplifierInputImpedance________________________________________-123CommonEmitterAmplifierOutputImpedance______________________________________-124CommonCollectorAmplifierSmall-SignalModel_____________________________________-127CommonBaseAmplifierSmall-SignalModel________________________________________-128Single-EndedAmplifierSummary_________________________________________________-129NMOSandPMOS______________________________________________________________-1303DNFET______________________________________________________________________-131DrainCurrentandThresholdVoltage______________________________________________-132NFETandPFETSymbols_________________________________________________________-132ICLayout_____________________________________________________________________-134VHDLandVerilog______________________________________________________________-135MOSFETCrossSectionandOperations_____________________________________________-136MOSFETOn-OffRequirements____________________________________________________-137IDversusVDSCurve____________________________________________________________-139CMOSSourceAmplifier_________________________________________________________-139MOSFETParasitic______________________________________________________________-142CommonDrainAmplifier(SourceFollower)_________________________________________-143CommonGateAmplifier_________________________________________________________-145BipolarversusCMOS___________________________________________________________-147DifferentialAmplifiers__________________________________________________________-148
TableofContentsXIII
CommonMode________________________________________________________________-149
CMRRandDifferentialGain______________________________________________________-150CurrentMirror_________________________________________________________________-152Op-Amp______________________________________________________________________-153Op-AmpRules_________________________________________________________________-155InvertingAmplifier_____________________________________________________________-158Non-InvertingAmplifier_________________________________________________________-160Op-AmpParameters____________________________________________________________-162LM741_______________________________________________________________________-164CurrentMirrorInaccuracies______________________________________________________-165WilsonCurrentMirror__________________________________________________________-166BipolarCascode________________________________________________________________-167DarlingtonPair________________________________________________________________-168CMOSCacosde________________________________________________________________-170Buffer(VoltageFollower)________________________________________________________-171SummingAmplifier_____________________________________________________________-172ActiveLow-PassFilter___________________________________________________________-174CircuitSimulator_______________________________________________________________-176Hysteresis____________________________________________________________________-179PositiveFeedback(Oscillation)___________________________________________________-182InstrumentationAmplifier_______________________________________________________-184LinearRegulator_______________________________________________________________-185LowDrop-out(LDO)Regulator____________________________________________________-186Summary_____________________________________________________________________-189Quiz_________________________________________________________________________-190
Chapter5:DigitalElectronics_____________________________-195
1sand0s:TheInverter
__________________________________________________________-196NMOSInverter________________________________________________________________-197NFETandPFETInverter_________________________________________________________-197InverterAction________________________________________________________________-198Shoot-ThroughCurrent__________________________________________________________-199RingOscillator_________________________________________________________________-200ORLogicGate_________________________________________________________________-202ORGateSchematic_____________________________________________________________-202Three-InputORGate____________________________________________________________-203LSB,MSB_____________________________________________________________________-204NORGate_____________________________________________________________________-204ANDandNANDGates___________________________________________________________-205XORGate_____________________________________________________________________-206CombinationalLogic____________________________________________________________-206BooleanAlgebra_______________________________________________________________-207Latch________________________________________________________________________-208Flip-Flop______________________________________________________________________-210DandJ-KFlip-Flops_____________________________________________________________-211FrequencyDivider______________________________________________________________-211ShiftRegister__________________________________________________________________-213ParallelDataTransmission_______________________________________________________-214Multiplexer___________________________________________________________________-215Mixed-signal__________________________________________________________________-216LevelShifter__________________________________________________________________-217Multi-LayerBoard______________________________________________________________-217DigitalVoltageLevels
___________________________________________________________-219
TableofContentsXV
Analog-to-DigitalConverter______________________________________________________-219NyquistFrequency_____________________________________________________________-221ADCGainandOffsetErrors______________________________________________________-222Digital-to-AnalogConverter______________________________________________________-224Binary-WeightedDAC___________________________________________________________-225555-Timer____________________________________________________________________-226Summary_____________________________________________________________________-230Quiz_________________________________________________________________________-230
Chapter6:Communications_____________________________-231
TimeversusFrequencyDomains__________________________________________________-232Harmonics,Distortion,andInter-modulation________________________________________-234Modulation___________________________________________________________________-236BitRate,USB,andBaud_________________________________________________________-236C=Fλ_______________________________________________________________________-237AmplitudeModulation__________________________________________________________-238ModulationIndexandBesselChart________________________________________________-239AMTransmitter________________________________________________________________-240FrequencyModulation__________________________________________________________-241PhaseLockLoop(PLL)___________________________________________________________-242Summary_____________________________________________________________________-245Quiz_________________________________________________________________________-245
Chapter7:Microcontrollers_____________________________-247
MCUParameters_______________________________________________________________-248HarvardArchitecture___________________________________________________________-251DataandProgramMemory______________________________________________________-251MCUInstructions______________________________________________________________-255InstructionClock_______________________________________________________________-257InternalOscillator______________________________________________________________-258Interrupt_____________________________________________________________________-260SpecialFeatures_______________________________________________________________-261DevelopmentTools_____________________________________________________________-262Debugger_____________________________________________________________________-263DesignExample:Comparator_____________________________________________________-265DesignExample:Timer__________________________________________________________-269Summary_____________________________________________________________________-271Quiz_________________________________________________________________________-271
Chapter8:ProgrammableLogicControllers_________________-273
History_______________________________________________________________________-273PLCBenefits__________________________________________________________________-275PLCComponents_______________________________________________________________-276PLCProgrammingandLadderLogic________________________________________________-278PLCProgrammingExample_______________________________________________________-283PLCProgrammingSyntax________________________________________________________-286Timers_______________________________________________________________________-292On-Timer_____________________________________________________________________-293On-TimerApplication___________________________________________________________-294Off-Timer_____________________________________________________________________
-295Off-TimerApplication___________________________________________________________-296Counter______________________________________________________________________-297CounterApplication____________________________________________________________-298ProgramControlInstructions_____________________________________________________-300JumptoLabelInstructions_______________________________________________________-300JumptoSubroutineInstructions__________________________________________________-301NestedSubroutines____________________________________________________________-303
TableofContentsXVII
TemporaryEnd________________________________________________________________-304DataManipulationInstructions___________________________________________________-304PLCDataStructure_____________________________________________________________-305MOVInstruction_______________________________________________________________-306MOVInstructionApplication_____________________________________________________-307DataCompareInstructions_______________________________________________________-308MathInstructions______________________________________________________________-311SequencerInstructions__________________________________________________________-315Trends_______________________________________________________________________-317Summary_____________________________________________________________________-317Quiz_________________________________________________________________________-318
Chapter9:MentalMath________________________________-319
MultiplesandSubmultiplesofUnits_______________________________________________-319DecimalNumbers______________________________________________________________-320WholeNumbers_______________________________________________________________-320MultiplesNumberConversion____________________________________________________-320SubmultiplesNumberConversion_________________________________________________-321One-OverReciprocalwithMultiplesandSubmultiples
________________________________-323MultiplicationandDivisionwithMultiplesandSubmultiples___________________________-325PercentagetoDecimals_________________________________________________________-326LogtoRealNumber____________________________________________________________-326Summary_____________________________________________________________________-328Quiz_________________________________________________________________________-328
AbbreviationsandAcronyms____________________________-329Index________________________________________________-335
Chapter1:DirectCurrent(DC)
StudentsmajoringinelectronicsalwaysstartwithaDirectCurrent(DC)class.DCisabasicelectronictheorythatyoumustlearnandunderstandwell.Thisisthefirststeptoasuccessfulcareerinelectronics.Let’sfirstdefinesomeDCparameters.
Current
Electricalcurrentisquantifiedaschange(∆ordelta)ofelectroncharge(Q)withtime.Thinkofitasflowrateinplumbing.measureofcharges(∆Q)flowingthroughapoint(node)withtime(seefigure1.0).Current’sunitisamperes(A)with“I”beingitssymbol.
Electricalcurrentisathenumberofelectron
Current=∆Q/TimeResistor
Allmaterialspossessresistance,whichisameasureoftheamountofresistorvalue.Aresistorisapassiveelectronicdevicemadeexclusivelyforelectronicsystems.Resistorsresistcurrentflowforagivenelectricalvoltage(voltagewillbedefinedshortly).Apassivedevicebydefinitiondoesnotgenerateenergybutratherstoresand/ordissipatesenergy.Themostabundantmaterialsusedinresistorsarecopper(Cu)andaluminum(Al).Carbon,thin-film,metalfilm,andwire-woundarepopularresistortypes.Resistorsize(resistance)ismeasuredinunitOhms(Ω)with“R”asthesymbol.Resistorscomeinmanyphysicalforms.Wire-leads,surface-mount,integratedcircuits(ICs)packagearepopularones.Figure1.1onthenextpageshowsagraphicalviewofacopper(Cu)wirebundlewithacertainlengthandareaexhibitingafiniteresistanceamount.Internetwiresandcablesfoundinresidentialandcommercialdwellingsarelargelymadeofcopperwithaplasticshieldontheoutside.Aresistorcanbediscrete(onedeviceperitem)ormanufacturedviaanICprocesshousedinanICpackage.Wewillexploremoreonsemiconductorpackageslaterinthechapter.Resistanceforagivenmaterialstronglydependsontheresistordimension,whereresistivityisuniquetothematerialstype:
Figure1.0:∆Q/time
Figure1.1:CopperwireCommoncarbonresistorsaremeasuredintheorderofseveralcentimeters(seefigure1.1a).
Figure1.1a:Carbonresistors
Duetothesmallcarbonresistorsizes,colorbandsareusedtoindicateresistancevaluesinsteadofprintingthemontheresistors.Therearefourbands.Thefirstbandontheleftrepresentsthefirstsignificantresistancedigit.Thesecondbandisthesecondsignificantdigit.Thethirdbandisthemultiplier,andthelastistolerance.Tolerancedeterminesthemaximumpercentagechangeinresistancefromitsnominalvalue.Table1-1showsthedetailsamongbandcolor,digitvalues,multiplier,andtolerances.
Table1-1:Resistorbandcolor,digitvalues,multiplier,andtolerances
Let’sapplythistoanexample.WhatistheresistanceofthecarbonresistorthathasBrown,Orange,Red,andGoldbands?First,brownyields“1”;orangemeansdigit“3”;redmultipliermeans“100”;goldrepresents5%tolerance.Theresistanceisthereforecalculatedas:
13X100=1,300Ωor1.3kΩwith5%tolerance.
Figure1.1b:Surface-mountresistor
Surface-mountresistors,ontheotherhand,arepopularduetotheirminiaturesizes.Theyareidealforportableapplicationswhensmallsizeisnecessary.Figure1.1bshowsseveralsurface-mountresistors.Asurface-mountresistorcanbemeasuredassmallas0.2mm(millimeter)X0.4mm(millimeter).Becausesurface-mountresistorsaresmall,inordertodeterminetheirvalues,numberingcodesareusedinsteadofcolorbands.Thenumbersprintedontheresistorareusually3-digitnumbers.
Thefirsttwonumbersrepresentthefirsttwodigitsoftheresistorvalueswhilethethirddigitrepresentsthenumberofzeros.Forexample,aresistormarkedwith203means20X1,000Ωor20kΩ.A105resistorgives10X105Ωor1MΩ.Resistorsmanufacturedbymicroelectronicstechnologyusedifferentmethodstodetermineresistances.Dependinguponthechipmanufacturingprocess,therecanbemultipleresistortypes,rangingfrommetalandthin-filmtopolyresistors.Theresistancesaredeterminedbytheverticalandhorizontaldimensionsinconjunctionwiththesheetrho(pronouncedasrow)resistance.Sheetrho’sunitsareinΩpersquare(Ω/square).Forexample,aBipolar-CMOS(BiCMOS)processthin-filmresistor’ssheetrhoisspecifiedas1,000Ω/square.Length/Widthdefinesthesquarenumbers.Iftheresistor’slengthandwidtharedrawnas10micrometers(um)by10micrometer(um)respectively,thenumberofsquareequatesto10um/10um=1.Theresistanceisthencalculatedas:
Regardingthechipmanufacturingprocess,inadditiontosheetrhoresistances,eachprocessoffersaslewofdeviceswithauniquesetofparameters.Belowaresomecommononesyouwilllikelyencounter.Transistors’minimumgeometries:CMOSusesgatelengthwherebipolartransistorsuseemitterwidth.Transistors’maximumoperatingfrequencies:capacitors’capacitanceperunitarea;temperaturecoefficient(itdetermineshowmuchvariationsdeviceparameterchangeswithtemperature);maximumvoltagesupplyandbreakdownvoltages;transistors’drawnversusmanufactureddimensions,metallevelnumbersavailable,andmanymore.Furtherexplanationsoftheseparameterswillbediscussedlaterinthisbook.Fullunderstandingoftheseparametersisnecessarybeforedecidingonaprocesstouseforaparticularchipdesign.Furtherdetailsonmicroelectronicdesignwillalsobediscussedinlaterchapters.
Voltage
Voltageisthepotentialdifference(subtraction)betweentwopoints(nodes).Theobjectofthesepointscanbeanymaterial.Themostcommonmaterialsareelectronicdevicessuchasresistors,diodes,andtransistors,whicharethemainfocusofthisbook.Eachelectricalparameterhasitsownsymbolandunit.Theyaresummarizedintable2-1.
Table2-1:V,I,Rsymbols;units
Definition
Directcurrent(DC)statesthatelectricalcurrentflowsthrougharesistorwithoutchangesinamplitudesorfrequencies.Awaveformcanbeusedtomakeclearsuchphenomenon.Awaveformisatime(transient)domaingraphthatshowsquantitiessuchasvoltage,current,orpoweronthevertical(Y-axis);timeonthehorizontal(X-axis)(seefigure1.2).Inthiswaveform,theDCvoltagelevelstaysthesameovertimewhilethefrequencyofDCiszero.Wewillfurtherdefineamplitudeandfrequencyinchapter3,AC.
Figure1.2:Voltagevs.timeinDC
Ohm’sLaw
Ohm’slawstatesthatwhenthereisavoltagedeveloped(drop)acrossaresistor,i.e.,voltagedifferencebetweentworesistorends(nodes),electricalcurrentisboundtoflow.Themathematicalrelationshipbetweenvoltage(V),current(AorAmp),andresistance
(Ω):
Voltage=CurrentXResistance
Foragivenresistorsize,increasingvoltagecausescurrenttoincreaselinearly.Thereby,Ohm’slawissimplyalinearfunction(seefigure1.3).Wecanapplytheabovelinearrelationshipamongvoltage,current,resistor,andslopeconcepttocalculateresistance.AV-Igraphisshowninfigure1.4.Anytwopointscanbeusedtocalculateslope(resistance).Becausethisisalinearfunction(straightline),slope(resistance)isfixed.
Resistorsareusuallyinlargesizes—thousandsofΩs,sometimesevenmore.Thisisbecause,foragivenvoltage,largeresistanceresultsinlowercurrent(linearrelationship).Thisisessentialduetosafetyandpower-savingreasons.UsingOhm’slaw,1Vdividedby1Aequals1Ωresistance(1V/1A=1Ω).Oneampereisalotofcurrent,infact,currentabove100mA(milliamp)goingthroughthehumanbodyisdeemedlethal.Tolowerthecurrentforagivenvoltageata
Figure1.3:Ohm’sLaw,alineargraph
Figure1.4:Slopeequalsresistance
safelevel,resistanceneedstoincrease.Forexample,tolowerthecurrentto1mA,1Vsourceyields:
R=(1V/1mA)=1,000Ωor1kΩNote:k=1X103=1,000
Manyportableelectronicdesignsdrawlessthan1mAofcurrenttoconservebatteryliferesultinginlargevaluesofR.ThisexplainswhythousandsorevenhundredsofthousandsofΩarefrequentlyseen.
Power
Power(P)definition:
P=I2XRorV2/R
TheunitofpowerisWatts(W)anditssymbolis“P”.Amodernsmartphonepoweramplifierconsumesabout300mW(milliwatt)inidlemode.With4Vlithium-ionbattery(apopularcellphonebatterytype),antennaloadresistancecanbecalculated:
300mW=42/RR=53.33Ω
VoltageSourceandSchematic
Avoltagesourceisanelectronicdevicethatsuppliesvoltagetoanelectronicload.Theelectronicloadactsasanoutputthatdeliversorreceiveselectricalenergytoandfroman
input.Loadexamplesaremotors,electricfans,lights,etc.AnidealDCvoltagesourcehaszerointernalresistance,capableofsourcing(sending)andsinking(receiving)infinitecurrentamounttoandfromtheload.Anon-idealvoltagesourcecontainsfinite(non-zero)internalresistanceandcannotsupplyorreceiveinfinitecurrentamount.ThemostcommonDC
Figure1.5:Alkalinebatterytypes
voltagesourceisalkalinehouseholdbatterycommonlyusedinportableelectronics.Figure1.5showsseveralpopularalkalinebatterytypes(Energizerbrand).Mostalkalinebatteriesarecylindricallyshapedexceptthe9Vtype,whichisrectangular.Theydifferinsizes,voltageratings,andmAh.mAhstandsformilliamp-hour,whichisequivalenttoelectroncharge.
Itdescribestheelectricalcurrentcapacityofabattery.BothAA,AAA,andDbatteriesandareratedat1.5VwithdifferentmAhratings.A9Vbatteryisratedat9VDC(1,800–2,600mAh).If,forexample,aportabledevicedraws100mAdischargecurrenttooperate,thebatterywilllastaminimumof18hours(1800mAh/100mA=18hours).Otherpopularbatteriesarebutton-sizedbatteries(buttoncells)suitableforlightweightapplications.Theycomeinawiderangeoftypes,sizesandvoltageranges.Buttoncellstypicallyareratedat1.5VwithlessmAh(150–200mAh).
CurrentSourceandSchematics
Acurrentsourceisanelectronicdevicethatsupplieselectricalcurrenttoaload.Anidealcurrentsourcehasinfiniteoutputresistancecapableofsupplyinganinfiniteamountofcurrent.Mostelectronicdesignscanbegraphicallyexpressedintheformofschematics(electroniccircuits).SchematicsincludegraphicalV,I,andRsymbols,plusvariouselectroniccomponentsandwires.Figure1.5ashowsschematicsymbolsofvoltageandcurrentsourceswithgroundconnectedattheotherend.Groundisanelectricalconnectionthatisreferencedtozerovoltagepotential(0V).Schematicscanbehanddrawnonpaper,
althoughthemajorityofschematicsareenteredintocomputersoftware.Thismakesitveryeasytodesignandmodifyelectricalschematics.Popularelectronicschematicsoftwaretoolswillbediscussedinchapter4,AnalogElectronics.Ideally,groundisatabsolute0Vwithzeroresistance.Keepinmindreal-worldgroundhasnon-zeroresistance.Thegroundsignalamplitudedependsonmultiplefactors(mostlyfromelectricalnoise),whichwillbediscussedlateron.Thecurrentsourcesymbolinfigure1.5acontainsanarrowsignifyingthecurrentflowdirection.Bothtriangularandhorizontallinegroundsymbolsareinterchangeablealthoughsomeusethetriangularsymbolstrictlyforpowerground;thehorizontalsymbolforsignalground.Triangulargroundsymbolsareusedthroughoutthisbook.
Figure1.5a:Voltage,current,andresistorschematicsymbols
Electrons
Anatomismadeupoftinyparticles:protons(positivecharge),neutrons(neutral),andelectrons(negativecharge).Protonsandneutronsareinthecenterofanatomwhileelectronssurroundthenucleus.Electronsareions(particles)containingnegativecharges.Differenceinelectronandprotonnumbersgivesrisetovariousatomstructures(chemicalelements).Inthisbook,wemainlymicroelectronics,suchassiliconandattractedtopositivecharges(terminalsandpolarities).Thesymbol“Q”quantifieselectroncharges.TheunitofQiscoulomb(C).Oneelectronchargeholds:focusonchemicalelementsthatareusedin
germanium.Thenegatively-chargedelectronsare
OneElectronCharge=1.6X10-19CCurrentversusElectrons
Infigure1.6,apositivevoltagesource(positivesigns)isconnectedtoaresistorwithawire.Theotherendofresistorconnectstoground(negativepolarity)creatingaloop.Duetoapositivechargeatthevoltagesource,accordingtoOhm’slaw,acurrentisboundtoflowthroughtheresistorinclockwisedirection(innerarrow)whileelectrons(E-)areflowingtowardsthepositivechargesarrivingatthevoltagesource.Keepinmindtheelectronandcurrentflowinreversedirections.
Figure1.6:Electronvs.currentflow
Kirchhoff’sVoltageLaw(KVL)
KVLstatesthatthesumofallvoltagesaroundaloop=0.Asimplecircuitinfigure1.7appliesandexplainsthistheory.Thereisonlyonetheorytoapply:Ohm’slawandwewilluseittwice.Thiscircuitcontainsa5Vvoltagesourceconnectstoa10Ωresistor.WeuseGroundtoclosetheloop.ByusingOhm’slaw,currentcanbeevaluated:
V=IXRI=V/RI=(5V)/(10Ω)=0.5AThiscircuitisaseriescircuit.Thereisonlyonebranchthecurrentcouldgo.Wewillvisitmoreseriescircuitsinamoment.
Figure1.7:SeriescircuitByusingOhm’slawthesecondtime,wecouldfindoutwhatthevoltagedropisacrossthe10Ωresistor,V_resistor:V_resistor=IXRV_resistor=(0.5A)X(10Ω)=5VNow,wecoulduseallvoltagesinthiscircuittoseeifKVLholdsup.SumofAllVoltagesAroundaLoop=VoltageSource+VoltageDropAcrosstheResistor.5V+(–5V)=0V
Itchecksout!Noticethatthevoltagedropacrosstheresistorcontainsanegativesign(polarity).Thereasonisthatthevoltageontheleft-handsideoftheresistorwashigher(+)thanthevoltageontheright-handsideoftheresistor(–).Thepositiveresistorsign“opposes”thepositivepolarityofvoltagesource,hencethenegativesignintheKVLcalculations(seefigure1.7).Theimportanceofthiscircuitistwofold.First,itdemonstrateshowsimpleitistoapplyandexplainthecircuitusingOhm’slawandKVL.Secondly,despitethecircuit’ssimplicity,anyelectroniccircuitregardlessofitscomplexitycanalwaysbeexplainedbyOhm’slawandKVL.Sometimes,youwillhearstatementssuchas;thereisa“short”inanelectroniccircuitthatcauseddamages.ApplyingOhm’slaweasilyexplainsit.Infigure1.7,ifthe10Ωresistorwere“shorted”(zeroresistance)andweappliedOhm’slaw,I=V/R,whereV=5V,R=0.I=5V/0Ω=infinite.Currentbecomesinfinitelylargecausingdamagetothesystem.Realistically,anyelectronicsystem,nomatterhowshorteditbecomes,possessesafiniteamountofresistance.
Kirchhoff’sCurrentLaw(KCL)
KCLstatesthatcurrentgoinginto(passingthrough)apoint(node)isequaltocurrentcomingoutofthesamenode.Wecouldusethesamecircuitinfigure1.7toexaminethistheory.Thisisaseriescircuit.Thecurrentgoesintoleft-handside(node)oftheresistor,andthusisequaltotherightsideoftheresistor.WewilluseaparallelcircuitinthenextsegmenttofurtherexplainKCL.
ParallelCircuit
Seriescircuitstatesthatcurrentonlyflowsinonedirection.Inparallelcircuitshowever,currentflowsinmorethanonedirection(seefigure1.8).
Figure1.8:KCLCurrentA(IA)goesintonodeZandisequaltosumofbothcurrentsIBandIC,comingoutofthesamenode(nodeZ).Mathematically,it’ssimply:
IA=IB+ICParallelResistorRule
Equivalentresistance(R_equivalent)oftworesistors(seefigure1.9):
Figure1.9:ParallelresistorruleIftheparallel(||)resistorsnumberistwoormore,theequivalentresistanceisequaltothereciprocalofthesumofindividualreciprocalresistances(seefigure1.10).
Figure1.10:MultipleparallelresistorsIfA=1Ω,B=2Ω,C=5Ω,
Youmaynoticethattheequivalentresistanceofmultipleresistorsisalwaysslightlylessthanthesmallestresistoramongtheresistorgroups.Fromtheaboveexample,theequivalentresistanceof1Ω,2Ω,and5Ωis0.58Ω.It’slessthanthesmallestresistorvalue1Ω.Thisgivesyouaquickwayofknowingiftheequivalentresistanceyoucome
upwithmakessenseornot.Notethatiftheresistornumbersinparallelareexactlythesamesizes,theequivalenceresistanceiscalculatedasresistanceofoneresistordividedbythetotalresistornumber,e.g.,10||10||10=3.33Ω(10/3=3.33Ω).Thisrule,however,doesn’tapplytoparallelresistorsthathavedifferentsizes.
SeriesResistorRuleEquivalentresistance=Sumofallresistances(seefigure1.11).
Figure1.11:SeriesresistorruleLet’suseasimpleparallelcircuittoexplainseriesandparallelresistorconfigurations.(Seefigure1.12).
Figure1.12:Simpleparallelcircuit
Inthisillustration,resistorA,Bformsaparallelcircuit.Totalcurrent(I_TOTAL)goingtowardsnodeA,Bisdividedintotwoseparatebranches,accordingtoKCL.TocalculateI_A,I_B,wefirstcalculatethetotalresistanceoftheentirecircuit.I_TOTALcanthenbefound.TheideaistoconsolidateallthreeresistorsT(10Ω),A(10Ω),andB(10Ω)intooneresistor(Equivalence)andonevoltagesource.WecanthenuseOhm’slawtocalculateI_TOTAL.Accordingtofigure1.9,resistorA,Bcanbecombinedintooneresistor,R_eq:
Wethenfurtherconsolidatethetworesistors(TandR_eq)intooneresistor.WewillcallitR_total.Usingseriesresistorrule,R_total=T+R_eq=10Ω+5Ω=15Ω.Theconsolidatedonevoltagesource,oneresistorcircuitisshowninfigure1.13.
Figure1.13:Simplifiedonevoltage,oneresistorcircuit
WenowcansimplyuseOhm’slawtocalculateI_TOTAL.I_TOTAL=5V/15Ω=0.33A.Atthispoint,wecanapplyKVLtomakesuretheanalysisisvalid.5V+(–0.33AX15Ω)=0VTofigureoutI_A,I_B,wefirstcalculatethevoltagedropacrossTusingOhm’slaw:
VoltageDropacrossT=(I_TOTAL)X(T)=0.33AX10Ω=3.33VSincevoltageatleftsideofTis5VandthevoltagedropacrossTis3.33V,thevoltageattheright-handsideofT(nodeAandB)is:
VoltageDropacrossT=(VoltageatLeftSideofT)–(VoltageatRightSideofT)5V–(VoltageattheRightSideofT)=3.33V(VoltageattheRightSideofT)=5V–3.33V=1.67V
It’scrucialtorecognizethatvoltageacrossadevicemeansthedifference(subtraction)betweentwonodes.NowwecanuseOhm’slawagaintocalculateI_AandI_B.BecausevoltageatrightsideofTiscommontonodeAandB(VoltageatNodeA=VoltageatNodeB):
I_A=(VoltageatNodeA)/A=1.67V/10Ω=0.167AI_B=(VoltageatNodeB)/B
=1.67V/10Ω=0.167AToprovetheanalysisiscorrect,simplyuseKCLwhichstatesthatI_TOTAL=I_A+I_BI_A+I_B=0.167A+0.167A=0.33A=I_TOTAL,itchecksout!
CurrentDividerRule
Thecurrentdividerrulestatesthatthecurrentononebranchisthetotalcurrentmultipliedbytheratiooftotalcurrent.WhenseekingcurrentA,thenumeratorcontainsresistorBandviceversa.
Usingfigure1.12inthepreviousexample,I_AandI_Bcanbeeasilycalculated:
Noticeifbothresistorsizesarethesameoneachbranch,thecurrentamountwillbeequallydividedinaparallelcircuit.IftheresistorsAandBaredifferentsizes,thecurrentislessonthebranchthathasthelargerresistorandviceversa.Thisconceptisillustratedinfigure1.14.
Inthisexample,I_total=2A,A=20Ω,B=10Ω:
ThisshowsthatI_AislessthanI_B(A’sresistance>B’sresistance).Tofurtherprovethisiscorrect,applyKCL:I_total=I_A+I_B=0.66A+1.33A=2AItchecksout!
Figure1.14:Resistorsizevs.currentamount
VoltageDivider
Thevoltagedividerisusedalltoooften.Wewillstartwiththedefinitionthenusesimplecircuitstoexplainit.Justlikeitsounds,avoltagedivider“divides”voltage.Theword“divides”doesnotmeanthereisamathematicaldivision;itmeansthevoltageis“reduced”bytheresistors.Belowisasimpleseriescircuit(seefigure1.15)toexplainvoltagedivider.
Figure1.15:Simpleseriesresistorcircuit
Theexplanationofthiscircuitissimple,notsurprisingly,usingOhm’slaw.Thereisonlyonecurrentbranchinthisseriescircuit.ThecurrentcanbecalculatedusingOhm’slawandtheseriesresistorrule:
ThevoltageatNodeAis10V(connectedtoa10Vvoltagesource).Thevoltageacross(IRdrop)resistorAisthepotentialdifferencebetweennodeAandB,i.e.,VoltageatNodeA–VoltageatNodeBoritcanbecalculatedusingOhm’slaw:0.5AX10Ω=5V
Onceagain,it’simportanttorealizethatvoltagedropacrossaresistoristhepotentialdifferencebetweentwonodes.KnowingthatvoltageatnodeAis10V,andvoltagedropacrossresistorAis5V,voltageatnodeBcanbefoundusingvoltagedefinition:
(VoltageDropacrossA)=(VoltageatNodeA)–(VoltageatNodeB)5V=10V–VoltageatNodeB
VoltageatNodeB=(10V–5V)=5VForvoltagedropacrossresistorB,itwouldbeVoltageatNodeB–ground(0V)=5–0=5V.Allvoltagedrops(IRdrops)areshowninfigure1.16.
Figure1.16:VoltagesacrossAandB
Therearevoltagedropsacrosseachresistor.Voltagewasreduced(divided)fromthe10Vvoltagesource.Inotherwords,voltagesacrosseachresistorcannotexceedthe10Vvoltagesource.Someusethisformulawhenitcomestovoltagedivider:
RAisinthenumeratorwhencalculatingVA.RBisinthenumeratorwhencalculatingVB.VAandVBaresimplytheratioofindividualresistance(RA,RB)overthesumofallresistances(RA+RB)inthecircuit.Ifyoulookclosely,theVA,VBformulacomesfromOhm’slawandseriescircuitrule.WeknowthatthecurrentgoingthroughAandBarethesame(seriescircuitrule).VA/10Ω=VB/10Ω.Thiscurrentcanbecalculatedfromthe10VsourceinserieswithRA+RB(Ohm’slaw):
Thus,VA=VB=(10Ω)X10V/(10Ω+10Ω).Thisisessentiallythevoltagedividerformula.Althoughthevoltagedividerformuladoescomeinhandy,oneformulawillnotandcannotfitallbecausetheresistorconfigurationsmaybetotallydifferentfromonecircuittothenext.It’smuchmoreintuitivetoapplybasicprinciplestoanalyzevoltagedividercircuits,infact,anycircuits.Toseeifwecomeupwiththevoltagescorrectly,weuseKVLtoproveit.
10V+(–5V)+(–5V)=0V,itchecksout!
Figure1.17:Voltagevs.resistorsize
Intheaboveexample,thereareonlytworesistors.Theirsizesarethesame.Inreallife,voltagedividerscouldhavemorethantworesistorsexhibitingavarietyofsizesandconnectionconfigurations.Despitedifferentvoltagedividerconfigurations,themethodofdeterminingvoltagesonanynode,voltagedropacrossanyresistor,andcurrentthrough
eachbranchisthesame:byusingOhm’slaw,KVLandKCL.Oneinterestingfactisthatiftheresistanceislargerthantheother(s),suchresistorwouldhavethemostvoltagedropacrossit.Thisisdemonstratedinfigure1.17,whereresistorBvalueislargerthanA,thusvoltage
dropacrossBislargerthanA.ThisobservationisexactlyoppositetothecurrentdividerrulewherelargerRsoughtsmallerIandviceversa.Infigure1.17,let’sassume
RA=5Ω,RB=10ΩToseekthevoltagedropsacrossRAandRB,weusethevoltagedividerformula:
CheckwithKVL:10V+(–6.67V)+(–3.33V)=0V,itchecksout!
Thisexampleshowsthat,inaseriescircuit,ifresistance(RA)ishigher,thereismorevoltagedrop(VA)acrossRAthanRB.Regardlessofresistorvaluesorcircuitconfigurations,KVLandOhm’slawalwaysholdtrue.
SuperpositionTheorems
Sofar,we’vefocusedonlyononevoltagesourcecircuit.Practicalcircuitshavemorethanonevoltageand/orcurrentsource.Numeroustheoriesexistwhichattempttoexplainhowthecircuitsareanalyzedinacademictextbooks(Thevenin,Norton,andMesh,justtonameafew).Idecidedtousesuperpositionbecauseofitssimplicity.Bydefinition,superpositionstatesthatifacircuitcontainsmultiplevoltageorcurrentsources,anyvoltageatanodewithinthecircuitisthealgebraicvoltagesumfoundbycalculatingindividualvoltageoneatatime.Furthermore,anyvoltagesourcewillbeseenasashorttogroundwhencalculatingothervoltagesintheremainingcircuit.Anycurrentsourcewillbeseenasopencircuit.Let’suseasimpleexampletounderstandsuperposition(seefigure1.18).
Figure1.18:SuperpositioncircuitexampleThegoalistofindoutwhatthevoltageisatVxifthecurrentsourcepushesout100uA(100microamperes,100X10-6A)currentandDCvoltagesourceis5V.Steps:1)Isolatethecircuitintotwoseparateones.2)Startwiththevoltagesourceontheleft;forcethecurrentsourceopen.ThencalculateVx_1.Theindividualcircuitisshowninfigure1.19.
Figure1.19:Superpositioncircuit1
Noticedthe5kΩresistor(upperright)haszeroIRdrop(voltageacrossit)becauseoftheopencircuitontherightresultinginnocurrentflowingthroughit.Ohm’slawsays,V=IXR=0X5kΩ=0V.Vx_1isthenviewedasavoltagebetween10kΩandthevertical5kΩ(voltagedivider):
3)Secondcircuit:The5VDCsourceisshortedtoground(seefigure1.20).
Figure1.20:Superpositioncircuit2Useparallelresistorrule,10kΩandthevertical5kΩcanbecombined:
Byinspection,figure1.20istransformedtofigure1.21.Thisisaseriescircuitwherethevoltagedropacross3.33kΩisbetweenVx_2andground(0V).Ohm’slawstatesthatVx_2=100uAX3.33kΩ=0.333Vwhena100uAfixedcurrentsourceflowsthrough3.33kΩ.
Figure1.21:Circuit2transformationTheresultingVxcannowbefoundbysummingVx_1andVx_2:Vx_1+Vx_2=1.67V+0.33V=2V
DCCircuits
1)Whatisthedifferencebetweenanidealandnon-idealvoltagesource?Thisquestionleadstotheunderstandingofvoltagesourceandvoltagedividernon-idealcharacteristics.Rules:
Idealvoltagesource:ZerointernalresistanceNon-idealvoltagesource:Non-zero(finite)internalresistanceIdealcurrentsource:InfiniteinternalresistanceNon-idealcurrentsource:Non-zero(finite)internalresistance
Anon-idealvoltagesourcecanbeviewedasavoltagedivider.Figure1.22demonstratesthisconcept.Ifitwereanidealvoltagesource,internalresistancewouldbezeroΩ.ThevoltageatnodeAwillbeexactlythesameasvoltageoriginatingfromthevoltagesource.IfnodeAistheoutputvoltage,inputwouldbethesameastheoutput.Inanot-so-perfectworld,voltagesourcewouldhavefiniteinternalresistance.Thisfiniteresistanceoriginatingfromthevoltagesourcemakesthecircuitlookjustlikeavoltagedivider.VoltageatnodeAisnolongerthesameastheoriginalvoltagesource.Inanon-idealworld,whenyouconnectavoltagesourcetoaresistor,theoutputwillnotbeexactlythesameastheinput.Highqualitypowersuppliesofferextremelylowinternalresistance(stillnon-zero),andyouroutputis“almost”thesameastheinput.It’sforthisreasonvoltagedividerisseldomusedasaconstantvoltagesource.UsingFigure1.22asanexample,iftheoriginalvoltagesourceontheleftis10V,theintendedvoltageoutputis5VatnodeA.Bydesign,wesetbothresistorstohavethesamevalues(voltagedividedbyhalf)sothat5VatnodeAcanbeobtained.Inreality,thevoltageatnodeAwon’tbeconstantat5V.Firstly,anychangesfromtheoriginalinputsourcewillchangethevoltageatnodeA(againbythevoltagedivideraction).Secondly,anychangeintheresistances(e.g.,causedbytemperaturevariations)willalsochangethevoltageatnodeA.Toachieveamorestablevoltageoutput,lowdrop-outandswitchingregulatorsareused,whichwillbediscussedlaterinthisbook.
Figure1.22:Non-idealvoltagesource
2)DrawV,Icurveofa“real”resistor.Thisquestiontestshowmuchyouknowaboutnon-idealresistorsbehavior.Backinfigure1.3,Ohm’slawisdepictedasalinearfunction.Inreality,it’salinearrelationshiponlyuptoacertainpoint.Thispointisdeterminedbyhowhottheresistorgets.Figure1.23showsthisheatingeffect.Aselectrons(E-,currentinreversedirection)passthrougharesistormadeofcopper(Cu),theresistorheatsupcausingrandomcopperionmovementsbytheelectronbombardment.ThisrandommotiondecreasesthelikelihoodofavailableelectronspassingthroughCuatoms.Thiscausestheresistancetogoup.Theserandomcopperions’movementsaretheelectricalnoisesource.Noiseisunwantedsignalsinterferingwithcircuits.Itcomesfrommanydifferentsources,adverselyaffectingcircuitperformanceandcorruptinggroundsignal.NoiseisparticularlyapparentinACsystems.TheVversusIresistorfunction(seefigure1.24),unlikeanidealresistorI-Vcurve,isanon-linearfunctionwithincreasingslope,i.e.,increasingresistance.Thisphenomenoniscalledtemperaturecoefficient(TC)whereresistors’TCispositive.Thismeansresistancesgoupwithtemperature.Theexponentialpartofthecurvedependslargelyontheresistor’spowerrating.Ifit’swithinorbelowtherating,itmaynotshowupinthedatasheets.Productdatasheetsaredocumentationprovidedbytheelectronicdevicemanufacturersdetailingdevicefeatures,functions,descriptions,andratings,alongwithdevicesymbols,conditionedparameters,andspecifications(spec).Theyoftenincludegraphs,waveforms,
sampledcircuits,applicationnotes,andpackageinformation.Thoroughdevicedatasheetunderstandingallowsyoutodecidequicklyifthepartisrightforyourdesign.Adatasheetisadocumentprovidedbytheelectronicsystemcomponentmanufacturersthatdetailsspecificdevicename,number,features,functions,andparametersrelatedtothedeviceelectricalperformances.Manydatasheetscomewithelectricaltestandcharacterizationgraphsalongwithdevice’sdimensions.Someevenprovidesampledapplicationcircuits.
Figure1.23:Resistorheatingeffect
Temperatureisamajorfactorofelectronicsystems.Manydesignstemperaturerange.Thesystemyouworkwithmostlikelyhaveelectronicparametersfluctuatewithtemperature.Payspecialattentionwhendesignandanalyzeproductsovertemperature.considerationinmost
operateinawideelectronics
Figure1.24:Resistortemperaturecoefficient(TC)
Asforpurchasingparts,mostdiscrete(stand-alone)componentsaresoldthroughthirdpartywholesalers(distributors).Well-knownonesareDigi-key,Mouserelectronics,Arrowelectronics,AVNET,andFutureelectronics.Somechipcompaniesprovidedirectpurchasesystemstocustomersinconjunctionwithdistributors.AnalogcompaniessuchasAnalogDevices,TexasInstruments,Freescale,STMicroelectronics,MaximIntegratedCircuits,LinearTechnology,OnSemiconductor,Intersil,InternationalRectifierandMicrochipTechnologyhavethesesystemsinplace.
ICPackages
Leadingsemiconductorcompaniesalldesignandproduceintegratedcircuits(ICs),which
aremicroscopicelectronicscomponentsmanufacturedonapieceofsemiconductorchip(chip).Somechipsaremeasuredinseveralhundredsofsquaremillmetersinarea.ThechipwillthenbehousedinsideanICpackage.Thesemiconductorpackageisacrucialpartofmodernelectronicsdevices.Manydevicesaremanufacturedatthesub-micron(lessthanamicrometer)levelthatrequiresanICpackagetohousethedeviceinside.Figure1.25showsanICthatisplacedinthemiddleofanICpackage.MostICsaresmallenoughtoplaceinthepalmofahand.Thethinwiresconnectingthechiptothepackagepins(needle–shapedstructure)arebondwiresusedtointerfacethechipwiththeoutsideworldsuchaswiresandtracesontheprintedcircuitboard(PCB).MoreonPCBinamoment.
Figure1.25:ICinsidesemiconductorpackage
ThepurposeoftheICpackagemainlyistoprotectthedevicefromexternaldamage,shock,andcontaminantssuchasdustandmoisturethatcouldadverselyaffectdeviceoperation.Theotherpurposeofthepackageistoprovideaphysicalconnectionofthedeviceitselftotheoutsideworld.TheICpackageisavitalpartoftheentireelectronicsindustry.Theycomeinmanyformsandsizes.Fromwire-bond,dualinlinepackage,ball-grid-arraytoflip-chip,theadvancementinICpackagingtechnologyisalwaysprogressing.Semiconductorpackagingislargeenoughthatitiscategorizedasaseparateindustry.MajorpackagemanufacturersareAmkor,AdvancedSemiconductorEngineering
andSiliconwarePrecisionIndustries.TheICpackagecouldcomewithinterfacepinsorball-shapedbumpsthatconnecttotheotherICsordevicesattheboardlevel.Figure1.25ashowsaMicrochipTechnologyAnalog-to-DigitalConverter(ADC)ICwithapackagelengthofabout10mmlong.
Figure1.25a:MicrochipTechnologyMCP3903,ADCIC
3)Showcurrentflowdirectionandamountofcurrent,ifthereisanyinfigure1.26.ThissimplequestionteststheconceptofpotentialdifferenceandOhm’slaw.Thevoltagedropacrossthe50kΩresistoristhedifferencebetween10Vand5V,i.e.,10V–5V=5V.ApplyOhm’slaw:
Figure1.26illustratesthecurrentflowdirectionfromhigherpotentialtolower(lefttoright).Noticethetwohorizontallinessymbolrepresentingvoltagesourcesymbol.
Figure1.26:Currentflow
4)Whatisthevoltageattheidealsource,giventhedividercircuitinfigure1.27?Thisquestiontestsyourknowledgeonasimplevoltagedividerwherebothresistorsconnectedinseriesaresamesizes.IfvoltageatnodeBis2V,thesourcewouldbetwiceasmuch,4V.Thedivider“divides”thesourcevoltagebyhalfwithequalresistorsizes.
Figure1.27:Voltagedivider
5)Therearemanykindsofelectronicmeasuringinstruments.Themostbasiconesaremultimeter,oscilloscope(scope),functiongenerator,andDCpowersupplies.Thereareanaloganddigitalmultimeters(DMM).Bothhavetheabilitiestomeasurevoltageandcurrent.Ananalogmultimeterhasaneedletodisplaythemeasurementresults.
Figure1.28:FlukeDMMModelCNX3000
Digitalmultimeters(DMM)comewith7-segmentdisplay.DMMfeatures,andpricesvarydependingonbrands,
specificationssuchasaccuracyandresolutions.Well-knownDMMbrandsareFluke,Agilent,andTektronix.Figure1.28showsaFlukeDMMModelCNX3000(CourtesyofFlukeCorporation).DMMshavebecomemainstreaminrecentyears.Manyareportable,designedtobelightweightandavailablewithawiderangeoffeatures.Inresistancecapacitance,additiontovoltage,current,andmeasurements,somemeasureinductance,frequency,temperature,
anddiodes.Thecenterdial(seefigure1.28)allowsuserstoswitchfrommeasuringvoltageandresistancetocurrent.Frequency,capacitance,andinductancewillbe
discussedshortlyinchapter3,AC.AsimplifiedgraphicalDMMviewisshowninfigure1.29.“I”,“V,”and“COM”areterminals.TestcablesandleadsarepluggedintotheseDMMterminals.Theotherendsofthecablesconnecttothedevicebeingmeasured.“COM”correspondstocommonthatshouldbeconnectedtothelowestpotential(groundorthemostnegativesupplyvoltage)duringthemeasurement.Size,accuracy,rangenumbers,resolutions(thesmallestvaluestheDMMcouldmeasure),maximumvoltage,currentrangesarecriteriainchoosingDMMs.AsidefromknowinghowDMMworks,understandinghowitmeasuresvoltageshelpsyoutroubleshootyourcircuitsmuchquickly.Weusethevoltagedividertoexpandthisideafurther(seefigure1.30).
Figure1.29:SimplifiedDMMview
Figure1.30:DMMmeasuresvoltage
Weassumethe4Vpowersupplyisanidealvoltagesource.DMMisconnectedasavoltmetermeasuringvoltage.Itmeasuresonly1.98V.Accordingtothevoltagedividerrule,itshouldhavemeasured2V.Why?Therearetwoanswerstothisquestion.Firstofall,testleads(representedbythearrows)andplugs(connectorsthatgointotheDMMterminals)consistoffiniteresistanceaddingadditionalresistancestothecircuitaffectingthemeasurement.Secondly,theDMMitselfcontainsinputresistance,andalthoughverylargebydesign,it’snotinfinite.DMM’sinputresistancehencedeterminesthemeter’sresolution.WehavelittlecontroloverthisparameterforaparticularDMM.Wedohavecontroloverleads.Toachievemoreaccuratereadings,shortleadswiththeleastresistancearemorepreferred.Whataboutmeasuringcurrent?Figure1.31showsasimplecurrentmeasurementusingDMM.TheDMMissettomeasurecurrentasanammeter.It’sconnectedinserieswiththecircuit.Ideally,theammeterresistanceisinfinite.Thisisthereasonwhytheammetercannotbeconnectedinparallel.Ifitwere,nocurrentwouldflowthroughtheammeter.Realcurrentsourcespossesslargeinternalresistance(non-zero)thatwouldimpacttheoverallresistanceoftheentirecircuit.Thisinternalresistancecausesasmallvoltagedropacrosstheammeter.This“error”voltageisparticularlyimportantwhenmeasuringlow,precisecurrent,(e.g.,microamperes(uA)andbelow).LeadingtestequipmentsupplierssuchasAgilentoffermanypowersuppliesmodels.Figure1.32showsanAgilentDCpowersupplywithmultimeter,U3606A.Itcomeswithavoltagesupply,current,andresistancemeasurementwith
programmingcapabilities.
Figure1.31:DMMmeasurescurrent
Figure1.32:AgilentPowersupply,multimeter,U3606A
6)Isittruethatifyouhavevoltage,youalwayshavecurrent?Whataboutthecircuitinfigure1.33?WhatisthevoltageatnodeAassuming9Visanidealsource?Theanswerisno,notalways.Thecircuitbelowisaseriescircuitwithabrokenloop.Nocurrentisabletoflowthroughtheloopduetoinfiniteresistancefromtheopencircuit.UsingOhm’slaw,thereis0Vdropacrosstheresistor,V=IXR=0XR=0VTheresistorpotentialdifferencecanbederived:
(9V–VoltageatNodeA)=0VThen,VoltageatnodeA=9V
Figure1.33:Opencircuit
7)WhatistheequivalentresistancebetweennodeAandBinfigure1.34?Weneedtofirstconsolidatethisresistornetworkintoonesingleresistor.Usingseriesandparallelresistorrules,westartfromthetwoparallelresistorsDandE(5Ωusingtheparallelresistorrule).
Figure1.34:EquivalentDandEresistanceThenwefurthersimplifyitbycombiningC,parallelofDandE(5Ω)below(seefigure1.35).
Figure1.35:C+parallelofDandETheresultisa15Ωresistor.WethenusetheparallelruletocombineBand15Ω.Thisyields6Ω(seefigure1.36).
Figure1.36:CombineBwith15ΩinparallelFinally,theresultoftheparallelcombinationisinserieswith10ΩresistorA.Thisgivesriseto16ΩequivalentresistancebetweennodeAandB(seefigure1.37).
Figure1.37:Finalequivalentresistancevalue
Summary
DCelectronicsarethemostbasic,easytolearnelectronictheory.Thechapterstartedwithbasicelectronicproperties(voltage,current,andresistor).Basicelectronicprincipleswerethendiscussed:Ohm’slaw,KVL,andKCL.Wethenwentoverseriesandparallelresistorsrules,andvoltage-currentdividerrulesexplainedbypracticalcircuitexamples.Superpositiontheorems,ICpackage,electronicmeasuringapparatus,non-idealcharacteristicsofvoltage,currentsources,andresistorswerereviewed.Onceyoubecomeproficientinbasicelectronicsprinciples,youcanthenapplytheoriestoexplainandanalyzeanycircuitswithease.Thisbuildsupastrongfoundationforfurtherstudy,use,andapplicationsofmorecomplexelectronics.
Quiz
1)Showcurrentflowdirectionandamountofcurrent,ifany(seefigure1.38).
Figure1.38:Currentflow2)Thepowersupplywassettoproduce5V.WhenmeasuringusingDMM,itonlyreads4.95V.Why?3)Fiveparallelresistorssizedfrom1Ω,10Ω,100Ω,1kΩ,and10kΩ.Whatistheapproximateequivalentresistancebyinspection?4)Usingfigure1.38,ifthe5Vontheleftisreplacedwith10V,whatisthecurrentflowdirection?Whatistheamountofcurrent,ifany?5)Designavoltagesourcethatgenerates3Vfroma12VDCsource.Tosavepower,currentislimitedto10mA.Hint:Useavoltagedivider.
6)WhatisthepowerinWattsfromthecircuityoudesignedinproblem5?7)Refertothecircuitbelowinfigure1.39a.R1isavariableresistorsymbol(potentiometerorPOT)inwhichuserscanadjustresistancesbymanuallyturningaknob.Figure1.39bisa10kΩPOTwithabodysizeof9.5mmX9.5mmX4.9mm.Youcanviewthepotentiometerasaresistivedividerwherethetop,middle,andbottompinsaremeasuredpoints.Ifyouconnectthetopandbottompinstoyourcircuit,afullscale10kΩisobtained.Byconnectingthetopandmiddlepinstothecircuit,resistancecanbevariedbyturningtheknob.Therangeofresistancewouldbefrom0Ωto10kΩ.Calculatecurrentflowineachbranch,assumingthatthepotentiometerisatmidscale.
Figure1.39a:Currentflowindifferentbranches
Figure1.39b:Potentiometer8)UsesuperpositiontofindVx.Showsteps(seefigure1.40).
Figure1.40:Superposition,voltage,currentsources9)UsesuperpositiontofindVx.Showsteps(seefigure1.41).
Figure1.41:Superposition,twovoltagesources10)Twovoltagesourcesareconnectedinseriesinfigure1.42.WhatarethevoltagesatnodeAandB?
Figure1.42:Twovoltagesourcesinseries
Chapter2:Diodes
Diodesarepassiveelectronicdevicesthatdonotgenerateelectricalenergyorpower.Passivedevicesonlydissipateorstoreenergy.Resistorsanddiodesareexamplesofpassivedevices.DiodesaremadeofP(positive)andN(negative)typejunctions.Theyarethebuildingblocksoftransistors.Transistors,byfar,arethemostwidelyusedelectroniccomponentsinelectronicsystems.Diodesareusedinmanyelectroniccircuitsthatweencounterdaily.Understandingdiodestructure,devicephysics,behavior,anddiodecircuitspreparesyouwelltofurtherunderstandtransistorsandcomplexelectroniccircuits.
Figure2.0:Siliconatom,14electrons,4electronsonoutershell
P-NJunctions
Diodesareformedbymergingtwodifferenttypesofmaterials.Siliconandgermaniumarethemostpopularmaterialchoicesusedinsemiconductors.Fromaperformancestandpoint,germaniumoffersfasterswitchingcapabilitywithlowerreliability.Withsilicon’sabundant
supplyandhigherreliability,siliconisthemostpopularmaterialinsemiconductortechnology.1,DC,chemicalmaterials(elements)atoms.Eachatomconsistsofelectrons,protons,andneutrons.Siliconhastotal14electrons(dots)with4electronsintheoutershell(seefigure2.0).Anatomisstableiftheoutershellcontainstwooreightelectrons.Bybombardingsilicon(Si)withchemicals,wecanalteritspropertiestocreateP-N
junctions.Forexample,tocreateaP-typejunctioninsilicon,webombardsiliconwithboron(Br),whichhasthreeelectronsinitsoutershell.Byaddingboron’sthreeelectronstosilicon,whichcurrentlyhasfourelectrons,sevenelectronsarenowinthesiliconatom’soutershell.Recallthatthesiliconatomwantstohaveeight
electronstofillupitsoutershell.Thesesevenelectronsleaveanetpositivecharge(hole)inthemodifiedsiliconatomoutershell(seefigure2.0a).Fromchapteraremadeof
Figure2.0a:Siliconimplantedwithboron,netpositivecharge
Inotherwords,it’seagertoseekoneelectrontofilltheoutershellwithtotalofeightelectrons,whichisthemaximumnumberofelectronsashellcouldaccept.Thisprocessleavesanetpositivecharge.P-typejunctionmaterialmeansthattheareaisinjectedwithmorepositiveions,namelyholes.Precisely,thepositiveionconcentrationandratioishigherthanwithNtype.ItdoesnotmeantherearenoelectronsatallinaP-typeregion.Thenumberofionsinagivenjunctionareaisdefinedbyitscarrierconcentration(dopinglevels).ForP-type,theholesdopinglevelishigh.TocreateanN-typejunction,phosphorus(P)isbombardedwithsilicon.Becausephosphorushas5electronsontheoutershell,itnetsatotalof9electrons(e-).Thisextraelectronresultsinnetnegativelychargedsilicon.AnN-typejunctionisdefinedastheareathatisdominatedbynegativeions,namelyhigherelectronconcentrations(seefigure2.0b).
Figure2.0b:Siliconimplantedwithphosphorus,netnegativecharge
Thebombardmentprocessmentionedaboveiscalledionimplantation,whichisoneofmanyICmanufacturingsteps.Theresultofionimplantationgivestheprocessedsiliconuniquepropertiessothatit’snottotallyconductivebutonlysemi-conductive,hencethenamesemiconductor.Electronicdevicesmadebysuchprocessarecalledsolid-statedevicesbecausetheelectronsandotherchargedcarriersareconfinedinthesolidmaterials.Withappropriatevoltagecondition(bias),asemiconductorcanbecontrolledbyeitherturningitfullyorpartiallyonoroff.Thisconceptbuildsthefoundationofdiodes,whichcomeinmanyformsintermsofjunctioncarrierconcentrations.Figure2.1showsagraphicalrepresentationofaP-Njunction(seetopoffigure2.1).ThereisaregioninbetweenP-Njunctions,calledthedepletionregion(seebottomoffigure2.1).Thisregiondeterminestheamountofvoltageacrossthediodeneededinordertoturnadiodeonoroff.Theabilitytoturnadiodeonandoffgiveslimitlessandpowerfuldesignpossibilities.ElectronsintheNjunctiondiffuseintotheP-typewhiletheP-typemigratestotheNregionduetocarrierconcentrationimbalance(seemiddleoffigure2.1).ThisdifferenceincarrierconcentrationresultsinelectronsdiffusingintothePregion,leavingtheN-typewithanextrahole.WhiletheelectronrecombineswithaholeinthePregion,itleavesbehindanegativeion.Asthisdiffusionprocesscontinues(seebottomoffigure2.1),awallofelectronsaccumulatesneartheP-typeandwallofholesontheN-typeedges.Finally,thediffusionprocessstops,reachingequilibrium.Thisprocessformsthedepletionregion.Thereasonfortheendofthediffusionprocessisthatasmoreholesrecombinewithelectrons,theelectronconcentrationstartstoincreaseinthePregionopposingadditionalelectronsmigrationfromN-toP-type.ThesameresistingforceoccursatthePregion.Thisiswhythereisawallofelectronsandholesontheedgesofeachtype.Theseionscannotdiffuseanymoreandare“stuck”atthedepletionregion.
Figure2.1:GraphicalrepresentationofP-Njunction
Forward-BiasedandReverse-Biased
Theimplicationofdepletionregionissignificant.Itsetstheminimumvoltagerequiredtoturnonthediode.Turningonthediodemeansforward-biasingadiode,inwhichcasewesaythediodeisforward-biased.Manytextbooksdefinetheminimumbuilt-indiodevoltagepotentialtobe0.7V.Itisimportanttonotethatthisnumberisonlyatypicalnumber.Forward-biasedvoltagecanhaveothervaluesdependinguponthediodetypesandmanyotherfactors.Adatasheetwouldindicatetheexactforward-biasvoltagesonanyparticulardiode.Let’snowgooverthemechanismsbehindforward-biasingadiode.Infigure2.2,thereisavoltagesourceconnectedtoadiodewiththesource’spositiveterminalconnectedtothePjunction.Thenegativesourceterminal(polarity)connectstotheNjunction.Assumetheforwardvoltageis1V.Ifwedialinthevoltagesourceto0.5
Vacrossthediode,thepositivechargefromthesourceopposestheholesinthePjunctioncausingtheholesinthePjunctiontodiffusetowardsthedepletionregion.ThesameactiontakesplaceintheNjunctionwhereelectronsaremovingtowardsthedepletionregion.Since0.5Vislessthan1V,whichistheminimumvoltagerequiredtoturnonthediode,thediodeisnowreverse-biased.Modelingthediodeasaswitch,it’scurrentlyopen(off).Ifweincreasethevoltagesourceto1V,theswitchovercomesthebuilt-inpotential,causingholesandelectronstoflowinthereversedirectionbreakingthroughthedepletionbarrier.Currentthenstartstoflow.Thediodeisnowconducting.Asaswitch,it’snowclosed(on).
Figure2.2:Voltageacrossdiode
Thediodeschematicsymbolincludesaverticallineandatriangle(seefigure2.3).Itmaybeobviousthatthediodesymbollookslikeanarrow.Theverticallineatthetipofthearrowendisacathode.AcathodeissimplytheNjunctionofthediodeinfigure2.1.Theoppositesideofthediodesymbolistheanode(Pjunction).Adiodeisforward-biasedwhenthevoltageacrossanodeandcathodeispositiveandatleastequaltoorabovetheforward-biasedvoltage,i.e.,voltageattheanodeishigherthanvoltageatthecathode.Theseconditionsgiverisetocurrentflowfromtheanodetothecathode,justlikeanarrowmovingfromlefttoright.Whenadiodeisforward-biased,currentflowsfromanodetocathode.Whenthediodeisreverse-biased,i.e.,whenvoltageatcathodeislargerthananodeorthevoltageattheanodeandcathodeislessthantheminimumforwarddropvoltage,undertheseconditions,thediodeissaidtobereverse-biased(offoranopen-circuit)withoutcurrentflow.
Figure2.3:Diodeforward-andreverse-biased
DiodeI-VCurve
Figure2.4:Diodevoltagevs.current
Aswecontinuetoincrease(sweep)theDCvoltagesourceinfigure2.2,forwardbiasingthediode,thecurrentcontinuestoincreaseexponentially.Usingcurrentversusvoltageofa1Vdiode(seefigure2.4),wecanfurtherexaminediodebehavior.Therearetwosetsofcurvesinthisfigure.ThedottedlineistheidealdiodeI-Vcharacteristic.Itshowsthatthecurrenttakesoffinfinitelyoncethediodeisforward-biased.Thenonidealdiode,however,showsthecurrentisrisingexponentiallywithvoltagebutnotinfinitely.Thisisbecauseofthefiniteresistanceintherealworlddiodethatlimitsthecurrent.Beforethediodevoltagereaches1V,thecurrentisclosetozerowiththediodebeingoff
(reverse-biased).Whenanidealdiodeisreverse-biased,itisanopencircuit(infiniteresistance).Arealdiode,however,wouldnothaveinfiniteresistancebutextremelylargeresistancewhenit’soff.Itmeansthattherewouldbecurrentflowingthroughthediodewhenit’sreverse-biased.Thisischaracterizedasleakagecurrent,whichisusuallysmallandnegligiblebutincreasesexponentiallywithtemperature.Thediodecurrenttransferfunctionismodeledas:
I=IoX(eqV/KT–1)
Io:Leakagecurrent;q:Electroncharge(1.6X10-19C);V:Voltageacrossdiode;K:Boltzmann’sconstant(1.38X10-16);T:Absolutetemperature(Kelvin).ThetransferfunctionoftemperaturefromKelvintoCelsiusisK=°C+273;forroomtemperature,27°C,K=27+273=300K.Thisdiodecurrentmodelindicatesthatforagiventemperature,increasingdiodevoltageincreasesdiodecurrent.Everydiodehasitsownset
ofparameters(ratings).Maximumforwardvoltageisthemaximumvoltageadiodecouldwithstandinforward-biasmodebeforeitbreaksdown(shortsorblowsopen).Reversevoltage:Thisnumberdeterminesthemaximumreverse-biasedvoltageadiodecouldwithstandbeforereversebreakdown.Diodeoutputcurrentdefinesthecurrentlevelduringforwardbiasandisapproximatelyconstantinhighforwardvoltage.Maximumreversecurrent(leakage)definesthecurrentamountthroughadiodeduringreversebias.Maximumpowerdissipationdescribestheamountofpower(Watts)allowedforagivendiodevoltageandcurrent,power=(I)X(V).
DiodeCircuits
1)Manycircuitsutilizediodes.Adiodecanbeusedasavoltageregulator(seefigure2.5).Avoltageregulatorbydefinitionisanelectronicdevicethatgeneratesaconstantvoltagesource.Theidealvoltageregulatorcansourceandsinkinfiniteamountsofcurrent.Thetiltedup-pointingarrowinthevoltagesourcemeansit’sachanging(sweeping)variablevoltagesource.Thediode’sforward-biasvoltageis200mVinthissampledcircuit.VoltageatnodeDisthethintrace(V-Igraphontheright).Asthevoltagesourcesweepsfrom0Vto200mV,thereisnocurrentflowinginthiscircuitduetothefactthatthedioderemainsoff(reverse-biased).Therefore,nodeDvoltagefollowsvariablevoltage.UsingOhm’slaw,thereisnovoltagedropacrossthediode,i.e.,Inputvoltage–nodeDvoltage=0V,andcurrent=0A.Whenvariablevoltageincreasesto100mV,nodeDfollowsat100mV.Oncethevariablevoltagesourcereaches200mV,thediodestartstoturnon.NodeDvoltageisnowroughlyfixedat200mV.Currentcontinuestoincreaseexponentiallyasthevariablevoltagesourcecontinuestogoup.
Figure2.5:Diodeasvoltageregulator
2)Averypopulardiodetypeisthelightemittingdiode(LED).WhentheLEDisforwardbiased,itemitslight.TherearemanycolorLEDcombinations(white,red,blue,yellow,orange,green,andvioletarepopularcolors).TypicalLEDforward-biasedvoltage
isbetween2Vto3V.Theintensityofthelightisastrongfunctionofcurrent.TypicalLEDconsumes20to30mAofforwardcurrent.Becauseofitssmallsizes,lowpowerconsumption,andlonglife(typically10,000hours),LEDsaresuitableforlightingapplications.AsthepricesofLEDshavecontinuedtogodowninrecentyears,they’vefoundthemselvesfurtherinautomotivelightingapplications.Figure2.6showsseveralLEDsthatareintheorderof2mmby3mmindimensions(right)andasimpleLEDcircuitinaseriesconfiguration(left).
Figure2.6a:LEDsinseries
3)AnothercommonLEDapplicationisconstructedinparallelconfiguration(seefigure2.7).Fromchapter1,DC,itiseasilyrecognizedthatthetrade-offbetweenaseriesandaparallelLEDapplicationisthataseriesLEDcircuitrequireshighervoltagethantheparallelone.AparallelcircuitdrawsmorecurrentduetomultipleLEDbranchesasaresultoftheKCLrule.
Figure2.7:LEDsinparallel
4)Asmentionedpreviouslyinthischapter,diodesaremodeledasswitches.Let’stakealookatapracticalcircuit(seefigure2.8).Anoutputissuppliedbyeitheroneofthetwovoltagesources(V1andV2).Therearetwoassumptions.1)WhenV1ispresent,V2isnot.2)WhenV2isconnected,itwouldbehigherthanV1.IfV1=5V,theforwarddiodedropisratedat1V.Thisforward-biasesthediodecausingthevoltageattheoutputtobe4V.IfV2is10Vconnectedtotheoutput,thediodeisnowreverse-biased(voltageatcathode>anode).Thediodeisoff(switchisopen),andV2isthentheonlyvoltagesupplytotheoutput.
Figure2.8:Diodeapplication
5)A“real”diodedoesnotbehavethesameasanidealdiode.Diodevoltageisastrongfunctionoftemperature.Thegraphinfigure2.9showsthatdiodevoltageexhibitsnegativetemperaturecoefficientwithapproximately–2mV/°C.Duetomanydiodetypes,youshouldrefertothespecificdiodedatasheetforthecorrecttemperaturecoefficientnumbers.
Figure2.9:Diodenegativetemperaturecoefficient
6)Adiodecontainsfiniteresistancewhenit’sforward-biased.Additionally,thereareresistancesinarealdiodeduetophysicalleads.Figure2.10showsasimplifiedphysicaldioderepresentationwithleads.Theseleadspresentsmallfiniteresistancethatmaybesignificantindesignsthataresensitivetonoise.Surface-mountdiodesareavailableinsmallfootprints.Figure2.11showssurface-mountdiodesfromSEMTEX.Recallfromchapter1,DC,figure1.21,thatanyresistorwithcurrentflowingthroughitgeneratesheatandnoiseduetorandomionbombardments.Noiseinparticularshouldbeminimizedatallcosts,especiallyinhighlyaccuratecircuits.
Figure2.10 Figure2.11Surface-mountdiode(CourtesyofSEMTEX)
7)Azenerdiodeisaverypopulardiodetypecommonlyusedinlinearregulatorapplications.Linearregulatorsarethebuildingblocksofvirtuallyallelectronicpowersupplies.Asopposedtoswitchingregulators,linearregulatorsareon100%ofthetime.Switchingregulatorsmeansthatdevicesthatturnonandoffperiodicallywillpotentiallyincreasepowerefficiency.Wewilltakeacloserlookatswitchingregulatorsinchapter3,AC.Figure2.12demonstratesasimplezenerdiodeimplementationusedasavoltageregulator.Azenerdiodeoperatesinthereverse-biasedregion,i.e.,theleft-handsideoftheI-Vdiodecurve.Whenitreachestheratedreverse-biasedthreshold,5V,itbehavesasavoltagesourcestayingat5V.Oncethezenerdiodestartsconducting,itremainsturnedon
Figure2.12:Zenerdiodecircuit,V,Icurveasalinearregulatoraslongasvariablevoltagesourcestaysatleastorabove5V.
Summary
DiodesareformedbyP-Njunctions.Theyarebasictransistorbuildingblocks.Powerful,practicalelectroniccircuitscanbebuiltanddesignedbyusingdiodes.Thechapterstartedwithsiliconatomicstructure,thenbasicdiodeformationprocess,followedbydiodeDCcharacteristics(I-Vdiodecurve).Wethenexaminedforwardandreverse-biaseddefinitionsaswellasseveralpracticaldiodeapplications.Ideal-andnon-idealdiodecharacteristicswerediscussed.ThechaptercloseswithLED,zenerdiodes,andthelinearandswitchingregulatorprincipleofoperationsandapplications.
Quiz
1)Ifyoumeasurevoltageacrossadiodebetweentheanodeandcathode,theDMMreads1V.Isthediodeforward-orreverse-biased?
2)DrawaDCgraphofnodesAandBduring0Vto5V(DCsweep)usingthediodecircuit(seefigure2.13).Assumeforward-biasedvoltagesare1V.
3)Designacircuitthatdrives5LEDs.Assume5Visthesupplyvoltageandthe
minimumcurrentneededtoturnoneachLEDis10mA.WhentheLEDconducts,itdrops1.5V.Hint:IncludeLEDvoltagedrop.Decideifyoushouldchooseparallelorseriesconfigurations.
4)Usingfigure2.13,at5VDC,drawaDCsweepgraphofnodesAandBovertemperaturerangingfrom–40°Cto+125°C(seefigure2.14).Thetemperaturecoefficientofbothdiodesis–2mV/°C.
Figure2.13:Diodecircuit
Figure2.14:Diodevoltage
temperaturesweep
5)1N4001isapopulargeneral-purposediodethatiscapableofhandlingupto1Aofforwardcurrent(seefigure2.15).Itslengthislessthan10cm;forwardvoltagedropisratedat1.1V,27°Croomtemperature;reversevoltageisspecifiedatmaximumof50V.UsingDMM,100mAforwardbiascurrentismeasured;thevoltagesattheanodeandcathodeofthediodearethesame.Whatconditionisthediodemostlikelytobe?Woulditmeanitisshorted,openorworkingproperly?
Figure2.15:1N4001general-purposediode
Chapter3:AlternatingCurrent(AC)
Alternatingcurrent(AC)isnotanisolatedelectronictheorybutratheranextensionofDCanddiode.Bydefinition,ACisanelectricalsignal(current,voltage,orpower)thatchangesitsamplitudeovertime.ACoperationscanbeseeneverywherefromelectricpowerutilities,computers,CentralProcessingUnit(CPU)operations,radiobroadcasting,wirelesscommunications,etc.WefirstneedtounderstandbasicACparameters,capacitors,andinductorsbeforegettingintomorecomplicatedACelectronicsdesigns.SomeACparametersarelistedintable3-1.
Table3-1:ACparameters
SineWave
WewillusesinusoidalwaveandACparameterstoexplainmostACoperations.ThemostcommonACwaveformistheperiodicsinusoidalwave.Sinusoidal(sine)wavecomesfromtrigonometryinmathematics.Figure3.1showsaperiodicsinevoltagewaveformintime(transient)domain.Itmeansthatthefrequencyisfixedwhilethewaveformamplitudeischanging.Otherthanthesinewave,thesquarewaveandsaw-toothwavearealsocommonACsignalsources.Theschematicsymbolsofallthreetypesareshownbelow.
SinewaveSquarewaveSaw-toothwave
Figure3.1:Periodicwaveform
FrequencyandTime
Oneoperationcycle(period,unitinseconds)isdefinedasthetotaltimeittakeswhilethevoltagestaysabovetheX-axis(upperhalfofasinewavecycle)plusthetimethevoltagestaysbelowtheX-axis(bottomhalfofonesinewavecycle).Infigure3.1,eachcycletakes1/60secondtocomplete.Furthermore,oneperiodcanbeinterpretedas:fromonewaveformpeak(maximumpoint)tothenextpeak.Itcanalsobemeasuredfromtherising(leading)orfalling(trailing)edgeofthewaveformtothenextrisingorfallingedge.Fromfigure3.1,oneperiodisfoundbyonerisingedgetothenext.Bydefinitionintable3.1,frequencyisdefinedasoneoverperiod(1/Period):
Frequency=1/PeriodOrPeriod=1/Frequency
Thefrequencyinfigure3.1is:
Inotherwords,60Hzmeansthatthereare60cyclesoccurringinonesecond(seefigure3.2).Thesignificanceofthisexampleisthat60HzistheUShouseholdpoweroutletfrequency.A3gigahertz(GHz)signal(thetypicalCPUclockspeedoftoday’sdesktopcomputers)runs3billioncyclesinonesecond.
Figure3.2:60Hzintimedomain
WeuseACinourdailylives.Figure3.2ashowsanelectricaloutlet(receptacle)commonlyfoundinUSresidentialhouseholdsandcommercialbuildings.Eachofthethreeterminalshasacopperconductorconnectedit.The“hot”terminalprovides120V
ACsource.“Neutral”isthereturncurrentpathfortheACsource.The“ground”terminalhasazerovoltagepotentialandzeroresistance.Itprovidesapathforthecurrenttotheearth,whichisahugemassofconductivematerialssuchasdirt,rock,groundwater,etc.Sincetheearthisasuperbconductor,itmakesthegroundterminalagreatvoltagereferenceforelectricalsystemsaswellasasafetymeasurebydirectingallunwantedbuildupofelectricalchargetotheearth,thuspreventingdamagetotheequipmentandtheuser.Electricalequipment,suchascomputers,isoftenbuiltwithachassisground.Thiszerovoltageconnectionprovidesacommonpointofvoltagereferencewithrespecttointernalcircuitriesandforsafetyreasons.
Figure3.2a:Electricaloutlet
PeakVoltagevs.Peak-to-PeakVoltage
Fromfigure3.1,theverticalaxisisvoltage.It“swings”upanddownaboveandbelowtheXaxis.Theverticalamplitudeisexpressedinvoltage(V).Fromthehighestpeakoftheupperhalfwaveformto0VontheX-axis,itsamplitudeis120V.Thisisthepositivepeakvoltage(Vpeak),(seefigure3.3).Thelowerhalfofthewaveformispeakvoltagewithanegativesign,i.e.,–120V.Peak-to-peakvoltage(Vpeak-to-peak)canbeestimatedfromthehighestpeakvoltagetothelowestpeakvoltage.Inthisexample,120V–(–120V)=240V.Vpeak-to-peakcanalsobeviewedasthepositiveVpeakmultipliedby2,i.e.,(120V)X2=240V.YoucanseethatVpeakisexactlyhalfofVpeak-to-peak.
Figure3.3:Vpeak,Vpeak-to-peak
DutyCycle
Sofar,wehavediscussedpeakvoltage,amplitude,frequency,andperiod.Now,wewilllookatdutycycle.Thedutycycleistheratioofon-timeoveroneperiod(on-time+off-time)expressedinpercentage:
Fromfigure3.3,thetimeittakesfortheupperhalfofonesinewavecycletocompleteisontime.Theotherhalf,off-time,isthetimeittakesforthelowerhalfofthesinewavecycle.Bydefinition,On-time+Off-time=Oneperiod(seefigure3.4).Foraperiodicwaveform,ontimeisexactlythesameasoff-time.Usingthedutycycleequation,youcanseethatthedutycycleofaperiodic60Hzsinewaveis50%:
Figure3.4:Periodanddutycycle
Inotherwords,a50%dutycyclemeansthesignalis“on”halfofthetime(oneperiod)whiletheotherhalfis“off.”Thisconceptappliestoasignalinanyfrequencies,notjust60Hz.Aslongasthewaveformisperiodic,thedutycycleis50%.NotallACsignalsare50%dutycycle.Figure3.5showsa10%dutycycle(a0.1GHzsquarewave).
Figure3.5:10%dutycycle
Vrms
Vrmsstandsforrootmeansquarevoltage.ItdirectlyrelatestoVpeakdiscussedinprevioussection:
Vrms=VpeakX0.707
Wewilldiscussthemeaningofthe0.707constantindetailshortly.ElectronicproductsshowVrmsinformationinthedatasheetswherethemanufacturersuseVrmstospecifythenoiseamount.Ideally,noise,asaparameter,shouldbeminimal.ManufacturersnormallyuseVrmsratherthanVpeakbecauseVrmsislessthanVpeakbyabout29.3%(100%–70.7%=29.3%).IfVpeak=100mV,Vrms=70.7mV.
Impedance,Resistance,andReactance
Untilthispoint,wehavestrictlydescribedresistanceasaparameterthatdoesnotchangewithfrequency.Thisisinfacttruewithidealresistors.However,itisverydifferentwithAC.Therearetwoelectronicdevicesthatarefoundinvirtuallyallelectronicsystemsthatbehaveverydistinctivelywhenitcomestoresistanceandfrequencies.Thesearecapacitorsandinductors.Beforewediscussthem,someessentialresistanceparametersarelistedbelow:
Impedance=Resistance+Reactance
ThesethreeparametersallhaveunitsinOhms.Impedanceisthesumofresistanceandreactanceofanelectroniccomponentsuchasaresistor,capacitor,orinductor.Forresistors,reactanceiszero.Thus,resistanceisequaltoimpedance.Theresistor’svaluedoesnotchangewithfrequency:
Impedance=Resistance+0=Impedance
Reactance,however,changeswithfrequency.Thiscausestheimpedancetovarywithfrequency.ThisfundamentalcharacteristicprovidestheframeworkforallACelectronicdesigns,circuits,andsystems.
Capacitors
Acapacitorisapassiveelectronicdevicethatdoesnotgenerateenergy.However,itstoresenergythroughanelectricfield.Acapacitorisformedbytwoconductiveplatesseparatedbyaninsulator(dielectric).Thereareplentyofconductiveplatematerialsaswellasinsulatortypes.Themostcommononesaretantalum,ceramic,polyester,andelectrolytic.Figure3.6showsacapacitorgraphicalrepresentation,capacitorschematicsymbol,discretetantalum,electrolyticcapacitors,andfilmcapacitors.
Figure3.6:Capacitorstructure,schematicsymbol(topright),tantalum,electrolyticandfilmcapacitors(bottomleft);capacitorsymbols(middle)createdbyFritzingSoftwareCapacitorvalues(capacitance)aremeasuredinfarad(F),whichexhibitsreactance,calledcapacitivereactance(Xc).Capacitivereactance’sunitsareinOhms(Ω).
CapacitiveImpedance=Resistance+Xc
Thecontributionofthecapacitorresistancecomesfromcapacitorpackages,leads,andthe
intrinsicnatureofcapacitivematerials.Capacitivereactance(Xc)isdefinedas
,wherefisfrequencyofsignal,π=3.14,Ciscapacitivevalueinfarad(F).Ifthesignalfrequencychanges,Xcchangescausingcapacitorimpedancetochange.Forexample,ifsignalfrequency=1MHz,capacitance=1uF.
XCversusFrequency
Ifthefrequencynowincreasesto2MHz,thenXc=80mΩ.Inshort,Xcisinverselyproportionaltofrequency.Seebodeplotinfigure3.7.AbodeplotisagraphthatshowsAC(frequency)analysis.ItincludesX-YaxiswhereX-axisisfrequency.Keepinmindthateventhoughimpedanceschangeswithfrequencies,thecapacitancevaluesremainthesame.Fromabove,capacitanceremains1uFbetweenthetwofrequencies.
Figure3.7:Xcvs.frequencyTheabovefigureshowsthatXccouldreachzeroohmsiffrequencyisextremelyhigh.Usingarithmeticrules,supposefrequencyisinfinite(∞);Xcwouldbecomezero(AC
short). Applyingthesamerule,iffrequencyiszero(DC),Xcwouldbecomeinfinitelylarge(DCblock).
SimpleCapacitorCircuit
Let’suseasimplecapacitorcircuitinfigure3.8tofurtherunderstandandapplythis
theory.ConnectingaDCvoltagesourcetoacapacitorisequivalenttoconnectingthevoltagesourcetoanopencircuit,i.e.,infiniteimpedance.Thisimpliesthatthecapacitorisnow“charged”tothepositivevoltagefromthesource.It’sstoringenergyfromthevoltagesourceintheformofanelectricfieldonthecapacitor.Despitevoltagedropacrossthecapacitor,thereisnocurrentflowingthroughthecapacitor(Xcisinfinite,opencircuit).AccordingtoOhm’slaw,whileimpedanceisinfinite,therewouldbezerocurrentflow.TosimplifyXc,1/(2πfC),canbeconvertedto1/SCor1/ѠC,whereSorѠ(omega)replaces2πf.
Figure3.8:SimplecapacitorcircuitAsimplemathematicalmodelcanbeusedtorepresentthecapacitor:
(Current)X(TimeChange)=(Capacitance)X(VoltageChange)I(∆t)=C(∆V)
Asimplefour-stepprocesscircuitinfigure3.9explainstheI(∆t)=C(∆V)equation.
Figure3.9:Four-stepcapacitorcircuitStep1:Beforetheswitchclosescompletely,thereisnovoltageacrossthecapacitor,i.e.,thevoltageacrosstopandbottomplatesis0V.
Step2:Whentheswitchcloses,electronsmovetowardsthepositivevoltagesourceleavingthetopcapacitorplatepositivelycharged.Duringthischargemovementprocess,unlessthereisdamagetothedielectriccausingashortcircuit,noelectricalionsareabletopassthroughthecapacitorduetotheinsulatingdielectric.Thetimedelayittakesforthevoltageatthecapacitortobechargeduptothevoltagesourceamountis∆t.Dielectricdamagecanbecausedbyexcessivevoltageacrossthecapacitor,thusbreakingdownthe
capacitor.Thecapacitordatasheetshouldspelloutthemaximumvoltage.
Steps3and4:Whentheswitchopens,energystoredonthecapacitorintheformofvoltagehasnootherpathtogo(discharge)andthereforeremainsinthecapacitor.Thecapacitorcannowbeviewedasabatteryholdingupthecharge.
I(∆t)=C(∆V)
Byknowingthevoltage,capacitance,andXc,∆tcanbeobtained:
∆t=C(∆V)/I
Thechargingbehaviorisfurthermadeclearinthewaveformshowninfigure3.10.Youcanseethatittakestime(∆t)tochargeupthecapacitor(dottedline)tofullvoltage.
Figure3.10:Capacitorcharging
CapacitorChargingandDischargingCircuit
Capacitorsareusedinapplicationswherecharginganddischarginghappensperiodically.Flashlightsapplicationsfoundincamerascanbeimplementedusingthecircuitbelow(seefigure3.11).
Figure3.11:Capacitorflashlightcircuit
Thiscircuitrequirestwoswitches,S1andS2,operatinginacomplementarymanner.WhenS1opens,S2closesandviceversa.Theflashlightactsasanelectroniccircuitload.Themaindifferencebetweenthisflashlightcircuitandthecapacitorchargingcircuitinfigure3.9isthattheflashlightcircuitdissipateschargetotheloadtolightuptheflashlight(step3).Theelectricalenergyistransferredfromthecapacitor(battery)totheflashlight(step4).Thecapacitorvoltagewaveformisshowninfigure3.12.
Figure3.12:Capacitorchargeanddischarge
Combiningresistorsandcapacitorscreatesseveralfundamentalelectroniccircuitsthatarefoundinliterallyendlesselectronicsystems(seefigure3.13).Thecircuitcontainsasquarewavevoltagesourcesymbol(Vin).Thecircuitisanalyzedusingthefollowingmathematicalmodel,
V_cap=VinX(1–e–t/(rc))
whereV_capisthevoltageatthetopcapacitorplate.Vinrepresentsinputvoltage;“e”istheexponentialfunctioninmathematics.RandCareresistanceandcapacitance.Thisisanexponentialfunction.AV_capwaveformisshowninfigure3.14.
Figure3.13:R,Cseriescircuit
Figure3.14:Capacitorvoltagewaveform
Thiscircuitintroducedawell-knownelectronicquantitycalledRCtimeconstant.RCtimeconstantisexpressedbythenumberofinstances,forexample,one,two,andthreetimeconstants.Whenthesquarewavesignalgoesfromlowtohigh,thecapacitorischargedupwithatimedelaycalledtimeconstant.FromtheV_capmathematicalmodel,onetime
constantmeanst=RC.Substitutingthatintotheequationyieldsthefollowing:
V_cap=VinX(1–e–1)V_cap=VinX0.64Fromthisresult,atonetimeconstant,voltageatthecapacitoris64%oftheinputvoltage.Fortwotimeconstants,timeisequalto2XRC.V_capnowequatesto:V_cap=VinX(1–e-2)=VinX0.87
Pluginsomerealisticnumbersandletusfurtherdemonstratethisconcept.Supposethelowestandthehighestlevelsofthesquarewaveare0Vand1Vrespectively.R=10kΩandC=1uF.Onetimeconstantyields10kΩX1uF=10ms.Itmeansthatittakes10msforV_captoreach0.64V(64%of1V).Fortwotimeconstants,i.e.,2XRC=20ms,ittakes20msforV_captoreach0.87V(87%of1V)(seefigure3.15).Whenthesquarewavegoesfromhightolow,thecapacitorwasdischarged(decay)usingthesamemathematicalmodel.
Figure3.15:RCtimeconstant
ParallelCapacitorRule
Capacitorscanbearrangedinparallelwiththefollowingrulesinfigure3.16.Twoparallelcapacitors’equivalenceisthesumoftwocapacitances.
Figure3.16:Parallelcapacitorrule
SeriesCapacitorRule
Infigure3.17,capacitorsconnectedinserieshaveequivalentcapacitance(C_eq):
Figure3.17:Seriescapacitorrule
Youprobablynoticedthatthecapacitorrulesareexactlyoppositetotheresistorrules.Atthispoint,wefocusedonusingtimedomaintoillustratecapacitorcircuits.It’smorefavorabletousefrequencydomain(bodeplot,ACanalysis)inelectroniccircuits.FrequencydomainusesfrequencyontheX-axisandelectricalquantitiesontheY-axis.Beforewetakeadeeperlookatfrequencydomain,decibelordBneedstobeunderstood.dBisaratiooftwoquantities.TocalculatevoltageratioexpressedindB,logarithm(log)canbeused.Forvoltage:
Forcurrent:
Forpower:
Thedifferencebetweenvoltage,current,andpowerdBcalculationistheconstant10vs.20.
PowerRatioindB
Forexample,anaudiopoweramplifieroutputs7.5W,theinputsupplyvoltage,currentis10Vand1A.WhatisthepowerratioindB?Theinputpowerisfoundby:VXI=10VX1A=10W:
RCSeriesCircuit
Figure3.18:RCseriescircuitinfrequencydomain
Wewillnowmoveontousingthesamecircuitfromfigure3.13toexplainfrequencydomaininfigure3.18.WewoulddefinethesquarewavevoltagesourceasVin(inputvoltage),voltageatthecapacitorisVout(outputvoltage).Toanalyzethiscircuitinfrequencydomain,weneedtoderiveatransferfunction.Atransferfunctionisanequationthatspellsouttherelationshipbetweeninputandoutput.Ifyoulookclosely,it’snothingmorethanavoltagedividerwherethecapacitorisanimpedancevaryingresistor,(i.e.,Xc).Thetransferfunctiontherebyis:
The“–”signinXcindicatesClagsbehindRby90degrees.Thisconceptwillbefurtherexplainedshortly.RecallXc=or,
–20dBperDecade
Thistransferfunctionshowsthatforgivenresistorandcapacitorsizes,increasingfrequencycausestheVouttodecrease.Thebodeplotbelowelaboratesthisconcept(seefigure3.19).
Figure3.19:RCrollsoffAt0Hz(DC),Vout=Vin,
Asfrequencyincreases,voltagefallsrollingoffat–20dBperdecaderate.Adecadeis10timeschangeinfrequency.Assumeat10kHz,Voutstartstofall;Vinisat10V.Vout/VinindB;frequencyandVoutaredevelopedbelowinTable3-2.ThereisanegativesignofdBafter0dB.It’sduetothe–20dBperdecadereductionrate.
Table3-2:Frequency,Vout/Vin,VoutThecorrespondinggraphisshowninfigure3.20.
Figure3.20:Vout/Vinvs.FrequencyLet’sputsomeactualnumberstothisRCcircuitinfigure3.21.Vin=0Vto10Vat10kHz,100kHz,1MHzand10MHz,R=10kΩ,C=1mF
Figure3.21:RCcircuitwithactualvalues
Thiscircuitonlycontainspassivedevices,henceoutputcannotexceedinput.Thehighestoutputcanreachisinput,denotedby0dB(Vin=Vout).Asfrequencyincreases;Voutdecreases,thenegativedBsignthenfollows.Every–20dBperdecaderoll-offsignifiesthe10timesincreasesinfrequency.WhenVin=Vout=10V,frequencyis0Hz:
At–20dB,Vout:Frequencyisthenfoundby:At–40dB,Vout:
Vout=0.1V,whereVin=10V
100=1–2πff=16Hz
Vout=0.01V,Vin=10VFrequencyisthenfoundby:
1,000=1–2πff=160HzApplythesametechnique,itcanbeestimatedthatthefrequencyincreases10timesforevery10timesreductioninVout.Table3-3summarizesthesefindingsforR=1kΩ,C=1mF.TheexerciseaboveshowsthatyoucandesignthecircuitbychangingtheRandCvaluestofinetuneauniquefrequencyinsuchawaythatVoutstartstoreduce.Thisconceptextendstoaverypopularcapacitorfilterapplication:low-passfilter.
Table3-3:ForR=1kΩ,C=1mF
Low-PassFilter
Figure3.21isapopularcircuitcalledthelow-passfilter.Itallowssignaltopassthroughonlyatlowfrequencyfilteringouthighfrequencysignals.Alow-passfilterisusedtoremovehighfrequencynoiseeffectivelyimproveelectronicsystemperformance.Thecapacitorusedinthiscircuitiscalleddecouplingorbypasscapacitor.ThedownsidetothisnoisereductiontechniqueistheadditionalRandCcomponentsaddingbill-of-materials(BOMs)costsandspaceontheprinted-circuitboard.BOMsareusedtoestimateoverallsystemcosts.Theyincludeallhardwarecomponentsaswellasprintedcircuitboardscosts.Onefilterparameteroftenusedisf–3dB.Itdenotesspecificfrequencyvaluewhentheoutputstartstofallto70.7percentoftheinput.It’sthepointwheretheoutputjuststartingtoroll-off.Usingthischaracteristic,filterperformancecanbesummarized(seefigure3.22).
Coincidently,the0.707isthesameconstantusedinVrmscalculations.
Figure3.22:f–3dB
PhaseShift
IntheRClow-passfiltercircuit,thereisaphaseshiftbetweenthevoltageattheresistorandcapacitor.Phaseshiftisthetimedifferenceamountfromtheoriginaltimingpositiontoanewone.Aphaseshiftcanbepositiveornegative.Tounderstandphaseshiftinthe
low-passfilter,weusea360-degreecircletointerpretafullcyclesinewaveinfigure3.23.
Figure3.23:Sinewavewith360degreecircle
Aperiodicsinewaverevolvescontinuously.Itcanbemappedtoa360degreecircleontheleft-handsideoffigure3.23.Asinewaveatasinglepointoftimepresentsspecificamplitude.Itstartsfrom0degreemovinginanti-clockwisedirection.Inthefigure3.23,whenthesinewavearrivesatthepositivepeak,itrepresents90degreeofthecircle(topdottedline).Whenthesinewavecontinuestorevolvetowardstheright-handsideofthetimingwaveformarrivingatthelowerhalf,itcorrespondsto225degrees.Allthesecanbemodeledas:
V(t)=VpeakXsinѲ,whereѲisdegree=VpeakXsin(Ѡt)=VpeakXsin(2πf)X(t)=VpeakXsin(2π)
Forexample,ifVpeak=5V,therotationdegree(Ѳ)=45degrees:V(t)=5VXsin(45degrees)=(5V)X0.707=3.53V
Radian
TheequationonthepreviouspageisafunctionwhereV(t)isaportionofVpeakatanyparticulartime.Ѡ=2πfor(2π)/tistheangularvelocity(distancedividedbytime).Figure3.24belowshowsthevariousradiansaroundafullcyclesinewaveandatablewithdegreescorrelatewithradianinπanddecimalvalues.Radiancanalsobedefinedas:
degreesofacircle,ifgivenaradian,aparticulardegreeiseasilyfoundviathe2πand360degreeratio.Forexample,radian=1,degreeX:
(2π/360degrees)=(1radian/Xdegree)X=57.30degrees,whereπ=3.14Ifarcdistance=2,radius=0.5.Radian:Radian=2/0.5=4radians=(1.27Xπ)radians
Therotationdegreecanbecalculatedbythe2πand360-degreerelationship.Let’sassumetherotationdegreeisY.Use4radiansfromtheaboveexample:
(2π/360)=(4radians/Y)(2π/360)=1.27π/YY=229.18degrees
Figure3.24:Radianvs.sinewave
ICE
IntheRCfiltercircuit,thevoltageatthecapacitorlagscurrent.Someuse“ItoCtoE”(ICE)asawaytorecognizethisphenomenon.“I”correspondstocurrent,“C”isthecapacitor,and“E”isvoltagepotentialacrossthecapacitor.Infigure3.25,voltageatthecapacitorappearsontherightwhilebothcapacitorandresistorcurrents(ontheleft)leadcapacitorvoltageby90degrees.Becausetheresistorandcapacitorareconnectedinseries
withonlyonecurrentbranch,thecapacitorcurrenthasthesamephaseasresistorcurrentandvoltage.Inotherwords,thecapacitorvoltageislaggingcapacitorandresistorcurrentsby90degrees.ThisexplainswhyXchasanegativesignintheRCcircuitcalculationinfigure3.18.Itdesignatesthe90-degreephaseshift.
Figure3.25:ICEWederivedinchapter1,DC:Current=I=∆Q/tThecapacitorisrepresentedbythismodel,I(∆t)=C(∆V)SubstitutingIwith∆Q/tinthismodelresultsin(∆Q/t)∆t=C(∆V)∆Q=C(∆V)Thisequationcanberealizedbythecircuitbelowinfigure3.26.
Figure3.26:Capacitorcircuitquestion
Witha5Vsource,two5uFcapacitorsareconnectedinparallel.BothS1andS2areidealswitcheswithzeroresistance.S1firstcloses,S2opens.WhatisthevoltageatVxafterS1openswhileS2closes?YoumaybetemptedtosayVxis5V,butitisn’t.Wecanuse∆Q=C(∆V)toprovethat.Fromtheformula,theelectriccharge(Q)remainsthesamebeforeandaftertheswitchopensandcloses.Applyingenergyconservationfromthelawofphysics,whenS1isclosed,S2opens:
Vx=5V,C=5uFQ=CV:Q=(C)X(Vx)=(5uF)X(5V)=25ucoulombsAfterthat,S1opens,S2isclosed,andQremainsthesame.Wearenowlookingattwocapacitorsinparallel(5uF||5uF=5uF+5uF=10uF):Q=(C)X(V)=25ucoulombs=(10uF)X(Vx)Vx=2.5VWewillgoovermorepracticalcapacitorcircuitsattheendofthechapteraftertheinductorsection.
Inductors
Aninductorisanelectronicpassivedevicethatdoesnotgenerateenergybutratherstoresenergyinamagneticfield.Inductorsaretypicallymadeofwoundedcoilinmultipleformsandsizes.Commoninductormaterialsareiron,copper,andferrite.Manycharacteristicsareexactlyoppositethatofacapacitor.Figure3.27showsseveralinductortypesanditsschematicsymbol.
Figure3.27:Assortedinductors(top)andinductorschematicsymbol(bottom)
Inductorvalue(inductance)ismeasuredinunitHenry(H).Theyexhibitreactance,calledinductivereactance(XL)measuredinOhms(Ω).TheinductorsymbolisL.Someinductorsareconstructedinthemicroelectronicscalehousedinsmallsemiconductorpackages.Thesmallersizessavearea,however,smallsizedinductorsoffermuchlessinductance.
InductorImpedance=Resistance+XL
Thecontributionoftheinductanceresistancecomesfrominductorpackagesandleadsandtheintrinsicnatureofinductivematerials.XL=2πfL,wherefissignalfrequencyandLisinductancewithunitsinHenry(H).Whenthesignalfrequencychange,XLchangecausingchangeininductorimpedances.Ifsignalfrequency=1MHz,inductance=1uH:
XL=(2π)X(1MHz)X(1uH)=6.28Ω
XLversusFrequency
Ifthefrequencynowincreasesto2MHz,thenXL=12.56Ω.Inotherwords,XLisproportionaltofrequency(seefigure3.28).Keepinmindthatevenwithchangesinimpedanceswithfrequencies,theinductivevaluesremainthesame.Inductanceremains1uFinbothfrequencies.
Figure3.28:XLvs.frequency
TheabovediagramshowsthatXLcouldreachinfinityiffrequencyisextremelyhigh.Thisonlyappliestoidealinductors.Youwillseeseveralnon-idealinductorcharacteristicslateron.Usingarithmeticrules,assumingfrequencyisinfinite,XLwouldbecomeinfinite(ACchoke):
XL=2π(∞)(L)∞>>2π,L,XL=∞
Applyingthesamerule,iffrequencyiszero(DC),Xcwouldbecomezero.
XL=2π(0)(L)=0
Let’suseasimpleinductorcircuittoexplainthisinfigure3.29.ConnectingaDCvoltagesourcetoaninductorisequivalenttoconnectingthevoltagesourcetoazeroΩresistor.Thisimpliesthattheinductorpracticallyisnon-existent(DCshort).
Figure3.29:Simpleinductorcircuit
V(∆t)=L(∆I)
Asimplemathematicalmodelcanbeusedtorepresentacapacitor.
(Voltage)X(TimeChange)=(Inductance)X(CurrentChange)V(∆t)=L(∆I)
Asimpleinductorcircuitinfigure3.30explainstheabovemodel.
Figure3.30:Inductorcircuitexplained
Aftertheswitchisclosed,currentstartstorampupandthemagneticfieldstartstoincrease.Ittakes∆tfortheinductortobuildupthemagneticfieldandcurrenttoits
maximumlevel.Thefieldstrengthandcurrentdependontheinductanceamount,whichrelatesstronglytotheinductormaterialsandproportionallytothecoilnumber.Immediatelyaftercurrentrampsuptothehighestlevel,theswitchopens.Theinductortriestomaintaincurrentflowandtheinductorwillflippolarity.Themagneticfieldstrengthdecreasesandcurrentrampsdown.Figure3.31showsthecurrentramp(currentripple)waveform.If,forexample,inductanceis1H,1Vacrosstheinductorresultsincurrentrampof1Ain1S.
(1V)X(1S)=(1H)X(∆I)(∆I)=1A
Powermanagementapplicationsstepupand/ordowninputvoltagetoprovidehigherorloweroutputvoltage,current,orpower.SomepowermanagementdesignsoperateinDCsuchasthose(diodes,zenerdiodes)mentionedinchapter1,DC.ManypowermanagementapplicationsoperateinACandatmuchhigherfrequency.Forexample,a400kHz(2.5msperiod)switchingregulatortakes12Vinputvoltageandregulatesto1.2Voutput.Itspecifiesthat10%dutycycle(0.25ms)isrequiredwithmaximum2Aripplecurrentattheoutput.Theinductorsizecanbecalculated:
(12V)X(0.25ms)=L(2A)L=15mH
Figure3.31:Inductorcurrentramps
ELI
Asforvoltageleadsandlags,inductorsbehaveexactlytheoppositeofcapacitors.Weuse“EtoLtoI”(“ELI”)where“E”ispotentialdifference,“L”representstheinductor,and“I”correspondstocurrent.Inductorvoltageisleadingthecurrentby90degrees,showninfigure3.32.
Figure3.32:ELI
QFactor
Theinductorqualityfactor(Q)dictateshowgoodaninductoris.Thisfactordetermineshowmuchlosstheinductorincursintermsofheatandmagneticfieldlosses.Qfactorismodeledby2πf,inductance(L),andtheinductor’sinternalelectricalresistance(R).
Withthissimplemodel,anidealinductor(lossless)Qfactorisinfinite(R=0):
Asurface-mount10nHinductorwith1mmby0.5mmindimensioncanhaveaQfactorashigh20at500MHz.
ParallelInductorRule
Recallcapacitorparallelrules.Inductorscanbearrangedinparallelwiththefollowingrulesinfigure3.33.It’sagainoppositetothecapacitorrule.Theparallelinductorruleisthesameastheresistorrule.Theequivalentoftwoparallelinductors,L_eq:
Figure3.33:ParallelinductorruleWithtwowire-woundinductorsconnectedinparallel,eachhas100nH.Equivalentinductance,L_eqis:
Thesameastheresistorrule,iftheparallelinductorsarethesamesizes,theequivalentinductanceistheinductancedividedbythenumberofinductors,(i.e.,100nH/2=50nH).If3inductorsconnectedinparallelareallequalininductances,theequivalentinductance:
SeriesInductorRule
Theequivalenceoftwoinductorsinseriesyieldsthesumoftwoinductancesshowninfigure3.34.
Figure3.34:Seriesinductorrule
Twoinductors,eachhaving5uHconnectedinseries,yields5uH+5uH=10uH.Acombinationofseriesandparallelinductorcanbeevaluatedusingtheserulestoyieldequivalentinductance.Infigure3.35,L_eq:
Step1:FirstcombineB,E,andD,(B+E+D)Step2:Parallel(B+E+D)||FStep3:AddA,resultsfromstep2,andCtogether
A+(F||(B+E+D))+C
Figure3.35:Inductorcombinations
High-PassFilter
Let’suseasimpleinductorcircuitinfrequencydomain(ACanalysis),illustratedinfigure3.36,tohelpourinductorknowledgesinkinfurther.
Figure3.36:RLcircuit
Thiscircuitiscalledhigh-passfilter.Itcontainspassivedevicesonly;a1kΩand10uHinductorconnectedinseries.ACsquarewavesourcefrequencyincreases.Outputcannotexceedinput.Itcanonlygoashighasinput,denotedby0dB,Vin=Vout.ToderiveVout,wecannotsimplyuseastandardvoltagedividerbecauseoftheELIbehavior,(i.e.,inductorcurrentleadsinductorvoltageby90degrees).AcreativewaytoanalyzeanACcircuitistousethevectordiagramshowninfigure3.37.InsteadofusingtimeontheX-axis,thevectordiagramusesvoltageorcurrentonboththeX-andY-axisalongwithdegreerotations.Becausethiscircuitisaseriescircuit,currentinthisseriesRLcircuitisthesame,(i.e.,thesamephase).Thismakesthevoltageandimpedances90degreesoutofphase.Inordertofigureoutthevoltageacrossresistorandinductor,totalimpedanceZfirstneedstobefound.ZistheresultantimpedancebetweenXLanda1kΩresistor.Foragivenfrequency,ifXLandRarethesame,theresultantZwouldbeangledat45degrees(halfof90degrees).IfXLishigherthanR,(i.e.,Vinfrequencyishigher),XLpullsZupwardwithmoredegreerotation.WecanusestandardtrigonometryorthePythagoreanTheoremtocalculatetheresultantZandangle.OnceZisfound,thedividerruleisusedtoevaluatethevoltagesacrossinductorandresistor.Infigure3.37,toachievea45degreeangle,XL=R=1kΩ=2πfL,andVinfrequency:
UsethePythagoreanTheorem:Z=(R2+XL2)0.5
Z=(1kΩ2+1kΩ2)0.5Z=1.414kΩ
WhenVinreachespeakat10V,
Vout=7.07V
Figure3.37:RLvectordiagram
Figure3.38showsthetimingwaveformbetweeninductorandresistorvoltage.Theydifferby45degrees.Iftheinputfrequencychanges,theresultantZchangesaswellastherotationangle(phaseshift).
Figure3.38:RLtimingwaveform,XL=R,45-degreephaseshiftAtDC,XLiszeroyieldingVout=ground.XL=2πX0X10uH=0Ω
UsingthedBequationcoveredpreviously,wecanfigureouttheVout/Vinversusfrequencyrelationship.AtDC,frequencyiszeroandVout/VinindB:
Assumingfrequenciesstepupgraduallytoinfinitelyhigh,Vout/VinindB:
∞>>1kΩ,
dBwhenVout/Vin=1:
=20X0dB=0dB
Seefigure3.39forVout/VininthedBbodeplot.AtDC,Voutisatground(0V).With–∞dB,asfrequenciesincrease,negativedBgoesupwithVoutgoingupto0dB(Vin).Thisiswhythecircuitiscalledahigh-passfilter.AtDCorlowfrequency,Voutisclosetogroundornosignalattheoutput.Thesignalonlypassesthroughathigher
signalfrequency.
Figure3.39:Vout/Vinvs.FrequencyTodetermine–3dbbandwidthofahigh-pass
filter:
RealLandC
Beforewestepintorealworldcircuits,it’sbeneficialtoknowcapacitorsandinductorsdevicemodels.Devicemodelsincludeadditionalcomponents(R,L,andC)thatarecalledparasitic.Althoughthesecomponentsaresmallinquantity,theycouldhavemajoreffectsoncircuitperformance.Anon-idealcapacitormodelisshowninfigure3.40.Itincludesthecapacitoritself,leakageresistor,equivalentseriesresistor(ESR),andequivalentseriesinductance(ESL).ESRcontributestoheatloss.ESLcontainsXL.10mΩisconsideredgoodperformancefora500uFaluminumcapacitor.RecallthatXcdecreaseswithincreasingfrequency.Inreality,ifthefrequencyishighenough,XLfromESLwouldeventuallykickin,tiltingtheoverallimpedanceupward(seefigure3.41).TheuptickinXcoccursatextremelyhighfrequency.Somedatasheetswillnotshowthembecauseit’sabovethenormaloperatingfrequencyforaspecificcapacitor.
Figure3.40:Capacitormodel
Figure3.41:Xcvs.frequency
Inductorcontainsparasiticdevicesaswell.Figure3.42showcasesarealinductormodel.TheESRcomesfromleadsandpackageresistance.Parasiticcapacitancecomesfromtinygapsbetweencoils.
Figure3.42:InductorparasiticAthighsignalfrequency,XLultimatelydecreases(seefigure3.43).Forahighfrequencysurface-mountinductorwith100nH,ESRcanbeaslowas500mΩ.
Figure3.43:XLvs.frequency
PracticalACCircuits
Figure3.44aisatypicalcircuitusedinaFrequencyModulation(FM)radiocircuit.Iteliminatesnoiseby“clipping”outsignalabovetheupperandbelowlowerdiodevoltage.MoreACcircuitswillbepresentedinchapter4,AnalogElectronics.Inthiscircuit,D1conductsinthepositivehalfACcycleleadingVoutat+2V,duringthenegativehalfACcycle,theD2forward-biasresultingin–2VatVoutwhiletheD2anodestandsatground.SeeVinandVoutwaveformsinfigure3.44b.
Figure3.44a:FMnoiseclipper
Figure3.44b:FMnoiseclipper,VoutandVinwaveforms
RingingandBounce
TheRCcircuitwasmentionedpreviouslyasafilter.Apracticalscenariobelowinfigure3.45hasa“real”switchconnectingtoanelectronicload.Whena“real”switchcloses(stepresponse),thetransitiontakesfinitedelaytimewithphysicalbouncebackandforthcausingringing,whichisaformofoscillationandundesirable.Ringingisalsoreferredtoasundershootandovershootofthesignal.UsinganRCfilterinfigure3.46,thisbouncecanbeeliminatedorhighfrequencynoisecanbefilteredout(dottedtrace).Thetrade-offisalongertimetoreachpeakvalue,completelyclosingtheswitch.
Figure3.45:Switchconnectstoload
Figure3.46:RCeliminatesbounce
InductiveLoad
Youneedtobemindfulaboutanelectronicloadthatisinductiveduringswitching.Infigure3.47below,whentheswitchisfullyclosed,theinductiveloadturnson.
Figure3.47:Switchclosewithinductiveload
Whentheswitchopensinfigure3.48,theinductorflipspolarity,attemptingtomaintaincurrentflow.Thebottomendoftheinductorisopen,andvoltageisunknown.Thereisnolimittohowhighthisvoltagecanbe.Thereisnomechanismtodefinethebottomend
inductorvoltage.Theelectronicloadcouldbedamagedbyexposingittolargevoltageamount.Wecallthisphenomenoninductivekick.
Figure3.48:Switchopens,voltageundefined
DiodeClamp
Tosolvethisproblem,adiodecanbeadded(seefigure3.49)inparallelwiththeinductor.Whentheswitchopens,thediodenowconductsandholds(clamps)thediodeanodeat2Vabovethe7Vsource.Inotherwords,theelectronicloadvoltageissafely“clamped”atnomorethan2Vabove7V.Thisdiode,sometimescalledacommutatingdiode,hasnoimpactonnormaloperationwhentheswitchisclosed.Thediodeinfactisreversed-biased,appearingasanopencircuit.Thistechniqueisalsocalledsnubbercircuit.Thedisadvantageofusingthediodeistheadditionalchargeanddischargetimebecauseofthedioderesistanceandparasitic.
Figure3.49:Diodeclamp(snubber)
SeriesRLCCircuit
Recallthevoltage,currentlead,andlagdifferentlyamongR,L,andC.ThisinterestingfeaturecreatesmanyusefulcircuitsliketheRLCseriescircuitinfigure3.50.
Figure3.50:RLCcircuitApplyingvoltage,currentlead,andlagrules,thefollowingwaveforminfigure3.51canbeobtained.
Figure3.51:Capacitorandinductorvoltagelagandlead
Allcurrentsinaseriescircuitareinphase.Capacitorvoltagelagsitscurrentby90degrees(ICE)whileinductorvoltageleadsitscurrentby90degrees(ELI).Thisresultsininductorvoltageleadingcapacitorvoltageby180degrees.UsingthesameACprinciples,voltage,current,andphaseinformationcanbeextracted.Infigure3.52,thevectordiagramshowsinductorvoltage(VL)isleadingcapacitorvoltage(VC)by180degrees.Theresistorvoltageisatzerodegreeasthereferencevoltage.VLisstandingupwardinthevectordiagramwhileVCispullingdownwardduetothe180-degreephasedifference.ThereisanetvoltagesumdependingupontheXLandXCimpedancesizes.Thisseriescircuitonlyhasonecurrentgoingthroughallthreecomponents.IftheCandLweredesignedtohavethesameimpedances,theresultingcircuitispurelyresistive,i.e.,nophaseshiftbetweenvoltageandcurrent.ThenetVLandVCvoltageyieldszerovoltage.Thisleadstomaximumcurrentflowinginthecircuitwithminimumimpedance.Thisparticularfrequencyiscalledresonantfrequency.FrequencyaffectsbothXLandXc.LCreactanceisheavilycontrolledbyfrequency.Keepinmind,however,thenon-idealR,L,andCnaturecouldbecomefactorintheRLCcircuit.Wecanderiveresonantfrequencyusingfigure3.52:Vout=0whenXLandXCcanceleachotherout:XL=XcorXL–Xc=0.MaximumcurrentoccurswhenXL–Xc=0,i.e.,minimumimpedances.Tolookfortheresonantfrequency,wesimplyapplyXL=XCthensolveforresonantfrequency,f:
Figure3.52:Inductorvoltageleadscapacitorvoltage
LRCParallel(Tank)Circuit
ThepopularLRCparallelcircuitiscalledatankcircuit(seefigure3.53).Itincludestheinductorandcapacitorconnectedinparallel.ThevoltageacrossLandCisthesame.Thecurrentthrowsthroughtheinductorandcapacitorare180degreeoutofphase.Thevectordiagraminfigure3.54showsthevectordiagram.Varying(tuning)LCcomponentvaluesallowsustodetermineandadjustresonantfrequency.SimilartoseriesanLCcircuit,atankcircuit’sresonantfrequencyis:
Atresonant,XL=Xc,thetotalreactanceisatmaximumwhilecircuitcurrentisminimum.Positivepeakinductorcurrentcancelsoutthenegativepeakcapacitorcurrent(seefigure3.54).Resonantfrequencycaneasilybetunedbyvaryinginductorandcapacitorsizesforagivenfrequency.Forexample,toachieve1MHzresonantfrequencyusinga10mHinductor,thecapacitorvaluecanbeevaluated:
Figure3.53:LRCparalleltankcircuit
Figure3.54:ParallelLCvectordiagram
Figure3.55demonstratesthetransientwaveformamongcapacitorandinductorvoltageandcurrent.Inductorandcapacitorvoltageareinphase.Inductorcurrentlagsinductorvoltage(ELI)by90degreeswhilecapacitorcurrentleadsinductorvoltagealsoby90degrees.Thisresultsina180-degreephaseshiftbetweencapacitorandinductorcurrents.Theapplicationsofatankcircuitincludeoscillatorsandwirelesstransmitterandreceivers.Theseapplicationswillbefurtherexploredinchapter6,Communications.
Figure3.55:TankLCcurrentwaveforms
Transformers
AtransformerisanACcircuitthatstepsupordownACvoltages.Theoperationofatransformercanbeexplainedbyelectromagnetictheory.Transformersareusedinmanyapplicationssuchaselectricpowergenerationandelectronicdevicecharging,(e.g.,laptopandcellphonebatterychargers).Atransformerrequiresatleasttwosidestooperate:primaryandsecondarysides.Multiplesecondarysidesareoftenfoundincomplextransformerdesigns.Thekeytotransformeroperationiselectromagnetictheorywherechangingvoltageandcurrent“induce”voltageandcurrentontheothersideofthecircuitthroughelectricandmagneticfieldsgeneratedonbothsides.Infigure3.56,theprimarysideontheleftispoweredbyanACvoltagesourcewhichconnectstowires.Thewiresareroundedwithmanyturns(turnnumbers),calledN1.Theseturnsaretightlywrappedaroundthecore,whichismadeofconductivematerials.Thewiresonthesecondarysidewraparoundthecorealsowithfixedturnnumbers(N2).Forstep-downapplications,fromahouseholdelectricaloutlet(120VAC)toDC,thesecondaryturnnumberislessthantheprimaryone.TheinputACvoltage(Vin)isgeneratingmagneticandelectricfieldsfromthewirecarryingACcurrent.Thesefieldsaredirectedtothesecondarysideviathecore,inducingchangingvoltageandcurrentonthesecondaryside.Thecurrentamountandvoltageattheoutput(Vout)aredeterminedbytheturnnumberratiobetweenprimaryandsecondarysides.Let’susesomerealnumberstofurtherelaborateit.N1=100,N2=10,Vin=120V,Vout=?
12VisanACvoltage.Toachievea5VDC,usuallyfoundinportableelectronicdevicessuchasiPodandsmartphonecarchargers,additionalvoltagereductionisrequired.Thebenefitofusingatransformeriselectricalisolation.Itofferssafetyinadditiontotheabilitytoincreaseordecreasevoltagesattheoutput.Youmayaskhowitcouldprovideisolationifthecoilsaretightlywrappedaroundtheconductivecore.Theansweristhatthewiresurfaceiscoatedwithnon-conductivematerials.Despitetightwrappingwiththecore,thereisn’tanydirectelectricalconnectionfromprimarytothecoreandthesecondaryside.Allactionsarepurelyreliedreliantonelectromagnetictheorywherevoltageandcurrentarecreatedbychangingelectricandmagneticfields.Inelectricalplantoperations,powerplantsstepupthevoltagetotensofthousandsofvolts.Then,travellingthroughcablebeforearrivingatthehousehold,thesehighvoltagesareeventuallysteppeddownthroughmultiplesubstationsbeforetheygetto120VAC(householdrating).It’sverytypicalthatfewthousandvoltsarepresentatthesubtransformerlocatedrightoutsideresidentialhomes.Themotivationforthishighstep-upvoltageispowerlossreduction.Forpowerconservationrule,
(InputVoltage)X(InputCurrent)=(OutputVoltage)X(OutputCurrent)
Supposeallcomponentsareideallylossless.Thismeansiftheinputvoltageisextremelyhigh,currentwouldbeloweredforthesameinputandoutputpower.LessinputcurrentmeanslessI2Rpowerloss.Theselossesaremainlyduetoheatandelectromagneticfieldlosseswhencurrentflowsthroughtheutilitycables.Forexample,toprovide12,000Wofpower,inputvoltageisat1,200Vdrawing10Aofcurrent.Ontheoutputside,powerremainsthesameassumingallcomponentsareideal.Transformerstepsdown120Voutput.Thisequatesto100Aofoutputcurrent.
(1,200V)X(10A)=(120V)X(100A)
Manycountrieshavetheirownstandards.120VACistheUnitedStatesstandard.Asia,Europe,andotherpartsoftheworldhavedifferentratingsnumbersultimatelyaffectingtransformerdesigns.
Figure3.56:Transformer
Half-WaveRectifier
Usingadioderectifier,azenerlinearregulatorcouldfurthertransformACvoltagetoDC.Ahalfwaverectifierisaclassicexampleshowninfigure3.57.ThediodeonlyconductsduringthepositiveVinhalfcycle.Voutisat0Vduringthenegativehalf(Diodereverse-biased)cycle.Byaddingacapacitorinthecircuit,a“DC-like”outputisacquiredsimilartofigure3.58.Duringthepositivehalfcycle,thecapacitorischargeduptotheVinpeak.Duringthenegativehalfcycle,thediodeturnsoff,andchargesaccumulatedonthetopcapacitorplateslowlydischargetotheresistordelayedbytheRCtimeconstant.ThisoutputisnotastableDCvoltageduetothefactthatthevoltageisbeingchargedanddischarged.Theamplitudeofthischargeanddischargevoltageiscalledripplevoltage.RipplevoltagedefineshowwelltheVoutiscomparedtoastableDCvoltage.
Figure3.57:Half-waverectifier
Figure3.58:DCvoltagewithcapacitorAzenerregulatororDC-to-DCregulatorsmaybeusedtoachievemorestableVoutasshowninfigure3.59.
Figure3.59:Diode,RCwithzenerdiode
TheACsignalfrequencyandRCsizesareimportantdesignconsiderationstoproducestableVout.Forexample,infigure3.60,Vinpeak-to-peakis10Vrunningat10kHz(0.1msperiod).RCisinitiallydesignedtobe10kΩand1uF(10mstimeconstant).TheproblemwiththisdesignisthattheRCtimeconstantistoolong.Recalltimeconstantdefinition:ittakes2timeconstantstoreach87%oftheinput.TheVoutinthisdesignneverhadenoughtimetoreachnoticeableoutput.SizingRCaccordinglyisthekeytodesigningthistypeofregulatorsuccessfully.
Figure3.60:LargeRCtimeconstant
SwitchingversusLinearRegulators
Bydefinition,voltageregulatorsprovideconstantDCoutputvoltagetoaload.Aswitchingregulator’soutputisanACsignalwithminimumripplevoltagebehavinglikeaDCsignal.Mostswitchingregulatorsrequireacontrollercircuitandaswitchtogglingonandoff.Thisincreasescircuitcomplexity.It’sbecauseofthisreasonswitchingregulatorsaremoreefficientbecausedevicesareonlyononlypartofthetime.Someswitchingregulatorscanrunwithashighas90%efficiency.Thisisextremelybeneficialinportableapplicationswhenlongerbatterylifeisrequired.Conversely,alinearregulatordoesnothaveanyswitchingactions,iseasytouse,makeslessnoise,andcostsless,butsuffersfromlowerpowerefficiencybecausetheactivedeviceremainson(heatsinkmayberequired)theentiretimeduringvoltageregulation.Typical
linearregulatorefficiencyislessthan50%.Bothtypescomeinmanytopologiesandarefoundinplentyofportableapplicationssuchassmartphones,digitalcameras,robots,computers,etc.Populartopologiesofswitchingregulatorsarestep-up(boost)andstep-down(buck).Thezenerdiodeandlowdropoutregulator(LDO)arecommonlinearregulators.BothswitchingregulatorsandLDOusefeedbackcontrolcircuitrytoregulatetheoutput.Asummaryofthemajordifferencesbetweenswitchingandlinearregulatorsisshownintable3-4.
Table3-4:Switchingvs.linearregulators
BuckRegulator
Lastly,aswitchingvoltageregulatorisshowninfigure3.61.Thisisabuckregulatorcircuitinventedinthe1970s.Itcontinuestobepopularinpowermanagementsystems.Itmerelyconsistsofthreedevices:aswitch,adiode,andaninductor.Thiscircuitstepsdownahighervoltagetoalowerone.Oneapplicationisthe5VDCoutletsinautomobiles.Theyrunoffa12Vlead-acidcarbattery,whichissteppeddowntolowervoltagesforportableelectronicsusedinsideautomobiles.V(t)=L(∆I)canbeusedtoexplainthiscircuit.Whentheswitchisclosed,thediodeisreversebiasedandinductorcurrentstartstorampupwithafixedvoltageacrossit.Thetimeittakesforthecurrenttoramptoitspeakiston(on-time).Duringthistime,theswitchisclosed.Thevoltageacrosstheinductoris(Vin–Vout).Theswitchthenopens,andtheinductorflipspolaritytryingtomaintaincurrentflow(seefigure3.62).
Figure3.61:Switchingregulator
Figure3.62:Switchopens
Theonlycurrentpathisthroughthediode,whichisnowforward-biased(seefigure3.62).Thiscausesthediode’scathodetobeonediodebelowground(–Vdiode).Thisdiodesometimesiscalleda“catchdiode.”It’sintendedtobeswitchingfasttokeepupwiththeon-offswitchingaction.Toachievejustthat,it’squitetypicalforacatchdiodethresholdtobeaslowas200mV.UsingKVL,thevoltageacrosstheinductorisnow
(Vout–(–Vdiode))=Vout+Vdiode.
Theswitch-opentimedurationistoff.Foragiveninductorsize,currentchange(eitherrampingupordown)hasthesameamplitude(seefigure3.63).Theinductanceand∆Iliterallyareconstants.
Figure3.63:InductorcurrentrampL(∆I)=(Vin–Vout)Xton=(Vout+Vdiode)Xtoff
Vdiodeisdesignedtobeaslowaspossible.AssumeVdiodeismuchsmallerthanVoutandbecomesnegligible.(Vin–Vout)Xton=VoutXtoffSolveforVout:VinXton–VoutXton=VoutXtoffVout(ton+toff)=VinXton
Dutycycleneedstobelessthanoratleastequaltoone(dutycycle≤1)inorderforVouttobelowerthanVin.Forexample,ifVinis10V,regulatedoutputvoltageis5V.50%dutycycleisneeded(ton=toff).Iftheswitchingfrequencyis400kHz:
dutycycle=0.5=ton/(ton+toff)(ton+toff)=Period=1/400kHz=2.5us0.5=ton/2.5uston=toff=0.5X2.5us=1.25us
TochangeVout,youneedtocontroltheswitch’sdutycycleusingcontrolcircuits,avoltagedivider,andacomparator.Infigure3.64,theoutputisalwaysinAC,i.e.,theoutputvoltageistogglingbackandforth.TheamplitudeofACoutputwaveformisquantifiedasripplevoltage.Thepeak-to-peakvalueoftheripplevoltagedetermineshowwelltheoutput“lookslike”aDCsignal.Thesmallertheripple,morestabletheoutputwouldbe.DuetotheloadattachedtotheVoutcausingunevencurrentflow,noiseinthesystem,andpossibleintermittentVoutdisconnection,Voutcouldchangeerratically.Thetriangularsymbolwiththe+and–signsinsideistheoperationalamplifier(op-amp).Theop-ampandcontrolcircuitarepartofthefeedbackmechanism.Ittakesavoltagesampleandcomparesittoafixedvalue(VFB).Theresultofthedifferencefeedsbacktothecontrolcircuit.Thecontrolcircuitthenalterstheswitch’sdutycycle.Thewholeconceptistomaintainconstantoutputbyadjustingtheswitch’sdutycycleaccordingtothefeedbackfromtheVout.IfVoutgoestoohigh,theswitchturnsonlesstobringtheVoutbackdown,andviceversa.TheopampinthiscircuitisacomparatorthatcomparesvoltagebetweenVFBandVout.Thepositiveop-ampterminalchangesifVoutchanges(voltagedivider)causingtheop-ampoutputchanges.Thecontrolcircuittakesthischangethenadjuststhedutycycle.IftheVoutdrops,theswitchturnsonlonger(increasingthedutycycle),bringingtheVoutbacktoitsoriginalvalue.Feedbacktechniquesintheop-ampareusedincountlesselectronicsproducts.Theywillbefurtherexaminedinchapter4,AnalogElectronics.UsingavoltagedividercancontrolVoutleveleasilybychangingtheresistorsratio.Forexample,targetVout=2.5V,VFB=1.25V.Ifresistorsarethesamesize,then:
Figure3.64:Buckregulatorcontrolledcircuit
Thisfeatureallowsyouto“program”theoutputvoltagebyusingdifferentresistorsizes.Thebuckregulatorisasimple,yetpowerfularchitecturedemonstratingthesimplicityofbasicACtheoriesincreatingusefulandpracticalelectroniccircuits.
Summary
ACisanextensionofDCanddiodetheories.ACcharacteristicsempowerlargenumberofmodernelectronicsystemsandcircuits.WecoveredbasicACparameters,definitions,andcomponents.Idealandnon-idealcapacitorsandinductorcharacteristicswerereviewedfollowedbysimpleLCcircuitsincludinglow-andhigh-passfilters.SeriesandparallelLRCcircuitswerethendiscussedwithseveralotherpracticalACapplications(rectifiers,transformers,diodeclamps,andsnubbercircuits).Wealsoexploredresonantfrequency,vectordiagrams,bodeplots,andswitchingandlinearregulatorstowardstheendofthechapter.OnlywithasolidfoundationinDC,diodes,andAC,canmorecomplicatedelectroniccircuitsbeunderstood,designed,tested,andanalyzed.Table3-5isasummaryofinductorandcapacitorcharacteristics.
Table3-5:Inductorandcapacitorsummaries
Quiz
1)Thesignalis5sin(2π1000t+20degrees).WhatarethesignalfrequencyandVpeak?2)ThepeakofanACvoltage(Vpeak)maybecalculatedas:VrmsXConstant.Whatistheconstantvalue?3)Theidealinductorstoresenergyin________________field.4)Theidealcapacitorstoresenergyin________________field.5)IfanACsignalisrunningata25%dutycycle,andon-timeis250ns,whatisthefrequency?6)DerivetheVouttoVintransferfunctionoftheboost-switchingregulator(seefigure3.65).Hint:Assumediodeforwardvoltagedropis1V.
Figure3.65:Boost-switchingregulator7)Designahigh-passfilterusinganinductorandresistor.Thiscircuitallowsasignaltopassthroughattheoutputstartingat10MHzassumingresistorvalueis1kΩ.
8)Ceramiccapacitorsareoftenusedinfilteringnoiseduetotheirsmallsizeandlowcost.Figure3.66showsasimpleapplicationusingaceramiccapacitortofilterouthighfrequencynoisetotheIC.Inactualimplementation,thelocationofthecapacitorneedstobeascloseaspossibletothechiptominimizeanynoisepickupalongtheboardtraces.WhatisthepurposeofthediodefromVCCtotheexternalpin?IftheVCCcontainsACnoiserunningashighas100kHz,whatisthesizeoftheceramiccapacitorinordertoreducenoisestartingatf–3dB,assumingtheoutputimpedanceoftheexternalpinis100Ω?
Figure3.66:Ceramiccapacitornoisefilter
9)Afull-waverectifierinapowersupplygeneratesarectifiedACvoltage(DC)signal.Asopposedtoahalf-waverectifierinfigure3.57,afull-waverectifierconvertsbothfirstandsecondhalvesofanACinput(secondarysideofthetransformer)totheoutput(seefigure3.67).Inthiscircuit,thedottedlinesshowthecurrentdirectionsduringthepositivehalfofthetransformeroutput.OnlyD2andD4areconducting.Accordingtothisdesign,ifVin’speakvoltageis10Vandfrequencyis100kHz,whatisthevoltagewaveformattheVout?
Figure3.67:Full-waverectifier
10)Voltagecanbeeasilydoubledbyusingswitchesandcapacitors.Figure3.68showsa
voltage-doublercircuitcalledachargepump.Whileswitches1and4areclosed,switches2and3areopen,andviceversa,chargepumpingthecapacitor.IfVinis10V,examinethecircuitanddrawthetransientresponsewaveformofVinandVout,assumingVoutconnectstoaresistiveloadandtheRCtimeconstantisnegligible.
Figure3.68:Chargepumpcircuit
11)Atankcircuitshowninfigure3.69consistsof10mHand100pFcapacitors.Whatistheresonantfrequencyofthistankcircuit?TheQfactorofaresonantcircuitcanbeusedasafigureofmerittodescribehowgoodthetankcircuitis.ThehighertheQ,thesmallerthebandwidth.ThisresultsinsharperACresponse,asshowninfigure3.70.Bandwidthismeasuredfromthepeakreactancetobothrisingandfallingat70.7%.WhatisthebandwidthofthistankcircuitifQis100?
Bandwidth=fresonant/Q
Figure3.69:LCtankcircuit
Figure3.70:HighandlowcircuitQACresponse
12)ThevectordiagramofaRCfilterisshowninfigure3.71.IfVinis25Vat500kHz,calculatethetotalimpedanceofthecircuit,andcalculatethevoltageattheoutputandphaseshift.Hint:UsethePythagoreanTheoremtocalculateZ,thenusethevoltagedividerruletocalculateVout,andtrigonometrytocalculatethephaseangle.
Figure3.71:RCcircuit
Chapter4:AnalogElectronics
WhatIsAnalog?
Let’sfirstdefineandclarifywhatananalogsignalis.Weexperienceanalogsignalsdaily.Sound,lightintensity,speed,temperature,pressure,humidity,weight,height,voltage,current,andpowerareexamplesofanalogquantities.Analogsignalsconsistofinfinitecombinationsoflevelsornumbers.Inchapter3,AC,sinewaveswerepresented.Theyareanalogwaveformshavinganinfinitenumberofcombinationsbetweentwopoints.Therearenodiscretelevelsatasinglepointoftime(seefigure4.1).
Figure4.1:Analogsignal
Ananalogsignalcanalsocomeinirregularpatterns.Figure4.2showsatemperaturepatternasafunctionoftimedepictedinatimingwaveform.Atanyparticularpointintime,thetemperaturereadingcanhaveinfinitedigitnumbersafterthedecimalpoints.
Figure4.2:Temperatureintimedomain
AnalogICMarket
Beforewediveintotheworldofanalogelectronics,let’stakealookathowbigtheanalogmarketreallyit.TheanalogICmarketsizeisaboutUS$17billionaccordingto2011marketdatafromresearchfirmDatabeans.Plentyofelectronicproductsdealwithanalogsignals.Whenyouspeakintoyoursmartphones,yourvoiceisananalogsignalthatisprocessedanddigitizedbeforebeingtransmittedthroughtheair.ThetopfiveanalogICvendorsaccountforalmost40%oftotalmarketshare.TheyareTexasInstruments,STMicroelectronics,InfineonTechnologies,AnalogDevicesandQualcomm.Lowcostsandtechnologicaladvancementinelectronicstechnologymadeelectronicsanidealchoiceforprocessinganalogsignals.Electronicstakeanalogsignalsasinput;thenthesignalsarefilteredandamplifiedbeforepassingtothenextprocessingphase.Suchaprocessiscalledsignalconditioning.Majoranalogelectronicsproductsincludestandardamplifiers,comparators,analog-to-digitalconverters(ADCs),digital-to-analogconverters(DACs),radiofrequency(RF)chips,powermanagementsystems,andmore.Manyanalogelectronicsarenowcombinedwithdigitalelectronics.Theindustryterminologyofsuchframeworkismixed-signaldesign.Thesesystemscontainamixofanaloganddigitaldesigncombinedintoonesemiconductorchip.Somereferthesechipsas“system-on-a-chip”(SOC).Productscontainingmixed-signalelectronicsareplentiful.Figure4.3showsseveralindustriesthatusemixed-signalelectronicsandthemarketandproductcategorieswithin.Ineachmarket,numerouselectronicfunctionsandapplicationsareemployed:audio,video,automotive,LEDlighting,Ethernetnetwork,wirelessnetwork,telecommunicationapplications,medicalequipment,motorcontrolapplications,renewableenergy,aerospace,military,defenseapplications,touchscreen,smartphoneapplications,industrialtesting,manufacturingequipments,andthelistgoeson.
Figure4.3:Mixed-signalelectronicsindustriesandmarkets
WhatAreTransistorsMadeOf?
Transistorsarethebuildingblocksofanalogelectronicsystems.Agreatdealofunderstandingisrequiredbeforeattemptingtounderstandmorecomplexanalogcircuits.Thetransistorwasinventedin1947atBellLabs.Ithassincegonethroughtremendousdevelopments.Today’scomputingmicroprocessorseasilyholdseveralhundredmilliontransistorsonasinglechipmeasuredin10mmX10mm.TransistorscomeindifferenttypeswitheitheradiscreteorinanICpackage.PopulartransistortypesaremanufacturedviabipolarandComplimentary-Meta-Oxide-Semiconductor(CMOS)processes(seechart4-1).BiCMOSprocesshasbeenpopularinrecentyearscombiningbothbipolarandCMOSintoonesinglemanufacturingprocess.BiCMOSprocessoffersthebestofbothbipolarandCMOStechnologiesunderminedbyitshighcost.Thematerialsusedtomanufacturetransistorsaremainlysiliconbased.Forhigh-speedapplication,germaniumandgalliumarsenideareconsideredalternatives.Therearetwotypesofbipolartransistors:NPNandPNP.CMOStransistorsarenotmadeofdiodesalthoughbothbipolarandCMOStransistorsoperatesimilarly.ForCMOStransistors(MOSFETs:MetalOxideSemiconductorFieldEffectTransistor),therearetwotypes—NFET(N-typefield-effecttransistor)andPFET(P-typefieldeffecttransistor).NFETandPFETcanalsobecalled
NMOSandPMOStransistorsrespectively.Chart4-1belowshowsalltransistorandprocesstypes.WewillfocusonNPN,PNP,andenhancementmodeNFETandPFETinthisbook.
Chart4-1:Transistortypes
NPNandPNP
Wewillfirstgooverbipolartransistors.NPNandPNPeachhavethreeterminals.Eachismadeofatriple-layersandwichofN,P,andN-typematerialsforNPN;P,N,andP-typematerialsforPNP(seefigure4.4).OnNPN,theP-typejunction(base)issandwichedbytwoN-typejunctions(collectorandemitter).ForPNP,theN-typejunction(base)issandwichedbetweentwo(emitterand
P-typejunctionscollector).Theterminalnames—collector,base,andemitterhavespecialmeanings
andarenotrandomlyassigned.Each
Figure4.4:NPNandPNPstructuresandterminalnamesterminalnamerepresentsaspecifictransistoraction.Theirmeaningswillbecomeobviousinthenextsection.
Figure4.5:TwodiodesonNPNandPNP
NPNandPNPtransistorsareeachformedbytwodiodes(seefigure4.5).ForNPN,thebase(anode)andemitter(cathode)isoneofthetwodiodes.Theseconddiodeisformedbythebase(anode)andcollector(cathode).YoucanseethatthebaseissharedbetweenthetwodiodesinNPN.BoththeNPNcollectorandemitterarehighlyconcentratedwithelectrons.Relativelyspeaking,therearemoreelectronsintheemitterthaninthecollector.Thebase,ontheotherhandhashigherholesconcentrations.PNPisalsoformedbytwodiodes.Theterminalnamesare:P(emitter),N(base),andP(collector).
Fromaperformancepointofview,NPNswitchesfasterthanPNPduetoelectronsmovingatahigherspeedthanholes.Evenwiththisperformancedifference,bothNPNandPNPareusedfrequentlytogether.
NPNandPNPSymbols
TheNPNandPNPschematicsymbolsanddiscreteNPNandPNPtransistorsareshowninfigure4.6.
Figure4.6:NPNandPNPschematicsymbols(top);discreteNPNs(bottomleft,createdbyFritzingsoftware);andPNPinplasticpackage,2.2mminlength(bottomright)TheNPNschematicsymbolhastwodiodes(seefigure4.7),base-collectorandbase-emitterdiodes.Thebase-emitterdiodeisapartoftheNPNsymbolandlooksalikean
arrow.Figure4.7NPNdiodesinschematicsymbol
TransistorCross-Section
AconceptualNPNdeviceandarealisticSiliconGermanium(SiGe)transistorcrosssectionsareshowninfigure4.8.Transistorregionsarecreatedonelayeratatimestartingfromthebottom,involvinghundredsofstepsbycomplexsemiconductormanufacturingequipment.Manyofthesestepsutilizechemicalsingasorliquidform.Ionimplantationanddiffusionprocessesaremajorprocessstepsincreatingjunctions,alsocalleddiffusions.Intheconceptualview(figure4.8),thesubstrateisanareafilled(doped)withpositiveions(holes)bychemicalreactionswiththesiliconwaferusedasthedevice-supportingstructure.TheNpocket(junctionordiffusion)isdopedwithelectronssupportingthecollector.Baseandemitterjunctionsarebuiltontopofthecollector.Thedimensionsandthicknessofthejunctionvaryfromoneprocesstoanother.Nonetheless,theyaremeasuredintheorderofmicrometer(um).Becausegermaniumrequireslessenergythansilicontoexciteelectronsfromoneenergybandtothenext,transistorsmadebygermaniumarefaster,consumelesspower,andgeneratelesselectricalnoise.Itsdisadvantageislowerreliabilitycomparedtosilicon,especiallyinhighertemperaturesandthehighcostofmanufacturing.However,bycombiningbothsiliconandgermaniuminoneprocess,wecanleveragethelowcostsiliconmanufacturingcapabilitywhilegainingtheperformancebenefitsofgermanium.In1989,IBMMicroelectronicsfirstintroducedamainstream,highvolumeSiGeICprocess.Sincethen,IBMhaspioneeredSiGewithothermajorsemiconductorcompaniesfollowingsuitwiththeirproprietarySiGeprocesses.ThelatestdevelopmentofSiGehasdemonstratedthatCPUssuccessfullyoperateatmorethan100GHzclockspeed(conventionaldesktopcomputers’CPUclockspeedsarelessthan10GHz).Thisisidealforwirelessandhigh-speedapplications.Onthesilicongermaniumcross-sectiondiagrambelow,thebaseemitterregionisthecriticalareadefiningtransistorperformanceintermsofswitchingspeed,noise,andpowerconsumptions.IntheSiGeprocess,germaniumisdopedinthebaseregion,improvingoperatingfrequency,reducingnoise,andincreasingpowercapabilities.
Figure4.8:NPN,SiGetransistorsideview,crosssections(CourtesyofDr.SteveVoldman)
BipolarTransistorTerminalImpedance
Beforewegointotransistorcircuitdesign,let’sgetfamiliarwithdevicecharacteristics.First,wewilltakealookatbipolartransistorimpedances.Table4-1belowshowsthebasehasthehighestimpedance,andthenthecollector,followedbytheemitter.Base’shighimpedanceisduetonarrowbasewidthandlowcarrierconcentration.Emitter’shighdopinglevelcontributestolowimpedance,andcollector’simpedanceismoderatelyhigherthanemitter’sbutlessthanthatofthebase.Realworldcircuitswillbediscussedlatertoechobacktothisimpedanceconcept.
Table4-1:Base,collector,andemitterImpedances
IC,IB,IE,andBeta(β)
Let’snowuseasimplecircuitinfigure4.9toexaminehowatransistorfunctions.TheNPNbaseconnectstoavariableDCinputvoltage.Theoutputisatthecollectorthatconnectstoaresistor.ThetopendofresistortiestoaDCvoltagesource.Theemitterisgrounded.Inthisexample,DCinputvoltagesweepsfrom0Vto5V.Assumethebase-emitterdiodethreshold(minimumvoltagerequiredtoforward-biasthebaseemitterdiode)is1V.At0V,it’sreversebiased.Considerthetransistorasaswitch.Atthisinputvoltagelevel,theswitchisinactive(off,open).Nocurrentflowsthroughthetransistor.Astheinputvoltagecontinuestosweephighertoapointwhereitreachesthe1Vthreshold,itstartstoconductformingthebasecurrent(Ib).Anicefeatureofthetransistoristhatthereisamuchbiggercurrent(IC)nowstartingtoflowthroughthecollectordowntotheemitter(IE).Thisiswhytransistorsareactivedevices.Currentand/orvoltagearelargerattheoutputwithgain.So,howcouldasmallIbgenerateabiggerICandIE?
Figure4.9:Simpletransistorcircuit
ThegraphicalrepresentationoftheNPNcircuitoperationexplainsthereason(seefigure4.10).Thebasejunctionisfilledwithpositiveions(holes).Thebasesize(width)isrelativelysmallerthanthecollectorandemitter.Onlysmallnumbersofelectronscan“emit”fromtheemittertowardsthebaseformingasmallbasecurrent(Ib).Themajorityofelectronsaresweptacrossthebasejunction,“collected”bythecollectoraslongasthecollectoristiedtoapositiveterminal(apositive5Vattractselectrons).Recallfromchapter1,DC,thatelectronsandcurrentflowinreversedirections.Thiscollectorcurrent(IC)combineswiththebasecurrent(Ib)flowingdownwardstoformemitterthecurrent(IE).Toturnonthetransistor,base-emittervoltage(VBE)needstobeatleastequaltoorlargerthanthediodethreshold(VBE≥forward-biasthreshold).Thesecondconditionisthatthecollectorhastobemorepositiverelativetothebase.Thecurrenttransferfunction:
Figure4.10:NPNoperations
IE=IC+Ib
Beta(β)isusedtospecifycurrentgain:
Manyacademictextbooksclaimthatthebasecurrentiszeroforsimplicityreason.Thisisafalseassumption.Intherealworld,Ibisnon-zeroanditcouldadverselyaffectcircuitperformance.TypicallyBeta(β)isaround100to200.IfIb=1uA,beta=100:
Betaintherealworlddoesn’tstayconstantandchangeovertemperature.Thisimperfectcharacteristiccouldbecomeamajordesignchallenge.Manydesigntasksaretocompensateforthesechanges,keepingthecircuitrunninginstableconditionsoverwidetemperaturerange.WeuseAlpha(α)tospecifytheICtoIE(IC/IE)ratio.Foranon-idealtransistor,whereIbisnon-zero,αisalwayslessthan1.
VBE
Asinputvoltage(VBE)continuestogoup,thiscausesICandIEtoincreaseaswell.TheVBEtransferfunctionis:
VT=Thermalvoltage(KT/Q),KistheBoltzmann’sconstant,andTistemperature.Thelnsymbolisthenaturallogmathfunction,IS=Saturationcurrent,andIC=collectorcurrent.A=TransistorArea,measuredinwidthandlength.
WithinVT,Kisaconstantthatisfixedforaspecifictransistormanufacturingprocess.TisabsolutetemperaturemeasuredinKelvin(K).Qiselectroncharge(1.6X10-19C).VTisapproximately26mVatroomtemperature(27°C).Saturationcurrent(IS)isacomplexfunctionthatisinverselyproportionaltotemperature.Recallfromchapter2,Diode,thatthetemperaturecoefficientofadiodeisnegative.TheVBEequationisareflectionofthat.DespitethefactthatVTgoesupwithtemperature,withstrongtemperaturedependenceofISinthedenominator,VBEactuallydecreaseswithtemperature.ApplyingVBEfunction,ICincreaseswithVBEexponentiallyasfollows:
IC=AXISXe(VBE/VT)IE=IC+IB
Uptothispoint,theVBEdiodeisfullyon.Thetransistorisoperatingintheactiveregion.Ontheotherhand,thebasecollectordiodeiskeptintentionallyoff.Youwillseeinthenextsectionthatitiscriticaltokeepthisdiodeoffforoptimaltransistoroperation.Furthermore,youwillseeinthenextsectionthatICwilleventuallystopincreasingevenwithincreasingVBE.PNP,incontrast,worksinanoppositemannerinasensethatthe
currentflowsfromemittertobaseandcollector.Figure4.11showstheNPPandPNPcurrentdirectionsusingschematicsymbols.Knowinghowtoconnecttheterminalstoappropriatevoltagelevelsorbiasthetransistorstherightwaygivesyougreatcontroloveratransistor’soperations.
Figure4.11:NPNandPNPcurrentflowdirections
ICversusVCECurve
ThefollowingICversusVCEcurvesinfigure4.12revealsmoreinformationabouttransistor.Thesecurvesaregreattoolstoexaminetransistoroperations.
Figure4.12:ICvs.VCEThegraphshowscollectorcurrent(IC)ontheY-axis,voltageacrossthecollector,andtheemitter(VCE)ontheX-axis.Theemitterisconnectedtoground(0V),thus,
VCE=VC–VE=VC–0V=VC
Thisgraphshows5ICvs.VCEcurves.Eachcurve’sVBEisdifferent.VBE1>VBE2>VB3…etc.Asmentionedinprevioussection,asVBEincreases,ICincreasesaccordingly,asshownbytheverticaluparrowsontheleftoffigure4.12.Thedottedlineintercepts(cross)eachcurvetoformaloadline.ForeachVBEincrease,(e.g.,VBE1),theloadlineintersectstheICcurveandextrapolatesdowntoVCE1.IncreaseVBE1toVBE2,andtheloadlineintersectswiththeICcurveleadingtoVCE2.ThisprocesscontinuesasVBEsincrease.Theloadlineshowsthatasinputvoltage(VBE)increases,ICincreasesandVCEdecreases,showninthehorizontalarrowrightbelowtheX-axis.FromVCE1toVCE4,thetransistorcurrentisconstantateachVBE.Inotherwords,theIChaslittleeffectondecreasingVCE.Thisisexplainedbyadevicephysiceffectcalledemittercurrentcrowding.Thiseffectreducesbase-emitterareareducingthecurrentgainsignificantly.ThisiswhytheICstartstobenddownathigherVCE.FromVCE1to4,thetransistorissaidtoberunninginthenormaloperatingregion(almostconstantcurrent).NoticedImentioned“almost”constant.Withinthisregion,thecollectorcurrentactuallygoesupslightlywithincreasingVCEinsteadofremainingabsolutelyconstant.TheEarlyeffectexplainsthisphenomenon.TheEarlyeffectwasdiscoveredbyMr.JamesEarlyin1952.ThiseffectstatesthatbasewidthismodulatedastheVCEchangesintheoperatingregion.
AstheVCEcontinuestorise,theeffectivebasewidthgetsreducedfurtherduetothespreadingofdepletionregionintothebase,increasingcurrentgainslightlyandthereforetheuptickinIC(∆IC)(seefigure4.13).VBEcontinuestoincreasetoVBE5andVCEgoesdownfurthertoVCE5.Atthispoint,theICstartstofall.ContinuedVCEreductionleadstomoreICdecreases.Thisregioniscalledsaturation.ThesmallregionwhereICjuststartedtofall(bend)iscalledthe“knee”region.Itdefinesthepointwherethetransistorstartsgoingintosaturation.Duringsaturation,thecurrentischanging,modulatingwithchangingVCE.Thiscollectorcurrentchangecouldcauseunstablesystemoperationifaconstantcurrentisexpected.IfVCEgoesdownevenmore,ICwouldeventuallyreachzerocurrentandthetransistorisnowincut-offregion(ZeroIC).Ideally,youwouldwanttooperatethetransistorinthenormaloperatingregionwheretheICisrelativelyconstant.Inadditiontoastablecollectorcurrent,thenormaloperatingregionoffersthehighestvoltageoutputswing.ThisistheoptimaloperatingregionoftenreferencedasthetransistorQpoint.
Figure4.13:Earlyeffect
CommonEmitterAmplifier
Let’sapplyindividualtransistorunderstandingintoasimplecircuit:anamplifier.Anamplifierbydefinitionprovidesvoltage,current,and/orpowergain.Amplifiersareregularlyusedtoamplifyinputsignalsandproducealargeroutputsignal.Thecircuitinfigure4.9iscategorizedasasingle-endedamplifier.Thereisonesingleinputandoutput.Thisisacommonemitteramplifier,whichmeanstheemitteriscommon(DC)toafixedpotentialwheretheoutputislocatedatthecollector.Therearemanywaystobuildamplifiersusingtransistors.Wewilllookatseveralinthissection.Reusingthecircuitbackinfigure4.9,werevisedittoreplacetheinputwithasinusoidalsourceshowninfigure4.14.WhenViniszero,NPNstaysoff(ZeroVBE).NoIB,IC,andIEarezeros.Thereisnovoltagedropacrosstheresistor.Voutis5VaccordingtoOhm’slaw:
Topendofresistor=5V,I=0,voltageacrossresistor=IXR=0XR=0V5V–(Voltageatresistorbottomend)=0V(Voltageatresistorbottomend)=5V–0V=5V
Figure4.14:RevisedNPNcircuit
AsVinrisesabovethediodeforward-biasedthresholdinfigure4.15,IB,IC,andIEstarttoflow.SupposeIC=1mAat1Vinput.TransistorBeta=100(thesenumbersaredevicespecific),R=1kΩ,VC=4V,Ib=10uA,andIE=1.01mA
Figure4.15:NPN“on”
RepeatingthestepsshowsthatincreasingVinleadstodecreasingVCandviceversa.ThisagreeswiththeICvs.VCEgraphsinfigure4.12,revisedinfigure4.16.Vinwave,andtheVoutisasinusoidal
willhavethewaveformasshowninfigure4.17.YoucanseethatVinandVoutare180degreesoutofphasewhereVoutislargerthanVin.Thiscircuitoffersaninverterfunctionmeaningwheninputislow,outputishighandviceversa.Moreimportantly,it’sanamplifierthatprovidesvoltagegain(hfe).Bydefinition,hfe:
Figure4.16:ICvs.VCErevised
Voltagegain(hfe)isunit-lessbecausethisisadivision.Anamplifier,bydefinition,istocreatealargeroutputsignalfromalowerone.Thelargeroutputsignalcanbeintheformofvoltage,current,and/orpower.
Figure4.17:SinusoidalVin
Allcircuitsdiscussedsofarhaveground(0V)beingthelowestcircuitpotential.Manyamplifiersweredesignedtoacceptnegativevoltageonthebottomsupply(rail).Forpersonalsafetyandtominimizethechanceofdamagingtheparts,dopaycloseattentionstomaximumpositiveandnegativevoltagesthedevicecouldwithstandfromthedatasheets.Infact,allcomponentsinthecircuitscanbeusedinconjunctionwithdiodes,inductors,andcapacitorsforan
unlimitednumberofcircuits.Itdependsontheapplication’srequirementswhenmakingapart-selectiondecision.
CommonCollectorAmplifier(EmitterFollower)
Thesecondamplifiertopologyisthecommoncollectoramplifier.Itsoutputisattheemitter.Inputremainsatthebase,andthecollectorconnectstothepositiverail.Figure4.18showstwoemitterfollowers(NPNandPNP).
Figure4.18:Commoncollectoramplifier(Emitterfollower)
NPNandPNPcommoncollectoramplifiersworkstheoppositeway.ForPNP,thedevicewasflippedupsidedown(emittertorail,collectortoground).InbothNPNandPNP,anemitterresistor(RE)isaddedinthecircuit.Thecollectorresistorneedsnotbethereaslongasit’sconnectedtoapositivesource.Alternatively,thiscircuitisnamedemitterfollowerbecausetheemitteroutput(VE)“follows”thebaseinput(VB).Theemitterfollower’svoltagegainisone.Toprovethat,assumea0.7VVBEthreshold,andVinswingsfrom1Vto2V.Thisleavestheoutputswingingfrom0.7Vto1.3V(0.7VdropacrossVBE).Voltagegain(hfe):
hfe=(1.3V–0.3V)/(2V–1V)=1Becausevoltagegainhasnounit,todescribeitinsomeformofmeasuredunit,dBisused:
indB=20log(1)=0dB
Onphaseshift,theoutputfollowstheinput.Bothareinphase.Figure4.19showsthephaserelationshipbetweenVout,Vin,andthe0dBgain.Theemitterfollower’sgainin
realityisslightlylessthan1,whichwillbediscussedinthenextsection.Ifyouquestionwhyusetheemitterfollowerifthe∆Vout=∆Vin,voltagegainsometimesmaynotbeyourprimarygoal.First,theemitterfollowerhascurrentgainfrombeta.Secondly,thestrongappealofthehighinput,lowoutputimpedancesmakesthecommoncollector(emitterfollower)anidealchoiceasabuffer(moreonbufferinchapter4,AnalogElectronics).Thefollowingmodelinfigure4.20illustratesthisbufferideawithamulti-stagedamplifierdesign.
Figure4.19:Vinvs.Voutphase
Figure4.20:Multi-stagedamplifierblockdiagram
Startingfromtheleft,Vinhasfiniteimpedance,andRVinconnectstoaStage1amplifier
thatpresentsfiniteinputimpedance,Rin.Fromchapter1,DC,weknowthatthisformsavoltagedividerdenotedbythedottedrectangle.ToachievetheclosestvoltagepossibleatStage1inputfromVin,RVinideallywouldbezerowhileRinwouldbeinfinite.Thesesituations,however,arenotpracticalintherealworld(RVin>0,Rin<infinite).Instead,wechoosetherightamplifiertopologytogiveusthehighestpossibleimpedance(highestoutputvoltagelevel)aspossible.AtStage1output,weneedto“condition”theoutputtohavethelowestpossibleoutputimpedance.ItfacesthesameissuewheretheoutputtiestoStage2’sinputformingavoltagedivider.Finally,Stage2outputconnectstoaload.EnsureStage2Rout’slowimpedanceiscriticalespeciallywhenLoadRinmaynotbeeasilychangedduetosystemrequirements.Usinganemitterfollower(highinput,lowoutputimpedance)isagoodchoiceforStage2todrivetheload.
CommonBaseAmplifier
Thelastpopularsingle-endedamplifieristhecommonbaseamplifier.Figure4.21showsanNPN-basedcommonbaseamplifier.Itsinputisattheemitter,itsoutputatthecollector,whilebasetiestothefixedvoltagesource(commonDC).Thecommonbaseamplifierprovideshighgainwithoutanyphaseshift(seefigure4.21).
Figure4.21:Commonbaseamplifier
Single-EndedAmplifierTopologiesSummary
Table4-2belowsummaries3singled-endedamplifiertopologies.
Table4-2:Amplifiers’inputandoutputconfigurations
Tranconductance(Gm),Small-SignalModels
Youmaywonderhowyoucanpreciselyfigureoutthespecificgainoftheamplifiers.Utilizingasmall-signalmodelfacilitatestransistorcircuitsusingidealimpedances,andvoltagegain.Inordertouseasmall-signalmodel,transconductance(Gm)isintroduced:thisprocessforus.Small-signalmodelsaresimplifiedvoltage,currentsourcestodetermineinput,output
Gmisequaltotheoutputcurrentchangedividedbyinputvoltagechange.MultiplyingGmbyVingivesrisetooutputcurrent,GmXV.Recallthatatransistorisanactivedevice
thatproducesalargecurrentifcertainrequirementsaremet.GmXVisusedtomodelatransistorasacurrentsource.Let’snowapplytheseconceptsbacktoacommonemitteramplifiertoderivevoltagegain.First,weneedtotransformtheoriginalcircuitintoasmallsignalmodelcircuitusingtheGmandsuperpositiontheorem.Figure4.22isasmall-signalmodelofacommonemitteramplifier(hybrid-π)model.
Figure4.22:Commonemitteramplifiersmall-signalmodel
CommonEmitterAmplifierInputImpedance
Onthepreviouspage,theoriginalcommonemitteramplifierisonthefarleft.Afterthetransformation,rπconnectstotheVin.rπisintrinsic(natural)baseresistance.ItisdefinedasthechangeofVBEoverthechangeofbasecurrent(Ib):
SubstitutingIbtorπequationfromaboveyields:
∆VBE=Vin,
rπintermsofβ,Gm:
rπrepresentstheinputimpedanceofthiscircuit.Forexample,abipolartransistorbetais200atroomtemperature(r.m.t.).Fora1VVBEchange,outputcurrent,ICchangesby1mA:
Onceagain,Gminthiscircuitis:
BymultiplyingGmbyVBE,it’sleftwithoutputcurrentICrepresentedbythecurrentsource.
GmX∆VBE=GmX∆Vin=∆IC=Outputcurrent
Thepositivevoltagesourcetiestocollectorresistor(RC),andisconvertedtoashortcircuitshownonthefarright.Thevoltagegainofthefinalsmall-signalmodelcircuitiscalculatedas:
ThenegativevoltagegainsignisbecauseV+wasconvertedtogroundwhilecurrentcontinuestoflowfromgroundtowardsRC.ThevoltagedropacrossRCwouldhavetobebelowgroundby(–(GmX∆Vin)XRC).Thisnegativesignagreeswithpreviousassessmentthatthecommonemitteramplifier’sinputandoutputareoutofphase,i.e.,wheninputis“+”outputis“–”.IfRC=100kΩ,∆IC=1mA,∆VBE=1V:
hfe=–GmXRC=–1mX100kΩ=–100
CommonEmitterAmplifierOutputImpedance
Asforoutputimpedance,itisequallyimportantfromacircuitperformancestandpoint.Thecommonemitteramplifier’soutputatthecollectorusuallyconnectstoaload.InACanalysis(sinusoidalinput),thisloadpresentsfiniteresistiveandcapacitivereactanceseeninparallelwiththecollectorresistor(seefigure4.23).InACsmall-signalanalysis,theDCvoltagesourceisreplacedbyashorttoground.ThustheeffectiveoutputimpedanceistheparallelofRC,RLoad,andCload(seefigure4.24a).
Figure4.23:CommonemitterwithRLoad,CLoadatcollectoroutput
Figure4.24a:Commonemitteroutputimpedance
RCistypicallymuchlargerthanRLoad.Consequently,theoutputimpedanceisroughlyequaltoRLoadaccordingtoparallelresistorrulesinchapter1,DC.Theresultofthissmall-signalmodelconcludesthatthevoltagegainiscontrolledlargelybytheGmandRCsizes.ThehigherGmandRC,thehigherthevoltagegainwouldbewithoutanyphaseshift.Useofsmall-signalmodelappliestoanytransistorcircuittypesincludingthetwopreviouslydiscussedsingle-endedamplifiers.ThereareothertransistormodelssuchasGummel-PoonandEbers-Mollmodelsdescribingtransistorcircuitbehaviors.Regardlessofthemodelsyouchoose,alwaysfollowACanalysisrulesandbasicelectronicprinciples.Intheoriginalcommonemittersmall-signalmodel,therewasasmallre(internalemitterresistance)thatwasexcludedinthemodel.Thereistheintrinsicresistanceintheemitter.Therevalueisafunctionofemittercurrentanddopinglevel.Someuse25Ω(1mA/IC)tomodelreresistance.Therevisedmodelisshowninfigure4.24b.
Figure4.24b:Revisedcommonemittersmall-signalmodelThevoltagegainalsoneedstoberevisedfromthesmallreasfollows:
Fromtheabove,youcanseethatthevoltagegainisreducedbythereinthedenominator.Thevoltagegainisfurtherreducedifanexternalresistorisconnectedattheemitterterminal.Youmaywonderwhyanyonewouldwanttodesignanamplifierwithlowergain.Thereasonistokeeptheamplifierstable.whichiscalledemitterde-generation,itoscillations.Thedetailsoftheemitterde-generationrelatetocircuitdesigntechniquesandbeyondthescopeofthisbook.Thereadersshouldhowever,atleasttakenoteoftheir
existence.
Byaddinganexternalresistorattheemitter,helpspreventtheamplifierfromgoinginto
CommonCollectorAmplifierSmall-SignalModel
TheACsmall-signalmodelofthecommoncollectoramplifier(emitterfollower)isshowninfigure4.25.Justlikeacommonemitteramplifier,rπistheinputimpedance.Thepositivevoltagesourceisconvertedtoashortcircuitshowninfigure4.25.Onceagain,Gminthiscircuitis:
BymultiplyingGmbyVBE,it’sequaltocurrentsource:GmX∆VBE=GmX∆Vin=∆IC=OutputcurrentVinisthevoltageacrossrπ(VBE)plusvoltageacrossRE(VE):
Figure4.25:EmitterfollowersmallsignalmodelVin=VBE+VEVE=(Ib+IC)(RE),IC=(GmXVin):Vin=VBE+(Ib+(GmXVin))(RE)VBE=(Ib)(rπ):Vin=(Ib)(rπ)+(Ib+(GmXVin))(RE)IE=Ib+IC=Ib+(GmXVin):VE=Vout=IE(RE):
Vout=VE=Ib+(GmXVin)(RE)
Thevoltagegainofthefinalsmall-signalmodelcircuitiscalculatedas:
Thevoltagegaincameinslightlylessthan1withoutanyphaseshift(theoutputfollowstheinput).
CommonBaseAmplifierSmall-SignalModel
Figure4.26:
Commonbaseamplifiersmall
Asforthecommonbaseamplifier,thesamesmall-signalmodeltechniquecanbeappliedtofigureoutvoltagegain,input,andoutputimpedances.Figure4.26showsthesmallsignalmodelofacommonbaseamplifier.TheDCsourceatthebasehasbeenreplacedbyashortcircuittoground.Thesmallreistheintrinsicimpedanceoftheemitter.Thetransistorisnowrepresentedbytheoutputcurrentsource,GmXVBE.VoutremainsatthecollectorwitheffectiveoutputimpedanceequaltoRLoadinparallelwithRCandCLoad.Tocalculategain,weneedtoderiveVoutand
Vin.signalmodel
IOUT=GmXVBE:
Thecurrentgoingthroughrecamefromthebase;reistheeffectiveinputimpedance.Vin=IBXre=VBE,
Noticethegainispositive,i.e.,thereisn’tanyphaseshiftfromtheinputtotheoutput.Thisagreeswithpreviousassessment.Thedrawbackofthecommonbaseamplifieristhattheinputimpedancereisquitelow.Besurethatthevoltagesourcedrivingtheemitterinputishighimpedanceorelsetheinputlevelattheemitterwillbedegraded.TheoutputimpedanceislargelydependentontheRLoadjustlikethecommonemitteramplifier.Fromadesignperspective,asmall-signalmodelisanicetooltocheckifthecircuitmakessensefirstbeforetheactualdesign.
Single-EndedAmplifierSummary
Table4-3belowsumsupthesingle-endedamplifiers’characteristics.Sometextbooksassignthesecommonlyusedamplifiersinclasses.ThecommonemitteramplifierisconsideredaclassAamplifier.Itdefinestheamplifierisonduringtheentireinputperiod,supplyingoutputwithanactivesignal100%ofthetime,though180degreesoutofphase.ClassAamplifiersareinherentlypowerinefficientduetothefactthatthetransistorsareneverturnedoff.Increasingpowerlossresultsinlowpowerefficiency.
Anemitterfollower(commoncollector)isconsideredaclassBamplifier,whichmeanstheoutputisactiveonly50%ofthetime.Ifacommoncollectoramplifierisemitter-ground,whentheinputgoesbelowgroundduringhalfoftheperiod,thetransistorissaidtobeoffresultinginarectifiedhalf-waveoutput.ClassBamplifierismoreefficient(only50%oftimeon).Ithoweverlackstheabilitytodrivetheloadat100%dutycycle.ClassABisanotheramplifiertypethatcombinesthebestofbothclassAandB.ClassABconductsbetween50to100%ofthetime.AcommonclassABexampleisapush-pulltopologyusingcombinationsofNPNandPNPtransistors.Thistopology,thoughitincreasesefficiencyandloaddrivingcapability,comesattheexpenseofcircuitcomplexity.
Table4-3:Single-endedamplifierscharacteristics
NMOSandPMOS
Similartobipolartransistors,CMOStransistors(MOSFETs)are3-terminaldeviceswithcomplimentaryN-andP-types.SomerefertotheN-typedeviceasNMOS(NFET)andthePtypedeviceasPMOS(PFET).TheMOSFETs’structuresarefundamentallydifferentthanthebipolaronesdespitesharingsimilarcircuitbehavior.BothNMOSandPMOSaremadeofNandP-junctionsandpoly-silicongatecombinationthroughchipmanufacturingprocess.Byshrinkingtransistorsizesandwiththeconceptofmassproduction,manufacturingthroughputcouldincreasesubstantially.Figure4.27showsthetop-levelviewofasiliconwafercontainingchips“printed”onthem.Thethicknessofthewaferisintheorderof100umto200um.Asinglechipiscalleda“die.”Themoreadvancedprocessontherighthousesmorechipsthantheolderoneontheleft.Thisincreasesthetotalproductionnumberforthesameprocesstimeamountandsiliconspace.Inadditiontoscalingdowndevicesizes,waferdiameterhadincreasedfrom6-inches(150mm)to12-inches(300mm)to18-inches(400mm)injusttwodecades.Withrisingcomputingpowerdemand,manyelectroniccircuitsareintegratedontoasinglechip,noticeablyinportabledevices,likesmartphoneswherelongerbatterylifeisrequired.Runningthesedevicesatlowervoltageshelpincreasebatterylife.Since1997,CMOSvoltagesupplyhadsincescaledupfrom5Vto3.3Vto2.5Vto1.8Vto0.9Vinrecentyears.It’sonlyfeasibletorunelectroniccircuitsatlowervoltagesifthetransistorsaresmaller,orelsehighervoltageswillbreakdownsmaller-sizedtransistors.ThetrendofmakingtransistorssmallercloselyechoesMoore’sLaw.Itstatesthattransistorsizewillshrinkandnumberswillincreasetwofoldeveryyear.ChipcompanieslikeIntel,AdvancedMicroDevice(AMD),IBMMicroelectronics,andotherswithmanufacturingcapabilitiestendtodeveloptheirownproprietaryprocessestogainandmaintainacompetitiveedge.Thehighcostofbuildingchipmanufacturingplantsandoffabrication(fab),ofteninbillionsofdollars,posehugecapitalexpensestothesecompanies.Forothersthatdon’thavesuchfinancial
strength,contractmanufacturingfacilitiesareavailable.Therearecompanies(foundries)worldwide.Thetop4ICManufacturingCompany(TSMC),UnitedMicroelectronicsCorporations(UMC),GlobalFoundries,andSamsungSemiconductor.In2011theybroughtin,combined,overUS$20billioninrevenue.Thefoundrybusinessmodelhasmade“fabless”designcompaniesameanstomanufacturechipswithoutbuildingafab.ThesechipmanufacturingcapabilitiesnotonlyapplytoCMOS,butalsotobipolarandanyotherdiscretedevices.
Figure4.27:Topviewsiliconwafer
overtwentycontractfoundriesareTaiwanmanufacturingSemiconductor
3DNFET
ANMOS3-dimentionalcrosssectionmodelisshowninfigure4.28.
Figure4.28:ANMOS3-dimentionalcrosssectionmodel
Theheightofthis3Dmodelislessthan20umthick.TheCMOSgateismadeofpolysilicondopedpositively.Beneaththegateisanoxidelayermadeofsilicondioxide(SiO2),whichisusedasaninsulator.TheoxidelayerthicknessandqualitydeterminetheperformanceoftheMOSFET.AdvancedCMOSprocessstrivesformakingtheoxidelayerasthinaspossiblewhilemaintaininghighqualityforsize-shrinking,lowervoltagedomain,andincreasingspeedreasons.Theoxideinthediagramwasdrawnoutofproportionjusttoshowthatinreality,theoxidelayerismuchthinner.Oxidethicknessfoundinstate-of-the-artCMOSprocessescanbeasthinas50angstroms(1angstrom=1X10-10meter).Theadvancedprocess’sgatelengthcanbeaslowas30nmandbelow.ThelatestfinFETtechnology(stillbeingdevelopedatthetimeofpublication)pushesdevicegeometrydownto10nmgatelength.Circuitdesignersdonothavecontroloverthisparameterduetothefactthatit’sfixedbythemanufacturingprocess.ThetwoN-junctions,calledsourceanddrain,arelocatedabovetheP-substrateregion.Thedopinglevelsofthesejunctionsareentirelydictatedbytheprocess.Theonlyparametersthatcircuitdesignerscouldvaryforadjustingcircuitperformancesarethetransistor’swidthandlength.Thedraincurrent(Id)transferfunctionismodeledasbelow:
u:effectivemobility,Cox:gate-oxidecapacitanceperunitarea.W,L:CMOStransistor’swidthandlength:VGS=(Voltageacrossgateandsource)=VG–VS
DrainCurrentandThresholdVoltage
Similartothebase-emitterdiodeforward-biasedvoltageinbipolar,VTisthethresholdvoltage.Thisparameterisaconstantforaspecificprocessalthoughitvariesstronglywithtemperature.Infact,VTbehavessimilartoVBEwhereVTgoesdownwithincreasingtemperature(negativetemperaturecoefficient).VTscalesdownalongwithshrinkingdevicesizefromoneprocessgenerationtothenext.VT,foundinmanyadvancedCMOSprocesses,isabout0.9V.Forexample,tothecalculatedraincurrentofanNFETina2um(gatelength)process,itsuCoxisroughly100um.IfW=5um,lengthremainsatminimum2um,VGS=2,VT=0.9V:
NFETandPFETSymbols
NFETandPFETschematicsymbols(seefigure4.29a)havearrowstorepresentthecurrentflowdirections.Similartobipolartransistors,MOSFETsarethree-terminaldevices.Gate,drain,andsourcecorrespondtoabipolartransistor’sbase,collector,andemitter.
Figure4.29a:NFET,PFETschematicmodelsThereareotheralternativestoMOSFET’ssymbols.Figure4.29bshowsanexample.Inthisbook,wewillusethesymbolsinfigure4.29a.
Figure4.29b:AlternativeMOSFETsymbols
ThereisactuallyafourthterminalinMOSFET,calledasubstrateterminalasindicatedinfigure4.30.Thisterminalcontactsthetransistorsubstrate.IfitconnectstothesourceofNMOS,itformsadiodecalledthe“bodydiode.”Therearedesigntrade-offswhendecidingwhetherornottoconnectthesubstrateterminaltothesource.Onediodeapplicationisacatchdiodementionedinthebuckregulatorcircuitinchapter3,AC.
Figure4.30:Bodydiode
Fromatopviewoftheactualdeviceprintedonsilicon,theCMOStransistorwouldlooksimilartofigure4.31.TheseshapeswereprintedthroughhundredsofICmanufacturingstepsinvolvingtheuseofnumerouschemicalsandexpensiveequipment.Althoughthedetailsofthesestepsarebeyondthescopeofthisbook,youshouldatleastrecognizethattransistorsareproducedbyhighlyefficient,large-scale,complexmanufacturingprocesses.
Figure4.31:CMOStransistortopview
ICLayout
Theactualdevice’sshapes“printed”onthesemiconductorchiparethedevicelayout.Figure4.32showsthetopviewofasiliconchiplayoutcomprisingtransistorsandresistorscreatedbyICschematiccapturesoftware(top).AnInteli7coresiliconchip(About215mm2)seenunderamicroscope(bottom)containsoveronebilliontransistors.
Figure4.32:IClayoutinsoftware(Top),IntelI7coresiliconchip(Bottom)CourtesyofDr.BruceWooleyandTallisBlalack(StanfordUniversity)
VHDLandVerilog
Forhigh-densitydesignlikeApplicationSpecificIntegratedCircuit(ASIC),FieldProgrammableGateArray(FPGA),andCPUs,itisimpossibletoplacemillionsoftransistorsmanuallyonebyoneduringthedesignprocess.Instead,digitaldesignersuseprogrammingtechniquestowriteprograms(scripts)torepresentdigitalfunctionsas
behavioralmodels.ThescriptsarecalledVeryHighLevelDescriptiveLanguage(VHDL).OnepopularscriptinglanguageisVerilog.Belowisascriptexamplefora2-inputANDgate.ThislogicANDgate(furtherdiscussedinchapter5,DigitalElectronics)consistsofAandBinputsandFoutput.moduleAND2gate(A,B,F);
inputA;inputB;outputF;regF;always@(AorB)beginF<=A&B;end
endmodule
TheVerilogscriptswouldbeprocessedbysophisticatedsoftwarealgorithmintheformofsimulationsandverifications.Digitaldesignerswouldusetimingwaveformtoolsthatarebuiltinthesoftwaretoverifyfunctionalitiesperformingtiminganalysisofthedesign.Upondigitaldesigncompletion,thefinalstepsaresynthesisusingacomputer-aideddesign(CAD)tool,whichgeneratesfinalschematicsandphysicallayoutautomaticallyviaautomatic-synthesisfunction.Thesechip-designmethodologiesareverycomplex.Thereareonlyahandfulofcompaniessupplyingsoftwareinthisarea.CadenceDesignSystems,MentorGraphicsandSynopsisaremarketleadersinthisfield.Oncethecircuitswereconstructedintheschematiccapturesoftwareusingschematicsymbols,suchdesignwouldneedtobeconvertedtolayoutusinglayoutsoftware.High-densitydesignincorporatesautomaticlayoutgenerations.Theverificationprocess,LayoutversusSchematic(LVS),checksifbothschematicandlayoutmatchornot.Layoutdesignerswillcorrectanydiscrepanciesiffound,betweenschematicandlayout.DesignRuleChecking(DRC)isanotherverificationtool.DRCchecksifthephysicallayoutmeetsthedesignrulessetbythemanufacturingprocesses.Adesignruleexampleistheminimumgatelength.Ifthegateinthelayoutisdrawnshorterthantheminimumgatelengthspecifiedbythemanufacturingprocess,theDRCwillflagindicatingaDRCfail.Thelayoutdesignerscanthencorrecttheerrorsaccordingly.OnceLVSandDRCarecomplete,thelayoutwillbesentelectronicallytomanufacturing.Thisprocesshistoricallyiscalledtapeout.ThetimeittakestomanufactureICsdiffersbycompanies.Generallyspeaking,ittakesseveralweekstocompletetheentireprocess.ICsprintedonthesiliconwafersareprocessedinbatches.Theyoftenarecountedinlots(boxes),inwhicheachlotcontainsnumberofwafers(10to12typically).Thenumberoflotsdependsontheordersizes.Electricaltestsareperformedthroughoutthemanufacturingprocesstomakesuredevicesarewithintestspec.
MOSFETCrossSectionandOperations
ThemechanicsofMOSFET’soperationsarebestdescribedusingtheconceptualNMOScrosssectionaldiagram(seefigure4.33).
Figure4.33:MOSFETcrosssection
Thegate(topplate),oxide(insulator),andp-substrate(bottomplate)underneatharemodeledasacapacitor.ThiscapacitoressentiallygavethemeaningtoMOSFET.FETstandsforfield-effecttransistor.Thisfieldreferstotheelectricfieldofthecapacitor.Applyingtwovoltagesourcesatthegateandthedrainstrikethispointclearlyinfigure4.34.
Figure4.34:MOSFEToperations
MOSFETOn-OffRequirements
Ifvoltageatthegate(VG)isslowlyrising,electronsareattractedtothesurfacerightunderneaththeoxideforminganelectronpassagecalledachannel.Electronsareminoritycarriersdopedinthesubstrate.Thechanneliseffectivelyinvertedaselectronconcentrationincreaseswithincreasingpositivegatevoltage(VG).Thisisastrong
inversionphenomenon.WhenVGincreasestoatleastequaltoorlargerthanVT(VG≥VT)andthedrainvoltage(VD)ishigherthanground(VD>0V),theNMOSissaidtobe“enhanced”;thechannelisnow“pinchedoff”givingrisetocurrentflow(seefigure4.34).Atthispoint,thetransistorisactive(on).IftheNMOSismodeledasaswitch,it’snowclosedwithfiniteimpedance.ToturnonPFET,thepolaritieswouldbereversed.Table4-4belowsummarizestheonandoffconditionsandtherequirementsofturningonandoffNandPFETs.
Table4-4:N/PFETOnandoffrequirementsConvertfigure4.34toaschematic.Figure4.35showsusthedifferencebetweenNandPFETson-conditions(ID>0).
Figure4.35:NFETandPFETdifferentinoperations
Unlikeabipolartransistor’sbase,CMOSgate,atDC,hasnogatecurrentbecauseofthecapacitor(gate,oxide,andsubstrate).Asaresult,IDandISarealmostequaltoeachotherexceptforsmallleakagecurrent.Thebadnewsisthattheleakagecurrentincreasesexponentiallyovertemperaturechange.Theseleakagecurrentscomeintheformofdynamicgatecurrent.DespitezeroDCgatecurrent,duringAC(switchingsignal),therewouldbecurrentflowingtowardsandoutofthegate.ThesecurrentsflowtowardsandoutofthegateduringACsignaltransition.Thisiscalleddynamicgatecurrent.Figure4.36demonstratesthisevent.Duringvoltagesquarewavetransition,currentsareshootingup,down,to,andfromtheCMOSgate.Thiscurrentcontributesnoises(glitches)propagatingthroughoutthesystems.Extracareisrequiredtominimizetheseglitches.Theyadverselyimpacttheoverallsystemnoiseperformance.Oneofthetechniquestoreducedynamicgatecurrentistoaddaresistoratthegate(RG).Theresistorsuppressesthegatecurrentandhelpsprotectthegatefromtransientvoltage-spikedamageattheexpenseofslowertransitiontime.ThesizeofRGdependsontimingtransitionrequirement.Typicalsize
variesfrom10’sto100’sofohms.
Figure4.36:Dynamicgatecurrent
TheotherfactaboutCMOStransistorsisthattherearenoactivediodespresentinthemexceptthebodydiode.Thearrowoftheschematicsymbolsimplyindicatesthecurrentdirections.TheIDversusVDScurvesonthenextpageshowstheCMOStransistors’operatingregions(seefigure4.37).
IDversusVDSCurve
Figure4.37:IDvs.VDS
Theylookalmostidenticaltobipolartransistors’ICversusVCEcurves.Theexceptionsaretheregiondefinitionswheretheconstantcurrentregionisnowcalledsaturation.Thisistheexactoppositeofbipolartransistor.TheregionwhereVDSislowistheLinear(Ohmic)region.Cutoffoccurswhenthetransistoristurnedoffwithoutanydraincurrent.
CMOSSourceAmplifier
IfwemodifytheNMOScircuitinfigure4.35tofigure4.38,weobtainacommonsourceamplifierthatperformsaninverterfunctionjustlikethebipolarinverter(commonemitter)withoutthebase.CMOStransistorscanbeconstructedincommonsource,commondrain(sourcefollower)andcommongateamplifierssimilartothosediscussedinthebipolarsections.Similartothecommonemitteramplifier,thecommonsourceamplifier’sinputisatthegatewhiletheoutputislocatedatthedrain.Theinputandoutputwaveformsareshowninfigure4.39.Theyare180degreesoutofphasewithpositivevoltagegain.
Figure4.38:Common
sourceamplifierFigure4.39:Commonsourceamplifierinput,output
If,forexample,VGS=0V(VG<VT),NFETisoff.NoIDorISwouldflow.Novoltagedropsacrosstheresistor.VDisatpositivevoltagesupply.OneincentiveusingMOSFETasanamplifierchoiceistheinfiniteinputimpedanceatthegate(capacitor).Recallchapter3,AC,capacitorsareopencircuitsatDC,i.e.,infiniteimpedance.Fromaninputimpedancestandpoint,itispreferablethattheamplifier’sinputstagehaveextremelyhighimpedances(maximumvoltageattheinput).ThisgivesMOSFETsbetteredgeoverbipolartransistors,nottomentionthebenefitoflackingDCgatecurrent.Thesefeatures
makeCMOScircuitseasiertobuild,test,andmeasure.Thesamesmall-signalmodeltechniqueusedtoanalyzebipolaramplifierscanbeusedonCMOScircuitsaswell.Theoriginalcommonsourceamplifierinfigure4.35wastransformedtothesmall-signalmodelinfigure4.39aonpage141.Thevoltageatthegate,VGisthesameasVin.Itisnowfacinganopencircuitbythegate-oxidecapacitor.Gminthiscircuitis:
BymultiplyingGmbyVGS,whichistheinput,it’sleftwithoutputcurrent,ID,representedbythecurrentsource.
Thepositivevoltagesourcetiestothedrainresistor(RD),isconvertedtoashortcircuitshowninthebottomoffigure4.39a.Thevoltagegainofthefinalsmall-signalmodelcircuitiscalculatedas:
The“–”voltagegainsigncamefromthefactthatV+wasconvertedtogroundwhilecurrentcontinuedtoflowfromgroundtowardsRD.Theexactsameanalysistechniqueinthebipolarcommonemitteramplifierappliestocommonsource.ThevoltagedropacrossRDisbelowgroundby–(GmX∆Vin)XRD.Theresultofthissmall-signalmodelindicatesthatthevoltagegainiscontrolledlargelybyGmandtheRDsize.ThehighertheGmandRD,themorevoltagegainyoucouldachieve.Forexample,acommonsourceamplifier’s∆ID=1mA,∆VGS=1V,RD=10kΩ.Voltagegain:
Figure4.39a:Commonsourceamplifiersmall-signalmodel
MOSFETParasitic
Small-signalanalysisappliestoanyamplifierdesign.Itsimplifiesdesigntasksandgivesfirst-orderconfidencethedesignworkstoyourexpectations.However,manyrealworldcircuitsprocessACsignals.ThisACrequirementcomplicatestransistorbehavior.TheNFETmodelexamineswhatitmeansinfigure4.40.ParasiticcapacitancesaredistributedaroundbothbipolarandCMOStransistors.TheNFETexampleincludescapacitorsfromgate-todraincapacitor(CGD),gate-to-source(CGS),drainto-substrate(CDSub),drain-to-source(CDS),andsource-to-substrate(CSSub).Thecapacitancesoftheseparasiticcapsarerelativelylow.TheyhavelittleeffectsinDC.Ifyourecallchapter3,AC,Xc=1/2πfC,XcisinfiniteatDC.Ifthesignalfrequencyishigh,Xcstartstodecreasegeneratingcurrentpathsviathecapacitors.ThisXchasprofoundeffectsontransistorfunctionsincludingchangesingain,leakagecurrent,input,andoutputimpedances.Thissomewhatexplainswhyanalogdesignisachallengingtaskinadditiontonumerouschangingparameters,frompowersupplyvalues,temperaturefluctuation,frequencyranges,orbandwidth.Inmostcases,atransistordatasheetonlylistspecificationsasarangeofnumbersatsomepre-definedconditions.ThesecapacitancesarestrongfunctionofVGS,VDS,temperature,andswitchingfrequency.MOSFETsdatasheetssometimeslistthemasinputcapacitance(CISS).Theycanbeintheorderof100sofpicofarads(pF).Forhighspeedapplications,gatechargeisanimportantparameterthatdescribeshowmuchcharge(Qunitincoulomb)theMOSFETneedstoswitchatcertainconditions.Theseparametersbecomesignificantathighspeed,whichcouldslowdowntheoverallspeed.GatechargesareheavilydependingonMOSFET’sthresholdvoltage(VT)aswellasthetypeofloadconnectedtoit.ToselecttherightMOSFETforanapplication,engineersneedtounderstandthetrade-offamongparametersandperformance.
Figure4.40:NFETmodel
CommonDrainAmplifier(SourceFollower)
Let’snowanalyzethesecondCMOSamplifiertype:thecommondrainamplifier.Itsinputisatthegate.Outputisatthesource.Theconnectionsaresimilartothecommoncollectoramplifier(emitterfollower).Thisiswhythecommondrainamplifieriscalledthesourcefollower.Figure4.41showstwosourcefollowers:NFETandPFETtypes.Figure4.42showstheinputandoutputwaveform.BothareinphasewithVoutslightlylessthantheinput.
Figure4.41:Commondrain(sourcefollower)amplifier
Figure4.42:Sourcefollowerinput,output
UsingaNFET-basedsourcefollower,whenVGisatground(VGS<VT)andNFETisoff,ID=IS=0A.NovoltagedropsacrosstheRS.VDismeasuredatpositivevoltagesupply.Samesmall-signalmodeltechniqueusedtoanalyzecommonsourceamplifiercanbeusedoncommondrainamplifier.Figure4.41wastransformedtosmall-signalmodelinfigure4.43.
Figure4.43:Commondrainamplifiersmall-signalmodelThevoltageatthegate,VG,isVin.Itisnowfacinganopencircuitbythegate-oxidecapacitor.Similartoacommonsourceamplifier,Gminthiscircuitis:
BymultiplyingGmbyVGS,whichistheinput,we’releftwithoutputcurrent,ID,representedbythecurrentsource.
ThedraintiestoV+,whichisconvertedtoashortcircuitshownonthefarright.Vin=VGS+Vout.Vout=VS=(OutputcurrentXRD)=(GmXVGS)XRD
Thevoltagegainofthesourcefollowerisslightlylessthan1(NegativedB).Forexample,acommondrainamplifier’s∆ID=1mA,∆VGS=1V,RD=10kΩ.Gm=1m/1=1m.Thevoltagegainisthereby:
TocalculategainindB:
=20log(0.909)=–0.83dB
CommonGateAmplifier
Thethirdandlastsingle-endedCMOSamplifieristhecommongateamplifier.Figure4.44showsNFETandPFET-basedcommongateamplifiers.TheNPN-basedcommongateamplifierinputisatthesource,theoutputatthedrain,andthegatetiestoaDCvoltagesource.Thecommongateamplifierprovideshighgainwithoutphaseshift,asshowninfigure4.45.
Figure4.44:Commongateamplifiers(N/PFETs)
Figure4.45:Commongateamplifier,NFET,PFET,waveformThecommongateamplifiergaincanberealizedbysmall-signalmodelinfigure4.46.
Figure4.46:Commongateamplifiersmall-signalmodelVIN=VS–VG=VSG=–VGSVout=VD=–(GmXVGS)RD
Fromthegainequation,youcanseethatgainispositiveindicatingthereisn’tanyphaseshift.TheamountofgainismainlycontrolledbyGmandRD.
BipolarversusCMOS
Amongthesixdifferenttypesofamplifiers,therearetrade-offsamongthemwhenitcomestochoosingonethatmeetsyourdesigntarget.Table4-5detailsthedifferences,pros,andconsbetweenbipolarandCMOStransistors.ThedifferencesbetweenMOSFETsandbipolartransistorscreateinterestingdynamicswhenitcomestodesigningandanalyzingelectroniccircuits.Understandingthetrade-offssavesyoutime,getsyourfinalsystemwithinspecs.
Table4-5:BipolarandCMOSelectricalperformance
DifferentialAmplifiers
Sofar,wecoveredsingle-endedamplifiers.Differentialamplifiers(diffamp)arewell-suitedtomanyapplications.Theyareinmanycasessuperiortosingled-endeddesign.Thissectiondescribeswhatdiffampsareandthemotivationbehindusingthem.Lookbackatsingleendedamplifiers.Theinputsandoutputsarereferencedfrompositivetogroundorthemostnegativerailvoltages.Weknowbynowthereisnosuchthingasaperfectvoltagesourceorground.ADCpowersupply,evenground,hasnoiseridingoverit(seefigure4.47).Theseimperfectqualitiesleadtoinaccuracies.Thesenoisesbecomemoreapparentinmicroelectronicswhentransistorsaremeasuredinthesub-micronlevelrunninginextremelylowvoltages.Anysubstantialnoisecouldfalselytriggeratransistortogivewrongresults.Onesolutiontothisproblemistonotusegroundorthenegativerailasareferencetotheinputbutrathertousetwo(differential)inputsinstead.Figure4.48consistsoftwoNFETs(Q1,Q2)andtwodrainresistors.Theinputvoltageisnolongerasingle-endedinputreferencetoground.Itconsistsoftwoinputs,V1andV2.More
precisely,theinputsarethedifferencebetweenV1andV2(V1–V2=Vdiff).Thistopologyeliminatesgroundasvoltagereference.
Figure4.47:Supplyandgroundnoise
Figure4.48:Differentialamplifier
CommonMode
Figure4.49a:Currentsplitindifferentialamplifier
Intermsofdiffampvoltagegain,wefirstneedtointroducecommonmode.Commonmodevoltage=(V1+V2)/2.WhenbothV1andV2arethesame(seefigure4.49a),thereisnovoltagedifferencebetweenthetwoinputs.Currents(I1,I2)aresplitequallybetweentwodrainresistors(KCLinchapter1,DC).TheoutputsareatthedrainbetweenQ1andQ2.Theyareexactlythesame,i.e.,thevoltageoutputdifferenceiszero.Theamplifiernowhaszerodifferentialvoltagegain.Whenbothinputsarethesame,diffampexhibitszerocommonmodegain.Thezerocommonmodegainisyetanotheradvantageoversingle-endedtopology.Anynoiseappearingatbothinputs,iftheyareequalinvalue,wouldnotgetamplifiedshowingupattheoutput.However,evenwithdiffamp,therewouldbesomesmallcommonmodegain.Thisgainiscausedbythemismatch
betweenresistorandtransistorsizeseveniftheirdesignedvaluesarethesame.Whatitmeansisthatduringthemanufacturingofelectroniccomponents,notwophysicalelectroniccomponentscanbemanufacturedidenticallytoeachotherduetoprocesstechnologylimitations(gradients).Forexample,foraresistorwith10kΩinvalue,therecouldbeplusorminuspercentage(e.g.,5%)differencebetweentheactualresistorsand
theresistors’designvalue.Inotherwords,therecouldbeasmuchas500Ωdifferencebetweenthetwophysical10kΩresistors.Thispercentagedifferencevariesfromprocesstoprocess.Aprocessspecsheetwouldtellyousuchinformation.Besidestheresistors,transistorshavesameinaccuracieswherenotwotransistorsarethesameeveniftheyareidenticalintheschematic.Theirwidth,length,andVTmaybeslightlydifferent.Thesenon-idealdevicecharacteristicsleadtounevencurrentbetweenI1andI2,evenwhenV1andV2arethesame.Thesedifferencesincurrentresultsinvoltagedifferenceattheoutput,hencecommonmodegain.Thecurrent(I1+I2)combinedatsourcesiscalledtailcurrent(tail-likeshapeof
Figure4.49b:Tailcurrentsourcevs.resistorNMOS).Thesecurrentsaresunkbythecurrentsource.Numerousacademictextbooksusearesistoratthesourcetoproducethecurrent.ThisisimpracticalbecausethecurrentgeneratedbythevoltagedropacrosstheresistorisconstantlychangingwhenV1andV2areACsignals.ThisleadstodifferencesinI1,I2,anddrainvoltages.Thevoltagegainwillbechangingconstantly,unacceptableforstablegainoperations.Mostrealworlddiffampsusecurrentsourcetosupplyconstantcurrenttothecircuit(seefigure4.49b).
CMRRandDifferentialGain
Toquantifythissmallgain,thecommonmoderejectionratio(CMRR)iseasilyfoundinthedifferentialamplifierdatasheet.It’sameanstoquantifyhowwelltheamplifierrejectscommonmodesignal.UsingAdm(differentialmodegain)andAcm(commonmodegain),CMRR=Adm/Acm.Inanidealcase,Acm=0andCMRR=infinite.Inreality,CMRRwouldbelargealthoughnotinfiniteduetosmallAcminthedenominatorofCMRR.Thedifferentialamplifiergaintherebyisequalto(differentialmodegain+commonmodegain)or(Adm+Acm).Thedifferentialmodegainissimplyameasureofvoltagechange(difference)attheoutputversusinput:
Wecouldusefigure4.50toshowthemeaningofvoltagedifferenceattheoutput.IfV1>V2,currentissteeredtowardsQ1sothatI1>I2(largerI1arrow).Thisgeneratesavoltagedifferenceincurrent
difference(Vout_diff)betweenQ1,Q2’sdrainvoltages(VD_Q1<VD_Q2).Tofindouttheexactdifferentialamplifiergain,wecouldusethesamesmallsignalmodeltechniqueintheprevioussectionandapplyahalf-circuitanalysis.Ahalf-circuittakesthehalfofthedifferentialcircuitwherethecommonmodevoltageinputiszero:
Figure4.50:VoltageoutputdifferenceV1=–V2
Ifbothinputsarethesame,V1=–V1,fordifferentialvoltageinput:Vin_diff=V1–(–V1)=2X(V1)Wesplitthedifferentialcircuitinhalf.V1wouldbeequaltoVin_diffdividedby:
Usingthesmall-signalmodel,outputvoltageatQ1:Vout_1=–Gm(V1)XRD1
Gothroughthesamestepsontheright-handsideforQ2:
Thefinaldifferentialamplifiervoltagegain,AdmorAv(diff):
ThedifferentialgainisafunctionofGmX(RD1+RD2)where(RD1+RD2)istheoutputimpedance.Tovisualizehowdiffampworks,weuseVout_diffvs.Vin_diffDCgraphinfigure4.51a.WhenV1=V2(Vin_diff=1),Vout_diff=0(novoltagegain).WhenV1>V2,Vin_diffispositive(right-handsideofthegraph).V1>>V2indicatesQ1VDSapproaches0V(cutoff).Themostnegativethecurvecangois–V++.WhenV1<<V2,Vin_diffisnegative(left-handsideofthegraph).IfV1<<V2,Q2VDSapproaches0V(cutoff),andthehighestthecurvecangoisV++.Theresistorsinthediffapparecalledpassiveloadresistors.Inpracticaldiffampcircuits,loadresistorsareseldomused.Withatransistor’shighdrainimpedance,transistorsareusedasactiveloadstoachievehighgainindiffamps.Anexampleisshowninfigure4.51b.Thisdifferentialamplifiertopologyisthebasicbuildingblockoftheoperationalamplifier.ThetwoPFETSareconstructedasacurrentmirrorwithhighdrainimpedance.Currentmirrorisdiscussedinthenextsection.
Figure4.51a:Vout_diffvs.Vin_diff
Figure4.51b:Activeload
CurrentMirror
Let’sexaminethecurrentmirror(seefigure4.52a).Theyarewidelyusedinmicroelectronicdesigntogeneratecurrentreferences.Thepurposeofthecurrentmirroristofirstgenerateareferencecurrent(IREF),thenreplicateittocreatemultiplecopies.Thecopiesofthecurrentcanbemanipulatedbyvaryingtransistorsizes.Thecurrentcopiescanthenbeusedinotherplacesthroughoutthedesign.Itssimplicitymakesapowerful
circuittoeasilygenerateanynumberofcurrentsfromonlyfewcomponents.Figure4.52aisacurrentmirrorexamplemadeupofa10kΩresistorandtwoNPNs(Q1,Q2).ThiscircuitisonlypracticalwhenimplementedinanICdesign;discretecomponentsexhibittoomanyparametermismatchesmakingitdifficulttoachievedescentaccuracy.TheQ1collectorisshortedtoQ1andQ2’sbases,i.e.,VC=VB.ThisforcesbothQ1andQ2’sVBEstobeequal.Ifyourecallthecollectorcurrentequation:
IC=AXISXe(VBE/VT)
Figure4.52a:CurrentmirrorBothcollectorcurrentsareidenticalifQ1,Q2area,VBE,andtemperaturearethesame.Thecurrentreference(IREF)isfoundbyKVLonthe10kΩresistor:
ThePMOScurrentmirrorusedinthedifferentialamplifierasactiveloadworkssimilarly.Figure4.52bshowsanexample.For1VVGS,IDassumestobe0.4mA(processdependant).Thereferencecurrent:
VGSsfortwoPFETsontherighthavearethesame(gatesandsourcesaretiedtogether).Becausetheirsizesare2Xand3XlargerthanthereferencePFET:
IOUT1=2X0.4mA=0.8mAIOUT2=3X0.4mA=1.2mA
PFET’sdrainishighimpedance.Asdiscussedinthepriorsection,thisisadvantageousinadifferentialamplifierwherecurrentmirrorisfrequentlyusedasanactiveloadtoprovidehighervoltagegain.
Figure4.52b:PMOScurrentmirror
Op-Amp
Operationalamplifier(op-amp)inputsaredifferential;outputistypicallysingle-endedalthoughdifferentialoutputsarefairlycommon.Differentialamplifiersintheprevioussectionaregreatchoicesforop-ampinput.Allamplifiersdiscussedsofarareopen-loopwheretheamplifieroutputisnotconnectedbacktotheinput(feedback).Anop-ampconnectedinopen-loopoffersextremelyhighgain.Toachievesuchimpressivegain,multistagedamplifiersareneeded.Totalsystemmulti-stageamplifiers’gainisdetermined
bythemultiplicationofindividualgains.AssumeindividualstagegainsareA1,A2,andA3,totalopampgain=A1XA2XA3.Anop-ampwithreasonablebandwidthcouldhaveopen-loopgainof90dBto100dB.
ThismeansifVinchangesby1V,theoretically,Voutchangesby100,000V.100,000Visnotapracticalnumbertouseorlistinthedatasheet.Forthisreason,open-loopgainiswrittenasV/mV(1V/0.001V).Fromtheaboveexample,theopen-loopgainis:
Toachievereasonable,manageablegain,feedbackorclosed-loopconfigurationisnecessary.Asforunity-gainbandwidth,it’sthefrequencywheretheop-ampdropstoagainof1(0dB):
Recallthelow-passfilterinchapter3,AC.Wecoulduseabodeplottoexplainop-ampgainvs.frequency(seefigure4.53).Ideally,thehighertheunity-gainbandwidth,thebettertheop-ampwillbe.Transistorsareactivedevices.Anop-ampismadeprimarilyoftransistors.Atlowfrequency(DC),gainsindBwouldbemuchmorethan0dBasopposedto
alow-passfilter,wherethehighest
Figure4.53:Op-ampgainvs.frequency
filter“gain”is0dBbecausefiltersdonothavegain;theyhaveattenuationinstead.Thelowpassfilterattenuationandop-ampareboth–20dB/decade(–20dBperdecade)withincreasingfrequency.Aclosed-loopop-ampconfigurationmeansthattheoutputisfeedingbacktotheinputprovidinglowerbutcontrollablegain.Youmaywonderwhyanyonewouldwanttodesignanamplifierwithlowergain.Thereasonliesinanalogsignalprocessing.Manyanalogapplicationsneedpreciseandcontrollablegains.Thisiswhereclosed-loopandfeedbacknetworkcomein.Wewilldiscussthemshortly.Theop-amphasitsownschematicsymbol(seefigure4.54).
Figure4.54:Op-ampschematicsymbol
Thetriangularsymbolincludestwoinputterminals,denotedby“+”(non-invertingterminal)or“–”(invertingterminal).Singled-endedoutputislocatedontheright.Thedifferentialamplifierdiscussedintheprevioussectionisagoodexamplebeingusedastheop-amp’sinputstage.Figure4.55showsanop-ampinputstageexampleusingPFETsQ1andQ2astheinputstage,Q3,andQ4(activeloads).TheNMOSinthiscircuitaretheactiveloads.
Figure4.55:PFETinputstagedifferentamplifier
Op-AmpRules
Thesearetherulesassociatewithop-ampworthnoting:1)Inputimpedance:infinite2)Outputimpedance:zero3)Inputoffsetvoltage:zero
Let’stakeacompleteop-ampcircuitasanexampletomaketheserulesclearinfigure4.56.
Figure4.56:Multi-stageamplifiers
Q1,Q2,Q3,Q4,andthecurrentsourcemakeupstage1oftheop-amp.Stage1isaCMOSbasedamplifierwithV1andV2asinputsatQ1andQ2’sgates.ThismakestheinputimpedanceinfiniteatDCfromrule1.Q3andQ4formaPMOScurrentmirror.TheoutputislocatedattheQ4drain(PFET)andQ2(NFET)causinga180-degreephaseshift.ThisoutputistakentoQ5’sgate.Itsdrainresistorformsstage2:APMOScommonsourceamplifierwiththeoutputlocatedatQ5drain.Stage2providesa180-degreephaseshiftnettingazerodegreeshiftfromstage1.Finally,Q6isthefinalstage,3:Theemitterfollowerofferslowoutputimpedance(ideallyzeroΩfromrule2)andwithazero-degreephaseshift.Inreality,weknowthattheemitterhaslow,finiteimpedance.Themajorityoftheop-ampgaincomesfromstages1and2(bothcommonsourceamplifiers)withslighttrade-offfromstage3’ssmallemitterfollower’svoltageloss.ThezerooffsetvoltagemeanswhenV1andV2arethesame,bothQ1andQ2gatevoltagesareidentical.Inreality,thisisnottruebecausenotwotransistorscouldbemanufacturedexactlythesameinsizesresultingindifferentthresholdvoltages(VT),i.e.,differentQ1andQ2gatevoltages.WhenV1>>V2,Q1isenhancedandcurrentsteerstotheleft-handsideofstage1.Q3VGSisestablishedequalingQ4’sVGS.WiththisenhancedQ4,however,nocurrentisabletoflowdownwardfromQ4becauseQ2isoff(opencircuit).ThisliftsQ4drainuptowardsthepositivesupply.ThishighoutputcollapsesQ5VGSshuttingitoff.NocurrentflowstothedrainresistoryankingQ6(NPN)basetoground.VBEiszerovoltagesotheoutputislow.Insummary,whenV1ishigh,V2islow,andVoutislow.Nowlet’sconsiderwhenV2>>V1.Q1isnowoff,andQ3thencutsoff.WithoutadequateVGSof
Q3,Q4isoff.EvenV2ishighenhancingQ2;thereisn’tanycurrentflowingthroughit.ThispullsQ2’sdraindownwhichinturncausesQ5VGSlargerthanVTturningiton.IfVGSisknownwithadrainresistorsizedesignedproperlytobehigherthanVBEvoltageplustheIRdrop(voltageacross)oftheemitterresistor,Voutisliftedup.Table4-6showstheop-ampoperationwithterminaldefinitions.Oneeasywaytointerpretthissummaryisthatanopen-loopinvertingamplifiersimplymeanswhentheinputoftheinvertingterminalishigherthanofthenon-invertingterminal,theoutputgoeslowandviceversa(seefigure4.57a).
Table4-6:Op-ampoperationwithterminaldefinitions
Figure4.57a:Inverting,Non-inverting,outputrelationship
Fromthebuckregulatorinchapter3,AC,theop-ampwasusedasacomparatorconnectedinopen-loop.Inthatexample,thenon-invertingterminalisfixedwithavoltagesource.Ifthenon-invertingterminalishigherthanthevoltagesourceatthenegativeterminal,theoutputwillliftuptotherail.Thiscanberealizedbythehighopen-loopgain.Supposetheop-amphas100dBopen-loopgainwithpositiverailvoltageat5Vtoground.
Thismeansthatitonlytakes50uVdifferencebetweenthepositiveandnegativeterminalstofliptheoutputtoeither5Vorground.Thisisacomparatorcircuitcomparingthevoltagedifferencebetweentwoterminals.Theoutputsareeithergoinguptothepositiverailorground.Open-loopisperfectincomparatortopologybecauseofitshighgain.Thishighgaindirectlyrelatestohighslewrate,whichspecifieshowfastvoltagechangesovertime,i.e.,∆V/∆T.Forexample,astepresponseattheinputproducesanoutputwithslewrateat10V/1us(seefigure4.57b).Thismeansthedevicewouldbeabletochange10Vattheoutputinonemicrosecond(us).Ahighslewrateisdesirablebecauseitreducesthetimefortheinputandoutputtoreachtoitsintendedlevels.Settlingtimeisanotherimportantop-ampspecthatiscommonlyfoundinadatasheet.Infigure4.57c,settlingtimespecifieshowquicklytheop-amprespondstoaninputandoutputsettlesin2uswhentheoutputvaluestayswithinthepredefinederrorband.
Figure4.57b:10V/1usSlewrate
Figure4.57c:2ussettlingtime
Apartfromvoltagegain,manyanalogcircuitsrequirecurrentgain.Anop-ampusedtodriveahigh-currentmotorisoneexample.Itrequirestheop-ampoutputstagetoprovidesufficientcurrentforthemotortoturn.Wewillsummarizeallmajorop-ampparametersattheendofthissection.Asniceashighopenloopgainsounds,inmanycases,wewouldlikethegaintobelowerandinamorecontrolledmanner.Inmanycases,anaudioamplifieronlyneedstoamplifytheinputsignals3to5times.Iflowerandcontrolledgainisrequired,
closed-loopop-ampconfigurationcanbeimplemented.Therearetwopopularways(invertingandnon-invertingamplifiers)toconnectanop-ampinclosed-loop.BotharecoveredinthenextfewsectionsandcanbeeasilyexplainedbyOhm’slaw,KVL,andKCL.
InvertingAmplifier
Invertingamplifierisfirstshowninfigure4.58.OurgoalistodeveloptheVoutvs.Vintransferfunction,i.e.,closed-loopgain,withrespecttotheRfandRi.YouwillseeinamomentthattheamplifiergainisnicelysetbyRfandRi.Inthisconfiguration,theinputvoltageconnectstoterminal(V–).Therethenegativeisaresistor
feedbacknetwork,RfandRi.Partoftheoutputisnowfeedingbacktotheopampinputcreatingaclosed-loopcircuit.Forclosed-loopop-ampconnections,iftheop-ampoutputstage(transistors)isn’tdriveninsaturation(outofrange),Voutwoulddowhateverittakestoforcethedifferencebetweenpositiveandnegativeterminalstobezero,V+–(V–)=0.ThisrulemeansthatV–hasthesamevoltageastheV+at0V.Thisgroundpotentialis
called“virtualground.”Oncewehaveobtainedthevirtualgroundconnection,wecanapplytheinfiniteinputimpedanceop-amprule.Atransformedcircuitinsidethedottedlineisdeveloped(seefigure4.59).Theinfiniteinputimpedancepreventsanycurrentgoingintotheop-ampturningitintoanopencircuit.Thisop-ampliterallycanbetakenoutofthepictureforthetransferfunctiongainanalysis.
Figure4.58:Invertingamplifier
Figure4.59:Transformedop-amp
Figure4.60:Simplifiedop-ampcircuit
Thesimplifiedversionofthecircuitisshowninfigure4.60.Thiscircuitcanfurtherberealizedastwoindividualcircuits.OnefromVinandRitoground,theotherfromVoutandRftoground(seefigure4.61).Thecurrentofbothcircuitsgotovirtualground.Thesecurrentscan’tgotoop-amp’sinfiniteimpedancenegativeterminal.
TheamountofcurrentgoesfromVintogroundisidenticaltocurrentfromVout.Theonlydifferenceiscurrentdirectionasbothcurrentsareflowingtowardseachotherresultinginanegativesign.Theindividualcircuitsareshowninfigure4.61.
Figure4.61:Individualop-ampcircuits
UsingOhm’slawandcurrent,Vout/Vinequationsarederived:
Thevoltagegain,Vout/Vin,isnoweasilydeterminedbytheRftoRiratio.Duetothe“–”(Vout/Vin)sign,thisisaninvertingamplifier.VinincreasesandVoutdecreaseswithacontrollablegain.Ifthedesiredgainis–5,Ri=10kΩ:
Non-InvertingAmplifier
Whatifyouwantapositivegainattheoutput?Onecouldaddacommonsourceoremitteramplifiersattheop-ampoutputtorevertthephase,orcoulduseanon-invertingamplifier(seefigure4.62).
Figure4.62:Non-invertingamplifier
TheonlydifferencebetweenthisamplifierandtheinvertingoneisthatVinisconnectedtothepositiveterminal.TheleftsideofRiisconnectedtoground.Theresistivefeedbacknetwork,however,remainsonthenegativeterminalside.TheVout/Vingaintransferfunctionisexaminedthroughthemodifiedcircuit(seefigure4.63).
Figure4.63:Modifiednon-invertingamplifier
Thesameruleisappliedtothenoninvertingamplifier.Bothpositiveandnegativeterminalsareatthesamevoltagepotentials.ThismakesV–=Vin.Thisop-ampruleconvertsfigure4.63tothefinalmodifiedversion(seefigure4.64).Thiscircuitstrikinglyresemblesavoltagedivider.Thevoltagetransferfunctionisthereby:
Figure4.64:Finalmodifiednon-invertingamplifier
Theclosed-loopvoltagegainofanon-invertingamplifierisconvenientlysetbytheRftoRiratio.Theclosed-loopgainispositive,hencethenon-invertingamplifiernameconvention.Ifagainof10isyourdesigntarget,Ri=10kΩ:
Op-AmpParameters
Therearemanyop-ampparametersinadditiontogain,slewrate,andsettlingtime.Getfamiliarwiththeseop-ampparametersmakeschoosing,designing,andtestingop-ampsaneasiertask.Theothermajorsignificanceofop-ampfeedbacktopologyistheabilitytoaltertheop-ampinputoroutputimpedances.Fortheinput,itcouldbeanegativeeffect.Ideally,op-ampinputsareinfinite,whichisnowloweredbytheRiandRf.-Supplyandinputvoltage:Supplyvoltagedefinesabsolutemaximumandminimumvaluesofpowersupplyyoucanapplytotheop-amp.Inputvoltagedefinesthehighestandlowestvoltageyoucanapplytotheinputterminals.Unlesstheop-ampsarerail-to-rail,inputvoltageislessthansupplyvoltage.-Supplycurrent:Ittellsyouhowmuchcurrenttheop-ampwillbesourcedfromtheop-amppowersupply.Whentheop-ampisnotdrivinganyloadoramplifyinganysignal,theop-ampstilldrawscurrenttokeepitsoperations.Thiscurrentisspecifiedasquiescentcurrent.Quiescentcurrentappliestoanyelectronicdevicesuchasvoltageregulatorsorcontrollers.-Commonmoderejectionratio(CMRR):Ithasthesamedefinitionasdescribedin
previoussection.Ittellshowwelltheop-amprejectsthecommonmodesignalfromnoise.TheCMRRunitisindB.ThelargerthedB,thebetterCMRRperformancewouldbe.-Powersupplyrejectionratio(PSRR):Itspecifieshowmuchoutputchangesfrompowersupplychanges.It’smeasuredindBwithtransferfunctionas:(∆Powersupply)/(∆Vout).PSRRisinfiniteinanidealcase(∆Vout=0).-Outputvoltageswing:Itdefinesthevoltagerangetheoutputcouldgofromthemostpositivetothemostnegativelevels.Therangedependsontheload.Withasmallerload(bigloadresistor,lowercurrent),theoutputcangohigherthanalargerload.-Outputsourceandsinkcurrent:Thisisthemaximumcurrentop-ampcouldsupplyandreceive.Figure4.65depictswhatsourceandsinkcurrentmean.Therearetwoelectronicloads(circlesymbols)inthiscircuit.Thetoploadturnsonwhenop-ampoutputgoeslowsinkingcurrenttowardstheop-amp.Whentheop-ampoutputgoeshigh,thetoploadturnsoff,andthebottomloadturnson.Theop-ampisnowsourcingcurrenttothebottomload.Thecurrentamountcapableofsourcingandsinkingtoandfromtheloadistheop-ampsource/sinkcurrentparameter.-Inputoffsetvoltage:Thisisthevoltagedifferencebetweenthepositiveandnegativeterminalsthatisneededtobring∆Vouttozero.Ideally,inputoffsetiszero,meaningwhenthedifferenceofthetwoinputterminalsisthesame,thereiszerovoltageoutputchange.
Figure4.65:Op-ampsource,sinkcurrent
-Inputoffsetcurrent:Thiscurrentgoesinoroutoftheop-amp’sinputterminals.Anop-ampwithaCMOSinputstagedoesn’thavesuchspec.Onlybipolarcarriesthisspecduetobasecurrents.ForNPN,inputbiascurrentgoesintotheop-amp.ForPNP,basecurrentcomesoutoftheinputterminals.Thiscurrentaddstotheoffsetvoltage.Forthisreason,minimalinputbiascurrentisdesirable.
-Powerconsumption:Themaximumpowerinwattsthatop-ampconsumes.Thisrelatestopowersupplyvoltageandsupplycurrent.-Inputimpedance:Thisistheinputimpedancelookingintotheop-amp.ForaCMOSinputop-amp,inputimpedanceisinfinite.Forabipolar-basedop-amp,itsbase’simpedanceishighbutnotinfinite.5MΩinputimpedanceistypical.-Open-loopgain,bandwidth:Someuselargesignalvoltagegaintorepresentopen-loopgain.InsteadofdB,somedatasheetstranslatedBtoV/mVtodescribeopen-loopgain.Forexample,100V/mVisequivalentto100dB.20log(100/1m)=100dB.Open-loopgaincanberealizedinabodeplotinfrequencyresponse(seefigure4.66).Theopen-loopgainismuchlargerthancontrolledclosed-loopgain.
Figure4.66:Op-ampfrequencyresponse
Bemindfulthatdatasheetsonlylistvaluerangesonaparticularparameterfrommaximumtominimum.Mostparametersareguaranteedonlyforaspecificsetofconditions,e.g.,aspecifictemperaturerange(−55°C≤T≤+125°C)orsupplyvoltagelevel.
LM741
Perhapsthemosttalkedaboutop-ampinacademicsisthegeneralpurposeLM741op-amp.It’san8-pinbipolartransistor-based,differentialinput,single-endedoutputop-amp.Figure4.67showsLM741inametalcanpackage;italsoshowsthepinnames,andnumbers.Thediameterofthecanisabout0.37inch.Pins1and5areusuallyconnectedtogetherwitha10kΩresistortoreducetheoffsetvoltage.
Figure4.67:LM741inacanpackage(left)andpinnames,numbers(right)Table4-7TexasInstrumentspartofLM741datasheet.http://www.ti.com/product/lm741
Table4-7:LM741datasheet(Partial)Note:TA(Operatingtemperature),RS(Sourceimpedance),VS(Sourcevoltage),andRL(Loadimpedance)
CurrentMirrorInaccuracies
Usethecurrentmirrordevelopedearlier(see4.52a).ThedesigngoalistocreateIOUT,anexactcopyofIREFifbothQ1andQ2sizesarethesame.Byjustthreecomponents,areferencecurrentandcopiesofcurrentsarecreated.ChangingQ2’ssizeeasilycreatesmultiplecurrentamplitudes.Forexample,doublingtheQ2sizefromQ1makesIOUTtwiceasmuchasIREF.Thiscircuitdoeshaveflaws.TheIOUTwouldnotbeexactlyconcept
figure
equaltoIREF.ThemainerrorsFigure4.68:CurrentmirrorerrorcomefromthebasecurrentandthesizemismatchbetweenthetwoNPNs.Figure4.68examinesthisinaccuracy.UsingtheKCL,IB+IC=IErule,itcanbeseenthatIOUTistwoIBslessthanIREF.IOUT=IREF–(2XIB).Forexample,VBE=1V,IC=0.3mA(aspecifictransistorspec).IREF=(5V–1V)/10kΩ=0.4mA=400uA.Supposebeta(β)=100,IB=0.3mA/100=3uA.Fromthemathderivationinfigure4.68:IOUT=IREF–(2XIB)=400uA–(2)X(3uA)=394uA
Thecurrenterrorinpercentage:
Despite1.5%appearingtobealownumber,recallthatVBEandtransistorbetaare
dependentontemperature.Thiserrorworsenswithtemperatureandsupplyvariations.Theerrorpercentagecouldgoupquickly.Forhighaccuracydesign,itmaybeunacceptable.Becausethiserrorismainlycausedbythebasecurrent,youmaybetemptedtouseaCMOStransistortosolvethisproblem,thinkingthatthereisnogatecurrentinMOSFET.However,VTmatchingofCMOSisworsethanVBEinmicroelectronicdesign.Devicematchingquantifieshowwelltwodeviceswouldbeidenticaltoeachother.Comparatively,becauseCMOSVTmatchingispoorerthanbipolarVBEduetothematchingproblem,thebenefitsofzeroCMOSgatecurrentarediminished.
WilsonCurrentMirror
Therearesimpledesigntechniqueswecouldimplementtoimprovethebipolar-basedcurrentmirror(seefigure4.69).
Figure4.69:Wilsoncurrentmirror
ThisisaWilsonmirrorcircuit,inventedbyMr.GeorgeWilsonin1960s.It’sstillpopulartodayandusedbymanyICdesigners.Bymakingtwochangestotheoriginalcircuit,Wilson’smirrorIOUTisnowequaltoIREF.Thesesimplechangesare:1)AddQ3.2)SwaptheQ1andQ2basetotheQ2collectorinsteadofQ1.Themathematicalderivationlookstedious.Ifyoulookclosely,however,theyarenomorethanKCL,IC,IE,andIBrulesandsimplearithmetic.Thiscircuitservesanotherpurpose.TheQ1collectorvoltage(Q1_VC)isnowfixedattwoVBEs(VBE2+VBE3).ThisfixedvoltageattheQ1collectorensuresQ1doesn’tgointosaturation(VCEbeingtoolow)andstayinthe
normaloperatingregion(constantcurrent).Allthesedesign“fixes”sofarrequiregoodtransistorunderstanding.Anyelectronicinnovationsarealwaysbackedbybasicelectronicprinciplenomatterhowcomplicatedtheyturnouttobe.
BipolarCascode
Thetechniqueofconstantcollectorvoltagesiscalledcascode.Figure4.70isacurrentmirrorusingthistechnique.
Figure4.70:CascodecurrentmirrorQ3,Q4,andQ5arecascodedevices.AllVBEs(Q_VBE)areidentical.ThecascodedeviceskeepQ1,Q2,andQ6’scollectorvoltages(Q1_VC,Q2_VC,Q3_VC)equal.ApplyKVL:Q3_VC=Q1_VBE1+Q3_VBE=2X(VBE)Q4_VE=Q2_VC:Q2_VC=(2XVBE)–VBE=VBE
ThereisanadditionalcurrentbranchfromQ5toQ6.SimilartoQ1andQ2’sVBEs,Q6’scollectorisoneVBE.TheseconstantvoltagesatcollectorsQ1,Q2,andQ6keepthemoutofsaturations.Thisisausefulfeaturewhentransistorsareusedascurrentsources.Alldesignsolutionscomewithtrade-offs;thecascodecurrentmirrorsarenoexception.Whatyouloseistheheadroom.Headroomisthevoltagesacrossthecollectorandemitter.FromtheICversus-VCEcurves,itindicatedthathavinglargeVCEisdesirableinordertokeepthetransistoroutofsaturation.Byaddingarowofcascodedevices,Q3,Q4,andQ5
transistor’sheadroomwouldbereduced(reducedheadroom).Thisisparticularlyapparentinlowvoltageapplications.Ingeneral,cascodesarenotdesignedforextremelylowvoltagedesignduetotheheadroomissue.
DarlingtonPair
TheDarlingtonpairconfigurationisapopularcircuit.ThiscircuitwasinventedbyMr.SidneyDarlingtonin1953whenheworkedatBellLab.It’sstillusedtodayinmanymodernICs.Let’susePNPdevices,thistimeconnectedasDarlingtonshowninfigure4.71.ThiscircuitisadifferentialamplifierusingPNPastheinputstage,NPNasactiveload.TheDarlingtonpairprovidestwofeaturesinthiscircuit:1)maximumcurrentgain,and2)inputvoltageconversion.Onpoint1,currentisincreasedfromQ1toQ2usingthetransistorbetaruleas
follows:Assumetransistors’beta(β)areequal,
Figure4.71:PNPDarlingtonpairQ1_IE=Q1_IB+Q1_IC:Q2_IB=Q1_IE:Q1_IE=Q1_IBX(1+β):
β>>1, Q1_IE=Q1_IB+(Q1_IBXβ)=
Q1_IB(1+β)
Q2_IC=βXQ1_IB(1+β)Q2_IC=βXQ1_IBXβQ2_IC=β2XQ1_IBThisshowsthatoutputcurrentIE(Q2_IE)ismuchlargerthantheinputcurrent(Q1_IB)byβ2.Forexample,ifQ1_IB=10uA,betaareall100.Q2’semittercurrent:Q2_IE=1002X10uA=100mA,10,000timeslarger
Onpoint2,theinputvoltageattheQ1baseis“lifted”uptwoVBEsatQ2’semitter(Q2_VE).Iftheinputis2V,VBEis1V,andQ2_VBisat(2V+1V)=3V.AddingonemoreVBEgives4VatQ2’semitter,keepingQ2andQ3outofsaturation.Thisinputvoltageconversionislikelyneededespeciallywhentheinputvoltageisrelativelylow.Fordesignsthatrequirelowinputvoltage,theDarlingtonpairbecomesanidealchoiceasaninputstage.ImagineusingthesamecircuitwithouttheDarlingtoninfigure4.72.With1VinputatQ1and1VVBE,emittervoltageatQ1=1V+1V=2V.Q3collectorstandsat1VfromQ3’sVBE.VECacrossQ1isnow2V–1V=1V.Foraparticularbipolarprocess,1VVECmaybetoolow,forcingQ1intosaturation.Saturationshouldbeavoidedatallcostsbecauseittakestimeforthetransistortorecoverfromsaturationduringswitching,hurtingtimingperformance.
Figure4.72:PNPdifferentialpairwithlowinputvoltages
CMOSCacosde
CascodecanalsoapplytoCMOStransistors.ACMOScascodecircuitisshowninfigure4.73.Q1andQ2gatesandQ2drainaretiedtoeachother.ThismakesQ1gate-to-sourcevoltage(Q1_VGS)equaltoQ2drainvoltage.Gate-to-sourcevoltageofQ2isQ2_VGS.ApplyKVL,sourcevoltageofQ2,Q2_VS=(Q1_VGS–Q2_VGS).Plugsomenumbersintothecircuit.Youwillgainsomerealinsightsintohowitworks.Forexample,ifQ1_VGS=Q2_VGS=1Vforagiventransistorsize,VT,andtemperature,thenaccordingtotheQ2’ssourcevoltageequation,itisequalto:Q2_VS=(1V–1V)=0V.ThismakesQ1drain-to-sourcevoltage(Q1_VDS)zerovoltcuttingoffQ1.Thiscircuitdoesnotoperateproperly.Tofixit,thedevicesizeneedstobechanged;usethedrain
currentequation:
Bychangingthetransistorsize,VGScouldbemodifiedforagivenVTanddraincurrent.Inthiscase,wewouldliketoincreasetheQ1VGStobelargerthanQ2’s.WedoubleQ1’swidthtochangeQ1_VGSfrom1Vto2V.Q2_VSisnow:2V–1V=1V.ForlowvoltageCMOSprocess,1VispossiblyenoughtokeepQ1fromcut-off.
Figure4.73:CMOScascodecircuit
Buffer(VoltageFollower)
Let’snowgooversomeop-ampcircuitstoreinforcewhatwelearned.Averycommonopampusageisabuffer.Itspurposeistoprovidehighinputandlowoutputimpedances(voltagedividerconcept)tomaximizesignallevels.Bydefinition,thebufferoutputisthesameastheinput.Anop-ampcanbeconnectedasabuffer,showninfigure4.74.It’scalledvoltagefollower(unitygainamplifier)becausetheoutput“follows”theinputwith
gainofone.Comparingtosourceandemitterfollowers(single-ended),avoltagefollowerissuperiorbecausetheoutputisthesameastheinputwithoutanyvoltagedrop(recallsourceandemitterfolloweroutputisslightlylessthantheinput).
Figure4.74:VoltagefollowerThisop-ampconfigurationaboveisanon-invertingamplifierwhereinputvoltageconnectstothepositiveterminal.Usingthevoltagegainequationdevelopedearlier:
BecauseRiandRfdonotexist,thismakesvoltagegaintransferfunctiontobe1,i.e.,Vout=Vin.Infigure4.74,theop-ampoutputis5V,whichisequaltotheinput.
SummingAmplifier
Thenextcircuitinfigure4.75iscalledsummingamplifier.Itisaninvertingamplifierwithmultipleinputsconnectingtothenegativeterminal.
Figure4.75:Multiple-inputsop-ampApplyinvertingamplifierandKCLrules,andvirtualgroundisestablishedinthefollowingcircuit(seefigure4.75a)andmodifiedcircuitinfigure4.76onthenextpage.
Figure4.75a:Virtualgroundatnegativeterminal
Figure4.76:Modifiedmultiple-inputcircuitApplyKCL,IA+IB=I
Iand–Iareequalbutflowinoppositedirections:
Thiscircuitisasummingamplifiercircuitwithaninvertedoutput.Itaddsallinputvoltagestogether.TheresultofthesumarrivesatVoutisphase-shiftedby180degrees.
ActiveLow-PassFilter
Let’snowuseACcomponentsunderstandop-amps.Figure4.77low-passfilter.WecoulddevelopaVout/Vintransferfunctionusingstandardop-ampandcapacitivereactancerules.Foraninvertingamplifier:
tofurther
isanactive
Figure4.77:Activelowpassfilterusingop-amp
Thisisalow-passfilterwithhighinputandlowoutputimpedancesbytheop-amp(activedevice).Insomecases,youmaywanttomaintainfinitegaininhighfrequency.Asimplechangetothecircuit(addsRf)infigure4.78achievesthat.Revisedtransferfunction:
Figure4.78:AddRfinactivelow-passfilter
Basedonthistransferfunction,startingatlowfrequency,thedenominatorisclosetozero.Vout/Vinislarge.Inputfrequencystartstoincrease,andVout/Vinstartstofallat20dB/decaderate.Atextremelyhighfrequency,voltagegainremainsroughlyconstantbecause2πfCcancelouteachother:
Thetransferfunctionisbestdescribedbyabodeplot(seefigure4.79).
Figure4.79:BodeplotAgainfromVout/Vouttransferfunction:
Athighfrequency,voltagegainremainsconstantandholdssteadybyRftoRi’sratio.Thebodeplotaboveisanexcellentmethodtoverifycircuitbehaviorsandperformances.Withtheuseofcapacitorsandinductorsinfeedbackcircuits,youneedtotakephaseshiftintoconsiderationbecauseitcouldpotentiallycauseoscillations.RecallRC,voltage,andcurrent(lead,lag)characteristicsinchapter3,AC.Feedbacksignalarrivingbackattheinputmayeitherleadorlagoutputsignals.TheseL,Ccomponentscouldcausecircuitstobehaveerratically(circuitoscillation).Unwantedoscillationscreatenoiseandunstableoutputinthesystem.Theyshouldbepreventedatallcosts.Thecriteriaofoscillationdependonphaseshiftthatexceeds360degreeswhengainisaboveunity.Incircuitdesignanalysis,gainandphasemarginsareoftenusedtodetermineoscillationcriteria.Wewilllookacloseratthesecircuitdesigncriterialaterinthepositivefeedbacksection.
CircuitSimulator
Oncircuitdesignprocess,circuitsimulationsoftwarelikeMultisim(madebyNationalInstruments)ispopularamongacademia.Oftenusedinelectronicscourselabsbystudents,Multisimconstructs(schematicentry)analoganddigitalelectroniccircuitsatthedevicelevel.Youcaneasilyplaceschematicsymbolsandconnectthembywiresinsoftware.Multisimofferssimulationcapability(DC,transient,andAC).Thesimulation
resultscanbedisplayedoncomputermonitorsingraphsandwaveforms.Youcanplacetestprobesonnodes(nets)tomeasureVandIanywhereintheschematic.Addingelectronicsinstruments(DMM,oscilloscope,functiongenerator,etc.)isconvenientwithafewmouseclicks.It’sagreatwaytoconfirmtheoriesandverifyapplicationsbeforebuildingthephysicalcircuits.Figure4.80and4.81showanop-ampsimulationbench,componentselectionwindow,andscopewaveformwindow.
Figure4.80:Multisimschematiccapture(CourtesyofNationalInstruments)
Figure4.81:Multisimcomponentselectionandoscilloscopesimulationwaveform
ThecommercialversionofMultisimisavailablewithmoreadvancedfeaturessuchasdevicemodelmodifications.Thismeansthesoftwarewillincluderealworldparasiticparametersintotransistor,resistor,diode,capacitor,andinductormodels.Thecomputersimulationsoftwarethenusestheseparametersandfeedsthemintothesimulationalgorithmtoreflectwhatcouldbetherealisticcircuitbehavior.Theresultscanbeverifiedusinggraphicalwaveformsandprobesintheschematics.Thisdesign-checkprocessofferstremendouscostandtime-savingbenefitsintermsofmakingsurethedesignonpaperperformscloselytothefinalhardware.Beingabletoverifythedesigntoacertaindegreeusingcomputersimulationsbeforerunningthroughthemanufacturingsavestimeandmoney.Ontheotherhand,simulationscouldonlymimicthereal-worldscenariotolimiteddegrees,dependingonhowaccuratethemodelsare.Inspiteofmodelimperfections,newchipdesign(firstsilicon)comingoutoffabusuallymeetbasicspecifications.BesideNationalInstruments,CadenceDesignSystems,MentorGraphicsandSynopsisaremarketleadersinICdesignandsimulationsoftware.Onthetestfront,inadditiontoDMM,powersupplies,andfunctiongenerators,oscilloscopesarestandardequipmentstomeasureACcircuits.Oscilloscopes(scopes)aretime-measuringtestequipmenttakinginputfromanACsignal.Theycomeinawidevarietydifferentiatedbythechannel
numbers,resolutions,andspeed.Manyhigh-endscopesarecapableofmeasuringingigahertz(GHz)orgigabitspersecond(Gbps)withbuilt-inprintersandtouchscreendisplays.Scopeshaveconnectors(plugs)thatallowBayonetNeill-Concelman(BNC)cablestobeconnectedtoit.AttheotherendofthecablewouldbetheACsignalbeingmeasured.ThescopedisplaysX-axisastime,Y-axisaseitherthecurrentorvoltage.Userscanzoominandoutofthewaveformusingvoltageandtimescalesknobs.Figure4.82showsanAgilentDSO5012ASeriesOscilloscopewithdualchannel,100MHz,2Gsample/s.Thevoltageprobeinthefigureconnectselectroniccircuitsandoscilloscopes.Oneendofthescopeprobeconnectstothescopeconnector.Theprobetipontheotherendconnectstothecircuitofinterest.Probesaredividedintocategoriessuchasactiveorpassive.Activetypescontainamplifierstoamplifysignals.Passiveonesarelessexpensivewithresistorsandcapacitorsbuiltintothem.Manyprobescomewithswitchableattenuationsettings,e.g.,1X,10X.TheXrepresentstheattenuationratio.For1X,thesignalatthetestpintoscopeconnectoris1:1(noattenuation).10Xmeansthesignalarrivingatthescopeisreducedby10timesrelativetothetestpinsignal.Probedatasheetslistprobeparametersincludinginputresistance,capacitance,bandwidth,voltagerange,etc.1Xand10Xprobes’parametersmaydiffergreatly.The10Xsettingofferslowercapacitance(<20pF)withmuchwiderbandwidth.
Figure4.82:AgilentDSO5012ASeriesOscilloscopewithscopeprobe
Gettingfamiliarwiththeseparametershelpsengineersandtechniciansselecttherightprobetypeforaspecifictestormeasurementtask.Anotherpopularelectronicapparatusisthefunctiongenerator.ItgeneratesACsignalsdrivingtoaloadasanACsignalsource.Mostfunctiongeneratorsarecapableofproducingsignalssuchassine,square,ortriangularwaves.Frequencyadjustment,offsetdialknobs,andoutputconnectorscanbefoundinfunctiongenerators.TektronixandAgilentareleadingfunctiongeneratorsuppliers.Figure4.83showsaTektronixAFG2000FunctionGeneratorwith20MHzbandwidth,14-bitresolution,and250MS/ssamplerate.
Figure4.83:TektronixAFG2000FunctionGenerator(CourtesyofTektronix)
Hysteresis
Testequipmentandelectronicsystemsrequiretheuseofhysteresistoreducefalsetriggercausedbysystemglitches.Anexampleishouseholdair-conditioning(A/C)andheatingsystemsusingathermostat.Figure4.84showsthetemperatureprofileofaroomovertime.Whenthetemperaturerisesabovea27°Csetpoint,theA/Csystemturnsontobringthetemperaturedown.Meanwhile,whenthetemperaturefallsbelowthesetpoint,theheatingsystemturnsontobringthetemperaturebackup.Thesingletemperaturesetpointtriggersmanyon-offpulses(falsetriggerdenotedbythedottedcirclesinfigure4.84).Thisincreasesthewearandtearofthesystemovertime.Topreventthat,ahysteresiszonecanbeimplemented.Infigure4.85,thehysteresiszoneconsistsoftwothresholds(upperandlower).TheA/Csystemonlyturnsonwhenthetemperaturegoesabovetheupperthreshold.Ifitfallsbelowtheupperlimit,thesystemignoresitandtheoutputremainshigh.Whenitcrossesthelowerthreshold,theheatingsystemturnsontobringthetemperatureup.Thedetailedimplementationofhysteresiswillbediscussedinthenextsection(positivefeedback).
Figure4.84:Temperaturecontrolwithsingletemperaturesetpoint
Figure4.85:Temperaturecontrolwithhysteresis
Usingpositivefeedbackinanop-ampcanimplementthehysteresistechnique.Figure4.86ashowsasampledop-amphysteresiscircuitwithVinandVoutwaveforms.Thisop-ampisaninvertingcomparatorwithVinconnectingtothenegativeterminal(V–)whilethepositiveterminal(V+)tiestothemidpointofthevoltagedivider(R1andR2)formingapositivefeedbacknetwork.V+becomestheupperandlowerthresholdsofthecomparatorsetbytheR1,R2voltagedivider.WhenVinstartsat0V(Low)andrises,Voutflipstothepositiverail5Vsaturatingtheop-ampoutputstage(V–<V+,invertingamplifier),asshowninfigure4.86b.Theupperthresholdisnowsetat2.5Vbythevoltagedivider.WhileVincontinuestoincreasefrom0V
Figure4.86a:Op-ampwithhysteresis,Vin
(before2.5V),Voutstaysat5Vduetothecomparator’shighgain.OnceVinrisesslightlyabove2.5V,Voutflipstothe–5Vrail(V–>V+).Now,thecomparator’sthresholdV+isat–2.5V(setbythevoltagedivider).Vincontinuestoincreaseabove2.5VwhileVoutremainsat–5V(V–>V+).AsVin(V–)startstofallfromitspeakjustbelow2.5V,itcontinuestostaylow.V–remainslessthanV+.OnceVin(V–)fallsbelow–2.5V(V–<V+),Voutflipstothepositiverail.Thesamemechanismrepeatstothenextcycle.TheupperandlowerthresholdscanbeeasilysetbyvaryingthesizesofR1andR2.
Figure4.86b:Hysteresiswaveform
PositiveFeedback(Oscillation)
Thepositivefeedbackinthepreviousconfigurationisintentional.However,inanyop-ampfeedbacktopologieswherethefeedbackresistornetworkisused,unwantedoscillationcanoccurundercertainconditions.Circuitoscillationsareperiodicsignals,whichcanbeintentional(oscillator)orunintentional.Iftheyareunintentional,oscillationsbecomeunwantednoisetothesystem,adverselyimpactingoverallcircuitperformance.Youneedtomakesurecircuitoscillationdoesnotoccurunlessitisintended.Tounderstandoscillation,wefirstneedtounderstandwhyandhowoscillationoccurs;thenweexaminehowtopreventitfromhappening.Thecauseofcircuitoscillationisduetopositivefeedback.Forexample,assumeanop-amp’sinputisanACsource.Theop-ampemploysresistorfeedbackarchitecture(see
Figure4.87:Non-invertingamplifier,poles
figure4.87).Inthisexample,aninvertingamplifierisused.Therearecapacitorsinsideandoutsideoftheop-amp.Theinternalcapacitorscanbebydesignorparasitic.Theexternalcapacitoristhecapacitiveload(CLoad).Thecapacitors’presentpolesinthesignalchainareimposingphaseshiftonthesignal(chapter3,AC).Capacitorvoltageislaggingresistorvoltageby90degrees.Thisphaseshiftbecomesthecriteriaforcircuitoscillation.Thesecondeffectfromthepoleissignalattenuation(low-passfilter),wheresignalisreducedby–20dBperdecade.Eachtimeasignalpassesthroughapole(capacitor),itattenuatesbyanother–20dB.Thelargerthecapacitor,themoreattenuationisasserted.Bothphaseshiftandsignalreductionformthebasisofoscillation.Thisphenomenonisexplainedbythebodeplotshowninfigure4.88.
Figure4.88:Gain,phasebodeplot
Thisamplifierpresumestohave100dBofopen-loopgainand60dBclosed-loopgainat90kHz.Therearetwopoles.Thefirstpole(CLoad)rollsofftheamplifiergainby–20dBandcausesa90-degreephaseshift.Thesecondpolegivesyetanother–20dBtotaling–40dBrolloff.Thissecondpolecontributestoanother90-degreeshiftthatgivesatotal180degrees.Becausecapacitorslagresistorvoltageby90degrees,twopoles(90+90)plusthecapacitorlagvoltages(90+90)yieldatotalof360-degreephaseshift.Bothfeedbackandtheoutputsignalarenowsuperimposedwitheachother(positivefeedback).Withthegainatthesecondrolloffstillaboveunitygain(0dB),thiscircuitisnowinunstablecondition(oscillation).
Toensurestability,phaseshiftneedstobelessthan180degreesforanygainlargerthanunity(0dB).Inotherwords,amplifiergainata180-degreephaseshiftneedstobelessthan0dBgain.Theseconditionsbecomethestabilitycriteria.Toachievethis,weaddadominantpole(externalorinternal)atthelowfrequency,deliberatelymovingthegaincurvetotheleftsothatbythetimeitrollsofftounity,phaseshiftislessthan180degrees.Thistechniqueiscalleddominantpolecompensation(seefigure4.89).Thedownsidetothisfrequencycompensationtechniqueisthatdesiredgainisnowatalowerfrequency,reducingamplifierbandwidth.Essentially,youaretradinggainforbandwidthbyaddingadominantpole.Thereareothertypesofcompensationschemestoensureamplifierstabilitysuchaslead,lag,andfeed-forwardcompensations.Thedetailsofthesetechniquesarebeyondthescopeofthisbookandwillbediscussedinotherpublicationsbytheauthor.
Figure4.89:Dominantpolecompensation
InstrumentationAmplifier
Sofar,tocontrolgains,allop-ampswereconstructedwithexternalfeedback.Aninstrumentationamplifier(INA)allowsgaincontrolwithexternalfeedbackwhilemaintaininghighinputimpedance.TheprimarilyuseofINAistoofferhighdifferentialgainandrejectcommonmodesignaloriginatingfromnoise.INAscomeinmanyforms.Oneofthemostpopularoneisthetwoop-ampINAshowninfigure4.90.
Figure4.90:Twoop-ampinstrumentationamplifierBothinputsVIN1andVIN2connectdirectlytotheop-ampinputsofferingextremelyhigh
inputimpedance.ThedifferentialgaintransferfunctionoftheaboveINAisasfollows:
LinearRegulator
Aspreviouslydiscussedinchapter2,Diodes,and3,AC,azenerdiodeisalinearregulator.Thecircuitfromfigure2.12isshownagaininfigure4.91.Azenerregulatorcomeswithdeficiencies:zener’scathode(nodeZ)ishighimpedance.Unlessaload’simpedanceisextremelyhigh,outputdegradessubstantially(voltagedivider).Thisproblemcanbesolvedbyusinglow-outputimpedanceofemitterorsourcefollowersasbuffershowninfigure4.92.Thedottedrectanglerepresentstheimpedancetransformationmodelfromhightolow-outputimpedance
(upperrightoffigure4.92).Therearetwo
voltagedividers.The
Figure4.91:Zenerregulator
Figure4.92:Bufferedzenerregulator
Figure4.93:MultipleinternalzenersupplieswithNFETbuffer
zener’scathodeishighimpedance(RZ+Rgate).AfterbufferingitwithanNFET,thesourceisnowtheoutputofferinglowimpedance(RS).RsformsyetthesecondvoltagedividerwithRLoad.TheseconddividerretainsasmuchVZaspossible.Thetrade-offofthisdesignisthelossofoneVGS.AssumeVGS=1VforagivenNFETsize:
VOUT=5V–1V=4V
IfsizingtheNFETproperly,VGSanddraincurrentoptimizetheoutputvoltagewhilemeetingoutputcurrentrequirements.Inmixed-signalICdesign,it’sdesirabletohavemultipleinternalvoltagesources.Themotivationistoisolatenoise(highspeeddigitalcircuits)couplingtotheanalogcircuitriesandviceversa.Withsuperbtransistor-matchingcapabilitiesinmicroelectronics,highaccuracyinternalvoltageregulatorsarepossible.Figure4.93showsanimplementationexample.VDD_Aistheinternalsupplytoanalogcircuits;VDD_Dpowerthedigitalcircuits.
LowDrop-out(LDO)Regulator
Figure4.94:LDOfunctionalblockdiagram
Alowdrop-outregulatorisalinearregulatoroperatingbyfeedbacknetworkwithsensingcircuits.Figure4.94showsafunctionalblockdiagramofLDO.RLoadcouldchangeregularly.Forexample,fanspeedvariescausingitsloadcurrenttofluctuate.Thesechangesresultinloadcurrentchange,ultimatelychangingVout.LDOhasafeedbacknetworkthatsensestheoutputvoltage(voltagedivider).This
voltage(errorvoltage)isthenusedtoadjusttheinputcurrent(Iin=Isense+ILoad)accordinglytokeepVoutatitsdesiredvalue.It’smerelyanegativefeedbacksystemwheretheinputcurrentmodulatesfromtheresultsofthesensecircuit.IftheVoutfalls,IinincreasestobringVoutbackup.Italsoworkstheoppositeway.IfVoutgoesup,IindecreasestobringVoutdown.It’scalled“lowdrop-out”becausetransistorsareusedasacurrentsourceinLDO.Byforcingatransistorintosaturation,VoutcangetfairlyclosetoVinbeforedroppingoutofregulation.Thisisadvantageousfromapowerefficiencystandpoint.Asatransistorgoesintosaturation,itdissipatestheleastpoweramountincreasingefficiency.Forthisreason,LDOissuitableforbattery-poweredapplicationswherelowpowerconsumptionisdesirable.Thetrade-offofLDOistheneedforcompensationtokeepthenegativefeedbackloopstable.Figure4.95showsanLDOexample.ItusesaPNPtransistorcalledthepassdeviceasaswitch.Theon-chiperroramplifiersensestheoutputbythevoltagedividerR1andR2atVsense.Thisfeedbackvoltagefeedsintothenegativeterminalofanop-amp(erroramp).Vsenseisconstantlycomparingagainstthereferencevoltage(Vref).Theerroramplifierwilldowhateverittakestomakethetwoinputterminalsequal(op-amprule).
Figure4.95:LDOexample
Forexample,thelead-acidbattery,apopularbatterytypeforportabledevicessuchasrechargeableradiosandlamps,isusedasVin.Ifthebatteryoperatesat6Vnominally,Voutregulatesat5VbytheLDO.AsRLoadchanges,Voutfallsbelow5V(Step1).VsenseisnowlowerthanVref(Step2).Theerrorampisaninvertingamplifier.Wheninputgoeslow,outputrises.Theerrorampeffectivelycapturesasampleoftheerror,liftingitsoutput(Step3).Theop-ampoutputthenraisesQ1baseturningitonmore(Step3),pullingitscollectordown(Step4).BecauseQ1’scollectortiestoQ2’sPNPbase,PNPnowturnsonmoreasthebasegetspulleddown.Asaresult,Q2,nowsuppliesmorecurrent(Step5)toRLoad,bringingVoutbackupuntilVbe=Vrefagain.ThesameconceptapplieswhenVoutgoeshighermakingVsense>Vref.Tosettheoutputvoltage,asimpledividerruleisused.Forexample,if2.5Visthedesiredoutputvoltage,Vref=1.25V,R1=1kΩ,R2wouldbe:
R1=1kΩ,R2=1kΩ
ThevoltagewheretheVoutstartstofalloutofregulationiscalledthedrop-outvoltage.It’sacriticalLDOdesignparameter.Thedrop-outvoltageistheminimumvoltageacrossthecollectorandemitter.Thelowestdrop-outvoltageofthisexampleistheVCEsat(saturationvoltagebetweencollectorandemitter).ThisisthevoltageatwhichLDOis
stillabletomaintainregulation.Thesmallerthisvoltage,thebettertheLDOisbecausetheitutilizesthemostavailableVinbeforefallingoutofregulation.Inthisdesign,thePNPVCEsatcanbeaslowas0.7V.Drop-outvoltagerelatesstronglywithloadcurrent.Forlowloadcurrent,VCEsatcanbeaslowas50mV.Suchlowdrop-outvoltagehaspropelledLDOapplicationstoportable,handhelddevicesinrecentyears.Inadditiontodrop-outvoltage,transientresponseisalsoadesignparameter.Outputcouldchangequickly.IttakestimeforLDOtorespond.Thistimedelayisanimportantconsideration,especiallyintiming-criticalapplications.ThetypeofVinisanotherdesignconsiderationwhereVincouldberectifiedACorpureDC.MostLDOsareabletoregulateVouttoascloseas+/–5%ofthenominalvalue.LDObyitselfdrawscurrenteventhoughtheRLoadisdisabledoridle.Thisquiescentcurrentbecomesthedominatingfactorofdraininginputbattery.ManymodernLDOsintegratespecialfeaturesincludingthermalshutdownandcurrentlimitcapabilitiestopreventdamagefromexcessivetemperatureandcurrenttotheLDOICs.Forexample,loadcouldsuddenlydropsignificantly,overloadingtheoutput.Thisexcessivecurrentcoulddamagethepassdeviceifcurrentlimitcapabilitydoesnotexist.Excessivecurrentcanalsobecausedbytheinputvoltage(inrushcurrent).Thedetaileddesignimplementationofthermalshutdownandcurrentlimitisbeyondthescopeofthisbook.However,thefunctionalblockdiagramofthesefeaturesisshowninfigure4.96.
Figure4.96:LDOwithcurrentlimitandthermalshutdownfeatures
Inthisexample,acurrentlimitresistor,V_iLimit(betweenQ2collectorandVout)isaddedtotheLDO.Thesizeoftheresistordeterminesthecurrentlimitthreshold.Theinternalcurrentlimitcomparator(iLimit)controlsQ2.IfovercurrentisdetectedbythevoltagedropacrosstheV_iLimitresistor,forexample,Voutsuddenlyshortstoground.Q2’sbasewillthenpullup,shuttingitselfoff.Asaresult,nocurrentwillflowtotheloadwithoutdamagingthepassdevice(Q2).Thethermalshutdowncircuitusesthepositivetemperaturecoefficientoftheresistortocombinewiththenegativetemperature
coefficientofVBEdiode.Atemperaturetransferfunctionandthresholdcanbedeveloped.Oncethetemperaturegoesabovethedesignedtrippoint,thetemperaturesensor’scollectorpullsup,yankingQ1’sbasedown.Q1collectorpullsupturningoffQ2.LDOisthendisabled.Bothfeaturespreventcurrentflowtotheloadreducingthepossibilityofdamagingthepassdevice.
Summary
Analogelectronicsinterface,transform,andprocessmanyanalogquantitiesinallkindsofapplications.AnalogelectronicsshouldbetreatedasanextensionofDC,diodes,andAC,becausebipolartransistorsaremadeoftwodiodes.Withoutacompleteunderstandingofdiodes,it’sdifficulttogetagoodgraspoftransistors.Fullanalogelectronicsunderstandingleadsustoadvanceddigitalsignalprocessing(DSP)andmorecomplexelectronicsystems.Thebuildingblocksofanalogelectronicsaretransistors.Transistorscomeinmanyshapesandforms.BipolarandCMOSarethemostpopulartypes.Switchesandamplifiersarecommonapplicationsbuiltbytransistors.Transconductancesmall-signalmodelsaresuitableforfindingouttheexactvoltage,current,andpowergainsofanamplifierdependingupontheamplifiertopologies.Theop-ampisbyfarthemostwidelyusedelectronicdevicethatisimplementedinalargenumberofdesigns.Thischapteronlycoversafewop-ampcircuits.It’suptothereadertofurtherexploreothercircuitimplementationsaswellasdesigntechniquesandtradeoffs.Withasolidunderstandingoftransistorsandop-amps,complexcircuitscanbeeasilybuilt,tested,andanalyzed.
Quiz
1)Designasimplecurrentsource.Useonediode,oneresistor,andonevoltagesource.Yourdesigntargetis10uAfroma5Vsupply.AssumeVBE=1V.Hint:ShorttheNPNbaseandthecollectortogethertoformadiode.
2)Anamplifierhasthefollowingopen-loopfrequencyresponse(seefigure4.97).FromDCto10kHz,gainisat100dB.Estimateunity-gainfrequency.
Figure4.97:Amplifierfrequencyresponse3)Vin=5V,R=1kΩ.Calculate1)Outputcurrent(Iout),2)NPNbasevoltage.VBE=1V.Hint:IB=0A.Op-ampisconnectedasavoltagefollower(seefigure4.98).
Figure4.98:Op-ampcurrentsource
4)Manyanalogapplicationsinvolvemeasuringtemperature.Athermocoupleisoftenusedtomeasuretemperatureandproduceananalogvoltage.Thermocoupledevicesconsistoftwopiecesofwire(conductor)madeofdifferentkindsofmaterials.Thefirstconductorgeneratesavoltagechangefromtemperaturechange.Thesecondconductortypewouldgenerateavoltagegivingadifferenttemperaturegradientchange.Thetransferfunctionoftemperatureperdegreedependsonthethermocoupletype.AK-typethermocouplegivesabout40uVper°CwhileanS-typewouldgiveroughly7uVper°C.Figure4.99belowshowsatypicalthermocoupleapplication.
Figure4.99:Thermocoupleapplication
Thermocouplesaregenerallysmallwithfastresponsetime.Themajorissueswiththermocouplesaresmalloutputimpedance.Asignalconditioningcircuitmayberequiredbeforedrivingthenextstage.Ifthethermocouple’soutputimpedanceis50kΩ,itconnectstoananalog-to-digitalconverter(ADC)thathas1MΩinputimpedance.TheVOUTmeasuredbythethermocoupleis450mV.WhatisthevoltagethatappearsattheADCinput?IftheminimumADCinputvoltagerequires99%ofthethermocoupleoutputvoltage,whatdoyouneedtoaddinthesystemtomeettheADCinputrequirement?5)ASchottkydiodeisaspecialdiodethatfeatureslowforwardbiasvoltage(150mVto
450mV)andfastresponsetime(100psto10ns).Figure4.100showsaSchottkydiodeschematicsymbol.
Figure4.100:Schottkydiodeschematicsymbol
ThesetwofeaturesmadetheSchottkydiodeagoodcandidateintheswitchmodebuckregulatordescribedinchapter3,AC.OneotherpracticaluseoftheSchottkydiodeistoavoidbipolartransistorsaturation.RecalltheNPNsymbolfromfigure4.7.Figure4.101belowshowsabase-collectordiodeandcommonemitteramplifier.
Figure4.101:Commonemitteramplifier
AsVingoesup,voltageacrossthecollectorresistorincreases,causingVCtodecrease.ExcessiveVinincreasecouldcauseVCtogotoolowforwardbiasingthebase-collectordiode.HowdoweutilizetheSchottkydiodetoavoidNPNsaturationknowingthattheSchottkydiodeofferslowforwardvoltagedrop?6)Apopularcircuittechniqueistheopen-collector(bipolar)oropen-drain(CMOS),
showninfigure4.102.OneoftheapplicationsofthiscircuittechniqueisI2C(isquarec)communicationprotocolforclockanddatalines.ThedraininthiscircuitconnectstoanexternalR1(pull-upresistor).It’scalledpull-upbecausewhenQ1isoff,theexternalpinpullsuptotherailgeneratingalogic“1”(true)signalandviceversa.Byknowingtheon-resistanceofQ1andR1sizesandtheprecisevoltage,currentconsumptioncanbeobtained.Assumetherailvoltageis5V,Q1on-resistanceis200mΩandR1is4.7kΩ(thetypicalsizeofI2Cimplementations).Whatisthevoltageattheexternalpinwhenthecontrolsignalgoeshigh?
Figure4.102:Open-draincircuit
7)Figure4.103showsanopen-loopinvertingcomparatorcircuitusingaCMOS-basedinputop-amp.Referencevoltage(Vref)isassumedtobe2V.VinisasinusoidalvoltageinputwithVpeak–peak=0Vto+4V.Positiveandnegativerailvoltagesare5V,–5Vrespectively.DrawaVoutwaveform.(Hint:AssoonasVingoesaboveVref,Voutflipstothenegativerailandviceversa.)ThepurposeofRiistoreducedynamicgatecurrentduetotheCMOStransistorgatebeingpronetodamage.
Figure4.103:Open-loopOp-ampcomparator8)Designanactivelow-passfilterwithf–3dbat10kHzandafixedgainof10startingat1MHz(seefigure4.77),assumingRi=100kΩ.
9)Figure4.104showsthepackageofastandardMOSFET,2N7002byNXPSemiconductor.ThisMOSFETisspecat60V,300mANFET.60Visthemaximumdrain-to-sourcevoltage.300mAmeansthatthisNFETiscapableofsupplying300mAdraincurrent(ID)ataspecificVGS.UsethedatasheetbelowandfindtheVGSvaluesothat2N7002’sdraincurrentis300mA.
http://www.nxp.com/documents/data_sheet/2N7002.pdf
Figure4.1042N7002MOSFET(CourtesyofNXPSemiconductors)10)On-resistance(RDSon)isnon-zeroinrealtransistors.WhatistheRDSonanddraincurrent(ID)of2N7002ifVGS=5V?11)UsePFETtodesignaWilsoncurrentmirror.Thecurrentmirrorwillproducea10uA
referencecurrentassumingIDis1uAwhenVGS=1V.
Chapter5:DigitalElectronics
Digitalelectronicsarefoundinallkindsofelectronicsystems.Digitalsignalsdifferfromanalogsignalsinthatanalogquantitiesarenon-discretewithalimitlessnumberofpossibilities,potentiallyleadingtounwantednoise.Digitalsignalsdealonlywithtwo,simple,well-defined,discretelevels:low(false)andhigh(true).Thebinarynumbersystemisusedtodescribethesetwolevels:digit0(low)anddigit1(high).Thetimingdiagramdescribesthedigitalsignalsinfigure5.1.
Figure5.1:Digitalsignaltimingdiagram
Withthesimplicityofdigitalsignals,theybecomethepreferredchoicetoprocesslargeamountsofinformation(data)withhighclockspeed.Duetoincreasingdemandforhandlinglargedataamountsfromprocess-intensiveapplicationssuchashigh-bandwidthinternetdatacommunications,next-generationwirelesstechnology,videos,andCPUsincomputingapplications,largetransistorcountsareneeded.ACMOStransistorcanbemadeverysmallandrelativelyinexpensivelyusingsub-micron(lessthanamicrometer)manufacturingtechnology.DensedigitalcircuitsliketheInteli7CoreCPUhasadie(chip)sizemeasuredapproximately300mm2(seefigure4.32).Itcontainsover1billiontransistors.Manydigitalcircuitsarecalledlogiccircuits.Theexactvoltagelevelsofthetwobinarydigitsdependonthetechnology.AdvancedCMOStechnologycanhavelogic1definedas0.5V;logic0as0V.Basiclogiccircuitbuildingblocksarecollectivelycalledlogicgates.Inthenextfewsections,wewillfocusonthesebasiclogiccircuits.Thenwewillmoveontomorecomplexdigitalsystems.Logicgatescomeinwidevarieties.ThemostbasictypeistheNOT-gate,discussedinnextsection.
1sand0s:TheInverter
ThelogicNOTgateschematicsymbolisshowninfigure5.2.Theleft-handsideofthesymbolrepresentstheinput.Thesmallcircleontheright-handsiderepresentstheoutput.ANOTgatecanalsobecalledaninverter.
Figure5.2:Inverterschematicsymbol
Aninverterisasingled-endedinputandoutputdevice.Whentheinverterinputishigh,outputislow,andviceversa.Atruthtableisoftenusedtoexaminehowlogicgateswork.Atruthtablelistsallinput,output,terminalnames,andtheinput-outputcombinations.Seeinvertertruthtable(table5-1).
Table5-1:Invertertruthtable
TheNOTgate’struthtableisdividedintoinputandoutputcolumns.Therearetwopossibleinputcombinations(highorlow)expressedintworows.Whentheinverterinputis1,theinverteroutputs0.Whentheinputis0,itoutputs1.Figure5.3showsanACsquarewave’slogicinputandoutputafterbeingprocessedbytheinverter.
Figure5.3:InverterACsquarewave
NMOSInverter
Infigure4.38fromchapter4,AnalogElectronics,anNFETandresistorareusedtoconstructaninverter.WhenVINishigh(e.g.,5Vlogic),VOUTatthedrainislow.InhighdensityCMOSdesign,twoCMOScomplimentarytransistors(NFET,PFET)areusedinstead.Thereasonforthatisbecauseofpowerconsumption.ComparedtoaPFETand
NFETtypeofinverter,anNFETandaresistorinverterdrawmorepower.Thisisnotanidealsituationforpowersensitiveapplicationssuchashigh-speedCPUdesign.Wheninputishigh,NFETisenhanced,andcurrentflowsthroughtheresistor;NFETandtheresistorareburningI2Rpower.
NFETandPFETInverter
AnN,PFETinverter,ontheotherhand,worksdifferently.Figure5.5showsthatthePFETconnectstoNFETinseries.Bothgatestietoeachotherastheinput.Thedrainsareconnectedtogetherastheinverteroutput.
Figure5.4:NMOSinverter
Figure5.5:N,PFETinverterUsingtable4-4belowfromchapter4,AnalogElectronics,inverteroperationscanbeeasilyexplained(seetable5-2).
Table5-2:InvertertruthtablewithN,PFETon,offrequirements
InverterAction
TounderstandNFETandPFETinverterweneedtomodelthetransistorsasaswitch.The
followingswitchmodesinfigure5.6furtherdescribethesecircuitoperations.IftheFETison,it’senhanced(switchclosed).IftheFETisoff,it’scut-off(switchisopen).IfthegateisfedhighatVIN(left-handsideoffigure5.6),PFETturnsoff(topswitchopens),NFETisenhanced,andVOUTpullsdownduetoanon-existingcurrentpath.WhenVINislow(right-handsideoffigure5.6),NFETturnsoff(bottomswitchopen),PFETenhanced,andVOUTpullsupduetoanonexistingcurrentpath.
Figure5.6:Inverterswitchingaction
ThisinverterworksmuchbettercomparedtotheNFETinverterinfigure5.4.Firstofall,itdoesn’tdrawmuchcurrentsavingsubstantialpower.Secondly,thesizeofFETcanbedrawnrelativelysmallerthanaresistor(savingarea,hencecosts).
Shoot-ThroughCurrent
Atfirstglance,itappearsthatthisinverterdoesnotdrawanycurrentatall.Butifyoulookclosely,you’llseethatitdrawstransientcurrentduringVINtransitioningfromhightolowandviceversa.Thiscurrentiscalledshoot-throughcurrent.Figure5.7showstheVINtransitioncausingtheshoot-throughcurrent.PayattentiontotheVINmidpoint(2.5V).BothPandNFETsareenhancedatthemidpointofVINcausingcurrenttoflowthroughbothtransistors.Theresultofthatistheshoot-throughcurrentoccurringateachVINtransition.Figure5.8isashoot-through
currentwaveformwithrespecttoVINtransitions.
Figure5.8:Shoot-throughcurrentwaveform
Figure5.8a:DeadzoneFigure5.7:Invertershoot-throughcurrent
Dependingontheimpedanceofthetwotransistorsandthecomponentsattachedtothem,theshoot-throughcurrentamountcanbeasignificantsourceoftransientnoise.Toavoidthis,theinvertercanbedesignedsuchthatthresholdvoltage(VT)isdifferentbetweenNandPFETs.Itmeansthattheyarenolongerenhanced(on)atthesametime.Varying(skewing)thewidthandlengthofthetransistorscouldachievejustthatbyusingthedraincurrentequationfoundinchapter4,AnalogElectronics.Somerefertothistechniqueasbreak-before-makeordeadzone(seefigure5.8a).Theshadedareaisthedeadzone.Withinthezone,bothNFETandPFETareoff.Thispreventsshoot-throughcurrentattheexpenseofslowertransitiontime.Therearemanyotherdesigntechniquesandtrade-offsindesigningtransistorcircuits.In-depthunderstandingoftransistorsisthekeytodesignsuccessmeetingbothdesignandtapeouttarget.
RingOscillator
Apopularcircuitcalledaringoscillatorismadeofinverters.Ringoscillatorscanbeusedinsemiconductorprocessdevelopmenttocharacterizedeviceperformance.Aringoscillatorcomprisesthreeinverters(seefigure5.9).Supposetheinputsignallevel(farleft)islogic0(dottedoval),theNOTgateinvertsitandyieldslogic1(firstinverteroutput).Thislogic1feedsintotheinputofthesecondinverter.Thisinverterchangesittologic0.Atthethirdstageoutput(farright),ityieldslogic1again.Thislogic1(farrightinverteroutput)resetstheinputofthefirststagefrom0to1(dottedline).Thelogiclevel
continuestotogglebetween0and1.Asaresult,aperiodicACsquarewaveisgenerated.Noticethattheringoscillatorrequiresanoddnumberofinverterstofunctionproperly.Ifanevennumberofinverterswereused,theringoscillatoroutputwouldbelocked(latched)inonestate(DClevel).
Figure5.9:Inverter-basedringoscillator
Althoughtheringoscillatorwaveformisasquarewave,it’shardlyaperfectone,meaningthattherisingandfallingedgesofthewaveformarenotinfinitelyfast.Recallthattransistorgatesformacapacitorbetweengate,oxide,andsubstrate.Asinverterinputrisesfromlowtohigh,itliterallychargesthegatecapacitor,resultingintimedelay.Thisdelayiseasilyexplainedby:
∆t=C(∆V)/IForexample,N,PFETgates’capacitancefora3.3VCMOSprocessis10pF.Dynamicgatecurrentis200nA.Thefrequencyofthisoscillatoris:
Arealinverterwaveformisshowninfigure5.10.
Figure5.10:Realinverterwaveform
Toadjustinverterfrequency,yousimplyincreaseorreducetheinverternumber(increaseordecreasetotaltimedelay),hencethechangesinfrequency.Theothertechniquestovaryringoscillatorfrequencyareadjustingthewidthand/orlengthofthetransistors,andaddingcapacitorsinbetweeninverters(seefigure5.11).
Figure5.11:Useacapacitortoincreasedelayandlowerfrequency
ORLogicGate
Thereareotherlogicgatesthatareinthemixofdigitalbuildingblocks.TheyareOR,NOR,AND,NAND,andXORgates.BelowistheORgateschematicssymbol(seefigure5.12).
Figure5.12:ORgateschematicsymbol
Therearetwoinputs(A,B),oneoutput(O)inanORlogicgate.WeusethebinarynumbersystemtoanalyzedigitalcircuitssuchasanORgate.Binarynumbersusethebaseof2.Withtwoinputs,thetotalinputcombinationsis22=4.TheORgatetruthtableisshownbelow(seeTable5-3).
Table5-3:ORgatetruthtable
ORGateSchematic
SeveraltransistorsareneededtoconstructtheORgate.Figure5.13showstheschematicofanORgate.TwoPFETsareconnectedinseries.TwoNFETsareconnectedinparallel.Recallthetransistoron/offtableinchapter4,AnalogElectronics.TheORgateoperationisunderstoodassuch:IfeitherAorBinputishigh,theNFETdrain(inverterinput)getspulleddown,andtheinverter’soutputishigh.TheoutputonlygoeslowifbothAandBinputsarelow.Whenthisoccurs,NFETsturnoffandPFETsareenhanced,yankingtheinverterinputhigh.Thisresultsininverter
outputbeinglow.ThissatisfiestheORtruth
Figure5.13:ORgateschematictable.BycombiningN/PFETsinseriesandparallelform,logicgatesareeasilyconstructed.
Three-InputORGate
AnORgate,oranyotherlogicgateforthatmatter,canhavemorethantwoinputs.Athreeinput(A,B,C)ORgatesymbolisshowninfigure5.14.
Figure5.14:Three-inputORgateschematicsymbol
Withthreeinputs,thetotalnumberofinputcombinationsis23=8.Thethree-inputORgatetruthtableisshownbelow(seetable5-4).Thereareeightinputcombinationsstartingfrom“000.”Byadding“1”to“000”,ityields“001”(secondrow).Startingfromthesecondrow,itagainincreasesbyincrementsof1.Essentially,thenextrowistheresultofadding1tothepreviousrow.Thisprocesscontinuesuntilitreachesthehighestvalue“111”(bottomrow).
Table5-4:Three-inputORgatetruthtableFromtheORgatetruthtables,youcandevisethattheoutputofanORgateishighifanyoftheinputishigh.Theoutputonlygoeslowifallinputsarelow(firstrow).
LSB,MSB
AmongthethreedigitsintheORgatetruthtable,thenumberonthefarright-handsiderepresentstheleastsignificantbit(LSB).Itcarriesthesmallestweightamount.Thenumberonthefarleft-handsideisthemostsignificantbit(MSB).Itcarriesthelargestvalue.Thisweightedapproachcanbeexplainedbyconverting“110”backtodecimal.TheLSBcurrentlyhasavalueof“0”andhasaweightof20.Theseconddigital“1”hasaweightof21.Finally,theMSBcarriesaweightof22.Tocovert“110”backtoadecimalnumber,multiplythecorrespondingbinarydigitbyitsweight,thenaddthemup:
MSBLSB↓↓(22X1)+(21X1)+(20X0)=6
Allcombinationsofgateinputnumbersyieldanoutputoflogic1,exceptforaninputofall0s.ThenameORgatecomesfromthefactthattheoutputyieldsalogic1ifoneoralloftheinputsishigh.Tofullyunderstandlogicgates,wecan’tjustmemorizethetruthtable.Instead,weneedtofullyunderstandtheinputandoutputconditionsofaspecificlogicgate.Withtheunderstandingoftheseconditions,wecanthencomeupwiththetruthtablevalues.
NORGate
ByaddingadotattheORgateoutput,NORgateisobtained(seefigure5.15).
Figure5.15:NORgateschematicsymbol
ThedotsimplymeansthatalltheNORoutputsareexactlyopposite(inverted)fromtheORgateoutputs.YoucanimaginethereisaninverterattheoutputofanORgate.TheNORgatetruthtableisshownbelow(seetable5-5).
Table5-5:NORgatetruthtable
ANDandNANDGates
AnANDgateisanimportantgateworthdiscussing.TheANDsymbolinfigure5.16containstwoinputs(A,B)andasingle-endedoutput(O).
Figure5.16:ANDgateschematicsymbolThetruthtablebelowdemonstratestheANDgateoperations(seetable5-6).
Table5-6:ANDgatetruthtableTheANDgateonlyyieldshighoutputwhenbothAandBinputsarehigh(bottomrow).TheNANDgateistheoppositeoftheANDgate,whereoutputgoeslowwhenALLinputsarehigh.TheNANDgateissimplyanANDgateplusaNOTgate.TheNANDgatesymbol(soliddotattheoutput)andtruthtableareshowninfigure5.17andtable5-7.
Figure5.17:NANDgateschematicsymbol
Table5-7:NANDgatetruthtable
XORGate
ThelastbasiclogicgateistheexclusiveOR(XOR)gate.XORoutputsgohighiftheinputsaredifferent(rows3and4).Iftheinputsarethesame,outputsstaylow.TheXORsymbolandoperationtableareshowninfigure5.17andtable5-8.
Figure5.17:XORgateschematicsymbol
Table5-8:XORtruthtable
CombinationalLogic
Combinglogicgatestogethercreateanendlessnumberofpossiblecombinations.Theselogiccircuitsarecreatedusingcombinationallogic.Figure5.19belowshowsapracticalexample.Forsafetyreasons,automotivemakersimplementthewindshieldwiperoperationinsuchawaythatthewindshieldonlyworksifthreeconditionsaremet.First,thefronthoodiscompletelyclosed,andboththewindshieldwiperswitchandtheignitionkeyareturnedtoONpositions.Thisleadstoasimplethree-inputANDoperation.Meanwhile,tomakeiteasierforautomotivetechnicianstoworkonthewindshieldwiper,thereisabypassswitchinplacetoturnthewiperonregardlessofthethreeconditions.AnORgatecombinedwithanANDgatecouldaccomplishthat.
Figure5.19:Combinationallogicpracticalexample
BooleanAlgebra
Toexpresstheoperationsmorelogically,weapplyBooleanalgebra.ForanANDgate,inputsaremultiplied(soliddot)byeachother.ForanORgate,inputsareaddedtoeachother.Figure5.20describesthelogicalcircuitsinBooleanalgebraandthesymboldefinitions:F(fronthood),WS(wiperswitch),I(ignitionkey),B(bypassswitch),andWM(windshieldmotor).
Figure5.20:LogiccircuitsdescribedbyBooleanalgebraUsingBooleanalgebra,abarontopoftheletterisusedtoshowinvertedoutput.Theinverter’sBooleanequationisshownbelow.
TheapplicationbelowshowsanotherexampleofaBooleancircuitexpression.Twotemperaturesensorsareusedtocontrolaheatingsystem.Ifthefirstorsecondtemperaturefallsbelowacertaintemperature(logic0),theheatingsystemturnson.ThelogiccircuitandBooleanalgebraareshowninfigure5.21.
Figure5.21:BooleanexpressionofaheatingsystemapplicationForNANDandNORgates,theBooleanequationscanbefoundbelow(seefigure5.22).
Figure5.22:NANDandNORgates’Booleanequations
Latch
Combinationallogicoutputdoesnotrequireanypreviouslystoredinformation(memory)toobtainavalidoutput.Manyelectronicsystems,however,requirememorytobeusedfordesiredoperations.Forexample,whentheuserofamicrowaveovenentersthecookingtime,thetimeisstoredasmemorywithinthemicrowaveovenelectronics.Many
automobilesnowadayshavememoryseats.Thepasscodeofahomesecuritysystemisstoredasmemorywithinthesystem.Smartphonecamerasstoreimagesorvideosasmemories.Therearemanymoreelectronicapplicationsthatusememory.Digitalcircuitssuchasthelatchandflip-floparebasicbuildingblocksofdigitalsystemsanddatastorageelements.Digitalsystemscombinedwithstandardlogicgatesandmemoryarecalledsequentiallogic.Thedifferencebetweenalatchandaflip-flopisthataflip-flopusesaclocktodeterminetheoutputstates,alatchdoesnot.Alatchconsistsoftwoinputs,aset(S)andreset(R),andadifferentialoutputpair(Q,Q_bar).Figure5.23showsthelatchschematicsymbol.
Figure5.23:Latchschematicsymbol
Figure5.24:LatchmadeupoftwoNANDgates
Figure5.25:LatchmadeupoftwoNORgates
AlatchcouldincludetwoNANDgates(seefigure5.24).OtherthanNANDgates,alatchcanbeconstructedusingNORgates(seefigure5.25).Thelatchoperationsaredescribedusingatimingdiagrambelowinfigure5.26.Sisfedexternally.WhenSgoeshigh,QgoeshighwhileRremainslow.First,therisingedgeofScausesQtopullup.Q_barisacomplement(opposite)ofQ,i.e.,180-degreesoutofphasefromQ.Qcontinuestostayhigh(shadedarea)eventhoughSgoesfromhightolow.Thisshadedarearepresentsthememoryisnowstored.QonlygoeslowwhenRgoeshigh,resettingtheQoutput.ThisresetoccursatthefirstrisingedgeofR.WhileRispurposelysethigh,Sgoesup.However,Qremainslowresultingindatastored(secondshadedarea)ontheright-handside.Triggeredbyexternalsignal,ReventuallygoeslowwhileSremainshigh.Ultimately,thefallingedgeofSsetstheoutputlowonthefarright.
Figure5.26:Latchtimingdiagram
Thelatchhasthecapabilitytoretaininformation.It’sfreerunninganddoesn’trequireanytiming-specificrequirement(clock)toproduceavalidoutput.Insomecases,wewouldliketocontroltheoutputonlyundersomeparticulartimingconstraints.Thisiswhereflip-flopcomesin.
Flip-Flop
Inthepreviouslatchexample,flip-flopwouldbeanidealchoicetocontroloutputwithtimingrequirements.TheS-Redge-triggeredflip-flopsymbol(seefigure5.27)issimilartothatofthelatchexceptthatthereisanadditionalpinfortheclockinput(C).Withtheadditionalclockpin,thisflip-floptriggerstheoutputinresponsetotherisingorfallingedgesoftheclock,hencethenameedge-triggeredflip-flop.
Figure5.27:S-Redge-triggered
flip-flopsymbol
TheoperationoftheS-Redgetriggeredflip-flopisthattheoutputrespondsonlywhenclockishigh.Whenclocksourceislow,outputsremainintheirpreviousstates.Thetimingdiagraminfigure5.28showshowflip-flopoperates.ClockpulseCrunsatafixedfrequencywitha50%dutycycle.SandRsignallevelsarerandomlyassigned.DuringthefirstrisingedgeofS,Qshouldhavebeensettohigh;instead,itstayslowbecausetheclockpulseislow.Qgoeshighrightaftertherisingedgeoftheclock.QcontinuestostayhighwhileSremainshigh.AfterthefirstSfallingedge,Qresetstolowduringthehighclock.ThefirstrisingedgeofRhasnoeffectonQbecauseSislow.OnthesecondrisingedgeofS,Qremainslowduetoclockbeinglow.Qrisesuponthenextsubsequenthighclock.QfinallygetsresetwhenRgoeshigh.Someflip-flopsrespondtothefallingedgeofclockinsteadofarisingone.Suchaflip-flopsymbolisshowninfigure5.29(dotattheCpin).
Figure5.28:Flip-floptimingdiagram
Figure5.29:Fallingedgetriggeredflip-flopsymbol
DandJ-KFlip-Flops
Figure5.30:D-flip-flopsymbol
Anotherflip-floptypeistheD-flip-flop.Itconsistsofasingle-endedinput(D).Fromatiming-functionstandpoint,itworksexactlythesameasthepreviousflipflops.TherearetwoinputsinternallyintheD-flip-flop.ThereisaninternalinverterfromtheDinputtoensurethattwoinputsarecomplimenttoeachother.TheD-flipflopsymbolinfigure5.30showstheinternalinverter.Latchesandflip-flopsarejustbuildingblocksofdigitalcircuits.J-Kflip-flops,ontheotherhand,areavariantofedge-triggeredflip-flops.TheyworkalmostexactlyasS-Rflip-flopsexceptthattheoutputtoggleswhentheclock
signalishigh.TheschematicsymbolfortheJ-Kflip-flopisshownbelow(seefigure
5.31). Figure5.31:J-Kflip-flop
FrequencyDivider
Figure5.32:Divide-by-twofrequencydivider
OnepopularapplicationofJ-Kflip-flopsisthefrequencydivider.Adivide-by-twofrequencydividerisshowninfigure5.32.It’sa2-bitdivider.Thebitisthebasicunitofdigitalinformation.It’sthesmallestaddressableunitindigitalsystem.Abitcouldbeassignedeither“1”or“0”(transistoronoroff).Digitalelectronicsusebitsandbytestoquantifymemorysize.Forexample,8-bitsofmemoryisequivalentto1byte.Abitinthefrequencydividerrepresentsthenumberof
possiblecombinationsthereareinbinarysystem.Fora2-bitsystem,thereare22=4combinations.Fora4-bitsystem,thereare24=16combinations.Table5-8showsthenumberofpossiblestatesindecimalupto8bits.
Table5-8:BitnumbersandnumberofoutcomesBothflip-flopsofthefrequencydividerinputsaretiedtoVCC(logichigh).Thedividingactioncanbeseeninthetimingwaveformbelowinfigure5.33.
Figure5.33:Frequencydividertimingdiagram
Asclockgoeshigh,QArespondsbypullingup.QBgoeshighaswellwhenQAisnowtheclocksourceatthesecondflip-flop.QA’shighlevelisstoredevenafterCgoeslow.ThesamegoesforQBwhereitstayshigh.WhenCgoeshighagain,QAnowtogglesback
tolow.QBremainshighevenwhenQA(QB’sclocksource)goeslow.Theprocessthencontinues.YoucanseethattheclockfrequencyofCisdividedbyhalfthroughQA.QB’sfrequencyisfourtimeslessthanC.Additionaldividingactioncanbeachievedsimplybyaddingflip-flopsinseries.Thisflip-floputilizestheclockconnectedinseries,i.e.,eachclockisindependentlyoperated.Thiscouldpotentiallycreateatimingerrorasoneflip-flophastowaitfortheoutputtorespondbeforetriggeringtheclockofthenextflip-flop.
ShiftRegister
Flip-flop’sclockscanbeconnectedonadedicatedlinemakingitcommonamongallflip-flops.Awell-knowncircuitcalledashiftregisteracceptsdataserially,onebitatatimeonadedicatedline.Theshiftregisteroutputisintheexactformoftheinput,inthiscase,serially.Anexampleofa3-bitshiftregisterisshown(seefigure5.34).Thisconnectionisadaisy-chainconnection.Itsnamecamefromthefactthatmultipledevicesareconnectedasa“chain.”
Figure5.34:3-bitshiftregisterTheshiftregisterwaveformisshownbelowinfigure5.35.
Figure5.35:Shiftregistertimingdiagram
ThefirstSDIN(datainput)risingedgedidnotcauseQAtoriseimmediatelyduetotheclocksignalbeinglow.QAthengoeshighatthenextrisingedge.Inotherwords,QAisdelayedbyoneclockcyclebeforeabletoclockthedatainfromSDIN.Shiftregisteriswidelyusedinserialcommunications.Universalserialbus(USB)isapopulartype.Othersaresynchronousperipheralinterface(SPI),Integrated-integratedcircuit(I2C)andControlAreaNetwork(CAN).Theseserialtransferprotocolswillbediscussedinchapter7,Microcontrollers.
ParallelDataTransmission
Datacanbetransmittedandreceivedviaparallelcommunicationprotocols.Paralleldatatransmissiontrumpsserialtransmissionbecauseparallel’shigherdataratewithmultipledatatransmissioncanoccursimultaneously.Thedownsidetoparalleldataoperationistheneedformoretransmissionbusesandcables,resultinginhighercosts.Inthe3-bitshiftregisterexample,QA,QB,andQC(SDOUT)canberetrievedinparallelwhileSDINsuppliesdataserially.Apracticalexampleinfigure5.36showshowparalleldataoutputgetsimplemented.Thisisavariable-gainop-ampdesignwithgaincontrolleddigitallybyQAandQB.Therearefourindividualgains.ByclockinginSDINseriallyandextractingQAandQBinparallel,fourpossiblegaincombinationscanbeeasilyselected.
Figure5.36:ParalleldataoutputusingopampGain1:QAhigh,QBlow
Gain2:QBhigh,QAlow
Gain3:QA,QBbothhigh
Gain4:QA,QBbothlow,gainof1
∞>>VinandR1:
Thisdesignexampleshowsthatelectronicsystemscancombinebothanaloganddigitalelectronicsinonedesign.Whileanalogoutputisachievedbytheop-amp,low-costandhighspeeddigitalelectronicscontrolgain.Thisisaclassicexampleofmixed-signaldesign.
Multiplexer
Amoreintuitivewaytocontrolgainistousemultiplexer(MUX).Amultiplexerhasmultipleinputs.Itselectivelyusesonlyonespecificoutputchanneldependingonthecontrolsignal(CTRL).AsimpleMUXsymbolandcircuitareshowninfigures5.37and5.38.
Figure5.37:Multiplexerschematicsymbol
Figure5.38:MUXmadeofANDandORgatesandinverter
ThisMUXconsistsoftwoANDgates,oneORgate,twoinputchannels(A,B),onecontrolpin(CTRL),andanoutput(eitherQAorQB).WhentheCTRLpinishigh,channelAisselectedwhileBisignoredusingtheANDgatelogic.WhenCTRLislow,
channelAisignoredandBchannelisselected.ThefinalgaincontrolcircuitimplementationusingMUXisshownbelow(seefigure5.39).
Figure5.39:GaincontrolcircuitusingMUXandop-amp
Mixed-signal
Iftheop-amponthepreviouspageisbipolar-based,thisisamixed-signalsystem,meaningitcombinesbothanaloganddigitalcircuits.BothCMOSandbipolardevicescanbeusedindigitaland/oranalogdesigns.Thetrade-offcomesdowntopower,performance,andcost.Manyapplicationsrequireinterfacingbetweenanaloganddigitalquantities.Forexample,whenyouaretalkingonacellphone,yourvoiceisananalogquantity.Usinganalog-to-digitalconverters(ADCs),thevoiceisdigitizedandup-convertedtoamuchhigherfrequencybeforetransmittingasradio-frequencywavesintheair.Oncethesignalisreceivedbythereceivingphone,theprocessisreversedusingdigital-to-analogconverters(DACs)wherethedigitalsignalisconvertedbacktosoundasanalogsignals.Thisanalog-to-digital,digital-to-analogconceptisshownbelowinfigure5.40.Electronicsystemssuchastheonebelowrequireengineers’abilitytodeterminewhattypeofdevicetouseineitheranalogordigitalsystems.
Figure5.40:Analog-to-Digital-to-Analogconcept
Forindustrialapplicationssuchasmotorcontrols,youneedtobecautiouswhenintegratinganaloganddigitaldesigns.Fromasystemspecstandpoint,amotortakesmorepowerandheavierload(current)tooperate.CMOSdevicesaregenerallyinsufficientasoutputdevicestodriveamotor.AlthoughtherearespecialMOSFETtypessuchaspowerMOSFETsthatarecapableofdrivinghigherloads,bipolardevicesareusuallybetterchoiceswhenitcomestodrivingheavierloads.Inotherwords,usingalogicgatetodriveamotormostlikelywouldresultinlackofdrivingcapability.
LevelShifter
Toresolvethisloadissue,adriver(levelshifter)circuitcanbeused.Alevelshiftertranslates(shift)voltagelevelsfromV+tohigherV++increasingcurrentdrivingcapability.Figure5.41demonstratesthisconcept.
Figure5.41:Driveasvoltagelevelshifter
Ifbothdigitalanddrivercircuitsresideinthesamesystem,it’sacommonpracticetohavemultiplepowersuppliesandgroundstoisolatenoisesandminimizecoupling.Undesirable,high-speednoisecomesmostlyfromhigh-speeddigitalcircuitswithinthesystems.Inmicroelectronicdesign,multiplepowersuppliescanbegeneratedasdescribedinchapter4,AnalogElectronics.Inadditiontocreatingmultiplesupplies,digitalandanaloggroundscanbedesignedtorunseparatelysothatgroundcurrentscouldreturntootherpaths.Obviously,thesemeasuresincreasecomplexityandcircuitcostwithincreasedperformance.
Multi-LayerBoard
Forprintedcircuitboarddesign,multiplelayersofpowersuppliesandgroundsareregularlyimplementedinprintedcircuitboards(PCB)withthesameideaabove(segregatingnoises).Figure5.42showsastudent-designedcircuitboard(atemperaturesensorapplication)usingamicrocontroller,seven-segmentdisplay,AC-DCconversion,
andtransformer.Thebottomoffigure5.42showsaMicrochipTechnologyaudiodevelopmentboardforaudioapplications.Thisboarddividesthepowerandgroundintomultiplelayers.Theinputandoutputjacks(connectors)ofthisboardare3.5mm.
Figure5.42:TemperaturesensorPCB(Top),Audiodevelopmentboard(Bottom)
Manylogicgatesinthemarketplacearegroupedtogetherintoasinglesemiconductorpackage.MajorICmanufacturersselldigitalchipsinvarioustypes.Readingdevicedatasheetsthoroughlyandclearlyensuresthecorrectchiptypesareusedtomeetyoursystemspecifications.
DigitalVoltageLevels
AmongdigitalICspecifications,youneedtoknowtheexactvoltagelevelthatdefineswhetherit’slogic0or1.Transistor-TransistorLogic(TTL),CMOS,andEmitter-Coupled-Logic(ECL)arepopularvoltagestandardsfoundindigitaldesigns.Amongtheselogicfamilies,propagationdelay,togglespeed,andsupplyvoltagearethemainparametercomparisonsofthesethreefamilies.Eachiterationsovertheyears.Thenumberswereassembledfromthelatestversions.parameters.Table5-9showsthe
familyhasgonethroughmultiple
Table5-9:TTL,CMOS,andECLspecifications
Analog-to-DigitalConverter
Analog-to-digitalconverters(ADCs)anddigital-to-analogconverters(DACs)arefoundinliterallyallkindsofelectronicproducts.Let’sfirstlookatADC.TheADCschematicsymbolisshowninfigure5.43.ADCscomeinwidevarietiesandtheyarecategorizedbyperformanceparameterssuchasspeed(samplingrateinHz)andresolution(numberofbit)inadditiontochannelnumbers,noiselevels,temperature,voltageranges,andaccuracy.AnalogDevices,TexasInstruments,LinearTechnology,MaximIntegratedCircuits,andMicrochipTechnologyareamongmajorADCsuppliers.MostofferonlineparametricproductsearchsuchasthissitefromAnalogDevices:
http://www.analog.com/ps/psthandler.aspx?pstid=10169&la=entohelpcustomerschoosetherightpartsfortheirdesigns.Typicalresolutionrangesfrom8-bitforlow-endADCstohigh-end24-bitADCs.Thehighertheresolution,themoreaccuratetheADCsare.Forexample,an8-bitADCwith5Vanalogreferencevoltageyields256steps,28=256.Eachstep,thereforeresolvesto5/256=19.5mV.Ifitwerea24-bitADC,a5Vreferencevoltageresultsin298nVperstep,amuchmorefinerandaccurateADC.Theanalog-to-digitalconversionofan8-bitADCisdescribedinfigure5.44.Theanaloginputsignalisreproducedthenconvertedtoadigitalsignalasseeninthewaveform.ADCscanbeclassifiedindifferentmarketsegments.Fromindustrialmeasurement,video,audio,anddataacquisition,tohighspeedinstrumentationandradio-frequencyapplications,ADCtopologiesarecategorizedbyarchitecture.Popularonesaresigma-delta(Σ-∆),successiveapproximation(SAR),andpipeline.Thedifferencesamongtheirarchitecturearecharacterizedbyresolutionsandsamplingrate.Sigma-deltaADCsoperatehighresolutions(12to24-bit)operatingatlowsamplingrate(10to10kHz).SARsoperateinmidrangeperformance(12to16-bit,100kHzto10MHz).Pipelinerunsinthehighestsamplingrate(10MHzto1GHz)withthelowestresolutions(8to16-bit).
Figure5.43:ADCschematicsymbol
Figure5.44:Analog-to-digitalconversionofan8-bitADC
Fromfigure5.44,duetolowbitnumberandresolutionsofthe8-bitADC,thedigitaloutputdidnotrepresenttheanaloginputwaveformquiteaccurately.Witha24-bitADC,thewaveforminfigure5.45showsthatthedigitalrepresentationisclosertotheanaloginput,offeringmuchhigheraccuracyandabetterreplicationoftheinput.
Figure5.45:Analog-to-digitalconversionofa24-bitADC
NyquistFrequency
Whenwetalkaboutsamplingrate,it’sidentifiedashowoftentheADCtakesananalogsignalsample.Thehigherthesamplingrate,themoreaccuratetheoutputwouldbe.AnotherADCspecisthroughputrate.It’sdefinedasmega-samplepersecond(MSPS).Lowend,lowcostADCsruninthe100Hzrange,withhigh-endonesrunninginthe1GHzrange.Thewaveformbelow(seefigure5.46)showsthatthesamplingfrequencyisrunningtwiceasfastastheinputsignal.It’sconvertingtheanalog-to-digitalsignaltwiceineveryinputsignalperiod.ThetwotimessamplingfrequencyistheNyquistfrequency.It’stheminimumfrequencythatthesamplingsignalneeds,i.e.,atleasttwiceasfastastheinputsignal(andpreferablymorethantwice),inordertoconvertananalogvalueintoadigitalvaluewithlesserror.
Figure5.46:NyquistfrequencyTheanalog-inputtodigital-outputtransferfunctionofan8-bitADCisdemonstratedinthegraphbelowinfigure5.47,assumingthereferencevoltageis8V.
Figure5.47:3-bit(8levels)analoginputtodigitaloutputtransferfunction
Thedigitaloutputslooklikeladdersteps.Theseoutputsare3-digitbinarynumberswith8possibleoutputcombinations(23=8).Startingfrom“000”,thevaluecorrespondsto0Vanaloginput.Goinguponestepintheladder,“001”willberesolvedto1Vinput,soonandsoforth.Thereareeightindividualanaloginputranges:0to1V,1Vto2V,etc.Theseproduceadiscreteoutputcodeforeachanaloginput.Eachanaloginputvoltagerangecanliterallytakeaninfinitenumberofvalues(thedefinitionofananalogsignal),causingdifferencesbetweentheactualanaloginputandtheexactvalueofthedigitaloutput.Thisuncertaintyiscollectivelycalledquantizationerror.ThiserrorultimatelyleadstoquantizationnoisewiththeADC.
ADCGainandOffsetErrors
Likeanyotheranalogcircuits,ADCscomewithimperfectionsoriginatingfromdesignerrorsandthemanufacturingprocess.UnderstandingtheseerrorsgivesengineersknowledgeaboutADC’scapabilitiesandlimitationsthroughtestingandcharacterizations.Gainandoffseterrorsarethemainsourcesofinaccuracies(seefigure5.48).Theoriginaldigitaloutputislinearwhereanaloginputpreciselymapstothedigitaloutputcode.Withgainerror,theladderstepoutputisshiftedtotheright,resultinginthewrongdigitalcodefromtheanaloginputs.
Figure5.48:ADCgainerror
Offseterror,ontheother,handgivesatilteddigitaloutputasshowninfigure5.49.Bothoffsetandgainerrorsarecategorizedasdrift(changeswithrespecttotemperature).OffsetdriftismeasuredinV/°C(voltageperdegreeCelsius).A24-bitsigma-deltaADCcouldfeaturelessthan5nV/°Coffsetdrift.Gaindriftismeasuredinparts-per-millionper°C(ppm/°C).Ahighresolution24-bitADCcouldhavegaindriftaslowas1ppm/°C.Parts-per-millionissimplyawaytointerpretpercentage.1ppmmeans(1/1million)X100percent.24-bitsigma-deltaADCsaregoodcandidatesformeasurementequipmentapplicationssuchastemperature,pressureorweightmeasurements.
Figure5.49:ADCoffseterror
Bothgainandoffseterrorsandquantizationnoisecontributetothenon-linearADCbehavior.OtherADCspecificationsincludesignal-noiseratio(SNR)measuredindB.Ideally,SNRwouldbeinfiniteifnoiseiszero.Otherspecsarepowersupplyrejectionratio(PSRR),commonmoderejectionratio(CMRR),powersupplyvoltageranges,phasenoiseinfrequencydomain(jitterintimedomain),supplycurrents,clockingschemes,andinterfacetypes.ManyADCsinthemarketincludesignalconditioningcircuitssuchasinternalinputandoutputamplifiers,buffers,andsamplingclocks.ThelargenumberofADCsmakessystem-leveldesignchallengingwhenitcomestoselectingtherightpartfortheapplications.
Digital-to-AnalogConverter
Digital-to-analogconverters(DACs)arethereversalofADCs,convertingdigitalsignalstoanalogones.TheDACoutputistheproportionalvalueofthedigitalinputsbasedonareferencevoltage.TheDACschematicsymbolisshownbelow(seefigure5.50).
Figure5.50:DACschematicsymbol
DACscanbefoundinallkindsofapplications:audio,video,digitalprocessing,wirelesssystems,manufacturing,motion,processcontrols,dataacquisition,andmeasurementthatrequiredigitalprogrammingcapabilities,justtonameafew.TheDACtransferfunctioncanbederivedbelow:
Vout:Analogoutput;Vref:Referencevoltage;D:Digitalinputcode;n:Bitnumbers.Forexample,a3-bitDACwith5Vreferencevoltage(Vref)withdigitalinputcode“101”resultsin:
The“101”digitalinputsarefirstconvertedtoadecimalnumberusingabinary-to-decimalconversionmethod.RegardingDACarchitecture,manyacademictextscoverresistivedividersandbinaryweightedandR-2RladderDACs.AswithADCs,DACs’applicationsarewidespread,fromcameras,audioandvideoprocessing,andmedicalimaging,towirelesscommunicationsandadvancedTVapplications.Manyend-systemdesignsnowincorporatesystem-on-chip(SOC)methodologywhereanalog,digitalfunctionandcircuitsareintegratedinonesinglepieceofsilicon,motivatedbysmalldiesizes,lessboardspace(lowercosts).MajorityofhighendICsuppliersdesign,manufacturesystem-on-chipICs.Oneexampleisinthewirelessindustrywheretransceivers(transmitterandreceivercombinedinonedesign)transmitandreceiveradiosignals.IndividualcircuitblockscouldincludeADCs,DACs,amplifiers,buffers,phaselockLoop,multiplexers,filters,voltage-controlledoscillator,voltage,currentreferences,andotherlogiccircuitsallononesingledie.Tosuccessfullydesignhighlyintegratedproducts,engineersmustunderstandtheentiresystem-levelspecifications.Manydesignsinvolvecircuitand
behavioralblockssimulationstoverifydesignfunctionalitypriortomanufacturing.
Binary-WeightedDAC
Figure5.51isasimpleDACexamplecalledbinary-weightedDAC.It’sbasedonaclosed-loopinvertingopampusingsummingamplifiertopology.D0,D1,andD3aredigitalinputsmakingita3-bitDAC.VOUTistheanalogoutput.Allthreedigitalinputswillhavethesamevoltages.SinceD0inputhasthelargestresistorresultingintheleastamountofcurrent,it’stheLSBoftheDACwhereD2istheMSB.Applyingtheinvertingamplifiergainrulefromchapter4,AnalogElectronics,ifallD0toD3arehigh“111”at5V,theVOUTisderivedasbelow.
Figure5.51:Binary-weightedDAC
Forexample,ifR=10kΩ,andRF=5kΩ,VOUT=–(5/10kΩ+5/20kΩ+5/40kΩ)X5kΩ,VOUT=–4.38V
Figure5.52:DACtransferfunction
Theanalogoutputversusdigitalinputtransferfunctiongraphisshowninfigure5.52.ManyDACdesignparametersaresimilartothoseofADCs.Gain,offseterrors,PSRR,CMRR,temperature,supplyvoltagevariations,systemnoise,andsamplingclockrateerrorallaffectanalogoutputaccuracy.RegardlessofDACparameters,engineersandtechniciansneedtobeconcernedwiththetypeofloadtheDACisdriving.Inmanycases,aninterfacedeviceorcircuitisrequiredtoprovidesufficientload.Someloadsrequirecurrentorvoltageoutput,hencetheneedofV-IorI-VconversionattheDACoutput.Insomecases,aseparate
clockorvoltagereferenceICisneededforclockingandprovidingvoltagesupplytotheDACorADC,becausetheremaynotbeonesingledataconverterthatisabletomeetalldesignrequirements.
555-Timer
PerhapsthemostwidelydiscussedICincollegecurriculaisthe555-timer.Itcanbeimplementedinmanyapplications,e.g.,precisiontiming,oscillation,pulsegeneration,andpulsewidthmodulation(PWM)withanadjustabledutycycle.Theoriginal555-timerwasinventedbyMr.HansCamenzindwhopassedawayin2012attheageofseventy-eight.It’soneofthemostsuccessfulICseverinvented.Itremainswidelyusedinacademicsandcommercialapplications.Figure5.53showsthe555-timerblockdiagramandpinnames.
Figure5.53:555-timerblockdiagram(CourtesyofTexasInstruments)Theelectricalspecificationofthe555-timerisshownintable5-10below.
Table5-10:555-timerelectricalspecificationsFigure5.54showsthesimplifiedinternalcircuitdiagramofthe555-timer.
Figure5.54:Simplifiedinternal555schematic(CourtesyofTexasInstruments)
Let’stakealookatasimple555-timermonostableapplication(seefigure5.55)usingthesimplifiedschematic.Amonostablecircuithasonlyonestablelogicstatewhiletheotherstateisunstable(alwaysintransition).Thepresenceofatriggersignalforcesthe555-timerintoanunstablestate(R1,C1,timeconstant).Inthisexample,the555-timerfunctionsasaone-shottimer.TheresetpinconnectsinternallytothebaseofthePNP(Q25infigure5.54)),whichcontrolsthedischargepin.PullingtheresetpinlowturnsonPNP.Thispullsthedischargepinlow,forcingoutputtostaylow.TyingtheresetpintoVCCkeepsPNPoffandthepartoutofresetstate.TheoutputpinconnectstoaVCC,R2,andR3voltagedividerasoutputload.Keepinmind,the555-timercansourceorsinkonlyupto200mAtotheload.A555-timerisnotsuitabletodrivehighloads.Thecontrolvoltagepinconnectstoaninternalvoltagedivider(R3,R4,andR5)usedasacomparatorthreshold.Thethresholdvoltageissetbytheinternalresistorratio(1/3XVCCor2/3XVCC).Theexternal10nFcapacitor(C1infigure5.55)ismainlyfornoisereductionanddecouplingpurposes.Thethresholdanddischargepinsaretiedtogetheruponreceivinganegativepulseatthetriggerpin.Whenthethresholdanddischargepins(tiedtogether)fallbelow(1/3XVCC),thedischargeandthresholdpinschargeup.ThechargingtimedependsontheR1,C1,timeconstantvalue.Duringthistime,theinternalflip-flopsetstheoutputhigh.Whenthedischargeandthresholdpinsriseto(2/3XVCC),theytripthecomparatorresettingtheflip-flop.ThisliftsthebaseofinternalNPN,pullingthecollectordownanddischargingC1.Theoutputstayslow(stablestate)untilnexttimethereisanegativepulseatthetriggerpin.Thisone-shotonlyworksifthenegativepulseoccursslowerthantheR1,C1chargetime.Thetriggerpulse,output,anddischarge/thresholdwaveformsareshowninfigure5.56.
Figure5.55:One-shot555-timerapplication
Figure5.56:One-shot555-timerwaveforms
Summary
Inthischapter,digitalelectronicswerediscussedfromthegroundup.Westartedfrombits“1”and“0”andthedefinitionsoflogicgates,andthenexplainedoperationsfromthedeviceperspective.Spanningfromsimplelogiccircuitblockstopopulardigitalandanalogcircuits,ADCs,DACs,multiplexers,digitallycontrolledvariablegainamplifiers,555-timers,summingamplifiers,andotherpracticalcircuitswerepresentedandexplainedinasimplemannercombiningrealworldquantitiesandparameters.
Quiz
1)ConstructanANDgateusingCMOStransistors.2)Designafrequencydividerthatgeneratesa2MHzsquarewavesignalfroma16MHzinputclock.Hint:UsethreeJ-Kflip-flops.
3)Createa1GHzoutputclockfroma0.5GHzclocksource.Verifyitusingtimingwaveform.Hint:Useatwo-inputXOR.Separatethe0.5GHzintotwosignals.FeedthemtotheinputsoftheXOR.Maketheinputs90degreeoutofphasefromeachother.
4)Designavariable-gainop-amp(seefigure5.36)withthefollowinggainoptions:2,4,8,and16.5)Howmanylevelsofdigitaloutputsdoesan8-bitanalog-to-digitalconverter(ADC)have?Whatistheoutputcodeofthefirstandlastlevels?6)Calculatetheresolutionofa16-bitADCiftheanalogreferencevoltageis1.8V.
7)Designa555-timerapplicationthatisastable-basedmeaningit’sunstableinbothstates.Drawtrigger,discharge,threshold,andoutputwaveformsHint:Connectthetrigger,andthresholdpinstogether.
8)A3-bitDigital-to-AnalogConverter(DAC)hasthefollowingtransferfunction:Vout=(VrefXD)/(2n–1)
D:Digitalinput;Vref:Referencevoltage;Vout:AnalogOutputvoltage;n:numberofbitsCalculateVoutusingdigitalinputsbelow.Vref=2.5V.a)010b)111
Chapter6:Communications
Anelectroniccommunicationssystem’sfunctionistotransmitandreceiveinformationfromoneendtoanotherandviceversa.Somecommunicationsareone-way(simplex)meaningoneendcanonlytransmit,theothercanonlyreceive.Radioandtelevisionbroadcastareexamplesofsimplexcommunications.Othercommunicationstechniquesareoccurringinbothdirections(bi-directional).Inbi-directionalsystems,informationcanbecommunicatedintwoways:1)occurringatthesametime(fullduplex),and2)onedirectionatatime(halfduplex).Cellphonesandcomputernetworksareprimeexamplesoffull-duplexsystemswhilewalkie-talkies(two-wayradios)areexamplesofhalf-duplexcommunications.Communicationsystemsthatareabletotransmitandreceivesignalsarecalledtransceivers.Acellphoneisaclassictransceiverexample.Communicationsystemscompriseaseriesofanalog-to-digital,digital-toanalogconversionswhereinformationistransmittedandreceivedviaacommunicationmedium(channel).Themediumcouldbeintheformofwiredorwireless(signaltravelsthroughtheair).Therawmaterialofanywiredmediumistypicallycopper.Fiberopticshavegainedpopularityinrecentyears.MostwiredcommunicationsarestandardizedasprotocolsbyorganizationssuchasTheInstituteofElectricalandElectronicsEngineers(IEEE).Well-knownprotocolsareRS-232(computerserialport),RJ-45(phoneconnectorstandard)andcoaxialcable.Voltagelevels,attenuations,impedances,andfrequencyrangesareclearlyspecifiedbyeachstandard.AwirelesssignalgoesthroughtheairasthemediumisanACsignalcalledaradio-frequency(RF)signal.Beforetransmittingthroughtheair,signalsinthecommunicationsystemsarefirstup-convertedtomuchhigherfrequenciesofRFsignalsfrequency.TheRFsignalfrequencyrangesarewide-rangingfrom3kHzto300GHz.Thischapterprimarilyfocusesonwirelesscommunications.IntheUS,eachindividualfrequenciesregion(band)holdspecificpurposes,fromphone,radio,satellite,andtelevision,tobroadbandcommunications.Eachtypeoccupiesaspecificfrequencyregioncalledafrequencyband(spectrum).FrequencybandallocationsarecontrolledbytheFederalCommunicationsCommission(FCC),agovernmentagency.ThepicturebelowshowsaportionofthefrequencyspectrumdesignatedbytheFCC.ThenumbersonthetoprepresentthefrequenciesinHz.Eachrectangledefinesthenamesofusageandfrequencyranges.Communicationsystemsworkmostlyonfrequencydomain.
TimeversusFrequencyDomains
Thereisastrongrelationshipbetweentimeandfrequencydomains(frequency=1/time)asdescribedinchapter3,AC.Aperiodicsinewaverunningat10kHzwith10Vpeak-to-peakisdisplayedinfigure6.1asatimedomainwaveform(top).Toexpressitinfrequencydomain,aspectrumanalyzerdisplaysvoltage,current,orpowerasafunctionoffrequency(bottom).Thespectrumanalyzer’sX-axisisthefrequencyinHz.TheY-axiscouldbevoltage,current,orpower.
Figure6.1:Time,frequencydomainofa10kHzsignal
Inthespectrumanalyzerdisplaywindow,itshowsthatthereisasharpjumpcharacteristic
inthemiddleat10kHz.Therestofthespectrumspanfrom0Hzto20kHzdoesnotshowanyvisibleshapes.Thisdemonstratesthatthesignalfrequencyisconstantat10kHz.Recallthatinchapter3,AC,wederivedresonantfrequencyusingLCtankcircuit.Usingsuchacircuitisagoodexampleofproducingasignalwithsharpfrequencyresponsesimilartofigure6.1.Mostradiosignaltransmittersimplementsometypeofresonantcircuitstogeneratefiltered,amplified,frequency-sharpresponsesuchasseriesLCwheremaximumcurrentoccurs(XL–Xc=0),i.e.,minimumimpedances.Thistypeofdesigniscalledaband-passfilter.Itallowsasignaltopassthroughonlywithinaspecifiedbandwidth(frequencyrange).Figure6.1ashowstheband-passcurrentandimpedanceinfrequencydomain.
Figure6.1a:Band-passcurrent,impedancefrequencydomain
Onthereceiverside,thesametechniquecanbeusedtofiltersignalsoutsideofaspecificfrequencyrangecalledaband-stop.Figure6.1bshowsthefrequencyresponseoffrequencymodulated(FM)bandwidth.FMwillbefurtherdiscussedlaterinthechapter.Infigure6.1b,itshowsthattheFMbandwidthislimitedbetween88MHzto108MHzbyband-stopfilter.
Figure6.1b:Band-stopfilterinFMreceiver
Thespectrumanalyzermentionedpreviouslyistheequipmentofchoicetotestandmeasureband-passandband-stopfiltersinfrequencydomain.Thereareseveraladjustmentssimilartotheoscilloscopeallowinguserstozoominandoutofthefrequencywaveform.Infigure6.1,thedisplaywindowstartsat0Hz(farleft)andendsat20kHz(farright).Thestarting,ending,andcenterfrequencies(currentlyat10kHz)canbeadjustedatanytime.TheY-axiscanalsobescaledupanddown.Intherealworld,it’sraretohavethesharpwaveformcharacteristicseeninfigure6.1duetonoisethatexistsinmanyplacesandinvariousforms.Thenoisesourceisusuallyinelectricalformgeneratedbydevicesinoperations.Thecircuit(seefigure6.2)showsthenoisefoundinthehalf-waverectifiershownbythespectrumanalyzer.ConnectingtheVouttoaspectrumanalyzer,theVoutfrequencywaveformnowshowsmultipleshapes.
Figure6.2:Half-waverectifiernoise
Harmonics,Distortion,andInter-modulation
Thesignalatthecenteriscalledthefundamentalfrequency(centerfrequency)wheretheothersarecalledharmonics.Harmonicfrequencycomponentsarecausedbynon-linearitywithinthesystem,inthiscase,bythehalf-waverectifiedwaveform.Theharmonics’frequencysignatureisconstantintegermultiplesofthefundamentalfrequency.Ifthefundamentalfrequency(seefigure6.2)is1MHz,thefirstharmonicislocatedat2X1M=2MHz,thesecondharmonicwouldbe3X1M=3MHz,andsoon.Allharmonicfrequenciesareperiodicwhiletheharmonicsamplitudeisalwayslessthanthefundamentalfrequency.Duetothemultiplefrequenciesnatureofharmonics,itbecomesamajorsourceofnoisecausingdistortiontotheoriginalsignalinanelectronicsystem.Distortionsaredeviationsorchangesmadetotheoriginalsignal.Keepinmindthateachharmonicbyitselfcreatesitsownharmonicsalthoughthesesub-harmonicshavemuchlessamplitudethanthecenterfrequency.Othersourcesofdistortionincommunicationsystemsareinter-modulations,causedbythesumanddifferenceoftwofrequencycomponents.Aninter-modulationproductstableexaminestherelationshipsbetweenfundamentalfrequenciesandindividualproductsdesignatedbyordernumbers(seetable6-1).Twofundamentalfrequencies,f1andf2,are100kHzand101kHz,i.e.,f1andf2are1kHzapartfromeachother.
Table6-1:Ordernumber,F1,F2,andInter-modulation
Fromtable6-1,onlyoddnumberorders(thefirst,third,andfifth)areclosetof1andf2.Theoddnumbersbecomethesignificantnoisecomponentsofthesystemwithinthespectrum.Aninter-modulationsspectrumisshownbelow(seefigure6.3).
Figure6.3:Inter-modulationsspectrum
Therecouldbenumbersofharmonicsandinter-modulationsinnon-linearsystems.Thesecomponents,sometimesreferredtoassidebands,areundesirableandneedtobefilteredout.Low-pass,high-passandband-stopfiltertechniquescanbeapplied.SophisticatedfiltertypesincludeButterworth,Chebyshev,andBessel.Althoughthedetailsofthesefiltersarebeyondthescopeofthisbook,youshouldatleasttakenoteoftheirexistence.
Modulation
Regardlessofwiredorwirelesssignal,mostsystemsgothroughamodulationprocess,whichisdefinedascombiningtheoriginalinformationofinterestswithacarriersignal.Acarrierfrequencyneedstorunatamuchhigherfrequencythantheinformationsignal.Theresultofthiscombinationyieldsamodulatedsignalthatincludesboththeoriginalinformationridingalongwiththecarriersignal.Thistechniquesqueezesmoreinformationwithinacertainbandwidth,raisingthedataratebeforethesignalwastransmitted.
BitRate,USB,andBaud
Intelecommunicationelectronics,datarate(bitrate)isquantifiedbythenumberofbits
persecond(bps).Itameasureofhowmanybitsareprocessed,transmitted,orreceivedperonesecond.ApopularserialdatatransferprotocolsuchasUSBversion2.0(highspeed)datarateisabout48Mbps.ThenewerUSB3.0(superspeed)isspecifiedatmaximum4Gbps.Figure6.4showsaUSBlogocommonlyseenonelectronicproducts.
Figure6.4:USBlogo
Baudratecanalsobeusedtomeasuredataspeed.It’sdifferentfrombitrateinthatbaudratecountsthenumberofsymbolspersecondinsteadofthenumberofbits.Forexample,ifthebaudrateis4,800baudandeachsymbolrepresentstwobits,thebitrateis9,600bps(4,800X2).Figure6.5demonstratesanexampleof4bauds(8bits/second).
Figure6.5:Baudvs.bitrate
Modulationisusedinallkindsoftransmissionsystemsincludingwiredandwirelessinternetcommunication(useofmodems)andanalogtransmissionsuchasradiotransmission(amplitudemodulation,frequencymodulation).AMfrequencybandwidthrangesfrom530kHzto1,700kHz.FMrangesfrom88MHzto108MHz.Modulationtechniquemakesitpossibleby“altering”theoriginalsignal,i.e.,byaddinganinformationsignaltothecarriersignalcreatingamodulatedsignal.
C=Fλ
Tofurtherunderstandwhymodulationsareused,weneedtodiscovertherelationshipbetweenfrequency,wavelength,andlightspeed.RFsignalsaresimplyelectromagneticwavesthattravelthroughairspaceatthespeedoflight.Wavelength’sunitofmeasurementisthemeter.It’sthefundamentalfrequencyperiod.Thetransferfunctionoffrequency(F),wavelength(λ),andlightspeed(C)isdefinedas:
C=(F)X(λ)
Speedoflight(C)isaconstantthatisequalto3X108meter/second.Fromthetransferfunction,ifFgoesup,λneedstogodownsothatCremainsconstant.Inwirelesscommunications,antennaeareusedfrequently.λdeterminestheantennasize,i.e.,λandantennasizeareproportionaltoeachother.Toreduceantennacosts,it’sdesirabletokeeptheλassmall(frequencyashigh)aspossible.Theotherincentiveofkeepingtheantennasmallerinsizeistopreventadditionalnoisecapturedbythelargeantennasize.Forexample,thewavelength(λ)ofa90MHzfrequencymodulation(FM)radiosignalis,
C=(F)X(λ)λ=C/Fλ=3X108/90X106=3.33meters
Fromthisexample,youcanseethatinordertokeepantennasizesmall,frequencywouldneedtoincreasewiththeconstantspeedoflight(C).Byusingmodulationtechnique,highfrequencymodulatedsignalcanbecreatedbyaddingahigherfrequencycarriersignaltotheoriginalsignal.Wewillfirstseehowamplitudemodulationworksinthenextsection.
AmplitudeModulation
Amplitudemodulation(AM),oftenusedinradiosystem,bestdescribeshowmodulationworks.IntheUS,theAMradioisbroadcastonmultiplefrequencybands.Therangeoffrequenciesgoesfrom535KHzto1,705KHz.Wewillfigure6.6tofurtherunderstandAM.Inthisexample,theaudiosignaloperatesatf1;thesinusoidalcarrierfrequencyoperatesatf2.Weassumef1isalsoaperiodicsinusoidalwaveforsimplicityreasons.Inreality,theaudiosignalwillbeintheformofrandomvoice(analog)signals.Theminimumfrequencyofthecarriersignal(f2)needstofollowtheNyquisttheorem,i.e.,f2needstobeatleasttwiceasmuchasf1.Thef1,f2waveformsareshowninfigure6.6.Byaddingf1andf2together,themodulatedsignalcanbeobtained(seefigure6.7).Thissignalcontainstheoriginalinformationandthecarriersignalrunningathigherdataratethantheoriginalsignal(f1).NotethattheamplitudeofthemodulatedAMsignalchangeswiththef1’samplitude.Themodulatedsignalisenclosedwithasinewaveshape,theAMenvelope.TheAMenvelopeisnotactuallypresentinthemodulatedsignal.Itcharacterizeshowwellthemodulatedsignaliscreated.Todeterminethequalityofthemodulatedoutputsignal,somecriteriasuchasmodulatingindexorthemodulationfactorareused.Figure6.7aonthenextpageshowsEmin,Emax,theminimumandmaximumpeak-to-peaklevels.
Figure6.6:Audioandcarriersignals
Figure6.7:Modulatedsignal
ModulationIndexandBesselChart
Bydefinition,modulationindex(M):
Figure6.7a:Minimumandmaximumpeak-to-peaklevels
Ideally,themodulationindexis1(Eminiszero).EministhemajorerrorsourceregardingAMtransmission.Itrepresentscrossoverdistortionwherethesignalistransitioningthroughthehorizontalaxis.Tofurtherquantifydistortions,aBesselchartcanbeusedinthetable6-2below.Thetableconsistsofthemodulationfactorinthefarleftcolumn.Thesmallestfactoriszero,meaningtherearenoharmonics,sidebandcomponents,orinter-modulation.TheypracticallyrepresentaDCsignal.Asfrequencyincreases,sodotheharmonicappearancesandsidebands.Thesecausethenumberofsidebandincreasesexpandingtotheright-handsideofthetable.Thischartisonlyshowingthemodulationfactorupto1.5asanexample.Themodulationindexcouldeffectivelygoupto10.Thevaluesinthesidebandsarenormalizedsidebandamplitudevalues.Thesidebandsatthefartherright-handsidewouldhavethelowestamplitudecomparedtotheleft,e.g.,0.56,0.23,0.06,and0.01onmodulationfactor1.5.
Table6-2:BesselChart
AMTransmitter
Thecircuitbelow(seefigure6.8)isanAMtransmittercircuitexample.ThiscircuitcanbeusedtocreatetheAMmodulatedsignalinfigure6.7.Itissimplyacommonemitteramplifierwherethecollectorvoltageistheresultingsignalmodulatedbyaddingthecarrierandaudiosignalstogether.Byvaryingthecollectorresistors,themodulationfactorcanbeadjusted.TheLRCcircuitfine-tunestheAMsignalfrequencyusingresonantfrequencyandband-passtechniques.
Figure6.8:AMtransmittercircuit
Onthereceivingside,oncetheAMsignaliscaptured,itneedstobeconvertedbacktoanaudiosignalviademodulationprocess.AnAMdetector(demodulationcircuit)isneededtoperformsuchtask.Adiode,resistor,andcapacitorcouldachievethatinfigure6.8a.
Figure6.8a:AMdemodulationcircuit
FrequencyModulation
Frequencymodulation(FM)worksfundamentallydifferentthanAM.FMradiosignalallocationintheUSrangesfrom88MHzto108MHz.AlthoughbothAMandFMaddaudioandcarriersignalstogetherbeforetransmittingviatheair,unlikeAM,FM’smodulatedsignal’samplitudedoesnotchangewhenfrequencychangeswithrespecttotheaudiosignalamplitude.Thisphenomenonwasdescribedinfigure6.9.f1istheoriginalaudiosignaladdingtothecarriersignal(f2).Astheaudiofrequency(f1)reachesthepeak,thefrequencyoftheFMmodulatedsignalisthehighest.Whenitcrossesthezerohorizontalaxis,itrunsatthelowestfrequency.It’sduetothisnaturethatFMisfarsuperiortoAMintermsofsignalquality,becausetheAMamplitudefluctuateswiththeoriginalsignal.Thesefluctuationsgreatlycontributetonoise.Onthecontrary,theFMamplitudestaysroughlyconstant,eliminatingthemajorityofnoisecomponents.It’sforthisreasonradiostationsuseFMtobroadcasthigher-qualitymusic.Ontheotherhand,AMisusedmainlyforaudio(talkshows)broadcast.Toachieveunchangedamplitude,FMnoiseclippercircuitdiscussedinchapter3,AC,canbeused(seefigure3.44a).
Figure6.9:FMmodulatedsignal
KeepinmindAMandFMtransmissiontechniquesnotonlyapplytoradiotransmissionsbutareapplicabletoallotherwiredandwirelesstransmissionapplicationsincludinghighfrequency,internet,broadband,cellular,RF,andevensatelliteapplications.EspeciallyonRF,manymobilephonesnowcarrymultiplebandsinonephone.Dependingonthephonelocations,itmayhavetoswitchfromonebandtoanothertoreceiveandtransmitsignals.PopularcellularbandsareCodeDivisionMultipleAccess(CDMA),GlobalSystemforMobile(GSM)andLongTermEvolution(LTE).Eachstandardspecifiesasetofprotocolsregardingfrequencyband,carrierfrequencies,voiceencoding,decoding,andphoneservicesecurity.Duetotheneedsofhavingmultiplesignalsatotherfrequencyrangesononesystem,frequencygenerationorsynthesiscapabilityisneeded.Apopularmethodofdoingsoisphaselockloop(PLL).
PhaseLockLoop(PLL)
AtypicalPLLgeneratesaveryaccurateclock,forexampleacarriersignalinanAMorFMtransmission.AsignalgeneratedbyaPLLwouldbeusedinternallywithinthechip(on-chip)orsuppliedtoothersystems.PLLisakeycomponentofradio,wireless,telecommunication,computingtechnology,andmore.AdvancedPLLsgeneratesignalsatdifferentfrequencies.Figure6.10showsthebasicPLLbuildingblocksincludingphasedetector,low-passfilter,andvoltage-controlledoscillator.YoucanseethereisafeedbackloopinthePLLfunctionalblockdiagram.Thephasedetectorcomparestheexternalsignal
totheoutputoftheinternalvoltagecontrolledoscillator(VCO).PLLisanegativefeedbacksystem.Itstaskistoself-correctphasedifferencebetweenthetwophasedetectorinputsuntilthedifferenceiszero.Whenthishappens,theinternalsignalis“phaselocked”withtheexternalsignal.Atfirstglance,PLLdoesnotlookthatpractical.Onemightsay“Icouldusetheexternalsignalasmyclocksourcedirectly.WhydoIneedaPLL?”Fromapracticalpointofview,thatisacorrectstatementandlegitimatequestion.Toanswerthequestion,youshouldunderstandthatapracticalPLLisimplementedwithabinarydividertocreatesignalsatmultiplefrequencies.Figure6.11showstheactualimplementation.
Figure6.10:PLLfunctionalblockdiagram
Figure6.11:PLLimplementation
D1,D2,andD3aredividerbitsthatcanbecontrolledbyamicrocontroller.Wewilldiscussmicrocontrollersshortlyinchapter7,Microcontrollers.IfweassumethedividerbitsD1,D2,andD3are0,1,and2,thefrequencydivideristhenabletodivideincomingfrequencybyone,two,andfourtimesshownintable6-3.Whentheexternalsignalarrivesatthephasedetectorinput,theVCOisrunningatitsdesignedfrequency.Thephasedetectoroutputgeneratesadigitalpulsethatrepresentsthedifferencebetweenthesetwofrequenciesintermsofphaseshift.Thelow-passfilterconvertsthisdifferenceintoaDCvoltagecallederrorvoltage(seefigure6.11).ThiserrorvoltageadjuststheVCOfrequencyuntilbothphasedetectorinputsarethesame,i.e.,phaselocked.Atthispoint,theoutputofthephasedetectorisaDCvoltage.Itpassesthroughthelow-passfilterkeepingtheVCOrunningatthesamefrequencyastheexternalsignal.Atanypointintime,iftheexternalsignalrunsdifferentlythanthelockedVCOsignal,thephasedetectorwouldagaincapturethephasedifferencegeneratinganewerrorvoltage.Thisvoltagethenskews(changes)theVCOtophase-locktheinputsignalagain.Theerrorvoltagemodulatesaccordingtotheinputsignalvariations.Thistopologyappliesthesamefeedbackself-correctionmechanismsimilartowhatwediscussedinop-ampsandlowdrop-outregulators.Let’sapplywhatweknowtoapracticalscenario.Supposetheexternalsignalcomesfroma50MHzcrystaloscillator(seefigure6.12onthenextpage).Thedividerbit,D2,isselected.TheVCOoutputwillhavetobetwice(100MHz)asfastasthecrystalbeforedividingbytwoto50MHzwhenthesignalisphaselocked.ThisinturnmakesthePLLafrequencymultiplierfromthecrystal.The100MHzsignalfromtheVCOoutputcanthenbeusedtoclockothercircuitswithinthesystem.Byusingotherdividerbits(D1,D2,D3),multiplesignalsatdifferentfrequenciescanbesynthesized.PLLinthisapplicationbecomesafrequencysynthesizer,whichiswidelyadoptedin
computers,high-speeddigitaldesign,microprocessors,andsystemsthatuseclockdistributions.
Table6-3:Binarybitanddividerfactor
Figure6.12:PLLfrequencymultiplier
ThenumberandvarietyofPLLpartsisstaggering.AnalogcompaniesofferseriesofPLLchipswithavarietyoffunctions.Figure6.13showsanAnalogDevicesPLL(ADF4116/4117/4118)functionalblockdiagram,packageoutline,anddimensions.Accordingtothedatasheet,“TheADF411xfamilyoffrequencysynthesizerscanbeusedtoimplementlocaloscillators(LO)intheup-conversionanddown-conversionsectionsofwirelesstransceivers.Theyconsistofalownoisedigitalphasefrequencydetector(PFD),aprecisionchargepump,aprogrammablereferencedivider,programmableAandBcounters,andadual-modulusprescaler(P/P+1)”.ThisPLLdoesnotincludeVCO,whichisexternaltothepart.
Figure6.13:ADIPLL,ADF4116/4117/4118blockdiagram,andpackageoutline
Summary
Wecoveredbasiccommunicationsystemsatthecomponentandsystemlevelsinthischapter.Communicationengineeringstandards,protocols,andspecificationswerecoveredemphasizingtime,frequencydomain,frequency,wavelength,andspeed-of-lightmodulationanddemodulationtechniques,amplitudemodulationmodulation(FM)were
describedatthedeviceandsystemlevels.AMandFMcircuitssuchasAMtransmittersandreceiverswerereviewed.Communicationsystemparameterssuchasbitrate,baudrate,harmonics,inter-modulations,modulationindex,andBesselchartswerediscussed.Thechaptercloseswithphaselocklooptheoryandapplications.relationship.Among
(AM)andfrequency
Quiz
1)Fromthespectrumanalyzerdisplayshowninfigure6.14,determineapproximatelytotalbandwidthneededtransmitsuchasignal.Span:Thedifferenceinfrequencybetweenfarlefttorightofthedisplaywindow.Start,Center,andEndaretheabsolutestarting(farleft),center(middle),andending(farright)frequenciesinthedisplaywindow.the
to
Figure6.14:Spectrumanalyzerdisplaywindow2)Ifthesignalfrequencyis300kHztransmittedusingAM,whatistheminimumfrequencyofthecarriersignal?3)AssumingEmin,Emaxare100mVand2V,whatisthemodulationindex,M?4)Accordingtofigure6.11,PLL,iftheexternalcrystalfrequencyis20MHz,andcontrolbitD3ishigh,whatistheoutputfrequencyoftheVCO?5)UsetheBesselchartbelowintable6-4anddeterminehowmanysignificantsidebandpairsatransmissionwouldgeneratewithamodulationfactorof0.5.
Table6-4:Modulationfactor,Besselchart
Chapter7:Microcontrollers
MicrocontrollerUnits(MCUs)aresiliconchipsthatactasthe“brains”ofmanyelectronicsystems.Theyarefoundincommercial,industrial,consumer,andmilitaryelectronicproducts.Automobiles,computers,audio,video,lighting,wired/wirelessnetworkcommunication,LCDs(liquidcrystaldisplay),touchscreens,medicaldevices,motorcontrols,temperaturecontrols,powermanagement,mechanicalsystems,children’stoys,andhomeappliances(airconditioners,washer,driers,microwaveovens,andrefrigerators)areallcontrolledbyMCUs.ThesystemscontainingMCUsarecalledembeddedsystems.TheMCUsare“embedded”insidewithoutdirectaccessbytheendusers.Theendusersdonothaveaccesstothedesignsourcecode(computerprograms).Usersonlyhavelimitednumbersofprogrammingcapability.Oneexampleisamicrowaveovenwhereusers“program”thecookingtimebyinputtingthetime.Userscannotchangehowthetimeisinputted(e.g.,whichbuttontousetoinputthetime).Thebuttonlocationsandthebeepvolumeandfrequencyarehardcodedinthesourceprogramsbytheembeddedsystemdesigners.ThesourcecodewasdownloadedtotheMCUsduringdesignandmanufacturing.MCUsthereforearefieldprogrammable.OneMCUcouldhavemanyapplicationsaslongasthesourcecodeisdifferent,makingMCUshighlyconfigurable.Embeddedsystemengineersusesoftwaredevelopmenttoolstodevelopanddebugprograms.Wewilldiscussdevelopmentenvironmentslaterinthechapter.TheworldwideMCUmarketsharewasUS$13billionfrom2011data.ThetoptenworldwideMCUvendorsaccountfor70%oftotalMCUsales.TheyareRenesasElectronics,FreescaleSemiconductor,Atmel,MicrochipTechnology,InfineonTechnologies,TexasInstruments,Fujitsu,NXP,STMicroelectronics,andSamsung.AmongmajorMCUmarkets,theautomotivemarketaccountsforalmosthalfofthetotalmarketsize.Popularprogramminglanguagesusedbyembeddedsystemengineersareassembly,C,andC++.IntermsofMCUtypes,MCUsaresimilartoconventionalmicroprocessorsinasensethattheybothhaveCPUs.Thedifferenceisintheperipherals(externalcomponents).AlthoughbothCPUsandMCUscommunicatewithperipheralsthroughdataandaddresscommunicationbuses,CPUperipheralsareexternalwhileMCUperipheralsareinternalonthesamechip(on-chip).WithCPUs,peripheralssuchasvolatileRandom-AccessMemory(RAM),non-volatileRead-OnlyMemory(ROM),clocks,printers,diskdrives,monitors,keyboards,ormiceareexternaldevices.InMCUs,RAM(datamemory)andROM(programmemory),alongwithotherperipherals,areon-chipwiththeCPU.SomeexamplesofMCUperipheralsarecomparators,ADCs,DACs,andtimers.DependingonthetypeofMCU,somecomewithdatabusinterfacesincludingUniversalSynchronousAsynchronousReceiverTransceiver(USART),SerialPeripheralInterface(SPI),Inter-IntegratedCircuit(I2C),UniversalSerialBus(USB)andPulseWidthModulation(PWM)channel.NewerMCUscomewithnetworkingprotocolssuchasTCP/IP,Ethernet,andmanyotherwirelessnetworkcapabilities.DuetoalargenumberofperipheralsavailableonMCUs,theyarehighlyconfigurablethroughsoftwareprogrammingtocontroltheirfunctions.MCUdatasheetsthatareseveralhundredpagesarequitecommon.Figure7.1onthenextpageshowsasimplifiedblockdiagramofaCPUandMCU.
Figure7.1:SimplifiedCPUandMCUblockdiagrams
MCUParameters
TheCPUperformancewithinMCUsisusuallylowerthanconventionalcomputingonesbecausethereisnoneedtodesignembeddedsystemsrunninginmultipleGHzspeed.CPUsincomputersoftenuseapassiveheatdissipationdevicecalledaheatsinktohelpdisperseheatintothesurroundingairduetoexcessiveheatgeneratedbyfastclockspeed.Manyembeddeddesignsinvolvehumaninteractions,(e.g.,bypushingabuttonorinputtingonatouchscreen).Thetimedelaymaybeinthemilliseconds.MHzclockisquitesufficienttomeettherequirements.Forthisreason,aheatsinkisseldomneeded.AnMCUwithaCPUthatrunsabove100MHzisconsideredhighperformance.ManyMCUs’CPUsimplementARM(AdvancedRISCMachines)architecture.ARMisamicroprocessorfamilydesignedaccordingtoReducedInstruction-Set-Computing(RISC).RISC-basedCPUsrequirealotfewertransistorsthanconventionalCPUs.Thisleadstorelativeslowclockspeedandlowerpowerconsumption.ThislowpowermethodologyultimatelybenefitsMCUsfromalowerunitprice,makingitidealforlow-costdesigns.ThisexplainsthelargeMCUapplicationnumbersinthemarket.Figure7.2showsawirelesssmokedetectordesignreferencebyMicrochipTechnologyusingaconventional9Valkalinebattery.
Figure7.2:Wirelesssmokedetector(farright);smartphone,homesecuritysystem(bottom)
Inadditiontothestandardparameterssuchassupplyvoltageandtemperatureranges,therearevastnumbersofMCUstochoosefromdifferentiatedbytypes,productfamilies,peripherals,andpackages.MajorMCUvendorslikeMicrochipTechnologyoffercloseto1,000MCUstocustomers.Table7-1attemptstolistsomeMCUparametermetrics.MostMCUvendorshaveparametricsearchwebsitessoengineerscanlookuppartsfairlyeasilybasedontheirneeds.
Table7-1:MCUparametermetrics
Toselecttherightpartforyourdesign,youneedtofirstknowtheMCUfamily’sdefinitions.Popularonesare4-bit,8-bit,16-bit,and32-bit.Embeddedsystemengineersneedtotoand8-bitfamilies(cores)runatlowfrequenciesforgeneral-purposeapplications.Mid-andhigh-endcoresofferhighspeedanddrawmorepower.Ahigh-end32-bitcoreoffershigherperformance,pincounts,power,andfunctionality,atahighercost.Targetapplicationexamplesofhigh-endMCUsareaccuratecommercial,industrialcontrols,test,scientific,andmedicalequipment.Tofurtherunderstandthisconcept,let’stakeadeeperlookattheMCUarchitecture.MostMCUsmentionedinthischapterareMicrochipTechnologyparts.BecautiousthatotherMCUvendorsmayutilizedifferentarchitectures.EngineersneedtoreadthespecificMCUdatasheetfordetails.MicrochipTechnology’sMCUsarenamedPIC®(PeripheralInterfaceController)MCUs(PIC®MCUs).Figure7.3showsMicrochip’s8-bitproductfamily.Thegraph’sX-axisisthenumberofpins;theY-axisisthememorysize(KB).Bytesarememoryunits.Eachbyteofmemorycontains8-bitsofdata.Thebitisthebasicunitofdigitalinformation(chapter5,DigitalElectronics).Abitcanhaveavalueofeither“1”or“0.”PIC18isthehighestperformingamongthe8-bitfamilyofferingthehighestpincountandKBofmemory.
Figure7.3:PIC18architectureFigure7.3ashowsa20-pinPIC18(L)F1XKK22partpinpackagediagramandpinsummary.
Figure7.3a:PIC18(L)F1XKK22pindefinitions(CourtesyofMicrochipTechnology)
HarvardArchitecture
PIC®implementsHarvardarchitecture.Thespecialfeatureofthisarchitectureistheseparationofprogramanddatamemory.Programmemory(flash)storesuserprograms.TheCPUfetches(retrieves)programinstructions(commands)fromtheprogrammemoryonadedicatedbus.Datamemorywritesorreadsdata(fileregisters)toandfromRAMandtheCPUonaseparatebus.TheadvantageoftheHarvardarchitectureisthattheCPUfetchesandexecutesprograminstructionsatthesametimemaximizingtimingefficiency.Theseinstructionsperformmathematical,arithmetic,andlogicoperationsuponinteractingwiththeprogramanddatamemory.Figure7.4demonstratestheHarvardarchitecture.
Figure7.4:Harvardarchitectureconceptualview
DataandProgramMemory
TheadvantageofHarvardarchitectureisthatitimprovesoperatingbandwidthallowingdifferentbuswidth.ThePIC®bitnumbersrefertothewordlengthofthedatabus.An8-bitPIC®wouldhavean8-bitfileregister(datamemory)sizerepresentingone-byteofdata(contents).If,forexample,thetotal8-bitPIC®datamemorysizeis4KB(4,096bytes),therewouldbe512fileregisters(8X512=4,096).Thelast(bottom)registeris4,095andnot4,096becausethefirstregister’saddressstartswith“0.”Eachfileregisteroccupies8-bits(1byte)ofdata.Figure7.5showsasimplified8-bitPIC®datamemoryblockdiagram.
Figure7.5:Simplified8-bitPIC®datamemoryblockdiagram
EachregisterneedstohaveanaddresssothattheCPUknowswheretoaccess(fetch)it.ThisisachievedbyusingtheaddressbusbetweentheRAMandtheCPU.Oncethespecificregister’slocationisknown,dataisthentransferredbetweentheRAMandCPUonthedatabus.Thisaddressingschemeappliestobothdataandprogrammemory.Tostrikethispointclear,therevisedHarvardarchitectureinfigure7.6showstheaddressanddatabusinconjunctionwiththeinstructionbus.
Figure7.6:Addressanddatabus
Aspreviouslystatedinfigure7.3,PIC18isan8-bitPIC®family.PIC10,12,and16familiesallfallunderthe8-bitcategory.TheaddressbusforthePIC18datamemoryis12-bitswideandabletoaddress212=4,096fileregisters.Theaddressbusfortheprogrammemoryis21-bitswide,capableofaddressing2MB(221)programmemoryspace.Eachinstructionthereforetakesuponeprogrammemoryaddress.Figure7.7onthenextpagedescribesPIC18’sprogrammemorymapthatshowstheinstructionbusis16-bitwide.Inadditiontouserprograms,programmemorycontainsaresetvector,aninterruptvector,aninterruptserviceroutine(ISR),userprograms,adeviceID(identification),andconfigurationwords.Theresetvectoristhestartingpointofeachprogramexecution(address0).TheinterruptvectorcontainstheISR’saddressandcontents.Interruptswillbediscussedlaterinthischapter.Usermemorycontainssourcecodethatengineerswriteintheirchoiceofprogramminglanguage.Programcountersandinstructionsworkdirectlywiththeprogrammemory.TheprogramcounterkeepstrackofwhichinstructiontofetchandexecutenextfortheCPU.Eachinstructionhasauniqueprogrammemoryaddressthatisincrementedordecrementedbytheprogramcounterduringcodeexecution.Afterresettingthedevice,theprogramcounterisclear,forcingcodeexecutiontobeginattheresetvector.AnExternalMasterClear(MCLR)pincanbeused.MCLRisanactivelow(enabledonlywhenlow)pinthatneedstopulllowforareset.
Figure7.7:PIC18’sprogrammemorymap
Asmentionedpreviously,therearelargenumbersofPICsofferedwithinaspecificfamily.Thedataandprogrammemoryspaceisdevicespecific,i.e.,thesizesvaryfromoneparttothenext.Thebytenumbersshownareanexampleonly.OnPIC18pagingandbankingareusedinaddressingmemory.Programmemoryisdividedintopageswhilebanksdividedatamemory.Usingthedatamemorymapinfigure7.5onpage251asanexample,therewouldbetotalof16bankswitheachbankoccupying256fileregisters,addingupto4,096fileregisters.256X16=4,096.Inthedatamemory,therearetwomainregistertypes:general-purposeregisters(GPRs)andspecial-functionregisters(SFRs).GPRsholddynamicdataduringtheexecutionofaprogramwhileSFRsaremainlyforperipheralconfigurationsandoperationssuchasinputandoutputports(I/O),timers,ADCs,DACs,andPWMs.TheSFRaddressesarefixedinthedatamemory,andstartfromthelowestaddress(seefigure7.8onthenextpage).
Figure7.8:SFR,GPRindatamemoryTosummarizeMCUs,CPUs,datamemory,programmemory,andperipherals,figure7.9showsaconceptualblockdiagramofPIC18Fcontainingmemory,aCPUcore,andperipherals.
Figure7.9:PIC18Fblockdiagram
MCUInstructions
TheMCUinstructionwordlengthvariesfromonePIC®familytoanother.ThePIC18instructionsare21-bitswidewhereasthePIC16instructionsare14-bitswide.Regardlessofbitsize,allinstructionsconsistofoperationcode(op-code)andoperand.Op-codesaretheinstructionsthatperformarithmeticandlogicoperations.Operandsarefileregisters’addresses.Someinstructionsarebyte-orientedwhileothersarebit-oriented.Byte-orientedinstructionsoperateontheentireregister.Addition,subtraction,logicoperations,datamoving,andbranchingoperationsareexamplesofbyte-orientedinstructions.Bit-orientedoperationsperformbitoperations.Bitshiftingandclearingareexamplesofbit-orientedoperations.Aninstructionsetisacollectionofallinstructions.Theinstructionnumbersintheinstructionsetisfamily-specificandmaydiffergreatly.Table7-2belowlistssomecommonbyte-andbit-orientedinstructionsinassemblylanguage.Mnemonicsintheleftcolumnrepresenttheoperands’names.
Table7-2:Byte-andbit-orientedinstructionsinassemblyFandWinthetablerepresentthefileregisteraddressandthedestination.Belowisanactualassemblycodeexample:addWFGPIO,F
Thisbyte-orientedoperationaddstwo8-bitnumberstogetherandproducesan8-bitresult.The“F”onthefarrightdesignatestheresultdestination.Inthisinstruction,weareaddingthevaluesintheworkingregister(W)andGPIO(fileregister).GPIOstandsforgeneral-purposeinputoutput.GPIOpinfunctionscanbechangedbysoftwaretoinputoroutputpin.GPIOandWresideintheCPUcoreandtheycanstoreliteralvalues(numbers,characters,orstrings).Let’ssaytheworkingregistercontainsavalueof“3”.GPIOpresumestohaveavalueof“2”priortoexecutingthisaddinstruction.Afterthisinstructionisexecuted,theresult(2+3=5)willbestoredinthefileregister(F),whichinthiscase,istheGPIOregister.Thevalueintheworkingregisterwillremainthesame.Ifyouwanttostoretheresultintheworkingregisterinstead,thefollowingcodecanbeused:
addWFGPIO,W
Inthiscase,thevalueoftheworkingregisterwillbereplacedwiththeadditionresult.GPIOremainsatitsoriginalvalueaftertheinstructionisperformed.UsingGPIOtodrivea7-segmentdisplayisacommonapplication.APIC18(L)F1XKK22canbeusedtodrivea7-segmentdisplay(seefigure7.10).EachsegmentisanLED.A7-segmentdisplaycan
becommonanode(CA)orcathode(CC)type.Allanodenodesareconnectedtogetherinacommonanode-typedisplay.Turingitonrequirespower(5V)totheCAnode,andanRCpintogetpulleddown.Theresistors’functionsaretolimittheLEDcurrent.
Figure7.10:PIC18drivesa7-segmentdisplayOnbit-orientedoperations,thefollowingassemblycodeclearsGPIOregister’sbitnumber3.bcfGPIO,2Thethirdtypeofoperationisliteralcontrol.Table7-3showssomeexamples.
Table7-3:Literalandcontroloperationsmovlw0xFFTheaboveliteraloperationcopiesthevalueFFinhexadecimal(0X)totheworkingregister(W).Thecontroloperationbelowtakesprogramexecutionattheresetvector.gotoSTART
InstructionClock
Everyinstructiontakestimetocomplete.Theinstructionclockisderivedfromanexternalclocksourcethatcouldcomefromtwosources:1)mechanicalresonantdevices,suchascrystalsandceramicresonators,or2)electricalphase-shiftcircuitssuchasresistorsandcapacitoroscillators.Thetrade-offbetweenthetwoisthatmechanicaloscillatorrunsatmuchhigheraccuracywithlowtemperaturedrift(change).RCoscillators,incontrast,sufferfrompooraccuracy(morethan5%)overtemperature.Thepreciseinstructionclockfrequencyisdevicespecific.Inthe16-bitPIC24family,theinternalinstructionfrequencyis2Xslowerthantheexternalclock.ThedsPIC30hasfourexternalclockcyclesperinstructionclock.Figure7.11onthenextpageshowsaPIC24’soscillator(FOSC)andinstruction(FCY)frequencies.Ittakestwoexternalclockcyclesforoneinstructionperiod(TCY).
Figure7.11:PIC24’soscillator(FOSC)andinstruction(FCY)frequencies
Theinstructionclockissignificantinembeddeddesign.Insteadofusingfrequency,MCUsusemillionsofinstructionspersecond(MIPS)todefineitsperformance.MIPSisdefinedbyinstructionclock,e.g.,a16MIPSPIC®wouldneeda32MHzexternalclocktooperateaccordingtofigure7.11.Asforthenumberofcyclesittakesperinstruction,itdependsontheinstructiontype.Themajorityofinstructionstakeonlyonecycle;sometaketwo.Mathematicalinstructionslikedivisioncouldtakeasmanyastwentyinstructioncycles.
InternalOscillator
MCUscomewithinternaloscillators;someevenhaveaPLLfrequencysynthesizeron-chip.Designerscanselect,viasoftware,aninternaloscillatortosupplythesystemclock,theclockfortheCPU,andotherperipherals.Theflexibilityofselectingtheclocksourcesgivesdesignerstheflexibilitytotailortheirapplicationsforoptimalperformanceandpowerconsumption.Figure7.12isasimplifiedPIC®MCUclocksourceblockdiagram.TheLP,XT,HS,RC,andECdesignationsareasfollows:EC(quartzcrystalresonators),LP,XT,HSmodes(ceramicresonators),andRCmode(resistor-capacitorcircuits).Amongceramicresonators,LP:lowpowercrystal,0to200kHz,XT:crystalorceramicresonator,0to4MHz,HS:highgainsettingforthecrystal.
Figure7.12:SimplifiedPIC®MCUclocksourceblockdiagram
ThetimerisanimportantperipheralinMCUs.Thetimercouldruninthebackgroundwithoutinterferingwiththemainprogram.Itcanbeusedtotimeaneventonaninputandgenerateanoutput.Duringtiming,thetimerincrementsoneveryinstructionclockwithdelaytimedeterminedbythetimerregister.Youcanthinkofthetimerasastepcounter.Thestepsizedependsontheinternalorexternalclocksource.Figure7.13showsatimingfunction.Thestartandstoptimearefullyconfigurable.Thedelaytimeisstoredinthetimerregistersforretrieval.
Figure7.13:Timer’sfunction
Otherthantiming,thetimercanbeusedasacountertocountanevent.Whencounting,thetimerincrementsoneveryinput’srisingorfallingedgeindependentoftheinternalclock.Inthiscase,thetimeriseffectivelycountingsignaltransitions.Timerscanrecordanevent’sarrivaltime;generateperiodicinterrupt;andmeasurepulsewidth,period,frequency,ordutycycle.Moreover,wecanuseatimertogenerateawaveform.AsimpleapplicationexampleusingatimercouldbetogglingtheLEDconnectedtoaGPIOpinmanytimespersecond.Thisrequirestimerconfigurationtooverflowthenumberoftimespersecondgeneratinganinterrupt.TheISRwouldincludethecodetoblinktheLEDsaccordingly.Someprogrammingexampleswillbeshownlaterinthechapter.
Interrupt
InterruptisanothermajorMCUfeature.Itprovidesareal-timeresponsetotheMCUfromeitherexternalorinternalevents.Whenaninterruptoccurs,themainprogramstopsandtheinterruptflaggoeshigh.MCUisinstructedtojumptoandthenruntheinterruptserviceroutine(ISR).ISRisauser-definedprogramandcanimplementanyMCUfeaturestheprogrammerswouldlike.UponISRcompletion,theprogramresumesrunningthemainprogramfromwhereitwasstoppedbytheinterrupt.Theinterruptflagthenneedstobeclearedbysoftware.Ifinterruptisnotenabledoriftheinterruptneveroccurs,ISRwillnotbecalledandtheinterruptflagwillneverbeset.YoucanthinkofISRasaprogramwaitingtorununderspecialconditions.Theseconditionsarefullyconfiguredbytheprograms.Therearemanyinterruptsources;table7-4listssomeofthem.Theexternalinterruptisadedicatedexternalpinusedexclusivelyforinterrupt.Seefigure7.14forapracticalexternalinterruptexample.
Table7-4:Externalinterruptexample
Inthisexample,anRA2pinisanexternalinterruptpin.Ifthispinissetupasthefalling-edgetriggered,thenwhentheswitchcloses,RA2getspulleddown.Theinterruptflagthensets.TheprogramstopsandwilljumptoISR.IntheISRprogram,it’swrittenthattheLEDturnsonbypullinguppinRC7thenturnsoffonlyifRA2ishigh(switchopens).Asecondexamplecouldbethattheswitchisreplacedbyapushbutton.TheISRcanbewrittensuchthatoncetheinterruptflagisset,theLEDturnsonforapredeterminedperiodoftimeusingatimer,thenturnsoff.
Figure7.14:Practicalexampleofexternalinterrupt
SpecialFeatures
MCUshavemanybuilt-infeaturesmakingithighlyfieldprogrammable.SomeMCUshaveseparatepowersupplypinstoprovidesupplyvoltagestoCPUsandperipheralsseparately.Isolatingpowersuppliesisessentialinreducingnoisefromoneareatoanother.SomeMCUshaveinternalregulatorsallowingoneexternalsupplyvoltage(VDD)andpowerupmultipleblockswithintheMCU.ThissavesonMCUpinandboardspacewhilekeepingthenumberofexternalsupplycomponentsminimal.Figure7.15elaboratesonthisconcept.Awatchdogtimer(WDT)isanindependenttimerthatcouldrecoverfromasoftwaremalfunction,(e.g.,aninfiniterunningloop).IftheWDTisenabledfollowedbyanoverflowbeforeitisresetviasoftware,itassumessoftwarecontrolhasbeenlost.ItthenautomaticallyresetsthePIC®.Itcanbeusedtowakeadevicefromsleep(lowpowermode)withoutresetprovidedthattheWDTisresetperiodicallybeforeittimesout.Power-On-Reset(POR)placestheMCUinresetstatewhenpowerisfirstapplied.Itthenreleasesthedevicefromresetafteraperiodoftime.Thistimeiscontrolledbytheinternalpower-uptimer.ThePOR’sjobistogiveenoughtimefortheVDDtoriseuptotheminimumlevel.BothPORandWDTresetaresoftwareconfigurable.Brown-Out-Reset(BOR)resetsthedeviceiftheVDDfortheCPUcorefallsbelowacertainthreshold.APIC24MCUVDDcoreminimumisaround2V.Duringreset,iftheVDDcorerisesupagain,thereisadelaytimeofabout20ustheMCUneedstowaitbeforeitgetsreleasedfromreset.TheideaofBORistopreventerraticbehaviorduetoexcessivesystemnoisethatmaychangeVDDlevelsunexpectedly.Thedelaytimerensuresthatthevoltageisstablebeforereleasingthedevicefromreset.TheOscillatorStart-upTimer(OST)isanexternalcrystalorresonator.TheOSTwillautomaticallycount1,024oscillatorcyclesbeforereleasingtheclocktotheMCUmakingsuretheoscillatorhasstabilized.Sleepmodeisusedtosavepowerbyminimizingclocks.Thecoreandmostperipheralscanbe
stoppedasaresultofsleep.SomePIC®MCUshaveXLP(extra-lowpower)technologytosavepowerwithcurrentrunningaslowas20nAindeepsleepmode.ThedevicegoesintosleepmodebyexecutingaSLEEPinstruction.UnlikeanexternalMasterClearreset,thereareseveraleventsthatcanwakeupthedevicefromSLEEPwithoutresettingthedevice.Thewatchdogtimertimeout,I/Opin,andperipheraloutputchangescanwakeadeviceupwhilenotresettingtheMCUandthenresumeprogramexecution.Sleepmodeisextremelyusefulinbattery-poweredapplicationstoextendbatterylife.Examplesofapplicationsareportablemedicaldevicessuchasbloodpressuremetersanddigitalthermometers;smartenergymeterssuchaswater,gas,heat,andelectricmeters;LCDdriversforgraphicdisplay;integratedUSBapplications;smartcardsforauthenticatedsystems;embeddedwi-fi(wirelessfidelity)modules;andpowerradiomodulessuchasZigBee®orRFID(radiofrequencyID).
Figure7.15:Internalregulator
DevelopmentTools
MostMCUvendorsofferfreestand-alonesoftwaredevelopmentkits(softwareplatform)toembeddedsystemdesignersandprogrammers.Thedevelopmentkitsareacollectionofsoftwarecomponentsallcombinedintoonesoftwarepackage.Thecomponentsincludeaprogram(code)editor,projectmanager,programminglanguagesupport,source-leveldebuggers,andsoftwareplug-ins.Embeddedsystemengineerscanusethesesoftwarefeaturestodevelop,debugapplications,hardwareallinonesoftwareenvironment.MPLABXisthelatestdevelopmenttoolbyMicrochipTechnology.It’sanintegrateddevelopmentenvironment(IDE)forembeddedsystemengineerstodevelopcode
(software)inasingle,cohesiveplatform.AsnapshotoftheMPLABXIDEisshownbelow(seefigure7.16).
Figure7.16:MPLABXIDE
Theintegrationmethodologygoesbeyondcodedevelopment.Otherthanthestandardfile,projectcreation,management,andcodeeditorwindows,IDEcomeswithacompiler,anassembler,simulation,andhardwaredebuggerfunctionality.Acompilerisasoftwareprogramthatworkswithhigh-levellanguagessuchasC,C++,orJava.IttransferswrittencodeintomachinelanguagesothattheMCU(hardware)canunderstandandruntheapplicationsaccordingly.Assemblerworksonassemblylanguage.Itsfunctionissimilartoacompilerbridgingtheassemblyandmachinecodes.Embeddedsystemdesignerscanchooseanylanguagetheyprefer.Thedifferencebetweenacompilerandanassembleristhatanassemblerworkswithlow-levellanguageswhilecompilersworkwithhigh-levelones.Themajordifferencebetweenhigh-andlow-levellanguagesisthatalow-levellanguage’ssyntaxisclosertothemachinecode(0sand1s).Assemblycodeisrelativelydifficulttounderstandatfirstglancewhereashigh-levelcodeiseasiertocomprehend.Usingtheassemblycodeshownearlier,
addwfGPIO,F
Itmaynotbeobvioustheabovelineofcodeaddthecontentsofworkingandfileregisters.ComparingittothisCprogrambelow:if(X==1)
printf(“Xisequalto1”);
Youcaneasilyseethatit’sevaluatingwhetherXisequalto1.Ifitis,thentheprogramprintsout“Xisequalto1.”RecallMCUfamiliesearlierinthischapter.EachfamilyrequiresacompilerorassemblerwithintheIDEtoconverttheprogramsandoutputstomachinescodesbeforetheMCUcanrunitsoperations.Mostcompilersandassemblersarefree.Manyarebothcompanyspecificanddevice-specific,e.g.,an8-bitMCUdesignneedsan8-bitcompiler,andthesamecompilerwouldnotworkon16-or32-bitcodenorwoulditworkinanothercompany’sIDE.
Debugger
DebuggingtheprogramswithinanIDEiscalledsimulationanddebug.Simulationchecksfortheprogram’ssyntaxerrorsusingitsprogrammingalgorithmbuiltwithintheIDEsoftware.Theultimategoalofanyembeddeddesignistoverifythatthecodeworksontheactualhardwareusingthedebugfunction.Todoso,thedebuggerissupportedintheIDEtoactasabugreportingtoolbetweentheIDEandtargetsystem(hardware).Thedebuggersendsthecodeouttothehardwarethatrunstheapplicationsbasedonwhatthecodeiswrittenfor.ItthenreportsbacktotheIDEthroughthedebuggerifthereareanyissues.Itkeepstrackofdataandprogrammemorycontentsalongwithprogramstatus.Iftheprogramdidnotworkthewaytheapplicationwasintendedto,theprogrammerscouldthenusethereportedinformationtomodifytheprogramaccordingly.Thiserrorreportingandprogrammodificationprocessrepeatsuntilthedesiredoperationsoccuratthetargethardware.MicrochipTechnologyoffersseveralchoicesofdebuggers.PICKIT3isalow-costdebuggerwithmanyusefulfeaturesembeddedsystemdesignersneed.Manymicrocontrollercompaniesoffervarietyofevaluationanddevelopmentboards.Arduinoisapalm-sized,single-boardmicrocontrollerpopularamongacademiaandhobbyists.MicrochipTechnologyalsosuppliesavarietyofevaluationanddevelopmentboards.Figure7.17onthenextpageshowsPICKIT3andanevaluationboardthathasaLDCscreenonit.
Figure7.17:PICKIT3andevaluationboardwithLCDscreenIn-CircuitDebugger3(ICD3)isaCD-sized,mid-enddebuggerthatoffersabreakpointfeature.Figure7.18describesthedebugmethodologyusingICD3asdebugger(seefigure7.18).
Figure7.18:DebugmethodologyusingICD3
Itsupportsfull,high-speedUSBconnection,wide-inputvoltageranges(2Vto5V),andmultiplebreakpointssothatengineerscanpausetheprogramduringcodeexecutions.Fromfigure7.18,youcanseethatICD3actsasthecommunicationbridgebetweentheIDEandthetargetboard.ICD3allowsuserstoaddbreakpointsintheprogram.Thedebuggerpausesatwherethebreakpointislocatedduringdebug.Theprogramcontinuestobehaltedunlessprogrammersclick“continue”intheIDE.Breakpointisapowerfuldebuggingtoolforpinpointingerrorsinaprogrameffectively.Figure7.18ashowsanoccurrencehighlightedinaredbox.Whenthedebugstarts,theprogramexecutesinstructionsonelineatatime.Atline13,wherethebreakpointisadded,theprogrampausesduringdebugging.Programmerscannowmonitorandviewprogram,data,andmemorycontentsastheywish.Clickingthe“continue”buttonintheIDEresumesprogramexecutionandmoveontothenextlineofcode(line14).
Figure7.18a:Breakpointonline13
OtherusefulfeaturesinMPLABXareview,monitorvariablesorregistercontents.MPLABXoffersseveraltoolstoshowmemoryvaluesusedbytheprogramatanytimecalledWatchesandVariableswindows.Withfewmouseclicks,WatchesandVariableswindowscanbedisplayedwithintheIDE.Programmerscanchooseanyregisterstheywishtoview.AnIDEisamajorcomponentindesigningembeddedsystems.Engineersandprogrammersneedtogetfullyfamiliarwithitsfeaturesandfunctionsinordertoreduceproducttimetomarket.
DesignExample:Comparator
Toclosethischapter,let’stakealookatsomeembeddeddesignexamples.We’llstartwithacomparator.Justlikethecomparatormentionedinchapter4,AnalogElectronics,itcomparestwoinputvoltages.ComparatorsarestandardMCUperipheralsoftencombined
withcaptureandPWMmodules.Inthisexample,theobjectiveistodetecttheportabledevice’sbatteryvoltage.Whenthebatteryvoltagefallsbelowathreshold,theMCUcomparatoroutputpinwillpullup.ThisoutputpincanbeusedtoturnonanLED,notifyingtheuserwhenthebatteryislow.Thecomparatoroutputconnectstoaninternaltimerasapulsecounter.Intheapplicationblock(seefigure7.19onthenextpage),R1andR2setthebatteryvoltagethreshold.Assumebatteryvoltageis5Vwhenfullycharged.3VisthethresholdvoltageyouwanttolightuptheLED.Usingthevoltagedividerrule,resistorvalueswillbe:
R1=10kΩ,R2=16.67kΩ
ThecomparatoroutputgoestoanXORgate.Thesameoutputgoestothetimer,whichactsasacounter(moreontimerlater).ThesecondXORinputisacomparatorcontrolbit.ItcontrolsthepolarityoftheexternalXORoutput.Iftheinverterbitissettologic“1”(true),theXORoutputisinverted.Iftheinverterbitissettologic‘0’(false),theXORoutputisnotinverted.
Figure7.19:Comparatorapplication
ToprogramanMCU,engineersneedtoknowwhatregistersandcontrolbitstoconfigure.Figure7.20onthenextpageshowsthecontrolbitnamesanddescriptionsofthecomparatorcontrolregister(CMxCON).Onceagain,thecontrolregisternameisdifferentamongMCUpartsandvendors.Thenamebelowisjustanexample.ManyMCUshaveseveralcomparators.The“x”variableusedinthecontrolbitnamedesignatesthecomparatornumbers.Forexample,thefirstcomparator’sregisternamewouldbe
CM1Con.ThecomparatorpolarityselectionbitisCxPOLasshownbelow.
Figure7.20:CMxCONregistercontrolbitnamesanddescriptions
MCUprogrammingisasubjectthatcouldtakeanentirebooktocover.ReaderswhoareinterestedinlearningmoreaboutMCUprogrammingneedtofirstchooseaprogramminglanguageandstudyit.Belowisaseriesof#definestatementsthatconfigurethecomparator.InCprogramming,#definestatementsarepreprocessorstatements.Theyareusedasasubstitutionfortextwithincode.Forexample,inline1oftheexamplebelow,wheneverCOMP_INT_ENappearsinthemainprogram,itwillbereplacedbythebitvaluesinbinary:0b1000000(“0b”designatesthenumberisabinarynumber).
#defineCOMP_INT_EN#defineCOMP_INT_DIS#defineCOMP_INT_MASKComparatorbit//*************ComparatorOutputEnable/Disable**************0b10000000//EnableComparator0b00000000//DisableComparator
(~COMP_INT_EN)//MaskEnable/Disable
#defineCOMP_OP_ENEnabledonCxOUT#defineCOMP_OP_DISDisabledonCxOUT#defineCOMP_OP_MASKEnable/Disable0b01000000//ComparatorOutput
0b00000000//ComparatorOutput(~COMP_OP_EN)//MaskComparatorOutput
//*******************ComparatorOutputInversionSelection*******#define
COMP_OP_INV0b00100000withOPinvert#defineCOMP_OP_NINV0b00000000OPnoninvert#defineCOMP_OP_INV_MASK(~COMP_OP_INV)OutputInversionSelectionbit//Comparator//Comparatorwith//MaskComparator
//******************ComparatorInterruptgenerationsettings******#defineCOMP_INT_ALL_EDGE0b00011000generationonanychangeoftheoutput#defineCOMP_INT_FALL_EDGE0b00010000generationonlyonhigh-to-lowtransitionoftheoutput//Interrupt
//Interrupt
DesignExample:Timer
ThetimerisapopularperipheralinMCU.Manyapplicationsrelyontimingfunctions.Timeisanimportantparameterinembeddedsystems.Itisrepresentedbythecountofatimer.TimerbitnumbersdependontheMCUfamily.An8-bitMCUcomesstandardwithan8-bittimer.AnMCUtimercanrunonitsownwithoutinterferingwiththerestofthesystem.ThisfeaturemakesMCUflexibleandversatileinmanyapplications.Intermsofapplications,atimercanrecordaneventarrivaltime,generateaninterrupt,andmeasurethepulsewidth,period,frequency,orevendutycycleofasignal.MostMCUscomewithmorethanonetimer.Theblockdiagrambelowinfigure7.21showsTIMER0inaPIC16part.
Figure7.21:Timer0blockdiagram
Atimerrequiresareferenceclocktorun.InPIC16,TIMER0canbedrivenbyeitherFOSC/4(instructionclock)orexternalclocksource(T0CK1).AT0XCS(clockselect)bitdecideswhetherFOSC/4orexternalclockisused.TMR0SEisthesourceedgeselectbit.Ifsetto
“1,”TIMER0incrementsonhightolowtransition.Ifit’ssettozero(clear),TIMER0incrementsonlowtohightransition.Thereisaprescalerfunctionthatslowstheclockdown.PS<2:0>meanstherecouldbe8prescaleroptions(23=8).Thetimerratecanbedividedfrom1:2allthewayto1:256.Forexample,iftheinstructionclockrunsat1MHz,PSbitsaresettohaveadecimalvalueof4,andtheinternalclockisnowrunningat250kHz(1MHz/4=250kHz).ThenexttimerbitisaPSAbit.Itdetermineswhetherornotyouwanttouseaprescaler.Ifnotused,noclockratereductionoccurs.Foran8-bittimer,whenthetimerrollsoverto255,aninterruptautomaticallyoccurs(256incrementingstartedfrom0andendsat255,28=256).Wecanthenusetheinterruptsignaltocontrolotherfunctions.TheOPTIONregisteristhetimercontrolregister.Let’suseTIMER0tocreateatimedelayof2ms.Attheendofthe2ms,aninterruptsignalisgenerated.Inthisexample,weareusinga16MHzcrystaloscillator.Firstweneedtofigureouttheinstructionclockcyclefromthecrystal.Ifyourecall,thetimerisfedbytheinternalclock.Thisclockcomesfromacrystaloscillator.We’dneedtodividethecrystalbyfourtogetinstructionclockcycle.Thatturnsouttobe250ns.
Toslowdowntheclock,weusetheprescalervalueof32.Thisgivesustheactualinstructionclockfrequencyat125kHz(4MHz/32=125kHz)or8usclockcycle(1/125kHz=8us).Consequently,eachstepthetimercountsisnow8us.Toachieve2msdelay,weneedtosetTIMER0registertostartfrom5sothatitwillincrement250stepsrollingoverat255(5to255=250).Loadingtheoptionregisterinfigure7.22woulddoexactlywhatwewant.
Figure7.22:OptionregisterBelowaretheCprogram’simplementationsofthistimerexample.Inthisexample,wenametheCfunction,delay.Thedelayfunctionwillacceptaparametercalledxasa
charactertype.voiddelay(charx)
ThevoidkeywordmeansthisCfunctiondoesnotreturnanyvaluesbacktotheoperatingsystem.Withinthefunction,wedeclarei,initializex,andcleartheTIMER0register.Since“i”isanindex,wecanstepthrough5times.Recallthatweneedtorollovernotjustonce,but5timesinordertoget2ms.
inti,TMR0=0,x=1;WedisabletheTIMER0interruptbyassigning“0”tothetimerinterruptenablebitsothattheinterruptflagisfirstclearinitially.INTCONbits.TMR0IE=0;Thenextstepistoloadtheoptionregisterwiththeappropriatebitvalues.OPTION_REG=0b00000111;Withasimpleforloop,theprogrampresetstheTIMER0registerto5sothatitoverflowsonthe
250thpulse(250X8us=2ms).for(i=0;i<x;i++)INTCONbits.TMR0IF=0;TMR0=5
Insidetheforloop,wefirstcleartheinterruptflag,justtomakesureitwasn’tsetfromotherpartsoftheprogram.Wesetxto1sothatthisforlooponlyexecutesonce.IndexingitonceisallweneedtorolloverthetimerregisterbysettingTIMER0registerstartedfrom5.Thewhilestatementmonitorstheinterruptflag.Itwillsetifthetimerregisterrollsoverat255,andthentheprogramwillexitoutoftheforloop.Theresultofthisfunctionisthatwesuccessfullycreatea2mstimedelay.
while(!(INTCONbits.TMR0IF));
Summary
Microcontrollers’marketanddefinitionswerefirstdescribedinthischapter,followedbyMCUtypes,parameters,architecture,instructioncycle,andinstructionsetdefinitions.MCUsequipwithmanyperipheralsthatarehighlyconfigurabletoallowembeddedsystemdesignerstotailorspecificapplications.PracticalMCUapplicationsusingcomparators,timers,debuggers,IDEs,andprogrammingtechniqueswerecovered.Embeddedsystemengineersneedtomasterbothhardwareandsoftwareskills.AgoodunderstandingofMCUparametersandthedatasheetwillleadtoincreaseddesigneffectivenessandefficiency,reducingproductdesigntimetomarket.
Quiz
1)NamefivepopularMCUapplications.2)NamethreedifferencesbetweenMCUsandcomputingCPUs.3)WhatarethetwotypesofmemoryfoundinMCUs?Whatarethedifferencesbetweenthem?4)WhatarethemostpopularMCUproductfamiliesinnumberofbits?Whatdoesthisnumbermean?5)ListfivepopularMCUperipheralmodules.
6)IfanMCUusesanexternaloscillatorrunningat32MHz,whatistheinstructioncyclefrequency?7)ListthreeMCUspecialfeaturesandbrieflydescribetheirfunctions.
8)Writeanassemblycodethatsubtractsthevalueof“5”,whichisstoredintheworkingregister,fromtheGPIOregister.Theresultofthesubtractionwillbestoredinthefileregister(F).
9)Iftheinstructionclockcycleinthetimerdesignexample(seepage269)isdivideddownbya1:8prescalerinsteadof32,whatisthefinalclockfrequency?10)WriteaCprogramtocreatea1mstimebaseusingTIMER1module.
Chapter8:ProgrammableLogicControllers
Programmablelogiccontrollers(PLCs)aredigitalcomputersusedinindustrialandcommercialapplications.Theirmainfunctionsaretocontrolmachinesandautomatecomplexprocessesandmotions.ThePLCmarketisfragmentedwithmanyPLCsystemmanufacturers.SomeleadingPLCsuppliersareBoschandSiemens,Allen-Bradley,GeneralElectric,Panasonic,andMitsubishiElectric.Figure8.1showsanadvancedPLCfromGeneralElectriccalledtheProgrammableAutomationController(PAC).Itsdimensionsareapproximately4feetlongby1footwide.
Figure8.1:GEProgrammableAutomationController(PAC)
Duetotheneedsofoperatinginindustrialenvironments,PLCsarebuilttoberuggedwhilemaintainingmanycomponentsfoundinpersonalcomputers.Forexample,PLCs,likecomputers,havememory,CPUs,inputandoutputterminalsconnectingtoinputandoutputdevices,andbuilt-inpowersupplies.APLClacks,however,aharddrive,keyboard,andmonitor.Ontheotherhand,PLCscomewithcontrolprogrammingsoftwareallowingPLCdesignerstocreatecustomPLCprogramsoncomputerstotailortheirdesignneeds.TheprogramminglanguageusedinPLCsisladderlogic,agraphicalprogramminglanguageasopposedtotextbasedprogramminglanguagessuchasC,C++,orJAVA.Inthischapter,wewillcoverPLChistory,overview,operations,functions,applications,ladderlogicprogramcreation,techniques,andseveralPLCprojectexamples.
History
ThedevelopmentofPLCsfirststartedwithGeneralMotor(GM)inthelate1960swithinitsHydra-Maticdivision.TheoriginalobjectiveofthePLCwastoreplacebulky,costlyrelays,eliminatingcablesinthemanufacturingsystems.Thebenefitsarethattheyreducecostandincreasetherangeoffunctions,versatility,andflexibilitywhileachievinghigherreliability.Arelayactslikeaswitchapplyingelectromagnetictheorytooperate.Itsmainfunctionistocontrolmechanicalmovements(seefigure8.2).Byclosingtheswitch(abovetherelaycontrolACsource),anACcontrolsignalisappliedtothe
electromechanicalrelay.Itenergizesthecoilviatheelectromagnetmagnetizingthearmature,causingittodeflatedownward.Asaresult,theendpointsattheright-handsideofthearmaturemakingcontactachievinganormallyclosed(NC)condition.Ifthereisnorelaysignalappliedtothemagnet,thearmatureisdeenergized.Itthentiltsupwardanchoredbythespring.Itnowmakescontacttothenormallyopencontact(NO)point.Relaysareusedinheavyloadapplicationssuchasmotors.Thebenefitofusingrelaysisthatthecontrolsignaliselectricallyisolatedbythemagnet,providingisolationprotectionbetweenloadsandusers.Thisisessentiallyasafetymeasureasmanyindustrialapplicationsinvolvehigh-powerinputandoutputdevices.
Figure8.2:Relaydiagram
ThecontrolofelectricalsystemswithinGM’sHydra-Maticdivisioninthe60sreliedheavilyonconventionalhard-wiredrelays.Imagineacabinetfulloftheserelayscloggedwithcables.Figure8.3showsacabinetwithrelaysandcables.
Figure8.3:Relaycontrolpanel
Theseexternalcomponentsaddednotonlymaterialandlaborcostsbutalsocomplexitytothesystemaswellasdifficultyintroubleshooting,design,change,andrepair.Loweringcosts,increasingflexibility,andeaseofmaintenancebecamemajorinitiativeswithinGM.GMengineersthendevelopedtheconceptofPLCsutilizingcomputertechnologiesinasystemthatwouldautomatecomplexindustrialapplicationprocesses,andatthesametimethesystemswouldoperateoptimallyinharshindustrialenvironmentsfilledwithdirt,dust,moisture,andinsomecases,chemicals,shocks,andvibrations(e.g.,automotivemanufacturing).SinceitsinceptionofPLCs,AllenBradley,asacompany,tooktheconceptfurtherdevelopingthePLCterminology.AllenBradley(nowaRockwellAutomationcompany)PLCshavesincebecametheindustrystandard.
PLCBenefits
PLCfunctionsincludetiming,counting,calculating,anddigitalandanalogsignalprocessing.ThesebasicfunctionsformthefoundationsofPLCstructure.ThemajoradvantageofPLCsisthatthemajorityofthefunctionsarecontainedwithinthePLChardware.Thislargelyreducesthesizeoftheoverallsystemsandthelikelihoodof
makinganywiringmistakes.ThedesignersofthePLCprogramshavefullcapabilitytocreateladderlogicprogramsthroughsoftwaredisplayedonacomputermonitor.Anyprogrammodificationsareeasilymadebysoftware.Thisismuchbetterthanphysicalwiringchanges,andlowerslaborandmaterialcosts.ManymodernPLCsareequippedwithcommunicationcapabilitiesallowingPLCstocommunicatewitheachotherthroughwiredorwirelessconnections.Withwirelesscapabilities,userscanremotelylogintothesystemfortroubleshootingpurposes.EachPLCmustincludeatleastoneCPU(microprocessor).ThisgivesPLCstheabilitytoprocessdataandinformationinashortperiodoftimecomparedtobulkyrelays.ManyPLCsworkinconjunctionwithsensorsinmanufacturingenvironments.Oftentimes,manufacturingfacilitieshavefast-movingconveyerbeltsystems(seefigure8.4).Theinputdeviceisthesensor,whereastheturnmotoractsastheoutputdeviceinresponsetotheinputsensor.
Figure8.4:PLCapplication:Conveyorbeltsystem
PLCComponents
Figure8.5showsaconceptualPLCblockdiagram.Itincludessixbasiccomponents/modules:Inputandoutputmodules,powersupply,CPU,memory(program,data),andaprogrammingdevice.Theinputandoutputmodulescanbecombinedintoonemodule(I/Omodule).
Figure8.5:PLCblockdiagram
Theinputmodule(slot)servesasagatewaybetweenexternaldevicesandtheinternalcircuitriesofthePLC.Inputdevicesarehardwiredtotheinputterminalsoftheinputmodule.InputmodulesreceiveelectricalsignalsfromtheinputdevicesandthentransmittheminternallytothePLCforprocessing.ManyI/Omodulesarescalablewhereaninput/outputslotcanhavemultipleterminals,fromfourtosixteenormore.Commoninputdevicesarerelays,toggleswitches,pushbuttons,andsensorsofalltypes.Thesetypesofinputdevicesproducesignalsthatareeitherlogichighorlow.TheI/Omodulesthatacceptandproducediscretesignalsarecalleddiscrete(clearlydefinedlevel)inputmodules.I/Omodulesthatacceptandoutputanalogsignalssuchastemperature,pressure,orhumidityvaluesarecalledanalogI/Omodules.Figure8.6showsthesymbolsandactualexamplesofPLCinputdevices.InsomePLCs,bothinputandoutputmodulesareintegratedintoonemodule.Theseprintedcircuitboard(PCB)modulescanbepluggedintoandoutofthePLC.ThisremovablefeaturemakesthePLCsystemscalableandveryeasytorepairwithoutreplacingtheentirePLC.Figure8.1,shownpreviously,containsmultipleinput/outputmodules.PLCinputandoutputdevicespotentiallycarryhighcurrentandvoltage.Powerprotectioncircuitssuchasopto-isolatorsareneededtoisolatehigh-powerfielddevicesfromlower-voltagePLCelectronics.Opto-isolatorsrelyonlightsensitivetransistorstoturnonoroffinternalPLCcircuits.BecausethetransistoristriggeredbyanLED,whichisphysicallyisolatedwithinthetransistor,itprovideselectricalisolationoftheexternalpowerfromtheinternallow-voltagePLCcircuits.
Figure8.6:Switch,pushbuttons,andsymbols
Theoutputmodulesconnecttotheoutputdevicesthroughphysicalwires.Justlikeinputslots,outputsslotscanhavemanyterminals.Examplesofoutputdevicesaremotorstarters,solenoidvalves,andindicatorlights.Theoutputdevicesandsymbols(motorstarter;solenoid;andred,green,yellow,andbluelights)areshowninfigure8.7.
Figure8.7:Motorstarter,solenoidvalves,andoutputdevicesymbols
ThepowersupplyprovidestheelectricalpowertoallmodulesconvertingfromACtoDC.TheDCvoltagesuppliespowertoallinternalPLCcircuits.ThePLCpowersupplytypicallydoesnotsupportexternalinputoroutputdevices,onlyinternalones.TheACratingsaredifferentfromonecountrytoanother.Commonratingsarefrom120Vto240VAC.ThewaytheCPUworksisverysimilartoaconventionalcomputingCPUintermsofperforminglogicoperationsandinterfacingwithdataandprogrammemoryaswellasfetchingandexecutingcommandsfromthePLCprograms.ThemajordifferenceofPLCCPUsandcomputingonesarethatPLCCPUs’performanceisgenerallylowerthanthatofcomputingCPUsintermsofclockspeed.
PLCProgrammingandLadderLogic
PLCprogramsarewritteninladderlogic.AfteraPLCprogramiswrittenandinputtedbyPLCdesignersusingladderlogicsoftwareinstalledoncomputers(programmingdevices),PLCdesignerscantesttheprogramsrightonthecomputerscreenwithoutconnectingtotheactualPLC.Thisiscalledsoftwaresimulation.IftheactualPLCsareavailable,designerscanuploadthePLCprogramstothePLCsviaastandardcomputerinterface
suchasEthernetorRS-232.Enduserscanthenrun,control,andexecutetheprogramsusingtheprogrammingdevice.Duringprogramexecution,whilethePLCconnectstotheprogrammingdevice,itreportstheprogramstatusbacktotheprogrammingdeviceanddisplaysitonthecomputerscreenfortroubleshootinganddebuggingpurposes.WhenthePLCprogramsexecute,theyoperateinrepetitiveloops.First,theCPUreadsthestatusofallinputdevices.ThenitexecutesthePLCprogram.Finally,thePLCprogramsupdateandcontroltheoutputdevices.Thisprocesscontinuesuntiltheprogramispausedorstoppedbytheprogrammerorenduser.TheprogrammingdeviceservesasaplatformforPLCdesignerstoenterladderlogicprogramsinprogrammode.Inthefield,hand-helddevicesareusedinplaceofprogrammingdevicesprovidingportabilitybenefits.Aladderlogicprogramcouldincludemanyelementssuchasnormally-open(NO)andnormally-closed(NC)contacts,outputsymbols,andlogicalfunctions.AnNCcontacthasaforwardslashsymbolinit.Figure8.8showsanexampleofaladderlogicprogram,whichisenteredbythedesigner.TheprogramisstoredintheprogrammemoryofthePLC.Inthisexample,eachhorizontalbranchiscalledarungwhichcomprisescontactandoutputsymbols.S1toS4areonrung1.S5toS7arelocatedonrung2.Acontactcanbeeithernormally-openornormally-closedcontacts(furtherexplanationswillfollowshortly).Itispossibletoaddaparallelbranchonarung.S1andS4formabranchinstruction.Thecirclesontherightendofeachrungaretheoutputsymbolsrepresentingtheoutputdevices.TheseoutputsymbolsultimatelycontroltheoutputdeviceviathePLC’soutputterminals.TheCPUprocessesaladderlogicprogramstoredinthememory,onerungatatime,startingfromthetopoftheprogramandreadingtheinputsofcontactsfromlefttotheright.
Figure8.8:PLCLadderlogicprogram
Inorderfortheprogrammingelementstobeenteredcorrectly,thePLCneedstobesetto
programmode.ThedesignersneedtofirstunderstandtheproperoperationsoftheNOandNCcontactsaswellastheoutputsymbols.Asmentionedpreviously,NOandNCcontactscorrespondtoinputdevices.AndtheNOcontactneedstobecorrectlyaddressedtoaninputterminalwhichconnectsexternallytoaninputdevice.Let’sassumetheinputdeviceisapushbutton.Whenthebuttonispushed,theinputstatusoftheNOislogicallyhighcausingthecontactoutputstatustobeinalogichighstateaswell.Whenthecontactisnotenergized,(i.e.,thepushbuttonisnotpushed),thenthecontactinputstatusislowleadingtologiclowoutputstatus(seefigure8.9).
Figure8.9:Normally-opencontactstatus
IfapushbuttonisaddressedtoaNCcontact,whenthebuttonispushed,theinputstatusoftheNOislogicallyhigh.Becauseit’sanormally-closedcontact(theforwardslashwiththecontactsymbol),byenergizingthecontact,logiclowcontactoutputisachieved.Whenthecontactisn’tenergized,(i.e.,thepushbuttonisn’tpushed),thecontactinputstatusislow.Inthiscase,thecontactoutputstatusishigh.YoucanimaginethataNOoperationworksjustlikeaninverter(seefigure8.10).
Figure8.10:Normally-closedcontactstatus
Allcontacts,outputs,andlogicfunctionelementsinladderlogicprogramsneedtobeaddressedaccordinglyintermsofaddressformat.ForNOorNCinputcontacts,thefollowingformatcanberealized:
I:0/2
Thisaddressmeansthatitisaninputdevicedenotedbytheinitial“I”letter.Followedby“:”,thenumber“0”correspondstothemodulenumber.RecallthataPLCcouldcontainmultipleinputoroutputmodules;thiszerorepresentstheveryfirstmodule.Therightdigit“2”correspondstotheterminalnumberwhichrepresentsthethirdterminalofmodule0(seefigure8.11).
Figure8.11:Inputcontactaddress
PLCprogrammersneedtomakesureinputcontactisaddressedcorrectlysotheintendedinputdeviceisusedaccordingtothePLCprograms.ManyPLCerrorsstemfromincorrectcontactaddressing.TheaboveformatappliestoAllenBradley’sbrandofPLConly.KeepinmindtherearemanyotheraddressformatsfromotherPLCmanufacturers.
Theoutputsymbolsharesaprogrammingtechniquesimilartothatoftheinputcontact.Theoutputsymbolwouldrequirethecorrectaddress(seefigure8.12).Inthiscase,theoutputsymbolO:0/2withinthePLCprogramsmapstothefirstoutputmodule(module0)andthethirdterminal(terminalnumber2)whichconnectsphysicallytoanoutputdevice(motor).
Figure8.12:Outputcontactaddress
Asmentionedearlier,contactscanbeconnectedinparallelformingabranch.Infigure8.13,contacts1and2formabranch.Theoutputsymbollogicstatusiscontrolledbyinputcontact’soutputs.Theoutputsymbolwillbeinalogichighstateifeitheroutputsofcontact1or2ishigh,(i.e.,itfunctionsasanORgate).Theoutputsymbolstatus-controlmechanismisbestdescribedusingcontinuity.Itwillbefurtherexplainedinthenextsection.
Figure8.13:Branch=ORgate
BothNOandNCcontactscanbeconnectedasabranch(parallel).Figure8.14showsanexample.Toenabletheoutput,thenormally-opencontactinputneedstobehigh(outputhigh)andthenormally-closedcontactinputsneedtobelow(outputhigh)respectively.
Figure8.14:BranchinstructionusingNCandNOcontactsIfcontactsareconnectedinseries,theoutputisonlyenergizedwhenall1,2,and3contactoutputstatusesarehigh,(i.e.,anANDgateoperation)(seefigure8.15).
Figure8.15:Seriescontacts=ANDgate
Justlikebranchinstructions,acombinationofNOandNCcontactscanbeconnectedinseries.Toenergizeoutputinfigure8.16,theNOcontactinputneedstobehighwhiletheNCcontactinputsneedtobelow.
Figure8.16:SeriescontactwithNOandNCcontacts
PLCProgrammingExample
Let’suseapracticalexampletofurtherstudyhowladderlogicprogramswork.Thisapplicationsensesthetemperatureandhumidityofawarehouse.Ifthetemperatureandhumiditylevelsgoaboveapredeterminedvalue,theair-conditioning(A/C)systemand
fanwouldturnon.Additionally,thereisamanualoverdrivebuttonallowingwarehouseworkerstoturnontheA/Csystemandthefanregardlessoftemperatureorhumiditylevels.Forsafetyreasons,anemergencystopbuttonisinplacetodisablealloperations.Beforestartingtoprogramladderslogic,designersneedtofirstidentifywhattheinputandoutputdevicesare.Inthisdesign,therearefourinputdevices:amanualoverdrivebutton,anemergencystopbutton,temperaturesensors,andhumiditysensors.Foroutputs,therearetwooutputdevices:anA/Csystemandafan.Seetable8-1forfielddevicesnames,types,andaddressassignments.
Table8-1:PLCapplicationinput,outputdevices,andaddressesFigure8.17showstheladderlogicprogramforthepreviousapplications.
Figure8.17:Air-conditioningandfanladderlogicprogram
Whenthisprogramexecutesinrunmode,itgoesthroughonerungatatimereadingthe
inputcontactstatusmovingfromthelefttotherightoneachrung.Thisprogramonlycontainsonerungeventhoughthebranchinstructionisformedamonginputcontactsandoutputsymbols.Inordertoenablebothparallelconnectedoutputs,continuityneedstobeestablished,meaninglogicoutputsoneachcontactneedtobehighstartingfromtheleftoftherungandcontinuingallthewaytotheright.Figure8.18demonstratesonewaytoestablishcontinuity,denotedbythedottedline.TheoutputstatusofI:0/1,I:1/0,andI:1/1allneedtobehighinordertoturnonO:0/1andO:0/2.Althoughthesecontactsareconnectedinseries,eachcontactisindependentanddoesnotaffectthecontactnexttoit,(e.g.,ahighoutputatI:0/1doesnotcausetheI:1/0inputtogohigh).Thestatusofeachcontactsolelydependsonthefielddeviceassociatedwiththecontactaddressedtoit.Inthisscenario,whentheemergencybutton(I:0/1)isnotpushed,ifbothtemperature(I:1/0)andhumidity(I:1/1)sensorsaretripped,A/C(O:0/1)andfan(O:0/2)turnon.
Figure8.18:Continuityscenarioone
Thereisasecondscenarioinwhichbothoutputswouldbeon.It’sshowninfigure8.19,denotedbythedottedline.Inthisscenario,whenI:0/1andI:0/0outputstatusesarehigh,O:0/1andO:0/2areon.Thismeanswhentheemergencybutton(normally-closed)isNOTpushedwhileatthesametimethemanualoverdrivebuttonispressed,theA/Candfanturnon.Lastly,whentheemergencystopbuttonispressedtheoutputofI:0/1goeslow,andregardlessoftheinputstatusoftherestofthecontacts,theoutputsstayoff.Inthisparticularscenario,I:0/0,I:1/0,andI:1/1formaparallel(branch)instruction.
Figure8.19:Continuityscenariotwo
Combinationallogiccircuits(seefigure8.20)canbeusedtodescribeandmodelPLCprograms.SomePLCdesignersfirstusecombinationallogicasdesigntoolbeforeinputtingtheactualPLCprograms.TheequivalentlogiccircuitofthepreviousexampleconsistsoftwoANDgatesandoneORgate.Theinvertermodelsthenormally-closedcontact.Iftheemergencystopisnotpushed,inverterinputislowandoutputishigh.Ifbothtemperatureandhumiditysensorsaretripped,theANDgateoutputishighenergizingtheA/Csystemandfan.Iftheemergencybuttonispressed,theANDgateinputislowleadingtolowORgateoutput.Iftheemergencybuttonisnotpressedandthemanualoverdrivebuttonis,theANDgateinthebottomresultsinlogichighstatusturningonO:0/1,O:0/2.
Figure8.20:PLCdesigncombinationallogiccircuit
Therearemaximumlimitsoncontactnumbersonarung.Ifanapplicationrequiresmorethanthemaximumcontactnumberstobeonatthesametimetoenableanoutput,aninternaloutputsymbolcanbeused(seefigure8.21).Supposefiveisthemaximumnumberofcontactsallowedonarung.ThisdesignrequiresalleightNOcontactstobeenergizedtoturnonO:0/2.Onrung1,fiveNOcontactsareusedtocontroltheinternaloutput(B3:1/1).TheinternaloutputaddressisthenusedtoaddressanNOcontactonrung2(farleft)alongwiththeremainingthreecontacts.Thesefourcontactsnowcontroltheoutputsymbol(O:0/2).Whenthefirstfivecontactsareclosed,(i.e.,theoutputsof1to5areallhigh),theoutputstatusesofthesefivecontactsenergizeB3:1/1,whichisaddressedtothefirstinputcontactonrung2.Thismakestheinputstatusofthiscontacthigh.Iftheremainingthreecontacts’inputs(6,7,and8)arehighaswell,O:0/2willturnon.
Figure8.21:PLCdesignusinginternaloutput
PLCProgrammingSyntax
Similartotext-basedprogramming,therearesyntaxrulesinPLCprogrammingthatdesignersneedtobeawareof.Thefollowingdiagramshowscommonladderlogicsyntax.First,theoutputsymbolneedstobeonthefarright-handsideofarung(seefigure8.22).
Figure8.22:OutputsymbolsyntaxIt’svalidtohaveoneoutputonarungbyitself.It’sinvalid,however,tohaveonlyinputcontacts(eitherNOorNC)onarung(seefigure8.23).
Figure8.23:Input,OutputsymbolbyitselfsyntaxTocontrolmultipleoutputsatonce,aparalleloutputsymbolcanbeused.It’sinvalid,however,tohavemultipleoutputsinseriesonasinglerung(seefigure8.24).
Figure8.24:Multipleoutputs
Abranchinstructioncanbeusefulwhenpushbuttonsareused.Inmostcases,pushbuttonsrequireuserstoholdthebuttondownorelsethebuttonisoff.Infigure8.25,ifthestartbuttonturnsonO:0/3,theuserneedstoholdthebuttondowntheentiretime.Thisisinconvenientanddoesnotoffermuchflexibility.
Figure8.25:Pushbuttonapplication
Aspecialtypeofbranchinstructioncalledaseal-incircuitcanbeusedtoresolvethisissue(seefigure8.26).Instep1,thestartbuttonisnotyetpushed(startbuttonoutputislow).Althoughthestopbutton(anNCcontact)isnotpressedmakingitsoutputtologichighstate,thereisnocontinuitypathtoturnontheO:0/3becausetheoutputstatusofthestartbuttonislow.Instep2,thestartbuttonispressedwhilestopbuttonstaysoff,andoutput
turnson.Inthiscase,thebottombranchcontacthasthesameaddressastheoutput(O:0/3).Enablingtheoutputcausesthebranchcontactoutputstatustogohigh(dottedline).
Figure8.26:Seal-incircuitstep1)and2)
Instep3(seefigure8.27),thestartbuttonisreleased,andtheoutputremainsonduetothecontinuitypath(dottedline)bythebranchcontactwhilethestopbuttonremainsoff.Instep4,thestopbuttonispressedcausingitsoutputstatustogolowbreakingthecontinuitypath.Itde-energizesO:0/3causingthebranchcontactinputtode-energize.
Figure8.27:Seal-incircuitsteps3and4
AfterinputtingthePLCprograms,designerscandebugtheprogramswithinthesoftwareplatformwithoutphysicallyconnectingtothefielddevices.Theon/offstateofeachdevicecanbeeasilyviewedinthesoftware.Thissoftwaredebugfeatureallowsdesignerstofocusonladderlogicprogramdevelopment,isolatingotherdesignvariablesfromfielddevices.WhendesigningapplicationsthatusePLCstocontrolandautomateprocessesandmotions,besuretocaptureallsystem-levelelectricalandphysicalspecificationsfromallinputandoutputdevices.Allcontrolprocessflowsfirstmustbeunderstoodanddocumentedbeforeprogramming.Combinationallogiccanbeappliedaspointedoutbefore.ThefollowingdesignexampledemonstratesthestepstodesigningandimplementingasuccessfulPLCsystem(seefigure8.28onthenextpage).
Figure8.28:PLCConveyorsystem
Thisdesigniscommonlyfoundinmanufacturingandassemblyfacilitieswhereconveyorbeltsystemsareusedtotransportgoods.Inthisapplication,whenthestartbuttonispressed,themotorstartstoturn,movingtheconveyorbelt.Aftertheboxofgoodsmovestothelimitsensorposition,themotorstopsautomatically.Whiletheconveyorbeltisrunning,thegreenlightison.Whenitstops,theredlightturnson.TheseprocessstepsareusedtodesignPLCprograms.Asidefromprocesssteps,PLCdesignersandprogrammersmustunderstandeachandeveryfielddevice’selectricalspecificationsmakingsuretheproperinputandoutputmodulesarecapableofreceivinganddrivingtheoutputdevices.Questionsmayariseregardingstartandstopbuttontimingrequirements,theredandgreenlights’current,voltagelimitations,motorloading,powerspecifications,limitswitchsensitivitylevel,etc.Alistofthefielddeviceswithcorrespondingaddressesisshownintable8-2.
Table8-2:PLCconveyorapplicationinputandoutputdevicesandaddresses
Figure8.29istheladderlogicprogramoftheconveyorbeltsystem.Theinternaloutput,B3:0/1onrung1,iscontrolledbythestart/stopbuttonsandthelimitswitch.Ifthestartbuttonispressedwhilethestopbuttonandlimitswitcharede-energized,thentheinternaloutput,B3:0/1,ison.Onrung2,thesameB3:0/1addressismappedtoanNCcontact(dottedline),whichisnowlogichigh,makingthesecondrunginputcontact’soutputlow.Thislogiclowoutputkeepstheredlightoff.Onrung3,boththegreenlightandmotorareonasaresultofB3:0/1beingon.Astheboxreachesthelimitswitchposition,inputofI:0/3ishighcausingitsoutputtobelow(rung1).Thiscutsoffcontinuityonrung1turningB3:0/1off.Onrung2,theredlightturnsonduetothelowinputandhighoutputoftheNCcontact(B3:0/1).Onrung3,thegreenlightandmotorturnoff.Tostarttheconveyoragain,theuserneedstopressthestartbutton.Theboxneedstobetakenoutoftheswitchposition.ThisPLCprogramdesignisjustonewaytoperformthedesigntasks.RememberthattwocompletelydifferentPLCprogramscouldperformthesamefunctions.Arightorwrongdesignisnotreallythequestion.Rather,adesignthathastheshortestscantime,hashigherefficiency,andiseasiertotroubleshootandmaintainwillbethebestdesign.
Figure8.29:Conveyorbeltsystemladderlogicprogram
Timers
Let’snowgoovertimersinladderlogicprograms.TimeisacriticalparameterinPLCsystems.Thetimerisastepcounterandthestepsizeisdeterminedbytimebase,whichiseasilychangedinPLCsoftware.On-andoff-timersareavailabletoperformtimingfunctions.ThetimerladderlogicsymbolofanOn-timercontrolledbyanNOcontactisshowninfigure8.30.
Figure8.30:Timersymbolandparameters
Atimerrequiresauniqueaddresstodifferentiateitselffromothers.Inordertoprogramatimer,apresetvalue,timebase,andaccumulativevaluesneedtobesetup.Infigure8.30,thetimeraddressisT4:1.Thedelaytimeriscalculatedbymultiplyingthepresetvaluebythetimerbase,(i.e.,100X1ms=100ms).Ifadelaytimeof1sisdesired,thepresetvaluecanbeprogrammedto1,000,(i.e.,1,000X1ms=1s).Thetimebasecanbechangedtoothervaluesbysoftwareconveniently.Accumulatedvaluerepresentsthedelaytimemeasuredinrealtime.Itusuallystartsfromzeroseconds.Aprogrammercanreadtheaccumulatedvalueduringprogrammodeinrealtime.Inadditiontotimerparameters,atimercomeswithoutputbitsthatcancontrolothercontacts.Thesebitsareenable(EN),timing(TT),anddone(DN)bits.Thespecificaddressofeachbitisassociatedwiththetimer’saddress.UsingT4:1asthetimeraddress,timerbitnamesandaddressesareshownintable8-3.
Table8-3:Timerbitnames
On-Timer
Usingfigure8.30asareference,wecanconstructatimingdiagramtofurtherunderstandhowatimerworks(seefigure8.31).WhentheNOcontact’soutputislogichigh,theENbitfollowswhilethetimerstartstotime(theTTbitgoeshighwhilethetimeristiming).Attheendof100ms,thetimerhasreachedthetimedelayvaluesetbythepresetvalue.Asaresult,thedonebit(DN)goeshigh,andTTnowgoeslowbecausethetimerisnolongertiming.IftheNOcontactoutputremainshigh,theDNbitstayshigh.Ifnot,theDNbitgoeslow,asdoestheENbit.Essentially,ENfollowstheoutputstatusoftheNOcontact.
Figure8.31:On-timertimingdiagram
On-TimerApplication
Let’suseanapplicationexampletofurtherexaminetheon-timer(seefigure8.32).Thisdesignequipswithstartandstopbuttonsandamotor.10safterthestartbuttonispressed,themotorturnson.B3:0/1onrung1formsaseal-incircuit.Thestopbutton(normally-closed)isusedasanemergencystopbutton.B3:0/1onrung2controlsT4:1.TheDNbitcontrolsthemotor.
Figure8.32:On-timerexample
Togeneratea10sdelaytime,apresetvalueissetto1,000.TheDNbitturnsthemotoron10safterstartbuttonispressed(seefigure8.33).Themotorremainsonevenafter10s.Themotoronlyturnsoffwhenthestopbuttonispressed,resettingtheENandDNbitsofthetimer.Thisturnsoffthemotor.
Figure8.33:On-timerexampletimingdiagram
Off-Timer
Thesecondtimertypeistheoff-timer.Accordingtofigure8.34,thetheoryofoff-timeroperationisthattheDNbitisenergizedassoonastheoff-timerinputishigh,(i.e.,theENbitalsogoeshigh).Whenthetimerinputisfalse,theoff-timerstartstotime(TTgoeshigh).Afteraperiodoftimesetbythepresetvalue,thetimingbit(TT)andDNbitgolow.Figure8.34showstheoff-timersymbol.Inotherwords,theoff-timertakestimetoturntheoutputoff.
Figure8.34:Off-timersymbolFigure8.35istheoff-timertimingdiagram.
Figure8.35:Off-timertimingdiagram
Off-TimerApplication
Let’snowuseadesignexampletobetterunderstandtheoff-timer.Inthisapplication,whentheswitchispressed,unlikeapushbutton,theswitchstayspushed(closed);bothlightsturnonimmediately.Aftertheswitchispressedagain,itopens(off).Atthatmoment,theoff-timerstartstotime.ThefirsttimerT4:1turnsLight-1off10s(1,000X10ms=10s)aftertheswitchispressedthesecondtime.Light-2turnsoffafter20s(2,000X10ms=20s).Figure8.36showsthePLCladderlogicdiagramofthisoff-timerapplication.Figure8.37showsthetimingdiagramofthisapplication.
Figure8.36:Off-timerapplicationexample
Figure8.37:Off-timerapplicationtimingdiagram
Counter
Inadditiontothetimer,thecounter’sinstructionsareavailableinPLCs.ThecounterinaPLCcancountitemsupordown.It’sessentialtousecountersinmanyapplicationssuchascountingthetotalnumberofpartsproducedinafactoryusingproximitysensors,ortokeeptrackofcarscominginandoutofaparkinglot.Proximitysensorsareinputdevicesthatproduceadiscretesignalwhenanobjectpassesbythesensor.Itcanbeusedinconjunctionwithcounters.TherearetwotypesofPLCcounters—upanddown-counters.Theladderlogiccountersymbolsareshowninfigure8.38.
Figure8.38:Up-anddown-countersymbols
Intheup-counter,thepresetvalueisconfigurable.It’snowsetto5infigure8.38.TheCU(counter-upbit)bitgoeshighwhenthecounterinputistrue.WhentheNOcontactisactive,theCUbitishighandtheaccumulatedvaluegoesupbyone.ThecounterDNbiteventuallygoeshighwhentheaccumulatedvaluereachesthepresetvalue5.Auniquecharacteristicofthecounteristhattheaccumulativecountervaluecontinuestogoupevenafteritreachesthepresetvalue.Forexample,iftheNOcontactisactiveagain,theaccumulativevaluewouldgoto6.Thefollowingcounterdiagramshowshowanup-counteroperates(seefigure8.39onthenextpage).Inordertoresetthecounter’sDNandaccumulativevalue,aseparateresetinstructionisrequiredtoindependentlyresetthecounter’sDNbit.Figure8.40showsanexampleofusingacounterresetinstruction.ThecounterDNisresettozerowhenswitch2isclosed.Thedown-counterworksverymuchliketheup-counterexceptthattheaccumulatedvaluedecreasesbyoneeverytimethedown-counterinputisactive.TheDU(down-counterbit)istrueeverytimewhenthedown-counterinputishigh.
Figure8.39:Up-counterdiagram
Figure8.40:Counterresetinstruction
CounterApplication
Let’suseacounterandtimertodesignabottle-countingapplication,showninfigure8.41.Thisdesigninvolvesusingaconveyorbeltsystemandaproximitysensorcountingthe
numberofbottlespassingthroughthesensorforafixedperiodoftime(onehour).It’sanimportantpartofthemanufacturingprocesstoevaluatefactorythroughput.
Figure8.41:BottleconveyorsystemTheladderlogicprogramisshowninfigure8.42.
Figure8.42:Conveyorcountingapplication
Whentheon/offswitchispressed,it’sactiveintheONposition.Whentheon/offswitchispushedagain,it’sintheOFFposition.Assoonastheswitchispressed,thetimeronrung1startstimingfor3,600s(onehour).Duringthehour,B3:0/1staysonmakingtheB3:0/1contactonrung3active.Thesensorcontactonrung3detectsabottlepassingthroughit.Itincrementsup-counter’saccumulativevalueoneverybottlepassingthroughthesensor.Theaccumulativevalueofthecounterincreasesbyonewhenabottlepassesthroughtheproximitysensor.Rightafterthetimeraccumulatedvaluereaches3,600,thetimer’sDNbitgoeshigh,breakingrung2’scontinuityduetotheNCcontactaddressedtotimer’sDNbit.Thecountvaluecannowbereadfromtheaccumulativevalueinthecounter.ToresetthecountervalueandDNbit,pushtheswitchagaintotriggerrung4’sresetinstruction.Tostartcountingforonehouragain,presstheswitchtostartthetimerallover.
ProgramControlInstructions
Therearemanycontrolinstructionsinladderlogictocontrolprogramflows.Theseinstructionsallowdesignerstoenableordisableablockofprogramsorcallaspecificsectionoftheprogramrungs.Itgivesflexibilityindesigning,implementing,anddebuggingonlycertainpartoftheprogram,reducingdevelopmenttime.
JumptoLabelInstructions
Jump(JMP)isanexampleofaprogramcontrolinstruction.Itworkswithlabelsymbol(LBL).OncetheJMPinstructionisenabled,itjumpstotheLBLsymbolanywhereintheprogramdefinedbythePLCprogram.Figure8.43showsanexample.Astheprogramprogressesfromrung1torung2andsoon,ifpushbutton2ispressed,theJMPinstructiontakesthePLCprogramtorung4skippingrung3,thencontinuesontorung5.Thestatusofthepushbutton3andO:0/3willnotbeexaminedandprocessed.Theinputandoutputstatusofrung3remainsthesame.
Figure8.43:Jump-to-labelinstructionexample
ThepurposeofJMP,LBLinstructionsmaybethatrung3doesnotaffecttheoutcomeofrungs4and5.Byskippingrung3,theJMPinstructionisolatespartsoftheprogrammakingiteasiertotroubleshootandsavesscantimeduringprogramexecutions.
JumptoSubroutineInstructions
Thenextcontrolinstructionsarethejumptosubroutine,subroutine,andreturn(JSR,SBR,andRET)instructions.WhentheJSRiscalledupon,itjumpstotheSBRinstructionwithintheprogram.TheSBRcouldcontainoneormorerungs.Attheendoftheuser-definedsubroutine,theRETinstructionisneededtoreturnbacktotherungrightbelow
theSBR.Figure8.44showstheconceptofusingtheJSR,SRB,andRETinstructions.SupposeyourPLCprogramrequirestask1tobeperformedmultipletimes.Multipletaskswillneedtobeincludedintheprogram,takingupprogrammemoryspaceandreducescanningtime.ThisisnotanefficientwaytodesignPLCprograms.Iftheapplicationsrequirefasttimingresponse,theextrascantimemayultimatelyfailsystemspecifications.
Figure8.44:Sametaskperformedmultipletimes
Usingsubroutines,onlyonetaskisneededintheentireprogram.Ifthetaskneedstobeperformed,thejumptosubroutineinstructioncallsthetaskasasubroutine.Oncethetaskhasbeencompleted,thereturn(RET)instructiontakestheprogrambacktotherungrightbelowtheJSRinstruction.Theprogramthencontinuestoexecute(seefigure8.45).
Figure8.45:Jumptosubroutineconcept
NestedSubroutines
Thejumptosubroutinereducesprogramsizesandscantime,anditeasestroubleshootingefforts.It’spossibletoimplementasubroutinewithinasubroutine.Figure8.46demonstratesanexamplecalledanestedsubroutine.
Figure8.46:Nestedsubroutine(subroutinewithinasubroutine)
Inthisexample,thefirstsubroutineiscalledbyJSR1(Step1).Withinsubroutine1(SBR1),JSR2callstheSBR2subroutine(Step2).TheRETinstructionreturnsthesubroutinebacktotherungbelowJSR2(Step3).Step4returnsSBR1backtotherungbelowJSR1inthemainprogram.NotethatRETreturnsonlytothesubroutineitwascalledfrom,nottheonepriortothat.Infigure8.45,RETinSBR2onlyreturnstotherungbelowJSR2,notJSR1.Carefulplanningisrequiredsothatthecorrectsubroutinesarecalled.
TemporaryEnd
Temporaryend(TND)isyetanotherusefulladderlogicdebugfeature.Temporaryendsserveasbreakpointsthroughouttheprogramallowingdesignerstoruntheprogramtopauseandcontinueonesectionatatime.ATNDcanbecontrolledwithorwithoutinputcontacts.Figure8.47showsaTNDconcept.
Figure8.47:TNDconcept
Astheprogramprogressestorung3,iftherung3’snormally-open(NO)contactisclosed,theTNDwilltakeeffect.Atthispoint,theprogrampauses.Whentherung3’scontactgoeslow,itdisablestheTND,thentheprogramcontinuestoscanandmovestorung4.Ifrung5’scontactisnotactive,itcontinuesontorung6.Designershavefullcontroloverwhentohalttheprogramduringdebug.
DataManipulationInstructions
PLCcontainsprogramanddatamemorysimilartomicrocontrollers.Theladderlogicprogramsarestoredintheprogrammemory.Data,constants,andnumbersarestoredinthedatamemory.Thereisaneedfordatatobeabletomovearoundsothatladderlogiccanbeusedmoreeffectively.Copyandmoveinstructionsareavailableforthispurpose.
PLCDataStructure
WefirstneedtounderstanddatastructureandhowitisstoredwithinthePLCmemory.Then,wewillusesomepracticalexamplestounderstandhowdatamanipulationinstructionsincreaseprogrammingeffectiveness.Onedatawordconsistsofmultiplebits.The8-bitword(one-byteword)isthemostcommontype,althougha16-bitwordisfound
inPLCmemory.Ablockofan8-bitwordisshowninfigure8.48.
Figure8.48:Bitword,weight,andnumber
Inthesamewayasdigitalelectronics,thefirstbit(bitnumber0)ontherightistheleastsignificantbit(LSB).Thelastbit(bit7)ontheleftisthemostsignificantbit(MSB).Thiswordhasadecimalvalueasfollowsthatdependsontheweightofeachbit:
27X0+26X1+25X1+24X1+23X0+22X1+21X0+20X1=117
IfthePLCdatamemorysizeis4KB(4,096bytes),itequatesto512words,i.e.,512X8=4,096bytes.Multiplewordsmakeupafile.Thenumberofwordsinafileisuserdefined.Figure8.49onthenextpageshowsa4-wordfilenamedFile0.
Figure8.49:WordfileinPLC
Eachwordindatamemoryhasanaddresssothattheladderlogicprogramknowsexactlywheretofetchitfrom.AddressformatsaredifferentamongPLCvendors.Figure8.50showsawordaddressexample.
Figure8.50:Wordaddress
MOVInstruction
Tomanipulateandmovedataaround,weuseaMOVinstruction,showninfigure8.51.Data01010100isfirstloadedintoN0:0bytheladderlogicsoftware.Whentheswitchisclosed,theMOVinstructioncopiesdatafromN0:0toN0:1replacing11110001inN0:1with01010100.NotethatMOVinstructionisacopyinstruction.TheoriginaldatainN0:0remainsas01010100.
Figure8.51:MOVinstruction
MOVInstructionApplication
AcountingapplicationthatimplementsMOVinstructionsisshowninfigure8.52onthenextpage.Acountbuttonandturnswitchareusedasinputdevices.Thetwopositionswitches(positions1and2)setthecountvalues.Byturningtoposition1,thecounterpresetvalueissetto500.Position2setsthecountto1,000.UsingaMOVinstructioneasilytransfersthecountvaluestothecounterwithoutusingasecondcounter.Whentheprogramfirststarts,onrung1,theDNbitislowbecausethecounterpresetislessthantheaccumulativevalue.ThismakestheNCcontactoutputhighonrung1.Ifthecountbuttonispushed,theup-counteraccumulativevaluegoesupbyoneeverytimethecountbuttonispressed.
Figure8.52:CountapplicationandMOVinstruction
Rung2setsthecounterpresetvalueto500iftheposition1switchisclosed(dottedline).Iftheposition2switchisclosed,thepresetvalueissetto1,000insteadbecausebothMOVinstructionsanddestinationaddressesmaptotheC5:1counter.Oncetheaccumulativevaluereacheseitherpresetvaluedependingonwhetherposition1or2ispressed,theDNbitgoeshigh.Thisstopsrung1’scontinuity.AccumulativevalueandDNgetreset.Anewcountcannowstartoveragain.
DataCompareInstructions
PLCscomewithlogicinstructionstoperformcomparefunctions.Compareinstructionsareinputinstructions.Ifthecomparisonresultistrue,thecompareinstructionoutputgoeshigh.Alistofcompareinstructionsthatcomparenumericalvaluesisshownonthenextpage:equalto(EQ);notequalto(NEQ);lessthan(LES);greaterthan(GRT);lessthanorequalto(LEQ);greaterthanorequalto(GEQ).Let’sfirstexaminetheEQUinstruction.Infigure8.53,theEQUinstructionturnsonaredlightwhensourceA(10)isequaltosourceB(timeraccumulativevalue).
Figure8.53:EQUinstructionexample
Anotequalto(NEQ)instructioncomparestwosourcevalues.Iftheyareunequal,theinstructionoutputistrue.Infigure8.54,sourceAcontainsavalueof0.5inthewordN2:1datamemory.SourceBisassignedtoI:0/3thatconnectstoathermocouple.Thetransferfunctionofthethermocouplegives0.5Vatroomtemperature27°C.Ifthetemperatureisnot27°C,theredlightturnson.
Figure8.54:NEQinstructionexampleThegreatthan(GRT)instructioncomparessourcesAandB.IfsourceAisgreaterthanB,theoutputislogicallytrue.Figure8.55demonstratesanexample.
Figure8.55:GRTinstructionexample
SourceAhasavalueof10inN2:1.SourceBconnectstoI:2/1,whichtakesitsvaluefromaweightsensor.Thissensorconversionratiois10lbsper1V.Whenthisprogram
runs,assoonastheweightisgreaterthan100lbs(10VatI:2/1,100lbs/(10lbs/V)=10V),theredlightturnson.
LES,LEQ,andGEQworksimilarlyaccordingtotheirfunctiondefinitions.Aswithdatamanipulationinstructions,PLCapplicationscancombinedatacompareinstructionswithanyotherinstructions.Figure8.56showsanexample.
Figure8.56:Up-counter,LES,GRTapplication
Thisisagainacountingapplicationwithadditionalfunctions.Onrung1,theup-counterpresetvalueissetto2,000.Theproximityswitchtriggerswhenanobjectpassesthroughitincreasingtheaccumulativevaluebyone.Duringthefirst1,000counts(lessthan1,000),rung2istrueturningtheredlighton.Oncethecountvaluegoesabove1,000,theredlightturnsoffandthegreenlightturnsonduetorung3’sGRTinstructionbeingtrue.By2,000counts,thecounterdonebitgoeshigh.Thiscausesrung4toresetthecounter,C5:0.
MathInstructions
Arithmeticfunctionscanbeperformedusingmathinstructions.PLCmathinstructionsareoutputinstructionsthatincludeaddition(ADD),subtraction(SUB),multiplication(MUL),anddivision(DIV)instructions.Figure8.57showsamathinstructionexample.
Figure8.57:Mathinstructionexample
Rungs1and2controlup-countersthatareindividuallytriggeredbytwoproximitysensors(1and2).Thetotalcountsfrombothcountersarecalculatedbytheaddinstructiononrung3.TheresultisstoredinthedestinationN2:1.TheADDinstructiononrung3doesnothaveanyoutputsymbolconnectedtoit.Thisisperfectlyvalidbecauseit’sanoutputinstruction.Afterbothcountersreachpresetvaluesof1,000,bothcountersgetreset(rung4).Thenextmathinstructionexampleisshowninfigure8.58.It’saVrmsconverterapplicationusingaMULinstruction.I:3/7takesanaveragepeakvoltageasaninput.ThePLCconvertsittousingaMULinstruction.I:3/7takesanaveragepeakvoltageasaninput.ThePLCconvertsittosegmentdisplayoutputdevice(O:0/1).
Figure8.58:MULinstructionexample
ADIVinstructionexampleisshowninfigure8.59.Itreceivesaninputsignalfromaweighttransducer(I:2/1)thatproducesaweightvalueinkilogram(kg).TheDIVinstructionconvertsittolbs.Ifthebuttonispressed,theweightinlbsisdisplayedonanLCDdisplay(O:1/1).
Figure8.59:DIVinstructionexampleInsomecases,youmaywanttoinvertavaluefrompositivetonegativeorviceversa.Anegate(NEG)instructioncanperformsuchafunction.Figure8.60showsitsoperations.
Figure8.60:Negateinstructionexample
Aftertheswitchispressed,thecontentsofN2:3areinvertedfrom1to0andtheresultgetsstoredinN2:4.Forexample,ifN2:3datais00000000,itwillbeinvertedto11111111.TheresultisstoredinN2:4.Figure8.61isanapplicationcombiningmathanddatacompareandmanipulationinstructions.Thisisacarwashapplication.Inthisdesign,therearetwocarwashtypesforcustomerstochoosefrom:standardandsupreme.Standardservicetakesfiveminutes.Supremeservicetakestenminutes.Thisapplicationautomatesthecarwashprocesscontrollingtheon-timeforthewater,foam-dispensingpumps,andthewind-dryingmotor,dependingonwhetherthestandardorsupremebuttonispressedbytheoperator.ThisPLCprogramkeepstrackofthetotalnumberofcarswashed.Inaddition,ifthetotalnumberofwashedcarsreaches490(500–10),themaintenancelightturnson.Thefielddevicenames,types,andaddressesareshownintable8-4below.Inthisexample,allthewater,foam-pumps,andblowersarepresumablyonatthesametimeforsimplicityreasons.Inreality,therewillbeseparatetimerstocontroltheon-timeforeachofthethreeoutputdevicesindividually.
Table8-4:Carwashdevicenames,types,andaddressestable
Figure8.61:CarwashPLCprogram
Onrung1,pressingthestartbuttonstartsthetimer.TheTTbranchformsaseal-intokeepthetimerrunning.Dependingonwhetherthestandardbutton(rung2)orsupremebutton(rung3)ispressed,either300sor600siscopiedtothetimer’spresetvalue.Duringthetimer’sontime,rung4turnsthewater,foam-pump,andbloweron.Rung5keepstrackofthetotalcarswashedusinganup-counter.Rungs6and7determineifthetotalcarnumberhasreached490byusingasubtractinstruction.Ifso,themaintenancelightturnson(rung7’sGEQinstruction).
SequencerInstructions
Plentyofindustrialandcommercialapplicationsexecuteinstructionscontinuouslyinaloop.Industrialwashingmachines,large-scalewarehouseconveyorsystems,merchandise-processingsystems,andtrafficlightsystemsarefewexamples.SequencerinstructionsreducethenumberofrungsneededandsimplifysequentialoperationsinPLC
applications.Asequenceroutputinstruction(SQO)symbolisshowninfigure8.62.
Figure8.62:SQOinstruction
TouseanSQOinstruction,PLCprogrammersneedtoassignvaluestotheitemswithintheSQOinstruction.Theseitemsarefilenumber,destinationaddress,length,andpositionfields.Filenumbercorrespondstothestartingaddressofthesequencerfile.ThisfilecontainswordsthatPLCsexecuteupon.Forexample,figure8.63showsanSQOfile(#B3:1)comprisingfivewords.The“#”signdesignatesit’safileinsteadofaword.Thefirstword(word0)willbetransferredtothedestinationaddress(e.g.,anoutputdevice)iftheSQOinputislogichigh(pushbuttonPBispushed).Thesecondword(word1)istransferredtotheoutputdeviceifPBispushedagain.The6thtimePBispushed,SQOloopsbacktoword0andthesequencerepeatsagain.Thenumberofwordsandcontentsofeachwordareuserdefined.Howoftenthedatatransferoccursdependsontheladderlogicprogram.Thelengthitemdefinesthetotalnumberofwords(steps)thatwillbetransferred.Ifthelengthistwoina5-wordfile,onlythefirsttwowordswillbetransferredeventhoughtherearefivewordsinthesequencerfile.Positiondeterminesthestartingwordlocation,whichtypicallystartsatpositionone.
Figure8.63:Sequencerfile
Let’sapplyanSQOinstructiontoasimplifiedtrafficlightapplication(seefigure8.64).Thisapplicationturnsonandoffred,yellow,andgreenlightsinasequenceusinganSQOinstructioncontrolledbypushbuttons1,2,and3(PB1,PB2,andPB3).
Figure8.64:SQOexample
Inthisexample,#B3:0isthefilenumbermadeupofthreewordsstartingwithaddressB3:0.ThesecondandthirdwordaddressesareB3:1andB3:2.PB1,2,and3arecontrolledbythreeseparatetimers(notincludedinthisexample).ThesethreepushbuttonsformaparallelbranchwhichcontrolstheSQO.ThetimerscontrolPB1,2,and3oneatatime.ThedestinationaddressO:2connectstothreetrafficlights.ThefirstthreebitsofO:2(O:2/0,O:2/1,andO:2/2)connecttored,yellow,andgreenlightsrespectively.IfPB1ispushed,SQOloadsdatafromB:3.0(001)tothedestinationaddressO:2.Thislightsuptheredlightandturnsofftheyellowandgreenlights.PB2thengoeshightriggeredbyanothertimer.B3:1(010)nowloadsitscontentintoO:2turningontheyellowlightandshuttingofftheredandgreenlights.Lastly,PB3ispushedloadingB3:2(100)intoO:2,turningonthegreenlightwhileturningofftheredandyellowlights.Thisprocessrepeatsitself.Theon-timedurationofthelightsiseasilycontrolledbythetimer’spresetvalues.ThisexampledemonstratesthatusingSQOinstructions,onlyonerungisneededtoperformrepetitiveoperationswithouttheuseofmultiplerungs.Thisreducesprogramcomplexityandeasestroubleshootingefforts.
Trends
PLCtechnologydevelopmentcontinuestoevolve.Sophisticatedlarge-scaleindustrialcontrolsystemssuchasSupervisoryControlandDataAcquisition(SCADA)havegainedpopularityinrecentyears.SCADAiscapableofcontrollinglargeandmultiplesitessuchassemiconductorfabs(factory)withwirelesscommunicationcapabilities.Inadditiontoprocessandmotioncontrols,SCADAsystemsofferreal-timeprocessinformation,databasecreation,dataanalyticstools,andmaintenanceinformationfortrendingandthroughputanalysis.IncreasingCPUpowerallowsparallelPLCprocessingwithoutsacrificingprocessspeedandaccuracy.Somemodern,complexPLCsystemsutilizehumanmachineinterface(HMI),whichisanapparatustoshowhumanoperatorsrealtimeprocessdataandpicturesoftheactualsystemcomponents(inputandoutputdevices)whilethesystemisrunning.Figure8.65showsanHMIexampleofafillingsystem.Thissystemtransportstanksonaconveyorbeltwhiletheyarefilledupbythematerialsstoredinthefunnels.Buttons1and2controltheopeningandclosingofthefunnels.Levelsensors1and2monitorthetanks’levels.Button3triggersthesirenifthetanklevelpassesthelevelsetbythesensor2.Thisgraphicalinterfaceisdisplayedonthemonitorinrealtime.ButtonscanbepushedwithaclickofamousewithaPLCcontrollingtheconveyorbelt,on/offswitchforthefunnel,levelsensorsonthetank,andsiren.
Figure8.65:SCADAexample
Summary
Inthischapter,wecoveredPLChistory,components,input,andoutputdevices.Ladderlogicsyntaxandprogrammingtechniqueswereintroduced.SeveralPLCinstructiontypeswerediscussedincludingtimers,counters,math,datamanipulation,comparisons,andsequencerinstructions.PLCmemorystructure,practicalPLCprogramexamples,and
industrytrendswerepresentedthroughoutthechapter.
Quiz
1)ListthreebenefitsofPLCsovertraditionalrelaysystemsandfivePLCcomponents.2)ListthreedifferencesbetweencomputersandPLCs.3)Listfiveinputandoutputdeviceexamples.
4)DesignaPLCladderlogicprogramforasemiconductorfabconveyorsystem(seefigure8.66).Asiliconwaferbox(lot)waitsfor30minutesatprocesspoint1.Thelevelsensordetectswhetherthewaferlothasbeenfilledupto12wafers.Onceit’sfilled,thelotwillbetransportedtotheprocesscheckpoint2whereitstopsandwaitsfor15minutesforfurtherprocessing.Attheendofend15minutes,thegreenlightturnson.
Figure8.66:Semiconductorfabconveyorsystem5)Figure8.67showsaperiodicclockgeneratorconsistingofthreeon-timers.Completethetimingdiagramontheright.
Figure8.67:Periodicclocksignalgenerator
Chapter9:MentalMath
Electronicsoftenusebasicarithmetictosolveengineeringproblems,identifysolutions,andperformtechnicalanalysis.Althoughmanycalculationsregardingelectronicengineeringdealwithlargenumbers,mostelectronicengineeringsolutionscanbeobtainedquickly,efficiently,andaccuratelybyusingmentalmath,pen,andpaperinsteadofusingcalculators.Despitetheadvancedfeaturesofferedbycalculators,mostelectronicscalculationusedindailyengineeringtasksinvolvesonlyshort,simple-formcalculations.Calculatorsshouldonlybedeemednecessarywhenworkingwithmulti-ordermathmodels.Themisconceptionofusingacalculatorisunderminedbythefactthatnumbersandmathsymbolscouldbeenteredincorrectly.Combinethatwithimproperuseofparenthesesresultinginwronganswers,delayingprogress,andslowingproductivity.Becomingproficientwithmathtechniquesdescribedinthischapterenhancesyourmathematic,analytic,andproblem-solvingskillswhileyoudemonstratecompetencyandincreaseproductivity.Inthischapter,basicarithmeticandnumberingsystemsusedinelectronicscalculationsarefirstreviewed.Then,youwilllearnsimpletechniquestoimproveyourmentalmathabilitytocalculateelectronicsarithmetic.Topicsincludelargeandsmall-numbermultiples,submultiples,percentage-decimalconversion,divided-by-fractions,one-overreciprocals,multiply-dividepower(exponent)rules,anddB-to-logconversion.Examplesareprovidedthroughoutthechapterdirectlyrelatedtoelectronicengineeringcalculations.
MultiplesandSubmultiplesofUnits
Table9-1includesthenamesofthemultiplesandsubmultiples,theirsymbols,andthefactorsfrequentlyusedincalculatingforelectronics.Theincentiveofusingmultiplesistheabilitytonumbersexample,expressextremelylarge
insimplifiedforms.Forthestate-of-artCMOStransistor’sleakagecurrentismeasuredaslowasfemto(1X10-15)amperes.It’smucheasiertointerpret
1fA(1X10-15A)than0.000000000000001A.Hereisasecondexample:anACsource’sfrequencyis2,000,000Hz.It’ssimplertowriteitas2MHzbecause2,000,000Hz=2X(1X106)Hz=2MHz.
Table9-1:Multiplesandsubmultiplesofunits
DecimalNumbers
Decimalnumbersareanynumberswrittenwithadecimalpoint“.”,suchas2.3,5.78,or0.005.Thedecimalpointseparatestheonesplace(left)fromthetenthsplace(right)indecimalnumbers(seefigure9.1).IfaDMM’sresolutionis0.0001V,itcandisplaydowntoonetenthousandthofavoltontheDMM’sdisplay.
Figure9.1:Decimalplaces
WholeNumbers
Wholenumbersarenon-negativeintegersthataremadeupofdigitstotheleftofthedecimalpoint.Forexample,thewholenumberof1,288.00is1,288.Toidentifytens(10s),hundreds(100s),andthousands(1,000s)easily,acommaisusedateverythirdplace,startingatthedecimalpointandmovingtowardstheleft.Forexample,aresistorsizeof17,452,223Ωismoreeasilyrecognizedthan17452223Ω.
MultiplesNumberConversion
Convertingalowmultipletoahighfactoronemakesiteasiertoreadandunderstand.Forexample,asmartphoneCPU’sclockspeedis2,000,000,000Hz.Usingmultiples,itcanbewrittenas2,000MHz.However,itwouldbeevensimplertoconverttofewerdigitswithalargerfactormultiple(giga).Theconversionprocessisshowninfigure9.2.First,placethedecimalpointtotherightof2,000.Thedifferenceinthepowernumber(exponent)between“M”and“G”is3(9–6=3).Thenextstep(step2)istomovethedecimalpoint3times(theresultofthepowernumberdifference)totheleft.Thelaststepistorewritethenumberas2.0from2,000andreplace“M”with“G.”
Figure9.2:Smalltolargemultipleconversion
Figure9.3:Largetosmallmultipleconversion
Toconvertahighermultiplefactortoasmallerone,theprocessisreversed.Forexample,1MHzcanberewrittenas1,000kHz.Theconversionstepsareshowninfigure9.3.M(mega)is1X106.Toconvertittoalowerfactor(powerof3),wefirstfindthedifferenceinpowernumbers(6–3=3).Thenextstep(step2)istomovethedecimalpointtotheright(insteadofleft)accordingtotheresultofthepowernumbersubtraction.Lastly,rewritethenumberas1,000andreplace“M”with
“k.”Fromthesetwoexamples,youcanseethatconvertingalowmultipletohigheronerequiresmovingthedecimalpointtotheleft;convertingalargermultipletosmalleronerequiresmovingthedecimalpointtotheright.Thenumberoftimestomovethedecimaldependsontheresultofthesubtractionbetweenthepowernumbers.
SubmultiplesNumberConversion
Similartechniquescanbeappliedtoconvertsubmultiples.Forexample,2,500nAiseasilyconvertedto2.5uA.Theconversionprocessisshowninfigure9.4.First,placeadecimalpointtotherightof2,500.Thenmovethedecimalpoint3placestotheleft.Itmoves3timesbecausethedifferencebetweenthepowernumbersis3(9–6).Thelaststepistorewriteas2.5,andreplace“n”with“u.”
Figure9.4:Smalltolargesubmultiplesconversion
Toconvertlargesubmultiplestosmallerones,theprocessisreversed.Forexample,30.2msisrewrittenas30,200us.Theprocessstepsareshowninfigure9.5.Firstidentifythedecimalpoint.Second,movethedecimalpoint3(6–3)placestotheright(insteadofleft).Fillintheemptyspaceswithzeros.Finally,rewriteas32,000andreplace“m”with“u.”
Figure9.5:LargetosmallsubmultiplesconversionTable9-2summarizesmultiplestosubmultiplesconversionmethods.
Table9-2:Multiplesandsubmultiplesconversions(N=Subtractionresultbetween2powerorders)
One-OverReciprocalwithMultiplesandSubmultiples
Onceyougetfamiliarwithmultiplesandsubmultiplesnumberconversions,wecanapplythemtopracticalelectronicengineeringcalculations.Fractionsareusedoftenincalculatingelectronicarithmetic.Conversionofafractiontoanon-fractionproducesquickandaccurateresults.Forexample(seefigure9.6),anLEDflashlightrequirestwoAAbatteriesconnectedinseries(1.5VX(2)=3V).WhenanLEDturnson,itsforwardvoltagedropis2V.Tolimitcurrentdrawnat10mAforacertainbrightnesslevel,acurrent-limitingresistorisplacedinserieswiththeLED.Theresistorsizeiscalculatedandshowninfigure9.6.
Figure9.6:LEDflashlightcurrentlimitingresistorsize
Figure9.7:Fractiontonon-fraction,submultiples
Toconverttheresistancefromfractiontononfraction,thestepsareshowninfigure9.7.Inthisfraction,wefirstconvertmillito10-3.Thedenominatorcontainsasubmultiplenumber10mA(10X1X10-3A).Sinceallnumbersinthedenominatorareseparatedbymultiplicationsigns,itcanbebrokendownintotwofractions:1/10and1/(1X10-3).1/10=0.1.For1/(1X10-3),convertnegative3powertopositive3powerthenremovethefraction.Thefinalresultis0.1X1X103,whichisequalto0.1kΩ.Usingthelargemultipleconversionrule,previouslydiscussed,movethedecimalpoint3timestotherightturns0.1kΩto100Ω.Toconvertafractionwithmultiplesinthedenominatortoanon-fraction,theconversionprocessisreversed.Forexample,figure9.8calculatesperiodfroma2GHzclock.Separate1/2fromG(1X109).1/2=0.5.Thepower(exponent)ofpositive9inthedenominatornowbecomesnegative9.Wethenremovethefraction.Theresultis0.5X10-9=0.5ns.Ifyouwanttowrite0.5nstolowersubmultiples(e.g.,pico),usetheruledescribedearlier.Movethedecimalpoint3placestotheright.
0.5ns=500ps
Figure9.8:Fractiontonon-fraction,multiplesThistechniqueenablesyoutoconvertfractionstonon-fractionseasily,quickly,andaccurately.Table9-3summarizesthefractiontonon-fractionconversions.
Table9-3:Fractiontonon-fractionconversions
MultiplicationandDivisionwithMultiplesandSubmultiples
Multiplicationisusedallthetimeinelectronicengineeringcalculations.Multiplicationwithmultiplesandsubmultiplesworksoppositetomultiplicationoffractions.Insteadofsubtractingpowernumbers,multiplicationinvolvesaddingpowernumbers(exponents).Forexample,iffrequency=10MHz,andInductance=25uH,calculateinductivereactance,XL=2πfL.Figure9.9showsthesteps.2πissimply6.28.Themultiplicationofthe“k”multipleand“u”submultipleinvolvesaddingexponentstoeachother(3+(–6)=–3).Theresultingexponentis–3.Therestofthecalculationsaresimplemultiplication(6.28X250X1m=1,570m=1.57k).Divisionwithmultiplesandsubmultiplesinelectronicengineeringmathinvolvessubtractingexponents.Forexample,whenapushbuttonispressed,thereisthepresenceofon-resistance.Thevoltageacrossapushbuttonwhenit’spressedismeasuredat2mVwith100uAflowingthroughit.Figure9.10showsthestepstocalculatetheon-resistanceofthepushbutton.2/100=0.05.Negative3(milli)powerlessnegative6(micro)powerispositive3,whichbecomesthefinalexponent.
Figure9.9:Multiplyingmultiples
Figure9.10:Dividingsubmultiples
PercentagetoDecimals
Inelectronics,weoftenusepercentagestocalculatepowerefficiency,dutycycle,devicetolerance,accuracy,error,resolution,gainchange,voltagevariation,currentchange,andpowerdifference.Convertingpercentagestodecimalsquicklyhelpsyouanalyzeproblemseffectively.Anumberwithapercentagesignmeanstheoriginalnumbergetsmultipliedby100.Toconvertapercentagetoadecimalnumber,firstidentifythedecimalpoint.Thendividethenumberby100(movedecimalpointtwoplacestotheleft).Forexample(seefigure9.10),thedutycycleofanACsignalis75%.Toconvertittoadecimalnumber,firstidentifythedecimalpointlocation(totherightof5).Then,moveit2placestotheleftandremovepercentagesign.Toconvertthenumberbacktoapercentage,reversetheprocessbymovingthedecimalpointtwoplacestotherightandaddpercentagesign.Theexampleinfigure9.11convertsthenumber2toapercentage.Aftermoving2decimalplacestotheright,filltheemptyspaces(dotted)withzeros,andaddapercentagesigntocompletetheconversion.
Figure9.10:Percentagetodecimalnumber
Figure9.11:NumbertopercentageForexample,acarbonresistorhasa+/–10%resistancetolerance.Ifthenominalresistanceis33.33kΩ,whatistherangeofresistancevalues?10%isquicklyconvertedto0.01:33.33kΩX10%=33.33kΩX0.01=0.33kΩ=33Ω(33.33kΩ–33.33)<R<(33.33kΩ+33.33)
LogtoRealNumber
Weuselogarithms(log)involtage,current,andpowerdBcalculations.Thelogofanumberisequaltotheexponent(power)ofthebasenumber.Forexample,log10100=2because10tothepowerof2is100(seefigure9.12).Thebasenumbercanalsobeothernumbersexceptfor10.Log216=4because2tothepowerof4is16.Ifthebasenumberisnotshown,thenbydefault,thebasenumberis10.
Figure9.12:Logwithabaseof10
Extendingfromthisconcept,alogtableisshownintable9-4.Log0isinvalidbecause10tothepowerofanyvaluewillbelargerthanzero.Fromthistable,youcaneasilyestimatetherangeoflognumbers.Forexample,ifyoutrytoestimatevalueoflog20,youcaneasilytellit’sbetween1and2.
Table9-4:LogtableIfyourecalldBcalculationsusinglog,afractionisoftenusedwithinlog.Forexample,anamplifierwithgainof100dB,Vout/Vincanbequicklyevaluated:
Withpowerefficiencycalculations,outputpowerisalwayslessthaninputpower(Pout<Pin)duetoelectricalsignallosses.UsinganLEDasanexample,itspowerefficiency(lessthan15%)ismuchhigherthanthatofanincandescentlamp(lessthan2%).AtypicalLEDburnsroughly6Wto8Wofpower.Incandescentlamps’powerratingsdiffergreatlydependingonthetype.Themostcommononesconsume60Wofpower.WecanusedBtoexpresstheinputandoutputpowerasaratioinsteadofasabsolutevalue.Forexample,theoutputpowermeasuredis10timeslessthantheinput,i.e.,Pout/Pin=1/10=0.1.PowerindBiscalculatedas:
dB=10log(0.1)=–10dB
Fromthisexample,youcanseethatwhenthelognumberislessthan1,itequatestoa
negativenumber.Asimilarlogtableliketable9-4isdevelopedforthelognumbersthatarelessthan1(seetable9-5).
Table9-5:Lognumberlessthanone
Summary
Inthischapter,wefirstcoveredmultiples,submultiples,decimalnumbers,andpercentages.Wethenusedpracticalexamplesusingcommonelectronicengineeringtaskstoconvertbetweenhigherandlowermultiplestoandfromsubmultiples.Wethenappliedthesemultiplesandsubmultiplesconversiontechniquestomultiplicationanddivisionthatarefrequentlyusedinelectronicengineeringcalculations.Thischapterclosedwithusinglogarithmicnumberstocalculatevoltage,current,andpowerratios.Followingthesesimplerulesallowsyoutocomeupwithelectronicengineeringmathsolutionsquicklyandaccuratelyaswellasdemonstrateprofessionalcompetencies.
Quiz
1)Whatisthesubmultiplenameof1X1012?2)ADMMcandisplaydigitsdowntoonethousandthofavolt.WhatisthesmallestchangeindecimalvaluethisDMMcandisplay?3)Convert2.5uAtonA.4)Convert120nstofrequency.5)Usingmentalmath,calculateXL=2πX2MHzX2uH.
6)Acommonemitteramplifierdeliverstoaresistiveloaddraws2mAat12Vtogroundrails.Thepowermeasuredattheload(Pout)is10mW.WhatisthepowerefficiencyindB?
7)Convert0.707toapercentage.8)Anemitterfollower’svoltagechangesby0.5Vwhileinputchangesby1V.WhatisthevoltagelossindB?
9)1angstromisequalto10-10meters,whichisoftenusedtodescribethethicknessofCMOStransistorgateoxide.IftheFET’sgateoxideis50angstrom,whatisthevaluein
nanometers(nm)?
10)Ifanamplifier’sopen-loopgainis80dB,whatisthegainratioofV/mV?
AbbreviationsandAcronyms
˂(lessthan)%(percentage)(a)(b)(multiplyaandb)/(divide)||(parallel)>(greaterthan)∆(delta)≈(approximatelyequalto)≤(lessthanorequalto)≥(greaterthanorequal)°C(degreesCelsius)∞(infinity)AorAmp(ampere)A/C(air-conditioning)
AC(alternatingcurrent)Acm(commonmodegain)ADC(analog-to-digitalconverter)ADD(addinstruction)Adm(differentialgain)AM(amplitudemodulation)AMD(AdvancedMicroDevice)ARM(AdvancedRISCMachines)ASIC(ApplicationSpecificIntegratedCircuit)BiCMOS(BipolarandCMOS)BNC(BayonetNeill-Concelman)BOR(Brown-OutReset)Bps(bitpersecond)Br(boron)C(capacitanceorcoulomb)C_eq(equivalentcapacitance)CA(commonanode)CAD(computer-aideddesign)CAN(ControlAreaNetwork)CC(commoncathode)CDMA(CodeDivisionMultipleAccess)CDS(drain-to-sourcecapacitance)CDSub(drain-to-substratecapacitance)CGD(gate-to-draincapacitance)CGS(gate-to-sourcecapacitance)CLoad,Cload(capacitiveload)
CMOS(complementarymetaloxidesemiconductor)CMRR(commonmoderejectionratio)
COM(commonpotential)Cox(gate-oxidecapacitanceperunitarea)CPU(CentralProcessingUnit)CSSub(source-to-substratecapacitance)Cu(Copper)
D(digitalinputcode)DAC(digital-to-analogconverter)dB(decibel)DC(directcurrent)Diffamp(differentialamplifier)DIV(divideinstruction)DMM(digitalmulti-meter)DN(donebit)DRC(designrulecheck)DSP(digitalsignalprocessing)e(exponential)E(voltagepotential)e-,E(electron)EC(quartzcrystalresonators)ECL(emitter-coupledlogic)ELI(voltage-inductor-current)Emax(maximumpeak-to-peaklevel)Emin(minimumpeak-to-peaklevel)EN(enablebit)EQ(equalto)EQU(equalto)ESL(equivalentseriesinductance)ESR(equivalentseriesresistance)F,f(frequencyorfarad)Fab(fabrication)
FCC(FederalCommunicationsCommission)FCY(instructionfrequency)
FM(frequencymodulation)FOSC(oscillatorfrequency)FPGA(FieldProgrammableGateArray)fresonant(resonantfrequency)Gbps(gigabitpersecond)GEQ(greaterthanorequalto)GHz(gigahertz)gm,GM(transconductance)GPIO(generalpurposeInputOutput)GPR(generalpurposeregister)GRT(greaterthan)GSM(GlobalSystemforMobile)H(Henry)hfe(voltagegain)HMI(humanmachineinterface)Hz(hertz)I/O(inputoutput)I_A(currentA)I_B(currentB)I_C(currentC)I_total(totalcurrent)
I2C(Inter-IntegratedCircuit)Ib,IB(basecurrent)IBM(InternationalBusinessMachine)IC(collectorcurrent)ICD3(In-CircuitDebugger3)ICE(current-capacitor-voltage)ICs(integratedcircuits)
ID(draincurrent)ID(identification)IDE(integrateddevelopmentenvironment)IE(emittercurrent)IEEE(InstituteofElectricalandElectronicsEngineers)Iin(inputcurrent)Iload(loadcurrent)Iout(outputcurrent)IRdrop(voltagedropacrossresistor)IS(saturationcurrent)IS(sourcecurrent)Isense(sensecurrent)ISR(interruptserviceroutine)
I-Vcurve(currentvs.voltagecurve)JMP(jumpinstruction)JSR(jumptosubroutineinstruction)K(degreeKelvin)
KB(kilobyte)KCL(Kirchhoff’scurrentlaw)kg(kilogram)KVL(Kirchhoff’svoltagelaw)L(inductorortransistorlength)L_eq(equivalentinductance)LBL(labelinstruction)lbs(pounds)LCD(liquidcrystaldisplay)LDO(lowdrop-outregulator)LED(lightemittingdiode)LEQ(lessthanorequalto)LES(lessthan)LTE(LongTermEvolution)ln(naturallogarithm)LO(localoscillators)
LP,XT,HS(lowerspeed,external,highspeed)LSB(leastsignificantbit)
mA(milliampere)mAh(milliampere-hour)MCU(microcontrollerunit)MIPS(millioninstructionspersecond)mm(millimeter)
MOSFET(metaloxidesemiconductorfieldeffecttransistor)
MOV(moveinstruction)
MSB(mostsignificantbit)MSPS(mega-samplepersecond)MUL(multiplyinstruction)MUX(multiplexer)MUL(multiplyinstruction)n(bitnumber)N(negativetype)NC(normally-closed)NEQ(notequalto)NFET(N-typedfieldeffecttransistor)NMOS(N-typedmetaloxidesemiconductor)NO(normally-open)Op-amp(operationalamplifier)Op-code(operationcode)OST(OscillatorStart-upTimer)P(powerorPhosphorusorpositivetype)PAC(ProgrammableAutomationController)Parasiticcap(parasiticcapacitance)PB(pushbutton)PCB(printedcircuitboard)
PFD(phasefrequencydetector)PFET(P-typefieldeffecttransistor)PIC(peripheralinterfacecontroller)PLC(programmablelogiccontroller)PLL(phaselockloop)PMOS(P-typemetaloxidesemiconductor)POR(Power-On-Reset)POT(potentiometer)ppm(part-per-million)PSRR(powersupplyrejectionratio)PWM(pulsewidthmodulation)Qfactor(qualityfactor)Q#(transistornumber)q,Q(electroncharge)Q_bar(Qbar)
R(resistance)Rleakage(leakageresistance)rπ(intrinsicbaseresistance)
R_eq,R_equivalent(equivalentresistance)R_total(totalresistance)
RAM(readaccessmemory)RCmode(Resistor-Capacitormode)RD(drainresistor)Rdson(drain-to-sourceon-resistance)RET(return)Rf(feedbackresistor)RF(radiofrequency)RFID(radiofrequencyID)Rgate(gateresistance)Ri(inputterminalresistor)
RISC(ReducedInstructionSetComputing)RJ-45(registeredjack45)Rms(rootmeansquare)TT(timingbit)ROM(readonlymemory)Rout(outputimpedance)Rs(sourceresistor)RS-232(recommendedstandard232)Rvin(inputimpedance)Rz(zenerimpedance)SAR(successiveapproximation)SBR(subroutine)
SCADA(SupervisoryControlAndDataAcquisition)SFR(special-functionregisters)
Si(silicon)SiGe(silicongermanium)Sine(sinusoidal)
SOC(system-on-chip)Spec(specification)SPI(synchronousperipheralinterface)SQO(sequenceroutputinstruction)S-R(set,reset)SUB(subtractinstruction)SW(switch)T0CK1(externalclocksource)T0XCS(clockselectbit)TC(temperaturecoefficient)TCY(instructionperiod)TND(temporaryend)Toff,toff(offtime)RLoadorRL(resistiveload)TTL(transistor-transistorlogic)U(effectivemobility)um(micrometer)
UMC(UnitedMicroelectronicsCorporations)USART(UniversalSynchronousAsynchronousReceiveTransceiver)USB(universalserialbus)
V–(negativeterminal)V(voltage)V_cap(capacitorvoltage)
V+(positiveterminalorpositivevoltagesupply)V++(positivevoltagesupply)
VB(basevoltage)VBE(basetoemittervoltage)VC(collectorvoltage)VCC(positivepowersupply)
VCE(collectortoemittervoltage)
VCEsat(collectortoemittersaturationvoltage)VCO(voltagecontrolledoscillator)
VD(drainvoltage)VDD(positivevoltagesupply)Vdiff(voltagedifference)Vdiode(diodevoltage)VDS(drain-to-sourcevoltage)VE(emittervoltage)VFB(feedbackvoltage)VG(gatevoltage)VGS(gate-to-sourcevoltage)Ton,ton(ontime)TSMC(TaiwanSemiconductorMftg.Corp.)VHDL(veryhighleveldescriptivelanguage)Vin,VIN(inputvoltage)Vin_diff(inputvoltagedifference)
Vout,VOUT(outputvoltage)
Vout_diff(outputvoltagedifference)Vpeak(peakvoltage)Vpeak-to-peak(peak-to-peakvoltage)Vref(referencevoltage)Vrms(rootmeansquarevoltage)
VS(sourcevoltage)Vsense(sensevoltage)VT(thresholdvoltageorthermalvoltage)W(wattortransistorwidth)WDT(watchdogtimer)WiFi(wirelessfidelity)X(multiply)
Xc(capacitivereactance)XL(inductivereactance)XLP(extraLowPower)α(alpha)β(beta)λ(wavelength)π(pior3.14)Σ-∆(sigma-delta)Ω(ohm,unitofresistance)Ѡ(omega)
Index
–20dBperDecade,65–3dB,68,83∆∆Q=C(∆V),7111/SC,571/ѠC,57120V,941N4001,48
22π,7033-dimentionalcrosssectionmodel,1315555-timer,226HansCamenzind,226one-shottimer,228precisiontiming,226PulseWidthModulation(PWM),226
660Hz,5377-segmentdisplay,256AAA,7AAA,7ACanalysis,63atoms
ACchoke,74ACparameters,49ACshort,56Acm(commonmodegain),150activeloads,151activelow-passfilter,174ADC
gainerror,222offseterror,222Adm(differentialmodegain),150aerospace,106Agilent,27alkalinehouseholdbattery,7Alpha,112alternatingcurrent,49aluminum,1AMdemodulationcircuit,240AMdetector,240AMtransmitter,240amplifier,106,140Amplitudemodulation(AM),238AnalogDevices,3,24,219analogelectronics,105
analogICvendorsAnalogDevices,106InfineonTechnologies,106Qualcomm,106STMicroelectronics,106TexasInstruments,106analogmarket,106analogsignals,105Analog-to-DigitalConverter,25,106ADC,219ANDgate,205angstrom,131angularvelocity,70anode,41arc,70assembler,262AsynchronousReceiverTransceiver(USART),247atoms,37
electrons,37neutrons,37audioamplifier,157
Bband-passfilter,233band-stopfilter,233bandwidth,103base,108Baud,236Bayonet-NeillConcelman(BNC),178Besselchart,239Beta,112bill-of-materials,68BipolarversusCMOS,147bitrate,236bit-orientedoperations,255bodeplot,,63bodydiode,133Boltzmann’sconstant,113BOMs,68Booleanalgebra,207boron,37bounce,86break-before-make,199breakpoint,264Brown-Out-Reset(BOR),261buckregulator,97,156buffer,119,171built-indiodevoltage,40byte-orientedinstructions,255
CC=Fλ,237Capacitiveload(CLoad),182capacitor,136capacitor
capacitance,55capacitivereactance,55dielectric,55electricfield,55comparators,106compiler,262computer-aideddesign(CAD),135copper,1
core,93coulomb,8CPU,110Cu,1current,1,8,329currentdividerrule,15currentlead,89currentmirror,152,165currentsource,8
electrolytic,55passiveelectronicdevice,55polyester,55tantalum,55Xc,55
carbonresistors,2carrierconcentration,38cascode,167cathode,41,108cellphonebatterychargers,93cellularbands
CodeDivisionMultipleAccess(CDMA),241GlobalSystemforMobile(GSM),241LongTermEvolution(LTE),241
ceramicresonators,257chargepump,103charging,60circuitsimulationsoftware
Multisim,176classAamplifier,129classAB,129classBamplifier,129closed-loop,153closed-loopvoltagegain,161CMOS,130CMOScacosde,170collector,108collectorcurrentequation,152colorbands,3combinationallogic,206commonbaseamplifier,120,128commoncollectoramplifier,118commonemitteramplifier,115,123commongateamplifier,139,145commonmoderejectionratio(CMRR),150commonmodevoltage,149commonsourceamplifier,139communications,231
fullduplex,231halfduplex,231RadioFrequency(RF),231simplex,231
commutatingdiode,88
DDarlingtonpair,168datacompareinstructions,308datamanipulationinstructions,304datamemory,251dB,64DC,5DCblock,56
deadzone,199debugger,263
ICD3,264PICKIT3,263decade,65decibel,63decimalnumbers,320designexamplecomparator,265timer,269DesignRuleChecking(DRC),135designsystems,135desktopcomputer,110D-flip-flop,211die,130diffamp,148differentialamplifiers,153diffusion,110digitalcircuitsflip-flop,208latch,208digitalelectronics,195digitalvoltagelevelsCMOS,219Emitter-Coupled-Logic(ECL),219Transistor-Transistor-Logic(TTL),219Digital-to-AnalogConverterDAC,224System-On-Chip(SOC),224digital-to-analogconverters,106diodecircuits,43diodeclamp,88diodeparametersdiodeoutputcurrent,42maximumforwardvoltage,42maximumpowerdissipation,42maximumreversecurrent,42reversevoltage,42diodes,37,108directcurrent,1,5discharging,60distributorsArrowelectronics,24Digikey,24Futureelectronics,24Mouserelectronics,24DMM,27,28,33,48,320,328,329dominantpole,183dopinglevels,38draincurrent,132drainresistor(RD),140dutycycle,52,99dynamicgatecurrent,138electronicload,7electrons,8,9ELI,77,90emitter,108emitterfollower,118,127Energizer,7engineering,3,323,325,328equivalentseriesinductance,83ESL,83ESR,83Ethernet,106
EEarlyeffect,115electricpowergeneration,93electrical
current,51electricalengineering,3,4electricalisolation,93electricaloutlet,51electromagnetictheory,93electroncharge,42
Ff–3dB.,68fab,130fabrication,130FCY,257FederalCommunicationsCommission
Frequencyspectrum,231feedback,99fileregisters,251finFET,131flip-flop,210
edge-triggeredflipflop,210Fluke,27FM,85FMnoiseclipper,85Forward-biased,40FOSC,257Fraction-to-nonfractionconversions,324Freescale,24frequency,50frequencydivider,211frequencydomain,63,64frequencydomains,232FrequencyModulation,85FrequencyModulation(FM),241Fritzing,55full-waverectifier,102functiongenerator,27,179
GGeneralMotor,273GeneralPurposeRegisters(GPRs),253germanium,8,37,110Gm,121ground,8Gummel-Poonmodel,125
Hhalf-waverectifier,95Harvardarchitecture,251height,105high-andlow-levellanguages,263high-passfilter,80,101hole,37humidity,105hybridπmodel,122hysteresis,179
hysteresiszone,179
II(∆t)=C(∆V),57
IBM,3,110ICdesignandsimulationsoftware
CadenceDesignSystems,178MentorGraphics,178Synopsis,178
ICfoundriesGlobalFoundries,130SamsungSemiconductor,130TaiwanSemiconductorManufacturingCompany
(TSMC),130
UnitedMicroelectronicsCorporations(UMC),130IClayout,134ICpackagemanufacturers
AdvancedSemiconductorEngineering,25Amkor,25SiliconwarePrecisionIndustries,25
ICpackagetypesdualinlinepackage,25flip-chip,25wire-bond,25
ICPackagetypesball-grid-array,25ICPackages,24ICversusVCECurve,114ICE,71,90idealdiode,42Idealvoltagesource,22IE=IC+IB,113impedance,54induce,93inductiveload,87inductorcopper,73ferrite,73Henry,73inductance,73inductivereactance(XL),73iron,73magneticfield,73passdevice,73XL=2πfL,73inductorschematicsymbol,73InstituteofElectricalandElectronicsEngineers(IEEE),231instructionclock,257instrumentationamplifier(INA),184IntegratedDevelopmentEnvironment(IDE),262Intel,134intensity,105Inter-IntegratedCircuit(I2C),247internaloscillator,258internalregulators,261InternationalRectifier,24interrupt,260InterruptServiceRoutine(ISR),260Intersil,24intrinsicresistance,125inverter,196NOTgate,196
invertingamplifier,158ionimplantation,38,110iPod,93
JJamesEarly,115JKflip-flop,211JumptoLabelinstructions,300JumptoSubroutineInstructions,301
KKCL,11Kelvin(K),113Kirchhoff’sCurrentLaw,11Kirchhoff’sVoltageLaw,9KVL,9negativefeedback,186
Lladderlogic,273laptop,93latch,208
memory,208memoryseats,208sequentiallogic,208
LayoutversusSchematic(LVS),135LDO,97leakagecurrent,42leakagecurrents,138leakageresistor,83LeastSignificantBit
LSB,204LED,44levelshifter,217light,105lightemittingdiode,44linearregulator
lowdropoutregulator,186zenerregulator,97,185LinearTechnology,24literalcontrol,257loadline,114logtonumber,326logarithm,63lots,135lowdrop-outregulatorerrorvoltage,186
low-passfilter,68
MmAh,7mathematics,3,4,49,61MaximIntegratedCircuits,24MCUinstructions,255MCUparameters,248MCUperipherals
ADCs,247comparators,247DACs,247
timers,247MCUvendorsAtmel,247FreescaleSemiconductor,247Fujitsu,247InfineonTechnologies,247MicrochipTechnology,247NXP,247RenesasElectronics,247Samsung,247STMicroelectronics,247TexasInstruments,247medicalequipment,106mentalmath,319MentorGraphics,135MetalOxideSemiconductorFieldEffectTransistor,107MicrochipTechnology,3,24,25,217,219,248,249,250microcontrollerUnitsembeddedsystems,247MicrocontrollerUnits(MCUs),247microelectronics,3microscope,134milliamphour,7Millionsofinstructionspersecond(MIPS),258mixed-signalADCs,216DACs,216modulation,236modulationindex,239monostable,228MOSFETcrosssection,136MOSFETparasiticdrain-to-source(CDS),142drain-to-substrate(CDSub),142gate-to-draincapacitor(CGD),142gate-to-sourcecapacitor(CGS),142source-to-substrate(CSSub),142MOSFETs,130MostSignificantBit(MSB),204motorcontrolapplications,106MOVinstruction,306MOVinstructionapplication,307MPLABX,262multimeter,27multiples,319multiplesandsubmultiplesconversionssummary,322multiplesnumberconversion,320multiplexer,215multiplicationanddivisionwithmultiplesandsubmultiples,325multistageamplifiers,155NORgate,204normally-closed(NC),278normally-open(NO),278NPN,108NPNschematicsymbol,109Nyquistfrequency,221gigahertz,178outputcode,230outputimpedance,124outputsymbol,280oxide,131
NNANDgate,205National
Semiconductor,3,176NationalInstruments,176naturallog,113negativetemperaturecoefficient,46nestedsubroutines,303neutrons,8NFET,130NFETandPFETInverter,197N-junctions,131NMOS,130NMOSInverter,197non-idealcapacitor,83non-idealdiode,42non-idealvoltagesource,22non-invertingamplifier,160
Ooff-time,52Ohm’sLaw,6omega,57OnSemiconductor,24One-OverReciprocal,323on-time,52op-amp,99op-amp
LM741,164op-ampparameterssupplyandinputvoltage,162supplycurrent,162CommonModeRejectionRatio(CMRR),162inputimpedance,162inputoffsetcurrent,162inputoffsetvoltage,162open-loopgain,bandwidth,162outputsourceandsinkcurrent,162outputvoltageswing,162powerconsumption,162PowerSupplyRejectionRatio(PSRR),162op-amprulesinputimpedance,155inputoffsetvoltage,155outputimpedance,155open-collector,193open-drain,193operand,255operationcode(opcode),255ORlogicgate,202OscillatorStartupTimer(OST),261oscilloscope,27,177oscilloscopesattenuationratio,178gigabitspersecond,178PLCoff-timer,295PLCoff-timerapplication,296PLCon-timer,293PLCon-timerapplication,294PLCperiodicclocksignalgenerator,318PLCprogramcontrolinstructions,300PLCprogrammingladderlogic,278
PLCprogrammingexample,283PLCprogrammingsyntax,286PLCsequencerinstructions,315PLCsuppliersAllenBradley,273Bosch,273GeneralElectric,273MitsubishiElectric,273Panasonic,273Siemens,273PLCtimer,292PLCtrends,317PLLfrequencymultiplier,244AnalogDevices,244LownoisedigitalPhasefrequencyDetector(PFD),244PLLimplementationcrystaloscillator,243PMOS,130P-Njunctioncarrierconcentration,39concentrationimbalance,39depletion,39diffusion,39equilibrium,39P-Njunctions,37PNP,108PNPschematicsymbols,109polysilicon,131positivefeedbackbodeplot,182positivefeedbackoscillations,182power,7powerefficiency,129powermanagement,76,106powerratio,64Power-On-Reset(POR),261pressure,105printedcircuitboard,24programmemory(flash),251ProgrammableLogicControllers(PLCs),273programminglanguagesassembly,247C,247C++,247protons,8Psubstrate,131pull-upresistor,193PulseWidthModulation(PWM)channel,247pushbutton,279PythagoreanTheorem,104
Pparallelcapacitorrule,63parallelcircuit,11paralleldatatransmission,214parallelinductorrule,78parallelLC,92parallelresistorrule,12parasitic,83,84passiveelectronicdevice,1
passiveloadresistors,151peakvoltage,52Peak-to-PeakVoltage,52percentagetorealnumber,326percentage-decimalconversion,319period,50periodicwaveform,49PFET,130PhaseLockLoop(PLL),242
feedbackloop,242low-passfilter,242phasedetector,242VoltageControlledOscillator(VCO),242
phaseshift,69,71,119,120,129,145phosphorus,38PLCbenefits,275PLCcomponents,276
CPU,276I/Omodules,276inputmodules,276memory(program,data),276powersupply,276programmingdevice,276
PLCconveyorsystem,290PLCcounter,297PLCcounterapplication,298PLCdatastructure,305PLCmathinstructions,311
QQfactor,77ringing,86ripplevoltage,95RLoad,129roomtemperature,123rotationdegree,70
RRCcircuit,104rπ,123radian,70radio,85radiofrequency,106RandomAccessMemory(RAM),247RClow-passfilter,69RCtimeconstant,62,96reactance,54ReadOnlyMemory(ROM),247referencecurrent,152relay,274renewableenergy,106resistance,1resistivity,1resistor,1resonantfrequency,90,91reverse-biased,40RFID(radiofrequencyID),261ringoscillator,200
Ssaturation,115saturationcurrent,113sawtoothwave,49
schematics,8Schottkydiode,192scopeprobe,178seal-incircuit,288semiconductor,4,5,38,106,218,317,318semiconductorfabconveyorsystem,318semiconductorpackage,24SerialPeripheralInterface(SPI),247seriescapacitorrule,63seriescircuit,9seriesinductorrule,79seriesresistorrule,13settlingtime,157sheetrho,4shiftregister,213shoot-throughcurrent,199SiGe,110silicon,37silicondioxide(SiO2),131silicongermanium,110sinewave,49single-endedamplifier,115,129sinusoidal,49sleepmode,261slewrate,157small-signalanalysis,124small-signalmodel,121,128,140smartphonecarchargers,93SOC,106solid-state,38sound,105sourcefollower,139,143Special-FunctionRegisters(SFRs),253spectrumanalyzer,234speed,105squarewave,49stepresponse,86submultiples,319submultiplesnumberconversion,321summingamplifier,172superposition,35Superpositiontheorems,19surface-mount
resistors,4,46switchingregulators,97Synopsis,135system-on-a-chip,106PFET,107PNP,107
Ttankcircuit,91,103tapeout,135TCY,257Tektronix,27telecommunicationapplications,106temperature,112temperaturecoefficient,4,23temporaryend,304TexasInstruments,24commoncollectoramplifier,127thermalvoltage,113thermocouple,191thresholdvoltage,132
time,50timer,259touchscreen,106transconductance(Gm),121transferfunction,64transformer,93transistorBeta,116transistortypes,107
BiCMOS,107CMOS,107transistors,107MOSFET,107NFET,107NPN,107
trigonometry,49truthtable,196Vpeak-to-peak,52Vrms,54VT,113
Uunitygainamplifier,171UniversalSerialBus(USB),247USB,236
VV(∆t)=L(∆I),75variable-gainop-amp,214VBE,113VBEequation,113vectordiagram,80,104Verilog,135VeryHighLevelDescriptiveLanguage(VHDL),135VFB,99virtualground,158voltage,5voltagedivider,16,64,99voltagefollower
buffer,171voltagegain,126voltagegain(hfe),117voltageleads,77voltagesource,7voltage-doublercircuit,103Vpeak,52
Wwafer,130watchdogtimer(WDT),261waveform,5weight,105wholenumbers,320Wilsoncurrentmirror,166wirelessnetwork,106wirelesssmokedetector,248
XXORgate,206Zzenerdiode,47zenerregulator,96ZigBee®,261
ΩΩpersquare,4
ѠѠ,57