2008年12月17日星期三

Transcript - Lecture 1-5

Transcript - Lecture 1
6.002 Circuits and Electronics, Spring 2007

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.



Transcript - Lecture 2
6.002 Circuits and Electronics, Spring 2007

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.



Transcript - Lecture 3
6.002 Circuits and Electronics, Spring 2007

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.



Transcript - Lecture 4
6.002 Circuits and Electronics, Spring 2007

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.



Transcript - Lecture 5
6.002 Circuits and Electronics, Spring 2007

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.

没有评论: