Learn It!

Required

Explore More

Learn It!

Digital logic is the mathematical manipulation of zeroes and ones. (Other names for the logical values $0$ and $1$ are: low and high; false and true; and off and on.) Virtually all computing today is performed by digital logic circuits built out of MOSFETs. But MOSFETs (like other electronic devices) operate on voltages and currents, which are analog quantities. We bridge the gap between analog and digital by interpreting ranges of voltages as logical values.

Figure 1

A benefit of mapping a whole range of voltages to a single logical value is that it allows us to make aggressive approximations in circuit analysis. For example, in order to see whether a logical value is $1$, we do not need check that the corresponding voltage is exactly $V_{DD}$, just that it is approximately $V_{DD}$. Extending this reasoning leads to a useful set of logic circuit approximations for NMOS and PMOS transistors.

MOSFET Type | Logic Circuit Symbol | $A=0$ Approximation | $A=1$ Approximation |
---|---|---|---|

NMOS | | | |

PMOS | | | |

The logic circuit symbol for an NMOS transistor (shown above in Table 1) is slightly different to its analog circuit symbol. In a logic circuit, an NMOS transistor is always drawn with the drain terminal at the top and the source terminal at the bottom. In contrast, the logic circuit symbol for a PMOS transistor is always drawn with the source terminal at the top and the drain terminal at the bottom. The PMOS transistor symbol includes a bubble at the gate terminal that represents logical inversion (to be explained below). Note also that the input $A$ labeled at the gate terminal of each MOSFET in Table 1 is a logical value. When $A=0$, the voltage at the gate terminal is close to ground; when $A=1$, the gate terminal voltage is close to $V_{DD}$.

The approximations in Table 1 replace each MOSFET's drain-source connection with an open or short circuit depending on the type of MOSFET (NMOS or PMOS) and the logical value $A$. These substitutions are justified by the way that a MOSFET's gate-body connection behaves like a capacitor controlling its drain-source connection. To give a specific example, an NMOS transistor with $A=0$ has gate voltage close to ground, and consequently its drain-source connection is open. When $A=1$, the NMOS transistor's gate voltage is close to $V_{DD}$, and so it has a connected drain-source connection. The corresponding PMOS transistor substitutions are reversed with respect to the value of $A$. Abstractly, you can imagine that the PMOS transistor first inverts $A$ (from $0$ to $1$, or from $1$ to $0$) and then behaves the same way as an NMOS transistor. This imaginary logical inversion is represented by the bubble in the PMOS transistor's logic circuit symbol.

Complementary metal-oxide-semiconductor (CMOS) technology encompasses a design method and a set of processes for building reliable and power-efficient digital logic circuits out of NMOS and PMOS transistors. A CMOS circuit is reliable because its design guarantees that its output is always shorted to either ground or $V_{DD}$ but not both at the same time. As a consequence, the design also ensures that $V_{DD}$ is never shorted to ground through $Z$, which makes CMOS circuits power-efficient. We now use several examples to illustrate how the NMOS and PMOS transistors are arranged to provide these guarantees.

Figure 2

$A$ | Logic Circuit with Substitutions | $Z$ | Explanation |
---|---|---|---|

$0$ | | $1$ | When $A=0$, the NMOS and PMOS drain-source connections are approximated as an open and a short circuit, respectively, as in Table 1. In this way, $Z$ is shorted directly to $V_{DD}$ and isolated from ground. Therefore, $Z=1$. |

$1$ | | $0$ | When $A=1$, the NMOS and PMOS drain-source connections are approximated as a short and an open circuit, respectively, as in Table 1. In this way, $Z$ is shorted directly to ground and isolated from $V_{DD}$. Therefore, $Z=0$. |

Figure 3

$A$ | $B$ | Logic Circuit with Substitutions | $Z$ | Explanation |
---|---|---|---|---|

$0$ | $0$ | | $1$ | $Z$ is shorted to $V_{DD}$ through both PMOS transistors and isolated from ground by both NMOS transistors. |

$0$ | $1$ | | $1$ | $Z$ is shorted to $V_{DD}$ through the PMOS transistor with input $A$ and isolated from ground by the NMOS transistor with input $A$. |

