The case of constant-gm circuit
Constant-gm circuit also known as beta-multiplier circuit is a widely used current reference generation circuit. And shown below in fig. 1 is the circuit diagram for a constant-gm circuit (not the complete diagram of functional constant-gm circuit, the start-up circuit is missing).
Fig 1. constant-gm bias circuit
The circuit is used for generating supply indepedent reference current such that the transconductance of the n-channel MOSFET M1 (gm1) tracks the 1/Rs or at least that is what we desire from this circuit when we are designing it. The theory and algebra for deriving currents and transconductances can be found in the textbooks by Prof Razavi and Prof Baker.
So what brings me here to write about this circuit? The circuit I drew above may be redrawn as shown below in the right half of the fig. 2 below, this circuit also looks like a constant-gm circuit. Under the same assumptions/approximations, the algebra for the derivation of currents and transconductances for the circuit in the left half is applicable to the circuit in the right half.
Fig. 2 Two possible configurations?
The question that I want to address here is - is the configuration of the constant-gm circuit shown in fig. 1 unique for this circuit? Or the configuration b) shown in the right half of the fig. 2 is also a viable configuration for this circuit? For some readers the answer to the question may be very obvious, so reading the rest of this blog is going to appear completely futile.
If you don't know the answer, you may have already gathered that it is likely only one of these configuration works otherwise there is no sense in bringing up this question here. Now the question is which is the correct one? In the textbooks by Prof Razavi and Prof Baker the constant-gm circuit is drawn as the one shown in fig.1, so it is likely the configuration of fig. 1 is the correct one, which indeed is the case.
Now the question is why does the other one not work? The answer to this question is somewhat subtle. This question had bothered me for sometime before I figured out the answer to the question. An easier way to find out the answer to the question would have been to just simulate the two configurations, it didn't occur to me do that before I figured out the answer and I performed the simulation to validate my understanding of why one works and the other one doesn't.
At this point, you may be thinking that you want to figure out the answer to the question yourself because you never considered this question before and in that case you may want to stop reading this blog now, and may want to come back later to see if you and me both have the same conclusion or maybe if you can't figure out the answer you will come back to get the answer.
Just in case you are not able to figure out the answer despite simulating and comparing the two configurations, don't be disheartened. It doesn't make you any less capable analog design engineer than those who were able to figure out the answer to this question. It is likely the way you understand and visualise the operation of circuits is different from others which doesn't render the answer to this question immediately obvious to you. To better understand what I mean to say here, I highly recommend watching these two videos of Richard Feynman explaining the different ways in which we think and visualise things.
Now coming back to the circuits shown fig. 2, the circuit can be divided into two parts, one with PMOS network and the other with the NMOS network. In essence, the purpose of PMOS can be understood to provide current feedback with a factor of 1 i.e. the current sensed by the 'diode' transistor is produced by the other transistor in the same magnitude. This is also illustrated in the fig. 3 below.
Fig 3. PMOS half network in the constant-gm circuit.
The 2nd half of the circuit can be understood to be a current amplifying circuit. For the NMOS half of circuit in fig 2. a) redrawn in fig. 4, the gain is gm2/gm1 x 1/(1+gm2Rs) and for the circuit in fig 2. b) redrawn in fig. 5, the gain is gm1(1+gm2Rs)/gm2.
Fig. 4 NMOS half network for configuration a)
Fig. 5 NMOS half network for configuration b)
Now lets assume that a slight disturbance due to noise on the gate of transistor M1 in fig 4. and the gate of M2 in fig. 5 produces iin extra current on top of the expected/desired bias current in the two branches. The output current iout being generated because of the extra input current iin is fed to the PMOS network, which feeds the current back into the gate of M1 in fig. 4 or the gate of M2 in fig. 5 with a factor of unity. Now there is some extra current on top of the already existing disturbance iin, iin now is iin + iextra which will produce iextraout which in turn will be fed back to the gate of M1 or M2. iin can be described by the following equation
iadditional = iin + Giin +G2iin + G3iin + G4iin + .... (summation of the terms of infinite geometric series and G is the current gain).
For iadditional to converge G has to be less than 1 otherwise iin will grow to infinity, which is not possible in a real circuit. Instead of the current Iin growing to infinity the circuit is driven out of saturation to cause at least one of the two possibilities, either the current gain becomes less than 1 or the feedback factor of the PMOS network no longer unity or both conditions may result. Comparing the gains of the two configuration, it is pick the stable winner. The NMOS current amplifying network in the circuit shown in fig. 2 left half exhibits a current gain of gm2/gm1 x 1/(1+gm2Rs) which is likely to be smaller than 1, because (1+gm2Rs) is expected to be larger than gm2/gm1 (which lies between 1 ~ 2) the gain for the other configuration is inverse of this gain and hence it is likely to be greater than 1. Now we can easily pick which one out of the two configurations is a stable and working configuration. You can simulate these two configurations to check if the discussion given above holds true or not.
Here is a netlist that contains the two configurations which you can simulate using LTSPICE.
I have also included a graph from the SPICE results obtained from the LTSPICE simulation of the netlist and you can see that only one configuration gives stable supply independent current bias.



















