C744 of 57
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

C7 · Lesson 44 · SRAM, DRAM and flash

Three ways to store a billion bits

A flip-flop takes about twenty transistors to hold one bit, far too many for gigabytes. Memories use much smaller cells, each trading something away. SRAM keeps a tiny latch (six transistors) in each cell: fast, but bulky. DRAM stores each bit as charge on a capacitor behind one transistor: dense and cheap, but the charge leaks away, so every row has to be read and rewritten dozens of times a second. Flash traps charge on an isolated gate (B9.7): it keeps its data with the power off, but writing is slow and wears the cell out.

Play

  • A DRAM cell's capacitor, charged to a 1, leaks through its transistor. The sense amplifier reads a 1 only while the voltage stays above the threshold.
  • How long does the charge last? Change the leakage resistance (it varies with temperature).
  • Set a refresh period. Each refresh tops the cell back up. What's the longest refresh period that's still safe?

Predict

A DRAM cell starts at 1 V and loses charge with a time constant of 100 ms. Its contents read correctly while it's above 0.5 V. How often must it be refreshed?

Name it

Memory technologies

SRAMDRAMFlash
cell6 transistors (a latch)1 transistor + 1 capacitor1 floating-gate transistor
keeps data without powernonoyes, for years
refresh needednoyes, every 64 msno
read time~1 ns~10s of ns~10s of µs
writefastfastslow; erase in blocks; wears out
used forcaches, registersmain memorystorage (SSDs, phones)

Organization. A memory is a grid of cells: an address selects a row (word line) and the cells' contents appear on the columns (bit lines), where sense amplifiers detect the small signals. With n address bits and words of w bits, the capacity is 2n×w bits.

DRAM's tiny signal. A cell's capacitor (a few femtofarads) shares its charge with a long bit line many times larger, so the bit line moves only a fraction of a volt; the sense amplifier detects that difference and drives the line fully, which also rewrites the cell.

Flash's bits per cell. Multi-level cells store 2, 3 or 4 bits by distinguishing 4, 8 or 16 charge levels on the floating gate, trading endurance and speed for density.

Worked example

A 1 GiB memory has 64-bit words. How many address lines does it need?

Show the solution
  1. Count the words. 1 GiB is 230 bytes, and each word is 8 bytes: 2308=227
  2. Count the address lines. 227 words need 27 address lines.

Answer 27 address lines.

Worked example

A DRAM must refresh all 8192 of its rows every 64 ms. How often does it refresh a row?

Show the solution
  1. Divide the period by the rows. 64ms8192=7.8μs
  2. Schedule the refreshes. One row refresh every 7.8 µs, interleaved with normal accesses.

Answer one row every 7.8 µs.

Worked example

A memory channel is 64 bits wide and transfers 3200 million times a second. What's its peak bandwidth? And how big a ROM would hold an 8-bit by 8-bit multiplication table?

Show the solution
  1. Peak bandwidth. Each transfer moves 8 bytes: 8×3.2×109=25.6GB/s
  2. ROM size. The multiplier has 16 input bits and a 16-bit product, so 216 words of 16 bits: 216×16=1Mbit or 128 KiB.
  3. Why ROMs stay small. A ROM can compute anything, but its size doubles with every input bit, which is why it's used as logic only for small functions, as in an FPGA's LUTs.

Answer 25.6 GB/s; the multiplication table takes 1 Mbit, 128 KiB.

Check

A DRAM cell decays as e−t/τ with τ = 100 ms from 1 V. When does it fall to 0.4 V?

Write units the way you normally would: 1.5 ms, 1500 µs and 0.0015 s are the same answer.

Check

A memory has 16 address bits and 8-bit words. How many bytes does it hold?

Check

A flash cell stores 2 bits. How many charge levels must it tell apart?

Check

A DRAM chip must refresh all 4096 rows every 64 ms, one at a time, evenly spread. How often does it refresh a row?

Write units the way you normally would: 1.5 ns, 1500 ps and 0.0015 µs are the same answer.

Check

Match each memory to its cell.

  1. Aa six-transistor latch
  2. Ba row of flip-flops
  3. Cone transistor and a capacitor
  4. Da transistor with a floating gate

Check

A 4 GiB memory has 16-bit words.

(a)

How many address lines does it need?

(b)

How many more address lines would it need if it were byte-addressed?

Check

A memory channel is w bits wide at r transfers per second, with n channels; separately, a DRAM must refresh R rows every t seconds.

Step 1

What's the peak bandwidth in bytes per second?

Type it the way you would write it, like 3sin(2πft) or 3*sin(2*pi*f*t). Angles can be in radians or carry a degree sign, like 45°.

Explain why

Why does DRAM need refreshing while SRAM doesn't?

Practice

Keep practicing

8 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.