This mini-lesson covers OCR J277 · 1.2 Memory and storage: RAM & ROM, virtual memory, secondary storage (magnetic, optical, solid state), units of data and capacity calculations, binary ↔ denary ↔ hex, binary arithmetic & shifts, and how characters, images & sound are represented, plus compression.
Answer the questions as you go (several are calculations) and collect ⭐ stars. Press Start when you're ready.
Primary storage · RAM & ROM
RAM and ROM
Primary storage is memory the CPU can access directly. The two main types:
RAM (Random Access Memory) — volatile (loses its contents when power is off). Holds the data, programs and OS currently in use. It is read/write.
ROM (Read Only Memory) — non-volatile (keeps its contents without power). Holds the boot program (BIOS) that starts the computer. It is read-only.
Nail it: RAM is volatile and can be written to; ROM is non-volatile and (normally) only read. When you turn a computer on, ROM boots it, then the OS is loaded into RAM.
Quick check
Which is volatile?
?A student turns off their computer and loses unsaved work. Which type of memory lost its contents because it is volatile?
Primary storage · virtual memory
Virtual memory
If the RAM becomes full, the computer can use part of the secondary storage (e.g. the hard disk) as extra, temporary memory. This is called virtual memory.
Data not currently needed is moved from RAM to virtual memory to free up RAM.
Because secondary storage is much slower than RAM, relying on virtual memory makes the computer run more slowly.
Fix: adding more physical RAM reduces the need for virtual memory and speeds the computer up.
Secondary storage · types
Secondary storage: magnetic, optical & solid state
Secondary storage holds data long term (non-volatile). Three technologies:
Magnetic (HDD, magnetic tape) — data stored as magnetised patterns on spinning platters. High capacity, cheap per GB, but slower and has moving parts that can fail.
Optical (CD, DVD, Blu-ray) — data read/written with a laser as pits and lands. Cheap and portable, but low capacity and easily scratched.
Solid state (SSD, USB flash, memory card) — data stored in flash memory with no moving parts. Fast, silent, robust, low power, but more expensive per GB.
Choosing storage: weigh up capacity, speed, portability, durability, reliability and cost per GB for the job.
Sort it
Which storage technology?
Tap a device, then tap the technology it uses.
🧲 Magnetic
💿 Optical
⚡ Solid state
Units of data
Units of data & capacity
The smallest unit is the bit (a single 1 or 0). Bits are grouped into larger units:
An overflow error happens if the result needs more than 8 bits (a carry out of the leftmost column).
A left shift by 1 place multiplies by 2; a right shift by 1 place divides by 2. Bits shifted off the end are lost; new positions are filled with 0.
Worked example — left shift
0000 0110 (6) shifted left by 2 → 0001 1000 = 24. (6 × 2 × 2 = 24)
Nail it: shift left = ×2 per place; shift right = ÷2 per place.
Calculate
Your turn — binary shift
4The binary number 0000 0101 (denary 5) is shifted left by 1 place. What is the result in denary?
in denary
Hint: a left shift of 1 multiplies by 2, so 5 × 2.
Data representation
Characters, images & sound
Everything is stored as binary. How different data is coded:
Characters — each has a binary code in a character set. ASCII uses 7 bits (128 characters); Unicode uses more bits to cover many languages & emoji.
Images — a bitmap is a grid of pixels; each pixel's colour is a binary number. Colour depth = bits per pixel; resolution = number of pixels. More of either → bigger, better-quality file.
Sound — an analogue wave is sampled at intervals. Sample rate (samples per second, Hz) and bit depth (bits per sample) both raise quality and file size.
Character codes: in ASCII the letters are in order, so if 'A' = 65 then 'C' = 67 and 'a' = 97. Higher colour depth or sample rate = more bits = larger file.
Quick check
ASCII letters
?In ASCII the capital letter 'A' has the code 65. What is the ASCII code for the capital letter 'D'?
Compression
Compression: lossy vs lossless
Compression makes a file smaller so it needs less storage and transfers faster. Two types:
Lossy — permanently removes some data (e.g. detail the ear/eye barely notices). Much smaller files, but quality is reduced and the original cannot be recovered (e.g. MP3, JPEG).
Lossless — reduces size using patterns (e.g. an index of repeats) with no loss of data; the exact original can be perfectly rebuilt (e.g. PNG, ZIP, FLAC).
Choose: use lossless when every bit matters (text, program code, archives); use lossy when small size matters more than perfect quality (streaming music/photos).
Quick check
Which compression?
?You need to email a program's source code so the recipient gets it back perfectly, with no data lost. Which compression should you use?
Match it
Match term to meaning
Tap a term on the left, then its matching description on the right.
Term
Meaning
Recap
The big ideas to know
RAM volatile / read-write · ROM non-volatile / holds boot program
Virtual memory: uses disk when RAM is full (slower)
Secondary storage: magnetic (HDD) · optical (CD/DVD) · solid state (SSD/flash)