OCR J277 · Component 01 · §1.2 · Paper 1

§1.2 Memory and Storage

How is data stored and represented in a computer — from binary to images, and from RAM to hard drives?

All data inside a computer is ultimately stored as binary — sequences of 0s and 1s. A bit is the smallest unit; 8 bits make a byte; units scale by 1,000 from there (kilobyte → megabyte → gigabyte → terabyte → petabyte). The same binary digits can represent different things — a number, a character, part of an image — depending on context and encoding. ASCII and Unicode define how characters are encoded; image and sound files are binary sequences whose file size can be calculated from colour depth × resolution and sample rate × duration × bit depth respectively.

Memory sits in a hierarchy. Cache (tiny, very fast) feeds the CPU first; RAM (fast, volatile) holds running programs and data; secondary storage (slow, non-volatile — magnetic, optical, solid-state) holds everything else when the power is off. When RAM is full, the OS moves data to a virtual memory area on secondary storage — slower, but it prevents crashes. The choice of secondary storage type depends on the application: SSDs are fast but expensive; HDDs are slow but cheap and large; optical media (CD/DVD/Blu-ray) is portable but slow.

A 24-bit colour bitmap image has dimensions 1200 × 800 pixels. (a) Calculate the file size in bytes. (b) An audio file is recorded at 44,100 Hz, 16-bit depth, for 3 minutes. Calculate the uncompressed file size in MB. (c) Convert 11011010 from binary to denary. Convert 2D from hex to denary.

Key formulas and facts

Image file size (bits) = colour depth × height (px) × width (px)
Sound file size (bits) = sample rate (Hz) × duration (s) × bit depth
Text file size (bits) = bits per character × number of characters
Units: 1 KB = 1,000 B · 1 MB = 1,000 KB · 1 GB = 1,000 MB · 1 TB = 1,000 GB

What students must understand

Diagrams

Photograph of a RAM memory module
A RAM module. Primary storage is fast and volatile, holding running programs and their data.
Diagram of the surface of an optical disc showing pits and lands and the binary data they encode
Optical storage records data as pits and lands. Each transition between them is read as a 1.
A grid of ones and zeros shown as black and white pixels, illustrating how a bitmap image is stored in binary
A bitmap is just binary. Each pixel's colour is stored as a binary value, here 1 bit per pixel.
An analogue sound wave with sample points marked at regular time intervals
Sampling. The analogue wave is measured at regular intervals, and each sample is stored as a binary number.
The full ASCII character table with decimal and 7-bit binary codes for each character
The ASCII character set. Each character maps to a 7-bit binary code.

Diagrams: PG Online (Paul Long), OCR J277 textbook. Used under the school site licence.

Linking questions

Practice

Video Support

Craig'n'Dave — OCR J277
1.2 Memory and storage — unit playlist