Appearance
2.5 — Operational Amplifiers
A single transistor amplifier has a gain that depends on temperature, on the particular device you soldered in, and on the bias resistors being right. Chapter 2.3 spent several pages just making the bias stable enough to be usable.
The operational amplifier makes all of that go away. It has so much gain — a hundred thousand or more — that you can afford to throw nearly all of it away in exchange for control. What comes back is a circuit whose behaviour is set by two resistors and nothing else, immune to temperature, to device spread and to supply variation.
The name comes from analog computers of the 1940s, where these amplifiers performed mathematical operations — adding, subtracting, integrating, differentiating — on voltages representing physical quantities. The maths came first; the chip came later.
1. What is inside, briefly
An op-amp is typically twenty to fifty transistors in three stages:
- A differential input pair. Two matched transistors sharing a current source (the current mirror from Chapter 2.3). They amplify the difference between the two inputs and ignore anything both inputs do together.
- A high-gain second stage, usually a common-emitter or common-source stage with an active current-source load, giving enormous gain because the load impedance is huge.
- An output buffer, a push-pull emitter follower pair, giving a low output impedance so the thing can drive real loads.
You will design with none of this. That is the point — the internal detail has been engineered into irrelevance. But two internal facts leak out into every design and are worth carrying: the input stage's transistors are never perfectly matched, which causes offset (section 7), and a deliberately placed compensation capacitor rolls the gain off with frequency, which sets the bandwidth (section 6).
2. The two rules
An ideal op-amp has:
- Infinite open-loop gain A
- Infinite input impedance, so no current flows into either input
- Zero output impedance
- Infinite bandwidth, zero offset, zero noise
Real parts are close enough to these that the idealisation works, and it gives two rules that solve almost every op-amp circuit.
Rule 1 — no current flows into either input.
Rule 2 — when negative feedback is present, the op-amp drives its output to whatever voltage makes the two inputs equal.
Rule 1 comes from the enormous input impedance. Rule 2 needs explaining, because it looks like magic.
The output is A(V_+ - V_-) with A around 10^5. The supply rails might be ±15 V. So for the output to sit anywhere sensible, the input difference must be at most $15/10^5 = 150\ \mu$V — essentially zero. If the feedback path is arranged so that a rise in output pushes V_- up, the amplifier will settle exactly where the two inputs match. Any imbalance gets multiplied by 100,000 and drives the output hard in the direction that removes it.
The two inputs are then said to be at a virtual short: the same voltage, but with no current flowing between them. In the very common case where the non-inverting input is grounded, the inverting input sits at 0 V without being connected to ground, which is called a virtual ground and it is the single most useful idea in this chapter.
Rule 2 requires negative feedback. Feed the output back to the non-inverting input instead and the amplifier runs away to a rail — which is sometimes exactly what you want (section 8), but it means Rule 2 no longer applies.
3. The inverting amplifier
Input through R_1 to the inverting input; feedback resistor R_f from output back to the same point; non-inverting input grounded.
Derive the gain in three lines. By Rule 2, the inverting input sits at 0 V (a virtual ground, since the other input is grounded). So the current through R_1 is
I_1 = \frac{V_{in}-0}{R_1} = \frac{V_{in}}{R_1}
By Rule 1, none of that current enters the op-amp, so all of it continues through R_f. The voltage at the output end of R_f is therefore
V_{out} = 0 - I_1R_f = -V_{in}\frac{R_f}{R_1}
\boxed{A_v = -\frac{R_f}{R_1}}
The gain is a ratio of two resistors. Nothing about the op-amp appears. Swap the chip for a different manufacturer's part, heat it, change the supply — the gain does not move.
Input impedance is exactly R_1, because the signal source drives into a virtual ground through that resistor. This is the configuration's main drawback: a gain of 100 with R_1 = 1 kΩ means R_f = 100 kΩ, and the source must drive 1 kΩ.
4. The non-inverting amplifier
Signal straight into the non-inverting input; R_f from output to the inverting input; R_1 from the inverting input to ground.
By Rule 2, V_- = V_{in}. The output drives a divider made of R_f and R_1, and Rule 1 says no current is stolen by the input, so it is a clean divider:
V_- = V_{out}\cdot\frac{R_1}{R_1+R_f} = V_{in}
\boxed{A_v = 1 + \frac{R_f}{R_1}}
Positive, so no inversion, and the minimum gain is 1 — you cannot make this circuit attenuate.
Its input impedance is the op-amp's own, which is megohms to teraohms. That is the reason to choose it: when the source cannot supply current — a sensor, a piezo element, a high-impedance divider — this is the configuration.
The voltage follower
Set R_f = 0 and R_1 = \infty: connect the output straight back to the inverting input and feed the signal to the non-inverting one.
A_v = 1
A gain of exactly one. Its value is entirely in the impedances: enormous in, near zero out. This is the buffer promised back in Chapter 1.3 when a voltage divider collapsed under load. Put a follower between the divider and the load and the divider sees nothing, while the load gets all the current it wants.
5. The operations the name refers to
Summing amplifier
Several inputs, each through its own resistor, all meeting at the virtual ground. Currents simply add at that node (KCL, Chapter 1.2):
V_{out} = -R_f\left(\frac{V_1}{R_1}+\frac{V_2}{R_2}+\frac{V_3}{R_3}\right)
With all resistors equal it is a plain sum. This is an audio mixer, and each channel's fader is one of those input resistors. It also works as a crude digital-to-analog converter: weight the resistors R, 2R, 4R, 8R and each bit contributes its proper binary share. Chapter 3.5 develops that properly.
The nice property: because every input arrives at a virtual ground, the channels do not interact at all. Change one fader and the others do not move.
Difference amplifier
Signals on both inputs, with matched resistor pairs:
V_{out} = \frac{R_f}{R_1}(V_2-V_1)
It amplifies the difference and rejects anything common to both. That rejection is measured by the common-mode rejection ratio (CMRR), in decibels, and it depends critically on how well the four resistors match. 1% resistors limit CMRR to about 46 dB, which is poor; this is why the next circuit exists.
Instrumentation amplifier
Two followers feeding a difference amplifier, with a single gain-setting resistor R_G between the two input stages:
A_v = \left(1+\frac{2R_1}{R_G}\right)\cdot\frac{R_3}{R_2}
The input stage gives enormous input impedance on both inputs and does the gain; the output stage does the subtraction at unity gain, where resistor mismatch matters far less. CMRR reaches 100 dB and beyond, and one resistor sets the gain, which is why these come as single chips with a gain resistor pin.
Where it is used: anything measuring a small difference riding on a large common voltage. A strain gauge bridge (Chapter 1.2's balanced bridge) puts out millivolts on top of a 2.5 V common level. An ECG measures microvolts between two electrodes that both sit at whatever potential the body has picked up from the mains. Without common-mode rejection, neither measurement is possible at all.
Integrator
Replace the feedback resistor with a capacitor. The input current V_{in}/R has nowhere to go but into C, and a capacitor's voltage is the integral of its current (Chapter 1.5):
V_{out} = -\frac{1}{RC}\int V_{in}\,dt
Feed in a constant and the output ramps linearly. Feed in a square wave and you get a triangle. This is how a function generator makes a triangle wave, and it is the core of every analog control loop's integral term (Chapter 6.6).
The practical problem: at DC the capacitor is an open circuit, so the gain is infinite, and the op-amp's own tiny input offset gets integrated forever until the output hits a rail. Every real integrator therefore has a large resistor across the capacitor to bound the DC gain. It makes the integration imperfect below some frequency, and that is the price of it working at all.
Differentiator
Swap them: capacitor in, resistor feedback.
V_{out} = -RC\frac{dV_{in}}{dt}
The output is proportional to the input's rate of change, so a step produces a spike.
Differentiators are rarely used, and it is worth knowing why. The gain rises with frequency, so noise — which lives at high frequencies — is amplified more than signal. And the rising gain interacts with the op-amp's own falling gain to make the circuit oscillate. A practical differentiator has a small resistor in series with the capacitor to cap the high-frequency gain. If a design seems to need a differentiator, the usual right answer is to rearrange it so an integrator does the job instead.
6. Where the ideal model stops working
Finite gain-bandwidth product
An op-amp's open-loop gain is not constant. It is huge at DC and falls at 20 dB per decade — a factor of ten less gain for every factor of ten more frequency — because of the internal compensation capacitor mentioned in section 1.
The consequence is a constant:
\boxed{\text{Gain} \times \text{Bandwidth} = \text{GBW}}
Worked example. A 741 has a GBW of about 1 MHz.
- Gain of 1: bandwidth 1 MHz.
- Gain of 10: bandwidth 100 kHz.
- Gain of 100: bandwidth 10 kHz.
- Gain of 1000: bandwidth 1 kHz — which will not even pass audio.
This is why high gain is taken in stages. Two stages of gain 32 give a total of 1024 with a bandwidth of 31 kHz, against 1 kHz for a single stage of 1000. Same total gain, thirty times the bandwidth, for the cost of one extra amplifier.
Why is the roll-off deliberate? Because without it, the phase shift at high frequency would turn the negative feedback positive and the amplifier would oscillate. The compensation capacitor buys unconditional stability at the cost of bandwidth, and "uncompensated" op-amps exist for people willing to manage the stability themselves in exchange for speed.
Slew rate
Gain-bandwidth is a small-signal limit. There is a separate large-signal one: the internal compensation capacitor can only be charged by the finite current the previous stage supplies, so the output voltage cannot change faster than some maximum rate, in volts per microsecond.
\text{SR} = \left.\frac{dV_{out}}{dt}\right|_{max}
A 741 manages 0.5 V/µs. For a sine of amplitude V and frequency f, the steepest slope is 2\pi fV, so the largest undistorted signal is
f_{max} = \frac{\text{SR}}{2\pi V}
For a 741 producing a 10 V amplitude: f_{max} = 0.5\times10^6/(2\pi\times10) = 8 kHz. Above that the sine turns into a triangle — the output simply cannot keep up. This is a distinct failure from bandwidth limiting, and it sounds different: bandwidth loss makes things dull, slew limiting makes them harsh.
Input offset voltage
The input transistors are never perfectly matched, so the output is not zero when the inputs are equal. The mismatch is quoted as an equivalent input offset voltage V_{OS}, typically 1 mV for a general-purpose part and under 10 µV for a precision one.
It gets multiplied by the circuit's gain. A 2 mV offset in a circuit with a gain of 100 puts 200 mV of error at the output, permanently. In an amplifier for a thermocouple producing 40 µV per degree, a 2 mV offset is a fifty-degree error, and the whole measurement is worthless.
The fixes: pick a precision part, or use a chopper (auto-zeroing) amplifier that continuously measures and cancels its own offset, reaching offsets under 1 µV.
Input bias current
Real inputs do draw a little current — nanoamps for bipolar inputs, picoamps for FET inputs. Flowing through the source resistance, it makes a voltage error. The standard mitigation is to make the DC resistance seen by both inputs equal, so the two errors cancel; that is why you often see an apparently pointless resistor between the non-inverting input and ground, with a value equal to R_1 \parallel R_f.
Output limits
The output cannot reach the supply rails. A classic op-amp gets within about 1.5 V; a rail-to-rail part gets within tens of millivolts. And the output current is limited, typically to 20 to 25 mA, with internal current limiting that protects the chip but also means it simply cannot drive an 8 Ω speaker directly.
Single-supply operation matters in practice: with only 0 V and 5 V available, an AC signal has nowhere to swing below zero. The standard solution is to create a false mid-rail reference at 2.5 V with a divider and a buffer, and let all signals sit around that. Every single-supply audio circuit does this.
7. Comparators, and why an op-amp is the wrong part
Remove the feedback and the enormous open-loop gain does something else useful: the output slams to one rail or the other depending on which input is higher. That is a comparator.
V_{out} = \begin{cases} +V_{sat} & V_+ \gt V_-\\ -V_{sat} & V_+ \lt V_-\end{cases}
An op-amp used this way works badly. It was designed and compensated for linear operation, so its recovery from saturation is slow — microseconds — and some parts misbehave outright when driven hard into the rails. A dedicated comparator chip has no compensation capacitor, switches in nanoseconds, and usually has an open-collector output that can drive whatever logic level you want.
Hysteresis, and the Schmitt trigger
A plain comparator has a real problem: when the input crosses the threshold slowly, noise makes it cross back and forth, and the output chatters between states dozens of times.
Add a small amount of positive feedback — a resistor from output back to the non-inverting input — and the threshold moves depending on the current state. When the output is high the threshold rises; when low it falls. The input must now travel a definite distance to change the output back.
That gap is hysteresis, and the circuit is a Schmitt trigger. The thresholds are
V_{UT} = \frac{R_1}{R_1+R_2}V_{sat}, \qquad V_{LT} = -\frac{R_1}{R_1+R_2}V_{sat}
for a symmetric supply, and the difference between them is set purely by the resistor ratio.
Where you meet it: every mechanical switch input on a microcontroller (contact bounce is exactly the chattering problem), every thermostat (which is why a heater does not click on and off continuously at exactly 20 °C), and the input stage of most logic families. It is also half of the oscillator in the next chapter.
8. Active filters
Chapter 1.6 built filters from resistors and capacitors alone. Those work, but they load each other when cascaded, they cannot give gain, and their roll-off is a gentle 20 dB per decade.
Put an op-amp in and all three problems go away.
A first-order active low-pass is an inverting amplifier with a capacitor across the feedback resistor:
A(f) = -\frac{R_f}{R_1}\cdot\frac{1}{1+j2\pi fR_fC}, \qquad f_c = \frac{1}{2\pi R_fC}
Gain below the cut-off, roll-off above it, and the output impedance is near zero so the next stage does not load it.
The Sallen-Key arrangement gives a second-order response — 40 dB per decade — from one op-amp and four passive parts, and its damping (and therefore whether the response is flat, peaked, or gently sloping into the corner) is set by the component ratios. Cascade three of them for a sixth-order filter at 120 dB per decade.
The three classical response shapes are worth knowing by name because they are a genuine three-way trade:
- Butterworth — flattest possible passband, moderate roll-off. The default when you do not have a reason.
- Chebyshev — steeper roll-off, bought with ripple in the passband.
- Bessel — gentlest roll-off, but the only one with constant delay across frequency, so it does not distort the shape of a pulse. Used where waveform fidelity matters more than filtering sharpness.
Part 5 develops filter design properly, in the digital domain where the same trade-offs reappear with different names.
Everything so far amplifies or shapes a signal that already exists. The next chapter makes a signal from nothing — a circuit whose output oscillates with no input at all — by taking the feedback that has stabilised every circuit in this chapter and deliberately turning it the wrong way round.
Every formula above, built from scratch
None of the results in this chapter are worth memorising, because each one can be rebuilt in under a minute from something simpler. What follows is that rebuilding, one result at a time, so the formula and the reason for it sit on the same page as the explanation that needed them.
Op-amps
Ideal rules: no input current; with negative feedback, the inputs are driven equal.
A_{inverting} = -\frac{R_f}{R_1}, \qquad R_{in} = R_1
A_{non-inverting} = 1+\frac{R_f}{R_1}, \qquad R_{in} \approx \infty
V_{out(sum)} = -R_f\sum_k\frac{V_k}{R_k}
V_{out(diff)} = \frac{R_f}{R_1}(V_2-V_1) \quad\text{(matched pairs)}
A_{instr} = \left(1+\frac{2R_1}{R_G}\right)\frac{R_3}{R_2}
V_{out(int)} = -\frac{1}{RC}\int V_{in}\,dt, \qquad V_{out(diff)} = -RC\frac{dV_{in}}{dt}
Real limits
A\times\text{BW} = \text{GBW (constant)}, \qquad \text{BW} = \frac{\text{GBW}}{A_{closed}}
f_{max} = \frac{\text{SR}}{2\pi V_{peak}}
Derivation of the slew limit: for v = V\sin(2\pi ft) the maximum slope is dv/dt|_{max} = 2\pi fV, which must not exceed the slew rate.
\text{CMRR (dB)} = 20\log_{10}\frac{A_{differential}}{A_{common}}
Output error from offset: V_{error} = V_{OS}\times A_{closed}.
Schmitt trigger thresholds
V_{UT} = \frac{R_1}{R_1+R_2}V_{sat}^+, \qquad V_{LT} = \frac{R_1}{R_1+R_2}V_{sat}^-
\text{hysteresis} = V_{UT}-V_{LT}
Active filter
f_c = \frac{1}{2\pi RC}, \qquad Q = \frac{f_0}{\text{BW}}
Second-order roll-off is 40 dB per decade; n-th order is 20n dB per decade.