Uni-Sine
Computer ScienceComputer systems

Random access memory (RAM) explained

Random access memory (RAM) is a computer's main working memory. It holds the programs and data in use right now, such as your open browser tabs and the game you are playing, so the CPU can read them quickly. RAM is volatile: everything in it is lost when the power goes off, which is why your files live on a drive instead.

What does RAM do?

When you open an app, its instructions and data are copied from the drive into RAM. The CPU then works through those instructions in the fetch, decode, execute cycle: each instruction is brought in from memory, worked out and then carried out, with results written back as it goes. Everything the CPU is working on passes through RAM, because reading straight from a drive would be far too slow.

"Random access" means the CPU can go straight to any location by its address, and every location takes about the same time to reach. That is unlike a tape, where you have to wind past everything before the part you want.

Volatile and non-volatile

Volatile memory needs power to keep its contents. RAM stores each bit as a tiny electrical charge, so when the power goes, the data goes. Non-volatile memory, such as ROM, an SSD or a hard drive, keeps its data with the power off. The AQA GCSE Computer Science specification asks you to explain both terms.

RAM vs ROM

RAMROM
Stands forRandom access memoryRead-only memory
Volatile?Yes: loses its contents without powerNo: keeps its contents without power
HoldsThe programs and data in use right nowThe start-up instructions (firmware) that run when the computer is switched on
ChangesAll the time, as programs runRarely or never in normal use
Size in a PCGigabytesMegabytes

Both are main memory: memory the CPU can reach directly. When you press the power button, the CPU runs the firmware from a chip on the motherboard, which checks the hardware and then loads the operating system from the drive into RAM.

RAM vs storage

A phone advertised with "256 GB" usually means storage, not RAM. They do different jobs. Storage keeps everything permanently, and RAM holds the part you are using, much faster. These rough read times come from the PC Components course:

MemoryTypical read timeVolatile?Size
CPU cache (L1)About 1 nanosecondYesKilobytes to tens of megabytes
RAMAbout 90 nanosecondsYesGigabytes
NVMe SSDAbout 0.1 millisecondsNoHundreds of gigabytes to terabytes
Hard driveAbout 10 millisecondsNoTerabytes

A hard drive read at 10 ms is about 110,000 times slower than a RAM read at 90 ns. Each step away from the CPU is bigger and cheaper per gigabyte, but slower. This is the memory hierarchy.

Cache: memory on the CPU

Even RAM is slow to a modern CPU. At 5 GHz a core ticks 5 billion times a second, so one 90 ns trip to RAM costs 450 ticks. The CPU keeps copies of recently used data in its cache, a small, very fast memory on the chip. Finding data there is a hit; having to go to RAM is a miss. If 95% of reads hit a 1 ns cache and the rest go to 90 ns RAM, the average read takes 0.95 × 1 + 0.05 × 90 = 5.45 ns. A bigger cache means more hits, which is why cache size is one of the three things the AQA specification says affect CPU performance, with clock speed and the number of cores.

DRAM and SRAM

  • DRAM (dynamic RAM) stores each bit as charge in a tiny capacitor, controlled by a transistor. The charge leaks away, so every cell has to be read and rewritten, called refreshing, many times a second. It is dense and cheap, so it is used for the RAM sticks in a PC.
  • SRAM (static RAM) stores each bit in a small circuit of transistors called a flip-flop, which holds its value without refreshing as long as it has power. It is faster but takes more space per bit and costs more, so it is used for CPU cache.

RAM speed and bandwidth

Desktop PCs in 2026 use DDR5 memory. A speed such as DDR5-6000 means 6,000 million transfers a second (MT/s), and each transfer moves 8 bytes. Two sticks in the right slots run in dual channel, so the CPU reads both at once and the bandwidth doubles:

\text{bandwidth}=\text{MT/s}\times8\ \text{bytes}\times\text{channels}

For DDR5-6000 in one channel: 6,000 × 8 = 48,000 MB/s, or 48 GB/s. In dual channel that becomes 96 GB/s. That is why two 16 GB sticks are usually better than one 32 GB stick: the same amount of RAM, twice the bandwidth.

Try one with a random speed, then press Mark to check it in the course:

Type the bandwidth in GB/s for a random DDR5 speed in single or dual channel (MathAnswerInput).

Press Mark to have your answer marked in the PC Components course.

What happens when RAM runs out?

If the programs you have open need more memory than you have, the operating system moves parts that are not being used right now out to the drive, and treats that space as extra memory. This is called virtual memory. It stops programs crashing, but the drive is thousands of times slower than RAM, so the computer slows down as data is swapped back and forth. Closing programs or adding RAM fixes it.

Interactive calculatorCPU SimulatorStep through fetch, decode and execute, and watch instructions and data move between memory and the CPU's registers.

Common mistakes

  • Calling storage "memory". RAM is memory; an SSD or hard drive is storage.
  • Saying RAM keeps data when switched off. It is volatile. ROM and storage are non-volatile.
  • Thinking more RAM always makes a computer faster. It helps when RAM is running out. Beyond what your programs need, extra RAM sits unused.
  • Mixing up cache and RAM. Cache is a small, faster memory on the CPU that holds copies of data from RAM.

Common questions

What is RAM in simple terms?
It is the computer's short-term working memory. It holds whatever you are using right now so the processor can get to it fast, and it is wiped when the power goes off.
What is the difference between RAM and ROM?
RAM is volatile and holds the programs and data in use, changing all the time. ROM is non-volatile and holds the start-up instructions that run when the computer is switched on.
Why is RAM called random access?
Because the processor can read any location directly by its address, in about the same time, rather than having to go through the data in order.
Is RAM volatile or non-volatile?
Volatile. Without power its contents disappear, so any work you have not saved to storage is lost when the computer turns off.
What is the difference between RAM and storage?
Storage, such as an SSD or hard drive, keeps your files permanently but is slower. RAM is much faster but smaller and loses its contents without power, so it only holds what you are using now.
What does dual channel RAM mean?
Two RAM sticks placed in the right slots so the processor reads from both at the same time. This doubles the bandwidth: DDR5-6000 goes from 48 GB/s to 96 GB/s.

Revision cards

Say the answer first, then flip the card to check it.

Where to go next

  • Solve it

    CPU Simulator

    Step through fetch, decode and execute in assembly

    Open the tool
  • Learn it

    PC Components

    CPUs, GPUs and RAM: understand what makes a computer tick

    Start the course
  • Test it

    GCSE Computer Science

    A new exam-style paper every day, with instant marking and a mark scheme

    Start today's paper
Read next
Computer Science · Computer systemsStorage devices: HDD vs SSD, magnetic and solid stateHow storage devices work: magnetic hard drives, solid state drives, SATA and NVMe, cloud storage, and how to work out load times.