This simulation needs WebAssembly, and it could not start in this browser.
The image is a frame from a real run. Check that JavaScript is on, or try another browser.
Brian Silverman invented Wireworld in 1987, and A. K. Dewdney made it widely known in his Computer Recreations column in Scientific American in 1990. It is a cellular automaton built for electronics: every cell is empty, wire, an electron head or an electron tail, and with these four states pulses run along wires, split at branches and combine at gates. Clocks, diodes and logic gates take only a handful of cells, and Wireworld is Turing-complete: David Moore and Mark Owen built a complete programmable computer in it that calculates prime numbers.
What you see
The grid has 200 by 200 cells, and its edges wrap around, although the circuits stay clear of them. Empty cells are black, wire blue, electron heads yellow and tails orange. An electron is a head with a tail behind it, and it moves one cell per generation, so a pulse crosses the whole grid in a little over 3 seconds at normal speed.
Where a wire turns a corner, the head excites the corner cell and the next cell around it at the same time, so the electron cuts the corner. A pulse therefore takes one generation less per corner than the number of cells it passes.
Rule
All cells update at once. A cell’s neighbors are the eight cells around it, and is the number of them that hold an electron head:
- Empty stays empty.
- Electron head becomes an electron tail.
- Electron tail becomes wire.
- Wire becomes an electron head if or , and otherwise stays wire.
The tail behind each head is what keeps a pulse moving forward: the cell it just left cannot fire again right away. The limit of two heads is what makes diodes and gates possible, because a wire cell touched by three heads at once stays dark.
Presets
Diode: two identical clocks send a pulse every 24 generations along two wires, and each wire has a diode at its middle. A diode is a gap in the wire bridged by a pad of two cells above and two below. From the input side the pads carry the pulse across, and both pads fire the cell after the gap together. In the upper wire the diode points forward and every pulse arrives at the far end. In the lower wire the same diode is reversed: coming from that side, the pulse spreads over both pads and the wire end between them, the next wire cell sees three heads at once and stays dark, and the pulse dies. Nothing ever passes the lower diode.
Clock: a loop of wire with one electron in it, whose upper edge runs on past the corner as an output. Each time the electron passes that corner, a copy continues straight on, so the output carries one pulse per lap. The two loops have periods of 24 and 48 generations, the number of cells in each loop minus one for each of its four corners.
Electron train: six electrons running clockwise on one loop of 356 generations. They never meet, so the pattern repeats exactly after every lap, about 6 seconds at normal speed.
OR gate: two clocks with periods of 48 and 72 generations feed a junction through one diode each, and the junction’s output fires whenever at least one input does. Within each 144 generations the output carries four pulses: two from the faster clock alone, one from the slower clock alone and one where both arrive together and merge into a single pulse. Without the diodes, a pulse arriving alone would also run backwards into the other input, and the diodes stop that echo. The first pulse reaches the end of the output after 191 generations, about 3 seconds.
Parameters
Wireworld has no numeric parameters: the circuit is the configuration. Use Reset to start a preset again from its first generation.