Primary memory comes in two families. RAM is fast, volatile working memory, built either from capacitors that must be refreshed or from flip-flops that need no refresh. ROM keeps its contents without power, and the three programmable types differ in whether, and how, they can be erased.
RAM (random access memory) is volatile, can be read and written, and holds the operating system, programs and data currently in use. ROM (read only memory) is non-volatile and holds data that must survive power-off, such as the bootstrap program and firmware. DRAM stores each bit as charge on a capacitor, which leaks, so it must be refreshed constantly; it is cheaper and denser, so it is used for main memory. SRAM stores each bit in a flip-flop, needs no refresh and has a faster access time, so it is used for cache. PROM is programmed once; EPROM is erased with ultraviolet light; EEPROM is erased electrically without removing it from the circuit.
Both are primary memory: the CPU can address them directly. The differences are about volatility, whether the contents can be changed, and what each is used for.
| RAM | ROM | |
|---|---|---|
| Volatility | Volatile: contents lost when the power is off | Non-volatile: contents kept without power |
| Access | Read and write | Read only in normal use |
| Typical contents | Parts of the operating system, programs running now and the data they use | Bootstrap (start-up) program, BIOS/firmware, fixed data for an embedded device |
| Size in a PC | Large (many GiB) | Small |
"Random access" does not mean the data is random. It means any location can be accessed directly, in the same time, without reading through the others.
Both types of RAM are volatile. They differ in how a single bit is held, and that one difference explains their speed, cost, density and use.
| DRAM (dynamic) | SRAM (static) | |
|---|---|---|
| How a bit is stored | As charge on a capacitor, with one transistor per cell | In a flip-flop made of several transistors (often six) per cell |
| Refreshing | The charge leaks, so every cell must be refreshed many times a second | No refresh needed while the power is on |
| Access time | Slower | Faster |
| Cost and density | Cheaper per bit; more bits per chip (higher capacity) | More expensive per bit; fewer bits per chip |
| Power | Uses power for the constant refreshing | Uses less power, as there is no refresh |
| Typical use | Main memory in PCs, laptops, phones and games consoles, where large capacity at low cost matters | Cache memory in the CPU, where speed matters more than size; small fast memory in some embedded devices and routers |
Both SRAM and DRAM are volatile. "Static" means no refresh is needed while powered, not that data is kept when the power is off.
Four quick checks. Each correct answer earns XP and records this skill on your profile.
Why must DRAM be refreshed?
Which type of memory is normally used for a CPU's cache?
Which statement about RAM and ROM is correct?
How is an EPROM erased?
Plain ROM has its contents fixed when the chip is manufactured. The programmable types let the contents be written after manufacture, and the last two let them be erased and written again.
| Type | How it is programmed and erased | Typical use |
|---|---|---|
| PROM (programmable ROM) | Supplied blank and written once with a special PROM writer, which blows fuses in the chip. It can never be erased or rewritten. | Firmware in a finished product that will never need changing, made in quantities too small for a custom ROM |
| EPROM (erasable PROM) | Erased by shining ultraviolet light through a quartz window, which wipes the whole chip; the chip has to be removed from the device. It can then be reprogrammed. | Developing and testing firmware, where the program is changed several times |
| EEPROM (electrically erasable PROM) | Erased and rewritten electrically while still in the circuit, so the chip does not need to be removed; individual bytes can be changed. Flash memory is a type of EEPROM that is erased in blocks. | BIOS/firmware that can be updated by the user, and settings that must be saved when a device is switched off |
EPROM and EEPROM are both reprogrammable. The mark is for how they are erased: UV light, whole chip, removed against electrically, in place, byte by byte.
Unlocks once the four checks above are done. Worth more XP, written to AS Paper 1 and Paper 2 standard.
Which is a reason for using DRAM rather than SRAM for main memory?
Which describes an SRAM memory cell?
Which feature belongs to EEPROM but not to EPROM?
A small batch of a device needs firmware that will never change after it is written. Which type of memory is most suitable?
This skill is now recorded on your profile. Keep the chain going.