← Back to subjects
0
OCR GCSE Computer Science (J277) · Memory & storage
Mini-Lesson

Memory & storage

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.

memory & storage number systems data representation computers store everything as binary — 1s and 0s

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:

1 nibble = 4 bits · 1 byte = 8 bits1 KB = 1000 bytes · 1 MB = 1000 KB · 1 GB = 1000 MB · 1 TB = 1000 GB · 1 PB = 1000 TB

OCR uses the decimal (×1000) convention. To work out how many bits/bytes a file needs, multiply the number of items by the size of each item.

Worked example

A file has 2000 bytes. In kilobytes: 2000 ÷ 1000 = 2 KB.

Remember: nibble = 4 bits, byte = 8 bits. Going up a unit you divide by 1000; going down you multiply by 1000.

Calculate

Your turn — bytes to KB

1A text file is 5000 bytes. How large is it in kilobytes (KB)? (1 KB = 1000 bytes)
KB
Hint: 5000 ÷ 1000.
Calculate

Your turn — image capacity

2An image is 100 pixels wide and 100 pixels tall, using 3 bytes per pixel. What is its file size in bytes? (ignore headers)
bytes
Hint: total pixels = 100 × 100 = 10000, then × 3 bytes.
Number systems

Binary, denary & hexadecimal

Computers use binary (base 2). Humans use denary (base 10). Hexadecimal (base 16) is a shorthand for binary — one hex digit = 4 bits (a nibble).

1286432168421 8-bit place values — add the columns with a 1
To convert binary → denary, add the place values where there is a 1.
Worked example — binary to denary

0011 0101 = 32 + 16 + 4 + 1 = 53

Denary to hex

53 = 0011 0101 → split into nibbles 0011 (3) and 0101 (5) → hex 35.

Hex digits: 0–9 then A=10, B=11, C=12, D=13, E=14, F=15. One hex digit ↔ one nibble (4 bits).

Convert

Your turn — binary to denary

3Convert the 8-bit binary number 0100 1010 to denary.
in denary
Hint: 64 + 8 + 2. (place values 128 64 32 16 8 4 2 1)
Convert

Denary to hex

?What is the denary number 200 in hexadecimal? (200 = 1100 1000 in binary)
Binary arithmetic & shifts

Binary addition & shifts

You must be able to add two 8-bit binary numbers and perform binary shifts.

  • Addition rules: 0+0=0, 0+1=1, 1+1=10 (0 carry 1), 1+1+1=11 (1 carry 1).
  • 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)

Units: bit → nibble(4) → byte(8) → KB → MB → GB → TB (×1000)

Number systems: binary ↔ denary ↔ hex (1 hex digit = 4 bits)

Shifts: left = ×2 · right = ÷2 · overflow if > 8 bits

Data: characters (ASCII/Unicode) · images (resolution × colour depth) · sound (sample rate × bit depth)

Compression: lossy (smaller, data lost) vs lossless (rebuildable)

You've covered the whole topic. Press Finish to see your score.

🏆

Mini-lesson complete!

⭐⭐⭐

You've worked through Memory & storage for OCR GCSE Computer Science (J277). 🎉

Your stars: 0 / 0

Next: test yourself in the Evaluate stage Confidence Quiz, then lock it in with Verify.

📣 Smashed it? Share your score

Challenge a mate to beat your stars, or show a parent how you got on.

→ Back to all subjects