I am a software developer so i don't have too much context in electronics. Just basics.

Can you please explain me what is the purpose of the resistors in a negative inverse opamp? Do they decrease the current or voltage ?

It appears that your lack of understanding of op-amps might be part of the problem. Many years ago, in the 1960s, when I first encountered operational amplifiers and negative feedback circuits, I had a difficult time trying to understand what was going on. Then one day I ran across a simple explanation of what an ideal op-amp does, and more importantly how to use that explanation to analyze circuits involving op-amps. If you know basic circuit analysis involving resistors, capacitors, and inductors, in other words how to calculate current through and voltage drop across these components using Ohm's Law and Kirchoff's Laws, adding op-amps to the mix is fairly easy.

The key to understanding op-amps is the characteristics of an

*ideal* op-amp. No such thing exists of course, but

*actual* op-amps come close enough to ideal to make circuit analysis possible, with some residual error in the resulting analysis. Even this residual error can be removed by substituting the equivalent (more complicated) circuit of a real op-amp instead of using the ideal op-amp. So, your first step is to go Google some explanations of what an ideal op-amp does.

In a nut-shell: ideal op-amps are three-terminal devices that have two infinite input-impedance differential inputs (inverting and non-inverting) and one bi-polar output with zero source impedance. Between the two differential inputs and the bipolar output is a

*gain element* that has characteristics of infinite gain, infinite bandwidth, infinite voltage sourcing capability, and infinite current output capability. It is these four "infinite" characteristics of the

**ideal** op-amp that simplifies circuit analysis using

**real** op-amps.

You, amigo, rock back on your heels and say, "How can this

**be**, Kemo Sabe? My computer deals with numbers, not infinities! Infinity is not a number!"

Good question. But it is not the infinities that cause the problem in circuit analysis; indeed, it is those infinities that

**simplify** the analysis. Consider the characteristic of infinite input impedance of the two differential inputs. This means neither of those two inputs either sources or sinks

**any** current. From a circuit analysis point of view these inputs are just points on a schematic diagram at which nothing happens. So, for your inverting op-amp example, whatever current goes through the input resistor R1 must "find" some other path to ground. The only other path is through the output or feedback resistor R0. The point where these two resistors connect, the inverting input of the op-amp, is often called a "summing point" because the sum of the currents entering this point must equal the sum of the currents leaving this point. That's Kirchoff's current law: can't have charge (the flow of charge is current) accumulating at any point in a circuit. Whatever current goes into a point must also leave that point.

So how can we compute that current through R1 (and the equal but opposite current through R2) since we don't know what the voltage at the summing point is?

This takes a bit of imagination. Imagine that the input to R1 is a positive voltage with respect to ground. Notice that the non-inverting input is connected to ground. When this positive potential is applied to the inverting input through R1 the op-amp output will be driven in a negative direction by the infinite-gain element. How far negative? Well, since the gain element has a "value" of infinity, then the output must be infinitely negative. A gazillion volts (or more) negative with respect to ground! Obviously that ain't gonna happen, even with an ideal op-amp, and here is the reason why: the negative going op-amp output is applied to R0, forcing a negative current through R0 into the summing junction. This current counters the current through R1 and decreases the potential at the inverting input from a positive value towards a zero value. Why zero? Because any other potential will cause the op-amp output to be infinite, either positive or negative. If the initial current through R0 was too high, driving the inverting input negative, then the op-amp output would go positive, producing a positive potential at the inverting input through R0 which would drive the output negative which is back where we started from. This is negative feedback and it is often a difficult concept to visualize because of the circular cause-and-effect reasoning that I just offered.

What you need to realize is the negative feedback (the current through R0) is driving the inverting input to be at the same potential as the non-inverting input, which in your example inverting op-amp configuration happens to be zero or ground potential. With nearly zero differential input voltage between the inverting and non-inverting inputs, the op-amp output could be any value between a positively infinite or a negatively infinite voltage, the polarity depending on whether the inverting input is slightly more positive than the non-inverting input (ground) or slightly more negative than the non-inverting input. In this case, we notice that under steady-state conditions the current in R1 entering the summing point has to be the same as the current in R0 leaving the summing point. So, the op-amp output has to be negative to make this happen. Since the inverting input is now virtually at ground (it is actually infinitesimally positive with respect to ground to produce a negative output) we can declare the summing point to be at ground potential with very little error. That means the current through R1 is calculated to be (Vin) / R1. The current through R0 is the same value but negative, calculated to be (-Vout) / R0. Equating the two currents and rearranging terms, we calculate the "gain" of this inverting op-amp circuit as (Vout) / (Vin) = - (R0) / (R1).

None of the above analysis applies unless the op-amp is configured for negative feedback. With positive feedback, the op-amp steady-state output will always be at either the positive power supply rail or the negative power supply rail, except when the input signal causes a transition between those two states.

I hope some of the above explanation helps you to understand op-amps.