MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Please use the following citation format: Anant Agarwal, 6.002 Circuits and Electronics, Spring 2007 (Massachusetts Institute of Technology: MIT OpenCourseWare). http://ocw.mit.edu (accessed MM DD, YYYY). License: Creative Commons Attribution-Noncommercial-Share Alike. Note: Please use the actual date you accessed this material in your citation. For more information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Transcript – Lecture 1 So, one question to ask ourselves is, what is engineering? How do we define, what is engineering? Well, the definition I like to use is one put forth by Steve Senturia, one of our professors who is now retired. He defined engineering to be the purposeful use of science. All right, so what is 6.002 about? So, 6.002 is a first course in engineering. And I like to view 6.002 as the gainful employment of Maxwell's equations. Many of you have seen Maxwell's equations before. Most of you should have. And they are hard stuff. 6.002 is all about teaching you how to simplify our lives, make things simple. So, if you can gainfully employ Maxwell's equations, gainfully employ the facts of nature to build very interesting systems. So let me show you how the transition is made. So, there's a world around us, nature, so we made some observations in nature. We make measurements, and we can write down large tables of measurements. So, for example, we can take objects and measure the voltage across them, and look at the resulting current through the elements. So, we may end up getting a bunch of values such as [CHALKBOARD]. So, we start out life with making measurements on what exists. And we build a bunch of tables. Now, we could directly take these tables, and based on observations of these tables, we could go ahead and build very interesting engineering systems that help us out in day-to-day lives. But that's incredibly hard. Imagine having to resort to a set of tables to do any kind of useful work. So what we do as engineers, we first layer a level of abstraction. We look at all the data, and somehow layer abstraction such that we can simplify or much more succinctly put in a simple equation or a simple statement what these numbers are telling us. OK, so for example, our physics laws, so laws of physics for example are simply abstractions, the laws of abstractions. So, these sets of numbers can be codified by Ohm's law, for example, V is equal to RI, the voltage current, relates to the resistance of the object. So, V is equal to RI is a law that succinctly describes a set of experiments, and replaces a large number of tables with a very simple statement. You could call this the law, or you could call it an abstraction. OK so you see laws of physics, call them abstractions of physics if you like. Similarly, there are Maxwell's equations and so on and so forth. So, this is what is. This is what's out there. OK, and a law as an abstraction describe the properties of nature, as we see it, in some succinct form. Now, if you want to go and build useful things, we could take these abstractions, take Maxwell's equations, and go and build things. But it's hard. It's really, really hard. And what you learn in, at MIT is this place is all about simplifying things. Take complicated things, build layers of abstraction, and simplify things so that we can build useful systems. Even in 6.002 we start life by making a huge leap from Maxwell's equations to a couple of very, very simple laws. OK, I'm going to show you that leap that we will make today. So, the first abstraction that we layer is called the lump circuit abstraction. OK, in the lump circuit abstraction, what we do is we make a set of simplifications that allows us to view a set of objects as discrete or lumped elements. So, we may, I will define voltage sources. We'll define resistors. We'll define capacitors, and so on. OK, and I'm going to make the jump, and show you how we make the jump in a few minutes. So, on that sort of abstraction, we then layer yet another abstract layer. And let me call that the amplifier abstraction. OK, remember, here we are absolutely down and dirty. We are setting the probes, measuring objects, and building huge tables. We abstracted things into simple laws, and life got a little better. OK, I'm going to show you can abstract things further out and build discrete objects, and, you could build even more interesting components called amplifiers and begin playing around with amplifiers. OK, so when you are using amplifiers, you don't really have to worry about the details of Maxwell's equations. OK, I'll give you some very simple abstract rules of behavior for an amplifier, and you can go build very interesting systems without really, really knowing how Maxwell's equations applies to that because you will be working at this abstract layer. However, since you're engineers, and you are good at building such systems, it's very important for you to understand how we make this leap from the laws of physics into some of our very primitive engineering abstractions. So, once we make the amplified abstraction in 6.002, by the way, 6.002 starts here. We start from the laws of physics and then proceed all the way out. So, once we talk about amplifiers we will take two pads. On the amplifier, you will build the next abstraction called the digital abstraction. OK, and with the digital abstraction, we will build new elements such as inverters and combinational gates, OK? So, notice we are building bigger, and bigger things, which have more and more complicated behavior inside them, but which are very simple to describe, right? So, following the digital abstraction, we will superimpose the combinational logic abstraction on top of that, and define functional blocks that look like this: some inputs, some function, some outputs. The next abstraction on top of that will be the clock digital abstraction, where we will have some notion of time introduced into the system. There will be a clock, and this will be some function. And there will be a clock that introduces time into the sort of logic values that functions operate upon. Following that, the next level of abstraction that we build is called instruction set abstraction. OK, now you begin to see things that consumers get to look at. Can someone give me an example of, or name an instruction set, or instruction set abstraction? Bingo. So, x86 is one set of abstractions. And in fact, in many universities, education could well start just by saying, OK, here's an abstraction. These are the x86 instructions, OK? Some MIT gurus have designed this awesome little microprocessor, OK? So you just worry about, you take this abstraction layer here, the assembly instructions, and you go and build systems on top of that. OK, so this is an abstraction layer called the x86 layer. There are other abstraction layers. In 6.004, you will learn about, I believe, the alpha or the beta, OK, and various other abstractions at this point. So, 6.002 kind of goes until here. 6.002 takes me from the world of physics all the way to the world of interesting analog and digital systems. OK, 004, the course on computation structures, will show you how to build computers all the way from simple digital objects all the way to big systems. Following that, you learn about language abstractions, Java, C, and other languages, and that's in 6.002. And there are several other courses that will cover that. Following this, you learn about software system abstractions, and software systems, you will learn about operating systems. Any example of an operating system abstraction that people know out there? What's that? Linux. What else? I'm just wondering how long I'll have to go before I hear what I want to hear. [LAUGHTER] OK, so we have a bunch of software systems. So, if we have a bunch of software systems, these are nothing but abstractions. Linux simply implies a set of system calls that the programs must adhere to. Windows is another set of system calls. That's it. And see how much money they made out of it? OK, it's all about abstraction layers, that all start from nature. All right? Build abstraction upon abstraction upon abstraction upon abstraction, and someone out here are lots of dollars. OK, so based on these abstractions, we can then build useful things for human beings. We can build very useful things, video games, so we can send space shuttles up, and a whole bunch of other systems. But it's based on these abstraction layers. What's unique about education at MIT? What's unique about 6.002 and EECS? Is to my knowledge, there are not many other places in the world where you will get an education in everything going all the way from nature to how to build very complicated analog and digital systems. OK, we will show you layer upon layer upon layer upon layer, peel away the onion until you are down to raw nature, OK, through Maxwell's equations. So, 6.002, 004, this is 033, OK, 6.170, and so on. OK, the whole EECS is about building abstraction layers, one on top of the other. So that's one path. There's the analog path. The analog path would take an amplifier, and build an abstraction layer called the op-amp. See how similar they all look? You know the amplifier, the inverter of the digital world, and the operational amplifier in the analog world, just different ways of looking at the same devices. So, to build an analog system, to build an operational amplifier, and then, here we go end up building a whole bunch of different interesting analog system components. OK, and these components might look like oscillators. They might look like filters. OK, they look like power supplies, a whole bunch of very interesting abstract components, which pulled together can then give you the next set of systems. And these systems might be toasters, or say for example other analog systems like the various control systems for various power plants and so on and so forth, and ultimately, fun and dollars. OK, so 6.002 is about going from physics all the way to this point. We will build interesting analog systems, and take you up to interesting digital system components, from which 004 will take you all the way to building computer architectures. So that, in a nutshell, kind of gives you a feel for the space of EECS. OK, this chart here is almost a vignette of what EECS at MIT is all about. And this is the world according to Agarwal, because he's teaching 002. OK, so this is 6.002, and the rest of EECS is somewhere out there. OK, so I'm going to do now is throughout this course; I want you to think about which part in this vignette we are in. So, right now, I'm going to start here and take you here. OK, and as you get closer and closer, things get simpler, and simpler, and simpler. Still, the final abstractions are pedal, brake, steering wheel. I mean, that's the abstraction to play a game, right, four or five very simple interfaces, and that's all you need to know. And everybody in the world can play stuff. So remember, this stuff is complicated. This stuff is very, very simple. OK, and the more we build abstractions and come to this side, things get simpler and simpler. So, a large part of what I'll cover today is make the biggest simplification. The biggest simplification we will make his go from Maxwell's equation to some very, very simple algebraic rules. OK, I did Maxwell's equations myself. And I tell you, they were very interesting stuff but complicated. I can't imagine building efficient systems using Maxwell's equations. So, let's take an example, OK? So, let's say I have a battery. Just switch to page three of your course notes. And let's say I connect that to a bulb. OK, and this is a wire. And, the battery supplies some voltage, V, and I ask you a simple question. What is the current through the bulb? OK, so here is something that I can build using objects. I can pick a round from stores and so on. And I can collect them up in this way, and ask the question, what is the current, I? Now, if all you've done is learn about Maxwell's equations, you can roll up your sleeves and say, ah-ha! The first step is to write down all of Maxwell's equations, and you can say, del cross E is minus del and go on, and on, and on, OK, and write out all of Maxwell's equations and say, now how do I get from there to here? OK, it's very good. You can do it. OK, you can do it, but it's very complicated. OK, so instead, what you're going to do is take the easy way. So, what I want to remind you is that this course is actually very easy. OK remember, we're going to be building abstraction upon abstraction to make your lives easier. If you think your lives are getting more complicated, then you are not using intuition enough. OK, just remember the big I word. It's all about making things simple. OK, so let me give you an analogy. So, suppose you have an object. OK, and I apply a force to the object. It's an analogy, OK to get some insight into how to do this. So, I say here's an object. I apply a force, and I ask you the question. What is the acceleration of the object when I apply a force, F? So, how would you do it? OK, and eighth, or ninth, or tenth grader can do this. OK, they would ask me, what's the mass of the object? OK, I ask you what is the acceleration? You would turn around and ask me, what is the mass of the object? I tell you, the mass of the object is M. And then you say, oh sure, A is F divided by M, done. It's as simple as that. OK, I could have gone into all kinds of differential equations and so on to figure that out, but you asked me for the mass. And you gave me the answer, A is F divided by M. So, you ignored a bunch of things. You ignored the shape of the object. You ignored its color. You ignored its temperature. OK, and you ignored the soft or hard or whatever. OK, you ignored a whole bunch of things. You were focused on one thing. OK, you're focused on its mass. And, it turns out that the process really was developed from a set of simplifications. That is called, does anybody remember this? Point mass simplification. OK, so, in physics, you've done this before. OK, you've simplified your lives by viewing objects as having a mass at a point, and force is acting at that point. OK, M is that property of the object that is of interest to you. This process is called, in physics, point mass discretization. OK, now using an analogy, and I'm going to show you a similar simple process to do the problem with the light bulb. OK, so take my light bulb again, And I focus on the filament of the light bulb. OK, all I care about is the current flowing through the light bulb. OK, I don't care about whether the filament is twisted, whether it's hot. I don't care about its shape. I don't care about its color. All I care about is the current. OK, so to do that, what we can do here at a very high level is since we just need the current and don't care about a bunch of other properties, we will simply replace the bulb with a discrete object called a resistor. So the discrete object is a resistor, much like the point mass simplification that we did earlier that replaced the bulb filament with a object called a resistor, a discrete object called a resistor. Or a lump object called resister, and put a value next to it just like the mass for the object, a resistance value, R. OK, now what I can do is in the same manner, replace the battery with an object called a battery object, and connect that here, the voltage, V, applied to it. V falls across the resistor, and I get my I simply from Ohm's law as we divide by R. So, notice here, to replace this complicated bulb, this really twisty, weird old thing with this discreet thing called a resistor, and its only property of interest was its resistance value, R, direct analogy to what we did there. So, since R represents the only property of interest, we can simply ignore all the other things. So, notice here, we've done things the simple way. And remember, in EE, in the electrical engineering, we do things the simple way. OK, we could go the hard route and do Maxwell's equations, and get PhD's in physics, and so on. But out here, we are looking to do useful, interesting systems in the simplest way that we can. OK, we do things a simple way. All right, so we just did this, and boom, I found out what the current was. Now, I cheated a little bit. I've cheated a little bit. R is a lumped abstraction for the bulb. So, you look at this resistor here. That is simply a placeholder. It's a stand-in for this complicated thing called a bulb. It's a discreet object. It's a lumped object, and represents the bulb. Now, so most of 6.002 will take off from here, OK, and that's it. To very simple stuff, like V is equal to IR, it's a simple high school algebra to take off in that direction. But before we go there, it's important to understand, why was it that we were able to make the simplification? OK, we did something else. Something's going on under the covers here. On the one hand, I say let's use Maxwell's, and then I jump out and say, hey, we can just use this simple thing. I did something that allowed me to go from here to here. And you need to understand why I did that and how I did that. Understand it once, and then you won't have to need that information again. You just need to understand it. So, let's take a closer look at the bulb filament, and look at what we really did. So, here's my filament, A, and let's say that the surface area here, I label that SA, and the one down here SB, my voltage, V, applied there, and this is what I call my black box that I've replaced with a resistor. Notice that, in order for this to work, V and I need to be defined. So I needs to be defined, and V needs to be defined. OK, if I give you a random object, and I don't tell you anything else about the object, it's not clear I can do that. OK, if it's a much more general situation, I have to write down Maxwell's equations, and this is what I would write down. Write down J dot dS as a function of the coordinate here integrated over the area minus, OK, I would have to start from there from one of Maxwell's equations. All right, notice that this becomes IA, and this becomes IB in our simplification. But, if I don't tell you anything else, you have to start from here. You will have some varying current here by point. You might have some other current coming out here because I may have some charge buildup happening inside. If charge is building up inside the filament; then I would have to put del q by del t out here, right, the current in minus the current out must equal charge buildup. Whoa, where is this and where is that? So this is reality. This is really, really what I have to do. But how did I get there? How did I get there? The key answer is, as engineers, when in doubt we simplify. Remember, we are engineers. Our goal in life is to build interesting systems. OK and some are motivated by money. OK, so our goal is to build interesting systems and do good to humanity. So, as long as we can build a good light bulb, we are happy. So what we can do is we can say, look, all I care about is building interesting systems. So I can say, hey, this stuff is too hard. Let's make the assumption that all the systems that we will consider will have this thing be zero. OK, in other words, if I take a complete object, if I take an element like a resistor or a capacitor, the box around the entire element, OK, and I want to just deal with those systems in which this thing is zero. You can come and beat me up and say, but why? Why not? Why am I doing this? And I am saying the world is arbitrary. I'm an engineer; I want to build good systems. By making this simplification, I eliminate this squiggle thing, and so on. I don't want to deal with it. I want to make my life simple. So this is gone to zero because, why? Because I have said that in the future I will only deal with those elements for which this is true. I'm going to discipline myself. I'm going to discipline myself to only deal with those systems. OK, Maxwell is turning around and, you know, mad at me and all that stuff, but tough. So this, what I've said about making a simplification here, and this is one of the simplifications I'm making. And I give a name to the simplification. And that's called the lumped matter discipline. OK, so I'm saying I will only deal with elements for which if I put a black box around it, this is going to be true. And if this is going to be true, then notice, there is no charge buildup. Current in must equal current out. Ah-ha! So this becomes IA. This becomes IB. Yes. OK, I can now deal with IA's and IB's. And IB and IA are equal because this is zero. Notice that there is a whole bunch of depth here in the jump from here to here. As MIT graduates, you really, really need to understand why it is that we made that jump, and then go and use that, and do cool things. All right, this allows us to define I. We have a unique I associated with an element for the current through the element. We still have to worry about B, and I won't go through that in detail. The course notes have some discussion of that and so does the textbook. So V, AB is defined when del phi B, the rate of change of magnetic flux is zero. So, if I take the element and I take any region outside the element, this must be true. And you say, why should that be true? That's not true in general. Absolutely. It's not true in general. But I, because I choose to, I going to deal with only those elements. I will discipline myself. But these are only those elements for which this is true, and this is true. I'm going to limit my world. I'm going to create a play field for myself. You want to play; follow my rules. OK, and that's called the lumped matter discipline. So once you say that I'm going to adhere to the lump matter discipline, and this is true inside your elements. This is true outside the elements. You can define VA and VB, and good things happen to you. OK, let me show you a few examples of lumped elements. But remember, a large part of what we're doing is based on these two assumptions. And to just go through the background on that, I would encourage you to go to chapter 1 of your course notes and read through just as how this came about, that comes about. So, by doing that by adhering to a lumped matter discipline, we can now lump objects. We could lump a bulb into a resistor. OK, so to be clear, a certain number of lumped objects, and now, the universe is going to be comprised into lumped objects. OK, so before this, when he went home, we talked about eggs, and omelets, and light bulbs, and switches, but once you come to MIT, and after you've taken 6.002, you begin talking about lumped elements, you know, resistors, voltage sources, capacitors, little inky-dinky objects that follow the lumped matter discipline. OK, they stick to very simple rules, and the math that you have to do to analyze them is incredibly simple. What could be simpler than V is equal to IR? So, let me give you an example of interesting lumped elements, and then show you a couple of really nasty lumped elements. OK. OK, so what you see out here, so we characterize lumped elements by the VI characteristics. OK, you apply voltage, measure the current. OK, so what I can do is I can plot I here, and V here, and see what it looks like. OK, I can characterize elements by their VI relationship. And there are a bunch of elements that I can create based on the VI relationship. So let me show you a few examples. So for the resistor, since V is directly proportional to I, and R is a constant, I get a straight line. That's the I axis, the V axis, and this is the resistor. What I actually have is a variable resistor, so I'm going to change the resistance value, R, and the curve will also change slope. OK, I changed the value of R because it's a variable resistor, and the changes slope because my R is different. OK, next, let me go to a fixed resistor, and this guy here on the screen to your left is a fixed resistor. And you see that its IV characteristic is a line of a given slope, 1 by R, and that's it. I can't change it. Number three, I have another lumped element called a Zener diode that you will see in the fourth week of this class, and the characteristics for the Zener diode look like this: IV. If my voltage goes across the Zener diode goes up slightly, the current shoots up. But if the voltage becomes negative I don't have any current flowing into it until the voltage passes on the threshold, at which point my current begins to build up. OK, so I can increase the voltage a little bit, and it can show that the current starts building up again. So that's another interesting lumped element called a Zener diode. Let's switch to the next one called a diode. So a diode looks like this: IV. As the voltage across the diode becomes positive, around .6 volts, or thereabout, the current begins to shoot up. But when the voltage is below that threshold of .6, then my current is almost zero. It's another lumped element called a diode. And you will begin using these elements in your 002 lives to build interesting systems. The next example is a thermistor. A thermistor is a resistor whose resistance varies with temperature. OK, so this is a very expensive little hairdryer, and what I'm going to do is blow some hot air at my resistor, and you're going to see that its value is going to change depending on how much I heat it. So as it cools down, let me cool it down, so you can see it's coming down. I can zap it again. I could do this all day. This is so much fun. OK, so that's another interesting lumped element. As the temperature rises, its resistance changes. The next thing is called a photo resistor. It's a resistor. It used to be a resistor; Lorenzo? Oh OK, that's fine. So this is a photo resistor. And notice that it almost behaves like an open circuit. But what I'm going to do is shine some light on it. When I shine light on it, it begins to conduct and becomes a resistor of some value. There you go. OK, so that's a photo resistor. So now I'm going to show you a battery. Notice we did talk about batteries before. I'll show you a battery. So before you show a battery, just thinking your own minds, what should the IV characteristic of a battery look like? IV. A battery supplies a constant voltage. You know your little cell, the AA battery, 1.5 volts? So, think of what the IV characteristic of a battery should look like for three seconds before it shows you. This is the one I showed, Lorenzo?. It's a straight line. This is a good battery. It's a straight, vertical line, but says that the voltage is 1.5 volts, or thereabouts. No matter what current it supplies as an ideal voltage source, it has a fixed voltage, V, and no matter what the current going through is. Now, I'll show you a dud, a bad battery, and this is what the bad battery looks like. So, many of you have had your car batteries die on you. When you go to the store, they check your batteries. They use exactly this principle, that dead batteries have resistance. By the way, you see slopes here. You're thinking of resistance. OK, they can use this property to figure out that your battery is dead. So that's a dead battery. And finally, let me show you a bulb. We started with a bulb, and so I need to end, OK, we started with a bulb, so I need to end with a bulb. And what you will see is that a bulb simply behaves like a resistor. Its IV curve is going to look like this. OK, notice this is my bulb. And guess what, it behaves like a resistor. It's a very interesting kind of resistor, so I won't go into details for now. But notice its IV characteristic behaves like a resistor. OK, so those are some pretty standard lumped elements. You deal with a lot more sets of lumped elements, switches, MOSFETs, capacitors, inductors, a bunch of other fun stuff. But before we do that, what I wanted to tell you, don't go berserk on this abstraction binge. Too much of anything is bad for you. So what I'm going to show you is, abstractions or models are only valid provided you work within a set of constraints. Notice, we have already had this tacit handshake which said that we follow the discipline. Even after we follow the discipline, there are ranges to how well physical elements can behave like ideal lumped elements. OK, for example, what we will do is show you the resistor. And it's going to look like a resistor. And I'm going to keep increasing the voltage around it. OK, what's going to happen at some point? I just keep doing that. If it's an ideal element, if you're a theorist, you say, oh yeah, the curve will keep extending until I reach infinity. But this is a practical resistor, so people out here can cover your eyes or something. OK, so you're abstraction can't predict that. All it says is the current is an amp. It can't predict the heat, light, or the smell. In the laboratory, even, you get the smell. You know what somebody has just done. So that's one example of the lumped abstraction breaking down. So, if I really believe that my own BS, anything is a lumped element. So here's a pickle. A pickle is a lumped element. I can choose it as a lumped resistor. But this is a very interesting lumped resistor. Don't try this at home. This is a standard pickle into which you are pumping 110 V AC. I promise you, this is a standard pickle. So, it has a fixed resistance, but your lumped abstraction cannot predict the nice light and sound effect. OK, so the last two or three minutes what I want to do, so remember, don't get carried away by abstractions. There are limits. OK, you can't predict everything. OK, that's the smell of a pickle. OK, so let me give you a preview of some upcoming attractions, and show you one more quick simplification in the last few minutes. So what we can do, once we build these lumped elements, we can connect them in circuits. OK, so I can build a circuit, of the sort. So here's a voltage source with a bunch of resistors. I can connect them with wires and build a circuit of the sort. One interesting question we can ask ourselves is, under the lumped matter discipline, what can we say about the voltages? OK, if I go around the loop, provided my world adheres to the lumped matter discipline, what can I say about the voltages around this loop? Ah-ha, Maxwell again, right? So, I can write Maxwell's appropriate equation to solve that. OK, voltages have something to do with E and your integral of E dot dl and all of that stuff, right? So this is the appropriate Maxwell's equations to use. And I want to find out what happens here. Now remember, under LMD, I made the assumption. OK, my world, my playground, has del phi B by del t being zero. The rate of change of flux is zero. So, under these circumstances, I can write this. I can break up this line integral into three parts across the voltage source and across the two resistors and write that down. OK, and then when I can do, is now that the right-hand side is zero, I can simply take this. And I know that E dot dl across this element is simply VCA. This is VAB, and this is VBC equals zero. OK, so when I make the assumption that del phi B by del t is zero, and I go around this loop, apply Maxwell's equations, what do I find? I find that the sum of the voltages, VCA plus VAB plus VBC, is zero. That's fantastic. So now, I could say hasta la vista to this baby here. And I can focus on this guy and say, Maxwell's equations, this thing with squiggles and dels and all that stuff, can be simplified to the sum of the voltages across a set of elements in a loop in a circuit is zero. OK, and this is called Kirchhoff's first first law, KVL. OK, similarly, in recitation section, you'll see the application of Kirchhoff's current law, which comes from this be equal to zero, and all the currents coming into a node being zero. So, KVL and KCl directly come out of the lumped matter discipline. And you can use those to solve circuits like this. MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Please use the following citation format: Anant Agarwal, 6.002 Circuits and Electronics, Spring 2007 (Massachusetts Institute of Technology: MIT OpenCourseWare). http://ocw.mit.edu (accessed MM DD, YYYY). License: Creative Commons Attribution-Noncommercial-Share Alike. Note: Please use the actual date you accessed this material in your citation. For more information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Transcript – Lecture 2 Good morning, OK. Let's get started. We have one handout today. That's your lecture notes. There's some copies still outside for those who haven't picked one up. In general, what I do is, in the lecture notes, I leave out large amounts of material. So, this will enable you to keep your hands busy while I'm lecturing and take down some notes and so on. So, don't assume that everything that I talk about is on here. Please follow along. OK, so as is my usual practice, let me start with a quick review of what we covered so far. So what we did primarily was looked at this discipline that we call the lump matter discipline, which was very similar, very reminiscent of the point mass simplification in physics. And this discipline, this set of constraints we imposed on ourselves, allowed us to move from Maxwell's equations to a very, very simple form of algebraic equations. And specifically, the discipline took two forms. One is, we said that we will deal with elements for whom the rate of change of magnetic flux is zero outside of the elements, and for whom the rate of change of charge I want to charge inside the element was zero. So, if I took any element, any element that I called a lump circuit element, like a resistor or a voltage source, and I put a black box around it, then what I'm saying is that the net charge inside that is going to be zero. And this is not true in general. We will see examples where, if you choose some piece of an element for example, there might be charge buildup, but net inside the, if I put a box around the entire element, I am going to assume that the rate of change of charge is going to be zero. So, what this did was it enabled us to create the lump circuit abstraction, where I could take elements, some element of the sort, this could be a resistor, a voltage source, or whatever, and I could now ascribe a voltage, some voltage across an element, and also some current, "i," that was going into the element. And as I go forward, when I label the voltages and currents across and through elements, I'm going to be following a convention. OK, the convention is that I'm going to label, if I label V in the following manner, then I'm going to label "i" for that element as a current flowing into the positive terminal. It's just a convention. By doing this, it turns out that the power consumed by the element is "vi" is positive. OK, so by choosing I going in this way into the positive terminal, the power consumed by the element is going to be positive. OK, so in general of even simply following this convention, when I label voltages and currents, I'll be labeling the current into an element entering in through the plus terminal. Remember, of course, if the current is going this way, let's have one amp of current flowing this way, then when I compute the current, "i" will come out to be negative. OK, so by making these assumptions, the assumptions of the lumped matter discipline, I said I was able to simplify my life tremendously. And, in particular what it did was it allowed me to take Maxwell's equations, OK, and simplify them into a very simple algebraic form, which has both a voltage law and a current law that I call Kirchhoff's voltage law, and Kirchhoff's current law. KVL simply states that if I have some circuit, and if I measured the voltages in any loop in the circuit, so if I look at the voltages in any loop, then the voltages in the loop would sum to zero. OK, so I measure voltages in the loop, and they will sum to zero. Similarly, for the current, if I take a node of a circuit, if I build the circuit, a node is a point in the circuit where multiple edges connect. If I take a node, then the current coming into that node, the net current coming into a node is going to be zero. OK, so if I take any node of the circuit and sum up all the currents going into that node, they will all net sum to zero. So, notice what I've done is by this discipline, by this constraint I imposed on myself, I was able to make this incredible leap from Maxwell's equations to these really, really simple algebraic equations, KVL and KCL. And I promise you, going forward to the rest of 6.002, if this is all you know, you can pretty much solve any circuit using these two very simple relations. It's actually really, really simple. It's all very simple algebra, OK? So, just to show you an example, let me do a little demonstration. Let me build let me build a small circuit and measure some voltages for you, and show you that the voltages, indeed, add up to zero. So, here's my little circuit. So, I'm going to show you a simple circuit that looks like this, and let's go ahead and measure some voltages and currents. In terms of terminology to remember, this is called a loop. So if I start from the point C and I travel through the voltage source, come to the node A down through R1 and all the way down through R2 back to C, that's a loop. Similarly, this point A is a node where resistor R1 the voltage source V0, and R4 are connected. OK, just make sure your terminology is correct. So, what I'll do is I'll make some quick measurements for you, and show you that these KVL and KCL are indeed true. So, the circuits up there, could I have a volunteer? Any volunteer? All you have to do is write things on the board. Come on over. OK, so let me take some measurements, and why don't you write down what I measure on the board? What I'll do is, let me borrow another piece of chalk here. What I'll do is focus on this loop here, and focus on this node and make some measurements. All right, so you see the circuit up there. OK, so I get 3 volts for the voltage from C to A. so why don't you write down 3 volts? OK, so the next one is -1.6. And so that will be, I'm doing AB, V_AB. OK, and then let me do the last one. It is -1.37. The measurements, I guess, have been this way. So, what's written is V_AC. But it's OK for now. Don't worry about it. So, well, thank you. I appreciate your help here. OK, so within the bonds of experimental error, noticed that if I add up these three voltages, they nicely sum up to zero. OK, next let me focus on this node here. And at this node, let me go ahead and measure some currents. What I'll do now is change to an AC voltage so that I can go ahead and measure the current without breaking my circuit. OK, this time around, you'll get to see the measurements that I'm taking as well. So, what I have here, I guess you can see it this way. What I have here is three wires that I have pulled out from D. And this is the node D, OK? So, I have three wires coming into the node D just to make it a little bit easier for me to measure stuff. OK, so everybody keep your fingers crossed so I don't look like a fool here. I hope this works out. So, you roughly get, what's that, 10 mV. OK, so it's about 10 mV peak to peak out there, and let's say that if the waveform raises on the left-hand side, it's positive. So, it's positive 10 mV. And another positive 10 mV, so that's 20 mV. And this time, it's a negative, roughly 20, I guess, -20. So, I'm getting, in terms of currents, I have a -10, -10, I'm sorry, positive 10, positive 10, and a -20 that adds up to zero. But more interestingly, I can show you the same thing by holding this current measuring probe directly across the node. And, notice that the net current that is entering into this node here is zero. OK, so that should just show you that KCL does indeed hold in practice, and it is not just a figment of our imaginations. So, before I go on, I wanted to point one other thing out. Notice that I've written down two assumptions of the lumped matter discipline, OK? There is a total assumption of the lump matter discipline, and that assumption is, in spirit, at least, shared by the point mass simplification in physics as well. Can someone tell me what that assumption is? A total assumption, which I did not mention, which you can read in your notes in section 8.2 in the appendix, what's a total assumption that is shared in spirit with the point mass simplification? Anybody? A total assumption to be made here is that in all the signals that we will study in this course, we've made the assumption that the signal speeds of interest, transition speeds, and so on, are much slower than the speed of light. OK, that my signal transition speeds of interest are much slower than the speed of light. Remember, the laws of motion, the discrete laws of motion break down if your objects begin moving at the speed of light. OK, the same token here, our lump circuit abstraction breaks down if we approach the speed of light. And there are follow on courses that talk about waveguides and other distributed analysis techniques that deal with signals that travel close to speeds of light. OK, so with that, let me go on to talking about method one of circuit analysis. This is called the basic KVL KCL method. So just based on those two simple algebraic relations, I can analyze very interesting and complicated circuits. The method goes as follows. So, let's say our goal is, given a circuit like this, our goal is to solve it. OK, in this course, we will do two kinds of things: analysis and synthesis. Analysis says, given a circuit, OK, what can you tell me about the circuit? OK, so we'll solve existing circuits for all the voltages and currents, voltages across elements, and currents through those elements. Synthesis says, given a function, I may ask you to go and build circuits. OK, so for analysis here, we can apply this method that I want to show you. And the idea here is that, given a circuit like this, let us figure out all the voltages and currents that are a function of the way these elements are connected. So, the basic KVL and KCL method has the following steps. The first step is to write down the element VI relationships. OK, right down the element VI relationships for all the elements. The second step is write KCL for all the nodes, and the third step is to write KVL for all the loops in the circuit. That's it. Just go ahead and write down element rules, KVL, and KCL, and then go ahead and solve the circuit. So, what we'll do, we'll do an example, of course. But, just as a refresher, we've looked at a bunch of elements so far, and for the resistor, the element relation says that V is pi R, where R is the resistance of the element here. For a voltage source, V is equal to V nought. That's the element relationship. And for a current source, the element is the relation is, "i" is simply the current flowing through the element. OK, so these are some of the simple element rules for the devices that the current source, voltage source, and the resistor. So let's go ahead and solve this simple circuit. And what I'll do is go ahead and solve the circuit for you. OK, if you turn to page five of your notes, I'm going to go ahead and edit the circuit here. You can scribble the values on your notes on page five. OK, so as a first step of my KVL KCL method, I need to write down all my element VI relationships. So, before I do that, let me go ahead and label all the voltages and currents that are unknowns in the circuit. So, let me label the voltages and currents associated with the voltage source as here. Notice, I continue to follow this convention where whenever I label voltages and currents for an element, I will show the current going into the positive terminal of the element variable, OK, after element variable voltage. So here, I have V nought and I nought. Let me pause here for five seconds and show you a point of confusion that happens sometimes. Often times, people confuse between what is called the variable that is associated with the element versus the element value. OK, notice that here, capital V nought is the voltage that this voltage source provides, while this name here, v nought, is simply a variable that we've used to label the voltage across that element. So, similarly, I can label v1 as the voltage across the resistor, and i1 is the current flowing through the resistor. So this method of labeling, where I follow the convention, that the current flows into the positive terminal is called the associated variables discipline. I was trying to use the word discipline in situations where you have a choice, OK, and of a variety of possible choices, you pick one as the convention. OK, so here, as a convention, we use the associated variables discipline, and use that method to consistently label the unknown voltages and currents in our circuits. OK, so let me continue the labeling here, v4, i4, i3, v3 here, and v2 and i2, v5, and i5. I think that's it. So, I've gone ahead and labeled all my unknowns. So each of these voltages and currents are the voltages and currents associated with each of the elements. And my goal is to solve for these. OK, so in terms of our solution here, let's follow the method that I outlined for you. So, as the first step I am simply going to go ahead and write down all the element VI relationships. OK, so as a first step, I'm going to go ahead and write down all the VI relationships. So, can someone yell out for me the VI relationship for the voltage source? OK, good. So, v0 is capital V nought, that is that the variable V nought is simply equal to the voltage, v0. Similarly, I can write the others. v1 is i1, R1. v2 is i2, R2, and so on. OK, and I have one, two, three, four, five, six elements. So, I will get six such equations. Step two, I'm going to go ahead and write KCL for the nodes in my system. So, let me start with node A. So, for node A, let me take as positive the currents going out of the node. So, I get i nought flowing out, plus i1 flowing out, plus i4 flowing out, and they must sum to zero for node A. Then, I can go ahead and do the other nodes, let's say, for example, I do node B. For node B, I have i2 going out. That's positive, i3, and i1 is coming in, so I get -i1 equals zero. OK, so I have one, two, three, four, I have four nodes. OK, so I would get four equations. It turns out that the fourth equation is not independent. You can derive it from the others. So, I get three independent equations out of this. I can then write KVL. And for KVL, I just go down my loops here. And let me go through this first loop here in this manner. OK, and a simple trick that I use, you have to be incredibly careful when you go through this in keeping your minuses and pluses correct. Otherwise you can get hopelessly muddled. Once you label it, you need to be sure that you get all your minuses and pluses correct. So, for KVL, what I'd like to do is, let's say I start at C, and from C I'm going to go to A. For A I go to B, and from B I'm going to come back to C. OK, that's how I traverse my loop. And, the trick that I'm going to follow is, as my finger walks through that loop, I'm going to label the voltage as the first sign that I see for that voltage. OK, so I'm going to start with C, and I go up. I start by punching into the voltage source element, and then punch into it, I hit the minus sign for the V nought. OK, so I'm just going to write down minus V nought, plus then I go through and as I come up to A and go down to B, I punch to the plus sign of the V1. So, that's plus V1. And then I punch into the plus sign of the V2, and so I get plus V2, and that is zero. OK, good. So, that matches what you have in your notes as well. So, this is the first equation. Similarly, I can go through my other loops and write down equations for each of the loops. OK, and the convention that I like to follow is as I go through the loop, I write down as a sign for the voltage the first sign that I counter for that element. OK, you can do the exact opposite, if you want, just to be different. But, as long as you stay consistent, you'll be OK. All right, so in the same manner here, there are four loops that I can have, so four equations. Again, one of them turns out to be dependent on the others. So I end up getting three independent equations. So, I get a total of 12 equations. I get 12 equations. There are six elements, OK, voltage source, and five resistors. So, there are six unknown voltages, and six unknown currents. So, I have 12 equations, and 12 unknowns. OK, I can take all of the equations and put them through a big crank, and sit there and grind. And if I was really cruel, I'd give this as a homework problem, and have you grind, and grind, and grind until you get your six voltages and six currents. OK, it works. OK, so you get 12 equations, and this method just works. However, notice that this is quite a grubby method. It's quite grungy. I get 12 equations, and it's quite a pain even for a simple circuit like this. However, suffice it to say that this fundamental method is one step away from Maxwell's equations, simply works. OK? So what you'll do is the rest of this lecture, I'll introduce you to a couple more methods. One is an intuitive method, and another one called the node method is a little bit more formal, but is much more, I guess, terse Than the KVL KCL method. Method 2. So the relevant section to read in the course notes is section 2.4. One of the things that I will be stressing this semester is intuition. What you'll find is that as you become EECS majors, and so on, and go on, or if you talk to your TAs or your professors and so on, you will find that very rarely do they actually go ahead and apply the formal methods of analysis. OK, by and large, engineers are able to look at a circuit and simply by observation write down an answer. And usually in the past, what we have tried to do is kind of ignore that process and told our students, look, we teach you all the formal methods, and you will develop your own intuition and be able to do it. What we'll try to do this term is try to stress the intuitive methods, and try to show you how the intuitive process goes, so you can very quickly solve many of these circuits simply by inspection. OK, so this method that I'm going to show you here is one such an intuitive method. And I'll call it element combination tools. OK, for many simple circuits, you can solve them very quickly by applying this method. The components of this method are these. I learned about how to compose a bunch of elements. So, let's say, for example, I have a set of resistors, R1 through RN, in series. OK, you can use KVL and KCL to show that this is equivalent to a single resistor whose value is given by the sum of the resistances. OK, so if I have resistors in series, then effectively it's the same as if there was a single resistor whose value is the sum of all the resistances. OK, you can look at the course notes for a proof for derivation of this fact. Similarly, if I have resistances in parallel, so let me call them conductances. A conductance is the reciprocal of a resistance. If resistance is measured in ohms, conductance is measured in mhos, M-H-O-S. OK, so that's the conductance is G1, G2, and G3. And effectively, this is the same as having a single conductance whose effective value is given by the sum of the conductances. OK, the conductances in parallel add, and resistances in series add. Similarly, for voltage sources, if I have voltage sources in series, then they are tantamount to the sum of the voltages. And similarly, for currents, if I have currents in parallel, then they can be viewed as a single current source, whose currents are the sum of the individual parallel currents. So, let's do a quick example. So let's do this example. So, let's say I have a circuit that looks like this, and three resistances. And let's say all I care about is the current, I, that flows through this wire. All I care about is that current. Of course, you can go ahead and write KVL and KCL. You will get four equations, and there are four unknowns. And you can solve it. But, I can apply my element combination rules, and very quickly figure out what the current I is, using the following technique. So, what I can do is, I can, first of all, take this circuit. And, I can compose these two resistances and show that the circuit is equivalent as far as this current, I, is concerned to the following circuit, R1. And I take the sum of the two conductances, OK, and that comes out to be R1, R2, R3, R2 plus R3. And then, I can further simplify it, and I get a single resistance, whose value is given by R1 plus R2, R3, R3. OK, I'm just simplifying the circuit. Now, from this circuit, I can get the answer that I need. I is simply the voltage, V, divided by R1 plus. OK, so in situations like this where I'm looking for a single current, I can very quickly get to the answer by applying some of these element combination rules. And, I can get rid of having to go through formal steps. So, in general, whenever you encounter a circuit, by and large attempt to use intuitive methods to solve it. And go to a formal method only if some intuitive method fails. Even in your homework, by and large, the homeworks are not meant to be grungy. OK, if you find a lot of grunge in your homework, just remember you're probably not using some intuitive method. OK, so just be cautious. All right, so let me go on to the third method of circuit analysis, and the third method is called the node method. So, the node method is simply a specific application of the KVL KCL method and results in a much, much more compact form of the final equations. If there's one method that you have to remember for life, then I would say just remember this method. OK, the node method is a workhorse of the easiest industry. OK, if there's one method that you want to consistently apply, then this is the one to remember. So, let me quickly outline for you to method, and then work out an example for you. The first step of the node method will be to select a reference or a ground node. This is the symbol for a ground node. The ground node simply says that I'm going to denote voltages at that point to be zero, and measure all my other voltages with reference to that point. So, I'm going to select a ground node in my circuit. Second, I want to label the remaining voltages with respect to the ground node. So, label voltages for all the other nodes with respect to the ground node. Next, write KCL for each of the nodes write KCL. OK, but don't write KCL for the ground node. Remember, if you have N nodes, the node equations will give you N-1 independent equations. So, write KCL for the nodes, but don't do so for the ground node. Then, solve for the node voltages. So, let's say when we label voltages. I want to be labeling them as E something or the other. So, solve for the unknown node voltages. And then, once I know all the voltages associated with the nodes, I can then back solve for all the branch voltages and currents. OK, once I know all the node voltages, I can then go ahead and figure out all the branch voltages and the branch currents. So, let's go ahead and apply this method, and work out an example. Again, remember, if there's one method that you should remember, it's the node method. OK, and when in doubt, consistently apply the node method and it will work whether your circuit is linear or nonlinear, if the resistors are built in the US or the USSR it doesn't matter. OK, the node method will simply work, linear or nonlinear, OK? So, what I'm going to do is I'm going to build a circuit that's my old faithful. It's our old faithful, plus I'll make it a little bit more complicated by adding in the current source. So, let's go have some fun. Let's do this. So here's my voltage source, as before. OK, what I'll do is for fun, add a current source out there. And, you can convince yourselves that if you go ahead and apply the KVL KCL method, it'll really be a mess of equations. OK, so R1, R3, R4, R2, R5. OK, so let's follow our method and just plug and chug here. So let's apply the first step. I select a ground node. It's a reference node from which I'll measure all my other voltages. OK, now without knowing anything about the node method, try to use intuition as to which node you should choose as a ground node. Remember, you want to label the ground node with the voltage zero, and measure all the other voltages with respect to that node. OK, a usual trick is to pick a node which has the largest number of elements connected to it as the ground node. OK, and in particular, you will find out later it's useful to pick a node in which all your voltage sources, the maximum number of your voltage sources are also connected. OK, so in this instance, I'm going to choose this as my ground node. OK, that's my first step. I chose that as my ground node. And I'm going to label that as having a voltage zero. Second step, I'll label voltages of the other branches with respect to the ground node. OK, so what I'll do is add this node here. So I'm going to label that voltage E1. These are my unknowns. Remember, node method, because my node voltages are my unknowns. So, I label this as E1. I label this one as my unknown voltage, E2. What about this one here? Is that voltage unknown? No. I know what the voltage is because I know that this node is at a voltage, V0, higher than the ground node. OK, notice that to go from here to here, I directly go through a voltage source. And so, this node has voltage V0. And I'll simply write down V0. OK, try to simplify the number of steps that you have to go through, so directly go ahead and write down the voltage, V0, for that node. What I will also do, is for convenience, I'm going to write down, I'm going to use conductances. So I'm going to use GI in the place of one by RI, and write down a bunch of node equations. OK, so step one, I've chosen my ground node. Step two, I've labeled my node voltages, E, OK? I've done that with two of my steps. Now, let me go ahead and -- OK, so let me go ahead and apply step three. And, step three says go ahead and apply KCL for each of the nodes at which you have an unknown node voltage. And then that will give you your equations. So let me start by applying KCL at E1. So, let me write KCL at E1. I do one more thing. Notice, I don't have any currents there. OK, so how do I write KCL? KCL simply says the sum of currents into a node is zero again, remember, by the lump matter discipline. So, if I don't have currents in there, so the trick that I adopt is that to write KCL, I use the node voltages, and implicitly substitute for the node voltages, divide by the elemental the resistance, for instance, so I take the node voltages, and divide by the resistance, get the current. OK, so I implicitly apply element relationships to get the node currents. So, the example that make it clear, so I take node E1 and, again, for currents going out I'm going to assume to have, to be positive. So, the current going up is E1 minus V nought, divide by R1, so I multiplied by the G1. That's the current going up. Plus, the current going down is E1 minus zero where the ground node potential is zero, G2, OK, plus the current that is going to resistor R3, which is simply E1 minus E2, divide by R3. So, E1 minus E2, divide by R3, or multiplied by G3 is equal to zero. OK, see how I got this? This is simply KCL, but to get my currents, I simply take the differences of voltages across elements, and divide by the element of resistance, and I get the currents. OK, so I can similarly write KCL at E2. So, at KCL at E2, again, let me go outwards. So, the current going up is E2 minus V nought multiplied by G4. The current going left is E2 minus E1 divided by R3 or multiplied by G3. The current going down is E2 minus zero multiplied by G5. And, the current going down is -I1. OK, you've got to be careful with your polarities here. So all the currents going out sum to zero. And here are the currents that are going out at this point. So what I do next is I can move the constant terms to the left-hand side and collect my unknowns. So, let me write them out here. So, let's say I get E1 here, OK, and from this equation, I have a V nought, G1, which comes out here. So, minus V nought G1 comes over to the other side. And, let me collect all the values that multiply E1. So I get, G1 is one example. I have G2, and I have G3. And then, for E2, I have minus G3. OK, so I'll simply express this as the element voltages multiplied by some terms in parentheses, and I put my external sources on the right hand side. Similarly, I go ahead and do the same thing here. In this instance, let me move my sources to the right. So, I get I1 coming out there, and I get V nought G4 coming out there. By the way, I just want to mention to you that if you're looking to fall asleep, this is a good time to do so because as soon as I write down these two equations, OK, from now on it's nap time. There's nothing new that you're going to learn from here on. It's just Anant Agarwal having fun at the blackboard, pushing symbols around. So, once you write down these two node equations, the rest of it is just grubby math. So, let me just have some fun. So let me just go ahead and do that. So, I moved my voltages and currents to the other side. And let me collect all the coefficients for E1 here. So, E1 minus G3, and that's it, I guess. OK, and then I'll do the same for E2. So, I get G4, and I get G3, and I get G5. OK, so notice here that I have two equations, and two unknowns. OK, the two equations are on the right hand side, I have some voltages and currents which are my dry voltages and dry currents. OK, so actually this is getting quite boring. I'm going to pause here, and talk about something else. So, you can take this and you can put it in matrix form, so I've done that for you on page ten. It's all matrix form. Yeah, I know that. You can use any technique to solve it, use algebraic techniques, use linear algebraic methods to solve it, use a computer, whatever you want. And, computers, when computers analyze circuits, they write down these equations, and deal with solving matrices. So, when you take the linear algebra across, how many people here have taken a linear algebra class? How many people here have heard of Gaussian elimination? How can more people have heard of Gaussian elimination than took a linear algebra class? Well anyway, so now you know why you took those linear algebra classes. And so, if I just collected these into matrix form -- OK, so I just simply expressed those two equations in linear algebraic form, and here's my column vector of unknowns, and you can apply any of the techniques you've learned in linear algebra to solve for this. Gaussian elimination works. OK, and in computer, people doing research in computer techniques, or solving such equations simply deals with huge equations like this, building computer programs that, given equations like this, can go ahead and solve them. OK, so let me stop here and reemphasize that what you've done is made a huge leap from Maxwell's equations to using the lump matter discipline to KVL and KCL, which ended up giving a simple algebraic equation to solve, and not having to worry about partial differential equations that were the form of Maxwell's equations. MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Please use the following citation format: Anant Agarwal, 6.002 Circuits and Electronics, Spring 2007 (Massachusetts Institute of Technology: MIT OpenCourseWare). http://ocw.mit.edu (accessed MM DD, YYYY). License: Creative Commons Attribution-Noncommercial-Share Alike. Note: Please use the actual date you accessed this material in your citation. For more information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Transcript – Lecture 3 Let's get started. Can you hear me back there? Loud and clear. OK. Let's get started. Before I begin, just a couple of announcements. Brad Buren is one of our students here and he needs a note-taker. It's a paid position. So if you are interested you can stop by after class and see him. He's sitting right here out there, OK? Second, just a reminder that 6.002 does have prerequisites. And the prerequisites are 8.02 and 18.03. So with that let me start off with the usual. Do a quick review of what we've done so far. So we started out life looking at the laws of physics and Maxwell's equations and so on. And those were way too hard so we said let's make life easy for ourselves. So we chose to play in this playground in which we said we shall adhere to the lumped matter discipline. OK? The LMD. So we are in that playground. So this entire course, and for that matter large parts of EECS are within that playground, within which the lumped matter discipline applies. So as soon as we jumped into the playground, the LMD playground, we could take Maxwell's equations and abstract them out into two very, very simple rules. And the very simple rules were KVL and KCL. KVL simply said that I can sum the voltages in any loop in a circuit and the result then would be zero. Similarly, I can sum the currents that enter or exit any node and the sum will also be zero. So what you can now do is, if you feel like, you can go around and brag. Oh, yeah, we use Maxwell's equations in everyday life and, yeah, it's good stuff. And the key is that this is really an encapsulation of Maxwell's equations within this playground that we are in. So I talked about the first method of circuit analysis in the last lecture. And that method simply took the, wrote KVL for all the loops, wrote KCL for all the nodes and wrote element vi relationships. And together gave you a big bunch of equations. And you sat down and grunged through the equations and you solved for branch voltages and currents. So we reviewed a second method of circuit analysis. And I'll simply call it circuit composition. The basic idea behind this method was to learn some simple rules of how resistors add and conductances add and so on and so forth and look at a circuit and simplify the circuit by making series simplifications when the resistors are in series and so on and so forth, and compose it and play around with it till we end up with the current, the voltages that we are looking for. This is the intuitive method. And so a section in Chapter 2, I believe, of the course notes discusses several examples using this method and attempts to make a little bit formal the intuitive approach that is applied in this method. So we then looked at the node method. And the node method was simply a particular way of applying KVL and KCL. Node method, remember? We took a ground node. Then we labeled the nodes of the remaining voltages with respect to that ground. Then we wrote KCL for each of the nodes. And when we wrote KCL for each of the nodes, remember, KVL was implicit in this expression that we used for each of the currents that were exiting each node. So if Ej was a node voltage, then Ej minus Ei multiplied by the conductance Gi was the current that was going through one of those, I should call it Gij. This is a conductance that connects nodes i and j. That gave us the KVL that fed into the same system. So these are three methods. The node method, by the way, is sort of the workhorse of the 6.002 industry. And for that matter for all of the circuits industry. When in doubt, apply the mode method, you'll be OK. That applies to linear circuits, nonlinear circuits, what have you. What I'm going to do today is go through two more methods. So notice that the first few lectures of this course, the first three lectures simply comprise transitioning you from the world of physics to the world of EECS. And then two lectures on giving you a bag of tricks. So we start you off with the sort of tools, your mallets and chisels and so on and so forth. And these five methods are your tools. We'll look at two methods today. One method is called the method of superposition and the second method is called the Thevenin method. And these methods apply only to linear circuits. So we look at the subset of circuits that are linear, and these two methods apply to only those circuits. These are methods that combined with intuition really enables you to solve very interesting circuits very, very quickly. So let me do an example using a usual node method. And then jump into introducing the superposition methods and Thevenin methods using that same example. So let me draw you an example circuit here. So, again, I'm using this example, I will use this example to introduce the method of superposition and the Thevenin method. So what I'm going to do is start off the usual way and analyze the circuit using a method that you know now, the node method. And what I'll do is write down the node equations for this by applying the node method. So if you recall the node method. I choose a ground node. I'm going to choose this node. It's got both the voltage source connected to it, and it's also got many other edges impinging on it. So I'm going to choose that as my ground node and I'm going to label the other nodes with their voltages. So this is an unknown. I'll label it as e. I guess we just have one unknown e. And I know the voltage of this node, and that is simply V. Since it's V, there's a voltage source between the ground node and that node. So what I can do next is that I can write down the node equation for this node and then go from there. So let me go ahead and do that. So let me sum up the currents going outside, going outwards. So I have e minus v divide by R1, I have e minus zero divide by R2, and I have minus i equals zero. This is a node equation. The first thing I want you to observe is that this equation is linear in V and i. What I mean by linear is that you don't see terms like Vi or V-squared and things like that. It's some constant times V plus some constant times i equals some other constant. So that's quite nice. So I'm going to rearrange the terms in the following manner. I'll move the known sources to the right-hand side and collect the coefficients of e on this side, so I get one by R1 plus one by R2 over here. So stare at this for a moment and notice again here I have e, my unknown node voltage, there is some constant multiplier, and that equals some function of V summed up with some function of i. And, again, notice that this is a linear combination of V and i. No multiplication terms and so on and so forth. This is a pretty standard form in which we will represent equations quite often. And just to label it, this is often labeled G as the conductance matrix. Of course this is e, our unknown node voltages, and this is a linear sum of sources. So this is a very standard way that we will represent equations. We did that last week as well, or rather on Tuesday where I took a conductance matrix, multiplied that by a column vector of unknown node voltages and equated that to some linear combination of my source voltages. The reason the circuit is linear is that I have only linear elements in the circuit. I don't have any nonlinear elements. And because of that I can rewrite this in the following manner. I'm just going to express e as a function of V and i and bring it over to this side. So it's some function of i. So I get R1 R2 divide by R1 plus R2. And I bring R1 R2 to this side. That's what I get. So stare at this for a few seconds, very common form. My unknown node voltage is equal to this stuff on the right-hand side. The stuff on the right-hand side has a term multiplying the source voltage V and some other term multiplying the current I. And if I were to put this in sort of symbol-like form my unknown node voltage is some constant times V1 plus some constant times, is of the form constant times the source current, constant times the source voltage and so on. The units of As and Vs are different because in this case A has no units because V is a voltage. And so is e. In this case V has units of resistance. So that V times i gives me a voltage. So stare at this equation for a few seconds and this should help us build up some insight that will allow us to write down the answer almost by inspection. I'm going to show you a method now, in a few minutes, which will allow you to write down the answer e just by starring at the circuit without having to go through node equations and so on. The more and more methods I teach you, the more you will be able to do a lot of this completely by yourselves. In this particular example it's a relatively simple circuit but these methods would be particularly useful when you have more complicated situations. But before I go on let me spend a few minutes pontificating on linearity. So that's a linear circuit. And this equation gives me the unknown node voltage e as a linear sum of source voltages and source currents. Linearity implies two properties, the property of homogeneity and also gives vice to the property of superposition. Let's do homogeneity first. What this says is if I have a circuit, some circuit and I feed it some sort of inputs, A, then let's say my output is S. If you're feeling hungry think of these as apples and the circuit converts them into applesauce. So what homogeneity says is that what I can do is if I take each of my apples and instead of feeding it an entire apple what if I give it three-quarters of an apple? Say I multiple all my inputs by some constant alpha, three-quarters. What that says is that at the output instead of getting one full bottle of applesauce I'm going to get three-quarters of a bottle of apple sauce. So if I proportionately reduce all the inputs and if this is a linear circuit then so shall my output be reduced in the same proportion. So that's homogeneity. Next, let's look at superposition. The property of superposition says the following. The same kind of circuit. If I feed it apples then I get applesauce. I take the same circuit, and this time around if I feed the circuit a different set of inputs, say blueberries. And let's say my output, oops, let me do it this way. So as my output I get blueberry sauce, if such exists. So apples applesauce, blueberries give me blueberry sauce. Then what I'm going to get if I mix up the two, so let's say I take my circuit, the same circuit with a set of inputs and in this example one output. Let's say I mix up my inputs and some of my inputs in the following way, here I feed an A1 plus B1 and here A2 plus B2 and so on then at the output I am going to get a mush of apple sauce and blueberry sauce. All this says is that if I apply just apples I get applesauce. If I apply just blueberries I get blueberry sauce. Then if I were to figure out how this blender would have worked had I fed in the combinations of apples and blueberries, then for the purposes of understanding that blender all I could have done was taken by two outputs and just mixed them up together myself and that's exactly what I'd get. So if I sum up the inputs my outputs would also be the sum of the outputs with the inputs applied by themselves. So let me take this here and munge around with hit for a few seconds and get something interesting out of it. So notice two inputs, two inputs, outputs. In your notes I've given you another template for the next set of scribbles I'm going to make here. So use the next set of templates on page three. What I'm going to do here is something very simple, set one output to zero and feed a voltage V1. So that's feed a voltage V1 and set the other output to zero. And let's say I get Y1 as an output. And in this case I set the first voltage to zero and feed a different voltage V2 on the second input. And let's say my output is Y2. This is just a particular application of the superposition principle I just outlined. Apply V1 set one output to zero. Apply V2 set the original output to zero. Then what I'm going to find is that the answer will simply look like this, just replace for As and Bs what I just did and we get V1 and zero here and we get zero and V2 here. And as my output I'm going to get exactly the sum Y1 plus Y2. This is simply a particular application of superposition where what I'm saying is the following. If you look at this circuit here effectively what have I done? Effectively what I've done is apply the voltage V1 on one input and a voltage V2 on the other input. V1 here. V2 here. And the output is Y1 plus Y2. What I'm saying is look backwards now. What I'm saying is that the whole components of the output Y1 plus Y2 could individually be derived in the following manner. I could get the component Y1 by simply applying one of the voltages and setting the other to zero. I can get the other component Y2 by setting yet another input to zero and applying the voltage V2 to get Y2. And sum then up and that's my answer. This will become a lot clearer with an example. Again, remember if I have a bunch of inputs applied to a circuit, V1, V2 and so on, and I get some output then what this is saying is that I can alternatively find out the answer by applying just one voltage, setting all the others to zero, measuring the output, apply a second voltage, set all inputs to zero, measure the output and sum of applesauce and blueberry sauce and there you get the answer. Let's do an example. And before we go into that I talked about setting voltage sources and current sources to zero. First of all, what does it mean to set a voltage source to zero? This is the same as this. Setting a voltage source to zero is simply replacing the voltage source with a short, and setting a current source to zero simply implies an open circuit. So when I say zero that source, if it's a voltage source short it, if it's a current source open it. I can take any two nodes in the world and measure the potential difference across them. So there may be some potential difference across these set by the circuit that I haven't shown you on this side. There might be some other circuit that is controlling the voltage of these two nodes. The same with the short. What's V going to be? But there is a V. It's zero. So that's method four, method of superposition. And this method says that the output of a circuit -- Again, remember I'm focusing on linear circuits. Remember, I have this playground where LMD applies. And within that playground I'm playing in the south goal area. In the south goal area, in that subset of the playground circuits are linear. So in that part of the playground superposition applies because there circuits are linear. So the output of a circuit is determined by summing up the responses to each source acting alone. Now, in this statement here this source stands for independent source. I haven't talked about independent versus dependent sources. We'll talk about dependent sources a few weeks from today. And just so you don't get confused, for dependent sources you will be looking at Section 3.3.3 of your course notes to see how superposition works with dependent sources. But remember we haven't covered dependent sources yet. We will be covering them about two weeks from now. So let's go back to our example and apply the method of superposition to an example. So the method says sum up the outputs of each of the sub-circuits where I'm applying one source acting alone. So let me just do this here. Let me start with the circuit. And let me start with shutting I off. So I have voltage V -- I have R2. And I'm shutting I off. So I have replaced this with an open circuit. So I is zero. Let me call the node voltage eV to reflect that component of the node voltage that arises due to V acting alone. And you should look at this pattern here and very quickly be able to write the answer for patterns like this voltage, the two resistors. That's called a resistive divider. It will appear again and again and again. And eV is simply V times R2 divided by R1 plus R2. That's still my ground node. So the voltage here is simply this voltage divided by the two resistors to give you the current multiplied by R2 to give you the voltage across this R. Remember this pattern. You apply voltage divider patterns probably more times than any other pattern that you might imagine. So that's with the V acting alone. Now, let me do I acting alone. So for I acting alone -- And what I do this time around is replace this with a short, replace the voltage source to the short. And let me call this voltage eI for the component of the voltage due to the current I. And eI, in this case, is simply given by yet another pattern here, the current across a pair or resistors is simply the effective resistance multiplied by the current so it's i and the effective resistance is R1, R2 or R1 plus R2. That's eI. That's a component that node due to the current I. Now, so the method says that. Then take these components, sum them up and there you have the answer. So E is simply ev plus ei. The components of V and I acting alone, just simply V times R2 divided by R1 plus R2 plus R1, R2. There we go. Fortunately, the fates have been kind to us and the answer is the same as the answer we obtained with the node method. No surprise here. So this is actually an incredibly simple method. So you can take a very complex circuit. What have you really done here? You can take a very complex circuit and you can solve a very complex circuit by breaking it down into many simple individual sub problems. You will do this in EECS time and time and time again. Whether it's in software systems or hardware systems or what have you, you're often times building complicated systems. Remember doom on this side? And the way and when you put these things together, let's say a large software system, is you don't write the whole piece of software starting main and grunge down. You build a lot of little components and tie the components together. In the same manner here you take a big circuit and you find its behavior for each source acting alone. Lots of little inky dinky simple little circuits. And you will see examples in your homework where you're given a big circuit or because it set all the Is to zero and the other Vs to zero the whole circuit almost vanishes and all that you're left with is a little resistor or two. So this is the very, very powerful method. I'd like to do a little demonstration for you. And what I'm going to show you is the demo is a vat of water. Actually, I'll tell you what it is in a second. But assume it is salt water for now. I'll apply two voltages. In this case I'm going to apply a sinusoid. That's not very good. A sinusoid and a triangular wave. And what I'm going to do is measure the response at this site. Now, this is a vat of salt water. And I'm going to tell you it behaves like a linear system. If you view each little particle, or each little cubic-centimeter or whatever of water, it'll behave like little resistor. So this vat of salt water behaves like big distributed resistor in the following manner. And so on. This of this big mesh of little resistors, but it's all resistors. It's a linear circuit. So I'm going to apply two voltages, a triangular and a sinusoid, and we're going to observe the output. And what do you expect to see there? You will see the superposition of the two, which is you'll see a sinusoid. And then you'll see the jagged triangular thing articulating the sinusoid pattern. What I'm going to do right now, don't put any water yet. This is the vat of nothing right now. It's all empty. Can we show the screen on this side? The oscilloscope screen? OK. Oh, there you go. So this is the screen of the oscilloscope now. Notice that I have a sinusoid and I have a triangular wave and the output is zero. And the reason is there is nothing in this vat. It's empty. So previously when I taught this course I would get saltwater and pour saltwater. Then we discovered a much better source of water that conducted electricity like one real mean fluid. Cambridge water. It just works very pleasantly. It just conducts electricity like nothing at all. And I've been thinking of using Charles River water next time and see what happens, although there we'd probably get some biological organisms doing strange things at you. But go ahead. Our friendly demonstration expert, Lorenzo, will pour some water into the vat. And you should begin seeing the output being a superposition of the two. So as he pours, there you go, do you see that? So you do see the sinusoidal articulation and the jagged wave form. And just to have some more fun, what I can do is increase one of the voltages. And you'll see -- Now you know what would have happened if I had used Charles River water. So my output keeps increasing as I increase the corresponding wave form. I could do this, this is fun. So let me pause there and go onto the next topic. So that little demonstration showed you that even something as simple as this physical entity vat of water behaves like a linear system, and we can model that linear system as a set of resistors. Unbeknownst to you, right now, in the past ten seconds I introduced a new concept. It's called subliminal advertising. So one of the things we do in EE a lot is model real systems. So often times if I wanted to look at the behavior of salt, behavior of a vat of water, I can model it as a set of resistors for certain kinds of activities. Just hold that thought for some time later in your careers. All right. That's method four, the superposition method. Remember, it is methods like this that will make your life really, really, really easy. If you find that you are having to do a lot of grunging homework or something, just step back and think superposition, think Thevenin or think composition rule. There must be a simpler way usually. Let's do the next method. This is called the Thevenin method. To derive this method let me start by applying superposition to some circuit. So let's say I have some arbitrary network N. Assume it's a linear network and the network has a whole bunch of goodies in it. It has a bunch of resistors, it has a bunch of voltage sources, and it has a bunch of current sources. Many current sources. Many voltage sources. Many resistors. Some jumbled voltage sources, current sources and resistors. And I look at two nodes in this network. Here are two nodes in the network, two points in the network were elements connect. I'm looking at those two nodes and all I want to do is the following. I want to figure out if I take a rinky-dinky little current source and apply it there, all I want to figure out is what is V and what is I. There is this mongo box out here, a black box of resistors, voltage source and current sources, too many to count. I pick two nodes, apply a current source, and all I care about is what is the voltage that I will measure by applying it here. Notice the current here will be I because the current here is I. And I apply it here. I want to measure what the voltage is. Now, with the insight you've obtained from superposition, you should be able to jump up and state the form of the answer. So by superposition we know the following. We know that the effect of the circuit will be the same as the sum of components being added up. Sum of component, sum of component, a bunch of components added up. Each component will be the response of one source acting alone. So if I can figure out the effect of one source acting alone and put that down here, and do the same thing for all the sources, that's what I will get. So for the source Vm it's a linear circuit. So I know that my answer is going to be, in the final answer is going to be a Vm term and it's going to be multiplied by some alpha M term. I know that. It's a linear circuit so I know that the answer shall have a term Vm multiplied by some constant. Simple, I know that. Similarly, the same is true for, oh, this is the term Vm. And what I can do is I can measure just this effect by setting all the other sources to zero. So I can set all the other current sources to zero and all voltage sources, except for this one, and I can get that answer. So, similarly, for every voltage source I am going to get a term. So for every single voltage source, M1, M2, M3 and so on I'm going to get such a term and they're all going to sum up. Similarly, I'm going to get a term for In. And I know there will be an In term, and I know it's going to be some constant beta multiplying In. In this example of ours here, in this example, remember alpha was this and beta was this constant here. There's some constant beta, some constant alpha. And because I have a whole bunch of current sources there's going to be such a term for each one of them. And each one of these terms, Vm, In will be the voltage I would see here if I set all the other Vms to zero and I set all the other current sources, except for that one to zero. What am I missing? Is that it? The response here, V here. Am I missing anything here? Is that it? Now, don't all yell at once. What am I missing? Current source i, exactly. So if I have a current source i then there's an effect of this current as well. And so I write down i there, too. It's going to be some constant multiplying I. And that constant is going to look like a resistor, right, because this circuit contains current sources, voltage sources and resistors. If I've shorted all my voltage sources and opened all my current sources, what's left in here? Just a whole caboodle full of Rs. It's just going to look like some resistance R. And that's what I get here. So this is what V is going to look like and that's a form. So let's take a look at these components. Let's focus on the easy part first. What does this look like? This component looks like an I, it looks like a current and has some resistance. What is that resistance given by? Supposing I gave you this network and this currency source and I asked you tell me R. How would you measure R? What you would do is open all the current sources, short all the voltage sources, put a ohmmeter in there and measure the resistance R. That's R. OK, so we understand this term. What about this term here? Can someone tell me the units of this term here, this big thing here? Voltage. This is a voltage. This is a voltage. iR is a voltage. So this does behave like a voltage. And it behaves like some voltage V. So notice that as far as this current I is concerned the rest of the universe looks like a resistor and a voltage source behaving in some manner. And let me just call it Vth for now, and you'll know why in a second. The voltage has a form, some voltage plus Ri. So, in other words, as far as this I is concerned this whole network here N full of all the nice stuff is indistinguishable to this I here. So my I is sitting out there injecting a current into two nodes. If I am i, I'm looking at this, this network looks no different than a voltage source in series with the resistor R. Notice that the equation for this simple circuit is this, so I is given by V minus Vth divided by R. Just remember. It's a circuit. In other words, Agarwal sitting here cannot tell the difference if I'm measuring the voltage here between a circuit that looks like a Vth in series to the resistor or this huge mess of voltage sources and current sources and so on. Now, we will talk about Vth and R. R is called the resistance of the network as seen from the port with all the sources shut off. And similarly Vth, what is Vth? Vth is the open circuit voltage. In other words, if I apply the voltage here this is the response of all the current sources and all the voltage sources acting together. So it's as if I took this out and simply measured my V here as if I didn't exist, correct? Because this is the component of i. So if I opened i and measured V, I would get that big term on the left-hand side. That's my Vth. So that inspires the next method called the Thevenin method. In this method what I'm going to do is take some circuit, I'm on Page 9, with a mess of stuff. It's a big mess of stuff. And if I care to look at its impact on something else that I add from the outside then as far as the outside world is concerned this is indistinguishable from a circuit that looks like this. So what I can do is if I want to figure out what's happening here then, for the purpose of my analysis, this simple network here with R and Vth becomes a surrogate for this entire mess. So for the purpose of finding out the behavior at this point, I can take this huge mess and replace it with its Thevenin surrogate or Thevenin equivalent. This is called the Thevenin equivalent of this big network. Let me do an example that will make the method completely clear. Again, remember in EECS, most of our lives are about how can we make things so simple as being able to be analyzed by inspection? And so this is a method that takes you further down that path. So let me use the same circuit that I've been using before, my voltage V, R1, R2. This is an R. I'm 55 minutes fast so we have another three or four minutes. So this is my circuit. And let's say all I care about is finding out i1. That's all I care about. And what I'm going to do is I'm going to box this up and see if I can replace that with its Thevenin equivalent. So I'm going to box that up. What I'm saying is that I'm going to box it up and replace it with this Thevenin equivalent. I don't know what Vth and R are at this point. I'm just calling it Rth for fun. I don't know what these two values are, but if I knew what these two values were I can determine I really trivially as follows. I can get i1 as simply V minus Vth divided by R1 plus Rth. So if I knew Vth and Rth, I can write down i1 by inspection in that manner. So next, finally, how do I get Vth and Rth? You get Rth by looking at this network and shutting off all the voltage sources and measuring the resistance there. So I short my voltage source, that's R1. Oops, wrong way. I need to look this way. So looking this way, that's what I get. So what's Rth? Rth is simply R2. So I have opened my current source. Similarly, for Vth, remember all I want to do is look at the two nodes, step back, put a voltmeter there, measure the voltage, that's my open circuit voltage. So the way I do it is I take the circuit and simply measure the voltage there. That's R2. That's my current capital I. And I simply want to measure the open circuit voltage here, which is what? Just simply if I stand back and I kind of gingerly measure the voltage here without disturbing anything, I simply get IR2. So Vth is IR2 and Rth is R2 and here is the formula for the current in this branch when I apply a voltage source and a resistor R1 to this little circuit here. OK, let's pause and let me summarize this in about ten seconds. I had this circuit here. I wanted to find out i1. So what I said I'd do is take this complicated mess, well, it's not a complicated mess but assume it is, and replace with it a resistance Rth got by turning off all the sources. And the voltage in series, Vth, which I get simply by pulling this thing out, taking my input, this part out and simply measuring the open circuit voltage out there, Vth. And then I replaced the whole network with this new network that they call the Thevenin network, and voila, I get the answer in a second. MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Please use the following citation format: Anant Agarwal, 6.002 Circuits and Electronics, Spring 2007 (Massachusetts Institute of Technology: MIT OpenCourseWare). http://ocw.mit.edu (accessed MM DD, YYYY). License: Creative Commons Attribution-Noncommercial-Share Alike. Note: Please use the actual date you accessed this material in your citation. For more information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Transcript – Lecture 4 So today we are going to talk about another process of lumping or another process of discretization what will lead to the digital abstraction. So today's lecture is titled "Go Digital". So let me begin with a usual review. And so in the first lecture we started out by looking at elements and lumping them. For example, we took an element and said for the purpose of analyzing electrical properties let's lump this element into a single lumped value called a resistor, R. And this led to the lumped circuit abstraction. The lumped circuit abstraction says let's take these elements, connect them with wires and analyze the properties of these using a sort of analysis technique. So a set of a methods. We've looked at the KVL, KCL method. Another example of a method we looked at was the node method. And of this category there is one method you should remember, which you can apply to every single circuit and it will simply work, is the node method. For linear circuits other methods also apply, and these include superposition, Thevenin method, and in recitation or in your course notes you would have looked at the Norton method. So that's what we did so far. So this is a toolkit. So now you have a utility belt with a bunch of tools in it, and you can draw from those tools. And, just like any good carpenter, you know, the carpenter has to cut a piece of wood. He could use a chisel. He could use a saw. He could use an electric saw. And the reason you pay carpenters $80 an hour in the Boston region is because they know which tool to use for what job. So what we'll learn today is, so this was one process of discretization. We discretized matter. This gave us the discipline here that we decided to follow, lumped matter discipline, that moved us from Maxwell's equations into this new playground called EECS. Where all elements looked like these rinky-dinky little values like resistors and voltage sources and so on. What we'll do today, if that wasn't simple enough, let's simplify our lives even further. What we're going to do is lump some more. So what else can we lump? We've lumped matter, so all matter is taken care of. So what can we lump to make life even easier? When in doubt, if things are complicated, discretize it or lump it, right? So what do you think? What we will do today is lump signal values. So we'll just deal with lumped values. And this will lead to the digital abstraction. And the related reading is Chapter 5 of the course notes. So before we do this kind of lumping, let me motivate why we do this. One reason is to simplify our lives, but there is no need to just go around simplifying things just because we can. Let's try to see if there are other reasons motivating the digital abstraction. So what I would like to start with is a simple example of a analog processing circuit that you should now be able to analyze. So I'm going to be motivating digital. So let's start with an analog circuit that looks like this, two resistors, R1 and R2. And what I'm going to do is apply a voltage source here, V1, apply another one here, V2, and make this connection. And let me call this voltage V nought and call this my output. This voltage with respect to ground node, rather than drawing this wire here, I often times draw a ground here and simply throw ground wherever I want. This symbol simply refers to the fact that the other terminal is taken at the ground node. So here is my V nought. Now, let's go and analyze this and see what it gives us. In this example, V1 and V2 may be outputs of two sensors, maybe heat sensors or something like that. This is a heat sensor on that side of the room and this is a heat sensor on this side of the room. And I pass their signals through two resistors and I look at the voltage there. So by now you should be able to write the answer V nought, or the value V nought almost by inspection. Just to show you, let me use superposition. When you see multiple sources, the first thing you should think about is can I use superposition to simplify my life? And let me do that. V nought here is the sum of two voltages, one due to V1 acting alone and one due to V2 acting alone. So what's the voltage here due to V1 acting alone? To find out that I short this voltage, I zero out this voltage and look at the effect of V1. So the effect of V1, if this were shorted out, is simply V1 x R2 / R1 + R2. This is now a voltage divider, right? A voltage V applied across two resistors and the output taken across one resistor. So that's this value. Then I could do the second part. To look at the effect of V2, what I will do is short this voltage and look at the effect of this. Now, this voltage is across this resistor divider. And so I get R1 / (R1 + R2) here. So you'll notice that for something like this, if I had applied KVL and KCL of the node method I would have gotten a bunch of equations, but here I wrote it just by inspection. You should be able to look at circuit patterns like this and write the answers down very quickly. Let's say if I chose R1 to be equal to R2 then V nought would simply be (V1 + V2) / 2. So if these two values were equal, I simply get the output, the average of the two voltages. So this guy is an adder circuit. It adds up these two voltages. But more precisely it's an averaging circuit. It takes two voltages and gives me the average value. Now, if you have two sensors in the room, you might think of why you want to take that average value to control the temperature of the room. But suffice it to say that V nought is the average of the two values. So let me show you a quick demo of this example and then look at what the problems are with this example. So let's say, as one example, I applied a square wave at V1, which is the top curve, the green curve, and I applied a triangular wave at V2, that's the second one. As you expect, the output is going to be the sum of the two voltages scaled appropriately. So notice that I have a square wave with a superimposed triangular wave on top. And I can play around. What I could do is change the amplitude of my wave form here. And, as you notice, the amplitude of the output component also changes accordingly. So this is one simple example of an adder circuit, and the two wave forms get summed up and I get the output. So I'll switch to Page 3. Let me just draw a little sketch for you here. Here, what I showed you was I had a triangular wave coming on one of these inputs and I had a square wave on the other one, and the output looks something like this. OK? No surprise here. This is a simple analog signal processing circuit which gives me the average of two wave forms. Now, let me do the following. Often times I may need to look at this value some distance away. So let's say this person here wants to look at the value. So I bring this wire here. And I also bring the ground connection and I look at it. I look at this value here. And when I have a long wire I can get noise added onto the circuit. So let's say a bunch of noise gets added into the signal there. And what I end up seeing here is not something that looks like this but something that looks like that. That's not unusual. And the problem with this is now when I look at this, if I'm looking to distinguish between, say, a 3.9 and a 3.8, it's really hard to do that because my noise is overwhelming my signal. I have a real problem, a real problem here. Noise is a fact of life. So what do we do? This is so fundamental. Large bodies of courses in electrical engineering are devoted to how do I carefully analyze signals in the presence of noise? You'll take courses in speech processing that look at clever techniques to recognize speech in the presence of noise and so on and so forth. One technique we adopt that we'll talk about here, which is fundamental to EECS, is using the digital abstraction. Let me show you how it can really help with the noise problem. So the idea is value lumping or value discretization. Much like we lumped matter, we've discretized matter into discrete chunks, let's discretize value into two chunks. Let's simply say that now I'm going to deal with two values and I can, say, call them high, low. I have a bunch of choices here. I may call it 5 volts and 0 volts. I may call it true and false. What I'm doing is I'm just restricting my universe to deal with just two values, zero and one. This is like dealing with a number system with only two digits. And these are zero and one. So what I've now done is I'm saying that rather than dealing with all possible continuous values, 0.1, 3.9999 recurring and so on and so forth, what I'm going to do is simply deal with a high and a low. Dealing with this whole continuum of numbers is really complicated. Let me simplify my life and just postulate that I am going to be looking at high and low. Whenever I see something I'll look at it and say high or low, is it black or white, period. There's no choice here, just two individual values. So that sounds simple, and nice and so on, but what's the point? What do we get by doing that? Let's take our example. Let's take what might be a digital system. Let's take a digital system and let's say I have a sender. Much like I sent a signal value a long distance, let me have a sender, and I have a ground as well and here is a receiver. This symbol simply says that both of them share a ground wire. So the sender and a receiver. And what I'm interested in doing, the sender is interested in sending a signal to the receiver. And in the digital system, the way I would send a digital signal is all I can use is ones and zeros, OK? So let's say the sender sends something like this. The sender wants to send a value. This is my time axis and this is 2.5 volts, this is 0 volts and this is 5 volts. My sender has some agreement with the receiver and says I'm just going to be sending to you low values and high values. And this signal here would correspond to "0" "1" "0". It's a symbol. That's why I have input zero in quotes there. We'll go into this in much more detail later, but for now suffice it to say that I'm sending a set of signals here "0" "1" "0". This simplistic scheme will not work in many situations but go along with this for a few seconds. So I send the signal sequence "0" "1" "0" out here. And notice that there is a high and a low. And the agreement the sender and the receiver have is that, look, if you see a value that's higher than 2.5 volts that's a high. If you see a value below 2.5 volts in the wire that's a low. And I'm going to send a 0 volt and a 5 volt from here. So now at the sending site let's say I don't have any noise in this system. Let's say this is my Vn, some noise being added. And let's say Vn is 0. Then in that case I will receive exactly what is sent "0" "0" 5, 2.5, 0 volts. And this is time. Nothing fancy here, right? My receiver receives a "0" "1" "0". Now, the beauty of this is that now suppose I were to impose noise much like I had noise out there and Vn was not 0. Rather Vn was some noise voltage, let's say 0.2 volts peak to peak. Let's say that simply got superposed on the signal. In which case what do I get? What I end up here with is a signal that looks like this. So the receiver gets that signal because a noise is added into my signal and that's what I get. But guess what? No problem. The receiver says oh, yeah, this is a 0 because the values are less than 2.5, this is a 1 and this is a 0. "0" "1" "0". So here my receiver was able to receive the signal and correctly interpret it without any problems. So because I used this value discretization and because I had this agreement with the receiver, I had better noise immunity. Consequently, I had what is called a noise margin. Noise margin says how much noise can I tolerate? And in this situation, because the sender sends 5 volts and 0 volts, the 5 volts can creep all the way down to 2.5, I'll still be OK. Similarly, 0 could go all the way up to 2.5, I'd still be OK. So in this case I have a noise margin of 2.5 volts for a 1 and similarly 2.5 volts for a 0, because there are 2.5 volts between a 0 volt and 2.5. So notice that I have a nice little noise margin here, which simply is the English meaning of the term there is a margin for noise. And even though I can change the signal value by up to 2.5 volts, the receiver will still correctly interpret the signal. So I've decided to discretize values into highs and lows. And because of that, if all I wanted to do in life is send highs and lows I can send them very effectively. There are many complications, but if all I care about is sending highs and lows I can send it with a lot of tolerance to noise. So many of you are saying but what about this, but what about that? There are lots of buts here. And let's take a look at some of them. If you look up there. What I ended up doing was creating a design space that looked like this. This is on Page 6. What I did was I said with a range of values from 0 to 5, what I'm going to do is at 2.5 I drew a line and I said as a sender if you wanted to send a 0 then you would send a value here. And if you wanted to send a 1 you would send a value here. Similarly, for a receiver. And if the sender sent a value all the way up in 5 volts that was the best thing, but technically the sender could send any value between 2.5 and 5. And if there was no noise then the receiver could correctly interpret a 1 if it was above this and 0 if it was below this. The problem with this approach really is that if I allow the sender to send any value above 2.5 all the way to 5 then there really is no noise margin in this situation. OK? Because if I allowed the sender to send any value between 2.5 and 5 then what if I have a value 2.5 for a 1? Then I may end up getting very little noise margin on the other side. Worse yet, what if I get a value 2.5? That's a much worse situation. What if the receiver receives a value of 2.5? Now what? What does the receiver do? The receiver cannot tell whether it's a 1 or a 0. The receiver gets hopelessly confused. So to deal with that, I'm going to fix this, what I'm going to do is the following. Switch to Page 7. What I'll do here is to prevent the receiver from getting confused, if the receiver saw 2.5, what I'm going to do is define what is called "no man's land". I'm going to define the region of my voltage space called the forbidden region. And what I'm going to do is, say, let's say I defined it as 2 volts, 3 volts and 5 volts, 0, 2, 3 and 5. With my forbidden region, if I have a sender then I tell the sender you can send any value between 3 and 5 for a 1. And you can send any value between 2 and 0 for a 0. To send the symbol 0, I can send any voltage between 0 and 2, and similarly for 1. At the receiving side, if I see any value between 3 and 5, I read that as a 0, and any value between 0 and 2 I read that as 2 volts. So I may label this value VH and label this threshold VL, so there's a high threshold and a low threshold. So this solves one problem. Now the receiver can never see a value in the forbidden region. Now, I can stand her and pontificate and say, oops, that's a forbidden region, thou shalt not go there. But what if I get some noise and a value goes in there? In real systems values may enter there. But what I'm saying, so this is the beauty of using a discipline. Let me use my playground analogy. This is my playground. We got into this playground using the discrete matter of discipline, the playground of EECS, but in that playground some region of that playground deals with just high and low values. I further restrict the playground and I say I'm only going to focus on that playground in which all signal values have a forbidden region. All senders and receivers adhere to a forbidden region. And if there is any signal in this space, in the forbidden space then my behavior is undefined. I don't care. You want to go there? Sure. I don't know what's going to happen to you. Now, we're engineers, right? So we've disciplined ourselves to play in this playground. It's like I tell my 9-year-old, don't go there, right? And of course he wants to go there. He says what will happen if I go there? And the answer here will be undefined, OK? Something really bad could happen to you. I don't know what it is but something really bad, you know, a lightening bolt or who knows what, but something really bad. And you as a designer of a circuit can, let's say you were Intel. Intel designs its chips. And let's say Intel decides to play in this playground and there is a forbidden region. So Intel says oh, it's really easy for me if in the forbidden region the chip simply burns up and catches fire, we'll sell more chips. That's fine. Whatever you want. The key here is that all I'm saying is that I am going to discipline myself into playing in this playground and that's where I will define my rules, and you stay within the boundaries and all the rules will apply. It's called a "discipline." You're disciplining yourselves to stay within it. There's no logic to it. It's just a discipline. Just do it and you'll be OK. When we look at practical circuits and so on, we have to address the issue of what happens when things go in there. But let's postpone that discussion. For now I've solved one of my problems, which is, the previous problem was what does a receiver do if it saw a 2.5? Now it can't see a 2.5. But then the receiver asks, Agarwal, but what if I see a 2.5? I can tell the receiver you can do whatever you want to do. You can stomp it. You can squish it. You can burn it. You can chuck it. Whatever you want. It's up to you. Do whatever you want. You won't see a value. If you do, do whatever you want. It's undefined. That works. So you, as the receiver designer can do whatever you want when you see a 2.5. You can say yeah, I'll just put out a 1 if I see a 2.5 or a 2.6. I'll just do something. No one cares. So this is pretty good. This is pretty good. We still have a problem, though. Do people see the problem here? This still doesn't quite work. If Intel did this, instead of your laptops failing and blue-screening every hour they'd be doing it every millisecond. So the problem is this discipline have allowed the sender to send any value between 3 and 5 as a 1. And any value between 3 and 5 at the receiver is treated as a 1. Do you see where the problem is? Yes? The sender sends a 1.99 and the noise pumps it into forbidden region. Exactly. So the sender says it's legitimate, I'm Intel. They've told me stick to 0 and 2. And Intel parts will be sending to values between 0 and 2. And Motorola parts, which are receivers, you know they have to receive 0 and 2. So Intel can send the value, 2. They can because it's 1.9 out of 2. It's legal. This way I can make really cheap parts. But now the problem is that even the smallest amount of noise will bump it into the forbidden region, and so therefore this one has a problem. And the problem is that this one offers zero noise margin. There is no noise margin. There is no margin for noise in the discipline. All right, back to the drawing board, folks. Switch to Page 8. Let's get rid of all this stuff and go back to the drawing board. OK, so what do we do now? How about the following? How, about as before I say, as a receiver, if you see a value between 3 and 5 you treat that as a 1 and a value between 0 and 2 you treat that as a 0. No difference. So as a receiver same as before. But now what I do is I hold the sender to tougher standards. I hold the feet of the sender to the fire and say you have to adhere to tougher standards. So what I'm going to do is hold the sender to tougher standards, maybe four walls. That is tell the sender that if you want to send to 0 or a 1, for a 1 you have to send a value between 4 and 5, and for a 0 a value between 0 and 1. Sender is now held to tougher standards. This is what my chart looks like. So now I do have some noise margin. Can someone tell me what is the noise margin here for a 1? 1 volt. And the reason is that the lowest voltage a sender can send is 4 volts, OK? If the 4 leaks down to 2.99 that's in the forbidden region, I'm in trouble. 2.99. This is my forbidden region here. And 2.99 is in the forbidden region. I'm in trouble. So notice that the lowest value that the receiver can receive is 3 volts. So if I sent the 4 and sent this over a long cable to you, the value can be beaten up by noise to such an extent that you may begin receiving 3s but nothing lower than a 3. So this is a noise margin, 1 volt. Similarly, for a 0 the noise margin is also 1 volt. So let me label these. There are four important thresholds here. This threshold is called VOL. V output low. These have special meanings. This threshold here is called VOH, V output high. This threshold here is called V input high and this threshold here is called V input low. So VOH simply says that senders must send voltages higher than VOH. Receivers must receive values higher than VIH as a 1. So these four thresholds together give you your threshold. For the sender gets 2.5, what does sender do? It could do that. So, in that case, you can do that. If all you want to do is have one value here then what you have is an infinitesimal value here for the forbidden region. That's fine. It's up to you to design it that way. You can. But it turns out that when you design circuits, when we see some examples in the next lecture it turns out to be fairly practical and easy to do it this way. But, again, these are design choices. If I'm Intel, Intel wants all its parts to work together. So parts that follow a common discipline can work together, right? Because senders will send values, receivers will receive these values here, so it will simply work. So the noise margin for a 1 here is simply VOH minus VIH and the noise margin for a 0 is VIL minus VOL. VIL minus VOL is the noise margin for a 0. So what do we have here? What we have here is a discipline that we've agreed to follow where senders are held to a tough standard and receivers are held to a different standard so that I allow myself some margin for error. And it's up to you as a designer to choose ranges for the forbidden region. Now, you may say that I want to make my forbidden region as small as possible. But you will see in practical circuits it's very hard to achieve that. Practical devices that you get, they have a natural region that gets very, very hard to break apart, and that tends to establish what that region looks like. So to continue with an example here, I may have the following voltage wave form for a sender. So I have some sender, I have a sender here. I have VOL, VIL, VIH, VOH and some other high voltage. And then, as a sender, if I want to send a "0" "1" "0" then I send a 0. I have to be within this band. And then for a 1 I have to be within this band. So this is an example of, say, "0" "1" "0" "1". And at the receiver -- Let's have VOL, VIL, VIH, VOH. So at the receiver, I interpret any signal below VIL as a 0. So I may get some signal that looks like this. And I'll still interpret that as a "0" "1" "0" "1". So to summarize here, this discipline that forms the foundations of digital systems is called "a static discipline". The static discipline says if inputs meet input thresholds -- So if an input to a digital system meets the input thresholds then outputs will meet, or the digital system should ensure that the outputs -- Output thresholds. So this means that if I have a system like this then if I give it good inputs. And by giving it good inputs I mean for 1s I have signal values that are greater than VIH and for 0s signal values which are less than VIL. These are valid inputs. So if my inputs are valid, that is below VIL for a 0 and above VIH for a 1 then this digital system D will produce corresponding outputs that follow output thresholds. For a 1 it will produce outputs that are greater than VOH and if it needs to produce a 0 it will produce outputs that are less than VOL. So notice that there is this tough requirement in digital systems that for the inputs, I should recognize as a 1 anything higher than a VIH. But if I want to produce a 1, I have to produce a tough 1 like a 4-volt 1. So there is a discipline that all my digital systems must follow, and that discipline is called a static discipline. So static discipline encodes the thresholds, encodes four thresholds that all digital systems must follow so that they can talk to each other. So if Intel and Motorola want to make parts that are compatible with, say, Pentium 4 devices then they will all talk over the phone or something and agree on a static discipline. We will say that, all right, all my peripherals will follow a static discipline with the following volted thresholds. And this way parts made by different manufacturers can interoperate and still provide immunity to noise. Yes. Question? Absolutely. There are many constraints on how you as a designer choose the noise margin. As a designer you want to make your noise margin as large as possible. The larger the noise margin the better you can tolerate noise which is why, how many people have heard of some devices called rad hard devices, radiation hard devices? Some of you have. There are a bunch of devices. Different manufacturers make different kinds of devices for different markets. For consumer markets they use parts which may have relatively poor noise margins because consumers can tolerate more faults. But if you're building devices for, say, the medical industry or for spaceships and so on, you need to be held to a much, much tougher standard. So for those devices you may end up having much, much tighter bands in which you have to operate so you have a tougher noise margin. So that leads us to, given these sort of voltage thresholds, we now move into the digital world. And in the digital world we can build a bunch of digital devices. The first device we will look at is called a combinational gate. A combinational gate is a device that adheres to the static discipline, Page 11, and this is a device whose outputs are a function of inputs alone. So I can build little boxes which take some inputs, produces an output where the outputs are a function of the existing inputs. And this kind of a device is called a combinational gate. And I can analyze such devices for the kinds of things that I would like to do. Before I go into the kinds of devices I'd like to build, let's spend a few minutes talking about how to process signals. How to process digital signals, Page 10. So notice that you have two values, 0 and a 1. So devices like my combinational gate, for example, can only deal with 0s and 1s. So I have to come up with some kind of a mathematics or some kind of a set of processing that can work with 0,1 values. So 0,1 map completely natural to the logic true and false. So I can borrow from logic and use true and false to do my processing of signals. So if all I care about is processing logic values, 0s and 1s, trues and falses then that's all I need. I can also use numbers. How do I represent a number? 3.9 which is 0s and 1s. It turns out that this is a whole field in itself. You'll hear more about this in recitation. Let me also point you to the last section of the course notes, Chapter 5.6 I believe, that talks about how to represent numbers. The basic insight is much like you can represent arbitrary long numbers with the digits 0 through 9 in the same way, but concatenating digits you can represent arbitrary long numbers with 0-1-1-1-0-0 and so on. So you can have a whole sequence of digits and you can build a binary number system. So you can read A&L Section 5.6, I believe. It's the last section for numbers. And you will also discuss this in your recitation tomorrow. Let me spend some more time talking about Boolean logic, two-valued logic, and how to process these systems. So one way of processing it is using logic statements of the following form. If X is true and Y is true then Z is true, else is Z false. So this is a logic statement. It says if X is true and Y is true then Z is true, else Z is false. So I can process this with 0s and 1s, trues and falses. And I do this all the time so I have a succinct notation for this. I express this as Z is X anded with Y. X and Y is Z. So Z is true if X is true and Y is true. A shorthand notation for this is just a dot. And a circuit notation for this is called an "AND gate". That's a little circuit. I haven't told you what's inside it. It's an abstract little device called an AND gate which takes two inputs, produces one output Z where the output is related to the inputs in the following manner. That's a little device called an AND gate. I could also represent logic in truth tables. And truth tables simply enumerate all the values and the corresponding outputs. Inputs can be 0-0-0-1-1-0 or 1-1. For an AND system output is 1, only if both are ones, it's a 0 otherwise. So that's a truth table for AND gate. So from 0s and 1s we deal with logic and we create devices like the AND gate to process digital signals. And what we will do is look at a whole bunch of little symbols like this, like the AND gate to process our input signals. And these devices might look like other functions like OR gates and so on. Let me show you a quick demo. What I'm going to show you is a signal feeding an AND gate. And one signal is going to look like this, and my signal Y is going to look like this. So you expect a processed output. So 1-0-1-0-1-0-1. And the output is simply going to be -- This is my time axis going this way. It is going to be an AND-ing of these two signal values like so. What I'm also going to show you is I'm going to superimpose noise on this wire. I'm going to superimpose noise on the wire, and what I want you to observe is the output of this digital gate. The output will stay exactly like this, even though I impose noise. The ultimate test. So stay right there. Let's do this demo. Give me a couple of seconds. If you look at the signal up there, look at the middle wave form, and I'm imposing let's have a digital system in a noisy environment like a lumberyard, for example, or chopping a bunch of trees in my backyard and building digital systems on the side. And if I have my buddies revving up chainsaws superimposing noise on my second input, but look at the output. And just to show that I'm not bluffing here, what I'll do is I'll pass the noise through and make the noise larger. And you'll notice that when the noise begins to surpass the noise margins the output begins to go berserk. Watch. Can you increase it gradually? Notice that as I put in a lot more noise then the output begins to go berserk, but as long as my input is within the noise margin my output stays perfectly stable. So that's the "Intro to Digital Systems". You'll see numbers in recitation. And we'll see you at lecture on Tuesday. MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Please use the following citation format: Anant Agarwal, 6.002 Circuits and Electronics, Spring 2007 (Massachusetts Institute of Technology: MIT OpenCourseWare). http://ocw.mit.edu (accessed MM DD, YYYY). License: Creative Commons Attribution-Noncommercial-Share Alike. Note: Please use the actual date you accessed this material in your citation. For more information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Transcript – Lecture 5 All right. Good morning. Let's get started. So the last lecture we showed you how to go digital. The fact that going digital had some key benefits for us. And what we'll do today is go inside the digital gate. Let's do a quick review. We began life by observing nature. We said those Maxwell's equations are tough. Let's simplify our lives by discretizing or lumping matter. So we got the lumped circuit abstraction. Then we had this noise problem here. In order to be able to handle that let's do some more discretization, some more lumping. So we said let's discretize values and deal with two levels, a high and a low. That's where the binary voltage levels come up, a high level and a low level. And then we said that in discretizing it we have to make some assumptions. We have to impose some constraints on ourselves. Just as with the lumped matter discipline, we imposed a couple of constraints in going from the continuous matter world to a lumped matter world. Similarly, we have to impose some discipline on ourselves, some constraints on ourselves in going from the continuous value regime to the digital value regime. And that discipline is called the static discipline. And what the static discipline says is that if you have senders and receivers in a digital system then they all need to adhere to some standard. If I was a sender I had to adhere to some tough output standards. I had to be sure to shift values that exceeded some high voltage threshold. And if I was sending a low value I had to make sure my values were lower than some output low voltage threshold. Similarly, if I was the receiver then I had to guarantee to recognize as a one all voltages that where above some input high voltage threshold. And similarly I had to guarantee to recognize as a zero voltages that were below some input low voltage threshold. So provided senders and receivers in a system adhere to these voltage levels, to this discipline then they would all very comfortably work correctly in a digital system. Then we also said that once you deal with such values, one you deal with digital values we can now postulate a bunch of digital elements that process these values in a manner very reminiscent of our analog circuits where we get analog signals. And you've already learned how to process analog signals. You've learned about resistor dividers and so on and so forth. You feed in an analog signal and you get an output analog signal as well. Now, here the resistor in the analog domain, elements like resistors and voltage sources were the symbols that you dealt with. Here, in the digital domain, the primitive elements that we will be using are called gates. As one example, this is called the NAND gate. So we looked at the AND gate in the previous lecture. This is an example of another gate called the NAND gate. The NAND gate has the following truth table. Our two inputs A and B and this output C. And the NAND gate works as follows. The output -- In English I can describe its properties as the output is a high at all times when at least one of these inputs is a low value. So it's high whenever at least one input is a low. So it's high here. It's high here. Oops, it's high here, high here. And when, oops. And when both inputs are a high the output is a low. This is a NAND gate. Notice that these are exactly complimentary to the AND gate. The AND gate outputs were 0-0-0-1. And the AND gate symbol looked like this. In general, notice that this little bubble here, it's called a bubble. That bubble implies a negation, an inversion. So we take the AND gate, invert the output and negate the output and you get the NAND gate. So these elements are combinational gates. And in combinational gates they adhere to two properties. One is that they must satisfy the static discipline. All the systems, all the elements in our repertoire in the digital domain need to satisfy the static discipline. And the properties of a combinational gate are that its outputs are a function of inputs alone. In other words, it doesn't store any state or doesn't store any history inside it. You can figure out its output just by looking at the inputs at that instant. Think of it as a completely transparent entity where its output reflects some function of the inputs at every instant of time. So I'll show you an example of a digital circuit. So much as I could interconnect resistors and voltage sources and current sources to build analog circuits, I can now build digital circuits using primitive elements such as these. So, for example, I could build a simple circuit that looked like this, two inputs A and B here, I get an output. And I feed that to another NAND gate with another input C. This device is called an inverter. The inverter simply flips the sense of the input. So if C is a 1 the output is a 0, if C is a 0 the output becomes a 1. It's an inverter. It simply inverts its input. Yet another primitive device. And this is my output D. So there are three gates in this design. And I can quickly write down what the output looks like using some very simple Boolean algebra or dealing with Boolean values here. So for AND gate the output is A and B. Remember dot is a short form for and. But there's a negation, inversion, so represent inversions with a bar. So my output is A dot B bar. There is a C here. So this is my output C bar. And this is a NAND gate. So it takes one input A dot B. It takes the second input C bar and ANDs those and inverts them. So that's the output. So there are three gates in this example. So you can think of building very complicated circuits containing large numbers of gates. In fact, the microprocessors that you use in your laptop contain a large number of gates. Can someone guess how many gates are in the Pentium IV, roughly? Approximate, how many? How many gates in a Pentium IV? 40 million. 100 million. In the Pentium IV you have on the order of 20 million gates. 20 million gates in the Pentium IV. And life begins in 002. Here you learn about onsies and twosies, and in the real world you will be dealing with tens of millions of gates. But this is for the Pentium IV. My research group at Laboratory for Computer Science built a chip called the Raw chip. And this chip has 3 million gates. And so there are several undergraduate students involved in this project in their third year, and they're beginning to deal with millions of gates. So the key thing to remember is that 002 provides the foundations where you make the switch from the analog signal to the digital signal or from continuous matter to lumped matter. And learn about the foundations of these primitive elements. And by the end of this course you will begin dealing with small systems, analog systems that contain on the order of 10 to 20 primitive elements. You will also begin dealing with small digital systems that contain tens of gates. In your final project you will build a mixed signal circuit involving an audio playback system. You will have digital data stored in a memory chip and you will build a circuit to extract that data, filter it and then convert it to the analog domain and then play it on a set of speakers. And that has on the order of about 50 to 100 primitive elements. So by the end of 002 you will have learned to deal with hundreds of elements. And then you will take other courses like 004 and so on where you will then make the leap to learn further abstractions that will take you from subsystems to systems with millions of gates. So the key is to manage the complexity of dealing with millions of gates it's all about abstractions. You have to build abstractions and double abstractions so you can deal with complexity. So the rest of EECS will take you from three gates to 20 million gates and software systems that operate on 20 million gates or whatever. So there is still a ways to go. Lorenzo, our friend has gone to bring a demonstration that we forgot to bring today. That will show you that little digital circuit in a mock up form. So what's today's lecture about? Today's lecture is going to be about what's inside a gate? How to build a gate. Once you build a gate you can then put millions of them into computer systems or analog systems or other sorts of systems. And what we'll do here is understand what's inside this abstraction. This is an abstract element that looks like a little circle and a line with some stuff inside it, with some properties. But someone's got to build that. It doesn't come from nature. You don't go and harvest gates from trees, you got to go build that, and someone has got to do that. So what to learn here is how do we go about building a gate? And here you will see practically how do you deal with voltage thresholds that satisfy a given static discipline? So before I jump into building a gate, let me try to build up some intuition. As is my usual practice, I'd love to get you to build some intuition as to how to build a gate. And then we'll go through the mechanics of doing it. So to build intuition, let me show you an analogous situation in fluids. So let's say I have a cauldron of water. This is like a power supply. And I need to feed this fluid down at some output source. And what I do in the middle is put in a couple of taps, faucets, all right? And so what do these guys do? Under what condition do you have fluid flow out of the tube at the other end? You will have fluid flow if -- So let me call this A and B. If A is on and B is on then C has water. Otherwise, if both A and B are not on then C has no water. So this is already beginning to sound like a AND gate, correct, where you get water only if A and B are both turned on. So we're going to use this insight, a stream of some flow and I put things to obstruct the flow. And when both the obstructions are lifted I get the output. I want to use that intuition to build an AND gate. Similarly, I could build a system that allows me to build the following structure -- So in this scenario let me call this -- -- the signal of A and B here. And in this situation under what conditions, provided the power supply has water, under what conditions do I get water out? In this situation, it is I get water if A or B are turned on. So I don't need to turn both A and B on. If either one of them is on, I'm going to get fluid flow here. So this will help us build the inside to build the OR gate. So that's an analogy involving items we see in everyday life. Let me now move into the electrical domain. In the electrical domain my analogy would be something like this. Let's say I have a power supply and I have two switches A and B. And I build a little circuit that connects this voltage source across the bulb using a couple of switches. In this case, the bulb is on if both switches A and B are on. My bulb turns on. If I switch either one of them off my bulb turns off. So notice that I can begin implementing things like this if I had this element. I had sources already. I know how to deal with bulbs. I model them as resistors. So I need to do something about this new element called a "switch". So let me build an abstract device. I'll tell you how to do that in real life in a second. So if I had the switch I could build things like this. I could put switches in series in a circuit and get myself something that looks like a AND function. So let me go ahead and build an equivalent circuit for a switch. So the switch has a couple of terminals here and I have a control. Switches have a control and they have a pair of terminals. And the equivalent circuit for this looks like this. This is for my switch. So when control is a 0. Then my switch is open to give me an open circuit in the circuit that I've shown you here. And, by the same token, if my control is a 1 then -- -- I have a connection between in and out. And this is a short circuit. So, in other words, if my switch has 0 at its control, I'll talk about how to get that, I have an open circuit, and if it's a 1 then I have a short circuit. This is a switch going on and off. Now, in traditional switches mechanical pressure is my control signal. If I apply mechanical pressure my switch could turn on. And if I take away the mechanical pressure then I could get an off situation. So let's for now imagine that we have a switch. I still haven't told you how I am going to get a switch in real life. Let's imagine you have a switch. It's a three terminal device. There's a control thingamajig coming in. Input and an output. So let's build the following little circuit containing a switch. So what I'm going to do, I will take a resistance RL and plug it in here. And connect my power supply like so. So the little circuit that I build has a resistor. And I connect the switch in this pattern and I get a VS. Lorenzo, you can set that up there if you'd like. No problem. So I get a VS here. Now, a couple of lectures ago I told you that 6.002, and for that matter, 004 and many of our other courses deal with combinations of elements. And we often deal with the same kinds of combinations again and again and again. We see the same sorts of patterns happening, and we need to begin to learn to identify these patterns. This is an incredibly common pattern. You'll see this pattern more times in 6.002 than any other pattern, I promise you. A power supply connected to a resistor and connected to a couple of terminals of some interesting device. I promise there will be at least one such pattern on the quiz, for example. These patterns are incredibly common. So let's take a look at the interesting properties of this pattern. Since this pattern occurs so commonly, I am going to create a short form. I have already created a short form which is this ground node here. By putting ground 0 all I'm really saying is that there is a wire connecting these two and that's my ground. So I already have a short form here. My second short form is when I connect a power supply to a node. Then what I'm going to do is come up with yet another short form that looks like this, an up arrow with the voltage written there. This symbol simply says that this node is connected to a power supply with voltage, or a voltage source voltage VS. So I just have come up with a slightly simpler representation for the little pattern that I have. Now let's take a look at the properties of this little system. Let's first look at what happens when C is 0. When C is 0, let me draw the equivalent circuit for this using the open circuit out there. That's what I get, OK? So when C is 0, if VS is a high voltage, let's say 5 volts, what do you expect at the output if C is a 0? This voltage VS appears at V out because this is an open circuit here. Remember, RL and this little device form a voltage divider. But since it's an open circuit its resistance is infinity. And so therefore in this resistor divider all the voltage falls across this open circuit. So, in this case, v out is a 1 or a high voltage. But let's take a look at what happens when C is a 1. In this situation, I have my RL, that's what I have. It's a short circuit at the switch and C is a 1. So what's the voltage v out in this case? Not surprisingly, since I've shorted this node to ground the voltage at this point is 0. So if I have low voltage that's corresponding to logical 0s that corresponds to a 0. So I can build a simple truth table for C and use logical symbols here. So when C is a 0 I get a high at the output and when C is 1 I get a low at the output. Have you seen a device that behaves like this so far? That's a little inverter. That's the exact behavior of an inverter. So this thing I've written here is a truth table for an inverter. So notice with just a simple little switch and a resistor, I have managed to build an inverter. Before I go on, I guess we have some things to show you. And let me pause for a couple of seconds and do that. First of all, what I want to show you is the following idea. So as I was preparing for this lecture last night I said, now here I am telling the 6.002 gang that you need to learn about analog circuits and resistors and all of that stuff, and you also need to learn about digital systems and all of that stuff. And I said, because these two are very commonplace and often times they occur together. So I said well, if I really believe in my own BS then there should be something around me where I can find both of them instantaneously. So I said let me do the following experiment. Let me close my eyes and reach out and see what I touch. So I closed my eyes, reached out, and guess what? I touched the lonely mouse. The mouse. So I said let me see what is in side the mouse. And if I believe in my BS we should find analog, little components and digital components in there, right? So let's see what is inside the mouse. All right. There we go. Don't try this at home, as with many other things we do in lecture. Come on. Show me what I want to see. OK, here we go. Not bad. Let me show you what we have here in this poor shattered mouse. That's my finger, silly. You should recognize this little resistor here. That thing with the little bands, oh, here we go. We'll use this. That's a resistor. And you'll see capacitors in about four weeks. That's a capacitor. And there is a digital IC here. That's a digital IC. That contains a bunch of gates inside it. So this mouse has not made a liar out of me. So what I just showed you was a little device that we use in everyday life that has both analog components and digital components. A large number of devices that we use in daily life are this way. You can do the same thing to your laptop. You could go try it out. And you will find a bunch of analog components and a bunch of digital components. And you really, really need to understand the whole caboodle here. Let me show you a fun little demo involving gates. Now, I want you to be very careful here. Lots of caveats here. If your grandmother asks you how big is a gate don't say this big. This is how big gates used to be, I would say, when they were first invented. When they built gates out of discrete vacuum tubes and so on, this is how big a gate used to be. This is roughly that big. Today in a chip, in a small VLSI, very large scaled integrated circuit in a chip, which is about 1 cm on the side, how many gates do you think I can fit in a thumbnail sized chip? Any guesses? With today's technology, how many gates can I fit on a chip? It has to be more than a million because I just told you that Pentium IV was 20 million and that was a year ago. How many? 40 million is a good guess. So on the order of 40 to 80 million gates in a 1 square centimeter. Intel just announced that they will be shipping a chip containing 1 billion switches. Remember, this whole thing is a gate, right? Inverter, a resistor and a switch. This thing is a switch. So Intel is going to be shipping something containing a billion of those little elements. Just keep those large numbers in mind. So here is a little circuit that I showed you here, A, B, the NAND gate, the NAND gate at the output and the inverter. So this output A is going to be 1 whenever either A or B is off. So the output is a 1 in this case when both A and B are off. I turn A to 1, output is still a 1. So the moment I turn both of these inputs into a 1, these are 1s, the output goes to 0. That's behavior for NAND gate. If I switch any one of the inputs to a 0 the output should go to a 1. Similarly, for the inverter here, when the input is a 0 the output is a 1. And when I switch it so should the output. Now imagine a circuit, a little chip containing billions of these devices. And just imagine all of these 1s and 0s flying around. So one simple switch in the input, like a click of a keystroke could actually cause a billion signals in your circuit to be flipping around. And that causes some fun stuff to happen, which we will learn about a few months from now. But for now that's a quick show of a little circuit that looks like that. Let me go back to talking about building other types of gates. So that was an inverter. So now you know. You're almost halfway to being able to build a Pentium IV. You've come all the way from nature to gates. And Pentium IV contains 20 million of them so you now know how gates are built. So that's an inverter. Let's look at how we can build other forms of gates. To build another gate let me do this. How about this pattern? If I build a pattern like this with A and B coming in here and I put two switches with their inputs in and out, so two switches in series. Let's write down the truth table for what this looks like. Let's see. When A and B are both 0, what should the output be? These are both off so the output is directly VS which is a high. When either of these switches is off 0-1 or 1-0. If either switch is off then this node is cut off from ground. There is no current flowing here. So this entire voltage drops across this infinite resistance here, and so I get 1s at the output as well. If both switches are on what happens? If both A and B are on then I get a short circuit to ground and my output is a 0. So can someone tell me what gate this is? Awesome. We just build a NAND gate. This is unbelievable. Five lectures and you've already come all the way from nature to the primitive building blocks of microprocessors. It's pretty amazing. So what about this one here? What's this? I haven't told you this before but if an AND gate becomes a NAND gate, this is kind of an OR arrangement, what should an OR become? NOR. It's all completely logical. So you can go home and practice a truth table for this. A, B and C. I'll just fill in one of the rows. So in this particular situation, if both A and B are 0, if A is 0 and B is 0, both the switches are off, so it's as if this little sucker here is cut off from ground and VS falls across from C to ground here and the output is a 1, so on and so forth. So I can build other interesting forms of gates. So let's say I build something that looks like this. I build something like this. You can write the truth table for this or you can look at this and write down the function that this one supports. Notice that this output here is going to be a high only when both of these are not connected to ground. And if you stare at it some more the function this one presents, this is my AND function. Suppose this one didn't exist, that would be my AND function. But because this one exists that's in an OR configuration and so I get a C. And so because of that I get something that looks like this. So this is my A dot B, this is my plus because of a parallel here, and ultimately this caused an inversion in this gate. So the primitive pattern has a generic inversion built into the output. That is why they commonly end up building NAND gates and NOR gates and so on as the simplest gates. We don't build AND gates and OR gates. How can I convert this one to an AND gate? Anybody? Put an inverter on the output. So what I can do is take this little sucker here, put an inverter here and I get an AND gate. So the real primitives in circuits tend to be NANDs and NORs. OK. So the real practical among you should be saying at this point all right, all right, I buy this, if there existed a switch. I know exactly how to go from nature to building Pentium IVs if there exists a switch. So that the obvious next step for me is to show you a switch, a physical switch device. And to introduce a switch device, let me show you a three terminal element. Remember, the switch has three terminals, an input, output and something called the control, C. So I'm going to introduce a new primitive element called "The MOSFET Device". MOSFET stands for metal-oxide semiconductor field-effect transistor. This is shortened to FET or transistor. Now I'm going to show you that this works like a switch. And before I do that, in fact, let me do that first. Then I'll show you something else. So this device has the following symbol. It has a terminal called a gate, the drain and the source. Gate, drain and source. Three terminals. This is the primitive element that forms virtually every electronic component built today. This is the foundation of the universe. So this little MOSFET device, we can look at how it behaves. I'll show you this thing on the screen in a second, but this guy behaves very much like this device I was postulating earlier. Let's take a look at this device on the scope. To do so let me label some voltages and currents. So let me label this voltage as vDS. Let me label this voltage as vGS between the gate and the source. And let me label the current coming into this node iG. In this device, the physical device that I'm going to show you, the current going into the gate is always 0. So iG is always going to be 0 for 6.002. In real life there is some leakage and so on. But in 6.002 for now we deal with a very simple abstract model, iG is 0. And let me label the current here as iDS. To be correct with the nomenclation, the current into node D should be labeled iD, but because iG is 0 iD flows out through the source as well, so I would simply call it iDS just so that I can show that vDS and iDS are the two voltages and currents that I am going to deal with. So that's my little device here. And notice that the source terminal is common. I use the source both for the control GS and I use the source for the drain as well. So you can view this as input, view this as out, and you can view this, if you like, as the control abstractly. So let me show you a plot of how this behaves. To understand how it behaves, I can draw an equivalent circuit for it. So in this particular situation, if its behavior is characterized by the voltage applied to vGS. Much like the control on the switch, vGS is my control. So if vGS is 0, oh, I'm sorry. If vGS is greater than or equal to some threshold voltage VT -- So vGS, the voltage applied here is greater than some voltage, VT, a threshold voltage, or the pressure of the switch is greater than some threshold pressure then this guy behaves like a short circuit. This is iDS, this is my drain and this is my source. So if the voltage applied between the gate and the source is higher than some threshold then this behaves like a short circuit. Similarly, if the voltage vGS is less than some threshold VT then in that situation -- -- I get an open circuit. And when I have an open circuit between D and S then the current iDS is going to be 0. So this is the idealized model. And this idealized model is called "the switch model of the MOSFET". The switch model or the S model of the MOSFET. Well, if you want to see the internals of the MOSFET, I won't cover that in lecture or recitation. You can look at the section, I believe Section 6.7 of the course notes. That has the internal structure of the MOSFET and how you physically construct such a device. So what I can do here is step back and stare at the device for a second or two. And what it says is that if I apply a lot of pressure, if vGS is greater than a threshold VT then I get a short circuit here just like my switch. When in doubt think faucet. If you put pressure on the faucet, think of this as closing, and when I open it, when vGS goes less than VD, less than a threshold, I take off the pressure and then it becomes an open circuit. So I can plot the following. Much like I plotted the iV characteristics of two terminal elements, I can plot the iV characteristics of this three terminal element in the following way. I can focus on two terminals and look at vDS and iDS for that terminal pair and draw the curves for how it will behave as I change vGS that I applied. So what I'm going to show you is that if vGS is less than a threshold then this behaves like a open circuit. So no matter what the voltage is the current is 0. Similarly, if vGS greater than equal to some threshold voltage then I get the behavior iV curve of a short circuit where the current can be anything and controlled by external forces like in any short circuit. So let me show you on the screen. Lorenzo has kindly put the graph up already. So I'm showing the iV curve of a switch. Notice that when vGS is greater than VT, greater than a threshold I get the vertical line corresponding to a short circuit. Is it this one? This one. There we go. So what I'm going to do here is I'm going to reduce vGS to below VT. What should you see happening? The curve, from being a short circuit, should hammer down to becoming an open circuit. That's the curve for an open circuit as I drew out there for you. VGS pressure ain't enough. Lots of pressure, boom, it's a short circuit. I really like to think of this pressure analogy if I get confused whenever I look at a MOS transistor and I need to look at vGS and so on I always think vGS is greater than VT. Lots of pressure on the switch it turns on. Just remember that, and then you won't forget this vGS thing here. So that's the behavior of a switch. And so viola, there's our switch. So I've given you a three terminal element that is a switch that is controlled like a mechanical switch. So I can build a, if I replace -- This was my switch earlier. And what I can do is replace this with my MOSFET and that's what I get. And I won't bother showing you this is your inverter. All of that has replaced the abstract switch with a physical switch which behaves as shown in the graph up there. And so I apply an input here and I take the output here. So as 6.002 you could look at this and say ah-ha, that is an inverter. When you go to 004 what you will do is build this triangle and a circle around it and you will ignore what's inside and just look at that. So in 002 we showed you that the internals look like a pattern with a MOSFET and a resistor, but it's really the abstract inverter looking in from the outside. I'm just going to close the loop inside the digital gate, and this was inside your little inverter with a resistor and a switch. Let me continue with this for a little longer here -- -- and do something that we like to do a lot, which is plot what are called input / output curves. So let's say the voltage applied here is v in and let's call this v out. For fun let's plot a v in versus v out for this inverter. So when input is a 0, let's say VT is 1 volt for the inverter. The threshold voltage is 1 volt. The threshold pressure is 1 volt. So when input is a 0, and let's say VS is 5 volts. So when the input is a 0, this guy is turned off. So what's the output? What's the output voltage? If this is turned off, what's the output voltage? It's the supply. The supply directly shows up here. And so as long as the input is 0 the output is at 5 volts. And this is true until the input reaches 1 volt. As long as the input is less than 1 volt my output stays high. And then when my input exceeds or hits 1 volt then at that point the switch turns on and the MOSFET turns on and shorts the output to ground in which case boom, this is what I get. And then, no matter how much I increase the input, my switch stays on and the output follows a zero volts at the output. So this is my v in versus v out curve for the inverter. One of the interesting things that we do a lot is see whether this satisfies some voltage threshold. So let's say I have a VOL of 0.5 volts, VOH of 4.5, VIL of 0.9 and VIH of 4.1 volts. So VOL says in its low value is the output less than 0.5? Yup, output less than 0.5. In its high is it more than 4.5? Yup, it's more than 4.5. Does it recognize all values below VIL as a low input? Yup. So anything below 0.9 or 1 for that matter is viewed as a low. That's good. So these pass. And high, anything above 4.1, is that treated as a high? Yes. So anything above 4.1 is treated as a high and the output goes low. So therefore this inverter that I've designed for you here satisfies the static discipline and this inverter can be used in circuits or other devices that conform to this value here. In your recitation, you will look at a slightly more detailed model of the switch where the switch behaves like a resistor. MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Please use the following citation format: Anant Agarwal, 6.002 Circuits and Electronics, Spring 2007 (Massachusetts Institute of Technology: MIT OpenCourseWare). http://ocw.mit.edu (accessed MM DD, YYYY). License: Creative Commons Attribution-Noncommercial-Share Alike. Note: Please use the actual date you accessed this material in your citation. For more information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Transcript – Lecture 6 -- will try it again at the end of this lecture and you show you that stuff hopefully next time. For today we are going to start with nonlinear analysis. Before we do that I wanted to do a little bit of review. I wanted to give you the past three weeks in perspective and show you how all of these things fit into the grand scheme of things. We began by building a great little playground, and within that playground we said that by enforcing upon ourselves the lumped matter discipline we created the lumped circuit abstraction. So within that playfield we assumed that we had dq by dt and d phi by dt to be 0 so that gave us as the lumped circuit abstraction. And within that lumped circuit abstraction, within this playground we looked at several methods of analyzing circuits, including the KVL, KCL method. We also learned the method involving composing resistors, the voltage dividers and so on and solving circuits intuitively. And we also looked at the node method, which is kind of the workhorse of the circuits industry. So when in doubt apply the node method and it will get you where you want to go. Now, we also said that this is good, here is our playground. We said hey, if we focus on those circuits that are linear we come to the left part of our playground. And we said that for linear circuits in this part of the playground we can further use a couple of techniques, a few techniques, superposition, Thevenin, Norton and so on. So these techniques allow you to very quickly analyze complicated circuits, especially when you're looking to find a single current, or voltage or some parameter of interest. Whenever you see, if you see a circuit containing multiple voltage sources or two or more voltage sources or current sources, as a first step think superposition. And so these are very powerful techniques that let you analyze very complicated circuits very effectively. After we did this we said, oh, let me draw another playground here. This is another piece of our playground. And if these are linear circuit then this half of the playground is nonlinear circuits. And we said that if you further focus on discretized values, if you discretized values and focused only on circuits that dealt with binary signals, highs and lows, then we came into this small regime of the playground. And notice that digital circuits are, by their very nature, nonlinear. Remember the circuit, A, B, this was one of our NOR gate circuits? And if you look at transfer functions, that is if I plot, let's say for example, for some combination of input values. Let's say I plot v in verses v out. Let's say, for example, I turned this guy off by setting B to 0 and then I simply apply a low to high transition at v in, then what I would see at the output is a transfer function of the following sort where as v in changes the output switches at some point and then stays at a low value. So when v in is low v out is high and v in and high v out is low. So that's kind of the v out versus v in when B is set at 0. So notice that this is a nonlinear curve. This is not a straight line. It's a nonlinear curve. And so therefore in the digital domain we see highly nonlinear functions that look like this and so on. However, take a look at this circuit. Suppose I focus on the circuit for a given set of switch settings. Let's say, for example, I focus on the circuit when A and B are both 1s. For a given set of switch settings, notice that I'm going to be either in this region or in this region. Notice that this region is a straight line. So if I focus on let's say both A and B at once then I get something like this. And in this situation, for a given set of switch settings, notice that my digital circuit now can be analyzed using linear techniques. So therefore my digital gets moved into the linear domain for a given set of switch settings. So if I fix my switch settings and look at the circuit then each circuit, for a given set of switch settings, is comprised of voltage sources and some resistors and it's a linear circuit. Again, I can go back and apply all my linear techniques to virtually all the digital circuits that you will be dealing with in 6.002. Again, remember if I fix my switch settings, if I fix the inputs then the output can be determined using linear techniques. Because the digital circuits we're showing you in 6.002 simply comprise linear elements like voltage sources and resistors and so on. You'll see some more later. But you can apply your linear techniques and analyze them. The cool thing here is that with just two weeks of stuff that you've learned in 6.002, you are well on our way to being able to analyze certain classes of digital circuits for a given set of switch settings and many, many, many linear circuits. What we will do today is focus on nonlinear circuits. So we look at this space. Notice again that up until now we've dealt with these three methods, which apply to all circuits within this playground, the lumped circuit playground. And the subset of that is the linear domain. And we can analyze linear circuits in this way. And digital circuits, for a given set of switch settings, also fall within this category. So notice that you can go ahead and analyze the digital circuits using superposition or other techniques like that. The next big step for us is to begin our analysis of nonlinear circuits today. The important thing to remember is that nonlinear circuits are also within this big playground in which we are going under the lumped matter discipline. So nonlinear circuits are also lumped circuits. And therefore because we are in that playground we can use any one of our techniques, KVL, KCL or the node method to analyze nonlinear circuits. So if you see a nonlinear circuit, don't get daunted. Just remember this is meant to be simple stuff. So let me simply write down the node equation and analyze it. There is really nothing new in today's lecture. I'm just going to show you a nonlinear circuit and analyzing using techniques that you already know. Today nonlinear circuits. And we look at several methods of analyzing nonlinear circuits. We look at the "Analytic Method". We look at a "Graphical Method". You will look at a "Piecewise Linear Method" in the book. I won't be covering this in lecture. You can read Section 4.4 for the piecewise linear method. In this method you take your curves and you approximate them with a bunch of straight line segments, kind of like the v out, v in curve I've shown you there, and analyze the circuit using linear techniques within any given straight line segment. We will also do incremental analysis. This is also called small signal analysis. So I will cover these two today, I will introduce this one today, and wrap that up during the next lecture. Let's start with a simple example. So I have some voltage, V, some voltage source V. And I have some resistor, R. And I have a fictitious device here that I labeled D. Let's call this fictitious device the "Expo Dweeb". I purposely chose a funky name because this is a fictitious device. Let's call it the Expo Dweeb. And let me write down the associated variables for this device as follows. iD is the current flowing into this terminal and vD is the voltage across this device. So this is a nonlinear device. And this device is characterized by the following equation. Much like resistors were characterized by an iV relation, V is equal to iR, or i is equal to V/R. This device is also characterized by the following element relationship. It's a e raised to bvD. So there is an exponentiation here. Again, this is a fictitious device. And I'll show some funky things that it does in a second. It's a very simple relation. It's an exponential relation where the current relates to the exponentiated value of the voltage vD across the element. So I can plot iD versus vD for this element as follows. Notice that when vD is 0 iD is a, so I have a here, and it looks like this. It's a funny device, a fictitious device. So when vD is 0, I have some current flowing the device, and as vD increases I get an exponential increase in the current through that device. This device is funny in the sense that it is not a passive device in that notice that when vD and iD are positive the product is positive, which is fine, which says that it is consuming power. On the other hand, on the left-hand side notice that the vI relation is negative, which means that when I put a negative voltage on it, it can still sustain a positive current. This must imply that the device is producing power. But for the purpose of a nonlinear analysis we don't have to worry about that. Let's just do it mathematically and find out what it looks like. So back to this again. I have a voltage source, a resistor and my Expo Dweeb connected in that manner. Now, again, reflect on this pattern. A voltage source or a current source, a resistor and some device. This is a very standard pattern you will see again and again and again. In particular, if you look at this device, it's a nonlinear device here. And facing the nonlinear device is a voltage source in series with a resistor. And the reason I say that this is an incredibly important pairing is the following. Notice that if on the left-hand side I had any linear circuit and I had a single nonlinear element in that circuit. Notice that by a Thevenin reduction that you've learned you can take this entire mess. If all you care about is the behavior of the nonlinear device, for the purpose of analyzing this nonlinear device, you can take this entire linear circuit, no matter how complicated it is, voltage sources, current sources, resistors and a bunch of other funky stuff, you can boil all of that down to a Thevenin equivalent, a voltage and a resistor in series. So we can trick you. We can give you a complicated circuit and say ah-ha, tell me what the current is through this device if I apply some voltage, 3 volts there. What you can do is you can say ah-ha, I don't care what happens here so I'm just going to replace the whole thing with a Thevenin equivalent. And you've done your homework now and you can calculate Thevenin equivalents for circuits. And simply replace this and then go ahead and solve the circuit. Again, remember we are engineers. We are looking for answers. We are looking to build interesting systems. And, in general, we like to take the simplest path possible to the solution. So simplify your lives and create a simple Thevenin coupled to a nonlinear device and then you will be rolling. When we talk about a variety of other circuits, nonlinear circuits, time-varying circuits and so on in the rest of this course, we will look at this pattern again and again and again and again until we are blue in the face. And, just remember, the reason we keep looking at this pattern is that whenever you have some big linear mess connected to some interesting device what you can do is if all you care about is analyzing the behavior of that device, you can take this linear mess and simply figure out the Thevenin equivalent, or the Norton equivalent if you like and replace this whole thing with its equivalent and then go ahead and analyze it. So boil an arbitrarily circuit down to a very simple pattern of this sort. What this means is because of this brilliant Thevenin simplification, going forward through the rest of this course we will mostly deal with very simple circuits like this, voltage source, resistor and the device. That's it. Very, very, very rarely will you see multiple sources and lots of resistors in a circuit. It's usually going to be simple stuff. And remember how we got here, by making a Thevenin simplification of a linear mess. All right. If in homeworks or quizzes or in real life, or in many examples of real life, if you find that you have to deal with a lot of grunge and a lot of mess, step back and think a little bit. Try to use intuition and see if you can simplify things using some clever trick or method. Method 1 of analysis. Let's go ahead and analyze this pattern here, this template circuit, if you will, a voltage source a resistor and a nonlinear device. This is the analytical method. And remember the node method applies, so let me go ahead and apply the node method. To apply the node method, what do I do? I first have to select a ground node. Let me insulate this as my ground node. Let me label all the nodes with their voltages. So this node has voltage V and this node has label the capital D. So let me go ahead and analyze this using the node method. So the node method says for each of the nodes in the circuit whose voltage is not known go ahead and write down KCL implicitly applying the element relationships to replace the current values with the voltage values. Let's start with the current going in that direction. Current going from the vD node through resistor R, which looks as follows, vD – V divided by R. That's a current going that way. And the current going down is iD. In general, when I apply the node method, I don't write iD here but I go ahead and write the element relation ae to the bvD here. Then I get an equation in vD and I just solve the mode voltage. However, just to make a couple of extra points later, let me go ahead and do that in two steps, write down this and then go ahead and write down iD separately as ae to the bvD. Again, remember, don't get confused here. In a node method, I don't write down a second step. I directly write down ae to bvD in place of iD. I get one equation in vD, I go solve it. Just for fun today, I'm taking two steps here, writing iD and explicitly putting down iD as ae to the bvD. Now, that's it. I mean this is all there is to it. You guys can now go ahead and analyze nonlinear circuits. You get a bunch of equations, a bunch of unknowns, go solve. I have two equations here. vD and iD are my unknowns and I can just go ahead and solve for them. Now, in general with nonlinear circuits, often times it's hard to get a closed form solution so you may have to use a bunch of methods. You can try a closed form solution or you can try numerical solutions or you can do trial and error. In this case, I'll just go ahead and tell you. Suppose I choose V as 1 volt, R is 1 ohm and b is 1 over volt and a is ¼ amps for those values, approximately vD is roughly 0.5 volts and iD is roughly 0.4 volts. You can do this by using trial and error or other methods. In 6.002 we don't dwell on working too hard to solve equations of this sort. If you cannot substitute this in here and solve it directly, we don't ask you to go and learn numerical method and the techniques and so on to solve it. But just remember that you can use trial and error or you can use back substitution and other techniques that you will learn in future numerical methods classes and apply it here. But suffice it to say that, for here we can stick with trial and error if you like. And for these values, vD and iD are 0.5 and approximately 0.4. You're done. It's really that simple. Yes. Oh, I'm sorry. Good catch. I know there is one person that's not sleeping here. Good. So, as I said, there's not a whole lot to it. Whether it's a nonlinear circuit or a linear circuit and as long as I am inside this playground here where the lumped circuit abstraction holds, I can apply my node equations and then go ahead and solve it. Let me show you a few more methods so we can articulate your repertoire of tools for nonlinear circuits. And I'd like to show you a graphical technique. I personally rarely use a graphical technique to solve circuits. And why am I sharing this with you? It turns out that often times by looking at things graphically you can get some better insights into circuit behavior. You can also show cool demos when you show graphs of responses kind of playing with each other and so on. So this is fun for getting intuition and things like that. Graphically all I'm really going to do is solve those two equations graphically. So I'm going to plot equation one. Let me rewrite equation one as follows. iD is -- I'm just rewriting equation one as follows. V/R – vD/R. And I can also draw the second guy -- OK, I can do this as well. I can do an iD versus vD plot. And in this particular situation, you've seen this already, that's my iD versus vD curve right there. And I can do the same for this one here. So this equation establishes the following straight line relationship. It says that when vD is 0, iD is V/R. So that's here. And similarly when iD is 0 then vD is equal to V so I get something here. So that's my straight line relationship corresponding to this equation here. So what I can do is I can simply solve these by superimposing the two curves on the same vD, iD template here and finding the intersection of the curves. So I can take this curve corresponding to two and I can take this curve corresponding to one, and this is V/R and this is V, 0, and I can find the intersection point. This curve here, for reasons that will be obvious about three weeks from now, is called the load line. It's called the load line. You will understand why that is so in a later lecture. So I've given you a template on Page 6 to boil these two down into one equation. So there, again, you can substitute the values for V is 1 volt and R is 1 and so on and so forth and get the same kind of result as you did previously. So there is really nothing new here. All I've done in the second method is combined the two equations graphically and found the solution by looking at where the two curves intersect. At the start of the lecture I also told you that you may want to go and check out the piecewise linear technique -- -- in Section 4.4 of the course notes. All right. For today let me do a third method called "Incremental Analysis". This technique is also called the small signal method. I'm going to show you, before I go into the method, in today's lecture what I'll do is I'll give you a motivating example for why we need the small signal approach. I'll give you a motivating example and show you a little demo. And then I will close with showing you a problem with applying a standard approach, and I'll ask you to see if you can figure out a way to handle it in time for next lecture. So let me give you the motivation here. So here is what I want to do. Many of you have seen one of those electric eye garage door openers, right? You have a receiver at one end and you have some kind of a light beam at the other, and when you walk through it stops, or rather it cuts the circuit and stops the door from closing. And when no one is going through it maintains a connection and lets the door close. So what we did is we went to Home Depot, or one of those stores, and bought a very standard device that essentially produces some response when light impinges on it. And my goal will be to see if I can send music over the light beam using a simple garage door opener device. So here is the little circuit that I will do. We actually went there and built this. I will also show you a demo. Here is my time-varying voltage, vI(t), and this is some music signal. And get some music signal. And I want to connect this to this device, which is a device found in garage door openers. I am going to call it a LED. If you like, you can view it as, this is very similar to our Expo Dweeb. This is called a "Light Emitting Expo Dweeb". That's why it is LED. So what the LED does is, as I apply this voltage across it, that same voltage appears across the Light Emitting Expo Dweeb. And there is some current that flows through the device. And for our analysis we will assume that this device virtually has an identical iD characteristic to the Expo Dweeb just that it emits light. So when I pass a current through it, it emits light. And the light intensity is proportional to the current that flows through. So it emits light and light intensity, LD, is proportional to iD. Here is my little light emitting device, which when current flows through it, itproduces light because its intensity is proportional to the current. And what I will do is I will stick in the receiver here. Think of it as a photo resistor or some other device where I am going to connect that in a circuit. I am not going to spend too much time on this side. I'm going to focus on the left-hand side here. And let's say I have some kind of amplifier and speakers and so on and so forth. Suffice it to say that when the light falls on this device PR that iR that goes through here is proportional to the received light intensity. So if the current is proportional to the received light intensity then I amplify that signal in my amplifier and I get the music playing out here. And notice that the following chain of dependences apply. So I have an input music signal VI. That gets converted to some iD. These are all time-varying signals, so VI is a time-varying signal and so is iD. And iD gets converted to light of some intensity LD. This in turn gets attenuated somewhat and is received at the photo resistor. And I get some intensity LR impinging on that device there. And that in turn produces a current iR and then iR is amplified and goes through a speaker and so on and produces sound. Notice that using this chain I've taken a music signal here and I am playing it here. And just imagine that this is your garage door opener device here where the light emitted is being articulated by the voltage signal VI. And received here. So notice that if I cut this, if I stick something in here and block it then I get no response here, but if I take my hand away then I do get some response. But this is fine. This should work. You could try this at home if you'd like. If you have a garage door opener, just stick a little circuit like this and it should simply work. We have a problem, though. The problem is that, as I said, I'm using the Expo Dweeb here, the light emitting Expo Dweeb, and its characteristics are as follows. iD is exponentially related to the voltage vD, so this is nonlinear. And that's a real problem. Because this is nonlinear, I am going to get a distorted output. Let me show you a little wave form, a little graph to show you how the distortion happens and then show you a little demo showing you the distortion. Let me graphically show you the kind of distortion that is happening here, and I will do it by drawing the following graph. So this is the vD, iD curve for our device. And what I'm going to plot for you is if I have a time-varying vD voltage, I just want to see what the time-varying iD current looks like. And a trick to plot that is to take your input voltage like so. And let's say I apply a sinusoid. So I am just taking a time-varying sinusoidal voltage and rotating the plot 90 degrees like so, so I can see where these points correspond to on that curve. So what this says is that at some point here, for example, where vI, at this point and time, vI is here. Notice vI and vD are the same thing because vI is applied across vD. vI directly applies across the device, and so vI equals vD at all time. So this voltage here corresponds to this voltage, it corresponds to this current and then I can find out what the current is for that voltage. By using the same artifice I can plot the output current iD like so. So for this value I get some current here. And so at time T0 I start here. And notice that as this signal moves up here, I can find out the corresponding values of iD by looking at where a straight line intersects here and plotting the values here. I have a nice little graphical animation to show you this. Hopefully, the laptop will work tomorrow and we can check that. I am doing nothing new here. Just showing you a trick to be able to plot vI versus v out relationships, or vI or versus other relationships based on some kind of a transfer function. So what you end up getting is something that looks like this. Why is that? Notice that this curve here corresponds to the signal. As this signal moves from here to here, this point moves from here to here and that corresponds to this iD. When this moves from here to here that corresponds to a point moving from this part of the curve to here, and that looks like so. And then for the whole negative incursion, notice that the whole negative incursion moves here, so for that entire negative incursion I get an output that looks like this. Notice that this device has completely cut off and hammered negative going signals. What it's done is that rather than giving me a nice little negative spike incursion here, or excursion here, what this is doing is that it is taking this excursion and simply slamming it down to this value here. And then again, when I go back up, I get this peak here. So notice that what was a nice little sinusoid out there gets hammered and squished into this funny curve here. What this device is doing is for positive values it tends to produce exponentially greater current so I get boom, high-rising peaks corresponding to these two, and for negative going voltages it simply compresses them to a low positive value here. And that's what I see here corresponding to negative excursion. So notice that what this will do, if I view sound, if I input sound here, and sound has negative going excursions it will simply scrunch them. But more or less let the positive things through. And that is going to give rise to a bunch of distortion in my signal. So I would like to show you a little demo. Actually, we've gone ahead and built a little device like this. We have an honest to goodness little device costing, I don't know, 50 cents or $1 or something, which is a little voltage, it's a device that emits light proportional to the current flowing through it. I have a receiver. And I am going to play some music, and you will listen to the output here. And hopefully you should see a bunch of distortion because of that effect that I showed you. And what I will do is, before we do that, you will see two curves up there. The yellow, I believe is the vI, is the input, and the green, I believe, is a signal proportionate to -- The other way around. Oh, I see. So green is the input. So green, the lower one is the input and the upper one is the distorted output. So we are going to play some sound through it, music through it and you can listen, through a little CD player. So a couple of things. The good news is that it works. However, I doubt that music artists will come to my studio to record if this is the quality of what I produce. Do notice that there are hardly any negative going excursions in that curve up there, right? All the negative ones have been like scrunched up down into a flat line there, and that's the reason I get this distortion. And just to prove to you that I am indeed using a garage door opener device and not faking it here, I am going to just shut the signal off by stopping the light using a piece of paper here. So notice that this device here is the little device that has a light beam going through the center, and I am going to take this piece of paper, can you turn it up? So let's have some fun with this. If I were to put this piece of paper halfway down, I should get half the intensity, right. So my sound should diminish in volume a little bit. Maybe that will work. Let's see if it works. Nothing to do with 002 but it's just fun. Louder. You can make it loud. Too much coffee. My hand is shaking. I guess you did see the lowering of volume, right? OK. Just way too much coffee, and so my hand was shaking too fast imposing its own sine wave on top of the signal. What did I show you? This was garbage, right? We had a nice little signal input, and the output was completely distorted because I was playing sound over this and this is what happened. Switch to Page 9. Now, this is what I would have liked to have happened. On Page 9 what I would have liked to see happen is this. Suppose I had a light emitting device that looked linear, a straight line where the current was linearly related to vD. Then what I would see, if I had a sinusoid here then I would get a sinusoid here. No distortion there, right? If only things were like I wanted them, if I had a linear device, but I don't have a linear device. I have an Expo Dweeb. Now you know why I call it a dweeb. Well, I'd like a linear device and it's exponential. But this is what I would like. And if I had this I wouldn't show it to you today. If I had this my music would go through without any distortion and I wouldn't have to run cables through my attic. I could just use my garage door opener to play signals from my bedroom and living room and so on, right? So the key thing here is how do I get this? And what I would like you to do is think about it yourselves. What I am given is something like this. This about it yourselves, you know, what would you do? See if you can come to me before lecture tomorrow or Thursday and tell me the answer, OK? MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Please use the following citation format: Anant Agarwal, 6.002 Circuits and Electronics, Spring 2007 (Massachusetts Institute of Technology: MIT OpenCourseWare). http://ocw.mit.edu (accessed MM DD, YYYY). License: Creative Commons Attribution-Noncommercial-Share Alike. Note: Please use the actual date you accessed this material in your citation. For more information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Transcript – Lecture 7 OK, good morning all. So before we begin, I just thought I'd show you a little news item that I happened to read that was very relevant to what we covered recently in 6.002. So you recall when we did the digital section a few days ago last Thursday, we talked about a switch. We talked about the MOSFET switch, which when turned on and off, by input signals could help build gates which would then be combined in tens of millions of quantities and go into chips like the Pentium 4 and AMD Athlon 64, and so on it so forth. So I just saw this news item that I came across, and this says they are rethinking the basic construction of the products. It talks about the semiconductor manufacturers like AMD, Intel, and others that build digital chips. They are rethinking the basic construction of the products down to the architecture of the transistor. That's a MOS transistor, and the on/off switch inside the chip. OK, now this might imply that there is a single switch inside the chip, but no, there's tens of millions of transistors, or tens of millions of switches inside a chip. And pretty much any advancement that can be made to the basic transistor can have a 10 million to 20 million times effect because there are that many of them on a single chip. So I thought that was very appropriate. OK. Let's dive into a quick review. So this week, we had begun nonlinear analysis, and I just thought I'd blast through a few animations that I've created, trying to give you more insight into the behavior of some of the things that we have done. Now first of all, as I did the last time, let me try to put it in perspective most of what you've learned thus far, and what we will be learning today. So the past week, we have been focusing on nonlinear analysis. And as I pointed out, here is how this fits into the big picture. So, we had our 6.002 world, at what we said is that we are engineers. We are going to devise our own playground in which to play with our own rules. And that's our playground. That's what we're going to learn about in 002, and for that matter, the rest of EECS at MIT. It's all within this playground here. And this is the playground with lumped circuit abstraction, and good old KVL, KCl, node method, your basic composition rules apply within this playground that directly come from Maxwell's equations because you have made the lumped matter discipline assumptions. OK, so then we said a large part of the playground is linear, and some other much more intuitive techniques apply within the linear portion of that playground, techniques like the superposition, Thevenin and Norton. In most exercises, and quizzes, and experiments, and so on that you do in real life, you can pretty much apply these simple techniques. Very rarely do you have to go into the node method for circuits that are more complicated than single source and a couple of elements. And then, there's the nonlinear part. Remember, the reason I showed this is that this is the same playground. OK, linear and nonlinear are part of the same playground. OK, even nonlinear elements are lumped circuit elements, and they follow KVL, KCl, the node equation, and so on. And then, last week we spent some time talking about the digital abstraction. So we focused on a smaller region of the playground. And the assumptions we made in there were even tighter. We said that it is part of the playground we shall only deal with binary values. We'll digitize or lump values into highs and lows, and that's where our circuits are going to be. And these circuits, when looked at as a whole, were nonlinear. So, this is a simple NAND gate circuit. And this is the input/output characteristic. So, for example, if I hold B at zero, and I apply a zero to one transition at A, then this is the output that I will see at C. So notice, this is decidedly nonlinear. Then I said that, look, suppose we had to fix the input values at a given set. OK, so let's say, for example, I fix A at one, and B at one. OK, and then look at the circuit in this situation. What do I find? What I find is that the entire digital set of circuits that we were looking at move over into the linear space for a given set of switch settings, OK? So, when I set A 1 and B 1, A equal to one and B equal to one, my NAND gate becomes like this. OK, it's a simple resistive network with a voltage source, VS. So, for a fixed set of inputs, for a given set of inputs, if I don't change my inputs, then my circuit looks like a linear circuit, and my good old linear analysis techniques apply. So that was last week. And this week, we are looking at the nonlinear space. And we looked at a couple of techniques in the nonlinear space, analytical techniques and graphical techniques. And then, I showed you an example. OK, I showed you an example circuit that was something that I would like to build involving the light emitting expo dweeb, my little garage door opener thingamajig, and I wanted to transmit music over that light beam. I also showed you that it was highly distorted because it was in the nonlinear space. So, today what I'm going to do is introduce a new part of the playground. There's a new part of the playground, and I'll show you a technique whereby by focusing on this part of the playground and disciplining ourselves in the kind of inputs we apply to circuits, I'm going to show you that certain kinds of nonlinear circuits also move over, when used in a particular way, also move into the linear analysis domain. OK, so let me leave that for now and go back into quickly reviewing the motivating example of music that I had taken last time. OK, so here was a little example. So I have a music source, VI, and I apply that. This device that I call the, lightheartedly, the Light Emitting Expo Dweeb has a current, VD, across it, or a voltage, VD, across it, and a current ID through it. And the light intensity, I said, was proportional to the current. And because of that, I was able to get the light to impinge on a receiving device, which produced a current that was proportional to the intensity of light falling on it. And that signal would then be amplified somehow. We haven't talked about all of this stuff yet. This will happen next week. But let's say we somehow amplify the signal and then played out through a set of speakers. All right, so if I had some sort of a music signal here, then I could then transmit the music signal over to the side on top of this light beam. But the problem, as I said the last time, was that our device, the Light Emitting Expo Dweeb had an exponential characteristic, so that I had some trouble in getting undistorted music. So, the characteristic of the VI characteristics of my device looked like so. The ID versus VD curve looked as follows. OK, it was decidedly nonlinear. And because of that, I was getting a lot of distortions in my signal, and I showed you a little trick to plot, given an input waveform at a transfer function such as here to plot the output function. OK, let me show you another little animation that I have created here for you that should give you even more intuition in terms of how it happens. So, this is a characteristic I showed you up here. It's on both sides, but I guess it points to only one unless I shuttle back and forth really fast. So on average, I'll be in both places. But anyway, so here's my ID versus VD characteristic. And as I said, there's an exponential ID versus VD curve. And I want to see what the output looks like, for example, a sinusoidal input. So I said, let's place the input along a little graph, rotate it so, and take a sinusoid, and apply a sinusoid to the input, VI, which would also appear across the Light Emitting Expo Dweeb. And then, what I wanted to see was how the output looked. OK, so let me tell you that the output is going to look like this. OK, the output is going to look like so. And, a little artifice to discover curves like this is to think about a point here corresponding to the point on the transfer curve here, because this is VD, looking at the Y intercept. That's a value of ID, and that's a value of ID here. And, time moves along here, and time moves along here. So, I did this little animation. You'd better be impressed. It took me six hours to do it. So, here it goes. So, let's say I start by focusing on this little point that corresponds to this point on the transfer function, which then, in turn, points to a time, zero, this point on my ID curve. OK, I hope this works. So, as my point moves down [LAUGHTER], this was fun to do, I promise you. So notice that as this point has the following excursion, this had the following excursions here. OK, all right. So let me pause that little animation there. At the end of the lecture, I'll put that up again if you like, and you all can come and play with it. So, you can actually do this in PowerPoint. It took me quite a bit of time to figure out how to do it, though, but it's fun. OK, so let me show you a little demo, and show you a sinusoid, and show you what the output looks like if I apply a sinusoid for VI. So, I'll show you ID as a function of VI when VI is a sinusoid. There you go. So, I applied my sinusoid VI, and this is the current that I get. And notice, this is the transfer function that I talked about, the ID versus VD curve of my Light Emitting Expo Dweeb. And I get this highly nonlinear transformation of the input as I get to the output. OK, so that is a problem. And then, I also played some music for you. Let's do that, too. I played some music for you. I applied the music as an input to the circuit, and that's the output. OK, that's the output that I'm observing at the amplifier. It's highly distorted. OK, we can stop that. There you go. OK, so that was my problem. OK, so we had covered, we had gone this far last Tuesday. I set the problem up for you, motivated what we had to do, and showed you that I was able to transmit music over my garage door opener, but I did not think I could listen to that music for very long. So, I challenged all of us to think about how a trick that I could use to be able to transmit music and have a linear response. So, did you people get time to think about it? So how many people here think they know the answer? It's OK, don't be modest. Go ahead. Could you speak louder? Yeah, you find another something, kind of element, that's got the opposite graph so that when you add them together. Oh, this guy wants to cheat. No. He wants a new element. So, no, no new elements. Pardon? Build an MP3 encoder. Ah-ha, so that will happen much later. Yes? Digitize the signal before you send it to the LED? Digitize the signal before you send it to the LED. But in some sense, each of these solutions is a huge sledgehammer approach to look at solving it. There's a much simpler technique I can apply here. Yeah? Add a voltage offset. Ah, ah-ha, that might work. What else? So let's say, here's my signal, right? If I add a voltage offset, that will just bump the signal up here. Then the curve is still nonlinear. But you're getting there. Well, I'll tell you what. Let's pause here. Let me quit while I'm ahead. OK, so the answer here, folks, is Zen. OK, what I want you to do is, so, in Zen, what you have to do is you have to sit down in a courtyard, and look at a rock, like a small rock on the ground. And you got a focus on it till the rest of Earth kind of vanishes. Just focus on the rock. OK, now make like you're in a courtyard, and you're looking at this little area here. Just look at this. OK, and I'll give you ten seconds. Sit down quietly, and no sounds. Just stare at the spot here. OK, make believe this is your little rock, and just stand there and think about it. OK, I'll give you five seconds to do that. Just stare at it. And very soon, the answer should pop into your heads. OK, what do you see? This guy, if I focus on this really small region of the graph, this small little piece looks more or less linear. OK, hmm, so that should give me some insight. This whole thing, the macrograph is nonlinear. But I focus on a little rinky dinky piece of that graph like so, that appears more or less linear. If it's small enough, that appears linear. So, I'm staring at this, and that appears linear. The question is, how do I exploit this little small, little, linear region to get a linear response from my device. OK, so here's the trick that I'm going to use. The little trick that I'm going to use is the following. Notice that, let me call this voltage at the center of this region capital VD. What I can do, if I take my input signal, and I just pointed out earlier, I bump it up. I boost it. OK, so I apply a DC offset to my input signal, like so. So I apply some input signal, VI, which is also equal to the VD if I look at a variable across the nonlinear element. If I apply a DC offset, VI, and I superimpose the music on top of that, let me call my music, just to distinguish between the two, capital VI, and the small vi. OK, that's my music. So here's my capital VD, my DC offset. And I want to superimpose my music on top of that. OK, so I've gotten halfway there. By superimposing my music here instead of having excursions out here, I now have excursions out here. OK, and so I'm using some portion of the graph here. But that's still way beyond the small little element there. So a second think that I do in addition to boosting up the signal is shrink it. Think of boost and shrink, BS. So what I want to do is boost up the signal using a DC offset, and shrink the sucker. OK, so I'm going to go with a small signal and bump it up. OK, so now what happens is that small signal in its excursions, only uses that little portion of the graph. OK, again, remember: bump and shrink, bump and shrink, two things, boost and shrink. So what do you think of that trick? So, by doing that, what happens is that signal that has excursions here will produce a corresponding response in this region, OK? And I argue that since this is more or less like a straight line, I invoke Zen here, and argue that this little signal now gets transformed, and I get a linear response. OK: boost and shrink. So in terms of my circuit, let me draw it out for you. My Light Emitting Expo Dweeb, and this whole signal was what I used to call V capital I, and that's made up of two components now, a bump offset, and a shrunk voltage VI. It shrunk, so therefore I've used the small v and small i, like, really, really small. In the same manner, I get a VD ID across the LED, and the corresponding values here will also have a DC offset and a small response. Let me call that ID plus I small d. I'll do all this mathematically in a second as well, but first let me do it completely intuitively so you get some insight into what's going on. And, VD is simply capital VD plus small vd. OK, and this is the same as VI, I, and VI. OK, so what have I done? I've done two things. I have said, as an engineer, OK, I care about getting music across my garage door opener. And I'll do what it takes to do that. OK, so as an engineer, I'll do two things. I'm going to bump my signal up and shrink it. And the bumping and shrinking, and I do it like this. I shrink my signal, the music signal here, and add a DC offset. OK, and I claim that the music I listened on the other side now, provided I have enough amplification there, is going to be undistorted. OK, so far I've showing this to you completely intuitively using little sketches, no math. I promise you, I'll give you a bunch of math in a few seconds, but just get the basic idea, and get the intuition behind it. So let's go back to our demo and take a look. So remember, BS, right, bump and shrink. So what I'm going to do is first of all, let me bump up the signal. So, what I'll do is I want to add an offset to my input, and let me bump it up. Let me shrink it first. It'll make the point a little clearer. So, the big input, green, is a big input. Let me shrink it. OK, so I've made my input small, and in the middle of that picture out there, you see the region of the transfer curve that's being articulated. OK, this region of the curve is being articulated by the small signal. It's a much smaller signal. And the output is still distorted because I have to do two things: bump and shrink. I've only shrunk. OK, let me bump it up now. What's the yellow curve? It's going to get linear. It's going to get proportional to the input. Then I'm bumping it up now. I can make it smaller, make it even smaller, there you go. Isn't that fantastic? So, I'm making nature do my bidding here, OK? So, this is one of those, when I learned electronics and so on many, many years ago, this was one of those really big ah-ha moments for me, saying, wow, that stuff is cool. It's something that I couldn't think about myself, and it's not obvious, and by being disciplined and creative in how I use circuits, I can do really, really cool things. OK, remember this as a big ah-ha moment for you. So, here's my little signal that I've shrunk and bumped up, and my output is a sinusoid, and not this funny, distorted waveform. And notice that this is the region of the curve that is being articulated. So, I can make the signal even smaller if I like. OK, and what I'd like to do next is play music for you, and if you don't believe your eyes, you can at least believe your ears. Let me go to the distorted signal again, switch to music, and raise it up. OK, now what we'll do is shrink the music signal and then bump it up. Can I turn the volume down a little bit? That's good. OK, so if I shrunk the volume a little bit, and let me bump it up, now. [MUSIC PLAYS] Just remember this as a big ah-ha moment. OK, the signal is really, really small. I like that. I like the enthusiasm. OK, so the signal's very small, and I get a more or less linear response. OK. All right, so that's intuition, and the approach that I've taken is called, it's variously called small signal analysis, incremental analysis, small signal method, small signal discipline, whatever you want. OK, this simply says that by boosting and shrinking my signal, I get a response that's more or less linear even when I have a nonlinear device. And this technique is called the small signal approach. So, just to focus on that a little bit longer, switch to page five of your notes and let me draw something out for you. OK, so what I have here, this is my offset VD, and from the VD offset I have my little signal V small d, and the total signal is called V capital D. Offset, small signal, and that's my total signal. OK, notice the offset is all capital. The total signal is small v capital D, and the music or the small signal is small v small d. Similarly, the output is going to look like this, and here I get an offset in the output ID. I get a corresponding signal, I small d, and I get a total signal, I capital D, OK? The cool thing to notice is that the signal here, the output signal here corresponding to the input signal, the music signal, VD, is small I small D, and that is more or less linear. OK, and I can even plot the signal like so. This is my input, v capital D. That's T. This is VD, V small d. That is my total input. And similarly, I have an output. And this is my output ID. And, that looks like this, I capital D, small i small d, total signal I capital D. OK, so that's the small signal method. So, let me summarize that for you. There are three steps to the method. So, first of all, operate at some DC offset. This is also called DC bias, and in that example it's VDID. OK, so I choose an operating point that bumps up the operation in some region of interest. The second step is to superimpose small signal on top of VD, capital V capital D, to superimpose a small signal, and the third step is observe the response -- -- and the response, small i small d, that's the music part of the response, ID, is approximately linear. OK, three steps to the method here, and just remember this notation. And, my notation in the small signal model is as follows. My total signal ID is the sum of two signals, I capital D plus small i small d. This is called the total signal. That's called the DC offset. And this is the superimposed small signal. OK, total signal, DC offset, plus the small signal. And sometimes, especially when doing math, and so on, we may oftentimes represent ID as a delta, I capital D, OK, to show that ID is incremental change in the value of I capital D. And because of that, this method is also often called the incremental method, incremental analysis. OK, so far what I've done is given you some intuition. I've developed a small, simple method, given you some insight into why we use this method, and also shown you some demonstrations that show that when I bump and shrink, and observe the response, I do get a more or less linear response. So let me now do this mathematically and show you that mathematically, you can also derive your response to be a linear response. This is page seven. So, I know that ID is some function of the diode voltage. F was my nonlinear function. OK, so my function F was a nonlinear function. So therefore, ID was nonlinearly related to VD. So, let's do the math. So as a first step, what we did was replace VD by a DC offset, the small signal method, a DC offset, plus a small incremental change. OK, by doing the math, let me simply use the delta VD notation to show you that I'm dealing with small increments, and also because in the mathematics community, when you learn about some of these techniques, they will use the incremental change notation, which is the delta VD notation. In electrical engineering, we use a small v, small d notation. So, this is a large DC offset, and this is a small change about that offset. So, you folks have taken math courses before, and been looking at finding out the value of a function, which is a small change for an input value, which is a small change about a big input value or a big DC point is Taylor's expansion. OK, so let's use Taylor's series expansion, OK, and substitute VD plus delta VD into this, and see what ID looks like. Again, let me tell you where I'm going with this. ID equals F of VD. This is a nonlinear function, OK? I claim that by replacing VD, the input, with the DC offset plus a small value, the resulting response to the small value will be linear, OK? So what I'm going to do next is replace VD with this sum here, and then do the math, and show you that the response corresponding, or the change in ID corresponding to the change in VD is going to be linear. All right, so let's expand this function using Taylor's series near the DC offset point, capital V capital D. OK, so ID is simply, by Taylor's series, I want to find out a value of the function close to V capital D. OK, so I take the value of the function at that point, and then I add a few terms in my Taylor's series expansion. The first term is simply the good old Taylor's series stuff. OK, the first term is the first derivative of the function times the change. And then, the second one is second derivative. OK, and then I get higher order terms. So this is nothing new here. This is good old Taylor series expansion, and again, let me tell you where I'm going. I want to look at the response for an input that looks like this, and I want to show you at the end of the day that the response in ID, the effect on ID of using an input like this is as if that effect, the incremental change is linearly related to the small input, delta VD. So here's my Taylor's series expansion for delta V. Now remember, I told you that delta VD is much, much smaller than V capital D. OK, it's a very, very small quantity. But that quantity is really very small. Then what I'm going to get is that my output is, I can begin to ignore my second order terms. OK, delta VD is very, very, very small. Then, what I'm going to do is that ignore higher order terms. So I'll go and ignore higher order terms. They'll all go to zero. Remember, I can do this because by design I've chosen delta VD to be very, very, very small. OK, remember, we are engineers. I've chosen it in a way that this is very small. OK, so I'm telling you that's the case, and under those conditions, I can ignore second higher order terms, in which case I am left with this expression here. So let me rewrite this. Let me rewrite this down here. OK, I've just copied this turnout, I've ignored all these terms here, and so I have a more or less equal to sign that remains. So what I'm going to do is when I apply a small input of this form to a large DC offset, my output is also going to look like some output offset with a change in the output offset. And let me call the output offset I capital D, and some small change in the output delta ID. OK, we'll make sure we can convince ourselves that this is indeed the case. Notice that this guy here, F of capital V capital D is a constant. That's a constant with respect to the incremental change, delta VD. Similarly, this part here is a constant. Notice that this term here is the first derivative of the function evaluated at the DC bias point, capital V capital D. OK, so this term is also a constant with respect to delta VD. So notice, then, I have a constant term plus a constant term multiplying a small change, delta VD. So what I can do next is, in this case, given that I have a constant term on both sides, and on this side it's a time varying term, what I can do is equate the two constant terms. I can go ahead and equate these two terms. Remember, I have a constant plus a time varying term, OK, if I'm assuming here that delta VD, my little music signal is a time varying term. So, this constant will equal this, so ID must equal F of VD. And I know that's the case because the function evaluated at the DC offset gives me the DC current ID. And similarly, ID is equal to that component. Delta ID is equal to D, F of -- OK, so my incremental change in the output is the first derivative multiplied by the small change in the current. OK, so I'm pretty much done. So, therefore, notice that delta ID is proportional to delta VD. OK, and that's what I had set out to show. Remember, I had set out to show that provided my input is a small excursion around a large DC offset, then my output could also be a large DC offset with a small excursion on top of it where the two excursions, the input excursion and the output excursion would be linearly related like so. OK, and the method is very simple. I simply expanded the function about that point, that DC point, neglected higher order terms, and notice that my incremental term was simply the derivative plus the incremental change, a derivative times the incremental change in the input. Move onto page nine, and I'd like to give you a quick graphical interpretation of this. So I gave an intuitive explanation earlier. This is a mathematical explanation that shows you that the input could be linearly related to the output, provided, the outputs would be linearly related to the input, provided the input has a DC offset, and small excursions about that DC offset. So, let me give you some intuition in what you've really done here, using a little graph here. So, I'm going to plot ID versus VD, and notice that I have some point here, V capital D, I capital D. That's my DC bias. So, I have some DC bias point here. OK, what is this? That is simply the slope of the curve at that point. OK, it's the slope of this curve evaluated at this point. So this guy here is simply the slope of this curve evaluated at ID VD. OK, now, what I care about is this point here, and this point here. So let's say that this is delta VD, all right, and that corresponds to this point here. So what I've done is taken the slope and multiplied that by delta VD. So I've taken the slope, and multiplied it by delta VD, OK, and that gives me this component here. OK, and so, this is the point that I'm going to get. So in other words, what I've done is approximated point A using the Taylor trick by the point B. OK, so this is a point, A, which is what I really want, and I've approximated that by taking the slope of the function at V capital D, and multiplying that by the change in the input to get the corresponding Y offset, and that's the point that I get. And notice that if I make this delta VD small enough, then the error between these two points becomes smaller and smaller. So back to our example, so ID was a e to the BVD. This was the relation for our Expo Dweeb, and let me just plug in the values. So, ID plus small id. Notice, I'm just shuttling back and forth between the notation delta VD, and small v small d. OK, and so that is given by a e to the BVD, oops, plus, I'm just writing that equation up there. Let me call this equation X. And so, I get the second term is the derivative, ab times e to the BVD times delta VD, small VD, and equating this term that the DC offset. Notice that this is the DC offset in the output, and the small signal, ID is, further notice that in this particular example, what's that? a e to the BVD. That's simply ID again. It just happens to be that way in this example. So, I get ID times BVD. So, for my input, small id, my incremental change in the output is some ID times B times VD. And notice that this is a constant. And because that is a constant, my small signal behavior ID is going to be linearly related to the signal, VD, the input signal VD. OK, in the last three minutes, I'd like to give you one additional insight. So what we've shown so far is if I have an offset and a small change above it, then my output ID will be linearly related to my input. Now let's stare at this thing again. Let me rewrite it. It's some constant IDB times VD. So, where have we seen such an expression before? OK, where ID was some constant times VD. OK, remember, I equals V divided by R: Ohm's law. What I want to show you now is how we constantly keep simplifying our lives. The moment we hit some complication and things get too painful to analyze, as engineers, we come up with some clever tricks to make an analysis and use of circuits simple again. And so, notice that this is similar to some, one by RD VD, where RD is simply one over IDB. I'm just defining this to be RD. And what that means is that I can take a nonlinear circuit that looks like this. OK, and what I can do is replace this by its incremental equivalent, and build what is called a small signal circuit. And I'll just introduce it here. And we will revisit the circuit in much more gory detail a couple of weeks from now. So, what I can do is build a small signal circuit where I have all the small signal variables, and replace a nonlinear device by a simple little resistor whose value is given by IDB. OK, so therefore, what I can do is take my nonlinear circuit, and for small, incremental changes, replace that circuit with this equivalent small signal circuit, and go back to doing simple stuff again. Thank you. MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Please use the following citation format: Anant Agarwal, 6.002 Circuits and Electronics, Spring 2007 (Massachusetts Institute of Technology: MIT OpenCourseWare). http://ocw.mit.edu (accessed MM DD, YYYY). License: Creative Commons Attribution-Noncommercial-Share Alike. Note: Please use the actual date you accessed this material in your citation. For more information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Transcript – Lecture 8 All right, good morning. So today, we are going to talk about what is both a basic device in itself, the amplifier, and it also serves as a real key example of both nonlinear analysis and small signal analysis. So, today, dependent sources and amplifiers. So, let me first spend a few seconds just pointing out to you some of the key points from our previous lectures. I also want to point out that each chapter in the course notes has a summary at the end of it. And if you take a quick scan of the summary at the end of each chapter, it highlights the major takeaway points from each chapter. It stresses what's important, and if you have to remember a few things, what are those things to remember? So, to quickly review, we talked about a few primitive elements: resistors, voltage sources, and so on. And by now, you should have the facility to play around with these device elements. And then we talked about the Node method, and this is kind of the workhorse of 6.002. When in doubt, use the Node method. OK, and this will work both for linear circuits and nonlinear circuits. OK, so if you see a problem, or if you see a situation in real life that requires analysis, then as a first step, you should try to think of whether you could apply some of the key intuitive shortcut methods, superposition. One of my favorites, the Thevenin method, the Norton method, or the method that involves composition, that is very quickly analyzing circuits that have resistors in series and parallel. OK, so if you can apply one of these quick, intuitive, shortcut methods, go do so. If you can't, then usually you can resort to the Node method irrespective of whether the circuit is linear or nonlinear. So the last week was focused on the nonlinear method or nonlinear circuits, and we spent the first lecture talking about a straightforward application of the Node method, which gave us a bunch of nonlinear equations that we had to solve. In the last lecture, we talked about the small signal trick. What we said is if you look at the whole space of nonlinear circuits, then within that space, if we focus on small variations, small perturbations about an operating point, then even the behavior of nonlinear circuits in that small regime would be linear. So small signal method. And as an example, I showed you how I could take a highly nonlinear device like the garage door opener LED, and using that, build a pretty nice transmitter that would transmit music. And as long as we kept the signal small, and operated the device in a region where its transfer curve was relatively smooth, and I biased, or set the operating point appropriately, I would get a linear, small signal response. OK. So today, we're going to do a couple things. We're going to look at dependent sources. And the reading for this is section 2.6 of your course notes. And, the dependent source will be a new element in your tool chest. We will also do amplifiers, and amplifiers are in section 7.1 and section 7.2 of your course notes. So, before I begin with dependent sources, I'm just a huge believer in motivating things with real world examples. OK, so let me start by motivating: why we need an amplifier? Why do we need to do things like this? Or why do we even bother? And, spend a few minutes really getting you to appreciate that amplification is fundamental. OK, it's as foundational to life as high fat potato chips and stuff like that. So, let's do some basic examples here. So first, let me talk about, why do we need to amplify signals. Why amplify? Why do we care about building an amplifier? So, an amplifier, think of a little box, and apply some sort of small input. And I get a larger output. In this example, this may be a voltage with a swing of 10 mV, and in this case, the output might be another voltage with a swing of, say, 100 mV. And commonly, the amplifier, in addition to an input and an output, input port and output port, may also contain the power port, OK, so that I can apply a power supply to the amplifier because commonly as an amplifier signal, I'm looking for a power gain as well, an increase in the power provided by the output. So, that's an abstract definition of an amplifier, and let's take a look at an example of why we may need this. So let's say I have a small, useful signal, and let's say the signal has 1 mV peak to peak. And, I'm looking to transmit the signal over a wire to some other point. But let's say that in this environment, I get a bunch of noise that is in a noisy environment. And in this environment, let's assume that some noise may get superimposed. And if I have a 1 mV signal, and 10 mV of noise, then what I end up with at the output is something that looks like this. And it's really hard to distinguish my 1 mV signal from that large amount of noise. On the other hand, if I do the following, if I took the signal and passed the signal to an amplifier, and I amplified the signal to be a much larger version of the same signal, let's say in this particular situation 100 mV peak to peak signal. OK, so I magnified the signal by a factor of 100. OK, let's say it's a linear amplifier, I linearly amplified signal to be 100 mV, then in that case, if I had a noise on top of this, it's going to be less discernible. The signal will look like this. OK, my 10 mV noise would add on to it. But, this is still pretty decent. I can still recognize the input. And so, this is one application of amplification. If I need to send something from point A to point B as an analog signal, then an amplified signal is less prone to noise attacks than a small signal. Not surprisingly, a large number of devices that are used in everyday life have amplifiers built into them. So, get a little cell phone, and virtually every single cell phone contains an amplifier. By the way, this is an all digital cell phone. It's a Kyocera, I forget the number now. It's completely digital. OK, although they say it's completely digital, it turns out that a significant fraction of the circuitry is analog, in particular, so digital is sort of a marketing term to say that there's something special about this. But remember, there's a bunch of analog stuff. So, here's my little antenna from the cell phone. OK, and typically the first thing that happens to a signal as it comes out of the antenna in your cell phone is, look at cell phone circuits, or cell phone systems would be something that looks like this, OK, this, and may have a label LNA. If someone were to take a guess at what LNA might stand for? What's that? Linear amplifier. That's pretty good. So that's LNA. Close enough. A is correct. It's amplifier. What does L and N stand for? Low noise. OK, so this stands for low noise amplifier. So, I get a really rinky dinky small signal here, and then the low noise amplifier amplifies a signal. And in real cell phones, and for that matter, in your 802.11b, or 802.11a, or 802.11g wireless cards, same thing. Antenna, low noise amplifier, and then you may have a bunch of processing. And commonly, you have a bunch of analog processing. And then, you convert the analog to a digital signal. OK, I recall last week I asked somebody in class here, how would we transmit the signal from point A to point B without it being impacted way too much by noise, and he said, oh, go digital. Good point. OK, so if I go digital, I can transfer the signal without noise being a real factor. But the analog to digital converters need the signal strengths to be a given value before it can chop it up into digital levels. OK, so an amplifier is very fundamental. OK, and so in this case, what may be a signal of a few tens of microvolts to be amplified to some large enough value that it can be further processed. So, that's application of amplification in the analog domain. Let me talk about amplification in the digital domain. So, that's in the analog domain. This amplification is in the domain that I have both analog and digital. OK, and now let me talk about amplification in the digital domain, OK? I'm going to argue that amplification is absolutely foundational to the digital domain. OK, the digital abstraction would not occur if I did not have basic amplification. OK, and the next minute and 37 seconds I will prove that to you, OK? So, let's do so. So, let's suppose I have a very simple digital system, and the system simply contains a pair of inverters. So, if I send a one here, it's a zero here and a one here, which is a very simple, trivial, digital system. And here's the input. Here's the output. And we said that for digital systems of this sort to work, they have to follow a static discipline. OK, our signals and our circuits must follow a discipline for them all to work together. And, the discipline we described comprised of signals adhering to certain voltage thresholds so that all the components in the system could agree on what comprised a zero, and what comprised a one, OK? So the way we did that was we said that you would have a threshold called VIH, V input high, and another threshold called VIL, V input low. OK, and we said that this circuit must recognize signals that are higher than VIH, 3 V for example as a one, and simultaneously, any signal that has a voltage level less than VIL, say, two volts, should be recognized as a zero. That was the input constraint. On the output, it had a similar set of constraints, where we had tougher constraints on devices, where we said that the output had to satisfy a output low constraint, output high constraint. What this said is that for this circuit to be called a good digital circuit that satisfies the static discipline, signals that were ones here should be recognized as such. And if I am producing a one as an output, then the signal level should be higher than VOH. Similarly, if the signal's a zero, then it should be less than VOL. So as an example, this may be 2 V, this may be 3 V, and this may be 4 V, and this may be 1 V. OK, so input, I should recognize 2 V and less as a zero, but at the output I have to produce a very, very low value, 1 V. So, I have some noise margin. So as an example, say if I made a plot of the input/output, so I get my VIL here and VIH here. This is time. This would comprise a valid digital signal: zero, one, zero, one, and so on. OK, now, I had a tougher set of constraints at the output. I would have VOL, VOH. So, at the output, OK, I'm required to stretch the ones and zeros to be further apart from each other so that I get noise margin, and the corresponding signal for our little circuit there would look like so. Right, if this is a valid input, then this would be the corresponding, valid output. OK, and need I say more? OK, you can see that, intuitively, look, there's amplification happening here, and the reason is that VOL is chosen to be less than VIL, and VOH is higher than VIH. So therefore, the signal has to be stretched. The signal has to be amplified. OK, and what's the minimum amplification needed for the system to work? The minimum amplification is if I had a signal that looked like this. OK, that barely skimmed the VIL, VIH level. OK, so if signal were this high peak to peak, VIH minus VIL, and what's the absolute minimum signal at the output? It would look something like this. OK, barely skimming VOL and VOH, OK, so the corresponding output level would be VOH minus VOL. OK, so this is the absolute minimum amplification that my digital circuit has to provide. OK, and notice, VOH is larger than VIH. VOL is smaller than VIL. Therefore, this quantity needs to be greater than one. OK, so I've shown you both a simple, graphical, intuitive explanation, and this is a slightly more formal proof that even the digital circuit really requires to have amplification built into it, if it is to satisfy valid static disciplines. Yes? Yes. The question is, is that the same as gain? Good question. Yes, the term amplification has many, many variants. You could say gain. You could say amplification. You could say increase in signal strength, and so on and so forth. And in fact, when talking about low noise amplifiers, people sometimes talk about having the low noise, high gain amplifier at the input stage. OK, so let me pause there in terms of motivation. So, I believe I've motivated every which way: pure analog, analog/digital, and digital. OK, so I've covered every single base here. And so, we need amplification. OK, so let's look at how to build a fundamental, primitive device called the amplifier. Before we do that, however, let me take a quick detour. It will be convenient for me, as I show you how to build an amplifier, to introduce a new device, a new element, called the dependent source. OK, let me introduce a new device for your arsenal of devices, along with resistors, You learned about a MOSFET, a switch, voltage source, current source, and now a dependent source. So, a dependent source looks like this, OK, has an output port, and has a control port. So, a dependent source in its simplest form has two ports: an input port and an output port. Remember, a port is a convenient pairing of terminals, and I apply signals to such terminal pairs. But this is a abstract diagram for a dependent source, and to get a little bit more specific, let me show you an example of a dependent source. So, let's say, here's my input, and I label the terminal variables for the input. VC is the voltage applied to the input, and IC is the current into this terminal here. And, here is the symbol for the dependent source. Much like a current source or a voltage source has a circle around it, the corresponding symbol for a dependent source is like so. So this example, for instance, is a dependent, current source. I can apply the corresponding output variables, I0, OK, and I can say that the current, I, is some function. In this example, I've designed the example that the current through the current source, I, is some function of the input voltage or the control voltage, VC. OK, so notice that the current through a current source, the current through this current source, I, is some function of another variable. OK, in this example, it's the voltage across its control port. Not surprisingly, this device is called a voltage controlled current source -- -- or a VCCS. So, in like manner I can also devise other forms of sources. You can think of this is a device where a voltage controls an output current. You can think of all other combinations, current controlling current, voltage controlling voltage, current controlling voltage, and so on. So, another example, I give you another dependent source, and in this situation, my output current is controlled by an input current, VC. IC rather. And I claim that I for this one is some function of a current, IC. OK, it's another dependent source where the output current for its output port is related to the current, IC. And, this is a current controlled current source. OK, it's a current controlled current source. And, if I had lots of time on my hands, and I was wanting to kill time, I'd sit around drawing for you, other types of dependent sources. I would draw for you a current controlled voltage sourced, and I could also draw for you a voltage controlled voltage source. OK, so that's an abstract diagram for such a source. And so, let's do a few examples involving elements like this. To begin, just so you can build up your intuition, let me start by doing a very simple circuit, involving an independent current source, OK, just so we can relate back to what we've been doing so far. So, let's say I have some resistor, and I have a standard current source with current I nought. This is an independent current source. Remember the circle? And, some resistor, R, and let's say I care about the voltage across the resistor. OK, so I have a current I nought flowing through it. So, I can very quickly write down VR as, simply, I0 R. OK, it's the drop across the resistor when a current I nought flows through it. OK, so this is what you've been used to doing. Correspondingly, I can do an example with a dependent current source. And, as an example, I'll use a voltage controlled current source. OK, a voltage controlled current source is a dependent current source whose output current depends on the voltage applied at the control port of the current source. So let me build a little circuit. OK, so here's my current. And let's say it's VC IC for the control port, and similarly, let's say my current I here is some function of the control port voltage. And let's say, to be specific, there is some K over VC, some function. OK, there are a variety of dependent sources that can be built, and here's a hypothetical device where the output current is mathematically related to the input in the following manner. So, let me build a circuit of the following form. So, let's add the resistor, R, and here's my circuit, OK? And, as before, let me look to figuring out what VR is. So, notice that I have to supply some voltage at the input so that the output can depend on the input because right now I don't know what the input here. So what I'll do is let me apply VR over here. OK, so let me make this connection. OK, let me make the connection from here to here. What I've done is I've applied VR at the control port of the dependent current source. OK, and I often draw a circuit like this. This looks pretty messy. I will often draw the circuit like so: R, VR. OK, short form circuit drawing would look like this. This is a complete drawing that I show you the explicit connections of the control port, but oftentimes, when the control port does not have any other impact in the circuit, you can eliminate, don't explicitly show the control port. Rather, you can simply show the dependence of the output current on whatever circuit variable you have in mind. So, you can draw the diamond like this, and see its current is some function of VR. VR in this is case is K divided by VR, OK? OK, so let's go ahead and analyze this little circuit here, and look at what this might give us. Our goal, as before, is to find out the value, VR. So, in this case, let's apply the Node method to this node, and sum the currents into that node to be zero. OK, so sum the currents going into that node to be zero. The current going down is simply VR divided by R. OK, and that is equal to the current that is going out of the node. And so that is equal to F of VR. And I know that F of VR is given by K divided by VR. OK, a simple application of the Node method. So then, I collect VR's on the left hand side, and I get VR squared is K times R, OK, and VR is simply the square root of KR. There you go: I'm done. OK, I've gone ahead an applied the Node method to this, and when have to figure out the current here, I simply reflect the fact that it depends on VR like so, and I just go ahead and solve the circuit. Remember, the workhorse of the circuit industry, the Node method, when in doubt, apply it. It simply works. And notice, this is a nonlinear circuit. OK, the dependence is nonlinear, and I get the response like so. So, to plug in some numbers, supposing K was 10 to the minus 3 amperes per volt, and R was one kilo ohm, then I can plug the numbers in and the kilo here cancels with the 10 to the minus 3, and I get VR equals 1 V. OK, this simply says, if I build a circuit like this, then this voltage here will be 1 V. So, again, as long as you remember that the dependent source is simply another little circuit element, OK, and you usually draw just the output port for dependent sources, and reflect the way that the control affects the current, that'll suffice, and you get, through the application of the Node method, the variable you're interested in. Let's do another example, OK, of another fun current source, a voltage controlled current source, and look at it this way. So, let's say I have a resistor, and I have a current source, a resistor, RL, and this goes to some, I apply a VS here. Remember this short form notation; that's simply applying a supply VS between that node and the ground. OK, and let us say the current IV through the device is some function of the current at its control port. OK, so I'm not going to show you that. But remember that the device already looks like this, that there is a control port here. I'm not showing that to you. And let us say that I apply some voltage, VI, to the input port. The reason we often don't show the input port is for many practical dependent sources, the input has no other effect on the circuit. So, for example, in this case, the input has infinite resistance looking in. So therefore, if I apply a VI here, it doesn't draw any current from VI. I simply apply the voltage, VI. It doesn't affect the circuit in any other way except in terms of how it controls the current ID. So let's say the current ID is some function of VI because VI is applied at the control port. OK, and as I pointed out before, I oftentimes, just for clarity, just to show this dependent source explicitly. OK, so let's work the example. So as I said, I'm going to choose ID to be F of VI, and let's pick some specific parameters here. Let's say it's K by two VI minus one, both squared. OK, and let's say this is true for VI less than equal to one volt. And let us also say that ID equals zero for VI less than one volt. OK, it's a dependent source, and it can have various forms of dependences on the input. And, I just picked an example of some hypothetical, or as yet, hypothetical dependent source, the current through which is related to the input using a square law relation, VI minus one all squared as long as VI is greater than one. And if VI is less than one, then the current is simply zero, it shuts off. So, I can go ahead and apply. So, let's say I want to find out V0 versus VI. So, I care about finding out V0. V0 is the voltage of this node with respect to ground. OK, so it's a slightly more complicated circuit than you saw up here, than you saw up there. So, let's go ahead and do this example. Start by applying the workhorse of the circuits business, the Node method, and let's start with doing this for VI. Let's first do it for VI greater than one, notice the behavior of this is different for different ranges of VI. So let's first do it for VI greater than or equal to one and apply the Node method. Node method says sum the currents going into this node; we know the voltage at this node. It's VI. We know the voltage at this node. It's VS. OK, the only unknown is V nought. And so, let's go ahead and write the node equations for that node. So, the current going up, let me simply equate the current going up to the current that has been supplied by this particular node here. And, that should equate that the two of them should sum to zero, the current going up plus the current going down should sum to zero. So, I get V0 minus VS divided by R. That's the current going up. Plus, the current going down must sum to zero, plus ID must sum to zero. And ID is going to be K divided by two VI minus one all squared. That must equal zero. Straightforward application of Node method, current going up plus the current going down at this node should equal zero because the total current leaving the node must be zero, OK? So I can go ahead and simplify this, multiply it throughout by, I call this RL here. So, multiply it throughout by RL, and move all of this to the other side, so I get VS divided by RL, multiply it throughout by RL. I get VS at this side. I take this term to the other side. This becomes a minus. RL multiplies here, so I get KRL. That's the expression I get. V nought is VS minus KRL divided by two times VI minus one all squared. Let me put a box around this because I will be referring to this more times in 6.002 for a variety of reasons than probably any other equation on Earth. OK, this is the first time you saw it. You saw it here. OK, mark it down. You'll smile every other time you look at it in quizzes, and you will find out why this comes up very often in 6.002. So, I'll just give you a few seconds to savor this big moment in your 6.002 life. All right, OK, so it's pretty simple actually. I mean, there's really not much. A lot of this stuff is just a plain old, simple application of the Node method, and things just fall out. It's just so simple. So, the V nought, I apply the Node method, I get V nought for this nonlinear circuit. I can also it for VI less than one. For VI less than one, when VI is less than one, what happens? ID is zero. OK, since ID is zero, think of this as an open circuit. OK, so there's no voltage drop across RL. And, this voltage V nought is equal to VS. So, I like to see things in pictures. I'm not an equations kind of person. I'm much more of a graphical person. So, let me draw a little graph to show how V nought, to see the form of V nought, and then let's study that little system a little bit more carefully. So, this is page seven, and we plot V nought versus VI for you. And let's take a look at how this really simple circuit looks. This has got nothing. It's got an RL resistor connected to a supply, and a dependent current source, and I apply some voltage VI at the input. It's a very, very simple circuit. So, let's see. So as long as VI is less than one, the output stays at VS. OK, that makes intuitive sense, right? As long as the current here is zero, this is like an open circuit here. If this is an open circuit, then effectively, V nought is simply the voltage VS. V nought simply appears here. If you want to grunge through KVL and KCL, go ahead. VS minus RL times the current is V nought, and the current is zero so it's, yes. So, this is simply VS. When VI goes above one volt, fun stuff begins to happen. OK, when V nought goes above one volt, then this equation applies because VI is greater than one. This equation applies. And, when VI is a one, one minus one is zero. This term cancels out, so this is VS. OK, phew! So, I start off here. As VI increases, what happens now? As VI increases, this term here becomes increasingly negative, OK, subtracting from VS. OK, so I get some behavior like this. V nought begins to drop. And it makes intuitive sense, right? As ID begins to increase, the voltage here will begin to drop because I'm drawing more and more current through RL. I'm dropping more and more across RL. So more and more drops across RL, so V nought begins to drop too. So, it looks something like this. I'll show you a little demo, but my claim is that you have just seen an amplifier. Whoa. You just saw an amplifier. So, I snuck an amplifier by you, OK? So, I just snuck an amplifier past you. I'll show you why in a second. So, let's take a look at this waveform here. Let's not worry about what happens way down here. We'll talk about that a little later. But, look at this curve here. I claim there is amplification in the following sense. Focus on some change in the input voltage, delta VI, OK, and for that change in input voltage, I get some change in the output voltage. OK, for some change in the input voltage, delta VI, I get some change in the output voltage. And guess what? In this, at least the way I have drawn it, delta V nought divided by delta VI, if I can find regions of the curve where this is greater than one, then I have amplification. OK, so what's that saying? What that's saying is that if I apply some voltage here, OK, and I change that voltage by a small amount from, let's say, 2 V to 2.1. OK, I am going to find the output voltage. Let's say I go from 2 V to 2.1 here. OK, abstractly out there, I might have an output that goes from three to, let's say, two V perhaps. OK, so for a 0.1 change here, I'm going to get a bigger drop here, so from 3 V to 2 V, giving me an amplification in this little circuit. OK, so we'll see this again and again, and you'll really understand it. So, I have a small change in the input, and I have a corresponding larger change in the output. So, I've shown you an amplifier. I haven't shown you a linear amplifier. There's an extra charge for that. OK, that'll happen later. OK, all I've shown you so far is an amplifier, and this happens to be a crummy amplifier. It's a nonlinear amplifier because, notice, this is not linear. It's a nice little curve, and so it's not linear. But, I promised you an amplifier, and I'm cheap, and that's all you get for now. OK, we'll see linear stuff later, but for now, I have a little amplifier. So, let's do some real numbers, and plot some numbers down, and also look at a demo. So, let's do an example. Let's say VS is 10 V, that the K is two milliamps per V squared, and let's say RL is five kilo-ohms, OK? So, let me substitute these values into that equation, and I get V nought is, VS is ten. So, it's ten minus, KRL divided by two. So, K is two milliamps. Two milliamps times five kilo-ohms is ten divided by two gives me five, and VI minus one squared. That's what I have. I just plug in a bunch of numbers, and that's what I get. So, what I'll do is let me just do a little table for you, and plot using real numbers, simply plot those values for you. MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Please use the following citation format: Anant Agarwal, 6.002 Circuits and Electronics, Spring 2007 (Massachusetts Institute of Technology: MIT OpenCourseWare). http://ocw.mit.edu (accessed MM DD, YYYY). License: Creative Commons Attribution-Noncommercial-Share Alike. Note: Please use the actual date you accessed this material in your citation. For more information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Transcript – Lecture 9a All right. Let's get started. I guess this watch is a couple minutes fast. First a quick announcement. In case you have forgotten, your lab notebooks are due tomorrow with the post-lab exercises for the first lab. OK, so I am going to continue with amplifiers today. And to just give you a sense of where we headed, we have this five lecture sequence covering different aspects of amplifiers with dependent sources and showed how we could build an amplifier with it on Tuesday. Today I am going to show you a real device that implements a dependent source. And then next Tuesday we will talk about analysis of an amplifier. Wednesday is our quiz. Thursday and the Tuesday after that we then talk about small signal analysis and small signal use of the amplifier. Today we will talk about the MOSFET amplifier. So let's start with a quick review. And in the last lecture, I showed you that I could build a amplifier using a dependent source. And a dependent source worked as follows. Let's say I had a circuit and I connected a dependent source into the circuit. Let's say in this example I have a current source. So this is some circuit. And the current i is a function of some parameter in the circuit. That's why this is a dependent source. This is a dependent current source. So it could be that I have some element inside. And I measure, I sample the voltage across the element or between any two points in the circuit. And, in this little example here, this current could be dependent on that voltage. So notice that although I showed you the two terminals of the dependent source that carried a current, there is another implicit port, another implicit terminal there. And that terminal there is called the "control port" of the dependent source at which I apply a voltage or current that will control the value of the current source. As a quick aside. There is a small glitch with the tools in your tool chest. We talked about the superposition technique where you were taught to turn on one source at a time, for a linear circuit one source at a time, and then sum up the responses to all the sources acting one at a time. Well, what do you do about dependent sources? A dependent source is a source. And we have to modify the superposition statement just a little bit. And for details you can look at Section 3.5.1 of your course notes on the details and some examples on how to do this. So the approach is very simple, actually. The approach is, for the purpose of superposition, to not treat your dependent source as sources that you turn on and turn off. So what you do is when you do superposition with dependent sources simply leave all your dependent sources in the circuit. Just leave them in there and turn on and off only your independent sources. So look at the response of the circuit by turning on your independent sources one at a time and summing up the responses. And your dependent sources stay within the circuit and simply analyze them as you do anything else. So essentially what it says is that just be a little cautious when you have dependent sources, but the basic method applies almost without any change. The readings for today's lecture are Section 7.3 to 7.6. So since we are going to build up on the dependent source amplifier, let me start with a quick review of that amplifier. We built our amplifier as follows. We connected our dependent source in the following manner. And the current through the dependent source in the example we took was related to an input voltage vI. So some voltage vI. And so these two were the control port of the dependent source and a vI was applied there. And I showed you a simple amplifier built with a dependent source that behaved in this manner. And again I will keep reminding you, just remember that the dependent source is actually this box here, the control port and the output port. And commonly we don't explicitly show the control port for those dependent sources for which the control port does not have any other affect on the circuit, like it doesn't draw any current or things like that. So in this particular example we said that this behaved in the following manner for vI greater than or equal to 1 volt and iD was zero otherwise. So we can analyze the circuit to figure out what vO is going to look like. And a simple application of KVL at this loop here, again, you know, when I say this loop here, I am pointing at something here. That is the VS source that is implicitly across these two nodes. Again, this is a shorthand notation where this little up arrow here implies that I have a voltage source connected between these two terminals here. And so there is a loop here that involves VS. So Vo is simply VS minus the drop across this resistor. So it's VS minus the drop across this resistor gives me vO. And the drop across the resistor is simply iD RL. iD is the current here and that's the drop across the resistor. And I could get the explicit relationship of vO versus vI by substituting for iD as vI minus one all squared. So vO relates to vI in the following manner. Nothing new so far. I have pretty much reviewed what we did the last time. Here is where we take our next step forward with some new material. Up to now I have talked as a theoretician would where I said just imagine that you had spherical cow or something like that. Here I just asked you to imagine this ideal dependent source, control port and an output port, and it behaved in this manner. So as a next step what I would like to do is show you a practical dependent source which turns out to be a little bit more complicated than this idealized dependent source that I showed you in many dimensions. Real life tends to impose a bunch of practical constraints on you, and we will look at those in a second. If I could find a dependent source that looked like this -- We had a control port A prime and output port B prime. And I looked at some examples where the current through the dependent current source was some function of the input voltage. This is a "voltage controlled current source". What I am going to do is talk about a device that can give me this behavior or some close approximation to it. It turns out that under certain conditions the MOSFET that you have already looked at behaves in this manner. The MOSFET that you've seen sort of behaves like this. And let me show you under what conditions the MOSFET behaves in that manner. Let me create some room for myself. Notice that I need a control port, needed an output port. And I am going to view my MOSFET in a slightly different manner than you have seen before. I draw these two terminals here. And this was a three terminal MOSFET. This was my drain, my gate and my source terminal. It was a three terminal device, but what I do is I view the MOSFET slightly differently. I will just use this terminal to be common across both the gate and the drain. And so this voltage here is vGS. I am just using the source port, the source terminal along with the gate as a terminal pair. I am using the same source along with the drain as another terminal pair. So I have a vDS out there and I have some current iDS that flows out here. Notice that when I view the MOSFET in this manner I have accomplished my first step, which is I seem to have a box which has a port here and a port here. And I also explained to you that a MOSFET behaves in a particular manner. For one, the output port behaved as an open circuit under certain conditions when -- This was vGS, G, drain and source. When vGS was less than a threshold voltage VT this MOSFET had an equivalent circuit that looked like this. So when vGS was less than some threshold voltage VT then there was an open circuit between the drain and the source. And you saw this before. So far nothing new here. However, when vGS is greater than or equal to VT -- vGS was greater than VT. The MOSFET behavior we looked at earlier showed that this behaved either like a short circuit in the simplest form or in a slightly more detailed form it behaved like a resistor. We call that the SR model of the MOSFET. So when vGS was greater than VT we said that a simple way to approximate MOSFET behavior was to view this as a resistor connected between the drain and the source. That was our SR model use of the MOSFET. It turns out that we kind of lied. We were sort of looking at the MOSFET in a really funny way. And I shone the light on the MOSFET in a really, really clever way. Well, I shouldn't say clever. A really, really tricky way. And tricked you into believing that it was just a resistor. And we constrained how you use the MOSFET. So that behavior was indeed a resistive behavior. But it turns out that in real life the behavior of the MOSFET between the drain and the source terminals is much more complicated than the limited form in which you saw it. So today what I am going to do is take the wraps off the complete MOSFET and show you its full behavior in all its gory glory. And I will spend a bit of time on that to clearly emphasize under what conditions the MOSFET behaves like a resistor, as you saw when you did digital circuits, or behaves differently in other domains of use. Let me pause for a second and leave this space blank here. And let's do some investigations. Let me leave this here. I won't draw in anything yet. You will figure out what it looks like yourselves under certain conditions. What I will do next is apply some voltages on a MOSFET and observe the current versus vDS behavior and plot that on a scope and take a look at it. What I am going to do -- -- is figure out what iDS looks like for -- Remember iG into the gate for 6.002 is always going to be zero. In much more detailed analyses of the MOSFET, in future courses you may see slightly more complex behavior. But as far as we are concerned it is an open circuit looking into the gate. So I am going to apply a vGS across the MOSFET, apply a vDS across the MOSFET and plot iDS versus vDS. First let me show you what you already know. What you already know -- This is vDS. I will just keep doing as much as I can of what you already know. And then when I do some new stuff I will tell you explicitly. You've seen this before. The MOSFET behaves like an open circuit when vGS less than VT. That is when vG is less than a threshold voltage VT, I have zero current flowing through the MOSFET. And when vGS was greater than VT then the S model of the MOSFET the switch model simply said that look, we can model the D2S as a short circuit. You saw this in your labs and you saw that it was a very, very small resistance between the drain and the source and it kind of looked like a short circuit. But then we said well, that's not quite it. There is some resistance. And so we said a slightly more accurate model would have this line droop a little bit to imply that there was some resistance R_on between the drain and the source, so vDS iDS. So this was when vGS less than VT and vGS greater than or equal to VT. I have some resistance. And that showed me a straight line kind of like behavior. And I showed you that behavior. So far absolutely nothing new. Now what I have plotted there for you is that behavior. Up here notice that this is the vDS axis, this is the iDS axis. I am plotting iDS versus vDS. And when vGS -- The gate voltage is more than a threshold, notice that I see what looks like something more or less like a straight line. And this is a straight line with some slope, more or less a straight line implying resistive behavior. And we also had some fun and games here. We said hey, what if I turn vGS off? Boom. That would be my iDS of zero implying that the MOSFET behaved like an open circuit between the drain and the source. I applied a positive vGS more than VT and it began to look like a resistor. Open circuit, resistor, open circuit, resistor, OK? Up until now nothing new. So you shouldn't have learned anything at all that is new until now in today's lecture. Now watch. What I am going to do is, as I said, I kind of lied all this time and I just showed you this behavior. And what I have been doing all along is very carefully using a very small value of vDS. Notice it's a small values of vDS. I haven't told you what it looks like as vDS increases. Well, let's go try it out. We have a scope here. We have the MOSFET here. Now, I am not sure what is going to happen now. You may see smoke or have an explosion, who knows what? But look up there for a second. I am just going to increase vDS and you can figure out what happens for yourselves. I increase vDS. Whoa, what a liar. Agarwal is a liar. I have been kind of tricking you. I have been putting -- Covering up all this part here and showing you just this region of the curve for small values of vDS. But as I increase vDS this is nothing that looks even close to that of resistive behavior. So what's happening here? What's happening is that as I increase my vDS the iDS curve tails off and saturates at some value of current. Notice it saturates at some value of current. And so I am going to look at this region of behavior. Notice that what we have looked at so far was the behavior for small vDS. It kind of looks resistive. But when I pump up the vDS, really whack this node really hard with a much larger vDS the guy says, oh, I give up. And the current saturates out and flattens out and holds the value steady at some value. So what's that behavior look like? What is my horizontal line above the X axis in terms of V I elements? What is that behavior like? Current source, exactly. So this is current source like behavior. And so let me start by drawing you a little model and explaining it in more detail. What happens is that under certain conditions, and the conditions are the following, when vDS, that is my drain to source voltage is greater than or equal to vGS minus VT. When my drain voltage goes above vGS minus VT, so if vGS is 3 volts and if VT is 1 volt, then if vDS goes above 2 volts, if I am hammering the drain of the MOSFET with a higher voltage then this guy says I give up, can't show you nice restive behavior, and the current saturates out and it doesn't allow you draw any more current than a maximum value. And that's the current source behavior. This one behaves like a current source. And the current iDS is given by the following expression. The current is given by iDS is equal to a constant K divide by two times (vGS-VT) all squared. Kind of reminiscent of the carefully chosen dependent source example, just that this one here is VT. This model, which applies when vGS is greater than VT, the MOSFET has to be on and the drain to source voltage in the MOSFET must be larger than some value, and that value is vGS minus VT then this guy begins to behave like a current source. This model of the MOSFET is called the "switch current source model". So in the region of the MOSFET characteristics where vGS is greater than VT and the drain to source voltage is larger than vGS minus VT, the MOSFET behaved like a current source between its drain and source terminals. And in that part we model the MOSFET as a current source. And so not surprisingly that part of the model is called the SCS model in contrast with the SR model where we had a resistor. Again, remember, this is not meant to be conflicting. It is not like gee, how can the MOSFET look like a resistor, and then suddenly what happens it becomes a current source. Well, the two regions are different. It is not that it is behaving as a current source for the same parameters, no. When vDS is less than this right-hand side it does behave resistive. The SR model applies. But increase vDS beyond a point, the current saturates and the SCS applies like so. So let's draw. The SCS behavior can be drawn here vDS and iDS. As I mentioned to you, for small values of vDS, let's say I pick some value of vGS, let's say vGS3, some value vGS, it is going to look like a resistor until vDS becomes equal to vGS3 minus VT. And after that it saturates out and begins to look like a current source. And this point is where vDS becomes equal to vGS minus VT. And this way is when this equal sign becomes a greater than sign, vDS becomes larger then I move into this part of the curve. Similarly, for various other values of vGS it will look like this -- -- and so on. And it behaved like an open circuit as before when vGS less than VT. When vGS less than VT it is still behaving like an open circuit. And so as I increase my vGS, provided I keep my vDS greater than vGS minus VT, I get current source like behavior. And notice that this is increasing vGS. I have purposely drawn these curves at greater distances from each other to imply that it is a nonlinear relationship in that if I increase vGS by some amount, the increase in vDS is related to the square of vGS. It is vGS minus VT all squared. So I get a family of curves of that look like this. And this is in the region of operation where vDS equals vGS minus VT. And this applies in this regime where vDS less than vGS minus VT. This region of operation is called, as you might expect, the "saturation region". We say the MOSFET has been hammered, the MOSFET has been walloped, the MOSFET is in saturation. So the MOSFET is in saturation. This region, corresponding to this, is called the triode region. This is really very simple. All we are doing is saying that when vDS is increased beyond a certain limit, given my vGS minus VT, the MOSFET begins to behave like a current source. It cannot draw any more current. It limits the current to a given value like a current source. But on the left-hand side of this it behaves in a resistive manner. So what I would like to do is -- What I will do is, we've plotted for you, for the MOSFET, all its characteristics in its full glory for a whole bunch of values of vGS and a whole bunch of values of vDS. And let me stare at those curves with you for a few seconds and walk you through them. So what do I have here? One of these curves corresponds to a given value of vGS. This may be vGS equals 2 volts. This is vDS, the drain to source voltage, and this is the current. So focus on this curve for now. In the beginning I hid the right-hand side behavior from you and showed you just the resistive behavior out here. When I increase vDS to be much larger the curve saturated and I got the saturation region operation of the MOSFET. And notice as I increase my value of vGS the saturation current also increases according to a square law behavior. So these are the entire curves of the MOSFET. Finally the truth comes out. And notice that when vDS is less than vGS minus VT, I have more or less resistive behavior. But when vDS is greater than vGS minus VT I get current source like behavior. So one question you may ask is when do I use one model or the other? When do I use the SR model and when do I use the SCS model? If you want to do a real detailed analysis then you can use the SR model when vDS is less than vGS minus VT. And you would use this model when vDS is greater than or equal to vGS minus VT. That is simple enough. In 6.002, to eliminate confusion we constrain how we look at things a little bit more stringently. And what we do is that for our entire digital analysis, for the entire digital world we focus on the SR model. And I will tell you why in a second. So for all digital circuits, invertors, look at power of invertors, look at delay, a bunch of other things, we will be using the SR model in 6.002. And I will tell you why in a second. And for analog -- That is for amplifier designs and situations like that, we will be operating the MOSFET in a saturation region. And I will talk about that in a second. What I am saying here is that in 6.002, when we do analog designs, we are going to discipline ourselves to using the MOSFET only in this region. We are going to constrain ourselves to play in only this region of the playground where vDS is quite large. Why? Because I am asking you to. I am saying let's play in that part of the playground and keep your vDS high. And so the MOSFET is going to be operating somewhere in here. So we can apply just the SCS model, just the current source behavior in that region. There is another important reason, which I will get to in a second. And for digital designs we will simply use the SR model. And it turns out that this is realistic because in the digital designs that you have you seen and will be seeing in this course, the pull down MOSFET is on, or when these pull down MOSFETs are on, the output voltage is pulled down close to ground. So vDS is very, very small. So it does make sense that this model apply. And when we talk about amplifiers, I am asking you to follow this discipline. I will tell you why in a second. I am saying analog designs follow this discipline that I call the saturation discipline. It says simply operate the MOSFET operating in saturation as a current source. We will look at an amplifier in a second, and I will tell you why. Now let's do a MOSFET amplifier. Remember my amplifier had an input port and an output port. And in general in our use we are going to have a common ground. And we have a VS and a ground here as well. That is the power port of the amplifier. The input port and the output port. And let me redraw the circuit putting a MOSFET in place of the current source, RL, VS, vO, drain, gate, source, vI. So my input is vI. Again, the MOSFET output is vO. And I have a resistor RL. Hey, we've seen that before. It turns out this is not surprising. You've seen this before. This was our primitive inverter circuit. So what's different here? We showed you the circuit as an inverter. What's different here is that when we look at MOSFET behavior as a current source, this behaves like an amplifier. In other words, when vDS is greater than some value then this behaves like a current source. When vDS is small, in other words, in the digital design when vDS was small here, because when the MOSFET was on it pulled the voltage down to ground, we could view this behavior as a resistor. And exactly the same thing, it is an amplifier. And with digital designs, I was driving it with 5 volts and 0 volts and that was it, rail to rail. As an amplifier, what I am doing now is looking at a small region of its behavior when vDS is greater than vGS minus VT. What I am saying is that for amplification let's follow the saturation discipline. And the reason is that when this behaves like a current source, what I have shown you is that if this behaves like a current source I have shown you that this expression up here gives you amplification. In last lecture we plotted a bunch of values for vO versus vI, and we saw that we were getting amplification. For a small change in vI, I was getting a larger change in vO, and that was when I had the equation for a current source in there. And so we know for a fact that if I can operate this as a current source, with a reasonable choice of values here, I am going to be able to get amplification. What I haven't told you is if this is operated in the linear region, in fact, you do not get amplification. I won't cover that, but you can check that out in your course notes as a discussion or you can try it out for yourself. Replace this with the SR model for small vDS and you can show yourselves that you don't get any amplification. In order to get the amplification we are telling ourselves let's focus on this part of the playground where vDS is greater than or equal to vGS minus VT. And for vGS greater than or equal to VT. So when vGS is greater than VT the MOSFET is on. Further, when vDS is large, larger than vGS minus VT this behaves like a current source. So we have now created a small playground for ourselves where we can build lots of fun little amplifiers and other circuits. And provided our circuits follow the saturation discipline where for the MOSFET or MOSFETs in the circuit these expressions are true then the MOSFETs are going to be in saturation, the current source model applies, and I will be indeed getting saturation. In future courses you may actually see the MOSFET used in other regimes of operation for a variety of reasons. But in 6.002 when we talk about amplifiers and so on we will be adopting the saturation discipline. And your homework problems and so on will state that. Assume that the MOSFETs are in saturation. What that means is that you can begin to model them as a current source and simply analyze their behavior accordingly. One minor nit. Note that vDS for the MOSFET is the same as vO. And vGS for the MOSFET is the same as vI. So if you see me jumping back and forth using vOs and vIs or vDSs and vGSs they are the same thing in this circuit. If you are dealing with circuits with many MOSFETs then you will have vDS1s and vGS1s and so on and so forth. But for this simple circuit, vO and vDS are the same, vI and vGS are the same. So we could go ahead and analyze that circuit. What I do to analyze the circuit, I am telling you this. I am telling you that the MOSFET is behaving in saturation. I am telling you this. We have disciplined ourselves to say that in that circuit the MOSFET is in saturation. As soon as we tell you that we can then go ahead and analyze that circuit. And to analyze that circuit what you will do is simply replace the MOSFET with its equivalent model, and that looks like this. Since you have been told that it is in saturation, we can replace the MOSFET with its current source model. And the current iDS for the MOSFET is given by K/2(vI-VT)^2. And it is always good to write the constraints under which you are implicitly working close by. So the constraints are one, vGS is greater than or equal to VT, vDS is greater than or equal to vGS minus VT. These constraints immediately follow from a statement of the type we are operating under the saturation discipline or the MOSFET is in saturation. Let me just mark this equation as A, and we will refer to it again. So with this new little circuit with the MOSFET working as a current source, let's go ahead and analyze our amplifier. Notice that to analyze the circuit I have a current source. It's a dependent current source where the current depends on the square of the input. So I want to go and analyze it. This is a nonlinear circuit. So I can apply any one of the methods that we talked about last week for nonlinear circuits. To analyze it I will go ahead and use the analytical method. And my goal will be to obtain vO versus vI. Again, remember where are we here? The MOSFET circuit operating in saturation so I can replace this with a current source. It is nonlinear. And so I can apply one of the two methods, the analytical method or the graphical method. Let's do both and start with the analytical method. The analytical method simply says go forth, apply the node method and solve. Simple stuff. Let's go ahead and do that. Node method. I have a single node here that is of interest. I know the voltage vI at this node. I know the voltage VS at this node. So the only unknown is here at vO. So I will go ahead and do that. Let me go ahead and equate the currents into the node to be zero. So the currents out of the node here are iDS. And that was equal the current into that same node. So iDS must equal VS minus vO divided by RL. iDS=VS-vO/RL. For later reference, let me call that B. Simplifying, what I can do is, we know that iDS is given by K/2(vI-VT)^2. So I replace iDS with this expression and I multiply that by RL. So I get K/2(vI-VT)RL. So iDS gets multiplied by RL and I get vO on this side and VS remains out here. All I have done is multiplied both sides by RL. So it is RL iDS, taken RL iDS to this side, that is here, I get the minus sign, and VS stays here, vO comes here. So that is my final expression. Remember this is true under certain conditions. I will keep hammering that home because some of the most common errors made by people is in forgetting the constraints under which this was obtained. And the constraint under which this was obtained is the saturation discipline. And that was true when vGS for a MOSFET was greater than or equal to VT and vDS for a MOSFET was greater than or equal to vGS minus VT. I also know that for vGS less than VT, vO=VS. So when vGS is less than VT then this one turns off. That's why it is the SCS model, switch current source model. When vGS is less than zero it turns off and VS directly appears at vO. I would like to stare at this constraint with you for a second, vDS greater than or equal to vGS minus VT here. And vDS is simply vO. I want to rewrite this constraint in terms of iDS. It will come in handy. So iDS is K/2(vI-VT)^2. This is vI-VT. So vI-VT is simply square root of 2iDS/K. In other words, I can write iDS less than or equal to K/2vO^2. So this constraint expressed in terms of iDS is simply iDS less than or equal to K/2vO^2. So all I've done here is analyzed this nonlinear circuit. I can also analyze it using the graphical method. And in order to do that, for my nonlinear circuit, in order to do that, all I have to do is plot. Let's have iDS here and vDS here. And as we did with a nonlinear expo dweeb, what I do is I plot the device characteristics iDS versus vDS. The device characteristics under saturation look like this, so vGS increasing. iDS versus vDS has a bunch of curves that look like current sources of increasing values. That simply reflects equation A. And then I superimpose on top of that the expression that comes up due to equation B which is iDS equals, let me write that down here, iDS equals VS/RL - vO/RL. That's B. And let me plot that. That is a straight line relationship between iDS and vO. And so when vO is zero iDS is VS/RL. And when iDS is zero vO equals VS. Remember, vO and vDS are the same. So this is what I get. This is the straight line corresponding to equation B here. And, as before, we just find the point where the two intersect. Let's say I am given some value of vGS. And let's say I am given some known value of vDS. So for that I can go ahead and find out the corresponding value of iDS from this graph. Just as I told you when we did the expo dweeb stuff, this line here is called a load line. You will be seeing that again and again and again where we have the equation corresponding to the one shown here, the equation written for the output loop superimposed on the device characteristics. That's called a load line. So I can get this point corresponding to the operating point of the MOSFET for this iDS, vDS and vGS by using the graphical method. In the next lecture we are going to look at, given a device of this sort, how do we figure out the boundaries of valid operation so that the MOSFET stays in saturation? MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Please use the following citation format: Anant Agarwal, 6.002 Circuits and Electronics, Spring 2007 (Massachusetts Institute of Technology: MIT OpenCourseWare). http://ocw.mit.edu (accessed MM DD, YYYY). License: Creative Commons Attribution-Noncommercial-Share Alike. Note: Please use the actual date you accessed this material in your citation. For more information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Transcript – Lecture 9b Good morning, all. Let's get going. So I guess you had your quiz review yesterday. I hope you guys didn't beat up on (name of TA) and who else was it? (Name of TA) too much. As you know, the quiz is tomorrow. And unfortunately MIT couldn't give us one big room so we are broken up into three rooms. And you will go to your room based on the first letter of your last name. OK, so today we shall cover a topic called "Large Signal Analysis". So in the last couple lectures we looked at one dependent sources abstractly, and then we looked at an amplifier built using a practical dependent source called the MOSFET. Now, the MOSFET had to be operated in a given region of its operation in order to behave like a current source. And while it behaved like a current source you would get amplification or a FET amplifier. So that was in the past two lectures. What you are going to do today is called large signal analysis, and this is a loaded term. So large signal analysis means something very specific in our business, and I will describe to what that is. This analysis involves looking at a circuit containing, for example, a MOSFET and figuring out how to get that device to operate in a way that the MOSFET was always in saturation. So you had to figure out, based on parameters that you could control, how to establish those parameters so that the circuit operated in a way that the MOSFET was always in saturation. So large signal analysis involves that. And although the examples we use, use the MOSFET, the same kind of analysis can apply to any other device. Remember, your MOSFET is a primitive element that we use as an example in this course. There are other primitive elements that you can use. The course notes, for example, discusses a couple other devices. One is the "bipolar junction transistor", the BJT, and works through a complete example from start to finish involving a circuit containing a bipolar junction transistor. And you can do a large signal analysis of that device as well. It turns out that you need to operate that device in an interesting region of its operating space, and so you can conduct a large signal analysis of a circuit containing that device and figure out how best to operate that circuit. So that is large signal analysis, and we will do an example and explain how this is done using an example today. So to quickly review where we have been so far, we looked at this little structure here, our MOSFET amplifier. Notice that when I write a voltage at a node, that's a short form for saying I am looking at the voltage between the ground node and the node at which the voltage is written down. So VO here and VI applied here. This is a very, very common circuit that we use. To emphasize one more point, in general, in the kind of circuits we look at both in this course and in real life, there are a few patterns that we use very commonly that keep repeating all the time. Very often you don't have to look at every possible permutation and combination of how things could be connected. This sort of connecting thing is very, very, very common. And you will see a lot of this pattern. And we do the equivalent circuit for this. In the equivalent circuit we replace the MOSFET with a dependent source provided this operated in the saturation region. So I will just say while operating under saturation the equivalent circuit would look like this, VO, VI. And IDS for the dependent source was given by K/2 (VI-VT)^2. So this was an amplifier. Here was the equivalent circuit while this device was in saturation. And to operate in saturation, I said that certain properties need to be true for the MOSFET. And there are two properties that need to be true for this to be operating in saturation. One is that its gate to source voltage needs to be greater than VT, so VGS for the MOSFET should be greater than VT. And the second one was that the output voltage needed to be greater than the input voltage minus one threshold drop. And this was the same as VDS for the MOSFET, this was the same as VGS for the MOSFET. So what are we really saying here? What we are saying is that look, we built this circuit using a MOSFET, and it is up to us as engineers to choose its operating points in a way that these two properties hold. For example, to make the first condition true, I can discipline myself to operate such that VI is always greater than VT. Similarly, I can choose VS, RL and VI in a way that this condition is true, which says that the drain to source voltage across my MOSFET drain and source should be greater than VI minus VT. As an example, if VI was 2 volts and VT was, say, 1 volt, then what I am saying is that VO should be greater than or equal to 2 minus 1 or 1 volt. So I need to keep this high, 2, 3, 4, 5, whatever, a high voltage so that this guy stays in saturation. The relevant readings for the material that we are going to cover in the course notes are in 7.5.1 and 7.6. So that is pretty much a review of where we were. We said we could build an amplifier. Its equivalent circuit was shown on the right. And, provided that, I discipline myself to operate in the saturation region or to have the MOSFET operating in the saturation region, then this would work like an amplifier and all would be good with the world. So today -- -- we look at large signal analysis of a circuit. And an example would be this circuit up here containing a MOSFET. And, again, as I mentioned earlier, a large signal analysis is a loaded term in 6.002, or for that matter in circuits. And large signal analysis involves two steps. The first step involves writing down the transfer function of your little circuit. In our case, VO is the output, VI is the input, so involves writing down VO versus VI. Simply write down the transfer function. In other words, the relationship between the output and the input for that circuit. And, in our case, again, we've disciplined ourselves to adhere to the "saturation discipline". And the second part of large signal analysis is to find out the valid input operating range. Find out for the given circuit parameters, let's say I apply a VS and I use some value of RL and I use a given MOSFET, which has a given value of VT. The question then is that what is a valid set of input voltages that would operate the circuit in a way that I would be in saturation. And so find out the valid input range, and this would give me a corresponding output range -- -- for saturation operation of the MOSFET. That is what we will dwell on in the lecture today. So what we are saying here is that if I am careful with how I apply VI for a given value of RL and VS and for a given choice of my MOS transistor then I can stay within saturation provided I select my input voltages carefully. And the analysis that we will go through today will figure out what that range of input voltages is. And, again, I will use this as a motivating example, the MOSFET amplifier. But in general large signal analysis would apply to any other circuit as well. For example, in recitation you may learn about other circuits containing a MOSFET. And you can do a large signal analysis of other circuits containing a MOSFET or you might learn about some other devices like the bipolar junction transistor, and you could do the same kind of analysis for that device. So remember that the MOSFET amplifier here is an example. I will be using that as a driving example to explain large signal analysis. So the first step, as I mentioned earlier, is to get the VO versus VI. And in general for some circuit that you build the output will not even be a voltage. There are certain circuits where the output might be some kind of a current. Let's say I am building some kind of a circuit where I would like the output current or the current through some edge of the circuit to depend on some input. In that case the transfer function would be the output current versus VI. And if I had an input current here it would be output current versus input current, you know, whatever the given problem tells you. So this is under the saturation discipline. And I will not rederive this for you. You can apply a good old technique like the analytical method. Or you can use the graphical method to get the appropriate answer here. I wanted to point out in a quick aside that why do we care about graphical analysis? Once you have the analytical method, why do you care about the graphical method? And a student asked me a question after lecture last Thursday, and it occurred to me that it's not obvious why you need the graphical method. So it turns out that often times you do not have an equation describing the device. So let's say, for example, I am a manufacturer. Let's say I am AMD. As AMD I sit down and my semiconductor division builds a MOSFET. And when you build a MOSFET your experiments and your fabrication division often times doesn't give you an equation with the MOSFET. They build something and then you look at it and you experiment with it. You apply various input voltages and you measure currents and output voltages and so on. And so what you end up getting is a graph that describes the behavior of the MOSFET. And you have seen this in your lab as well, your 2N7000 or was it 2000? 7000. So your 2N7000, the MOSFET you use in the lab also gives you a data sheet. And in that data sheet you see a bunch of curves. So very often devices come with data sheets. And when you have a data sheet but no equation then you can apply the graphical method and solve your circuits. In this example, assuming I can apply the analytical method, here was the expression that I had derived for you in the last lecture. So VO was related to VI using the square law relationship. And we can plot and do other fun stuff with this equation. So here is the input voltage VI. That is my VT. So notice that VO is VS. This is true when VI greater than or equal to VT and VO greater than or equal to VI minus VT. So these are the constraints of the saturation discipline. And in our particular situation when VI was less than VT output would simply be VS. If VI is less than VT the MOSFET would turn off, switch off, and I would have no current flowing through RL, and VS would appear at the output. So until VT, I have VS, and then following that I get the square law behavior articulated by this equation. And this was simply VS-K/2 (VI-VT)(RL^2). So that's the first part. You have seen this before. The transfer function shows that I have a square law dependence between VI and VO. So now I can embark on the second step of my large signal analysis, and my goal is to find the valid input operating range. So what does that mean? What I am looking to do here is, for this little circuit, is drain, source, gate, VI, VO, RL and VS. What I am looking to do is that given the value of the supply VS, RL and a MOSFET, in our case given a MOSFET implies that it is a given value of K and a given value of VT for that MOSFET. So what I am going to do is find out, let's assume VI is my free variable here. So my goal will be to find out the range of VI for which this device stays in saturation. And I will use a couple of methods to do that, and I will use both a combination of a graphical method to give you intuition and then apply analytical analysis to get down to specific answers. So let's start with the intuitive part. So here is VI, VO. I will use the transfer curve VO versus VI to help build intuition here. So that is what it looks like. So the first step, looking at this graph, we know that this point here, that VI needs to be greater than VT to satisfy the first equation. Let me just write down both equations here. So VI greater than or equal to VT is one of them, and VO is greater than VI minus VT is a second equation. And just remember that this is the same as VDS and this is the same as VGS. So VI must be greater than VT for the MOSFET to turn on. And so therefore the valid operating range starts at this point and is somewhere up here. So the first part is pretty easy. Somewhere here -- Somewhere at that point, my output voltage VO. I'm not quite sure what that point is. My output voltage VO, as this keeps falling down, my output voltage VO goes lower than one threshold below VI. And at that point it goes into its triode region, and I need to find out what that point is. So somewhere here I go into my triode region and begin to show a different behavior than the amplifying square law relationship there and go into my triode behavior. So I need to find out what this point is. Once I find out what that point is then this will be my valid operating range. So let's figure out what that point is. At that point the following is true. Certainly VI is greater than VT. And at that point the output goes below one threshold, the input minus one threshold. So at this point the following is true, VO is equal to VI minus VT. At that point the output voltage is equal to the input minus VT. And if the output goes lower then it will violate this equation here. It is no longer greater than that number. So how do we find out what this point is? The principle intuition. Let's draw some lines here. Let's assume that VI and VT use the same scale, say, volts. So if I draw a straight line at 45 degrees then that is a curve representing VI equals VO. We all know that. No big shakes. So the line at 45 degrees here is the line at which VI equal VO. And if I take that line now, the VI equals VO line, and I begin translating it to the right. So let's take a line here. Let's take a line there. That line will be simply equal to VO equals VI minus VT. I have translated that to the right. And so this line is simply VO equals VI minus VT. So this line is a locus of points at which VO is equal to this value. This minus VT shows up as a translation to the right. So I take my VO equals VI line, translate that to the right and it becomes VO equals VI minus VT. Elementary geometry 101 or whatever. So what do we have here? Above this we have the condition VO greater than or equal to VI minus VT, and below that we have VO less than VI minus VT. If we look at this graph here, this is the valid input operating range. Starting at this point greater than VT, and at this point my output equals VO equals VI minus VT. This must be the valid operating range for the input here to here. And correspondingly the outputs are from here to this point to here like so. So this is my valid input operating range and this is my valid output operating range or the corresponding valid output operating range. So what does this say? What this is saying is that if I, as the designer of the circuit, am disciplined enough to apply inputs that are in this range, VT to some value here, graphically shown here. Then my MOSFET will remain in saturation. And correspondingly my outputs will go between VS and some value here. So hopefully that gives you some of the intuition behind how we get it. And let's continue. Let me label this point X. So continuing with two to get the valid operating range. I have shown you intuitively where that point is, but what I will do next is actually compute that for you. It is a pretty simple computation. Note that point X is the intersection of two curves VO equals VI minus VT. And the second curve is VO equals VS minus K divide by 2, VI minus V2 all squared RL. So the point X iss at the intersection of these curves, and I can very easily get that as follows. What I will do is I will simply substitute for VI minus VT from this equation here and then solve for it, so I get VO equals VS minus K divide by 2 VO squared RL. And so this gives me a quadratic in VO. And I can solve for it pretty easily. And I get for a quadratic AX squared plus BX plus C equals 0. The solution is given by VO is minus B plus/minus square root of B squared minus 4AC divided by 2A. And so I am just going to get those numbers here. So the coefficient of VO, that is B, is minus 1. Take the positive root because we are up in the positive voltages here. And square root of B squared, that is 1, minus 4AC. So I get a plus 4 times K divide by 2 RL. And 2A is simply 2 times K divided by 2 times RL. So that is what I get. That gives me VO. So it tells me that VO, at the point where the output just equals one threshold drop below VI is given by the other circuit perimeter such as VS, RL and so on. Oh, I am missing a VS here. I just forgot the VS up here. That is my VO. So what is VI equal to? Remember that at this point VO equals VI minus VT, so VI is simply VT plus -- I have not taught you anything earth shattering here. I have just done some grubby math here to solve these two equations. So this is a straight line at 45 degrees from VT and this is the transfer function. And I need to find the intersection. And the intersection is given by this point. So that point, VI being VT plus something, is simply the second dot on the X axis. So therefore I am pretty much done. My valid input range for VI goes from VT. So it starts at VT. That is where the transistor just turns on. And then goes all the way to this point, VT plus minus 1 plus square root of 1 plus 2 K RL VS K RL. So this is my valid operating range. And again remember I won't dwell on this equation because, in some sense, you will get a different set of limits for other devices, for other circuits containing a MOSFET. Or, for that matter, for other outputs that one may be focusing on. So what is more important here is not so much the results that you see but the process that I have gone through. So what is more important here is how did I get here? And the way I got here was looked at the graph and said look, the MOSFET is in saturation in that regime. And I am finding the bounding points of the regime of saturation operation. So now, as an engineer, I can say that hey, look, if you build a MOSFET circuit like so, with a given value of RL, a given MOSFET and a given VS, then if you limit yourself you are operating with input voltages in this range thou shalt be happy. If you go beyond that range then you will be violating the saturation discipline. So the corresponding output range -- I can write the corresponding output range, and that goes from VS, when the input is at VT the output is at VS and goes from VS down to the input minus VT. Which is simply minus 1 plus -- Let me go back and quickly show you a little MOSFET circuit, amplified circuit so you can stare at a real transfer curve yourselves. And indeed convince yourselves that roughly at the point where proportionately shown in the curve up there the MOSFET indeed goes into its triode region and begins heading out of its saturation region. Notice that here that is the same curve, the transfer function. And the amplified output is at VS until input reaches a threshold voltage VT. And once input goes beyond VT the output begins to drop precipitously. And at some point here this begins to go into its triode region. And what I am going to do is simply increase the input voltage VI, and you will see that the output them begins to go into its triode region. It keeps dropping. And, as you can see, the output begins to go into a space where the gain is no longer more than 1. And this is a triode region of MOSFET operation. So the MOSFET is in saturation, things are going great. As I increase my VI notice at some point I begin to go out of my saturation region of the MOSFET. And somewhere here I go from the saturation region and transition into the triode region. And this value shown here gives you the corresponding input voltage and the output voltage. Other practical devices like bipolar junction transistors or MOSFETs and other circuits and so on can be subjected to a similar analysis. And you can find out the valid operating regions for that device as well, or for that circuit. So as a next step what I would like to do -- Out here I began by looking at the transfer function, the VO versus VI curve, and used that to drive the intuition behind how we calculated the bounding regions. You can do the same kind of analysis intuitively looking at yet another curve, another set of graphs that you are familiar with, and that is a load line characteristic. And it is interesting to get two interpretations. And you can use whichever one you feel comfortable with. So I will do two alternatively and show you another set of curves that you can use to get that. Here I am going to plot IDS versus VDS, which is the same as VO. This was the load line graph that we had seen earlier. And, just for our reference, remember that VI must be greater than VT for saturation operation. Similarly VO should be greater than or equal to VI minus VT for saturation operation. Those are my limits. The way we got the load line graph was we superimposed the load line equation over the device characteristics. And so let me plot the device characteristics in the saturation region. Remember that this constraint could be related to the current as I derived for you in the last lecture as follows. IDS being less than or equal to K divided by 2 VO squared. So in terms of my IDS versus VDS relation, this lateral constraint is equivalent to IDS being less than K by 2 VO squared. So this is that equation. So this line is IDS equals K by 2 VO squared. And in this region I have the valid operating region where IDS is less than that quality. So here are all my other curves for various values VGS. So here are my devices curves, IDS versus VDS. Remember that these curves come down like this, for the MOSFET, right? Just that we focus on the right-hand side because that is where the MOSFET is in saturation. And on this side the MOSFET is in its triode region, and we discipline ourselves not to operate the MOSFET such that it is in its triode region. So those were the device characteristics. And then I could plot my load line equation. My load line equation, if you recall, was IDS = VS/RL - VO/RL. This was simply obtained by writing KVL at the loop containing the output node and the supply VS. Notice there that VO is equal to VS minus IDS times RL. And that is simply by dividing by RL on both sides and moving IDS to the left-hand side we get this equation. And this equation gives rise to a curve that looks like this. And what is this point here? This point is where VO is 0. So when VO is 0 my IDS is simply VS divided by RL. And this point is obtained when IDS is 0. And under those conditions VS and VO are equal so this is VS. This is my saturation region and this is the triode region. This was another interesting graph. We often times fondly call it the load line graph. So here is a load line superimposed on the MOSFET device IDS versus VDS curves for a variety of values of VGS. So by looking at this curve, we can also intuitively determine the valid operating range. So what are the two points here? I will let you stare at it for a couple of seconds yourselves to figure out what two points here bound the valid operating range of the MOSFET, the valid operating range of the circuit. I will start. One is this point, because at this point the output is VS and VGS has just begun to equal VT. So think about where the second point is for valid operation. It is here, and, somewhere along that load line. Remember the load line is a constraint that must be met by the output VO. It is the constraint imposed by KVL on the output. So the output is constrained to operate in this regime for various values of VGS. So as the output keeps going from here all the way here, at some point I exit my saturation region. And that other point is given by this one. So notice that this is the curve that bounds. On the left-hand side of this the MOSFET is no longer in saturation. It is on the right-hand side, and so therefore this is the valid operating region. Here to here. This is good. This is VS. That is good to know. And for this point I know that VI, which is VGS, equals VT. I know VO is equal to VS. And IDS, at this point, is 0. So VO and IDS being VS and 0 correspondingly are the output operating perimeters when VI equals VD. So that is one point. And let's find out what this point is. At that point I get my output just entering the range of the MOSFET triode region operation. Notice that this point is the intersection of two curves, this line and this curve. So this curve here is given by IDS equals K divided by 2 VO squared. And this is my load line equation. So that is VS divided by RL minus VO divided by RL. That's it. So I won't go ahead and solve that for you. You can go and check it out and convince yourselves that if you solve these two equations and find out the VO for this, it should be the same VO that you obtained using the other graph. What I have done here, obtaining the valid regions of operation is no different from what I did here. The two are alternative approaches to getting to the same place. Just that over the years what I have discovered is that there are one class of people that are output transfer function people, this graph, and another set of people that are load line people that like to think that way. I have always been a transfer function person myself, but some of you may be load line people and so you can use that to drive your intuition. It is pretty amazing. As we get into this business and keep going down the path, it is amazing how some people really kind of get the load line thing and others feel much more comfortable with the transfer function. So pick whatever you want. So what we have so far is we have conducted a large signal analysis of a MOSFET amplifier. It is an analysis of a circuit, and we found two things. One is the transfer function under saturation operation, and we found the valid input operating ranges and the corresponding valid output operating ranges for the circuit. In the last five or six minutes let me talk about a couple of other issues. And the first issue is what we have done so far is intuitively and mathematically shown you what the valid regions are. Now you are thinking that's fine, but how do I get there? This region is good, VT through that other point, that's good, but how do I get there? How do I make my amplifier operate in that region? The answer is pretty simple, and let me drive the intuition again using a graph. So this is a graph. And I showed you that -- That was my valid region here. Take a 45 degree line, find out where it intersects the transfer function, then this is the valid region here, VT through that coordinating function that we developed out there. If I have an input that looks like so, some input whose gyrations fall within this range, will constantly keep the MOSFET in saturation. And the corresponding output will look like this. If my input is in this range, my output will be within this range. And how do I get my input to be here? Let's say I have a sinusoid that is 1 volt peak to peak or whatever. How do I get my sinusoid up there? Well, you have learned the trick on how to boost things. Remember boost? All you have to do is boost up your signal by some value capital VI. And the way you do that is as follows. VS, RL, VO. What you do is you apply a DC offset to your input. You take your sinusoid and boost it up so that all the gyrations of the input are in the valid range. This is my input, some VA. Then I apply some DC offset capital VI given by this value here. And boost up the interesting input? My interesting input is the VA. And I boost it up by capital VI so that this guy is always in saturation. I would like to show you a little demo now. I am going to show you an input that is a triangular wave. And what we will do is I'll play with a wide variety of offset voltages. This guy is a triangular wave. And what I am going to do is apply a triangular wave and we'll look at the output and convince ourselves that I get amplification when VI is big enough that the input goes into a valid operating range. And we will look at a variety of ranges here. You can put it a little larger. OK. So the triangular wave is my input. And this is my output. This looks nothing like a triangular wave. And the reason is that I do not have the right offset. So what I will do is gradually increase the offset on the MOSFET. So at this point the offset is very low, a very small near zero offset. And so therefore my output is a disaster. My MOSFET is not in saturation all the time. So what I will do here is apply some sort of offset. Is this the one? We want to switch. This is the input. You can see I am applying an offset by bumping and boosting up the input. I don't have clipping happening at both ends, but I get something. And I get amplification. Now let me apply way too much of an offset. With this offset I am kind of operating here. What I will do now is apply an even higher offset so that this triangular wave begins to move here. If I apply a very high offset what I am doing is overdriving the amplifier, boosting it so high that the MOSFET is going to go into its triode region and you are going to see that I won't have any gain. My output is going to shrink noticeably if I overdrive the input. You will notice the input going higher and higher. Pull the trigger point down. There you go. Notice that as I boost up my input even higher notice that the output is a really small image of what the right input should be. The right answer here, of course, is that I apply some right amount of offset to boost up the input into the right regime so that the output is seen to be some amplified version of this input. So I showed you three things. One is very little offset. That was like so, as the thing comes down. A very high offset, it gets killed again. And the right amount of offset. But notice that we still have a problem, even with the right offset. The output is not linearly related to the input. It is nonlinear. And the answer to get a linear response is good old small signal stuff. And we will be looking at the small signal part in the next lecture. MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Please use the following citation format: Anant Agarwal, 6.002 Circuits and Electronics, Spring 2007 (Massachusetts Institute of Technology: MIT OpenCourseWare). http://ocw.mit.edu (accessed MM DD, YYYY). License: Creative Commons Attribution-Noncommercial-Share Alike. Note: Please use the actual date you accessed this material in your citation. For more information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Transcript – Lecture 10 Good morning, all. Good morning. I hope you guys did not spend all of last night celebrating the Red Sox victory, but there is one more tonight. OK. Let's see. I trust the quiz went OK. What I will do today is take off from where we left off on Tuesday. And continue our discussion of the large signal and small signal analysis of our amplifier. Today the focus will be on "Small Signal Analysis". So let me start by reviewing some of the material. And, as you know, our MOSFET amplifier looks like this. One of the things you will notice in circuits, as I have been mentioning all along in this course, is that certain kinds of patterns keep repeating time and time again. And this is one such pattern. A three terminal device like the MOSFET with an input and the drain to source port connected to RL and VS in series in the following manner, this is a very common pattern. There are several other common patterns. The voltage divider is a common pattern. We keep running into that again and again and again. The Thevenin form, a voltage source in series with the resistor is another very common form. The Norton equivalent form, which is a current source in parallel with a resistor is also very common. And it behooves all of us to be very familiar with the analyses of these things. Voltage dividers in particular are just so common that you need to be able to look at it and boom, be able to write down the expression for voltage dividers. I would also encourage you to go and look at current dividers. When you have two resistors in parallel and you have some current flowing into the resistors to find out the current in one branch versus the other very quickly. The expression is very analogous to the voltage divider expression. And some of these very common patterns are highlighted in the summary pages in the course notes, so it is good to keep track of those and be extremely familiar with those patterns to the point where if you see it you should be able to jump up and shout out the answer just by looking at it without having to do any math. So here was an amplifier. And then we noticed that when the MOSFET was in saturation it behaved like a current source. And this circuit would give us amplification while the MOSFET was in saturation. So we agreed to adhere to the saturation discipline which simply said that I was going to use my circuit in a way that the MOSFET would always remain in saturation in building things like amplifiers and so on. And by doing that throughout the analysis I could make the assumption that the MOSFET was in saturation. I didn't have to go through -- Analysis became easier. I didn't have to figure out now, what region is the MOSFET in? Well, because of my discipline it is always going to be in saturation. But in turn what we had to do was conduct a large signal analysis. Again, in follow on courses you will be given circuits like this. In fact, this very circuit with a very high likelihood. And you will be looking at more complicated models of the MOSFET. Or you will be given the MOSFET like this and, let's say in that course the designers do not adhere to the saturation discipline, in which case you have to first figure out is my MOSFET in its triode region or in the saturation region? And depending on the region it is in you have to apply different equations. So it is one step more complicated than in 002. In 002 we simplified our lives by following a discipline. And let me tell you that following a discipline is quite OK. When it simplifies our lives and we can do good things with it, it is quite OK to do that. We are not wimps or anything like that. It is quite OK to have a discipline and agree that we are going to play in this region of the playground and build circuits in that manner. By doing so, we could assume the MOSFET was in saturation all the time. And analysis simply used a current source model. By the same token, what becomes important is to figure out what are the boundaries of valid operation of the MOSFET in saturation? To do that we conducted a large signal analysis. And it had two components to it. One of course was to figure out the output versus input response. And what this usually does is that it does a nonlinear analysis of this circuit. If it is a linear circuit it is a linear analysis. And figures out what the values of the various voltages and currents are in the circuit as a function of the applied inputs and chosen parameters. And the second step we said was to figure out valid operating ranges -- -- for input and corresponding ranges for the other dependent parameters such as VO. You could also find out the corresponding operating range for the current IDS and so on. So by doing this you could first analyze the circuit, find out the "bias" parameters, find out the values of VI and VO and so on. And then you could say all right, provided, as long as VI stays within these bounds my assumption that this is in saturation will hold and everything will be fine. The reading for this is Chapter 8. And today we will take the next step and revisit small signal analysis. In the demo that I showed you at the end of last lecture, I showed you an input triangular wave. And the input triangular wave gave rise to an output. And we noticed that we did have amplification, I had a small input and a much bigger output. I did have amplification when the MOSFET was in saturation but it was highly nonlinear. The input was a triangular wave and the output was some funny, it kind of looked like a sinusoid whose extremities had been whacked down and kind of flattened. And its upward going peak had been shrunk. So it was a kind of weird nonlinear behavior. I will show that to you again later on. And so it amplified but it was nonlinear. And remember our goal of two weeks ago? We set out to build a linear amplifier. So today we will walk down that path and talk about building a linear amplifier. So to very quickly revisit the input versus output characteristic, VI versus VO, this is VT and this is VS, this is what things looked like. Also to quickly review the valid ranges, until some point here the amplifier was in saturation, the MOSFET was in saturation and somewhere here I had VO being equal to VI minus a threshold drop. At that point the MOSFET went into its triode region and I no longer was following the saturation discipline. So therefore this is my valid region of operation. We also know that the output was given by VS minus K (VI-VT) all squared RL over 2. Again assuming the MOSFET is in saturation. It is very important to keep stating this because this is true only when the MOSFET is in saturation, when I am following the discipline. Notice that this is a nonlinear relationship. So VO depends on some funny square law dependence on VI. The key here is how do we go about building our amplifier? Take a look at this point here. At this point here let's say I have a VI input. Corresponding output is VO. Focus is this point. And left to itself this was a nonlinear curve. Remember the trick that we used in our nonlinear Expo Dweeb example? We used the Zen Method. Remember the Zen Method? We said look, this is nonlinear, but if you can focus your mind on this little piece of the curve here this looks more or less linear. If I look at a small itty-bitty portion of the curve and I do the Zen thing, and kind of zoom in on here. This looked more or less linear. This means that if I could work with very small signals and apply the signal in a way that I also had a DC offset of some sort. Then I would be in a region of the curve, I would be delineating a small region of the curve which would be more or less linear. This was a small signal trick. And what we will do here is simply revisit the small signal model. Most of what I am going to do from here on will be more or less a repeat of what you saw for the light emitting expo dweeb. Just that here I have a three terminal device, with a little bit more complication. The equation is different. I don't have to resort to a Taylor series expansion. I will just do a complete expansion of this expression and develop the small signal values for you. Recall the small signal model. It had the following steps. The first step will operate at some bias point, VI, VO, and of course some corresponding point IDS. This is Page 3. And then superimpose a small signal VI on top of the big fat bias. Remember the "boost"? So VI is the boost. Boom. And above VI, I have small signal VI that I apply. And our claim is that response of the amplifier to VI is approximately linear. The key trick with this is that for my small signal model here, this is Page 3 here, and Page 2. The key trick here is that with the small signal model, I operate my amplifier at some operating point, VO, VI. I superimpose a small signal VI on top of small VI on top of big VI. And then I claim that the response to VI is approximately linear. And let me just embellish that curve a little bit more. Notice that in this situation this was my VI, which is my bias voltage, this is VO, which is the output bias, and of course not shown on this graph is the output operating current which is IDS. One nice way of thinking about this is to redraw this and think that your coordinate axes have kind of shifted in the following manner. This is VI. This is also on your Page 3. This is VT. Remember this was the operating point, VO and VI. And notice that we were operating in this small regime of our transfer curve here. And in effect what we are saying is that I am going to apply small variations about VI and call those variations delta VI or small VI. And the resulting variations are going to look like delta VO. Also referred to as small V, small O. So I will have small variations here. And they give rise to corresponding small variations there. One way to view this is as if we are working with a new coordinate system. Another way to view this is that so the capital VI and capital VO correspond to my VI and VO as the total voltages in my circuit, but at this bias point I can think of another coordinate system here with small VI and VO out there. And for small changes to VI, I can figure out the corresponding small changes to VO. Just that all the analysis I perform here is going to be linear. And I will prove it to you in a couple of different ways in the next few seconds. When I am doing small signal analysis I am operating here in this regime at some bias point. You have also seen this before. How do I get a bias? This is my amplifier RL and VS. This is Page 4. VO. The way I get a bias is I apply some DC voltage VI and superimpose on top of that my small signal small VI. This is my DC bias that has boosted up the signal to an interesting value. And because of that what I can get is by varying VI as a small signal with a very small amplitude, I am going to get a linear response here. And I can draw that for you as well. This is my bias point here. And if I vary my signal like so then my output should look like this. This is point VI, this is point VO, and this is my small signal VI and this is my small signal VO and this is capital VO. So this small thing here is VI. I would like to show you a little demo. I will start with the same demo I showed you the last time. I showed you the amplifier. In the demo I am going to apply a triangular wave. And initially I start with a large signal. And you will see that the output looks really corny, is going to look something like this. That's large signal response. And then I will begin playing with the input making it smaller, and you can see how it looks yourselves. There you go. So this is where I stopped the last time. The last lecture I applied this input, time is going to the right, and the purple curve in the background is the output. It looks much more like a sinusoid with some flattening of its tips. Nothing like an interesting triangular wave. What I will do next is that let me make sure I have enough of a boost here, enough of a DC voltage so that I am operating at some point here. I believe I already have that. Notice that I can shift up the triangular wave input, or I can shift it down. So let me bias it here. I have chosen a VI that's about, I forget how many volts per division it is, but I have chosen some VI here. And I biased it such that this is the input. You get a nonlinear response. It is amplified. It is much bigger. What I will do next is make VI that I apply smaller and smaller. I have already done the boosting. Boom, that's a boost. So I have boosted up your VI already. Next is I am going to shrink it, and hopefully you will see that if all that I am saying is truthful here you will see a triangular response. Let's go try it out. Watch the yellow. I am going to shrink the yellow and make it smaller and smaller. There you go. It is great when nature works like you expect it to. I have never seen a triangular wave looks so pretty in my life. It is awesome. Look at this. Here is a tiny triangular wave. And the output is also a triangular wave but it is much more linear. Yes. Question? What's that? The question is that the output here is only as big as the input used to be before. That's a good question. What I have done here is I am showing you a laboratory experiment. And let's assume that this input is the input I am getting from some sensor in the field. Assume that this is my input, not what I had before. Assume that this is my input to begin with and this is the amplified output. What I can also do is I can also change the bias. And we will see this at the end of the lecture, in the last ten minutes of lecture. How do you select a bias point? By changing your bias point you can change the properties of an amplifier to give you a preview of upcoming attractions. Let me ask you, what do you think should happen if I change the bias point? I have not shown you the math yet, so intuitively what do you think should happen? If I increase the bias what do you think is going to happen? Yes. Good insight. Higher bias will be more amplification. Let's see if our friend is correct. Let me set a higher bias. Not necessarily, I guess. You're actually right, by the way. I am playing a trick on everybody here. As I change my input bias. Notice that under certain conditions my output becomes smaller and gets more distorted. Under other conditions what is going to happen to my output is that it is becoming smaller and is going to get distorted again. So there are a bunch of funny effects happening that reflect on the bias point, but for an appropriate choice of bias point as I increase the bias the amplification should increase. And I will show you that in a few minutes. But it is a complicated relationship. Yes. This is finally getting fun. Here is the question. Professor Agarwal, we love your song and dance, but if you really want to get a high signal at the output and you want to amplify your big input signal how do you do it? So the question is let's say I have an input that is this big here, if it is this big, I have shown you how I can get things that are this big, but what if my input was this big? How do I get an output that is this big? Well, I will use one of those learned by questioning methods and have you tell me the answer. Someone tell me the answer. How do I do that? Yes. Use another amplifier. So the answer is I will use one amplifier to go from here to here. And the suggestion is use another amplifier to go from here to here. And, in fact, I believe that you may have a problem in your problem set where you will do that. And so you have only yourselves to blame. So how do you make this work? What you have to do is this VI has to be much smaller than the bias point VI on this one. I have to build a different amplifier, choose a different set of parameters such that VI prime, which is the VI for this guy, is much less than V capital I prime for this guy. It's a design question. You need to design it in a way that the signals of interest need to be much smaller than the bias voltage of this amplifier. So you may have to use much higher supply voltages. My amplifier, I believe, has a 4 volt supply or 5 volt supply. You might have to use an amplifier with a much bigger supply, different values of RL and so on. And I know that the course notes also have some exercises and problem sets that discuss that in more detail. Yes. This is even more fun. The question is, good question. The question is why do you need this guy here? Just use this guy, right? Why do you need this guy? Big guys rule, right? Who needs the little guys? Well, let me use the Socratic method again. Why don't you give me the answer? You guys are smart. Why do you need little guys? Why do you need the small guy here? Anybody with the answer? Yeah. The big guy may not be as sensitive. I like that. You know what? He is almost correct. I will show you why in a second. Anything else? Any other reason? Yes. Bingo. That is another good answer. So let me address both the answers. The answer given was that look, this amplifier is amplifying the signal by a certain amount, by a factor of 7. And I have designed this such that this amplifies a signal by a factor of maybe 10. So in all I am getting an amplification of 70. This would be a great design question for lab next year. I give you a bunch of components and ask you to design an amplifier given the constraints with the highest amount of amplification. It turns out that when you design your amplifier, in order to meet the saturation discipline and so on, you have to choose values of RL and VS and stuff like that and be within power constraints so the amplifier doesn't blow up and stuff. And by the end of it all you are going to get a measly 7X gain out of it. The same way here, to be able to deal with a very small signal here and get some amplification, another set of values and you get 10X. So they multiply. It is much harder to build one amplifier with a much larger gain. You know what? I just realized that we will be looking at this in the last five or seven minutes of lecture. I am going to show you what the amplification depends upon. It depends upon K. It depends upon RL. It depends upon VI. Now the question is I have had all this time to think about how to stitch in sensitive into this, and I believe I can. It turns out that when you have large voltages and so on and you have practical devices, it turns out that the more current you pump through devices they tend to produce noise of various kinds. So very powerful amplifiers are not very good at dealing with really tiny signals because they have some inherent noise capabilities. And so I guess that is sensitive. It is sensitive to noise. Another question? Yes. Ask me the question again. I didn't follow. Let me just explain it. It turns out that I will not be able to pass this through the big amplifier to begin with because it is just going to give me a gain of just a factor of 7. However, if I have a signal that is this big to begin with then I may just need this amplifier. I don't need the smaller guy. If my signal was this big to begin with, if I had a strong sensor that produced a strong signal to begin with, yeah, I can deal with just a single stage. I don't need to two stages. It is all a matter of design. And it is actually a fun design exercise. Given a budget, dollars, right? You go to your supply room and look at the parts that you have and you go to build what you have to build with the parts that you have. And so sometimes you need to build two amplifiers to get the gain or build a signal amplifier. It's all a design thing. All right. Moving on to Page 7. That brings us to the small signal model. Page 5. What I showed you up on the little demo was that provided the signal input in this example VI was much smaller than capital VI out there as I shrank my input, I was able to get a more or less linear response at the output. And so to repeat my notation at the input, the total input is a sum of the operating point input plus a small signal input. This is called the total variable. This is called the DC bias. It is also called the operating point voltage. And this is called my small signal input. It is also variously called incremental input. This is more a mathematical term relating to incremental analysis or perturbation analysis. So VI, call it small signal, call it small perturbation, call it increment, whatever you want. Similarly, at the output I have my total variable at the output a sum of the output operating voltage and the small signal voltage. I do not like using Os in symbols because big O and small O is simply a function of how big you write them. It is not super clear. And in terms of a graph, let me plot the input and output for you. Let's say this is the total input and that is the total output. I may have some bias VI. And corresponding to that I may have some bias VO. Hold that thought for a second while I give you a preview of something that we will be covering in about three or four weeks. Notice that as I couple amplifiers together, the output operating point voltage of this amplifier in this connection becomes the input operating point voltage of this amplifier, right? So when they connect this output to this input, the output operating point voltage becomes coupled to the input here so it becomes the input operating point voltage here. Now I have a nightmare on my hands. As I adjust the bias of this guy, the bias of this guy changes, too. The two are dependent. It is a pain in the neck. And we being engineers find ways to simplify our lives. And you will learn another trick in about three or four weeks. And that trick will let you decouple these two stages in a way that you can design this stage in isolation, go have a cup of coffee and then come back to this stage and design this stage in isolation. For those of you who want to run ahead and think about how to do it, think about it. What trick can you use to get them in isolation? Moving on. What I would like to do next is address this from a mathematical point of view. And much as I did for the light emitting expo dweeb analyze this mathematically and show you that if VI is much smaller than capital VI, I indeed get a linear response. This time around I won't use Taylor series because it turns out that this expression can be expanded fully. So you don't have to buy into Taylor series and so on. I am going to list everything down for you. We know, to begin with, that VO for the amplifier is VS-RLK/2 (VI-VT)^2. What I am going to do for this, much as I did for the LED, what I'm going to do is derive for you the output as a function of the input when the input VI is very small. In other words, when I substitute for VI, V capital I squared plus small VI. Much as I did for the expo dweeb, I want to substitute for VI a big DC VI. So VI is much smaller than VI. And show you for yourselves that the output response, V small O is going to be linearly connected to VI. Notice that, let me write another equation here. This is a total variable. This simply says that if the input is VI then the output is going to be VO, which means that the operating point input voltage should satisfy this equation, correct? In other words, the operating point output voltage V capital O should equal VS-RLK/2 (VI-VT)^2. This is at VI equals capital VI. This is very simple but may seem confusing. All this is saying is that look, this equation gives me the relationship between VI and VO. Therefore, if I apply capital VI as the input, I'm given that my corresponding output is capital VO, so they must satisfy this equation, right? Those are bias point values and that must satisfy this equation. Simple. I know that. So hold that thought. Stash it away in the back of your minds. Now let me go through a bunch of grubby math and substitute for VI in this expression here. Let me go ahead and do that. VS-RLK/2((VI+vi)-VT)^2. When I do something that is other than math I will wake you up. I will just keep doing a bunch of steps that are pure math. No cheating. No nothing. Watch my fingers. When I do anything that is not obvious math I will wake you up. Next I am going to simply move VT over and rewrite this as follows, RLK/2((VI-VT)+vi)^2. Again, I haven't done anything interesting so far. I have just substituted this. I am just juggling things around just to pass away some time, I guess. All right. Next what I am going to do is simply expand this out and write it this way RLK/2, expand that out and treat this as one unit VS - RLK/2((VI-VT)^2+2(VI-VT)vi+vi^2). Nothing fancy here. This is like the honest board. Nothing fancy here. Standard stuff. Only math. I will move to this blackboard here where I do some fun EE stuff. Yes. Good. At least one person isn't asleep here. Thank you. So just math here. Nothing fancy. Plain old simple math. I have not done any trickery. I still have all my ten fingers. Now what I am going to do, now watch me. I am not using Taylor series here because this expression lends itself to this analysis. Notice VI squared here. I made the assumption that VI is much smaller than capital VI, so what I can do is assuming that VT is small enough that VI minus VT is still a big number compared to small VI, what I can do is ignore this in comparison to the capital VI terms. So I have a capital VI term here. I am going to ignore VI squared. So, for example, if capital VI was 5 volts and small VI was 100 millivolts 0.1, so 0.1 squared is 0.01. So it is comparing 0.01 to 5. So I am off by a factor of 500. So now watch me. Now I begin playing some fun and games here. I eliminate this, and because I eliminate that it now becomes approximately equal. What I do in addition is let me write down the output. The total variable is the sum of the DC bias and some variation of the output. And let me simply expand that term and write it down again. VS-RLK/2(VI-VT)^2-RLK/2. I get a two here. And I get VI-VT. I won't forget the VI this time. Again, from here to there nothing fancy. This is the one step where I have used a trick. I have said small VI is much smaller than capital VI, and so I have simply expanded this out and written it here. So do you see the obvious next trick here? From star look at this guy. I can cancel this out from star because I know that at the operating point these two expressions are equal, and so therefore I can cancel out the operating point voltage and this. What I am left with is small VO is simply minus RLK(VI-VT) times vi. Only one place where I did something funny. Other than that it is purely math. So this is what I get. Notice that this whole thing is a constant, minus RLK(VI-VT). This whole thing is a constant. And so VO is equal to some constant times VI. Let me just define some terms for you that you will use again and again. For reasons that will be obvious next lecture, I am going to call this term here GM. I am going to call this term a constant, K(VI - VT). It is a constant for a given bias point voltage. So I am going to call that GM. And then I am going to call this whole thing A. And of course this is VI. There you go. I have my linear amplifier. A is the gain times small VI. And the gain has these terms in it. I just call this GM. You will see why later. But notice that the gain relates to RL. The size of the load resistor RL, how big it is, 1K, 10K, whatever. K, this is a MOSFET parameter, and VI minus VT. That is a constant for a given bias point voltage and small VI. So VO equals small VI. I won't give you a graphical interpretation, but I encourage you to go and look at Figure 8.9 in the course notes. And it gives you a graphical interpretation of that expression. Move to Page 7. Another way of looking at this, another way of mathematically analyzing it, here I went through a full blown expansion and pretty much deriving the small signal response. What I can also do is take a shortcut here. So let me just give you the shortcut. You might find this handy. VO=VS-KRL/2(VI-VT)^2. And my shortcut is as follows. My small signal response is simply this relationship. I find the slope at the point capital VI and multiply by the increment. Slope times the increment gives me the incremental change in VO as follows. d/dI (VS-KRL/2(VI-VT)^2) evaluated at vI=VI times vi. This is math again. I want to find out the change in VO for a small change in VI, and I do that by taking the first derivative of this with respect to VI substituting V capital I and multiplying by the small change delta VI or small VI. So this is simply the slope of the VO versus VI curve at VI. And so therefore taking the derivative here of this. This is a constant so it vanishes. But twice 2 to cancel out, so I get KRL(VI-VT) times small vi evaluated at capital VI. So I get twice KRL, VI evaluated at capital VI, so it is VI minus VT times small VI. Same thing. Oh, and I have a minus sign here. I get the same expression that I derived for you up there, and this is just taking the slope and going with it. And this, as I mentioned before, this is A. The last few minutes let me kind of pull everything together and also hit upon something that many of your questions are touched upon. And that all relates to how to choose the bias point. So here I have taken an analysis approach. When teaching we often teach you are given something, you analyze it, but as you begin to master it you can begin to design things where you can ask a lot of questions and so on. And here what we have is an analysis given a value of RLK, VI and so on. How to choose the bias point becomes more of a design issue. If you are designing an amplifier, you asked me the question, how do I choose two small amplifiers versus one big amplifier, that sort of stuff? It boils down to how do you choose the bias point? How do you choose VI? How do you choose RL and so on? What I would like to do is touch upon some of these things. First of all, gain or the amplification. One of the most important design perimeters for an amplifier is what is the gain? Let's say you get a job at Maxim Integrated Technologies, and they say we would like you to build a linear power amplifier for cell phones. You can say I know how to do that. And then they say the next stage needs a 100 millivolt input. While this thing coming from the antenna is only a few tens or a few hundreds of a microvolt. So you sit down and say oh, my gosh, I need an amplification of so much, and you go design an amplifier. So gain tends to be a key parameter. And notice that gain is proportional to RL. It relates to VI minus VT, so proportional to VI. It is also related to RL. The second point is the gain point determines where I bias something. If I choose my bias too high I get distortion, or if I choose my bias too low I get distortion. So depending on how I choose my bias point, as a signal goes up it may begin clipping or begin distorting. And I will show you a demo the next time on that particular example. So bias point will determine how big of a signal you can send without getting too much distortion. And the other thing is that, relates to how big of an input, what is a valid input range? So let's say you have a signal. And you want that signal to have both positive and negative excursions of the same value. Then, depending on where you choose a bias point, your input range may become smaller or larger. And we will go through these in the context of and amplifier and look at some design issues in the next lecture. MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Please use the following citation format: Anant Agarwal, 6.002 Circuits and Electronics, Spring 2007 (Massachusetts Institute of Technology: MIT OpenCourseWare). http://ocw.mit.edu (accessed MM DD, YYYY). License: Creative Commons Attribution-Noncommercial-Share Alike. Note: Please use the actual date you accessed this material in your citation. For more information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Transcript – Lecture 12 Good morning. Today we move in the direction that takes a big turn from the direction we have been going in so far. All the devices we have had up until now, resistors and voltage sources, and even your digital devices like the AND gate or the inverter and so on had a very specific property. We didn't dwell on that property, but that property was that these were not what are called memory devices. In other words, the outputs at any given time are a function of the inputs alone. In other words, if you took your inverter or your NAND gate for that matter and you build a circuit comprising 50 NAND gates connected in structures that we have talked about, you apply an input and boom you get an output. And your output is a function of the inputs alone, right? The same thing with your resistors and voltage sources. At any given point in time your output VO of T was some function of the input VI of T. What we are going to do today is discuss a new element which will introduce a whole new class of fun stuff for all of us to deal with. And that is called storage. In other words, the output of a circuit is now going to depend not just on the inputs but it is going to depend on the background or it is going to depend on where the circuit has been in the past. So past is going to matter. It is a very fundamental difference. And what I would like to do is start by giving you folks a little bit of a surprise. I am going to do a little demo taking two of your inverter circuits. I am going to start by taking a couple of inverters. Remember, I am using this structure here as an inverter. And I am going to couple this to another inverter and take an output C, some VS, some load resistance RL, my B terminal and my A terminal. So I'm going to apply some input between ground and my A terminal. And for fun I want to apply a square wave at the input. A square wave between zero and 5 volts. And this is how my time goes. Let's assume that VS is 5 volts. So what I am going to do is plot for you the behavior of this inverter. I am going to plot for you A, which would look like this. I am going to plot for you B, which would be the inverted wave form. And then plot C, which would be a wave form that looks like this again. Let me do a plot here. So this is A. -- and so on. Time goes this way. And let's say this is between zero and 5 volts. And B should be an inverted wave form that should look like this. If all that we believe of the world so far is true then this is how things should behave, so C should look like this. This is what the world should look like and if everything that you learned about is true and correct and all of the good stuff. Let me show you a little demo and see if I can try to pull the rug out from under all that you have learned so far and show you some surprising stuff. Here are the three wave forms that I showed you up here. This is my A. This is my A wave form. This is the B wave form. Notice that B, as you expect, is an inverted form of A. And this is C. We all expect this, correct? But what I am going to do is let me expand the time scale on this so that I can look at these transitions a little bit more carefully. I am just going to expand the time scale. There you go. All I have done is expanded the time scale and spread that out a little bit. And what you see there is quite different from what you expect. A is a square wave as expected, but B is stunningly different. It is a zero as expected because this is a one. But here I get some really strange behavior, behavior that is like nothing on earth. Like nothing you have seen before. And then, of course, it becomes a one eventually, but there's some really, really shady stuff going on here. And so far you are not prepared to deal with this. We have not given you the facility to deal with his issue. What is the problem with this? We could say who cares? What is the problem with this? Let's look at the result. I am looking at this, I am focusing on this piece here. And notice that instead of being a sharp rise it looks like this. It is going up a little bit more slowly. What kind of problem would that create? The problem that it creates is the following. Let me play around with this graph a little bit more. What I am going to do is just take this output here, the C output and line it up against the A output. And so I am going to line up the C wave form on top of the A wave form. So you can see for yourself if something really, really strange and nasty is happening, I am just going to move up the C wave form and line it up. What is happening out there? If you look carefully, what you observe is that the C wave form transitions just ever so slightly later than the A wave form. Look here. And I claim that it is because of this. Because of this, the C wave form falls just a little bit later, and that little thing we see out there is a delay. So nothing you have learned so far prepares you for this. Suddenly, instead of the output exactly following the input, my output is following the input but a little bit later. And it is this fact of life that things happen a little bit later, is really the reason why each of you and all of us needs to buy new computers every couple of years. This simple basic fact. If this fact of life didn't exist, you would buy one computer and be done with it for life. Intel would make gobs of money one year, and so would Dell and Gateway and so on, and then no more. That's it. This is it. But because of this a little itty-bitty difference here the entire semiconductor technology is charging along trying to do something about that. You buy newer and newer computers each year. It turns out this little itty-bitty thing here, that is called the delay, the inverter delay. And it happens because of a specific element that has been introduced here that we have not shown you so far. And a large part of the semiconductor industry and follow-on courses and design and so on focuses on how could I make my delay smaller, how can I get to be faster and faster and faster? This relates to how fast we can clock your Pentium IV. Remember it came all the way to 1.3 gigahertz? What's the fasted Pentium money can buy today? What is the fastest P4? Oh, 3.2 have come out? I don't know. Ken claims 3.2. But, yeah, there you go, 3.2 gigahertz. It all has to do with this little itty-bitty thing. You saw it for the first time here. When some of you become CTOs at Intel and so on, just remember that it all began on October 16th with this little rinky-dink thing here. What you are going to learn now is some really cool stuff that has huge implications for life. So why does that happen? Why did this transition happen just a little bit later? The reason is that remember when this wave form reaches VT, the threshold voltage of this MOSFET, this guy is going to switch, right? So because of the slower rise of the voltage, the VT is going to be reached a small amount of time later. So I am going to hit VT slightly later. And because of that this guy is going to transition just a bit later because this intermediate wave form B is slower. It hits VT just a little bit later than if it would have made an instantaneous transition. And therefore my output falls just a little bit later and this gives rise to my delay in the inverter. We can call that d if you would like, some delay. In your course notes, this material is covered in Chapters 9 and 10. That was to kind of motivate why we are going to be doing all that you we will be doing. Don't anybody come within a foot of this even by mistake. I mean it. It is pretty deadly stuff. Today we will talk about the capacitor. And in the next couple of lectures I am going to tie it all together and show you how this relates to that. I will show you exactly how the delay happens. You can compute it based on some simple principles that you will learn about in the next couple of lectures. What I am going to do is first of all show you, I claim that that delay happens because of the presence of a capacitor somewhere in there. What I will do now is take you into a closer look, take a closer look at the MOSFET and show you were the capacitor is. This is the MOSFET that you have seen so far, drain, gate and source. This is called an n-channel MOSFET. And what I am going to do is dissect this and show you what is actually happening, what this looks like on silicon. So here is my slab of silicon. It is very thin. And let's say this is, I won't go into details here. You will learn a lot more about this in future device classes like 301 and so on, but suffice it to say I will just introduce it here to give you a sense of where the capacitor is. This is p-type silicon. And the way you build a MOSFET is you create a couple of tubs in which you dope to be n-type. The basic silicon is dope p-type. And this guy here is n-type. And what you do is a thin oxide layer is placed on top of that and then on top of that a thin metal layer. This is a metal layer. This is a thin piece of oxide, silicon dioxide. And this is my P substrate. Now this is a little metal layer that is really a wire on top of the silicone. This metal layer could be some sort of a wire that meanders around on the surface of silicone. And this is a wire that connects to the gate. This is the gate of my MOSFET. And this guy here is the drain. And this guy here is the source. And this is my gate. So there is a little piece of metal here. This is this piece of metal here. And there is a piece of oxide and then my silicone substrate. Notice that this is my oxide. When I apply a positive voltage to the gate here with respect to the substrate, what happens is that I draw up negative charges. I draw up electrons here into this channel region and I have corresponding plus type out here so that I get a view here that looks like a couple of plates. And I end up with an oxide in the middle. There is no connection. Two plates separated by a small distance with plus q and minus q on the plates. And, because of that, what ends up happening here is that this piece behaves like a capacitor. So a capacitor has two plates with a thin insulating material in the middle with some permittivity epsilon. And so I get a little piece of a capacitor here. That is the capacitor that is forming. I did not set out to build that capacitor, but there is a capacitor nonetheless. So when I apply a positive voltage at the gate, negative electrons are pulled up here which forms a channel, and then a current can then flow. And that is how the MOSFET turns on. So n-type electrons back to n-type, and I get electron flow here and that gives me my channel. This is just kind of devices in four minutes or less. You will do an entire course on this, if you like, if you take 301. What we do is to be able to capture the behavior that we just saw, the funny delayed behavior, we have to augment our model. We have to introduce a new element. So what we do is here is a MOSFET, gate, drain and source. And notice here we model this by putting a little capacitor, CGS between our gate and the source. So this becomes a simple model for our MOSFET device which is the good old gate drain source device from the past with a little capacitor CGS having some value for CGS in maybe ten to the minus 14 or thereabouts farads. So that is a little capacitor that has come about in this device that we fabricated here. It is that capacitor that is at between node B and ground because it is between the gate and the source of the second inverter. And it is that capacitor that is playing the games that we saw out there. So let's look at some of the behavior of an ideal linear capacitor. A capacitor, as I said, has a couple of plates. There are a couple of plates. Between the plates is some dieletric, permittivity epsilon. Let's say the area of the plates is A, and let's say the plates are separated by a distance D. I get some charge here, let's say q. So q and minus q on the capacitor. And the capacitance C is given by epsilon A divided by D. Epsilon, as I said, is the productivity of the dielectric. So if it is free space then it would be epsilon zero which is the permittivity of free space. That is the capacitance in farads. And the symbol looks like this. Capacitor C. Voltage v. Current i. So this, much like the resistor, voltage source and so on, this now becomes a primitive element in your tool chest of elements like the voltage source and so onn. Capacitance with the voltage v across it and a current i. And I have assigned the associated variables here according to the associated variable discipline. A question to ask ourselves is remember we said we are all now in a playground from all of nature, in this playground where the lumped matter discipline holds? And also remember that we said that for the lumped matter discipline to hold we have to make a couple of assumptions. One of those assumptions was that dq/dt, for all their elements should be zero for all time. So right now what about the capacitor? It has got some charge q. So charge must have built up somehow. Does that mean that I lied all along, that we are no longer in this playground, that we have been ejected from the playground because of the capacitor, or are we still in the circuits playground in which the lumped matter discipline holds and all good things happen and so on? It seems like a contradiction, doesn't it? I took you from Maxwell's playgrounds to the EECS playground where I said the lumped matter discipline holds. And one of the foundations of the LMD was that dq/dt should be zero for all time inside the elements that we are going to deal with. And right now boom, it's not four weeks into the course and Agarwal introduces an element and it has q in it. It turns out that the capacitor also adheres to the lumped matter discipline. Remember the discipline says that dq/dt is zero for all time within elements. So I am going to be clever. What I am going to do is I want to choose element boundaries in a very cleaver way. Notice that if I have q here on this plate then I get minus q on the other plate. So if I take the whole element, the element as a whole, if I am careful in terms of how I package my boundaries, if I put both my plates inside my element boundary then I still do get the net charge being zero. So dq/dt is indeed zero for all time provided I make sure that my element has both the plates. Therefore, if you come across somebody else that gives you an element that says I have an idea. Let's create a new branch of electrical engineering in which we model the capacitor not as one element for two plates, but let's build a capacitor by combining two new elements, two garbage elements called G1 and G2. G1 is like the top plate. G2 is the bottom plate. I put them together and I get a capacitor. But notice if I just pick one plate then the element G1 will not adhere to the LMD. It adheres to the LMD because I choose my element boundaries in a way that both plates come within it. So it is very fundamental and key. And you can read a lot more about it in the course notes. I purposely dwelt on that simple point because I think it is foundational and important. And you really need to understand that the capacitor does satisfy LMD. We are still in the good old playground. A few simple facts here. These are in the notes. And you have also seen this before, I am sure. I can relate the charge to the capacitance and the voltage as q is equal to Cv. And q is in coulombs, this is in farads and this is in volts. So there is some charge q stored on the capacitor and it is in coulombs and q is equal to Cv. So I can differentiate this with respect to time to get the current, and that becomes i=dq/dt. So the current at any given time is dq/dt. And so I substitute for q in terms of Cv here. That is what I get. So the current i=d(Cv)/dt. A 6.002 assumption, capacitance in general can be time-varying. I can get time-varying capacitors. In fact, there are some sensors which are capacitive. And, as I talk, my sound waves can change the pressure on the top plate of the capacitor. And move the top plate of the capacitor, thereby changing the capacitance by moving the plate. Remember d here, as the plate moves closer I get a higher capacitance. So we won't be dealing, unless explicitly said so, with time-varying capacitances. So what we can do is 6.002 allows us to write Cdv/dt. So my current source capacitor is Cdv/dt. I can also write down the energy, capacitors store energy. E=1/2Cv^2. I am sure you have seen all this before in physics and so on. That is the amount of energy stored in the capacitor if it is holding a charge q. Let me do a little demonstration for you. They don't make glasses like they used to. Our friend Lorenzo has charged up this capacitor. It is a huge capacitor. It is a 250 volt capacitor so it is nasty. He has charged it up and has kept it there. And to show you that it does contain stored charges it has been sitting there holding charge. Maybe the first row should go backwards, just step back for a second. I think you guys would be safe but I just don't want to take any chances. This is holding a bunch of charge. It is kind of sitting there. If I short the terminals it should try to say oh, I've got a path, let me get my charge out. All right. Let's do it. This is always a scary moment for me. And I say a little prayer before I do this. Good? OK. Gee, you guys would love to see me getting fried, huh? All right. Let's see. So it did contain charge. So there is a reason why Lorenzo puts one hand inside his pocket when he shorts it, because there is a natural tendency to hold the wire with both hands, and la, la, la, la, la and put it across the capacitor. By doing this you are guaranteed that you will just be touching it with one hand. Hopefully you folks will remember for life that a capacitor can sit around and hold its charge for a while. All right. That is enough of fun and games. Let's get on with our business of building circuits. What I am going to do is, as I promised you, I am going to close the loop on that example by halfway through the next lecture. I'm going take you on a bit of a journey involving capacitors and resistors and involving some analysis, and then we will close it all up for you at about the middle of next lecture. What I would like to do next is here is a new element. And let's do some fun stuff with elements. Well, you know about voltage sources, you know about resistors, let's put them together and see how they behave. Let's have a capacitor here, C, vc(t) and some current i. What I am going to do, in general, whenever I have something new or something strange, let's say like a capacitor or some other device. It is interesting to model the rest of the circuit behind it if it contains only resistors and voltages and linear elements as a Thevenin equivalent. So let me do that. This is R and this is vi. This stuff in the back is my standard pattern, voltage source in series with a resistor, and I connect that across my capacitor. But remember, although you saw those funny wave forms and so on, the capacitor is a linear device. Because you can see from here that the current relates to dv/dt. That is a linear operation. You don't see V squareds and Vis and things like that in there. It's is a linear device. Let's go back to our trusty old method, the node method. If you just blindly apply the node method and simply grunge through a bunch of math, you should be able to get to the answer, that is for some voltage v or some form of voltage vi, I should be able to figure out what vc looks like. So let's do that. This is the node that is of interest here with the unknown node voltage vc. So let me apply the node method. (vc-vi)/R is the current going this way. That plus the current through the capacitor should equal zero. And what is the current through the capacitor? The node method tells me that, get the current in terms of the element values. We know that the current is given by CdvC/dt.=O. Just shuffling things around a little bit, I can write RC dvc/dt+vc=vi. We are writing the node equation and then getting the equation that characterizes this little circuit. Notice here that this has units of volts. And since I have time here, this also must have units of time. Let's go about solving this little circuit and understanding how it behaves. The specific example that we will look at looks like this. Let's say the capacitor voltage at time T=0 is V0. This is given. So at time T=0, I am telling you that the capacitor contains a charge. And because of that there is a voltage V0 across it. That capacitor had a voltage of 250 volts across it and most of the devices we deal with in laptops and so on today, like the Pentium IV, voltages are on the order of 1.5 volts, very small voltages. So that is the value in the capacitor, the voltage. That is called a state. This is called the state, capacitor state. It is the state of the capacitor. And I also give you that vi(t)=VI. So my voltage is VI. And somehow, I am not telling you how, but some how it arranged to have the capacitor voltage be V0 at time T=0. Now I want to look to the solution to this for t greater than or equal to zero. And in that time my voltage vi is at some capital VI, some DC voltage VI. So I am going to solve the differential equation RC dvc/dt+vc=vi given these two values. Input is DC voltage VI and VC0 is V0, the initial charge in the capacitor. So from now until almost to the end of the lecture, it is just going to be math by solving this very simple first order differential equation. And the key here will be that throughout 6.002 we will be following one method to solve these. There are many methods to solving differential equations, and we will follow one method. That method is called the method of homogenous and particular solutions. In 1802, I believe, you would have learned maybe this, and certainly other methods. You can use any method to solve it. We will just stick to one method. And this is also used in the course notes. In this method what we do is take the solution VC by finding two other components. One is called the homogenous solution. And summing that up with the particular solution. And that is the total solution. So total solution is the sum of the homogenous and the particular solutions. And the method has three steps. As I said before, we will be using this method again and again with every differential equation that we encounter in this course. And you won't encounter a while lot. The first step we find the particular solution. The second step, find the homogenous solution. The total solution is the sum of the two. And then find --- There will be some unknown constants depending on the equation that you have. And in the end we simply find the unknown constants by applying the initial conditions that we have. Boom, boom, boom. Particular. Homogenous. Find constants. Three things. So let's go about solving this equation and apply those three conditions. Again, remember, what I am doing now for the next 10 minutes or 15 minutes is using math that you know about to simply solve this first order of differential equations. There is nothing really new that I am going to talk about here. One is to find the particular solution vCP, which will then be added into the vCH to get me the solution. So the way you find the vCP is you find any solution that satisfies this equation. This is the equation. You find any solution that satisfies it. And find the simplest possible solution that money can buy. Find it. That's the particular solution. Any solution is fine. In this case, a really simple one would be vCP equals VI. Let's see if a constant works. One thing you will realize in differential equations is that they are actually much simpler than they seem. And the reason is that almost every time you have to assume you know the answer, and then you are checking to see what you assumed was correct. Assume the answer is this like you are really smart, and then check it out and say oh, yeah, that must have been the answer. So here we assume that I think VI is going to work so let's try it out. Substituting in here. RC dvc/dt is 0. vi is a constant. So I get vi equals vi, so therefore this is a particular solution. Done. I substitute vi here. So dvi/dt=0. This vanishes and vi=VI. Bingo. Therefore, VI is a solution to this equation. So I am done with my vCP. And in general what you have to do is use trial and error. By trial and error try out a bunch of solutions until you get lucky. In general, again, in all of 6.002 for many of the excitations a simple constant usually suffices. Our second step is to find the homogenous solution. And we can also do that very quickly. And to do that we have to find a general solution to the homogenous equation. The homogenous equation is the same differential equation but with the drive set to zero. We want to follow a set pattern to solve the differential equations here, and the set pattern is find vCP, vCH, find constants. And to find vCH we are also going to follow a set pattern to find the homogenous solution. So we set the drive to zero, so vi is set to be zero. And I need to find a general solution to this. As I promised earlier, diff equations are really, really simple because the way we are going to solve them is we are going to assume we know the answer and then go check it. So let's try Ae^st. Let's try and see if this can solve this particular equation for some values of A and S. I am telling you that the solution is going to be of this form. Assume it. And then simply go ahead and find me A and S, and do that by substituting it back into the equation and find out the corresponding As and Ss. So let's go ahead and do that. I get RC. I substitute this back up so I get dAe^(st)/dt+Ae^st=0. And let me plug that in and see what comes. I get RCAse^st+Ae^st=0. I want to discard the trivial solution of A being 0. That is a trivial solution so I will discard that. And what I will do is cancel out the As from here, assuming A is not zero, and cancel e^st here. And what is left is RCs+1=0. What this is saying is that if I can find an S such that this is true then Aest is a general solution to my homogenous equation. This is easy enough. And so S=-1/RC. If I choose my S to be -1/RC then the simple math that I have gone through shows me that this must be the solution to the homogenous equation. Or in other words vCH=Ae^(-t/RC). All this is saying is that Ae^(-t/RC) is a solution to my homogenous equation. A is an unknown constant. A is some constant. I don't know what that is yet. Notice RC has popped up again. And the cool thing about RC is that, this is time, this also has units of time. We commonly represent RC as some time constant tau, as units of time. Associated with that circuit is the time constant tau, which is simply RC. I commonly write this as Ae^(-t/tau). I am very the end here. I have the particular solution here. I have got the homogenous solution there. I need to tell you about something else. The way I found the homogenous solution was in four steps. I assumed a solution of the form Ae^st. I created this equation here in S. This is called the characteristic equation for that circuit. We will see this time and time again for RC and other forms of circuits. Assume a solution of this form. Construct the characteristic equation. Find the roots of the characteristic equation. In this case it is an equation in S. So this is the root. And then form the solution based on that root. Four steps. Ae^st, characteristic equation, root and then write down the general homogenous solution. Four steps there. And finally I want to write down the total solution. And the total solution is simply vCP+vCH. And vCP was VI and vCH was Ae^(-t/tau). tau was simply RC. That is my solution. Now, remember the last step. The last step was form the total solution and find out the remaining constants. Find out the remaining constants by using my initial conditions. At t=0, I know that vC=V0. I know that. And so therefore I can substitute t=0 to find the constant. So I know that VO=VI+A. t=0, this thing becomes 1, and so I get this equation from which I get A=V0-Vi. In other words, my solution vC is simply VI+(VO-VI) e^(-t/tau). So the last 15 minutes have just been math. No electrical engineering here, but electrical engineering stopped at the point where you wrote this differential equation down, went through a bunch of math and came up with a solution. Purely mathematically. So here I simply used math to get you the solution. And, as I have been promising you throughout this course, in the next lecture I will give you an intuitive EE method of doing it. Real electrical engineers, real EECS folks don't do it this way. Real EECS folks do it intuitively. And I will show you how to do it in four easy seconds in the next lecture. But you need to understand the foundations of how this comes about, and so this is the answer. You can also get the current iC is simply Cdvc/dt. I won't do that for you, but you can simply differentiate it and get the current. So I can plot for you vC, time t, vC. The intuitive way of looking at this is I have VI which is the final value of the voltage. When t is infinity this part goes to zero so the vC is simply VI. And then there is a component V0-VI which decays according to this starting out at an initial value of V0. Notice when t is zero vC is V0, you can see that in the equation, and so it starts out at V0 and ends up at VI. I start here, I end up here. And this portion V0-VI decays out over time like this. And this decay is governed by the RC time constant or tau. I am going to show you very quickly a couple of examples of wave forms, one that goes like this and one that looks like this. This is when I start with some value V0 and I don't apply any input, it should decay down to zero, t, t, vC, vC. If I apply zero for VI then this should simply decay down to nothing over time. And if I apply some VI but there is no state in the capacitor then that same equation is going to look like this. You can go and confirm for yourselves that when I apply some input but the capacitor has zero state, I start at zero, I finish up at VI and my wave form looks like this. There you go. That's the first one. The second one where I have 5 volts on the capacitor and no input. Assume that at time equals zero I take away an input, short the input voltage to ground for example, apply zero volts. You will see the decay from 5 volts to 0 volts. And in the first case I start with zero volts in my capacitor, I apply input of 5 volts, and notice that at t=0 the capacitor rises up to that level. So notice that these circuits with capacitor and resistors are typified by wave forms that are exponential rises and exponential decays. We will see more of that next time. MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Please use the following citation format: Anant Agarwal, 6.002 Circuits and Electronics, Spring 2007 (Massachusetts Institute of Technology: MIT OpenCourseWare). http://ocw.mit.edu (accessed MM DD, YYYY). License: Creative Commons Attribution-Noncommercial-Share Alike. Note: Please use the actual date you accessed this material in your citation. For more information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Transcript – Lecture 13 OK. Good morning. In the last lecture I did a little demonstration for you where I showed you a pair of inverters. And showed you that the output of the first inverter looked weird, certainly not like anything we have seen thus far. It looked like a slow rising transition like this. And using that motivation we have begun our study of RC circuits. And in particular for today the lecture is titled "Digital Circuit Speed". We are going to look at the fundamentals of digital circuit speed. And it all boils down to an RC delay. By the end of the lecture, I am going to show you two numbers that you can look at a circuit and obtain by observation, multiply them out and you will get a good idea of the speed at which a circuit will run. It is pretty amazing. So as a quick review -- The relevant section for this is Chapter 10.4. As a review, we said to understand things like this we need to develop the foundations for RC circuits. And the example I covered was that of a very simple circuit that looked like this -- An RC circuit of this form. And I also showed you that for an input of the form, input that steps from zero to VI at time T equal to zero. And assuming that the capacitor state at time T equals zero was zero. What this means is that the capacitor starts from rest, so at time T=0, oops, this is VI, I'm sorry. So we assume that the capacitor starts from rest. At time T=0 I apply a VI step, capital VI. And then I want to look at how the voltage across the capacitor behaves. And we did a bunch of analysis. And at the end of the day, in the final demo in the lecture last time I showed you that the capacitor would behave like this. It would start off at, oops. I am sorry. This should be, let's assume that started off at VO. We get a different equation for zero. So let's say the capacitor started off at VO, in which case VC at time T=0 is VO as expected. And we showed that the output would look something like this. After a long period of time this would come up to VI and this rise had a time constant of tau=RC. So we wrote the equation for this waveform. And this is the case when VI is greater than VO. I would like you to stare at the circuit and this result here to get more intuition on what is going on. At time T=0, VC starts off at VO as expected because I am telling you that is the case, that is initial condition. It starts off at VO. Then this one steps to VI. There is no infinite transition anywhere here, and so the capacitor holds its voltage at VO, at time T=0. And then the VI here, which is greater than VO, begins to charge the capacitor up, charge it through this resistor. And so therefore the capacitor charges up. After a long period of time, from the basic foundations of capacitors, we know that the capacitor appears like a long-term open circuit to DC. This is a DC voltage VI. So it appears like an open circuit. So after a long period of time VI appears at the end. And from here to here I have an exponential rise that is typified by an equation of the form -t/RC. This kind of waveform rising from a smaller value to a higher value is typified by this expression. We saw the expression when we developed the equations last time. On the other hand, if the input was such that VI was smaller than VO, so let's say VI was smaller than VO then what will happen is that the capacitor voltage would start off at VO, because I am telling you that is the initial condition, and would then decay in this manner to the final value of VI which is the input. Instead of going up this way it decays down to the final value applied to the circuit. Again, the time constant is RC. But this is typified by a form, this is exponential rise and this guy e^-t/RC is an exponential decay. The key thing to remember is that when you have RC circuits of this form, the waveforms that you get are either each of the e^-t/RC or 1-e^-t/RC. So you can now begin to see how waveforms such as that come about. We will do an example and sit down and compute the inverter delay. And notice that this waveform here is very typical or corresponds to this waveform that we see here. Here I am starting at VO. And assuming this axis starts off at zero, this one starts very close to zero and then rises up to some final value. So far I have reviewed some material for you that I covered the last time. As a second step, I would like to give you a much more intuitive approach -- -- that doesn't involve solving any differential equations. And the reason I do this is that most experienced circuit designers do not sit down and write differential equations each time they see an RC circuit. When you are starting out and you see an RC circuit, you say node method and you write the differential equation, but experienced people don't do that. They look at it and they can sketch the waveform out by inspection. And I will show you how to do that. It is indeed incredibly simple once I give you some intuition. Throughout the rest of this course, I will be showing you many such examples where initially I develop the foundations of stuff and then show you an intuitive approach that very quickly lets you either get the final answer or at least sanity check the answer that you have gotten. And this is how experienced circuit designers deal with stuff. How many people here have seen this movie Bend it Like Beckham? So you know this Beckham character doesn't think about how he is going to curve the ball. He just does it and it happens. He doesn't sit down writing differential equations to find out the projectile trajectory and all of that stuff. You just kind of do it. These series of intuitions I am going to give you is going to be in line with the Bend it Like Beckham kind of intuition. And this one in particular I would like to do in honor of one of your recitation instructions Professor David Perreault. And so this piece of intuition is going to be termed "Practice it Like Perreault". Watch what I do with the other names. Professor David Perreault is really a world expert in designing really incredible power supplies for very, very small chips and so on. He doesn't start writing differential equations to do this stuff. He looks at it and sketches it out. Let me show you how he would do this. Suppose I have my circuit like before, VI, R and C, and I am telling you that VC(0)=VO. And my input VI is a step that looks like this. VI is a step. How would Professor Perreault do this? Let's do it completely by intuition. No math here. All right. We know that I have told you that this guy starts off at VO. I am telling you that. You know it is going to start at VO. And there is no impulse or huge infinite transition, and so the capacitor starts off at VO. We also know from basic capacitor properties that after a long period of time, in the steady state, this is but a DC voltage. If you apply a DC and here is my capacitor. After a long period of time this guy is going to look like an open circuit. It is going to charge up to some value and then is going to look like an open circuit. Because if it didn't, you would keep charging it and its voltage would keep increasing. That doesn't happen, it looks like an open circuit. So it looks like an open circuit in the long run. The voltage across it must be capital VI. If I don't have current flowing in the circuit then the only way that can happen is -- This open circuit. Capital VI appears across the capacitor. Well, after a long period of time I know that the output must look like this. In this case, I have assumed VI is greater than VO. So you have two points of your curve, VO and VI after a long period of time. And, as I told you earlier, with capacitors you get two kinds of curves. Two things. What you do is go zoop. There you go. You're done. And this has an exponential rise. This is with the form 1-e^-t/RC. So we can write an equation for that as follows. VC we know has something to do with minus t/RC. This is of that form, so there has to be that term in there somewhere. And I start off with VO. At time T=0 this is one and this is one, so this term becomes a zero. At time T=0 that becomes a zero so I get VO here. I am going to make sure this stuff stays zero at time T=0, so I start off with VO. Now, as time wears on what happens here? This voltage here, VI-VO, if you look at this difference. That is exponentially decaying over time. And so therefore all I have to do here is write VI-VO. There is the answer. I know the form of the curve. I am just fitting an expression that meets this form. This starts off at VO. When time T=0 this second expression is zero and so it is VO. And this difference here decays down to zero. And this difference here, VI-VO is multiplied by this term here and that is what I get. And you can confirm this. At time T=0 this is zero. At time T infinity this goes to zero, this goes to zero leaving a one, and VO and minus VO cancel and I get a VI. Virtually any such simple voltage source, current source, resistor, capacitor, circuit for most inputs like steps and so on can be analyzed in this manner. Initial value, final value, it's simple. And just to show you that this is simple, I am going to label this expression this way. It is of the form 1-e^-t/RC. Just remember that. Now, by the same token, what if VI had been smaller than VO? Then that is simple, too. I would have had my VI being here. VI would have been here. And that is of the form. In this particular situation, here is my VI, my starting value and I do this. And just to label that, let me label that this way. I just told you that for RC circuits you go this way or you go this way. So it is down here. I get some kind of an exponential decay. And, like before, think of this one. This one has VI as a base value here. And the difference between the two is VO minus VI. And that difference decays. So I have a VI out here, and this difference decays so I get VO-VI and that decays in this form. So I get an exponential decay of this difference here. Just stare at it for a while longer. You should be able to just go and knock it off like this, just like Professor Perreault would. No differential equations. Just write it down by looking at the curve. Let's keep these two in mind, OK, these forms? One is the 1-e^-t/RC form and the e^-t/RC. Both have a time constant RC. Let me just make this a dashed line just to be on the safe side here. That is our first piece of intuition. And, as I pointed out before, in problems you face in life or in ones that we give you, feel free to use the intuitive method. Or what you can do is apply the mathematical method and then check your answer by using your intuition. What I would like to do next is apply what you have learned so far to figure out what we set out to figure out, which is the delay of my inverter. I had promised you that by the end of this lecture I was going to close the loop on that little demo. I was going to close the loop for you on this little circuit that we had looked at, one inverter driving another inverter. This was A, this was inverter X, and this was my node B. The green curve you see out there, the middle one has a transition shown up there. And what I am going to do next is use the results we have gotten so far to compute a number. We are going to compute a delay number both for a rising transition. We will call that delay DR for rising transition. And we will compute a delay for the falling transition DF. Remember, that this is the input that falls down sharply. The intermediate node B rises much more slowly. And because this rises much more slowly this guy here falls a little after this transition here, and so there is a delay. And I am going to apply what we have learned so far and do an example for you and figure out what that delay is. This is an absolute foundational calculation done in building digital circuits all the time. It is remarkable that something so simple is used in designing even the most complex of circuits to obtain very quick ideas of what my delay will look like when I have some subcircuit driving some other piece of subcircuit. Let me just draw a few equivalent circuits for you. The internal circuit looks like this. This is my inverter X, A, my node B. And notice that I have this capacitor CGS. Since I am interested in this node, let me show you that, this capacitor explicitly, it is because of this capacitor here that arises because of this MOSFET here between the gate and the source. And that capacitor gives rise to this RC thing that we are seeing. This is RL, this is RL, VS, VS. And let's say, just as up there, at time T=0 I get a transition like so, a falling transition from say 5 volts to 0 volts at the node A. This is VA here. That is shown up there. And VB -- We had expected that VB would look like this. We expected VB to be instantaneous and looking like that, but instead because of the capacitor VB looks like this. And remember, again, this is of the form 1-e^-t/RC. And we will write down the answers by inspection. From this let me draw the connection to circuit delay by showing you another little graph here t, VB, zero. And what I am going to show you, this is 5 volts. And so the output goes like this from close to zero to 5 volts. It is close to zero. Because, at least with the inverters we have been seeing in lab and so on, the RON for the inverter is very, very small compared RL. So it is virtually zero down here. And so what is the delay? I mentioned there are two delays of interest. One is the rising delay. That is the logical value at the end, if I wait a long enough period of time, is a logical one. Delay is simply defined as starting from here how long does this output take to get to a valid one? At what voltage here can I say that this transition corresponds to a logical one? At what voltage here can I say that that represents a valid one? Any ideas? Yes. It depends on the discipline, bingo. So it depends on the discipline. Now let's get more specific. Since it depends on the discipline, at what value based on something in the discipline can I say this thing is a logical one? This is an output remember. VOH, bingo. There is some VOH somewhere. And it takes some amount of time to get to a valid logical one output, ergo there is your delay. This is tR. And I call this the rising delay of the inverter X. It is interesting that the rising delay of inverter X, based on our model, depends on the parameters of this inverter and the parameters of whatever it is driving. So remember that the delay is not necessarily just the property of the inverter itself, but it depends on the context. If I stick my inverter before another inverter like this, it is the capacitance on that inverter by our model that tells me what the delay is going to look like, of course in addition to RL. And we will do the math in a few seconds. By the same token, if I had this wire connecting not to one inverter but going to ten other inverters, I expect to have a capacitance equal to ten times CGS. And so therefore this thing should rise even more slowly, correct? The more capacitance on here the slower it rises up. Simple. If I put more and more load on this line by putting more and more MOSFETs on that line, more and more inverters this will rise slower. In our example I just have one, so let's go ahead and compute the delay. This is called the rising delay of X. That says that for this node here to go from its output value to a valid one, which is VOH how long does it take? Notice that if this capacitor was zero then you would have seen an instantaneous transition. If you have an instantaneous transition then notice that the rising delay was zero. That was the model we had looked at up until learning about capacitors. So let's go ahead and compute the number. I can draw an equivalent circuit for computing a rising delay. The equivalent circuit for the rising delay looks like the following. The VS voltage source, with a resistor RL and a capacitor CGS, because when I turn this guy off, this guy has gone off, and so as far as the rise time of this node is concerned I can look at this circuit, ground through CGS through RL through VS back to ground. And just for simplicity, let me draw this in a form that we understand. CGS. Let me use this as my ground node. And this is the voltage VB. And this is RL. And V is simply VS once that transition happens. My other equations here, VI=VS. And what is VB(0)? VB(0) is at what value does this node start out? Notice that for simplicity here if this RON is much, much smaller than RL, then this node would be very close to ground. So I will just go ahead and say that VB at T=0 is approximately zero. And then what I want to find out is what does the value look like for time starting from zero and then going forward? Well, we have become experts at this now. Let's do the intuition here. Start off with zero. That's good. Because my initial value is zero, I start off here. What is the final value? After a long time, since this is a DC voltage, what would be the value at VB after a long time? Pardon? VS. If I wait long enough then it is going to be at VS. This is greater than the initial value, so we're done. That is my 1-e^-t/RC form. It took me three seconds there. It's pretty cool. We could add the expression for this. And the expression was I take my starting value, which is zero, and I add to that this difference VS and I multiply that by this form. There we go. And remember I get this from that rising form up here. V0=0, this is zero, so it is simply VI times that, and VI=VS. I really would like you to get this intuition. If I had two choices, one is that you understand the intuition and are able to sketch that versus in your sleep be able to solve the differential equation and get to the answer. I would much rather you get the intuition, if it is one or the other. It is very simple. Start off at zero, I go chuck, and boom, I get to VS and this is my 1-e^-t/RC form. I need to compute tR. And tR is the time that this takes to get to VOH. For what value of time, for what T, does VB reach VOH? I want to find tR. What's tR? From that equation, that simply tells me the trajectory of VB as a function of time. And so I need to find out what is T for which VB is VOH? I write VOH=VS (1-e^-t/RC). So after a rise time my output is going to be VOH. And so let me go ahead and find tR. Let's see. I bring this to this left-hand side and divide VOH by VS, and then I move things around and what I end up getting is -tR/RC and on the other side I get ln(1-VOH/VS). Divide VOH by VS, that is this, move this to the other side, and move e^-t/RC to this side. And take logarithms on both sides. This is what I get. tR is therefore -RLCGS ln(1-VOH/VS). That is my rise time. You can just do this by inspection. It is just so awfully simple. Just to give to some intuition with numbers and so on. Let's say that RL=1K, VS=5 volts, VOH=4 volts, CGS=0.1 pF. This happens so often that we often time call it "puff". 0.1 puff. It is pF, it's called puff. If it is nF, I don't know why they didn't call it "nuff". They just call it nanofarads. TR for these numbers gets to be one times ten to the three times point one times ten to the minus twelve for pico-farads ln(1-4/5). And if you do the math you get this down to 0.16 nanoseconds. This means that if I had an inverter like that droving another inverter then my output transition would be delayed by 0.16 nanoseconds. Trust me, when Intel builds microprocessors or when Broadcom builds its cable modem chips, they have to do this one way or the other using a computer tool or by hand for virtually every little subcircuit in their chip. That is how you get the delays or some approximation thereof. What I want you also to do is, for no particular reason, I will just compute for you the following quantity RLCGS. The time constant of that circuit for no reason at all. I am just going to compute it and stick it here. And RLCGS 1 K times 1 pF is simply 0.1 nanoseconds. I am just writing it and sticking it there for no particular reason. The next step let's do the falling delay, DF. That is the rising delay. And, although I didn't show this to you in the demo, there is a corresponding delay of the fall time. It doesn't fall instantly, but rather it falls rather slowly. Let's draw the equivalent circuit for when the node X falls. Notice that in my inverters here, this node starts off being at VS. This is high. And this is going to fall because when I turn this transistor on it is going to pull this node to ground or it is going to fall down. And what is the equivalent circuit? The equivalent circuit is that ground through capacitor to this node. At this node I have RON connecting to ground and I have RL connecting to ground through VS. Let me draw that little circuit for you. Remember life begins and ends on storage elements, so I will draw them first. My storage element CGS. That is VB. And, as I said, this is node X, it goes from RON to ground, and it also goes through RL through VS to ground. And in this particular situation VB of zero for the following delay, VB starts off at VS so VB of zero is VS. And the final output I am not sure yet. What is the final value of the voltage at this node? I don't know that yet. I need to compute that. So what I will do is whenever you see something like this, a capacitor connecting to linear stuff, or a nonlinear element connecting to linear stuff. For no apparent reason you should at least think about what? Think Thevenin, exactly. And then see if you can use the Thevenin method to simplify your life. Capacitor, a bunch of stuff here, I need to find out the initial value. Oh, I know that. That is VS. Done. I need to find the final value using my intuitive method. For the final value, I could do it just by looking at this, but I wanted to throw in Thevenin. Hey, let me try to the Thevenin equivalent and see if that makes my life any easier. VTH. The Thevenin method says that you can replace this circuit here with a Thevenin equivalent of the sort for the purpose of determining what happens at this node given that that is linear. So I need to find out that for the purpose of determining what happens at the node X. I have to replace this with its Thevenin equivalent. And I now need to find out RTH and VTH. So I get RTH by looking in here, shorting this guy and looking at the resistance. So I look in like this, then I short this guy here and I get RL in parallel with RON because this one shorts to ground. So RTH is simply RL in parallel with RON. This is a convenient notation for RL being in parallel with RON. And you all know the value of that. It is another one of our very simple patterns like voltage divider and so on. Resistances in parallel can be computed as RL RON divided by RL plus RON. What is VTH? VTH is the open circuit voltage here. If I take out this capacitor, I want to find out what the voltage here is. Ah-ha, voltage divider. VS, the voltage divider here, RL and RON. I could write this down as VS times RON/(RL+RON). Remember you will see again and again and again and again in 6.002 or any circuit stuff that you do, you will see them all over Thevenin. Voltage dividers, current dividers, resistances in series, resistances in parallel, RC thing-a-ma-jigs like this. So if you just remember those 10 to 15 intuitive patterns then you are pretty much set for life. It just comes on again and again and again. Parallel resistors. Voltage dividers. You should be able to write down a voltage divider in your sleep. So this is what I have. Let me now write down intuitively what I expect the node X to do just by inspection. Let's see. What is the initial value of the voltage across the capacitor, intuitive method? This is how Professor Perreault would do it, remember? He would start off by saying ah-ha, initial value is VS because I am told it is VS. I start off with VS. And so I start off here. What is the value after a long, long time based on this circuit here? V Thevenin. After a long time this is a DC voltage because that is a DC voltage. The capacitor looks like an open circuit after a long time. And VTH appears there so it is simply V Thevenin. And then when you see those two, boy, I love doing this, you go like this. That is the coolest part. And then I am done. It is so simple. Three seconds or less, I am able to tell you what the delay of an inverter is purely by intuition, completely intuitively. I mean I haven't done any solving. It is just by observation. Took this circuit, made my life easy, Thevenin, looked at RTH, VTH and then sketched it by inspection. Again, if you find that things are really, really, really simple don't be surprised. Once you get some conceptual understanding things are indeed very simple. You can eliminate a lot of math just by staring at things attempting to build up the intuition. As a next step what I can do is write down the expression for VB. And I write down the expression from a falling transition. How do I do it? What was it? What is the method? I take the lowest value of interest here. That is VTH. And then I add to that this difference decaying exponentially. And that difference is simply VS-VTH. And that decays exponentially. This form is the e^-t/RC form. And, boom, I am done. Many of you are wondering, Professor Agarwal, if life was so simple, why on earth did you have us mess around with those differential equations to get here? You show us differential equations and then you don't use them anymore. Well, that is a good question. The answer to that is that you need to understand the foundations. Once you understand the foundations you can find simplifying techniques to get to where you need to be, but you need to understand the foundations. You need to at least see why things are the way they are at least once. Understand the foundations and then find intuitive ways of getting your answers. So now my falling delay here is, I start off with VOS and I need to get all the way down to what value to compute. At some point here, this is a valid one, at some point VB becomes a valid zero for the output. And that is when I stop my tF block. What is the value here for this to be a valid zero? Don't all yell at once. VOL. I simply had to figure out what is the value of time, this is Page 7, for which this expression decays down to VOL. So it is VTH+(VS-VTH) e^-tF/RC. Then I simplify this. How do I do that? VOL-VTH. Then I divide that by VS-VTH. So VOL-VTH. Divide that by VS-VTH. Take logarithms on both sides and then multiply by RC. So I get tF is -RC log of that. This is R Thevenin and this is CGS. How did I get this? VOL-VTH divided by VS-VTH. Take logs on both sides. And then multiply throughout by -1/-RC and I get my tF. Done. Let's do it for the same set numbers, just that we add an RON of 10 ohms. I will do this for RON of 10 ohms and compute the value for you. tF=-RTH. RTH is RON parallel RL. This is 10 ohms. That is 1K. So 10 ohms in parallel with 1K is approximately 10 ohms. So let me just use approximately 10 ohms. 1 pF, that is RC times ln of VOL. Oh, I need to give you a VOL. Let's say my discipline has VOL being 1 volt. And so therefore I end up getting a VOL-VTH divided by VS-VTH. Since RON is much, much, much smaller than RL, since RON is 10 ohms and this is 1K, most of VS will drop across RL. This is a hundred times smaller. Compared to VOL, which is 1 volt, VTH is very, very small. VTH will be on the order of 0.05, and so therefore I simply write down VOL here and say VTH is approximately zero, and I get VS-VTH. This is approximately 5. So let me just say this is approximately. And if you do it you will get 1.6 pico-seconds. Again, just for fun, let me write the corresponding RC time constant for the circuit, which is RTHCGS. So RTH is approximately 10 ohms and CGS is 1 pF, so this is 1 picosecond. Now you will understand why I have been writing this time constant down. It turns out that the time constant is a very, very important number. So you see an RC circuit, and you compute its time constant for an RLC connection like this, it is the series resistance times the capacitor. The time constant is a very important number. And usually the circuit delays are in the neighborhood of the time constant value. In this case this is 1 pS. That is 1.6 pS. And in this case we had 0.1 nS and 0.16 nS. So the time constant itself is a good indicator of what your delays are going to be like. If you have no time, you are sloshing your cereal down in the morning and you need to know how long the delay of the inverter very quickly, you have three seconds. Just do the RC and that is a good first approximation. What I would like to do next in the last three or four minutes is set up a little demo for you for your recitation, and then your recitation will cover it. This is a true story. This really, really happened. In this West Coast school, which shall remain nameless, they had a chip, they built a chip. And the chip had a bunch of pins, as you might imagine. And the pin, as you have a trace on a board, a wire on a board there are some capacitance attached to wires, between the wire and ground. And that is a capacitor. And they just called it a load capacitance. It could have been 0.1 pF or 0.01 pF or something like that. What they found when they built this chip -- What they found was that the voltage here they expected to look like this, this computer science abstraction and so on, zero to one transition, boom, it should look like this. But for the reasons we saw today the observed transition was much slower and looked like this. So the students said ah-ha, let's speed up this chip. We can speed up the chip by looking at the RL and RON of my driving inverters. And if I make RL small -- Notice if I make RL small my delay is small. If I make RON small my falling delay is small. So let's make really small RLs and RONs and let's all have fun. Unfortunately, what they observed was that by making RL and RON both small, the RC time constant small they expected to see a much sharper rise time. And this was the original. But what really happened was -- They expected this to get faster and kind of look like this, but what happened was disaster struck. What they observed was something like that. This is a real-life story. And so instead of getting something like this they go something like this. And why is that a problem? That is a problem because notice when I expect to be at a zero, I got some spikes that went higher than VIL into the forbidden region and did bad things to me. So let me show you a little demo and show you that that's exactly how the circuit is behaving. Notice that this is what I expect but this is what I see. Look at the purple curve here. Notice these spikes that are showing up there. This is true. They saw it happen. And why is this happening? It turns out that what was happening was that the two pins were next to each other. And I will show you a little demonstration here. Let's see if you can figure out why this was happening. Think of these as two pins and the pins are close together. I am just modeling the two pins with a role of wire. And what I am going to do is -- I am going to separate the wires and keep them far apart. It is like keeping my pins far apart. Hey, guess what happened? Those nasty spikes went away. But then I cannot keep my pins 1 meter apart on a chip. Your laptops are going to look 20 yards long. You want the pins to be very close to each other so that you can have many pins on chips and therefore have very small systems. But then look, I get the spikes. Any idea why that is happening? Why is that when the pins are close together I get those spikes? Any ideas? Somewhat? We just learned about capacitors, so this must have to do with capacitors. There is this parasitic capacitor between the pins, exactly. Here is what is happening. Here is what I expect. I expect a nice square wave at the output. But instead I have a pin next to me. And I have a faster wave form driving it. And so therefore there is a parasitic capacitor here. And because of that I get something called "crosstalk". And the model for crosstalk is some resultant resistance with the parasitic capacitor and I get those spikes. And the 6.002 experts saw the solution. They said how do we fix this problem? 6.002 experts said the way we fix this problem if it is slow it may be better. Instead of having sharp transitions let me drive it with slower transitions. Let's switch to the demo again. You will see this in recitation, but I will show you the demo very quickly. I have a sharp transition of the input, which is that yellow thing out there. I am going to make the transition slower. Switch to a triangular wave. And you will notice the spikes go away. Oh, no. That is the wrong one. The other one. There you go. The moment I switch to a slower transition boom, the spikes go away. You want to switch back to square? There you go. The 6.002 experts saw the solution. Slower transitions. And you will do this example in detail in Section tomorrow. Thank you. MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Please use the following citation format: Anant Agarwal, 6.002 Circuits and Electronics, Spring 2007 (Massachusetts Institute of Technology: MIT OpenCourseWare). http://ocw.mit.edu (accessed MM DD, YYYY). License: Creative Commons Attribution-Noncommercial-Share Alike. Note: Please use the actual date you accessed this material in your citation. For more information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Transcript – Lecture 14 I will be replacing Professor Agarwal today because he is away. I am one of the recitation instructors for those of you who have not seen me. We will talk today about a neat application of RC networks and expand those to application in MOS memory systems. To connect with everything, we will get back to the basic circuit that we have been discussing so far. And you recall the circuit that we have been studying, the canonical RC with an input voltage function of t. And we had specified that we solved this problem for the case of a step input or a condition in which a t=0. At t greater or equal to zero vI is equal to some capital VI value that for now on is constant. And the other condition that we discussed was the value of the voltage on the capacitor that would exist at time t=0. Let's call that vc(0). And in general there is some finite value here. It can be zero or it can be different from zero. Given that, we learned how to write down directly, without messing around with differential equations, the answer for the voltage on the capacitor vc(t), let me define also my vc right here, is equal to VI, the final value, plus vc(0), the initial value on the capacitor, minus the final value, e^–t/RC. This is our standard equation to which we plug in, and it's either a rising exponential if VI is larger than VC or a decaying exponential if VI is a smaller value than VC. This should all be familiar. And, again, as pointed out in the notes, the reading for today is 10.3 and for the new material you should look at Chapter 11 where we discuss memory. This is where we stood as of last time. Now, I would like to discuss a little bit more about the storage of charge in capacitors. And how we can take advantage of that for storing logic state. One of the things that I am sure you must be aware of is that one of the perhaps most massively produced chips is actually the so-called DRAM which you find in every PC and every computer that exists anywhere. This DRAM is dynamic random access memory in which we can store a state and come back and look at it at any time later, provided we don't power off our machine. The logic state in the basic memory elements, of which instead there are close to 1 giga elements per chip, are stored on capacitors. And so we will play a little bit with that concept today. And, although we're not going to discuss the specific example of the DRAM, the basic elements of the DRAM you will see actually in a demo shortly. So that's the general response of this network that I have here to an input VI that happens at t=0. Now, the one thing that you recognize immediately is that it really doesn't matter what the value of VI was for t less than zero. What really counts is the value of VI at t=0. And that's the value that we're interested in. Now, there is an implicit statement in that. And that statement is that somehow that network appears like this at t=0. So, there has to be some switch there, and you will see that, that basically starts my condition to that at t=0. And so the history of VI really doesn't matter. The response following that equation that we have there will depend on the initial value which is vc(0) here. Now that is the voltage on the capacitor at that time. And then assuming that VI is a value that is larger than vc(0) will have a rising exponential that will come to this value. And this is the time constant RC and this is time. So, the capacitor starts with some voltage here and goes to a new voltage that is imposed by the input for time greater than zero. We can define at any one time, say this time, this time, this time, this time the state of the capacitor. The state. What is the state of the capacitor? The state is the summary of all inputs that are relevant to predicting the future. If I know the state of the capacitor this time, I can predict what it is going to go given a response VI here in the future. So, predicts the future. Now, what is the state variable on the capacitor? What is actually stored on the capacitor? You can say, well, what is stored is voltage. The real physical quantity that is stored is the charge q which is for linear capacitors related to the voltage, let me actually write it correctly, vc like this. So, the real state variable is this. But for a linear capacitor, since there is one-to-one relationship between the two, v is also a state variable. OK, so let's then go back to our original circuit. What we have is -- -- vc(t), so that's the future value of the voltage on the capacitor, is a function of vc(0), the initial value and the variable input now in the future time. And for the case of vI(t) being constant VI for t greater or equal than zero we have the equation that we just described. Nothing new. All the past inputs to the capacitor for time t less or equal to zero is summarized in this value. And vi being constant the future is predicted from that. So, that's the concept of the state. There is an initial state on the capacitor. And then there is a final state that will be reached when equilibrium actually is achieved. There is a fair amount of discussion in the text, and we don't go in great detail here, but it is both convenient for analysis and also it's interesting in many cases to look at the response of a linear network for two different conditions. So, we're interested in two cases. One is the so-called zero state response. Now, what is the zero state response? It's the response to a condition in which we impose an input and impose also the condition that the initial value, initial state of the capacitor is zero. So then we ask how does it respond to vi(t)? So, starting with a capacitor at zero state what is the response? It allows us to decouple the initial conditions from the response to the input. Now, you will see that this is actually very useful. The second condition to which we're also very interested is the so-called zero input response. What is that? That is vi(t)=0. Now, it's the condition under which there is no input. vi(t)=0. The question here is how does it relax? We're starting with an initial state. So, how this state relaxes out in the circuit. Now, the zero state response, this one here is Z so called SR for our case, which I will write like this, vC, ZSR is simply a rising exponential. We start from zero and we go to VI. So, it's VI-VI e^–t/RC. So, that's the ZSR. The ZIR, the zero input response is like this. It's the decay of the initial voltage on the capacitor to zero or to equilibrium. Starting from vC(0) we're decaying like this. Now, do you see something that's rather obvious from what's on the board in terms of ZIR and ZSR and the final complete answer which is there? They are specific cases, but how do they relate to the full answer? It's the sum. It's the superposition of the two. What basically we see here -- And that's actually a general statement, is that vC = vC,ZSR + vC,ZIR. Now, you may say this is trivial because we started from that, ended back in that from some very simple observations. However, we are not always solving networks for responses that are steps. The input voltage may be a ramp. We did that in recitation. Or, it could be an impulse. Or, it can be a more complicated function. Having this observation in place actually allows us to solve the problem rather neatly. If I have time at the end, I might come back to this. So, this is the same equation as I started with, arrived at from a principle of superposition of two different solutions. One application of state which can be, since we have energy storage element here, the capacitor, which can be stored on the capacitor is in memory. And you may ask, so why do we need a memory node to perform logic? Well, there are cases in which a result depends on previous results. So, a computation proceeds in time. In order to do that, we need to store intermediate results and proceed forward. One good example is if you're doing a continuous summation, say, on your calculator, you keep putting things in the memory. The M+ button, right? And you keep adding a series of numbers. Every time we store the sum of the previous operation we add another number and so on. Clearly we need some way of storing state. For a complete computing system, we need combinational logic and we need memory. In fact, these are the two basic elements that are essential for any kind of computing system. We need to remember intermediate results. We need to remember transient inputs. And that's the role that all these enormous amount of memory that comes to play in computers is doing. The basic memory abstraction is as follows. Imagine a block which needs to be populated by transistor, resistor, capacitor, whatever elements. And it has a control input, which we will call the store. It has a state input that we will call dIN and has an output dOUT. When we're telling this element, OK, now it's time to store, it looks at the input dIN and stores it for, in principle, an infinite amount of time. If we were to make a drawing of this, of what this looks like, let's suppose, let me do all this in one axis. So, time moves this way. Let's suppose that we have an input dIN that looks like this, and the store command comes in the form of a logic. Let's actually suggest here this is logic one, this is logic zero. And, although this is not absolutely necessary, let's also define that the store command comes in the form of a logic one at this store input. Store, let's say, looks like this. What does the output look like then in this particular case? Assuming that the output was dOUT, the stored element was zero prior to the store, then the output would look like this. This is dOUT. As you can see, it would remember the one that it saw at this point. In fact, it would do that irrespective of what was stored in this memory cell. For example, suppose it was storing one and the output didn't change, it's still one. If it was storing a zero, it would flip to a one. If we had another store, let's say here, then what happens? Then it would go back down to zero because now we sampled an input that is zero and we flipped the state. That's what a memory -- -- element or cell would do for us. It would remember the output state. And, not only that, but in principle it should be undisturbable. In other words, I may do something to this dOUT but it should not flip the state. And that comes about quite a bit. Because in actual integrated circuit memory there is lots and lots and lots of nearest neighbors to this cell which, when they're flipped, have a cross-coupling to the cell. The cell must be designed robust enough that it doesn't flip, that no coupling actually occurs. All right. Now we're going to try to apply what we've learned so far to invent a basic memory element. And, believe it or not, this is the key to the DRAM. Let's implement this in a circuit. Suppose I have a switch here like this. And I will put a capacitor. I take my dOUT here. This is dIN. And the switch is operated by a command here that we will call store. When store is one it goes up. When store is zero it is down here. That's capacitor C. This is the storage node. What are we actually storing in this case? Let's suppose that this voltage here is 5 volts. I flip the switch up to one and I flip it back down to zero. What's the voltage in this capacitor here? 5 volts. Now the capacitor is at 5 volts, I put dIN to ground, flip the switch back up and then back down to its known storing condition. What's the voltage in the capacitor? It's zero, exactly. So, it does store the value of the voltage that it saw, five or zero, high and low. It stores it because it stores charge. That's actually the physical quantity that's stored. It's manifested as a voltage, which we see. All right. Now, is this, oh, before I move from here. What is the basic cell in a DRAM, one that you go out and buy by the billions of cells? It's actually this. The only difference is that this switch here is replaced with a MOSFET. And that's all it is. So, a MOSFET plays the role of the switch. When the gate is high this is a resistor and connects the input to the capacitor. And when the gate voltage is below the threshold voltage this is an open, as we've seen, and it isolates the transistor from the output. So, that's the basic memory element. And, as I said, it's the key to a DRAM. OK. Now let's consider a little bit the conditions of operation of this thing. Let me draw the circuit in two conditions. One in which it is storing, one in which it is sampling and one in which it is storing. Not to redraw this thing. Assuming that I have a MOSFET there, I would have the on resistance in place here when store=1. Now, in principle, the output is connected to -- -- some load resistance. We'll talk a little bit more about this load resistance in a minute. This is the situation when we are at store=1 situation. For example, let's suppose that dIN is 5 volts. Now, what is the situation for store=0? It's very simple. We have the capacitor C and dOUT and here we have a resistance. The switch is open. This is store=0 condition. What we have in this case is we have a problem similar to what I was discussing earlier. It is a ZIR, if you like, situation. And this you can think of as a ZSR if we're starting with zero charge on the capacitor, but I'm interested in this part. In this case, I am starting with a vC(0)=5 volts. And I'm asking myself how long will this cell hold the value? And, in fact, that is actually what happens in a dynamic RAM. The value on the capacitor is not stored forever. In fact, that's why we call it dynamic because we have to come back and restore it every once in a while. For how long are we going to store the charge? What's the response of vc for t greater than zero after the switch flicked? It's very simple. It's vc is equal to 5 volts e to the minus t over RC, right? That's the response. We have a decay. And applying to the things we know. We start from 5 volts, let's say here, I have a decay going down towards zero, at some point we are going to cross the threshold for high. The only period in which I have a valid output, if the capacitor was storing a one, is this period here. This is the only period in which I have valid stored one because, once I go beyond capital T here, I have crossed the legal limit, threshold for discriminating a high output. And from then on the output is no longer valid. So, this memory is good provided time is less than capital T. It's not a case in which the capacitor can hold charge forever. In fact, we can calculate, that is we can solve for T in this particular case. It's in your notes. Nothing really profound. T is equal to minus RC log VOH over 5 volts. So, this is basically what the response is going to be. Now, there is an implicit assumption here, which is that the store pulse width is much, much larger than RON C. In other words, when we want to store a one here starting from zero, we better charge it all the way up to 5 volts in the time that our switch is connected here. And what is the relevant time constant? It's going to be the RON C. In fact, it's actually the RON parallel RL with C. But typically RON is much, much less than RL so we don't have to worry about that. Dominant time constant is RON C. So, provided these things are happening, we have a memory. Now, we can try to improve things a little bit. We see here that we will have a decay to an invalid state in time T. How can we improve things? One way to improve things are the buffer. Here is our memory element again. Here is the capacitor. This is the storing node. Now I am going to put the buffering effect. I am going to put two buffers here. Two invertors, I should say, because if I am storing a one here I want to be able to see a one here as well. And, in this case, what I am looking at is the RIN of the buffer. And, in principle, I have out here the RL. Now, this is better because if RIN is much larger than RL then the time T, in this case, is much larger than the case without buffer. So, we buffer the effect of VL. This could be one of these neat circuits we saw in recitation like a source faller, for example, or it can be just an inverter in which case you just see the input of a transistor. So, now this condition can be satisfied. Let me give you some cases which are some numbers that are typical for a dynamic RAM. Typical times we're talking about is RIN on order of 1 gigaohm and storage node capacitor on order of 1 femtofarad to one picofarad. Now, if you can do the math in your head, which is just multiplication, you will see that the time constant, the RC is between 1 millisecond to 1 microsecond. And for DRAMs, actually, we try to be in the order of milliseconds. These are the times we're talking about. If I have this kind of circuit, somehow there has got to be additional circuitry that comes back, samples the voltage here and restores it. And that is actually what is happening in a DRAM. And my laptop is working there and its DRAM keeps getting refreshed every, say, millisecond or whatever the condition is. But, in our case, we are going to do a slightly different case in which we will create a static memory. Let's actually look at, first of all, the case of the discharge. Pay attention to, let me actually break the loop here. This is my capacitor. This is a resistor that is in series with a capacitor like you see here. Actually, I am going to keep that resistor in series with the capacitor, even in this case, because I have it for my second part of my example. I charge the capacitor to 5 volts. And you can see here this lights up, I hope everybody can see it, proportional to the voltage that I have here. From here on it's all logic levels. So, the intensity of light here will always be the same. It's either lit or it's not lit. Right now I am charging the capacitor. In fact, let's see. Maybe I can discharge the capacitor first. Here the capacitor is discharged. As you can see, the input is zero, the output is a one, and then the output of this inverter here is a one. I have two inverters in series. And I am going to charge the capacitor. I charged it to 5 volts and this lit up, this is off of course, that's an inverter, this is a valid zero, produce a valid one. And now I am going to take the input out. As you can see it's stored. In fact, we have to wait for a very long time. We don't have enough time to wait for this to discharge, so instead what I am going to do now is I am going to add also the resistor. Now I am going to flip the resistor in parallel with the capacitor to imitate what happens when we have an input resistance. You saw that there was a discharge of the capacitor. This input level went down. Voltage here flipped over to a one. Let me do it again now with a resistor in place. Storing charge on the capacitor. That's the store command. Now, don't store. I have less, about a second. The element here is 20,000 microfarads and 100 ohms which gives me a time constant of two seconds. Assuming a VOC of the order of, let's say, I don't know what it is for this case, 2.5, the log would be about 0.5, so it cuts basically the time to about one. So, it lasts about one second, if my math is all correct. It's actually a little longer than a second, excuse me, but the point is that the charge is gone. Now, notice, however, that there is something I can do here, which is that suppose I take the switch or a switch and bring it back and provide a path from the output to the input here. And this switch is open when this is closed and closed when this is open. So, this basically is the compliment of store. What I am doing now is I put a charge here, it produces a valid one at this point, and then I am feeding this valid one back to the input. As you can see, this will now allow me, even though I have a high resistance, to store the value for a long time. In this case, what I am going to do is I am going to connect the output, as you can see here. And I have my resistor in. And I am storing zero here, storing 5 volts. Now I am going to flip the switch. Basically, I mean the don't store, don't look case. You notice this dims a little bit. Sorry. No, I want the resistor in. There. Yes. OK, so the output remain value. This dimmed a little bit but the output has remained OK. All right. So, we've provided a feedback. Now we've created a static memory. This will hold charge for as long as the circuit is powered up. Now, there is still one little problem that I have with this kind of configuration. And that is if I disturb this output the charge may, the state may change. So, for example, let's say that I have -- I disturbed it by coming close to it, so let's charge it again. OK. I flipped the switch. I flipped the state from the output. That is an invalid condition. I shouldn't be able to do that. How do I avoid that? How can I avoid this problem that you just saw? Well, I need yet another buffer. The answer is in your notes. If I don't take the output here but rather take the output here, or if I don't want an inverted output, if I don't want an inverted output, I could put yet another element there. Then the situation would be fine. In this case, let me do it again. Charge. Why isn't this lit? A bad one? Now, of course we disturbed the input. Now, of course I can do anything I want here. Nothing happens, but you may say this is a trivial case because this is already zero. So, I am going to change the state. Here's is the changed state. See. I can show this. Nothing happens up there. So, this is an interesting situation in which I am buffering the output so that the output does not feed back to the input. And, by and large, in designing circuits this is something that we do. Now, in the remaining three minutes there is an example that we have. Can we put the laptop here? OK, so here is an example of how memory can be put together now to create something a little bit more complicated. And you can see the memory cells that we were discussing here. There's four of them, so this is a four bit memory. There is a decoder at the beginning here which decodes the address of each cell, so the input here will tell me which cell I need to address. Let's look at the truth table. This is the truth table for the decoder. As you can see, depending on the address that I have here, this is zero, one, two and three in a binary system, only A, B, C or D is up, is high. Which means that this end operation here only allows the input that is presented to all of the cells, what is going through the AND gate here to appear at the output. If, for example, we have a one, zero, the only end input that is going to be high is going to be this one. And that means the only cell that will look at the input when the store comes up is going to be this one here. At that point it will store whatever is on the input cell because that's an AND operation. That is a simple example of a memory. And following that simple arrangement you can build incredibly large memory systems. So, that's all I had for today. And I will see you on Tuesday. MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Please use the following citation format: Anant Agarwal, 6.002 Circuits and Electronics, Spring 2007 (Massachusetts Institute of Technology: MIT OpenCourseWare). http://ocw.mit.edu (accessed MM DD, YYYY). License: Creative Commons Attribution-Noncommercial-Share Alike. Note: Please use the actual date you accessed this material in your citation. For more information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Transcript – Lecture 15a All right. Good morning, all. So we take another big step forward today and get onto a new plane of understanding, if you will. In the last week and a half, our focus was on the storage element or storage elements called inductors and capacitors. And capacitors stored change and inductors essentially stored energy in the field, the magnetic flux. And the state variable for an inductor was the current while that for a capacitor was the capacitor voltage. We also looked at circuits containing a single storage element, we looked at RC circuits and we also looked at circuits containing a single inductor. And this was a single inductor with a resistor and a current source or a voltage source and so on. What we are going to do today is do what are called "second-order systems". So they are on the next plane now. And with this second-order of systems, they are characterized by circuits containing two independent storage elements. They could be an inductor and a capacitor or two independent capacitors. And you will see towards the end what I mean by two independent capacitors. If I have two capacitors in parallel, they can be represented as a single equivalent capacitor so that doesn't count. It has to be two independent energy storage elements and resistors and voltage sources and so on. And what we end up getting is what is called "second-order dynamics". And much as first order circuits were represented using first order differential equations, this kind you end up getting second-order differential equations. Before we go into this, I would like to start motivating this and give you one example of why this is important to study. There are many, many examples but I will give you one. What I would like to do is draw your attention to our good old inverter driving a second inverter. The same circuit that we used to motivate RC studies, one inverter driving another. So let me draw the circuit. Here is one inverter. This is, let's say, 5 volts and this is, let's say, 2 kilo ohms. And I connect the output of this inverter to a second inverter. And what we saw in the last few lectures was that in this specific example there was a parasitic capacitor or a capacitor associated with the gate of this MOSFET. And that could be modeled by sticking a capacitor CGS between the gate of the MOSFET and ground. And we saw that the waveforms here, if I had some kind of step here. Let's say, for example, a step that went from high to low. Then out here I would have a transition that instead of going up rapidly like this would transition a little bit more slowly. And this transition was characterized by an RC time constant. And this is what gave rise to a delay in the eventual output. So that is what we saw previously, single energy storage element. Today what we are going to do is we are going to look at the same circuit, the exact same circuit, and have some fun with it. What we are going to say is look, this thing is pretty slow, so what I would like to do is -- why don't we go ahead and put that up. What we are going to see is that the yellow waveform is the waveform at the input here. And the green waveform here is the waveform at this intermediate node. And notice that this waveform here is characterized by the slowly rising characteristics that are typical of an RC circuit. There are some other weirdnesses and so on going on here like a little bump and stuff like that. You can ignore all of that for now. It happens because of certain other very subtle circuit effects that you won't be dealing with, called Miller effects and so on that you won't be dealing with in 6.002. So focus then on this part here. It is pretty slow. And because of that slow rising, I get a very slow transition and I get some delay in my inverter. So you say ah-ha, we learned about this in 6.002, I can make it go faster. How can you make the circuit go faster? What could you do? This is rising very slowly. How can you make it go faster? Anybody? You have multiple choices, actually. What are your choices here? Pardon. Decrease the time constant. And how would you decrease the time constant? The capacitance is connected to this MOSFET gate here. I didn't want it in the first place but it is there, I cannot help it, so I can decrease the resistance. Good. Let me go ahead and do that. What I will do is I am going to knock this sucker out and stick in a new resistance that is say 50 ohms, a much smaller resistance. That should speed things up, right? That should make things go much faster because this is a smaller time constant because R is smaller, correct? OK, let's go do it. And let's see if we get what we expect. I have a little switch here. And using that switch, I am going to switch in this little resistance. Whoa, what on earth is happening out there? This is so much fun. What I did is I switched in a small resister here to decrease the time constant, but it looks like I got a whole bunch of crapola that I did not bargain for. This is certainly very fast, it goes up really fast, but I am not sure where it is going, though. Let's stare at that a little while longer. Let me expand the time scale for you. Look at this. Instead of a nice little smooth thing going up. I get something that looks like this. It looks something like a sinusoid. It looks sinusoidal, but then it is a sinusoid that kind of gives up and kind of gets tired and kind of goes away. Right? It kind of dies out. So nothing that you have learned so far has prepared you for this. And, trust me, when I first did some circuit designs myself a long, long time ago I got nailed by that. I looked at my circuit, and what ended up happening was I was noticing these sharp lines at all my transitions. When I looked at my scope, I expected to see nice little square waves but I saw these little nasty spikes sitting out there. And then when I stared at it more carefully, those spikes were really sinusoids that seemed to kind of get tired and kind of go away. So those are nasty, those are real and they happen all the time. And what we will do today is try to get into that and understand why that is the case. We will understand how to design that away. And that is a real problem, by the way. And the reason that is a real problem is the following. Look at this. Look down here. Because this intermediate voltage is meandering all over the countryside here, at this particular point the intermediate voltage dips quite low. And because it dips quite low look at the output. The output has a bump here. And it is quite possible for this output bump to now go into the forbidden region. Or worse. If this swing here was higher, this could have actually gone onto a one, so I would have gotten a false one pulse here. Instead of having a nice one to zero transition, I would have gotten a one to zero, oh, back to one, oh, back to zero and then back down to zero. So this is nasty stuff, really, really nasty stuff. What we will do is understand why that is the case today and see if we can explain it. What is going on here? What is really going on here is take a look at this circuit here. I will take a look at this path here. So this is your VS voltage source. Path kind of goes like this and around. It turns out that this circuit is a loop here. And when there is current flow, going down to basic physics you remember that I also enclose some amount. So there is a current flowing in a loop. And because of that there is an effective inductance here. And, in fact, any current flowing through a wire above a ground plane, for that matter, can be characterized by the inductance. So I can model that by sticking a little inductor here. So my real circuit is not exactly a resistor and a capacitor, but my real circuit is an inductor as well that comes into play because of this wire. Every wire, when there is a current flow, has an inductance associated with it. And because of that the real circuit is resistor, inductor and capacitor. So I end up with two storage elements now, and the dynamics of that are very different from that with a single storage element. That is just a bit of motivation for why our study of inductors is important. And I can draw a quick circuit here. If you look at the circuit, start from ground, the voltage VS and there is a resistor here. And then I have an inductor and then I have a capacitor. So it is a voltage source, resistor, inductor and capacitor. For this whole week we will be looking at circuits like this. Today what I would like to do is start very simple, start with the simplest possible form of this so that you can begin building up your insight and then go into more complicated cases. Today what I will do is simply begin with a case where I don't have a resistor here and simply study a voltage source, an inductor and a capacitor and understand what the voltage looks like out here. So we look at the dynamics of a little system like this. Before we go on, I want to caution you about something. It is just happenstance that I have introduced for you capacitors based on the parasitic capacitance here and inductance based on parasitic inductance. I would hate to leave you with the impression that inductors and capacitors are "bad". Because when you think of a parasitic, you know, parasites. These are parasitic. You didn't expect them there, didn't expect this here and we got the weird behavior. So parasitics have a bad connotation to them. I do not want to leave you with a bad taste in your mouth about capacitors and inductors that these are just bad things. We just have to deal with them and deal with second-order differential equations and all that stuff because they're just bad stuff and we just have to deal with them. I don't want you to end up going through life hating capacitors and inductors. Just because of my choice of examples, it just happened to be introducing them as capacitors. I want to point out that these are fundamental lumped elements in their own right. They are very, incredibly important and useful circuits where we designed capacitors and inductors because we want to have them in there. There are many circuits that we will look at where we really want the inductor in there. We will design an inductor by wrapping wire around in a coil and get bigger inductances and so. Just remember that this can be parasitic in some cases, but in many cases it's good, inductors are good, so just stick with that thought. These are mostly good so don't go around hating them. All right. Let's go on and analyze a basic circuit like this. And what I would like to cover in the next hour are the foundations of something like that. I will take you through the foundations so you understand how it works. And, as always, what I am going to end up with is build up the foundations, help you understand why we got where we were and then help you build intuition. And then show you a really, really simple intuitive way of doing things in terms of how experts do it. And the real cool thing about EECS is that the way experts do things, things are really, really very simple in the end. But you need to build up some intuition to get there. So our circuit looks like this in terms of my two storage elements. I have a voltage vI, inductor L, capacitor C and I am going to look at the voltage across the capacitor and my current through the capacitor. So v(t) is the voltage across the capacitor and my current is the current through this loop here, which is the same as the current through the capacitor or the current through the inductor. And we are going to proceed in exactly the same manner as we did for first order differential equations, write the equations down and just boom, boom, boom, boom, go down the same sets of steps but just get to some place different. We are going to start by writing a node equation for this node here. That's the only node for which I have an unknown voltage. The node here is vI, so I need to find this, there's just one unknown node voltage. And I am going to need some element laws. For the capacitor I know the iV relation is given by the i for the capacitor is Cdv/dt. And just to show the capacitor I am just calling it dvc/dt. Similarly, for an inductor, L, the voltage across the inductor is given by Ldi/dt. So this is the vI relation for the capacitor, the vI relation for an inductor. It also suits us to write this in an integral form. So if I integrate both sides of this equation and I bring L down to this side, I end up getting something like this, 1/L minus infinity to t, VLdt, and that is simply iL. I am just simply replacing this with an integral form. So this is a VI relationship for the inductor and this is for the capacitor. So let me now go ahead and apply the node method for my circuit here. Here, for the node method, I have to equate the currents coming into the node or sum the currents coming into the node and equate that to zero. And while I do that I simply replace the currents by the corresponding voltages using the element laws. So what do I get? I get the current going in here to the inductor is equal to the current going through the capacitor. What is the current going the capacitor? In terms of its v relationship it is Cdv/dt. And the current going to the inductor is given by this relation here, which is simply 1/L minus infinity to t. The voltage across the capacitor is simply (vI-v)dt. I have just written down the node quotation for this node here. Now I will just apply a bit of math and simplify it and get the resulting equation. What I can do is simply differentiate with respect to t here. And get this to be Cd^2v/dt^2, the second derivative of v. And here what I end up getting is 1/L(vI-v). So I just differentiated the whole thing by d/dt here. And then I just move L up here. I bring d^2v/dt^2 out here. And then I get a minus v here, and that will be equal to, oh, I'm sorry. Let me leave this here. Bring the minus v to this side so it becomes a plus and leave vI on this side. So I end up getting LCd^2v/dt^2. I bring L up here. And then I take v to the other side. Plus v and leave vI here so I get vI. That is second order differential equation that governs the characteristics of the voltage, v. So much as the voltage across the capacitor was a state variable in our RC circuits or the current through the inductor was a state variable in our RL circuits, out here both the current through the inductor and the voltage across the capacitor are my two state variables. And so here I have a second-order equation in my voltage, v. Again, going through the foundations here, I am now going to go through a bunch of math. Up to here it was circuit analysis, and now I am just going to do math. For the next three or four blackboards just math. You can solve this second-order differential equation any which way you want. But just to keep things as simple as possible, in 6.002 I solve all the differential equations, it turns out we are fortunate enough we can do that, using the exact same method again and again and again, the same thing can be applied. And the method that we use to solve it is the method of homogenous and particular solutions. So the first step we are going to find the particular solution, vP. Second step we find the homogenous solution, vH. And the third step we are going to find the total solution as the sum of, v is simply the particular plus the homogenous solution and then solve for constants based on the initial conditions and the applied voltage. So let's write down initial conditions. Let's assume, for simplicity, that my initial conditions are simply the voltage across the capacitor is zero to begin and the current through my inductor is also zero as I begin life. Now, this is what is called "zero state". v and i are both zero, and so the response of my circuit for some input is going to be called ZSR. You've probably heard this term in one of your recitations. So zero state response simply says I start with my circuit at rest and looks at how it behaves for some given input. That is a little term you may end up using. My input next. I am going to use the following input. vI of t is going to be a step, is going to look like this. My input is at t=0 v is going from zero to some voltage VI and then stay at that voltage. It is going to be a step. Kaboom. And you can see why I am going with this set of variables, because I want make this situation as close as possible to the funny behavior we observed there. Remember we had a step, and because of the step we had some behavior at that node? So I will try to bring you as close to that. In tomorrow's lecture, I am going to close the loop around that and derive for you exactly the behavior we saw on the scope. And to get there I am going to be try to be as close as possible to the constants and other parameters in the demo. So VI is a step and zero state. Just in terms of notation, this kind of a step input occurs pretty frequently. And we just have a special notation for it. We simply call it VI is the final value here. And we call it u(t). So VIu(t), u(t) simply represents a step at time t=0, steps from zero volts to VI. That is just a little more notation that will come in handy at some point. More math now. Three steps, particular solution, homogenous solution, total solution/constants. This is almost like a mantra here, like a chorus. Homogenous solution we compute using a four-step method. And four-step method for homogenous solutions, it turns out that it happens to be that way for all the equations we will see in our course. The first step would be assume a solution of the form Ae^st. Exactly as with RCs. If you close your eyes and do exactly what you did for RCs you will get to where you want to be. You assume a solution of the form Ae^st. Substitute that into your homogenous equation. Obtain the characteristic equation. Solve for the roots. And then write down your homogenous solution. Same sort of steps again and again and again until you get bored to tears. Particular solution. For the particular solution, I simply need to find a solution, any solution, if not the most general one but any solution that satisfies the particular equation which satisfies that equation. LCd^2vP/dt^2+vP=VI. My input is a step and I am going to look for the solution for time t greater than zero. Notice that for time t less than or equal to zero, v is going to be zero. So I am looking for a solution greater than t=0. Here, if I substitute vP=VI, that is a particular solution. Because if I substitute VI here this goes to zero and then I get VI=VI, so this works. I promised you this was going to be simple. You cannot get any simpler than that. I have done my first step. I found the particular solution. And VI is a good enough particular solution so I will use it, I will take it. As my second step I am going to find vH or the solution to the homogenous equation. And the homogenous equation is simply that equation with drive set to zero. What I get here is LCd^2vH/dt^2+vH=0. That is my homogenous equation. I simply set the drive to be zero. And to find the solution here, I go through my four-step method. Again, in 6.002 following the kind of Occam's principle, we just show you the absolute minimum necessary to get to where you want. The absolute minimum necessary is it turns out that we can solve all our differential equations that we use here by using the methods of homogenous and particular solutions. And every homogenous solution can be solved by a four-step method. That is about as minimal as it can get. So no extraneous stuff there. The four-step method, four steps. The first step is assume a solution of the form vH=Ae^st. What I have noticed is that students starting out are usually scared of differential equations. I know I was when I was a student. And the trick with differential equations is that it is all a matter of psych. Just because you see some squigglies and squagglies and a bunch of math and so on you say oh, that must be hard. But differential equations are actually the simplest thing there is because in a large majority of cases the way you solve them is you assume you know the answer, someone tells you the answer. And then all you are left to do is shove the answer into the equation and find out the constants that makes it the answer. Just a matter of psych. Psych yourselves that this stuff is easy, because I am telling you what the solution is. All you have to do is substitute and verify. If you think about differential equations that way or a large majority of them, it really is very simple if you can just get past the squigglies here. Just get past the squigglies and then just simply stick in some simple stuff and it works. I mean it just cannot get any easier. I cannot think of any other field where the way you find a solution is assume you know the solution and stick it in. It has never made any sense to me but that is how it is. So we assume the solution to the form Ae^st, you stick it in there, and you have to find out the A and s that make it so. It cannot get any simpler than that. Let's stick the sucker in here and see what we can get. Substitute Ae^st here I get LCA, and second derivative, so it's s^2 e^st. And Ae^st on this one here. And that equals zero. And then let me just solve for whatever I can find. Assuming I don't take the trivial case A=0, I cancel these guys out. And what I am left with is simply LCs^2+1=0. In other words, what I end up getting is B, s^2=-1/LC. My first step was, I am giving you solutions, stick them in there, assume a solution of this form. Second step is get the characteristic equation. And the way you get the characteristic equation is that you simply stick this guy in there. And what you end up getting is some equation in s^2. Do you remember what you got for first order circuits? What s was? What is s? For first order circuits, what did you get as a characteristic equation? s+1/RC=0. The same thing. Just remember to blindly apply the steps. It will lead you to the answer. This is called the "characteristic equation". This is incredibly important. You will see in about a couple weeks from now that once you write the characteristic equation down for a circuit, it tells you all there is to know about the circuit. And often times you can stop solving right here. To experienced circuit designers this tells me everything there is to know. This is really key. That's why it's called a characteristic equation. I believe in problem number three of the homework that will be coming out this week, that is exactly what you are going to do. I am going to give you a circuit, ask you to get to the characteristic equation quickly and then from there intuit the solution. Write the characteristic equation and then just intuit solution, it's that simple. So, step A, assume a solution of the form, step B, write the characteristic equation down. And let me just simplify that a little bit. I go ahead and find my roots. And my roots here, remember that j is the square root of minus one. And so what I end up getting is, my two roots here are, plus j square root of 1/LC and minus j square root of 1/LC. Two roots. And just as a shorthand notation, much like I had a shorthand notation for RC, what was my shorthand notation for RC? Tau. Just as tau was big in first order, we have a corresponding thing that is big in second order and that is omega nought. Omega nought is simply square root 1/LC. Just as tau was RC, omega nought is a shorthand here. And so s is simply plus or minus j omega nought. Notice that in this equation here, if you take the square root of LC there that has units of time, so one divided by that has units of frequency. Notice that this guy is a frequency in radians. I end up getting my roots of the homogenous equation, and that is my third step. And as my fourth step, I simply write down the homogenous solution as substituting s with its roots and writing the most general possible form of the solution, and that would be A1e^(j omega nought t)+A2e^(-j omega nought t). Done. Some constant times this solution plus some other constant times, the other solution. Plus zero omega nought. Remember it comes from here, Ae^st. I assume the solution of this form, so my solution in this most general case would be s being j omega nought in one case, minus j omega nought in the other case, and I sum the two to get the most general solution. So blasting ahead. I now have my homogenous solution. And as my third step of solution to differential equations I write down the total solution, v=vP+vH, particular plus the homogenous solutions. And v=VI, was my particular solution, +A1e^(j omega nought t)+A2e^(-j omega nought t) is my complete solution. The final step, write down the total solution and find the constants from the initial conditions. To find the constants from the initial conditions, let's start with, the voltage is zero to begin with. This equation governs the characteristics of v, so I need to find the initial conditions. First of all, I know that know that v(0)=0. From there I substitute t=0. And so this goes to one, this goes to one, and I end up getting 0=VI+A1+A2. That is my first expression. And then I am also given that i(0)=0. And so I can get that as well. How do I get i? This is v. I know that i=Cdv/dt, so I can get i by simply multiplying by C and differentiating this with respect to t. I get C, this guy vanishes so I get d/dt of this. So it is CA1(j omega nought) e^(j omega nought t)+CA2(-j omega nought)e^(-j omega nought t). From here I am given that that is zero, and so therefore this guy becomes a one, this guy becomes a one, j omega nought, j omega nought cancel out. What I end up getting is A1=A2. From the second initial condition I get A1=A2. From these two, if I substitute here for A2, I get VI + 2A1 = 0, or A1=-VI/2. That is also equal to A2. Therefore, my total solution now can be written in terms of the actual values of the constants I have obtained. I get VI-VI/2. So A1 and A2 are equal. I just pull them outside. I pull VI-2 outside and I stick these two guys in parenthesis in. Again, I promised you no more circuits from here on until the very last board or something like that. It is all math, so not much else happening there. More math. If you would like, I could skip all the way to the end and show you the answer. But I just love to write equations on the board so let me just go through that. I am going to simplify this a little further here. And we should remember this form by the Euler relation, ejx=cos x+j sin x. And by the same token, (e^jx + e^-jx)/2=cos x. You all should know this from the Euler relation. So were are using this guy here, ej^x + e^-jx=2cos x. And so this one is 2 cosine of omega nought t, 2 and 2 cancel out, and what I am left with is v(t)=VI-VI cos( omega nought t). And the current is Cdv/dt, which is simply CVI sin( omega nought t). Just remember that omega nought is the square root of 1/LC. We are done. In fact, I did not give that answer the importance that was due so let me just draw. There. That is better. Enough math. In a nutshell, what did we do. We wrote the node method, it's a very simple circuit, to write down the equation governing that circuit. And then we grunged through a bunch of math. Not a whole lot here. It is pretty simple. And ended up with a relation that says the voltage across the capacitor for a step input, assuming zero state, is a constant VI-VI cos omega t. Notice that even though I have a step input, the circuit dynamics are such that I get a cosine in there. You can begin to see where these cosines are coming from now. They come in here. And if you recall the example I showed you earlier of the inverter circuit, remember there was a cosine that decayed, that was sort of losing energy and kind of dying out? So you can see where the cosines are coming from. And just to draw you a little sketch here. Let me draw v and i for you and let me plot omega t, pi/2, pi and so on. Let me plot VI. When time t=0, VI=0, cosine omega t is one, and so VI-VI=0. That is simply a cosine that starts out at zero here, and at pi I get cosine omega t is minus one, so I get plus VI on the other side. So I end up at +2VI. At this point the voltage is here. And notice that this guy looks like this. It is a cosine that is translated up so that its mean value is not zero but VI. It is just a translation up of a cosine. Similarly, in this case for the current it is a sinusoidal characteristic. And it looks something like this where the peak is given by CVI, oh, I messed up. When I differentiated this is missed the omega nought out there. What I would like to do now -- This is the form of the output for a step input. What I would like to do next is show you a demo. But before I show you a demo, I always found it strange that I have a step input and then I have two little elements, how can I get a sine coming out of the output? I would like to get some intuition as to why things behave the way they are. I could go and pray to find out, but let me just give you some very basic insight as to why this behaves the way it does. Let me draw the circuit for you here. And this is my inductor L and capacitance C. Remember this is v. Let me just walk you through what is happening there and get you to understand this. Now, you have seen sines occur before. If you go and write down the equation of motion of a pendulum, you know, you have a pendulum, you move it to one side, let go. It is also governed by sinusoidal characteristics. And you will find that the equation governing its motion is very much of the same form, and you get the sinusoid where you have energy that is sloshing back and forth between maximum potential energy to maximum kinetic energy and zero potential energy back to maximum potential energy, zero kinetic. So it is energy sloshing back and forth. The same way here. Capacitors and inductors store energy. Let's walk through and see what happens. I start off with both of them having the stage zero, zero current, zero voltage. I apply a step here. Boom, the step comes instanteously to VI. I notice that the capacitor voltage cannot change instantly unless there is an infinite pulse of a sort, so this guy cannot change instantly. And so its voltage starts off being zero. So the entire voltage here, KVL must be true no matter what. They are absolutely fundamental principles from Maxwell's equations. KVL must hold, which means that the entire voltage VI must appear across the inductor. I put a big voltage across the inductor and its current begins to build up. There you go. A voltage across the inductor, its current begins to build up. As its current begins to build up that current must flow through the capacitor, too. And as current flows through a capacitor it is depositing charge into the capacitor. As the capacitor begins to get charge deposited on it, its voltage begins to rise. Let's see what happens here. Its voltage keeps rising. At some point, the voltage across the capacitor is equal to VI. But then VI equals this VI here. So when the two become VI, the inductor has zero volts across it. So there is no longer a potential difference that is increasing the current in that direction. At that point, at pi divided by 2, I have some current going into the inductor so there is no longer a pressure that is forcing more current through the inductor because this voltage reaches VI. But remember capacitors like to sit around holding voltages. Just remember that demo. That rinky-dink capacitor sat there stubbornly holding its voltage. And it had a huge spark towards the end. It just sat there holding its voltage. In the same manner, inductors love to sit around holding a current. They will do whatever they can to keep the current going through them. It has got the current going through. And few forces on earth can change that. And so therefore, even though the capacitor voltage is VI and the voltage drop across the inductor is zero, it still keeps supplying a current. It has got the current. It's got inertia. It keeps going. It is like a runaway train. You may not be pushing the train from the back, but once it is running it has got kinetic energy and is going to run no matter what for a least some more time, even if you take away the force on the train. So I have taken away the force on the punching more current through, but it has kinetic energy. It has current flowing through it so it continues to supply a current. Because it continues to supply the current the capacitor voltage keeps increasing. This is a subtle insight which is absolutely spectacular that with zero volts across it, it still keeps pumping that current. Capacitor voltage has gone up. And guess what? The voltage on this side is higher now but this guy is still pumping a current. Man, I have been born to do this, you know, I shall pump a current. However, because the voltage has now gone up here gradually the current begins to diminish. So the capacitor is concerned. You pump a current into me, my voltage goes up. At some point, like a runaway train, it comes to a halt. The current through the capacitor drains and now goes to zero and the capacitor voltage reaches 2VI. So this is at 2VI now and this is at VI. Now the situation is not in equilibrium. At this point there is zero current through it, but guess what? I have a VI pumping in this direction now. I have the same VI punching in this direction. So guess what? Its current must now build up in this direction and its current begins to build up in that direction. That begins to discharge the capacitor and the capacitor then goes on to a negative, or the current goes down to a maximum negative current, and this process continues. What you are seeing here is energy. It is sloshing back and forth between the two, and that is kind of a key. I will just quickly put up a demo that you can watch as you are walking out. With a step input, notice the green is the voltage across the capacitor and the orange is the current through the capacitor. MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Please use the following citation format: Anant Agarwal, 6.002 Circuits and Electronics, Spring 2007 (Massachusetts Institute of Technology: MIT OpenCourseWare). http://ocw.mit.edu (accessed MM DD, YYYY). License: Creative Commons Attribution-Noncommercial-Share Alike. Note: Please use the actual date you accessed this material in your citation. For more information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Transcript – Lecture 15b Before I begin today, I thought I would take the first five minutes and show you some fun stuff I have been hacking on for the past three years. This has to do with 6.002 and circuits and all that stuff, but this is completely optional, this is for fun, this is to go build your intuition, this is to check your answers, whatever you want. This is not a required part of the course. Just for fun. There is this URL out here that I put down here. I have been hacking on this system for the past three years, and for the first time this year and very tentatively and gingerly introducing it to students. The idea here is that it is a, that is kind of defocused. Any chance of focusing that a little bit better? The idea of this is that it is a Web-based interactive simulation package that I have pulled together. And what you can do is you can pull up a bunch of circuits. Notice that the URL is up here. It is euryale.lcs.mit.edu/websim. And there is the pointer to it. So you have a bunch of fun things you can play with. And we have gone through all of these things in lecture. Let's pick the MOSFET amplifier. You come to this page. This is something you have seen in class. And let's play with this little circuit. And you see the mouse? Good. You can set up a bunch of parameters. You can set up the MOSFET parameters VT and K. You can set up the value of R for your resistor, you can establish a bias voltage, and you can have an input voltage vIN. So you can apply a bunch of input voltages. You can apply a zero input, unit in pulse, unit step, sine wave, square waves. Or this was the part that took me the longest to get right. You can also input a bunch of music. And so far I just have two clips, so you are going to get bored listening to them. Good. So you can also input music. And what you can do is you can watch the waveforms, you can listen to the output and do a bunch of fun stuff. One experiment I would love for you guys to try out. Again, remember, this is completely optional. Just for fun. You can apply some input. Step input, for example, to an RLC circuit and spend 30 seconds thinking about what should the output look like. I divine that the output should look like this and then do this and see if what you thought was correct. And it's fun to kind of play around with it. Let me start with, just as an example, let's say I input classical music. And let us say I would like to listen to the output here that is the voltage at the drain terminal of the MOSFET. For listening it sets up a default timeframe to listen to, so you go ahead and do it. This shows you the time domain waveform of a clip of the music and then you can listen to it. Lot's of distortion, right? As you can see, there is a bunch of distortion. And that is as you expect because the peak-to-peak voltage is 1 volt, the bias is 2.5, and so this is clipping at the lower end, plus the MOSFET is nonlinear. You can play around with a bunch of things and you can have a lot of fun. And the reason I created this is that MIT is putting a bunch of its courses on the Web. And one of the hottest things about courses like this is the lab component. If you are beaming a course to, say, a Third World country or something, how do you get people to set up the massive lab infrastructure? I know you hate your oscilloscopes, I know you hate your wires, I know you hate the clips, but the fact is you have them. I know a lot of places those are way too expensive to pull together, which is why I have been creating this Web-based kind of interactive laboratory so that people can learn this stuff over the Web. Let's go do another example very quickly. Let's say you learned about, well, let's do RC circuits. Here is the parallel RC circuit. And you can set up capacitor values, resistor values, you can set up input. Here, let me look at the time domain waveform for the voltage across the capacitor. And this time around let me play a unit step. And let's see what the output is going to look like. You can think in your minds what should the output look like, and then you can go and plot it. There you go. That's what the output looks like. So you can play around with it and have fun. That's all the good news. The bad news is that so far I just have one Pentium III machine behind us. It is a Linux box, so don't all of you try it at once. However, what I have also done, and that took me another six months of hacking in the small amount of time professors have to hack on stuff, I've hacked an incredibly elaborate cashing system so that once anyone in class tries out some combination of parameters it goes and squirrels away all the outputs. If anybody else types in the same sets of parameters it will just get all the output and play it back to you. So if enough of you play with over time, we may end up cashing all the important waveforms and music clips and all of that stuff. I have allocated a few gigabytes of storage, so I am hoping that it may work. Go forth. Play with it. And this is completely my fault, so if there are any bugs or anything simply email them to me. This is the first time this is coming alive so bear with it. Now let me switch back to the scheduled presentation for today. All right, hope and pray that this works. Yes. Good. I am going to do today's lecture using view graphs. And the reason I am going to do that and not do my usual blackboard presentation which I way, way, way prefer to a view graph presentation. The only reason I am going to do this for today, and maybe one more lecture, is that there is just a huge amount of math grunge in this lecture. What I want to do is kind of blast through that, but you will have it all in the notes that you have, so that you don't waste time in class as you watch me stumbling over twiddles and tildes and all that stuff. The key thing here is that the insight is actually very simple. The beginning and the end are connected very tightly and very simple. There is a bunch of math grunge in the middle that we are going to work through and, again, follows a complete old established pattern. So, in that sense, there is really nothing dramatically new in there. Let me spend the next five minutes reviewing for you how we got here, what have we covered so far and set up the presentation. The first ten view graphs I am going to blast through and just tell you where we are in terms of LC and RLC circuits. I began by showing you this little demo, two inverters, one driving. I can model the inductance here with a little inductor, the capacitor of the gate here. And recall that when I wanted to speed this up by introducing a 50 ohm smaller resistance, I got some really strange behavior. Just to remind you, for Tuesday's lecture it would help if you quickly reviewed the appendix on complex algebra in the course notes. Remember all the real and imaginary j and omega stuff? It would be good to very quickly skim through that. It is a couple of pages. Remember this demo? And the relevant circuit that is of interest to us is this one here. It is the resistor, there is the inductor and there is a capacitor. This is Page 3. I am just going to blast through the first ten view graphs. It is all old stuff. Then we observed the following output. We applied this input at VA and we got this output, a very slowly rising waveform because of the RC transient. And because of that you saw a delay. Notice that this delay was because of the slowly rising transient. This waveform took some time to hit the threshold of the neighboring transistor. So we say ah-ha, let's try to speed this sucker up by reducing the resistance in the collector of the first inverter. And so I had this input. Now, to my surprise, instead of seeing a nice little much higher and much faster transitioning circuit, well, I did see a much faster transitioning circuit but I got all this strange behavior on the output that I was interested in. And because of that, if these excursions were low enough, I could actually trigger the output and get a whole bunch of false ones here because of these negative excursions which should not really be there. That was kind of strange. In the last lecture we said let's take this one step at a time. Let's not jump into an RLC circuit. Let's go step by step. Let's start with an LC, understand the behavior. We started off with an LC circuit of this sort, and using the node equation we showed that this was the equation that governed the behavior of the circuit. And then we said that for a step input and for zero initial conditions, that is the zero state response, let's find out what the output, the voltage across the capacitor looks like. And so we obtained the total solution to be this. And there was a sinusoidal term in there. And the omega nought which was one by square root of LC. And this was the circuit. And so for this step input notice that the output looked like this. So far an input step I had an output that went like this. Notice that it is indeed possible for the output voltage to actually go above the input value VI. This is kind of non-intuitive but this can happen. So this waveform jumps up and down. But the steady state value, on average if you will, is VI. On the other hand, it does have sinusoidal excursions and this kind of goes on because there is nothing to dissipate the energy inside that circuit. By the way, the fact that the capacitor voltage shoots above the input voltage is actually a very important property. We won't dwell on it in 6.002, but just squirrel that away in your brain somewhere. I promise you that some time in your life you will have to create a little design somewhere that will need a higher voltage than your DC input. And you can use this primitive fact to actually produce a DC voltage higher than you are given, and then use that somehow. In fact, there is a whole research area of what are called DC to DC converters, voltage converters. Let's say you have 1.5 volt battery, a AA battery, but let's say a circuit needs 1.8 volts. The Pentium IIIs, for example, needed 1.8 volts. And the strong arm is another chip that required 1.8 volts a few years ago, but the AA cell was 1.5 volts. How do get 1.8 from 1.5? Well, you have to step it up somehow. And this basic principle where the voltage can jump up above the input is actually used, of course with additional circuitry, to kind of get higher voltages. It is a really key point that you can squirrel away. This was pretty much where we got to in the last lecture. This starts off the material for today. What we are going to do is take that same circuit, but instead we are going to put in this little resistor here. This is what we set out to analyze. And for details you can read the course notes Section 13.6. The green curve here was the behavior of the LC circuit. And what we are going to show today is that the moment we introduce R this sinusoid here gets damp. It kind of loses energy. And I am going to show you that the behavior is going to look like this. By introducing R this guy doesn't keep oscillating forever. Rather it begins to oscillate and then kind of loses energy and kind of gets tired and settles down at VI. And remember the demo. This is exactly what you saw in the demo. You had a step input and you had this funny behavior. And for the RLC that is exactly what it was. So today's lecture will close the loop on what you saw in the demo and the weird behavior, and I am going to show you the mathematics foundations for that today. Let's go ahead and analyze the RLC circuit. I purposely created the entire presentation to follow as closely as possible both the discussion of the RC networks and the LC networks so that the math is all the same. Exactly the same steps in the mathematics are in the exposition of the analysis. What's different are the results because the circuit is different. So don't get bogged down or whatever in the mathematics. Just remember it is the same set of steps that you are going to be applying. We start by writing down the element rules for our elements. Nothing new here. For the inductor V is Ldi/dt. The integral form which is simply 1/L integral vLdt=i. We saw this the last time. And for the capacitor, the current through the capacitor is simply Cdv/dt. Those are the two element rules for the capacitor and inductor. The element rule for the resistor, of course, is V=iR. You know that. And for the voltage source we know that, too, the voltage is a constant. Just follow the same established pattern. By the way, just so you are aware, I have booby trapped the presentation a little bit to prevent you from falling asleep. You see the dash lines here? Whenever you see a dash line, that stuff needs to be copied down. Don't trip over that. Don't say I didn't warn you. We start by using the usual node method. And I have two nodes in this case. Unlike the LC circuits, I have two unknown nodes. One is this node here with the node voltage vA and the second node is the node with voltage vT. Let me start with vA and write the node equation for that. It is simply 1/L, the node equation for this is the current going in this direction with is vI-vA integral and that equals the current going this way which is vA-v/R, node equation. I then write the node equation for the node v, for this node here, and that is simply (vA-v)/R=Cdvdt. And that is what I have here, two node equations. Let me summarize the results for you and then show you a view graph where I grind through the math as to how I got the result. Here is the result I am going to get. If I take these two node equations and I massage some of the mathematics, I am going to get this result. And I will show you that in a second. By grinding through some math and solving these two equations and expressing this in terms of v, I get a second order differential equation, d^2v blah, blah, blah. Notice that this is different from the LC in this term. Every step of the way you can check to see if I am lying or I am correct. I will indulge you, indulge myself rather with a little story here. Richard Fineman was a known smart guy. And one of the reasons that he was that was in the middle of talks he was known to get up and ask some of the darndest, hardest questions and say ah-ha, you have a bug in this proof here or a bug in this equation that is not right. And usually he would be correct. So his trick in doing this and which is one reason how he became a known smart guy. What he would do is, as the speaker went on talking he would kind of follow along and think of a simple initial primitive case. In this case, I have an RLC circuit. So think of a simpler case of this. A simpler case of this is R=0. Whenever you set R to be zero, you should get exactly what we got in the last lecture, correct? That is what Fineman would do. He would boil this down to a simpler case, make some assumptions and just follow along. And whenever he found a discrepancy between the math here and his simple case he would say oh, there is a bug there. If you want you can catch me that way. Here, what Fineman would do is replace R being zero, and notice then this equation here is exactly what we got the last time with R being zero. Just remember that Fineman trick. This is the equation we get, the second-order differential equation with an R term in there. And let me just grind through the math and show you how I got this from this. So the two node equations again. And what I do is I start by taking these two equations and differentiating this with respect to t and this is what I get. And, at the same time, I have replaced (vA-v)/R here by this term. I replace this with this and differentiate. Then I simply divide the whole thing by C. Then I take this expression here and write down vA is equal to this stuff here. Next I am going to substitute this back for vA and eliminate vA. So I take this vA, stick the sucker in here, and thereby eliminate vA and get this. And then I simplify it and here is what I get. That is what I get. I just grind through the two equations and get that result. So like a stuck record I will repeat our mantra here, which is here is how we solve the equations that we run across in this course, the same three steps. Find the particular solution. Find the homogenous solution. Find the total solution and then find the constants using the initial conditions. Same steps. You could recite this in your sleep. And the homogenous solution is obtained using a further four steps. Let's just go through and apply this method to our equation and get the results. vP is a particular solution and vH is the homogenous solution. With a particular solution, oh. Before I go on to do that, let me set up my inputs and my state variables. My input is going to be a step. Remember, I am trying to take you to the point where the demo left off. The demo had a step input, so I am going to use a step input rising to vI. And I am going to with the initial conditions being all zeros. So the capacitor voltage is zero, inductor current, another state variable is also zero, and therefore this is also fondly called the ZSR or the zero state response because there is only an input but zero state. Again, remember the dashed lines here. Don't say I didn't warn you. Let's start with a particular solution. This is as simple as it gets. I simply write down the particular equation and stick my specific input. And remember the solution to the particular equation is any old solution, it doesn't have to be a general solution, any old solution that satisfies it. And I am going to find a simple solution here. And V particular is a constant VI. It works. Because remember this has been working all along. And I am going to keep pushing this and see if this works until the end of the course. Guess what? It will. So this is a solution. I'm done. That is my particular solution. Simple. Second, I go and do my homogenous solution. And the homogenous equation, remember, is the same old differential equation with the drive set to zero. Remember that sometimes this equation with the drive set to zero is the entire equation you have to deal with in situations where you have zero input, for example. Or in other situations in which you have an impulse at the input. And the impulse simply sets up the initial conditions like a charge in the capacitor or something like that. So we are going to blast through this four-step method. The method simply says that four steps, I am going to assume a solution of the form Ae^st. And if you think you've seen that before, yes, you have seen it many times before. And you will see it again, again and again. And we need to find A and s. We want to form the characteristic equation, find the roots of the equation and then write down the general solution to the homogenous equation as this. Same old same old. Let me just walk through the steps here. Step A, assume a solution to the form Ae^st. And so I substitute Ae^st as my tentative solution to the equation. Again, let me remind you that the differential equations that we solve here are really easy because the way you solve them is you begin by assuming you know the solution and stick it in and find out what makes it work. I am going to stick Ae^st into this differential equation, and A comes out here. Differentiate this d squared, I get s squared down here, A s here and this simply gets stuck down here with the 1/LC coefficient. The next step I begin eliminating what I can, so I eliminate the A's, then eliminate the e^st's, and I end up with this equation here. I end up with this equation. This is my characteristic equation. It is an equation in s. Do people remember the characteristic equation we got for the LC circuit? Remember the Fineman trick? That's right, LC. S^2+1/LC=0. This thing wasn't there. All you do is simply follow the R. Just follow the R. Just imagine this is a dollar sign and kind of follow it. And you will see what the differences are between the LC and the RLC. So this is the characteristic equation. What I am going to do, iss much as I wrote the characteristic equation for the LC circuit, by substituting omega nought squared for 1/LC. Let me do the same thing here but introduce something for R and L as well. What I will do is let me give you this canonic form. The very first second-order equation I learned about when I was a kid was this one, S^2+2AS+B^2 or something like that. Let me write it in that form where I get 2 alpha s plus omega nought squared. Again, remember the alpha comes about because of R. So omega nought squared is 1/LC and alpha is RL/2. Omega nought squared is 1/LC and R/L is equal to two alpha. I am just writing this in a simpler form so that from now on going forward I am just going to deal with alphas and omega noughts. Once I get to this characteristic equation, after that I can give you one generic way of solving it. And depending on the kind of circuit you have, a series RLC, which is what we have, or a parallel RLC we will simply get different coefficients for the alpha term. This is going to stay the same but this term will look different, alpha is going to look different. There is a real pattern here. And what I am doing is simply focusing on what is important, what the differences are between the pattern. You learned the LC situation and the RLC situation. Given this I can now write down, I am just simply replacing this as my characteristic equation in dealing with alphas and omegas. I will give you a physical significance of alpha in a little bit. Do you remember the physical significance of omega nought? That was the oscillation frequency. In other words, given an inductor and capacitor, you put some charge on the capacitor and you watch it, it will oscillate. And its oscillation frequency will be one by a square root of LC. The magnitude of the initial conditions will determine how high are the oscillations or what the phase is in terms of when it starts, but the frequency is going to be the same. Step three, to solve the homogenous equation, is find the roots of the equation, s1 and s2, and here are my roots. Good old roots for a second-order, little s squared equation here. Finally, given that I have the roots, I can write down the general homogenous solution. So general solution is simply A1e^s1t, A2e^s2t. That's it. That's the solution. This looks big and corny, but we are going to make some simplifications as we go along and show that it ends up boiling down to something cos omega t. The math is kind of involved but we get down to something very simple, a cosine. Hold this general solution. From that, as a step three of the differential equation solution, I write the total solution down. And my total solution is the sum of the particular and the homogenous, so therefore I get this. VI was my particular and this term here is my homogenous solution. Now, if I wasn't doing circuits and simply trying to solve this mathematically here is what I would do. I would find the unknown from the initial conditions, so I know that v(0)=0. And so therefore if I substitute zero for V(0) I get this. If I substitute zero here, t is 0, t is 0, so I simply get V1+A1+A2. And let me just blast through because I am going to redo this differently. i=Cdv/dt. And so that's what I get. I substitute zero and this is what I would get. I hurried through this. Don't worry. I'm going to do it again. If you just do it mathematically, you can solve this equation here and these two simultaneous equations in a1 and a2 and get the coefficients and you are done. But it doesn't give us a whole lot of insight into the behavior of these terms here. What I am going to do for now is kind of ignore that. Ignore I did that and instead try to go down a path that is a little bit more intuitive. Let's stare at this expression we got for the total solution. That is the expression we got. All I did is, I had alpha in there, I simply pulled out the alpha outside. So this is my total solution, V1-A1e^(-alpha t) something else and something else. Three cases to consider depending on the relative values of alpha and omega nought. If alpha is greater than omega nought then I get a real quantity here. The square root of a positive number, I get a real number, and that number will add up to the minus alpha and I am going to get a solution that will look like, oh, I'm sorry. Let me just do it a little differently. There are three situations here. One is alpha greater than omega nought. Alpha equal to omega nought. Alpha less than omega nought. Alpha is greater, alpha is less, alpha is equal to this term inside the square root sign. For reasons you will understand shortly, we call this "overdamped" case, the "underdamped" case and the "critically damped" case. When alpha is greater than omega nought this term gives me a real number, and I get something as simple as this. Remember, for the series RLC circuit, alpha was R/2L. So if R is big, in other words, if in my RLC circuit R is huge then I am going to get this situation. My output voltage on the capacitor is going to look like this, the sum of two exponentials. And if I were to plot it very quickly for you, for a VI step, V would look like this. So v would simply look like this because it is the sum of a couple of exponentials. All right. Now, alpha is positive here. Remember alpha1 and alpha2 are both positive. These two added up, because of this constant VI, give rise to something that increases in the following manner. Let's look at the situation where alpha is less than omega nought, where the term inside the square root sign is negative. What I can do is pull the negative sign out and express it this way. What I am going to do is since alpha is less than omega nought, I am going to reverse these two and pull out square root of minus one to the outside. This is what I get. I am just playing around with this so that whatever is under the square root sign ends up giving me a positive real number. So I pull the j outside and this is what I get. Now, let me blast through a bunch of math and end up with something very, very simple for this underdamped case. Let me define a few other terms. I am going to call omega nought minus alpha squared the square root of that. I am going to call it omega d. And here is what I get. So I have defined three things for you now, alpha, omega nought and omega d. And I get this equation in terms of alpha and omega d. And then, remember from your good-old Euler relationship? e to the j omega d is simply cosine plus a j sine. I am just going to blast through a bunch of math rather quickly. Once I replace this in terms of a cosine and sine, cosine and a j sine and then collect all the coefficients together, I get an equation of the form VI plus some constant e to the minus alpha t, cosine, the sum of the constant e to the minus alpha t, sine. Remember the sines and cosines are coming out, but because of my R I am getting this funny alpha here, e to the minus alpha here. So I am getting sums of sine and cosine. And K1 and K2 are some constants which I will need to determine for my initial conditions. I am going to continue on with this and keep on simplifying it because, as I promised you, I want to get to something that is just a cosine. I want to go down this path. I am not going to cover this case, the critically damped case. And I will touch upon it later but not dwell on it. Let me continue down the path of the underdamped case, and this is what we have. Continuing with the math, let's start with the initial conditions, v nought equals zero, and that gives me K1 is simply -VI. So at v(0)=0 t is zero, so this terms goes away, the cosine becomes a 1, e^(alpha t) goes away, and K1=-VI. Then I know that i(0) and i is simply Cdv/dt. And I get this nasty expression. I substitute t=0 and I get something that looks like this. I know what K1 is, and so therefore K2 is simply -V1alpha divided by omega nought. I have taken this expression where the unknowns K1 and K2 are to be found. I set the initial conditions down at t=0 and I get K1 and K2 as follows, which gives me the following solution. This is the solution I get where I do not have any unknowns anymore. Remember that omega d and alpha are directly related to circuit parameters. Alpha was R/2L and omega d was square root of alpha squared minus omega nought squared. ** omega d = sqrt(alpha^2 - omega_0^2) ** And omega nought squared was 1 by square root of LC. So I know it all now. I still have sines and cosines here, so I am going to simplify this a little further. Oh, before I go on to do that, let's do the Fineman trick again and notice if I am still true to the LC circuit I did the last time. Remember when R goes to zero alpha goes to zero. Because alpha is R divided by 2L. If alpha was zero what happens? If alpha was zero, this guy goes to one, this whole term goes to zero and omega dt now ends up becoming omega nought, and I get this term here. I get VI-VIcosine(omega t), which is exactly what I expected in my equation. This is the same as the LC case that I got. Let's go back to this situation and simply if further. If you look at Appendix B.7 in your course notes, Appendix B.7 is a quick tutorial on trig. And in that trig tutorial you will see that, and you have probably seen this before, too, multiple times, the scaled sum of sines are also sines. This is an incredibly cool fact of sinusoids. If you take two sinusoids of the same frequency and you scale them up in any which way and add them up you also end up with a sinusoid. It is hard to believe but it is true. It is an incredible property of sinusoids. Take any two sinusoids, scale them in any way you like, same frequency, add them up, you will get a sinusoid. What that is saying is that, look, here is a sinusoid, here is a sinusoidal function, and I am scaling them up in some manner. So I should be able to add them up and be able to express that as single sine. And to be sure you can, look at the Appendix, and there is an expression for a1 sinX plus a2 cosX is equal to a cosine of blah, blah, blah. This is what you get. No magic here. Just math. From here I directly get this. And look at what I have. It is absolutely unbelievable. v(t) is simply VI, there is a constant here, this an e to the minus alpha term and there is a cosine. Again, to pull the Fineman trick, if this alpha were to go to zero here then you would end up with the expression you had for the LC situation. Let's stare at this a little while longer. There is a constant plus a minus, a cosine term, so there is a sinusoid at the output, and there is an e to the minus alpha which ends up giving you the decay you have seen before. In other words, to a step input, the LC circuit would give you a sinusoid. That is what the LC circuit would do if alpha was zero. But because of this alpha term here, e to the minus alpha t, that gives rise to a damping effect, so this causes this thing to become smaller and smaller as time goes by until this term goes to zero at t equals infinity. This guy damps down and so therefore you end up getting the curve that you saw like this. Twenty minutes of juggling math solving a second-order differential equation, but what ends up is the same sinusoid but it is damped in the following manner such that the frequency, rather the amplitude keeps decaying until it starts off at zero and then settles down at vI. This is exactly what you saw in the demo that we showed you earlier. The critically damped case, I am not going to do it here. I am going to point you to the following insight. The underdamped case looked like this. It was a sinusoid that kind of decayed out. That is the underdamped case. And then I showed you the overdamped case. The overdamped case looked like this. And, as you might expect, the critically damped case is kind of in the middle and looks like this. So the overdamped case would look like this, underdamped like this, and the critically damped case kind of goes up and kind of settles down almost immediately. This is when alpha equals omega nought. I won't do that case here, but I will simply point you to Section 13.2.3. Just to tie things together, recall this demo here that we showed you in class yesterday. This is exactly the kind of form of the sinusoid you saw because of that input step. If you want to see a complete analysis of inverter pairs and look at the delays and so on because of that, you can look at Page 170 and example 898. In the next five or six minutes, what I would like to do is stare at the RLC circuit. And much like I showed you some intuitive methods to get the RC response, what we are going to do is do the same thing for the RLC. In the RLC situation, much like the RC situation, experts don't go around writing 15 pages of differential equations and solving them each time they see an RLC circuit. They stare at it and boom, the response pops out, the sketch pops out. This one is going to be another one like our Bend it Like Beckham series here. And this one is in honor of Leslie Kolodziejski. And I call it "Konquer it like Kolodziejski". Again, as I said, experts don't go around solving long differential equations and spending ten pages of notes trying to get a sinusoid. They look at a circuit and sketch response. I am going to show you how to do that, too. And what you can do is, to practice, go to Websim and try out various combinations of inputs and initial conditions and sketch it, time yourself, give yourself 30 seconds or a minute if you like, and sketch it and check it against the Websim response. If it doesn't match either you are wrong or there is a bug in Websim. What I am going to do is, the response to the critically damped and underdamped case was very easy to sketch out. You started with an initial condition, you settled at VI and just kind of drew it like that. The interesting case is the underdamped case, and that is what I am going to dwell on. Before we go on and I show you the intuitive method, as a first step I would like to build some intuition. Let's stare at this response here and try to understand what is going on. This is the response that we saw. And this fact that you see an oscillation happening is also called "ringing". You say that your circuit is ringing. All right. You see some interesting facts. You see that frequency of the ringing is given by omega d. This cosine omega d, so that is the frequency omega d. So the time is 2 pi divided by omega d. The oscillation frequency is omega d, but omega d is simply omega nought squared minus alpha squared. Once you have a big value of R alpha becomes very small and omega d is very commonly equal to, very close to omega nought. So omega d and omega nought very commonly are very close together. And when that happens this frequency is directly omega nought. Alpha governs how quickly your sinusoid decays. e to the alpha t here is the envelope that governs how quickly my sinusoid decays. And notice that each of these terms, alpha and omega nought, comes directly from my characteristic equation. Which means that once you get your characteristic equation you really don't have to do much else. And up until now you still have to write the differential equation to get the characteristic equation, so you still have to do some differential equation stuff, but in two lectures I am going to show you a way that you can even write down the characteristic equation by inspection. Look at your circuit and boom, in 15 seconds or less write down the characteristic equation. It is absolutely unbelievable. What are the other factors that are interesting here? Of course I need to find out initial values. I start off at zero. This is my capacitor voltage. If I don't have an infinite spike or an impulse my capacitor voltage tries to stay where it is and starts off at zero. And the final value is given by VI, the capacitor is a long-term open so therefore VI appears across the capacitor. In the long-term my final value is going to be VI. There is one other interesting parameter, which I will simply define today but dwell on about a week from today, and that is called the Q. Some of you may have heard the term oh, that's a high Q circuit. Q is an indication of how ringy the circuit is. And Q is defined as omega nought by 2 alpha. It is called the "quality factor". And it turns out that Q is approximately the number of cycles of ringing. So if you have a high Q you ring for a long time and if you have a low Q you ring for a very short time. That is called the quality factor defined by omega nought by 2 alpha. Notice that Q, omega nought, alpha, omega d, all of these come from the terms in the characteristic equation. We will spend more time on Q later. With this insight here is how I can go about very quickly sketching out the form of the response. Here is my circuit. I want to sketch the form of the response for a step input at vI. Zero to vI step input here, I want to find out what happens at this point. This is described to you in a lot more detail in Section 13.8 in your course notes. Let's go through the steps. Let's do the really simple situation first. Let's also assume for fun that you are given that v(0) starts out being some positive value. Some v(0) which is a positive number. And, to make it harder on ourselves, let's say i(0) starts out being some negative number. So i(0) is some negative current. The first thing I know is v(0), the capacitor voltage starts out here, which can change suddenly. And I also know that in the long-term this is an open circuit. So that this voltage vI will appear directly across the capacitor in the long-term. So I get starting out at v(0), ending at vI, I am also half the way there. I know the initial and ending point of the curve. And then I know that somewhere in here there must be some funny gyrations here, because remember I am dealing with the underdamped case. And you can determine that from alpha and omega nought. If alpha is less than omega nought, you know that you are in the underdamped case and this is what you get. Let's compute and write the characteristic equation down. A week from today you will write it by inspection, but for now you will do it by writing down a differential equation. And from the characteristic equation you will get omega d, you will get alpha, omega nought and Q. So omega d gives you the frequency of oscillations. My frequency of oscillation is now known. From Q I know how long it rings, because I know it rings for about Q cycles. I know that ringing stops approximately here. And then I know that between that the start and end point my curve kind of looks like this, something like this. Right there we are 95% of the way there. The only question is I do not know if it goes like this or it goes like this. I am not quite sure yet if it starts off going high or starts off going low. Not quite clear. I also do not know what the maximum amplitude is. It turns out this is rather complicated to determine so we won't deal with that. Just simply so you can draw a rough sketch. The questions is which way does it start? I could leave it for you to think about. Yeah, let me do that. It is given on this page so don't look at it. Think about it, and think about how you can determine whether it goes up or down. It turns out that in this case it is going to down and then ring. See if you can figure it out for yourselves and then we will talk about it next week. MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Please use the following citation format: Anant Agarwal, 6.002 Circuits and Electronics, Spring 2007 (Massachusetts Institute of Technology: MIT OpenCourseWare). http://ocw.mit.edu (accessed MM DD, YYYY). License: Creative Commons Attribution-Noncommercial-Share Alike. Note: Please use the actual date you accessed this material in your citation. For more information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Transcript – Lecture 16 OK. Good morning. Let's get going. As always, I will start with a review. And today we embark on another major milestone in our analysis of lumped circuits. And it is called the "Sinusoidal Steady-state". Again, I believe this will be the second and the last lecture for which I will be using view graphs. And the idea here is that, just like in the last lecture, there is a bunch of mathematical grunge that needs to be gone through. And I want to show you a sequence in a little chart today that talks about the effort level in doing some problems based on time domain differential equations, as in the last lecture, something slightly different today and something much better on Thursday. And so, in some sense, Thursday's lecture and today's lecture involve talking about the foundations of the behavior of certain types of circuits. And it is good for you to have this foundation as background, but when you actually go to solve circuits you don't quite use these methods. You use much easier techniques, which I will talk about next Thursday. Let's start with a quick review, and then we will go into sinusoidal steady state. The last lecture we talked about this circuit and we did the same two lectures ago on Tuesday. We had one inverter driving another inverter. And we said that the wire over ground had some inductance. CGS is the capacitor of the gate and R is the resistance at the drain of the first inverter. And if you look at this circuit, that circuit formed an RLC pattern. And what we did was we said let's drive this with a one to zero transition at the input. And the one to zero transition at the input would cause this transistor to switch off, and this node would then go from a very low value to a high value. So it as if a 5 volt step was applied at this input. We also saw that using time domain differential equations that by applying a step input here the output looked like this. The output would show some oscillatory behavior when we have a capacitor and inductor. I also gave you some insight as to why it oscillates like this. And you also heard in recitation that the reason for this oscillation was because of these two storage elements. Each of these storage elements tries to hold onto its state variable. For example, the capacitor tries to maintain its voltage while the inductor tries to maintain its current. And, much like a pendulum which oscillates back and forth, it swaps potential energy versus kinetic energy down here and swings back and forth. In the same way, in an LC circuit like this, energy swaps back and forth between a potential energy and a kinetic energy equivalent, which swaps back and forth between energy stored in the inductor and energy stored in the capacitor and sloshes back and forth. And because of this resistor the energy eventually dissipates and you end up getting a final value which corresponds to the 5 volts appearing here. And why is that? That is because remember the capacitor is a long-term open for DC. It is a DC voltage. After a long time this capacitor looks like an open circuit and the inductor looks like a complete short circuit, an ideal inductor as a complete short circuit for DC. And so therefore in the long-term it is as if this guy is a short, this guy is an open, so 5 volts simply appears here. And this is the transient behavior. Then we just switch the first transistor off. In the last lecture, I left off with intuitive analysis. Let me quickly cover that and redo the intuitive analysis for you. I left it the last time by having you think about whether the transient response would begin by going down or begin by going up. And I will cover that today. This was the circuit that we analyzed. A VI input with a step and an RLC out here. And we were plotting the capacitor voltage. And intuitively we can plot this in the following way. I have also marked for you the section number in the course notes which has a discussion of this intuitive analysis, (Section 13.8). Let's do the easy stuff first. Notice that the capacitor wants to hold its voltage. And so given that we don't have any infinite impulse here, I am going to start out with the capacitor voltage being where it is. And the initial conditions are given to you. You are given that the capacitor voltage starts out being positive at v zero and the current starts out being negative at time zero. So I am telling you that there is a voltage v across the capacitor at time t=0 and there is a current that is flowing. Since i is negative there is a current initially that is flowing in the opposite direction to this arrow here. The i zero is negative. In light of that, I can start plotting my curve here by intuition. I start by saying at time t=0 I am told that the initial voltage of the capacitor is at zero. This is about as simple as it gets. Completely intuitive. I also know that after a long time, can someone tell me after a long time what the voltage will be at the end of the capacitor? You should be able to get his by observation? VI. And why is it VI? It is vI because this is a DC value VI. And after a long time this guy behaves like an open circuit to DC. This guy behaves like a short circuit to DC. So since this is an open circuit, VI will appear here after a long time. And so therefore, after a long time, the capacitor voltage is going to be at VI. And I just showed you that. There you go. You already have the two endpoints of your curve completely by observation, intuition. No DEs, no nothing. Just by staring at it and understanding the fundamentals of how simple primitive circuit elements work. Absolutely simple stuff. So you've nailed the two ends now and you cannot go wrong with the stuff in the middle. Let's see. As a next step what I do is I need to understand what the dynamics of the circuit looks like here. What I do is I develop the characteristic equation. And initially you will write the differential equation and then substitute e^st and get this characteristic equation. But you could also remember it as a pattern. For a series RLC circuit you always get an equation of this form, always. If this were R, L and C. And whether you are looking at L up here or C up here, as long as you're looking at the capacitor voltage, the capacitor voltage is going to behave the same. And for this circuit the characteristic equation remains the same as well for a series RLC. It is exactly this. And I write the standard canonic form as s squared plus two alpha s + omega nought squared. And omega nought is simply one by square root of LC and alpha is simply R divided by L and I have two in the denominator as well. And then I get omega d which is my damped frequency given by omega nought squared minus alpha squared. And Q is simply called the quality factor. And we will learn about Q in a lot more detail in about a couple of lectures from today. That is given where omega nought divided by two alpha. These parameters, alpha, omega nought, Q and omega d pretty much characterize everything else that I need to know about the circuit. First of all, omega d is the frequency of oscillation. And so since omega d is a frequency of oscillation then I know that the time period of oscillation is two pi by omega d. Omega is in radians. Notice that for typical values of circuits like this when R is pretty small, alpha squared is going to be very small. It's a common case for underdamped circuit that omega d will more or less be equal to omega nought. Commonly that is going to be the case. This frequency is governed by LC. And if R is large it is governed by this omega d here. So I have the frequency of oscillation. I also know that Q is related to the frequency of oscillation divided by alpha. It is a ratio of the frequency divided by how badly I am being damped. So it is a fight between the frequency of oscillation and now heavily I damp. And the ratio of that is an indication of how many cycles I ring. So Q tells me that the ringing stops approximately after Q cycles. These four values, omega d, Q, alpha and omega nought are telling me more and more now. So I have got these two factors. So I know now, based on omega d and Q, that it is going to look something like this. Some ringing here and then I stop at this point. The last thing that is left to do here for me for now is to figure out whether I start out going down or I start out going up. I start out going down or I start out going up? I don't know that yet. And I stopped at this point in the last lecture and let you think about how you can stare at the circuit and intuitively figure out whether this goes down or that goes up. So here is the insight. Let's stare at this for a minute purely through intuition. The capacitor has a voltage v across it, right? And that is because I am telling you that it has an initial voltage v. Now, I want to find out at prime t equals zero plus, in which direction does a capacitor voltage go? Increase or decrease? What do I do? Let me take a look at the inductor current. I am told that the inductor current is negative which means I am told that the inductor current is going in this direction initially. The inductor current is pushing in this direction. Now, remember, just as the capacitor is one stubborn nut trying to hold its voltage, the inductor is as stubborn. It is trying to hold its current. It is trying to maintain its current. And its initial current i(0) is in this direction. Capacitor has a voltage here, that is v(0), and the inductor is yanking the current in that direction. So what should happen to the capacitor voltage initially? If I am at v(0) and someone is yanking current out, at least initially in that direction, what should the initial dynamics of the capacitor voltage look like? Pardon? It should drop, which means that if the initial current is being pulled in that direction the capacitor voltage must droop to begin with. Completely through intuition. No math here. This means that i(0) is negative. It is as if i(0) is being pulled out in this manner, so the capacitor voltage must drop to begin life. Therefore, the dynamics look somewhat like this. Notice that this is very reminiscent of the ringing that we saw at the gate node of the second inverter. Let's stop here in terms of time domain analysis of RLC, and today let's take another big step forward. Today marks another transition in life here. This is actually a huge transition so I want to just pause and take like ten seconds of a breather just to clearly demarcate the fact that we have a huge transition coming up. The key to this transition is that I want to look at today the steady-state response of networks to a sinusoidal drive. We are going to do two things differently starting today on this new journey of ours. In the past, we looked at time domain behavior of circuits. For RLC, for example, we looked at the transient response. And what happened the instant I turn something on? The transient response. Today we are going to look at a steady-state response. Steady-state response says that if I wait long enough, for whatever the circuit wants to do in the beginning of life to die out. If I wait long enough, how is the circuit going to behave after a long time? I will tell you why that is important in a second. I look at the steady-state behavior. Second, I am going to look today at sinusoidal drive. Two things that are different from, say for example, what I covered in the past ten minutes. In the past ten minutes I covered two things which were different. One is that I looked at the transient response and then steady-state. And remember for a DC input, for a DC voltage the steady-state was a DC voltage across the capacitor, correct? So the steady-state was pretty boring, it was steady-state DC. But what we are going to do today is instead of having DC inputs or step inputs which settle to a DC value after some time, we are going to drive a circuit through the sinusoidal input. So you may ask me, Agarwal, are you nuts? Why do you want to drive something with a sinusoidal input? Why not just steps in DC and so on? That was painful enough. Why sinusoidal? Why not do triangular or why not do some other exponentially decaying stuff or something really cool like a whacko music signal? What is special about sinusoidal stuff? The key thing to realize is that, well, let me ask you a question first. How many people here know about Fourier series? Good. It looks like some of you have taken the prerequisites. Good. Need I say more as to why this is important? Just that question should give you the answer, right? You've learned about Fourier series. And when you learned about Fourier series you were wondering why on earth are we learning about Fourier series? Who cares that you can represent the periodic signals as a summation of a series of sine waves? Why is that interesting? Why are you telling me that I can take a square wave and represent that as a summation of periodic square waves and represent that as a summation of sines? Who cares that I can take a sequence of pulses with a fixed period and represent that as a sum of sines? Who cares that I can take a triangular wave and represent that as a sum of sines? I am not sure what answer your math professors gave you when they taught you Fourier series. But in math they are purists. They don't care about applications. The answer could well have been because it is aesthetically pleasing. I mean isn't it cool that you can represent a sequence of pulses as a sum of sines? That is good enough for mathematicians. But I am an engineer. If it I cannot see how it helps humanity in the short-term then I probably don't care too much about it. Let me give you some practical significance of this. So it turns out that, since we know that we can represent periodic signals with sums of sines. What this means is that if I can figure out the behavior of networks to a sinusoidal input, if I can understand how to analyze a network for a sinusoidal input that means that if the circuit is linear I can then compute the response of the circuit to any periodic waveform. Here is the argument. I can represent any periodic waveform as a sum of sines. The Fourier series, remember? If I just figure out the response of my network for a sine wave, then if this is a linear network, I can compute the response to any sequence of scaled sum of sines. A some sine, B sine two, omega whatever, C sine something or the other. I can simply take the response of the one sine. And from there I can go ahead, and knowing the response of a sine wave I can compute the response to a sum of sines. That is pretty cool. Therefore, doing it for sinusoidal drives is really important. Why steady-state now? Hopefully, I have convinced you that looking at the response of circuits to sinusoidal drive is important and interesting because we can long ways from there. What about steady-state? Well, it turns out that, and I am going to show you, when you listen to music, you have an amplifier and listen to music, what you are observing by and large is the steady-state behavior of the amplifier. You are listening to something over many seconds or many hours. And the transients used for most of our common circuits, the transients die out pretty quickly. And so the transients are quite complicated and they die out quickly. We say we are engineers. Let's focus on what is practically important. And we focus on the steady-state behavior as a large part of our analysis and just completely ignore the transient response when we care about the response to sinusoidal input. The transient response will die away, and I will show that mathematically to you in a few seconds. And let's focus on the steady-state because that what I am going to hear most of the time. I am going to listen to an average over long periods of time. That's the motivation behind this. And let me put this in perspective for you. By now this should bring memories to your mind. This is the playground that we are in. This is the lumped circuit playground here. Remember we came from the playground of nature to the playground of EECS where we made the big leap from Maxwell's equations to lumped circuits, that's lumped circuit abstraction. And within there we spent a large part of the last couple of months doing linear circuits. We also analyzed nonlinear circuits. Remember the amplifier circuit of the MOSFET large signal analysis was nonlinear? Well, there is linear and nonlinear. Within linear we also showed that if you take a digital circuit, at least as we understood them, and draw the subcircuit for a given set of switch settings, if I set the switches in a given way what I was left with was another linear circuit for a given value of all the switch settings. My small signal analysis was also linear. If I focused on small signals I also had linear analysis. Today what we are going to do is this. We are going to articulate a different part of the playground. This was a big linear playground. We've done this. We've done this. We are going to explore this territory. This is that territory of the playground in which we have sinusoidal inputs to circuits. Furthermore, we are going to look at a subcircuit of that region which is steady-state. We will look at sinusoidal input and in the steady-state. So that is going to be our focus for the next two or three lectures just to give you a perspective of where we are. To motivate this, what I would like to do is consider your amplifier. This is our friend the amplifier circuit, this part here. And remember, even though this is an amplifier, I am using a MOSFET here. And a MOSFET, as you know, has this gate capacitance CGS. I am explicitly drawing it out for you here. And I am going to drive this with a bias voltage plus some small signal vI, the usual template for amplifiers. And there is some Thevenin resistance attached to that source. I am going to model my source as a bias voltage, a small signal plus some source resistance. And I want to apply a sine wave here and I am going to look at what this looks like. You may think, look, this is a linear amplifier. And so if I apply a sine wave here I should see some response here, and that should be the same amplitude if I feed the same amplitude here over any frequency. But let's see what happens. Keep a look at, switch over to that view graph while I show you a little demonstration here. What you see here are three sine waves, a yellow sine wave which is the input here, you see a green sine wave which is the input vC at the gate of the MOSFET, and then you see the blue which is the output here. For now simply focus on the yellow and the blue. The yellow is the input and the blue is the output. So I apply some input and I get an output that looks more or less some linear function of this input here. It is a small signal. What I am going to do is I am going to change the frequency of the input. Remember, I want to look at the response of the circuit to a sinusoid. I am feeding a sinusoid here. I look at the response. I am going to change the frequency. That is a big shift that we are making in that the curve that we drew in the last lecture had to do with varying time. Now I am going to focus on sinusoids and vary their frequency. I am going to change the frequency. Stare at the blue curve as I increase the frequency and just think of what you might expect. Based on the knowledge you have so far you would expect that look, as I change the frequency, the frequency should change but I should see the same amplitude. OK but take a look. Let me increase the frequency of the input. What do you see at the output? I am increasing the frequency. What do you see happening there? If you don't see anything changing there you will need to see an optometrist. What do we see here? As I changed the frequency, as I increased the frequency what happened to the blue? The blue kept decreasing in amplitude. And you are saying whoa, what is happening here? We don't have the tools to deal with this. I expected that when I changed my frequency, my frequency here should change of course, but why is the amplitude changing? What is happening here? That is weird. I noticed that this amplitude became smaller because the amplitude of the green became smaller. And remember the green was the voltage across the capacitor. So this is your RC. And here is my input. My input has the amplitude, which I am holding more or less constant. And notice that vC decreased in value as I increased my frequency. Just hold that thought. As I increased the frequency of my input the amplitude of the output kept diminishing. In other words, the gain of the system seemed to have decreased as I increased by frequency. And today we will look at why that is so and how we can analyze that. The other thing that is not so obvious here is there is a phase shift. What I am going to do is try to see if we can observe the phase shift here. Notice here. What we have been used to is for the amplifier we get a complete inversion at the output. Inversion means a phase difference of 180 degrees for a sine wave, right? This peak should have been here, but notice that there is a shifting of the peak. In other words, if the yellow was my input my output should have had its minimum when the input had its maximum. But notice there is a shifting of the signal such that the output is a maximum, not quite at the point where the input is a minimum but a little bit after that. Also weird. Not only has this little circuit here lost its gain somehow, but also it seems to have shifted the signal in phase. That is weird. And today we will look at why that is so and try to understand the frequency behavior of this little subcomponent here. Notice that vC is exactly 180 out of phase with vO. So vO is faithfully an inverted amplified form of the input vC. However, vC itself should have been the same as vI but it looks quite different. So let's understand why that is so. The subcircuit to model is the subcircuit comprising the source, resistor and the capacitor. And I am just showing that to you here. I have a vI, a resistor and capacitor. And I am going to understand how this behaves. And it is a first order circuit, single capacitor. My input is a vI cosine of omega t. vI is a real number for t greater than zero. And I am telling you that the capacitor voltage starts out being zero. And my vI is a sinusoid. It's not a step this time. It's a sinusoid. So vI is a sinusoid and I want to find out what vC looks like. The behavior here tells me, I will give you the answer, that when I feed a sinusoidal input as the frequency increases, vC should be decreasing somehow and also be shifting in phase. Let's do the derivation for that and see what happens. To give you some insight as to how to go about analyzing this let me draw a little graph as to the effort level of doing this. To determine vC of t on the y-axis here is our effort. How hard do we have to work to solve this circuit for a sinusoidal input? And on this graph, down here is easy and up here is pure agony. Sheer agony up here. So it's the scale of effort level ranging from easy to complete agony. And this is the time axis. And the time axis starts out at 11 o'clock, the early part of today's lecture, and ends at roughly 12, that is today's lecture and this is next lecture. What I am going to show you today is a method that uses a usual differential equation approach, and this is going to be pure agony. If you thought last Thursday was agony watch today. This is going to be sheer, sheer, sheer hell. So I am going to grunge through that, and I think I will sort of give up halfway because it's just too painful even for me here. Then what I am going to do is at the end of this lecture I am going to show you an approach that I give a cutesy name. I call it the "sneaky approach". We are going to sneak something in there it is going to be a lot easier. And then in the next lecture I am going to show you an even sneakier approach that is just going to be absolute bliss. So let's start here. Indulge me as I go through the agony part. I am going to blast through it because that is not of how we are going to do things, but you just need to know that that is agony. Let's do a usual differential equation approach. Steps one, two, three and four. Set up differential equation, find the particular solution, find the homogenous solution, add up the two and solve for the unknowns. It's a mantra. The four-step manta. Let's do it. Step one, write the DE. That's easy. We have done this before the RC circuit. It's RC dvc/dt+vc=vI. This is no different from what you got from what you got from your RC circuit with a step input, just that my input is VI cosine of omega t in this case. It is not just a DC voltage VI. Stare at that. Enjoy it while the going is easy. It's like traversing rapids, and before you come to a class five, you have calm and raging waters there, you kind of sit there saying oh, the scenery around here looks really good and so on. All you are doing is stalling before you have dive down to class five. We will get to class five rapids in a few seconds here, so just enjoy this. RC dvc/dt+vC=vI. You've seen this before. Nothing fancy. Good old stuff. VI cosine of omega t. You want to hold onto your seatbelts? OK. Let's find the particular solution to the cosine input. Let's use our standard method. What I will do is just so, there is going to be so much crapola up there, so that I draw your attention to vP, which is what we are trying to get, I am just going to put a box around vP in red. If you see like all sorts of garbage appear, just look for the red square. That is what we are trying to get at. That's the equation. Let's try. First try, A worked before. A constant value A worked before for DC inputs. Let's try that again. If it worked then it may work now. If I use A, a constant value, and I substitute it here, I get dA/dt goes to zero, vP is A, but on the right-hand side I have VI cosine omega t. So clearly A doesn't work. Sorry. I struck out. Well, cosine omega t here, let's try A cosine omega T as my particular solution. Things are getting a little harder now, a little more painful. So substitute A cosine omega t here. So I do get A cosine omega T for vP, but out here I get RCA sine omega t times omega times minus one. So I have a sine and a cosine, and I have a cosine on the right-hand side. Sorry, it doesn't work. Nope, doesn't work either. Well, let's try A cosine omega t plus phi. We are now embarking into the rapids here. You can begin feeling the pressure. Just to refresh your memories of sines and cosines. A is the amplitude of the cosine. Omega is the frequency. Phi is the phase. Remember the signal I showed you earlier? If something happens to the amplitude of the sine, something happens to the phase. A cosine omega t plus phi. Let me plug it in here and go by standard practice. Here is what I get. I plug in A cosine omega t to this equation, and this is what I get. I differentiate it. I get omega out minus sine, sine of negative d plus phi, A cosine omega t plus phi equals VI cosine omega t. That might work. Now we get into the class six part of the class five. All class fives have a little bit of class six rapids. Remember, the rapids go up on an exponential scale so it like earthquakes. What I do now is expand out sine omega t plus phi, blah, blah, blah, it goes on and on. I could go on and on, but this is even tiring me. This can be made to work, but I am not sure I want to put all of us through this trig nightmare here. If I am really, really nasty I could give this to you as a homework assignment or something, but I am not that nasty so you won't see that. But if I go down this path it will get me to the answer, but I would have to soon negotiate class six, class seven rapids to get to where I want. So let me punt on it, let me start from scratch. I am at step two, let me start from scratch. Instead what I would like to do is let's get sneaky here. Rather than negotiating the class five rapids, what we can say is ah-ha, we can take our canoes and jump onto shore and run down and then get back onto the river. Let's do that. That is called the sneaky approach. So that all our friends who are behind us think we are negotiating the rapids, but what we are going to do is get sneaky and take the shore path. Let's get sneaky, just walk down the shore and see what is there. I want to do something completely weird here. I want to look at solving this equation through the shore method. S stands for shore or S stands for sneaky, whatever you want. What I am going to do is rather than trying to solve for VI cosine omega t. I am going to say let's try a different input all together. And you will understand why in a second. It's like I am the captain of my canoe and I tell my teammates, hey, let's not negotiate the rapids, let's go and explore the shore. Maybe down the shore we can find a path that gets us across to the other side more easily. So here is me and my colleagues carrying our canoe and getting onto shore and taking a sneaky path. This is not what I set out to solve. I don't know where this will lead me. But let's see where the shore path leads us. I want to try solving this equation Vie^st. S stands for shore or sneaky or whatever you want. I don't know where I am going, but let's see where this leads us. Let's explore. Make believe you are Columbus or something. I don't know. Let's use the usual techniques and see how this works out. Let's try a particular solution, Vpe^st. My input is Vie^st. I am trying to solve the circuit for a different input. And let me try solution Vpe^st and see if that works out nicely. I substitute Vpe^st into my equation here, so RCVpe^st blah blah blah. What I get here is Vie^st, Vpe^st stays the same, but here vP comes out, s comes out and e^st stays the same. That is nice property of exponentials. This is what I get. A really cool property of exponentials is that when I differentiate it I get the exponential back. Unlike a cosine I got a sine, and for a sine I got a cosine. Exponentials are very plain and simple, are straightforward. What you see is what you get. You differentiate it. You get the same thing, you get scaling vP, S and so on, and some scaling here. You get S scaling here, but the basic form stays the same. This is quite nice. I have e^st in all three places, so I can cancel those out and I get this expression. And I get this. Wow. So if I go down the shore I get some place fast. I don't know where I am yet, but whatever I did, it was easy. I am just exploring this path, down the shore path. I am making progress. I don't know where I have gotten yet. We will see where we got to in a second, but I got some place quickly, fast. I was able to solve for this input Vie^st and get this solution very quickly. So what happened here? I assumed the solution of the form Vpe^st, substituted it back, and found that if vP were equal to Vi/(1+sRC) then Vpe^st is a solution. What I have done here is that Vi/(1+sRC) is a particular solution to this equation for the input Vie^st. I put a box around it because this is important. This was easy. We went down the shore, and said let's try this other input. We made rapid progress on shore and I got some place. I don't know where I am yet. I got this. Let me pause here and let me give you the final answer. I am going to show you over the next five minutes that this is our answer. You are staring at the answer already. I am a party, I have taken a shore path and we have gotten some place. We see the river there, so it turns out we are exactly where we want to be, just after the rapids. All I have to do now is get my colleagues into the river with myself in the canoe and we are done. You don't know that yet. My colleagues and I are sitting on the shore looking at the river. We've gotten some place. There are no rapids there. We have gotten some place. We don't quite know is this just after the rapids or not. We don't know yet, but I got there very quickly. And I will tell you right now, that is the place we wanted to go to. The next five view graphs I am going to blast through. There is going to be more pain and agony to show you why that is the case. It's me thinking I am Columbus and proving to my colleagues that this is where we want to be. And pulling out my sextant, and the compasses and so on that cartographers and people use to prove to my colleagues that this is where I want to be. This is the answer. The next five view graphs will be demonstrating that this is indeed the answer, or close enough to the answer that we will be satisfied. Isn't this spectacular? I am going to show you in about five minutes that this gives us all the information we need to know to compute the sinusoidal steady-state response to this differential equation. Let me write that down here just so you know. Just so you remember. I am going to put a marker on the shore that says this is where we are right now. Now let me prove to you. As I just said, vPS is Vi, it's this stuff here multiplied by e^st is the solution to Vie^st. This guy here is a solution for Vie^st and vP is simply the coefficient that multiplies e^st. Similarly, if I substitute S equals j omega. I told you five view graphs of more hell, but I am just going to prove to you that this is it. I am substituting S equals j omega. This is Columbus giving a big speech at the end convincing his colleagues that we are where we want to be. I substitute j omega for S and this is what I get. This is a solution for e to the st, and so this is a solution for e to the j omega t. And let me mark this for you as something to remember. Vi/(1+j omega RC). In terms of that, I am substituting j omega for S. And this is a complex number. It is a complex amplitude. It is a complex number because of j here, and it multiplies e to the j omega t. Just keep this in mind. So that was easy. The steps were easy. I am still proving to you that this is where we want to be. Now let me draw the connection back to vP. And the first fact was that finding the response to Vie^(j omega t) was easy. We know that. Second was the following observation that Vi cosine omega t is simply the real part of this number here. So Vi cosine omega t is simply the real part of Vie^(j omega t) from the Euler relation. So cosine omega t is simply the real part of this guy. Light bulbs beginning to go off? The first fast was that finding the response to Vie^(j omega t) was easy. And the response was this, right? Times e to the j omega t. That was easy. All right. And the second part is that the real part of this is Vi cosine omega t was our input. Draw the connection between two steps. Finding the response to Vie^(j omega t) was easy. The real part of that was the input we cared about. Are light bulbs going off? Let me draw you a little picture here to show you what is happening. Response to vI is vP. It's the particular response we are looking for. Remember the red square? But we threw in a sneaky input vIS and we formed the response vPS to that. This step was easy. This step was hard. vI to vP was hard, trig nightmare, remember? But vIS to vPS was easy. It was a simple Vpe^st thing. We also know that the real part of vIS is vI. The real part of this is simply vI. If you have a real circuit, if you have a real linear circuit, for a linear circuit, if the real part of this gives me vI then the real part of the solution should give me vP. So computing vPS was easy. If I take the real part of this, I take the corresponding real part of this. This is sort of an inverse superposition argument. Superposition, I said, take the response for A, take the response for B, add them up and you get the response for A plus B. Here what we are saying is that get the response to A plus B, or to A plus jB and the real part of the input will produce the response given by the real part of the output. So this is an inverse superposition argument. If it is a linear circuit, then if vI is the real part of this sneaky input then I find the response to the sneaky input and take its real part I should get vP. Here I am, Columbus, staring down at the entrance to this part of the river. I just proved to my colleagues that all we have to do is take the real part of what we have. We can just jump right back into the river and get back to vP. And what I am going to do next is just grind through the math and just show you that. I will just blast through it. It is not important, but you have it in your notes. I am telling you that vP is simply the real part of the sneaky output. And I take the real part of vP e to the j omega t. And I take the real part. And just a bunch of math here. I am just taking the real part and doing a bunch of complex math. Remember vP was given by this quantity here. And I take the real part and I end up with vP is simply this quantity multiplied by cosine omega t plus phi, where phi is given by is given by tan inverse of omega RC, and this is the coefficient multiplying the cosine. So by taking the sneaky path and then taking the real part of that output answer, I was able to very quickly get to where I wanted to be. So from here to here it is only math. Recall, that vP, the thing in the red was what we set out to find out, which was the particular response to VI cosine of omega t. And remember that two grunge is all of this stuff. I am going to blast through two or three more view graphs that just give you more insight and more math, nothing particular. And remember to solve the equation we have to find a homogenous solution, too. But recall that the homogenous solution for an RC circuit is of the form Ae^-t/RC. This means that as time becomes very large this part goes to zero. As time becomes large in the steady state, remember I care about the steady state? This goes to zero. I don't care about the homogenous solution. Isn't that fantastic? Most the circuits we will deal with, except for purely oscillatory ones, the homogenous part dies away. You have something like e to the -t whatever. It just dies away. It's gone. So the total solution has vH going away. And what I end up with is just vP. My total solution in the steady state is simply vP. And A is given by this that we just calculated. I just have a bunch more insight that I talk about that you can look through in your notes. And I just want to show you a very quick summary. In summary, what we have is we computed vP. It was a complex coefficient. And all these steps, 2 grunge, 3 and 4 were a waste of time. And what I showed you was that for the input VI the coefficient vP was complex. And I can take the ratio and represent it in this manner as well. And from vP, I can then compute the multiplier for the cosine as follows. I divide by vP here. Remember the cosine was multiplied by, in the mathematical step that I did, VI divided one plus, this stuff here, so I could get the magnitude and phase of the transfer function of this circuit in the following manner. And to wrap up very quickly, I am going to cover this again the next time and show you a magnitude plot. Notice here that if I plot Vp/Vi. Remember this was Vp here. That's the answer. The magnitude looks like this. On a log scale Vp/Vi for small frequencies omega is at one, but as omega increases Vp/Vi keeps decreasing. That is the output. Remember Vp was the amplitude of the output? That keeps decreasing. And this is the reason why. As I increase the frequency, the amplitude of my output cosine kept decreasing. I could also plot the phase for you. And the phase, in the same manner as omega increased, my phase also kept shifting from zero initially to pi/2 finally. Let me stop here and start with this the next time and revisit this. Unfortunately, I won't have time for the demo. I will show it to you next time. MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Please use the following citation format: Anant Agarwal, 6.002 Circuits and Electronics, Spring 2007 (Massachusetts Institute of Technology: MIT OpenCourseWare). http://ocw.mit.edu (accessed MM DD, YYYY). License: Creative Commons Attribution-Noncommercial-Share Alike. Note: Please use the actual date you accessed this material in your citation. For more information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Transcript – Lecture 17 Good morning. All right. Today we are going to take a fresh look at some of the stuff we covered in the last two lectures. And the graph I want you to keep in mind as we go through this lecture in terms of what to expect. This was time. And last Tuesday's lecture we covered some stuff. I talked about a method for the sinusoidal response which was agony, I warned you it will be agony, and then towards the end I showed you another method that was quite a bit easier but still pretty hard. And I promised you that today there will be a new method which is going to be so easy , actually almost trite. Just imagine. I am going to make a statement right now that I think you will all find hard to believe. What I am going to say is just imagine your RLC circuit, your resistor, inductor and capacitor, a parallel form or series form. Imagine that you could write down the characteristic equation for that by observation in 30 seconds or less. Just imagine that. By observation, boom, write down the characteristic equation for virtually any RLC circuit or RC circuit or whatever. And we all know that once you have the characteristic equation you could very easily go from there to the time domain response intuitively or to the sinusoidal steady-state response, too. So just keep that thought in mind. Imagine 30 seconds. And that is what you should expect in today's lecture. Students often ask me, if this stuff is actually so easy why do you take us through this tortuous path? Are we just mean? Do we just want you show you how hard things are and then show the easy way? I have argued with myself every year as to whether to just go ahead and give the easy path and that's it. But I think the reason we cover the basic foundations is that it gives you a level of insight that you would not have otherwise gotten if I directly jumped into the easy method. So you need to understand the foundations and you need to have seen that at least once. And second, once you do something the hard way, you appreciate all the more the easy method. All right. Today we cover what is called "The Impedance Model". First let me do a review just because of the large amount of content in the last two lectures. I did them using view graphs. I usually don't like to do that, but even then it was quite rushed. So let me quickly summarize for you kind of the main points. We have been looking at, on Tuesday, the sinusoidal -- --looking at the sinusoidal steady state response. Also fondly denoted as SSS. And the readings for this were Chapters 14.1 and 14.2. what we said was if you took this example circuit and we fed as input cosine of omega t, we have an R and a C, and let's say we cared about the output response and we cared about the capacitor voltage. What we talked about was focused on the sinusoidal steady-state response. And what that meant was first of all focus on steady-state. In other words, just to capture the steady-state behavior when t goes to infinity after a long period of time. And for most of the circuits that we consider, because of the R or presence of any resistance, the homogenous response usually would die out because the homogenous response is usually of the form minus t by tau. And as t goes to infinity this term tends to go to zero. We are just looking at the steady-state. And therefore, because of the circuits we looked at, we can ignore the homogenous response. All we are left to do is to find the particular response to sinusoids of this form. And second was focus on sinusoids. We said the reason for this was that, let's say we did not care particularly What happened when I just turned on my amplifier. I just turned on my amplifier, often times you see some distorted sound coming out for a few seconds and then hear a much clearer sound. And that initial part is due to the transient response. And let's say we don't care about that. We care about the steady state. Second we focus on sinusoids because based on the Fourier series experience that you had previously, we can represent repeated signals as a sum of sines. And therefore it is important to understand the behavior of these circuits when the input is a sinusoid. And what was important was this introduced a new way of looking at circuits, and that was the frequency viewpoint. When we looked at transient responses, we plotted response as a function of time. And when we look at sinusoidal steady-state, it becomes interesting to plot the response as a function of the frequency, a function of omega. What I will do is draw a little chart for you to sort of visualize the various processes we have been going through. We can liken obtaining the sinusoidal steady-state response to following these steps. Here is my input. What I did as a first step was fed my input to a usual circuit model. My elements were lumped elements, built the circuit and wrote down the VI relationship for the element. As a second step I set up the differential equation. This was the first of four steps, set up a differential equation. And then the path that I took first was fraught with real nightmarish trig. By the end of the day it would still yield an answer. It could be a nightmare. But I would get something cosine omega t plus something, some phase. I could grunge through the trig. And I gave up halfway in class here, but you could grunge through it if you would like. And you would get the answer to be some sinusoid with some amplitude and some phase. So Vi cosine omega t would produce the response that was something cosine omega t plus some phase. We said this was too painful so let's punt this. Instead, what we said we would do is take a detour, take an easier path. And the easier path looked like this. I said let's sneak in -- -- Vie^(j omega t) drive. That is just imagine, do the math as if you had fed in not a Vi cosine omega t but a Vie^(j omega t). And from Euler's relation you know that the real part is Vi cosine omega t. So we said that I am going to sneak in this thing, find the response and just take the real part of that because the real part of the input gives me this. So this is my "sneaky path". And what I did there, as soon as we fed in the e^(j omega t), because of the property of exponentials, the e^(j omega t) cancelled out in my equation. And what was left was some fairly simple complex algebra. And at the end of the day, after I grunged through some fairly simple complex algebra, I ended up with some response that looked like this. Vpe^(j omega t). What I would find is that for the input Vie^(j omega t), I would get a response Vpe^(j omega t). And then what I said we would do is take the real part. Why take the real part? Because this is a fake, a sneaky input. The input I really care about is the real part of the sneaky input. So this is my sneaky output. And what I care about is the real part of the sneaky output. That is sort of the inverse superposition argument that I made on Tuesday that if what I care about is the real part of this input, then I just take the real part and get the output that I care about. So I take the real part. Notice that Vp here, in the examples we did, we did an RC example. The Vp here was a complex number. So I could represent that complex number as, in many ways. This is e^(j omega t). I could represent Vp in an amplitude, as a phasor, actually polar coordinates. I can say that the equivalent to Vpe to the j angle Vp. Vp is a complex number. If you look at the complex appendix in your course notes, I can represent a complex number as an amplitude multiplied by e raised to j times some phase. It's simple complex algebra. And then what I could do here is take the real part of that. And when I took the real part of that what came about was that this was simply Vp. Notice that the angle Vp goes in here so it becomes j times omega t plus angle Vp. It is Vp amplitude times e raised to j omega t plus j angle Vp. And the real part of that is simply Vp cosine of that stuff. What I end up getting here is Vp cosine omega t plus Vp. The cool thing to notice was that once I found out this response here, I could immediately write down the output based on Vp. In other words, once I had Vp, I could stop right there in my math. I got Vp very quickly here. This step produced Vp very quickly, after two algebraic steps. And then from here I could directly write down the answer as homogenous of Vp cosine omega t plus angle Vp. Boom, right there. So this was a much shorter path. And here I just described to you how this yields an expression for Vp and angle Vp. And for our example Vp was 1/(1+j omega RC). And we often times write a shorthand notation 1+sRC, where S is simply j omega. We commonly jump back and forth between the shorthand notation S and j omega. S has some other fundamental, has another fundamental significance you will learn about in future courses, but for now S is simply a short form for j omega. This was the path that we took. There is a hard path and an easier path. Today I am going to claim that even this was too hard. There is an even easier path. And today what I am going to show you is that from here we are going to take one step and get here. I am going to show you today that we won't do this, we won't do this, not this, not this, none of this. One step and then we are going to get the answer. So let's do that. Before we jump into the impedance method and get into doing that, I just would like to plot for you this function here just so we can understand a little bit better exactly what is going on. As I mentioned to you, the output vO for our circuit there was simply Vp cosine of omega T plus angle Vp. Oh, that's Vp so this one should be Vi here. I am showing you Vp so there is a Vi in there. Vp/Vi=1/(1+j omega RC). This is a complex number, and it is simply a number that when multiplied with Vi gives me the output. This is also called a transfer function and represented as H(j omega). This guy is a transfer function, much like the gain of my amplifier. Which when multiplied by the input to get me the output. This guy is a complex multiplier which when multiplied by Vi gives me Vp. And as such we call it a transfer function H(j omega). And we can plot this function. Notice that this a function of omega. Remember we are taking the frequency domain view, so where has time vanished? Remember that we are taking the steady state view. So we are saying in the steady state, if I wait long enough this is how my circuit is going to behave, this is how a circuit is going to behave. And the transient responses have died away and I have time in my output here so my output is a cosine. But that in itself is not very interesting. It is a cosine of some amplitude and has some phase. What we will plot is we are going to plot this property here, Vp as a function of the frequency. Vp is frequency dependent. As an example, I could plot the absolute value of Vp/Vi, the modulus of that versus omega. And notice that when omega is zero again intuitive ways of plotting this is to look at the value at zero and look at the value at large omega. For small omega, omega goes to zero this is one, so it starts off here. And when omega is very large then it is much bigger than one here, so this goes down. Far away this one looks like 1/omega RC. And this function, assuming I have linear scales on my X and Y axes looks like this. We also commonly plot this using log-log scales. And when you do log-log scales you get a straight line here, and then you actually get a straight line of slope minus one because the log of this gives you a line with a constant slope, it's a slope of negative one so it becomes a straight line going down. The other interesting thing to realize is that this magnitude is simply one by one plus omega squared R squared C squared, the square root of this. That's the magnitude here. And notice when omega equals 1/RC, this thing, the denominator becomes one by square root of 2. Somewhere here when omega equals 1/RC The output is one by square root 2 times the input. It's an interesting point. And this is called the "break frequency". You can view it as a frequency where I am getting this transition from one to a lower value, and it is where the output is one by square root two times the value of the input. Now you can think back on the demo we showed you earlier. And in the demo remember that as I increased the frequency of my input sinusoid my output kept becoming smaller and smaller and smaller. And you notice that you can see this dying out or decaying of the amplitude as I increase my omega. Let me go back. What you have done is that, we're going to apply a bunch of sinusoids to the same circuit and plot the frequency response, the ratio of the output versus input as a function of frequency. And kept applying a variety of frequencies. So you can listen to the frequencies as they go by, and we will plot the amplitude up on the screen for you. Just for fun we are going to play frequencies between, say, 10 hertz and 20 kilohertz. It will be fun for you to figure out at what point you stop hearing the frequencies. We are going to play from 10 hertz to 20 kilohertz. And figure out where your ears cut out. That will tell you what the break frequency of your ear is. You can see the amplitude being articulated. The bottom figure is the phase. This is the frequency axis. This is the amplitude, log-log scales. I am not sure about you but I cannot hear anymore. If you bring your canine friends to class it is quite possible that they would go berserk somewhere here. As I promised you, when I plot this on a log-log scale I get a straight line here and a straight line out there as well and the bottom line gives you the phase. Now, what you can also do is you can also go to Websim. Websim is now linked on your course homepage. You can go to Websim and you can play with various L and C and R values. And if you plot frequency response, if you click on the frequency response button, boom, it will give you frequency responses for your circuit that look exactly like that. You can go and play around with that. Thank you. All right. As the next step I promised to show you an easier path. And let's build some insight. Is there a simpler way to get where we would like to get? In particular, is there a simpler way to get Vp? Let's focus on Vp. Why Vp? Because remember Vp was the complex amplitude of e to the j omega t. And once I know Vp then I know this expression here. Also notice that this here, the denominator is simply the characteristic equation for, I wonder how many of you noticed it, is simply the characteristic equation for the RC circuit. If I can write down Vp, I can write down the characteristic equation, it will be in the denominator. I can also write down the frequency response very easily by taking the magnitude and phase of Vp. So Vp has all the information humankind needs for those circuits. Is there a simpler way to get Vp? To bring some insight, let's go ahead and write down -- Let's stare at this for a while longer and see if light bulbs go off in our minds. Of course, I could write this as Vi/(1+sRC). I just replaced the shorthand notation for a j omega. And I simply divide by SC throughout. So I get Vi times, I simply divide by SC throughout. Here is Vi. I have one by SC, one by SC plus R. Light bulbs beginning to go off? The form we have here is 1/SC, some function of my capacitance divided by something connected to my capacitance plus R. This is Vi multiplied by something connected to capacitance divided by something connected to capacitance plus R. And remember your circuit. What is that reminiscent of? What does that remind you of? Voltage divider? Hmm. There is some voltage divider thing going on here. I just cannot quite pin it. It is something about the capacitor, capacitor plus booster, some voltage divider thingamajig happening here. We will try to figure that out. What I will do is replace those terms with something called Zc. Zc plus Zr. If I can find out the Zr and Zc somehow, I can write down the Vp by inspection by the voltage divider action, by some generalization of the good old Ohm's law that I know about. Let's proceed further and see if we can make some kind of a connection between this and this. If I can make the connection then boom, I'm done. I will just use voltage dividers and I am home. OK, so let's play around and see. There is something in there. By now you should know that we are very close. There is something going on in there. I just need to get that spark. I just need to make that spark so I can bridge the gap between something that is really easy versus where I am. Let's take a look at the resistor. I have my resistor with the voltage vR across it and a current iR. Remember to get to any sort of steady state you are going to be dealing with the drives of the form vI e to the j omega t, exponential drives. And by taking the real part, I know I get the input, and the real part of the output gives me the actual output. Let's say my iR is simply Ire^st and my vR is Vre^st. The S is, again, a shorthand notation for j omega. If my current Ire^st of the exponential form shown there and here is Vr, I need to find out what relates Vr and Ir for the element relationship for the resistor to hold. In general, Ir and Vr are complex numbers. For the resistor, I know that Vr=RIr. And I substitute using my complex drives here. So it is Vre^st=RIre^st. I am just substituting for these drives, Ohm's law should apply, and I cancel off e^st. And so I get Vr=RIr. Interesting. For the resistor I find that, based on the fundamental principles of resistor action, the complex amplitude of the voltage simply relates to the complex amplitude of the input by the proportionality factor R. In other words, for the resistor -- Just as the time domain V and I were related by the proportionality constant R, the complex amplitudes Vr and Ir are also related in the same way. That's interesting. Now let's look at the capacitor. Some current ic flowing through it and a voltage vc. Let's say the current is Ice^st and the voltage is Vce^st. Let's plug these into the element law for the capacitor and see if we can find out a way of relating vc and ic. I know that ic is simply Cdvc/dt. So I replace this with Ice^st=Cd/dt(vce^st), which is simply Ice^st=CsVce^st. So I can cancel this out again. Interesting. Ic=CsVc. Very interesting. What is interesting here? Notice that in the time domain Ic=Cdvc/dt, the element law for the capacitor. So I said let's use exponential drives, Ice^st, Vce^st, that's an exponential drive, and try to find out what the relationship between the complex amplitudes are. I plug them and what do I find? I find that if my input is Vce^st, and Vc is the amplitude of the input, then the current is simply given by something multiplied Vc. It's very similar in form to what I saw here. The resistor, Vr=RIr. For the capacitor, Vc=Ic/sc. 1/sc kind of plays the role of R. In other words, the complex amplitudes around the capacitor are related by Vc equals some constant times Ic. Almost like a funny Ohm's law kind of relationship where Vc and IC are complex amplitudes. For the inductor it is the same way, iL, vL and L. Let's say iL=Ile^st and vL=Vle^st. Substitute the values for the inductor into its element relationship as well. I know that vL=LdiL/dt. Therefore, substituting the complex amplitudes is L. And diL/dt will simply be Ilse^st. So I cancel out the exponentials. The reason we're able to do all of this is simply the remarkable beauty of exponentials. Exponentials are absolutely stunningly beautiful. The reason is that when I differentiate them what I get back is the exponential times some constant, and the constant was in its numerator multiplying t. And that's the beauty of exponentials. If this was a sine then I would get cosine and a sine. With exponentials these cancel out and what I am left with is something that is LsIl. Again, for the inductor, the voltage across the inductor relates to some constant Ls here times Il. This is absolutely stunning and almost looks like a form of Ohm's law here. What I am going to do is let's give this the name Zr. Let's give this 1/sC the name Zc. And let's give this the name ZL. It kind of behaves like a resistor, so the resistor simply becomes Zr. And 1/sC behaved like a resistor so I called it Zc. And this is a ZL. These are called "impedances". In other words, for a capacitor, as far as complex inputs and outputs are concerned, if Vc and Ic is fed to it, the capacitor can be replaced by an impedance Zc where I can write the relationship between Vc and Ic as Vc=ZcIc. Where Zc is simply one by sc. Similarly, for an inductor -- -- I can write its impedance ZL as sL and I get Vl=ZLIl. And finally for a resistor it is pretty simple. What I am saying is that if I am in the region of the playground, if I constrain myself in the region of the playground where my inputs are something Vi e to the j omega t or exponentials, in that little region of the playground now, I am focusing more and more on small parts of the playground so I am kind of boxed in right now. In that region of the playground this applies. In that region of the playground, I can replace resistors by impedances, capacitors with impedances of value 1/sC. And within that playground the beauty of analysis there is that in that region of the playground where the inputs are of the form Vie^st, it turns out that the element laws are simply generalizations of Ohm's law. That is absolutely stunning. It is one of the biggest hallelujah moments in learning circuits. This is really big. And I think this is almost as big as the realization that you can take a nonlinear circuit, operate it at a given operating point, and you can sit around doing Zen things, looking at small perturbations in there, those are going to be linearly related. This is one of the big hallelujah moments in 6.002. And this is of the same magnitude as the small signal response being linear. It is something that is completely non-intuitive. It is something that you just would not have known until you had seen it happen. The same way here. This is very important so I will repeat it again. I have boxed myself into this small region of the playground where all I care about are sinusoidal inputs and steady-state responses. So there I focus on complex inputs, Vi e to the j omega t. And I have just shown you that I can replace inductors, capacitors, resistors with their impedances. And the amplitudes of the corresponding signals around them are related by just a simple Ohm's law like relationship using impedances. I am sort of boxed into this playground, right? In my playground it is all about e to the ij omega t. e to the ij omega t is implicit everywhere. I just don't show it. If I want to talk to somebody else outside but within MIT in this small region, it's all e to the ij omega t in there. If I want to talk to somebody outside, get out of MIT, get out of this playground, what else do I have to do? I have to take the real part. Don't forget that. Remember that, take for example Vc here, so Vc is this, so implicit in all of this is that if I measure Vc at some place it is really going to be Vce to the j omega t. And if we the cosine, the real part, then I have to take a real part of this. And the real part of that would Vc cosine of omega t angle Vc. This piece here kind of goes unsaid. We will agree that we have to do it, but we just skip that step because it is obvious. We just deal with Vcs and Vls now. So a new notation certainly sneaked by you, and that notation looks like a big letter and a small letter. Remember you have seen vL, this is the total behavior, you have seen vl, that's a small signal behavior, and now you see this, Vl, capital V small l. And we also have DC, we have labeled operating point values as VL, capital V, capital L. We have one thing left so nobody go out there inventing something new because we would be in trouble. This is capital V, small l, and this is simply "complex amplitude" in the small boxed region of my playground where good things happen and exponentials fly. Whenever someone gives you a variable, capital V, small l, remember it's a complex amplitude, a complex number, and you know how to get to the time domain from there. You take that number, take the real part, multiple the number by e to the j omega t and take the real part, which is tantamount to magnitude cosine omega t plus angle of that number. Actually, you know what? Let's send this up. Back to an example. Oh, I'm sorry. I'm sorry. This is not good. This is my time domain circuit. Remember this was my time domain circuit. A vI input. A vC output. I wanted to analyze this. What I am telling you now is let's box ourselves in this impedance playground. And in the impedance playground the input becomes the complex amplitude of the input, my resistance gets replaced by a box Zr, my capacitor gets replaced by a box Zc. And the voltage I care about here is Vc. Zr = R and Zc=1/sC. Now, there we go. I can write down Vc using a voltage divider action as Vc is simply Zc/(Zc+Zr), done, times Vi of course. And that gives me 1/sC divided by 1/sC+R and multiplying throughout by sC I get 1/1+sCR where S is j omega. Just cannot get any simpler. How long did I take to do this? 30 seconds. Where I spent a whole lecture on Tuesday grinding through first trig, giving up halfway and collapsing, and then showing you the sneaky path which was still pretty painful, but 30 seconds, boom. This stuff is spectacularly beautiful. The really cool thing here is that in this impedance domain for linear circuits all your good old tricks apply. Your Thevenin, your Norton, your superposition, name it and it applies for this linear circuit. If you close your eyes and make believe that Zr is like an R and simply apply all the techniques you have learned so far in this linear playground. Just a little hack at the end where this is the complex amplitude. And if you want to go to the time domain part then you do the usual thing. Modulus Vc cosine omega t plus angle Vc. Just remember that. That's the jump to get back to the time domain. Just to show you that this not just works for one little rinky-dink circuit here, let me take a more complicated circuit. If I believe in my own BS, I should be able to apply this theory to my series RLC, the big painful circuit that we did differential equations for about a week ago. Let's do it. I have an inductor, a capacitor and a resistor. What I am going to do is replace this with the impedance model. Input Vi. Let's say this was vI. Let's say I cared about vR. L, C and R. The impedance model would simply be Vi. What's the impedance of an inductor? SL. And for the capacitor it is 1/sC. And for a resistor it is simply R. And just remember, if I can find out VR then for an input cosine of the form Vi cosine omega t the output will given by |Vr| cosine of omega t plus angle Vr. Just remember this last step. But Vr itself is trivially determined. It is the voltage divider action again times Vi. And the voltage divider action is in the denominator I sum these thingamajigs, so ZL+ZC+ZR, ZR in the numerator. And Zr is simply R. ZL is sL. Zc is 1/sC. And R is R. Vi. And I multiply through by, in this particular situation, by s/L. I want to get it into the same form as you've seen before. Multiply throughout, the numerator and denominator by s/L, what do I get? I get RS/L and out here I end up getting S squared plus 1/LC, and I get plus R/L S. I am done. Look at that. Well, a little more than 30 seconds. Maybe a minute. What is this? Where have you seen this before? The denominator of this expression here? Ah, characteristic equation for the RLC. Remember I promised you in the beginning that when we come to the end of the day using a simple one-minute expression I am going to write down the characteristic equation? Boom, here is what I get. Did somebody hear an echo in there? Notice that just by doing a simple voltage divider thingamajig, I got this expression. And now I can write down the frequency response by replacing s is equal to j omega. Even more beautiful and what is even more stunningly pretty here is that remember the intuitive method I taught you about? The characteristic equation gives you alpha, omega nought, omega d and Q. And based on those we can sketch even the time domain response. Guess what? RLC circuits are passé now. You can just write this thing down and you're done, 30 seconds or less. No DEs, no trig, no nothing. OK. MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Please use the following citation format: Anant Agarwal, 6.002 Circuits and Electronics, Spring 2007 (Massachusetts Institute of Technology: MIT OpenCourseWare). http://ocw.mit.edu (accessed MM DD, YYYY). License: Creative Commons Attribution-Noncommercial-Share Alike. Note: Please use the actual date you accessed this material in your citation. For more information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Transcript – Lecture 18 All right. Let's get moving. Good morning. Today, if everything works out, we have some fun for you guys. I hope it works out. We'll see. What I am going to do today is a very major application of the frequency response and the frequency domain analysis of circuits. And this application area is called filters. The area of filters often times demands a full course or a couple of full courses all by itself. And filters are incredibly useful. They're used in virtually every electronic device in some form or another. They're used in radio tuners. We will show you a demo of that today. They're also used in your cell phones. Every single cell phone has a set of filters. So, for example, how do you pick a conversation? You pick a conversation by picking a certain frequency and grabbing data from there. They are also in wide area network wireless transmitters. Do we have an access point here? I don't see one, but you've seen wireless access points. Again, there they have filters in them. So, virtually every single electronic device contains a filter at some point or another. And so, today we will look at this major, major application of frequency domain analysis. Before we get into that, I'd like to do a bit of review. The readings for today correspond to Chapter 14.4.2, 14.5 and 15.2 in the course notes. All right. Let's start with the review. We looked at this circuit last Friday -- -- where I said that for our analysis, we are going to focus on this small, small region of the playground. And what's special about this region of our playground is that I am going to focus on sinusoidal inputs. And, second, I am going to focus on the steady state response. How does the response look like if I wait a long, long time? And then we said that the full blown time domain analysis was hard. This was, remember, the agonizing approach? And then I taught you the impedance approach in the last lecture, which was blindingly simple. And, in that impedance approach, what we said we would do is -- I will apply the approach right now and in seconds derive the result for you. But the basic idea was we said what we are going to do is assume that we are going to apply inputs of the form Vi e to the j omega t. Wherever you see a capital and a small, there is an implicate e to the j omega t next to it. I'm not showing you that. And what I showed last time, and the class before that was once you find out the amplitude -- Once you find out the multiplier that multiplies e to the j omega t, it's a complex number, you have all the information you need. And once you have this, you can find out the time domain response by simply taking the modulus of that, or the amplitude and the phase of that to get the angle. And that gives you the time domain response. So, our focus has been on these quantities. The impedance method says what I am going to do is replace each of these by impedances. And then the corresponding impedance model looks like this. Instead of R, I replace that with ZR. And instead of the capacitor, I am going to replace that with ZC. And this is my Vc. ZR is simply R and ZC was going to be one divided by sC where s was simply a shorthand notation for j omega. Based on this, once I converted all my elements into impedances, I can go ahead and apply all the good-old linear analysis techniques. I will discuss a bunch of them today. As an example, I could analyze this using my simple voltage divider relationship. Vc is simply ZC divided by ZC plus ZR times Vi. And that, in turn, is, well, let's say I divide this by Vi so I can get the response relation, is ZC divided by ZC plus ZR. And ZC I know to be one by j omega C, plus R. And multiplying throughout by j omega C, I get one divided by one plus j omega CR. It's incredibly simple. This is simply called the frequency response. And it's a transfer function representing the relationship between the output complex amplitude with the input. We can also plot this. Notice that in our entire analysis we have not only assumed sinusoidal input, but we're also saying that let us look at this only in the steady state. So, we will wait for time to be really, really large, and then look at the response. And so, therefore, we will plot the response not as a function of time, but rather we are going to plot the response as a function of omega. What we are going to say is I am going to input a sinusoid and my output is going to be some other sinusoid. And since I'm waiting for a long time to look at the output, time doesn't make sense anymore. Rather, my free variable is going to be my frequency, so I am going to change the frequency of the input that I apply. And so, I am going to plot this as a function of omega. This represents a completely complimentary view of circuits, the time domain view and then there is a frequency domain view. The frequency domain view says how did this circuit behave as I apply sinusoids of differing frequencies? I can plot that relationship in a graph like this, and this relationship is simply given by a parameter edge the transfer function, it's a function of omega. And I can also plot the absolute value of that. And let's take a look at what it looks like. So, I can look at functions like this and very quickly plot the response. I am going to do a whole bunch of plots just by staring at circuits and staring at expressions like this. And you will see a number of them today. First of all, the way you plot these is look for the values where omega is very small and when omega is very large. When omega is very, very small this term goes away. And so, for very small values of omega the output is simply one. Vc by Vi is simply one. This part goes away. What happens when omega is very, very large? When omega is really large, this part dominates, is much greater than one. If I ignore one in relation to this guy and take the absolute value of that then I simply get one divided by omega CR when omega is very large. So, when omega is very large, I get a decay of the form one over omega CR. I know the value for small omega, and it looks like this for very large omega. And, if you plot it out, this is how it's going to look like. Let's stare at this form for a little while longer. And let's plot some properties off it. First of all, you notice something else. When omega CR equals one then, in other words, when omega equals one by RC, notice that the output is given by one plus j. And the absolute value of that is simply one divided the square root of two. So, in other words, when omega is one by RC -- When omega is one by CR then the output is one by square root two times its value when omega is very, very small. So, that is one little piece of information. If you look at the form of this, I would like you to stare at it for a few minutes and try to understand what this represents. This says that for very low frequencies the response is virtually the same as the input in amplitude. In other words, if I apply some very low frequency sinusoid of some amplitude then the output amplitude is going to be same as that amplitude. And that's a one. Now, it also says when I apply a very high frequency, at very high frequencies it decays. So, this graph which says I am going to pass low frequencies without any attenuation, without hammering it, but I am going to clobber high frequencies and give you a very low amplitude signal at the output but pass through, almost without attenuation, the input at low frequencies. And so this is an example of what is called a low pass filter or LPF. What this is saying is that this little circuit here acts like a low pass filter. It's a low pass filter because it passes low frequencies without attenuation but kills high frequencies. If I take some music, and you will do experiments with this in lab. When is lab three? People are doing lab three right now, right? Lab three is going on right now and early next week as well. And, in lab three, you will play with looking at the response to music of different types of filters. If apply some music here, you will see that the output will pass low frequencies but really attenuate high frequencies. You will hear a lot of the low sounding base and so on but attenuate a lot of the high frequencies. All right. The other thing that I encourage you to do is Websim has built in pages for a large number of such circuits. You can go in there and play with the values of RC, or L for that matter, for a variety of circuits. And, if you click on frequency response, you actually get both the amplitude response and the phase as well. You can play with various values of RLC and see how the frequency response looks like for each of the circuits. As a next step, what I would like to do is just give you a sense of how impedances combine. This won't be very surprising given that they behave just like resistors, but it's good to go through it nonetheless. Suppose, just to build some insight, suppose I had two resistors in series. All right. R1 and R2. And this was my A and B terminals respectively. And let's say the complex amplitude of the voltage was Vab across this. Then I could relate, let's say Iab was the current, I can relate these resistances. Or, I could relate Vab and Iab as follows. Simply Vab divided by Iab equals R1 plus R2. I know that. And the same thing applies to R viewed as an impedance. It's still impedance R, and so this one still goes ahead and applies. The second thing I can try is the circuit of this form. A, B, and I have an R1 and an L in this case. And what I can do is, in the impedance model, I can view this as an impedance of value j omega L. And I can also combine them to get the impedance between A and B. Much as I got a resistance between A and B, I can get an impedance between A and B as Vab divided by Iab. And that will be given by ZR1 plus ZL, and that is simply R1 plus j omega L. Similarly, I can do an even more complicated circuit. So, resistance. And here I have a capacitor in series with the resistance, and then I apply inductor to it. This is A, B, Iab and plus, minus Vab. And let me call this R1 and let me call this R2 and this is C and L. I can go about combining these in much the same manner that I combine my resistances in the series parallel simplifications. I can define an impedance Zab between the A and B terminals as ZR1 plus Z of this combination, impedance of this combination, which is simply impedance of C and that of R2 in parallel with each other. I get Zc in parallel with ZR2. Notice that this notation simply says that look at the impedance of the capacitor in parallel with a resistor. And then, finally, I add to that the series impedance of the inductor ZL. Exactly as you would have done for resistances, if all of these resistances you would have said R of this piece plus the R of the parallel combination plus the R of whatever was here. This time around we have impedances. And replacing this with the values, this is R1. I know for ZL it's j omega L. And so, for ZL, parallel ZR2 it is given by ZCZR2 divided by ZC plus ZR2, which is simply R1 here and j omega L. And let me just substitute the values here. I know that ZR2 is simply R2, ZC is one by j omega C, and then one by j omega C plus R2. And I can go ahead and simplify that further and get my impedance Zab. Notice how simple analysis has become. Using this technique, using the impedance method we've managed to convert our analysis from solving differential equations to going back to algebra. A large part of what we do in circuits is see how we can get back to really simple algebra and try to be clever about how we do things. So, this is as far as analysis is concerned. In the next five minutes, I want to give you some insight into how you can build different kinds of impedances. And I won't go into too much detail but give some insight into how you can get a sense for the kind of filters you want to design. Or, at the very least, given a filter, how can you very quickly get some insight into what kind of filter it is, how it performs, what its frequency response is and so on. And, this time around, this piece of intuition will be in honor of Umans. And back to our Bend it Like Beckham series, I call this "Unleash it like Umans". What experts in the field do is they don't go about sitting around writing differential equations, but rather use a lot of insight into how to solve these things. And so in honor of Umans, I will label this unleash it like Umans. Let's get some insight into how the response of various elements look like. Let's take, for example, I have some impedance Z. Let's say this could be a resistor, it could be an inductor or it could be a capacitor. Let's take a look at what the frequency response of just these elements look like. In other words, what are the frequency dependents of Z itself? Let me just plot the impedance of each of these elements as a function of frequency. Let me just take the absolute value of their impedance. Notice that it's a complex number. For the inductor it's j omega L. And let me take the absolute value omega L in that case and plot it for you. And use that to develop some insight. Let's do a simple case first. If Z is a resistance of value R then no matter what the frequency my value is going to be R. If I have an inductor of value L then the impedance is going to look like j omega L, and so I am going to omega L for that. And the dependence of that simply says that for low omega the impedance is very small. For omega zero the impedance is zero and it increases linearly with omega. So, it's omega L for the inductor. Impedance increases linerally as I increase the frequency. What about for the capacitor? For the capacitor, the impedance is one divided by j omega C. And so, therefore, I get the dependence being related to omega C. Which says that for very high frequencies impedance is very low, but for very low frequencies the impedance is very high and I get a behavior pattern that looks something like this. It goes as one by omega C. As omega is very large, my impedance is very small. If omega is very small, my impedance goes towards that of an open circuit. This is not surprising. You've known this before, right? That a capacitor behaves like an open circuit for DC. An inductor behaves like a short circuit for DC. Notice that zero frequency here corresponds to DC. The capacitor looks like an open circuit for DC, very high impedance. The inductor looks like a short circuit for DC, very low impedance. And the opposite is true at very high frequencies. While R is a constant throughout. Let's use this to build some insight into how our circuits might look. Let me do this example. Let's say I have a Vi and I measure the response across the resistor. So, I measure Vr divided by Vi and take the absolute value and take a look at how it's going to look like. I want you to stare at this for me and help me with what the response is going to look like. Let's take incredibly high frequencies. At very high frequencies, this has a very high frequency, what do the capacitor look like to very high frequencies? Is it an open or is it a short? A short circuit. At very high frequencies the capacitor looks like a short circuit. Then Vi simply appears across the resistor, which means that at very high frequencies the output is very close to the input. At very low frequencies what happens? At very low frequencies the capacitor looks like an open circuit. If this looks like an open circuit then very little voltage will drop across this resistor here because most of it is going to drop across the capacitor. What is going to happen is, for very low values, I am going to be looking at something out here. And, because of that, my response looks like this. And this is of a different form than the one you saw earlier. In this case, I pass high frequencies but attenuate low frequencies. Not surprisingly, this is called a high pass filter. You need to begin to be able to think about capacitors and inductors in terms of their high and low frequency properties. And, if you develop that intuition, once you develop the intuition about capacitors and inductors and their frequency relationship, that will be a big step forward in 002. If you get that insight, you will go a long way in terms of knowing how to tackle problems and being able to quickly sketch responses. Yes. In the case of, if we get something like j omega L, what you can do is take the limit as omega goes to zero. If it is omega L then notice that it is going to start linear. And, on the other hand, if when you get very high frequencies, for example, if you get one by something omega C then this is a hyperbolic relationship, so it is going to go ahead looking like this. So, you can take a look at a lot of these functions at their very low values and see how they look like at that point. All right. The next one I would like to draw for you is something that looks like this. Let's say, for example, I have an inductor L and a resistor R and I want to see what that looks like. In this particular example, I have H, take the absolute value. So, what is this going to look like? I am going to look at the value across the resistor here. Here what I am going to find is that at very low frequencies this guy is a short circuit. Since this guy is a short circuit, all the voltage drops across the resistor so it's going to look like this. And, at very high frequencies, what I am going to find is that the inductor is going to appear like an open circuit. And so, therefore, all the voltage is going to pretty much drop across the inductor. It will be R divided by something plus omega L. So, at high frequencies this guy is going to taper off to zero and is going to look like this. And this is back to my low pass filter. Just to go back to a question asked earlier, how do you know what this looks like? I can very quickly write down the expression for H of j omega. This is simply going to be R divided by R plus if this is VR. VR is simply R divided by one by j omega C. I multiply it out by j omega C in the numerator and the denominator. I'm going to find j omega C here and I am going to get one by j omega C here. And what is going to happen with something like this is that as omega becomes very small then I am going to ignore this. When omega becomes very small, I can ignore this with respect to one, and I get R j omega C. Given that, is what I've drawn here correct or wrong? This goes away with respect to one. I am left with R j omega C, right? For very low frequencies. Given what I have drawn here, is that correct or is that wrong? Well, it's hard to say. For very, very low frequencies it starts out being linear because it's an omega relationship, and then it goes up like this and then goes out there. Let me go onto another example. Let me do another example here which is something like -- I need to make sure I don't make a mistake here. If I get R j omega C by R j omega C, you know what, this ends up being a first order system, and so is going to look like this. I blew it there. Back to this system here. If I have an L and an R and I look at this equation to look at what happens across L, you can plot that again. And for very low frequencies it is going to be zero amplitude here and for very high frequencies this is going to be an open circuit, and so the response is going to look something like this. That's going to end up being your high pass filter. As another example, I would like to do a series RLC circuit -- -- and try to get you some sense of what that output looks like. Let's use our intuition and first write down what this looks like and then go and do some math and see if the math corresponds to what our intuition tells us. I want to plot Vr with respect to Vi. I want to plot it there. For something like this, what happens at very low frequencies? We are just looking to get very, very crudely what this graph is going to look like. Very, very crudely what this graph is going to look like. Given that I am taking the voltage across VR, what happens at very low frequencies? At incredibly low frequencies, the inductor looks like a short circuit, but the capacitor looks like open circuit. An open circuit in series with a short circuit that ends up looking like an open circuit. And so, therefore, all my voltage falls across VR. Now, what happens at very high frequencies? At very high frequencies the capacitor looks like a short. But the inductor looks like an open circuit now for very high frequencies, correct? Just remember, capacitor is short for high frequencies inductor open for high frequencies. So, this ends up having a very high impedance. At very high frequencies this guy has a very high impedance. And, because of that, for a high value of frequency, I end up going in that manner. This behavior has the effect of the capacitor here. And for very high frequencies I get the effect of the inductor. And so this means that I have very low values for low frequencies, very low values for high frequencies. And, as the frequency increases, I do something like this. I keep building up, then the inductor begins to play a role, and then I taper off again. This kind of a filter where I kill low and high frequencies and pass intermediate frequencies is called a band pass filter, BPF. This means that it passes frequencies in some band. Let's get some more insight on this by writing down the equations. So, Vr divided by Vi is simply R. Using the impedance relation it is R divided by j omega L plus one divided by j omega C plus R. I am going to use this equation later, so let me stash it away on my stack and put a little notation there. I am going to multiply throughout by j omega C. And what I end up getting is j omega RC divided by one plus R j omega RC, and then here, I get j times j is minus one, so I get minus omega squared. Let me rewrite it this way. I get minus omega squared. So, j j is minus one, omega times omega is omega squared, and then I get an LC. That's what I end up getting. And if I take the absolute value here, I end up getting, back to your complex algebra, the square root of this real value squared plus imaginary value squared. So, one minus omega squared LC plus omega RC squared. This is from, you can look it up in your complex algebra appendix in the course notes. It's simply omega RC here, then square of the real value plus the square of the imaginary value, and take the square root of that. By staring at this, you can notice that you realize a really important property. When omega equals LC. I'm sorry. When omega equals one divided by LC, what happens? Sorry, square root of LC. When omega is one divided by square root of LC then omega squared times LC becomes one. When this is true then this becomes one, and one and one cancel out. And, not only that, when these cancel out, these two cancel out at that point, so I end up getting a one, which means that when omega equals omega nought equals one by square root of LC and I end up getting a value that is one. It's pretty amazing. Which means that if I drive this at omega nought, if my sinusoid has a frequency omega nought where omega nought is one by square root of LC, if I'm sitting here and this is a black box on the right-hand side, and I drive this at a frequency omega nought equals one divided by square root of LC, what does this entire circuit look like to me? I'm sitting there, the black box here. I'm driving it at omega nought equals one by square root of LC at that frequency. What does that circuit look like? Yes. It looks like a resistor. It's pretty amazing. It means that even though I have an L and a C here, if I happen to drive this at omega nought then the circuit looks purely resistive and it seems to give me the same input appearing at the output. In other words, the effect of these two cancels out. And that aspect is called driving the circuit at its resonance point. Resonance is when you're driving the circuit at omega nought equals one by a square root of LC. I will very quickly sketch for you a couple of other ways of looking at circuits. Supposing I looked at this value here, Vlc, I looked at the value across the inductor and the capacitor, what will the frequency response look like? I am looking at the voltage across the inductor and the capacitor in series. Let's see. Let's go back to our usual mantra. Think about Steve Umans when you do this. What would he do? He would say ah-ha, at very low frequencies the capacitor is going to look like an open circuit. In my voltage divider, I am measuring the voltage across an open circuit, so the entire Vi must drop across the inductor and capacitor. Similarly, at very high frequencies the inductor looks like an open circuit now, so it looks like this. At very high frequencies inductor is an open circuit. And, again, I'm looking at the voltage divider across the near infinite resistance, impedance, so I get a high value here as well. Well, in the middle the value dips and I get something like this. So, this thing is called a band stop filter. Here I can nail any specific frequency, as long as the frequency falls in roughly that regime. Yet another example. The reason I'm working on so many examples is that to experts, a large part of what they do is look at a circuit and boom, give a rough form of how it looks like. That can get you half the way there in most of what you're going to do. How did this look like? If I take the voltage Vo versus Vi, let's take a look. At very low frequencies, the inductor looks like a short circuit, correct? I am talking the voltage across a short circuit, so it looks like this. At very high frequencies, I am taking a voltage across a parallel combination, but the capacitor is now a short circuit. So, that looks like a capacitor. This looks like an inductor out here and this is a capacitor holding sway here. And so, somewhere in the middle it goes up and comes down like that. So, it's a band pass filter. What is amazing is that you can take fairly complicated circuits, and just by doing a quick analysis of what happens at very low frequencies, what happens at very high frequencies, you can roughly sketch the response. And then what you should do, in addition to that, is if it's a second order circuit, just assume that it's going to do something interesting at its resonance frequency, at omega nought equals one by square root of LC. Something interesting is going to happen. Check it out. And for circuits that are first order, RC or RL, the important number is the time constant RC. Usually, when you're driving it at one by RC, omega equals one by RC then what happens is that you often times end up getting a value that is one by square root two times the input value in the circuits we looked at here. Next, what I am going to do is talk about a major, major application of filters. And that is an AM receiver. Let me do Radios 101 for 30 seconds. These guys have an antenna. You take a ground here. You pick up a signal at your antenna. There is an implied ground as well. And what you do, as a first step, is you begin processing the signal now. What we place right there is a little filter that looks like this. It is a inductor and a capacitor in parallel. And this capacitor is really your tuner that you can tune to radio frequencies. And then what you have here is a bunch of other processing and end up with your speaker. And the processing that happens here is you have a demodulator, you have an amplifier and a bunch of other things that let's not worry about them for now. What we do here is the antenna picks up a signal. So, in some sense, this part of the circuit here is your source. I could replace it with its Thevenin equivalent as follows. So, the front end of your radio looks like a Vi, R, L and a C. Where have you seen this before? Right there. That's the front end of radios. Let me tell you why I need a band pass filter in a radio out here. The way life works is as follows. I have my frequency. Let me do this not in radians but in kilohertz for now, and let me plot your radio signal strength. In the Boston area, the signals go between 540 kilohertz and they go all the way to 1600 kilohertz. In some areas we have begun to use the 1700 extra band as well for some new stations. This is the frequency range of interest. If you look at your radio tuner, you will see 540 kilohertz all the way up to 1600 and you can tune your AM radio. The way it works is that each station is given 10 kilohertz of spectrum here. And so, this is at 1000 kilohertz, 1010 kilohertz and so on. And each station transmits its signal in plus or minus 5 kilohertz around that point. And this station transmits it here and this station transmits it here and so on. This is 1030. This guy is WBZ News Radio 1030, for those of you who listen to it. What happens is that at 10 kilohertz, each station gets 10 kilohertz, and so WBZ transmits in the 10 kilohertz around 1030. Notice that each of these signals transmitted by radio stations happen within small bands. Now, you will learn a lot more about modulation and how do you get a signal to go in a small band and all that stuff. You will learn about that in 6.003. For now, don't worry about how I did all of this. How do you listen to that station? The way you listen to that station is you put a low pass filter here. You put a low pass filter that does the following. Let's say I want to hear WBZ 1030. If I pass this entire signal through that filter. And if I arrange to have the omega nought of my filter at 1030. If I can arrange to have the omega nought at 1030 then this is the response of my filter. And I am going to pick out this guy and cut out everything else. I am just going to get this. Let's listen to the station for some time. So, you can see I can tune to the station WBUL. MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Please use the following citation format: Anant Agarwal, 6.002 Circuits and Electronics, Spring 2007 (Massachusetts Institute of Technology: MIT OpenCourseWare). http://ocw.mit.edu (accessed MM DD, YYYY). License: Creative Commons Attribution-Noncommercial-Share Alike. Note: Please use the actual date you accessed this material in your citation. For more information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Transcript – Lecture 19 All right. Good morning all. Today we embark on another new chapter in what we do. And the topic is going to be -- We will talk about this thing called an Operational Amplifier. Before I get into the lecture, I want to point out a couple of things. One is that you are going to hear about two big words in today's lecture. Two big and incredibly important words. And I want to mention those words to you right now so that when I come to them in lecture you can say OK, I better pay really close attention, these are important words. All right. One of them is abstraction. The second one is feedback. Two incredibly important concepts. Abstraction, you have been seeing a couple times during this course, once in the beginning where we abstracted out Maxwell's equations by focusing on a smaller playground and simply using KVL, KCL in place of those equations. A big abstraction. It turns out that almost all of EECS is based upon abstractions at various levels. In the first lecture, I also showed you the layer upon layer of abstraction that we built to be able to build interesting systems. The second big thing is feedback. And I am going to relate this to anti-lock breaks in cars. And so, you can wait and see how we do that. It's an incredibly important concept. Before we dive into the amplifier abstraction, let me first talk about something that you know. Start with something that you know and then lead up into the operational amplifier and its circuits. You know about the MOSFET amplifier. The MOSFET amplifier that you know about looked like this. It was based on a MOSFET. There was a VS supply. There was a vI input, a vO output and, as I said, a VS supply. So, this was a MOSFET circuit that you've seen before. One way of viewing this is that this circuit has three major ports. This here is the input port with voltage vI. This here, between the drain terminal and the ground, is the output port. I take the output between the drain terminal and ground. And, finally, we have a third port, which is this one. It is called the power port. I apply VS between this terminal here and the ground terminal. And that gives us the power port. This device here was a three port device. Input port or control port, output port and a power port. And so we looked at the circuit and did a whole bunch of analyses of it. Then what I can do at this point, now that you've seen this, it's often times interesting to think about abstracting this out into some kind of a building block. Much like in software, you write a procedure and you abstract out the internal details of the procedure in the procedure declaration and in the call that you make. In the same way, we can take this little device here and abstract that out into the following abstraction. We could abstract that out as a device that looks like this. I have my input port, I have my output port and I have my power port. So, I can apply VS here. Notice that I've taken these six terminals here, one, two, three, four, five and six, and put a box around it. And just exposed the terminals to you. And I need to tell you a little bit more about the internal properties, but suffice it to say that you can begin working with this little block. An even simpler version of this for many applications might just look like this, vI and vO where there is a ground that is shared among them that is implicit in this picture. And vI and vO can simply be the node voltages at these nodes. This is a progressively more abstract representation of this amplifier. What we can do is, provided we know, we can abstract out the relevant properties of this block and expose them outside. And the relevant properties might well be that, let's say here the properties may be that I in is always zero. I can also express to you the gain of this amplifier. I may also be able to tell you the Thevenin equivalent for the output. There are some properties that I can give you that will let you use this building block abstractly. Today, what we will do is introduce a powerful abstraction of a type of amplifier. This is called the operational amplifier or "op amp" for short. What I am going to do is give you a slightly more involved building block than the one I have shown you there. But suffice it to say that the idea is going to be the same. This building block looks like this. This building block has an input port. This building block also has a port in which to connect power or the power port. And the way I am going to connect power, I am going to connect a plus VS supply here. That is going to be my ground node. And I am going to connect a minus VS supply to this node here. So, these voltages are both VS. I want to apply a plus VS here and a negative VS out here. And I am going to take the output between the ground node and the output node of the operational amplifier and call that a vO. This is the output port. So, input port and output port and a power port. Think of this as a pattern where I have an input port across which I connect the input. I have a power port across which I connect a plus VS, minus VS supply, and then I take the output terminal and take a ground terminal, which is defined by external components of my circuitry, and use this as my reference node. Remember ground is just a reference node. I am going to use this as a reference node. These two are equal in magnitude. And take this as my output. And when I do something like this, I can build an even simpler, so this is an abstract differential input amplifier. In other words, this amplifier is going to amplify whatever I apply at the input. A slightly more abstract representation of this looks like this. vOUT and plus/minus vIN. This is a slightly more abstract representation where, remember, we are going to draw this again and again, maybe at least 38 or 39 times in this course. And, remember, each time you draw it, remember that there is an implicit power port, a plus/minus supply that is connected which we don't show. And I remember when I first learned about it a long time ago there was a confusion in me initially. How does this work? Where is the power coming from? Just remember that power comes from a plus/minus supply, and we just don't show that in this abstraction. Now, the details, a lot of details are in Chapter 16 of your course notes. That's the reading for that. The other thing is that there are some other key properties of this amplifier. And let me discuss those very quickly. First of all, I can draw a circuit model for the amplifier. Make some room for myself here. And this is a circuit model for what we call the ideal operational amplifier. And the circuit model is going to look like this. This is an abstract device. And, in terms of analyzing how this behaves in a circuit, I am going to show you this abstract circuit that looks as follows. Some input v is applied at these two terminals here. And this terminal is called my v plus terminal and this is called my v minus terminal, so this corresponds to these two terminals. I am telling you that the current going in is going to be zero, so i plus is going to be zero and i minus is going to be zero. i plus is the current in here and i minus is the current into the v minus terminal, and both these currents are going to be zero in this device here. The output is going to look like this. Let me just call it vOUT to be consistent with this here. And taken with ground as my reference. The output is simply Av. In other words, what I am doing is I am going to model this as a device that has a dependent source at its output. And the dependent source here is a voltage controlled voltage source. It is a dependent source, it is a voltage controlled voltage source such that the output voltage is A times the voltage v across its input. This is actually very simple. Think of these three terminals I have shown you here. I applied input across these. And the output is going to be A times whatever I applied. And A is going to tend towards infinity. A is going to be huge. And specific values for A might be a hundred thousand or a million or things of that sort. Huge A in this abstract amplifier. In addition to that, the other properties are that it is going to have infinite input resistance. That means looking in this looks like an open circuit. The fact that this is open here implies the infinite input resistance across this port. What about the output here? Remember, this is a voltage source. And we have a zero output resistance, which means that no matter how the load affects this, as I apply a load this is going to behave like an ideal voltage source and keep holding the voltage constant based on whatever the function I establish here. And A is virtually infinite. Let me pause there for a few seconds and just dwell on this so you just understand what the basic device is. Following this basic definition, I am just going to build a whole bunch of fun little circuits. The analysis will be pretty straightforward, but this is a big conceptual leap here where there is some circuitry inside. Containing resistors, MOSFETs, a whole bunch of stuff in there. I am not telling you what is inside it. Much like I could build an abstract amplifier, I could put an abstract box around the amplifier you saw earlier, I want to put a box around some circuitry. I am not telling you what the circuitry is. And, if you are curious, you should look at page 581 of your course notes. There is an example solved. The example is for a differential amplifier. This is the small signal analysis chapter. That differential amplifier that's solved in that example is usually the first stage in an operational amplifier circuit. That differential amplifier is the first stage at the input. And that differential amplifier, as the name implies, amplifies not a single voltage but amplifies a differential voltage. Note that this guy amplifies the voltage difference between these two terminals. That's v here. And v is simply the same as v plus minus v minus. It's the node voltage here minus the node voltage here. That is what's amplified. It amplifies a difference. Therefore, it is called a difference amplifier or a differential amplifier. And so that input stage is what is inside the op amp. It's got a bunch of other circuitry like level shifters and so on. And at the output it has got a buffer. At at the output it has something that is reminiscent of the source follower circuit that you learned about in recitations, solved an example in the course notes and in your homework as well. And you solved a variant of the source follower on your quiz as well in problem two. So, a circuit that looks like that appears at the output. Remember, for the source follower, the resistance looking in from the output was very, very small. You have seen some of the pieces that go inside the amplifier, but we will deal with this as a building block and simply represent it using this abstract little circuit. To dwell on this a little longer, this little device here is the workhorse of the analog industry. Much like your primitive gate abstraction, your inverter and NAND gate and so on, much as your primitive inverter or NAND gate was from the foundations of the digital industry. Remember we learned how to build this little abstract device called a NAND gate or an inverter? We noticed that those form the foundations of very complicated microprocessors. Those were the building blocks of the digital industry. In the same way, this little beast here is the building block of the analog industry. Just to give you an analogy from software, think of this abstract little device as a library routine from a library of functions when you program in C++ or whatever. Can someone give me an example of an incredibly popular routine that we use all the time that may be called the workhorse of the software industry? Pardon? An abstraction, an abstract procedure. One example might be something like a printf. Printf is an abstract name for a procedure that goes and does something for you. It is amazing how we take the lowly printf for granted. I stick my printf into my program, it includes the standard IO library and it goes and prints a value. You won't believe how complicated the printf is. As you go into learning more advanced software subjects, implementing the printf is a nightmare. It is horrendously complicated. Just imagine. You give it a string and it has to go and print that on your terminal or on your Windows system or whatever. Think of the complicated steps it has to go through. But, as far as you're concerned, it's simple. Just print out something and you're done. The same way. Think of this as the printf of the analog business. It is really simple, and the analysis is going to be incredibly simple, it will be mind-bogglingly simple, but inside it, heavens forbid if you look inside it. Tell you what, go into to S-T-D-I-O dot in one of the library routines and just pore through printf. The world's worst horrendous macros are in there. I mean it is just nasty. The same way inside the op amp, it is nasty. You don't want to go there. Much like in your C programming in your classes, you were able to use printf without fully knowing how it was implemented. Probably some MIT god or some key graduate implemented it, but once it was implemented you just used it based on simple abstract rules as to how it behaved. You didn't have to know what was inside it to use it. The same way with the operational amplifier. So, just think of printf when you see this and just imagine how simple it is going to be to use it. You may think that I spend way too much time, ten minutes dwelling on this abstract concept, but I like to dwell on things that I think are incredibly important. The concept of abstraction is very important. And it's not just in software. The concept of abstraction pervades all of EECS. And if I were to give you a project to say go and ask every professor what is the one word that you think best describes all of EECS? Just pick one word. Go ask every single professor you know. What is a single word? If you were to characterize all of EECS with just one word, what might that word be? In my mind, it is the A word, abstraction. It is all over. If you do a grep on all the words used by all your professors in your four years here, I promise you the first one will be know. And the second one will be abstraction. Check it out. See if what I am saying is true or not. It is all over the place. In 6.001, how many times do you think the word abstraction was used in 6.001? It's all over the map. It's the A word all over. Imagine your shock when you see it being used in 002 because the same concept applies. We build more complicated systems by abstracting out the details of lesser objects, and then using those to build the more complicated systems. Abstraction is a very powerful mechanism of dealing with complexity. Next step is how do I go about using the op amp? Let me show you how it looks on a scope. What I am going to do is apply input to the op amp, I am going to look at the output, place the resistor RL to ground and look at the output. And here I am going to apply a plus VS and out here a minus VS. Again, remember that a plus VS simply looks like this and a minus VS simply looks like this. It's just an inverted VS applied here so I get a minus VS at this input. First of all, what I would like to do is as I change vIN, I am going to plot for you how vOUT looks. vIN and this is vO. I am going to plot vIN in terms of microvolts and vO in volts. vIN is going to have a very very small, the scale is going to be in microvolts because remember the gain of this is huge. It's on the order of ten to the sixth. It's huge. Small changes in vIN are going to cause massive changes in vO. I have a very fine scale on the X axis. What is going to happen if I somehow magically make vIN exactly zero? If I short these two terminals, if this was a completely ideal op amp, which it never is, if it's a completely ideal op amp, then my output should be zero. As I increase my vIN the output should be A times vIN. For some small value of vIN, small v, let's say one microvolt, the output should be one volt. A is a constant so this would look like a straight line. And let's say my supply voltages are 12 volts minus 12 volts, if this were an ideal amplifier and I didn't have to worry about the supply, this would just go on extending forever. But I have a plus 12 volt supply and a minus 12 volt supply. My output cannot go past those limits. And so, therefore, my output kind of flattens out at these two points. And it is called hitting the rails. Output goes up and you hear a thunk sound and you hit the rails. When you play with op amps in your next lab, if you listen really, really carefully you may hear it. So, this saturates out. Not surprisingly, this region where the output saturates at the supply is called the saturation region. Remember, don't confuse it with-- It's not the same as your saturation in the MOSFET. It is a totally different thing. It is just happenstance that we call this saturation. And if you would like to think about it, you can think of it as the thunk region. That's probably more appropriate to distinguish it from the saturation region in the MOSFET. And, not surprisingly, this one is called the active region. And it is in this region that we use the op amp. Here it has hit the rails and is kind of dangling out there. It's not much use to us. It's in this active region that we use it because this is where the gain is seen. Now, it turns out that this is a very high gain device. It is very skittish. This gain is kind of a really funny thing. It's dependent on a bunch of factors. This could be temperature dependent. This gain here and this curve is just completely skittish. It could depend on temperature. It could depend on time of day. It could depend on what medication this amplifier is on. It could depend on its mood swings. Who knows what? This is kind of unstable. And A in particular is highly unstable. It is going to be big, that's for sure, but it could be ten to the six, on a rainy day it might be two times ten to the six. If it feeling sleepy it may be point five times ten to the sixth. It is big but I cannot rely on it. Let me show you an example. I want to show you this curve for this MOSFET, apply an input and plotting the output. What I will do is take a look at this curve. Then what I am going to do is use a heat gun to heat the op amp and you are going to see this vary all over the map. If you still remember last week, some of you may remember that from some place in a similar situation where the gm for the MOSFETs you were given was also dependent on temperature and stuff like that. It is a very common occurrence. And that is certainly the case for the MOSFET. Let's apply input. Let's do this. This is vIN versus vOUT for the amplifier. Notice that this is plus 12 volts, this is minus 12 volts. It is about two volts per division. This axis here is in microvolts, I believe. For a very small change, for a few tens of microvolts, I have an incredibly high gain. Notice that this has an incredibly high gain here. The gain is the slope of this line, almost a vertical line. What I am going to do next, is to have some fun, is I am going to heat the op amp. To show you that A is kind of really skittish and also the fact that it doesn't quite hit zero, it does all kinds of weird things, I am going to heat the op amp. And then let's take a look at how that curve fluctuates. What you saw there was that the op amp began to behave really weirdly as I heated it. Instead of doing this it sometimes did this really weirdly, like getting an offset from the center and so on. And it does a bunch of other weird things, but we won't go into those details. It's not relevant for this course. But the point is that the gain and the offset at the input are dependent on temperature. And we look for ways to make it less dependent on temperature. As the next step, what I would like to do is build a circuit. This is model equivalent of your Hello World program. We are going to use the printf and build a small program on the printf. You don't have to worry about how printf is implemented, just that we can build very highly interesting circuits with this horrendously complicated function based on a simple abstraction of the device. The circuit that we will build is called a noninverting amplifier. From now on, I am not going to show you the plus/minus VS. I am not going to show the power port, but it is in there. It's hidden under the abstraction layer. This is my op amp. And I am going to build the following circuit. This is my v plus and this is my v minus. What I am going to do is for the v plus I shall apply a vIN. Let me talk a little bit about ground as well. Ground is commonly taken as the point at which I connect my VS and minus VS supply. It is kind of at the midpoint. And if VS and minus VS are very carefully tuned then the output is also going to be at that same ground reference when the input is zero. So, the ground is defined as the point at which I connect my plus/minus VS supplies. I apply my vIN out here. Then what I am going to do, here is my output vO. I am going to have a resistive divider to ground here and label these R1 and R2. And what I am going to do here is feed this back to the input, to the v minus input. I am going to sample the voltage here and feed that into here. So, this is my abstract model and this is my Hello World program. What we are going to do is simply analyze how this little program behaves. So, my equivalent circuit model. The way to analyze these is after one or two of these examples, you will be able to directly analyze this just by looking at it, by inspection. But, much as we did for the other pieces, let me grunge through drawing the equivalent circuit and grinding through the analysis, and then show you the much simpler way of doing it. And even here, even with this grinding analysis, it is going to be pretty simple in any case. So, I will replace the op amp with its equivalent circuit model. Its equivalent circuit was v plus, v minus. So, that was the equivalent circuit model of the operational amplifier, just this piece. I draw that for you. Then what I am going to do is I connect my v in here. And, remember, I have an R1, R2 resistive divider here. And this one gets connected to this terminal there. I also know that i plus is zero. I also know that i minus is zero. All I've done is simply replaced the amplifier with its equivalent circuit. Let's go ahead and analyze that circuit now. Let's go ahead and analyze that circuit. And it's going to be pretty simple, actually. What I am going to show you is the hard way of doing it. I will show you a much easier way, but the hard way itself is pathetically easy. What I want to do is find vO in terms of vIN. And there will be a bunch of other factors thrown in, including things like R1 and R2, A and stuff like that. Let's go and analyze it. vO, let's look at that circuit. By the way, let me take 30 seconds and make a little speech at this point. When you see circuits like this, and I saw this happen in quiz two as well, for some reason, when you see a new kind of circuit, don't completely go berserk or freeze or whatever. There is just no reason to. You know the node method. The node method is the workhorse of our business. When in doubt apply the node method. It will simply work. Don't freeze. Don't think oh, man, I need to apply a pattern that I know already. I must have seen this somewhere. When in doubt boom, apply the node method. This circuit here, all I have here is one unknown node voltage. I know the voltage of v plus, I need to compute the voltage vO. There are two unknowns, vO is an unknown and the voltage here at v minus is another unknown. This is a very simple circuit involving a dependent voltage controlled voltage source, and you need to find out vO and v minus using the node method. Just apply it. It's simple. Don't freeze. Just look at it and say I can do it and apply the node method. It will simply work. So, let's do that. What I can do here is vO is A times v plus minus v minus. This is actually really simple. And then, if I take v plus here, I know v plus is simply vIN so I will just make that substitution right away. So, v plus is simply vIN. What is v minus? v minus here is vO -- What is v plus? I'm sorry, v minus. v minus is simply the voltage that is between R1 and R2. Notice that no current flows in to the v minus node. There is no current flowing in. Voltage at v minus is simply the voltage given by the resistive divider, which is vO times R2 divided by R1 plus R2. Stare at that for another second. The voltage at this node here is simply given by the resistive divider. Because no current is flowing in this direction. And no current flows in because I am telling you there is no current there based on my abstraction. I am telling you i minus is zero. That voltage is simply the voltage at this resistive divider. And so I can simplify it further and write this as vO. So I get, there is a one here. And I move this thing over to this side so I get one plus A times R2 divided by R1 plus R2. And that is equal to AvIN. And simplifying it some more, I get vO is AvIN divided by one plus AR2 divided by R1 plus R2. Notice how simple this is, and this is the hard method. All I have done is analyze the circuit using the basic circuit analysis principle that you learned the first week of the course, and I have the output for you. I just noted very carefully what the relationships were between the various elements in the abstraction. Notice here that I am told that A is extremely large. A is on the order of ten to the six and so on. And suppose it is the case that, let me write that down again. vO is AvIN, one plus AR2, R2. Suppose R1 and R2 are more or less comparable and A is ten to the six, it's a huge number, so this whole number is much, much greater than one. If it is much huger than one, what I can do is I can then write this as follows. I can say that this is more or less equal to AvIN divided by AR2 divided by R1 plus R2. I am ignoring the one here. As soon as I do that, notice I can cancel out A and I get vO to be approximately equal to vIN times R1 plus R2 divided by R2. Notice now that when the gain is very large the output is a function of the input multiplied by some number. The beauty of this thing here is that when A is very large, or this expression is very large, A cancels out and there is no A in this relationship. This means that even though the basic amplifier was very skittish, the output here relates to the input based on components that I have control over. These are soldiers in my army. I control them. So, to give you a sense of some numbers here, suppose A was ten to the six. And I choose R1 to be 9R. And R to be some R. Then vO is ten to the sixth vIN divided by one plus ten to the six R divided by 9R plus R. So, that is ten to the six vIN divided by one plus ten to the six divided by ten. All right. If I ignore the one here, the ten to the six and ten to the six cancel out, this ends up giving me 10vIN. So, I get a really nice amplifier whose output is simply ten times the input and determined solely by some resistor values. Let me show you another quick demo this time and show you the amplifier again, but with resistors connected like that. And then I show you that I want to heat the amplifier to the wazoo, the op amp to the wazoo, but vO is going to be absolutely rock solid. Let's try that out. This time around, this is the transfer function, the vO versus vIN. And notice that this time around I have similar scales on the X and Y axes, and this has a slope of 10. This is the point where the amplifier saturates at plus 12 volts, and this is minus 12 volts, and this point here is a zero. So, this is vIN, vOUT, plus 12, minus 12 and this slope is 10. What I am going to do now is heat the op amp to the wazoo and this ain't going to change because it's my external resistors that control it independent of the value of A, provided A continues to be very large. I am just articulating the vOUT, vIN curve. And let me start heating the op amp. Notice that it's pretty stable. It doesn't change because it is independent of the amplifier values. What I have done now is by connecting these resistors in this way, I have a nice amplifier with a gain of ten. The question you may ask yourselves is why? There is this little sucker in there that wants to shoot things up by ten to the sixth. Wants to knock things off the one rail or the negative rail. Why is it that it's behaving like a docile lamb here and giving us a nice little factor of ten gain no matter what I do to it? Why is it doing that? What is the intuition behind it? I will draw something on the board, but for the next ten seconds I want you think about it. See if you can come up with some insight as to why is it doing that. Why is it exactly ten? Why isn't the ten to the sixth kind of killing me somehow? Why am I getting exactly ten no matter what happens? See if you can come up with some intuition and then I will show you how it works. I will redraw the circuit in the meantime. Let me see if I can give you some intuition. This is my circuit, and let's say this is R and this is R. As an example, let's assume that the input is 5 volts, vIN is 5 volts. If R and R are equal, what should the output be? It's R and R, so it's R1 plus R2 divided by R2, right? It's 2R divided by R, so it has a gain of two. My amplifier has a gain of two because R1 plus R2 divided by R2, which is my gain, is R plus R divided by R equals two. So, this will be 10 volts. If that is 10 volts this is going to be 5 volts, correct? This R and R, voltage divider, this is five, so I get 5 volts here. This is v plus. This is v minus. I get R and R, 5 volts here, that's how the circuit looks. Now let's understand what is going on. And listen very carefully. This is going to be a key insight that I hope you will carry with you for the rest of your lives. This is really, really key. What you are going to see is, I think, the third big ah-ha moment in 6.002. Like small signal analysis, like the frequency domain stuff we saw, I think this is the third big one in the next 30 or 40 seconds, things that are completely either not necessarily intuitive but are just spectacular in terms of what they can do for you. Let's see. Let's suppose that because I am heating it, let's suppose that A suddenly tends to increase. It wants to increase because I have heated it. A is saying I want to get out this mold here and starts to break through its shackles here. Let's say, as a Gedanken experiment, that it tries to shoot up this to 12 volts. It tries to push it up higher. This is just a Gedanken experiment. The up arrow says that the increase in A is trying to push up vO momentarily. Let's see what happens. It is trying to push up vO momentarily, so let's say this goes to 12 hypothetically. If that goes to 12, what should this volt node go to? Six, exactly. This goes to 6 volts. If that goes to six, what does v minus go to? 6 volts again. So, v minus goes to 6 volts. Now at the input I have 5 volts at v plus and 6 volts at v minus, so where should the output go? The output should go down because the voltage of the negative terminal is higher. And so the output is A times v plus minus v minus. And because this has gone down, this has gone up here it is going to try to pull the output down. That is going to pull the output down let's say to 9 volts or something. Cachunk, there is a big battle going on here. A has gone up, it has boosted it up to 12, but the moment that goes to 12, this goes to 6, this goes to 6, and the op amp output has to go down to 9 volts now because this input is higher here. If this goes to 9, this goes to 4.5. If that goes to 4.5, this goes to 4.5. What happens now? If this goes to 4.5, what happens? It wants to go back up. Can't it make up its mind? This guy wants to go back up now because v plus is higher than v minus. What am I seeing here? This whole circuit here behaves like my little son, my 9-year-old. If say do this, he wants to do the exact opposite. So, there is a trick in how you make them do things for you. Look at this. Because of this arrangement of the circuit when A tries to push the output up, the rest of the circuit tries to pull it back down to where it used to be. If the circuit tries not to follow the true path, the rest of the circuit tries to whack it into shape so it follows a true path. And what's happening is because, in this arrangement, I have fed back a portion of the output to the negative input. I have fed back some of the output to the negative input. And by providing this feedback of a portion of the output to the negative input, I have arranged it in a way that I have something called negative feedback. What negative feedback does is that if this wanted to go wild and crazy, the circuit provides it with some negative feedback like you just saw. Feedback, a big word. If you take a poll of all the EECS faculty, I suspect that feedback would rank at least as the ninth or tenth most important word in the EECS. If abstract is number one, I think this would rank like a nine or a ten or something. So, that's the reason why it worked. In the last couple of minutes, let me give you some insight, based on something that you know, on how feedback works. This is a road here. Let's look at anti lock breaks. This is my tire. And let's say I have a set of disk brakes here. As the car is moving forward, if I apply the brakes the tire stops rolling, but if I apply the breaks too hard it can lock up the tire and the whole car can skid. The way anti lock breaks work is as follows. There is a controller that sits here. And there is a little person looking at the wheel and seeing is it turning. So, this is a feedback. And it is saying is it turning? Yes. Or, is it not turning? No. All this person watching the tire is doing is saying is it turning or is it not turning. That is it. That is a negative feedback. And so, if it is no and if it is yes. If it is yes then what this does is it applies the brakes even more strongly. It is turning so I can apply more brakes. But if it says oops, it stopped turning, what it does is it simply releases, the controller releases the brakes. And when the controller releases the brakes this one tends to loosen up a little bit and the tire starts turning again. So, this way you are constantly keeping the tire in its region of critical friction so that it is constantly moving. And static friction applies to how hard you can brake and it doesn't start skidding. In fact, if you take your car out, and I don't say you do this. Let's say go onto the Charles River in the dead of winter and you drive on the lake and you slam your anti lock brakes on, on an icy patch, you will notice that there is a constant sound that looks like something is vibrating in there. That is exactly what is happening. Oops, the tire is locked. Release the brakes. The wheel is turning. Jam the brakes on. That is exactly what is happening. The same way as out there, you notice that oops, the output is going up, pull it down, oops, it's going down, pull it up. So, there is constant negative feedback that is keeping the output stable. A very important concept. And I will ask your recitation instructors to cover the very simple method that is on page 9. MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Please use the following citation format: Anant Agarwal, 6.002 Circuits and Electronics, Spring 2007 (Massachusetts Institute of Technology: MIT OpenCourseWare). http://ocw.mit.edu (accessed MM DD, YYYY). License: Creative Commons Attribution-Noncommercial-Share Alike. Note: Please use the actual date you accessed this material in your citation. For more information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Transcript – Lecture 20 All right. Good morning. Let's get going. In today's lecture we continue with the operational amplifier, "op amp" for short. And what we are going to do is just build up a bunch of fun building blocks using the op amp. As a quick review -- To quickly review what we've seen about the op amp -- We represented the op amp as a device that looked like this where the amplifier had an incredibly high gain. So, if I had a small voltage difference here -- I call this v plus and this v minus with respect to ground. And if I had a small voltage difference then this gain here would multiply the difference by a large number and thereby giving me an output that was on the order of a million times greater than this difference. And because of that when I use the op amp in a mode like this without any negative feedback the output would usually crank up to the positive rail or the negative rail. We also saw that it had infinite input resistance so that the current flowing in here or here was zero and also had zero output resistance. This is my ideal op amp where irrespective of what load I connect here the op amp would supply pretty much any current. Now, in practical op amps that's not the case. But suffice it to say that when used as an ideal op amp the output impedance, the output resistance is going to be zero. The op amp is a huge workhorse of the analog industry. You will see based both on what you've done on Tuesday and Wednesday but also today that it's very, very simple to build circuits using the op amp. When you use the amplifier, you don't have to worry about things like nonlinear analysis. You don't have to worry about am I really meeting the criteria for saturation limits and so on? To some extent you have to think about that with the op amp, too, because if the output hits the positive rail or negative rail it isn't going to behave like you expect it to. But fundamentally with this primitive model, this idea model it becomes really simple to build circuits with the op amp. Therefore it has become a key building block for circuits. When circuit designers build analog circuits very often their primitive building blocks are really an amplifier of this sort, an op amp, resistors, capacitors and some of our other primitive building elements. If you look at the course notes the readings are -- There are a bunch of examples solved in Chapter 16. And you will see that using the op amp it is indeed possible to build current sources that look like more or less ideal current sources. It is also possible to build voltage sources and so on. It is an incredibly neat building block using which you can do all kinds of cool stuff. In this course you will see a whole bunch of example circuits using the op amp. In today's lecture you will see things like a subtractor. You will also see integrators and a differentiator. And then in your lab, lab four, you will build a really fun mixed signal circuit involving both digital and analog components. And you will build what is called a digital to an analog converter using the op amp. And of course I can build all our good-old amplifiers and circuits of that sort. In a later lecture you will also see how we can build filters using an op amp. This is going to be using the knowledge you learn in terms of connecting resistors, capacitors and inductors together and doing a frequency domain analysis, well we can throw the op amp in there and build filters, too. This is just to give you a preview of upcoming attractions. For today I am going to focus on these circuits. I won't be covering any new theory or any new set of foundations but pretty much take the simple properties that I have explained to you about the op amp. And using those simple properties very quickly build up a bunch of circuits that you can use to analyze signals in a variety of ways. Let's start with the following circuit. With op amps I start with this little guy. And what I am going to do is use two voltage sources, v1, and this is a resistor, not an inductor. And value R1, value R2. So, I have a voltage connected by a divider, voltage divider to the plus input. And I am going to provide some negative feedback in the following way. This is going to be R2, the same as this one here, a resistor R1. And then a voltage source v2 that I connect out here. So notice that- Oh, and I take the output vOUT out here. And that vOUT of course is with respect to ground, and R2, v1 and v2 are also connected to ground. What I am going to do is analyze the circuit it two different ways, and as I analyze it describe some other interesting properties to you. In the last lecture the technique I used to analyze op amps was one in which I replaced the op amp with its ideal model involving a dependent source and so on with a large gain A and showed that. I wrote the expression and then I let A increase to infinity to the limits and got an expression that was independent of A. And then in recitation yesterday you would have covered another technique which makes it much simpler to analyze op amps. Let me very quickly review that method. We fondly call that technique, there is no formal name for it, but we fondly call that v plus more or less equal to v minus method. This is also variously called the virtual ground method and so on, but we shall call it the v plus more or less equal to v minus method. The insight here is that whenever I use the op amp in a way in which I am giving it negative feedback, so I am feeding some portion of the output to its negative input. I am giving it negative feedback. That's one property. Second property is that my inputs, v1 and v2, and my resistance values are chosen such that the output is not in saturation. So, the op amp is not at the plus VS rail or minus VS rail. Rather it's somewhere in the middle in its active region. When that happens we claim that the v minus and v plus for the op amp are more or less equal. And to give you some intuition as to why that is so, let's say the output is 6 volts and my supply is plus/minus 12. This is 6 volts and the amplifier is a gain of a million, ten to the six. To sustain 6 volts at the output all I need is a difference of 6 microvolts here. Six divided by ten to the six is the difference between v plus and v minus. It's very, very, very small. It's so small as to make v plus more or less equal to v minus. All it takes is a very small differential voltage here to give you 6 volts at the output. The key thing to observe is under negative feedback, when the op amp is not in saturation the property that v plus equals v minus holds. And the way it works is that it's not that it's a magical property. It is simply that when I apply negative feedback the negative feedback is such that it will force this v minus node here to be at more or less the same voltage as v plus. Remember the when in doubt simply go back and think about the anti lock brakes example we did last time. For example if v plus increases the output will increase and so will the voltage here and tend to make these two equal. What we can do, being rather tricky here, what we'll do is say look, if we know for a fact that under negative feedback the op amp is going to engineer these two node voltages to be more or less equal then why don't I just use that fact to begin with and analyze my circuit assuming that it's true. This is just a bit of inverted logic here that says look, the circuit is going to make that happen. If the circuit is going to make that happen to analyze the circuit in its steady state, why don't I just go ahead and assume that to begin with? This again goes back to us wanting to be engineers here and do whatever is simply and find the simplest possible way of getting some place. I want to use that method, the v plus equals v minus method. Let me just first write down some values that I know about. I know that v plus is simply a voltage divider relation here. That's v1 times R2 divided by R1 plus R2. And by the v plus equals v minus method I know that this is going to be equal to v minus. And this is going to be true because I am giving you negative feedback here. And we are going to engineer the values of R1, R2, v1 and v2 such that the op amp is not in saturation. So, we know that. The next thing that we know, let's say this is a current i. This current i flows here. Know that there is no current going in here. Op amp has an infinite input resistance so there is nothing going in there. There is no current going in there. If there is no current going in here, what must happen to i? Remember, from the foundations of the universe Maxwell's equations and therefore KVL and KCL hold. KVL and KCL simply come straight from nature. You and I cannot mess with that. Bad things happen to you if you do. So, nature, Maxwell's equations, KVL, KCL. It's simply nature. So, KCL applies here. Current comes in here. Nothing goes there. Don't argue. The current has to go here, period. No if, ands or buts. There is i coming in here, nothing goes there, so that current must flow here. It has no choice. It's from basic nature. I can write down what my current i is going to look like. What is i going to look like? Well, I know v2, I know v minus. v minus is the same as v plus. And v plus is the i expression given here. So, I can write i as v2 minus v minus divided by R1. Let me keep track of those two and then go ahead and compute vOUT. So, my goal in life is compute vOUT as a function of the two input voltages v1 and v2. And just for kicks I have gone ahead and computed some of the intermediate node voltages and currents. How do I write vOUT? What is vOUT? vOUT is simply v minus from KVL. vOUT is simply v minus minus the drop across this resistor. So, the drop across that resistor is simply iR2. From good-old KVL from the first lecture, a voltage minus the drop across the resistor is equal to vOUT. Therefore it's simply v minus minus iR2. One thing to be very cautious about, I will tell you right now, is that the output here relates to the inversion of the voltage across this resistor R2. Be very, very careful in that if I have a voltage across this resistor here that impacts vOUT with a minus sign attached to it. Notice that iR2 is the voltage across R2 and vOUT relates to the negative of that. Be very cautious. That's one of the commonest silly mistakes I have seen people make in solving problems like this. Let's go ahead. I know v minus and I don't know i. Let me substitute for i for now, and that is v2 minus v minus divided by R1 times R2. Let me go ahead and collect all the v minuses. v minus, I get a one here, minus minus becomes a plus, and so I get R2 divided by R1 out there. And then I minus v2 R2 divided by R1. That is vOUT. Now let me go ahead and substitute for v minus. And that is simply v1 R2 divided by R1 plus R2. That is v minus. And this character here is simplified to be R1, R1 plus R2 minus v2 R2 divided by R1. What do we get? I cancel these two suckers out and what I end up with is v1 R2 divided by R1 minus v2 R2 divided by R1, which is simply R2/R1(v1-v2). What is interesting here is that what I have ended up building is a very primitive subtractor. So, my output relates to v1 minus v2 multiplied by the constant factor given by R2 divided by R1. Again, as I pointed out to you at the beginning of this lecture, no knew foundations today, no new theories, no new disciplines, no new laws. We are just going to take what you have learned -- Three simple things, infinite gain, infinite input resistance, zero output resistance, plus this new thing v plus equals v minus. And just being armed with those four principles we are just going to charge ahead and analyze a bunch of circuits. It is purely intellectual and pure applications today. This is one way of doing it. There is another way of solving it. We can solve the circuit. Remember, whenever you see a linear circuit and you see two sources or three sources, just think superposition, right? You see a linear circuit and two or three sources, think superposition. We should be able to apply superposition to this. The op amp is simply another building block. It's a linear circuit. So, let's see if we get the same answer. Let's try to solve the circuit using superposition and see if we get the same answer. To do superposition what I am going to do is build two subcircuits. One subcircuit in which v1 is zero, and that subcircuit looks like this. If I set v1 to be zero then I get R1 parallel R2 going to ground. So, if v1 is set to zero then R1 goes to ground. And I get R1 parallel R2 here. And of course I have v2 as before. And this was R1, this was R2, and let me call that vOUT1. Oh, I'm sorry. Let me call it vOUT2 corresponding to that component of the output that relates to v2 acting alone. Remember superposition? Build two subcircuits, one that depends on v2 and another one that depends on v1. Let's do the second one, too. Second one is v2 going to zero. Here is my little op amp. And what I will do is simply flip the op amp just to see if you can identify some interesting patterns. Just flip the op amp around. And this is v1 as before. And recall that v1 was going to the plus node through a resistor R1. And then I had a R2 to ground. And then let me short v2 to ground. And when I short v2 to ground what happens? When I short v2 to ground what happens is that the tail of R1 here goes to ground. And so it is as if the output is connected to the node v minus through a resistor, so it as if the output v R2 is connected to the minus input through a resistor. We will draw it like this. And the minus input goes through a resistor R1, to ground. If you thought that patterns were important in the earlier part of the course doing voltage divider patterns and current divider patterns and amplifier pattern, the source follower pattern, op amps is all about patterns. You should remember two or three simple patterns and be able to write down the expression for those just by observation. So, this is one common pattern that you have seen before in the very first lecture. And I just wrote it down in that manner. Let me go ahead and solve this circuit. It turns out that this is also a pattern. I will analyze it today but in the future v2 going to this node through R1 and then R2 to the output. You have probably also seen this in your recitation. This one is called an inverting connection and this one here is called a non-inverting connection. Let's go ahead and do vOUT2. vOUT2 is simply given by, notice that since this is ground, no current flowing here, this voltage is zero. If this voltage is zero, this voltage is zero by the v plus equals v minus method. If this is zero, the current that goes through here is v2 divided by R1. And that same current must flow through the resistance R2 as well. If the current v2 divided by R1 flows through this resistor, the drop across this resistor is simply given by, let me hide this for a second, is simply given by v2. So, v2 divided by R1 is the current here. This is zero. So, the drop across this resistor is v2 R1 multiplied by R2. That's a drop across this resistor. This voltage is simply zero minus a drop across the resistor. So, it's zero minus the drop across the resistor and that gives me v2. Again, remember this minus sign comes in when I want to convert this to get the output voltage from that. This is a very common pattern. It's called an inverting connection where the output is some factor of the input voltage and the factor is given by R2 divided by R1. Let's go ahead and analyze this guy now. What is vOUT1 equal to? I should have called this vOUT1 because it relates to v1. vOUT1. There is a v plus here. From our first lecture I know that vOUT1 relates to v plus in the following way. I know that it is v plus times the sum of the resistances divided by R1. Based on the first lecture this is true. vOUT1 is simply an amplified version of v plus where the amplification factor is given by R1 plus R2 divided by R1. And I know v plus is simply a voltage divider action here. And I can take a simple voltage divider action here because the current going in is zero. Looking in here this is as if it's an infinite resistance, so it is as if the element simply does not exist. The voltage here is simply v1 divided by R1 plus R2 multiplied by R2, our voltage divider pattern. So, I get v1 times R2 divided by R1 plus R2 times R1 plus R2 divided by R1. These two cancel out which gives me vOUT1 is simply v1 R2 divided by R1. To get vOUT I add up the two. vOUT is vOUT1 plus vOUT2, which is my goal. And that is simply v1 R2 by R1 minus v2 R2 by R1. Thankfully what we have here is the same as here. Again, there is really nothing new that I am going to cover today. Simply apply, apply, apply, four simple principles. Here I have used superposition and I am showing you a circuit. So, it turns out with op amps you should really remember that pattern. You will see it again and again and again. And each time you see it, it will save you six minutes of having to solve the circuit without knowing the pattern. So, remember this pattern. You can pick up another three or four minutes by remembering this pattern here. This pattern is simply v2 R2 divided by R1. Imprint those two patterns into your brains. OK, so those are a couple of simple circuits using the op amp. We built a subtractor. The next step, let's go ahead and try to build an integrator. Using this little building block we can go ahead and try to build a bunch of circuits. We can build filters, A to D converters and so on. Let's build an integrator. Abstractly I need to build this box. Which when fed a vI, I want that box to integrate and give me a vO which is vI integrated over time. That is what I want to build. How do I go about building it? What I would like to do next is give you some flavor for design. How do you go about designing things with an op amp? Knowing that you do not know the pattern for this yet, how do you go about designing things? Well, let's start with the following intuition. The intuition that I begin with is that if I have a current i, and remember that capacitors and inductors related to, you saw differentiation and integration happening when we dealt with capacitors and inductors. So, I think we have to invoke a capacitor here or an inductor. In this example I invoke a capacitor. Notice that if I stick a capacitor in here this current is i, capacitance C, then my voltage vO is given by what? Voltage is simply the integral of the current flowing through it or vice versa i is C dv/dt. If i is C dv/dt then v is simply one by C integral. If I can pass the current through a capacitor then the voltage across the capacitor must be a current. Notice then that vO is related to i dt. I have some multiplying constants and so on, but fundamentally what I have found is if I can stick a current through a capacitor then the voltage across the capacitor relates to the integral of the current. OK, that's interesting. So, I have an integral in there. But I have a current. Notice my goal was to integrate a voltage. What I figured out how to do was if I can turn that voltage into a current -- If I can turn that voltage into a proportional current and then pump that current through a capacitor I will get the integration that I want. How do I convert my vI to i? How do I do that? Well, let's take a stab at it. Here is my vI. Let's take the resistor R. And remember I need to stick the capacitor here. I have some current I here. I don't know what the current is yet. And I stick a voltage here. And what I am trying to do is trying to see if I stick a voltage and a resistance in series then there is some relationship between the current and this voltage. Recall that I am trying to make this current be directly proportional to the voltage vI. But it turns out that i here is not equal to vI divided by R. If i was vI divided by R somehow, I am done. If i was vI divided by R, by some magic, then I have converted my voltage to a current, I feed that current through my capacitor and vO is my integral that I am looking for. But unfortunately i is not equal to vI divided by R. You know that. i relates to vI minus the capacitor voltage divided by R. So, i is not simply vI divided by R for all time but i is really vI minus the capacitor voltage divided by R. And, in fact, when we did RC circuits you wrote this equation to represent the dynamics of the circuit, RC dvO by dt plus vO equals vI. We wrote down this circuit for a first order RC, wrote this equation for a first order RC circuit. Now, it does turn out, to wrap up on this wild goose chase that we went on, it does turn out that if this term here is much bigger than that term. If this term is much bigger than that term then I can ignore that term and write down RC dvO by dt more or less equal to vI. If that were true, this would be true, and then vO would be more or less equal to one by RC integral of vI dt. Again, if this were true. If this were true for all time then vO would be integral of vI dt. Again, remember this is all a wild goose chase. Just write down WGC there just so you don't get confused. I am on this wild goose hunt here trying to find a way to get a current from a voltage which I can then feed into a capacitor. This was one thing I knew, but this was not what I want. But it does turn out to be what I want when vO is very, very small. So, I see some glimmer of hope but not quite. It turns that in R and C, if I make R and C very, very big, if I have a huge time constant, with a huge time constant the voltage vO looks like an integral of vI, but only when I have a very huge time constant. So, I give up on that track. Instead I try something else. Another try. I would like you to notice if you take your op amp, here is your op amp, if you take this op amp and you stick the positive terminal to ground, under reasonable feedback, under reasonable negative feedback what do you notice about the current? If I had a current i flowing here what did you notice? Look at this picture. I had a current i flowing in here, v2 divided by R1. And because this resistance was infinite all the current went through the upper terminal. So, this is zero volts. And by the v plus equals v minus method this is also more or less equal to zero. And I have a current i flowing in here, nothing goes here, so then the i must flow up there. So, all I am doing here is causing a reflection of the current from this grounded node. My current is being reflected into, or deflected if you feel like it, the upper edge here after coming in through this edge. That is interesting. We are just one step away from the key insight. I have an i coming in here, an i going out there. Notice that, as I said before, this is zero volts. How do I get my voltage vI to look like a current, to become proportional to a current? It is simple now. All I do is put a voltage vI and put a resistor R out there. If I do that, and since this is zero, the current i is given by vI divided by R. I have gotten to where I want to be. So, by using an op amp and using the fact that the minus node here, v minus is at the same potential as v plus when there is negative feedback then I can stick a resistor here. And because this is zero the current here is simply vI divided by R. I have gotten to the first place. Now all I need to do is simply pump this current through a capacitor and I get the integral of the, the voltage becomes an integral of the current. That is easy. I stick my capacitor here and I get my answer out there as vO. Notice that when I do this, let's say this is plus/minus VC. This is zero. So, vO is minus VC. Again, I will keep emphasizing it maybe 17 times throughout this course that if this is zero then the output here is related to the negative of this voltage, common, common, common mistake. I will be very upset after doing all this if I see this mistake happen in any of the future homeworks or finals or whatever. This should not happen. So, vO is a minus sign here VC. And I know that if I have a current i through a capacitor what is VC? If I have current i through a capacitor than this is simply t i dt. And i by design is -- So, I have my integrator. It is a two-step process. I stuck a resistor here, so the current became equal to vI divided by R. Then I took that current and pumped it through a capacitor through this terminal here, and the voltage across the capacitor for a current i is given by this expression. This is Capacitors 101. OK Capacitors 101 says that the voltage across the capacitor is simply one by C integral i dt. Another way of looking at it is the voltage across the capacitor is C, I'm sorry, the current through a capacitor is C dv/dt. This is simply the integral form of that equation. And I am done with my integrator. So, this is another very common building block. Remember this. Most of the circuits we will be seeing with op amps simply involve something here and some there. And the output in this inverting connection is the output times, if it is a resistance it is simply R2 divided by R1, if it's a capacitor I get the integral form looking like this. Yes. Can someone tell me where the negative sign went? The blackboard ate it up. Good catch. After all that lecture about watching the negative sign. After this little bit of faux pas here, now I will be doubly mad if you guys make that mistake. All right. Now that we have built the integrator, I could give this out as a homework problem. And you should be able to design a differentiator based on what you've learned here. You now have the tools to go and do some design like this, but we don't have any more homeworks left so I guess I will go ahead and solve this for you right here and do the design for you. The building block that we need looks like this, d/dt here. Let me take a vI and stick a vI in there. That's what I want to build. And what I built here is that different integrator box. And what I would like to do now is build a differentiator box. How do I go about doing it? I will go really slow here so you will have some time to think about it for yourselves and see if you folks are crack op amp circuit designers already, if you have the right instincts here. Again, when you see differentiation integration think capacitors or inductors, it doesn't matter. In fact, as a homework exercise, you may want to go back and see how you can get a similar effect using inductors. Can you play with inductors and get a similar effect? So, inductors are devices that are a dual of the capacitor. Whatever we will do with capacitors, there must be a corresponding way with inductors. You can try it out in your spare time. Let's go back to this one here. I will stick with the capacitor way of looking at things. I need a differentiation now. Remember this. If I have a vI and I stick this across a capacitor, I have a current C and some voltage vc across the capacitor, what does i relate to? i is simply C dv/dt and vc in this case is simply C dvI/dt. If I can stick a voltage across a capacitor, if my input voltage is stuck across a capacitor then the resulting current relates to dvI/dt. Here we have the opposite problem. By doing this simple trick, I can obtain a current that has the right form. Now what I need to do is somehow convert that current into a voltage because the abstraction that I need is a voltage to voltage. The next step, what I need to do is somehow convert a current to a voltage. How do I go about doing that? Again, remember for the op amp, if I have a current i flowing here then by the reflection property i gets pushed up into this edge, provided that the whole circuit is working with descent negative feedback. Given this trick what I can do is say look, suppose I did this. Remember, my goal here is how do I convert a current to a voltage? I have a current i coming in here, and I can turn that into a voltage because I know the current must come out here, I know this current must come out there. All I have to do is stick a resistor in there. If I stick a resistor in there what is vO equal to? vO is simply iR, right? That's right. vO, I get i here, so i pumps through here. Remember, what comes in here must get reflected up because the current going in here is zero. All the i must come out here. So, that i must pump through this resistor. The drop across this resistor is iR. That's the voltage drop across that resistor. And since this at a virtual ground the output here is simply zero minus this drop which is minus iR. So, I have gotten to where I want to be. I have my current i being converted to a voltage. I have taken my current, and I have been able to convert that into a voltage by sticking a resistor in here. As a final step, I simply need to produce the current. And that is pretty easy to do. Abstractly what I need to do, again, this is design here so we will talk about abstract stuff. If I had a voltage vI, I need to produce a current which relates to C dvI/dt. And I know I can do that by simply doing this. By doing this I know my i is C dvI, correct? If I can get this effect, I put this in quotes because that's my pattern. I am looking for a pattern, where a voltage vI is directly applied across a capacitor. And when that happens the current relates to C dv/dt. Let's go back to our op amp pattern here, op amp circuit. So far I have achieved -- I just repeated this out there. And so somehow I need to take this pattern here and learn from that pattern and apply the pattern here. So, what I can do is, this is a ground node, correct? Now, the poor little capacitor, what does it care, whether it's a ground node or a virtual ground node? As long as it's a zero volt node down here what does it care? What I am going to do is stick this point, not here but into a virtual ground node. I am going to grab that point, take it here and stick it here. The poor little capacitor doesn't know the difference. I have really suckered the little beast. This is vI. Remember this. My i through the capacitor is proportional to C dv/dt. Instead what I have done is taken this guy and stuck it here to get something like this. Just remember these four or five little tricks. And you apply them in op amp circuits again and again and again and again. So, this is vI, this is my virtual ground. As far as this poor little capacitor is concerned, it is chugging along merrily thinking that it is connected to ground. Little does it know it is only a virtual ground, all right? But the current i here is simply C dvI/dt. And that current, the C dvI/dt, that current flows through here and gives me vO as iR. So, vO is simply minus R. Let me substitute for i there, C dvI/dt. OK, so notice then that my vO is now proportional to dvI/dt. So, vO is some RC time constant times dvI/dt. Therefore, I have my differentiator circuit. Remember this as a closing thought. Remember this v plus more or less equal to v minus trick. And to the extent possible simply use that trick to analyze op amp circuits under feedback and not in saturation. Just remember these two. Very quickly for the demo, I have a square wave input here to the op amp, that's my vI to the integrator. And this is the output vO. The integral of a square wave is a triangular wave, as you can see. And we will do the same thing for a differentiator. And for the differentiator, I input the square wave to this differentiator circuit. And I get this, wherever there is a sharp rise, I get this huge negative spike and a positive spike because of the minus sign. So, this is the differentiator circuit. Then I feed this into the op amp. OK. Thank you. MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Please use the following citation format: Anant Agarwal, 6.002 Circuits and Electronics, Spring 2007 (Massachusetts Institute of Technology: MIT OpenCourseWare). http://ocw.mit.edu (accessed MM DD, YYYY). License: Creative Commons Attribution-Noncommercial-Share Alike. Note: Please use the actual date you accessed this material in your citation. For more information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Transcript – Lecture 21 All right. Good morning, all. You have two handouts, lecture notes and an article on mixed signal chips. A mixed signal stands for circuits that have both analog and digital components to them. The reason I am giving you the handout is that Lab 4 and also your last homework involve designing and building a mixed signal circuit. It's a real fun exercise. And I just wanted to tell you that from past experience people who have taken 6.002 often view the last lab as the single most fun thing they did in all of 6.002. So, as you go into Lab 4, you should be telling yourself I should be having fun, I should be having, I should be having fun. You have to positively psych yourself. Otherwise, it's going to go by. And then you're going to say boy, that was fun, I wish I had savored the moment as I was doing it. All right. Let's see. What do we do today? Today's lecture is actually going to be a fair amount of fun. We are going to blast through a bunch of fun things. And some things that you will be quite unprepared for. Until now, in the last two lectures with op amps we talked about negative feedback. That is applying some portion of the output voltage to the negative input so that I could control this high strung device, my op amp. Today, what we are going to do is try to get a handle on what happens if we use positive feedback. It's the usual curious child. You tell them to do this, and of course they're going to try to do this as well. And we are going to try to do that and see what happens and look to see if we can build some useful circuits. Today -- As motivation, let me do a quick review of a circuit that should now become affixed in your brains in a standard pattern. This is a circuit that gives you negative feedback. R1 and R2. And I apply a vIN. By now you should be able to look at this pattern. And this is your inverting amplifier pattern. So, you should be able to write down by inspection this is simply vIN or the minus vIN times R2 divided by R1. This is an amplifier whose gain is controlled by the ratio of R2 and R1. This is a negative feedback circuit because it is always fun to do the intuition thing and say that look, if this voltage tends to go more positive than I care then this negative input goes more positive than I care. If that goes more positive then the negative input v minus becomes more positive in the plus input which yanks the output down. So, there is a nice counteracting force that keeps the output stable. Let's look at this circuit. Being curious engineers, let's look at the opposite here where I give myself some positive feedback in this op amp. And it is going to be interesting to analyze this because what we find out on the face of it is not quite actually how it behaves. We are going to spend most of the lecture today on understanding the dynamics of circuits that look like this and to see if we can build some fun and interesting circuits and systems based on this kind of positive feedback. It is positive feedback because I am feeding back a portion of the output to the positive input. And you should be able to stare at this and already begin to intuit what should happen to this. Let's think about it. This is zero. Remember, with positive feedback, the famous v plus is equal to v minus method doesn't apply anymore. Let's apply very simple analyses. If this is zero, let's say for example that this output tends to go a little bit more positive. This output, due to some noise or perturbation, tends to go up a little bit. If that goes up a little bit then because of feedback this node tends to go up a little bit. If this node tends to go up a little bit this exacerbates the positive input here and this one goes cachunk, whacks into the positive rail. Let's take the other point of view and look at it intuitively. What if this one tries to droop a little bit? If it droops a little bit then the input at the plus terminal droops a little bit. If that tends to go down a little bit, that makes the output droop further and it goes and hits into the negative rail. I can see that this circuit wants to hammer into the positive rail or hammer into the negative rail because of the positive feedback. It is like if you give incredibly positive feedback all the time, and by positive feedback I mean feedback encouraging the child to do whatever the child is doing. It could be if he does bad stuff you give a lot of positive feedback or good stuff you give a lot of positive feedback then you are guaranteed to have a very good child or a very bad child. You are not going to have anybody in the middle. Same way here. By giving positive feedback you're going to drive this into the positive rail or drive this into the negative rail. Now, I am going to analyze this in two steps. First I am going to analyze this using a method you've seen before which is replace the op amp with its equivalent circuit and analyze it statically. And by analyzing it statically we are going to show that the simple static analysis will yield the following expression. I put this in quotes, well, for a reason you will see shortly. When I apply a plain and simple static analysis here is what I find. Let's go ahead with the analysis and see what is basically different about these two. And, first of all, I will confirm for you that our naive analysis we have seen so far will give rise to that expression. So, let's go ahead and analyze that circuit. And to analyze that circuit what I will do is replace the op amp with its equivalent circuit. If you remember the op amp is characterized by the following circuit, A times v+ minus v-, vOUT. This is the equivalent circuit of my op amp. And let me just impose that external circuit on this op amp. I have grounded my v- terminal. My v+ terminal goes through a resistor and a supply, the v into ground, it's the resistance R1. This terminal goes to the output through a resistor R2. So, this is the equivalent circuit. And I can apply the same good-old techniques I have learned about all through this course to this circuit and see what vOUT looks like. Very simply, vOUT is this expression here A times v+ minus v-. And because of my ground connection v- is zero. Then let me go ahead and replace v+ with the voltage that relates vOUT and vIN. What is v+? v+ is simply the current through this part of the circuit, the current flowing here times the resistance R1. That gives me the drop across R1. And to that I add vIN and that will give me V+. And then of course I multiply this by the gain here. So, let me write down that expression. The current through this is simply vOUT minus vIN. That is the voltage drop between these two points. I divide that by the resistance R1 plus R2. That gives me the current flowing through here. That times R1 is the drop across resistor R1. And to that I add vIN and that gives me the voltage v+. So, this is v+. That is simply vIN plus the drop across the resistance R1. Let me shuffle things around and put all the vOUT terms on this side here. I get a 1+ for that vOUT and let me move AR1 divided by R1 plus R2 to the left-hand side. And I pick up a minus sign. So, I get AR1 divide by R1 plus R2. I pick up that. And on the left-hand sign I end up with vIN, and my vIN here is a function of the vIN that I have here. I have an A multiplying both the vINs. And then I get a one for this vIN here and there is a minus sign, so I get a minus R1 divided by R1+R2. That is the expression that I have. Let me go ahead and simplify that a little further and move this whole thing down here. That gives me my expression as a function of vIN. What I will do is, let me continue here. vOUT=vIN A(1-R1/(R1+R2)). By the way, you may be wondering why I am going through so laboriously what is seemingly a very simple exercise. The reason I want to do is it I want to very carefully show you that the result produced by this exercise is exactly that. No magic here. No cheating. We are going to get exactly that. And then stare at it and say huh, how did that happen? And then we are going to try to figure out how it actually behaves following that. I divide this by 1-AR1/(R1+R2). And by now you should be familiar with the technique of ignoring small numbers when I have a big number next to it. So, AR1/(R1+R2) can be very much larger than one because A is very large. So, I can ignore my one there. And then what I am going to do is multiply the numerator and denominator by R1+R2. Oh, this A and this A is going to cancel out. This A and this A will then cancel out. And then I multiply the numerator and denominator by R1+R2, so this R1+R2 vanishes. I get R1+R2 here. R1+R2 minus R1 is simply R2. And then down here I get a R1 and then I have a minus sign out there. Notice that vOUT we have found to be equal to vIN R2 divided by R1. That is not wrong. That is correct. Technically that is correct. But you will see in a few seconds that in practice that that's rarely what you are going to see happen. And we will try to understand why that is so. What we have done so far, if you stare at these two panels here, first of all, we know that the inverting amplifier has the expression for vOUT up there. And through this laborious exercise we have also shown that even with positive feedback, if I take a static view of the circuit -- If I take a snapshot of the circuit and simply analyze it as a static circuit, I get the same expression vOUT. But what we are going to do is when I explain to you that look, a small perturbation in vOUT is going to drive the op amp to the positive and negative rail, that is where the insight begins to show. That if everything were magical and I could somehow exactly keep things just so that will be true. I will be able to build that positive feedback circuit where the output is equal to R2/R1 vIN. But remember even the slightly amount of perturbation is going to send the op amp scurrying off to the positive rail or the negative rail. How do we analyze that? How do we analyze the behavior of a circuit that based on a small perturbation begins to move one place or another? We want to analyze the dynamics of the op amp. And to analyze the dynamics what I need to do is give you a slightly more detailed view of the operational amplifier. If the operational amplifier is not moving instantaneously between the plus and minus rail, I need to give you a more detailed model that encapsulates the behavior of the op amp. And so let me do that. If you want to study the dynamics of an op amp -- By dynamics I mean how an op amp moves as I perturb the input or the output and so on. To capture the dynamics of the op amp we build a slightly more involved circuit, so v+ and v-. This is what we've seen before, two terminals and dependent source that amplifies the difference input here by a large amount. Instead what we are going to do here is something slightly different and interpose the following circuit in the middle here. This is a model of the dynamics of an op amp. We are going to impose a small RC circuit in here. This is R. This is C. And I am going to call the voltage across the capacitor v*. Notice what I have done is rather than say this is Av+ minus v- I am breaking it apart in two dependent sources, the first dependent source, which is simply v+ minus v-, and there is a RC time constant surrounding it and then here I simply add on my gain Av*. Notice that if it turned out that the resistance here, for example, was zero then v+ minus v- would appear across v* and this would be A(v+ - v-), what you have seen before. It is always good to take a look at circuits and look at what happens when some component goes to an extreme value. This would give you your basic op amp circuit. What I would like to do next is analyze the following circuit to understand how positive and negative feedback work together. And by understanding that then be able to explain how a positive feedback circuit works or a negative feedback circuit works. Here is what I will do. This part simply corresponds to my positive feedback circuit, R2, R1. So, that is my positive feedback circuit. And I will do the same thing on this side. All I am doing is applying both a positive feedback through R2 and R1 and negative feedback through R4 and R3 and representing the dynamics of the op amp and then standing back and ee, all right, let's see what happens to you. So, I am sticking positive feedback, negative feedback, the dynamics of the op amp here and let's see what happens. What I would like to do is impose this circuit on top of this op amp model. To save myself some effort, let me just go ahead and modify this circuit directly. I get an R2 here, an R1 here, and then up here I get an R4, R3 here. The math is going to be just a little bit grubby but the result is actually pretty spectacular. So, all I have done is replace the op amp with its internal circuit out here. And now we are going to take a look at what happens to op amp dynamics when there is a small perturbation. Let's develop an equation of this circuit containing a capacitor using techniques that we already know. Just to give you some insight into what you're going to see, notice that if I make a small perturbation in the voltage across the capacitor, let's say I make a small perturbation to the capacitor voltage let's say by applying some initial condition kind of thing onto the capacitor. Then let's say that the output changes to some value K. So, the change on the capacitor must have been K divided by A. And what you are going to see is what happens to the op amp when the initial condition on the capacitor is such that this output gets perturbed to the value K. Let's write an equation for this little circuit and see what happens. Recall our goal was to understand what happens when I perturbed the output a little bit. Here I perturbed the output such that its value goes to K. And I can perturb the output by changing what happens at the capacitor. Let me write the equation for this circuit now and then to understand what happens to this capacitor circuit if I let go after giving it a small perturbation. What I am going to do is let me start by writing the good old equation for this little circuit here. And that equation is simply the voltage here v+ minus v- equals the voltage across the RC. So, v+ minus v- will be equal to the voltage drop across the resistor plus that across the capacitor. The voltage across the capacitor is v*. The voltage across the resistor is the current through the capacitor C dv*/dt times R. So, v* plus RC dv/dt is equal to v+ minus v-. RC dv*/dt plus v* is v+ minus v-. You have done this millions of times before, but yet again. This voltage here is equal to the drop across these two, and the drop across these two is v*, the drop across C, plus the current through the capacitor C dv/dt times the resistance R. Or you can apply the node method as well and get the same expression. Now, we also know here that vO divided by A is v*. I can go ahead and replace this guy here, v* by vO divided by A. RC/A dvO/dt. Recall, I want the dynamics of vO so let me just get an expression in vO. So, I get vO divided by A plus v+ minus v- equals. Now, I want an expression in vO, an equation in vO, so I need to express v+ and v- in terms of vO. What are these expressions? The expression for v- is vO and this voltage divider, so it's vOR3/(R3+R4). And just for simplicity, let me call this some constant gamma minus. This is some fraction R3/(R3+R4). And let me call that fraction gamma minus. Similarly, v+ is vO R1/(R1+R2). And let me call that gamma plus. All I am doing is replacing v+ and v- in terms of vO. So, effectively, what I have here is v+ is some fraction of vO. That's the best intuitive way of thinking about it, some fraction of vO. And v- is some fraction of vO as well. And I just stick these. I now have an expression in vO. Don't get psyched by gamma plus and gamma minus. Simply read this as if it is an F1 and F2 if you would like. So, vO times some fraction minus vO times some other fraction. I am feeding back some fraction of the output to the positive and to the negative terminals. Then, just moving things around a little bit, dividing throughout by A divided by RC. So, I divided by A divided by RC. Plus vO divided by RC. And what I am going to do here in a second, vO gamma plus minus gamma minus. And I have multiplied by A divided by RC throughout. Finally, collecting all the vO terms I get vO times one divided by RC plus A divided by RC. I got a plus sign here so I will just reverse these two guys in there, gamma minus minus gamma plus equals zero. All I have done here is simply grunged through some math to express this equation in terms of vO. And just to make it even simpler, I will just replace this thing by one divided by T, much as we did for first order equations. What I end up with is dvO/dt+vO/T=0. Despite all the grubbiness, I end up with something that is very, very familiar to all of us. I went through a bunch of gyrations to substitute for v+, v- and v*, but at the end of the day I got the simple expression which was dvO/dt+vO/T=0. Where capital T is the time constant of the circuit, and the time constant of the circuit relates to the expression in there 1/RC+A/RC(gamma minus - gamma plus). The gamma minus and gamma plus are the respective portions of the output fed back to the negative input and the positive input. Now, as we all know, based on very simple intuition that we can completely predict the behavior of a first order of an RC circuit once we know what the initial condition of the capacitor is and once you know the time constant. That's it. We know, we are masters at the fact that the capacitor is going to behave like this. It is going to be exponential. And I do know that the time constant capital T. What's here? It is simply the initial condition. There is no drive input. I am not driving this with any input here. There is no input drive anywhere here. This is simply the natural dynamics of the system. And, recall, I start off with bumping the capacitor voltage such that the output starts off being K. That is it. You should be able to write down this expression and the form of the response simply based on this. So, this is what I bumped up the output to be by perturbing the capacitor voltage. My output response based on this equation is going to look like that. Let's try to understand what that means. It is actually quite a lot of fun. How do we plot that response? You all learned that the way to plot the response is plot the initial value, plot the final value, and go cachoock, right? It's pretty simple. I am going to start at K. I know that. I am going to start at K and I am going to go and find out what the steady state value is. Here is where the interesting stuff comes in. The final value on the capacitor depends a lot on whether T is positive or negative. In my RC circuits that I looked at what was T? In the very simple RC circuit we looked at what was capital T? What was the time constant? RC. This was RC. This was a positive quantity. When capital T is positive my output is going to look like this. When T is positive. And T is positive when this expression is positive. And if A is so large that I can ignore the 1/RC term, if A is very, very large and I can ignore the left-hand term here then T is positive when gamma minus is greater than gamma plus. So, when gamma minus is greater than gamma plus, I have a stable circuit, this is the good-old stuff we have seen before. Now things begin to make sense. Intuitively, what am I saying here? All the gammas and other pieces of crapola aside, what am I really saying here in English? What I am saying here is that if the portion of the output fed to the negative input is greater than that fed to the positive input then I have net negative feedback. I have net negative feedback. I am feeding the output back to both the positive and negative inputs. And if my negative input has a stronger effect then I am going to see the op amp output decay down to a value that I expect which is going to be zero. Notice that since I am not applying any input here, I expect the stable point for this to be output going to zero. I don't have any input there. Let's take a look at another situation. What happens when the opposite is true? What happens when gamma minus is less than gamma plus? When I feedback more, what happens when I do this, when gamma plus is greater than gamma minus? The opposite is true. This means that I am feeding back more to the positive input. A bigger proportion goes to the positive than the negative. What happens then? Then what happens is capital T becomes negative. We cannot see this happening on the RC circuit because capital T is equal to RC, but here we have a more complicated circuit and capital T can go negative. If capital T goes negative then this whole thing in the exponent there goes positive. If that goes positive what should the output look like? It should take off into never-never land. There we go. I start off at zero and a make a small perturbation, and the output should go as t divided by capital T. The dynamics of this it goes berserk, so it is net positive feedback. This is called a stable situation. This is unstable. What happens when capital T goes to infinity? When capital T goes to infinity, spend five seconds thinking about what it means physically. What does it mean for the time constant of an RC circuit to go to infinity? That means that your R and C are very, very, very large. That means that circuit is going to be very, very sluggish. Think elephant. A big time constant. I want to move a leg. It takes a while to do that. Think big. Big time constant. So, everything is going to happen really slowly. It's like moving in molasses. Big time constant. Everything is going to happen really, really slowly. If gamma minus is greater than gamma plus with a huge time constant it is going to look like this. And the output is going to look like this. I make T even larger. All right. It is going to like this. I make these so large that T tends to zero, T tends to infinity in which case I get this situation. The output goes dah. OK? Very slow. Very lethargic. Big time constant. T tends to infinity. And so if this is stable, this is unstable, this is called corresponding neutral. And there is a mechanical analog to all of this. You can show that this situation is akin to let's say I had a physical well of the sort and I had a ball in there. I let the ball go. Then the ball will come down here and settle down in a stable state. Any small perturbation of the ball will get it to come down and settle down here. The unstable situation is this situation where I have a ball sitting up here where any small perturbation will get it to zip down to a positive rail or to a negative rail. So, this is an unstable equilibrium situation. And exactly the reason we got this analysis in the static situation is that this can happen. If I do this circuit here and don't perturb it then I could get the output sitting at zero, but the slightest perturbation, boom, it is going to fall down or go up. What about the neutral equilibrium state? That can be modeled like a table top and the ball is here. It doesn't matter where you go. There you are. How many people saw the Buckaroo Bonzi thing? Possibly well before your time. OK. I have this table here. No matter what I do to it, it just goes and settles down where it is, and that is neutral equilibrium. But what this gives you is a fun view of the dynamics of the operational amplifier as I make small perturbations to it. And the even more interesting thing here is you have the tools based on your first order RC analysis to analyze the dynamics of a simple op amp circuit. OK, so much for theory. Now let's get to some action here. All right. Fine. That is really pretty, good and so on, but what can you do for me? What good does this property do for me? What can I build? What we will do is look at the op amp circuit and focus on the situation where I have net positive feedback. In particular just look at this circuit with R1 and R2 and send both to infinity. So, I have no negative feedback and I ground this terminal here and take a look at what happens to a circuit with positive feedback and see if I can build some interesting circuits. What you are going to do is build on a circuit called the basic comparator. What is that? If I have an op amp that looks like this, and remember a VS rail and minus VS supply there, this is v+, this is v-, I can build a very basic comparator by doing the following. All the circuits I am going to show you are going to build on this basic little circuit. What I am going to do is consider applying an input to the v- terminal, applying some sort of an input and taking a look at how the output behaves. So, I apply some input vIN. And if I just do that, if this is v+ minus v- here then I am going to get something that goes like this. That is when this is positive here then this guy is going to go to the VS rail and this guy is going to go to the minus VS rail. In terms of the, if I plot the same thing, in terms of vIN, and this is vOUT, if I plot the thing in terms of vIN then notice that as vIN increases this guy should go to a negative rail. So, in terms of vIN it looks like this. What this says is that as the input becomes more and more positive applied to v- then the output goes to minus VS, and if the input becomes more and more negative then the output goes to VS. This is what is called a very basic comparator circuit. It compares the two inputs and goes up if the input is in one direction and goes to the other rail if the input is in the opposite direction. So supposing I feed this- I can plot this is a function of time. Let's say I plot vIN. Let's say I feed some vIN here. Let me just call this. I feed some vIN to this circuit here, then what do you expect the output to look like, the output wave form? For all positive vINs the output is negative. So, my output vO is going to be negative as long as vIN is positive. And when vIN becomes negative this one shoots up and behaves like this. This is minus VS. That is plus VS. This is my input vIN. Then this guy is going to be my output. As vIN is positive output slams to the negative rail. When vIN becomes negative the output slams to the positive rail. So, that is quite nice. And so such a circuit is pretty useful to me. Let's say, for example, I want to build a little digital circuit that is fed ones and zeros. I can use a comparator to turn my vIN voltage into a sequence of ones and zeros. When vIN is positive I produce a zero and when vIN is negative I produce a one. I can get this one, zero, one, zero sequence coming out corresponding to the values of vIN being greater or less than zero. Now, one problem with something like this is that this circuit can be quite messy in the following situation. Suppose I superimpose a small amount of noise in vIN. In particular, let's say that I have some amount of noise on vIN. I get a bunch of noise sitting around here. What happens is that at this point where the value goes negative, I do bump up. But when for a second I have my input going above zero again -- -- this output comes down again and out here it goes up again. I get this nasty behavior at the point where the input is around zero. When the input is around zero, the input is meandering around zero because of noise, I get a huge amount of up and down glitches on the output. That's not very nice. And we will do a little circuit that attempts to fix that little problem. What we are going to do is use positive feedback. And I am going to build you a circuit that shows that we can eliminate this for small noise on the input. So, let's build the following circuit. So I still feed vi to the negative input, but this time around I give it some positive feedback. So, I give it some positive feedback. And what I am going to do is feedback a portion of vO to the positive input. This is positive feedback. And, in particular, let's assume that VS equals 12 volts. And to the negative one I connect -VS. This guy is going to go between 12 and -12. And correspondingly because these two are equal this one is going to go between 6 and -6. This is going to be a 12 or -12. Remember, the top rail and the bottom rail. And this one is going to be a +6 or -6. And let's understand how this circuit works when I apply an input vIN. Let's start by saying that assume my input is zero for a moment. And let's say my output starts off being 12 volts. The output is 12 volts then the input here is going to be 6 volts. In this case v+ is going to be 6 volts. The output is 12, v+ is going to be 6 volts. And my circuit is sitting out there doing nothing. Now, this started off being zero. Let's say vIN increases. As vIN begins to increase what happens? Well, nothing until vIN reaches 6 volts. Since this is 6, vIN has to go up to 6 volts, has to equal this voltage before I can flip the circuit. What happens when vIN is greater than 6 volts, if vIN goes above 6 then I have more voltage on a negative terminal than the positive so the op amp flips its state. And vO gets to -12 volts. When vi goes above 6, vO gets to 12 volts. And what does v+ go to? In this state v+ goes to half of -12 which is -6 volts. Now, this guy is sitting at -6 and this guy is sitting at -12. If this one keeps rising nothing happens, so output can stay at -12. So I am pretty safe. Then let's say v begins to come down. As v begins to come down, does anything happen when v gets to 6 again? If v is equal to 6 what happens? Nothing because this is at -6 now. So, there is still a huge net negative voltage here from v+ to v-. And so therefore I sit at -12. Oh, well, I keep coming down until I reach -6. When I reach -6 here these two become equal. And what happens when this becomes less than -6? v- becomes less than -6. If this one goes below this voltage, this is -6 and this is -7. There is a net positive voltage between v+ and v-, so this output swings to the positive rail like so. We will spend a lot more time on this in the next few minutes to really hammer the point home. What is interesting about this is that even though the moment vi became more than 6, I swung to the positive rail, and then I had to go all the way back down to -6 before I could change state. I had to go way down before it could flip again. How can we make use of that? Well, let me draw you a little vi versus vO diagram and then talk about how that can be useful to us. This is vi, this is vO, this is zero. Let's say this is 12, -12, -6, +6. Let's plot that on the screen and see what it looks like. As I told you, the output was at 12 volts to begin with and my input was at zero. So, my input kept increasing. When the input hit +6 what happened to my output? My output swung down to -12. As the input kept increasing nothing happened. This was step one, this was step two, step three. My input kept increasing and output stayed at -12 volts. Then what I said was well, let's bring the input down. So, my input began to go down, step four, became more and more negative. Nothing happened until I reached -6. When I reached -6 I swung positive, step five. Again, one, two, three, four, five. I am going up here. It came up here. And nothing happens until I reach -6, but at -6 boom, I switch to the positive rail. And as I get more and more negative I stay there. Then again, as I start increasing again, nothing happens until I reach +6. Think of that as your seventh step. What is spectacular about this is that I seem to have a circuit that now has some knowledge of where it came. If it is coming from here it switches at +6, but if it is coming from here it switches at -6. So, there seems to be sort of a lag in the behavior of the circuit or some memory property in the circuit. This kind of behavior is called hysteresis. The word comes from magnetic circuits where, or rather elements that you're trying to magnetize. Where if you take a magnet and move it over a piece of metal it may leave some residual magnetism in it. And, in the same way, that is called hysteresis. Same way here. As the voltage increases it seems to leave some residual in the circuit so that it effects when it shifts. The good news with this is that now, if I take the same kind of noisy wave form that I had before and do this -- If this is vi then what is going to happen is for vO I am going to be negative at this point. Nothing happens here because I have to get to -6 or +6 before something happens. Out here I get to -6 and I switch state and go up to +12. And then this one comes up above -6 very slightly out there. Nothing happens because the next change will happen only when the input goes to +6. So, if eventually the input gets to +6 and then I am going to change state again. It is actually a really cool property and something that is completely non-obvious. In the last 30 seconds let me show you a quick demo. And, based on this property of hysteresis, I have actually built a little circuit. Let me do that first. Notice here that I am showing you the input on the X axis vi and vO on the Y axis. Notice how the output switches at +6 volts and switches at a -6 volts to +12 or -12. That's the hysteresis property. And we can actually use this property to build a clock circuit, which is on page 9, build an oscillator that sits there and oscillates by itself. And you will see details of that in recitation tomorrow. MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Please use the following citation format: Anant Agarwal, 6.002 Circuits and Electronics, Spring 2007 (Massachusetts Institute of Technology: MIT OpenCourseWare). http://ocw.mit.edu (accessed MM DD, YYYY). License: Creative Commons Attribution-Noncommercial-Share Alike. Note: Please use the actual date you accessed this material in your citation. For more information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Transcript – Lecture 22 Good morning. OK. The topic for today is Energy and Power. Most of the time this semester, up to now at least, we focused a lot on speed. We have been truly speed freaks looking at how fast can we switch the signal, what does a time domain waveform look like? We also looked at frequency responses of circuits. This week we will spend on something a little bit different, and that relates to energy and power. Energy and power is gaining a lot more importance in certainly this decade, and will do so in the future. And I am going to work out a little example towards the end of the lecture. And there you will see that if you do things naively, your handheld devices, your cell phone, laptops and so on will just up and explode. You have got to be a little bit careful in terms of how to manage energy and power. Before I get into that, I just want to wrap up with a quick review of what we covered last week. We ended last week by looking at positive feedback in analog circuits using an op amp. And, in particular, we built an oscillator. We built an oscillator that allowed us to charge a capacitor. And when the voltage across the capacitor equaled that at the minus terminal it would flip and keep doing so. And at the output you would get a waveform that looked like this. You would get a square wave output. Now, throughout the course we have talked about getting square wave inputs. And this is one example of how you can actually produce a square wave pretty much from first principles using a capacitor, resistors and an op amp. Now, I just wanted to wrap up this little item here by talking about one application of an oscillator. And this application of the oscillator really nicely closed the loop on the body of knowledge relating to digital circuits that we have covered in this course. What I want to talk about briefly is a small digital system with a sender and a receiver. And the sender is sending a signal, the receiver receives a signal, and in this course we have talked about senders sending a sequence of ones and zeros. Say, for example, the sender wants to send some sort of a signal like this. We have seen that this is quite a legitimate signal. We get some kind of oscillatory behavior because of the inductance and capacitance associated with the wire. And what you have done is that you pretty much believed me when I said that this really corresponds to a one, one, zero. The sender wants to send a one, one, zero signal to the receiver, and the receiver gets it. So this is a one, this is a one, this is a zero. But if I am a receiver, I am going to look at the square wave. There is no such thing as sending a one on a wire. You cannot send a one on a wire. You send a voltage signal or a current signal on a wire. So, the receiver receives a voltage signal. It is going to be zero for some time and then maybe 5 volts or 3 volts or whatever is your high and then zero again. How does my receiver know it's a one, one, zero? Why can't it be a one, one, one, one, zero, zero, zero? It doesn't know. How does the receiver know it's a one, one, zero sequence and not 50 ones followed by 40 zeros? It doesn't know. What we need is -- For senders to be able to communicate with receivers, we need some kind of agreed upon time when receivers sample the signal coming in and decide whether it's a one or a zero. They both have to agree on certain time bases when to look at the input. One way to deal with this is I can have a clock, a square wave signal that we call a clock in digital systems and ship it to the other side in the following manner. This clock signal can be applied to this sender and to this receiver. For more details on this, let me recommend Page 735 of the course notes that talks about a detailed example of the use of a clock in a digital system. What I can do is create a clock that looks like the square wave. The clock provides a notion of time to the circuit. And I have some kind of a clock signal generator. And I connect that to the sender and connect that to the receiver. And now both the receiver and the sender have a notion of time. And what I can do is I can tell my receiver, the sender and the receiver can have an agreement between them that says that look at the signal at your input when on the rising edge of the clock. Whenever the clock rises, when you see a rising edge look at the value in the wire and that's the value I sent. By doing so, what I can do is that the receiver can look at the signal. At this rising edge it sees a zero, this is vOH, looks up here, sees a one here, sees a one here and sees a zero. So, it correctly sampled one, one, zero at the receiving end. And the sender can send the same sequence here once we have this time base. This little brief foray circuits was simply to give you an application of a circuit that can produce a square wave. I can create a clock with a time base. Also, interestingly much more fundamental is we looked at various abstractions throughout the course. We talked about discretizing space by looking at lumped signals. What I also want to point out is that a clock can be viewed as another fundamental abstraction in the digital domain where what I am doing is discretizing time. What I am saying is that, look, in the digital domain we have already discretized value into zeros and ones, but we still had continuous time until now. And what you do in digital systems is to say that look, let's digitize everything, or rather discretize everything. And let's discretize time as well into these points that happen on the rising edge of the clock which means that the circuit has meaning, signals have meaning only when the clock is rising. That tends to discretize time which means that I really don't care what happens to signals in this time, as long as on the rising edge of the clock I get the right value. This concept is called discretizing time. And a clock lets you do that. Remember that in digital systems, which you will learn about in 004 I am really discretizing two things, discretizing values into zeros and ones, and at the same time also discretizing time into a time when I sample things and a time when I ignore values on the wires. I think you will get to clocks in 6.004 after about a month, so initially you would just be focusing on the statics of the system without worrying about any dynamic clock introduced in the circuit. OK, that's just a brief little interlude. With that let me get into today's topic of energy and power. Why is this important? The reason this is important is that what really determines the size of your handheld? You may think oh, gee, electronics in the handheld. Some of you may think, oh, the antenna in the handheld. No. What really, really determines the size and weight of your handheld devices, your PDAs, your cell phones, your laptops and so on is by and large the battery. On Page 2 I have a little cartoon that shows you that if we did not have you learn about energy and power, that's what we would all be doing in order to use cell phones. Not surprisingly the very first wireless phones ended up in automobiles because you had a big battery. And so you had these wireless phones only in cars. Because of a huge amount of research based on the knowledge, the technologies I am going to talk about in today's lecture and Thursday's lecture, you will see very simple and elegant ways of reducing the amount of battery you need to be able to get some kind of function out of analog or digital devices. I also want you to take a look at Page 2 of the handout that I have given you here, handout 63. This handout talks about the absolute latest in digital fabrication technology out there. This is not a paid commercial for IBM. IBM has a technology called CU08. It is called Blue Logic. It is called the Copper 08 Process. And in this process, if you look down on Page 1, for example, IBM claims that it can build up to 72 million gates in a single chip. With this technology they are able to build 70 to 80 million gates where a gate is, unless otherwise mentioned, pretty much defined as a two input NAND gate equivalent. So, your inverter, your NAND gate and so on count as a gate. And they can build close to 80 million of these little suckers on a single chip. Just imagine that. And the biggest chip they can build is on the order of 18 to 19 millimeters on a side, roughly two centimeters on a side. On a chip that's about one square inch. You can put down 80 million gates. What is more important for today is what is on Page 2, actually. I have circled two things on Page 2. One thing that I have circled is power supply range in the 0.7 to 1.3 volts. Notice that that voltage, the power supply voltage for these chips is significantly lower than the 5 volts that we have been normally talking about in this course. When in doubt our problems have used 5 volts. But notice that in this technology they're talking about using voltages for the power supply VS in the range of 0.7 to 1.3. Why is it so much lower? Well, you will find out. The second thing I've circled is something called power dissipation. And you say power dissipation is said to be 0.006 microwatts per megahertz per gate. It says power dissipation is 6 nanowatts per megahertz per gate. What that says is that each gate off your circuit will dissipate this much power at a 1 megahertz frequency. And the implication of that is that you should be able to convert that single number to the power dissipation in any chip that you might build depending on the number of gates that you have, the frequency you run the circuit at, the voltage that you use and so on and so forth. By the end of today's lecture you will be able to take this number and correlate that into the power dissipation of any chip that you might want to build with this. That just serves as the motivation that by the end of this lecture you will understand how to very quickly in five seconds or less, boom, given a chip, oh, yeah, that should consume about 30 watts of power. And what you will also do, based on some examples here, estimate the power of not the Pentium IV but a chip following the Pentium VI, let's call it the Pentium V would consume if it ran at 1 gigahertz. We will come up with some absolutely shocking numbers based on what you have learned. With that kind of motivation let me get into talking about some theory and get into the foundations of energy and power. Let's go to Page 3. To drive the theoretical discussion, I would like to focus on the energy dissipated in a MOSFET gate. And fundamentally we will talk about looking at energy and power in circuits containing switches, resistors and capacitors. The MOSFET gate is simply an illustrative example to drive the theory. But fundamentally what I am going to show you, or lead you through today, I will tell you how to compute the power and energy when you have capacitors, resistors, voltage sources and switches in your circuit. We will look at a circuit that looks like this. Your vanilla inverter circuit. My inverter. I apply some vIN signal here. It could be a square wave. It could be some sequence of ones and zeros. And this is an inverter that we all know and love. And this guy here is, stuck in a capacitor here. And this capacitor is meant to model the input gate capacitance of whatever this inverter drives plus any capacitance of the wire leading up to that gate and so on. It is just a lumped capacitor that I have stuck on there. I am interested in determining a few things. One is what we call the standby power. You will see all these terms being used in cell phones and so on. In your cell phone, your cell phone manufacturer gives you two numbers. Of course both are over exaggerations, but they give you two numbers nonetheless. One number is the number of days that the cell phone battery will last when in standby mode, right? That's exactly where standby comes from. In standby mode, how much power does your cell phone or how long will the battery last, that's the standby power. And the second thing is what we call active use power. Active use is when you are making a phone call and so on, what is the power consumed? And there again your manufacturer of your cell phone will give you a much smaller number for the active use power of your cell phone. What I am going to do is assume for discussion that the inverter is driven by a square wave signal of the following sort. This is vIN. And I am going to drive this with a signal of this sort. The period applied at the input, so I am switching the inverter on and off, on and off, on and off. And T1 seconds for the high, T2 seconds for the low. This is the inverter, this is the input signal, and we'll keep coming back to that again and again. Rather than directly taking this circuit and analyzing its power, I would like to do things in a slightly roundabout manner. What I would like to do is show you some very simple circuits and analyze their standby and active powers. And then show you that this circuit simply is a combination of some of the simple things that you have seen. Example 1. I would like to take a simple circuit that looks like this. A voltage source V applied across a resistor R, some current I. And if I apply a voltage across this resistor, that voltage would simply appear across the resistor. And the power is simply given by VI which is simply V squared divided by R. This is 6.002 101 in the very first chapter. That is the power that is dissipated by this resistor, simply V squared divided by R. That's the power dissipated by the resistor. Where does that power come from? The voltage source supplies the power. So, this guy here supplies this power and this guy here dissipates it. What is the energy that I dissipate in T time? Remember, power is the rate of energy dissipation. And so energy is simply power multiplied by time. For a circuit like this, energy dissipated in time T is simply VIT. For our gate remember we have two situations. We have VS, we have RL we have RON, vO and vIN. So, vIN is high. If vIN is high with respect to ground then RON, the switch is on, and this is the circuit that I see. In this situation the power consumed is simply V squared divided by the resistance here. It is simply VS squared divided by RL plus RON. Let me mark that with an asterisk. I will refer to this later. Similarly, when vIN is low the MOSFET is off. And the power is simply zero. I have no current flowing down and the power is zero. Absolutely basic stuff. Absolutely basic. So, the power, when I have the MOSFET on, for the kind of inverters you have seen so far, this is the power consumed by the inverter. And this asterisk here is simply to say hold that thought, we will get back to it a little later. Let me work out a second example. In this second example, I would like to consider the following circuit, a voltage source VS with a strange arrangement of switches, S1 with a resistance R1, a capacitor C in this manner, a switch S2 and a resistor R2. For now don't worry about how the circuit comes about. Just assume that I have drawn the circuit for you. And what I want to do is compute the power under certain conditions. Notice that if this is off and this is off, there is no current flowing either in this loop or this loop, and the power dissipated by the circuit is zero. But there are some arrangement of switches for which I do consume power. And so let me show you that arrangement of switches. And what I am going to do is assume that the switches open and close with the following periodic cycles. Let's assume that when this is high S1 is closed and S2 is open, and when this is low assume that S1 is open, S2 is closed. And let's assume this is T, this is T1, this is T2. That sequence should be reminiscent of this input that I am feeding to this inverter. All I am telling you here is that I am giving you the circuit. I want to compute the power consumption of the circuit. And what I am telling you is that with the frequency, with a time period of capital T, for the first T1 seconds this switch is closed and that is open. So, this circuit applies. In the second half of the clock this switch is open so this circuit applies. And what I am interested in finding out is what is the energy dissipated in each cycle of time capital T? And I also want to find out the average power. Just spend about five seconds just staring at this and kind of intuit what is going on here. I start by putting a voltage source here and I close the switch. That is open. Start by closing this, what happens? When I close the switch VS is going to charge up this capacitor. I get current flowing through my resistor, so I am going to be charging up this capacitor here. Then let's say I allow T1 to be as large as possible, and so this capacitor is going to be charged up to all of VS. After a long time this guy gets to be VS in the capacitor. And as it is charging up I have current flow through the resistor, so it is sitting there dissipating power. Notice that this sucker does not dissipate energy. It simply stores energy. So, the energy supplied by the voltage source comes in, some of it gets stored in the capacitor and some of it is being dissipated by the resistor. That gets me to the end of T1. At the end of T2 I open the switch and close this switch. When I close the switch I have some energy on the capacitor, and the voltage across the capacitor begins to drive a current through this resistor R2. And now the capacitor supplies its stored energy, and its stored energy then begins to dissipate through resistor R2. And if T2 is very long then all the charge in the capacitor drains out. And the voltage in the capacitor at the end will be zero. So, that is just sort of a high level description of what goes on. Now let's go ahead and compute from first principles the energetics of this little circuit. Let's look at the entire period capital T, and as a first step look at T1. When T1 is in place S1 is closed and S2 is open. Accordingly, the circuit that applies looks like this. I have VS, S1 is closed, so that is closed, and I have this resistance R1, I have this capacitance C, some voltage VC across the capacitor. You can go ahead and assume that VC of zero is zero. That I start off my life with no voltage across the capacitor. First of all, let me plot the waveforms and write the expressions down and then compute the energy supplied by the voltage source and then look at where the energy goes. You all know, or should know by now, if I plot VC as a function of time, remember, this is really easy to do. VC as a function of time goes like this. At time T equal to zero I am telling you that the capacitor voltage is zero. I am telling you that. So, it is at zero. And then the capacitor charges up until it reaches VS. I also know that after a long time this will be VS, after a long time that will be VS, and between those two I have a rising function that looks like this. I can similarly plot the current for you. At time T equal to zero instantaneously the capacitor looks like a short, and so the current that I start off with is going to be VS divided by R1. The voltage across the capacitor is zero. All the voltage falls across the resistor R1. So, VS divided by R1 is the initial instantaneous current. And after a long time, because VC reaches VS, the current is going to be zero. And between those two points I get an exponential decay. I could very quickly write down the expression for the current. And that is simply the initial value VS divided by R1 times the exponential decay minus T divided by the time constant for the circuit R1C. You have seen this stuff before. Here comes the part that we care about for now. Let's find out what is the total energy provided by the source. When dealing with energy computations you have to be incredibly careful of these words here, supply, provided versus dissipated. Dissipated implies that the resistor is burning energy. Provided means that the source is supplying that energy. So, energy provided by source during T1. Let's go ahead and compute that very quickly. The energy supplied by the source is simply the voltage across the source multiplied by the current being supplied by the source. This is i. Remember, by associated variables convention, if I have a voltage across some element and the current into the element is positive then that element dissipates power. If the voltage here is, say, 1 volt and it is supplying current, if the i is out in the other direction then it is supplying power. In this case, the current i is going to be on the outside, heading outside. The total energy is going to be the instantaneous power integrated over time, and that is simply VS. Remember, the instantaneous power is VS times the current i, so the instantaneous power is simply VS times i, that is the instantaneous power. To get the energy provided by source and some time, I have to integrate that instantaneous power over the period of interest T1. That gives me the energy supplied by the source during T1. And let me go ahead and substitute for i with this expression here. It is VS times i, and i is VS divided by R1 times this expression here. That gives me (VS^2/R1)e^(–t/R1C) dt. Let me carry out the integration there. I get -1/RC, so I get this outside. And I also get to write down, oops, let me do that a little bit more carefully. VS^2/R1 simply comes out and I get a -R1C in the numerator. If I differentiate it then I get R1C in the denominator. I have an integral that comes up here. And then I write down e^-t/R1C, zero and T1. So, this R1 and this R1 cancel out. And I end up getting something that looks like this. I get CVS^2. And so there is a minus sign out here, so at zero this thing goes to a one, so I get a one. And because of minus sign I get e to the -T1/R1C. All I have done here is simply go through the math to do this integration here. What I am also going to do is assume that if T1, if the time that the switch is closed is much, much bigger than the time constant of the circuit, T1 is much, much greater than R1C, if this is much, much greater than R1C then this term goes to zero. And this becomes more or less equal to CVS^2. What do we have here? What we have here is that if I let the switch stay closed for a long time and S to be open then the voltage source is going to supply some amount of energy. That energy will equal CVS^2. The voltage across the capacitor will be VS and all that energy would have been supplied by this guy. Let me pose the following conundrum here. If the voltage across the capacitor is VS, because we know the energy stored in the capacitor is half CV^2. So, the energy in the capacitor is half CVS^2. At the end of the day, since the voltage across the capacitor is VS, ½CV@2 is the energy stored here. But we know, from this calculation, the source has supplied CVS^2. Source has supplied twice that energy. This guy has supplied twice that energy and only half of that is stored here. Who ate up the other half? The resistor, exactly. The resistor has walloped half the energy. Let me just show it to you. It dissipated ½CVS^2. It's pretty interesting. It's a pretty simple result. If T1 is very large compared to time constant then half the energy is in the capacitor and half of it has been burned by R1. This energy has not been burned. It is simply stored. It is stored by the capacitor. And if you do simple energy conservation arithmetic here, the energy dissipated in the resistor plus that stored in the capacitor equals the energy supplied by the source. All right. Let's go to T2 now. At T2, S2 is closed and S1 is open. Let's look at the second part of the cycle when S1 is open and S2 is closed. And what is going to happen now is the left-hand part of the circuit can be ignored and I can focus on this part. So, S2 is closed. This is RC, my capacitor, this is vC. This is the circuit of interest. What is the initial condition on this? What is the value of vC initially? Start off, because remember, I allowed this capacity to charge up fully, and so initially I have VS on the capacitor. And so the energy on the capacitor initially is ½CVS^2. That is the energy on the capacitor. This time around I won't go through an integration process like that, but you can if you like, and do it in a much similar manner to say that now let's suppose that T2 is much greater than this time constant. If T2 is much greater than R2C, this time constant. If that time is much greater than this entire, the initial voltage VS drives a current through the resistor, and after some amount of time the voltage across the capacitor goes to zero and all the energy in the capacitor gets dissipated in R. So, if T2 is much greater than R2C then energy dissipated in R2 is simply ½CVS^2. Notice that the energy dissipated in R1, in the first half cycle is ½CVS^2 and the second half cycle during T2, if T2 is large enough, all this energy gets dissipated in this resistor R2. And I have that expression here. So let me just say that this is E1 and let me say that this is E2. So, E1 is dissipated in the resistor and E2 is dissipated in R2 in the second half cycle. A couple of interesting things to note at this point. One is that E1 and E2 are independent of R. If the time constant is small enough compared to the time that I charge the capacitor then half the energy gets lots in the resistor, and that is simply ½CVS^2. And if I let this discharge completely it doesn't matter what resistor I am discharging it through. That's the intuition. If I have certain energy here and I let it discharge completely it doesn't matter what this resistor is. Small or large, it doesn't matter. All this energy gets dissipated there. The rate at which the energy gets dissipated will change depending on R2. If R2 is very small then I get a burst of power initially and then a rapid decay after that, but if R2 is very large then I have a much slower release of energy. But suffice it to say that the energy dissipated, the total energy in T2 is simply ½CVS^2. All right. Let's put T1 and T2 together and look at the total energy dissipated -- Total energy dissipated. E is simply E1 plus E2. Dissipated in each cycle. Assuming T1 and T2 are much larger than the respective time constants. And I know that this is ½CVS^2, ½CVS^2, so this is simply CVS^2. If I have an arrangement of switches and capacitors like that, I charge the capacitor, discharge the capacitor, charge the capacitor, discharge the capacitor. What it is saying is that in a charge/discharge cycle I am using up CVS^2 of energy. ½CVS^2 when I charge it up and ½CVS^2 when I discharge it. That is what I get. Let's compute the average power dissipated, P average in a cycle is simply E/T where T is the period of the square wave sequence that I have shown you out there. This is simply CVS^2 divided by T. If the period of the square wave is capital T, I can express that as a frequency. Let's say for example the period of the square wave is T, so let's say the frequency of the square wave is simply 1/T. I can also express this as C(VS^2)f. What does this say? Let me mark that as a thing to remember, the second thing to remember. One was the power that was the static power. And second is this power relating to this frequency f and the charging and discharging of the capacitor in that little circuit shown up there. So, this average power is CVS^2f. What this is saying is that if f is high, if I have high frequency of charging and discharging the capacitor then I am charging and discharging much more frequently so I am going to consume more power. Notice that at any given time there is no direct connection between the power supply and the ground. What I am doing is my capacitor is an intermediary. I am dumping some charge in the capacitor and the capacitor is dumping the charge into ground. It behaves like a switch to capacitor. And what it is doing is it is being charged and discharged at frequency f. So, it makes sense that the amount of average current that I am pumping through relates to the frequency at which I am charging and discharging the capacitor. And similarly the average power also relates to the value of the capacitor. If C is larger I dissipate more energy. And the same way with the voltage. If the voltage is higher then the power in that period, or the average power relates to CVS^2. Spend a few seconds staring at the two expressions. This power here relating to just this connection between the power supply and ground and that power out there relating to charging and discharging capacitors. Let's get back to our inverter right now. This is our inverter circuit. Let us say that I drive the input with the waveform shown here. Well, I go back to the same situation as here. I drive the input with a square wave, with T1 and T2 as the high time and the low time. The equivalent circuit for this is not exactly what we saw there. The equivalent circuit for this would look like this. I have a VS. And the VS supply is connected through RL, VS connected through RL to a capacitor C. This is my voltage vO. So, VS is always connected to ground through this resistor and capacitor in this manner. And then I have a resistor here RON corresponding to that MOSFET. And there I am switching it on and off in a way that it is on during T1 and off during T2. So, the situation here is a bit different from that simple situation I computed there. Much like I computed the power dissipation in that circuit, I can go ahead and compute the total power dissipated in this circuit. I won't do it here. The algebra tends to be a big more grubbier than what I have been through. And suffice it to say that you can show that the average power is given by (VS^2)/(2(RL+RON))+(CVS^2)f (RL^2)/(RL+RON)^2. OK? And for details I suggest that you look at section 12.3 of the course notes. Section 12.3 goes through the algebra to compute the total power dissipated by this specific circuit, and here is the expression we get. And let's take the specific situation where RL is much greater than RON. If RL is much greater than RON then I can ignore this RON here. And I get this. And out here, if I ignore RON, then RL and RL will cancel out and I get CVS^2f. If I ignore RON compared to RL this is the expression I get. Now you can see why I went through those two examples. This is exactly the power consumed by the connection between power supply and ground. And this CVS^2f is the power consumed in charging and discharging the capacitor. If you look at the circuit here it is consuming two kinds of power. One kind of power is due to the current flowing directly from VS through RL and RON to ground. Oh, this also assumes, by the way, that T1 is equal to T2. So, in this circuit there are two kinds of power. One is the power when the switch is on and I have a current flowing from VS to RL to ground. Notice I get an extra factor of two in the denominator here. And that two comes about because the connection to ground only happens half the time. It's half that power out there because I am connected to ground only when the switch is on. And that happens only half the time, and so therefore I get the VS^2/2RL. And then CVS^2f is simply the power that I consumed because I am charging and discharging the capacitor C. Notice that in this inverter circuit there are two kinds of power. One is called the standby power which is static power being consumed by the circuit, and the second power is the dynamic power because the circuit is switching up and down. This relates to star and this relates to the double star. And to demonstrate that, I have a little demonstration here that has an inverter. And I am going to up the frequency of the square way of driving the inverter. I am going to show you a few numbers so hang on for two minutes after this demo. I will give you some numbers, but I want you to go ahead and compute the numbers based on what we have seen here. And you will get suitably impressed, I promise you. This is the input fed to the inverter. This is the output of the inverter. Notice that the output of the inverter reflects some sort of an RC time constant because of the output driving the capacitor, and the same way here. I start off by showing you that on the left-hand side I am simply measuring the power being consumed by the circuit. Notice that the power being consumed is expressed by the needle being at this point here. This is a very low frequency so this is almost all standby power consumed by the inverter. The inverter is on half the time, and when it is on it is consuming power. What I am going to now is increase the frequency. As I increase the frequency driving the inverter what should happen to this needle? As I increase the frequency there that waveform should become closer and closer together. And what should happen to the needle? That should begin to go up. If I increase the frequency it should consume more and more power and the needle should start going up. So, let me do that for you. In terms of numbers there it is on top of the four on the scale in the middle. I am going to increase the frequency very slowly. Unfortunately, the sampling scope messes up the waveform. Ignore the waveform for now. Just look at the meter as I increase the frequency. Notice that I have increased the frequency by about a factor of 2 or 3. And notice here that this meter has moved. The needle has moved to the right. And I can keep doing that and the needle keeps moving to the right as I am consuming more and more power because I'm driving the inverter faster and faster and faster. That should convince you that there is a standby power and there is some power component related to frequency. This relates to your standby power in your cell phone. This relates to active use. Let me show you some numbers, and you can plug those numbers in yourself and see how much power this converter is going to consume and see if it makes sense. Assume that I have a chip with 10^8 gates. F is 1 gigahertz. That is 10^9. Assume C is 0.1 femtofarads which is 10^-16 farads. Assume VS is 5 volts. Assume RL is 10 kilo ohms. Use these numbers. Plug these numbers in here and get a sense if our modern-day circuitry used that inverter, what would be the power consumed by a chip that contains 10^8 of these gates? You will find out that you may have to use a nuclear power reactor to actually drive that chip, but go check it out for yourselves. In the next lecture we will see then how do our cell phones work, how does life go on despite this horrendous calculation here. MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Please use the following citation format: Anant Agarwal, 6.002 Circuits and Electronics, Spring 2007 (Massachusetts Institute of Technology: MIT OpenCourseWare). http://ocw.mit.edu (accessed MM DD, YYYY). License: Creative Commons Attribution-Noncommercial-Share Alike. Note: Please use the actual date you accessed this material in your citation. For more information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Transcript – Lecture 23 All right, let's get moving. Good morning. Let me take a quick poll. So, how many of you have completed Lab 4. Completed Lab 4? Wow, that's great. So, how many people have begun Lab 4? OK, well that's good. I won't ask the last question. OK so, well I hope you're having fun with this lab. Lab 4 was designed to be almost like a mini-project. And, it sort of ties together a lot of the content of the entire course. And, it's not unlike the kind of systems that people design in industry, in systems that go into a variety of devices like, say, for example, digital CD players and stuff like that. A lot of mixed signal stuff goes in. OK, so today, I'm going to continue with our discussion of energy and CMOS. CMOS will be a new topic that I will introduce. So, the last lecture, we spent a fair bit of time talking about energy, and how to compute the energy of our inverter. So, let me start from where I left off, and I've given you a couple of extra pages of notes today just to sort of tie it to the previous lecture. Right now, I'm going to start off on page three. So, what we saw last time was an inverter of this sort, Vs, VIN, and we said, let's study the situation where this inverter was driving a load capacitor, C. Where did this load capacitor come from? Well, this inverter could be driving one, or two, or three, or four other larger gates, OK? So, this C is lumped value of the gate capacitances of all of those inverters. This may also include some component due to wiring capacitance and stuff like that. So, for an inverter like this, we showed in the last lecture that the formula for the average power was, so this was a static power independent of frequency, and this was called dynamic power, and it had some bearing, it's related to the frequency at which you clocked your circuit. So, this was related to standby power, and this to dynamic. So, what I also said is that I gave you a bunch of numbers so you could compute the power consumption of a chip that included 10^8 gates, 100 million gates, and at a frequency of 1 GHz, and a bunch of other numbers. C was given to be 0.1 femtofarads. Femto is 10^-15. So, F was 10^9. VS was 5V, and for these numbers, if you plonk them down in something like this, for 10^8 gates on a chip, the average power would be 10^8 times these two. So, this would be five squared, which is 25, divided by twice. RL was given to be 10 kilo-ohms, so, twice, 10^4. And here we had CVS^2. So, C was 10^-16, 0.1 femtofarads. Vs^2 was 25, and F was 10^9. So, if you commence through the numbers here, what you end up getting is something that looks like this, 10^8 times this guy here. This is 1.25mW plus this guy ends up being 2.5 microwatts. So, this should come as a bit of a shocker. If I take 1.25mW, and multiply that out by 10^8, this says that each gate suffers a standby power loss of 1.25mW. So times 10^8, I get 125kW, and this guy yields 250W. OK, the 250W is manageable. It's still high, and just so you don't think that this is unreasonable, when the Pentium 4 first came out, it was consuming 170W of power. OK, you should see the heat sinks on there. There's actually a huge heat sink with a fan built into the top of the heat sink. OK, today it's down to more reasonable numbers like 100W and so on, but when it came out it was in this range. So it's high but not unreasonable. But this, of course, is totally wacko. OK, imagine carrying a laptop around, and the sucker is blowing 125kW. That'll be fun. So, clearly there's something wrong here. What this is saying is that this gate here consumes 125kW, there are 10^8 of these on a single chip. OK, so we clearly have to do something about this, otherwise the semiconductor industry would fail. So, anybody have any ideas? What do you think you might do here? What do you think you might do to this inverter to make this look better, to bring it down? What can I do? Anybody? Any ideas? What do you think? Well, the problem is that if I look at this 125kW, well, there's a VS term here and an RL term here. So, I can increase RL. OK, I can make RL four times or eight times as large. That'll bring the power down somewhat. Can anybody think of any problem with increasing RL? If I make RL really, really large, will I run into other problems? Yes? Exactly, the slowdown of the inverter. Remember, the rise time of the inverter depends on how quickly I can charge this capacitor through RL. So, if I make my RL really large, I will consume less standby power from hundreds of kilowatts to merely tens of kilowatts. But my gates will run as slow as molasses. So, clearly that's not a tradeoff I would like to make. So, I can reduce my voltage to maybe a volt. But that just reduces it by a factor of 25, VS squared. So clearly, this is not going to work. I have to somehow do something else, and that will be the topic of today's lecture. Also, I will dwell for a moment on this term. So, if you look at the spec sheet for the IBM's ASIC processor that we handed out, if you recall, we talked about power dissipation of 0.006 microwatts per MHz per gate. OK, now you see where this is coming from. Per MHz, that's because it's a multiple of f, the power. Second is that it's per gate, so this is the power per gate. So, as I have more gates, I just have that much more power dissipation. It also says power supply voltage in the range of 0.7 to 1.3 right next to the power expression. So, you can see why they tell you all of that, because both voltage, and the frequency, and the number of gates come into the power of equation. OK, this really simple expression here, it's amazing how close this is to what people use for the dynamic power in chips. OK, so as the next step, what I'd like to do is, this guy, what do we do about that? OK, so we've taught you to build gates in a particular matter, but it's a non-starter. So, how do we get rid of static power? How do we get rid of static power? OK, to do so, let's build up a little bit of intuition. OK, so the intuition goes as follows. So let's say I take my inverter. Let me draw the circuit both on the on state and in the off state. So, when VIN is high, when VIN is high, I get the MOSFET turning on and has a resistance, RON, and Vo is the output voltage. Similarly, when VIN is low, so when VIN was high, Vo was low because RON is much less than RL. So, this voltage was low, while here, when VIN is low, the MOSFET is off, and so I have an open circuit out here. And because of that open circuit, the voltage here was going to be high because VS would simply appear there. So let's tailor this and see if we can build up some intuition as to what to do. So, when VIN is low, I don't have any static power being dissipated because I don't have a connection from VS to ground. OK, the current, i, is zero. And, VS simply appears at the output. The reason this is so is have a switch here. So when this is low, the switch opens up and cuts the path from power to ground. This is a nice situation. Here, when VIN was high, there was no switch that turns off. Rather, I get a connection from VS to ground. OK, so think about this situation here. The insight here is, just imagine if I could do the following. Imagine if I could somehow magically elevate RL to be a very, very, very large number, if I could make this so high as to make the power really low only in the situation when the input was high, OK? So, imagine if I could do something like this. Imagine I could open circuit this guy, RON, so when VIN was high, if I could, instead of having an RL here, what if somehow I could make this RL become infinity? OK, so in this case, output VO would be low. OK, I get many benefits by doing this. One benefit is that, look, I have opened this switch here so I don't have any standby current. OK, the standby current is zero. The second benefit is that my output gets dragged down to ground, OK? Out here, my output was VS multiplied by RON divided by the sum of these two. Out here, I have a direct connection to ground, and nothing to the power supply, VS, and so therefore I have a nice, solid low. So the question is that, can I get this situation? OK, that is a key insight. So, imagine that somehow, when this was high, I could get this to open up, much like when this was low, I got this to open up. OK, so think about it. So, the intuition is that what I need instead of a resistor here, what if I have something like the MOSFET that I have here? So, I have a MOSFET here that turned off when VIN was low. OK, what if I did the complementary thing? What if I put in some kind of MOSFET here that would turn off when VIN was high? OK, so, much like the MOSFET turned off when VIN was low down here, imagine if I could find a device that could turn off when VIN was high? OK, this would be on, but this would be off. So the behavior of this device would have to be complementary to this device. So, we need some sort of a switch to introduce this new, little MOSFET device with slightly different properties, let me quickly review for you the properties of the MOSFET that we know about, so our N channel MOSFET, also called the NFET, this is what we've been seeing all this while, is drawn like this. I have a gate; I have a drain; I have a source. And this guy is on when VGS is greater than or equal to VT, OK, and off when VGS is less than VT. You saw this before, OK, nothing new here. So, what I need is a device that behaves in a complementary manner. OK, so the device is a P channel MOSFET. By the way, I must point out, till about 1983-84 until the early '80s, that's exactly pretty much how chips were designed, OK, using an NFET for the switch looking down here, and a variety of different kinds of devices to be used as resistors. OK, that's when technology began moving towards this new kind of technology I'm going to talk about, and that dramatically reducing the power consumed. And, the P channel MOSFET was created, and this guy's called the PFET. It's a complementary device that looks as follows. OK, the difference here is that, to show this is complementary, I'll put a little circle here. It has a gate. Just to make things a little clearer, flip the drain and source terminals, and this guy is on at a distinguished threshold voltage of this with the NFET device, let me put an N here to say that this is the VT for the N channel device. And for this guy, this guy came on when VGS was greater than some voltage. So, VTN could be, for example, one volt. So, VGS was more than one. This turned on. In this case, I wanted this to turn on when VGS is some value which is lower than, or much lower than, the source voltage. OK, so this guy turns on when the gate voltage is higher. This guy should turn on when the gate voltage is significantly lower than the source voltage, just the complementary behavior. OK, so when VGS is less than or equal to VTP. And in this case, the threshold voltage for the PMOS device, say, just as an example, maybe -1V. So this means that if the source is at, say, 5V, OK, then this device would turn on if the gate, for example, using that example was less than 4V. So, this is five. If the gate fell below 4V, this guy would turn on. In this situation, remember, if this was at zero, the gate would have to be greater than 1V to turn on. In this situation, the gate has to be less than 4V if the source was at five to turn on. And, it's off. OK, so this is a complementary device that I postulate that behaves in a complementary manner. So, the gate voltage rises, this guy turns on, and in this situation, when the gate voltage drops below the source voltage, this guy turns on. OK, so when there's a rising guy that turns on in this particular situation when it falls, the gate turns on and shows some resistance. In this case, the resistance would be RON. And to show that it's N channel, let me say N. And in this case, the resistance, when it turns on, would be RONp to represent P channel. OK, so now consider the following circuit for the inverter. So, instead of my resistor, I put a complementary device, OK, and that's it. So all I've done here is replace my resistor with a MOSFET that behaves complementary to the N channel MOSFET. So this is my gate, my drain. This is my source, my gate, my source, and my drain. OK, and this guy is called a pull up, and this guy is called a pull down. OK, and the reason is that this guy pulls the output to ground when it's turned on, while this guy, when switched on, will pull this node up to VS. So, I pull it down or pull it up based on when the VIN is high or low. So, let's look at the two situations. So, let's say, as an example, my VS is 5V, and let's say VIN in one situation being 5V, and another situation being equal to 0V. Let's draw the equivalent circuit in both these cases. So, when VIN is high, I have my usual circuit. When VIN is high, this MOSFET, as before, when VIN is 5V, the N channel MOSFET below is turned on, and so I have an RON resistance here. But remember, VIN is 5, and VS is 5V, then the voltage across the source and the gate of this P channel FET is now equal, five and five. OK, so this one would turn off. And that's the circuit that I get. The output is suitably low. In this situation, if VIN is zero, what happens in this situation? Here's my output. If VIN is 0V, the lower device turns off. This is zero. This is zero. This guy turns off, and that's the situation for the N channel MOSFET. How about this guy here? What happens here? This is at 5. So let me just, this is at 5V. OK, and VIN is at 0V. OK, so therefore, the GS of this is -5V. If this is zero and this is five, G, source, and drain, GS is -5V, and -5V is significantly less than the threshold -1V in our example. So, this one will switch on. And if this one switches on, what I end up getting is RONp out there. So, when this one kicks in, it pulls the output high and VO goes high. So, all I've done is replaced my resistor with a complementary device, which switches off when the input is high, and switches on when the input is low. And the beauty of this is that at no point, assuming all the devices are ideal here, at no point do I have a short circuit between the output, do I have a current path from the output to the ground from the supply to ground, OK, I have this turned off or this turned off. So, this type of logic involving a PMOS transistor here, and the N channel transistor here is called CMOS logic for, OK, it's called complementary MOS logic. That's what CMOS comes from. OK, so I'm sure you've read in a number of places that most digital chips today use CMOS technology. It comes from complementary MOS, and complementary comes from the use of complementary transistors: N channel, P channel, turns on when high, turns off when high, turns off when low, turns on when low. OK, that's exactly complementary to each other. OK, so what you've seen here has been the workhorse of the digital industry for the past two decades, 20 years, CMOS logic. OK, and even the most advanced chip from Intel has an inverter that looks exactly like that. OK, if you count all the inverters in the universe today, I would say a significant fraction of those look exactly like that, no difference, just so simple. So, the key with something like that is there is no path from the power supply to the ground, and so by that model, I did not consume any standby power. OK, my standby power in that idealized model is zero. So, let's compute P. So, what is P dynamic? Let's use the method that we adopted in the last lecture, and draw the equivalent circuit, and compute the power. OK, so I'm going to model the following situation, and assume that I drive a capacitive load, C. OK, and as an input, as I did the last time, I'm going to assume I have some input voltage, VIN, that looks like this. The cycle time, T, and the frequency is 1/t, and let me assume that this is T1, and this is T2. OK, and I'm assuming that T1 and T2 are both much larger than the respective time constants. OK, the time constants when, for discharging here, is C RONn, and here the relevant resistance is RONp. The charging time constant is RONp times C. OK, so T1 and T2 are assumed to be much greater than these two. So when you look at this, there's one other benefit besides the power benefit, OK, of using CMOS logic compared to using NMOS. OK, it not only cuts out my standby power, but there is another significant advantage which is almost equal to the power advantage of this kind of CMOS technology. Anybody have any ideas? What's the advantage? What does intuition tell you? Is CMOS going to be faster or slower than NMOS? Why? That's right. The key here is that the NMOS design I showed you earlier was relatively slow because it took me a while to charge up the load capacitor from RL. In this situation, RL will become really, really small; it's RONp. It's roughly the same magnitude as RONm. OK, if so both of these on resistances are more or less equal and small, then the rise time will be of the same order of magnitude as the fall time, which makes this much faster than the NMOS. In NMOS, my time constant was RLC, and RL was pretty large. In this case it's RONp C, and RONp can be made to be very small because when it's switched off, the resistance here is infinity. So, in this situation, if I assume T1 and T2 are much larger than the respective time constants, I can go ahead and draw my equivalent circuit. So, here's VS. So, for charging up, let's say this one is going to a one, or to a high. So, I have VS going through a resistor, RONp, to a capacitor, and this thing is a switch. So I have RONp, an ideal switch, going to a capacitor, C, this is my V out node, OK, so it's VS going through a resistance, RONp, an ideal switch, to a capacitor, C. That's a charging circuit. For discharging, I have C, discharging through an ideal switch with RONn. So, this situation, I have an ideal switch, RONn. OK, so that's the equivalent circuit for something like this. So, in this circuit, during T1, this guy's off, and this guy's on, on during T1, and off otherwise. This guy is on during T2, and off otherwise. OK, so just imagine, this guy switches on, this guy switches off, this guy switches on, this guy switches off, OK? And remember, this is exactly the circuit I had analyzed last time in the last lecture, and the result given by v double asterisk. And that result was simply average power being CVS^2f. That's the exact circuit we used to compute the dynamic power, CVS^2f. OK, so we're done. And how did this come about? This came about because the intuition here is that I'm charging up the capacitor fully, and then I'm discharging the capacitor through this other side, OK, and I'm consuming power, dissipating power, in these two resistances during charge up and during the discharge. Half the power gets consumed during charge up, and half during the discharge. So, I'd like to go back to doing a few numbers here, and taking a look at how, even with this expression, life can get pretty thorny as we go ahead into the next decade. OK, so for our previous example, we assumed that 10^8 gates, F=1 GHz, C=0.1 femtofarads, VS was 5V, and I don't need RL anymore. OK, why is it that I don't have any resistance component here? I don't have it here because the power consumed by this circuit is independent of those resistances, provided T1 and T2 are long enough, are much longer than the two time constants, RONp C, and RONn C. OK, so I don't have RL in my equation anymore. I don't have any standby power. So, based on this calculation, the calculation I did up there showed that I had 2.5 microwatts per gate, and for 10^8 gates I had 250W for a chip with 10^8 gates. So, I'd like to dwell on this, if you can move over to page eight in your notes, here. Let me dwell on this for some time, and pontificate on a few things. First of all, this number, as I said before, is high, but not a disaster. OK, so you can't use this in laptops, but it's quite OK for a desktop or a server, and so on. If you just go and put your ear to a pedestal computer, you'll always hear it making a sound, and that sound is because of a big fan that's inside it. And, if you have a big enough fan, 250W is not such a big deal. But, this is certainly a real problem for mobile devices. For a laptop, this is unthinkable. OK, so we have to deal with this. The second issue is the following, that it's 250W for 1GHz. Now, the fastest Pentium 4s that money can by today are, what, how many GHz? What's the fastest Pentium 4 you can buy today? What's that? Does anybody have a 4GHz Pentium 4 here? Oh, darn, you beat me. Anybody have a 3? 3GHz? A couple. So, I have a couple of 3GHz machines, and our lab has a whole ton of them. So, if Intel comes out with 4GHz machines today, they've been going up by about 1GHz roughly every year for the past couple of years. And, within three or four years, you're going to see chips, microprocessors that are in the 5-10GHz range, OK, assuming that all other things stay equal, which of course they're not, but just to give you some insight here, if I clock these guys and build circuits that are ten times faster, I very soon go up to 2.5kW, again as I said, all things being equal which they're not. But just to give you a sense, as I increase my frequency, so does the power consumed by the chip, OK? So, I really have to do something here. So, if I stare at this equation, CVS^2f, I want to increase f because people will buy computers if I have higher frequencies. And, Intel has managed to use its marketing campaigns to pretty much convince consumers that high frequencies are a good thing. OK, and whether they really mean anything or not, that's a different issue. So, we've got this huge power for assuming 5V, OK, so it turns out that microprocessors, as they come out, newer and newer versions run at lower and lower voltages. OK, they invent technologies that use lower and lower voltages, and go from VS 5V to, today, VS on the order of 1.5 to 1V, somewhere in that range. So the moment you do that, you get a 25x reduction in power. OK, so in going from 2.5kW, you would now come down to something on the order of 100W, which is, again, much more reasonable, again, all other things being equal. It turns out that the capacitance of devices also changes as you go to smaller and smaller devices. And, 100W is also pretty high, and still not good enough for mobile computers. So, there are many, many other tricks that people use to get even lower powers. One trick is to play games with the clock. OK, what you do is, let's say for example in some computation you are not going to be using your floating point unit. Or let's say I'm going to be using your integer adder unit. OK, so what you can do is you can turn off the clock to those devices so that those devices do not even switch when they're not working. OK, if I turn off the clock to a device, the device isn't even going to switch, it's just going to sit there in limbo without consuming any power. It's equivalent to turning off both transistors. If you turn off both the PMOS and NMOS somehow, OK, it's not consuming any power. And by doing that, you can further cut down the power. So, if you can idle some of your function units, it's called idling a function unit, idle a function unit for, let's say, half the time. OK, you would cut down power by another factor of two. We can idle, then, 75% of the time, come down to 25W. So, those are the classes of tricks that people play. I'm going to stop here and allow the underground guide folks to do the survey. But, suffice it to say that the power discussion that I've gone through with you is a very high level discussion as to the real thing. In real life, what actually happens is that there is a fair amount of standby power even for CMOS logic. It turns out that although I don't have a path from VS to ground for my two transistors, it turns out that there are many leakage currents. OK, currents leak through all kinds of places through the drain of the inverter, and so on and so forth. And so, there is some standby power. So, let me show you a quick demo while, I guess, the review handouts are going around. And this shows the temperature of my CMOS inverter, and as I increase the frequency, you can just watch the temperature go up, and hopefully we'll blow this transistor. So, I'm increasing the frequency as you can see on the side here, and higher frequency implies more power consumption, more temperature, OK, and hopefully you will see some smoke coming out of, OK, I think I blew the inverter. So, the output is gone. So, it's at 110 degrees there, and that blew it. Sometimes we see smoke come out, but I guess today is not one of our lucky days. OK, so let me stop here and have the underground guide folks go through the reviews. MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Please use the following citation format: Anant Agarwal, 6.002 Circuits and Electronics, Spring 2007 (Massachusetts Institute of Technology: MIT OpenCourseWare). http://ocw.mit.edu (accessed MM DD, YYYY). License: Creative Commons Attribution-Noncommercial-Share Alike. Note: Please use the actual date you accessed this material in your citation. For more information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms MIT OpenCourseWare http://ocw.mit.edu 6.002 Circuits and Electronics, Spring 2007 Transcript – Lecture 25 All right. Good morning. Good morning. So, we have some fun stuff for today's lecture, and as far as the final is concerned and so on, I'd like you to forget about anything we do today, absolutely. So, get your mind to become a blank, and forget anything you hear in today's lecture. So, what I'm going to show you today will hopefully completely blow your minds. And I'm not talking about controlled substances or anything. So what I'm going to do is show you a few things that behave completely and spectacularly differently than how you expect them to. And, today's lecture is appropriately called -- OK. So, we're going to violate the abstraction barrier here, and do some fun things. And, the important thing to realize is that in all of 6.002, we have, after all, based on some assumptions we made at the beginning of the course like lumped matter discipline and so on, we have landed ourselves in this playground called the playground of 6.002. And, within that playground, certain ground rules apply. OK, and our entire course depended on those assumptions being true. So, for example, the first assumption we made that brought us from Maxwell's equations to the lumped matter discipline was, or rather the circuit abstraction, was a lumped matter discipline. And there were three tenets of the lumped matter discipline. One is that the rate of change of flux was going to be zero within our circuits, not inside elements, but in the circuit itself, and second, the dq by dt was going to be zero outside the elements, and third, something we did not dwell upon in the course, but it's certainly present in the course notes is that the speeds of signals that we are going to consider are going to be much slower than the speed of light. OK, so we're going to be working in a realm where we are going to be well slower than the speed of light. OK, so starting with that, let me walk you through some examples and some fun stuff. So, the first case is called the Double Take. So, let me sketch out a small little circuit for you, and take a look at the expected behavior, and then show you what really happens in real life. So, the first case, I have a voltage source, and what I'm going to do is make a transition from a zero to a one. Think of it as a step input, and through a Thevenin like resistance, I want to feed it to a circuit. The circuit will go to an inverter. This node goes to an inverter, and goes through some other circuits within our own design here. So, again, remember, a step input here, and this input goes through a Thevenin like resistance, or is applied to some other circuit elements. So, if I apply a step here, what do you expect? You expect that, so let me call that VI, and let me call that Vo. So, if I plot VI as a function of time, and let's say this step input happens at t=0. So let's say this is t=0 here, and let's say this is a 5V step. So, I expect that this input here is going to go to, VI here, is going to go to 5V at t=0. What do I expect at Vo? At Vo, based on our circuit abstraction, I get a step input here. I should get a step of some magnitude here, depending on what's connected in this direction. And let's simply say that what's connected here is an inverter, and maybe other inverters at the other side. So essentially, as far as this node is concerned, it's got some wires connected to it. And at the end of the wires, it has an open circuit, an open circuit, for example, like the gate input of this inverter. So what do you expect at V nought? A step input here, and at V nought I see an open circuit. OK, so I expect the same step at V nought: 5V. So, that's what we've prepared you for, OK? But, the fun thing that we're going to see, so this is what you expect, and I'll show you a little demo that is going to show you something very different. What you're going to see is not this. OK, you're not going to be seeing that. Rather, I'm going to show you something that looks like this. So, at t=0, I do see Vo looking like a step, and approximately halfway through, decides, ah, well never mind, and flattens out, OK, then says, oh, OK, and zoom, it goes back up to 5V. So, it sort of does a bit of a double take up there saying, hey, what's going on here? And zoom, jumps up to 5V, and then it's five as you expect. OK, so this is some finite amount of time that looks like that. OK, so try to understand what's going on. So let me show you a quick little demo. So that's the input VI. OK, so that's the input VI that you expect, and I won't do anything to my circuit at this point. And, go ahead. So, let's see what happens now. There you go. So now, I'm showing you the output here at Vo. So at VI, there's a nice little step, and at Vo, notice that I get something that behaves like this. OK, and I promise you, nothing we've taught you in 6.002 prepares you for this. OK, and as I mentioned at the beginning of this lecture, it would behoove you to forget about everything you learn in today's lecture for the next two weeks at least. So what's going on here? Any ideas? Anybody? Any thoughts? So what's up with my circuit here? It says, oh, OK, a step. It starts off and says, oh, never mind, and then meanders along at 2.5V and then says oh, step, yes, I remember, and then boom, it jumps up to 5V. So, any theories? Any guesses? Any wild guesses? OK, so let me draw you a little bit more of a detailed circuit, and see if you can explain what's going on here. So, the circuit that I've drawn there is not quite the circuit I have at least in terms of my wires. So, what I have is something that looks like this, VI, and this is going to step to 5V. I do have a resistance, R. This is Vo, this does go to an inverter. But what is also happening is that I have a long wire. OK, you see this guy here? We had one of our union folks stretch out along the floor here. We have a really long wire that connects to the Vo node, and there's also a long corresponding ground. So, this wire is a coaxial cable that is used for Ethernet and such like. It's got a core that carries a signal, and around the core is shielding that is the ground. OK, so that goes a long way, and at the end, it is open. OK, it's an open circuit at the end. I haven't connected anything out there: open circuit. So, you know, something's happening here that's making the circuit behave like this. So, this is VI. At Vo -- So at Vo I'm getting this funny behavior. OK, so does anybody want to take the next piece of clues here, does anybody want to take a stab at guessing what might be going on here? Yes? Ah, we have a shill in the audience here. So, the theory is that the step here, think of it as an electromagnetic pulse that goes from zero to five, and things in real life don't travel instantaneously. So, there's something with a wave that flies down, and the wave goes to the end, flips, and then comes back, and then establishes the full voltage here. So that is indeed at the root of what's going on. And let me put it in layman's terms and then describe the details of what's going on here. OK, so the way to view what's going on is that I have this long wire. OK, in the very first lecture, I started off by saying wires are ideal. OK, ideal wires are such that I can transmit signals on them. Wires are small so that the propagation time of signals is inconsequential compared to the rise times and fall times of the signals of interest. By having this really long cable here, I have clearly violated that assumption, which is the wires are really, really long here. OK, and so I somehow need to model what the wire is doing to my circuit when I don't have a small wire. So what actually happens, the way to view it is the following. So, although this is a wire, to understand the mechanics of what's going on, I really have to model it much more accurately, OK? And, the way to model a wire like this is that notice that every small element of a wire has associated with it some inductance. OK, so let's take a small segment of the coax cable here. The coax cable is a small core surrounded by a metallic shield. OK, that's a ground. And so, when I have a wire surrounded by a metallic shield, that also has the capacitance, OK, inductance and capacitance. So this small segment can be modeled as a really small inductance, and a really tiny capacitance. Similarly, the next segment can be modeled as a tiny inductance and a capacitance. There is also a resistance here, but let's assume that the resistance is zero for our model, and also the parallel resistance is also infinity. OK, so it's an inductor, capacitor, and really the situation that I have is not a pair of ideal wires, but really a really, really small inductance, and a small capacitance in parallel. So, it's more of a set of distributed elements that I have here. Notice that in my lump circuit abstraction, when we talked about the RLC model for the wire between two inverters, we lumped it. We lumped this thing into a model that looked like this. OK, we lumped the resistance into a source resistance. We lumped all the inductors into a lumped inductor. We lumped all the capacitances into a lumped capacitance. OK, but in this situation, I can do this when the signal speeds of interest are much, much, much slower than the speed of light than the propagation speeds of electromagnetic signals. In this case, that is not quite true. And so, therefore, we have to model it much more exactly. We need to see what's going on. So, what's happening here is that at t=0, I get this step. So, think of that as a pulse of energy, and the instant it comes here, and instantaneously this guy looks like a voltage divider, OK? I've chosen my resistance, R, here to match the instantaneous impedance looking in, which is also R. I've arranged it to be that way. So, instantaneously, the point at which the pulse appears at this point, looking down here looks like another resistor to this pulse. OK, therefore, when I start out, I start out going up and pausing at 2.5 because instantaneously, this looks like a resistance, R. So instantaneously, it's a voltage divider, R, and so it's 2.5 here, instantaneously. OK, then what happens? Then those little pulse propagates down. What does it mean for a pulse of energy to propagate down? Well, it begins sending a current through the inductor, begins charging up the capacitor, current here, so that's what I mean by saying that the pulse of energy goes down. OK, it's a step that sends current to the inductor and charges of the capacitors, and that wave front moves out here and comes all the way here. What happens there? Well, think about it. Supposing you stand here, and you hold a long string in your hand somehow, and just do this Gedanken experiment. It's not easy to do. And so, let's say you somehow have the long string that you're holding onto, and the string on the other side is not connected to anything. OK, just imagine this experiment. OK, and what you do is you suddenly raise the string up at your end by about a foot. What are you going to see happen? So instantaneously, the string is up here, but the rest of the string is down a foot below. And then you see this wave propagate down the string, right? So here's a string. I lift this thing, and you see this wave propagate all the way down, the one foot wave propagate all the way down until you come here. What happens here? So, out here, the string is down here, the wave propagates out here and pulls it up to one. And then what? There's nothing connected there, so the string is zipped up, but it's got the energy. OK, where does energy go? Well, it continues going up, and sends a wave back. OK, so just think of a string that you pull up like this and propagates down, boom, hits the other end, reverses, and comes back at me. OK, you can look at a complementary situation, not the same as this, but complementary by taking a string, tying it to a door, and lifting it up. It's not the same situation. It's a complementary situation where it's tied down. Tying down a string is tantamount to shorting the ends here. OK, in that case what you'll see happen: as the wave goes down, at the end the string can't move, so the wave goes and flips around and comes back. Try it out at home. Take a long piece of string, tie it up there, do this, OK? And you'll see the wave go out, flip, and then come back at you. So, if your friends see you tying a long piece of string doing this, hopefully they won't think you're nuts or something. OK, so the same way here: this thing flies down, OK, there's no way to dissipate the energy here, so this thing continues up. And then, what I'm going to see happen is the wave move back. OK, the wave begins to move back, and that's another 2.5V, resulting in a net 5V at this terminal. That wave begins to blast back, OK, and then when it comes back here, after some amount of time, it raises this to 5V, and that's what you see happen here. So, this is a wave going down, and then after a time, 2t, it goes back up to 5V. That's a return wave. It's 2t because to get down here is t seconds, and then t seconds to come back, which is why we have 2t. OK, that is why you see that pulse at 2.5. OK, so I'd like to show you a few more things here. Clearly we don't want that in our circuits. Could someone tell me what problem would happen if my signals looked like this in my digital circuits? Instead of being nice little steps, if there was a little thing in the middle and then a step, what's the problem with signals like this? In digital circuits, what did it violate? Yeah? Exactly. This little sucker here is meandering out in the forbidden region for all of 2T. Can't do that. OK, can't have that. Well, so we need to fix the problem because this is real life. OK, but what if you and your buddy were signaling each other but using digital signals from one dorm room to another maybe a few hundred feet down? Your circuit isn't going to work because the signal's going to meander around in the forbidden region for some time. So, any ideas what might you do? Yeah? Put a resistor on the end. OK, trick the circuit. So, what you can do, and I'm going to show you a little demo here, what you can do is the reason I got this wave propagating back, was that there was nothing to absorb the energy. So instead, what if I put another resistor here, R? So, as far as a burst of energy is concerned, it says, oh, yeah, it just looks the same. It's R, and goes and dissipates in this resistor, R, and guess what? I don't have any wave going back, and I'm done. So, what I'm going to find, then, is that out here, this goes up to 5V, but out here, I will have a signal that starts out and goes up to 2.5, and that's it. OK, I lift it up, it goes down, it goes to 2.5 because in the lumped model that you've been dealing with, it's a resistor R, a resistor R to ground, and you're taking the connection here or here. So, it's your standard lumped model, your voltage resistive divider, and it just simply works. Yeah, that's it. So, this is the end of the cable. OK, if somehow you could watch this and that at the same time, so what I'm going to do, and this is a resistor, R, I'm just going to plug it in. OK, if the fates are smiling at me, what should you see there? What should happen is that the second jump from 2.5 to 5 should simply go away. It should just go to 2.5. Let's try that. There you go. I take it out, it jumps back up. OK, so all I've done here is put in a resistor at the end, and I'm still measuring the voltage here. So, that's one solution. One solution is to put a resistor here. So, I absorb the energy, and the resistance has to be equal to the instantaneous impedance looking in. And the instantaneous impedance, for many of these cables is 50 ohms. It's called a characteristic impedance. OK, you'll learn a lot more about it if you take 6.014. That course starts out with assuming that things are distributed in that matter. OK, so if you want to design multi-gigahertz chips, it turns out that if you have signals that are traveling around at edge speeds in the 0.1-1 nanosecond range, remember, light travels roughly one nanosecond a foot. And if the signals are roughly of interest are 0.1 nanoseconds, then if the chips are one inch in size, right there, the propagation speed of a signal across a chip is 0.1 nanoseconds. OK, so today, we have to deal with these issues and try to figure out what to do about them. OK, so that's one solution that somebody pointed out. There is a second solution. Anybody else have a second solution for me? And then there's a third solution, too. So it's OK. You can give me either the second or the third solution. It doesn't matter. Anybody? You have two to choose from, come on. Yeah? You can do that, yeah. So we could define the problem away by saying this transition is such that my high is below 2.5. So, once it goes above 2.5, who cares what it does? That's a good point. That's solution number four, and that works. OK, so I still need two and three. Put a diode in there? Yeah, I guess you could. If the diode had the same kind of impedance looking in, it kind of may work. That's solution 4.2. I'm still waiting for solution two and three. Pardon? Cut off the cable? Exactly. So, the solution says, work on a different problem. And that is solution number two. OK, so the idea is, the root of all evil, this long wire, which is why I had this thing here. So instead, if I had short wires, then what will happen is if it's a very small wire, it'll look like this. And the wire's small enough. I will see an itty-bitty thingamajig out there, but not a whole lot. By the way, the fun thing is that you can actually calculate the speed of light, the experiment I just showed you. Can we put that up again? No, the big one. So, in the experiment that I showed you, this distance was about 500 nanoseconds, OK? This distance was 500 nanoseconds this time interval. The length of this cable is about 500 feet, somewhere around 500 feet. So you can figure out the speed of light. What's the speed of light? So, this is about 500 nanoseconds, and this cable is roughly 500 feet. What's the speed of light? Roughly a foot per nanosecond. So, would you believe that in 6.002 we've figured out the speed of light from a simple experiment? All right, so let's do the next experiment now. Let's take out the long cable, and connect a short cable instead. So, what I'm going to do is disconnect the long cable, and instead, connect a small cable. It's still relatively long, but much shorter than the 500 foot cable. So what you should see happen now is that the little step should not be this big, but much, much smaller. So, take a look up there. There you go. OK, so with this thingamajig, the little blip there is very small. And of course, if I make it even smaller, then that can virtually vanish. OK, so that is solution number two. So, we've done one, two, four, 4.2. So, what's solution number three? One more solution. Pardon? So, another solution we mentioned is we change this resistance. and that will work, if I make this very, very low, then I'll get much closer to 5V here. Yeah, that's a possibility. That's solution six I guess. So what was solution number three? And you all should be able to solve this. You guys know the answer. OK, you folks should be able to solve this. Yes? Ah, clock. So, what I can do is just as was pointed out, that I leveraged my abstraction by changing my VOH and VIH thresholds. So that'll work. The alternative thing is to use a clock. A clock is a distinguished signal that I send around in my digital circuit, OK? So all I do is if I arrange it such that my clock doesn't happen in this vicinity, but rather, my clock happens late enough, then I'm going to sample and look at my signals only on the rising and falling edges of the clock, in which case I won't be looking at the signal, but the signal is doing weird things. OK, so a decent clock would also solve the problem. OK, any last minute questions before we go onto the next one? OK, the next problem that we're going to look at is titled the Double Dip. OK, so what I'm going to do here is our Vs power supply, and what I'm going to do is feed the power supply to an inverter. OK, so we've been doing this all along; Vs, I feed the supply to an inverter. And what I'm also going to do is, so this is ground, and I'm going to feed it to, so feed the power supply connection to a couple of inverters. OK, and what I'm going to do is apply some sort of a signal to this inverter, and I'm going to observe, and I'm going to look at this signal here. So, the abstraction should tell you that here's a power supply. This is 5V, or whatever the supply voltage is to these two inverters. That should be fine, and feed some sort of input to this inverter, OK, and the output here should be simply determined by this input. This signal can have absolutely no bearing on this output. OK, and let's look at that and actually confirm it. So, I build a circuit like this, and we look at this output, and initially there should not be any, it should simply work fine. OK, so it should work now, right? OK. So what you have here, this input here is the input that I'm feeding to this inverter. That is a straight line. Is that the power supply? It doesn't matter? OK, so I believe this is the, we'll check in a few minutes, but I suspect this is the power supply, and this guy here is the output looking here. So, the green one is the look here part. So, there must have been a one-to-zero transition here, and that's all fine. So, so far, so good. OK, no problem so far. Now what I'm going to do is I'm going to do something to the circuit that as far as abstraction is concerned, it doesn't show up on the circuit. OK, it's below the abstraction layer. OK, I'm going to do something, and suddenly, some things are going to happen. Look up there. The circuit hasn't changed. It's the same circuit. I've done nothing to the circuit. OK, look at the green output. I've done nothing to the circuit that is visible here. OK, it's below the radar screen here. It's below the abstraction barrier. But, look at the disaster here. OK, in particular, the spikes going up are not so much of a problem. Because of the static discipline, if I am at five or six or seven, it doesn't matter as long as I am higher than VOH. So as long as I'm higher than VOH I don't have a problem. But the problems are these repeated dips. OK, the dips are a problem here, which is why I labeled this experiment the Double Dip. OK, the dips are bad because if they are large enough, they can then group the output down into the forbidden region, or worse yet, make it look like a zero. OK, so you're not prepared for this. So what I'm going to do is tell you what I did to the circuit, and then ask you to help me figure it out. So all I did was applied a load resistance to this, I think of 50 ohms or some RL. I just applied a load resistor. And this inverter here, I believe, is a CMOS inverter that looks, OK? So I have this input applied to this inverter, and all I did is I applied an RL load here. And notice that the load here should not really change what's happening if this is an ideal inverter, OK, the load here should simply draw some current but really should not change any other property. OK, so just remember, what's the signal doing? The signal is high. This guy turns on, and current flows like this. So, let's say I had some sort of a capacitor here. This charges like this, and when it's slow, the PFET is on, and current flows through here down here. And then when this goes high, this guy goes off, and this guy turns on. OK, so the current flows out this way and this charges through this guy. When I turn it off, the P fret turns on and draws current from the top. OK, so do we have any theories as to why I'm getting that messy stuff, the dips and the spikes, on the output of this inverter? So why does this inverter care what the load of this inverter is? I mean, who cares? So, put your thinking caps on. Any theories? You guys did pretty well with the previous one. And this is much easier, actually. Need a better power supply; OK, so what I'm going to do is I'm going to replace the power supply, and instead, use a much bigger power supply at 5V. A big, mongo power supply that can supply 100 amps, and guess what, I've made the changes, but guess what, I still see the spikes. Good try, but it didn't work out. Good try, good try. What next? Any other solutions? Yes? So dips are because of the resistance, and the spikes are because of the inductance? You're half correct. So, which one is it? So, dips are because of resistances, and spikes are because of inductances. You're half correct. It turns out that both the dips and the spikes are because of inductances. OK, but be that as it may, let me give you the next clue here, and then see if you can come closer to the answer. So, what I've done here is I've made this wire really, really long. OK, it's a really long wire, OK, but it's a thick wire, so it's a long, long, thick wire. So it's not the resistance. It's really, really thick and mongo, and it's a long wire, so a signal wire above a ground plane behaves like an inductor. And so here, it has the capacitance to, but in this case it's inductance. It's inductance here. So, I'll give you another ten seconds to think about it and then tell you the answer. But despite the inductance here, it turns out if I take out this resistor, the problem goes away. Look, I take out the resistor, the problem goes away. Yes, there is an inductor here. OK, I take out this resistor, problem goes away. I put the resistor back in, boom. Yes? OK, pretty good. That's 86 points. So here's what's going on. There's an inductor here, and when I put a 50 ohm resistor here, I put this resistor. When the PFET turns on, it draws a current. OK, it's going to draw a current. It draws a current; remember that across an inductor, I have a drop. And the drop relates to the di/dt. Remember, for a capacitor, the current is Cdv/dt. For the inductor, the voltage across the inductor is Ldi/dt. So, if di/dt, from switching a large current through the inductor every cycle, OK, big di/dt, di/dt is large. I've made it large by having a very small RL, so, you know, pulling a big current through every few, whatever, every cycle, and then stopping it. And so therefore, I'm getting these big drops across this inductor that relate to Ldi/dt. In other words, the power supply here is fine. While you guys were watching, I switched to the huge, mongo power supply, and so this voltage is fine. But then this voltage after the wire is the problem. So, this voltage here doesn't look like this anymore. Rather, it has spikes that go down, for example, and when I switch the other way, they go up. OK, so therefore, what I end up having here is big spikes on this power supply. And when this guy's power supply goes wacko, then I see the spikes on its output as well. OK, so what are the solutions for that? Any solutions here? What can I do to fix the problem? Pardon? Stop using the, exactly. When in doubt, do something else. Build a different design. So what I could do is this is pretty dumb, using a long wire. And so, no, but trust me, oftentimes you go to the store room and they give you a big roll of wire, and you're too lazy to cut a piece out. Use the whole roll, and use the two ends, and connect it in, OK? So, if I had a much shorter piece of wire, then that can solve my problem. But again, remember, what's small to you may not be small to the circuit. OK, so let's say, for example, I'm Intel, and I'm building a 10 GHz Pentium 6 processor. OK, it's 0.1 nanosecond is my cycle time. There, even a small, itty bitty wire can be a real problem. OK, and so therefore, distributing power throughout a one inch chip that's clocking at 10 GHz is a really, really hard problem. And our own David Perreault, who is doing one of our sections, is one of the world's experts in this field. Distributing power, something as simple as, how do I get 1V in a stable manner to every single device on my chip? It's a hard problem. OK, so now, you have to begin feeding your power supply connections much like RC circuits, OK, and you have to solve some hard problems to be able to simply distribute power decently throughout your circuit. So, what else can I do? Yeah? Say it again? Ah, I can do that. I could use different wires to connect each of the inverters. That's a good point. So here, the coupling happens because I connect the two inverters way out here. So instead, I use a different cable. I hadn't thought of that. That's a creative solution. OK, so in fact, if you build a chip, so we built this chip called RAW in our group, and it has on the order of 10 million gates. And this chip we built with IBM's technology, and it turns out that you don't send power supply in through a pin and then connect that 1.5V supply to all your gates. What you do is from that pin, you then build special power supply buffering trees. And each tree, each leaf of the tree drives a subcircuit. In other words, if this is a chip, you have lots and lots of gates throughout your chip. What you do not do is bring in a power supply like this, and then connect. You don't do that. That's the worst possible thing you can do. It's an absolute disaster for the reason just brought up. OK, so instead what you do is divide up the chip into, say, four quadrants. OK, in our case, we have 16 quadrants. And then what you do is from this point, you take one wire that goes to this quadrant, one wire that comes here, one here, and one here, so that you're getting the power supply very close to the source, and you have different connections going to each quadrant so that switching in this quadrant will not affect this guy because of the inductance of this lead here. OK, and if you hadn't taken 6.002, you'd have been arguing with IBM, I don't want 16 wires. I want just one wire. OK, so there are other solutions, of course. There's a couple more solution. One is that what you can do is part of the problem here is that all my transitions are really, really sharp. OK, so di/dt is very, very large. So, there's a whole new technique in design of digital and analog circuits, which talks about, maybe I should call it waveform engineering, OK, or edge engineering. OK, it's also called edge smoothing. The idea is that rather than have very sharp edges in your circuit, you try to have smoother edges. And when you have smoother edges, OK, then your di/dt is now going to be less. It's not going to be very, very high. Rather, your delta I is spread out over a longer period of time. Of course, that means the circuits may have to run a little slower, but that can also solve the problem. And in fact, that same smoothing of the waveforms was also the solution you saw in the capacitive coupling we saw a month and a half ago. And let me show you the demo, and then close up. Not working? OK, that's OK. It doesn't matter. So if you remember the demo from the lecture about a month and a half ago in capacitors, I talked about a chip with two pins, and there was this capacitive coupling between the pins. And because of this, if this waveform is switching, then because of this coupling, you will end up getting, if this is the signal here, you will end up getting spikes on this pin because of the signaling of the other pin. And that's good old capacitive coupling. OK, and to eliminate this, what you can do is much like with the inductance system, if you, rather than having sharp transitions on this pin, if you have smooth transitions that look like this, then what you can do is you'll now spread delta V from here to here over a longer delta T. OK, delta T has become longer, and because of that, you end up getting much better behavior, and you don't end up getting these spikes. So therefore, if you want to build really, really fast circuits, you have to be really careful. You can build fast circuits, but watch out for them fast edges. OK, fast edges are nasty. They kill you. That's something to remember as you build the next generation of circuits. Well, thank you all. I had a blast, and I hope you guys had fun too. Thank you.