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.





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