Academy Computer Science Memory and storage

Paper 1 · J277/01 · unit 1.2

Memory and storage

RAM, ROM, virtual memory, HDD/SSD/optical, units, binary/hex, images, sound, and compression. Practice conversions and a self-check quiz — all open.

Everything on this course is open. Skip, jump, retry. Nothing is locked and there is no required order.

Where data lives while a program runs, where it lives when the power is off, how we measure it, how we encode numbers/text/images/sound, and how we squash files. Open any heading.

1.2.1 Primary storage

Primary storage is memory the CPU can use directly as it runs: mainly RAM, ROM, and (in the spec’s model) virtual memory. Cache was in 1.1 — still primary-ish, but questions here want RAM/ROM/virtual.

RAM

  • Random Access Memory — currently running programs and the data they are using
  • Volatile: contents lost when power is off
  • More RAM → more programs/data in fast memory → less need to shuffle to disk

ROM

  • Read-Only Memory (today often flash that acts as ROM at boot)
  • Non-volatile
  • Typical use: bootstrap / BIOS / firmware — the first instructions that start the machine

RAM vs ROM in one table

RAM ROM
Volatile? Yes No
Typical contents Running programs, working data Boot / firmware
CPU write during normal use? Constantly Not in normal operation

Virtual memory

When RAM is full, the OS moves inactive pages of RAM out to a reserved area of secondary storage (the page file / swap). That area is virtual memory.

  • Lets you run more than physical RAM would allow
  • Much slower than RAM — too much swapping is thrashing (the machine crawls)

Need: RAM is full → move idle data to disk → free RAM for what is active → if that data is needed again, page it back in.

1.2.2 Secondary storage

Non-volatile storage for files, the OS, and anything that must survive a power-off. Three technologies:

Type How it stores bits Examples Typical traits
Magnetic Magnetised regions on spinning platters HDD, magnetic tape Cheap per GB, slower, moving parts, decent durability if not dropped
Solid state Flash cells, no moving parts SSD, USB stick, SD card Fast, shock-resistant, more expensive per GB, limited write cycles (still fine for normal use)
Optical Pits and lands, laser CD, DVD, Blu-ray Cheap removable discs, slow, easy to scratch, falling out of everyday use

Choosing storage (the exam pattern)

Give the need, then characteristics: capacity, speed, portability, durability, reliability, cost.

Example: a photographer’s working drive in a backpack → SSD (durable, fast, portable) not a spinning HDD; archive of 20 years of RAW files → high-capacity HDD or tape (cost per GB).

1.2.3 Units

Name Size
Bit 0 or 1
Nibble 4 bits
Byte 8 bits
Kilobyte (KB) 1,024 bytes
Megabyte (MB) 1,024 KB
Gigabyte (GB) 1,024 MB
Terabyte (TB) 1,024 GB
Petabyte (PB) 1,024 TB

OCR GCSE uses 1,024 (binary prefixes) unless the question says otherwise. Show every conversion step. No calculator in the exam.

A file size question is usually: how many bits in total, then divide down to the asked unit.

1.2.4 Data storage

Four encodings. This is the fattest spec point on Paper 1 — sit with it.

Numbers — binary, denary, hex

Denary is base 10 (what you count in). Binary is base 2. Place values for 8-bit:

128 64 32 16 8 4 2 1

Example: 01001101

64+8+4+1 = 77 denary.

Hexadecimal is base 16: digits 0–9 then A–F (10–15). One hex digit = one nibble (4 bits). Two hex digits = one byte.

0100 11014D hex.

Why hex? Shorter for humans than binary; easy to convert (groups of 4 bits); used for colours, memory addresses, MAC addresses.

Binary addition and overflow

Add bit by bit, right to left, like denary, carrying when 1+1=10.

If the result does not fit in the bits you have, that is overflow — the extra 1 has nowhere to live. In 8-bit unsigned, 255+1 overflows.

Binary shifts

  • Left shift of 1 place ≈ multiply by 2 (if no bits fall off)
  • Right shift of 1 place ≈ divide by 2, lose the remainder (integer)

Shifts are fast. Bits that fall off the end are gone.

Characters

  • ASCII: 7-bit original (0–127). Enough for English letters, digits, punctuation
  • Extended ASCII: 8-bit (0–255)
  • Each character is a code'A' is 65, 'a' is 97. The difference is 32 — useful for case tricks
  • Unicode covers many languages and symbols; common encodings include UTF-8. Needs more bits per character for many symbols

Images

A bitmap is a grid of pixels.

  • Colour depth (bits per pixel): 1-bit = two colours (mono); 8-bit = 256 colours; 24-bit = ~16.7 million (8 bits each for R, G, B)
  • Resolution: width × height in pixels
  • File size (bits)width × height × colour depth (uncompressed). Then convert to bytes / KB / MB
  • Metadata: extra data about the image — height, width, colour depth, GPS, camera settings — not the pixels themselves

Sound

Analogue sound is sampled:

  • Sample rate: samples per second (Hz). CDs use 44,100 Hz
  • Bit depth (sample resolution): bits per sample. More bits → more accurate amplitude
  • Duration in seconds
  • Channels: 1 = mono, 2 = stereo

File size (bits)sample rate × bit depth × duration × channels (uncompressed).

Higher sample rate / bit depth → better quality, larger file.

1.2.5 Compression

Why compress? Smaller files → less storage, faster transmission, cheaper bandwidth.

