Logical Art

Interactive explanations of difficult machines.

A hole punched in card stock in 1928 and a neural network trained in a browser tab are the same idea a century apart. Everything here sits somewhere on that line, and all of it is working: every number live, every failure honest, nothing faked.

New here? Punch a card takes about a minute. Front Panel (on frontpanel.dev) is the one to sit down with.

Bit
One idea
Nibble
One mechanism in three or four stages
Byte
A complete machine you operate

99 of them open with a crash course: the least you need to know to work the thing, and what you can safely skip. It is nibbles and bytes that carry one, because a bit is already that size.

A few ways in

The list below is a chronology, which is the only order that needs no opinion. These are not a second index: each is a handful of machines from that same list, read in an order somebody chose, because at a hundred entries the relationships between machines are worth saying out loud.

  1. How memory became an illusion

    Every layer here lies about where your data is, and each one lies to cover for the layer below it.

    1. Core Memory
    2. CPU Cache
    3. Page Fault
    4. Context Switch
    5. LSM-Tree
  2. How networks survive

    Nothing in a network is reliable, so every one of these is a way of being wrong safely.

    1. Packet Switching
    2. Spanning Tree
    3. Slow Start
    4. Majority
    5. Consistent Hashing
  3. How computers catch mistakes

    From noticing that something broke, to knowing which part, to handing the missing part back.

    1. Hamming
    2. CRC
    3. Reed-Solomon
    4. Merkle Proof
  4. Why concurrency lies to you

    Each of these is the machine underneath doing something the program you wrote never asked for.

    1. Race
    2. Deadlock
    3. Compare and Swap
    4. False Sharing
    5. Spectre

And now the machines, oldest first

Every one of them is on this list, in the order they were built rather than the order that would be tidy. The controls below narrow it; nothing removes anything.

