Sub topic 4
The inverting amplifier: Vout = -(Rf/Rin) Vin
This chapter assumes you know Ohm's law, Kirchhoff's current law, and the ideal op amp model from earlier chapters. That model has infinite open-loop gain, zero input current, and a virtual short between the inputs when negative feedback is present. Here you use those facts to derive the inverting amplifier's gain and find its input resistance.
The circuit
The input signal passes through Rin to the inverting (-) input. Rf connects the output back to that same input, which supplies the negative feedback. The non-inverting (+) input is grounded.
The inverting input is called the summing node because every current that reaches it is added there.
Derivation from the virtual short
Negative feedback drives the op amp's two inputs to the same voltage. The non-inverting input is at 0 V, so the inverting input is also at 0 V. It is not physically grounded, so engineers call it a virtual ground.
- The current through Rin is I = (Vin - 0) / Rin = Vin / Rin.
- An ideal op amp draws no current into its input, so all of I flows on through Rf.
- The voltage across Rf is I · Rf, and the output sits at 0 V minus that drop: Vout = 0 - (Vin / Rin) · Rf.
The result is:
Vout = -(Rf / Rin) · Vin
The gain is -Rf/Rin. The minus sign means the output is inverted. A +1 V input with Rf = 10 kΩ and Rin = 1 kΩ produces -10 V.
Unlike the non-inverting amplifier, the inverting gain can have any magnitude. A gain of -0.5 only needs Rf to be half of Rin.
Input resistance
The source sees Rin connected to a node held at 0 V. The input resistance of the whole circuit is therefore simply Rin. This is a useful design rule, but it also creates a cost. If the source has its own series resistance Rs, the gain becomes -Rf / (Rin + Rs). The source resistance changes the gain, so it must be small compared with Rin or included in the design.
The output impedance is close to zero. Feedback holds the output voltage steady as the load current changes, until the op amp reaches its current or voltage limits.
Checking the formula numerically
The Python function below compares the ideal gain with the gain for a finite open-loop gain A.
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)
print(inverting_gain(10e3, 1e3)) # -10.0
print(inverting_gain(10e3, 1e3, 1e5)) # about -9.9989With A = 100,000, the gain differs from -10 by about 0.01%. Later chapters cover this finite-gain error in more detail.
You can confirm the result in SPICE. The voltage-controlled voltage source E1 models the op amp with a gain of 1e5.
* 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 show V(out) close to -10 V and V(inv) close to 0 V.
Common errors
- Grounding the wrong input. If you ground the inverting input instead, the feedback becomes positive and the output saturates.
- Ignoring the source resistance. A source with 1 kΩ of output resistance driving a 1 kΩ Rin gives half the expected gain.
- Forgetting the supply limit. The equation does not know about the rails. A -10 V result from a ±5 V supply will clip near -5 V or less.
- Applying the virtual short without feedback. The 0 V assumption holds only while the output is not saturated and the feedback loop is working.
Exercise
An inverting amplifier uses Rin = 4.7 kΩ and Rf = 47 kΩ, with Vin = 0.5 V. What are the gain, Vout, and the resistance the source sees?
Show answer
Gain = -47k / 4.7k = -10. Vout = -10 × 0.5 V = -5 V. The source sees Rin = 4.7 kΩ, because the summing node is a virtual ground.