---
title: Memory devices
heading: DRAM, SRAM, flash and the newer memories, as device physics
eyebrow: S1 · Lesson 43 · Memory devices
xp: 50
---

::: hook
Most transistors ever made are memory cells. A DRAM bit is a capacitor of a few tens of femtofarads that leaks, so it's read back as a small voltage on a much bigger wire and has to be rewritten every 64 ms. A flash bit is a transistor with charge trapped in its gate, where it stays for years because the electrons are surrounded by an energy barrier several electronvolts high; storing three or four bits per cell means telling apart thresholds a few hundred millivolts apart, each made of a few hundred electrons. This lesson does the arithmetic of both, and places the newer memories that try to combine their strengths.
:::

::: play
- A DRAM cell storing a 1, read out after time t. The curve is the signal it puts on the bitline: the voltage swing relative to the precharge level at half the supply (1.1 V), in mV.
- The signal starts small because the cell's charge is shared with a much larger bitline capacitance. Leakage then drains the cell, and the signal falls toward zero.
- The marker is a 30 mV sense margin. Where the curve crosses it is the cell's retention time; the chip refreshes every row well before that.
:::
:::

```sim plot
view: graph
x: t = 0..2000 ms
y: v = 0..150
slider: Cs = 5..40 = 20 fF
slider: CBL = 30..300 = 120 fF
slider: I = 1..100 = 10 fA log
plot: (0.55 - I*1e-15*t*1e-3/(Cs*1e-15))*Cs/(Cs + CBL)*1000 | samples: 400 | label: bitline signal, mV
marker: y = 30 | label: sense margin
readout: initial signal, mV = 0.55*Cs/(Cs + CBL)*1000
readout: retention time, ms = (0.55 - 0.03*(Cs + CBL)/Cs)*Cs*1e-15/(I*1e-15)*1000
readout: electrons stored = Cs*1e-15*1.1/1.602e-19
```

::: predict
## A DRAM cell of 20 fF holds a 1 at 1.1 V and is read onto a 100 fF bitline precharged to 0.55 V. How big is the signal the sense amplifier sees?

- [ ] 1.1 V
- [ ] 550 mV
- [x] About 90 mV
- [ ] About 5 mV

::: reveal
Charge sharing: the cell's extra 0.55 V spreads over 20 + 100 fF, giving $0.55 \times \frac{20}{120}$ = 92 mV. That small swing is why DRAM needs a sensitive latch-type sense amplifier on every bitline and why bitlines are kept short. It's also why the cell capacitance hasn't been allowed to shrink much, even as everything else did: the capacitor became a tall, narrow cylinder etched deep into the chip.
:::
:::

::: nameit
## DRAM

One transistor and one capacitor per bit. To read, the bitline is precharged to $V_{DD}/2$ and the access transistor connects the cell, so charge sharing gives

$$\Delta V = \frac{V_{DD}}{2}\cdot\frac{C_s}{C_s + C_{BL}}$$

Reading destroys the stored charge, so the sense amplifier writes it back. Leakage (junction generation current, subthreshold current through the access transistor, gate-induced drain leakage) drains a stored 1; the chip refreshes every row within 64 ms (32 ms when hot), and the worst cells set that interval.

## SRAM

Six transistors per bit: two cross-coupled inverters with two access transistors. It needs no refresh and is fast, but takes about 100 to 150 times the area of the minimum feature squared, against about 6 for DRAM. Its stability depends on transistor ratios, so threshold mismatch (lesson 38) limits how low its supply can go.

## Flash

A transistor with a storage layer between its control gate and channel: a conductive floating gate or, in 3D NAND, a charge-trapping nitride. Electrons stored there raise the threshold by

$$\Delta V_T = \frac{Q}{C_{CG}}$$

where $C_{CG}$ is the capacitance between the control gate and the stored charge.

- **Programming** pushes electrons in by Fowler–Nordheim tunneling through about 8 nm of oxide at fields near 10 MV/cm (B10.38), or by hot-electron injection in NOR flash.
- **Retention:** a 3 eV barrier holds the electrons for ten years at operating temperature.
- **Endurance:** each cycle damages the oxide, limiting cells to roughly $10^3$ to $10^5$ cycles.
- **Multi-level cells:** n bits need $2^n$ threshold levels in the same window, so TLC (3 bits) packs 8 levels, and QLC 16.
- **3D NAND** stacks 200 to 300 layers of cells vertically along a channel hole, which is how density keeps rising without shrinking the cell.

## Emerging memories

- **FeRAM:** a ferroelectric's polarization (B12.42); HfZrO films made it CMOS compatible.
- **MRAM:** a magnetic tunnel junction whose resistance depends on whether two magnetic layers are parallel, switched by spin-transfer torque.
- **Phase-change memory:** a chalcogenide switched between amorphous and crystalline phases by heating.
- **RRAM:** a conductive filament formed and broken in an oxide.

Each trades speed, endurance, density and retention differently.
:::

