Sub topic 5
The Virtual Short and Zero Input Current
This chapter assumes you can write KCL equations at a node, solve resistor networks with node voltages, and treat a dependent source as a known relationship between voltages. Earlier chapters gave the ideal assumptions and showed why negative feedback keeps the op amp out of saturation. Here those two ideas become two working rules, and you use them to analyze circuits.
The two rules
An ideal op amp with negative feedback and an output inside its supply range obeys two constraints at the input terminals.
- Virtual short: the voltage at the non-inverting input equals the voltage at the inverting input, so v+ = v−.
- Zero input current: no current flows into either input terminal, so i+ = i− = 0.
The two rules describe different things. The virtual short constrains a voltage difference. Zero input current constrains a current. The output terminal has no rule of its own. It supplies whatever current is needed to make the two input rules hold.
The word "virtual" matters. A real short circuit forces equal voltages and also allows any current to flow through it. The virtual short forces equal voltages but passes no current. You cannot replace the gap between the inputs with a wire, because that would change how current flows in the rest of the circuit.
Where the virtual short comes from
The op amp output is vout = A(v+ − v−), where A is very large. Suppose the output sits at a normal value, such as 5 V, and A = 10^5. Then the input difference must be
v+ − v− = vout / A = 5 V / 10^5 = 50 µV.
Compared with volts elsewhere in the circuit, 50 µV is effectively zero. As A approaches infinity, the difference approaches zero for any finite output. The ideal model takes that limit and states v+ = v− as an exact equality.
The difference is nonzero only because the output must be nonzero. The output is set by the circuit, and the op amp adjusts its input difference to produce it. Feedback is what makes this adjustment happen on its own.
If the difference grows, the output moves in the direction that shrinks it. The loop settles where the difference is just large enough to produce the required output, and that value is tiny.
Why the input current is zero
The ideal op amp has infinite input resistance. In real devices the input stage is a pair of transistors, either MOSFET gates or bipolar bases. A bipolar input draws nanoamps to microamps, and a MOSFET or JFET input draws picoamps. Compared with the milliamps in typical resistor networks, these currents can be dropped.
This rule lets you treat each input terminal as a node that connects to nothing inside the op amp. At the inverting node, all current entering through the resistors must leave through the other resistors, because none goes into the op amp.
When the rules apply
The rules are a consequence of three conditions. If any one fails, the virtual short fails with it.
| Condition | Why it matters | What happens if it fails |
|---|---|---|
| Negative feedback path from output to the inverting input | Gives the loop that drives v+ − v− toward zero | With no feedback, or feedback to the non-inverting input only, the difference is not forced to zero |
| Output within the supply rails | Keeps the op amp in its linear region where vout = A(v+ − v−) | The output clips at a rail and v+ − v− can be large |
| Large open-loop gain A | Makes the required input difference negligible | Gain error grows, as covered later in this tutorial |
The code below shows the first condition in action. It solves a non-inverting amplifier with finite A and reports the true input difference. The difference equals vout / A, as predicted.
def input_difference(vin, rf, rg, a):
"""Differential input v+ - v- of a non-inverting amplifier with finite gain a."""
ideal = 1 + rf / rg
vout = vin * ideal / (1 + ideal / a)
v_minus = vout * rg / (rf + rg) # feedback divider
return vout, vin - v_minus
vout, vd = input_difference(vin=1.0, rf=9e3, rg=1e3, a=1e5)
print(f"vout = {vout:.5f} V") # vout = 9.99900 V
print(f"v+ - v- = {vd * 1e6:.1f} uV") # v+ - v- = 99.99 uV
print(f"vout / A = {vout / 1e5 * 1e6:.1f} uV") # vout / A = 99.99 uVA 1 V input with a gain of 10 leaves about 100 µV between the inputs. That is 0.01% of the input, so setting it to zero costs very little.
Using the rules at a node
Both rules together give a direct method. Pick a node attached to an op amp input, then proceed as follows.
- Mark the voltage at the op amp input you know. If the non-inverting input connects to ground or a source, that voltage is known.
- Set the other input to the same voltage using the virtual short.
- Write KCL at the input node, counting only resistor currents. The op amp contributes zero current.
- Solve for the node or output voltage you need.
Never write a KCL equation at the output node to find the output voltage in the first pass. The op amp output current is unknown and depends on the load, so such an equation adds an unknown without helping. Use the input nodes first, then compute the output current afterward if you need it.
Worked example: inverting amplifier
An inverting amplifier has R1 = 1 kΩ from vin to the inverting node and Rf = 10 kΩ from the output back to that node. The non-inverting input is grounded, and vin = 0.5 V.
The non-inverting input is at 0 V, so the virtual short puts the inverting node at 0 V. The current through R1 is
i1 = (0.5 V − 0 V) / 1 kΩ = 0.5 mA.
Zero input current means all 0.5 mA continues through Rf toward the output. The voltage across Rf is 0.5 mA × 10 kΩ = 5 V, with the inverting-node side at 0 V, so
vout = 0 V − 5 V = −5 V.
This matches −Rf/R1 × vin = −10 × 0.5 V.
The inverting node is held at 0 V without being connected to ground. Engineers call this a virtual ground. It is a special case of the virtual short that applies when the non-inverting input is grounded.
Worked example: a non-grounded reference
Now move the non-inverting input to 2 V and keep the same resistors, with vin = 2.5 V. The inverting node is now at 2 V, not 0 V.
i1 = (2.5 V − 2 V) / 1 kΩ = 0.5 mA, and the drop across Rf is 5 V.
vout = 2 V − 5 V = −3 V.
If you assumed the inverting node was at 0 V, you would compute −25 V and be wrong. The virtual short only says the inverting node equals the non-inverting node. It does not say that node is zero.
Common errors
- Applying the virtual short without negative feedback. A comparator circuit has no feedback or has positive feedback. Its input difference can be large, and the output sits at a rail.
- Swapped input terminals. If the feedback resistor returns to the non-inverting input, the loop reinforces any difference. The output runs to a rail and stays there. The virtual short does not hold.
- Treating the virtual short as a wire. Do not write a branch current through the gap between v+ and v−. No current crosses it.
- Assuming zero current at the output. The output sources or sinks current. Only the input terminals draw none.
- Ignoring saturation. With ±15 V supplies, an amplifier with gain −10 and vin = 2 V would need −20 V. The output stops near −15 V, and v+ − v− is no longer near zero. Always check the computed output against the rails.
The next program shows the saturation check as a short function.
def inverting_output(vin, rf, r1, v_neg=-15.0, v_pos=15.0):
"""Ideal inverting amplifier output, flagged if it exceeds the supply rails."""
vout = -rf / r1 * vin
saturated = not (v_neg <= vout <= v_pos)
return max(v_neg, min(v_pos, vout)), saturated
print(inverting_output(0.5, 10e3, 1e3)) # (-5.0, False)
print(inverting_output(2.0, 10e3, 1e3)) # (-15.0, True)Exercise
A non-inverting input is held at 1 V. The inverting input connects to a 2 kΩ resistor to ground and a 6 kΩ feedback resistor to the output. Assume ideal behavior. Find the output voltage and the current in the feedback resistor.
Show answer
The virtual short puts the inverting node at 1 V. The current to ground through 2 kΩ is 1 V / 2 kΩ = 0.5 mA. No current enters the op amp input, so 0.5 mA flows through the 6 kΩ resistor, from the output toward the inverting node. The drop across it is 0.5 mA × 6 kΩ = 3 V, so vout = 1 V + 3 V = 4 V. The gain check is 1 + 6k/2k = 4, and 4 × 1 V = 4 V.
Exercise
An inverting amplifier uses R1 = 2 kΩ and Rf = 20 kΩ with supplies of ±12 V. What is the largest input magnitude that keeps the ideal analysis valid, and what is the output when vin = 1.5 V?
Show answer
The gain is −Rf/R1 = −10. The output must stay within ±12 V, so |vin| must be at most 12 V / 10 = 1.2 V. At vin = 1.5 V the ideal output would be −15 V, which is beyond the rail, so the output saturates near −12 V and the linear analysis does not apply.