Showing 113 built

  1. 1838-1865 Bit Subject: encoding.

    Morse

    Letter frequency, turned into dots and dashes. Badly, in places.

    /bits/morse/
  2. 1876-1901 Bit Subject: encoding.

    Baudot

    What happens when every letter costs exactly five bits, however common it is?

    /bits/baudot/
  3. 1919 Bit Subject: hardware, also logic.

    Flip-Flop

    Feed a circuit its own output. What does it do now that it could not do before?

    /bits/flip-flop/
  4. 1928 Bit Subject: encoding, also storage.

    Punch Cards

    Eighty columns of holes. Everything had to fit.

    /bits/punch-cards/
  5. 1932-1939 Bit Subject: hardware, also encoding, graphics.

    Interlace

    Odd lines, then even. Freeze the picture to see the comb.

    /bits/interlace/
  6. 1933-1991 Byte Subject: hardware, also numbers.

    Rangekeeper (on rangekeeper.dev)

    The answer is on both sides of the equation, so it had to be a machine.

    rangekeeper.dev
  7. 1937 Bit Subject: logic.

    Bitwise

    Every bitwise operator is a wiring diagram. The shift is not even arithmetic.

    /bits/bitwise/
  8. 1937 Nibble Subject: logic, also numbers, hardware.

    The Adder

    Every bit adds correctly on its own. The carry is what makes it slow.

    /nibbles/adder/
  9. 1945 Bit Subject: hardware.

    Stored Program

    Instructions are numbers. They live in the same memory as the data.

    /bits/stored-program/
  10. 1945-1949 Bit Subject: numbers, also logic.

    Two's Complement

    The adder does not know whether the number is negative.

    /bits/twos-complement/
  11. 1946-1947 Nibble Subject: logic, also hardware.

    Trigger

    Why the trace stands still.

    /nibbles/trigger/
  12. 1947-1964 Bit Subject: encoding.

    Bit, Nibble, Byte

    Why a byte is eight.

    /bits/bit-nibble-byte/
  13. 1947 Bit Subject: hardware, also logic.

    Transistor

    A relay is open or closed. This one has a middle.

    /bits/transistor/
  14. 1949 Nibble Subject: encoding, also numbers.

    Sampling

    The same samples fit two different waves, and nothing in them says which one you had.

    /nibbles/sampling/
  15. 1949 Nibble Subject: numbers, also logic.

    The Middle Square

    An early way of making random numbers by arithmetic, and it dies: every seed there is falls into one of eight short cycles.

    /nibbles/middle-square/
  16. 1950s-1970s Nibble Subject: hardware, also numbers.

    Score Reel

    An electromechanical table cannot add, it can only count at the speed of a motor.

    /nibbles/score-reel/
  17. 1950 Nibble Subject: errors.

    Hamming

    Put the checks at the powers of two and the failures spell the address.

    /nibbles/hamming/
  18. 1952 Nibble Subject: compression.

    Huffman

    The two rarest symbols marry, and the tree that falls out is provably the best.

    /nibbles/huffman/
  19. 1953 Nibble Subject: hardware.

    Core Memory

    Half a current does nothing. Reading the bit is what destroys it.

    /nibbles/core-memory/
  20. 1953 Nibble Subject: storage, also encoding.

    Hash Table

    Finding the key is constant time until two keys want the same drawer.

    /nibbles/hash-table/
  21. 1954 Nibble Subject: hardware, also concurrency.

    The Interrupt

    What happens in between two instructions.

    /nibbles/interrupt/
  22. 1956 Nibble Subject: logic, also numbers, hardware.

    Carry-Lookahead Adder

    Stop waiting for the carry to ripple and work out where every carry is born.

    /nibbles/carry-lookahead/
  23. 1957 Bit Subject: graphics, also encoding.

    Raster

    How much picture fits in one bit per square? The first ones found out.

    /bits/raster/
  24. 1958 Nibble Subject: hardware, also storage.

    DMA

    The processor never copied these bytes and they arrived in memory anyway.

    /nibbles/dma/
  25. 1959 Nibble Subject: numbers, also hardware.

    CORDIC

    A sine, from nothing but shifts and adds.

    /nibbles/cordic/
  26. 1960 Nibble Subject: logic, also storage.

    The Call Stack

    Recursion spends memory that appears in no line of the source. You can work out the exact depth it dies at.

    /nibbles/call-stack/
  27. 1960 Nibble Subject: storage, also logic.

    Garbage

    Memory becomes garbage when nobody can reach it, not when somebody says it is finished.

    /nibbles/garbage/
  28. 1960 Nibble Subject: errors, also storage.

    Reed-Solomon

    Erase the bytes you can see are gone and the equations hand them back.

    /nibbles/reed-solomon/
  29. 1961 Nibble Subject: errors.

    CRC

    Divide the message by a polynomial and the remainder is what you send.

    /nibbles/crc/
  30. 1961 Nibble Subject: hardware.

    The Pipeline

    The next instruction starts before this one finishes, until it needs something that does not exist yet.

    /nibbles/pipeline/
  31. 1961 Nibble Subject: concurrency, also hardware.

    Round Robin

    Every program believes it owns the processor because none of them gets to keep it.

    /nibbles/round-robin/
  32. 1962 Nibble Subject: hardware, also storage.

    Page Fault

    The address exists even when the memory does not.

    /nibbles/page-fault/
  33. 1962 Nibble Subject: hardware, also storage.

    The TLB

    If every address must be translated, where does the translation table live?

    /nibbles/tlb/
  34. 1962 Nibble Subject: hardware, also security.

    The System Call planned

    The same instruction runs in one mode and traps in the other, and the trap is the only door.

  35. 1962 Nibble Subject: hardware, also concurrency.

    Context Switch

    Your program is stopped mid-instruction, its registers are copied somewhere, another program runs for a while, and then everything is put back so precisely that it cannot tell.

    /nibbles/context-switch/
  36. 1963-1967 Bit Subject: encoding.

    ASCII

    There was no lowercase until 1967. Then it was one bit away.

    /bits/ascii/
  37. 1964-1990s Byte Subject: encoding, also storage, logic, errors.

    Abend (on abend.dev)

    The loop nobody wrote. It cost a day.

    abend.dev
  38. 1964 Nibble Subject: numbers, also logic.

    The Shuffle

    The obvious way to shuffle a list cannot be fair, and you can prove it by counting rather than by measuring.

    /nibbles/seeded-shuffle/
  39. 1964 Nibble Subject: networks, also hardware.

    Packet Switching

    The message is cut into pieces that find their own way, so the network can route around what is gone.

    /nibbles/packet-switching/
  40. 1964-1967 Nibble Subject: hardware.

    Out of Order

    The processor reorders your instructions, runs them in an order you never wrote, and is required to produce the answer you would have got anyway. Most of the time it manages.

    /nibbles/out-of-order/
  41. 1965 Bit Subject: graphics, also numbers.

    Bresenham

    A straight line, drawn with no division and no fractions.

    /bits/bresenham/
  42. 1965-1990s Nibble Subject: hardware.

    CPU Cache

    Reading memory twice is not the same operation twice.

    /nibbles/cpu-cache/
  43. 1965 Nibble Subject: numbers.

    FFT

    Reusing a sum instead of recomputing it takes n-squared work down to n log n.

    /nibbles/fft/
  44. 1965 Nibble Subject: concurrency.

    Deadlock

    Each program is waiting for the other to release the thing it cannot release.

    /nibbles/deadlock/
  45. 1965 Nibble Subject: concurrency.

    Race

    Two increments. One of them goes missing.

    /nibbles/race/
  46. 1965 Nibble Subject: concurrency.

    The Semaphore planned

    The count is the permission, and no process has to know which other one is waiting.

  47. 1965 Nibble Subject: storage, also logic.

    Fragmentation

    There is enough free memory for the request and the request still fails.

    /nibbles/fragmentation/
  48. 1966 Nibble Subject: hardware, also numbers.

    SIMD

    One instruction, many lanes, and the speedup stops being the number of lanes the moment the data disagrees.

    /nibbles/simd/
  49. 1968 Nibble Subject: numbers.

    Fifteen Planes

    It passes every easy test. Then everything lands on fifteen planes.

    /nibbles/fifteen-planes/
  50. 1968 Nibble Subject: hardware, also storage.

    DRAM Refresh

    The bit disappears unless the machine keeps reading it and writing it back.

    /nibbles/dram-refresh/
  51. 1968 Nibble Subject: encoding, also logic.

    Regular Expressions

    The search holds every state at once, which is why it never has to go back and can never be made to take forever.

    /nibbles/regex/
  52. 1969 Nibble Subject: hardware, also storage.

    Page Replacement planned

    Giving a program more memory can make it fault more, and the obvious algorithm is where it happens.

  53. 1970 Nibble Subject: storage.

    B-tree

    A billion rows in four reads. Node width is the whole reason.

    /nibbles/b-tree/
  54. 1970 Nibble Subject: storage, also numbers.

    Bloom Filter

    No means no. Yes means maybe.

    /nibbles/bloom-filter/
  55. 1971-1995 Byte Subject: networks, also encoding.

    Line Mode (on linemode.dev)

    For a while you could telnet to port 80 and be the browser.

    linemode.dev
  56. 1971 Nibble Subject: storage.

    The Inode

    The filename is not the file.

    /nibbles/inode/
  57. 1972 Nibble Subject: hardware, also storage.

    Copy-on-Write

    Two processes share the same memory until one of them writes.

    /nibbles/copy-on-write/
  58. 1973 Nibble Subject: graphics, also hardware.

    Double Buffer

    Why the picture tears.

    /nibbles/double-buffer/
  59. 1973 Nibble Subject: hardware, also logic.

    Metastability

    Catch a flip-flop at the wrong instant and it cannot promise when it decides.

    /nibbles/metastability/
  60. 1973 Nibble Subject: security, also encoding.

    Avalanche

    Change one bit and half the answer changes.

    /nibbles/avalanche/
  61. 1973-1976 Nibble Subject: networks, also concurrency.

    Backoff

    Two machines transmit on the same wire. Both back off for a random interval.

    /nibbles/backoff/
  62. 1974 Nibble Subject: encoding, also errors.

    Checkout

    The label tells the scanner which way up it went across the glass.

    /nibbles/checkout/
  63. 1974-1981 Nibble Subject: networks, also errors.

    Sequence Numbers

    The stream arrives in order and nothing underneath it is in order.

    /nibbles/sequence-numbers/
  64. 1974 Nibble Subject: concurrency.

    Compare and Swap

    Change it only if nobody changed it since you looked.

    /nibbles/compare-and-swap/
  65. 1974 Nibble Subject: graphics, also hardware.

    Z-Buffer

    Draw the triangles in any order and every pixel still keeps the nearest one.

    /nibbles/z-buffer/
  66. 1975 Byte Subject: hardware.

    Front Panel (on frontpanel.dev)

    A working 1975 Altair 8800 you program by flipping switches.

    frontpanel.dev
  67. 1976 Nibble Subject: security, also numbers.

    Diffie-Hellman

    The secret is not among the things that crossed the wire, and everything that did is on the screen.

    /nibbles/diffie-hellman/
  68. 1976 Nibble Subject: graphics, also encoding.

    Dithering

    The error you cannot remove, pushed into the pixels next door.

    /nibbles/dithering/
  69. 1976 Nibble Subject: compression.

    Arithmetic Coding

    The whole message becomes one number in an interval that keeps shrinking.

    /nibbles/arithmetic-coding/
  70. 1977-1981 Nibble Subject: hardware, also numbers.

    Zero Address

    Assembly for a processor that was usually not there.

    /nibbles/zero-address/
  71. 1977-2018 Nibble Subject: compression, also encoding, graphics.

    Fringes

    Colour and resolution are the same currency.

    /nibbles/fringes/
  72. 1977 Nibble Subject: compression.

    LZ77

    The next bytes are a pointer into bytes you have already seen.

    /nibbles/lz77/
  73. 1978 Nibble Subject: storage, also networks.

    Two-Phase Commit

    Everyone promises before anyone acts, and one silent machine blocks them all.

    /nibbles/two-phase-commit/
  74. 1978 Nibble Subject: security.

    Signature

    How can everyone verify something only one person could have produced?

    /nibbles/signature/
  75. 1978 Nibble Subject: networks, also concurrency.

    Logical Clock

    The clocks disagree and the machines still agree which event happened first.

    /nibbles/logical-clock/
  76. 1978 Nibble Subject: storage, also concurrency.

    MVCC

    The reader never waits, because it is reading a version nobody is writing.

    /nibbles/mvcc/
  77. 1979 Nibble Subject: encoding, also compression.

    Z-Characters

    Five bits is not enough for English. Zork shifted.

    /nibbles/z-characters/
  78. 1979 Nibble Subject: security, also errors.

    Merkle Proof

    Proof that a leaf is in the tree, without being shown the tree.

    /nibbles/merkle-proof/
  79. 1979 Nibble Subject: concurrency, also hardware.

    Memory Ordering

    Both processors wrote first, and both can still read zero.

    /nibbles/memory-ordering/
  80. 1980s Byte Subject: networks, also encoding.

    300 Baud (on 300baud.dev)

    A real dial-up modem and the BBS on the other end of it.

    300baud.dev
  81. 1981-1990s Nibble Subject: hardware.

    Branch Prediction

    The processor runs an instruction before knowing whether it should exist.

    /nibbles/branch-prediction/
  82. 1981-1992 Nibble Subject: storage, also concurrency.

    Write-Ahead Log

    The database says done before half the database has been written.

    /nibbles/write-ahead-log/
  83. 1982 Nibble Subject: errors, also encoding.

    Interleave

    Scratch the disc and watch a burst come apart into single symbols.

    /nibbles/interleave/
  84. 1983 Bit Subject: hardware, also graphics.

    Eight Sprites

    Eight per scanline and the ninth is dropped, which is why they flickered.

    /bits/eight-sprites/
  85. 1983 Nibble Subject: networks.

    DNS

    Nobody knows the answer, and everybody knows who to ask next.

    /nibbles/dns/
  86. 1984-1990s Nibble Subject: hardware, also concurrency.

    False Sharing

    Two threads, two variables, nothing shared. They still fight.

    /nibbles/false-sharing/
  87. 1984 Nibble Subject: hardware, also concurrency.

    Cache Coherence

    The fourth state is free.

    /nibbles/cache-coherence/
  88. 1984-1987 Nibble Subject: compression, also encoding.

    LZW

    The dictionary is never sent. Both ends build it from the data.

    /nibbles/lzw/
  89. 1984 Nibble Subject: graphics, also encoding.

    Premultiplied Alpha

    The edge of the cut-out is wrong unless you multiply before you blend.

    /nibbles/premultiplied-alpha/
  90. 1985 Nibble Subject: numbers.

    Floating Point

    The answer is already wrong before the addition rounds it.

    /nibbles/floating-point/
  91. 1985 Nibble Subject: numbers, also logic.

    Quantum Interference

    Measured once it is fifty-fifty, and the same step twice gives one answer every time.

    /nibbles/quantum-interference/
  92. 1985 Nibble Subject: networks.

    Spanning Tree

    One spare cable and the network drowns; cut the right links and it is safe.

    /nibbles/spanning-tree/
  93. 1987-1990s Nibble Subject: storage, also hardware.

    Erase Block

    The drive cannot overwrite the page you asked it to overwrite.

    /nibbles/erase-block/
  94. 1988 Nibble Subject: networks, also concurrency.

    Slow Start

    Nobody tells TCP how fast it may send. It finds out by hurting the network.

    /nibbles/slow-start/
  95. 1988 Nibble Subject: networks, also concurrency.

    Vector Clock

    Each machine counts everyone's messages, so it can tell concurrent from caused.

    /nibbles/vector-clock/
  96. 1988 Nibble Subject: storage, also errors.

    RAID Parity

    A whole disk is gone and XOR still knows every byte that was on it.

    /nibbles/raid-parity/
  97. 1991 Nibble Subject: numbers, also errors.

    Catastrophic Cancellation planned

    Subtracting two close numbers throws away the digits you still needed.

  98. 1992-2008 Nibble Subject: security, also concurrency.

    Longest Chain

    History is whatever was most expensive to produce.

    /nibbles/longest-chain/
  99. 1992 Nibble Subject: compression, also graphics.

    JPEG

    Throw away numbers, not pixels.

    /nibbles/jpeg/
  100. 1992 Nibble Subject: encoding.

    UTF-8

    Starting to read in the middle costs a bit in every byte.

    /nibbles/utf-8/
  101. 1993 Nibble Subject: compression.

    Masking

    Put a loud tone beside a quiet one, then throw the quiet one away.

    /nibbles/masking/
  102. 1993-1995 Nibble Subject: networks.

    Longest Prefix

    Three routes match the address, and the longest one wins.

    /nibbles/longest-prefix/
  103. 1994 Byte Subject: networks.

    Winsock (on winsock.dev)

    The two seconds after the modem stopped screeching, before anything worked.

    winsock.dev
  104. 1996 Nibble Subject: storage.

    LSM-Tree

    Never change a file, write another, then keep rewriting them all.

    /nibbles/lsm-tree/
  105. 1996-1997 Nibble Subject: compression, also graphics.

    PNG Filters

    The compression happens after something else has made the bytes boring.

    /nibbles/png-filters/
  106. 1996-1999 Nibble Subject: graphics, also numbers.

    Gamma

    The numbers are not brightness, which is why the average of two of them is the wrong colour.

    /nibbles/gamma/
  107. 1997 Nibble Subject: networks, also storage.

    Consistent Hashing

    Add one more server and almost every key stays where it was.

    /nibbles/consistent-hashing/
  108. 1998 Nibble Subject: numbers.

    PageRank

    Importance defined by importance, and the circle closes if you iterate.

    /nibbles/pagerank/
  109. 2001 Nibble Subject: security, also encoding.

    AES

    Sixteen bytes go in, and every byte that comes out depends on every byte that went in.

    /nibbles/aes/
  110. 2002-2015 Nibble Subject: errors.

    Merge Collapse

    The sort in every standard library, and the invariant it did not keep.

    /nibbles/merge-collapse/
  111. 2005 Nibble Subject: storage, also security.

    Merkle DAG

    A commit holds hashes pointing at hashes, and never holds your repository.

    /nibbles/merkle-dag/
  112. 2007 Nibble Subject: numbers.

    Count Distinct

    Wrong on purpose, by an amount it knows before it starts.

    /nibbles/count-distinct/
  113. 2014 Nibble Subject: concurrency, also networks.

    Majority

    A write counts once most machines have it, and no later majority can miss it.

    /nibbles/majority/
  114. 2014 Nibble Subject: concurrency, also networks.

    Consensus planned

    One of them is elected to speak, and the decision survives losing it.

  115. 2014 Nibble Subject: security, also hardware.

    Rowhammer

    Reading one address changes a different address you never wrote.

    /nibbles/rowhammer/
  116. 2018 Nibble Subject: security, also hardware.

    Spectre

    The instruction never happened, and the cache remembers that it did.

    /nibbles/spectre/
  117. 2018 Nibble Subject: security, also networks.

    TLS Handshake

    Everybody hears the conversation that agrees the key nobody else has.

    /nibbles/tls-handshake/
  118. 2020s Byte Subject: numbers.

    LLM Lab (on watchitlearn.com)

    Train a tiny language model and watch every number as it learns.

    watchitlearn.com

