Input, process, output… and storage
Every computer, from a phone to a washing machine, does the same four jobs. Learn these four words first. Everything else in computing hangs on them.
Input: information goes in. You press a key. A microphone hears a sound. A sensor measures the temperature.
Process: the computer follows instructions to change that information. It adds numbers. It moves a game character. It decides what to do next.
Output: a result comes out. Letters on a screen. Sound from a speaker. A motor turning.
Storage: most computers also keep information to use later. Your photos, your saved game, the program itself.
The IPO sorter
Tap a device, then tap the box it belongs in. (On a computer you can also drag it.) Each one tells you why.
Pick a device to start.
A washing machine is a computer too. Input: the dial and the door sensor. Process: choose a wash plan. Output: the drum turns and water flows. Storage: the wash programs, kept in a memory chip.
Ask one question about any part: which way does the information go? Into the computer = input. Out of it = output. Changed inside = process. Kept for later = storage.
Why electricity?
A computer has to change information very fast. Electricity moves almost instantly, and it can be switched on and off billions of times a second.
It is fast. A signal in a wire travels at about two-thirds of the speed of light. That is about 20 cm in one billionth of a second.
It is easy to switch. You can turn a current on and off with no moving parts.
Electricity can control electricity. One switch can flip another switch. That lets switches be chained together into bigger machines (Step 6).
It is easy to send and to keep. Wires carry it anywhere. Tiny stores of charge can hold it (that is how memory chips work).
People did build computers from other things first. Every new kind of switch made computers thousands of times faster.
| The switch | Example machine | Roughly how fast |
|---|---|---|
| Gears and levers | Babbage's Analytical Engine (designed 1837, never finished) | about 1 addition a second (planned) |
| Relays (switches moved by magnets: they click) | Harvard Mark I (1944) | about 3 additions a second |
| Vacuum tubes ("valves": glass bulbs) | ENIAC (1945) | 5,000 additions a second |
| Transistors (no moving parts) | Any phone today | billions of instructions a second |
A 3 GHz processor ticks 3 billion times a second. In one tick, light travels only about 10 cm. This is one reason chips are so small: signals have to get across them in time.
Why not use light? We do, for long distances: fibre-optic cables carry the internet as flashes of light. But light is hard to store and hard to use to switch other light. Electricity does all of the jobs, so it runs the inside of the computer.
A switch has two states: why only two?
A light switch is either on or off. There is no half-on. A switch remembers one choice between two options. That is the whole trick of computing.
But a wire could carry many different voltages, not just two. So why not use 10 levels, one for each digit 0 to 9? Because real electricity wobbles.
Electricity is never perfectly steady. Heat, nearby wires, and long distances all add small random wobbles, called noise.
With 10 levels on a 0 to 5 volt wire, the levels are only about 0.56 V apart. A wobble of just 0.28 V pushes a 6 closer to a 5 or a 7. Misread.
With 2 levels, we only ask: is it above or below halfway (2.5 V)? The signal can wobble by almost 2.5 V and still be read right.
Two states are also the simplest part to build, and they match yes/no and true/false perfectly.
The noisy wire
Each wire sends 16 values. Drag the slider to add wobble. Watch which wire starts to make mistakes first.
Computers use two states because they are reliable: easy to tell apart even when the signal wobbles. Not because two is "simpler maths", and not because computers "can't count to ten".
Naming the two states: 0 and 1
We need short names for the two states. We call them 0 and 1. One switch, holding a 0 or a 1, is one bit.
| State | We write | Can also mean |
|---|---|---|
| Off (low voltage, near 0 V) | 0 | No, False |
| On (voltage present, e.g. 5 V or 1 V) | 1 | Yes, True |
Whenever you see a 0 or a 1 in computing, picture one tiny switch, off or on.
0 does not mean "nothing" or "broken". 0 is a real state that carries information, just like 1. "The light is off" is useful information.
Modern chips use low voltages to save power, often about 1 volt for a 1. The name stays the same: low = 0, high = 1. The exact voltage does not matter, only which side of the threshold it is on.
Transistors: the real switches
Computers use transistors. A transistor is a switch with no moving parts. A small voltage on one wire decides if current flows through two others.
| Water tap | Transistor |
|---|---|
| Handle | Gate: the control wire |
| Water | Electric current |
| Pipe in, pipe out | The other two legs (called source and drain) |
| Your hand turns the handle | Electricity sets the gate: so one transistor can control another |
A modern processor has billions of transistors on a piece of silicon the size of a fingernail. Each one is only a few dozen atoms wide in places.
Why "no moving parts" matters. A relay physically clicks a metal arm. That is slow, noisy and wears out. A transistor just changes what the silicon lets through. So it can switch billions of times a second for years.
From switches to logic to maths
Electricity controls transistors, so one transistor can switch another. Chains of switches can make decisions. Decisions, put together, can do maths.
Two switches make a decision
That is the first rung of a ladder. Each rung is built from the one below it.
How switches add: 1 + 1
Adding two bits has only four cases. Look at the two answer columns. The carry is 1 only when A and B are both 1: that is exactly the series circuit above. The sum is 1 when exactly one is 1: another gate, called XOR.
| A | B | A + B in denary | carry | sum |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 2 | 1 | 0 |
1 + 1 = 2, and 2 in binary is 10: carry 1, sum 0. So an AND gate and an XOR gate together can add. That pair is called a half adder. Year 9 builds it.
Hardware and software
A computer is two different kinds of thing working together: the parts you can touch, and the instructions that tell those parts what to do.
- Hardware = the physical parts you can touch: chips, wires, screen, keyboard.
- Software = the instructions (programs) that tell the hardware what to do. Stored as 0s and 1s.
Hardware is a piano. Software is the sheet music. The piano only does something useful when it gets music. The same piano can play thousands of different pieces, just like the same phone can run thousands of apps.
| Thing | Hardware or software? | Test: can you touch it? |
|---|---|---|
| Keyboard | Hardware | Yes |
| A game you download | Software | No: it's instructions stored as 0s and 1s |
| The memory chip the game is saved on | Hardware | Yes |
| Windows / Android | Software | No |
| Scratch | Software | No |
Software is not "nowhere". It is stored as patterns of bits on hardware: on a memory chip or a disk. You can touch the chip, but not the program. Like a book: you can touch the paper, not the story.
Embedded and general-purpose computers
Most computers in the world are not laptops or phones. They are hidden inside other things, doing one job. These are embedded systems.
| Embedded | General-purpose | |
|---|---|---|
| Job | One job, the same every day | Any job: install new programs |
| Program | Fixed, in firmware | You add and remove apps |
| Size and power | Small, cheap, low power | Bigger, more powerful |
| Examples | Washing machine, microwave, car engine control, traffic lights, smart speaker's sensors | Laptop, desktop, phone, tablet |
Washing machine: embedded. One job, fixed program. Car: full of embedded computers, often 50 to over 100 of them: engine, brakes (ABS), airbags, windows. Phone: general-purpose, because you can install any app. But even a phone has small embedded chips inside, for example to control the battery charging.
Why not put a full computer in everything? Cost, power and safety. A microcontroller costs very little and can run for years on a battery. And a brake controller that only does braking can't be broken by a bad app.
The stored-program idea: programs are data too
Early computers were programmed by rewiring them. The big idea that made modern computers: keep the program in the same memory as the data, as 0s and 1s.
Run a tiny stored program
Memory holds 4 instructions and 2 numbers. In each instruction, the first 4 bits say what to do and the last 4 say which cell. Press Next to let the CPU run it.
Why does this matter so much? Because a program is just data, a computer can: load a new program in a moment (downloading an app); keep many programs on one disk; and even run programs that write other programs (translators and compilers, Year 8). The flip side: malware is also "just data" that sneaks in and gets run.
John von Neumann described this design in 1945, so it is often called the von Neumann design. On 21 June 1948 the "Manchester Baby" at the University of Manchester became the first computer to run a program stored in its own memory.
A short history: the switch got smaller
The story of computers is mostly the story of the switch getting smaller, faster and cheaper. Gears, then valves, then transistors, then whole circuits on one chip.
1837, Charles Babbage designs the Analytical Engine: a steam-powered computer of gears with a "store" (memory) and a "mill" (processor). It was never finished.
1843, Ada Lovelace publishes steps for the Engine to work out Bernoulli numbers. It is often called the first computer program. She also saw that such a machine could work with music and symbols, not just numbers.
1936, Alan Turing describes, on paper, a "universal machine" that can do any calculation if given the right instructions. In the war he helped break codes at Bletchley Park.
1945, ENIAC (USA): 17,468 vacuum tubes, about 30 tonnes, filling a large room. Programmed by rewiring.
1947, the transistor is invented at Bell Labs (Bardeen, Brattain and Shockley). Smaller, cooler and more reliable than a vacuum tube.
1958, the integrated circuit (Jack Kilby; Robert Noyce in 1959): many transistors and wires made together on one slice of material. A "chip".
1971, the microprocessor: the Intel 4004 puts a whole processor on one chip, with about 2,300 transistors.
2007, the iPhone makes the touchscreen smartphone mainstream (earlier smartphones existed, such as IBM's Simon in 1994). A general-purpose computer in your pocket.
Why did chips get so powerful so fast? In 1965 Gordon Moore noticed the number of transistors on a chip was doubling regularly; later he said about every two years. That is called Moore's law. Check it by hand: 2,300 transistors in 1971. 50 years = 25 doublings. 2,300 × 2²⁵ ≈ 77 billion. Real big chips in the early 2020s had about 50 to 100 billion. Close!
Build it: a switch and a light
Now make a real switch control a real light, in Tinkercad Circuits. First press the button by hand. Then let the Arduino flip the switch for you.
Why does the LED need a resistor?
An LED is not like a bulb. Below about 2 volts, almost no current flows. Above it, the current shoots up. Nothing inside the LED stops it. So something outside must limit the current: the resistor.
By hand: the resistor for a red LED
Supply voltage Vs: the Arduino pin gives 5 V.
LED voltage Vf: a red LED uses about 2 V. (Blue and white use about 3 V.)
What's left for the resistor: 5 − 2 = 3 V.
The current you want: 20 mA. Milli means thousandths, so 20 ÷ 1000 = 0.02 A.
Divide: R = 3 ÷ 0.02. Dividing by 0.02 is hard, so multiply top and bottom by 100: 300 ÷ 2 = 150 Ω.
Check with the kit's 220 Ω: current = 3 ÷ 220 ≈ 0.0136 A = 13.6 mA. Less than 20 mA, so a little dimmer but safer. That's why kits use 220 Ω.
Pick a resistor
Red LED (2 V) on a 5 V pin, so 3 V is left for the resistor. Try each size.
Common mix-ups
These are the ideas almost everyone gets wrong at first. Read the left side, then the right.
A computer is a laptop or a desktop.
Anything that does input, process, output by following stored instructions. Washing machines, cars and traffic lights all contain computers.
Computers use binary because it's the simplest maths, or because they "can't count to 10".
Two states are reliable: easy to tell apart when the signal wobbles. And a two-state switch is the simplest part to build.
0 means nothing, empty or broken.
0 is a state (low voltage) and carries information, just like 1.
The monitor is the computer.
The monitor is an output device. The processing happens in the CPU, inside the box or the laptop base.
Software isn't stored anywhere physical.
Software is stored as bits on hardware (a chip or disk). You just can't touch the instructions themselves.
Transistors are tiny switches with little moving arms.
Transistors have no moving parts. A voltage on the gate changes what the silicon lets through.
Memory and storage are the same thing.
RAM is short-term working memory and is volatile: it forgets when the power goes off. Storage (SSD, hard disk) keeps files with no power.
An LED can go straight onto a battery or a pin.
Without a resistor, nothing limits the current. The LED burns out. Always use a resistor (220 Ω in the kit).
Check yourself
Quick questions first. Then endless practice: a wrong answer shows you the working, step by step.