OPAMP What's inside ?

Introduction

In the picture below, the simplified internal diagram of a common bipolar OPAMP (based on BJT = bipolar junction transistors) is shown.
The real internal circuit of an OPAMP is overwhelming and has a lot more transistors, MOSFFETs or JFETs on board.
With the simplified diagram we stick to the basic building blocks that you will recognize in the internal circuitry of any OPAMP.
When you check out the schematics of discrete audio amplifiers, you will also recognize similar building blocks as in an OPAMP.

Building blocks

When we follow the path from input to output, we find the following building blocks:

  1. Differential amplifier (long-tailed pair) + current mirrors:
    Q6 and Q7 form a differential amplifier (long-tailed pair), in this case using PNP transistors, so the long tail is pointing upward to the positive supply voltage. The basic version of a differential amplifier would have a resistor in the tail (emitter of Q6 and Q7), but here the tail is provided with a constant current delivered by the PNP current mirror formed by Q1 and Q2. The current generated by this current mirror is defined by R1.
    Why a current mirror in the tail (emitter of Q6 and Q7) instead of a simple tail resistor ?
    One of the requirements of an OPAMP is that it only amplifiers the difference voltage between the 2 inputs but not the common voltage that is present at both inputs simultaneous. In other words: the OPAMP needs a high Common Mode Rejection Ratio (CMRR). To achieve a low common mode gain, the tail resistance should have a high value compared to the collector resistance, so the tail resistor behaves as a constant current source that is not affected when both inputs of the differential amplifier carry the same voltage. By using a current mirror, which is a constant current source instead of a tail resistor, the common mode rejection will be maximum.

    Instead of 2 collector resistors, a current mirror formed by Q11 and Q12 is used as an active gain defining element for the collectors of the differential amplifier. Why a current source instead of resistors ? Well, in an OPAMP we try to achieve a very high open-loop voltage gain of 10000x to even 100000x. When using a resistor as a gain defining element we need a very big resistor value to achieve a high voltage gain. This leads to problems because high resistor values cause extra capacitance (thus reduced bandwidth) and extra noise. A constant current source, such as a current mirror has an extremely high impedance, so it can achieve much higher gains without introducing extra capacitance or noise. An additional advantage of a constant current source is that the constant current is (almost) independent of the applied supply voltage. So power supply variations do not affect the current. This is not the case when we would use resistors as collector loads. The current mirror formed by Q11 and Q12 does not have a current defining resistor, as with the current mirror formed by Q1 and Q2. The current mirror Q11 and Q12 will try to keep the currents in both collectors equal. Depending on which input of the differential amplifier gets a higher input voltage than the other one, one of the transistors of the differential amplifier will consume the current of the current mirror, resulting in a low collector voltage, while the other transistor will not consume the current of the current mirror, resulting in a high collector voltage. Because the impedance of a current source is very high, the gain of the differential amplifier is very high.
    In OPAMPs matched transistors are used and the transistors will have exact the same temperature, so the 2 collector currents of Q11 and Q12 will be (almost) exactly the same. Also here much higher impedance values are obtained by using a current mirror instead of resistors, and the current will be independent of the power supply voltage.
    The differential amplifier amplifies the difference between the voltage on the non-inverting and the inverting input. It amplifies only the difference, so common mode voltage levels or signals that would be present on both inputs simultaneous are blocked. How good the OPAMP blocks the common mode is defined by the CMRR (Common Mode Rejection Ratio) specification of the OPAMP.
    The voltage output of the differential amplifier is taken from the collector of Q7.

  2. Buffer:
    Q9 is an emitter follower (common collector) that buffers the voltage output of the differential amplifier, so the next stage does not load the differential amplifier output too much. Remember that we are using a current source in the collectors of the differential amplifier and that current sources have a very high internal resistance. So the collector impedance is pretty high. So we need a buffer to make sure that this collector signal is not affected. An emitter-follower has a high input impedance and a low output impedance, so it is a good voltage buffer. The gain of the buffer is a little less than 1x.

  3. Voltage amplifier:
    Q10 is a voltage amplifier with a very high gain. This very high gain is achieved by the current mirror formed by Q3 and Q4. This current mirror acts as an active collector "resistor" with a very high impedance for transistor Q10. The current of this current mirror is defined by the value of R2.

  4. Output amplifier:
    Voltage amplifier Q10 drives a class-AB push pull output stage formed by Q5 and Q8. D1 and D2 take care that both transistors Q5 and Q8 are at the edge of conducting to prevent cross-over distortion. Without D1 and D2, there would be a dead-zone in which neither Q5 neither Q8 would conduct when their both their base voltages would be 0V.

  5. Frequency compensation capacitor:
    Last but not least we have the frequency compensation capacitor C1. Why we need it ?
    Each stage of the OPAMP will cause some phase shift due to parasitic capacitances inside the transistors (Miller capacitance, base-emitter capacitance,...).
    Because the OPAMP is normally used in a closed loop configuration, we need to make sure that there is enough phase margin to ensure stability. When the total phase shift of the OPAMP + feedback loop can reach 0 or 360 degrees at a gain >= 1, the circuit will oscillate because we created positive feedback.
    When enough phase margin (difference between the actual phase and 0 or 360 degrees phase when gain = 1) is implemented, the step response the OPAMP will not show any significant ringing or overshoot.
    To add extra phase margin, C1 is added as a frequency compensation capacitor.

    Don't forget that under the hood, we are working with an enormous amplification that is kept down by negative feedback. But due to delays in the circuits, caused by parasitic capacitance, the feedback get delayed, which releases the beast temporarily.