REDSTONEPEDIA › Circuits › Logic gates

Logic gate

A AND B · 5 blocks

It has two inputs, A and B. The output is on only when both inputs, A and B, are on.

reacts in 4 ticks (0.2 s) · made of redstone torch, redstone wire · fits in 3×2×2

A AND BLogic gate3D view loading (or not available in this browser)

Try it

Use the A and B buttons under the view to drive the inputs: the box marked OUT turns red while the output is on. Press play under the view to watch a demo on a loop; touch any other control to take over.

How this design does it: AND with real signal inputs: a torch stands on each input block, so each goes out when its input turns on; the dust between them is then off exactly when both inputs are on, and the wall torch hanging under that dust turns it back into AND.

Build it

Download .litematic Download the design as text

The .litematic opens in Litematica (Minecraft 26.3): every block of the design in one region. The text file is the same build written as plain text, block by block.

Blocks used: redstone torch redstone wire stone

Details: how it works, measurements and properties

In depth

A logic gate: the output depends only on the inputs right now. AND: the output is on only while A and B are both on.

ABOUT
offoffoff
offonoff
onoffoff
ononon

The output settles 4 ticks (0.2 s) after an input changes.

How to try it

Press play under the view to watch the demo on a loop (the badge reads demo with the step it is on; the same sequence is drawn as a timing diagram below). Touch any control to stop it and try the circuit yourself.

To try it: tap the A button of the bar (or the cell tagged A) to turn that input on or off (it powers the cell with a redstone block); tap the B button of the bar (or the cell tagged B) to turn that input on or off (it powers the cell with a redstone block).

Inputs are tagged in lime; the output is tagged OUT: the orange glass marker next to it glows while the output is on (the output strip by the demo badge shows its last 40 game ticks, 2 seconds). Drag to look around, pinch or scroll to zoom, step one game tick at a time with the step button.

Inputs and output over time

The inputs follow this schedule (the 3D view's demo plays the same). Lime: an input is on; orange: the output is on (taller = a stronger signal, 1 to 15). Time runs left to right in game ticks (20 ticks = 1 s).

00 (rest)010010001101100111101100ABOUTticks020406080100120140160180200220240260

Swipe the diagram sideways: the whole sequence lasts 281 ticks (14.05 s).

Step by step (13 lines)
00 (rest): output 0
-> 01: output 0
-> 00: output 0
-> 10: output 0
-> 00: output 0
-> 11: output 1 after 4 ticks (0.2 s)
-> 01: output 0 after 4 ticks (0.2 s)
-> 10: output 0
-> 01: output 0
-> 11: output 1 after 4 ticks (0.2 s)
-> 10: output 0 after 4 ticks (0.2 s)
-> 11: output 1 after 4 ticks (0.2 s)
-> 00: output 0 after 4 ticks (0.2 s)

Measurements

metricvaluewhat it means
functionandthe logic function the truth table names
latency4 ticks (0.2 s)the worst time from an input change to the output's change

Notes from its designer

AND with real signal inputs: a torch stands on each input block, so each goes out when its input turns on; the dust between them is then off exactly when both inputs are on, and the wall torch hanging under that dust turns it back into AND.

Properties

StudyLogic gates
KindLogic gate
Blocks placed5 (not counting the input levers or buttons the view adds)
Box3×2×2 (12 blocks of space)
Made of (the blocks that change state)redstone torch, redstone wire
Inputs / outputsA (repeater), B (repeater) / OUT
Design filegate-and-5b-r7

The design file

on GitHub

Design file (19 lines)
# Logic gate: A AND B · 5 blocks
# https://vjeux.github.io/redstonepedia/circuits/gates/gate-and-5b-r7.html
name: gate-and-5b-r7
circuit: gate and
port input.a: 0 1 0
port input.b: 2 1 0
port output: 1 1 -1
origin: 0 0 -1
palette:
  S minecraft:stone
  T minecraft:redstone_torch[lit=true]
  W minecraft:redstone_wall_torch[facing=north,lit=true]
  r minecraft:redstone_wire[east=side,north=none,power=0,south=none,west=side]
layer 1:
  .W.
  .S.
layer 2:
  ...
  TrT