---
title: "Project: MOS capacitor extraction"
heading: An exact quasi-static C–V model, fitted to a measured curve
eyebrow: S1 · Lesson 53 · Project: MOS capacitor extraction
xp: 80
---

::: hook
A fab's C–V station sweeps a test capacitor and, within seconds, reports the oxide thickness, the substrate doping and the flat-band voltage. Behind that report is a model of the curve and a fit. In this project you'll build both. The model is exact: the silicon's charge from the full solution of Poisson's equation (lesson 32), the gate voltage that produces each surface potential, and the capacitance as the oxide in series with the silicon. The fit starts from textbook estimates (the maximum, the minimum, the flat-band point) and polishes them with least squares until the model lies on the measurement.
:::

::: predict
## A quasi-static C–V curve is measured. Which feature tells you most directly about the oxide thickness?

- [x] The capacitance deep in accumulation, close to $C_{ox}$
- [ ] The depth of the minimum
- [ ] The voltage of the minimum
- [ ] The slope through depletion

::: reveal
Accumulation. With the surface flooded with holes, the silicon's capacitance is huge and the series combination is nearly $C_{ox} = \varepsilon_{ox}/t_{ox}$. "Nearly": even 2 V into accumulation the silicon's capacitance takes 2 to 3% off, which is why careful extraction fits the whole curve with an exact model instead of reading $t_{ox}$ off the maximum. The minimum's depth gives the doping, and the voltage where the curve passes the flat-band capacitance gives $V_{FB}$.
:::
:::

::: nameit
## The exact model

For p-type silicon with $u = \psi_s/V_T$ and $r = n_i^2/N_A^2$:

$$Q_s = -\text{sign}(\psi_s)\sqrt{2\varepsilon_sV_TqN_A}\sqrt{F^2}, \qquad F^2 = e^{-u} + u - 1 + r(e^u - u - 1)$$

The silicon's small-signal capacitance is $C_s = -\frac{dQ_s}{d\psi_s} = \sqrt{2\varepsilon_sV_TqN_A}\frac{\lvert dF^2/d\psi_s\rvert}{2\sqrt{F^2}}$, with $\frac{dF^2}{d\psi_s} = \frac{1}{V_T}\left(1 - e^{-u} + r(e^u - 1)\right)$, and at $\psi_s$ = 0 it's $\varepsilon_s/L_D$.

## From gate voltage to capacitance

Each gate voltage fixes $\psi_s$ through

$$V_G = V_{FB} + \psi_s - \frac{Q_s(\psi_s)}{C_{ox}}$$

whose right side rises steadily with $\psi_s$, so bisection finds $\psi_s$ for every $V_G$ at once (vectorized over the array). Then the quasi-static capacitance is

$$C = \left(\frac{1}{C_{ox}} + \frac{1}{C_s(\psi_s)}\right)^{-1}$$

