Memory
Primary storage (also called primary memory) is memory the CPU can access directly, without going through another device. Everything the CPU is using at that moment is held here: the operating system, the sections of open programs that are in use, the data and instructions being worked on, and the start-up instructions needed to switch the computer on. Primary storage usually consists of RAM and ROM, and cache is also part of it. RAM is the main working area.
RAM holds the operating system, the active parts of running programs and the data currently in use. Complete programs and whole files are stored long-term on secondary storage, not kept in RAM permanently.
RAM is volatile: it needs power to keep its contents and loses them when the power is switched off, so restarting the computer clears RAM. This is why start-up instructions are kept in ROM instead, ready when RAM is empty.
RAM is read/write: the processor stores new values in it as well as fetching them, so its contents are constantly swapped as different tasks start and finish. Closing a program releases the room it occupied for something else to use. RAM has a much larger capacity than ROM but a smaller capacity than secondary storage.
Secondary storage keeps programs and files long-term when the power is off, but it is much slower than RAM. If the CPU worked directly from it, it would spend most of its time waiting. When you open a program or file, it is copied from secondary storage into RAM so the CPU can fetch it much faster.
| Feature | RAM | Secondary storage |
|---|---|---|
| CPU access | Direct | Not direct; copied into RAM first |
| Speed | Much faster | Much slower |
| Power off | Contents lost (volatile) | Keeps contents |
| Capacity | Smaller | Much larger |
| Holds | Operating system, active program parts, data in use | Programs and files long-term |
OCR GCSE Computer Science · Memory