From bits to a real machine.
Hands-on lessons that build up the smallest useful model of a computer — starting from a single bit and ending with a working 8-bit CPU running real code. Click things, watch them change, build intuition. Friendly even if you've never written code.
Binary, "binary math," how a chip actually runs — these get a reputation for being elusive. I don't think they're hard. They're usually explained from the top down, in the abstract, and the moment where it would have clicked gets skipped. People who'd given up on binary have walked through this and now get it. That's the whole point — fill the gap, not guard it.
So it runs the other way: by hand, by doing, the smallest real version of each idea, built by you — and built AI-forward, so you can pull the full context into your assistant whenever you want to go deeper. Here's the story behind it →
Binary, by hand
5 lessons
- 01 Bits & bytes
Start with a single light. Add another, then another, until you have eight — a byte. Click your way to a feel for binary, no math required.
binary fundamentals - 02 Bigger words
Eight bits isn't always enough. Glue two bytes together — that's a word, sixteen bits, range 0 to 65,535. Plus what's actually moving on a real chip when those bits flip, and why a wider CPU gets more done per tick.
binary fundamentals words voltage - 03 Bit ops — AND, OR, XOR, NOT
Now we steer the wires. Four operations — AND, OR, XOR, NOT — are the workhorses of bit-level work. Each one has a real-world job that turns out to be the whole reason these operations exist.
binary bit-ops masks - 04 Overflow, underflow, and negative numbers
A byte can't go past 255 or below 0 — but it doesn't crash, it wraps. That same wrap is the key to a clever trick called two's complement that lets a single byte represent negative numbers, with a quirky asymmetric range that's worth understanding.
binary overflow signed twos-complement - 05 Arithmetic and shifts
Add and subtract walked bit-by-bit with carries. Why multiply costs more than add. And the two operations that are almost free — shift left doubles, shift right halves, just by sliding the wires.
binary arithmetic shifts add
How a computer works
7 lessons
- 01 Meet the CPU
Now that bits and bytes feel real, let's see how an actual chip uses them. Meet the CPU — the chip that runs the show — and watch it talk to memory through a small handful of wires.
cpu 6502 memory bus - 02 The CPU's pockets — A, X, Y, P, PC, SP
The CPU keeps a small handful of bytes inside itself — way faster to reach than going out to memory. Meet its six on-chip registers — three for working values (A, X, Y) and three for bookkeeping (P, PC, SP) — then watch a small program use them.
cpu 6502 registers instructions - 03 Where the program lives — ROM
When the CPU powered on last lesson, the program was already sitting at $CE00 waiting for it. How? Meet ROM — built like RAM in many ways, but with a fundamentally different relationship to bytes. Plus the trick the chip uses to know where to start every single time it wakes up.
cpu 6502 rom memory - 04 Talking to the world — I/O and interrupts
A computer that only talks to itself isn't very useful. Meet the I/O controller — how the keyboard, the LED on the front panel, the timer chip, and a thousand other things get onto the CPU's bus. Plus the trick that lets a peripheral pull the CPU's attention right when it needs to.
cpu 6502 io interrupts - 05 Showing it off — the display
A program that runs but never produces a picture is just a long sequence of voltage changes. The video chip takes a region of memory and turns it into something you can actually look at. It's the most demanding peripheral on the board, and the rules around talking to it are the reason "how to draw a screen" became its own engineering specialty.
cpu 6502 video display - 06 Working in parallel — co-processors
The CPU is a generalist. It can do anything, but for some kinds of work — fast multiplication, network packets, audio synthesis — it's not the best tool for the job. A co-processor is a specialist chip that does one thing extraordinarily well, and does it while the CPU is busy with something else.
cpu 6502 coprocessor parallel - 07 Today's world — Arduino, ESP32, Raspberry Pi
You now understand what a 1980s computer was made of. Forty-some years later you can buy something that runs hundreds of times faster, fits on a fingernail, and costs less than lunch. Three platforms — Arduino, ESP32, Raspberry Pi — cover most of what a hobbyist will ever need. Here's how to pick one, what each is good and bad at, and how AI changes the story.
cpu arduino esp32 raspberry-pi
The 6502, by doing
9 lessons
- 00 Meet the machine
A tiny 6502 computer — a CPU, some RAM, and a 6522 VIA (Versatile Interface Adapter) chip wired to eight LEDs — runs entirely in this page. You write assembly, it assembles and runs in your browser, and the same program runs unmodified on a real board. Start by single-stepping one instruction.
6502 assembly go6sim go6asm - 01 The registers
The 6502 has just three working registers — A, X, and Y — each one byte wide. Almost everything the chip does is shuffling bytes through them. Load them, copy between them, and watch every move in the CPU panel.
6502 assembly registers - 02 Memory and the zero page
Memory is a long shelf of byte-sized slots, each with an address. STA puts a register's byte into a slot; LDA picks one back up. The first 256 slots — the zero page — are special: shorter, faster, and where real 6502 code keeps its working variables.
6502 assembly memory zero-page - 03 The 8 LEDs are one byte
One memory address — $B000, a port on the 6522 VIA chip — is wired to eight LEDs. Store a byte there and the bits become light: a 1 lights an LED, a 0 leaves it dark. This is memory-mapped I/O, and the exact same store runs on a real lcm-32 board.
6502 assembly io via - 04 Loops and branches
A program that runs once is barely a program. INX adds one to X; BNE jumps back if the result isn't zero. Put a store, an increment, and a branch in a loop and the LEDs become a live binary counter you can watch tick.
6502 assembly loops branches - 05 Shift and mask
ASL slides every bit one position left — so a single lit LED walks across the row. Shifting is how you move bits, build masks, and multiply by two, all with one instruction. Watch one light march left and fall off the end.
6502 assembly bitwise shift - 06 Tables and indexed addressing
X and Y aren't just counters — they're index registers. LDA table,X reads the X-th byte of a table. Lay out an animation as a list of bytes and step a pointer through it; the LEDs play whatever you wrote down.
6502 assembly indexed tables - 07 Timing with the VIA Timer
A delay loop wastes the CPU and times nothing accurately. The 6522 VIA has a real hardware timer (T1) ticking on its own crystal. Arm it, then poll its flag — the count now advances on a precise beat while you learn how peripheral registers work.
6502 assembly via timer - 09 Reading the machine
Every program you write will be broken at some point — that's normal, not failure. This one is broken on purpose. Use the error panel, the disassembly, single-step, and Reset to find it, fix it, and prove it. Debugging is the actual skill.
6502 assembly debugging tools
Building things
3 lessons
- 01 An 8-bar LED meter — same idea, three languages
Take everything from the binary series and the computer series, point it at eight LEDs, and you have a working VU meter. Same logic in 6502 assembly, Arduino C, and MicroPython on an ESP32 — three languages, one byte, one little bit-trick that stays unchanged through all of them.
6502 arduino esp32 micropython - 02 Wiring an LED — active-high vs active-low
You've made eight LEDs light up from code. Now meet the hardware between the chip and the LED — what an LED actually needs to work, and why the wiring choice can flip the meaning of `1` and `0` in the byte you write.
leds electronics wiring hardware - 03 Same LEDs, new patterns — a scanner and a lookup table
The same eight LEDs, two more shapes. A Knight Rider-style scanner that bounces a single light back and forth, and the engineering tradeoff every programmer eventually meets — compute the answer, or look it up from a table?
leds scanner lookup-table tradeoffs