Redstone circuits/Logic

Introduction
A logic gate can be thought of as a simple device that will return a number of outputs, determined by the pattern of inputs and rules that the logic gate follows. For example, if both inputs in an AND gate are in the 'true'/'on'/'powered'/'1' state, then the gate will return 'true'/'on'/'powered'/'1'. Much more in-depth information and a better explanation of this expansive topic is available on Wikipedia.

For this introduction, we are beginning with examples of the major logic gates and some common circuits. There are many different ways to construct them other than those shown below, and many of these circuits can be done more simply with newer components such as redstone repeaters and pistons. Most circuits have multiple valid implementations, with various advantages and disadvantages between designs such as size, complexity, performance, maintenance overhead. Later sections will give many different designs for each gate type.

A game map with these gates and other redstone help can be found here

Some general notes:
 * tick is always a redstone tick, the delay between the events "Redstone torch receives power" and "Redstone torch turns off or on". (depending on its initial state);  One redstone tick is 2 game ticks, or $1⁄10$ of a second.
 * A torch is always a redstone torch, and a piston is always sticky.
 * In most of these circuits, repeaters are set to 1 tick, but in some cases this can be altered, e.g. to synchronize outputs..

Truth Values
This table shows the input and output values for all the gates listed here. Some notes:
 * All these except IMPLIES and NOT are commutative, meaning that the A and B inputs can be swapped without changing the output.
 * NOT, of course, only pays attention to one input.
 * AND, OR, and XOR are furthermore associative: if you want to combine more than two inputs, you can do any pairs, and then combine those with another gate, and so on until you're down to one output.
 * XOR for more than two inputs is "parity", true for any odd number of "on" inputs.