Loading [MathJax]/jax/output/HTML-CSS/jax.js

Sunday, September 16, 2012

The amazing NAND

If you are in Hong Kong and you need help for university mathematics courses, please visit www.all-r-math.com.

In daily language and mathematical articles, we frequently use the four basic logical operations: "not", "and", "or", "if-then". However, in electronics, the most fundamental logical operation is "nand" -- the NAND ("not and") operation can be used to implement other logical operations.


The symbol for NAND gate.

The truth table of NAND is pqp|qTTFTFFFTFFFT In other words, the output is false only if both p and q are true. (Note that apart from p|q, there are other symbols for NAND, for example pˉq, see here.)

From NAND we can construct the four basic logical operations, which are the building blocks of the symbolic logic:

  • Negation: Not p. p¬pTFFT By comparing its truth table with the truth table of p|p, we see that ¬p=p|p.
  • Conjunction: p and q. pqpqTTTTFFFTFFFF The output is true only if both p and q are true. It turns out that pq=(p|q)|(p|q). Note also that p|q=¬(pq), i.e. "p NAND q" is indeed "Not (p AND q)".
  • Disjunction: p or q. pqpqTTTTFTFTTFFF The output is false only if both p and q are false. It turns out that pq=(p|p)|(q|q).
  • Conditional: If p then q. pqpqTTTTFFFTTFFT The output is false only if p is true but q is false. It turns out that pq=p|(q|q).
It is also possible to build all the logical operations from the NOR ("not or") operation.

No comments:

Post a Comment