Skip to content

Instantly share code, notes, and snippets.

@ssylvan
Created November 20, 2015 22:40
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 ssylvan/ab93a39a8c2aa1ce35ad to your computer and use it in GitHub Desktop.
Save ssylvan/ab93a39a8c2aa1ce35ad to your computer and use it in GitHub Desktop.
1. AND
2. OR
3. Parity of three bits
inv(x) = nand(x,x)
and(x,y) = inv(nand(x,y))
or(x,y) = nand(inv(x), inv(y))
xor(x,y) = or(x & inv(y), y & inv(x)) = inv(nand(x&inv(y), y&inv(x))) = inv(nand(nand(x, inv(y)), nand(y, inv(x))))
xnor(x,y) = nand(nand(x, inv(y)), nand(y, inv(x)))
par(x,y,z) = or(and(inv(x), xnor(y,z)), and(x, xor(y,z,)))
@ssylvan
Copy link
Author

ssylvan commented Nov 20, 2015

I gueess the parity bit could just be xor(x,xor(y,z)) too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment