EE Basics · step 10 · circuits
Operational Amplifiers
An op-amp is a differential amplifier with enormous, poorly controlled gain. Wrapped in negative feedback, that gain disappears from the result and precise resistor ratios take its place. This page derives feedback from scratch, the standard circuits, what is inside an op-amp, gain-bandwidth and stability, slew rate, and the DC and noise errors that limit real designs.
Builds onDifferential pair · FETs · RC filtersRelatedAmplifier classes
1The op-amp as a component
An op-amp has two inputs and one output and amplifies their difference:
The open-loop gain \(A\) is huge (\(10^5\) to \(10^7\), i.e. 100–140 dB) but varies by large factors between parts and with temperature, load and frequency. The inputs draw almost no current (pA to µA) and the output can source or sink current with low output resistance. On its own, an op-amp is almost useless: 1 mV of input difference would try to drive the output to 100 V. Its usefulness comes entirely from feedback.
2Negative feedback
- The error is \(e = x_\text{in} - \beta x_\text{out}\), and \(x_\text{out} = Ae\).
- Substitute: \(x_\text{out} = A(x_\text{in} - \beta x_\text{out})\), so $$G = \frac{x_\text{out}}{x_\text{in}} = \frac{A}{1+A\beta} = \frac1\beta\cdot\frac{1}{1+1/(A\beta)}$$
- The product \(T = A\beta\) is the loop gain. When \(T\gg1\), \(G\to1/\beta\): the gain depends only on the feedback network.
- Sensitivity: differentiate \(G\) with respect to \(A\): $$\frac{dG}{G} = \frac{1}{1+A\beta}\cdot\frac{dA}{A}$$ Variations in A are divided by \(1+T\).
\(A = 10^5\), \(\beta = 0.01\): \(T = 1000\), \(G = 100/(1.001) = 99.90\), a 0.1% gain error. If A drops by half to \(5\times10^4\), G becomes 99.80: a 50% change in A moved the gain by 0.1%. The same factor \(1+T\) reduces distortion, output resistance and the effect of most internal imperfections.
Feedback is a trade: you spend gain (the raw \(A\)) to buy precision, linearity and control. The excess \(T\) is the budget, and at high frequency, where A falls, the budget runs out (section 9).
3The golden rules
With large loop gain, two shortcuts follow for any op-amp circuit with negative feedback and an output that is not saturated:
- Virtual short: \(v_+\approx v_-\). The output is finite, so the input difference is \(v_o/A\), effectively zero. The op-amp drives its output to whatever value makes the inputs equal.
- No input current: \(i_+ = i_- \approx 0\).
Every circuit below is solved with these two rules plus KCL.
4Non-inverting amplifier
- Input to \(v_+\). The output feeds back through \(R_f\) to \(v_-\), with \(R_g\) from \(v_-\) to ground: \(v_- = v_o\,R_g/(R_f+R_g)\), so \(\beta = R_g/(R_f+R_g)\).
- Virtual short: \(v_- = v_+ = v_\text{in}\). So $$\frac{v_o}{v_\text{in}} = \frac1\beta = 1+\frac{R_f}{R_g}$$
- With finite gain: \(G = \dfrac{1+R_f/R_g}{1+(1+R_f/R_g)/A}\).
Input impedance is very high (the op-amp input, raised further by \(1+T\)), output impedance very low (\(r_\text{out}/(1+T)\)). With \(R_f = 0\) and \(R_g\) open, it is a voltage follower (\(G = 1\), \(\beta = 1\)): the most demanding configuration for stability because the loop gain is highest.
5Inverting amplifier
- \(v_+\) grounded. Input through \(R_\text{in}\) to \(v_-\); \(R_f\) from output to \(v_-\).
- Virtual short: \(v_- = 0\), a virtual ground.
- KCL at \(v_-\) with no current into the op-amp: \(\dfrac{v_\text{in}-0}{R_\text{in}} + \dfrac{v_o - 0}{R_f} = 0\). So $$\frac{v_o}{v_\text{in}} = -\frac{R_f}{R_\text{in}}$$
- Input impedance is just \(R_\text{in}\) (the other end sits at virtual ground).
The feedback factor here is still \(\beta = R_\text{in}/(R_f+R_\text{in})\), so the loop sees a gain of \(1/\beta = 1+R_f/R_\text{in}\), not \(R_f/R_\text{in}\). This noise gain is what multiplies the op-amp's offset and noise and what sets bandwidth. An inverting amplifier with signal gain −1 has noise gain 2, half the bandwidth of a follower.
6Summing, difference and instrumentation amplifiers
Summing amplifier. Several inputs through \(R_k\) into the virtual ground: KCL gives \(v_o = -R_f\sum v_k/R_k\). The virtual ground prevents the inputs from interacting, which is why it mixes signals and forms the basis of a simple DAC.
- \(v_1\) through \(R_1\) to \(v_-\), \(R_2\) from output to \(v_-\). \(v_2\) through \(R_3\) to \(v_+\), with \(R_4\) from \(v_+\) to ground.
- \(v_+ = v_2R_4/(R_3+R_4)\). Superposition at the output: \(v_o = -\dfrac{R_2}{R_1}v_1 + \left(1+\dfrac{R_2}{R_1}\right)v_+\).
- If \(R_4/R_3 = R_2/R_1 = G\): \(v_o = G\,(v_2 - v_1)\). Only the difference is amplified.
- With each resistor off by up to \(\pm\epsilon\), the worst-case common-mode gain is about \(4\epsilon/(1+G)\) relative to the differential gain, so $$\text{CMRR}\approx\frac{1+G}{4\epsilon}$$ For \(G = 1\) and 1% resistors, CMRR ≈ 50 (34 dB). Precision difference amplifiers use laser-trimmed matched networks for 80–100 dB.
The difference amplifier's input impedance is only \(R_1\) and unbalanced between inputs. The three-op-amp instrumentation amplifier fixes this with two non-inverting buffers sharing a gain resistor \(R_G\) in front of a difference stage: \(G = (1+2R/R_G)(R_3/R_2)\). One resistor sets the gain, both inputs are high impedance, and CMRR is set mainly by the matched output stage. This is the standard front end for bridges and sensors.
7Integrator, differentiator and transimpedance amplifier
- Inverting configuration with a capacitor \(C\) as the feedback element.
- Current into the virtual ground \(v_\text{in}/R\) must flow into the capacitor: \(v_\text{in}/R = -C\,dv_o/dt\).
- $$v_o(t) = -\frac{1}{RC}\int v_\text{in}\,dt, \qquad H(j\omega) = -\frac{1}{j\omega RC}$$
A real integrator also integrates the op-amp's offset and bias current until the output saturates, so practical circuits add a large resistor across C (making it a low-pass filter) or a reset switch. The differentiator swaps R and C, \(v_o = -RC\,dv_\text{in}/dt\); its gain rises with frequency, so it amplifies noise and tends to oscillate unless a series resistor limits its high-frequency gain.
- A current source (a photodiode) drives the virtual ground directly; feedback resistor \(R_f\).
- All the current goes through \(R_f\): \(v_o = -I\,R_f\). The photodiode sits at 0 V bias, so its capacitance is not charged and dark current is minimised.
- The photodiode capacitance \(C_d\) at the input makes the noise gain \(1+j\omega R_fC_d\), rising with frequency. That creates a second pole in the loop, so a small feedback capacitor \(C_f\approx\sqrt{C_d/(2\pi R_f\,\text{GBW})}\) is needed for stability. The resulting bandwidth is about \(\sqrt{\text{GBW}/(2\pi R_fC_d)}\).
8Inside an op-amp
The classic two-stage op-amp:
- Input differential pair with a current-mirror load (see the BJT page). It converts \(v_+ - v_-\) into a current \(g_{m1}v_d\) and rejects common mode. Gain \(g_{m1}r_{o1}\).
- Second gain stage, a common-emitter or common-source stage, with gain \(g_{m2}r_{o2}\) and a compensation capacitor \(C_c\) across it.
- Output stage, a class-AB push-pull follower: unity voltage gain, high current, low output resistance (see amplifier classes).
DC open-loop gain is the product of the stage gains, \(A_0\approx g_{m1}r_{o1}\cdot g_{m2}r_{o2}\): two intrinsic gains of a few hundred each give \(10^5\) or more.
9Gain-bandwidth
- A compensated op-amp behaves like a single pole: \(A(s) = \dfrac{A_0}{1+s/\omega_p}\), with \(\omega_p\) very low (often 1–100 Hz).
- Above \(\omega_p\), \(|A|\approx A_0\omega_p/\omega\): gain × frequency is constant. That constant is the gain-bandwidth product, \(\text{GBW} = A_0f_p\), equal to the unity-gain frequency \(f_u\).
- Closed loop with feedback β: $$G(s) = \frac{A(s)}{1+A(s)\beta}\approx\frac{1/\beta}{1+s/(\beta\,\omega_u)}$$
- So the closed-loop circuit is also single-pole, with bandwidth $$f_\text{CL} = \beta\,f_u = \frac{\text{GBW}}{\text{noise gain}}$$
A 10 MHz op-amp at a noise gain of 100 has 100 kHz of bandwidth. At that frequency the loop gain is 1, so the precision benefits of feedback are gone; for 1% gain accuracy you need loop gain of 100, which is only true below 1 kHz. Need more bandwidth at high gain? Use two stages of lower gain each.
10Stability and compensation
Feedback is negative only as long as the loop's phase shift stays clear of 180°. If the loop gain still has magnitude 1 when its phase reaches −180°, the subtraction becomes addition and the circuit oscillates.
- Phase margin is \(180° + \angle T\) at the frequency where \(|T| = 1\). 45° gives about 25% step overshoot; 60° gives under 10%. A single pole contributes at most −90°, so it is always stable; each additional pole near the crossover eats margin.
- Every real amplifier has extra poles (the second stage, the output stage, load capacitance). Compensation makes one pole dominant so that \(|T|\) falls below 1 before the others act.
- \(C_c\) across the second stage (gain \(-A_2\)) appears at its input as \(C_c(1+A_2)\), a huge capacitance that creates the dominant pole (the Miller effect from the BJT page, used on purpose).
- In the mid-band, the second stage forces its input to be a virtual ground for the first stage's output current, which therefore flows entirely into \(C_c\): \(v_o\approx g_{m1}v_d/(j\omega C_c)\).
- So \(|A| = 1\) at $$\omega_u = \frac{g_{m1}}{C_c}$$
- The same feedback through \(C_c\) lowers the output resistance of the second stage at high frequency, pushing its pole up to about \(g_{m2}/C_L\). This pole splitting separates the two poles. For about 60° margin, \(g_{m2}/C_L\) must be at least two to three times \(\omega_u\).
A capacitive load \(C_L\) with the op-amp's open-loop output resistance \(R_o\) adds a pole at \(1/(2\pi R_oC_L)\) inside the loop. A follower driving a long cable or a large decoupling capacitor can oscillate. Common fixes: a small isolation resistor (10–100 Ω) between the output and the load, with feedback taken from the op-amp side; or an op-amp specified for capacitive loads.
11Slew rate
- For a large input step the differential pair switches fully (beyond about ±100 mV for a BJT pair) and delivers its entire tail current \(I_\text{tail}\) into \(C_c\).
- The second stage holds its input nearly still, so the output moves at the rate \(C_c\) charges: $$\text{SR} = \frac{dv_o}{dt}\Big|_\text{max} = \frac{I_\text{tail}}{C_c}$$
- Link to bandwidth: for a BJT pair, \(g_{m1} = I_\text{tail}/(2V_T)\), so \(\text{SR} = 2V_T\,\omega_u\approx0.052\,\text{V}\times\omega_u\). Degenerating the input pair (or using FETs, whose \(g_m/I\) is lower) raises SR for the same \(\omega_u\).
- A sine \(V_p\sin\omega t\) has maximum slope \(\omega V_p\) at its zero crossings.
- Undistorted output needs \(\omega V_p\le\text{SR}\): $$f_\text{FPBW} = \frac{\text{SR}}{2\pi V_p}$$
An op-amp with 1 V/µs slew rate can deliver a 10 V peak sine only up to \(10^6/(2\pi\times10)\approx16\) kHz, even if its small-signal bandwidth is 1 MHz. Beyond that, the output turns triangular.
12DC errors
- Input offset voltage \(V_\text{OS}\): the input difference needed for zero output, from mismatch in the input pair (µV for chopper and precision BJT parts, mV for general CMOS). It appears at the output multiplied by the noise gain.
- Input bias current \(I_B\) flows in the input resistors. In an inverting or non-inverting stage, \(I_B\) into \(v_-\) flows through \(R_f\) and gives an output error \(I_BR_f\).
- CMRR and PSRR describe how much a change in common-mode voltage or supply voltage looks like an input offset (e.g. 100 dB CMRR: 1 V of common-mode change = 10 µV of offset).
- Swing and input range: outputs cannot reach the rails unless they are rail-to-rail; inputs may misbehave (even invert phase) outside their common-mode range.
- Inverting stage with \(R_\text{in}\), \(R_f\); signal input grounded, \(v_+\) grounded. Bias current \(I_{B-}\) flows into the \(v_-\) pin.
- The loop holds \(v_-\) at 0 V, so both ends of \(R_\text{in}\) are at 0 V and it carries no current. All of \(I_{B-}\) must come through \(R_f\) from the output: \(V_o = I_{B-}R_f\).
- Put \(R_p = R_\text{in}\parallel R_f\) in series with \(v_+\). \(I_{B+}\) develops \(-I_{B+}R_p\) at \(v_+\), which appears at the output multiplied by the noise gain \(1+R_f/R_\text{in}\): \(-I_{B+}R_p(1+R_f/R_\text{in}) = -I_{B+}R_f\).
- Total error \((I_{B-}-I_{B+})R_f = I_\text{OS}R_f\): only the offset current remains, usually 5–10× smaller than \(I_B\). (With FET-input op-amps, \(I_B\) is pA and the resistor only adds noise.)
13Noise
An op-amp's noise is modelled as a voltage source \(e_n\) (V/√Hz) in series with the input and current sources \(i_n\) (A/√Hz) into each input. Independent noise sources add in power (root-sum-square). Referred to the input of a non-inverting stage with source resistance \(R_s\):
Output noise density is \(e_\text{in,tot}\) times the noise gain (plus the feedback resistors' own noise). Total RMS noise integrates the density over the noise bandwidth; for a single-pole response the noise bandwidth is \(\tfrac\pi2f_{-3\text{dB}}\approx1.57f_c\).
Bipolar input, \(e_n = 1\) nV/√Hz, \(i_n = 2\) pA/√Hz; FET input, \(e_n = 7\) nV/√Hz, \(i_n = 1\) fA/√Hz.
With \(R_s = 100\ \Omega\) (thermal 1.3 nV/√Hz): bipolar total ≈ 1.6 nV/√Hz, FET ≈ 7.1. The bipolar part wins.
With \(R_s = 1\ \text{M}\Omega\) (thermal 129 nV/√Hz): bipolar \(i_nR_s = 2\ \mu\)V/√Hz dominates everything; FET total ≈ 129 nV/√Hz, limited by the source itself. The FET part wins by 15×.
The crossover is near \(R_s = e_n/i_n\): match the amplifier to the source impedance.
At low frequency both \(e_n\) and \(i_n\) rise as \(1/f\) below a corner frequency; chopper and auto-zero op-amps remove 1/f noise and offset by modulating the signal to a higher frequency before amplifying it.
14Comparators and hysteresis
Without feedback, an op-amp saturates to one rail or the other: a crude comparator. Dedicated comparators are faster, recover from saturation quickly and have logic-compatible outputs; op-amps used this way are slow and can latch up or invert. Noise on a slow input makes a comparator chatter as it crosses the threshold, so positive feedback is added to create hysteresis.
- Input to \(v_-\). Output fed back to \(v_+\) through \(R_2\), with \(R_1\) from \(v_+\) to a reference \(V_\text{ref}\).
- \(v_+ = V_\text{ref}\dfrac{R_2}{R_1+R_2} + v_o\dfrac{R_1}{R_1+R_2}\), with \(v_o\) at \(V_\text{OH}\) or \(V_\text{OL}\).
- The two thresholds are \(v_+\) evaluated at each output state; the hysteresis width is $$\Delta V = (V_\text{OH}-V_\text{OL})\frac{R_1}{R_1+R_2}$$
Make \(\Delta V\) larger than the peak noise on the input. The same circuit with an RC from output to input is the relaxation oscillator.
Summary
15Check yourself
Why does an inverting amplifier with gain −1 have half the bandwidth of a voltage follower using the same op-amp?
Its feedback factor is \(\beta = 1/2\) (noise gain 2), while the follower's is 1. Closed-loop bandwidth is \(\beta\cdot\text{GBW}\).
A non-inverting stage with gain 101 uses an op-amp with 2 mV offset. What is the output error?
\(2\ \text{mV}\times 101=202\ \text{mV}\). Offset is multiplied by the noise gain, which here equals the signal gain.
An op-amp has GBW = 5 MHz and SR = 2 V/µs. Can it amplify a 200 kHz, 5 V peak sine at a gain of 10?
Small-signal bandwidth at gain 10 is 500 kHz, fine. But the needed slope is \(2\pi\times200\text{k}\times5 = 6.3\) V/µs, more than 2 V/µs. It will slew-limit and distort; the full-power bandwidth at 5 V peak is only 64 kHz.
Why does a follower driving 100 nF often oscillate?
The op-amp's open-loop output resistance and the load capacitance form a pole inside the loop. Combined with the dominant pole, the phase approaches −180° before the loop gain drops below 1. An isolation resistor moves that pole outside the loop.
When is a FET-input op-amp quieter than a bipolar one even though its \(e_n\) is higher?
When the source impedance is high. Current noise times source resistance (\(i_nR_s\)) dominates for bipolar parts above about \(e_n/i_n\), a few hundred ohms to a few kilohms. FET parts have femtoamp current noise.