No magic

How a computer works — from power on and off to AI

My passion for programming began with exactly one hour of computer science lessons and an Apple ][. Since then I have often explained how a computer works. One thing I noticed: people who are otherwise very careful often give up on the computer because it seems like magic to them. It isn’t.

A computer is made of billions of tiny switches. Each knows only two states: power on or power off. This house shows, floor by floor, how texts, pictures and AI come from that.

Basement Bits and bytes Built 1703

Power on, power off

At the very bottom there are only switches: power on or off, 1 or 0.

1 of 4 Set the number 2.

Every switch that is on counts as much as the number above it. Added up, that makes a number.

Together: 64 + 1 = 65

And text? Every character has a fixed number, set out in a table called ASCII — even the space and the digits. In ASCII, 65 is the character “A”.

Why 1, 2, 4, 8 … 128?

Every new switch doubles the possibilities — that’s why it counts twice as much as its neighbour.

Every fork in the tree is a switch: left off, right on. Every path from the trunk to a tip is one number.

  1. 1 switch: 2 possibilities — off or on
  2. 2 switches: 4 possibilities
  3. 3 switches: 8 possibilities
  4. 4 switches: 16 possibilities
  5. 5 switches: 32 possibilities
  6. 8 switches: 256 possibilities — one byte
  7. 16 switches: 65,536 possibilities
  8. 32 switches: 4,294,967,296 possibilities
Learn more

Write 1 for on and 0 for off, and a row of switches becomes a number — and the number becomes a character once people agree on a table. ASCII is one such table; it has 128 characters, enough for English. For ä, é and all the world’s other scripts there is Unicode today, its big continuation, in which ä is number 228.

In 1703 Gottfried Wilhelm Leibniz described arithmetic with just two digits, 0 and 1. In 1941 Konrad Zuse’s Z3, the first working programmable computer, calculated this way — with more than 2,000 relays, switches that switch electricity.

Technical terms

Bit
one switch: 0 or 1
Byte
eight bits, enough for one ASCII character
Binary number
a number made of zeros and ones
ASCII, Unicode
the tables that say which number is which character

Sources, checked 7 October 2026:

One floor upBack to the floor plan

Ground floor Logic gates Built 1937

Switches that switch

On the ground floor, switches work together, just as in everyday life.

1 of 4

Lamp on an extension lead

The light only comes on when both the extension lead and the lamp are switched on: AND.

Turn the light on.

one after the other = AND

Light on

The dots in the wire are electrons: current only flows when the circuit is closed.

Light in the car

The light comes on when either door is open: OR.

Turn the light on.

side by side = OR

Light on

Light on the stairs

The light is on when exactly one of the two switches is flipped: EITHER–OR.

Turn the light on.

two-way switching = EITHER–OR

Light on

Now for some arithmetic

Together, two of these circuits can add up: AND shows the carry, EITHER–OR the units.

Work out 1 + 1.

1 AND 1

Carry1

1 EITHER–OR 1

Units0

1 + 1 = 2 In switch writing: 10

Learn more

Many such circuits in a row add up big numbers too; the processor in a phone has billions of switches.

In 1937, in his master’s thesis at MIT, Claude Shannon showed that switches can compute logic — with AND, OR and NOT.

Technical terms

Logic gate
a circuit such as AND, OR or NOT
XOR
exclusive or: one of the two, but not both
Half adder
the circuit that adds two bits
Transistor
the electronic switch everything is built from today

Sources, checked 7 October 2026:

One floor upBack to the floor plan

First floor Processor Built 1948

The clerk with the slips

The processor works through slips of paper like a hard-working clerk: one after another, without understanding what for.

Hand over the slips one at a time. The program adds 3 + 4.

The program
  1. Set the carry to 0 CLC
  2. Take the number 3 in hand LDA #3
  3. Add 4 ADC #4
  4. Put the result in box 20 STA $20
  5. Done BRK
In hand
7
Carry
0
Box 20
7

Finished. Box 20 now holds 7.

Learn more

The slips are only numbers too: to the processor, “LDA #3” is the sequence A9 03. Program and data sit in the same memory — that was the idea of 1948.

This is what machine code looked like on a 1977 Apple II. Its processor, a 6502, had about 3,500 switches. Today’s phone processors have billions and get through billions of slips a second.

In 1948, in Manchester, a program stored in the computer’s own memory ran for the first time — and computers still work that way today.

Technical terms

Processor (CPU)
the clerk
Machine code, instruction
the slips
Assembly language
the shorthand on the slips: LDA, ADC, STA
Register, accumulator
the hand
Memory (RAM), address
the boxes and their numbers
Carry flag
the note for the carry

Sources, checked 7 October 2026:

One floor upBack to the floor plan

Second floor Operating system Built 1956

The building manager

The operating system — Windows, Android or iOS — manages the house and keeps the keys to the camera, contacts and location.

Apps knock and ask for keys. You decide.

1 of 4

  1. The video call app would like to use the camera.

    Allow: Makes sense: no camera, no video call.

    Deny: Also fine: then people won’t see you on the call. You can change it later in the settings.

  2. The torch app would like to read your contacts.

    Allow: A torch doesn’t need your contacts. Better not to hand over this key — you can take it back in the settings.

    Deny: Good: a torch doesn’t need your contacts.

  3. The weather app would like to know where you are.

    Allow: Can make sense — for the local weather. “Only while using the app” is often enough.

    Deny: Also fine: then you type in your town yourself.

  4. A caller asks you to install a program so that they can help you.

    Install: That would be the master key: with a remote access program the caller sees and controls everything you can. Genuine companies don’t call like this — hanging up is always right here.

    Hang up: Right. Someone who calls out of the blue and wants remote access isn’t there to help.

Key rack

  • Camera in your hands
  • Contacts in your hands
  • Location in your hands
Learn more

Programs only get the keys you hand out, and every permission can be taken back in the settings.

In 1956 one of the first operating systems, GM-NAA I/O, was written for the IBM 704 mainframe.

Technical terms

Operating system
the building manager: Windows, macOS, Android, iOS
App, program
a tenant in the house
Permission
a key to the camera, contacts or location
Remote access
the master key for strangers

Sources, checked 7 October 2026:

One floor upBack to the floor plan

Third floor Programming language Built 1957

The translator

Experts write programs in a language that looks almost like English. A translator, the compiler, turns it into the slips.

Change the numbers: one line becomes four slips.

Program text

result = 3 + 4

3
4

The translator turns this into:

  1. CLC Set the carry to 0
  2. LDA #3 Take the number 3 in hand
  3. ADC #4 Add 4
  4. STA result Put the result in the box “result”

Result: 7

Learn more

Large programs consist of millions of such lines. Nobody knows them all, and because people write them, programs have mistakes.

In 1957 the first translator for FORTRAN, a programming language for formulas, was delivered. Today hardly anyone writes the slips by hand.

Technical terms

Programming language
the language experts write in, such as Python, Java or C#
Source code
the program text people write
Compiler
the translator
Variable
a box with a name, such as “result”
Bug, update
a mistake in a program and its repair

Sources, checked 7 October 2026:

One floor upBack to the floor plan

Fourth floor Internet and email Built 1969

Post between computers

Computers send each other messages like letters, emails for example. On the way, nobody checks who wrote them.

Write whatever you like as the sender and send the letter.

Please confirm your account details.

The letter travels in four packets, each by its own route.

In the recipient’s inbox

From: Your Bank <service@bank.example>

Please confirm your account details.

Learn more

On the way, every message is split into small packets and passed along through many sorting offices. Each one only looks at the address and passes it on.

This is how email has worked since 1982: the sender is a line of text that the writer fills in. Checks now catch many fakes — but not all, and anyone can choose the name that is displayed.

The exception is digitally signed email (S/MIME or PGP): when you open it, the mail program checks whether the signature matches the sender and the message is unchanged.

In 1969 a computer in Los Angeles sent the first message over the ARPANET, the forerunner of the internet. It was meant to say “LOGIN”; “LO” arrived — then the system crashed.

Technical terms

Internet
the network of sorting offices
Data packet
one part of the letter
Router
a sorting office
IP address
a computer’s house number
Email, sender (From)
the letter and its sender, which anyone can fill in
SPF, DKIM, DMARC
the checks for senders

Sources, checked 7 October 2026:

One floor upBack to the floor plan

Fifth floor Web and browser Built 1991

The shop window

A web page is a plan made of text that your browser paints. It cannot look into your computer.

Look behind the warning — and write one of your own.

A mock-up, not a real alert

https://help-now.example

WARNING!

Your computer is infected with 5 viruses.

Call support immediately!

<div class="alarm">
  <p class="head">WARNING!</p>
  <p>Your computer is infected with 5 viruses.</p>
  <p>Call support immediately!</p>
</div>
Learn more

That’s all it is: a few lines of text that your browser paints. Nobody checks whether they are true.

A web page cannot check whether there are viruses on your computer. It can only pretend — with big letters, red colour and time pressure.

In 1991 the World Wide Web was opened to everyone. Since then, browsers have been painting pages that other computers send them.

Technical terms

Browser
the program that paints the pages: Chrome, Edge, Safari, Firefox
HTML
the plan of a web page
Address (URL), domain
it shows who owns the shop window
Pop-up
a window the page paints itself

Sources, checked 7 October 2026:

One floor upBack to the floor plan

Roof Artificial intelligence Built 2017

The next word

AI is a program too: it calculates which word is likely to come next — like the word suggestions on your phone, only much bigger.

Build a sentence from the suggestions.

I’m running

Suggestions

  • a bit late 51%
  • out of time 18%
  • to the shop 9%
  • other words: 22%

The percentages here are made up to show the principle — for real probabilities, see “The die in the machine” on lostcontext.ai.

Learn more

Because it picks what sounds likely, AI writes flawlessly and convincingly — even when something isn’t true. And because a voice is only numbers too, it can imitate voices.

In 2017 the design appeared on which today’s language programs such as ChatGPT, Claude or Copilot are based. The roof is still being built.

Technical terms

Artificial intelligence (AI)
programs that learn from examples
Language model (LLM)
the AI that picks the next word
Token
a word or part of a word it calculates with
Training
learning from huge amounts of text
Hallucination
a convincing-sounding false sentence
Voice clone, deepfake
an imitated voice or picture

Sources, checked 7 October 2026:

Back to the floor plan

That’s the whole house: eight floors, all built by people — and no magic on any of them.

If you would like to practise spotting scams, Practice makes safe is a free practice ground with no sign-up and no tracking. And lostcontext.ai shows how the AI on the roof works.

An unhandled error has occurred. Reload 🗙

Rejoining the server…

Rejoin failed… trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.