← All docs

Circuits

Logic gates

NOT, OR, AND and their relatives — turning one or two on/off inputs into a single yes-or-no answer.

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.

Lever off → lamp on. Flip the lever and the torch switches off.View & run →

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.

Either lever lights the lamp.View & run →

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 lamp lights only when both levers are on.View & run →

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.

GateOutput is on when…
NOTthe input is off
ORany input is on
ANDevery input is on
NORevery input is off
NANDany input is off
XORthe inputs differ

Keep reading