gate

A logic gate, drawn as its schematic symbol turned to the flow.

gateNode
On this page
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 the gate computes.
andornotnandnorxorxnor
Can be written as shorthand: gate:value
value
The level its output starts at, 0 or 1.
colourAnimatable
A hue that tints the symbol's fill and deepens its stroke, to pick one gate out.
paint
Also written: color
hiddenAnimatable
Declares the gate without drawing it or giving it room; it still computes.
Defaultfalse

#Derived attributes

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

levelDerived
The level of its output.

#Allowed content

Body { }Words set inside the symbol; usually empty

#Allowed in

#Examples

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

#Notes

  • and, or, nand, nor, xor and xnor take as many inputs as wires arrive, each on a port of its own on the gate's back, placed where its source stands; not takes one.
  • A gate's inputs have no names; a named input is a compile error: A gate's inputs have no names — write the wire to '#g', and it takes the next free input.
  • The output leaves the gate's front and fans out to every wire that leaves it.
  • A gate answers a change one gate delay, 110 ms, later.
  • 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.
  • A gate's inputs have no names; wires land on the next free input.

Last updated