Let’s introduce the ideal opamp.

An opamp is a differential amplifier. It measures the difference in voltage between its two input ports. It amplifies that difference and puts the result on the output port.

$v_o = \text A \,(v^+ - v^-)$

Open up this incomplete schematic in another browser tab.

The triangle is the symbol for an opamp. The gain of this opamp has been set really low so you can see how a differential amplifier works.

Double-click on the opamp. Give it a name like “U1”.
What is the gain of this opamp, $\text A$?

The initial gain setting is $\text A = 10$.

Opamps have gains in the many $1000$’s, but we start low to get a feel for how it works.

Add another opamp from the parts bin. Open up its properties with a double-click.
What is the gain of an opamp fresh from the parts bin?

A default opamp in Circuit Sandbox has a gain of $\text A = 30{,}000$.

You can leave it at this value most of the time.

It is common for real-world opamps to have a gain of $\text A = 100{,}000$ or more.

We don’t need this opamp any more. Please delete it.

This ideal opamp model has a ground reference pin, but no power supply pins. The ground pin is the circle on the downward slant of the triangle. The output of this ideal opamp isn’t limited by a power supply. It’s output goes to any value as it obeys the opamp equation from above. That makes this ideal model kind of fanciful. For a real world opamp the output range can’t be greater than the power supplies.

Let’s build a circuit,

• Connect the opamp ground pin to ground.

There are two voltage sources to drive the opamp inputs.

• Connect v+ to the opamp’s + input.
• Connect v- to the opamp’s - input.
• Connect the bottom side of both opamps to ground.
finished schematic

Do the rest of this exercise with your own schematic.

If you want you can compare yours to the one I drew — Willy’ schematic.

Now let’s change the input voltage sources and see what happens to the output.

Before running a simulation, figure out in your head what $v_o$ will be.

Hint: Fill in the opamp equation, $v_o = \text A \,(v^+ - v^-)$.

Do a DC operating point analysis (click on DC). What is $v_o$?

$v_o = \text A \,(v^+ - v^-)$

$v_o = 10 \,(1.1 - 1)$

$v_o = 10 \,(0.1)$

$v_o = 1\,\text V$

The output voltage is $10$ times the difference between $v^+$ and $v^-$.

Change $v^+$ to $1.3\,\text V$. What is going to happen to $v_o$?

Change $v^-$ to $0.8\,\text V$. What is going to happen to $v_o$?

Change $v^-$ so it is greater than $v^+$. What is going to happen to $v_o$?

Change $\text A$ to $20$. What is going to happen to $v_o$?

#### High gain

Change $v^+$ or $v^-$ so the difference between them is $10\,\text{mV}$.
Change $\text A$ to $100{,}000$. It is not hard to design an opamp with gain like this. What is going to happen to $v_o$?

This is kind of a trick question. With the gain so high, even the smallest input differential voltage will cause a huge output. Our ideal opamp is happy to generate a big number in the computer. For real-world opamps the output would increase until it slams into the top or bottom power supply and stays there. This is called output saturation.

#### Ground reference pin

The voltage you attach to the opamp’s ground pin does not have to be $0$. It might be a better idea to call this pin the output reference pin. This pin determines the output voltage when the input voltages are identical, when $(v^{+} - v^{-}) = 0$.

Open this schematic. The opamp’s inputs are connected together, and connected to ground. The ground pin is connected to a voltage source you can adjust.

Run a DC operating point simulation and verify $v_o$ is $0$.

Change the value of the voltage source to move the opamp’s ground pin to another voltage.

Set the voltage source to $1\,\text V$. Run another DC. What happens to $v_o$?

Try other voltages, including negative values.

What is this for? Sometimes you want to operate an opamp circuit with strictly positive voltage. This is called single-rail or single-supply operation, as opposed to a more traditional dual-rail design with symmetric $+$ and $-$ supplies. With single-rail, you want the output voltage to be centered between a positive supply voltage and ground when $v^+ = v^-$. For example, if $\text{VDD} = +5\,\text V$ the center is $v_o = 2.5\,\text V$. To set this up, generate a steady $2.5\,\text V$ and apply it to the ground reference pin.

Single-rail example. Run a DC and observe the output when the inputs are the same.

## Summary

These exercises should give you a good feel for how a differential amplifier works. The amplifier we’ve been looking at has modest gain. In the upcoming opamp videos the gain will be really high. You will learn how to take advantage of high gain by designing useful circuits featuring an opamp.