$1$ | $0$ | | $1$ | $Z$ is shorted to $V_{DD}$ through the PMOS transistor with input $B$ and isolated from ground by the NMOS transistor with input $B$. |

$1$ | $1$ | | $0$ | $Z$ is isolated from $V_{DD}$ by both PMOS transistors and shorted to ground through both NMOS transistors. |

Figure 4

$A$ | $B$ | $C$ | $D$ | $Z$ |
---|---|---|---|---|

$0$ | $0$ | $0$ | $0$ | $1$ |

$0$ | $0$ | $0$ | $1$ | $1$ |

$0$ | $0$ | $1$ | $0$ | $1$ |

$0$ | $0$ | $1$ | $1$ | $1$ |

$0$ | $1$ | $0$ | $0$ | $1$ |

$0$ | $1$ | $0$ | $1$ | $0$ |

$0$ | $1$ | $1$ | $0$ | $0$ |

$0$ | $1$ | $1$ | $1$ | $0$ |

$1$ | $0$ | $0$ | $0$ | $1$ |

$1$ | $0$ | $0$ | $1$ | $0$ |

$1$ | $0$ | $1$ | $0$ | $0$ |

$1$ | $0$ | $1$ | $1$ | $0$ |

$1$ | $1$ | $0$ | $0$ | $1$ |

$1$ | $1$ | $0$ | $1$ | $0$ |

$1$ | $1$ | $1$ | $0$ | $0$ |

$1$ | $1$ | $1$ | $1$ | $0$ |

The logic circuits in Fig. 2, Fig. 3 and Fig. 4 illustrate the key principles of CMOS design: the PMOS transistors sit between $V_{DD}$ and the output; the NMOS transistors sit between the output and ground; and the PMOS and NMOS transistors are laid out in complementary fashion, in which every series combination in the PMOS transistors is matched by a parallel combination in the NMOS transistors, and *vice versa*. When a logic circuit does not adhere to these design rules, it may be unreliable and sometimes also power-inefficient, as shown by the next two examples.

Figure 5

Figure 6

CMOS logic circuits can be combined to create more complex circuits, which in turn can be combined to create even more sophisticated structures. In ECE 120: Introduction to Computing, you will use this process to build memory, arithmetic functions (such as adders) and ultimately microprocessors.

Figure 7

$A$ | $B$ | $Y$ | $Z$ |
---|---|---|---|

$0$ | $0$ | $1$ | $0$ |

$0$ | $1$ | $1$ | $0$ |

$1$ | $0$ | $1$ | $0$ |

$1$ | $1$ | $0$ | $1$ |

In a complex CMOS circuit, each MOSFET is linked at its output to the gate terminals of one or more downstream MOSFETs. In Fig. 7, for example, the 4 MOSFETs that comprise the NAND logic circuit feed into the gate terminals of the 2 MOSFETs that comprise the NOT logic circuit. Since gate terminals behave like capacitors connected to the semiconductor body, we can model each upstream MOSFET's load as a capacitance $C$.

Recall that the energy stored by a capacitor is $0.5CV^2$ J. Thus, each time a MOSFET's output goes from $0$ to $1$ and back to $0$, the load capacitance charges and discharges with $0.5CV_{DD}^2$ J of energy. An additional $0.5CV_{DD}^2$ J is wasted during each cycle due to inefficient charging. (Charging a capacitor efficiently requires the applied voltage to be increased gradually, but this would be too slow for high-performance electronics.) Therefore, a MOSFET consumes a total of $CV_{DD}^2$ J of energy every time its output completes a full cycle. If the MOSFET switches at a rate of $f$ Hz (i.e. cycles per second), then its power consumption is $fCV_{DD}^2$ W.

We now extend this analysis to an entire chip. Suppose the chip contains $n$ MOSFETs but only a proportion $a$ of them are actively switching output at any time on average. Then the average number of switching MOSFETs on the chip is $na$, where the proportion $a$ is known as the activity factor. Finally, if $C$ is the MOSFETs' average load capacitance and $f$ is the cycling frequency of the chip, the power consumption of the chip is:

\begin{align}

P &= nafCV_{DD}^2 \label{LOG-POW}

\end{align}

Explore More!