This post is a list of basic logic gates with inputs and outputs. 0 represents off; 1 represents on. There are 7 logic gates listed below alphabetically with electrical diagrams.
In the diagrams, '+5v' represents electricity; 'A' represents the first input 'B' represents the second input; a v-shaped intersection represents a transistor; a zig zag line represents a resistor; 3 horizontal parallels lines represent ground; a dot at an intersection represents a connection.
A transistor conducts electricity only if the input is turned on. If the electricity has a direct connection to ground then the circuit loses electricity. The resistor allows electricity to pass through it but breaks direct connection to ground.
AND
0, 0 = 0
0, 1 = 0
1, 0 = 0
1, 1 = 1
NAND (NOT AND)
0, 0 = 1
0, 1 = 1
1, 0 = 1
1, 1 = 0
NOR (NOT OR)
0, 0 = 1
0, 1 = 0
1, 0 = 0
1, 1 = 0
NOT
0 = 1
1 = 0
OR
0, 0 = 0
0, 1 = 1
1, 0 = 1
1, 1 = 1
XNOR (Exclusive NOT OR)
0, 0 = 1
0, 1 = 0
1, 0 = 0
1, 1 = 1
XOR (Exclusive OR)
0, 0 = 0
0, 1 = 1
1, 0 = 1
1, 1 = 0
License: CC BY-SA 4.0