Here is a summary of the truth tables for all the two input gates. The inputs are labelled A and B. The yellow highlights identify the special cases that it is useful to remember. For example the AND rule is that two ones on the inputs give a one on the output. Any other input gives a zero.
| AND |
NAND |
OR |
NOR |
XOR |
NOT |
|||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
|
|
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
| A B Q |
A B Q 0 0 1 0 1 1 1 0 1 1 1 0 |
A B Q 0 0 0 0 1 1 1 0 1 1 1 1 |
A B Q 0 0 1 0 1 0 1 0 0 1 1 0 |
A B Q 0 0 0 0 1 1 1 0 1 1 1 0 |
A Q 0 1 1 0 |
|||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
|
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
Two ones |
Two ones |
Two zeros |
Two zeros |
Equal |
Input |