Year 7 · Foundations · Part A: Storing information

What a computer is

In one line

A computer takes information in, follows instructions to change it, gives a result out, and stores things for later. It does all of this with billions of tiny on/off switches.

1

Sort any device into input, process, output or storage, and follow one real example through all four.

2

Explain why computers use electricity, and why they use only two states (0 and 1), not ten.

3

Describe a transistor as a switch, and show how two switches can make a decision.

4

Tell hardware from software, and embedded computers from general-purpose ones.

5

Explain the stored-program idea, place the big inventions on a timeline, and say why an LED needs a resistor.

Input / outputInformation going in / results coming out.
ProcessFollowing instructions to change information.
TransistorA switch with no moving parts, controlled by electricity.
HardwareThe parts you can touch.
SoftwarePrograms: instructions stored as 0s and 1s.
Embedded systemA small computer inside a device, doing one job.

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.

  1. Input: information goes in. You press a key. A microphone hears a sound. A sensor measures the temperature.

  2. Process: the computer follows instructions to change that information. It adds numbers. It moves a game character. It decides what to do next.

  3. Output: a result comes out. Letters on a screen. Sound from a speaker. A motor turning.

  4. Storage: most computers also keep information to use later. Your photos, your saved game, the program itself.

Example: you take a photo on a phone INPUT light hits thecamera sensoryou tap theshutter button PROCESS the processorturns light intonumbers, thensharpens them OUTPUT the photoappears onthe screen STORAGE saved in flashmemory for later save load back Storage talks to theprocessor both ways:in to save, out toopen the photo later.
The IPO model with storage. Arrows show which way the information travels. Blue = input, orange = process, green = output, purple = storage. These colours stay the same in the sorter below.
▶

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.

e.g.Example

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.

★Remember

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.

  1. 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.

  2. It is easy to switch. You can turn a current on and off with no moving parts.

  3. Electricity can control electricity. One switch can flip another switch. That lets switches be chained together into bigger machines (Step 6).

  4. 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 switchExample machineRoughly how fast
Gears and leversBabbage'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 todaybillions of instructions a second
e.g.Fun fact

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?

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.

Same wobble (noise) on both wires. Grey ring = what was sent. Dot = what arrived. Red dot = it landed nearer a different level, so it was misread. With 2 levels, the safety gap is huge.
  1. Electricity is never perfectly steady. Heat, nearby wires, and long distances all add small random wobbles, called noise.

  2. 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.

  3. 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.

  4. 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.

10 levels: misreads0
2 levels: misreads0
★Remember

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.

StateWe writeCan also mean
Off (low voltage, near 0 V)0No, False
On (voltage present, e.g. 5 V or 1 V)1Yes, True
★Remember

Whenever you see a 0 or a 1 in computing, picture one tiny switch, off or on.

!Watch out

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.

e.g.Example

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.

Off (0)On (1) A water tapA water tap handle shut: the valveblocks the pipe. No water. handle turned: the valvelifts. Water flows. A transistorA transistor in (+5 V) channelclosed out gate0 V in (+5 V) currentflows out gate5 V
A transistor works like a tap. The gate is the handle. Voltage on the gate opens a thin channel in the silicon, so current can flow from "in" to "out". No voltage on the gate: the channel closes.
Water tapTransistor
HandleGate: the control wire
WaterElectric current
Pipe in, pipe outThe other two legs (called source and drain)
Your hand turns the handleElectricity sets the gate: so one transistor can control another
e.g.Example

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?

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.

1 transistor = 1 switch 2 to 6 transistors = 1 logic gate a few gates = add two bits 8 adders in a chain = add two bytes thousands of gates = an ALU billions of transistors = a CPU each rung isbuilt from theone below it AND, OR, NOT does the mathsand logic runs programs
Nobody designs a CPU one transistor at a time. Engineers design a gate once, then reuse it millions of times. This idea, hiding detail in layers, is called abstraction.

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.

ABA + B in denarycarrysum
00000
01101
10101
11210
e.g.Example

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.
Youtap, type, talk Applicationsgames, browser, Scratch Operating systemWindows, Android, iOS Firmwarestart-up code in a chip HardwareCPU, memory, storage, screen softwarecan't touch it;stored as bits hardwareyou can touch it
Each layer asks the one below it to do the work. A game asks the operating system to draw on screen. The operating system asks the hardware. Year 8 opens up each layer.
e.g.Example

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.

ThingHardware or software?Test: can you touch it?
KeyboardHardwareYes
A game you downloadSoftwareNo: it's instructions stored as 0s and 1s
The memory chip the game is saved onHardwareYes
Windows / AndroidSoftwareNo
ScratchSoftwareNo
!Watch out

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.

Inside a washing machine INPUTS dial door sensor water level temperature microcontroller a tiny CPU+ memory+ one fixedprogram (firmware) OUTPUTS drum motor heater water valve display, beep The same IPO model as Step 1. The difference: the program is fixed. You can't install a game on a washing machine.
An embedded computer uses a microcontroller: CPU, memory and input/output pins on one cheap chip. The Arduino in the Tinkercad build and the micro:bit in Year 9 are both microcontrollers.
EmbeddedGeneral-purpose
JobOne job, the same every dayAny job: install new programs
ProgramFixed, in firmwareYou add and remove apps
Size and powerSmall, cheap, low powerBigger, more powerful
ExamplesWashing machine, microwave, car engine control, traffic lights, smart speaker's sensorsLaptop, desktop, phone, tablet
e.g.Three examples

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?

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.

