NAND and NOR logic gates are the two pillars of logic, in that all other types of Boolean logic gates (i.e., AND, OR, NOT, XOR, XNOR) can be created from a suitable network of just NAND or just NOR gate(s). They can be built from relays or transistors, or any other technology that can create an inverter and a two-input AND or OR gate. Hence the NAND and NOR gates are called the universal gates.
For an input of 2 variables, there are 16 possible boolean algebraic functions. These 16 functions are enumerated below, together with their outputs for each combination of inputs variables.
| INPUT | A | 0 | 0 | 1 | 1 | Meaning | |
|---|---|---|---|---|---|---|---|
| B | 0 | 1 | 0 | 1 | |||
| OUTPUT | FALSE | 0 | 0 | 0 | 0 | Whatever A and B, the output is false. Contradiction. | |
| A AND B | 0 | 0 | 0 | 1 | Output is true if and only if (iff) both A and B are true. | ||
| A B | 0 | 0 | 1 | 0 | A doesn't imply B. True iff A but not B. | ||
| A | 0 | 0 | 1 | 1 | True whenever A is true. | ||
| A B | 0 | 1 | 0 | 0 | A is not implied by B. True iff not A but B. | ||
| B | 0 | 1 | 0 | 1 | True whenever B is true. | ||
| A XOR B | 0 | 1 | 1 | 0 | True iff A is not equal to B. | ||
| A OR B | 0 | 1 | 1 | 1 | True iff A is true, or B is true, or both. | ||
| A NOR B | 1 | 0 | 0 | 0 | True iff neither A nor B. | ||
| A XNOR B | 1 | 0 | 0 | 1 | True iff A is equal to B. | ||
| NOT B | 1 | 0 | 1 | 0 | True iff B is false. | ||
| A B | 1 | 0 | 1 | 1 | A is implied by B. False if not A but B, otherwise true. | ||
| NOT A | 1 | 1 | 0 | 0 | True iff A is false. | ||
| A B | 1 | 1 | 0 | 1 | A implies B. False if A but not B, otherwise true. | ||
| A NAND B | 1 | 1 | 1 | 0 | A and B are not both true. | ||
| TRUE | 1 | 1 | 1 | 1 | Whatever A and B, the output is true. Tautology. | ||
The four functions denoted by arrows are the logical implication functions. These functions are generally less common, and are usually not implemented directly as logic gates, but rather built out of gates like AND and OR
No comments:
Post a Comment