There's something in computer theory called a "logic gate". It's a device that has two inputs and one output. The only input it accepts is "on" or "off", and the output is the same, "on" or "off". You might see the relation to binary.

A logic gates output is dependent on its input. One kind of a logic gate is the NAND gate, shown below. Try turning the switches on:


When both of the NAND gates inputs are on, the output is off. Otherwise, the
output is on.

There are more kinds of logic gates, but the only one we need to worry about for now is the NAND gate. Here are some real life examples of logic gates

<left 2/8 next>

source code - donate - contact