# Difference between configurations of unity gain buffer using op-amp

Is there any practical difference as to how a unity gain buffer using an op-amp might be configured? For example, the input signal can be connected to the noninverting input and the feedback to the inverting input; but it can also be configured the other way, with the inverting input as the signal and the noninverting as the feedback. Practically speaking (noise, stability, frequency response, offset error and so on), is there a difference between these configurations?

• Using the noninverting input for feedback won't work as a unity gain buffer, at best you'll get a Schmitt-Trigger. Mar 5, 2011 at 21:26
• @markrages: falstad.com/circuit/… Mar 6, 2011 at 0:55
• @thomasO, build it, it will not work with positive feedback. Mar 6, 2011 at 1:51
• If your computer persists in lying to you—junk that digital piece of disaster—throw it off the roof. You’ll feel much better about it—and the computer will never lie to you again. — Robert A. Pease, Troubleshooting Analog Circuits Mar 6, 2011 at 2:02
• If you disconnect and reconnect the feedback in Falstad sim, then it does the right thing. Mar 6, 2011 at 2:10

A normal opamp has an infinite gain, practically [factor] x 10^5. The difference between + and - terminal determines its output:

Vout = (V+ - V-) * A_ol

For an opamp you will have 2 rules:

• No input current.
• Input terminals share no voltage difference. This can be explained because A_cl for an ideal opamp is infinite, so (V+ - V-) should be 0V, otherwise Vout would be infinite too.

When you make a real circuit, you reduce the open loop gain to a closed loop gain. However, the 2 rules stated only work for negative feedback. If you use positive feedback, they do not apply.

So, if the rule of no input voltage difference doesn't apply, the opamp basically becomes an comperator. An inverting situation would try to get the difference to 0V because of its feedback. Now it will be become a simple comperator with Vout=H if V+ > V-, Vout=L if V+ < V-. In an wrong unity gain buffer, you'll see Vout=L because V+ is lower then the signal you're feeding it with.

Because I couldn't believe both situations would simulate the same, I did it myself:

Just 2 opamps which are internally fed to +/-15V. They follow a 1kHz 10Vpp source. The results are: (Note: Colors are inverted, so green = purple, cyan = red)

Oh so they do amplify correctly. But the ideal opamp has an infinite gain, no offset voltages, no input bias currents, no bandwith limitations (however, we wont notice much of that at 1kHz) etc. If we look at a real opamp, I picked one randomly (TL031):

An now it suddenly clips, because the opamp doesn't have the correct feedback.

• +1 for an explanation of why the circuit simulator does this. Thanks. Mar 6, 2011 at 11:37
• so the short version of this is, "only simulate with real component models, even if the ideal ones seem to work better". well done! Mar 6, 2011 at 13:07
• No, the moral of this is, don't trust simulator output. This is a convergence problem, where the positive feedback opamp is in a metastable state. Different simulators have different tricks to get circuits like this to converge. But if you don't know what a circuit does before you simulate it, the simulation will lead you astray. (And the Falstad sim is a worse liar than most.) Mar 6, 2011 at 22:49
• very well done, I wanted to take time to make simulations and just did not have it. Your answer is concise and well done! Mar 7, 2011 at 2:49

If you use a feedback from the output to the non-inverting input you will find that as the output goes too high it causes the difference to increase and it will rail.

You have to use the feedback to the inverting input.

### What is really happening?

An op-amp attempts to take the difference from the non-inverting compared to the inverting and multiply it by infinity. Lets say that the gain is only 10 though(instead of the 10^5 you can reasonable expect) and work through an example. There are two major points to remember here, the feedback from the output to the inverting input is nearly instant, this is not always true, but it is a reasonable approximation for low frequencies.

The circuit:

If, lets say, you instantly changed Vi from being 0V to 10V what would happen?

1. The instant that the voltage change happens your Vi is 10V, your Vo is 0V.
2. This means that the op-amp has a difference of 0-10 V and will attempt to start swinging towards the -100V mark.
3. As the voltage swings towards 0V the voltage it is targeting will go down. This will happen all the way until it reaches 0V. In a no load circuit with no delay, this will be instant.

In the real world you have delay, this can cause overshoot and ringing. In the real world, you have a load, so a higher gain gate will allow a higher speed transition.

The opamp's transfer function is

$\mathrm{V_{OUT} = G \times (V_+ - V_-)}$

In our circuit with the positive feedback that becomes

$\mathrm{V_{OUT} = G \times (V_{OUT} - V_{IN})}$

$\mathrm{(-G + 1) \times V_{OUT} = -G \times V_{IN}}$

$\mathrm{V_{OUT} = \dfrac{G}{G - 1} \times V_{IN}}$

For an ideal opamp $\mathrm{G}$ is infinite, then

$\mathrm{V_{OUT} = \dfrac{\infty}{\infty - 1} \times V_{IN} = V_{IN}}$

And because the ideal opamp is infinitely fast it can follow the input voltage perfectly. That's the reason why it works in your simulator.

How are real opamps different? Well, first they don't have infinite gain, and second they're not infinitely fast. Real opamps have a gain in the order of 100 000. But it's speed which will kill our voltage follower. Opamps tend to oscillate, and the early opamps had to be compensated in the designer's circuit, which was a PITA. Current opamps have internal compensation which makes them a lot more user-friendly. The compensation limits the bandwidth, and introduces a propagation delay from input to output.

Let's start with both inputs at 0 V. If $\mathrm{V_-}$ rises 1 $\mu$V the output (and hence the non-inverting input) won't follow immediately. We get a small negative voltage difference which gets amplified by 100 000 to become -100 mV at the output. That results in a new input difference of -100.001 mV (we had +1 $\mu$V on the inverting input :-)), which again gets amplified by 100 000, and the output goes to the negative rail.

This circuit has two stable states: the output to the positive supply rail, and to the negative supply rail.