Lec 02 - CMOS Inverter

Inverter

An inverter can be thought of as a NOT gate. It will negate whatever value from its input.

Ideal Inverter

An ideal inverter has the following Vin-Vout graph (also known as Voltage Transfer Characteristic, or VTC)

From this graph, we can see that

  1. When 0 Vin VDD /2, Vout = VDD, this means [0, VDD/2] is Vin's input low range. Similarly, [VDD/2, VDD] is Vin's input high range.

    1. NMH: VDD /2

    2. NML: VDD /2

    3. Switch threshold: VDD /2

  2. The meaning of gain is just the change rate of Vout with respect to Vin, which is dVoutVind\frac{V_{out}}{V_{in}}

Real Inverter

In the real world, the inverter cannot be that perfect. Its Vin-Vout graph is usually shown as follows

From this graph, we will see some very important conventions used in Electrical Engineering

  1. In the Vin-Vout graph, we always treat x-axis as Vin and y-axis as Vout.

  2. VOH: This is the nominal (expected) output voltage when the inverter output is logic HIGH. This is usually around VDD.

  3. VOL: This is the nominal (expected) output voltage when the inverter output is logic LOW. This is around 0V.

    1. VOH and VOL are nominal values, and they are different from the actual output, which we usually define to be just Vout.

    2. Usually, VOH, VOL, together with VIL and VIH are specified by the manufacturer in the logic family’s datasheet.

  4. VM: This is the switching threshold, where Vin = Vout.

Mapping between Analog and Digital Signals

As analog signals are continuous while digital signals are discrete, when we convert analog signals to digital signals, we need to define some "mappings". In this lecture, the following mapping is defined,

From this graph, we add on to the important conventions that will be used in Electrical Engineering

  1. VIL: The highest input voltage that the gate will still recognize as a logic LOW.

    1. Thus, in this graph, the input low range is [VOL, VIL]

  2. VIH: The lowest input voltage that the gate will recognize as a logic HIGH.

    1. Thus, in this graph, the input high range is [VIH, VOH]

By definition, VIH and VIL are the operational points of the inverter where dVoutdVin=1\frac{dV_{\text{out}}}{dV_{\text{in}}}=-1.

Noise Margin

Noise margin is how much noise a signal can tolerate and still be read correctly as 0 or 1. So, in our notation, we can easily treat NMH as the length of input high range and NML as the length of the input low range.

  • NMH = VOH - VIH, or more precisely, VDD - VIH.

  • NML = VIL - VOL, or more precisely, just VIL.

Prof. Annie also introduces the following analogy for NMH and NML:

  • NMH defines how much the Vout can drop from the nominal high voltage (VOH) for it to be read correctly as logic HIGH by the following gate.

  • NML defines how much the Vout can go up from the nominal low voltage (VOL) for it to be read correctly as logic LOW by the following gate.

Fan-in and Fan-out

From the above image, we can clearly see that

  1. Fan-out means how many inputs are driven by one output the number of gates that one output signal can drive.

  2. Fan-in means how many inputs a gate has, it describes the number of signals feeding into one logic gate.

CMOS Inverter

An inverter can be built using one PMOS and one NMOS shown as follows,

Basic Operation

The basic operations of a CMOS inverter are the same as the inverter. Basically, it's just when input = 0, output = 1 and when input = 1, output = 0. But in this part, we will use the |VGS| thinking to decide the ON/OFF state of the PMOS and NMOS.

  1. Input = 0 -> Output = 1: NMOS's |VGS| = 0 < |VTH|, NMOS is OFF. PMOS's |VGS| = VDD > |VTH|, PMOS is ON. Thus, Vout is connected to VDD, output is 1.

  2. Input = 1 -> Output = 0: NMOS's |VGS| = VDD > |VTH|, NMOS is ON. PMOS's |VGS| = 0 < |VTH|, PMOS is OFF. Thus, Vout is connected to ground, output is 0.

Are VTH for NMOS and PMOS the same?

As you may notice, we are comparing the |VGS| with the same |VTH| in above. This is not a typo! In real world, we do try to make VTH of PMOS and NMOS the same. This is done by using the sizing technique we have introduced in Tutorial 1 to change the on resistance of the PMOS and NMOS.

