3 ms·
If you make a NOT from an XOR, and already have AND, you've made... NAND! Which is why it isn't a minimal set - because you're using AND and XOR to get NAND,
by analognoise 7y ago
If you make a NOT from an XOR, and already have AND, you've made...
NAND!
Which is why it isn't a minimal set - because you're using AND and XOR to get NAND, which (by itself) is universal!
- adrian_b 7y agoThe question about a minimal set of primitives arises in many domains, not only in Boolean functions, for example in structured programming or in a minimal computer instruction set. In all such domains it is possible to find a set composed of only one primitive and some people think that that is the minimal set because it has a minimum number of primitives. Nevertheless, other people do not agree that the minimum number of primitives is the correct goal for minimal complexity. In all such cases the single primitive is more complex than the primitives belonging to an equivalent set of primitives with more members and it is equivalent to a composition of all the simpler primitives, done in such a way that it is possible to obtain any of the simpler primitives by composing the single primitive with itself. In my opinion, it is nice to know this nice trick about reducing a set of independent primitives to only one, but this almost never has any practical application. When reasoning about that domain, using the single primitive does not make it any easier, because it glues together independent concepts which are easier to handle separate and not in a forced combination. For example, when thinking about Boolean function, it is easier to think about AND-OR stages instead of NAND-NAND, or about OR-AND stages instead of NOR-NOR. So the knowledge about being able to use just NAND does not help you. If we are talking about implementation, there also the single primitive does not help you, because you must actually implement it from more simpler primitives. For example the main blocks for TTL logic are minimum circuits with diodes (AND), parallel transistors (OR) and transistor inverters (NOT), while the main blocks for CMOS logic are parallel transistors, series transistors, transistor inverters and transmission gates. You do not design just a NAND and then make the other cells from it, but you must design at least a NAND, a NOR, a XOR and a multiplexer, then make other functions from these blocks. Knowing that you might use just a NAND does not help you, because any implementation that uses only NAND is less efficient than those based on multiple simpler primitives. An example from another domain, you can use just a WHILE-DO to implement both an IF-THEN and a REPEAT-UNTIL, so you can claim that it is enough to have that primitive. Nevertheless, if you look at the implementation, both IF-THEN and REPEAT-UNTIL are made with a single conditional jump. On the other hand, you must use 2 conditional jumps for a WHILE-DO, there is now way to implement it otherwise than as a composition of IF-THEN with REPEAT-UNTIL. If you implement the simpler primitives with WHILE-DO, you obtain a more inefficient implementation. In conclusion, while it is interesting to know that you can reduce most or all sets of primitives to only one complex primitive, both in theory and in practice the sets of multiple simple primitives are more useful.
- analognoise 7y ago"In my opinion, it is nice to know this nice trick about reducing a set of independent primitives to only one, but this almost never has any practical application." Also, NAND/NOR aren't "complex primitive", they're literally just primitives. You've never used any modern computer? I consider modern computers pretty useful; considering this "trick" backs everything we do with modern computers, I consider it pretty fundamental...