Logic GATE
What is logical operation
In mathematical logic or computer science , two states, True and False, are called Boolean expression.
After the advent of the Boolean algebra, logic begins to have a strong tendency in symbolic logic.
This document is intended to describe wiringpi.
Logic gate and shift operations are described on a C basis.
It doesn’t cover the details of logical mathematics.
Logic gates
A logic gate is a device that acts as a building block for digital circuits.
There are AND , OR , XOR , NOT , NAND , NOR and XNOR
AND
AND is that In the boolean algebra, if all are 1, it is an operation that represents 1,
and if any is 0, it represents 0.
A & B
A | B | result |
---|---|---|
0 | 0 | 0 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 1 |
OR
OR is that In the boolean algebra, if all are 0, it is an operation that represents 0,
and if any is 1, it represents 1.
A | B
A | B | result |
---|---|---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 1 |
XOR
XOR is that In the boolean algebra, if all are equal, it is an operation that represents 0,
and if any is different, represents 1.
A ^ B
A | B | result |
---|---|---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
NOT
NOT is that In the boolean algebra, Toggle all values to the opposite value.
~A
A | result |
---|---|
0 | 1 |
1 | 0 |
NAND
NAND is that In the boolean algebra, if all are 1, it is an operation that represents 0,
and if any is 0, it represents 1.
~(A & B)
A | B | result |
---|---|---|
0 | 0 | 1 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
NOR
NOR is that In the boolean algebra, if all are 0, it is an operation that represents 1,
and if any is 1, it represents 0.
~(A | B)
A | B | result |
---|---|---|
0 | 0 | 1 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 0 |
XNOR
XNOR is that In the boolean algebra, if all are equal, it is an operation that represents 1,
and if any is different, represents 0.
~(A ^ B)
A | B | result |
---|---|---|
0 | 0 | 1 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 1 |