::: example
## A DRAM cell has $C_s$ = 20 fF and its bitline 100 fF, at $V_{DD}$ = 1.1 V. Find the read signal, the electrons in a stored 1, and the retention time if 10 fA leaks out and the sense amplifier needs 30 mV.

::: solution
1. **Read signal.**
   $$\begin{aligned} \Delta V &= 0.55 \times \frac{20}{120} \\ &= 92\ \text{mV} \end{aligned}$$
2. **Stored charge.**
   $$\begin{aligned} Q &= C_sV_{DD} \\ &= 2.2 \times 10^{-14}\ \text{C} \end{aligned}$$
   or 137,000 electrons.
3. **Loss the cell can take.** The signal falls to 30 mV when the cell has lost
   $$0.55 - 0.03 \times \frac{120}{20} = 0.37\ \text{V}$$
4. **Retention time.** The cell droops at
   $$\frac{10\ \text{fA}}{20\ \text{fF}} = 0.5\ \text{V/s}$$
   so losing 0.37 V takes 0.74 s.
5. **Refresh.** That's a typical cell; refresh at 64 ms covers the leakiest cells, which can be a hundred times worse.

**Answer:** a 92 mV read signal, 137,000 electrons in a stored 1, and a retention time of 0.74 s.
:::
:::

::: example
## A flash cell has $C_{CG}$ = 0.5 fF and a 3 V threshold window. How many electrons shift its threshold by 1 V, and how many separate the levels of a TLC cell?

::: solution
1. **Electrons per volt.**
   $$\begin{aligned} Q &= C_{CG}\Delta V_T \\ &= 0.5 \times 10^{-15} \times 1\ \text{C} \\ &= 5 \times 10^{-16}\ \text{C} \end{aligned}$$
   or 3120 electrons per volt.
2. **TLC level spacing.** A TLC cell's eight levels in 3 V are 0.375 V apart, about 1170 electrons.
3. **Charge loss.** Losing a tenth of that over ten years, 117 electrons, shifts the threshold by 37 mV, a tenth of the spacing.
4. **What it means for design.** That's why multi-level cells need strong error correction and why scaled planar cells, with a few hundred electrons per level, gave way to 3D NAND's larger cells.

**Answer:** 3120 electrons shift the threshold by 1 V, and about 1170 electrons separate the levels of a TLC cell.
:::
:::

::: example
## A 20 fF DRAM cell may lose 0.3 V before it becomes unreadable and is refreshed every 64 ms. What leakage can it tolerate?

::: solution
1. **Tolerable leakage.**
   $$\begin{aligned} I &= \frac{C\Delta V}{t} \\ &= \frac{20\ \text{fF} \times 0.3\ \text{V}}{0.064\ \text{s}} \\ &= 94\ \text{fA} \end{aligned}$$
2. **Hot DRAM.** Leakage roughly doubles every 10 °C, so hot DRAM refreshes twice as often, which is why server memory specifies a 32 ms refresh above 85 °C.

**Answer:** about 94 fA.
:::
:::

::: check
given: C = 10 | 25; B = 60 | 150; V = 1 | 1.2
answer: V/2*C/(C + B)*1000
unit: mV
tolerance: 1%

## A DRAM cell of {C} fF at $V_{DD}$ = {V} V is read onto a {B} fF bitline precharged to $V_{DD}/2$. What's the signal?

::: right
Right. $\frac{V_{DD}}{2}\cdot\frac{C_s}{C_s + C_{BL}}$ = {answer} mV.
:::

::: misses
- [V*C/(C + B)*1000] The bitline starts at $V_{DD}/2$, so only half the supply is shared.
- [V/2*C/B*1000] The charge spreads over both capacitances.
- [any] Not yet. Charge conservation between cell and bitline.
:::
:::

::: check
given: C = 10 | 25; V = 1 | 1.2
answer: C*1e-15*V/1.602e-19
tolerance: 1%

## How many electrons does a {C} fF DRAM cell store at {V} V?

::: right
Right. $C_sV/q$ = {answer} electrons.
:::

::: misses
- [any] Not yet. Q = CV, then divide by q.
:::
:::

::: check
given: C = 15 | 30; B = 80 | 150; I = 5 | 50
answer: (0.55 - 0.03*(C + B)/C)*C*1e-15/(I*1e-15)*1000
unit: ms
tolerance: 1%

## A DRAM cell ({C} fF, bitline {B} fF, $V_{DD}$ = 1.1 V) leaks {I} fA. If the sense amplifier needs 30 mV, how long does a stored 1 last?

::: right
Right. The cell can lose $0.55 - 0.03\frac{C_s + C_{BL}}{C_s}$ volts at $I/C_s$ per second: {answer} ms.
:::

::: misses
- [0.55*C*1e-15/(I*1e-15)*1000] The signal only has to fall to 30 mV at the bitline, not to zero.
- [any] Not yet. Find the cell voltage loss that brings the signal to 30 mV.
:::
:::

::: check
given: C = 0.3 | 1; n = 500 | 2000 | 10000
answer: n*1.602e-19/(C*1e-15)
unit: V
tolerance: 1%

