Cs · Computer Science

How to Build a Logic Circuit in Conway’s Game of Life

Published By the 9to5Science editorial team

At a glance

  1. 1. Choose the logic

    Write the desired function as Boolean gates, such as AND, OR, and NOT.

  2. 2. Encode signals

    Represent bits with moving patterns, often gliders, and decide how each bit is timed.

  3. 3. Arrange interactions

    Use collisions and stable patterns to implement gates, routing, and signal cleanup.

  4. 4. Test the layout

    Check each input case over enough generations to confirm the output and timing.

A “circuit” in Conway’s Game of Life is a pattern whose evolution represents a computation. Bits are encoded by patterns, those patterns move or interact, and the resulting pattern represents the output. Life can support universal computation, but a circuit is not usually a row of cells with simple, isolated components: its behavior depends on the timing and geometry of pattern interactions.

The most useful starting point is to design the Boolean circuit on paper. Then decide how its wires and gates will be realized by Life patterns. If you are looking for a specific arrangement of cells, the required pattern depends on the function, signal encoding, and timing convention.

The rule being used

Conway’s Game of Life updates a square grid in discrete generations. Each cell has eight neighbors. A live cell survives if it has two or three live neighbors; otherwise it dies. A dead cell becomes live if it has exactly three live neighbors. This rule is commonly written B3/S23: birth with three neighbors, survival with two or three.

Although the rule is local and simple, patterns can move, remain stable, or interact in complicated ways. A glider is a small pattern that travels diagonally across the grid, returning to the same shape every four generations but shifted by one cell. Gliders are useful as signals because their arrival at a location can represent an event or bit.

How a Life circuit represents computation

A physical circuit needs more than a logic gate. It needs a convention for representing 0 and 1, a way to route signals, and a way to keep separate events from interfering.

One simple conceptual encoding is:

  • 1: a glider arrives at a designated place and time.
  • 0: no glider arrives at that place and time.

This is an absence/presence encoding. It is easy to describe, but a missing glider is harder to detect than a present one. Practical constructions may use multiple tracks, paired signals, or other conventions so that both values are represented by observable patterns. A glider’s direction and phase—when it reaches a point in the repeating evolution—also matter.

In a Life implementation, a “wire” is a route along which a signal travels. A “gate” uses collisions or other pattern interactions so that the outgoing pattern depends on the input signals. Stable objects can absorb unwanted gliders or help control the route. The exact arrangement must be designed so that the desired output survives and unintended signals do not.

Worked example: design an XOR circuit first

Suppose the goal is to compute the exclusive OR of two input bits. XOR is 1 exactly when its inputs differ:

ABA XOR B
000
011
101
110

A standard Boolean decomposition is

AXOR⁡B=(AOR⁡B)AND⁡NOT⁡(AAND⁡B).A \mathbin{\operatorname{XOR}} B = (A \mathbin{\operatorname{OR}} B) \mathbin{\operatorname{AND}} \operatorname{NOT}(A \mathbin{\operatorname{AND}} B).

Check the four cases. If both inputs are 0, the OR is 0, so the output is 0. If exactly one input is 1, the OR is 1 and the AND is 0, so the output is 1. If both inputs are 1, the OR and AND are both 1; NOT(AND) is 0, so the output is 0.

This gives a gate-level design: compute OR and AND from the same inputs, invert the AND result, then combine the two results with another AND. In Life, this is only the logical design. A physical implementation also needs to send each input to both gates, align the signals so they arrive at the right times, implement the gate interactions, and carry the final output to a readable location. That routing and timing work is why a truth table alone is not a complete Life pattern.

A practical construction workflow

  1. Specify the function. Write a truth table or Boolean expression and identify every input and output.
  2. Choose a Life signal convention. Decide what represents 0 and 1, and when each input is considered present. Keep the convention consistent across the circuit.
  3. Build and test small parts. Use known constructions for signal sources, routing, and logic interactions rather than guessing cell arrangements. Test each part for every relevant input combination.
  4. Connect the parts with timing in mind. A route can delay or alter a signal’s phase. Add appropriate delays or adjust placement so inputs meet at the intended interaction.
  5. Run the whole pattern. Verify all input cases for enough generations to observe the output and check that stray patterns do not later change it.

A glider gun can provide a repeating source of gliders, but it does not automatically provide arbitrary input bits. Inputs need to be controlled—for example, by choosing whether to inject a signal in a particular time slot. A full computer in Life also requires ways to store and coordinate information; a single gate is much simpler than a programmable machine.

Common mistakes

  • Treating a glider as a complete wire. The path, direction, and arrival time all matter. Two signals on intersecting paths may collide rather than pass independently.
  • Ignoring missing signals. With presence/absence encoding, a 0 produces no event. A downstream component cannot distinguish “0” from “the signal has not arrived yet” unless timing or a more robust encoding makes that clear.
  • Assuming a Boolean gate diagram specifies a Life pattern. It specifies the desired computation, not the cell coordinates or generation-by-generation behavior.
  • Testing only one input case. A collision that produces the right answer for one input may fail for another. Check the complete truth table and observe the system over time.

For a small project, it is usually easiest to build the Boolean circuit first and then adapt known Life constructions for each component. If you need a particular cell-by-cell pattern, specify the gate or function, the input encoding, and whether you want a one-time or repeating computation.

References

  1. Martin Gardner, “Mathematical Games—The fantastic combinations of John Conway’s new solitaire game ‘life’,” Scientific American, 1970
  2. LifeWiki: Universal computer

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.