circuits that move

The MorphoHDL article grows circuits that stand still. The dynamic-systems extension adds one primitive — REG — and suddenly circuits have a pulse. A small gallery of things that visibly move through time, each one a real, verified Morpho program. Sound on: every register commit is a note; the data is the score.

fifths on rings, scale-locked

two new words

REG declares state; DRIVE closes the loop through time. Every recurrent path crosses a register, so the whole circuit updates in lock-step: compute everything from the current state, then commit everything at once.

the smallest moving circuit

one register, one inverter: qt+1 = ¬qt
q = REG(ZERO)DRIVE(q, Not(q))return q

1 · remember a signal — the delay line

digital echo

bits travel down a register chain, one cell per tick — hold pulse and watch your signal come back late
q = REG(zeros(N))DRIVE(q, CAT(x, q[:-1]))return q[-1:]

interlude · a ring with one twist

running light (Johnson counter)

a register ring where the feedback bit is inverted: a block of light grows around the loop, then shrinks — 2N states from N registers and one NOT. The ring walks the circle of fifths.
q = REG(zeros(N))DRIVE(q, CAT(Not(q[-1:]), q[:-1]))return q

2 · memory for computation — the serial adder

carry through time

the article opens with the ripple adder: carry travelling through space, one full adder per bit. This is the same dependency rotated into time: one full adder, one register, any width. Click bits to edit the operands.
carry = REG(ZERO)s = Xor3(a, b, carry)DRIVE(carry, Maj3(a, b, carry))return s
a
b
carry
0
→ full adder →
sum

interlude · a number that is also a clock bank

binary counter / clock divider

registers wrapped around the article's own ripple adder: q ← q + 1. One state machine is simultaneously a number and a bank of divided clocks — each bit toggles at half the rate of the bit below.
q = REG(zeros(4))DRIVE(q, ripple_adder(q, one, ZERO)[0])return q

3 · autonomous dynamics — the LFSR necklace

pseudo-random from two taps

a shift ring whose new bit is the XOR of two taps (green). With the right taps the state visits every nonzero pattern before repeating. Click cells to move the taps; hunt for the maximal period.
s = REG([1,0,0,…])fb = Xor(s[i], s[j])DRIVE(s, CAT(fb, s[:-1]))return s

4 · distributed dynamics — the cellular automaton

elementary CA explorer

an N-bit register bank, two cyclic shifts, one 3-input rule — the whole language of elementary CAs in four lines. The rule's truth table is drawn below: click its cells to rewrite the physics while it runs. Every cell birth is a note; the melody is where growth happens.
state = REG(zeros(W))l = CAT(state[-1:], state[:-1])r = CAT(state[1:], state[:1])DRIVE(state, Rule(r, state, l))return state
rule — truth table (click to edit)

aside · state without a clock

SR latch — one bit from nothing but a loop

no REG at all: two cross-coupled NORs hold a bit as a fixed point of raw feedback (FORWARD/TIE, the asynchronous corner of the language). Pulse Set and Reset. Then pulse both at once and let go — and meet the state the latch cannot decide.
q, qn = FORWARD(ONE), FORWARD(ONE)TIE(q,  Nor(r, qn))TIE(qn, Nor(s, q))return q, qn
Q

5 · computation acquires a body

travelling-wave tentacle

so far the circuit has moved only in time. But a Morpho node can also describe physical tissue: feed register state into Muscle segments and the logical signal changes the geometry that carries it. A circulating bit becomes a contraction wave — peristalsis from a shift register. Swap the controller and the same body inhales, twitches, or dances Rule 110's gliders.
q = REG([1,0,0,…,0])DRIVE(q, CAT(q[-1:], q[:-1]))body = muscle_tube(q)return body

With Rule 90 or 110 selected this is an automaton with a body: every cell is simultaneously a bit of computation and a piece of muscle. Change the rule and you rewrite both the information dynamics and the choreography.

why these four, and a body

The demos form a progression: remember one signal (delay line) → use memory for computation (serial adder) → create autonomous dynamics (LFSR) → create distributed dynamics (cellular automaton) → embody those dynamics as motion (the tentacle). The latch sits apart because it stores a bit a different way — not behind a clock, but as a fixed point of the wires themselves. Every controller is a real program in the sequential extension, verified in the repository against numpy oracles and, for the adders, against arithmetic itself; the tube renders the tissue idea from the Morpho muscle work — logical nodes that also set the rest length of the links that carry them.

Every demo is the actual MorphoHDL program shown beside it, re-simulated in this page with the same synchronous-commit semantics as tiny_morpho_seq.py (runnable versions: examples/sequential/). Sound: one note per register commit, scale-locked (A pentatonic; rings walk the circle of fifths) in the manner of the snn lab. Resetting a demo plays a wavefront — one note per logic level, the signal travelling from inputs to outputs.

AI-generated research. The experiments, code and write-ups on this site were produced by AI agents (Claude and Codex) working semi-autonomously, directed at a high level by a human. Nothing here is peer reviewed and none of it is affiliated with an academic institution. Measurements are reported as taken — including the nulls, the caveats and the corrections — but the work has had no external review.