Вы находитесь на странице: 1из 6

Boolean Algebra

Boolean Algebra defines a set of laws, operations and theorems on the set of elements
{0, 1}. In this section we look at some of the basic operations, laws, and theorems of
Boolean Algebra and how they can be applied in the simplification of expressions.

Algebra will allow us to describe a circuit as a mathematical expression, as a


functional specification of its outputs in terms of its inputs. It will allow us to
manipulate the functional specification for the purposes of simplification of a circuit
reducing the number of logic gates required to implement it. Algebra will help us
substitute alternative implementation solutions for circuits or parts of circuits that may
require using certain types of logic gates.

We have already defined the operations AND, OR and NOT of the algebra.
Additionally, the following operations are easily derived from these:-

NAND
The NAND operator is the inverse of AND, that is NOT AND

NOT (A AND B) = A.B = A NAND B

The logic symbol for a NAND gate is shown below:-

NOR
The NOR operator is the inverse of OR, that is NOT OR

NOT (A OR B) = A + B = A NOR B
The logic symbol for a NOR gate is shown below:-

XNOR
The Exclusive NOR operator is the inverse of XOR, that is NOT XOR.
It is sometimes referred to as the coincidence or “coin” operator and is written as:-
A B

NOT (A ⊕ B) = A ⊕ B = A NXOR B
= A B

The logic symbol for an XNOR gate is shown below:-

Boolean Functions
A Boolean function consists of a number of Boolean variables joined by Boolean
operators. For example:-

A function of three variables f(A,B,C) may be defined as:-


f(A,B,C) = A.B + B.C + C

Commonly, the product operator, AND is assumed to exist between adjacent variables
and the function can be written as:-
f(A,B,C) = AB + BC + C

The dual of a function is obtained by changing the AND operators to OR and vice
versa and any 1’s to 0’s and vice versa. Therefore, the dual of function f above is
given by
fd(A,B,C) = (A+B)(B+C)C
Two functions are equivalent provided they generate the same output values for each
of the possible combinations of the input variables.

Two functions are complementary provided they generate the opposite output values
to each other for each of the possible combinations of the input variables. The
complement of a function can be found by complementing each variable in the dual of
that function.

For example, the complement of

f(A,B,C) = AB + BC + C
is
f(A,B,C) = (A+B)(B+C)C

Operator Precedence
When evaluating an expression:-
1. Terms in parenthesis are evaluated first from the deepest level of parenthesis
outwards.
2. The AND operator is always performed before OR unless overridden by
parenthesis.

Complete Sets
A collection of operators that can, on their own, be combined to express any Boolean
function is a complete set.

For example, any Boolean function can in fact be expressed using only AND and
NOT operators. This is because AND and NOT can be used to implement OR as
follows:-

A + B = A.B
Similarly, any Boolean function can in fact be expressed using only OR and NOT
operators. This is because OR and NOT can be used to implement AND as follows:-

A.B = A + B

In fact, the derived operator NAND is a complete set in itself as a NAND with both
inputs tied together acts as a NOT (inverter) and two NANDs can be made to function
as an AND as shown below:-

Similarly the derived operator NOR is a complete set in itself. A NOR with both
inputs tied together acts as a NOT (inverter) and two NORs can be made to function
as an OR as shown below.

This means that Boolean functions can be implemented entirely using only NAND
gates or alternatively NOR gates.

Truth Tables
A truth table is a method of describing a Boolean function. It contains a row for every
combination of the variables involved and gives the value of the function for each of
these possible combinations.

Minterms A B C f
m0 0 0 0 0
m1 0 0 1 1
m2 0 1 0 1
m3 0 1 1 1
m4 1 0 0 0
m5 1 0 1 1
m6 1 1 0 0
m7 1 1 1 0

For the three variable function f(A,B,C) whose truth table appears above there are 23
combinations of the variables and the value of the function for each of these
combinations is listed.

The Boolean function described by the truth table is provided by the logical sum of
those combinations for which the function has a value of f=1.

f(A,B,C) = ABC + ABC + ABC + ABC


Each combination of the variables (or row in the table) is called a minterm and the
function tabulated in the truth table can be described as a sum of minterms so that:-

f = Σ m1m2m3m5

which we might abbreviate to:-

f = Σ 1,2,3,5

A Boolean function expressed as a sum of minterms is termed the canonical sum-of-


products form of the function.

The inverse function is obtained by taking the logical sum of those combinations for
which f = 0. From the truth table earlier we have:-

f(A,B,C) = ABC + ABC + ABC + ABC

We can obtain an alternative expression for f by inversion using the principle of


duality:-

f(A,B,C) = (A+B+C)(A+B+C)(A+B+C)(A+B+C)
Each term in this equation is called a maxterm and the Boolean function is expressed
as a product of maxterms. The resulting expression is called the canonical product-of-
sums and may be written as:-

f = ∏ M0M4M6M7

or abbreviated as

f = ∏ 0,4,6,7

A truth table provides a simple way of understanding the operation of a function,


however, truth tables are of limited use for representing more complex Boolean
functions as the number of rows in a the table for an n-variable function is 2n. As n
gets larger, the construction of the table becomes tedious, time consuming and is
prone to error.
Boolean Theorems
The following theorems, which are easily proven using perfect induction or truth
tables are useful for algebraic manipulation and reduction of Boolean expressions.

Single variable theorems.


Theorems exist in pairs with the second form obtained by taking the dual of
the expression.

1. A+A=A
A.A = A

2. A+0=A
A.1 = A

3. A+1=1
A.0 = 0

4. A+A=1
A.A = 0

5. A=A

Theorems of more than one variable


Commutation
6. A+B=B+A
A.B = B.A

Association
7. A + (B + C) = (A + B) + C
A.(B.C) = (A.B).C

Distribution
8. A+B.C = (A + B)(A + C)
A.(B + C) = A.B + A.C

Absorption/Redundancy
9. A + A.B = A ; Prove using single variable theorems
A.(A+B) = A

Consensus
10. A.C + B.C = A.B + A.C + B.C
(A + C)(B + C) = (A + B)(A + C) (B + C)

DeMorgan’s Theorem
11. A+B = A.B
A.B = A + B
Simplification of Expressions

Simplify the following expression:-

f = (A + B)(A + B)(A + C)

(A + B)(A + B) = A + B.B Theorem 8


=A+0 Theorem 4
=A Theorem 2

A(A + C) = AA + AC Theorem 8
= 0 + AC Theorem 4
= AC Theorem 2

So, f = AC

In terms of circuit complexity, we have reduced the


implementation from 7 logic gates/operators to just 1
AND operation using Boolean Algebra.

Вам также может понравиться