Skip to content

Instantly share code, notes, and snippets.

@rygorous
Created November 23, 2011 19:58
Show Gist options
  • Save rygorous/1389724 to your computer and use it in GitHub Desktop.
Save rygorous/1389724 to your computer and use it in GitHub Desktop.
0000: 0 = a xor a
0001: a and b
0010: a and (not b) = a andc b
0011: b = b and b
0100: (not a) and b = b andc a
0101: a = a and a
0110: a xor b
0111: a or b
1000: (not a) and (not b) = not (a or b) = a nor b
1001: (not a) xor b = a xnor b
1010: not a = a nor a
1011: (not a) or b = (a => b) = b orc a
1100: not b = b nor b
1101: a or (not b) = (b => a) = a orc a
1110: not (a and b) = a nand b
1111: 1 = a xnor a
so need fns:
xor, xnor
and, andc, nand
or, orc, nor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment