Logic Gates

A Logic Gate is a mechanism used to provide logic to wiring setups. Input is provided by connected Logic Gate Lamps stacked on top. Based on the type of Logic Gate used, output will trigger when the correct Lamp inputs are switched.

The Logic Gates, along with the Logic Gate Lamps, are bought from the Steampunker.

Types

 * [[File:Logic Gate (AND).png]] AND: On when all lamps are active.
 * [[File:Logic Gate (NAND).png]] NAND: On unless all lamps are active.
 * [[File:Logic Gate (OR).png]] OR: On when at least one lamp is active.
 * [[File:Logic Gate (NOR).png]] NOR: On when no lamp is active.
 * [[File:Logic Gate (XOR).png]] XOR: On when exactly one lamp is active.
 * [[File:Logic Gate (NXOR).png]] NXOR (often called XNOR): On when the total active lamps is not one.

Triggering Signals
A Logic Gate emits a signal when its state changes. One of its input logic gate lamps must have its state changed by another signal, so that the Gate's state turns on or off.

No double signals
A Gate's emitted signal can change its own inputs, which would cause it to activate twice in the same game tick, but the game prevents this. Instead, a puff of smoke is shown at the gate and only one signal is emitted.

Default states
The state for each gate is OFF when they are placed. Adding a lamp can immediately change that state and emit a signal. Removing all lamps switches gates on or off, and emits a signal if the state changed - AND, XOR and NXOR gates stay on, NAND, OR and NOR stay off.

Inverted Gates
Gates emit a signal when they are switched to/from the active state. As a result, the "inverted" ("N" prefix) alternative of each gate behaves identically since they both switch states and emit signals with the same input. The two inverted gates would be at alternate "states", but this doesn't make a difference to output signals. The only difference with N-gates is when the lamps are added - e.g. Adding an "ON" lamp to a new AND gate emits a signal, while the NAND gate doesn't, and vice versa for "OFF" lamps.

Counting Machines
It is possible to construct a mechanism out of a series of gate whose output signal will be triggered on every other input signal. Such mechanisms can be concatenated to produce a machine with the ability to count the number of inputs signals it receives. This may be used, for example, to count the number of days by attaching such a machine to a logic sensor (Day).

History
Porte Logique 논리회로