EEPROM (Electrically Erasable Programmable Read-Only Memory) and flash memory are non-volatile, electrically reprogrammable. Both descend from ROM but can be erased and rewritten without pulling them out of the system.
The difference is granularity: EEPROM can erase individual bytes; flash erases in large blocks. Flash gives up fine-grained writes for higher density and lower cost per bit.
EEPROM
- Cell: 1 transistor with a floating gate that holds trapped charge.
- Read: fast (~50–200 ns).
- Write: slow (~ms per byte) and erasing requires a special voltage.
- Granularity: byte-by-byte erase and rewrite.
- Endurance: ~100K to 1M write cycles per cell before wearing out.
- Use case: small amounts of configuration data: a network device’s MAC address, a router’s settings, BIOS calibration values.
EEPROM fits where you need infrequent, fine-grained updates to small data. Settings the user occasionally changes but the device keeps across power cycles.
Flash memory
- Cell: similar floating-gate transistor as EEPROM.
- Read: fast (~25–100 ns for NOR, slower for NAND).
- Write: slow per byte but supports high-bandwidth bulk writes.
- Granularity: erases in blocks of typically 4 KB to several MB. Can’t change individual bytes without erasing and rewriting the whole block.
- Endurance: ~1K to 100K erase cycles per block.
- Density: very high, cells are tightly packed.
Flash is the technology behind SSDs, USB drives, SD cards, and embedded device storage.
NOR vs NAND flash
Two main flash architectures:
- NOR flash: cells in parallel, supports random byte-level reads (like a ROM). Lower density, used for code storage where execute-in-place matters (firmware, BIOS).
- NAND flash: cells in series, only supports page-level reads (typically 2–8 KB pages). Higher density, used for data storage (SSDs, USB sticks, SD cards).
NAND is more common for large storage; NOR for code that needs random access.
Why “block erasure”
The convention in NOR and NAND flash is that erased = 1 and programmed = 0. The high-voltage erase removes electrons from the floating gate, leaving every cell at logical . The (lower-voltage) program operation injects electrons into a chosen cell, flipping it from .
The asymmetry: programming can flip individual bits from , but flipping a bit from is impossible without erasing, and erase only works at block granularity. So once a bit has been programmed to , the only way to read from it again is to erase the whole block (returning all bits in the block to ) and re-program everything else.
That’s why flash writes are organized at the block level: small in-place modifications “in the wrong direction” force a full erase-and-rewrite of the surrounding block.
Flash file systems (F2FS, JFFS2) hide this, but they have to do wear leveling, spreading writes across the chip so no single block wears out before the others. Without it the most-frequently-written block (e.g. a file system’s allocation table) burns through its write endurance long before the rest of the chip.
Use cases by technology
| Technology | Use case |
|---|---|
| EEPROM | Small config data, calibration, MAC addresses |
| NOR flash | Boot ROM, firmware, code storage in embedded devices |
| NAND flash | SSDs, USB drives, SD cards, smartphones |
| 3D NAND | Modern high-capacity SSDs (stacked NAND for higher density) |
A multi-TB SSD is dozens of NAND dies on a shared bus plus a controller that does the wear-levelling, bad-block remapping, and stripe-across-dies parallelism. The raw NAND alone isn’t usable as direct storage: the OS expects sector-style read/write, and the controller turns block-erase / page-program flash semantics into that interface.
In the Memory hierarchy
EEPROM and flash sit below main memory (DRAM) in the hierarchy:
- Main memory: nanoseconds, gigabytes, volatile.
- SSD (NAND flash): microseconds, terabytes, non-volatile.
- Hard disk: milliseconds, terabytes, non-volatile.
SSDs are dramatically faster than spinning disks (50–100× faster random access) and have largely displaced them in laptops and consumer devices. HDDs hold on in capacity-tier datacenter storage, where price per byte is still the deciding factor.