---
# System prepended metadata

title: CH14. CMOS Digital Logic Circuits
tags: [MC2 WebNotes]

---

# CH14. CMOS Digital Logic Circuits

:::info
**Disclaimer**
If you spot any error, please contact me via my email: bigbeeismusic@gmail.com
:::

## 14.1 CMOS Logic-Gate Circuits

### 14.1.1 Switch-Level Transistor Model

**NMOS**
![截圖 2025-01-27 下午1.51.19](https://hackmd.io/_uploads/HkHx1oVOkx.png)

**PMOS**
![截圖 2025-01-27 下午1.52.02](https://hackmd.io/_uploads/HJ5MkiEOyx.png)

:::info
++Note++. $R_{on}=r_{DS}\simeq\frac{1}{k_nV_{OV}}$ for the MOS transistors.
:::

### 14.1.2 The CMOS Inverter

$Y=\overline{X}$
![截圖 2025-01-27 下午1.54.53](https://hackmd.io/_uploads/ByWpJoNdyg.png)

:::info
++Observation++. Operation of the circuit:
![截圖 2025-01-27 下午1.56.28](https://hackmd.io/_uploads/rkx7gs4uke.png)
:::

### 14.1.3 General Structure of CMOS Logic

![截圖 2025-01-27 下午1.57.29](https://hackmd.io/_uploads/rkAUliVd1x.png)

**Pull-up network (PUN)**: consisting of NMOS transistors.
**Pull-down network (PDN)**: consisting of PMOS transistors.

:::info
++Note++. PDN will conduct when $Y=0$ is required (PUN will be off simultaneously). PUN will conduct when $Y=1$ is required (PDN will be off simultaneously).

Examples of PDNs:
![截圖 2025-01-27 下午2.07.03](https://hackmd.io/_uploads/SJQjzo4dJx.png)

Examples of PUNs:
![截圖 2025-01-27 下午2.08.41](https://hackmd.io/_uploads/S14-Qo4_ke.png)
:::

**Alternative circuit symbols**
![截圖 2025-01-27 下午2.12.15](https://hackmd.io/_uploads/SydJViNu1g.png)

### 14.1.4 The Two-Input NOR Gate

$Y=\overline{A+B}=\overline{A}\ \overline{B}$
![截圖 2025-01-27 下午2.14.15](https://hackmd.io/_uploads/Syr_4iV_1e.png)

PDN: $Y=0$ when $A=1\lor B=1\Rightarrow\overline{Y}=A+B$
PUN: $Y=1$ when $\overline{A}=1\land\overline{B}=1\Rightarrow Y=\overline{A}\ \overline{B}=\overline{A+B}$

### 14.1.5 The Two-Input NAND Gate

$Y=\overline{AB}=\overline{A}+\overline{B}$
![截圖 2025-01-27 下午2.21.07](https://hackmd.io/_uploads/HkIk8sVdkg.png)

PDN: $Y=0$ when $A=1\land B=1\Rightarrow\overline{Y}=AB$
PUN: $Y=1$ when $\overline{A}=1\lor\overline{B}=1\Rightarrow Y=\overline{A}+\overline{B}=\overline{AB}$

### 14.1.6 A Complex Gate

$Y=\overline{A(B+CD)}=\overline{A}+\overline{B+CD}=\overline{A}+\overline{B}(\overline{C}+\overline{D})$
![截圖 2025-01-27 下午2.24.28](https://hackmd.io/_uploads/B1FhIoN_yg.png)

### 14.1.7 Obtaining the PUN from the PDN and Vice Versa

:::info
++Oberservation++. For the circuits we obtained so far, the PDN and the PUN are dual networks: Where a series branch exists in one, a parallel branch exists in the other.
:::

### 14.1.8 The Exclusive-OR Function

$Y=A\overline{B}+\overline{A}B\Rightarrow \overline{Y}=\overline{A}\ \overline{B}+AB$
![截圖 2025-01-27 下午2.29.36](https://hackmd.io/_uploads/H12bdsN_Je.png)
($\overline{A}$ and $\overline{B}$ can be obtained using extra inverters $\Rightarrow$ **12** transistors needed in total)

### 14.1.9 Summary of the Synthesis Method

1. PDN can be directly synthesized using the expression of $\overline{Y}$ with uncomplemented variables ($A, B, C...$). If complemented appeared, use extra inverters.
2. PUN can be directly synthesized using the expression of $Y$ with complemented variables ($\overline{A}, \overline{B}, \overline{C}...$). If uncomplemented appeared, use extra inverters.
3. PDN can be obtained from PUN using the duality, and vice versa.

## 14.2 Digital Logic Inverters

### 14.2.1 The Voltage-Transfer Characteristic (VTC)

:::success
++Recall++. VTC of a transistor amplifier
![截圖 2025-01-27 下午2.37.24](https://hackmd.io/_uploads/S1CaYi4dye.png)
:::

$\Rightarrow$ **The (approximated) VTC of an inverter**
![截圖 2025-01-27 下午2.44.05](https://hackmd.io/_uploads/SJ_rsiEuyl.png)

### 14.2.2 Noise Margins

![截圖 2025-01-27 下午2.47.30](https://hackmd.io/_uploads/BJPM3jNuyl.png)

$\Rightarrow NM_L=V_{IL}-V_{OL}$, $NM_H=V_{OH}-V_{IH}$

:::info
++Note++. Important parameters of the VTC of the logic inverter
![截圖 2025-01-27 下午2.50.23](https://hackmd.io/_uploads/By7wRi4d1g.png)
and their formal definitions.
![截圖 2025-01-27 下午2.58.09](https://hackmd.io/_uploads/HJK60jNukl.png)
:::

### 14.2.3 The Ideal VTC
![截圖 2025-01-27 下午3.00.40](https://hackmd.io/_uploads/BkTvy3EuJx.png)

### 14.2.4 Inverter Implementation

**A simple inverter**
![截圖 2025-01-27 下午3.03.09](https://hackmd.io/_uploads/BJSay3N_Je.png)

$V_{OL}=\frac{R_{on}}{R+R_{on}}V_{DD}$

**An inverter which utilizes a pair of complementary switches**
![截圖 2025-01-27 下午3.13.16](https://hackmd.io/_uploads/SJl7GhNdkl.png)

$V_{OH}=V_{DD}$, $V_{OL}=0$

#### Resistively Loaded MOS Inverter

![截圖 2025-01-27 下午3.15.49](https://hackmd.io/_uploads/SJjhf3Nd1x.png)
($V_x=1/k_nR_D$)

$V_{OH}=V_{DD}$, $V_{IH}=V_t+1.63\sqrt{V_{DD}V_x}-V_x$
$V_{OL}\simeq\frac{V_{DD}}{1+[(V_{DD}-V_t)/V_x]}$, $V_{IL}=V_t+V_x$
$V_M=V_t+\sqrt{2(V_{DD}-V_t)V_x+V_x^2}-V_x$

:::info
++Observation++. The required $R_D$ in this circuit design is usually very large. Also, this design causes static power dissipation when the output is low.
:::

#### Pseudo-NMOS Inverter

![截圖 2025-01-27 下午3.28.03](https://hackmd.io/_uploads/rJccShEuyg.png)

## 14.3 The CMOS Inverter

![截圖 2025-01-27 下午3.28.39](https://hackmd.io/_uploads/Skjnr3Nukg.png)

### 14.3.1 Circuit Operation

**When $v_I$ is high**
![截圖 2025-01-27 下午3.32.46](https://hackmd.io/_uploads/Sk73Lh4u1x.png)
($r_{DSN}=1/\left[k_n'\left(\frac{W}{L}\right)_n(V_{DD}-V_{tn})\right]$)

**When $v_I$ is low**
![截圖 2025-01-27 下午3.40.40](https://hackmd.io/_uploads/ryoYd2Eu1x.png)
($r_{DSP}=1/\left[k_p'\left(\frac{W}{L}\right)_p(V_{DD}-|V_{tp}|)\right]$)

:::info
++Observation++.
- The output voltage levels are $0$ and $V_{DD}$.
- No static power dissipation.
- A low-resistance path exists between the output terminal and ground or $V_{DD}$.
- The active pull-up and pull-down devices provide the inverter with high output-driving capability in both directions.
- The input resistance of the inverter is infinite.
:::

### 14.3.2 The Voltage-Transfer Characteristic (VTC)

:::success
++Recall++. For MOSFET in triode region, $i_D=k_n\left(V_{OV}v_{DS}-\frac{1}{2}v_{DS}^2\right)$
:::

$\Rightarrow$
$i_{DN}=k_n'\left(\frac{W}{L}\right)_n\left[(v_I-V_{tn})v_O-\frac{1}{2}v_O^2\right], \text{for }v_O\leq v_I-V_{tn}$
$i_{DN}=k_n'\left(\frac{W}{L}\right)_n(v_I-V_{tn})^2, \text{for }v_O\geq v_I-V_{tn}$
$i_{DP}=k_p'\left(\frac{W}{L}\right)_p\left[(V_{DD}-v_I-|V_{tp}|)(V_{DD}-v_O)-\frac{1}{2}(V_{DD}-v_O)^2\right], \text{for }v_O\geq v_I+|V_{tp}|$
$i_{DP}=k_p'\left(\frac{W}{L}\right)_p(V_{DD}-v_I-|V_{tp}|)^2, \text{for }v_O\leq v_I+|V_{tp}|$

:::info
++Note++. For NMOS and PMOS to be matched, we make
$\frac{W_p}{W_n}=\frac{\mu_n}{\mu_n}$
:::

![截圖 2025-01-27 下午3.57.01](https://hackmd.io/_uploads/B1WPnhEOJg.png)

**Determining $V_{IH}$**: ($Q_P$ in saturation, $Q_N$ in triode reigon)
$\Rightarrow (v_I-V_t)v_O-\frac{1}{2}v_O^2=\frac{1}{2}(V_{DD}-v_I-V_t)^2$
$\Rightarrow v_O+(v_I-V_t)\frac{dv_O}{dv_I}-v_O\frac{dv_O}{dv_I}=-(V_{DD}-v_I-V_t)$
$\frac{v_O}{v_I}=-1\Rightarrow v_O=V_{IH}-\frac{V_{DD}}{2}\Rightarrow V_{IH}=\frac{1}{8}(5V_{DD}-2V_t)$

**Determining $V_{IL}$**: ($Q_N$ in saturation, $Q_P$ in triode reigon)
By symmetry ($V_{IH}-\frac{V_{DD}}{2}=\frac{V_{DD}}{2}-V_{IL}$) $\Rightarrow V_{IL}=\frac{1}{8}(3V_{DD}+2V_t)$

$\Rightarrow NM_H=V_{OH}-V_{IH}=\frac{1}{8}(3V_{DD}+2V_t)$
$\Rightarrow NM_L=V_{IL}-V_{OH}=\frac{1}{8}(3V_{DD}+2V_t)$

### 14.3.3 The Situation When $Q_N$ and $Q_P$ Are Not Matched

$V_M=\frac{r(V_{DD}-|V_{tp}|)+V_{tn}}{r+1}$ ($r=\sqrt{\frac{k_p}{k_n}}=\sqrt{\frac{\mu_p W_p}{\mu_n W_n}}$)

:::info
++Observation++. $V_M$ increase (very slightly) with $r$.
![截圖 2025-01-27 下午4.25.05](https://hackmd.io/_uploads/ry8gXpE_1x.png)
:::

## Summary

- A CMOS logic gate consists of an NMOS PDN (pull-down network) and an PMOS PUN (pull-up network).
    - PDN can be directly synthesized using the expression of $\overline{Y}$ with uncomplemented variables ($A, B, C...$). If complemented appeared, use extra inverters.
    - PUN can be directly synthesized using the expression of $Y$ with complemented variables ($\overline{A}, \overline{B}, \overline{C}...$). If uncomplemented appeared, use extra inverters.
    - PDN can be obtained from PUN using the duality, and vice versa.
- The VTC and important parameters:
![截圖 2025-01-27 下午2.58.09](https://hackmd.io/_uploads/HJK60jNukl.png)
- Summary of important static characteristics of the CMOS logic inverter:
![截圖 2025-01-27 下午4.30.50](https://hackmd.io/_uploads/By1LNpNdyl.png)

## Practice

- 14.1, 14.2, 14.3, 14.4, 14.5
- 14.16, 14.18, 14.22
- 14.30, 14.32