Switching Characteristics

As Vin changes, the CMOS inverter goes through five different combinations of regions of operation. These combinations are indicated below:

  1. 0 Vin VTN: NMOS off, PMOS on.

  2. VTN < Vin < Vinv: PMOS linear, NMOS saturation.

  3. Vin = Vinv: Both PMOS and NMOS saturation

  4. Vinv < Vin < VDD - |VTP|: NMOS linear, PMOS saturation

  5. VDD - |VTP| < Vin VDD: PMOS OFF, NMOS ON

where,

  • Vinv is the switching voltage (same as the VM we have introduced above)

  • VTN is the threshold voltage of an NMOS.

  • VTP is the threshold voltage of an PMOS.

To understand it more clearly, let's use the following example,

Suppose VTN = 0.3V, VTP = -0.3V, VDD = 1V and Vinv = 0.5V

  1. 0 Vin VTN -> 0 Vin 0.3: Let's take Vin = 0.2V and assume Vout = 1V.

    1. NMOS: |VGS| < |VTN|, NMOS is OFF.

    2. PMOS: |VGS| 0.7V > |VTP|, PMOS is ON. VGD = -0.8V < VTP, PMOS in linear region.

  2. VTN < Vin < Vinv -> 0.4 < Vin < 0.5: Let's take Vin = 0.45V and assume Vout drops a bit but is still high, is 0.9V.

    1. NMOS: |VGS| > |VTN|, NMOS is ON. VGD = -0.45V < VTN, NMOS operates in saturation region.

    2. PMOS: |VGS| > |VTP|, PMOS is ON. VGD = -0.45V < VTP, PMOS operates in linear region.

  3. Vin = Vinv: Let's say Vin = 0.5V and Vout = 0.5V

    1. NMOS: |VGS| > |VTN|, NMOS is still on. VGD = 0 < VTN, NMOS operates in saturation region.

    2. PMOS: |VGS| > |VTP|, PMOS is still on. VGD = 0 > VTP, PMOS operates in saturation region.

  4. Vinv < Vin < VDD - |VTP| -> 0.5 < Vin < 0.6V. Let's take Vin = 0.55V and assume Vout is 0.2V.

    1. NMOS: |VGS| > |VTN|, NMOS is ON. VGD = 0.35V > VTN, NMOS operates in linear region.

    2. PMOS: |VGS| > |VTP|, PMOS is ON. VGD = 0.35V > VTP, PMOS operates in saturation region.

  5. VDD - |VTP| < Vin < VDD -> 0.6 < Vin < 1. Let's take Vin = 0.75V and assum Vout is 0V.

    1. NMOS: |VGS| > |VTN|, NMOS is ON. VGD = 0.75V > VTN, NMOS operates in linear region.

    2. PMOS: |VGS| < |VTP|, PMOS is OFF.

The above calculation is based on the following table we have introduced in Lec 01. As for the CMOS inverter case,

  • For NMOS: Vgsn = Vin, Vdsn = Vout.

  • For PMOS: Vgsp = Vin - VDD, Vdsn = Vin - VDD.

To summarize the five regions of operations together into one image, we have the following VTC of CMOS inverter

Now, we can draw the short-circuit current (Iinv) vs. Vin graph, and it looks like as follows,

From the graph above, we can see that the CMOS seems to only consume power when switching.

However, as I use "seems to" above, means that in reality, due to sub-threshold currents, etc, there is still some power consumption when the CMOS inverter is in OFF state.

Inverter with a Load

Normally, CMOS inverter will have parastic resistances and capacitances attached to the output node. Hence principle of operation of inverter alters a bit. This reflects in the appearnce of rise time (tr), fall time (tf), ..., we have introduced in Lec 01.

These time delays appear because charging and discharging the capacitor attached to the output node takes time! (CG1111A again!)

Charging the load

When Vin = 0V, the PMOS will turn on the current will flow from VDD, through the PMOS device (it has on resistance!) and finally through the capacitor to charge it until the capacitor is fully charged.

Discharging the load

