Op amps are versatile ICs that can perform a vareity of mathematical functions. For this reason, they are the building blocks of many signal processing circuits. They have almost infinite gain, high input impedance, and low output impedance. Because of this, there is no current drawn at either input, and the voltage at both inputs must be equal (they are often drawn with a short connecting them)
Op amps have two inputs, an inverting (-) and noninverting (+). A positive voltage source and negative voltage source or ground are connected directly to the op amp, although these are rarely shown on circuit diagrams. There is a single output, which is almost always connected to the inverting input with a feedback loop.

Ideal Op Amps
There are three rules for analyzing op amp circuits. In addition to KVL and KCL, any op amp circuit should be solvable with these rules.
1. Infinte input impedance. No current is drawn so:
![]()
2. Infinite gain. This means that the input voltages must be equal.
![]()
3. Zero output impedance. This means that output voltage does not depend on the output current.
Real Op Amps
Ideal op amps are modeled with infinite gain and infinite impedance. While real op amps have high gain and low impedance, they are not infinite. This limiting factor can affect the performace of the circuit, so it should be considered. Another limitation of real op amps is voltage gain. Instead of being infinite, the maximum output voltage is about 1.4 V lower than the supply voltage (this is due to diode drops in the op amp).
Ideal behavior is not an accurate modelling technique when square waves are used. For this type of input, the voltage changes infinitely fast as it jumps from the high to the low parts of the wave. Op amps can't change instantaneously, there is a slight slope produced in the output. This can be measured by the slew rate (with is the change in voltage over the change in time). Rise time is another parameter used to calculate how quickly an op amp can adjust. The amount of time it takes the voltage to change from 10% to 90% of the desired value is the rise time. For application with square wave input, these two factors can affect the response of your circuit.
Connecting an Op Amp
Op amps with Dual In Line Packages should be connected to a breadboard as shown here. The notch is at the top of the op amp, with pins counted couterclockwise from the upper left corner.

Some common op-amp applications are:
These circuits are demonstrated below. In these diagrams, G represents the gain produced by the op amp.
This circuit inverts and amplifies the input voltage.

From KVL and KCL:
(ia, Va and Ra are the current, voltage, and the resistance across the two inputs)
| i1 + if = ia | ia = Va/Ra |
| i1 = (Vin - Va) / R 1 | Va = - Vout /G |
| if = (Vout - Va) / R f |
This reduces to:
G = - Rf /R1
This circuit amplifies the signal. It does not invert the signal, as the previous circuit does.

G = 1 + Rf / R1
This configuration outputs the integral of the input voltage. A common adaptation is to include a shunt resistor, which is a resistor in parallel with the capacitor. This limits low frequency gain.

Switching the position of the resistor and capacitor in the above circuit differentiates the input voltage.

dVin/dt = i1/Cf
- or -
Vout = - RC(dVin/dt)
This circuit adds input voltages. The output is the negative sum of the inputs.

-Vout/Rf = Vin1/R1 + Vin2 /R2
The circuit below subtracts analog signals from each other.

Vout = (R3 /R2) (1+ Rf /R1)(Vin2) - (Rf /R1)(1+R3 /R2)(Vin1)
This circuit is used in place of the difference amplifier with high output impedance sources. It can amplify low level signals, even in a noisy circuit. The bandwidth is consistent over a large range of voltage gains and the common mode rejection ratio (CMRR) is large. CMRR = Gd / G cm where Gd is the gain for the voltage difference and Gcm is the gain for the common mode voltage. Common mode voltage is the original signal common to both inputs. CMRR is important to minimise the effect of common mode voltage on the output.
Vout = (1+ R5/R4) / (1+R7/R6) * Vout2 - R5/R4 * V out1
This setup is used to determine which input signal is greater. When the inputs are equal, ther is no output. When the inverting input is greater, the op amp becomes saturated and output voltage is equal to the voltage of the power supply the op amp is connected to. When the non inverting input is greater, the output voltage is equal to the negative voltage supply, or the negative of the positive supply if connected to ground. Comparators are often used in analog to digital conversions.

This circuit is used to isolate part of the circuit. The op amp lets you draw the voltage you require without drawing high currents. There is high input impedance and low output impedance.
Vout = Vin