Sub topic 5
The Non-Inverting Amplifier: Vout = (1 + Rf/Rg) Vin
This chapter assumes you know Ohm's law, Kirchhoff's laws, the voltage divider, and decibels. It also assumes you have met the ideal op amp model and the virtual short from earlier chapters. Here you use them to derive the non-inverting gain, check it against a finite-gain model and a simulation, and learn where the equation stops being true.
The circuit
In the non-inverting amplifier, the signal drives the non-inverting input (+) directly. A two-resistor divider connects the output to the inverting input (−). Rf runs from the output to the inverting input. Rg runs from the inverting input to ground.
The feedback is negative because it returns to the inverting input. If Vout rises, the voltage at the − input rises. That shrinks the difference between the inputs, which pulls Vout back down.
Deriving the gain
Use the two ideal rules: the inputs draw no current, and with negative feedback the op amp keeps V+ = V−.
- The + input is connected to the source, so V+ = Vin.
- The virtual short forces V− = Vin.
- The − input draws no current. Rf and Rg therefore carry the same current, and they form a plain voltage divider across the output: V− = Vout · Rg / (Rf + Rg).
- Set V− = Vin and solve:
Vin = Vout · Rg / (Rf + Rg)
Vout = Vin · (Rf + Rg) / Rg = Vin · (1 + Rf/Rg)
You can reach the same result with currents. The current in Rg is Vin/Rg, flowing to ground. All of it must come through Rf, so Vout = Vin + Rf · (Vin/Rg). Factoring out Vin gives the same expression.
The closed-loop gain is
G = 1 + Rf/Rg
Three consequences follow directly:
- The gain is positive, so the output is in phase with the input.
- The gain is never below 1. Even with Rf = 0, the 1 remains. To attenuate, you need a passive divider ahead of the amplifier.
- The gain depends only on a resistor ratio. The op amp's own parameters drop out, which is the whole point of feedback.
Gain examples
| Rf | Rg | Gain (1 + Rf/Rg) | Gain in dB |
|---|---|---|---|
| 0 Ω (short) | any | 1 | 0 dB |
| 1 kΩ | 1 kΩ | 2 | 6.0 dB |
| 9 kΩ | 1 kΩ | 10 | 20 dB |
| 99 kΩ | 1 kΩ | 100 | 40 dB |
Notice the offset from the inverting amplifier. A gain of magnitude 10 needs Rf/Rin = 10 when inverting, but Rf/Rg = 9 when non-inverting. Mixing these up is the most common design error with this circuit.
Limiting cases
The formula contains two useful limits.
- Rg → ∞ (open) or Rf = 0: the gain becomes exactly 1. This is the voltage follower, covered in the next chapter. The circuit is the same one, with the divider removed.
- Rf very large relative to Rg: the gain approaches Rf/Rg, and the "1" becomes negligible. At a gain of 100 the difference is 1%, which is why high-gain inverting and non-inverting designs look similar in magnitude.
Input and output impedance
The source connects only to the op amp's + input. In the ideal model that input draws zero current, so the input resistance is infinite. The source sees no load, and its own output resistance does not change the gain.
In a real op amp, feedback makes this even better. The input resistance of the closed loop is roughly
Rin(closed) ≈ Rin(open) · (1 + A·β)
where A is the open-loop gain and β = Rg/(Rf + Rg) is the feedback fraction. For a bipolar op amp this is often tens of megohms or more. For a JFET or CMOS op amp the leakage current becomes the limit, and you can treat the input as effectively open circuit at low frequency.
The output resistance is the open-loop output resistance divided by (1 + A·β). It is typically a small fraction of an ohm at DC, and it rises with frequency as loop gain falls.
This contrasts with the inverting amplifier, whose input resistance equals Rin and which can load a weak source. The non-inverting amplifier is the better choice when the source has high impedance, such as a piezo sensor, a photodiode in voltage mode, or a high-impedance divider.
Checking the equation with code
The ideal formula assumes infinite open-loop gain. With finite A, the closed-loop gain is A / (1 + A·β). The program below compares both configurations.
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)
def noninverting_gain(rf, rg, open_loop_gain=float('inf')):
ideal = 1 + rf / rg
if open_loop_gain == float('inf'):
return ideal
beta = rg / (rf + rg)
return open_loop_gain / (1 + open_loop_gain * beta)
print(inverting_gain(10e3, 1e3)) # -10.0
print(noninverting_gain(9e3, 1e3)) # 10.0
print(inverting_gain(10e3, 1e3, 1e5)) # about -9.9989
print(noninverting_gain(9e3, 1e3, 1e5)) # about 9.9990For the non-inverting case with A = 100,000 and β = 0.1, the loop gain A·β is 10,000. The actual gain is 10 / (1 + 1/10,000), which is about 9.9990. The error is roughly 1/(A·β), or 0.01%. The practical rule: the gain error is the reciprocal of the loop gain. Higher closed-loop gain means smaller β, so the error grows. At a gain of 1000 with the same op amp, A·β is only 100 and the error is about 1%.
Checking the equation with SPICE
This netlist models the op amp as a voltage-controlled voltage source with gain 1e5. The source E1 sets V(out) = 1e5 · (V(in) − V(inv)).
* Non-inverting amplifier, ideal gain 10
Vin in 0 DC 1
Rf out inv 9k
Rg inv 0 1k
E1 out 0 in inv 1e5
.op
.endRun the operating point and read V(out). It should be close to 9.999 V for a 1 V input, matching the Python result. Check that you wrote the controlling pair in the right order. In E1 out 0 in inv 1e5, in is the positive control node and inv is the negative one. If you swap them, the feedback becomes positive and the simulation either fails to converge or gives a rail-limited result.
Supply limits and clipping
The equation predicts the output without limits. Real outputs stop a little short of the supply rails. A general-purpose op amp on ±15 V supplies might swing to about ±13 V. A rail-to-rail op amp can come within millivolts.
Clipping starts when |Vin · G| exceeds the available swing. With G = 10 and ±12 V rails, a 1.5 V peak sine wave needs a 15 V output, so the peaks flatten near the rails. The maximum undistorted input is the usable output swing divided by the gain.
There is a second limit on the input side. In this circuit the input voltage is a common-mode voltage, because both inputs sit at Vin. Every op amp has an input common-mode range, and some stop working properly well before the rails. A single-supply amplifier with a 0 V to 5 V input needs an op amp whose input range includes the ground rail. The inverting amplifier avoids this limit because both inputs sit at a fixed reference voltage.
Bandwidth
The closed-loop bandwidth of the non-inverting amplifier is approximately
f_closed ≈ GBW / G
where GBW is the op amp's gain-bandwidth product. Because the signal gain equals the noise gain (1/β), this relationship holds exactly in the single-pole model. A 1 MHz GBW op amp set to a gain of 10 gives about 100 kHz of bandwidth. Set to a gain of 100, it gives about 10 kHz. For the inverting amplifier the signal gain is smaller than the noise gain by 1, so its bandwidth is slightly higher at low gain. At a gain of 1 (follower) the non-inverting circuit has the widest bandwidth, but it is also the most demanding for stability.
Common errors
- Using Rf/Rg as the gain. The gain is 1 + Rf/Rg. For a gain of 11, use Rf = 10 kΩ and Rg = 1 kΩ.
- Swapping the inputs. The source on the − input with feedback to + makes positive feedback. The output latches to a rail.
- Leaving Rg out. With Rg open, β = 1, and the circuit becomes a follower with gain 1, not a high-gain amplifier.
- Choosing very large or very small resistors. Values of megohms add noise and make bias-current errors and stray capacitance matter. Values of a few ohms load the output with Rf + Rg and waste power. A total of 1 kΩ to 100 kΩ is a typical starting range.
- Ignoring the common-mode range on single-supply designs.
Summary of the design procedure
- Pick the target gain G and compute the ratio Rf/Rg = G − 1.
- Choose Rg, often 1 kΩ to 10 kΩ, and compute Rf.
- Confirm that Vin(max) · G stays inside the output swing.
- Confirm that Vin stays inside the input common-mode range.
- Check that GBW / G meets the bandwidth you need, and that the gain error 1/(A·β) is acceptable.
Exercise
A sensor outputs 0.4 V peak and has a source resistance of 50 kΩ. You need a gain of 21 using a non-inverting amplifier powered from ±12 V, with Rg = 1 kΩ. What Rf do you choose, what is the peak output, and does the signal clip if the op amp swings to ±10.5 V?
Show answer
The gain is 1 + Rf/Rg = 21, so Rf/Rg = 20 and Rf = 20 kΩ. The peak output is 0.4 V × 21 = 8.4 V. This is below the 10.5 V swing, so there is no clipping. The 50 kΩ source resistance does not change the gain because the + input draws almost no current.
Exercise
An op amp has A = 200,000 and GBW = 2 MHz. It is set up as a non-inverting amplifier with Rf = 19 kΩ and Rg = 1 kΩ. Estimate the closed-loop gain error and the closed-loop bandwidth.
Show answer
The ideal gain is 1 + 19 = 20, and β = 1/20 = 0.05. The loop gain is A·β = 200,000 × 0.05 = 10,000, so the gain error is about 1/10,000 = 0.01%. The bandwidth is about GBW / G = 2 MHz / 20 = 100 kHz.