Why does a computer have so many kinds of memory — registers, cache, RAM, SSD, hard disk? Because there's an unavoidable trade-off: memory that's lightning-fast is tiny and expensive, while memory that's huge and cheap is slow. Computers solve this with a clever arrangement called the memory hierarchy.
1The memory pyramid
Arrange memory as a pyramid. As you go up, memory gets faster, smaller and costlier per byte. As you go down, it gets slower, larger and cheaper.
The big divide is between primary memory (registers, cache, RAM — directly reachable by the CPU, mostly volatile) and secondary storage (SSD, HDD, optical — permanent, holds your files when the power is off).
- Memory hierarchy: faster + smaller + costlier at the top (registers), slower + larger + cheaper at the bottom (hard disk).
- Primary memory (registers, cache, RAM) is fast and directly used by the CPU.
- Secondary storage (SSD, HDD, optical) is permanent and holds files when power is off.
2RAM, ROM and cache
The two main types of primary memory are RAM and ROM — and the difference is a classic exam question.
| RAM | ROM | |
|---|---|---|
| Stands for | Random Access Memory | Read Only Memory |
| Volatile? | Yes — loses contents when power is off | No — keeps contents without power |
| Read/Write | Read and write | Mainly read |
| Holds | Programs & data currently in use | Start-up instructions (e.g. BIOS) |
- RAM types: SRAM (Static — faster, used for cache) and DRAM (Dynamic — slower, cheaper, used as main memory; needs constant refreshing).
- ROM types: PROM (programmed once), EPROM (erasable with UV light), EEPROM (erasable electrically).
- Cache is a small, very fast memory between the CPU and RAM (levels L1, L2, L3) that keeps frequently used data close to the CPU to avoid waiting for slower RAM.
- RAM is volatile (lost on power-off), read/write, holds programs in use; ROM is non-volatile and mainly read (e.g. BIOS).
- SRAM (fast, used for cache) vs DRAM (slower, cheaper, main memory); ROM types: PROM, EPROM, EEPROM.
- Cache (L1/L2/L3) sits between CPU and RAM, holding frequently used data to speed things up.
3Secondary storage and units of measurement
Secondary storage keeps your data permanently:
- HDD (Hard Disk Drive): magnetic, spinning platters. Cheap and high-capacity, but slower and fragile (moving parts).
- SSD (Solid-State Drive): flash memory, no moving parts. Much faster and sturdier, but costlier per GB.
- Optical: CD, DVD, Blu-ray — data read by a laser.
Units of measurement
Data size is built up from the bit (a single 0 or 1). Eight bits make one byte. From there, each step is about 1000 times bigger:
| Unit | Size |
|---|---|
| 1 Byte | 8 bits |
| Kilobyte (KB) | about 1,000 bytes |
| Megabyte (MB) | about 1,000 KB |
| Gigabyte (GB) | about 1,000 MB |
| Terabyte (TB) | about 1,000 GB |
The full ladder continues: Bit → Byte → KB → MB → GB → TB → PB → EB → ZB → YB (Petabyte, Exabyte, Zettabyte, Yottabyte).
- HDD = magnetic, cheap, high-capacity, slower (moving parts); SSD = flash, faster, sturdier, costlier.
- 8 bits = 1 byte; the ladder is Bit→Byte→KB→MB→GB→TB→PB→EB→ZB→YB.
- 1 KB = 1024 bytes exactly (2¹⁰); ~1000 is the everyday approximation.
★ Practical: sort and size
On paper:
- Place these in order from fastest to slowest: RAM, registers, hard disk, cache.
- State one difference between RAM and ROM, and one between SRAM and DRAM.
- List the units in order from smallest to largest: GB, KB, TB, MB, Byte.
- Give one advantage of an SSD over an HDD, and one advantage of an HDD over an SSD.
Ready for the chapter test?
Answer 5 questions. Score 60% or more to mark this chapter complete.
Start the test →💡 Log in to save your progress and earn the certificate.