Op-amp
An op-amp amplifies the difference between its two inputs by an enormous factor. Alone, that just slams the output into a supply rail. Close the loop with resistors and the resistors, not the chip, set the gain.
- No current flows into either input.
- With negative feedback, the output does whatever it takes to make V+ equal V−.
Input through Rin into the − pin, Rf feeds the output back. Gain is −Rf/Rin and the − pin sits at 0 V: a virtual ground.
Rule 2 pins the − input at 0 V because the + input is grounded. Rule 1 says the current through Rin has nowhere to go but through Rf. So Vin/Rin = −Vout/Rf, and the ratio of the resistors is the gain. Watch V− stay at zero while everything else moves.
Push the gain up until the output hits the rails: the sine becomes a trapezoid. That flat top is clipping, the sound of every overdriven guitar amp. Then lower Vcc and watch the rails close in on the signal.