There have been some questions asked recently about op-amps, and I was curious to see how to make one with just NPN and PNP transistors. I did a simulation in LTspice and it seems to work pretty well, and I think it would be useful to illustrate the inner workings of op-amps. There also may be some applications where such a discrete design may have advantages, such as high supply voltages. But there are probably some real disadvantages as well, particularly due to inexact matching of junction voltages and temperature stability.
Here is the simulation:
Note that this shows a non-inverting circuit with gain of 3, over an input range of 0-5 volts, and power supplies of 3, 5, and 12 volts. The circuit becomes operational at a little more than 600 mV, which is a typical forward voltage for silicon devices.
It is interesting to see that for the 3V power supply, input voltage above 3V causes the output to drop to near zero (which I think is called phase inversion), whereas for higher supply voltage the output saturates at near the supply voltage. This is distortion due to exceeding the common-mode voltage limit.
I will try to add a Circuit Lab schematic so anyone can experiment with the design using simulation.
simulate this circuit – Schematic created using CircuitLab
I copied this basic circuit from this source, which explains how it works. But essentially it is comprised of two current mirrors. The one on the top creates balanced currents that are summed by the one on the bottom, which also sets the bias level with the resistor R1. The two BJTs in the middle comprise the circuit which upsets the current balance according to the difference in the IN+ and IN- inputs, and provides an output voltage that is used for negative feedback.
The output impedance of the circuit is determined by the bias resistor R1. So with a 10k resistor it can drive a similar load, and that works for 1k as well.