After the capacitor is fully charged, it has the polarity shown as above. Now, if Vin = 1, our PMOS will be turned off and NMOS will be turned ON, forming a circuit so that the current can flow from the capacitor, through the NMOS device, and lastly to the ground until the capacitor is finally discharged.

Transient Response

As it takes time to charge and discharge the capacitor, we can do the transient analysis to get a formula for calculating tpLH (when charging) and tpHL (when discharging).

For an RC circuit, the capacitor voltage at time tt is given by

V(t)=VDDet/RCV(t)=V_{\text{DD}}\cdot e^{-t/RC}

Recall that when we are doing the tpLH and tpHL calculation, we are only interested in the 50% point. So

  • When charging, tpLH is the time taken for Voltage across the capacitor to go from 0 -> VDD/2.

  • When discharging, tpHL is the time taken for Voltage across the capacitor to go from VDD/2 -> 0.

Thus, we can plug V(t) = VDD/2 into our formula and solve for tt

VDD2=VDDet/RCt=ln2RCt0.69RC\begin{align*}\frac{V_{\text{DD}}}{2}&=V_{\text{DD}}\cdot e^{-t/RC}\\ t&=\ln2\cdot R\cdot C\\t&\approx0.69\cdot R\cdot C\end{align*}

where RR is the on resistance of the PMOS/NMOS device, and CC is the capacitance of the capacitor.

There is also a second approach to know the propagation delay if we don't know the on-resistance, it is introduced later.

Power Dissipation

As we have seen above, when the CMOS is switching, the short circuit current will consume some power. Also, we have mentioned about the leakage current, which will also consume some power. Lastly, as we have introduced the capacitors above, charging and discharging the capacitors will also consume some power, this is called dynamic power consumption.

Dynamic Power Consumption

We have already seen the image when we are charging the capacitor,

The total energy/transition is CLVDD2C_L\cdot V_{\text{DD}}^2, and it can be calculated by integrating the following

EVDD=0iVDD(t)VDD dtE_{\text{VDD}}=\int_0^\infty i_{\text{VDD}}(t)\cdot V_{\text{DD}}~dt

Since VDDV_{\text{DD}} is constant, move it outside the integral:

EVDD=VDD0iVDD(t) dt\begin{align*} E_{\text{VDD}} &= V_{\text{DD}} \int_0^\infty i_{\text{VDD}}(t)~dt \end{align*}

For a capacitive load CLC_L, use iVDD(t)=CLdvout(t)dti_{\text{VDD}}(t) = C_L \frac{dv_{\text{out}}(t)}{dt} (during charging, where voutv_{\text{out}} is the output voltage):

EVDD=VDD0CLdvout(t)dt dt\begin{align*} E_{\text{VDD}} &= V_{\text{DD}} \int_0^\infty C_L \frac{dv_{\text{out}}(t)}{dt}~dt \end{align*}

Move CLC_L outside and change variable to v=voutv = v_{\text{out}} (substitute dt=dv/(dv/dt)dt = dv / (dv/dt)):

EVDD=VDDCL0VDD1 dv\begin{align*} E_{\text{VDD}} &= V_{\text{DD}}\cdot C_L \int_0^{V_{\text{DD}}}1~dv \end{align*}

Evaluate the integral (limits from 0 to VDDV_{\text{DD}} as voutv_{\text{out}} charges fully):

EVDD=VDDCLVDD=CLVDD2\begin{align*} E_{\text{VDD}} &= V_{\text{DD}} \cdot C_L \cdot V_{\text{DD}} = C_L V_{\text{DD}}^2 \end{align*}

Its power is energy/transition times frequency f, which is CLVDD2fC_L\cdot V_{\text{DD}}^2\cdot f. However, we can see the in this circuit, the capacitor will also take some power consumption, and it can be calculated by integrating the follwoing, which will give us 12CLVDD2\frac{1}{2}\cdot C_L\cdot V_{\text{DD}}^2,

ECL=0iVDD(t)vout dtE_{C_L}=\int_0^\infty i_{\text{VDD}}(t)\cdot v_{\text{out}}~dt

Similarly as above, for a capacitive load CLC_L, use iVDD(t)=CLdvout(t)dti_{\text{VDD}}(t) = C_L \frac{dv_{\text{out}}(t)}{dt} (during charging, where voutv_{\text{out}} is the output voltage):

