Analog Electronics
Think of an op-amp as an overzealous equalizer: if it sees the slightest difference between its two inputs, it slams its output all the way in that direction (gain ~100,000). Attach negative feedback and this zeal is tamed: the output locks onto whatever value makes the two inputs equal. Two golden rules emerge: v+ ≈ v− (the virtual short) and no current flows into the inputs.
With these two rules every circuit can be solved on paper. In the non-inverting amplifier the gain is 1 + R2/R1 (high input impedance); in the inverting one it is −R2/R1, and the inverting input becomes a "virtual ground" — the voltage there is always ~0 V.
REMOVE the feedback and the zeal returns: the op-amp becomes a comparator — whichever side v+ is greater on, the output slams to that rail. That is how you turn a sine into a square or detect a level.
⚡ Open this lesson in the simulator — free