The Inverting Amplifier and the Virtual Ground
A virtual ground turns gain into a resistor ratio
Slide the feedback resistor ratio Rf/Rin. Thanks to the virtual ground, the output becomes −(Rf/Rin) times the input. Set the ratio so the output is exactly four times the input while flipping the sign — that is a gain of −4.
Tie the non-inverting input to ground
Connect the non-inverting input V+ directly to the 0 V ground. An ideal op-amp under negative feedback drives its two inputs equal (the virtual short), so the inverting input V− also sits at 0 V. But V− is not wired to a real ground — the op-amp merely holds it at 0 V by adjusting its output. That is why it is called a virtual ground: the potential is zero, yet it does not swallow current like a real ground would.
The current has only the feedback to go to
The input voltage Vin drives current through the input resistor Rin into the virtual ground. Since V− is 0 V, the full Vin appears across Rin, so the input current is Vin/Rin. That current cannot enter the op-amp input (infinite input resistance), so it has exactly one path: the feedback resistor Rf. The same current flows through Rf, and since one end sits at 0 V, the output is 0 − (Vin/Rin)·Rf = −(Rf/Rin)·Vin.
The sign flip and summing come for free
The minus sign in the gain −Rf/Rin means the output swings opposite to the input: push the input up and the output goes down. The real power of the virtual ground shows when handling several inputs. Bring inputs through their own resistors into the same virtual-ground node, and the currents add at that node, so the output is a weighted sum, −(Rf/R₁·V₁ + Rf/R₂·V₂ + …). This is an analog summing amplifier.
Back to the first screen
As you slid the feedback ratio, the output grew to −(Rf/Rin) times the input, and at Rf/Rin = 4 it was exactly −4. The single choice of grounding the non-inverting input pinned the inverting input to a 0 V virtual ground, and the input current, with nowhere else to go, flowed through the feedback to set the gain cleanly by a resistor ratio. The flipped sign was not a cost but the seed from which the same structure grows into a summing amplifier.