EE I15B Frequencyresponse Log plots Ifltr yto p lot = onaline a rs c a le f o rv a lu e s o f xb e t we e n 0 a n d l0 , I g e t a f ai r l y r e a +." sonableplot. If I try to extendthe rangeto include 100, 1000,or one million, the plot quickly stops conveying any useful information (try it sometime). So what if I plot the 1ogof f(x) vs. the log of x? Now I find that I can actually draw a curve over many orders of magnitude of values of x and f(x) and still get useful information about it. Better yet, all I really need to draw is straight lines. /(x) The Bell - a unit of relative power (that'sa.joke-gert?) One Bell is one order of magnitude of power gain. The Bell is a relative unit, in the sensethat you need to specify a referencepower (or a ratio of powers) in order to calculatehow many Bells somethingis. For example,for soundpressure,the unit of power commonlyusedis the minimum power audible by the human ear, which correspondsto a pressurewave of roughly 0.00002 N / m2. Conversationalspeech,at roughly 5 Bells (or 50 deci-Belts)SPL (soundpressurelevel) has then 5 orders of magnitude more power than the minimum audible sound. A loud concert might be somewherearound 10 Bells, or 10 ordersof magnitudemore soundpower than the minimum audiblesound! 10 ordersof magnitude= 10,000,000,000.No wonderyour earsring a little after the concert! To calculatehow many Bells you have,take the log (base10) of the ratio of two powers: . /P\ togro[ If you find that this unit is inconvenientlylarge,you might want to multiply by 10 t,, re.f/] " and talk about tenths of Bells, or deci-Bells, which is usually contractedto decibels or dB. Probablythe most common use of Bells or decibelsis to representthe power gain of a linear system, in which casethe ratio of powers is the output power over the input power. For a truly linear system,this ratio is independentof the magnitudeof the input power. Another common referencepower level is the milli-Watt. Often power in RF circuits is written as somenumber of dBm. or deci-Bellsrelativeto a milli-Watt. Sometimesthe referencepower will be somemid-band power level in a given circuit, as in "the power is 3 dB down from it's DC value". Becausewe usually work with voltagesand currentsrather than power levels, we can replace the powers in the equation above with the expressionfor power as a function of voltage to get roe,ofio J = rosr.l Y) --\r ref/ '"lri"/ = togro( #\'= zrogls(Jl) 't \ v ref/ vVrrf) r) Which is theformulato usewhencalculatingBells basedon voltage. To calculatedeci-Bells sDtgs EE1158 basedon voltage,you needto multiply by 10 of course,whichis wherewe get thefamiliar forv mula2Ologf,. v ref Who caresabouttransferfunctions? Given a linear systemwith a transfer function H (s) , if the input of the systemis driven with a sine wave, the output of the systemwill be a sinusoidwith somedifferent magnitude and phase. The wonderful thing about the transferfunction is that it tells you what the magnitude and phase of that output sinusoidwill be. Inparticular,if v,n = sin (cor), thenvou,= lH(i@)lsin(or + /.H (.irrl)). This is suchasimple property to use, and such a powerful thing to be able to do, that we often plot lH (7co)| and lH (jul) as a function of crl so that we can quickly look up what's going to happento a sine wave at a given frequency. If you plot the log of the magnitudevs log frequency,we call these plots Bode plots. Why do we want to plot the log of magnitudeand frequency,but plot phaseon a linear scale? Voltagedividers Theseare easy: R. The thing to rememberis that this works with one or more capacitors ffi;. too. complex numbers- magnitude,phase,and graphicalcalculation Given a transfer function H ( s) = a (s-Z ) (s-Z )...(s-Z*) = o f I G - 2, ) ^ (s - P ,) (s - P z) ... (s - P n ) 'fl (s- Pr) the magnitude and phasecan be conveniently broken down in terms of the magnitude and phase of the individual terms of the form s - x, which has a nice physical meaningin the complex plane. s - "r is the vector from x to s . If we needto know the vector'smagnitude,we measureits length. If we need to know its angle,we measurethat relative to the positive horizontal axis. To get the magnitudeof H (s) , we seethat it is just the producflquotientof a bunch of lengths: flls - z,l ln(,)t=|"^|ffi So we just needto measureall of the vectorsfrom zerosto 's', and divide that productby the product of all of the lengths of the vectors from all of the poles to 's'. Similarly for angles,if you representthe complex numbersas exponentials,you can quickly convince yourself (seebelow if you needa little help in the argument)that the angle of H(s) is just the sum/difference of a bunch of angles: st9tgs EE 115B zH (s)= Llg -z) -Ez(s- P; ) The long and short of it is that you can draw your poles and zeros,and think abouthow all of theselengthsand angleschangeas you move aroundin the complexplane. Usually you will be particularly interestedin sliding 's' up and down the positivecomplex axis. (If you can't figure out why, go back up and look at 'Who caresabouttransferfunctions?') The capacitor- a frequencydependentresistor? One very useful way to think about capacitorsis just as frequencydependentresistors. If you see an RC circuit and want to know how it will perform at a given frequency,just replace the capacitor (mentally!) with a resistorof value I^. o lpF capacitorgives you lMe at (D = 106 radl sec, and IkQ at ot = 109 radlsec. (Quick quiz - what are thosefrequenciesin Hertz?) If the capacitor is in parallel or serieswith a l0 kO resistor,somethinginteresting is going to happen between those two frequencies. Is this the right way to think about capacitors? In somecasesyes - but don't forget that you're neglecting the phaseshift (that's really supposedto be a 7conot an crrin the formula for the impedanceof a capacitor). st9l9s EE1158 Complexnumbers A complex number of the form a + bj canalsobe representedas an exponentialof the form ,rio . In the first form, a andb specifythepositionof a point in a two dimensionalspacein a familiar Cartesianway. In the secondform, thepositionof thepoint is specifiedasa radiusr and.anangle from thehorizontalaxis, 0. You canusegeomeffyto figureout whattherelationshipis between thepair a, b andthepair r, 0. One advantageof the exponential form of a complex number is that the magnitudeand phase can be read directly from the representation. The magnitudeis r and the phaseis 0. This feature makes it convenient to work with transferfunctions using exponential notation. If we representa transfer function as H( s) =o ^ ffi=o^ W" .(s - rr) (s - p ) ... (s - p,) ( s _ p;) andthensubstitutein an exponentialrepresentation for eachof the (s - Z,) and (s - p,) terms, we get l1 ( s) = a^ jor, j!rjop n ' fp r€ " ...rp ,e ,p ru flrrejo'' ffr, ejo'' now remember that products of exponentialsturn into an exponentialof a sum, and we see that H (s) = o fI", Et",) *fr,,, "t(Lu',- The magnitude of the transfer function at a given point s is just the product of the distancesfrom the zerosto s divided by the distancesto all of the poles (anddon't forget about a^). Thephase is the sum of all of the phasesof vectorsdrawn from zerosto s minus the phasesof vectors drawn from poles to s. st9t95 EE115B Frequencyresponse, part II Most amplifiers can be broken down into a seriesof stages. Each stagehas its own relationship betweengain and frequency,which we call the frequencyresponseoithr stage. The overalt gain of the amplifier as a function of frequency is just the product of the frequenc! depenoent gain of each stage. In many cases,the stagescan be modeledindependentof each other. We will seethat in some cases(notably Miller compensation)the gain of one stagehas a sffong effect on the fequencyresponseof anotherstage. Singlestagegain and frequencyresponse Most gain stagescan be modeled by a voltage controlled current sourceor transconductance (B*), an output resistance(, (C ou), and an output capacitance "il. The low frequency gain of the amptfier is independentof the capacitorvalue, and is just -g ou,. ^r At some higher frequency,the capacitor will begin to "steal" a signifcant fraction of the current coming out of the transconductor.This will meanthat lesscurrent is flowing in the resistor,hence the output voltage will decrease,and the gain of the systemwill drop ,".orJingly. To find the frequency at which the capacitor has the samenmgnitudeimpedanceas the resisioi: lll lM)= rou, ,oc;rr= Now solve for rrr to get crr. = r outcey If we were to replace the capacitorwith a resistor of equalmagnitudeimpedance, the voltage gain of the amplifier would decreaseby a factor of two. Becausethe capacitorhas a complex impedance,the actual decreasein gain at frequency or, is only you J1. (Why? should be able to show this both graphically and atgebraically). For frequencieshigher than cDc,most of the current from the ffansconductor goes into the capacitor, and the resistor plays an increasingly small part in the circuit, the load impedancelooks very muchli,." &, andtheoutputvoltage becomes , = " ffi, , Another frequency of interest is the frequ ency atwhich the amplifier gives gain a of 1. The unity 6n/9s m 1158 gain frequencyCI)tis thefrequencyat which amplifier stopsgiving voltage and. gain,and begins to attenuatethe signal' This occurswhen , = !-. v rff Thesethreeexpressions for theDC gain, corner frequency,and unity gain frequency are very general - they apply to MoS amplifiers, bipolar and vacuum tube-amplifiers,evenhydraulic ,yrt.Lr. They are basedon the assumptionthat the stageis linear, which is always trusfor "smal'I" signals- where n'small,,essentiallymeanssigare small enough to make the amplifier looklinear (so we've gor some circuiar logic ffi}]rt:" The relationships can be summarizedgraphically using a plot of the log of the magnitude of the gain versus the log of the input frequency. log (g ^r or,) Let's plug in somenumbers:if we have a g , an outputresistanceof one Megaohm, * of 1 and a 1 pF capacitgl-we get a DC gain of -1000, ^N'f a corner frequency of one million radians per second' or around 160kHz, and a unity gain frequency of one billion rad/sec,or around 160 MHz. It is worth remembering how the three components affect the shapeof the transfer function as well' Increasing the output resistanceror, increases the low frequencygain, but decreasesthe corner frequency' so the high frequencyperformance remainsunchanged.Increasingthe effective capacitanc" c decreasesboth the corner frequency and the unity gain frequency,but has no "fi effect on low frequency gain. Increasingthe hansconductanceg, increasesboth the low frequency gain' and the unity gain frequency, but doesnot affect the corner frequency. Notice that the unity gain frequency is equal to the corner frequency times the Dc gain, 01 = (8 o. h general, the gain ' at frequenciesabovethe cornerfrequencyis given or) by ^r 8.,-foY' Ao'" A ( rrl) = =8 ^r our@,= = GB r + (D /(D c (D (D (D where GB is the gain-bandwidth product of the amplifier. 6nDs EE1158 IncreasinErou, DecreasingCrf Increasingg, Feedbackand stability Feedbackimproves linearity, reducesoutput impedance,reducesinput offset, increasesbandwidth (sort of), allows gain to be set accurately,and all sorts of other wonderful stuff. Unfortunately, it also introduces the possibility of instability vtw vou, With a little algebrayou can show that the gain from input to output in this figure is t/, A _=O UT V,* 1+A B All of the quantities in this equation can be frequencydependent,and the relationship still holds, and is often written G (s) = r ,O,(f). . If A is very large (or A(s) hasa largemagnitude),you 1 +A (s ) a p can approximatethe gain . fo get a largegain, you needa small B, which may seemcoun", p| terintuitive, but one way to look at it is that the amplifier needsto set V o* so that V* and V _ are (approximately)equal. If P issmall,ittakesmoreofVour toproducethedesiredeffect atV-, resulting in large gain. From the equation for the gain, it is clear that somethinginterestingwill happenf AA = - | . The equation indicates that the amplifier will provide infinite gain in this case. The unfortunate reality of this is that the amplifier will oscillate,becomeunstable,rtng,buzz,pop, and in some cases,melt.. It will certainlynot provide you with the nice cleansignalsthat you would like to see. To avoid this unstablestateof affairs, let's first seehow it can happen. 6/7t9s EE 1158 A(s) equal to negative one implies that the magnitudeof A is one, and the phaseof A is 180 degrees. Is this the only combination to worry about? What if the magnitude of A is 2 when the phaseis 180 degrees? The answer,as you might expect,is that if the magnitudeA is greater than or equal to 1 when the phaseof A is 180 degrees,the systemwill be unstable. [rt's call the fequency at which the amplifier gives a phaseshift of 180 degreesor80. From the figure we can seethat a signal arriving at the positive input of the amplifier with frequency crlrro will be ampli("rrrso) , and effectively multiplied by -1 (due to the 180 degreesof lA | phaseshift) and sent into the negativeinput of the op-amp. The two minus signs will cancel, and the processwill repeat. Each time around the loop the signal will be multiplied by (",rrao) , lA | (7olrr/ is greaterthan 1, the output signal will increaserapidly and inverted twice. Clearly, if lA | fied in magnitude by with time until something non-linear happens(like hitting the supply rails of the amplifier). In summary, to design a stable amplifier, you needto make sure that you design the frequency responseso that the magnitude of the transferfunction is less than one by the time the phasehas reached180. Miller compensation Thetwo stageCMOSop-ampbelowhasa primarypoleassociated with eachstage.Bothpoles Tt 6n/9s EE1158 areof theform, @p= +, r Thecapacitance interestinghappens. butin bothcasessomething ourLeff seenat the output of the differential amplifier is much larger than the apparentvalues of the capacitorsC*+ C ,. This is due to the Miller multiplicationof the compensationcapacitorC, . When a capacitoris placed acrossa gain stageit's effective capacitancechanges. Consider the figure below, in which Vo = -AV,. The chargeon the capacitoris given by Vo Vi but sincewe know whatVo is oncewe know V,,we canjust write Q = C (V i-V), = C (1+A )V i = Crf y ' , wh e reCrf f = (1 + A )C. S o t h e e f f e c t iv e c a p a c Q = C ( Vi--A V ) itance is equal to the actual capacitor value times the gain of the stageit's across. In the figure below, this means that Crrr, = g m.r out2C* andthat the pole of the differential 11 amplifier is at cl)or =-=rorttc ,1t r o rt l(8 ^ 7 t ' o u , zC)* ' If this were the only pole of the op-amp, the correspondingunity gain would be (8^zr o''t) (8 nr o''z) = y. As we will see,it turnsout that this generallyis 01 = A o@ p I r o u tL(B C ^ 7 t' o u t2 ) , Cx the unity gain frequency of a well designedMiller compensatedop-amp. The pole frequency of the gain stageis also affectedby the compensationcapacitor,but not becauseof Miller multiplication. There is no Miller multiplication since the gain looking from the output of the stageback toward the input is small. At higher frequencies,however, the compensationcapacitor does effectively couple the output signal back to the gate of transistor M7 , 6nps m 1158 resultingin an effectiveoutputresistance of r uutL out2= + for frequencies aboverrrol. I m'7 The capacitanceseenat the output node is the sum of the load capacitanceC, and the seriescomb in a ti on ofC* andCr.If CxrrCr,th e n t h e o u t p u t c a p a c it a n c e is ju s tu t 2 = CL + Ct . G e n e r Co ally the load capacitancewill be higher than the internal capacitanceC1, so the secondpole frequency is approxim ately r;-r, = y ' vL There is one additional effect of the compensationcapacitor. In addition to supplying a high-frequency coupling from the output to the gate of l:N.{7,italso allows signalsto favel from V, to V o without going through the inverting path through M7. This resultsin a right half plane zero 8 ,n 7 -fi. located at az = Noise There are many sourcesof noise in analog circuits. There is externalnoise, which may come from electrostatic or magnetic interference(you've all seen 60Hz on an oscilloscope). This type of noise can be minimized by using differential signals,running signalsin twisted pair wires, or co-ax cable. Unfortunately for the analog circuit designer,there is a more fundamentaltype of noise in electrical circuits - thermal noise. All resistorsgeneratenoise. Elecffons in a resistor are always bouncing around - they have thermal energy. In the absenceof an externally applied electric field, their motions are random. At any given time, some of them will be poking their headsout one end of the resistor or the other. This generatesa voltage which is random, and this voltage is what we call the thermal noise voltage of the resistor. Nyquist (I think) showedthat the amount of power in this noise voltage was 4kT for every Hz of bandwidth. Since the amount of noise power is the sameall acrossthe spectrum (4kT in each Hz) this is often called "white noise" (Q: what does "white" have to do with evenly distributed power over frequency?). kT is a fairly small amount of energy (about 4 x tA-zr Joulesat room temperature),so we're not talking aboutmuch power here. If we look at all of the thermal energy from DC to a gigaHertz,we only get about four picoWatts.Equating the power that Nyquist tells us about with the formula for power in a resistor,we come up with tt2 V = kTA,f and if we want to know what the noise voltage will be, we can solve for V to get y = J kTRLf For a lkC) resistor, thisworksoutto about4 nanoVolts timesthesquare rootof thebandwidth of interest,or 4 nV/ J-Hz. Soin a 1 MHz bandwidth, wecouldexpectto seeonaverage about4 microVolts of noise acrossthe resistor. Active devices (like MOSFETs and BJTs) generatenoise becausethey have internal resistances. Ideal passivecomponentssuch as inductors and capacitorsdo not generatenoise, but real devices will generally have some parasitic resistancewhich will generatenoise. 6n/9s EE I15B Questions 1 . Since the gain of a multistage amplifier is the product of the gains of the individual stages, why is it that I can talk about adding the magnitudeand phaseof the transfer functions? (you may want to use both graphical or analytical explanationsto answerthis question) 2. Derive the formula for the output impedanceof a cascodestage(r ou,* g.r2). 5. Derive the formula for the impedanceat the sourceof the cascodetransistor (r ou,= ;| I tn t om cascodeamplifier. 4 . If I invent a new type of MOS ransistor with a drain current given by forthetransconducI p(V ps,Vss) = X (VZs+BVf,5)[ f * 1,ffi,), a"riu"expressions tance and output impedance(S^ and ro). 5 . Design a folded cascodeCMOS amplifier with a DC gain of 10,000and a unity gain frequency of 200 MHz. Assume that the load will be capacitive,with no more than 10pF of capacitance.How would your design changeif you were told to minimize power dissipation at all costs? What would the minimum power dissipationbe? What if you were told to minimize die area?(Assume that die areais directly related to the sum of W times L for all devices). What if you were told to designfor a power supply of lessthan 5 volts. How low could you go? 6 . Design a two stageMiller compensatedCMOS amplifier which will be able to track input signals with better than 0.lVo accuracywhen usedin unity gain feedbackwith a 1k resistive load. How would your design changeunder the sameconstraintsof power, die area,and supply voltage above? 7. What is the fastestop-amp you can design which operatesfrom a 5 volt supply, allows input and output voltage swings to within 1 volt of eachrail, and dissipatesless than 100pW of power? 8 . Compare the performanceof a CMOS two stageMiller compensatedop-amp drawing 1mA in the input stageand 5 mA in the output stagewith the performanceof a similar bipolar operating with the samebias currents. In particular, if we assumea Vo, of 250mV for the CMOS devices, how do the transconductancesand output resistancesof the individual devices compare? What size capacitor is neededin eachcaseto make the amplifiers unity gain stable? What is the DC gain? Unity gain bandwidth? How do theseanswerschangeif we increaseof decrease Vo, for the CMOS devices? 9 . Explain why unity gain feedbackis the worst form of passivefeedback("worst" from a stability perspective).For an amplifier with 8.3 = Bp, and C* = I0Ct, what is the minimum feedback gain (or maximum feedbackfactor B ) for which the systemwill have 90 degreesof phasemargin? 6n/9s