gate

A logic gate, drawn as its schematic symbol turned to the flow. kind: is the implicit attribute — gate#x1:xor{} — and a gate usually has no words, so its body is empty. and, or, nand, nor, xor and xnor take as many inputs as wires arrive, each landing on a port of its own on the gate's back; not takes one. Its output leaves its front and fans out to every wire that leaves it. Every gate answers a change one gate delay later. Levels may be unknown: an AND with a 0 among its inputs is 0 whatever the others are, an OR with a 1 is 1, and anything else touched by an unknown is unknown — so a latch built from gates powers up unknown until something sets or resets it.

gateNode
Switches A, on, and B, off, each feeding an AND, an OR and an XOR gate, drawn as their schematic symbols; the OR and XOR lamps are lit and the AND lamp is dark.Switches A, on, and B, off, each feeding an AND, an OR and an XOR gate, drawn as their schematic symbols; the OR and XOR lamps are lit and the AND lamp is dark.

#Attributes

kindRequiredImplicit
What it computes: and, or, not, nand, nor, xor or xnor.
andornotnandnorxorxnor
Can be written as shorthand: gate:value
value
The level its output starts at, 0 or 1 — for a latch that must power up in a known state. Without it, a gate in a loop starts unknown.
colourAnimatable
The symbol fills with the hue's own tint and strokes deeper, to pick one gate out.
bluelight-bluedark-blueredlight-reddark-redorangelight-orangedark-orangeyellowlight-yellowdark-yellowteallight-tealdark-tealgreenlight-greendark-greenpinklight-pinkdark-pinkpurplelight-purpledark-purplegreylight-greydark-greyneutralhex(…)rgb(…)
Also written: color
hiddenAnimatable
Declared but not drawn, and taking no room while hidden. It still computes. Animatable.
Defaultfalse

#Derived attributes

Computed while the element renders — read one with #id.name in attribute position or {{#id.name}} in prose, never set.

levelDerived
Its output's level: 0, 1, or absent while unknown.

#Allowed content

Body { }Words set inside the symbol; usually empty

#Allowed in

#Examples

gate#x1:xor{}
gate#n1:nor{}(value: 0)

Last updated