[an error occurred while processing this directive]
The binary system allows for a new system of mathematics. In the mid-19th century, George Boole devised such a mathematical system (long before computers were created). The mathematics that he made up are now called boolean algebra. Boolean algebra is used all the time in programming, and is thus very useful to know. At the bottom of the page, we have prepared an applet to show results of boolean operations.
Boolean algebra contains 4 operations: AND, OR, XOR, and NOT.
| A | B | X (A AND B) | ![]() |
| 0 | 0 | 0 | |
| 0 | 1 | 0 | |
| 1 | 0 | 0 | |
| 1 | 1 | 1 |
| A | B | X (A OR B) | ![]() |
| 0 | 0 | 0 | |
| 0 | 1 | 1 | |
| 1 | 0 | 1 | |
| 1 | 1 | 1 |
| A | B | X (A XOR B) | ![]() |
| 0 | 0 | 0 | |
| 0 | 1 | 1 | |
| 1 | 0 | 1 | |
| 1 | 1 | 0 |
| A | X (NOT A) | ![]() |
| 0 | 1 | |
| 1 | 0 |
Although we have not presented them, there are other operations such as NOR, XNOR, and NAND. These particular ones are simply the NOT alternative of OR, XOR, and AND, respectively. The electronic sign for these is the same as what was presented above, except that there is a small circle on the tip, such as the one shown in the NOT picture.
To give you some experience about how all of these operations work, we have written a java applet which is able to execute all of the above boolean operations. However, the applet will be able to do boolean operations on multi-bit numbers. The only difference between that and what we showed you above is that above we used single digits, while with multiple digits the operation is performed on each matching pair of digits (i.e. the first bit of A with the first bit of B, and etc). Since NOT only takes one input, the first input is used when the NOT function is performed.
Note: You will need a Java 1.1 compliant
browser, such as IE 4.0+, and Netscape 4.5+.
Now that you understand everything that there is to know about Boolean algebra, you can go on to the mathematics section.
[an error occurred while processing this directive]