Analyzing Op-Amp Circuits.
In the article about measuring negative voltage with an ADC, most of the circuits described were built on an operational amplifier (op-amp). To a reader unfamiliar with op-amps the material might have seemed complicated, so I'll try to explain in simple terms the rules I use when analyzing op-amp circuits. In short, op-amp circuits aren't difficult; they're very easy.
There are 3 ways to use an op-amp:

Each of these configurations has its own features, and knowing them, it won't be hard to understand how a circuit works and how to calculate it.
An op-amp without feedback is a comparator; you can read about how it works here, and in general you can read that article to get acquainted with op-amps.
The peculiarity of a circuit with feedback is that the voltages at the non-inverting and inverting inputs tend to equalize; let's look at this process in more detail. By the way, whether the amplifier is inverting or not depends on which input we apply the signal to and which one we ground.

We'll look at a non-inverting amplifier, assuming R11 = R12.
Let's apply 2V to the non-inverting input (of course, the output voltage can't change instantly; it will start rising gradually, so let's stretch the voltage rise out in time). At the output we have 1V, and thanks to the divider 0.5V remains at the inverting input; since the voltage at the non-inverting input exceeds the voltage at the inverting input, the output voltage keeps rising.
At the output 2V, at the inverting input 1V, Vout keeps rising.
At the output 4.1V, at the inverting input 2.05V, the output voltage starts to decrease.
At the output 3.9V, at the inverting input 1.95V, the op-amp output voltage starts rising again.
As you can see, a kind of seesaw begins as the voltage at the inverting input approaches the voltage at the non-inverting input; thanks to it, the voltage at the inverting input will constantly tend toward the voltage at the non-inverting input. This reasoning doesn't take the op-amp's offset voltage into account, but it reflects the essence of the process.
Maybe this will be clearer for some:
Vnoninv = 2V, Vout = 1V, Vinv = 0.5V, Vnoninv > Vinv, Vout ↑
Vnoninv = 2V, Vout = 2V, Vinv = 1V, Vnoninv > Vinv, Vout ↑
Vnoninv = 2V, Vout = 4.1V, Vinv = 2.05V, Vnoninv < Vinv, Vout ↓
Vnoninv = 2V, Vout = 3.95V, Vinv = 1.95V, Vnoninv > Vinv, Vout ↑
Knowing and understanding this property of feedback, it won't be hard to calculate an op-amp circuit, and it doesn't matter which element provides the feedback, a resistor, capacitor or diode: calculating such a circuit is elementary. Using what we've learned, let's derive the formula for a non-inverting amplifier.

What matters is that the same current flows through both resistors, and it's easy to calculate, since the voltages at both inputs are the same (because there is negative feedback — NFB). Let's find the current flowing through each resistor and equate them.

The last formula shows how the gain depends on the values of R1 and R2.
That covers negative feedback; let's move on to positive feedback.
Positive feedback speeds up op-amp switching and introduces an interesting feature into its behavior called hysteresis. You can read a little about hysteresis here, at the very bottom. In a nutshell, a circuit with hysteresis has two switching thresholds: when the upper threshold is exceeded, the output voltage becomes positive; when the lower threshold is crossed (from top to bottom), it becomes negative. Let's see what hysteresis looks like on an oscillogram. Blue trace — the generator voltage, red — the voltage at the inverting input, green — at the non-inverting input, purple — at the op-amp output.

The sharp change in voltage at the non-inverting input (green trace) when crossing the threshold is precisely the result of positive feedback, which speeds up the op-amp switching.
There are 3 ways to use an op-amp:
- without feedback
- with positive feedback
- with negative feedback

Each of these configurations has its own features, and knowing them, it won't be hard to understand how a circuit works and how to calculate it.
An op-amp without feedback is a comparator; you can read about how it works here, and in general you can read that article to get acquainted with op-amps.
The peculiarity of a circuit with feedback is that the voltages at the non-inverting and inverting inputs tend to equalize; let's look at this process in more detail. By the way, whether the amplifier is inverting or not depends on which input we apply the signal to and which one we ground.

We'll look at a non-inverting amplifier, assuming R11 = R12.
Let's apply 2V to the non-inverting input (of course, the output voltage can't change instantly; it will start rising gradually, so let's stretch the voltage rise out in time). At the output we have 1V, and thanks to the divider 0.5V remains at the inverting input; since the voltage at the non-inverting input exceeds the voltage at the inverting input, the output voltage keeps rising.
At the output 2V, at the inverting input 1V, Vout keeps rising.
At the output 4.1V, at the inverting input 2.05V, the output voltage starts to decrease.
At the output 3.9V, at the inverting input 1.95V, the op-amp output voltage starts rising again.
As you can see, a kind of seesaw begins as the voltage at the inverting input approaches the voltage at the non-inverting input; thanks to it, the voltage at the inverting input will constantly tend toward the voltage at the non-inverting input. This reasoning doesn't take the op-amp's offset voltage into account, but it reflects the essence of the process.
Maybe this will be clearer for some:
Vnoninv = 2V, Vout = 1V, Vinv = 0.5V, Vnoninv > Vinv, Vout ↑
Vnoninv = 2V, Vout = 2V, Vinv = 1V, Vnoninv > Vinv, Vout ↑
Vnoninv = 2V, Vout = 4.1V, Vinv = 2.05V, Vnoninv < Vinv, Vout ↓
Vnoninv = 2V, Vout = 3.95V, Vinv = 1.95V, Vnoninv > Vinv, Vout ↑
Knowing and understanding this property of feedback, it won't be hard to calculate an op-amp circuit, and it doesn't matter which element provides the feedback, a resistor, capacitor or diode: calculating such a circuit is elementary. Using what we've learned, let's derive the formula for a non-inverting amplifier.

What matters is that the same current flows through both resistors, and it's easy to calculate, since the voltages at both inputs are the same (because there is negative feedback — NFB). Let's find the current flowing through each resistor and equate them.

The last formula shows how the gain depends on the values of R1 and R2.
That covers negative feedback; let's move on to positive feedback.
Positive feedback speeds up op-amp switching and introduces an interesting feature into its behavior called hysteresis. You can read a little about hysteresis here, at the very bottom. In a nutshell, a circuit with hysteresis has two switching thresholds: when the upper threshold is exceeded, the output voltage becomes positive; when the lower threshold is crossed (from top to bottom), it becomes negative. Let's see what hysteresis looks like on an oscillogram. Blue trace — the generator voltage, red — the voltage at the inverting input, green — at the non-inverting input, purple — at the op-amp output.

The sharp change in voltage at the non-inverting input (green trace) when crossing the threshold is precisely the result of positive feedback, which speeds up the op-amp switching.