It All Starts With Electricity
At its heart, a computer is a machine that manipulates electricity. A wire either has current flowing through it, or it doesn’t. That’s it. Two states. We call them ON and OFF — or in mathematics, 1 and 0.
A single 0 or 1 is called a bit (short for binary digit) — the smallest unit of data in computing. Eight bits grouped together make one byte, which can represent 256 different values (0–255).
By combining billions of these tiny on/off switches — called transistors — computers can represent and process any kind of information imaginable. Before we see how, we need to understand the number system this makes possible.
The Binary Number System
You already know decimal — base 10. It uses ten digits (0–9) and the value of each digit depends on its position. Each position is a power of 10. Binary works identically, but uses only two digits (0 and 1) and each position is a power of 2.
Encoding Everything as Numbers
Once we can represent numbers in binary, we can represent anything — as long as we agree on a mapping. Text, images, sounds, and videos are all stored as numbers inside a computer.
ASCII maps each character to a number. The letter ‘A’ is 65 in decimal, or 01000001 in binary. Every keystroke you type is stored as a number.
Modern text uses Unicode (UTF-8), which extends ASCII to support over 140,000 characters including emojis — but the principle is identical: every character has a unique number, which is stored in binary.
Images are broken into a grid of tiny squares called pixels. Each pixel stores a colour value as a number. In the simplest case (1-bit images), each pixel is either 0 (white) or 1 (black) — like the example below. With more bits per pixel, we get more colours: an 8-bit greyscale image uses values 0–255, and a full colour image stores three values per pixel — Red, Green, Blue (0–255 each), using 24 bits per pixel.
Sound is a wave — continuous vibrations in air. To store it digitally, we sample the wave thousands of times per second, recording its amplitude (height) as a number each time. CD audio samples 44,100 times per second at 16 bits — enough to fool the human ear completely.
Higher sample rate (samples/second) and higher bit depth (bits per sample) give better audio quality — but also larger file sizes. This is the trade-off at the heart of data compression.
Transistors & Logic Gates
A transistor is a tiny electronic switch, etched into silicon. It has an input signal that controls whether electricity flows through it or not. When the input is ON (1), current flows — the switch is closed. When the input is OFF (0), no current flows — the switch is open.
The Transistor: The Building Block of All Computing
Modern CPUs contain billions of transistors, each smaller than a virus. By connecting transistors in specific arrangements, we build logic gates — circuits that perform logical operations on binary inputs (0s and 1s). These are the building blocks of all computation.
| A | B | A AND B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
| A | B | A OR B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
| A | NOT A |
|---|---|
| 0 | 1 |
| 1 | 0 |
| A | B | A XOR B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
By combining just these simple gates, we can build adders (to add numbers), multiplexers (to route data), and ultimately the entire Arithmetic Logic Unit (ALU) — the part of the CPU that does all calculations.
The CPU & Fetch–Decode–Execute
The Central Processing Unit is the chip that runs your programs. It continuously performs one cycle: fetch an instruction from memory, decode what it means, and execute it. This happens billions of times per second.
Memory & Storage
Not all storage is equal. The CPU needs data instantly, but large storage is slow. Computers use a hierarchy — faster and more expensive near the CPU, slower and cheaper further away. Storage is either volatile (data is lost when the power is turned off, like RAM) or non-volatile (data is kept permanently, like an SSD or hard drive).
When you open an application: the OS loads it from secondary storage → RAM. The CPU fetches instructions from RAM → Cache → Registers. When you save a file, data travels in the reverse direction back to secondary storage.
What about ROM? ROM (Read-Only Memory) is a separate type of non-volatile memory that stores the BIOS/UEFI firmware — the small program that runs when you first switch on your computer, before the operating system loads. Unlike RAM, ROM keeps its data when the power is off, and unlike secondary storage, it is not used for saving your files.
The Full Journey
Every operation a computer performs follows the same chain, from physics to logic:
Electricity
Physical current flows or doesn’t flow through silicon — two states: ON (1) and OFF (0).
Binary Numbers
Sequences of 1s and 0s form numbers using place value — each position is a power of 2, just as decimal uses powers of 10.
Encoding Data
We map numbers to letters (ASCII/Unicode), colours (RGB), and audio samples — everything becomes a number, and numbers become bits.
Transistors & Logic Gates
Billions of transistors act as switches. Arranged into AND, OR, NOT, XOR gates, they perform boolean operations — the atoms of all calculation.
CPU: Fetch–Decode–Execute
The CPU reads instructions from memory, interprets them using the Control Unit, and the ALU executes them — billions of times per second.
Memory Hierarchy
Programs live in secondary storage, are loaded into RAM, cached near the CPU, and processed in registers. Data flows up and down this chain constantly.