Instruction Guide: boolean logic:guide

Printer-friendly version

One question that comes up frequently is how computers can do complex tasks such as play chess, search the web, and drive automobiles when all they can represent is 0's and 1's? In order to answer that question, we must understand logic, and in particular, boolean logic which operates on 0's and 1's. Note that we could use other symbols for these two values, for example, F and T or False and True. Inside a digital computer, they are represented by different voltages, one high and one low. It can also be implemented by a switch with only two positions.or a valve which is on or off. Daniel Hillis built a digital computer out of Tinker Toys. It is now in the Boston Museum of Science. You can also look at his book The Pattern on the Stone.

The most immediate application of boolean logic is in loops and conditional statements.  By combining boolean expressions, one can often simplify program logic.  Teaching students to use flow charts is one way to approach this subject.  Understanding how to look at the number of possible outcomes for a set of decisions can allow you to re-arrange the flow charts in a more eficient way.

There is a direct connection between boolean logic and set theory.  The operations on sets, such as union, intersection and complement follow the same rules as boolean (propositional) logic.  Mathematical structures which have these properties are called boolean algebras.  Venn diagrams provide a method to visualize set operations, and thus, also help the student understand boolean operators.  With numbers, the standard operations are +, -, *, /, i.e. addition, subtraction, multiplication and division. However, with Boolean values, there are three primary operations called and, or, and not, which are often written as ∧, ∨, and ¬.  Any boolean function can be written in terms of these operators.

A third aspect of boolean logic is being able to write truth tables.  This is a more advanced topic and allows students to understand the difference between or and xor and to prove the rules of boolean logic, such as distributive laws and deMorgan's laws.  It is also a way to verify that a simplification of a boolean expression is correct.