Skip to content

Instantly share code, notes, and snippets.

@iande
Created October 30, 2011 23:36
Show Gist options
  • Save iande/1326593 to your computer and use it in GitHub Desktop.
Save iande/1326593 to your computer and use it in GitHub Desktop.
XOR to NAND
A XOR B
(A * ~B) + (~A * B)
F + (A * ~B) + (~A * B) + F
(A * ~A) + (A * ~B) + (~A * B) + (B * ~B)
(A * (~A + ~B)) + ((~A + ~B) * B)
(A * (A NAND B)) + ((A NAND B) * B)
~(A NAND (A NAND B)) + ~((A NAND B) NAND B)
(A NAND (A NAND B)) NAND ((A NAND B) NAND B)
@iande
Copy link
Author

iande commented Oct 30, 2011

I'm using * for AND and + for OR to save some space.

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