Sub topic 7
The inverting amplifier
This chapter assumes you know Ohm's law, KCL, node-voltage analysis, and the ideal op amp constraints from the previous chapters: zero input current and a virtual short between the input terminals when negative feedback is present.
The circuit
In the inverting amplifier, the non-inverting input (+) is tied to ground. The input source Vin connects through Rin to the inverting input (−). A feedback resistor Rf connects the output back to the inverting input.
Because Rf returns a portion of the output to the (−) input, the feedback is negative. The ideal constraints therefore apply.
Derivation
- The (+) input is at 0 V. The virtual short forces the (−) node to 0 V as well. This node is called a virtual ground. It is not physically connected to ground, so current cannot flow into it from the op amp.
- The current through Rin, from the source toward the (−) node, is Iin = (Vin − 0) / Rin.
- The ideal op amp draws no current at its (−) input. KCL at that node says all of Iin must flow through Rf toward the output: If = Iin.
- The voltage across Rf is 0 − Vout, so If = (0 − Vout) / Rf.
- Setting If = Iin gives −Vout / Rf = Vin / Rin.
The result is:
Vout / Vin = −Rf / Rin
The gain is set only by a resistor ratio. The negative sign means the output is inverted relative to the input. The input resistance seen by the source is Rin, because the (−) node sits at 0 V.
Worked example
Let Rin = 1 kΩ, Rf = 10 kΩ, and Vin = 0.5 V.
- Gain = −10 kΩ / 1 kΩ = −10.
- Vout = −10 × 0.5 V = −5 V.
- Iin = 0.5 V / 1 kΩ = 0.5 mA, and this same current flows through Rf, which drops 0.5 mA × 10 kΩ = 5 V.
You can check the result in a simulator. The voltage-controlled voltage source E1 models the op amp, with 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
.endWith Vin = 1 V, the operating point gives V(out) very close to −10 V.
Effect of finite open-loop gain
A real op amp has a large but finite gain A. The closed-loop gain becomes the ideal gain divided by 1 + (1 + Rf/Rin) / A. This code compares the two models:
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, the gain error is about 0.011%, so the ideal formula is accurate here.
Common errors
- Writing Vout / Vin = +Rf / Rin. Check the current direction: the current into the output side of Rf makes Vout negative when Vin is positive.
- Treating the (−) node as a connection to ground. It is at 0 V, but no current flows to ground there.
- Applying the formula when the output would exceed the supply rails. If Vin = 2 V in the example above with ±15 V supplies, the ideal result of −20 V is impossible. The output saturates near −15 V, and the linear analysis no longer holds.
Exercise
An inverting amplifier uses Rin = 2 kΩ and Rf = 30 kΩ with Vin = −0.4 V. What are the gain, Vout, and the current through Rf? Assume the supplies are ±15 V.
Show answer
Gain = −30 kΩ / 2 kΩ = −15. Vout = −15 × (−0.4 V) = +6 V, which is within ±15 V. The input current is −0.4 V / 2 kΩ = −0.2 mA. The same current flows through Rf, so the current through Rf is 0.2 mA in magnitude, directed from the output toward the (−) node. The drop across Rf is 0.2 mA × 30 kΩ = 6 V, which matches Vout.
Exercise
For Rin = 1 kΩ and Rf = 10 kΩ, what input voltage range keeps the output linear with ±15 V supplies?
Show answer
The gain is −10, so |Vin| must stay below 15 V / 10 = 1.5 V. The input should be between −1.5 V and +1.5 V. In practice, real outputs saturate slightly below the rails, so the usable range is a bit smaller.