Before (ENIAC, 1945)After (Manchester Baby, 1948) plugboard memory 75data only The program is cables.New program = rewire it by hand.That could take days. Program and data live indifferent places. one memory 0001 01000010 01010100 0110 0000 01110000 0101 programdata New program = new bits.Takes a moment.
Blue = instructions. Orange = data. In a stored-program computer they sit side by side in the same memory, in the same 0s and 1s. The CPU just reads whichever cell it is told to.
▶

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.

Next cell to read0
Working number (accumulator)–
?Why?

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.

e.g.History

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.

Colours show the kind of switch: amber = gears and ideas on paper, orange = vacuum tubes, blue = single transistors, green = many transistors on one chip.
  1. 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.

  2. 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.

  3. 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.

  4. 1945, ENIAC (USA): 17,468 vacuum tubes, about 30 tonnes, filling a large room. Programmed by rewiring.

  5. 1947, the transistor is invented at Bell Labs (Bardeen, Brattain and Shockley). Smaller, cooler and more reliable than a vacuum tube.

  6. 1958, the integrated circuit (Jack Kilby; Robert Noyce in 1959): many transistors and wires made together on one slice of material. A "chip".

  7. 1971, the microprocessor: the Intel 4004 puts a whole processor on one chip, with about 2,300 transistors.

  8. 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?

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.

voltage (V)current (mA) 0123 20 40 too much current:the LED burns out about 2 V, 20 mA:bright and safe
The LED's "knee". Past about 1.8 V, a tiny extra push gives a huge extra current. The resistor takes up the spare voltage so the LED sits at the safe green dot.
pin 135 V resistor 2 V LED GND0 V drops 5 − 2 = 3 V drops 2 V same current all the way round: 20 mA The two drops add up to the supply: 3 V + 2 V = 5 V.
The voltage "falls" in two steps on its way from 5 V to 0 V. The LED takes about 2 V (for red). The resistor must take the other 3 V.

By hand: the resistor for a red LED

  1. Supply voltage Vs: the Arduino pin gives 5 V.

  2. LED voltage Vf: a red LED uses about 2 V. (Blue and white use about 3 V.)

  3. What's left for the resistor: 5 − 2 = 3 V.

  4. The current you want: 20 mA. Milli means thousandths, so 20 ÷ 1000 = 0.02 A.

  5. Divide: R = 3 ÷ 0.02. Dividing by 0.02 is hard, so multiply top and bottom by 100: 300 ÷ 2 = 150 Ω.

  6. 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.

People think

A computer is a laptop or a desktop.

Actually

Anything that does input, process, output by following stored instructions. Washing machines, cars and traffic lights all contain computers.

People think

Computers use binary because it's the simplest maths, or because they "can't count to 10".

Actually

Two states are reliable: easy to tell apart when the signal wobbles. And a two-state switch is the simplest part to build.

People think

0 means nothing, empty or broken.

Actually

0 is a state (low voltage) and carries information, just like 1.

People think

The monitor is the computer.

Actually

The monitor is an output device. The processing happens in the CPU, inside the box or the laptop base.

People think

Software isn't stored anywhere physical.

Actually

Software is stored as bits on hardware (a chip or disk). You just can't touch the instructions themselves.

People think

Transistors are tiny switches with little moving arms.

Actually

Transistors have no moving parts. A voltage on the gate changes what the silicon lets through.

People think

Memory and storage are the same thing.

Actually

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.

People think

An LED can go straight onto a battery or a pin.

Actually

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.

[ {"q":"A microphone hearing your voice is…","o":["Input","Process","Output"],"a":0,"w":"Information is coming **in** to the computer."}, {"q":"Why do computers use 2 states instead of 10?","o":["On and off are easy to tell apart reliably","Two is the biggest number","Ten states would be too cheap"],"a":0,"w":"Wobbly signals make 10 levels easy to misread. On/off is reliable."}, {"q":"A game you download is…","o":["Hardware","Software"],"a":1,"w":"You can't touch it. It's instructions stored as 0s and 1s."}, {"q":"What controls whether current flows through a transistor?","o":["A tiny moving arm","The voltage on its gate","How hot it is"],"a":1,"w":"The gate is like a tap handle. Voltage on the gate opens the channel."}, {"q":"Two transistors in a line (series) light a lamp only when…","o":["Either gate is on","Both gates are on","Neither gate is on"],"a":1,"w":"Current must pass through both, so both must be open. That is AND."}, {"q":"Which is an embedded system?","o":["A laptop","The computer controlling a car's airbags","A tablet"],"a":1,"w":"It does one fixed job inside a bigger device."}, {"q":"The stored-program idea means…","o":["Programs are kept in the same memory as data, as bits","Programs are stored on paper","Each program needs its own computer"],"a":0,"w":"Program and data share one memory, so a new program is just new bits."}, {"q":"Why does an LED need a resistor?","o":["To make it a different colour","To limit the current so it doesn't burn out","To store electricity"],"a":1,"w":"Past about 2 V, an LED's current shoots up. The resistor takes the spare voltage."} ]