### Reference Current Generator

#### Basic Idea:

Creating a spread insensitive current either requires trimming of resistors or a circuit where production spread cancels. Trimming is expensive. Therefore this circuit attempts to cancel the most frequent causes of spread. M4, M5, M7, M8 are a ring current generator similar to commonly known bipolar counterparts. In stead of using a resistor M9 is operated in linear range (Vds<<Vgs). M7 and M8 W/L ratio define the current flowing through M9. M2 is the starter. A depletion transistor is advantageous but a high valued resistor would do the same job.
Without long channel transistor M6 there would be 2 additional weakly stable operating points:
1. M7 off, gate of M8 floating high, M8 fully on.
2. M7 on, M8 off, gate of M7 floating high.
These two undesired operating points don't exist in the bipolar counterpart because the base currents don't allow floating states. Adding long channel transistor M6 prevents these undesired operating points. Making M6 too short degrades accuracy.

The voltage at the source of M8 depends on:
1. The W/L ratio between M8 and M7
2. The transconductance gm of M7 and M8
Since gm is a function of gate oxide thickness and of temperature the source voltage of M8 is inverse proportional to gm and temperature.

Vs8 ~ 1/tox

#### Compensation:

To compensate the spread of the source voltage of M8 a resistance proportional to gm and temperature is needed. The current through M9 calculates as:

ID=0.5*k*(W/L)*[2*(Vgs-Vt)*Vds-Vds^2]
with k=u*Eox/tox

assuming Vds=Vs8<<Vgs this equation can be approximated by:

ID=Vds*(W/L)*u*Eox*(Vgs-Vt)/tox

Provided M9 is driven by Vgs9 = Vt+Vc with Vc being a constant voltage the gate oxide thickness cancels. As long as the supply voltage is stable the drop across R2 is about equal to Vc (assuming the current through R1 is much higher than the current through M1).