The Inverting Amplifier and the Virtual Ground
A virtual ground turns gain into a resistor ratio
In the figure the + input is tied to ground, and the input Vin enters the − input through Rin. Change the feedback ratio Rf/Rin and the output becomes −(Rf/Rin) times the input, with the length of the output arrow showing its size. Set the ratio so that the output is flipped in sign and exactly 4 times as large, that is, the gain is −4 and the arrow reaches the target mark.
Tie the non-inverting input to ground
The non-inverting input V+ is connected straight to 0V ground. An ideal op-amp with negative feedback makes its two inputs equal (virtual short), so the inverting input V− also sits at 0V. But V− is not wired to a real ground; the op-amp merely holds it at 0V by adjusting its output, which is why it is called a virtual ground. Its potential is 0, but unlike a real ground it cannot swallow current freely.
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 at 0V, the whole of Vin appears across Rin, and the input current is Vin/Rin. That current cannot enter the op-amp's input (its input resistance is infinite), so it can only flow through the feedback resistor Rf. The same current flows through Rf, and since one end of Rf is at 0V, the output is 0 − (Vin/Rin)·Rf = −(Rf/Rin)·Vin.
The sign flip and summing come for free
The negative sign in the gain −Rf/Rin means the output swings opposite to the input: when the input goes up, the output goes down. The real power of the virtual ground shows up with several inputs. Bring each input through its own resistor to the same virtual-ground node, and the currents add at that node, making the output the weighted sum −(R_f/R_1·V_1 + R_f/R_2·V_2 + …). This is the analog summing amplifier.
Back to the first screen
As you changed the feedback ratio, the output grew to −(Rf/Rin) times the input and reached exactly −4 at Rf/Rin = 4. The single choice of tying the non-inverting input to ground held the inverting input at a 0V virtual ground, and the input current, with nowhere else to go, flowed through the feedback path and set the gain cleanly by the resistor ratio. The flipped sign was no penalty; it was the seed from which the same structure grows into a summing amplifier.