Lossy Lossless
Data thrown away? Yes — cannot get the original bits back No — reconstruct the original exactly
Typical uses JPEG photos, MP3 / AAC audio, many videos PNG, ZIP, FLAC, GIF (usually), documents you must not corrupt
Quality Lower (often “good enough”) Original

Lossy exploits what humans barely notice (quiet frequencies, tiny colour differences). Lossless exploits patterns (repeated bytes, dictionaries).

Do not ZIP a JPEG and call it lossless-of-the-photo — the JPEG already lost data; ZIP just packs the already-lossy file.


Exercises and quiz are below. Jump into binary first if 1.2.4 is the gap.

Practice · optional · answers on this page

Exercises

Do as many or as few as you like, in any order. Hints and a model answer sit under each task.

1.2.1 · e1 paper

RAM, ROM, or virtual memory?

Which kind of primary storage, and why? 1. Holds the first instructions used when the computer is switched on. 2. Holds the document you are typing right now. 3. Uses part of the hard disk when RAM is full. 4. Loses its contents when you pull the plug.
Hint
Volatile = RAM. Boot firmware = ROM. Disk pretending to be extra RAM = virtual memory.
Show a model answer
1. ROM — non-volatile bootstrap/firmware 2. RAM — working data for running programs 3. Virtual memory — overflow onto secondary storage 4. RAM — volatile
1.2.2 · e2 paper

Pick a drive

Recommend magnetic, solid state, or optical, with two characteristics: 1. OS drive in a thin laptop that gets thrown in a bag 2. Backing up 8 TB of CCTV overnight, cheapest per GB 3. Handing a film to a festival that still wants a disc
Hint
Durability and speed vs cost vs removable standard.
Show a model answer
1. SSD — portable, no moving parts (durable in a bag), fast boot 2. Magnetic HDD (or tape) — high capacity, low cost per GB, speed less critical 3. Optical (Blu-ray/DVD) — cheap removable, widely accepted, even if slower
1.2.3 · e3 paper

Convert without a calculator

Show working. 1. How many bits in 4 KB? (use 1 KB = 1024 bytes) 2. A file is 3,145,728 bytes. How many MB is that? 3. How many nibbles in one byte?
Hint
4 KB = 4 × 1024 bytes, each byte 8 bits. 1024 × 1024 = 1,048,576 bytes in a MB.
Show a model answer
1. 4 × 1024 = 4096 bytes; × 8 = 32,768 bits 2. 3,145,728 ÷ 1,024 = 3,072 KB; ÷ 1,024 = 3 MB 3. 2 nibbles (4 bits + 4 bits)
1.2.4 · e4 paper

Binary, denary, hex

1. Convert 10110100 to denary. 2. Convert 45 denary to 8-bit binary. 3. Convert 10110100 to hex. 4. Add 00001111 + 00000001 in 8-bit binary. 5. Left-shift 00001101 by one place. What denary was it, and what is it now?
Hint
Place values 128 64 32 16 8 4 2 1. Hex groups of 4 bits. Left shift ×2.
Show a model answer
1. 128+32+16+4 = 180 2. 32+8+4+1 = 45 → 00101101 3. 1011 0100 → B 4 → B4 4. 00010000 5. 00001101 = 13; left shift → 00011010 = 26
1.2.4 · e5 paper

Image and sound sizes

Uncompressed. Show working. Give answers in MB to 2 decimal places if needed (or leave as exact fractions of 1024). 1. Bitmap 800 × 600, colour depth 24 bits. Size in MB. 2. Mono sound, 44,100 Hz, 16-bit samples, 10 seconds. Size in MB.
Hint
Image bits = w × h × depth. Sound bits = rate × depth × time × channels.
Show a model answer
1. 800 × 600 × 24 = 11,520,000 bits ÷ 8 = 1,440,000 bytes ÷ 1024 = 1,406.25 KB ÷ 1024 ≈ 1.37 MB 2. 44100 × 16 × 10 × 1 = 7,056,000 bits ÷ 8 = 882,000 bytes ÷ 1024 ≈ 861.33 KB ÷ 1024 ≈ 0.84 MB
1.2.5 · e6 think

Lossy or lossless?

Pick one and say why. 1. Streaming a pop song on a phone data plan 2. A contract PDF a solicitor must not alter 3. A screenshot of a Python error you need to read later 4. Holiday photos for social media
Hint
If you cannot afford to lose exact bits, lossless. If ears/eyes will not notice, lossy is allowed.
Show a model answer
1. Lossy (MP3/AAC) — smaller, good-enough audio 2. Lossless — exact original required 3. Lossless (PNG) — sharp text; JPEG would blur the code 4. Lossy (JPEG) — small files, acceptable quality

Check yourself · not a gateway

Quiz

Mark it, reveal it, or skip it. A low score does not close anything. Try again as often as you want.

1 1.2.1 Why is RAM described as volatile?
2 1.2.1 Virtual memory is used when…
3 1.2.2 Which secondary storage typically has no moving parts and is most shock-resistant?
4 1.2.3 How many bits are in a byte? (number only)
5 1.2.4 What denary value is the binary number 00010110?
6 1.2.4 A left shift of one place on a binary integer (with no overflow) is equivalent to…
7 1.2.4 Uncompressed bitmap file size in bits is…
8 1.2.5 Which statement about lossy compression is true?
9 1.2.4 Which of these are reasons hexadecimal is used? (Select all that apply)