Nandi chapter opener illustration

Nandi

NAND gate: output is off only when A AND B are both on; on otherwise (a NOT-AND). Universal — any gate can be built from NANDs.

Nandi and the One That Builds the Rest

Nandi looked, at first glance, like Duet’s shadow. Where Duet glowed only when both her friends were on, Nandi did the exact reverse: she went dark only when both were on, and glowed every other time.

Both friends on? Nandi, alone of everyone, switched off. Any other combination — one on, one off, both off — and Nandi shone. It was as if you’d taken Duet’s careful “both, or nothing” and flipped it inside out. The little fireflies found her pleasant but unremarkable, a sort of backwards Duet, and thought no more about it.

They were wrong, and an old wire-mender was the one who told them so.

“You want to know a secret about Nandi?” he said one evening, tapping her gently. “She’s the most powerful firefly on this whole circuit. Every other one of them — Duet, Orla, Nay, Odele, all of them — can be built out of nothing but copies of her.

The fireflies didn’t believe it. So he showed them. He took two Nandis and wired them just so, and out came a perfect Nay — an inverter, from NANDs. He took a few more, arranged them cleverly, and out came a Duet. A few more: an Orla. It was uncanny. Nandi, the plain backwards-Duet, was a kind of seed you could grow every other gate from.

“Why her?” a firefly asked, amazed.

“Because she’s almost everything and not-quite nothing,” said the mender. “She says yes to every case but one. That single ‘no’ is just enough to be useful, and her flood of ‘yes’ is just enough to be flexible. Give me enough Nandis and I can build you any machine you like — any lock, any adder, any brain. Whole computers have been built from nothing else.”

Nandi, for her part, didn’t gloat. She glowed her steady almost-always glow and let the others marvel. “I only have one rule,” she said. “Dark when both are on, bright the rest of the time. It’s a small rule. I didn’t know you could build the world out of it.” She dimmed, just once, as both her friends lit up together — her single, faithful ‘no’ — then brightened again. “But I’m glad you can.”

When you wire a NAND gate, you are being Nandi: the output is off ONLY when both inputs are on — and from enough of her, every other gate can be built.

The gateforge ensemble

Nandi is part of gateforge's distributed-narrative cast. Each character embodies a different curricular primitive; together they teach the full subject.