How computers work
From transistors and binary to processors, memory and software, the layers inside every computer.
01Everything is numbers
A computer stores and processes everything, text, images, music and programs, as numbers, and those numbers are stored in binary, using only the digits 0 and 1. A single binary digit is a bit. Eight bits make a byte, which can represent 256 different values.
Binary suits electronics because a circuit can reliably be in one of two states, such as a high or low voltage. Meaning comes from agreed encodings: in the Unicode standard, the number 65 represents the letter A; in an image, three bytes can represent the red, green and blue brightness of one pixel.
02Transistors and logic gates
The basic building block is the transistor, a tiny switch controlled by electricity. Invented at Bell Labs in 1947, transistors replaced bulky vacuum tubes. A modern processor contains billions of them, each only a few nanometres in its smallest features.
Transistors are combined into logic gates. An AND gate outputs 1 only if both inputs are 1; an OR gate outputs 1 if either is; a NOT gate flips its input. Remarkably, combinations of these simple gates can add numbers, compare them and store them, which is all a processor fundamentally needs.
03The processor
The central processing unit, or CPU, runs programs by repeating a simple cycle billions of times a second: fetch an instruction from memory, decode what it means, execute it, and move to the next one. Instructions are very basic, such as add two numbers, copy a value, or jump to a different instruction if a value is zero.
A clock signal keeps the steps in time, and its rate is measured in gigahertz, billions of cycles per second. Modern CPUs have several cores that run instructions in parallel, while graphics processing units contain thousands of smaller cores specialised for doing the same calculation on large amounts of data at once.
04Memory and storage
- Registers: a handful of tiny, extremely fast storage cells inside the processor itself.
- Cache: small, fast memory on or near the CPU that holds recently used data.
- RAM: main working memory, fast but volatile, so its contents vanish when power is lost.
- Storage: solid-state drives and hard disks keep data permanently but are much slower to access than RAM.
- Each step down the list is larger and cheaper per byte but slower, so computers constantly move data between levels.
05Software and the operating system
Programmers rarely write the processor's raw instructions. They write in programming languages such as Python, C or JavaScript, and compilers or interpreters translate that code into instructions the machine can run. Layers of abstraction let one line of code stand for thousands of machine steps.
The operating system, such as Windows, macOS, Linux, Android or iOS, sits between programs and hardware. It decides which program runs on the processor at each moment, gives each program its own protected memory, manages files, and provides drivers so programs can use screens, keyboards and networks without knowing the details of each device.
06A short history
Charles Babbage designed a mechanical general-purpose computer, the Analytical Engine, in the 1830s, and Ada Lovelace wrote what is often considered the first published algorithm for it. In 1936 Alan Turing described an abstract machine that could compute anything computable, laying the theoretical foundation of computer science.
The first electronic computers, such as ENIAC in 1945, filled rooms. The integrated circuit, putting many transistors on one chip, arrived around 1958 to 1959, and the microprocessor in 1971. Gordon Moore observed that the number of transistors on a chip doubled roughly every two years, a trend that held for decades and made computers vastly more powerful and cheaper.
Test yourself
What does “Bit” mean?
Which term matches this description: An electronic switch that forms the basis of digital circuits.
What does “CPU” mean?
Which term matches this description: Software that manages hardware and runs other programs.
About this guide
An original guide written for Fathomly. © 2026 Fathomly, all rights reserved. Spotted an error? Send a correction.