TAPEOUT / FFW-NAND/1 — A BRAIN THAT FITS IN FIFTY GATES

Fifty NAND gates.
One fly brain.

Every move a fly makes has to come from somewhere. FFW-NAND/1 is that somewhere made small and checkable: twelve input bits, three output bits, fifty NAND gates, no memory of its own. Small enough to read on one screen and to build on TapeOut's canvas, where a circuit lives on BNB Chain and anyone can evaluate it with a free, read-only call.

50 NAND · 0 LATCH4096/4096 WORDS MATCH THE RULESNOT TAPED OUT YET
01 · THE CIRCUIT

Feed it a word.
Watch the gates answer.

Pick a level for each signal and the previous move, and the diagram lights up: every wire carries a 0 or a 1, every gate shows what it computes, and the three outputs at the right are the move the fly takes. This is the whole circuit — nothing is hidden and nothing is simulated at a higher level.

INPUTS12 bitsfive signals + the previous move
OUTPUTS3 bitsa move, and the Giant Fiber
GATES50 NANDno latch, no sub-circuit
DEPTH9gates on the longest path
FFW-NAND/1 · 50 NAND · 0 LATCH · DEPTH 9 29 OF 50 GATES HIGH ON THIS WORD
01f0f1t0t1l0l1n0n1h0h1p0p111111011000000000111111100101011110111001011011100move b0move b1escape
FEED IT A WORD · 12 BITS IN
  • f00
  • f10
  • t00
  • t10
  • l01
  • l10
  • n00
  • n11
  • h01
  • h11
  • p01
  • p11
food
threat
light
novelty
hunger
prev
INPUT WORD0xf90
RULEcurious
MOVEexplore
GIANT FIBERquiet

Rule curious: novelty >= 2 → explore

4096 words, all checked against the rules
WHERE THIS RUNS — in your browser, from the netlist committed to the repository (app/lib/nand/ffw-nand-1.netlist.json). Nothing on this page reads a chain, and there is nothing on a chain to read yet: the circuit has not been taped out. When it is, the same words can be sent to the on-chain eval() and compared, which is what npm run nand:verify does.
02 · THE INTERFACE

Twelve bits in,
three bits out.

A brain in Fruit Fly World maps four smells plus hunger and the previous move to one of four moves. FFW-NAND/1 turns each number into a level from 0 to 3, packs the levels into twelve bits, and answers in three. That packing is the entire contract a TapeOut circuit has to honour.

Level0123
Valuebelow 0.10.1 to 0.350.35 to 0.650.65 and above
BitsReads
bits 0–1food
bits 2–3threat
bits 4–5light
bits 6–7novelty
bits 8–9hunger
bits 10–11previous behavior

The levels are packed pin 0 first: TapeOut packs input pin i into bit i. The output word is move | escape << 2, where a move is 0 approach, 1 avoid, 2 explore, 3 freeze. A missing pin reads as 0, so a taped-out circuit and this page always agree on the same word.

03 · THE SEVEN RULES

Read top to bottom.
The first match decides.

The circuit is not a trained model and not a lookup table. It is these rules, compiled. Rule 1 is the brainstem the game already models — a looming threat drives the Giant Fiber and the fly jumps, and in the trading dish a Giant Fiber spike sells everything.

01

ESCAPE

threat >= 2 → avoid, and the Giant Fiber fires

02

DANGER

threat >= 1 and (previous was avoid or hunger < 2) → avoid

03

FEED

hunger >= 3 and food >= 1 → approach

04

LURE

food >= 3 → approach

05

PURSUE

previous was approach and food >= 2 → approach

06

CURIOUS

novelty >= 2 → explore

07

REST

previous was freeze and hunger < 3 → freeze

08

DEFAULT

otherwise explore in the light, freeze in the dark

Source of truth: app/lib/nand/rules.ts. The test suite compiles these rules into a 4096-row table and asserts the netlist reproduces every row, so the picture above and the prose here cannot drift apart without a test failing.

04 · WHAT TAPING OUT WOULD COST

Fifty transistors
and a fee.

TapeOut runs on BNB Chain: you buy transistors, lay out a circuit, and pay to burn the transistors you used. Here is the arithmetic for this circuit, with the numbers we can point at and the ones we cannot kept apart.

