Memory and Storage
Hardware
The two primary-storage chips you must know are and .
RAM (Random Access Memory)
RAM is that holds whatever data and instructions a running program needs right now. The CPU reads and writes RAM directly during the fetch-decode-execute cycle.
Key properties:
- . Everything stored in RAM disappears the moment power is removed.
- Read/write. The CPU can both read from and write to any RAM location.
- Fast. Much faster than any secondary storage, though slower than cache.
- Large compared to ROM. A modern PC has 8 GB to 64 GB of RAM.
When you launch a program, its instructions are copied from into RAM so the CPU can run them. When you save a file, the data is copied from RAM out to secondary storage so it survives the power being switched off.
ROM (Read-Only Memory)
ROM is primary storage that holds the very first instructions the computer needs at start-up, including the bootstrap loader and the BIOS.
Key properties:
- . Contents survive the power being turned off, which is essential because the computer needs ROM's contents in order to boot.
- Read-only. The contents are written once at the factory and (in basic ROM) cannot be changed by the running computer.
- Fast (faster than secondary storage but slower than RAM).
- Small. Only a few hundred kilobytes; just enough to hold the start-up code.
ROM contains the bootstrap: the small program that runs the moment the computer is switched on. Its job is to test the hardware, find the operating system on secondary storage, and load enough of it into RAM for the system to take over. After that point, the running computer mostly uses RAM rather than ROM.
Side-by-side
| Feature | RAM | ROM |
|---|---|---|
| Stands for | Random Access Memory | Read-Only Memory |
| Stores | Active program data and instructions | Bootstrap / BIOS / start-up instructions |
| Volatile? | Yes (lost when power is off) | No (kept when power is off) |
| Read/write? | Read and write | Read only (in basic ROM) |
| Speed | Very fast | Fast |
| Typical size | Many GB | Few hundred KB |
Common exam question
Describing RAM and explaining why a device needs ROM
Question: Describe what is meant by RAM, explain why a device such as a smartwatch needs ROM, or identify one item of data that is kept in ROM (1–2 marks).
Asked in 2 of the 17 papers. For RAM, any two of three points score: it is volatile; the CPU accesses it directly, so quickly; and it holds the data and instructions currently running. For ROM, any two from: it stores the BIOS; it stores the bootstrap loader; it holds the start-up instructions so the device can boot; it stores the firmware; it is non-volatile, so its contents are kept permanently; and it holds data and instructions that must not change. Non-volatile and unchangeable are separate points in that list, so write both rather than treating them as one idea. For the one-mark item of data stored in ROM, the BIOS or bootstrap, the firmware, or parts of the operating system are accepted.