ECL=0CLdvout(t)dtvout(t) dt\begin{align*} E_{C_L} &= \int_0^\infty C_L \frac{dv_{\text{out}}(t)}{dt} \cdot v_{\text{out}}(t)~dt \end{align*}

Move CLC_L outside the integral:

ECL=CL0vout(t)dvout(t)dt dt\begin{align*} E_{C_L} &= C_L \int_0^\infty v_{\text{out}}(t) \cdot \frac{dv_{\text{out}}(t)}{dt}~dt \end{align*}

Substitute v=voutv = v_{\text{out}}, so dv=dvoutdtdtdv = \frac{dv_{\text{out}}}{dt}dt, and change the limits of integration from t:0t: 0 \to \infty to v:0VDDv: 0 \to V_{\text{DD}} (as voutv_{\text{out}} charges from 0 to VDDV_{\text{DD}}):

ECL=CL0VDDv dv\begin{align*} E_{C_L} &= C_L \int_0^{V_{\text{DD}}} v~dv \end{align*}

Evaluate the integral:

0VDDv dv=[12v2]0VDD=12VDD20=12VDD2.\begin{align*} \int_0^{V_{\text{DD}}} v~dv &= \left[ \frac{1}{2} v^2 \right]_0^{V{\text{DD}}} = \frac{1}{2} V_{\text{DD}}^2 - 0 = \frac{1}{2} V_{\text{DD}}^2. \end{align*}

Thus, the final result is:

ECL=CL12VDD2=12CLVDD2\begin{align*} E_{C_L} &= C_L \cdot \frac{1}{2} V_{\text{DD}}^2 = \frac{1}{2} C_L V_{\text{DD}}^2 \end{align*}

But this is only half of the total energy consumption. Where does the rest half go? If you think about it, it won't be hard to find out that the other half is dissipated as heat on the PMOS's resistor.

Modification for Circuits with Reduced Swing

As we have seen above, we can exploit reduced swing to lower the power. And the circuit after modification is shown below,

And now the energy per transition will be E01=CLVdd(VddVt)E_{0 \to 1} = C_L \cdot V_{\text{dd}} \cdot (V_{\text{dd}} - V_t) and the energy for the capacitor will be 12CL(VDDVt)2\frac{1}{2}\cdot C_L\cdot (V_{\text{DD}}-V_t)^2.

Node Transition Activity and Power

Now, let's consider switching a CMOS gate for NN clock cycles

EN=CLVdd2n(N)E_N = C_L \cdot V_{\text{dd}}^2 \cdot n(N)

where ENE_N is the energy consumed for NN clock cycles and n(N)n(N) is the number of 010\to1 transitions in NN clock cycles. Thus, we can have the average power PavgP_{\text{avg}} as follows,

Pavg=limNENNfclk=(limNn(N)N)CLVdd2fclk\begin{align*} P_{\text{avg}} &= \lim_{N \to \infty} \frac{E_N}{N} \cdot f_{\text{clk}} = \left( \lim_{N \to \infty} \frac{n(N)}{N} \right) \cdot C_L \cdot V_{\text{dd}}^2 \cdot f_{\text{clk}} \end{align*}

We can further define the activity factor α01\alpha_{0\to1} as follows,

α01=limNn(N)N\begin{align*} \alpha_{0 \to 1} &= \lim_{N \to \infty} \frac{n(N)}{N} \end{align*}

And now, we can rewrite our average power PavgP_{\text{avg}} as follows,

Pavg=α01CLVdd2fclk\begin{align*} P_{\text{avg}} &= \alpha_{0 \to 1} \cdot C_L \cdot V_{\text{dd}}^2 \cdot f_{\text{clk}} \end{align*}

CMOS Inverter Propagation Delay

In the Transient Response analysis, we have already seen how to calculate the propagation delay of a CMOS inverter when we know the NMOS/PMOS on-resistance as well as the capacitance CLC_L. Now, we introduce the second method to know the propagation delay if we don't know the on-resistance, but know the average current Iav in the circuit.

Starting with i=Cdvdti = C \frac{dv}{dt}, move dt dt to the L.H.S and integrate both sides:

