In this section we'll learn the two easiest ways to reduce the huge gain of an opamp. First, we take a look at the non-inverting amplifier:

R1 and R2 make a voltage divider:
V_{n}=V_{OUT}∙R1/(R1+R2),
so

V_{OUT}=(V_{p}-V_{n})∙A
= (V_{IN}-V_{OUT}∙R1/(R1+R2))∙A =
V_{IN}∙A-V_{OUT}∙A∙R1/(R1+R2)
=>

V_{OUT}+V_{OUT}∙A∙R1/(R1+R2)=V_{IN}∙A.

Since A is nearly infinite, term V_{OUT} is
negigible, so

V_{OUT}∙A∙R1/(R1+R2)=V_{IN}∙A
=>

**V _{OUT}=V_{IN}∙(R1+R2)/R1**

Remember the first equation of this section?
V_{n}=V_{OUT}∙R1/(R1+R2).

This is equal to:
V_{OUT}=V_{n}∙(R1+R2)/R1. And
we've just proved that
V_{OUT}=V_{IN}∙(R1+R2)/R1. This
means that V_{IN}=V_{n}, and since
V_{IN}=V_{p},
*V _{p} must be equal to
V_{n}*!

This is always the case.

*If an opamp is used as an amplifier: ***V _{p}=V_{n}**

Note: the gain of this non-inverting amplifier is always greater than or equal to 1.

To create an amplifier with a gain less than 1 (an attenuator), we connect the input signal to R1, creating an inverting amplifier:

Since V_{p} is 0 and
V_{p}=V_{n},
V_{n}=0. This means
V_{OUT}=V_{R2}.

V_{R2}=(V_{OUT}-V_{IN})∙R2/(R1+R2)
=>
V_{OUT}=(V_{OUT}-V_{IN})∙R2/(R1+R2)
=>

V_{OUT}=V_{OUT}∙R2/(R1+R2)-V_{IN}∙R2/(R1+R2)
=>
V_{OUT}-V_{OUT}∙R2/(R1+R2)=-V_{IN}∙R2/(R1+R2)
=>

V_{OUT}∙R2/(R1+R2)-V_{OUT}=V_{IN}∙R2/(R1+R2)
=>
(R2/(R1+R2)-1)∙V_{OUT}=V_{IN}∙R2/(R1+R2)
=>

-R1/(R1+R2)∙V_{OUT}=V_{IN}∙R2/(R1+R2)
=> -R1V_{OUT}=R2∙V_{IN}
=>

**V _{OUT}=-(R2/R1)V_{IN}**

Note the minus sign: the input signal is inverted.

This amplifier becomes an attenuator if R1>R2.