Redstonery
RedstoneryCircuits › NAND gate
Logic circuit

NAND gate

Make the both-active state the only off state.

4 × 3 footprint2 layers12 blocksTested in 4 rotationsJava Edition 26.2
Open in the simulatorBuild it in the game

Layout

Layer 0 (on the floor)
lever [face=floor, facing=north, powered=false] at x 0, z 0redstone dust at x 1, z 0stone at x 2, z 0lever [face=floor, facing=north, powered=false] at x 0, z 2redstone dust at x 1, z 2stone at x 2, z 2stone at x 2, z 1redstone lamp at x 3, z 1
Layer 1 (1 up)
redstone torch at x 2, z 0redstone torch at x 2, z 2redstone dust at x 2, z 1redstone dust at x 3, z 1
redstone dustredstone torchinputlampsolid blockarrows point where a device sends its output; north is up

How it works

The AND without its third torch: the dust between the two torches is the answer, read by a lamp beside the middle block. Lit unless both inputs are on.

  1. The circuit produces the inverse of the two-input AND condition.
  2. One missing input is enough to keep the output on.

Truth table

Settled outputs after the inputs stop changing. 1 is on, 0 is off. Every row is checked in the simulator in all four rotations.

ABthe lamp, not (A and B)
001
101
011
110

Inputs and outputs

  • InputA (x 0, y 0, z 0)
  • InputB (x 0, y 0, z 2)
  • Outputthe lamp, not (A and B) (x 3, y 0, z 1)

Blocks you need

4 × redstone dust, 3 × stone, 2 × lever, 2 × redstone torch, 1 × redstone lamp.

Build it in the game: 12 commands

Relative to where you stand, with x running east and z running south. Paste one line at a time into chat, or into a chain of command blocks. The block art is the game's own; the layout is what the page above shows.

setblock ~0 ~0 ~0 minecraft:lever[face=floor,facing=north,powered=false]
setblock ~1 ~0 ~0 minecraft:redstone_wire
setblock ~2 ~0 ~0 minecraft:stone
setblock ~2 ~1 ~0 minecraft:redstone_torch
setblock ~0 ~0 ~2 minecraft:lever[face=floor,facing=north,powered=false]
setblock ~1 ~0 ~2 minecraft:redstone_wire
setblock ~2 ~0 ~2 minecraft:stone
setblock ~2 ~1 ~2 minecraft:redstone_torch
setblock ~2 ~0 ~1 minecraft:stone
setblock ~2 ~1 ~1 minecraft:redstone_wire
setblock ~3 ~0 ~1 minecraft:redstone_lamp
setblock ~3 ~1 ~1 minecraft:redstone_wire