Boolean algebra is a system of algebra (named after the mathematician who studied it, George Boole) based on only two numbers, 0 and 1, commonly thought of as ``false'' and ``true.'' Binary numbers and Boolean algebra are natural to use with modern digital computers, which deal with switches and electrical currents which are either on or off. (In fact, binary numbers and Boolean algebra aren't just natural to use with modern digital computers, they are the fundamental basis of modern digital computers.)
There are four arithmetic operators in Boolean algebra: NOT, AND, OR, and EXCLUSIVE OR.
NOT takes one operand (that is, applies to a single value) and negates it: NOT 0 is 1, and NOT 1 is 0.
AND takes two operands, and yields a true value if both of its operands are true: 1 AND 1 is 1, but 0 AND 1 is 0, and 0 AND 0 is 0.
OR takes two operands, and yields a true value if either of its operands (or both) are true: 0 OR 0 is 0, but 0 OR 1 is 1, and 1 OR 1 is 1.
EXCLUSIVE OR, or XOR, takes two operands, and yields a true value if one of its operands, but not both, is true: 0 XOR 0 is 0, 0 XOR 1 is 1, and 1 XOR 1 is 0.
It is also possible to take strings of 0/1 values and apply Boolean operators to all of them in parallel; these are sometimes called ``bitwise'' operations. For example, the bitwise OR of 0011 and 0101 is 0111. (If it isn't obvious, what happens here is that each bit in the answer is the result of applying the corresponding operation to the two corresponding bits in the input numbers.)
Read sequentially: prev up top
This page by Steve Summit // Copyright 1995, 1996 // mail feedback