Electronics / How computer memory stores bits

How computer memory stores bits

What physically holds a 1 or a 0 inside a chip: the SRAM, DRAM and flash cells, how one cell is picked out of billions, and why each kind has its place.

Intermediate7 steps~7 min
Cell — stores one bit
Word line — switches on one row of cells
Bit line — carries a bit in or out of a column
Charge — electrons that mark the stored bit
// THE SHORT VERSION

In 30 seconds

Memory is a grid of tiny cells, each storing one bit. An address selects a row and a column, and so a single cell.

There are three main cell designs. SRAM holds the bit in a loop of six transistors: very fast, but large. DRAM holds it as charge on a capacitor: small, but it leaks and must be refreshed. Flash traps electrons behind an insulator: slow to write, but dense.

SRAM and DRAM forget when the power goes off. Flash remembers, which is why it is used for storage.

How computer memory stores bits, step by step

STEPS01 / 07

Simplified: real arrays have sense amplifiers and far more rows and columns, flash cells are wired in long chains, and many modern flash cells trap charge in a different layer and store several bits each.

STEP 01 / 07 A grid of one-bit cells
THE MATH
1 cell = 1 bit 1 GB = about 8 billion cells
  1. Step 1: A grid of one-bit cells. Computer memory is an enormous grid of identical cells, and each cell holds a single bit: 0 or 1. Everything a computer remembers, from a photo to a running program, is spread across these cells. What differs between kinds of memory is how one cell is built.
  2. Step 2: Addressing one cell. Each cell has a numbered position, its address. Half of the address bits go to a row decoder, which switches on one word line and wakes a whole row. The cells in that row put their bits on the vertical bit lines, and the other half of the address picks which bit line to pass on.
  3. Step 3: SRAM: a loop that holds. Static RAM stores the bit in two inverters (NOT gates) wired in a ring. One outputs 1, which makes the other output 0, which keeps the first at 1. Each inverter is two transistors, and two more connect the cell to its bit lines when the word line is on: six in all. Fast, but bulky.
  4. Step 4: DRAM: charge in a bucket. Dynamic RAM keeps the bit as electric charge on a tiny capacitor, behind one transistor. Charged means 1, empty means 0. The cell is very small, but the charge leaks away and reading it drains it too, so the chip rewrites every cell many times a second. That is the refresh.
  5. Step 5: Flash: trapped electrons. A flash cell is one transistor with an extra layer, the floating gate, wrapped in insulator. A strong voltage pushes electrons onto it, and there they stay. Their charge changes whether the transistor conducts, which is how the bit is read. Writing is slow and gradually wears the insulator out.
  6. Step 6: Speed against density. The three designs trade speed for size. SRAM answers in about a nanosecond (a billionth of a second) but needs six transistors per bit. DRAM is a little slower and far denser. Flash packs in the most bits per chip and is the cheapest per bit, but it is much slower, above all when writing.
  7. Step 7: When the power goes off. Cut the power and an SRAM loop stops holding, and a DRAM capacitor drains with nothing to refresh it: both are volatile. Flash keeps its trapped electrons, so it is non-volatile. A computer therefore keeps files and programs in flash and works on copies of them in RAM.
VALUES SO FAR
cell1 bitunit
address····rule
SRAM····cell
DRAM····cell
refresh····DRAM
flash····cell
fastest····speed
densest····density
keeps····power off

Spotted a mistake on this page?