Just an entry about the way binary operators work so I can later discuss trinary.
Unary Operators:
Input
01
OutputAlways 000
No Change01
Not10
Always 111Of the possible unary operations NOT is the only one that actually does something. The other three either ignore the input, or don't modify the input at all.
Binary Operators:
Input - A B
0 00 11 01 1
OutputAlways 00000
A And B0001
A And (Not B)0010
A0011
(Not A) And B0100
B0101
A Xor B0110
A Or B0111
Not (A Or B)1000
Not (A Xor B)1001
Not B1010
A Or (Not B)1011
Not A1100
(Not A) Or B1101
Not (A And B)1110
Always 11111
There are 16 possible binary operations. Six of these operations ignore one or both inputs. By applying NOT to either the inputs or the output you can transform some operators into other operators, leaving only three operator groups: And, Or, and Exclusive Or (a.k.a. Xor). NOT could be applied more than once to allow more than one way to "get to" the other operators, but we still need the three operators to get to them all.