OCR J277 · 1.2.1 Computer Systems

Primary Storage & Memory

RAM, ROM, cache and virtual memory — Mr Brown

RAM — Random Access Memory

The computer's working memory. Whatever you're actively doing right now - the programs open, the tab you're reading, the game you're playing - is sitting in RAM so the CPU can reach it instantly. It can be read and written to by the CPU. The more RAM you have, the more programs can run smoothly (multi-tasking).

Volatile Read & write Holds running programs Typically several GB
Interactive Demo

Power Cut!

RAM is volatile — it needs constant power to hold data. ROM is non-volatile. See it for yourself:

RAM
ROM
Boot Firmware
BIOS Settings

Both are powered up and holding data.

ROM

ROM — Read-Only Memory

Before an operating system exists for the computer to use, something has to tell the CPU what to do the instant the power button is pressed. That's ROM's job. It is non-volatile and read-only . It holds the vital start up instructions.

Non-volatile Read-only Stores firmware / BIOS Fixed at manufacture
Interactive Demo

Why ROM Has to Go First

You don't need to know a detailed boot process — just the big picture of why ROM exists. Click these three stages into the right order:

Your order: —

Cache

A tiny area of memory built onboard the CPU. It's far faster to access than RAM, so keeping the CPU's frequently used instructions and data there cuts out a lot of waiting around. Cache reduces how often the CPU has to wait on the comparatively slow to access RAM. A bigger cache generally means more hits — but cache is expensive, so it's always kept small.

Fastest access speeds Very small capacity Most expensive per byte
CacheRAMVirtual Memory
Access SpeedFastestFastSlowest
CapacitySmallestMediumLargest
Cost per byteHighestModerateLowest
Interactive Demo

Cache Hit or Miss?

The CPU asks for 10 pieces of data, one at a time. In this demo, cache can only hold 3 at once. Step through each request and watch what the CPU has to do to get the data.

Click "Next Request" to begin

Cache contents (checked first):

Click "Next Request" to begin.

Cache Hits

0

RAM Fetches (Misses)

0

Total time spent fetching data so far:

With cache
0
Without cache
0

Using cache saved 0 time units so far.

Virtual Memory

When RAM fills up, the operating system borrows space on secondary storage as overflow — swapping data between the two as needed. Acess speeds are slower, but it keeps everything running. Paging is the process of swapping out of RAM or back in again. This takes time and too much of it causes disk thrashing .

Used when RAM is full Lives on secondary storage Slower access speed than RAM Paging in / paging out
Interactive Game

Memory Manager

In this demo, RAM holds 12 units. If a new or returning program doesn't fit, you choose what to page out to make room.

Click "Next Arrival" to start the simulation.
🧠 RAM — fast, limited to 12 units
💽 Secondary Storage — slower, used as virtual memory overflow

Total Time Cost

0

Paged Out

0

Paged In

0

Memory Challenges

A mix of styles — sorting, true/false, "which memory?", quick-fire questions, and ordering the hierarchy.

Complete

0

Points

0
Challenge

Loading challenge…