RAM, ROM, Cache and Registers: What's the Difference?
Learn the difference between RAM, ROM, cache and registers for GCSE Computer Science, including what each stores, where it is used and whether it is volatile.
RAM, ROM, cache and registers all store data or instructions, but they have different jobs. RAM holds programs and data currently in use; ROM keeps essential instructions when the power is off; cache helps the CPU access frequently needed information quickly; and registers hold the values the CPU is working with right now.
| Storage | Main job | Loses contents when power is off? |
|---|---|---|
| RAM | Holds running programs and their data | Yes |
| ROM | Stores essential start-up instructions | No |
| Cache | Holds frequently used data and instructions for quick CPU access | Yes |
| Registers | Hold small pieces of data or instructions being used immediately by the CPU | Yes |
How they work together
RAM is the computerβs main memory. When you open a program, its instructions and data are loaded into RAM so the CPU can use them. RAM is volatile, which means its contents are lost when the computer is switched off.
ROM is non-volatile: it retains its contents without power. It stores instructions needed to start the computer, often called firmware. Its role is different from RAMβs: it is not where your open programs normally run.
Cache is a small, fast memory in or close to the CPU. It keeps copies of data and instructions the CPU is likely to need again, reducing the time spent fetching them from RAM. Registers are tiny storage locations inside the CPU. They hold what the CPU needs for its current operation, such as a value being calculated or an address.
For example, while a program adds two values, the program and its data may be in RAM, useful data may be copied into cache, and the CPU may put the values in registers for the addition. ROM was needed to help start the computer, not to perform that calculation.
Exam mistake to avoid: cache and registers are not other names for RAM. All three are volatile, but they have different locations and jobs.