Redstone circuits/Logic/XOR

An XOR gate is a device which activates when the inputs are not the same, when only one is on. XOR is pronounced "zor" or "exor," a shortening of "exclusive or," because each input is mutually exclusive with the output. The output will be on only when exactly 1 of the inputs is on. Adding or removing a NOT gate to the end will produce an XNOR gate, which activates when the inputs are equal to each other. A useful attribute is that an XOR or XNOR gate will always change its output when one of its inputs changes, allowing for 2 switches to be combined to open or close a door, or activate another device. Like AND and OR gates, XOR gates can freely be "ganged" together, with gates gathering groups of inputs and their outputs being gathered in turn. The result of XORing more than two inputs is called "parity" -- the result is 1 if and only iff an odd number of inputs are 1.

Of the following patterns, F was the most widely used of the torch-only designs. However, design H is faster and more compact. if you can afford the pistons.

Design D is not very useful unless you want the levers to be fixed to the circuit. The shaded block indicates the block the levers and the lit torch are attached to, along with the block that one is resting on.

Design F was widely used, but repeaters and/or pistons can do better. Note that a solid block must be placed over each of the two shaded redstone torches, the ones closest to the inputs.

Design I can have its input repeaters coming in from either side or underneath (it depends on block powering), changing its size accordingly to fit tight spaces.