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.

The two golden rules
  1. No current flows into either input.
  2. 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.

Rin 1 kΩRf 4.7 kΩ−+Vin = 0 VV− = 0 VVout = 0 V±Vcc
VinVout
0T0.5T1T1.5T2T-12 V-6 V0 V6 V12 V+Vcc−Vcc
Vin
0 V
Vout
0 V
Gain
A−4.70
V−
0 V
Rin1 kΩ
Rf4.7 kΩ
Vin1 V peak
Vcc±12 V
Formula
Vout=− (Rf / Rin) · Vin=-4.70 · Vin
Intuition

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.

Try this

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.