lecture 9 - digital-to-analogue conversion 9 - digital-to... · the analogue world to digital...

16
1

Upload: voanh

Post on 08-Mar-2018

228 views

Category:

Documents


6 download

TRANSCRIPT

1

2

Althoughdigitaltechnologydominatesmodernelectronicsystems,thephysicalworldremainsmostlyanalogueinnature.Themostimportantcomponentsthatlinktheanalogueworldtodigitalsystemsareanalogue-to-digitalanddigital-to-analogueconverters(ADCsandDACs).

Inthenexttwolectures,wewillconsiderhowtheseconverterswork,theirlimitationsandhowtoreadtheirdatasheets.DesigningADCandDACrequiresbothknowledgeofanalogueanddigitaldesigns.Weareonlyinterestedinexaminingthebasicprinciplesoftheseconvertersandlearnhowtousethem.WewillNOTconsiderhowtheyaredesigned.DetailADC/DACdesignsattransistorlevelwillbeconsideredin3rd and4th yearsonothercoursemodules.

AnalogDevicesisaUScompanythathasthelargestrangeofconverterproducts.Theypublishanexcellenthandbookwhichisavailablethroughthecoursewebpage.Relevanttothislectureisthechapteron“Chapter3:DataConverterArchitectures”.

3

ThesimplestDACcanbeconstructedusinganumberofresistorswithbinaryweightedvalues.X[3:0]isthe4-bitdigitalvaluetobeconvertertoananaloguevoltageVout.The4-bitnumberisusedasinputtobuffercircuits(therectangularblockslabelled‘1’).TheoutputsofthefourbuffersareV[3:0]respectively.UsingKirchhoffcurrentlaw,thecurrentatnodeVoutsumstozero,andthisgivesthefirstequation.(G0 is1/R0 etc.)RearrangingtheequationproducestheequationforVout.ThedigitalvalueX[3:0]canthereforebeconvertedtoananaloguevoltageinthecorrectbinaryweightingifG3:G2:G1:G0havetheratioof8:4:2:1.Sincethedigitalbufferisveryfastandtheresistornetworkhasno(ornegligible)capacitanceorinductance,thisDACcanbeveryfast.However,thisDAChastwoproblems:1. TheoutputimpedanceoftheDACistheTheveninequivalentcircuitresistance.ChoosingtoohigharesistancevalueresultsintheDAChavingahighoutputimpedance;choosingtoolowaresistancevaluedrawslotsofcurrentfromthebuffersandisinefficientonpower.2. ItrequiresverylargeresistanceratioifthenumberofbitsofXislarge.Forexample,fora10-bitDAC,theratiois1024:1.SuchaDACisdifficultandexpensivetomanufacture.Insteadofonlyusingbinaryweighting,itispossibleforyoutochoosefivearbitraryVoutvalues.IfyouaddanotherresistorR4connectingfromVouttothepowersupply,andsetX[3:0]to0000,0001,0010,0100and1000,youcaneasilyworkouttherequiredvalueoftheresistancesinordertogiveyouthefivearbitraryvoltages.

4

Thehighoutputimpedanceofthepreviouscircuitcanbecircumventedusinganoperationalamplifier.Shownhereisasummingamplifier.Vout isgivenbythissimplelinearequation.Theoutputimpedanceisthatoftheopampandisverylow.

Unfortunatelytheoutputvoltageofthiscircuitcannotchangeveryfast.Itislimitedbytheslewrateoftheopamp.(Slewrateisameasureofhowfasttheoutputvoltagecanchange,anditisinunitsofV/sec.)

MakingbinaryweightedresistorsisstilldifficultandexpensiveofthenumberofbitsintheDACishigh.

5

Insteadofdrivingtheresistornetworkdirectlyfromthedigitaloutput,whichisnotveryaccurate,mostDACactuallyusethedigitalsignaltocontrolelectronicswitcheswhichswitchinoroutareferencevoltageVref.Thisreferencevoltagecanbemadeveryaccurate,thusprovidingaccurateoutputvoltagevalues.

6

HerearetheimportantspecificationsfoundinadatasheetthatdefinestheperformanceofaDAC.Hereweusethelinefromfullrangevaluetotheoriginasreference.Wewillexpressallvoltageintermsofthedelta-vcorrespondingtooneLSB.

Resolution – thevoltagestepequivalenttooneleastsignificantbit(1LSB)ofthedigitalinput.AssumingthattheinputisanN-bitnumber,thenresolutionoftheDACisthesameas:(full-scalevoltage)/(2N-1).

Accuracy – maximumerrorascomparedtotheperfectreferenceline(red).

Linearity – Insteadofusingthereferenceline,wecanjointomax-pointwiththemin-pointtoformanotherstraightline.Linearityisthemaximumdeviationfromthisnewline.

DifferentialLinearity– WorsecaseerrorasyoustepfromXtoX+1forallvaluesofX.

MonotonicDAC– OnethatalwaysgoesupastheinputnumberX[3:0]increases.

Settlingtime– Timetakentoreachfinalvaluewithin±1LSBasinputchanges.

7

Insteadofusingbinaryweightedresistornetwork,wecoulduseaseriesstringofidenticalresistorsasshownhere.Withthisarchitecture,Vrefto0isdividedinto8equalsteps(including0value).The3-bitdigitalinputisdecodedinto8possiblebinaryone-hotcodes.Forexample,000resultsinthelowestswitchbeingconnectedand111willswitchtheuppermostswitchon.