i dt=C dv\begin{align*} i ~ dt &= C ~ dv \end{align*}

Integrate from initial to final conditions, where vv goes from v1v_1 to v2v_2 and time tpt_p is the propagation delay:

0tpi(t) dt=v1v2C dv\begin{align*} \int_0^{t_p} i(t)~dt &= \int_{v_1}^{v_2} C~dv \end{align*}

Since C=CLC = C_L is constant, factor it out:

CL0tpi(t) dt=CLv1v21 dv\begin{align*} C_L \int_0^{t_p} i(t)~dt &= C_L \int_{v_1}^{v_2}1~dv \end{align*}

The right-hand side integrates to the voltage difference:

CL0tpi(t) dt=CL(v2v1)\begin{align*} C_L \int_0^{t_p} i(t)~dt &= C_L (v_2 - v_1) \end{align*}

The left-hand side represents the charge transferred, and since Iav=1tp0tpi(t) dtI_{\text{av}} = \frac{1}{t_p} \int_0^{t_p} i(t)~dt, substitute IavtpI_{\text{av}} \cdot t_p:

Iavtp=CL(v2v1)\begin{align*} I_{\text{av}} \cdot t_p &= C_L (v_2 - v_1) \end{align*}

Solve for tpt_p:

tp=CL(v2v1)Iav\begin{align*} t_p &= \frac{C_L (v_2 - v_1)}{I_{\text{av}}} \end{align*}

For the high-to-low propagation delay tPHLt_{\text{PHL}}, v2v1=Vswingv_2 - v_1 = V_{\text{swing}} (full swing from VDDV_{\text{DD}} to 0, but noting tpt_p is 50% of full swing), so we have:

tPHL=CLVswing/2Iavt_{\text{PHL}} = \frac{C_L V_{\text{swing}}/2}{I_{\text{av}}}

Load Capacitance / Resistance

Load Capacitance

When a CMOS gate drives another CMOS gate, the driver "sees" a capacitive load. The load capacitance consists of

  1. gate capacitance of the load from two MOSFETS on the right (Cg)

  2. junction capacitance from common drain of the driver inverter on the left (Cj), and

  3. the parastic routing capacitance from the metal line used for connection (Cw)

In other words, the load capacitcance is

CL=Cg+Cj+CwC_L=C_g+C_j+C_w

Transistor

1

Gate Capacitance

Gate capacitances estimation in different regions is below. However many times a constant value is used.

Parameter
Off
Linear
Saturation

CgbC_{gb}

ϵsio2Atox\frac{\epsilon_{sio_2} A}{t_{ox}}

0

0

CgsC_{gs}

0

ϵsio2A2tox\frac{\epsilon_{sio_2} A}{2t_{ox}}

2ϵsio2A3tox\frac{2\epsilon_{sio_2} A}{3t_{ox}}

CgdC_{gd}

0

ϵsio2A2tox\frac{\epsilon_{sio_2} A}{2t_{ox}}

0

In this table, ϵsio2=ϵoϵv\epsilon_{sio_2}=\epsilon_o\cdot\epsilon_v, and AA is the area, which is the same as WLW\cdot L.

2

Wire Capacitance

Cwire=Cpp+CfringeC_{\text{wire}}=C_{pp}+C_{\text{fringe}}

CppC_{pp} is the same as CareaC_{\text{area}}, which can be calculated using

Carea=Cper unit areaWL(1)C_{\text{area}}=C_{\text{per unit area}}\cdot W\cdot L \tag{1}

where, Cper unit area=ϵtC_{\text{per unit area}}=\frac{\epsilon}{t}, and ϵ\epsilon is the electron mobility and tt is the thickness. However, the Cper unit areaC_{\text{per unit area}} will usually be given.

The Eq. (1) applies to any capacitance calculation.

Load Resistance

To calculate the resistance, we can use the following formula

R=ρLHWR=\frac{\rho\cdot L}{H\cdot W}

where we treat ρH\frac{\rho}{H} as a whole and name it as sheet resistance with the unit ( Ω/\Omega/\square) and LW\frac{L}{W} has the unit of \square and they must be converted to the same unit before the division!

Last updated