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:

$$v_o = A\,(v_+ - v_-)$$

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

xin Σ+− error e A xout β
The output is measured, scaled by β (usually a resistor divider) and subtracted from the input. The amplifier acts only on the error.
Derivation · closed-loop gain
  1. The error is \(e = x_\text{in} - \beta x_\text{out}\), and \(x_\text{out} = Ae\).
  2. 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)}$$
  3. The product \(T = A\beta\) is the loop gain. When \(T\gg1\), \(G\to1/\beta\): the gain depends only on the feedback network.
  4. 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\).
Number

\(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:

  1. 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.
  2. No input current: \(i_+ = i_- \approx 0\).

Every circuit below is solved with these two rules plus KCL.

4Non-inverting amplifier

−+vinRgRfvo
Non-inverting amplifier. The divider Rf, Rg feeds back \(\beta =R_{\text{g}}/(R_{\text{f}}+R_{\text{g}})\) of the output, and the op-amp drives v− to equal vin: \(v_{\text{o}}=(1+R_{\text{f}}/R_{\text{g}})\,v_{\text{in}}\).
Derivation
  1. 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)\).
  2. Virtual short: \(v_- = v_+ = v_\text{in}\). So $$\frac{v_o}{v_\text{in}} = \frac1\beta = 1+\frac{R_f}{R_g}$$
  3. 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.

−+vinvo
Voltage follower: the limiting case \(R_{\text{f}}=0\), Rg open, so \(\beta =1\) and \(v_{\text{o}}=v_{\text{in}}\). Full feedback gives the highest loop gain, the lowest output impedance, and the hardest stability case.

5Inverting amplifier

−+vovirtual groundvinRinRf
Inverting amplifier. The non-inverting input is grounded, so feedback holds v− at 0 V (virtual ground). The input current vin/Rin must all flow through Rf, giving \(v_{\text{o}}=-(R_{\text{f}}/R_{\text{in}})\,v_{\text{in}}\).
Derivation
  1. \(v_+\) grounded. Input through \(R_\text{in}\) to \(v_-\); \(R_f\) from output to \(v_-\).
  2. Virtual short: \(v_- = 0\), a virtual ground.
  3. 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}}$$
  4. Input impedance is just \(R_\text{in}\) (the other end sits at virtual ground).
Signal gain vs noise gain

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.

−+v1R1v2R2v3R3Rfvo
Summing amplifier. Each input pushes its own current vk/Rk into the virtual ground, and the sum flows through Rf: \(v_{\text{o}}=-R_{\text{f}}(v_{1}/R_{1}+v_{2}/R_{2}+v_{3}/R_{3})\).
−+v1R1R2v2R3R4vo
Difference amplifier. With \(R_{4}/R_{3}=R_{2}/R_{1}=G\), \(v_{\text{o}}=G(v_{2}-v_{1})\). Any mismatch between the two ratios lets common-mode voltage through, which is why CMRR depends on resistor matching.
Derivation · difference amplifier
  1. \(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.
  2. \(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_+\).
  3. If \(R_4/R_3 = R_2/R_1 = G\): \(v_o = G\,(v_2 - v_1)\). Only the difference is amplified.
  4. 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.

+−A1−+A2v+v−RGRR−+A3R2R2R3R3vo
Three-op-amp instrumentation amplifier. A1 and A2 are non-inverting stages sharing RG: the full input difference appears across RG, so the differential gain is 1 + 2R/RG while common-mode passes at unity gain. A3 is a difference amplifier with gain R3/R2.

7Integrator, differentiator and transimpedance amplifier

−+vovirtual groundvinRCRp (optional, large)
Integrator. Input current vin/R charges C, so \(v_{\text{o}}=-(1/RC)\int v_{\text{in}}\,\mathrm{d}t\). The optional large Rp across C limits DC gain to −Rp/R so offset and bias current cannot walk the output into the rail.
Derivation · integrator
  1. Inverting configuration with a capacitor \(C\) as the feedback element.
  2. Current into the virtual ground \(v_\text{in}/R\) must flow into the capacitor: \(v_\text{in}/R = -C\,dv_o/dt\).
  3. $$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.

−+vovirtual groundvinRsCR
Differentiator. Capacitor current C·dvin/dt flows through R, so \(v_{\text{o}}=-RC\cdot \mathrm{d}v_{\text{in}}/\mathrm{d}t\). The small series Rs caps the high-frequency gain at R/Rs, which tames noise and keeps the loop stable.
−+RfCfvo
Transimpedance amplifier. The photodiode sits between the virtual ground and ground, so it operates at zero bias. Its photocurrent Iph flows into the node and out through Rf: \(v_{\text{o}}=-I_{\text{ph}}R_{\text{f}}\). Cf compensates the pole formed by Rf and the photodiode capacitance.
Derivation · transimpedance amplifier (TIA)
  1. A current source (a photodiode) drives the virtual ground directly; feedback resistor \(R_f\).
  2. 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.
  3. 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:

  1. 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}\).
  2. Second gain stage, a common-emitter or common-source stage, with gain \(g_{m2}r_{o2}\) and a compensation capacitor \(C_c\) across it.
  3. Output stage, a class-AB push-pull follower: unity voltage gain, high current, low output resistance (see amplifier classes).
