1 00:00:17,000 --> 00:00:20,000 All right. Good morning. 2 00:00:20,000 --> 00:00:26,000 Let's get going. In today's lecture we continue 3 00:00:26,000 --> 00:00:34,000 with the operational amplifier, "op amp" for short. 4 00:00:34,000 --> 00:00:40,000 And what we are going to do is just build up a bunch of fun 5 00:00:40,000 --> 00:00:43,000 building blocks using the op amp. 6 00:00:43,000 --> 00:00:46,000 As a quick review -- 7 00:00:57,000 --> 00:01:01,000 To quickly review what we've seen about the op amp -- 8 00:01:09,000 --> 00:01:16,000 We represented the op amp as a device that looked like this 9 00:01:16,000 --> 00:01:23,000 where the amplifier had an incredibly high gain. 10 00:01:23,000 --> 00:01:30,000 So, if I had a small voltage difference here -- 11 00:01:30,000 --> 00:01:34,000 I call this v plus and this v minus with respect to ground. 12 00:01:34,000 --> 00:01:39,000 And if I had a small voltage difference then this gain here 13 00:01:39,000 --> 00:01:43,000 would multiply the difference by a large number and thereby 14 00:01:43,000 --> 00:01:48,000 giving me an output that was on the order of a million times 15 00:01:48,000 --> 00:01:53,000 greater than this difference. And because of that when I use 16 00:01:53,000 --> 00:01:57,000 the op amp in a mode like this without any negative feedback 17 00:01:57,000 --> 00:02:02,000 the output would usually crank up to the positive rail or the 18 00:02:02,000 --> 00:02:07,000 negative rail. We also saw that it had 19 00:02:07,000 --> 00:02:14,000 infinite input resistance so that the current flowing in here 20 00:02:14,000 --> 00:02:20,000 or here was zero and also had zero output resistance. 21 00:02:20,000 --> 00:02:27,000 This is my ideal op amp where irrespective of what load I 22 00:02:27,000 --> 00:02:35,000 connect here the op amp would supply pretty much any current. 23 00:02:35,000 --> 00:02:38,000 Now, in practical op amps that's not the case. 24 00:02:38,000 --> 00:02:42,000 But suffice it to say that when used as an ideal op amp the 25 00:02:42,000 --> 00:02:46,000 output impedance, the output resistance is going 26 00:02:46,000 --> 00:02:49,000 to be zero. The op amp is a huge workhorse 27 00:02:49,000 --> 00:02:53,000 of the analog industry. You will see based both on what 28 00:02:53,000 --> 00:02:57,000 you've done on Tuesday and Wednesday but also today that 29 00:02:57,000 --> 00:03:03,000 it's very, very simple to build circuits using the op amp. 30 00:03:03,000 --> 00:03:07,000 When you use the amplifier, you don't have to worry about 31 00:03:07,000 --> 00:03:11,000 things like nonlinear analysis. You don't have to worry about 32 00:03:11,000 --> 00:03:16,000 am I really meeting the criteria for saturation limits and so on? 33 00:03:16,000 --> 00:03:20,000 To some extent you have to think about that with the op 34 00:03:20,000 --> 00:03:24,000 amp, too, because if the output hits the positive rail or 35 00:03:24,000 --> 00:03:30,000 negative rail it isn't going to behave like you expect it to. 36 00:03:30,000 --> 00:03:33,000 But fundamentally with this primitive model, 37 00:03:33,000 --> 00:03:37,000 this idea model it becomes really simple to build circuits 38 00:03:37,000 --> 00:03:41,000 with the op amp. Therefore it has become a key 39 00:03:41,000 --> 00:03:45,000 building block for circuits. When circuit designers build 40 00:03:45,000 --> 00:03:50,000 analog circuits very often their primitive building blocks are 41 00:03:50,000 --> 00:03:53,000 really an amplifier of this sort, an op amp, 42 00:03:53,000 --> 00:03:58,000 resistors, capacitors and some of our other primitive building 43 00:03:58,000 --> 00:04:01,000 elements. If you look at the course notes 44 00:04:01,000 --> 00:04:05,000 the readings are -- There are a bunch of examples 45 00:04:05,000 --> 00:04:09,000 solved in Chapter 16. And you will see that using the 46 00:04:09,000 --> 00:04:13,000 op amp it is indeed possible to build current sources that look 47 00:04:13,000 --> 00:04:15,000 like more or less ideal current sources. 48 00:04:15,000 --> 00:04:18,000 It is also possible to build voltage sources and so on. 49 00:04:18,000 --> 00:04:22,000 It is an incredibly neat building block using which you 50 00:04:22,000 --> 00:04:25,000 can do all kinds of cool stuff. 51 00:04:33,000 --> 00:04:38,000 In this course you will see a whole bunch of example circuits 52 00:04:38,000 --> 00:04:43,000 using the op amp. In today's lecture you will see 53 00:04:43,000 --> 00:04:48,000 things like a subtractor. You will also see integrators 54 00:04:48,000 --> 00:04:53,000 and a differentiator. And then in your lab, 55 00:04:53,000 --> 00:04:58,000 lab four, you will build a really fun mixed signal circuit 56 00:04:58,000 --> 00:05:04,000 involving both digital and analog components. 57 00:05:04,000 --> 00:05:09,000 And you will build what is called a digital to an analog 58 00:05:09,000 --> 00:05:14,000 converter using the op amp. And of course I can build all 59 00:05:14,000 --> 00:05:19,000 our good-old amplifiers and circuits of that sort. 60 00:05:19,000 --> 00:05:24,000 In a later lecture you will also see how we can build 61 00:05:24,000 --> 00:05:30,000 filters using an op amp. This is going to be using the 62 00:05:30,000 --> 00:05:33,000 knowledge you learn in terms of connecting resistors, 63 00:05:33,000 --> 00:05:37,000 capacitors and inductors together and doing a frequency 64 00:05:37,000 --> 00:05:40,000 domain analysis, well we can throw the op amp in 65 00:05:40,000 --> 00:05:42,000 there and build filters, too. 66 00:05:42,000 --> 00:05:46,000 This is just to give you a preview of upcoming attractions. 67 00:05:46,000 --> 00:05:50,000 For today I am going to focus on these circuits. 68 00:05:50,000 --> 00:05:53,000 I won't be covering any new theory or any new set of 69 00:05:53,000 --> 00:05:58,000 foundations but pretty much take the simple properties that I 70 00:05:58,000 --> 00:06:02,000 have explained to you about the op amp. 71 00:06:02,000 --> 00:06:07,000 And using those simple properties very quickly build up 72 00:06:07,000 --> 00:06:13,000 a bunch of circuits that you can use to analyze signals in a 73 00:06:13,000 --> 00:06:17,000 variety of ways. Let's start with the following 74 00:06:17,000 --> 00:06:21,000 circuit. With op amps I start with this 75 00:06:21,000 --> 00:06:25,000 little guy. And what I am going to do is 76 00:06:25,000 --> 00:06:30,000 use two voltage sources, v1, and this is a resistor, 77 00:06:30,000 --> 00:06:34,000 not an inductor. And value R1, 78 00:06:34,000 --> 00:06:38,000 value R2. So, I have a voltage connected 79 00:06:38,000 --> 00:06:42,000 by a divider, voltage divider to the plus 80 00:06:42,000 --> 00:06:46,000 input. And I am going to provide some 81 00:06:46,000 --> 00:06:50,000 negative feedback in the following way. 82 00:06:50,000 --> 00:06:56,000 This is going to be R2, the same as this one here, 83 00:06:56,000 --> 00:07:01,000 a resistor R1. And then a voltage source v2 84 00:07:01,000 --> 00:07:05,000 that I connect out here. So notice that- Oh, 85 00:07:05,000 --> 00:07:09,000 and I take the output vOUT out here. 86 00:07:09,000 --> 00:07:13,000 And that vOUT of course is with respect to ground, 87 00:07:13,000 --> 00:07:18,000 and R2, v1 and v2 are also connected to ground. 88 00:07:18,000 --> 00:07:22,000 What I am going to do is analyze the circuit it two 89 00:07:22,000 --> 00:07:26,000 different ways, and as I analyze it describe 90 00:07:26,000 --> 00:07:32,000 some other interesting properties to you. 91 00:07:32,000 --> 00:07:35,000 In the last lecture the technique I used to analyze op 92 00:07:35,000 --> 00:07:39,000 amps was one in which I replaced the op amp with its ideal model 93 00:07:39,000 --> 00:07:43,000 involving a dependent source and so on with a large gain A and 94 00:07:43,000 --> 00:07:46,000 showed that. I wrote the expression and then 95 00:07:46,000 --> 00:07:50,000 I let A increase to infinity to the limits and got an expression 96 00:07:50,000 --> 00:07:53,000 that was independent of A. And then in recitation 97 00:07:53,000 --> 00:07:57,000 yesterday you would have covered another technique which makes it 98 00:07:57,000 --> 00:08:04,000 much simpler to analyze op amps. Let me very quickly review that 99 00:08:04,000 --> 00:08:07,000 method. We fondly call that technique, 100 00:08:07,000 --> 00:08:13,000 there is no formal name for it, but we fondly call that v plus 101 00:08:13,000 --> 00:08:17,000 more or less equal to v minus method. 102 00:08:17,000 --> 00:08:23,000 This is also variously called the virtual ground method and so 103 00:08:23,000 --> 00:08:29,000 on, but we shall call it the v plus more or less equal to v 104 00:08:29,000 --> 00:08:33,000 minus method. The insight here is that 105 00:08:33,000 --> 00:08:37,000 whenever I use the op amp in a way in which I am giving it 106 00:08:37,000 --> 00:08:41,000 negative feedback, so I am feeding some portion of 107 00:08:41,000 --> 00:08:43,000 the output to its negative input. 108 00:08:43,000 --> 00:08:45,000 I am giving it negative feedback. 109 00:08:45,000 --> 00:08:49,000 That's one property. Second property is that my 110 00:08:49,000 --> 00:08:52,000 inputs, v1 and v2, and my resistance values are 111 00:08:52,000 --> 00:08:55,000 chosen such that the output is not in saturation. 112 00:08:55,000 --> 00:09:01,000 So, the op amp is not at the plus VS rail or minus VS rail. 113 00:09:01,000 --> 00:09:05,000 Rather it's somewhere in the middle in its active region. 114 00:09:05,000 --> 00:09:10,000 When that happens we claim that the v minus and v plus for the 115 00:09:10,000 --> 00:09:16,000 op amp are more or less equal. And to give you some intuition 116 00:09:16,000 --> 00:09:20,000 as to why that is so, let's say the output is 6 volts 117 00:09:20,000 --> 00:09:24,000 and my supply is plus/minus 12. This is 6 volts and the 118 00:09:24,000 --> 00:09:30,000 amplifier is a gain of a million, ten to the six. 119 00:09:30,000 --> 00:09:33,000 To sustain 6 volts at the output all I need is a 120 00:09:33,000 --> 00:09:38,000 difference of 6 microvolts here. Six divided by ten to the six 121 00:09:38,000 --> 00:09:42,000 is the difference between v plus and v minus. 122 00:09:42,000 --> 00:09:44,000 It's very, very, very small. 123 00:09:44,000 --> 00:09:49,000 It's so small as to make v plus more or less equal to v minus. 124 00:09:49,000 --> 00:09:54,000 All it takes is a very small differential voltage here to 125 00:09:54,000 --> 00:09:59,000 give you 6 volts at the output. The key thing to observe is 126 00:09:59,000 --> 00:10:03,000 under negative feedback, when the op amp is not in 127 00:10:03,000 --> 00:10:07,000 saturation the property that v plus equals v minus holds. 128 00:10:07,000 --> 00:10:11,000 And the way it works is that it's not that it's a magical 129 00:10:11,000 --> 00:10:14,000 property. It is simply that when I apply 130 00:10:14,000 --> 00:10:18,000 negative feedback the negative feedback is such that it will 131 00:10:18,000 --> 00:10:23,000 force this v minus node here to be at more or less the same 132 00:10:23,000 --> 00:10:26,000 voltage as v plus. Remember the when in doubt 133 00:10:26,000 --> 00:10:30,000 simply go back and think about the anti lock brakes example we 134 00:10:30,000 --> 00:10:35,000 did last time. For example if v plus increases 135 00:10:35,000 --> 00:10:39,000 the output will increase and so will the voltage here and tend 136 00:10:39,000 --> 00:10:42,000 to make these two equal. What we can do, 137 00:10:42,000 --> 00:10:46,000 being rather tricky here, what we'll do is say look, 138 00:10:46,000 --> 00:10:50,000 if we know for a fact that under negative feedback the op 139 00:10:50,000 --> 00:10:54,000 amp is going to engineer these two node voltages to be more or 140 00:10:54,000 --> 00:10:58,000 less equal then why don't I just use that fact to begin with and 141 00:10:58,000 --> 00:11:03,000 analyze my circuit assuming that it's true. 142 00:11:03,000 --> 00:11:06,000 This is just a bit of inverted logic here that says look, 143 00:11:06,000 --> 00:11:08,000 the circuit is going to make that happen. 144 00:11:08,000 --> 00:11:11,000 If the circuit is going to make that happen to analyze the 145 00:11:11,000 --> 00:11:14,000 circuit in its steady state, why don't I just go ahead and 146 00:11:14,000 --> 00:11:17,000 assume that to begin with? This again goes back to us 147 00:11:17,000 --> 00:11:21,000 wanting to be engineers here and do whatever is simply and find 148 00:11:21,000 --> 00:11:23,000 the simplest possible way of getting some place. 149 00:11:23,000 --> 00:11:26,000 I want to use that method, the v plus equals v minus 150 00:11:26,000 --> 00:11:30,000 method. Let me just first write down 151 00:11:30,000 --> 00:11:36,000 some values that I know about. I know that v plus is simply a 152 00:11:36,000 --> 00:11:42,000 voltage divider relation here. That's v1 times R2 divided by 153 00:11:42,000 --> 00:11:45,000 R1 plus R2. And by the v plus equals v 154 00:11:45,000 --> 00:11:51,000 minus method I know that this is going to be equal to v minus. 155 00:11:51,000 --> 00:11:57,000 And this is going to be true because I am giving you negative 156 00:11:57,000 --> 00:12:02,000 feedback here. And we are going to engineer 157 00:12:02,000 --> 00:12:06,000 the values of R1, R2, v1 and v2 such that the op 158 00:12:06,000 --> 00:12:09,000 amp is not in saturation. So, we know that. 159 00:12:09,000 --> 00:12:14,000 The next thing that we know, let's say this is a current i. 160 00:12:14,000 --> 00:12:19,000 This current i flows here. Know that there is no current 161 00:12:19,000 --> 00:12:23,000 going in here. Op amp has an infinite input 162 00:12:23,000 --> 00:12:26,000 resistance so there is nothing going in there. 163 00:12:26,000 --> 00:12:31,000 There is no current going in there. 164 00:12:31,000 --> 00:12:35,000 If there is no current going in here, what must happen to i? 165 00:12:35,000 --> 00:12:39,000 Remember, from the foundations of the universe Maxwell's 166 00:12:39,000 --> 00:12:42,000 equations and therefore KVL and KCL hold. 167 00:12:42,000 --> 00:12:45,000 KVL and KCL simply come straight from nature. 168 00:12:45,000 --> 00:12:47,000 You and I cannot mess with that. 169 00:12:47,000 --> 00:12:50,000 Bad things happen to you if you do. 170 00:12:50,000 --> 00:12:52,000 So, nature, Maxwell's equations, KVL, 171 00:12:52,000 --> 00:12:54,000 KCL. It's simply nature. 172 00:12:54,000 --> 00:12:59,000 So, KCL applies here. Current comes in here. 173 00:12:59,000 --> 00:13:01,000 Nothing goes there. Don't argue. 174 00:13:01,000 --> 00:13:04,000 The current has to go here, period. 175 00:13:04,000 --> 00:13:08,000 No if, ands or buts. There is i coming in here, 176 00:13:08,000 --> 00:13:12,000 nothing goes there, so that current must flow here. 177 00:13:12,000 --> 00:13:16,000 It has no choice. It's from basic nature. 178 00:13:16,000 --> 00:13:21,000 I can write down what my current i is going to look like. 179 00:13:21,000 --> 00:13:24,000 What is i going to look like? Well, I know v2, 180 00:13:24,000 --> 00:13:30,000 I know v minus. v minus is the same as v plus. 181 00:13:30,000 --> 00:13:33,000 And v plus is the i expression given here. 182 00:13:33,000 --> 00:13:38,000 So, I can write i as v2 minus v minus divided by R1. 183 00:13:38,000 --> 00:13:44,000 Let me keep track of those two and then go ahead and compute 184 00:13:44,000 --> 00:13:47,000 vOUT. So, my goal in life is compute 185 00:13:47,000 --> 00:13:52,000 vOUT as a function of the two input voltages v1 and v2. 186 00:13:52,000 --> 00:13:58,000 And just for kicks I have gone ahead and computed some of the 187 00:13:58,000 --> 00:14:03,000 intermediate node voltages and currents. 188 00:14:03,000 --> 00:14:08,000 How do I write vOUT? What is vOUT? 189 00:14:08,000 --> 00:14:12,000 vOUT is simply v minus from KVL. 190 00:14:12,000 --> 00:14:21,000 vOUT is simply v minus minus the drop across this resistor. 191 00:14:21,000 --> 00:14:30,000 So, the drop across that resistor is simply iR2. 192 00:14:30,000 --> 00:14:33,000 From good-old KVL from the first lecture, 193 00:14:33,000 --> 00:14:37,000 a voltage minus the drop across the resistor is equal to vOUT. 194 00:14:37,000 --> 00:14:40,000 Therefore it's simply v minus minus iR2. 195 00:14:40,000 --> 00:14:45,000 One thing to be very cautious about, I will tell you right 196 00:14:45,000 --> 00:14:49,000 now, is that the output here relates to the inversion of the 197 00:14:49,000 --> 00:14:54,000 voltage across this resistor R2. Be very, very careful in that 198 00:14:54,000 --> 00:14:59,000 if I have a voltage across this resistor here that impacts vOUT 199 00:14:59,000 --> 00:15:03,000 with a minus sign attached to it. 200 00:15:03,000 --> 00:15:08,000 Notice that iR2 is the voltage across R2 and vOUT relates to 201 00:15:08,000 --> 00:15:12,000 the negative of that. Be very cautious. 202 00:15:12,000 --> 00:15:18,000 That's one of the commonest silly mistakes I have seen 203 00:15:18,000 --> 00:15:22,000 people make in solving problems like this. 204 00:15:22,000 --> 00:15:27,000 Let's go ahead. I know v minus and I don't know 205 00:15:27,000 --> 00:15:29,000 i. Let me substitute for i for 206 00:15:29,000 --> 00:15:37,000 now, and that is v2 minus v minus divided by R1 times R2. 207 00:15:37,000 --> 00:15:43,000 Let me go ahead and collect all the v minuses. 208 00:15:43,000 --> 00:15:51,000 v minus, I get a one here, minus minus becomes a plus, 209 00:15:51,000 --> 00:15:56,000 and so I get R2 divided by R1 out there. 210 00:15:56,000 --> 00:16:03,000 And then I minus v2 R2 divided by R1. 211 00:16:03,000 --> 00:16:08,000 That is vOUT. Now let me go ahead and 212 00:16:08,000 --> 00:16:15,000 substitute for v minus. And that is simply v1 R2 213 00:16:15,000 --> 00:16:20,000 divided by R1 plus R2. That is v minus. 214 00:16:20,000 --> 00:16:27,000 And this character here is simplified to be R1, 215 00:16:27,000 --> 00:16:34,000 R1 plus R2 minus v2 R2 divided by R1. 216 00:16:34,000 --> 00:16:39,000 What do we get? I cancel these two suckers out 217 00:16:39,000 --> 00:16:46,000 and what I end up with is v1 R2 divided by R1 minus v2 R2 218 00:16:46,000 --> 00:16:51,000 divided by R1, which is simply R2/R1(v1-v2). 219 00:16:51,000 --> 00:16:58,000 What is interesting here is that what I have ended up 220 00:16:58,000 --> 00:17:04,000 building is a very primitive subtractor. 221 00:17:04,000 --> 00:17:08,000 So, my output relates to v1 minus v2 multiplied by the 222 00:17:08,000 --> 00:17:13,000 constant factor given by R2 divided by R1. 223 00:17:19,000 --> 00:17:22,000 Again, as I pointed out to you at the beginning of this 224 00:17:22,000 --> 00:17:25,000 lecture, no knew foundations today, no new theories, 225 00:17:25,000 --> 00:17:26,000 no new disciplines, no new laws. 226 00:17:26,000 --> 00:17:30,000 We are just going to take what you have learned -- 227 00:17:30,000 --> 00:17:32,000 Three simple things, infinite gain, 228 00:17:32,000 --> 00:17:36,000 infinite input resistance, zero output resistance, 229 00:17:36,000 --> 00:17:39,000 plus this new thing v plus equals v minus. 230 00:17:39,000 --> 00:17:44,000 And just being armed with those four principles we are just 231 00:17:44,000 --> 00:17:48,000 going to charge ahead and analyze a bunch of circuits. 232 00:17:48,000 --> 00:17:52,000 It is purely intellectual and pure applications today. 233 00:17:52,000 --> 00:17:56,000 This is one way of doing it. There is another way of solving 234 00:17:56,000 --> 00:18:00,000 it. We can solve the circuit. 235 00:18:00,000 --> 00:18:04,000 Remember, whenever you see a linear circuit and you see two 236 00:18:04,000 --> 00:18:09,000 sources or three sources, just think superposition, 237 00:18:09,000 --> 00:18:12,000 right? You see a linear circuit and 238 00:18:12,000 --> 00:18:15,000 two or three sources, think superposition. 239 00:18:15,000 --> 00:18:19,000 We should be able to apply superposition to this. 240 00:18:19,000 --> 00:18:23,000 The op amp is simply another building block. 241 00:18:23,000 --> 00:18:27,000 It's a linear circuit. So, let's see if we get the 242 00:18:27,000 --> 00:18:33,000 same answer. Let's try to solve the circuit 243 00:18:33,000 --> 00:18:38,000 using superposition and see if we get the same answer. 244 00:18:38,000 --> 00:18:43,000 To do superposition what I am going to do is build two 245 00:18:43,000 --> 00:18:48,000 subcircuits. One subcircuit in which v1 is 246 00:18:48,000 --> 00:18:52,000 zero, and that subcircuit looks like this. 247 00:18:52,000 --> 00:18:58,000 If I set v1 to be zero then I get R1 parallel R2 going to 248 00:18:58,000 --> 00:19:03,000 ground. So, if v1 is set to zero then 249 00:19:03,000 --> 00:19:09,000 R1 goes to ground. And I get R1 parallel R2 here. 250 00:19:09,000 --> 00:19:13,000 And of course I have v2 as before. 251 00:19:13,000 --> 00:19:16,000 And this was R1, this was R2, 252 00:19:16,000 --> 00:19:21,000 and let me call that vOUT1. Oh, I'm sorry. 253 00:19:21,000 --> 00:19:28,000 Let me call it vOUT2 corresponding to that component 254 00:19:28,000 --> 00:19:35,000 of the output that relates to v2 acting alone. 255 00:19:35,000 --> 00:19:38,000 Remember superposition? Build two subcircuits, 256 00:19:38,000 --> 00:19:43,000 one that depends on v2 and another one that depends on v1. 257 00:19:43,000 --> 00:19:46,000 Let's do the second one, too. 258 00:19:46,000 --> 00:19:51,000 Second one is v2 going to zero. Here is my little op amp. 259 00:19:51,000 --> 00:19:56,000 And what I will do is simply flip the op amp just to see if 260 00:19:56,000 --> 00:20:01,000 you can identify some interesting patterns. 261 00:20:01,000 --> 00:20:07,000 Just flip the op amp around. And this is v1 as before. 262 00:20:07,000 --> 00:20:15,000 And recall that v1 was going to the plus node through a resistor 263 00:20:15,000 --> 00:20:19,000 R1. And then I had a R2 to ground. 264 00:20:19,000 --> 00:20:23,000 And then let me short v2 to ground. 265 00:20:23,000 --> 00:20:30,000 And when I short v2 to ground what happens? 266 00:20:30,000 --> 00:20:35,000 When I short v2 to ground what happens is that the tail of R1 267 00:20:35,000 --> 00:20:40,000 here goes to ground. And so it is as if the output 268 00:20:40,000 --> 00:20:44,000 is connected to the node v minus through a resistor, 269 00:20:44,000 --> 00:20:50,000 so it as if the output v R2 is connected to the minus input 270 00:20:50,000 --> 00:20:54,000 through a resistor. We will draw it like this. 271 00:20:54,000 --> 00:20:58,000 And the minus input goes through a resistor R1, 272 00:20:58,000 --> 00:21:02,000 to ground. If you thought that patterns 273 00:21:02,000 --> 00:21:07,000 were important in the earlier part of the course doing voltage 274 00:21:07,000 --> 00:21:11,000 divider patterns and current divider patterns and amplifier 275 00:21:11,000 --> 00:21:14,000 pattern, the source follower pattern, op amps is all about 276 00:21:14,000 --> 00:21:17,000 patterns. You should remember two or 277 00:21:17,000 --> 00:21:20,000 three simple patterns and be able to write down the 278 00:21:20,000 --> 00:21:23,000 expression for those just by observation. 279 00:21:23,000 --> 00:21:27,000 So, this is one common pattern that you have seen before in the 280 00:21:27,000 --> 00:21:32,000 very first lecture. And I just wrote it down in 281 00:21:32,000 --> 00:21:35,000 that manner. Let me go ahead and solve this 282 00:21:35,000 --> 00:21:37,000 circuit. It turns out that this is also 283 00:21:37,000 --> 00:21:40,000 a pattern. I will analyze it today but in 284 00:21:40,000 --> 00:21:45,000 the future v2 going to this node through R1 and then R2 to the 285 00:21:45,000 --> 00:21:47,000 output. You have probably also seen 286 00:21:47,000 --> 00:21:52,000 this in your recitation. This one is called an inverting 287 00:21:52,000 --> 00:21:55,000 connection and this one here is called a non-inverting 288 00:21:55,000 --> 00:22:00,000 connection. Let's go ahead and do vOUT2. 289 00:22:00,000 --> 00:22:05,000 vOUT2 is simply given by, notice that since this is 290 00:22:05,000 --> 00:22:10,000 ground, no current flowing here, this voltage is zero. 291 00:22:10,000 --> 00:22:15,000 If this voltage is zero, this voltage is zero by the v 292 00:22:15,000 --> 00:22:19,000 plus equals v minus method. If this is zero, 293 00:22:19,000 --> 00:22:25,000 the current that goes through here is v2 divided by R1. 294 00:22:25,000 --> 00:22:31,000 And that same current must flow through the resistance R2 as 295 00:22:31,000 --> 00:22:35,000 well. If the current v2 divided by R1 296 00:22:35,000 --> 00:22:40,000 flows through this resistor, the drop across this resistor 297 00:22:40,000 --> 00:22:44,000 is simply given by, let me hide this for a second, 298 00:22:44,000 --> 00:22:48,000 is simply given by v2. So, v2 divided by R1 is the 299 00:22:48,000 --> 00:22:50,000 current here. This is zero. 300 00:22:50,000 --> 00:22:54,000 So, the drop across this resistor is v2 R1 multiplied by 301 00:22:54,000 --> 00:22:57,000 R2. That's a drop across this 302 00:22:57,000 --> 00:23:01,000 resistor. This voltage is simply zero 303 00:23:01,000 --> 00:23:03,000 minus a drop across the resistor. 304 00:23:03,000 --> 00:23:08,000 So, it's zero minus the drop across the resistor and that 305 00:23:08,000 --> 00:23:11,000 gives me v2. Again, remember this minus sign 306 00:23:11,000 --> 00:23:16,000 comes in when I want to convert this to get the output voltage 307 00:23:16,000 --> 00:23:20,000 from that. This is a very common pattern. 308 00:23:20,000 --> 00:23:24,000 It's called an inverting connection where the output is 309 00:23:24,000 --> 00:23:29,000 some factor of the input voltage and the factor is given by R2 310 00:23:29,000 --> 00:23:35,000 divided by R1. Let's go ahead and analyze this 311 00:23:35,000 --> 00:23:39,000 guy now. What is vOUT1 equal to? 312 00:23:39,000 --> 00:23:47,000 I should have called this vOUT1 because it relates to v1. 313 00:23:47,000 --> 00:23:50,000 vOUT1. There is a v plus here. 314 00:23:50,000 --> 00:23:58,000 From our first lecture I know that vOUT1 relates to v plus in 315 00:23:58,000 --> 00:24:04,000 the following way. I know that it is v plus times 316 00:24:04,000 --> 00:24:08,000 the sum of the resistances divided by R1. 317 00:24:08,000 --> 00:24:12,000 Based on the first lecture this is true. 318 00:24:12,000 --> 00:24:17,000 vOUT1 is simply an amplified version of v plus where the 319 00:24:17,000 --> 00:24:23,000 amplification factor is given by R1 plus R2 divided by R1. 320 00:24:23,000 --> 00:24:30,000 And I know v plus is simply a voltage divider action here. 321 00:24:30,000 --> 00:24:35,000 And I can take a simple voltage divider action here because the 322 00:24:35,000 --> 00:24:40,000 current going in is zero. Looking in here this is as if 323 00:24:40,000 --> 00:24:45,000 it's an infinite resistance, so it is as if the element 324 00:24:45,000 --> 00:24:50,000 simply does not exist. The voltage here is simply v1 325 00:24:50,000 --> 00:24:56,000 divided by R1 plus R2 multiplied by R2, our voltage divider 326 00:24:56,000 --> 00:24:59,000 pattern. So, I get v1 times R2 divided 327 00:24:59,000 --> 00:25:05,000 by R1 plus R2 times R1 plus R2 divided by R1. 328 00:25:05,000 --> 00:25:14,000 These two cancel out which gives me vOUT1 is simply v1 R2 329 00:25:14,000 --> 00:25:21,000 divided by R1. To get vOUT I add up the two. 330 00:25:21,000 --> 00:25:28,000 vOUT is vOUT1 plus vOUT2, which is my goal. 331 00:25:28,000 --> 00:25:37,000 And that is simply v1 R2 by R1 minus v2 R2 by R1. 332 00:25:37,000 --> 00:25:40,000 Thankfully what we have here is the same as here. 333 00:25:40,000 --> 00:25:45,000 Again, there is really nothing new that I am going to cover 334 00:25:45,000 --> 00:25:47,000 today. Simply apply, 335 00:25:47,000 --> 00:25:50,000 apply, apply, four simple principles. 336 00:25:50,000 --> 00:25:55,000 Here I have used superposition and I am showing you a circuit. 337 00:25:55,000 --> 00:26:00,000 So, it turns out with op amps you should really remember that 338 00:26:00,000 --> 00:26:04,000 pattern. You will see it again and again 339 00:26:04,000 --> 00:26:07,000 and again. And each time you see it, 340 00:26:07,000 --> 00:26:11,000 it will save you six minutes of having to solve the circuit 341 00:26:11,000 --> 00:26:16,000 without knowing the pattern. So, remember this pattern. 342 00:26:16,000 --> 00:26:20,000 You can pick up another three or four minutes by remembering 343 00:26:20,000 --> 00:26:24,000 this pattern here. This pattern is simply v2 R2 344 00:26:24,000 --> 00:26:28,000 divided by R1. Imprint those two patterns into 345 00:26:28,000 --> 00:26:32,000 your brains. OK, so those are a couple of 346 00:26:32,000 --> 00:26:35,000 simple circuits using the op amp. 347 00:26:35,000 --> 00:26:38,000 We built a subtractor. The next step, 348 00:26:38,000 --> 00:26:42,000 let's go ahead and try to build an integrator. 349 00:26:42,000 --> 00:26:47,000 Using this little building block we can go ahead and try to 350 00:26:47,000 --> 00:26:51,000 build a bunch of circuits. We can build filters, 351 00:26:51,000 --> 00:26:55,000 A to D converters and so on. Let's build an integrator. 352 00:26:55,000 --> 00:27:00,000 Abstractly I need to build this box. 353 00:27:00,000 --> 00:27:04,000 Which when fed a vI, I want that box to integrate 354 00:27:04,000 --> 00:27:08,000 and give me a vO which is vI integrated over time. 355 00:27:08,000 --> 00:27:13,000 That is what I want to build. How do I go about building it? 356 00:27:13,000 --> 00:27:19,000 What I would like to do next is give you some flavor for design. 357 00:27:19,000 --> 00:27:23,000 How do you go about designing things with an op amp? 358 00:27:23,000 --> 00:27:28,000 Knowing that you do not know the pattern for this yet, 359 00:27:28,000 --> 00:27:33,000 how do you go about designing things? 360 00:27:33,000 --> 00:27:36,000 Well, let's start with the following intuition. 361 00:27:36,000 --> 00:27:41,000 The intuition that I begin with is that if I have a current i, 362 00:27:41,000 --> 00:27:46,000 and remember that capacitors and inductors related to, 363 00:27:46,000 --> 00:27:51,000 you saw differentiation and integration happening when we 364 00:27:51,000 --> 00:27:53,000 dealt with capacitors and inductors. 365 00:27:53,000 --> 00:28:00,000 So, I think we have to invoke a capacitor here or an inductor. 366 00:28:00,000 --> 00:28:04,000 In this example I invoke a capacitor. 367 00:28:04,000 --> 00:28:10,000 Notice that if I stick a capacitor in here this current 368 00:28:10,000 --> 00:28:16,000 is i, capacitance C, then my voltage vO is given by 369 00:28:16,000 --> 00:28:20,000 what? Voltage is simply the integral 370 00:28:20,000 --> 00:28:28,000 of the current flowing through it or vice versa i is C dv/dt. 371 00:28:28,000 --> 00:28:36,000 If i is C dv/dt then v is simply one by C integral. 372 00:28:36,000 --> 00:28:44,000 If I can pass the current through a capacitor then the 373 00:28:44,000 --> 00:28:52,000 voltage across the capacitor must be a current. 374 00:28:52,000 --> 00:29:00,000 Notice then that vO is related to i dt. 375 00:29:00,000 --> 00:29:02,000 I have some multiplying constants and so on, 376 00:29:02,000 --> 00:29:06,000 but fundamentally what I have found is if I can stick a 377 00:29:06,000 --> 00:29:11,000 current through a capacitor then the voltage across the capacitor 378 00:29:11,000 --> 00:29:13,000 relates to the integral of the current. 379 00:29:13,000 --> 00:29:17,000 OK, that's interesting. So, I have an integral in 380 00:29:17,000 --> 00:29:18,000 there. But I have a current. 381 00:29:18,000 --> 00:29:21,000 Notice my goal was to integrate a voltage. 382 00:29:21,000 --> 00:29:25,000 What I figured out how to do was if I can turn that voltage 383 00:29:25,000 --> 00:29:31,000 into a current -- If I can turn that voltage into 384 00:29:31,000 --> 00:29:38,000 a proportional current and then pump that current through a 385 00:29:38,000 --> 00:29:44,000 capacitor I will get the integration that I want. 386 00:29:44,000 --> 00:29:50,000 How do I convert my vI to i? How do I do that? 387 00:29:50,000 --> 00:29:55,000 Well, let's take a stab at it. Here is my vI. 388 00:29:55,000 --> 00:30:02,000 Let's take the resistor R. And remember I need to stick 389 00:30:02,000 --> 00:30:06,000 the capacitor here. I have some current I here. 390 00:30:06,000 --> 00:30:09,000 I don't know what the current is yet. 391 00:30:09,000 --> 00:30:13,000 And I stick a voltage here. And what I am trying to do is 392 00:30:13,000 --> 00:30:18,000 trying to see if I stick a voltage and a resistance in 393 00:30:18,000 --> 00:30:23,000 series then there is some relationship between the current 394 00:30:23,000 --> 00:30:27,000 and this voltage. Recall that I am trying to make 395 00:30:27,000 --> 00:30:33,000 this current be directly proportional to the voltage vI. 396 00:30:33,000 --> 00:30:38,000 But it turns out that i here is not equal to vI divided by R. 397 00:30:38,000 --> 00:30:42,000 If i was vI divided by R somehow, I am done. 398 00:30:42,000 --> 00:30:46,000 If i was vI divided by R, by some magic, 399 00:30:46,000 --> 00:30:50,000 then I have converted my voltage to a current, 400 00:30:50,000 --> 00:30:56,000 I feed that current through my capacitor and vO is my integral 401 00:30:56,000 --> 00:31:01,000 that I am looking for. But unfortunately i is not 402 00:31:01,000 --> 00:31:04,000 equal to vI divided by R. You know that. 403 00:31:04,000 --> 00:31:09,000 i relates to vI minus the capacitor voltage divided by R. 404 00:31:09,000 --> 00:31:14,000 So, i is not simply vI divided by R for all time but i is 405 00:31:14,000 --> 00:31:19,000 really vI minus the capacitor voltage divided by R. 406 00:31:19,000 --> 00:31:22,000 And, in fact, when we did RC circuits you 407 00:31:22,000 --> 00:31:28,000 wrote this equation to represent the dynamics of the circuit, 408 00:31:28,000 --> 00:31:34,000 RC dvO by dt plus vO equals vI. We wrote down this circuit for 409 00:31:34,000 --> 00:31:39,000 a first order RC, wrote this equation for a first 410 00:31:39,000 --> 00:31:43,000 order RC circuit. Now, it does turn out, 411 00:31:43,000 --> 00:31:48,000 to wrap up on this wild goose chase that we went on, 412 00:31:48,000 --> 00:31:53,000 it does turn out that if this term here is much bigger than 413 00:31:53,000 --> 00:31:57,000 that term. If this term is much bigger 414 00:31:57,000 --> 00:32:03,000 than that term then I can ignore that term and write down RC dvO 415 00:32:03,000 --> 00:32:10,000 by dt more or less equal to vI. If that were true, 416 00:32:10,000 --> 00:32:15,000 this would be true, and then vO would be more or 417 00:32:15,000 --> 00:32:20,000 less equal to one by RC integral of vI dt. 418 00:32:20,000 --> 00:32:27,000 Again, if this were true. If this were true for all time 419 00:32:27,000 --> 00:32:32,000 then vO would be integral of vI dt. 420 00:32:32,000 --> 00:32:35,000 Again, remember this is all a wild goose chase. 421 00:32:35,000 --> 00:32:39,000 Just write down WGC there just so you don't get confused. 422 00:32:39,000 --> 00:32:43,000 I am on this wild goose hunt here trying to find a way to get 423 00:32:43,000 --> 00:32:48,000 a current from a voltage which I can then feed into a capacitor. 424 00:32:48,000 --> 00:32:52,000 This was one thing I knew, but this was not what I want. 425 00:32:52,000 --> 00:32:56,000 But it does turn out to be what I want when vO is very, 426 00:32:56,000 --> 00:32:58,000 very small. So, I see some glimmer of hope 427 00:32:58,000 --> 00:33:03,000 but not quite. It turns that in R and C, 428 00:33:03,000 --> 00:33:08,000 if I make R and C very, very big, if I have a huge time 429 00:33:08,000 --> 00:33:12,000 constant, with a huge time constant the voltage vO looks 430 00:33:12,000 --> 00:33:17,000 like an integral of vI, but only when I have a very 431 00:33:17,000 --> 00:33:21,000 huge time constant. So, I give up on that track. 432 00:33:21,000 --> 00:33:25,000 Instead I try something else. 433 00:33:34,000 --> 00:33:38,000 Another try. I would like you to notice if 434 00:33:38,000 --> 00:33:42,000 you take your op amp, here is your op amp, 435 00:33:42,000 --> 00:33:48,000 if you take this op amp and you stick the positive terminal to 436 00:33:48,000 --> 00:33:53,000 ground, under reasonable feedback, under reasonable 437 00:33:53,000 --> 00:34:00,000 negative feedback what do you notice about the current? 438 00:34:00,000 --> 00:34:04,000 If I had a current i flowing here what did you notice? 439 00:34:04,000 --> 00:34:09,000 Look at this picture. I had a current i flowing in 440 00:34:09,000 --> 00:34:14,000 here, v2 divided by R1. And because this resistance was 441 00:34:14,000 --> 00:34:19,000 infinite all the current went through the upper terminal. 442 00:34:19,000 --> 00:34:24,000 So, this is zero volts. And by the v plus equals v 443 00:34:24,000 --> 00:34:30,000 minus method this is also more or less equal to zero. 444 00:34:30,000 --> 00:34:35,000 And I have a current i flowing in here, nothing goes here, 445 00:34:35,000 --> 00:34:37,000 so then the i must flow up there. 446 00:34:37,000 --> 00:34:42,000 So, all I am doing here is causing a reflection of the 447 00:34:42,000 --> 00:34:48,000 current from this grounded node. My current is being reflected 448 00:34:48,000 --> 00:34:53,000 into, or deflected if you feel like it, the upper edge here 449 00:34:53,000 --> 00:34:56,000 after coming in through this edge. 450 00:34:56,000 --> 00:35:00,000 That is interesting. We are just one step away from 451 00:35:00,000 --> 00:35:02,000 the key insight. 452 00:35:10,000 --> 00:35:14,000 I have an i coming in here, an i going out there. 453 00:35:14,000 --> 00:35:16,000 Notice that, as I said before, 454 00:35:16,000 --> 00:35:21,000 this is zero volts. How do I get my voltage vI to 455 00:35:21,000 --> 00:35:25,000 look like a current, to become proportional to a 456 00:35:25,000 --> 00:35:27,000 current? It is simple now. 457 00:35:27,000 --> 00:35:34,000 All I do is put a voltage vI and put a resistor R out there. 458 00:35:34,000 --> 00:35:36,000 If I do that, and since this is zero, 459 00:35:36,000 --> 00:35:39,000 the current i is given by vI divided by R. 460 00:35:39,000 --> 00:35:42,000 I have gotten to where I want to be. 461 00:35:42,000 --> 00:35:46,000 So, by using an op amp and using the fact that the minus 462 00:35:46,000 --> 00:35:51,000 node here, v minus is at the same potential as v plus when 463 00:35:51,000 --> 00:35:55,000 there is negative feedback then I can stick a resistor here. 464 00:35:55,000 --> 00:35:59,000 And because this is zero the current here is simply vI 465 00:35:59,000 --> 00:36:04,000 divided by R. I have gotten to the first 466 00:36:04,000 --> 00:36:07,000 place. Now all I need to do is simply 467 00:36:07,000 --> 00:36:13,000 pump this current through a capacitor and I get the integral 468 00:36:13,000 --> 00:36:18,000 of the, the voltage becomes an integral of the current. 469 00:36:18,000 --> 00:36:22,000 That is easy. I stick my capacitor here and I 470 00:36:22,000 --> 00:36:27,000 get my answer out there as vO. Notice that when I do this, 471 00:36:27,000 --> 00:36:32,000 let's say this is plus/minus VC. 472 00:36:32,000 --> 00:36:34,000 This is zero. So, vO is minus VC. 473 00:36:34,000 --> 00:36:38,000 Again, I will keep emphasizing it maybe 17 times throughout 474 00:36:38,000 --> 00:36:43,000 this course that if this is zero then the output here is related 475 00:36:43,000 --> 00:36:47,000 to the negative of this voltage, common, common, 476 00:36:47,000 --> 00:36:50,000 common mistake. I will be very upset after 477 00:36:50,000 --> 00:36:54,000 doing all this if I see this mistake happen in any of the 478 00:36:54,000 --> 00:36:57,000 future homeworks or finals or whatever. 479 00:36:57,000 --> 00:37:05,000 This should not happen. So, vO is a minus sign here VC. 480 00:37:05,000 --> 00:37:15,000 And I know that if I have a current i through a capacitor 481 00:37:15,000 --> 00:37:22,000 what is VC? If I have current i through a 482 00:37:22,000 --> 00:37:29,000 capacitor than this is simply t i dt. 483 00:37:29,000 --> 00:37:36,000 And i by design is -- So, I have my integrator. 484 00:37:36,000 --> 00:37:40,000 It is a two-step process. I stuck a resistor here, 485 00:37:40,000 --> 00:37:44,000 so the current became equal to vI divided by R. 486 00:37:44,000 --> 00:37:49,000 Then I took that current and pumped it through a capacitor 487 00:37:49,000 --> 00:37:54,000 through this terminal here, and the voltage across the 488 00:37:54,000 --> 00:38:00,000 capacitor for a current i is given by this expression. 489 00:38:00,000 --> 00:38:04,000 This is Capacitors 101. OK Capacitors 101 says that the 490 00:38:04,000 --> 00:38:09,000 voltage across the capacitor is simply one by C integral i dt. 491 00:38:09,000 --> 00:38:14,000 Another way of looking at it is the voltage across the capacitor 492 00:38:14,000 --> 00:38:17,000 is C, I'm sorry, the current through a capacitor 493 00:38:17,000 --> 00:38:20,000 is C dv/dt. This is simply the integral 494 00:38:20,000 --> 00:38:24,000 form of that equation. And I am done with my 495 00:38:24,000 --> 00:38:27,000 integrator. So, this is another very common 496 00:38:27,000 --> 00:38:31,000 building block. Remember this. 497 00:38:31,000 --> 00:38:36,000 Most of the circuits we will be seeing with op amps simply 498 00:38:36,000 --> 00:38:39,000 involve something here and some there. 499 00:38:39,000 --> 00:38:43,000 And the output in this inverting connection is the 500 00:38:43,000 --> 00:38:47,000 output times, if it is a resistance it is 501 00:38:47,000 --> 00:38:51,000 simply R2 divided by R1, if it's a capacitor I get the 502 00:38:51,000 --> 00:38:56,000 integral form looking like this. Yes. 503 00:39:01,000 --> 00:39:05,000 Can someone tell me where the negative sign went? 504 00:39:05,000 --> 00:39:10,000 The blackboard ate it up. Good catch. 505 00:39:27,000 --> 00:39:30,000 After all that lecture about watching the negative sign. 506 00:39:30,000 --> 00:39:34,000 After this little bit of faux pas here, now I will be doubly 507 00:39:34,000 --> 00:39:36,000 mad if you guys make that mistake. 508 00:39:36,000 --> 00:39:38,000 All right. Now that we have built the 509 00:39:38,000 --> 00:39:42,000 integrator, I could give this out as a homework problem. 510 00:39:42,000 --> 00:39:45,000 And you should be able to design a differentiator based on 511 00:39:45,000 --> 00:39:49,000 what you've learned here. You now have the tools to go 512 00:39:49,000 --> 00:39:52,000 and do some design like this, but we don't have any more 513 00:39:52,000 --> 00:39:56,000 homeworks left so I guess I will go ahead and solve this for you 514 00:39:56,000 --> 00:40:00,000 right here and do the design for you. 515 00:40:00,000 --> 00:40:06,000 The building block that we need looks like this, 516 00:40:06,000 --> 00:40:11,000 d/dt here. Let me take a vI and stick a vI 517 00:40:11,000 --> 00:40:16,000 in there. That's what I want to build. 518 00:40:16,000 --> 00:40:23,000 And what I built here is that different integrator box. 519 00:40:23,000 --> 00:40:33,000 And what I would like to do now is build a differentiator box. 520 00:40:33,000 --> 00:40:37,000 How do I go about doing it? I will go really slow here so 521 00:40:37,000 --> 00:40:42,000 you will have some time to think about it for yourselves and see 522 00:40:42,000 --> 00:40:46,000 if you folks are crack op amp circuit designers already, 523 00:40:46,000 --> 00:40:49,000 if you have the right instincts here. 524 00:40:49,000 --> 00:40:53,000 Again, when you see differentiation integration 525 00:40:53,000 --> 00:40:57,000 think capacitors or inductors, it doesn't matter. 526 00:40:57,000 --> 00:41:00,000 In fact, as a homework exercise, you may want to go 527 00:41:00,000 --> 00:41:07,000 back and see how you can get a similar effect using inductors. 528 00:41:07,000 --> 00:41:11,000 Can you play with inductors and get a similar effect? 529 00:41:11,000 --> 00:41:15,000 So, inductors are devices that are a dual of the capacitor. 530 00:41:15,000 --> 00:41:20,000 Whatever we will do with capacitors, there must be a 531 00:41:20,000 --> 00:41:22,000 corresponding way with inductors. 532 00:41:22,000 --> 00:41:25,000 You can try it out in your spare time. 533 00:41:25,000 --> 00:41:33,000 Let's go back to this one here. I will stick with the capacitor 534 00:41:33,000 --> 00:41:40,000 way of looking at things. I need a differentiation now. 535 00:41:40,000 --> 00:41:45,000 Remember this. If I have a vI and I stick this 536 00:41:45,000 --> 00:41:51,000 across a capacitor, I have a current C and some 537 00:41:51,000 --> 00:42:00,000 voltage vc across the capacitor, what does i relate to? 538 00:42:00,000 --> 00:42:09,000 i is simply C dv/dt and vc in this case is simply C dvI/dt. 539 00:42:09,000 --> 00:42:18,000 If I can stick a voltage across a capacitor, if my input voltage 540 00:42:18,000 --> 00:42:28,000 is stuck across a capacitor then the resulting current relates to 541 00:42:28,000 --> 00:42:33,000 dvI/dt. Here we have the opposite 542 00:42:33,000 --> 00:42:36,000 problem. By doing this simple trick, 543 00:42:36,000 --> 00:42:41,000 I can obtain a current that has the right form. 544 00:42:41,000 --> 00:42:46,000 Now what I need to do is somehow convert that current 545 00:42:46,000 --> 00:42:51,000 into a voltage because the abstraction that I need is a 546 00:42:51,000 --> 00:42:54,000 voltage to voltage. The next step, 547 00:42:54,000 --> 00:42:59,000 what I need to do is somehow convert a current to a voltage. 548 00:42:59,000 --> 00:43:07,000 How do I go about doing that? Again, remember for the op amp, 549 00:43:07,000 --> 00:43:14,000 if I have a current i flowing here then by the reflection 550 00:43:14,000 --> 00:43:22,000 property i gets pushed up into this edge, provided that the 551 00:43:22,000 --> 00:43:30,000 whole circuit is working with descent negative feedback. 552 00:43:30,000 --> 00:43:35,000 Given this trick what I can do is say look, suppose I did this. 553 00:43:35,000 --> 00:43:40,000 Remember, my goal here is how do I convert a current to a 554 00:43:40,000 --> 00:43:43,000 voltage? I have a current i coming in 555 00:43:43,000 --> 00:43:48,000 here, and I can turn that into a voltage because I know the 556 00:43:48,000 --> 00:43:54,000 current must come out here, I know this current must come 557 00:43:54,000 --> 00:43:57,000 out there. All I have to do is stick a 558 00:43:57,000 --> 00:44:03,000 resistor in there. If I stick a resistor in there 559 00:44:03,000 --> 00:44:08,000 what is vO equal to? vO is simply iR, 560 00:44:08,000 --> 00:44:11,000 right? That's right. 561 00:44:11,000 --> 00:44:16,000 vO, I get i here, so i pumps through here. 562 00:44:16,000 --> 00:44:24,000 Remember, what comes in here must get reflected up because 563 00:44:24,000 --> 00:44:30,000 the current going in here is zero. 564 00:44:30,000 --> 00:44:35,000 All the i must come out here. So, that i must pump through 565 00:44:35,000 --> 00:44:40,000 this resistor. The drop across this resistor 566 00:44:40,000 --> 00:44:43,000 is iR. That's the voltage drop across 567 00:44:43,000 --> 00:44:47,000 that resistor. And since this at a virtual 568 00:44:47,000 --> 00:44:53,000 ground the output here is simply zero minus this drop which is 569 00:44:53,000 --> 00:44:57,000 minus iR. So, I have gotten to where I 570 00:44:57,000 --> 00:45:02,000 want to be. I have my current i being 571 00:45:02,000 --> 00:45:06,000 converted to a voltage. I have taken my current, 572 00:45:06,000 --> 00:45:11,000 and I have been able to convert that into a voltage by sticking 573 00:45:11,000 --> 00:45:14,000 a resistor in here. As a final step, 574 00:45:14,000 --> 00:45:18,000 I simply need to produce the current. 575 00:45:18,000 --> 00:45:23,000 And that is pretty easy to do. Abstractly what I need to do, 576 00:45:23,000 --> 00:45:28,000 again, this is design here so we will talk about abstract 577 00:45:28,000 --> 00:45:32,000 stuff. If I had a voltage vI, 578 00:45:32,000 --> 00:45:39,000 I need to produce a current which relates to C dvI/dt. 579 00:45:39,000 --> 00:45:44,000 And I know I can do that by simply doing this. 580 00:45:44,000 --> 00:45:50,000 By doing this I know my i is C dvI, correct? 581 00:45:50,000 --> 00:45:56,000 If I can get this effect, I put this in quotes because 582 00:45:56,000 --> 00:46:03,000 that's my pattern. I am looking for a pattern, 583 00:46:03,000 --> 00:46:10,000 where a voltage vI is directly applied across a capacitor. 584 00:46:10,000 --> 00:46:17,000 And when that happens the current relates to C dv/dt. 585 00:46:17,000 --> 00:46:22,000 Let's go back to our op amp pattern here, 586 00:46:22,000 --> 00:46:29,000 op amp circuit. So far I have achieved -- 587 00:46:29,000 --> 00:46:33,000 I just repeated this out there. And so somehow I need to take 588 00:46:33,000 --> 00:46:38,000 this pattern here and learn from that pattern and apply the 589 00:46:38,000 --> 00:46:40,000 pattern here. So, what I can do is, 590 00:46:40,000 --> 00:46:43,000 this is a ground node, correct? 591 00:46:43,000 --> 00:46:47,000 Now, the poor little capacitor, what does it care, 592 00:46:47,000 --> 00:46:51,000 whether it's a ground node or a virtual ground node? 593 00:46:51,000 --> 00:46:55,000 As long as it's a zero volt node down here what does it 594 00:46:55,000 --> 00:46:59,000 care? What I am going to do is stick 595 00:46:59,000 --> 00:47:04,000 this point, not here but into a virtual ground node. 596 00:47:04,000 --> 00:47:10,000 I am going to grab that point, take it here and stick it here. 597 00:47:10,000 --> 00:47:14,000 The poor little capacitor doesn't know the difference. 598 00:47:14,000 --> 00:47:18,000 I have really suckered the little beast. 599 00:47:18,000 --> 00:47:20,000 This is vI. Remember this. 600 00:47:20,000 --> 00:47:25,000 My i through the capacitor is proportional to C dv/dt. 601 00:47:25,000 --> 00:47:31,000 Instead what I have done is taken this guy and stuck it here 602 00:47:31,000 --> 00:47:36,000 to get something like this. Just remember these four or 603 00:47:36,000 --> 00:47:39,000 five little tricks. And you apply them in op amp 604 00:47:39,000 --> 00:47:42,000 circuits again and again and again and again. 605 00:47:42,000 --> 00:47:45,000 So, this is vI, this is my virtual ground. 606 00:47:45,000 --> 00:47:48,000 As far as this poor little capacitor is concerned, 607 00:47:48,000 --> 00:47:52,000 it is chugging along merrily thinking that it is connected to 608 00:47:52,000 --> 00:47:55,000 ground. Little does it know it is only 609 00:47:55,000 --> 00:47:58,000 a virtual ground, all right? 610 00:47:58,000 --> 00:48:03,000 But the current i here is simply C dvI/dt. 611 00:48:03,000 --> 00:48:08,000 And that current, the C dvI/dt, 612 00:48:08,000 --> 00:48:15,000 that current flows through here and gives me vO as iR. 613 00:48:15,000 --> 00:48:23,000 So, vO is simply minus R. Let me substitute for i there, 614 00:48:23,000 --> 00:48:29,000 C dvI/dt. OK, so notice then that my vO 615 00:48:29,000 --> 00:48:37,000 is now proportional to dvI/dt. So, vO is some RC time constant 616 00:48:37,000 --> 00:48:41,000 times dvI/dt. Therefore, I have my 617 00:48:41,000 --> 00:48:45,000 differentiator circuit. Remember this as a closing 618 00:48:45,000 --> 00:48:49,000 thought. Remember this v plus more or 619 00:48:49,000 --> 00:48:54,000 less equal to v minus trick. And to the extent possible 620 00:48:54,000 --> 00:48:59,000 simply use that trick to analyze op amp circuits under feedback 621 00:48:59,000 --> 00:49:04,000 and not in saturation. Just remember these two. 622 00:49:04,000 --> 00:49:09,000 Very quickly for the demo, I have a square wave input here 623 00:49:09,000 --> 00:49:12,000 to the op amp, that's my vI to the integrator. 624 00:49:12,000 --> 00:49:16,000 And this is the output vO. The integral of a square wave 625 00:49:16,000 --> 00:49:19,000 is a triangular wave, as you can see. 626 00:49:19,000 --> 00:49:22,000 And we will do the same thing for a differentiator. 627 00:49:22,000 --> 00:49:27,000 And for the differentiator, I input the square wave to this 628 00:49:27,000 --> 00:49:31,000 differentiator circuit. And I get this, 629 00:49:31,000 --> 00:49:35,000 wherever there is a sharp rise, I get this huge negative spike 630 00:49:35,000 --> 00:49:39,000 and a positive spike because of the minus sign. 631 00:49:39,000 --> 00:49:41,000 So, this is the differentiator circuit. 632 00:49:41,000 --> 00:49:44,000 Then I feed this into the op amp. 633 00:49:44,000 --> 00:49:47,000 OK. Thank you.