## A flash cell with $C_{CG}$ = {C} fF stores {n} electrons. How much does its threshold rise?

::: right
Right. $\Delta V_T = \frac{nq}{C_{CG}}$ = {answer} V.
:::

::: misses
- [any] Not yet. Q over the control-gate capacitance.
:::
:::

::: check
given: b = 2 | 3 | 4; W = 3 | 4
answer: W/(2^b - 1)
unit: V
tolerance: 1%

## A flash cell stores {b} bits in a {W} V threshold window. How far apart are adjacent levels' centers, spread evenly from one edge of the window to the other?

::: right
Right. $2^b$ levels with $2^b - 1$ gaps: {answer} V.
:::

::: misses
- [W/2^b] There are $2^b - 1$ gaps between $2^b$ levels.
- [W/b] The number of levels is $2^b$, not b.
- [any] Not yet. Count the levels first.
:::
:::

::: check
given: c = 0.6 | 0.7; V = 15 | 20
answer: c*V
unit: V
tolerance: 1%

## A floating-gate cell has a coupling ratio of {c} from control gate to floating gate. With {V} V on the control gate and the channel at 0 V (and no stored charge), what's the floating gate's voltage?

::: right
Right. $V_{FG} = \alpha_{CG}V_{CG}$ = {answer} V: the voltage across the tunnel oxide during programming.
:::

::: misses
- [V] The floating gate divides the voltage with the tunnel oxide's capacitance.
- [any] Not yet. A capacitive divider.
:::
:::

::: check
given: r = 4096 | 8192 | 65536; t = 30 | 50; T = 32 | 64
answer: r*t*1e-9/(T*1e-3)*100
unit: %
tolerance: 1%

## A DRAM bank has {r} rows, each refresh taking {t} ns, all refreshed every {T} ms. What fraction of the time is spent refreshing?

::: right
Right. {answer}% of the time.
:::

::: misses
- [any] Not yet. Total refresh time per interval, over the interval.
:::
:::

::: check
kind: parts
given: C = 10 | 20 | 30; B = 50 | 100 | 200; V = 1 | 1.2

## A DRAM cell of {C} fF stores {V} V and shares charge with a {B} fF bitline precharged to $V_{DD}/2$.

::: part
answer: V/2*C/(C + B)*1000
unit: mV
tolerance: 0.5%

### What signal reaches the sense amplifier?

::: misses
- [V/2*C/B*1000] Divide by the total capacitance.
- [any] $(V/2)C_s/(C_s + C_b)$.
:::
:::

::: part
answer: C*1e-15*0.3/0.064*1e15
unit: fA
tolerance: 0.5%

### What leakage lets it lose 0.3 V in a 64 ms refresh period?

::: misses
- [any] $C\Delta V/t$.
:::
:::
:::

::: check
kind: derivation
vars: C = 1e-16..1e-15, W = 1..6, b = 2..4

## A flash cell's control-gate capacitance is C, its threshold window W volts, and it stores b bits.

::: step
answer: C/1.602e-19

### How many electrons on the floating gate shift its threshold by 1 V?
:::

::: step
answer: W/(2^b - 1)*C/1.602e-19

### How many electrons separate adjacent levels?
:::

::: right
Right. Each extra bit halves the electrons per level, so multi-level cells trade endurance and retention for density.
:::
:::

::: explain
## Why does flash memory keep its data for years with the power off, while DRAM loses it in under a second?

::: model
A DRAM cell stores charge on a capacitor connected to silicon through junctions and a transistor that's off but not perfectly off, so generation currents and subthreshold leakage drain it in a fraction of a second to a few seconds. A flash cell stores electrons in a layer completely surrounded by insulator, with an energy barrier of about 3 eV between them and the silicon. At operating temperatures almost no electrons have enough energy to cross that barrier, and tunneling through the thick oxide is negligible at the small fields present when the cell is idle. Only the very high fields applied during programming and erasing move charge in and out. The price is slow, high-voltage writes and a limited number of cycles before the oxide wears out.
:::
:::

::: practice

::: check
given: C = 12 | 30; B = 70 | 200; V = 1.05 | 1.15
answer: V/2*C/(C + B)*1000
unit: mV
tolerance: 1%

## DRAM signal: {C} fF cell, {B} fF bitline, {V} V?

::: misses
- [any] $\frac{V_{DD}}{2}\frac{C_s}{C_s + C_{BL}}$.
:::
:::

::: check
given: C = 0.4 | 0.8; n = 300 | 3000
answer: n*1.602e-19/(C*1e-15)
unit: V
tolerance: 1%

## Threshold shift: {n} electrons, $C_{CG}$ = {C} fF?

::: misses
- [any] $nq/C_{CG}$.
:::
:::

::: check
given: b = 2 | 4; W = 3.5 | 5
answer: W/(2^b - 1)
unit: V
tolerance: 1%

## Level spacing: {b} bits in {W} V?

::: misses
- [any] $W/(2^b - 1)$.
:::
:::
:::