One transistor · list0.0005 BNBlist price on the official TapeOut processor, read from its contract on 2026-10-16. Its 1,000,000 transistors are all minted out, so a buy today is a secondary-market purchase, not a mint.
This circuit needs50 NANDand nothing else. No LATCH: the brain keeps its only memory — the previous move — in the world, which passes it back in as an input.
Transistors alone≈ 0.025 BNB50 × 0.0005. The tape-out fee and the protocol fee are not in this number: they are not confirmed on BNB Chain and we will not guess them.
THE ADDRESSES WE HAVE — the official processor is 0xb1024b89886b9a34aa4ff5f31c411d708b20a14c and its transistor token is 0xcc42ba5de07f01b472a5b14cf45abcca79eb8087, both on BNB Chain, both read from the public registry at tapeout.work. What is still open — the tape-out fee, the protocol fee, and the byte order for inputs past bit 7 — is listed in docs/tapeout-notes.md. For scale, a neighbouring team reports a 3,800-gate tape-out on X Layer costing about 0.0023 OKB net; that is a different chain and not our quote.
05 · THE VERIFICATION LADDER

Three rungs.
We are on the first.

A claim about a circuit is worth exactly as much as the cheapest way to falsify it. Here is where this one stands today, and what would move it up a rung.

Local, all words

4096 / 4096 words identical to the rules

The committed netlist is evaluated on every one of the 4096 input words and compared with the truth table compiled from the seven rules. The tape-out bytes are pinned by SHA-256, so a changed circuit fails the build.

✓

Silicon

Not taped out

No transistors have been burned and no circuit exists on BNB Chain. Buying the 50 NAND and calling tapeout(bytes, 12, 3) is a deliberate, one-off, human step.

—

On-chain eval

Not checked against a chain

Once taped out, npm run nand:verify reads the netlist back from the processor and calls the free eval() on all 4096 words. It must print IDENTICAL: all 4096 words before any season runs on this brain.

—
06 · HOW IT COMPARES

Inspired by the fly.
Not a copy of it.

The day the game already ships is driven by FFW-CX/0.1, a 24-neuron circuit. FFW-NAND/1 is a different, much smaller brain, tuned in closed loop until its day in the same dish matched. Same dish, same tapes: six fly seeds across four seasons, twenty-four trading days.

Per day, averagedFFW-CX/0.1 · market/2FFW-NAND/1 · market/3
Share of ticks alive0.9970.997
Deaths1.961.96
Generations2.922.92
Giant Fiber escapes, per day67.985.6
Trades2691,495
Equity at day end, paper USD1,2181,490

It lives as well — deaths and generations match exactly, because in this dish they are driven by the fee rhythm, not by the brain. It is a busier trader: it approaches more, rests less, and trades about five times as often. Say it plainly: this is a different brain with a similar temperament, inspired by FFW-CX/0.1 and tuned against it — never "the same brain".

WHAT THE CIRCUIT ANSWERS, OVER ALL 4096 WORDS
  • approach640
  • avoid2688
  • explore600
  • freeze168

Counted straight off the netlist, not from the rules. The Giant Fiber fires on 2048 of 4096 words — every word where threat reads 2 or higher.

07 · HOW IT WAS MADE

Four attempts.
Three did not work.

The obvious move — distil the 24-neuron brain into a table and compile it — is the one that fails. Writing down what failed is the part that makes the rest believable.

ATTEMPT 1

Distilled table

Sampling 380,000 decisions and compiling the most common behaviour per word produced 2,472–3,398 gates, and in closed loop the fly locked into one move: the neuron brain repeats its previous action 96% of the time, so "copy the last move" is what a stateless table learns.

ATTEMPT 2

Small decision trees

Down to 11–54 gates, with the same lock-in whenever the tree could read the previous move, and no resting or avoiding when it could not.

ATTEMPT 3

Closed-loop distillation

Letting a shadow FFW-CX/0.1 label the states the gate fly actually visited stalled near 50% agreement, and small parameter changes swung the behaviour mix widely. Unstable.

ATTEMPT 4

Seven rules, tuned

Explicit, readable rules tuned in closed loop: 35–53 gates across the settings tried, stable, and close on survival, equity and the behaviour mix. This is FFW-NAND/1.

The lesson, kept for anyone building a brain here: a circuit with no state needs the world to hand it a little memory — here, the previous move — and at this size readable rules beat imitation.

A small circuit.
A real reflex.

WHAT THIS IS

A gate-level decision layer — 50 NAND gates, 12 bits in, 3 bits out — that reproduces seven fly reflex rules on every possible input, and can be taped out to TapeOut on BNB Chain so a free read-only call answers the same way.

WHAT THIS ISN'T

Not a simulation of a whole fly brain, not a trading strategy, and not investment advice. It is not the same brain as FFW-CX/0.1, and it is not on chain: no transistors have been bought and no circuit exists.

WHAT YOU CAN CHECK

The circuit, its bytes and its SHA-256 in the repository; the whole truth table in your browser above; and, once it is taped out, every one of the 4096 words against the on-chain circuit with one command.