Skip to content

Instantly share code, notes, and snippets.

@jrhorn424
Created April 24, 2015 01:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrhorn424/6ec56674fb2343dd4e7a to your computer and use it in GitHub Desktop.
Save jrhorn424/6ec56674fb2343dd4e7a to your computer and use it in GitHub Desktop.
NAND is the root of all elementary logic.
NAND
====
| x | y | NAND |
| - | - | ---- |
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
NOT(x) = (x NAND x)
===================
| x | NOT |
| - | --- |
| 0 | 1 |
| 1 | 0 |
| x | x | NAND |
| - | - | ---- |
| 0 | 0 | 1 |
| ... | ... | ... |
| 1 | 1 | 0 |
(x AND y) = NOT(x NAND y)
=========================
| x | y | AND |
| - | - | --- |
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
| x | y | NAND | NOT |
| - | - | ---- | --- |
| 0 | 0 | 1 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
(x OR y) = NOT(NOT(x) AND NOT(y))
=================================
| x | y | OR |
| - | - | -- |
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
| x | y | NOT(x) | NOT(y) | AND | NOT |
| - | - | ------ | ------ | --- | --- |
| 0 | 0 | 1 | 1 | 0 | 1 |
| 0 | 1 | 1 | 0 | 0 | 1 |
| 1 | 0 | 0 | 1 | 0 | 1 |
| 1 | 1 | 0 | 0 | 1 | 0 |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment