 Welcome to lecture 14 of basic electrical circuits. In the previous two lectures, we looked at two port parameters, how to calculate them for different kinds of circuits. So you should now be able to calculate two port parameters of any resistive circuits or any linear circuit actually. And if you have a purely resistive circuit because of reciprocity, there will always be some relationship between parameter 2 1 and parameter 1 2, okay. Now in this lecture, what we will do is to go to a different topic, namely that of op-amps or operational amplifiers, which are a very, very useful circuit block in designing, I mean, and they are used in designing various kinds of electrical circuits, okay. What is an operational amplifier? It is just a voltage control voltage source and because it is a block that is used so often, it has a symbol of its own, which is given by this. This is really equivalent to, I will call this in P for positive inputs, in M for negative input and out and this is equivalent to in P and in M and a voltage controlled voltage source, okay. And what does the voltage controlled voltage source give out? It gives the voltage proportional to this and it is multiplied by a very large gain, okay, a naught times Vx. So the output voltage here will be a naught times Vx, where Vx is this voltage measured with this polarity, okay. So this is an operational amplifier and in this course in particular, we will not worry too much about the internal details of the opamp or any non-ideal feature, we will be dealing mostly with what is known as an ideal opamp and what is an ideal opamp? An ideal opamp is one in which a naught tends to infinity, okay. We will later see why this is a very useful property. This is okay, any questions so far? I just defined the opamp as a voltage controlled voltage source, okay. So now what we will do is to look at certain techniques of circuit analysis when opamps are present, okay. Because an opamp is a voltage controlled voltage source, you can simply replace the opamp by a VCVS of appropriate gain and then use it, okay. This is certainly possible, okay. Now what we want to do is to see in case of an ideal opamp, if a simpler method of analysis can be found, okay. Now for this, I am going to take a circuit example of an example of a circuit that uses opamps and that turns out to be an amplifier, a kind of amplifier which is used very often. It is known as a non-inverting amplifier, okay. The circuit for that is given by something like this. This is the input voltage. Now this symbol means ground and these are all connected together. Sometimes just to avoid clutter in the schematic, you take the reference node of the circuit and you do not explicitly connect them together but this means that this is connected to this, okay. And whenever we say that there is a voltage at some node, without specifying two nodes, it is implied that it is with respect to the reference node, okay. So VI is applied between this node and the reference node and VO is obtained between the output node and the reference node, okay. And let us say this is some resistor R2 and this is some resistor R1, okay. Now first of all, let us assume that the opamp is a voltage controlled voltage source and analyze this, okay. So that you should be able to do this by assuming some voltage Vx here and that means that a voltage A0 Vx appears over there, okay. Now since this is the first opamp circuit we are analyzing, I am going to rewrite the circuit with the voltage controlled voltage source, okay. So this is a voltage controlled voltage source of A0 Vx where Vx is the voltage between that node and that node, okay. Is this clear? Any questions about the circuit itself? Any questions about the circuit? Okay. And please try to answer this question. If the voltage at this node is V0, what is the voltage at this node, okay. That is at the junction of R1 and R2, what is the voltage? Please try and answer this question. Anyone? The voltage at this node, if the voltage here is V0. So it is very easy to calculate this. The current in these two resistors is the same because this is connected to an opamp circuit and no current is going there, okay. So this current here is V0 by R1 plus R2, okay. So R1 and R2 are in series and the voltage across this is this current times R1. So it is V0 R1 by R1 plus R2, okay. Then what is the value of Vx? That is the voltage between this node which has a voltage of Vi and this node which has a voltage of V0 R1 by R1 plus R2, okay. So Vx equals Vi minus V0 R1 by R1 plus R2, okay. And here we see that this voltage control voltage source is giving a value of V0 Vx and that is the actual output voltage V0, okay. So we have defined V0 to be the output voltage of the opamp which is A0 times Vx. So from these we can calculate the output voltage which is A0 times Vx which in turn is A0 Vi minus V0 R1 by R1 plus R2. So if I take this term to the other side, I will get V0 plus V0 A0 R1 by R1 plus R2 equals A0 times Vi, okay. So the gain of the circuit V0 by Vi can be written as A0 A0 divided by 1 plus A0 times this ratio of resistors R1 by R1 plus R2, okay. Now this can be written in a number of different ways. If I take this term to the numerator, I will get R1 plus R2 by R1 times A0 A0 plus R1 plus R2 by R1, okay. And it can also be written as R1 plus R2 divided by R1 times 1 by 1 plus 1 by A0 R1 plus R2 by R1, okay. So the gain can be written in a number of these forms but like I said earlier, the important thing is the opamp is a voltage controlled voltage source with a gain A0 that is very large, A0 tends to infinity, okay. So that is the condition under which we should calculate the gain of the circuit, okay. So as A0 tends to infinity, you can very easily see that this term disappears and the gain becomes R1 plus R2 by R1 or 1 plus R2 by R1, okay. So this is really the virtue of using an opamp which is just a voltage controlled voltage source with a very large gain. If the gain is very large but not infinite which is what it is going to be in real life, the gain V0 by VI will be very close to 1 plus R2 by R1 but not exactly 1 plus R2 by R1, okay. So the important thing is that the gain is independent of A0 if A0 is very large, okay. So if A0 is very large, the second term in the denominator is much smaller than 1 and can be ignored completely, okay. So this entire thing becomes 1 and V0 by VI will be R1 plus R2 by R1, okay. Any questions about this? So as A0 tends to infinity, the gain of the amplifier V0 by VI which is R1 plus R2 by R1 times this entire thing, okay. This is what we derived previously using circuit analysis. This becomes R1 plus R2 divided by R1 because this term here, this tends to 0 if A0 tends to infinity. So even if A0 is not infinity but a very large number, okay, what happens is this term becomes quite small, okay. So we will have a gain of 1 plus R2 by R1. So the point is the gain is independent of A0 if A0 is very large. Now this is really the reason why op-amps are used. It turns out that when you make these control sources, these use devices called transistors which you will later encounter in your, in some other course on electronics, okay. If you realize a gain, the value of the gain cannot be very accurately set usually, okay. This is the difficulty in setting the value of gain accurately. So now what you do is, instead of in order to realize an accurate gain, what you do is you realize a very large gain using transistors. Now even if it is not very accurate, what happens is that as long as the gain is very large, this term disappears and you have a gain that is accurately defined by using resistors, okay. I hope that is clear. Also let me copy over this circuit. So the output voltage V0, like I said, it is R1 plus R2 by R1 times 1 by, 1 plus 1 by A0, R1 plus R2 by R1 times Vi, that is the gain times Vi. And this Vx, okay, so if you calculate, what was Vx? Vx is nothing but Vi minus V0 R1 by R1 plus R2, okay, where V0 is this whole thing. So it is Vi minus 1 by 1 plus 1 over A0, R1 plus R2 by R1 times Vi, okay. So if you evaluate this, this comes out to be 1 by A0, R1 plus R2 by R1, 1 plus 1 by A0, R1 plus R2 by R1 times Vi, okay. So now the point is that as A0 tends to infinity, which really means a very large A0 in practice, this becomes R1 plus R2 by R1 times Vi or 1 plus R2 by R1 times Vi, okay. And this becomes 0, okay, that is A0 is in the denominator here. So this term becomes 0, okay. So this is the feature of an ideal op-amp that as A0 tends to infinity, the input voltage of the op-amp tends to 0. Now it is not exactly 0 for any finite value of A0, okay. So if A0 is infinite, the value of Vx tends to 0. So this gives us a more efficient way of analyzing op-amp circuits, okay. So instead of substituting a voltage controlled voltage source in place of the op-amp, that will certainly work, you can directly substitute these two voltages to be equal to 0, okay. It is, so this is basically a shortcut for analyzing op-amp circuits, okay. So let us do that. So it turns out that basically in an ideal op-amp, rather let me say, in a circuit containing ideal op-amps, okay. Just like somehow the windows journal shutdown. So in a circuit, what I was saying was in a circuit containing ideal op-amps under certain conditions, I am going to elaborate what they are. These conditions are very necessary. The input voltage of the op-amp equals 0, okay. So what I mean is that this Vx here, this will be 0 if the op-amp is ideal, okay. So this gives us a shortcut for analyzing circuits with ideal op-amps, okay. So this business of Vx being equal to 0, this is known as a virtual short circuit, okay. So if you have a short circuit, the voltage between, if you have a short circuit between two points, the voltage between them will be 0, okay, and any current can flow through the short circuit. In this case it is slightly different, it is a virtual short circuit, the voltage between these two points will be 0, but no current will flow between them, okay. So no current will go into the op-amp and then come back to this wire. So that is why this is known as a virtual short circuit, okay. So this basically is also called as the inputs of the op-amp being virtually shorted to each other, okay. So virtually shorted means that, this means that the voltage across them is 0, but no current flows into the op-amp, okay. So it is not a short circuit, it is just a virtual short circuit, okay. Now let us see how this idea simplifies the analysis of op-amp circuits. So I will take the same circuit, instead of using a voltage controlled voltage source in place of the op-amp, I will just use the virtual short circuit concept and figure out what the output is going to be, okay. So virtual short circuit what it says is that between these two we have 0 volts, okay. So this means that is the screen not visible, is there a problem? So there is a question why current does not flow in case of virtual short circuit, okay. Now the voltage between these two is 0 because A naught is infinity, it is not because the wire is connecting them, okay. If you go back to the picture with the control source it becomes even more clear, okay. So you see that this wire it is going nowhere, there is no path for current to flow. Basically in this there is no path for the currents to flow. But there is a virtual short between these two because Vx tends to 0 as A naught tends to infinity, okay. So this is what I mean is there is a so virtual short, it is not a real short there is no wire connecting between these two in that case a current can flow. Here the current cannot flow into this wire regardless of the value of A naught, right. This wire is just an open circuit here, no current will flow into the op-amp. But because A naught tends to infinity this voltage becomes 0. So that is why it is a virtual short and not a real short, okay. So now let us try to reanalyze this circuit using the concept of the virtual short. So if there is 0 volt between these two nodes what is the voltage at this node? What is the voltage at that node? So if there is a virtual short between the inputs of the op-amp what is the voltage at this highlighted node? I will highlight it again this node. So there is a question here, how is the gain infinite? Now that is the assumption we are using, okay. We will design the op-amp to have a gain of infinity, okay. Now in reality of course you will never be able to reach infinite, you will reach a very large number, okay. So you can think of this infinity as an approximation to a gain that is very large, okay. Is that fine? So what is the voltage here at the highlighted node? In terms of the input voltage Vi, I think there is a problem here but others are probably able to see the writings. There is, are you not able to see the writing? How about others? Anybody else has this problem of not being able to see the writing? Now I think maybe the problem is on your side. Perhaps you can quickly close the browser and reopen it. Perhaps it will be okay. So now, hopefully the audio is also clear now, what I was asking was what is the voltage at this node in terms of Vi, okay. So if this is a virtual shot that is these two have the same voltage, it means that clearly this node also has to have the voltage of Vi, okay. So the voltage here equals Vi. Now we also saw earlier that the current going here this way is 0, okay. So clearly if there is V0 here, the voltage at this point given by the voltage divided formula is V0 R1 by R1 plus R2, okay. So what I have done is to determine the voltage of this through two different ways. One is by observing that this is a virtual shot, it has to be equal to Vi and another one is observing that the current here is 0. So if this point is V0, this point has to be V0 times R1 by R1 plus R2, okay. So clearly whatever we derive for the same node from two different methods has to be equal to each other. So that means that V0 times R1 by R1 plus R2 equals Vi, okay or V0 equals Vi times R1 plus R2 by R1 or Vi times 1 plus R2 by R1, okay. So I hope this part is clear. In this case, I did not assume that the off-amp was a virtual, sorry, voltage controlled voltage source with a gain of V0. I assume that the off-amp offers a virtual shot between its inputs, okay. So when it is a virtual shot, we can immediately determine that the voltage here is Vi, it has to be equal to what you determine from the output which is V0 times R1 by R1 plus R2. So by manipulating this, we see that the output is input times some gain which is 1 plus R2 by R1, okay. And that 1 plus R2 by R1 is exactly the gain we derived when N0 is very large, okay. So when the off-amp is ideal, you can use the shortcut to analyze the circuit. Is this okay? Any questions? And off-amp is nothing but a voltage controlled voltage source with a very, very large gain. The whole point is you make the gain very large, it does not have to be very precise but the gain value will not depend very much on gain, okay. So for instance, you can make the gain let us say 10,000 but let us say for various reasons, usually when the temperature changes and so on, the gain will change. It could change all the way from 10,000 to 15,000 or 5,000 which is a very big change, okay. But as long as N0 is very large, the gain will not change all that much, okay. Any questions? Okay. Then let us move on with the lecture. So which part is not clearly understood? So which part would you like me to explain again? Okay, let us move on with the lecture. Now we can take another op-amp circuit, let me do that. So let us say if it becomes clear after we do this circuit, okay. So this is another circuit using op-amps and now between these two nodes there is a virtual short, okay. So that means that, so this point is at 0 volts. So this point is also at 0 volts, okay. So remember in case of an ideal op-amp, there is a virtual short between these two points, okay. But no current flows into the op-amp, okay. So in this case also no current flows into the op-amp. So now because this is at 0 volts, what is the current through R1? Please try to answer this, what is the current through R1? So clearly it is equal to VI by R1, okay. So we have VI across the resistor and the current is VI by R1. Now I will not be able to take questions by audio. Any questions you have, please type it into the chat window, okay. Now this current, it can go either into the op-amp or into R2. Now we know that no current goes into the op-amp, okay. So it will go into R2. Now what is the voltage drop across R2 in this polarity? So let me mark that here. What is that voltage across R2? Yeah, it is equal to V0 but in terms of VI, what is the voltage? No, the voltage is not infinite. On the right side you have V0, on the left side we have 0 volts. So the voltage across it is definitely V0. But you also know the current that is flowing through it. So you can try and figure out the voltage across it. What is it? Yeah, that's correct. So clearly this current is flowing that way. So this current times R2 will be the voltage drop with the left side positive. But here I have defined it with the right side positive. So the voltage equals V0 which is minus R2 times VI by R1 or V0 is minus R2 by R1 times VI, okay. So this is the gain, okay. And because, so this is another amplifier that is a classic amplifier topology using op-amps. And we analyzed it by assuming the virtual short between the inputs of the op-amp, okay. Any questions? Any questions about the circuit? So there is a question is there any chance to change the gain of the op-amp by putting a resistor at the non-inverting terminal, okay. Now we will see the condition under which the op-amp will behave like a virtual short, the op-amp inputs. And also just to be precise it's not the gain of the op-amp that is changing, okay. The gain of the op-amp is A0 which is assumed to be tending to infinity. It is the gain of the circuit which is built using the op-amp, okay. So the gain of the op-amp is A0 and that is fixed. There is another question why feedback is used in op-amps. Now it is a particular type of feedback that is negative feedback that will create the virtual short. Now in this very basic course we will not go into depths of negative feedback, okay. I will just tell you that there has to be negative feedback and how to find it, okay. How to find whether there is negative feedback or not. Now what I meant was the answer to earlier question. Now I will go through the conditions under which the op-amp input will behave like a virtual short, okay. Now the resistor it could be at the non-inverting terminal also but we have to see it depends on the topology. There are numerous topologies of op-amp circuits and some of them have resistors only to the inverting terminal, some of them to both inverting and non-inverting terminals, okay. And also just to be precise it is not the gain of the op-amp that is being changed, okay. It is the gain of the overall circuit. The gain of the op-amp is A0 and it is fixed and A0 tends to infinity in an ideal op-amp. So we have looked at two op-amp circuits and in this circuit V0 by Vi equals 1 plus R2 by R1 and we have this other circuit V0 by Vi equals minus R2 by R1. Now because the gain of the circuit on the left side is positive it is known as a non-inverting amplifier, okay. And because the gain of the circuit on the right side is negative this is known as an inverting amplifier, okay. So these are classic op-amp circuits and by the way these are true when the op-amp is ideal which means A0 tends to infinity. If A0 is less than infinity then A0 will appear in the gain, expression for the gain but as long as A0 is very large the gain will be approximately equal to 1 plus R2 by R1. Similarly, the gain of the inverting amplifier will be minus R2 by R1, okay. In fact I encourage you to replace the op-amp by the controlled source in the inverting amplifier and calculate the gain, okay. So you can take it up as an exercise. If you replace this op-amp with a voltage controlled voltage source, okay because plus is on the bottom and minus is on the top Vx and this will be A0 times Vx with this polarity, okay. So please analyze the circuit it will be a general practice for circuit analysis as well as then you take the limit of A0 tending to infinity and you should get the same answer as what we got by assuming that the op-amp input is a virtual shot, okay. This is fine. Now there is another question what is the difference between neutral and grounding. Now this is completely outside the scope of the basic electrical circuits. This has to do with safety and issues like that. The ground wire in the household supply is a wire that is actually connected to the earth so that and the neutral is really what is connected to earth and there should be a very small voltage difference between these two so that you do not have electrical shocks when you accidentally touch electrical equipment and so on. But we cannot deal with this here in detail so you will have to go through other courses mainly the ones that deal with power circuits for to understand this but the concept is quite simple and you can also probably refer to some standard textbooks to find out, okay. Now I said that so basically the rules for analyzing the ideal op-amp circuits can be written down. First of all what is an ideal op-amp? This is an op-amp. It is a voltage controlled voltage source with a gain A naught, okay. The current going into the op-amp terminals is 0, okay and an ideal op-amp means that the gain tends to infinity, okay. So to analyze ideal op-amp circuits you can use the methods we used earlier but you cannot write KCL at the op-amp output, okay. This is because you do not know how much current is going into the op-amp. Instead what you can do is to write the virtual short equation at the op-amp input, okay. So that is the two inputs of the op-amp have zero voltage between them. I said that this virtual short condition is true only under certain conditions. So virtual short condition or rather let me write it as op-amp inputs are virtually shorted under certain conditions and that condition is only if the op-amp is in negative feedback, okay. So this is a very, very, very important condition. You cannot assume that the op-amp inputs are virtually shorted in any circuit, okay in every circuit. The op-amp has to be in negative feedback in order for the op-amp inputs to be virtually shorted, okay. I will tell you what this means, okay. By taking the two examples let me take the non-inverting amplifier first, okay. So let me take the circuit. Now what I will do is I will null the input, okay. That is I will set vi equal to zero. So that means that I basically short circuit this to ground, okay. Then I will identify the input voltage vx and the output voltage v0 of the op-amp. In this case v0 is the output voltage of the circuit also, okay. But as a procedure you just identify vx with the appropriate polarity that is plus here and the minus there, okay. Let me call this vout. This is really the output of the op-amp. In this particular circuit it is also the output of the circuit, okay. You can have more than one op-amp in a circuit. Vx and vout of the op-amp. So then what you do is you just remove the op-amp, okay. Let's say I remove this op-amp and then you apply a test voltage to wherever the op-amp output was, okay. This is vtest, okay. I just connected there. I remove the op-amp and instead of the op-amp's output wherever the output was I connect the voltage source vtest, okay. I just add a voltage, test voltage vtest at the op-amp output, okay. Then you calculate vx, vx has already been identified, okay. It is basically the input of the op-amp when the op-amp was present in the circuit. So now vx will be because this is a linear circuit and in general any such circuit you take will be a linear circuit vx will be some number times vtest, okay. And this number has to be negative for the op-amp to be in negative feedback, okay. This is the procedure. Let me go over it once again. I first null the input because when I say the op-amp is in feedback I am only interested in how much of the op-amp's output comes back to the input. That is the meaning of feedback. If no part of the output comes back to the input there is no feedback at all, okay. So if some part of it comes back to the input there is feedback. That is what I am trying to determine here. So that is why I am not interested in the input voltage itself, the input voltage to the circuit. I am only interested in how much of the op-amp's output comes back to its own input. So I first null the input. In this case that means that I set the input voltage to zero that is I short the input to ground, okay. Then I identify the input and output voltages of the op-amp that is vx with this polarity that is important and we out this the output of this op-amp with respect to ground, okay. Then I just remove the op-amp and instead of the op-amp I connect a voltage source v-test wherever the op-amp's output was, okay. So then I calculate vx in this new circuit with the op-amp removed and this new voltage source inserted, okay. So this is just for testing the circuit, v-test is some arbitrary voltage. Because this is a linear circuit vx will be some number times v-test. It has to be, okay. So vx will be some number times v-test and that number has to be smaller than zero that is that number has to be negative. The multiplying factor, if it is negative then this op-amp in the original circuit is a negative feedback, okay. So what it means is vx has a contribution due to v out, okay. That we tested by applying this v-test in place of v out. Now that contribution is negative if this number is negative, okay. So that is the meaning of the op-amp being in negative feedback. We'll test it out for this circuit. As I mentioned earlier, I am unable to take questions by audio. Please ask all your questions on the chat window, okay. Is the procedure clear? So let's try it for this circuit that is I removed the op-amp. I've identified vx and v out and then I removed the op-amp and I applied v-test here, okay. So please now calculate the voltage that appears here. What is the voltage that appears there? Please let me know the answer. The voltage that appears at this node. See vx is the difference between this upper node and this one. And this node is at ground, that is zero volts. So I have to find the voltage of this node. So what is the voltage that appears there? What is the voltage that appears there at the junction of r1 and r2 due to v-test? That's right, clearly v-test is applied to this voltage divider. So this voltage is nothing but v-test r1 by r1 plus r2. Okay, the voltage divider times v-test. Okay, so what is the value of vx then? What is the value of vx? Please mind the polarity of vx. So it is not minus v-test, but minus of the voltage that appears here. So vx will be minus v-test times, or let me write it like this. Minus r1 by r1 plus r2 times v-test. Okay, so it is some number times v-test and that number is negative. Okay, by the way, there was some answer saying both will be in same potential. I am not sure which both are being referred to. These two, if we are talking about this node and that node, they will certainly not be at the same potential in this circuit. They will be at the same potential in the circuit when the opamp is present and the opamp has negative feedback. This circuit does not have the opamp. So this and that will certainly not be at the same potential. Okay, so the voltage vx is minus r1 by r1 plus r2 times v-test. It is a negative number times v-test. So this opamp here, this opamp is in negative feedback. Okay, so the reason that is very important is that only with negative feedback, do you get the virtual shot and the desired function that you want to implement. Okay, so there is another question. What are the assumptions made in an ideal opamp? The assumptions made are simply that a0 equals infinity. Okay, that will take care of everything else. Okay, now here if you look at it, I defined a0, I said a0 is infinity. Now I also said i equals 0. Now actually that's not a separate assumption. If you take any circuit with the opamp, even if there is a resistance between these two points, if a0 becomes infinity, it becomes an ideal opamp. Now for simplicity, what I'll assume is that it's a voltage controlled voltage source, that is no current is flowing here and this is an ideal voltage controlled voltage source and the value of a0 is infinite. Okay, so I hope that is clear. The essential assumption for an ideal opamp is that the gain has to be infinite. Okay, now the reason this is important is the following. So let me copy over the circuit again. So let me put the input back here. Okay, now in this case, in the second case, let me do this. Let me make the lower one plus and upper one minus. Okay, now the point is that if you calculate this voltage from the output side, okay, this is v0 and this point will be v0 times r1 by r1 plus r2. Here also it will be v0 times r1 by r1 plus r2. Okay, so they'll be exactly the same as each other, obviously. Now also if I assume ideal opamp and say that it is virtually shorted, okay, this voltage is the same as that voltage. So that means that from the input side, this will be vi and here also it will be vi. If I assume that there is a virtual short between these two terminals, okay. So whether I use the circuit on the left side or the circuit on the right side, I get the same relationship. I get vi equals v0 times r1 by r1 plus r2 or v0 equals vi times r1 plus r2 by r1. Okay, so if I blindly apply the virtual short concept, that's what I will get. But this circuit is very different from this and in fact it will not work at all. Okay, so this circuit will not work. And the reason is that we can look at the feedback in this particular circuit. Okay, so what I'll do is let me copy over this and I have to null the input. I will do that. I want to see whether it is in negative feedback. Okay, I null the input and I identify the input and output of the op-amp. Remember vx is now defined like this, okay, because plus sign is on the bottom side. And I remove the op-amp, okay, then I apply vtest. Then I apply vtest. So what happens? At this point, I'll get vtest times r1 by r1 plus r2. And if you calculate the value of vx in this circuit, it is equal to the voltage at this node, okay, because of the polarity. Whereas previously for this circuit, vx was negative of the voltage here. Okay, so the voltage here was v0 r1 by r1 plus r2. That part is the same as now, but this vx was negative of that. Whereas now vx is equal to r1 by r1 plus r2 times vtest. Okay, so it's a positive number times vtest. So that means that in this circuit, I mean this op-amp is in positive feedback. Okay, so if it's in positive feedback, then this virtual short assumption simply does not apply. Okay, this is clear. So it's an extremely important thing. The virtual short concept provides an easy way to analyze circuits containing an ideal op-amp, but it has to be applied with care. You have to check separately that the op-amp is in negative feedback. And the way to do that is given by this series of steps I described earlier. You null the input because this has nothing to do with the input. Feedback refers to what fraction of the op-amp's output comes back to its own input. Okay, identify vx and vout of the op-amp, whichever op-amp you want to find the feedback for. Okay, then you remove the op-amp. In place of the op-amp's output, you apply a test voltage vtest. And then now you have basically a linear circuit which you can analyze and find the input voltage vx of the op-amp. Okay, so this vh of the op-amp will be some number times vtest. And that number, if it is smaller than zero, the op-amp is a negative feedback, then the virtual short assumption is valid. If it is greater than zero, it's in positive feedback. You cannot assume virtual short. If it is equal to zero, also there is no feedback at all. And this virtual short is not valid. Okay, so there is another question, what will happen if we use positive feedback? Okay, so that again, we will not get into in this course. What is going to happen is that there will be no virtual short, that is for sure. And the way we have defined it, the op-amp is a voltage controlled voltage source. And its output voltage can be any value. It depends on the input voltage. In reality, when you make a real op-amp, the output of the op-amp will have some limits. Okay, which depends on the supply voltage. If you operate the op-amp from 10 volts, the output cannot go beyond 10 volts and so on. So it will end up going and getting stuck to either the maximum limits or the minimum limit on its output voltage. Okay, so that's what is going to happen to the op-amp. If you use it in positive feedback. Okay, any other questions? So similarly, if we look at the inverting amplifier. Okay, again we can apply the same algorithm. Okay, so first I null the input. That means that I short this to ground, that is vi equals 0. Okay, so then I remove the op-amp and apply V test. Sorry, I also had to identify. Let me remove this before coming to this step. I have to identify the input voltage Vx and the output voltage V out of the op-amp. Okay, then I remove the op-amp and apply V test to the output of the op-amp. Okay, so what is the voltage that appears here in this circuit? What is the voltage that appears at this node? Please find this. What is the voltage that appears there? The voltage that appears there is retest times r1 by r1 plus r2. Okay, so the value of Vx is the negative of this because of its polarity. So this will be minus r1 by r1 plus r2 times V test. So this means that this is okay. The op-amp here is in negative feedback. Okay, now if I interchange the plus and minus signs of the op-amp, it will be in positive feedback and what we discussed so far will not be applicable anymore. Okay, so any questions about op-amp circuits? What we learned was two popular circuits of the op-amp which are the inverting amplifier and the non-inverting amplifier. And also if in an op-amp, the op-amp is a voltage controlled voltage source with a very large gain. So if the gain is very large, then the gain of the circuit, the gain of the amplifier will not depend so much on the op-amp's gain. Okay, so there are two gains that we talked about here. The V0 by Vi of this circuit, the amplifier that you make and also the gain of the op-amp that is the gain of the voltage controlled voltage source which is inside the op-amp. Okay, so as long as that is very large, the gain of the circuit doesn't depend on this value A0. Okay, and an ideal op-amp is where this A0 goes to infinity. Okay, that's the largest gain you can possibly have. Now in that case, the analysis of op-amp circuits becomes quite simple. You can assume that the two inputs are virtually shorted. It's called virtual short because there is no wire that can conduct current between these two. So the two voltages are equal but no current flows between them. Okay, so that's why it's called a virtual short. And using this virtual short concept, you can easily analyze op-amp circuits. But the one thing you have to be very careful about is that the op-amp has to be in negative feedback for you to be able to apply this virtual short concept. Okay, otherwise you simply cannot use that. So that means that the op-amp has to be hooked up with the correct polarity. I've shown the circuits with the correct polarity. I also showed you what happens if you have the wrong polarity. Okay, that is in this case, if you have the upper one to be minus, lower one to be plus, then this op-amp is in positive feedback. And you cannot assume that these two are virtual shorts. Okay, so if you use that, you will get the same formula as before for V0, but that will be completely wrong. Okay, so is this clear? Any other questions? So there is a suggestion for books on this topic. I will try to find but unfortunately no book deals with the negative feedback aspect of it. Explicitly like this, but just for general op-amp circuits and ideal op-amp circuits and so on, there are many books. Okay, so the book by Hayton Kemmerle or Lin-Andy Karlo on linear circuit analysis, you can use them. And there is a book by Sergio Franco on op-amps. The whole book is dedicated to op-amps. It's full of circuits. You can use that as well. Okay, Sergio Franco on op-amps. Okay, there is an answer zero word. I'm not sure to which question this is the answer. The next question is if the voltage is zero on op-amp, why are we calculating Vx? Okay, now this is a way to calculate whether the op-amp is in negative feedback or not. Okay, we are not trying to find out what the output voltage is in terms of the input voltage. We are trying to find out if the op-amp has negative feedback around it. Okay, so it's not that the voltage on the op-amp is zero, whatever that means. You null the input source. Okay, you said Vi equal to zero. You remove the op-amp. You apply this V test. Basically, all you are trying to find out is the voltage here depends on the op-amp output because of this connection R2, this feedback connection. Okay, now you have to find out whether Vx is related with a negative factor to V out or with a positive factor. That's what you are trying to find out. Okay, so how much of the op-amp's output affects its own input? That is the key to feedback. Okay, if the op-amp's output is not connected back to its input, there is no feedback at all. Okay, if I remove this R2, then here, whatever the value of V test, the value of Vx will be zero, then there is no feedback. But this V test influences Vx, so that means that when the op-amp is really there, the op-amp's output influences its input voltage. You are trying to find out whether it's negative feedback or positive feedback. I hope that is clear. Which book is most easy to understand? I think you have to read some book and then see whether it's easy for you. Okay, so it depends on individual tastes. The first two books are about general circuit analysis. There is one chapter on op-amp's whereas the third book is completely about op-amp's. So for all other aspects of circuit analysis using dependent sources and so on, the first two books are quite good. They have lots of example problems and also problems at the end of each chapter. Okay then, so if there are no more questions, I will see you next week. Okay, we will end the lecture here. Bye.