V+V−Q1Q2Q3Q4Itailv−v+Q5I2Cc×1voinput stage: differential pair + current-mirror loadgain stageoutput
A simplified two-stage bipolar op-amp. Q1–Q2 form the differential pair with tail current Itail; Q3–Q4 are the current-mirror load that converts the pair to a single-ended output. Q5 is the common-emitter gain stage with current-source load I2, and Cc is the Miller compensation capacitor. A unity-gain push-pull buffer drives the output. Raising v+ raises the output, so the base of Q2 is the non-inverting input.

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

Derivation · closed-loop bandwidth
  1. 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).
  2. 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\).
  3. Closed loop with feedback β: $$G(s) = \frac{A(s)}{1+A(s)\beta}\approx\frac{1/\beta}{1+s/(\beta\,\omega_u)}$$
  4. 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.

Derivation · Miller compensation sets \(\omega_u\)
  1. \(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).
  2. 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)\).
  3. So \(|A| = 1\) at $$\omega_u = \frac{g_{m1}}{C_c}$$
  4. 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\).
Capacitive loads

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.

−+vinRisoCLvo
Driving a capacitive load. Riso (typically 10–100 Ω) separates CL from the op-amp output, so CL no longer adds a pole inside the feedback loop. Feedback is taken from the op-amp side of Riso.

11Slew rate

Derivation · \(\text{SR} = I_\text{tail}/C_c\)
  1. 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\).
  2. 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}$$
  3. 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\).
Derivation · full-power bandwidth
  1. A sine \(V_p\sin\omega t\) has maximum slope \(\omega V_p\) at its zero crossings.
  2. 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

−+voRp = Rin ∥ Rfvirtual groundvinRinRf
Bias-current compensation. \(R_{\text{p}}=R_{\text{in}}\) ∥ Rf makes both inputs see the same source resistance, so equal bias currents produce equal voltages that cancel at the output. Only the offset current IOS remains.
Derivation · bias-current compensation
  1. Inverting stage with \(R_\text{in}\), \(R_f\); signal input grounded, \(v_+\) grounded. Bias current \(I_{B-}\) flows into the \(v_-\) pin.
  2. 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\).
  3. 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\).
  4. 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\):

$$e_\text{in,tot} = \sqrt{e_n^2 + (i_nR_s)^2 + 4kTR_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\).

Number · choosing the op-amp for the source

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.

−+vinR1VrefR2vo
Inverting Schmitt trigger. R2 feeds the output back to the non-inverting input (positive feedback), so the threshold at v+ jumps when the output switches. The hysteresis width is (VOH − VOL)·R1/(R1+R2).
Derivation · inverting Schmitt trigger
  1. Input to \(v_-\). Output fed back to \(v_+\) through \(R_2\), with \(R_1\) from \(v_+\) to a reference \(V_\text{ref}\).
  2. \(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}\).
  3. 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

Feedback\(G = A/(1+A\beta)\to1/\beta\); errors ÷ \((1+T)\)
Golden rules\(v_+ = v_-\), no input current
Non-inverting\(1+R_f/R_g\)
Inverting\(-R_f/R_\text{in}\); noise gain \(1+R_f/R_\text{in}\)
Bandwidth\(f_\text{CL} = \text{GBW}/\text{noise gain}\)
Compensation\(\omega_u = g_{m1}/C_c\); 2nd pole ≥ 2–3 \(\omega_u\)
Slew\(\text{SR} = I_\text{tail}/C_c\); \(f_\text{FPBW} = \text{SR}/2\pi V_p\)
Noise\(\sqrt{e_n^2+(i_nR_s)^2+4kTR_s}\)

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.