# User:Contrapple/Tutorials/Logic gates

Logic gates are an advanced skill in redstone circuitry. All logic gates involve at least one input and an output that turns on in some state and off in others. They always output a signal strength of 15.

## Summary of types

There are many types of logic gates

### 2 inputs

Many logic gates have 2 inputs.

Type Summary Both on works? Both off works? A, but not B works? B, but not A works? Delay (in seconds)
And Both must be on. Yes No No No 0.2
Nand Both must be off. No Yes No No 0.1
But not A, but not B, must be on. No No Yes No
Or At least one must be on. Yes No Yes No 0.1
Nor At least one must be off. No Yes Yes Yes 0.1
Implies B must be on if A is. Yes Yes No Yes 0.1
Xor One or the other, but not both, must be on. No No Yes Yes 0.15
Nxor Both or neither must be on. Yes Yes No No 0.25

### 1 input

The simplest logic gates only have one input. These logic gates will have a 1 tick (0.1 second) delay.

#### Not gate

A not gate reverses the presence of a redstone signal, so if the input is on, the output will be off.

 rd-w!
A not gate (output is on)
A not gate (output is off)

#### Ot gate

An ot gate maintains the presence of a redstone signal. This means that the output will match the input, but the signal strength will be 15.

 rd-w
An ot gate (off)
An ot gate (on)

## Images of 2-input gates

### And gate

 sbrt! sb sbrt!
Both inputs are off.
 sb sb sbrt!
One input is on but the other is off.
 sb sb sb
Both inputs are on.

### Nand gate

 rd-e sb rd-w
Both inputs are off
 rd-e! sb rd-w
One input is on but the other is off
 rd-e! sb rd-w!
Both inputs are on

### Or gate

 rd-e rd-w
Both inputs are off
 rd-e! rd-w
One input is on but the other is off
 rd-e! rd-w!
Both inputs are on

### Nor gate

 rd-s rd-s sb sb
Both inputs are off
 rd-s! rd-s sb sb
One input is on but the other is off
 rd-s! rd-s! sb sb
Both inputs are on

### Xor gate

 rd-s rd-s sb sb rd-n! rd-n! sb
Both inputs are off
 rd-s! rd-s sb sb rd-n rd-n! sb
One input is off but the other is on
 rd-s! rd-s! sb sb rd-n rd-n sb
Both inputs are off

### Nxor gate

 rd-s rd-s sb sb rd-n! rd-n! sb sb ! ouput
Both inputs are off
 rd-s! rd-s sb sb ! rd-n rd-n! ! sb sb ! x
One input is off but the other is on
 rd-s! rd-s! sb sb ! rd-n rd-n ! ! sb sb ! x
Both inputs are off

### Implies gate

 A B ! sb ! !
Both off
 A B ! sb ! !
A is off, but B is on
 A B sb !
A is on, but B is off
 A B ! sb ! !
Both on