4.1. Boolean Expressions
Today’s digital circuits are built so that they can perform very fast operations over data that is encoded in binary. The underlying operations are part of what is known as Boolean Algebra. This algebra consists of two values known as true and false, and three operations over those values: conjunction, disjunction and negation. When using digital circuits, the values are also known as 0 and 1, high and low, or on and off. The three operations are also known by the generic names and, or and not respectively. These three operations receive a set of values that are either true or false, and produce another binary value and their definition is shown in the following table:
Operation | Symbols | Result |
---|---|---|
Conjunction | and, * | true when both operands are one |
Disjunction | or, + | true when any operand is one |
Negation | x’,
|
The opposite of the operand |
Out of all the possible symbols to represent the negation operation, we will use the expression
Regular Algebra | Boolean Algebra |
---|---|
1+5=6 | 1 + 0 = 1 |
3*2=6 | 1*1 = 1 |
a+b | a + b (disjunction) |
a*b | a*b (conjunction) |
a' (negation) |
As you can see, the expressions are written representing the conjunction by the symbol *, the disjunction by the symbol +, and negation as an apostrophe following the symbol. In some cases, the conjunction is simply represented by concatenating together two symbols, and conjunction has precedence over disjunction. The following expressions are equivalent:
Any symbol in Boolean algebra can only take the values true and false as opposed to the more familiar decimal algebraic expressions where symbols can take any number. Thus, we can easily enumerate all possible values of a simple expression. For example, the expression for the conjunction of two symbols,
Value of a | Value of b | Value of a*b |
---|---|---|
0 | 0 | 0 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 1 |
This type of table containing all possible combination of values for the symbols that appear in an expression and the result of evaluating the expression is known as the truth table. Thus, the previous table is the truth table of the conjunction of two symbols. Analogously we can create the truth table of the disjunction:
Value of a | Value of b | Value of a+b |
---|---|---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 1 |
And for completeness, the truth table of the negation is:
Value of a | Value of a' |
---|---|
0 | 1 |
1 | 0 |
Boolean expressions can be arbitrarily complex and contain arbitrary operations among symbols, but only using the three operations: conjunction, disjunction and negation. For any Boolean expression, the truth table is obtained by creating a column for each symbol that appears in the expression, one final column with the evaluation of the expression, and for each row, one possible combination of the values of its symbols. Let us consider the following Boolean expression:
The truth table derived from this expression will contain four columns, one for each of the symbols
a | b | c | Result |
---|---|---|---|
0 | 0 | 0 | 0 |
0 | 0 | 1 | 0 |
0 | 1 | 0 | 0 |
0 | 1 | 1 | 1 |
1 | 0 | 0 | 0 |
1 | 0 | 1 | 0 |
1 | 1 | 0 | 1 |
1 | 1 | 1 | 1 |
The values of the fourth column are obtained by substituting each appearance of a symbol by its corresponding value in the row and applying the operation rules previously described. For example, in the third row, the values for the variables are
01 + 10(1 + 0) = 0*1 + 1*0*(1 + 0) = 0 + 1*0*(1 + 0) = 0 + 1*0*1 = 0 + 0 = 0 |
And if we consider the values in the fourth row:
01 + 11(1 + 1) = 0*1 + 1*1*(1 + 1) = 0 + 1*1*(1 + 1) = 0 + 1*1*1 = 0 + 1 = 1 |
The process of substituting the symbols in an expression by a specific set of values is called evaluation. The last column of the truth table of a Boolean expression is then obtained by performing as many evaluations as possible combinations of values for its symbols.
4.1.1. Identical Boolean Expressions
Consider the two Boolean expressions