First, a little tutorial on how op amps work. Fig. 1 shows an op amp, which has five connections to the outside world. Two of these are power supply rail pins, +V and -V, which for monolithic op amps usually want to be attached to supply voltages in the range of about 5 to 15 volts each for commercially available chips. Specialized products work outside this range, from as low as 1 volt to as high as 500 volts. There is a presumption here that +V and -V are referenced to a ground potential, but this is not required by the op amp as such. The op amp only needs positive voltage on the +V pin relative to the voltage on the -V pin to operate properly. An op amp has two input pins, designated the positive and negative inputs (+In and –In), which control the voltage at the output pin. For linear operation we will generally want the voltages appearing at +In and –In to be in the range between the power supply voltages, and in many applications we will see these pins operated near ground potential, midway between +V and -V. The output of the op amp can vary between +V and -V, and is controlled by the voltage difference between +In and –In. If the voltage at +In is positive with respect to –In, then the output of the op amp swings positive, toward the +V rail voltage. If the voltage at +In is negative compared to the voltage at –In, the output swings negative. It only takes a small difference in voltage between the two inputs to create a large change in the output voltage. This is known as the gain of the op amp. That’s about it.
The role of feedback
Of course there’s really quite a bit more, and most of it involves the concept of feedback. The control pins of the op amp are usually so sensitive that it is nearly impossible to keep the output voltage in the useful (linear) range between the supply rails without some method of controlling the system, and this method is feedback. Feedback works to keep the differential input voltage (the voltage difference between +In and –In) very small, which keep the output in the linear range. We do this by communicating between the negative input and the output of the op amp. The easiest example of this is the simple voltage follower of Fig. 2. In this circuit, the negative input is connected directly to the output, with the result being that the output of the op amp matches the signal presented to the positive input. Following the logic of an op amp’s control pins, we observe that if the voltage from a signal source driving the positive input were to go positive, the output of the op amp would start to go very positive. But the output of the op amp being connected to the negative input would cause it to go positive also, and it will not want to go more positive than the positive input, or else the output would head off in the negative direction. Instead it will come very close to the voltage at the positive input, with just enough difference to allow the op amp’s output to track the input.
If we want gain, we simply have to fool the negative input into thinking that the output is smaller than it actually is, as in Fig. 3, where the negative input sees the output voltage after a voltage dividing network. The dividing network reduces the voltage by R2/(R1+R2). As a result, the op amp delivers an output that is a multiple of the input, where the gain is given by the inverse of the divider: (R1+R2)/R2. As an example, if R1 is 9 KOhm and R2 is 1 KOhm, then the gain would be 10, and a 1 volt input at +In would result in a 10 volt output.
Another simple feedback connection allows the negative input to be driven by the signal source, resulting in an inverted output voltage. Fig. 4 shows such a connection, with the gain given by the formula R1/R2. Again following the logic of the op amp input pins, a positive signal from the source will drive the negative input so that the output of the op amp goes very negative, and this feeds back around through R1, greatly reducing the...