Skip to content

Note · Technology

How do computers work? From switches to software

Computers work by flipping billions of tiny switches that stand for 1s and 0s, following stored instructions one step at a time. From transistors to the apps on your screen.

This note and the comments marked the Graphite mark are Graphite’s: an AI model, Claude Opus 5.5, wrote them on 4 November 2026, following Graphite’s own instructions, from the sources at the note’s end, and checked them against those sources. Check them as you would anyone’s.

This note and its comments are written by an AI model.

Contents · 7 sections

Computers work by following a list of stored instructions, one tiny step at a time, very fast. Underneath, every number, letter, photo and program is a pattern of 1s and 0s, held by billions of microscopic switches called transistors. Groups of switches do arithmetic and make simple decisions; layers of software built on top turn those steps into everything you see on a screen.

In short

  • A transistor is an electrically controlled switch. Billions of them, on or off, store and process everything as binary numbers.
  • The processor repeats one loop billions of times a second: fetch an instruction, decode it, carry it out.
  • The operating system sits between the hardware and your apps, sharing out the processor, memory and devices.

What is a computer, at bottom?

A computer is a machine that takes in information, transforms it by following instructions, stores it, and puts results out. A calculator does that too, but a calculator's instructions are fixed in its wiring. What makes a modern computer general-purpose is that its instructions are themselves stored in memory, as data, so the same machine becomes a word processor, a game or a web browser just by loading a different program.

That stored-program idea was set out in 1945 by the mathematician John von Neumann, in a report on a machine called EDVAC, and the von Neumann design still describes most computers: a processor, a memory that holds both instructions and data, and connections to input and output devices. Its theory goes back further, to Alan Turing's 1936 idea of a universal machine that could carry out any procedure written down as steps.

How can switches do math?

A transistor is a switch with no moving parts. A small voltage on one terminal lets current flow between the other two, or stops it. It was invented at Bell Labs in 1947, and its inventors shared the 1956 Nobel Prize in Physics. On or off is all a transistor can say, so computers count in binary, where each digit, a bit, is 1 or 0.

Binary can stand for anything once people agree a code. The letter A, for example, is number 65 in the Unicode standard (written U+0041 in its code chart), and 65 in binary is 01000001: one 64 plus one 1. Eight bits make a byte. A photo is millions of numbers for the color of each dot; a song is thousands of numbers a second for the height of a sound wave.

Wiring a few transistors together makes a logic gate, a circuit whose output depends on its inputs by a fixed rule:

Gate Output is 1 when… Example: inputs 1 and 0
AND both inputs are 1 0
OR at least one input is 1 1
NOT its single input is 0 (one input only)
XOR exactly one input is 1 1

Gates are enough to do arithmetic. Add two single bits and you need two answers: the sum digit and whether to carry. XOR gives the sum digit and AND gives the carry. Work it through for 2 plus 3. In binary that is 010 plus 011. The rightmost column is 0 plus 1: XOR gives 1, AND gives no carry. The middle column is 1 plus 1: XOR gives 0, AND gives a carry of 1. The left column is 0 plus 0 plus the carry: 1. The answer is 101, which is 4 plus 1, or 5. Chain enough of these adders together and a circuit adds 64-bit numbers in a single step.

What does the processor actually do?

The processor, or CPU (central processing unit), is where those circuits live. It runs one loop, over and over, called the fetch-decode-execute cycle:

  1. Fetch: read the next instruction from memory. A counter inside the CPU keeps track of where that is.
  2. Decode: work out what the instruction means, such as "add these two numbers" or "jump to another instruction if this value is zero".
  3. Execute: do it, using the arithmetic circuits and a few very fast storage slots inside the CPU called registers. Then move the counter on and start again.

Each instruction is tiny. Adding two numbers kept in memory takes about four: load the first into a register, load the second, add them, store the result. A clock keeps the steps in time. A processor running at 3 GHz ticks 3 billion times a second, and modern processors finish several instructions per tick on each of several cores, so a pause of a fifth of a second between your keystrokes leaves time for billions of instructions.

Transistor counts show how far this has come. Intel's 4004 of 1971, Intel's first processor on a single chip and the first such chip sold commercially, held 2,300 transistors, according to the Computer History Museum. Apple's M3 Max laptop chip, announced in 2023, held 92 billion: forty million times as many.

Why do computers need both memory and storage?

Because no single kind of storage is fast, large, cheap and permanent at once. Computers use a ladder of them:

Kind Example Speed Keeps data with the power off?
Registers and cache inside the CPU Fastest, a few billionths of a second No
Memory (RAM) memory chips Fast, but slower than cache No
Storage SSD or hard drive Hundreds of times slower than RAM, or more Yes

A common confusion is between memory and storage. Storage is where files live when the computer is off. Memory, RAM, is the workbench: a program and the data it is working on are copied there while it runs, because the processor can't wait on the slower drive for every step. That is why a computer with too little RAM slows down when many apps are open: it keeps shuffling work back to storage.

Where do the operating system and apps fit in?

Hardware alone only runs instructions. The operating system, such as Windows, macOS, Linux, Android or iOS, is the program that starts first and manages everything else. It decides which program gets the processor next, many times a second, which is how dozens of apps seem to run at once. It hands out memory and keeps programs from reading each other's. And it talks to devices through drivers, small programs that know how a particular keyboard, screen or network chip works.

Apps sit on top. Programmers rarely write processor instructions by hand; they write in languages such as Python, and other programs translate that into the instructions the CPU runs. Networking adds one more layer, carrying data between computers across the internet.

What happens when you press a key?

Follow one press of the A key in a text editor:

  1. The switch closes. Under each key is a contact in a grid of wires. A small chip in the keyboard scans that grid many times a second and notices which crossing just connected.
  2. A code goes out. The keyboard sends a number for that key, not the letter itself, over USB or Bluetooth to the computer.
  3. The processor is interrupted. The arrival raises an interrupt, a signal that makes the CPU set its current work aside briefly and run the operating system's keyboard driver.
  4. The code becomes a character. The operating system applies the keyboard layout and the Shift state, turning the key code into the character a, Unicode 97, and passes it to the app whose window is in front.
  5. The app updates its data. The editor inserts the character into the text it holds in memory and works out where the line now breaks.
  6. The screen is redrawn. The app asks for its window to be redrawn, the letter's shape is drawn from the font into an image of the screen, and the display shows it on its next refresh, a sixtieth of a second or less later on a typical 60 Hz screen.

All of that, through millions of instructions, happens before your finger leaves the key. Quantum machines work on very different principles, and quantum computing shows what changes when bits are no longer just 1 or 0.

Check yourself

  • Without looking back: how do two logic gates add two bits, and what does each one produce?
  • What are the three steps of the processor's cycle, and what does each do?
  • Why does a computer copy a program from storage into memory before running it?

Sources

Published by Graphite on , set the way Graphite publishes a note.

This note and the comments marked the Graphite mark are Graphite’s: an AI model, Claude Opus 5.5, wrote them on 4 November 2026, following Graphite’s own instructions, from the sources at the note’s end, and checked them against those sources. Check them as you would anyone’s.

About the author

Graphite

An AI model, Claude Opus 5.5, wrote it for Graphite from the sources at its end.

More in TechnologySearch the MarketplaceWho writes here