How Flash Memory Stores Bits
Flash memory sits inside USB sticks, memory cards, phones and solid state drives. It keeps your data even when power is off, and it has no moving parts. The trick behind that is a transistor that can hold a small electrical charge for years.
This article explains how a flash cell stores a bit, why it must be erased in blocks, and why the number of bits per cell changes cost and lifespan.
The floating gate cell
A normal transistor acts like a switch. A voltage on its control gate lets current flow through a channel beneath it. A flash cell adds a second, electrically isolated layer between the control gate and the channel. In the classic design this is the floating gate, a conductive layer surrounded by insulating oxide.
Electrons can be forced onto this floating gate and, once there, they stay trapped by the insulation. The trapped charge changes how much voltage the control gate needs before the transistor conducts. Reading the cell means applying a test voltage and checking whether current flows. Charge present means one state, and charge absent means the other.
Many newer chips use a charge trap layer made of an insulating material instead of a conductive floating gate. The principle is the same: charge is held in a layer that is electrically isolated.
Writing and erasing
Writing and erasing require moving electrons through the insulating oxide, which normally blocks them. Flash uses quantum tunneling and strong electric fields to push electrons through the barrier. Programming adds charge to the gate, and erasing removes it.
Each time electrons cross the oxide, the insulation wears slightly. After many cycles it can leak more easily or trap unwanted charge, which makes the stored value harder to read correctly. This wear is the reason flash has a limited number of program and erase cycles.
NAND and NOR arrangements
Cells are wired in two main ways. NOR flash connects cells in parallel, which allows fast random reads and direct code execution. It is used for firmware in many devices. NAND flash connects cells in series strings, which saves space and makes dense, inexpensive storage. Nearly all drives, cards and phone storage use NAND.
Pages and blocks
NAND is organized into pages, the smallest unit you can write, and blocks, the smallest unit you can erase. A block holds many pages. You cannot rewrite one page in place. To change data, the controller writes the new version to a clean page and marks the old one as invalid. Later, it copies the valid pages out of a block and erases the whole block, which is garbage collection.
More than one bit per cell
A cell can store more than one bit by distinguishing several charge levels instead of just two. This is how the common cell types are named:
- SLC (single level cell): one bit per cell, two levels.
- MLC (multi level cell): two bits per cell, four levels.
- TLC (triple level cell): three bits per cell, eight levels.
- QLC (quad level cell): four bits per cell, sixteen levels.
More bits per cell means more capacity from the same silicon, so storage is cheaper per gigabyte. The cost is that the voltage levels sit closer together, which makes reading slower and errors more likely, and it reduces how many erase cycles the cell can survive. SLC is the fastest and most durable but the least dense.
Many drives use part of their TLC or QLC flash in a fast single-bit mode as a temporary write cache. That is why a drive can write quickly at first and then slow down when the cache fills during a long, large transfer.
3D NAND
Shrinking cells in a flat layout eventually causes neighboring cells to interfere with each other. Manufacturers responded by stacking cell layers vertically, creating 3D NAND. Instead of making cells ever smaller, they build upward, with dozens or even hundreds of layers. This raises capacity while keeping cells large enough to be reliable.
The role of the controller
The raw flash chips are not very usable alone. A controller manages them with several jobs:
- Wear leveling: spreads writes evenly so no block wears out first.
- Error correction: stores extra bits so errors in reading can be fixed.
- Bad block management: retires failing blocks and uses spares.
- Address translation: maps the logical addresses your computer uses to physical flash locations.
Without these, flash storage would be far less dependable.
Data retention
Charge slowly leaks over time, and the rate depends on temperature and how worn the cell is. A new drive can hold data for many years unpowered. A heavily worn drive stored in the heat holds it for less time. This is why long-term archives on flash should be powered up and checked occasionally.
Frequently Asked Questions
Why does a flash drive get slower when it is nearly full?
With little free space, the controller has fewer clean blocks and must do more garbage collection while you write. A smaller fast cache is also available. Leaving some space unused helps keep speeds steady.
Is flash memory the same as RAM?
No. RAM is volatile and loses its contents when power is removed, but it is much faster and handles unlimited rewrites. Flash keeps data without power but has slower writes and limited erase cycles.
Can flash memory be repaired after it wears out?
Not at the cell level. Controllers retire worn blocks and use spares, but once enough capacity is lost, the drive reports errors or becomes read-only. At that point you should copy the data off and replace the device.