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.

There are many different kinds of logic gate, each of which can be implemented with many different designs. Each design has various advantages and disadvantages, such as size, complexity, speed, maintenance overhead, or cost. The various sections will give many different designs for each gate type.

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

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.