| Boolean functions: functional completeness | |||||||||||||
| Sum of products can represent any truth table: | |||||||||||||
| z = p1 + p2 . . . + pn | |||||||||||||
| each pi = l1l2 . . . lm | |||||||||||||
| and each lk is a literal | |||||||||||||
| Applying double negation to the right hand side, | |||||||||||||
| z = ~~(p1 + p2 . . . + pn) | |||||||||||||
| = ~(~p1 * ~p2 . . . * ~pn) | by DeMorgan's law | ||||||||||||
| OR has been eliminated. | |||||||||||||
| Therefore, {NOT, AND} is a functionally complete set. | |||||||||||||
| Similarly, {NOT, OR} is also functionally complete. | |||||||||||||
| Are {AND} and {OR} functionally complete? No. | |||||||||||||
| Consider any Boolean function composed of only these functions. | |||||||||||||
| If all of the inputs are 1, then the output MUST be 1, | |||||||||||||
| and if all the inputs are 0, then the output MUST be 0. | |||||||||||||
| 1 AND 1 == 1, 1 OR 1 == 1 | 0 AND 0 == 0, 0 OR 0 == 0 | ||||||||||||
| However, it is certainly possible to contruct a truth table where the output | |||||||||||||
| is 0 when all the inputs are 1, and vice versa. | |||||||||||||