logic gates
Devices that take one or more inputs, with values either 0 or 1, and output 0 or 1. These can be associated to form more complex circuits using boolean algebra.
NOT
Outputs 1 if its input is 0, and vice-versa.
In | Out |
---|---|
0 | 1 |
1 | 0 |
AND
Outputs 1 if both of its inputs are 1.
In A | In B | Out |
---|---|---|
0 | 0 | 0 |
1 | 0 | 0 |
0 | 1 | 0 |
1 | 1 | 1 |
OR
Outputs 1 if at least one input is 1.
In A | In B | Out |
---|---|---|
0 | 0 | 0 |
1 | 0 | 1 |
0 | 1 | 1 |
1 | 1 | 1 |
XOR
Outputs 1 if exactly one of its input is 1.
In A | In B | Out |
---|---|---|
0 | 0 | 0 |
1 | 0 | 1 |
0 | 1 | 1 |
1 | 1 | 0 |
NOR
Outputs 1 if none of its input is 1.
In A | In B | Out |
---|---|---|
0 | 0 | 1 |
1 | 0 | 0 |
0 | 1 | 0 |
1 | 1 | 0 |
NAND
Outputs 1 if not all of its input are 1.
In A | In B | Out |
---|---|---|
0 | 0 | 1 |
1 | 0 | 1 |
0 | 1 | 1 |
1 | 1 | 0 |
XNOR
Outputs 1 if none or more than one of its input is 1.
In A | In B | Out |
---|---|---|
0 | 0 | 1 |
1 | 0 | 0 |
0 | 1 | 0 |
1 | 1 | 1 |