A logic gate takes one or more inputs that are each on or off and produces a single on/off output by a fixed rule. Combine enough of them and you can build anything from an automatic door to a working calculator.
NOT — the inverter
The simplest gate of all. A redstone torch is a NOT gate by itself: it's on when its input is off, and off when its input is on. Inverting a signal flips its meaning, and almost every other gate is built from inverters.
OR — any input
An OR gate is on when any of its inputs is on. Merging two dust lines into one is already an OR: power arriving from either source lights the output.
AND — every input
An AND gate is on only when all of its inputs are on. It takes a little more work: invert each input with a torch, feed them into a shared block, then invert once more. The double inversion means the output only fires when nothing is holding it down — that is, when every input is on.
The rest of the family
From these three you get the others. NOR is an OR followed by a torch (on only when all inputs are off). NAND is an AND without the final torch (on unless every input is on). XOR is on when its two inputs differ — the heart of adders and toggles.
| Gate | Output is on when… |
|---|---|
| NOT | the input is off |
| OR | any input is on |
| AND | every input is on |
| NOR | every input is off |
| NAND | any input is off |
| XOR | the inputs differ |