ThisDAChastheadvantageslistedhere:• Itissimple,usesonlyoneresistorvalueReverywhere,thereforeeasytomanufactureusingsemiconductorprocess.• Onlyoperatingtwoswitchesatanyonetime,sotheglitchesaresmaller.• Itislowpowerandinherentlymonotonic.

8

Insteadofusingalargenumberofswitches,wecanalsouseswitchesarrangedinatreestructureasshownhere.Hereisanexampleshowingthedecodingofthedigitalvalue3’b0101.Decodingisimplicitlyperformedviathecontroloftheswitchesusingthethreedigitalbits.TheoutputopampprovidesbufferingoftheDACvoltage.

Inthisexample,the3’b101digitalvalueselectsthe5/8Vreftapoftheresistorstringtoroutetotheopamp.

9

Stringresistornetworkisgoodfor,say,upto10-bitDAC(requiring1024identicalresistors).Ifyouwanta16-bitDAC,youwouldneed65536resistors!Thatisobviouslynotpracticalortooexpensive.AbettersolutionistouseR-2RLaddernetwork.Thiscircuitisveryclever.ThebasicideaistoproducecurrentIo, 2Io, 4Io etc,usingonlyidenticalresistorsconnectedinaspecialway.ThebestwaytounderstandtheworkingofthisR-2Rnetworkistoconsiderjusttworesistorsbothwithvalues2R.IfthecurrentflowingthrougheachresistorisIo,thenthetotalcurrentatnodeVomustbeI1 = 2Io.TheTheveninequivalentresistanceofthesetworesistoris2R||2R=R.NowweaddanextraresistorRinserieswiththesetwo2Rnetwork.Togethertheyformaresistance2R.Ifweaddthenextstepoftheladderasshownhere,thetotalcurrentatV1is2I1 = 4 Io.Asyoucansee,addingeachextrastepoftheladderdoublesthecurrent.Ifthevoltagedropacrossthehorizontalresistorsthereforealsoincreasesinratiosof2foreachstep.

10

ForapracticalDACcircuit,theR/2Rladdernetworkisconnectedtothevirtualearthoftheopampasshownhere.Thecurrentiseithersenttothevirtualearthnodeifthedigitalvalueis‘1’,orswitchedtoearthifitis‘0’.Inthatway,theoutputvoltageVoutisaconverteranaloguevalueofX[3:0].

Notethatweswitchcurrentfromonebranchtoanotherbranch.Itisknownascurrentsteering.Currentsteeringismuchfasterthanturningthecurrentonandoff.

11

InsteadofusingVref,afixedreferencevoltage,wecoulduseananalogueinputVin(suchasanaudiosignal),andthenusetheDACasadigitallycontrolamplifierorattenuator.ThisisalsoknownasamultiplyingDAC.TheoutputisXmultipliedbyVin.

12

Youarefamiliarwith2’scomplementnotation.Youmaynotknowaboutoffset-binarynumbers.Whatitmeansisthatyouusezerotorepresentthemostnegativevalueinsteadofanegativenumber.Forexample,forarangefrom-512to511,usetherange0to1023byaddingtoyournumberanoffsetof512:

Yoffset=X+512

IfyouneedtoproduceaDACwithnegativevoltageorcurrentforbipolardigitalinputvalues,youneedananaloguecomponentknownasacurrentmirror.Youdon’tneedtoknowexactlyhowthiscouldbeimplemented.Itissufficienttounderstandthatacurrentmirrorsimplymirrorsthecurrentononebranchofthecircuittoasecondbranchofthecircuitasshowninthenextslide.

13

Assumingthatyouhavethecurrentmirrorcomponentavailable,youcanconnectthisasshownhere.Y[3:0]isa2’scomplementnumberthatwewanttoconvert.X3ismadetobe~Y3.Theoutputcurrentisnowbipolar.IfX[3:0]=4’b0000,thentheoutputcurrentis-16Io(i.eY[3:0]=-8).IfX[3:0]=4’b1111,thenoutputcurrentis14Io(i.e.Y[3:0]=7).

14

Insteadofusinganalogueresistornetwork,itispossibletobuildasimpleDACusingonlydigitalcomponents.Hereisacircuitschematicforapulse-widthmodulatedDAC.HerethecounterisusedtoproduceacountvalueAthatrampsuplinearlyinasawtoothmanner.Thedigitalvaluewewanttoconverttoanaloguevalueisdata_in,whichisstoredasBintheinputregister.Adigitalcomparatorcircuitcomparesthisinputdatawiththecountervalue(whichisrampingup).WhileAislessthanB,theoutputofthecomparatorishigh.AssoonasAexceedsB,theoutputgoeslow.Inthisway,thepulsewidthisproportionaltothevalueofB(ordata_in)inalinearmanner.PassingthisPWMsignalthroughalowpassfilterwillgiveananalogueoutputwhichislinearlyrelatedtodata_in.

15

ImplementingaPWMDACisextremelysimpleinVerilog.Althoughthisisnotspecifiedasanexerciseintheexperiment,Isuggestthatyoushouldtrythisoutforyourself.

HereistheVerilogcode.

16