Sub topic 7
The Inverting Amplifier
This chapter assumes you can apply Kirchhoff's current law (KCL) at a node, write node-voltage equations for resistor circuits, and recognize a voltage-controlled voltage source. It also assumes you know the ideal op amp constraints from the previous chapters: the input terminals draw no current, and negative feedback holds the two input voltages equal (the virtual short).
The circuit
In the inverting amplifier, the input source Vin connects through a resistor R1 to the inverting input (the minus terminal). A feedback resistor Rf connects the output back to that same terminal. The non-inverting input (the plus terminal) connects to ground.
The feedback path goes from the output to the minus terminal. That is negative feedback. If Vout rises, the feedback pulls the minus node up, which reduces the difference the op amp amplifies and pushes Vout back down.
Deriving the gain with the ideal model
Use the procedure from the previous chapter: apply the ideal constraints, then write KCL at the node where the resistors meet.
- The plus terminal is grounded, so v+ = 0 V.
- The virtual short forces v- = v+, so v- = 0 V. This node is called a virtual ground. It sits at 0 V but is not physically connected to ground.
- The current through R1 follows from Ohm's law across a known voltage drop: i1 = (Vin - 0) / R1 = Vin / R1.
- The op amp input draws no current, so all of i1 must flow through Rf. KCL at the inverting node gives i1 = if.
- The current if flows from the node (at 0 V) to the output, so the voltage across Rf is 0 - Vout. Therefore if = (0 - Vout) / Rf.
Setting the two currents equal:
Vin / R1 = -Vout / Rf
Solving for the output:
Vout = -(Rf / R1) × Vin
The closed-loop gain is -Rf / R1. It depends only on two resistor values, not on the op amp. That is the main reason feedback circuits are useful: resistors are cheap, stable and precise, while the op amp's own gain varies widely between parts.
What the virtual ground tells you
Two results follow from the virtual ground, and both matter when you design a stage.
Input resistance. The source Vin sees R1 connected to a node held at 0 V. The current drawn from the source is Vin / R1, so the input resistance is R1. This is a real limitation. If the source has its own resistance Rs, the gain becomes -Rf / (R1 + Rs), so a high-resistance source needs a large R1 or a buffer first.
Output resistance. In the ideal model, the output is a controlled voltage source with zero output resistance. Changing the load does not change Vout. The extra load current comes from the op amp output, not through Rf. Real op amps have a small output resistance that feedback reduces further, but they also have a maximum output current.
Worked example
Design a stage with a gain of -10 and an input resistance of at least 10 kohm, then predict its behavior for a 0.5 V input.
- Choose R1 = 10 kohm to meet the input resistance requirement.
- Choose Rf = 10 × R1 = 100 kohm.
- For Vin = 0.5 V, the current is i1 = 0.5 V / 10 kohm = 50 uA.
- That current flows through Rf, producing a drop of 50 uA × 100 kohm = 5 V. The node is at 0 V, so Vout = -5 V.
- This agrees with -(100 kohm / 10 kohm) × 0.5 V = -5 V.
If a 2 kohm load is connected to the output, the load current is 5 V / 2 kohm = 2.5 mA. The op amp supplies this current. The ideal gain stays at -10.
Gain values you can reach
Unlike the non-inverting amplifier, the inverting amplifier can have a gain magnitude below 1, because Rf can be smaller than R1.
| R1 | Rf | Gain Rf/R1 (inverting) | Input resistance |
|---|---|---|---|
| 10 kohm | 10 kohm | -1 | 10 kohm |
| 10 kohm | 100 kohm | -10 | 10 kohm |
| 10 kohm | 5 kohm | -0.5 | 10 kohm |
| 1 kohm | 10 kohm | -10 | 1 kohm |
The third and fourth rows show a design trade-off. A gain of -10 can come from either 10 kohm / 100 kohm or 1 kohm / 10 kohm, but the second pair loads the source ten times more heavily. Very large resistors, on the other hand, add thermal noise and make real input bias currents produce larger offset errors.
Checking with a simulation
A SPICE model of the ideal op amp uses a voltage-controlled voltage source with a very large gain. The line E1 out 0 0 inn 1e6 sets V(out) = 1e6 × (V(0) - V(inn)).
Inverting amplifier with an ideal op amp modeled as a VCVS
Vin in 0 DC 1
R1 in inn 1k
R2 inn out 10k
E1 out 0 0 inn 1e6
.op
.endThe operating point reports V(out) very close to -10 V, matching -R2 / R1 with a 1 V input. The voltage at inn comes out at about -10 uV, essentially the virtual ground.
Saturation: where the linear result stops
The formula Vout = -(Rf / R1) × Vin assumes the output can actually reach the computed voltage. An op amp output cannot go beyond its supply rails. With a +/-15 V supply, a gain of -10 and an input of 2 V would call for -20 V, which is impossible. The output stops near the negative rail, often 1 to 2 V inside it for a bipolar-output device.
When that happens, the virtual short is no longer valid. The op amp's input difference grows beyond a few microvolts, because the feedback can no longer pull the output to the required value. Always check that the predicted output lies inside the rails before trusting the linear analysis.
def ideal_opamp_output(v_plus, v_minus, gain=1e5, v_neg=-15.0, v_pos=15.0):
"""Open-loop output of an op amp, limited to the supply rails."""
v = gain * (v_plus - v_minus)
return max(v_neg, min(v_pos, v))
def inverting_output(vin, rf, r1, v_neg=-15.0, v_pos=15.0):
"""Ideal inverting amplifier output, clipped to the supply rails."""
return max(v_neg, min(v_pos, -rf / r1 * vin))
print(inverting_output(0.5, 100e3, 10e3)) # -5.0 (linear)
print(inverting_output(2.0, 100e3, 10e3)) # -15.0 (clipped at the rail)Effect of finite open-loop gain
A real op amp has a large but finite open-loop gain A. Take v- as unknown, with Vout = -A × v-. KCL at the inverting node gives (Vin - v-) / R1 = (v- - Vout) / Rf. Substituting v- = -Vout / A and solving gives:
Vout / Vin = -(Rf / R1) / (1 + (1 + Rf / R1) / A)
The ideal gain is divided by a factor slightly above 1. The function below computes both forms.
def inverting_gain(rf, rin, a=None):
"""Closed-loop gain Vout/Vin of the inverting amplifier.
a=None uses the ideal model; otherwise a is the finite open-loop gain."""
ideal = -rf / rin
if a is None:
return ideal
return ideal / (1 + (1 + rf / rin) / a)
print(inverting_gain(10e3, 1e3)) # -10.0
print(inverting_gain(10e3, 1e3, a=1e5)) # about -9.9989With A = 100,000 and a nominal gain of -10, the error is about 0.011 percent. The error grows with the gain: the quantity (1 + Rf / R1) / A is the fractional error, so a gain of -1000 with the same A would be about 1 percent off. Open-loop gain also falls with frequency, which makes this effect much larger for fast signals. Later chapters on non-ideal limits cover that.
Common errors
- Wrong sign in KCL. Write the current through each resistor as (higher-voltage end minus lower-voltage end) / R in the direction you assume, and keep the direction consistent. A frequent slip is writing Vout / Rf instead of (0 - Vout) / Rf.
- Forgetting the source resistance. The input resistance is R1, so a source with a series resistance changes the gain.
- Treating the inverting node as ground when the amplifier saturates. The virtual short holds only while the output is in its linear range.
- Swapping the input terminals. If the feedback resistor goes to the plus terminal, the feedback is positive and the circuit latches to a rail.
- Ignoring supply connections. With a single positive supply, a grounded plus input cannot produce a negative output, so the stage needs a bias voltage at the plus input.
Exercise
An inverting amplifier uses R1 = 2.2 kohm and Rf = 33 kohm, with a +/-12 V supply. (a) What is the ideal gain? (b) What is the ideal output for Vin = 0.4 V? (c) What happens for Vin = 1.2 V, and what current flows in Rf for Vin = 0.4 V?
Show answer
(a) Gain = -Rf / R1 = -33 / 2.2 = -15. (b) Vout = -15 × 0.4 V = -6 V. (c) The linear result for 1.2 V would be -18 V, which is beyond the -12 V rail, so the output saturates a little above -12 V and the virtual short no longer holds. For Vin = 0.4 V, the current is Vin / R1 = 0.4 V / 2.2 kohm, about 182 uA, and the same current flows through Rf, giving a drop of about 6 V across it.
Exercise
Using the finite-gain formula, find the actual gain of an inverting amplifier with Rf = 99 kohm, R1 = 1 kohm and open-loop gain A = 10,000. By what percentage does it differ from the ideal gain?
Show answer
The ideal gain is -99. The actual gain is -99 / (1 + (1 + 99) / 10,000) = -99 / 1.01, about -98.02. The difference from the ideal value is about 0.99 percent.