From Logic Operators to Calculations
Combining trivial Boolean logic operations can lead to a number of surprising capabilities, such as the ability to perform arithmetic operations on binary representations of numbers. This is where things get interesting.
A set of XOR and AND gates, for example, can be used to increase an input number by 1, and this is the first step on our way toward addition. Figure 2-3 shows a design for a counter, based on this concept.
Ah, a new term! XOR is yet another “convenient” Boolean logic operator that is true only when one of its operands is true. In this regard, it is closer to the usual meaning of “or” in English. XOR is often used to simplify notation, but otherwise easy to implement by other means, by recombining ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access