Skip to content
BetterDL

Non-volatile memory

Also called: nonvolatile memory, NVM, non-volatile storage, persistent memory

Memory that keeps its contents with the power off, such as ROM, EEPROM and flash. Systems use it for start-up code and saved data.

Non-volatile memory remembers without power. Unplug it for a year and the bits are still there.

The members of the ROM family are all non-volatile:

  • Mask ROM: contents built in at the factory
  • PROM: programmed once by the user
  • EPROM: erased with ultraviolet light, then reprogrammed
  • EEPROM: erased and rewritten electrically, byte by byte
  • Flash: rewritten electrically, erased in blocks

Outside the chips in this course, magnetic disks and optical discs are non-volatile too.

Why every computer needs some: volatile RAM is empty at power-on, so the very first instructions the processor runs must come from somewhere that kept them. That start-up program, the firmware, lives in non-volatile memory.

The trade-off: rewritable non-volatile memories are slower to write than RAM, often erase in blocks, and wear out after a limited number of erase cycles. So systems work in RAM and save to non-volatile memory.

Don't equate non-volatile with read-only. Flash and EEPROM are non-volatile and writable.

Worked example

Example

Where should it go?

Choose volatile or non-volatile storage for each item.

  1. 1.

    The program a microcontroller runs the instant it powers up: non-volatile (flash or ROM).

  2. 2.

    A running total being updated a million times a second: volatile RAM.

  3. 3.

    A thermostat's user settings, which must survive a power cut: non-volatile (EEPROM or flash).

  4. 4.

    A display's frame buffer, rebuilt every frame: volatile RAM.

Common mistakes

  • Thinking non-volatile means read-only. Flash and EEPROM can be rewritten in the field.

  • Treating SRAM as non-volatile because it needs no refresh. It still forgets at power-off.

  • Assuming non-volatile memory can be rewritten without limit. Flash and EEPROM wear out after many erase cycles.

Practice Non-volatile memory

Interactive questions with instant feedback and a worked solution for every wrong answer.

Learn it step by step

Non-volatile memory is taught in Memory.