Why these machines

A hole punched in card stock and a weight in a matrix are the same kind of object: a decision written down somewhere a machine can read it back. Everything here is a point on that line, and the line is the reason the set is what it is.

The big ones are not chosen from a syllabus. Each is something I actually sat in front of. I toggled a program into an Altair through the front panel switches in the late 1970s, and ran bulletin boards in the 1980s when getting online meant listening to a modem negotiate at 300 baud. In college and on contract work I punched decks and leased mainframe time by the hour on an AS/400 and an IBM 9221, in FORTRAN, COBOL, PL/I, RPG and REXX. I served aboard the USS Missouri in Desert Shield and Desert Storm, where the guns were still being aimed by a mechanical analog computer designed in the 1930s. In 1994 I was at Spry when the web stopped being something you had to already be inside. Now I build with language models.

That constraint costs a lot of good subjects, and it buys the one thing this studio is for: I can tell you where the simulation departs from the real machine, because I used the real machine. Every one of them ends with a section saying what is faithful, what is approximated, and what is simply wrong on purpose, with the sources that settle it.

The work is sized in three, named after what they are. The rule about my own history applies only to the largest, which is what lets the small pieces cover subjects that are worth building and are nobody's biography.

Bit
One idea, with nothing in it handing off to anything else. Lives on logicalart.us. 14 here
Nibble
One mechanism in three or four stages, each one reachable only through the one before. Lives on logicalart.us. 97 here, 92 built
Byte
A complete machine you operate, on its own domain, with its own sources and honesty ledger. 7 here

Nothing here is a video of a machine. If a number is on the screen, something computed it. How that is checked, what counts as a source, and what happens when this is wrong: the method. Words the machines share, each pointing at the one that explains it: words. Something wrong, or a machine worth building: corrections. New machines arrive in the feed.