How a Computer Works
A free 13-part course that builds a computer from one switch, then follows one tap on a dashboard through the screen, the network and the building controllers that run a building.
Start the courseAct 1: From a switch to a processor
- 1
Bits and Bytes
A light switch is one bit. Eight of them make a byte, which counts from 0 to 255, and with bytes a computer stores everything: the letter A is 65, a pixel is three bytes, and a minute of CCTV is 15 MB. Part 1 of How a Computer Works.
- 2
Logic Gates
How can one switch flip another? Part 2 builds logic gates from a lamp and two switches, then relays, then transistors: AND, OR and NOT as truth tables, why NAND alone can build every other gate, and the copper interlock that stops two chiller plant pumps running together.
- 3
Adding in Binary: the Adder and the ALU
Can gates do sums? Part 3 builds a binary adder from an XOR and an AND, adds 5 + 3 with the carry rippling across four full adders, subtracts by adding the negative, and compares two numbers by reading one bit, which is how a building controller asks whether CO2 is below 600 ppm.
- 4
Memory: Latches, Registers and RAM
An adder's answer vanishes when its inputs change, so how does a computer remember? Part 4 builds memory from gates: a latch that holds one bit, a clock and flip-flop, registers, rows picked by a decoder, and why 16 GB of RAM is about 137 billion bits that all forget when the power goes.
- 5
The Processor: Fetch, Decode, Execute
Who decides which sum comes next? Part 5 builds the fetch decode execute cycle on a toy computer: instructions stored as numbers, a program counter, decoding as plain wiring, and a jump that makes decisions, running a building's CO2 damper program one tick at a time.
Act 2: From a processor to the computer you use
- 6
Programs and the Operating System
What happens when you press the power button? Part 6 follows a laptop from its reset vector through the firmware, boot loader and kernel, then shows how an operating system loads programs, gives each its own memory and shares one processor in time slices.
- 7
The Screen: Pixels, Frames and the GPU
How does a list of numbers become a picture? Part 7 opens up a laptop screen: pixels as three bytes, the framebuffer a display controller sweeps 60 times a second, drawing as writing numbers, and why a GPU's thousands of small cores can fill 2 million pixels in time.
- 8
Clicks and Key Presses
How does a laptop know you tapped a button? Part 8 follows one tap: a keyboard's scanned grid of switches, a trackpad's movement counts, USB polling and interrupts, a pointer sum, and four subtractions that decide whether the click landed on the button.
- 9
Storage: How a Drive Keeps Files
Why does a drive remember when RAM forgets? Part 9 builds flash memory from a transistor that traps charge, then shows pages, erase blocks, the controller's map, files as lists of numbered blocks, reading into RAM by DMA, and why deleting is quick and drives wear.
- 10
Networks and Packets
How does a chart's data reach a laptop from a data centre? Part 10 follows one request: bits on Wi-Fi and Ethernet, addressed packets, routers passing them hop by hop, ports, TCP resending and reordering, and why round trips matter more than line speed.
- 11
Video and Sound
How can a 2 megabit stream rebuild 187 MB a second of pixels? Part 11 explains key frames, blocks that only say what moved, motion vectors and corrections, hardware decoders, why busy scenes need more data, and how sound becomes samples and stays in step.
Act 3: Computers that run buildings
- 12
Building Controllers: PLCs and DDC
Why don't building controllers run Windows? Part 12 opens a controller: a microcontroller, AI, AO, DI and DO points as numbers in memory, the scan cycle on a fixed beat, ladder logic drawn like relays, the watchdog that puts outputs safe, and the pumps it runs.
- 13
Capstone: Following One Click
The course capstone: follow one 2 a.m. pump reading from a current transformer through a meter, Modbus and an edge gateway to a cloud fault check, then trace the 8:05 tap back from the hit test to the chart's pixels and the CCTV clip, with every link named and timed.
Optional side readings
Background and history. Not needed to finish the course.