Sub topic 4
The Inverting Amplifier: Vout = -(Rf/Rin) Vin
This chapter assumes you know Ohm's law, Kirchhoff's current law, and series and parallel resistors. It also assumes you can read a simple schematic and have met the ideal op amp model and the virtual short. Here we derive the inverting amplifier's gain, find its input and output behavior, and check the result against a real op amp.
The circuit
The inverting amplifier uses one op amp and two resistors.
- The non-inverting input (+) connects to ground.
- The source Vin connects through Rin to the inverting input (-).
- The feedback resistor Rf connects from the output back to the inverting input.
The junction of Rin, Rf, and the inverting input is the summing node. All currents in the circuit meet there.
The loop through Rf is the negative feedback. Any rise in the output pulls the summing node back toward the grounded + input.
Deriving the gain
We use two ideal-op-amp facts:
- Virtual short. With negative feedback and a large open-loop gain, the op amp keeps V- equal to V+. Here V+ is 0 V, so V- is about 0 V.
- No input current. The op amp inputs draw essentially no current.
Follow the current through Rin. Because V- is 0 V:
I_in = (Vin - 0) / Rin = Vin / RinNo current enters the op amp input, so all of I_in must flow through Rf toward the output:
I_f = I_in = Vin / RinThe voltage across Rf is I_f × Rf, and the summing node sits at 0 V. The output voltage is therefore:
Vout = 0 - I_f × Rf = -(Rf / Rin) × VinThe closed-loop gain is -Rf/Rin. The minus sign means the output is inverted: a positive input gives a negative output, and a sine wave comes out 180° out of phase. The gain depends only on the resistor ratio, not on the op amp's own gain. That independence is why feedback circuits are precise and repeatable.
| Rin | Rf | Gain | Vin = 0.5 V gives |
|---|---|---|---|
| 1 kΩ | 1 kΩ | -1 | -0.5 V |
| 1 kΩ | 10 kΩ | -10 | -5 V |
| 10 kΩ | 5 kΩ | -0.5 | -0.25 V |
| 2.2 kΩ | 47 kΩ | about -21.4 | about -10.7 V |
Unlike the non-inverting amplifier, the inverting amplifier can have a gain magnitude below 1. Choose Rf smaller than Rin, as in the third row.
Why the summing node is called a virtual ground
The summing node is held at 0 V without being wired to ground. Current can flow into it, but the voltage there does not move. Engineers call it a virtual ground.
The op amp holds the node by adjusting its output. Suppose Vin rises. A little more current flows through Rin toward the node. The node starts to rise above 0 V. The op amp sees V- above V+, and its output moves negative. That pulls current out of the node through Rf, which cancels the extra current from Rin. The node ends up almost exactly where it started.
The words "virtual ground" apply only while feedback works. If the output saturates against a supply rail (see below), the node is no longer held at 0 V.
Input resistance
The summing node stays at 0 V. The source therefore sees Rin connected between Vin and ground, and the input resistance is:
R_in(amplifier) = RinThis is much lower than the input resistance of a non-inverting amplifier, which is nearly the op amp's own huge input resistance. Rin is also the same resistor that sets the gain. So raising the gain by shrinking Rin also loads the source harder.
If the source has its own output resistance Rs, that resistance adds in series with Rin:
Gain = -Rf / (Rs + Rin)For example, take Rs = 1 kΩ, Rin = 9 kΩ, and Rf = 90 kΩ. If you ignored Rs, you would expect -10. The real gain is -90 / 10 = -9, a 10% error. The fix is to include Rs in the calculation, or to buffer the source with a voltage follower.
Output resistance
The op amp's output stage plus feedback drives the output node strongly. The closed-loop output resistance is roughly the open-loop output resistance divided by the loop gain, so it is typically a fraction of an ohm at low frequencies. The inverting amplifier can therefore drive a moderate load without the gain changing. This holds only while the load current stays within the op amp's output current limit. A heavy load can make the output droop or saturate.
Checking with the finite-gain formula
The ideal derivation assumes infinite open-loop gain A. A real op amp has a large but finite A. Working through the node equation with V- = -Vout/A gives:
Vout/Vin = -(Rf/Rin) / (1 + (1 + Rf/Rin)/A)The factor (1 + Rf/Rin) is called the noise gain. It is the gain that matters for the error terms, and it is larger than the signal gain's magnitude by exactly 1. The gain error is small when A is much larger than the noise gain.
def inverting_gain(rf, rin, open_loop_gain=float('inf')):
ideal = -rf / rin
if open_loop_gain == float('inf'):
return ideal
return ideal / (1 + (1 + rf / rin) / open_loop_gain)
ideal = inverting_gain(10e3, 1e3)
real = inverting_gain(10e3, 1e3, 1e5)
print(ideal) # -10.0
print(real) # about -9.9989
print(f"{abs(real - ideal) / abs(ideal):.4%}") # about 0.0110%With A = 100,000 and a gain of -10, the error is about 0.011%. That is far smaller than the tolerance of ordinary 1% resistors, so the resistors dominate the accuracy at DC.
Simulating it in SPICE
In this netlist, the voltage-controlled voltage source E1 models the op amp. Its output is 1e5 times the difference between its + control node (ground, node 0) and its - control node (inv).
* Inverting amplifier, ideal gain -10
Vin in 0 DC 1
Rin in inv 1k
Rf inv out 10k
E1 out 0 0 inv 1e5
.op
.endThe operating point should report V(out) close to -9.9989 V. It should also report V(inv) near -0.1 mV, which is the tiny residual voltage at the "virtual" ground (about -Vout/A).
Output limits
The equation Vout = -(Rf/Rin) Vin does not know about the power supply. A real op amp cannot drive its output beyond the supply rails, and many cannot reach them. Suppose the op amp runs from ±15 V and its output reaches about ±13 V. Then at a gain of -10, an input beyond ±1.3 V clips the output.
Check the limit before choosing the gain: maximum |Vin| must be at most Vout(max) divided by |gain|. When the output clips, the feedback loop is no longer in control and the virtual short fails.
Bandwidth
The gain-bandwidth product (GBW) of the op amp sets how much bandwidth remains at a given gain. The closed-loop -3 dB bandwidth is approximately:
f(-3 dB) ≈ GBW / (1 + Rf/Rin)For a 1 MHz GBW op amp and a gain of -10, the noise gain is 11 and the bandwidth is about 91 kHz. Slew rate also limits large, fast signals. Both topics have their own chapters.
Common errors
- Forgetting the minus sign. Many designs need an inverted signal to be fixed later. Decide up front whether inversion is acceptable.
- Ignoring source resistance. Rs adds to Rin, so the gain is lower than Rf/Rin.
- Using too small an Rin. Rin is the load on the source. A 100 Ω Rin on a weak sensor distorts the signal even though the gain math looks fine.
- Using huge resistors. Rin and Rf in the megohm range add thermal noise and make the circuit sensitive to bias current and stray capacitance.
- Swapping the op amp inputs. If the + and - connections are reversed, the feedback becomes positive and the output slams into a rail.
- Treating the summing node as a real ground. Never connect it to ground or to a low-impedance source. It only behaves like ground because the op amp is working.
- Checking only the gain. A result of -10 at DC says nothing about clipping, bandwidth, or loading. Check all three.
Summary of the working model
- The + input is grounded, so the feedback holds the summing node at about 0 V.
- The input current Vin/Rin has nowhere to go but through Rf.
- Vout = -(Rf/Rin) Vin, with gain magnitude set only by the resistor ratio.
- The source sees Rin as the input resistance, so Rin and the source resistance Rs together determine the gain loading.
- The output is limited by the supply rails, and the bandwidth by GBW divided by the noise gain 1 + Rf/Rin.
Exercise
A sensor has an output resistance of 1 kΩ. You connect it to an inverting amplifier with Rin = 9 kΩ and Rf = 90 kΩ, powered so the output can swing to ±10.5 V. (a) What is the actual gain? (b) What is the largest sensor amplitude that avoids clipping? (c) What is the closed-loop bandwidth if the op amp GBW is 2 MHz, using the noise gain with Rs included?
Show answer
(a) The total input-side resistance is 1 kΩ + 9 kΩ = 10 kΩ, so gain = -90 kΩ / 10 kΩ = -9. (b) The maximum amplitude is 10.5 V / 9 ≈ 1.17 V. (c) The noise gain is 1 + 90 kΩ / 10 kΩ = 10, so the bandwidth is about 2 MHz / 10 = 200 kHz.
Exercise
An inverting amplifier uses Rin = 2 kΩ and Rf = 20 kΩ with an op amp whose open-loop gain is 50,000. Using the finite-gain formula, what is the actual closed-loop gain, and what is the percentage error from the ideal gain?
Show answer
The ideal gain is -10 and the noise gain is 1 + 10 = 11. The actual gain is -10 / (1 + 11/50000) = -10 / 1.00022 ≈ -9.9978. The error is about 0.022%.