Quasi-static means the inversion layer follows the signal, so the curve recovers in inversion (lesson 33's low-frequency curve, measured with a slow voltage ramp).

## The fit

1. $t_{ox}$ from the maximum capacitance, $\varepsilon_{ox}/C_\text{max}$ (slightly too thick).
2. $N_A$ by bisecting on $\log_{10}N_A$ until the model's minimum matches the measured one: higher doping gives a shallower minimum.
3. $V_{FB}$ where the curve crosses $C_{FB} = (1/C_{ox} + L_D/\varepsilon_s)^{-1}$ on the depletion side.
4. Levenberg–Marquardt on $(t_{ox}, \log_{10}N_A, V_{FB})$, minimizing the relative residuals, with numerical derivatives and the parameters kept inside physical bounds.

## What you'll write

1. `qs(psi, Na)`: the exact silicon charge per area, C/cm², vectorized.
2. `cv_quasistatic(Vg, Na, tox, Vfb)`: the capacitance per area (F/cm²) for an array of gate voltages; tox in nm. A `cs` function is provided.
3. `extract(Vg, C)`: return `(tox_nm, Na, Vfb)` fitted to a measured curve.
:::

::: example
## Check the exact charge against the depletion approximation in depletion.

::: solution
1. **Approximate the exact charge.** For $u \gg 1$ and r tiny, $F^2 \approx u - 1$, so
   $$Q_s \approx -\sqrt{2\varepsilon_sqN_A(\psi_s - V_T)}$$
2. **What that is.** It's the depletion approximation with kT/q taken off, the same correction the lab found at the junction's edge.
3. **Numbers.** For $N_A = 10^{16}$ and $\psi_s$ = 0.3 V that's $3.02 \times 10^{-8}$ C/cm², against $3.16 \times 10^{-8}$ from the plain formula.
4. **Accumulation and inversion.** In accumulation the exact charge grows as $e^{-\psi_s/2V_T}$, and in strong inversion as $e^{\psi_s/2V_T}$ times $n_i/N_A$.

**Answer:** in depletion the exact charge is the depletion approximation with kT/q taken off $\psi_s$: $3.02 \times 10^{-8}$ C/cm² against $3.16 \times 10^{-8}$ at 0.3 V.
:::
:::

::: example
## A capacitor with 20 nm of oxide on $10^{16}$ silicon has $V_{FB}$ = −0.9 V. At $V_G$ = −3 V, 2.1 V into accumulation, how close is its capacitance to $C_{ox}$?

::: solution
1. **The model's value.** At −3 V the model gives 0.974 $C_{ox}$.
2. **Apparent thickness.** Taking that as $C_{ox}$ would make the oxide look 2.7% thick:
   $$\frac{20.0\ \text{nm}}{0.974} = 20.5\ \text{nm}$$
   instead of 20.0.
3. **Fitting the whole curve.** Fitting the whole curve removes the bias; with 0.2% noise on 121 points, the fit lands within 0.01 nm.

**Answer:** it reaches 0.974 $C_{ox}$, so reading it as $C_{ox}$ would put the oxide at 20.5 nm instead of 20.0 nm.
:::
:::

::: check
kind: python

## Step 1. Write `qs(psi, Na)`, the exact charge in p-type silicon, in C/cm².

```python starter
import numpy as np, math
q = 1.602176634e-19
es = 11.7 * 8.854e-14
Vt = 0.02585
ni = 1e10

def qs(psi, Na):
    psi = np.asarray(psi, float)
    return np.zeros_like(psi)

print(qs([-0.2, 0.0, 0.3, 0.9], 1e16))
```

```python solution
import numpy as np, math
q = 1.602176634e-19
es = 11.7 * 8.854e-14
Vt = 0.02585
ni = 1e10

def qs(psi, Na):
    psi = np.asarray(psi, float)
    u = psi / Vt
    r = ni**2 / Na**2
    F2 = np.exp(-u) + u - 1 + r * (np.exp(u) - u - 1)
    return -np.sign(psi) * np.sqrt(2 * es * Vt * q * Na) * np.sqrt(np.maximum(F2, 0))

print(qs([-0.2, 0.0, 0.3, 0.9], 1e16))
```

```python tests
import numpy as np, math
Q = qs(np.array([0.3]), 1e16)[0]
dep = -math.sqrt(2 * es * q * 1e16 * (0.3 - Vt))
assert abs(Q / dep - 1) < 1e-3, f"In depletion the charge should match -sqrt(2εqN(ψ - kT/q)) = {dep:.4e}; got {Q:.4e}."
assert qs(np.array([-0.2]), 1e16)[0] > 0, "Accumulation (negative ψ) gives positive charge in p-type silicon."
assert qs(np.array([0.0]), 1e16)[0] == 0, "No band bending, no charge."
Qinv = qs(np.array([2 * Vt * math.log(1e16 / ni) + 0.15]), 1e16)[0]
Qdep = -math.sqrt(2 * es * q * 1e16 * (2 * Vt * math.log(1e16 / ni) + 0.15))
assert Qinv < 3 * Qdep, "0.15 V past 2φF the inversion electrons should outweigh the depletion charge several times over."
```

::: right
Right. One formula covers accumulation, depletion and inversion, and reduces to the depletion approximation (with its kT/q correction) where it should.
:::
:::

::: check
kind: python

## Step 2. Write `cv_quasistatic(Vg, Na, tox, Vfb)`, returning C in F/cm² for each gate voltage.

```python starter
import numpy as np, math
q = 1.602176634e-19
es = 11.7 * 8.854e-14
eox = 3.9 * 8.854e-14
Vt = 0.02585
ni = 1e10

def qs(psi, Na):
    psi = np.asarray(psi, float); u = psi / Vt; r = ni**2 / Na**2
    F2 = np.exp(-u) + u - 1 + r * (np.exp(u) - u - 1)
    return -np.sign(psi) * np.sqrt(2 * es * Vt * q * Na) * np.sqrt(np.maximum(F2, 0))

def cs(psi, Na):
    psi = np.asarray(psi, float); u = psi / Vt; r = ni**2 / Na**2
    F2 = np.exp(-u) + u - 1 + r * (np.exp(u) - u - 1)
    dF = (1 - np.exp(-u) + r * (np.exp(u) - 1)) / Vt
    small = np.abs(u) < 1e-4
    out = np.sqrt(2 * es * Vt * q * Na) * np.abs(dF) / (2 * np.sqrt(np.where(small, 1, F2)))
    return np.where(small, es / math.sqrt(es * Vt / (q * Na)), out)

def cv_quasistatic(Vg, Na, tox, Vfb):
    Vg = np.atleast_1d(np.asarray(Vg, float))
    Cox = eox / (tox * 1e-7)
    # bisect for psi in [-1.5, 1.5] at every Vg, then C = series of Cox and cs(psi)
    return np.full_like(Vg, Cox)

print(cv_quasistatic([-3, -0.9, 0, 3], 1e16, 20, -0.9) / (eox / 20e-7))
```

```python solution
import numpy as np, math
q = 1.602176634e-19
es = 11.7 * 8.854e-14
eox = 3.9 * 8.854e-14
Vt = 0.02585
ni = 1e10

def qs(psi, Na):
    psi = np.asarray(psi, float); u = psi / Vt; r = ni**2 / Na**2
    F2 = np.exp(-u) + u - 1 + r * (np.exp(u) - u - 1)
    return -np.sign(psi) * np.sqrt(2 * es * Vt * q * Na) * np.sqrt(np.maximum(F2, 0))

def cs(psi, Na):
    psi = np.asarray(psi, float); u = psi / Vt; r = ni**2 / Na**2
    F2 = np.exp(-u) + u - 1 + r * (np.exp(u) - u - 1)
    dF = (1 - np.exp(-u) + r * (np.exp(u) - 1)) / Vt
    small = np.abs(u) < 1e-4
    out = np.sqrt(2 * es * Vt * q * Na) * np.abs(dF) / (2 * np.sqrt(np.where(small, 1, F2)))
    return np.where(small, es / math.sqrt(es * Vt / (q * Na)), out)

def cv_quasistatic(Vg, Na, tox, Vfb):
    Vg = np.atleast_1d(np.asarray(Vg, float))
    Cox = eox / (tox * 1e-7)
    lo = np.full_like(Vg, -1.5); hi = np.full_like(Vg, 1.5)
    for _ in range(80):
        mid = 0.5 * (lo + hi)
        f = Vfb + mid - qs(mid, Na) / Cox - Vg
        hi = np.where(f > 0, mid, hi)
        lo = np.where(f > 0, lo, mid)
    psi = 0.5 * (lo + hi)
    return 1 / (1 / Cox + 1 / cs(psi, Na))

print(cv_quasistatic([-3, -0.9, 0, 3], 1e16, 20, -0.9) / (eox / 20e-7))
```

```python tests
import numpy as np, math
Cox = eox / 20e-7
LD = math.sqrt(es * Vt / (q * 1e16)); Cfb = 1 / (1 / Cox + LD / es)
assert abs(cv_quasistatic([-0.9], 1e16, 20, -0.9)[0] / Cfb - 1) < 1e-6, "At V_FB the model must give the flat-band capacitance."
V = np.linspace(-3, 3, 121)
C = cv_quasistatic(V, 1e16, 20, -0.9) / Cox
assert abs(C[0] - 0.97386) < 1e-4, f"At -3 V the model should give 0.9739 C_ox; got {C[0]:.5f}."
assert abs(C.min() - 0.18235) < 1e-4, f"The minimum should be 0.1824 C_ox; got {C.min():.5f}."
assert C[-1] > 0.95, "In strong inversion the quasi-static curve returns near C_ox."
assert V[np.argmin(C)] > -0.9, "The minimum lies above flat band, near threshold."
```

::: right
Right. A vectorized bisection turns the charge into a full C–V curve: accumulation, flat band, the dip near threshold and the recovery in inversion.
:::
:::

::: check
kind: python

## Step 3. Write `extract(Vg, C)` returning `(tox_nm, Na, Vfb)`.

```python starter
import numpy as np, math
q = 1.602176634e-19
es = 11.7 * 8.854e-14
eox = 3.9 * 8.854e-14
Vt = 0.02585
ni = 1e10

def qs(psi, Na):
    psi = np.asarray(psi, float); u = psi / Vt; r = ni**2 / Na**2
    F2 = np.exp(-u) + u - 1 + r * (np.exp(u) - u - 1)
    return -np.sign(psi) * np.sqrt(2 * es * Vt * q * Na) * np.sqrt(np.maximum(F2, 0))

def cs(psi, Na):
    psi = np.asarray(psi, float); u = psi / Vt; r = ni**2 / Na**2
    F2 = np.exp(-u) + u - 1 + r * (np.exp(u) - u - 1)
    dF = (1 - np.exp(-u) + r * (np.exp(u) - 1)) / Vt
    small = np.abs(u) < 1e-4
    out = np.sqrt(2 * es * Vt * q * Na) * np.abs(dF) / (2 * np.sqrt(np.where(small, 1, F2)))
    return np.where(small, es / math.sqrt(es * Vt / (q * Na)), out)

def cv_quasistatic(Vg, Na, tox, Vfb):
    Vg = np.atleast_1d(np.asarray(Vg, float)); Cox = eox / (tox * 1e-7)
    lo = np.full_like(Vg, -1.5); hi = np.full_like(Vg, 1.5)
    for _ in range(80):
        mid = 0.5 * (lo + hi)
        f = Vfb + mid - qs(mid, Na) / Cox - Vg
        hi = np.where(f > 0, mid, hi); lo = np.where(f > 0, lo, mid)
    return 1 / (1 / Cox + 1 / cs(0.5 * (lo + hi), Na))

def extract(Vg, C):
    Vg = np.asarray(Vg, float); C = np.asarray(C, float)
    tox = eox / C.max() * 1e7
    # then: doping from the minimum, flat band from C_FB, and a least-squares polish
    return tox, 1e16, 0.0

V = np.linspace(-3, 3, 121)
print(extract(V, cv_quasistatic(V, 1e16, 20, -0.9)))
```

```python solution
import numpy as np, math
q = 1.602176634e-19
es = 11.7 * 8.854e-14
eox = 3.9 * 8.854e-14
Vt = 0.02585
ni = 1e10

def qs(psi, Na):
    psi = np.asarray(psi, float); u = psi / Vt; r = ni**2 / Na**2
    F2 = np.exp(-u) + u - 1 + r * (np.exp(u) - u - 1)
    return -np.sign(psi) * np.sqrt(2 * es * Vt * q * Na) * np.sqrt(np.maximum(F2, 0))

def cs(psi, Na):
    psi = np.asarray(psi, float); u = psi / Vt; r = ni**2 / Na**2
    F2 = np.exp(-u) + u - 1 + r * (np.exp(u) - u - 1)
    dF = (1 - np.exp(-u) + r * (np.exp(u) - 1)) / Vt
    small = np.abs(u) < 1e-4
    out = np.sqrt(2 * es * Vt * q * Na) * np.abs(dF) / (2 * np.sqrt(np.where(small, 1, F2)))
    return np.where(small, es / math.sqrt(es * Vt / (q * Na)), out)

def cv_quasistatic(Vg, Na, tox, Vfb):
    Vg = np.atleast_1d(np.asarray(Vg, float)); Cox = eox / (tox * 1e-7)
    lo = np.full_like(Vg, -1.5); hi = np.full_like(Vg, 1.5)
    for _ in range(80):
        mid = 0.5 * (lo + hi)
        f = Vfb + mid - qs(mid, Na) / Cox - Vg
        hi = np.where(f > 0, mid, hi); lo = np.where(f > 0, lo, mid)
    return 1 / (1 / Cox + 1 / cs(0.5 * (lo + hi), Na))

def extract(Vg, C):
    Vg = np.asarray(Vg, float); C = np.asarray(C, float)
    tox = eox / C.max() * 1e7
    Cox = eox / (tox * 1e-7)
    ratio = C.min() / Cox
    grid = np.linspace(-3, 3, 241)
    lo, hi = 14.0, 19.0
    for _ in range(40):
        mid = 0.5 * (lo + hi)
        if cv_quasistatic(grid, 10**mid, tox, 0.0).min() / Cox > ratio:
            hi = mid
        else:
            lo = mid
    Na = 10**(0.5 * (lo + hi))
    LD = math.sqrt(es * Vt / (q * Na)); Cfb = 1 / (1 / Cox + LD / es)
    falling = Vg <= Vg[np.argmin(C)]
    i = np.argmin(np.where(falling, np.abs(C - Cfb), np.inf))
    p = np.array([tox, math.log10(Na), Vg[i]])
    def resid(p):
        return (cv_quasistatic(Vg, 10**p[1], p[0], p[2]) - C) / C
    lam = 1e-3
    for it in range(40):
        r = resid(p)
        J = np.zeros((len(Vg), 3))
        for k in range(3):
            dp = np.zeros(3); dp[k] = 1e-4
            J[:, k] = (resid(p + dp) - r) / 1e-4
        A = J.T @ J
        step = np.linalg.solve(A + lam * np.diag(np.diag(A)), -J.T @ r)
        pn = np.clip(p + step, [0.5, 14, -3], [200, 19.5, 3])
        if np.sum(resid(pn)**2) < np.sum(r**2):
            p = pn; lam *= 0.3
        else:
            lam *= 10
        if np.max(np.abs(step)) < 1e-9:
            break
    return p[0], 10**p[1], p[2]

V = np.linspace(-3, 3, 121)
print(extract(V, cv_quasistatic(V, 1e16, 20, -0.9)))
```

```python tests
import numpy as np, math
def _ref(Vg, Na, tox, Vfb):
    Vg = np.atleast_1d(np.asarray(Vg, float)); Cox = 3.9 * 8.854e-14 / (tox * 1e-7)
    es_ = 11.7 * 8.854e-14; q_ = 1.602176634e-19; Vt_ = 0.02585
    A = math.sqrt(2 * es_ * Vt_ * q_ * Na); r = 1e20 / Na**2
    def Q(psi):
        u = psi / Vt_
        return -np.sign(psi) * A * np.sqrt(np.maximum(np.exp(-u) + u - 1 + r * (np.exp(u) - u - 1), 0))
    lo = np.full_like(Vg, -1.5); hi = np.full_like(Vg, 1.5)
    for _ in range(80):
        mid = 0.5 * (lo + hi); f = Vfb + mid - Q(mid) / Cox - Vg
        hi = np.where(f > 0, mid, hi); lo = np.where(f > 0, lo, mid)
    u = 0.5 * (lo + hi) / Vt_
    F2 = np.exp(-u) + u - 1 + r * (np.exp(u) - u - 1)
    dF = (1 - np.exp(-u) + r * (np.exp(u) - 1)) / Vt_
    Cs = A * np.abs(dF) / (2 * np.sqrt(np.where(np.abs(u) < 1e-4, 1, F2)))
    Cs = np.where(np.abs(u) < 1e-4, es_ / math.sqrt(es_ * Vt_ / (q_ * Na)), Cs)
    return 1 / (1 / Cox + 1 / Cs)
V = np.linspace(-3, 3, 121)
rng = np.random.default_rng(7)
for Na, tox, Vfb in ((1e16, 20, -0.9), (3e17, 5, -1.1), (2e15, 50, -0.3)):
    Cm = _ref(V, Na, tox, Vfb) * (1 + 0.002 * rng.standard_normal(len(V)))
    t, N, F = extract(V, Cm)
    assert abs(t / tox - 1) < 0.005, f"Oxide: true {tox} nm, extracted {t:.3f}."
    assert abs(N / Na - 1) < 0.03, f"Doping: true {Na:.2e}, extracted {N:.3e}."
    assert abs(F - Vfb) < 0.005, f"Flat band: true {Vfb} V, extracted {F:.4f}."
```

::: right
Right. Textbook estimates get close, and a least-squares fit of the exact model takes the noise-limited remainder: oxide thickness, doping and flat band all come back to a fraction of a percent.
:::
:::

::: check
given: g = 0.2 | 0.5 | 1; V = 0.3 | 0.8
answer: (sqrt(g^2/4 + V) - g/2)^2
unit: V
tolerance: 1%

## In depletion, a MOS capacitor with γ = {g} V^½ sits {V} V above flat band. What's its surface potential (depletion approximation)?

::: right
Right. $V_G - V_{FB} = \psi_s + \gamma\sqrt{\psi_s}$ gives $\psi_s = \left(\sqrt{\frac{\gamma^2}{4} + V_G - V_{FB}} - \frac{\gamma}{2}\right)^2$ = {answer} V.
:::

::: misses
- [V] Part of the voltage drops across the oxide.
- [any] Not yet. It's a quadratic in $\sqrt{\psi_s}$.
:::
:::

::: check
given: C = 0.96 | 0.975 | 0.985; t = 5 | 20
answer: t/C
unit: nm
tolerance: 0.5%

## A capacitor's accumulation reading is really {C} of $C_{ox}$. If the true oxide is {t} nm, what thickness would reading $C_\text{max}$ as $C_{ox}$ report?

::: right
Right. $\varepsilon_{ox}/C_\text{max} = t_{ox}/(C_\text{max}/C_{ox})$ = {answer} nm.
:::

::: misses
- [t*C] A smaller capacitance means a thicker apparent oxide: divide.
- [any] Not yet. $t = \varepsilon_{ox}/C$.
:::
:::

::: check
given: N = 1e15 | 1e16 | 1e17; p = 0.2 | 0.4
answer: sqrt(2*11.7*8.854e-14*1.602e-19*N*(p - 0.02585))
unit: C/cm^2
tolerance: 1%

## For p-type silicon doped {N} cm⁻³ in depletion, what does the exact charge give at $\psi_s$ = {p} V (magnitude)?

::: right
Right. $\sqrt{2\varepsilon_sqN_A(\psi_s - kT/q)}$ = {answer} C/cm².
:::

::: misses
- [sqrt(2*11.7*8.854e-14*1.602e-19*N*p)] That's the plain depletion approximation; the exact charge subtracts kT/q.
- [any] Not yet. For $u \gg 1$, $F^2 \approx u - 1$.
:::
:::

::: explain
## Why fit the whole C–V curve with an exact model instead of reading the oxide thickness, doping and flat band off three points?

::: model
Each of the textbook readings is biased by an approximation. Accumulation never quite reaches the oxide capacitance, so reading the maximum overestimates the oxide thickness by a few percent. The minimum's depth depends on both doping and oxide thickness, so an error in one leaks into the other. The flat-band point depends on the doping through the Debye length. Fitting the exact model to every point at once lets all three parameters adjust together until the model agrees with the whole curve, and uses all the data to average down the noise. The textbook readings still matter: they give the fit a starting point close enough to converge.
:::
:::

::: practice

::: check
given: g = 0.3 | 0.8; V = 0.4 | 1.2
answer: (sqrt(g^2/4 + V) - g/2)^2
unit: V
tolerance: 1%

## Surface potential: γ = {g} V^½, {V} V above flat band?

::: misses
- [any] Solve $V = \psi + \gamma\sqrt\psi$.
:::
:::

::: check
given: N = 3e15 | 3e16; p = 0.25 | 0.6
answer: sqrt(2*11.7*8.854e-14*1.602e-19*N*(p - 0.02585))
unit: C/cm^2
tolerance: 1%

## Exact depletion charge: {N} cm⁻³, ψ = {p} V?

::: misses
- [any] $\sqrt{2\varepsilon_sqN(\psi - V_T)}$.
:::
:::

::: check
given: C = 0.965 | 0.98; t = 8 | 30
answer: t/C
unit: nm
tolerance: 0.5%

## Apparent oxide from $C_\text{max}$ = {C} $C_{ox}$, true {t} nm?

::: misses
- [any] $t_{ox}/(C_\text{max}/C_{ox})$.
:::
:::
:::
