4 ms·
To be fair, AND, OR and NOT are enough to compute any function, and you can make all the other operators out of a combination of those three. For example A XOR
by wongarsu 4y ago
To be fair, AND, OR and NOT are enough to compute any function, and you can make all the other operators out of a combination of those three. For example A XOR B is just (A OR B) AND (NOT (A AND B)). Knowing things beyond AND, OR or NOT is useful, but not strictly necessary. XOR has useful properties though: with random inputs you get TRUE 50% of the time, allowing you to chain it without trending to 0 or 1; also it's the opposite of bitwise equality.
The others aren't that interesting if you aren't dealing with hardware, and their function is obvious if you know the naming convention.
- dhosek 4y agoNah, all you need are nand gates. Everything else can be implemented from those.
- dan-robertson 4y agoYeah, similarly in mathematics they often like to build everything up from ‘implies’ where the rule is implies(a,b) = or(not(a), b) = nand(a,nand(b, b)).
- OJFord 4y agoYou only need one of {AND, OR} too. ((a or b) is (not ((not a) and (not b))), and vice versa.)
- deleted 4y ago[deleted]