Sub topic 4
Inverting amplifier as the building block
The inverting amplifier is the circuit the summing amplifier, the integrator and part of the difference amplifier are all built from. This chapter derives its gain from the virtual short and works through the details that matter in practice: input resistance, finite gain error, source resistance, and output limits. It assumes you know KCL, Ohm's law, voltage dividers, and the ideal op amp model and virtual short from the previous chapters.
The circuit
An input source drives resistor Rin. The other end of Rin connects to the inverting input (the "−" terminal). A feedback resistor Rf runs from the output back to that same terminal. The non-inverting input (the "+" terminal) goes to ground.
Negative feedback is present because the output connects to the "−" input. If Vout rises, the feedback pulls the "−" node up, which pushes the output back down. This is why the virtual short applies.
Deriving the gain
Use the two ideal assumptions: the op amp inputs draw no current, and under negative feedback the two inputs sit at the same voltage.
- The "+" input is grounded, so the "−" input is also at 0 V. This node is called a virtual ground. It has the voltage of ground but is not connected to ground, so no current can flow into it from the op amp.
- The current through Rin is
iin = (Vin − 0) / Rin = Vin / Rin. - No current enters the op amp input, so all of
iinmust flow through Rf (KCL at the "−" node). The feedback resistor carriesiinfrom the node toward the output. - The voltage across Rf is
0 − Vout, soiin = (0 − Vout) / Rf. - Set the two expressions for the current equal:
Vin / Rin = −Vout / Rf.
Solving for the output gives:
Vout = −(Rf / Rin) · Vin
The gain is set only by a resistor ratio, and the minus sign means the output is inverted. A 1 V input with Rin = 10 kΩ and Rf = 47 kΩ gives a current of 100 µA through both resistors and an output of −4.7 V.
Why the node is called a summing node
The derivation never used the fact that there is only one input resistor. The "−" node is a point where currents add. Any current that arrives there must leave through Rf. Adding more resistors from other sources into the same node adds their currents. That is the entire idea behind the summing amplifier in the next chapter.
What the circuit presents to its source and load
The ideal model gives these properties:
| Property | Value | Reason |
|---|---|---|
| Voltage gain | −Rf / Rin | Set by the virtual short and KCL |
| Input resistance seen by the source | Rin | The "−" node is at 0 V, so the source sees Rin to ground |
| Output resistance | 0 Ω | The op amp output holds Vout regardless of load current (within its limits) |
| Current into op amp inputs | 0 A | Ideal model |
The input resistance matters. Unlike a non-inverting amplifier, this circuit loads its source with a finite resistance. If the source has its own resistance Rs, that resistance adds in series with Rin:
Vout = −Rf / (Rs + Rin) · Vsource
A 1 kΩ source feeding Rin = 10 kΩ with Rf = 100 kΩ gives a gain of −100/11 = −9.09, not −10. If you need a precise gain from a source with unknown resistance, buffer the source first or use a non-inverting stage.
Load independence
Because the ideal output resistance is zero, a load resistor on the output changes the current the op amp supplies but not Vout. A real op amp has a maximum output current, so a small load and a large output voltage can force the output to limit. Check that |Vout| / Rload + |Vout| / Rf stays below the datasheet output current rating.
Choosing resistor values
Only the ratio sets the gain, but the absolute values still matter:
- Too small: Rin loads the source, and the output must supply
Vout / Rfof extra current. Values below about 1 kΩ often stress the source or the op amp. - Too large: Resistor thermal noise grows with resistance, and the op amp's input bias current produces larger error voltages across the resistors. Bias current and stray capacitance both matter more above roughly 1 MΩ.
- Typical choice: Rin between 1 kΩ and 100 kΩ for general-purpose parts, then pick Rf for the gain.
A finite-gain correction
A real op amp has a large but finite open-loop gain A, so the "−" node is not exactly at 0 V. It sits at v− = −Vout / A. Redoing KCL with that voltage gives:
Vout / Vin = −(Rf / Rin) / (1 + (1 + Rf / Rin) / A)
The quantity (1 + Rf/Rin) is the noise gain (the gain of the same circuit seen from the "+" input). The error is roughly (1 + Rf/Rin) / A as a fraction. High closed-loop gain and low open-loop gain both increase it. This is why the ideal formula works well for gains of 1 to 100 with A of 100,000 or more, and poorly for a gain of 1000 with the same part.
The simulation below uses a voltage-controlled voltage source with a gain of 100,000 as the op amp. With Vin = 0.5 V, Rin = 1 kΩ and Rf = 10 kΩ, the ideal output is −5 V.
* Inverting amplifier, gain -10, op amp modeled as a high-gain VCVS
Vin in 0 DC 0.5
Rin in inv 1k
Rf inv out 10k
E1 out 0 0 inv 100k
.op
.endThe operating point should show V(out) near −4.9995 V and V(inv) near +50 µV. The tiny voltage at the inverting node is the virtual short, and it is not exactly zero because the gain is finite.
The Python check below compares the ideal gain to the finite-gain gain, and then shows the effect of a source resistance.
def inverting_gain(rin, rf, a=float("inf")):
"""Closed-loop gain of the inverting amplifier with open-loop gain a."""
ideal = -rf / rin
if a == float("inf"):
return ideal
return ideal / (1 + (1 + rf / rin) / a)
print(round(inverting_gain(10e3, 100e3), 4)) # -10.0
print(round(inverting_gain(10e3, 100e3, a=1e5), 4)) # -9.9989
# Source resistance adds to Rin: 1 kohm source into Rin = 10 kohm, Rf = 100 kohm
print(round(inverting_gain(10e3 + 1e3, 100e3), 3)) # -9.091Output limits
The output cannot exceed the supply rails. A part powered from ±12 V might reach only about ±10.5 V. If Vin = 3 V and the ideal gain is −5, the formula predicts −15 V, but the output clips near −10.5 V. When the output clips, the virtual short no longer holds, and the "−" node moves away from 0 V. Test your design against the largest expected input, not just a typical one.
Generalizing to impedances
Nothing in the derivation required resistors. Replace Rin and Rf with impedances Zin and Zf, and the same steps give:
Vout / Vin = −Zf / Zin
This one result produces the next circuits in the tutorial:
- Several resistors from different sources into the same node give the summing amplifier.
- Replacing Rf with a capacitor makes
Zf = 1/(sC)and gives the integrator. - Combining this stage with a non-inverting path gives the difference amplifier.
Common mistakes
| Mistake | Effect | Fix |
|---|---|---|
| Using gain +Rf/Rin | Wrong sign on the output | Remember the output is inverted: −Rf/Rin |
| Using 1 + Rf/Rin | This is the non-inverting gain, so the value is off by 1 or more | Use the formula that matches the input connection |
| Ignoring source resistance | Gain is lower than expected | Add Rs to Rin, or buffer the source |
| Assuming the "−" node is grounded | Wrong current when the output is clipped | Check the output is within the supply range |
| Putting the input on the "+" side while the resistor ratio is for "−" | Circuit becomes non-inverting | Trace which input the signal drives |
| Very large resistors | Bias current and noise errors | Keep values in the kΩ to hundreds of kΩ range |
Checking your work
- Compute the input current
Vin / Rin. It should be the same as the current through Rf. - Compute the output as
−Rftimes that current. - Confirm the magnitude stays inside the supply swing.
- Confirm the source can supply the current and tolerate the resistance Rin.
- Run a quick simulation or a few lines of code like the ones above to confirm the result.
Exercise
An inverting amplifier uses Rin = 4.7 kΩ and Rf = 33 kΩ. The input is 0.4 V from a source with 300 Ω of series resistance. The op amp is powered from ±12 V. (a) What is the output voltage? (b) What input current flows? (c) What gain would you get if the source resistance were ignored?
Show answer
(a) The total input resistance is 4.7 kΩ + 0.3 kΩ = 5.0 kΩ. The gain is −33 kΩ / 5.0 kΩ = −6.6, so Vout = −6.6 × 0.4 V = −2.64 V, well inside the ±12 V supply. (b) The input current is 0.4 V / 5.0 kΩ = 80 µA, and the same 80 µA flows through Rf (80 µA × 33 kΩ = 2.64 V). (c) Ignoring the source resistance gives −33/4.7 = −7.02, which would predict −2.81 V. That is an error of about 6 percent.
Exercise
A designer wants a gain of −200 from a single stage using an op amp with open-loop gain A = 50,000. Using the finite-gain formula, approximately what gain error will the stage have, and what does this suggest about the design?
Show answer
Rf/Rin = 200, so the noise gain is 1 + 200 = 201. The fractional error is about 201 / 50,000 = 0.4 percent, so the actual gain is about −200 / 1.004 = −199.2. A 0.4 percent error may be acceptable, but it grows with the gain and shrinks with a better op amp. If the requirement is tighter, split the gain across two stages (for example −14.1 each) so each stage has a much smaller noise gain, or use an op amp with a higher open-loop gain at the signal frequency.