0% found this document useful (0 votes)
18 views

CH 2

Boolean algebra defines binary logic operations using a set of elements and operators. It consists of binary variables, operators like AND and OR, and logical identities. Boolean functions can be represented as algebraic expressions or logic circuits using gates. Functions can be simplified algebraically by reducing terms using theorems like DeMorgan's laws. Canonical forms like minterms and maxterms provide a standardized way to write functions from their truth tables by including all variable combinations that produce a 1.

Uploaded by

zinabuhaddis21
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

CH 2

Boolean algebra defines binary logic operations using a set of elements and operators. It consists of binary variables, operators like AND and OR, and logical identities. Boolean functions can be represented as algebraic expressions or logic circuits using gates. Functions can be simplified algebraically by reducing terms using theorems like DeMorgan's laws. Canonical forms like minterms and maxterms provide a standardized way to write functions from their truth tables by including all variable combinations that produce a 1.

Uploaded by

zinabuhaddis21
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Chapter 2

Boolean Algebra and Logic Gates


2.1 Basic Definitions

Boolean algebra, like any other mathematical system, is defined with a set of elements, a set of
operators, and a number of axioms or postulates. It deals with binary variables and logic operations. A
binary operator defined on a set S of elements is a rule that assigns to each pair of elements from S a
unique element from S.

Example, consider the relation a *b = c. We say that * is a binary operator if it specifies a rule for finding
c from the pair (a, b) and also if a, b, c ϵ S. However, * is not a binary operator if a, b ϵ S, and if c is not
element of S ( ).

Boolean algebra is an algebraic structure defined also defined by a set of elements, together with two
binary operators, (+) and (.), and provided that the following (Huntington) postulates are satisfied:

1. (a) The structure is closed with respect to the operator +

(b) The structure is closed with respect to the operator •

2. (a) The element 0 is an identity element with respect to +; that is, x + 0 = 0 + x = x


(b) The element 1 is an identity element with respect to • ; that is, x • 1 = 1 • x = x
3. (a) The structure is commutative with respect to +; that is, x + y = y + x
(b) The structure is commutative with respect to • ; that is, x • y = y • x
4. (a) The operator # is distributive over +; that is, x • (y + z) = (x • y) + (x • z)
(b) The operator + is distributive over • ; that is, x + (y • z) = (x + y) • (x + z)
5. Every element x ϵ B, there exists an element x’ ϵ B (called the complement of x) such that
(a) x + x = 1 and (b) x • x = 0.
6. There exist at least two elements x, y ϵ B such that x ≠ y

2.2 Basic Theorems and Properties of Boolean Algebra


 Duality

Duality principle is an important property of Boolean algebra and has many applications. If the dual of
an algebraic expression is desired, we simply interchange OR and AND operators and replace 1’s by 0’s
and 0’s by 1’s.

Example, x • x = x the dual of this expression is => x + x = x

x • 0 = 0 the dual of this expression is => x + 1 = 1

 Basic Theorems:

Table 2.1 lists six theorems of Boolean algebra and four of its postulates. The theorems and postulates
listed are the most basic relationships in Boolean algebra. The theorems, like the postulates are listed in

1
pairs: each relation is the dual of the one paired with it. The postulates are basic axioms of the algebraic
and need no proof. The theorem must be proven from the postulates.

Proofs of the theorems:

 At the right is listed the number of the postulate which justifies that particular step of the proof.

2
 Operator Precedence: The operator precedence for evaluating Boolean expressions is (1)
Parenthesis, (2) NOT, (3) AND, and (4) OR. In other word, expressions inside parenthesis must be
evaluated before all other operations. The next operation that holds precedence is the complement,
and then follows the AND, finally, the OR.
Example: F = A(B + C)(C + D’)

2.3 Boolean Functions


A Boolean function described by an algebraic expression formed with binary variables (0 or 1), the two
binary operators (OR, AND), the unary operator NOT, parentheses, and equal sign. And For a given value
of the binary variables, the function can be equal to either 1 or 0.
Example, Boolean function F1 = x + y’z

 The function F1=1, if x is equal to 1 or if both y and z are equal to 1


 The function F1= 0, otherwise.

A Boolean function can be represented in a truth table. The number of rows in the truth table is 2n,
where n is the number of variables in the function. The binary combinations for the truth table are
obtained from the binary numbers by counting from 0 through 2n – 1.

Example, Table 2.2 shows the truth table for the function F1. There are eight possible binary
combinations for assigning bits to the three variables x, y, and z. The column labeled F1 contains either 0
or 1 for each of these combinations. The table shows that the function is equal to 1 when x = 1 or when
yz = 01 and is equal to 0 otherwise.
Table 2.2: Truth Tables for F1

3
A Boolean function can be transformed from an algebraic expression into a circuit diagram composed of
logic gates connected in a particular structure. The logic‐circuit diagram (also called a schematic) for F1 is
shown in Fig. 2.1 . There is an inverter (NOT gate) for input y to generate its complement. There is an
AND gate for the term yz and an OR gate that combines x with yz.

Algebraic Manipulation
When a Boolean expression is implemented with logic gates, each term requires a gate and each
variable within the term designates an input to the gate. We define a literal to be a single variable within
a term, in complemented or un complemented form. By reducing the number of terms, the number of
literals, or both in a Boolean expression, it is often possible to obtain a simpler circuit. The manipulation
of Boolean algebra consists mostly of reducing an expression for the purpose of obtaining a simpler
circuit having less number of inputs, may reduce the cost of the implementation.

 There are 2 methods for simplification of Boolean functions.

 The algebraic method: Simplify symbolically using theorems/postulates.

 The graphical method: using Karnaugh Map method (we will see in the next chapter)

Example, Simplify the following Boolean functions to a minimum number of literals using algebraic
method:

1. x(x’ + y) = xx’ + xy = 0 + xy = xy.


2. x + x’y = (x + x’)(x + y) = 1(x + y) = x + y.
3. (x + y)(x + y’) = x + xy + xy’ + yy’ = x(1 + y + y) = x.
4. xy + x’z + yz = xy + x’z + yz(x + x’)
= xy + x’z + xyz + x’yz
= xy(1 + z) + x’z(1 + y)
= xy + x’z.

Complement of a Function
The complement of a function F is F and is obtained from an interchange of 0’s for 1’s and 1’s for 0’s in
the value of F. The complement of a function may be derived algebraically through DeMorgan’s
theorems, listed in Table 2.1 for two variables. DeMorgan’s theorems can be extended to three or more
variables.

4
The three‐variable form of the first DeMorgan’s theorem is derived as follows, from postulates and
theorems listed in Table 2.1 :

(A + B + C)’ = (A + x)’-------  let B + C = x


= A’x’ ------------ by theorem 5(a) (DeMorgan)
= A’(B + C)’ -----  substitute B + C = x
= A’(B’C’) --------- by theorem 5(a) (DeMorgan)
= A’B’C’ -----------  by theorem 4(b) (associative)

DeMorgan’s theorems for any number of variables resemble the two‐variable case in form and can be
derived by successive substitutions similar to the method used in the preceding derivation. These
theorems can be generalized as follows:

(A + B + C + D + …….. + F) = A’B’C’D’… ....... F’

(ABCD…….F) = A’ + B’ + C’ + D’ + ................ + F’

The generalized form of DeMorgan’s theorems states that the complement of a function is obtained by
interchanging AND and OR operators and complementing each literal.

Example, Find the complement of the functions F1 = x’yz’ + x’y’z and F2 = x(y’z’ + yz). By applying
DeMorgan’s theorems as many times as necessary, the complements are obtained as follows:

(F1)’ = (x’yz’ + x’y’z)’ = (x’yz’)’(x’y’z)’ = (x + y’ + z)(x + y + z’)

(F2)’ = [x(y’z’ + yz)]’ = x’ + (yz + yz)’


= x’ + (y’z’)’(yz) = x’ + (y + z)(y’ + z’)
= x’ + yz’ + y’z

2.4 Canonical and Standard Forms


Minterms and Maxterms
A binary variable may appear either in its normal form (x) or in its complement form (x)’. Now consider
two binary variables x and y combined with an AND operation. Since each variable may appear in either
form, there are four possible combinations: x’y’, x’y, xy’, and xy. Each of these four AND terms is called a
Minterm, or a standard product. In a similar manner, n variables can be combined to form 2 n minterms.

In a similar fashion, n variables forming an OR term, with each variable being primed or unprimed,
provide 2n possible combinations, called Maxterms, or standard sums. The eight maxterms for three
variables (x,y,z), together with their symbolic designations(M0, M1,…..M7) are listed in Table 2.3 . Any 2n
maxterms for n variables may be determined similarly.

Note That,

 Each min-term is obtained from an AND term of the n-variables, with each variable being
primed if the corresponding bits is 0 and unprimed if 1.
 Each max-term is obtained from an OR term of the n-variables, with each variable being
unprimed if the corresponding bits is 0 and primed if 1.
 Each max-term is the complement of its corresponding min-term, and vice versa.

5
Table 2.3: Minterms and Maxterms for Three Binary Variables

A Boolean function can be expressed algebraically from a given truth table by forming a Minterm for
each combination of the variables that produces a 1 in the function and then taking the OR of all those
terms. For example, the function f1 in Table 2.4 is determined by expressing the combinations 001, 100,
and 111 as x’y’z, xy’z’, and xyz, respectively. Since each one of these Minterms results in f 1 = 1, we have

f1 = x’y’z + xy’z’ + xyz = m1 + m4 + m7

Similarly, it may be easily verified that

f2 = x’yz + xy’z + xyz’ + xyz = m3 + m5 + m6 + m7

6
These examples demonstrate an important property of Boolean algebra: Any Boolean function can be
expressed as a sum of minterms (with “sum” meaning the ORing of terms).

Now consider the complement of a Boolean function. It may be read from the truth table by forming a
minterm for each combination that produces a 0 in the function and then ORing those terms. The
complement of f1 is read as:

( f1)’ = x’y’z’ + x’yz’ + x’yz + xy’z + xyz’

If we take the complement of (f1)’, we obtain the function f1:


f1 = (x + y + z)(x + y’ + z) (x + y’+ z’) (x’ + y+ z’)(x ‘+ y’ + z)
= M0 • M2 • M3 • M5 • M6

Similarly, it is possible to read the expression for f2 from the table:


f2 = (x + y + z)(x + y + z)(x + y + z)(x + y + z)
= M0• M1• M2• M4

These examples demonstrate a second property of Boolean algebra: Any Boolean function can be
expressed as a product of maxterms (with “product” meaning the ANDing of terms). The procedure for
obtaining the product of maxterms directly from the truth table is as follows: Form a maxterm for each
combination of the variables that produces a 0 in the function, and then form the AND of all those
maxterms. Boolean functions expressed as a sum of minterms or product of maxterms are said to be
in canonical form.

Sum of Minterms
Previously, we stated that, for n binary variables, one can obtain 2n distinct minterms and that any
Boolean function can be expressed as a sum of minterms. The minterms whose sum defines the Boolean
function are those which give the 1’s of the function in a truth table. Since the function can be either 1
or 0 for each minterm, and since there are 2n minterms, one can calculate all the functions that can be
formed with n variables to be 22n. It is sometimes convenient to express a Boolean function in its sum‐
of‐minterms form. If the function is not in this form, it can be made so by first expanding the expression
into a sum of AND terms. Each term is then inspected to see if it contains all the variables. If it misses
one or more variables, it is ANDed with an expression such as x + x’, where x is one of the missing
variables. The next example clarifies this procedure.

Example, Express the Boolean function F = A + BC as a sum of minterms. The function has three
variables: A, B, and C. The first term A is missing two variables; therefore,
A = A(B + B’) = AB + AB’

This function is still missing one variable, so


A = AB(C + C’) + AB(C + C’)
= ABC + ABC’ + AB’C + AB’C’

The second term B’C is missing one variable; hence, B’C = B’C(A + A’) = AB’C + A’B’C

Combining all terms, we have


F = A + B’C
= ABC + ABC’ + AB’C + AB’C’ + A’B’C

7
But, AB’C appears twice, and according to theorem 1 (x + x = x), it is possible to remove one of those
occurrences. Rearranging the minterms in ascending order, we finally obtain
F = A’B’C + AB’C’ + AB’C + ABC’ + ABC
= m1 + m4 + m5 + m6 + m7

When a Boolean function is in its sum‐of‐minterms form, it is sometimes convenient to express the
function in the following brief notation:

F(A, B, C) = Ʃ(1, 4, 5, 6, 7)

The summation symbol Ʃ stands for the ORing of terms; the numbers following it are the indices of the
minterms of the function. The letters in parentheses following F form a list of the variables in the order
taken when the minterm is converted to an AND term.

Product of Maxterms
Each of the 22n functions of n binary variables can be also expressed as a product of maxterms. To
express a Boolean function as a product of maxterms, it must first be brought into a form of OR terms.
This may be done by using the distributive law, x + yz = (x + y)(x + z). Then any missing variable x in each
OR term is ORed with xx’. The procedure is clarified in the following example.
Example, Express the Boolean function F = xy + x’z as a product of maxterms. First, convert the function
into OR terms by using the distributive law:
F = xy + x’z = (xy + x’)(xy + z)
= (x + x’)(y + x’)(x + z)(y + z)
= (x’ + y)(x + z)(y + z)

The function has three variables: x, y, and z. Each OR term is missing one variable; therefore,

X’ + y = x’ + y + zz’ = (x’ + y + z)(x’ + y + z’)


x + z = x + z + yy’ = (x + y + z)(x + y’ + z)
y + z = y + z + xx’ = (x + y + z)(x’ + y + z)
Combining all the terms and removing those which appear more than once, we finally obtain:

F = (x + y + z)(x + y + z)(x + y + z)(x + y + z)


= M0M2M4M5

A convenient way to express this function is as follows:

F(x, y, z) = π(0, 2, 4, 5)

The product symbol, π, denotes the ANDing of maxterms; the numbers are the indices of the maxterms
of the function.

Conversion between Canonical Forms


A Boolean function can be converted from an algebraic expression to a product of maxterms by means
of a truth table and the canonical conversion procedure. Consider the example below:

F = xy + x’z

8
First, we derive the truth table of the function, as shown in Table 2.6. The 1’s under F in the table are
determined from the combination of the variables for which xy = 11 or xz = 01. The minterms of the
function are read from the truth table to be 1, 3, 6, and 7. The function expressed as a sum of minterms
is: F(x,y,z) = ∑ ( 1,3,6,7)

Since there is a total of eight minterms or maxterms in a function of three variables, we determine the
missing terms to be 0, 2, 4, and 5. The function expressed as a product of maxterms is:
F(x, y, z) = π(0, 2, 4, 5)

Standard Forms
The two canonical forms of Boolean algebra are basic forms that one obtains from reading a given
function from the truth table. These forms are very infrequently the ones with the least number of
literals, because each minterm or maxterm must contain, by definition, all the variables, either
complemented or uncomplemented.

Another way to express Boolean functions is in standard form. In this configuration, the terms that form
the function may contain one, two, or any number of literals. There are two types of standard forms:
the sum of products (SOP) and products of sums (POS).

 The sum of products is a Boolean expression containing AND terms, called product terms, with one
or more literals each. The sum denotes the ORing of these terms. An example of a function
expressed as a sum of products is: F1 = y’ + xy + x’yz’
The expression has three product terms, with one, two, and three literals. Their sum is, in effect, an
OR operation.
 The product of sums is a Boolean expression containing OR terms, called sum terms.
Each term may have any number of literals. The product denotes the ANDing of these terms. An
example of a function expressed as a product of sums is: F2 = x(y’ + z)(x’ + y + z’) . This expression
has three sum terms, with one, two, and three literals.

These Standard Form Boolean function expressions results in a two‐level structure of gates (two-level
implementation). As shown in Fig. 2.3 (a) logic diagram for sum‐of‐products and 2.3 (b) logic diagram for
product‐of‐sums.

9
A Boolean function may be expressed in a nonstandard form. For example, the function

F3 = AB + C(D + E)

is neither in sum‐of‐products nor in product‐of‐sums form. The implementation of this expression is


shown in Fig. 2.4 (a) and requires two AND gates and two OR gates. There are three levels of gating in
this circuit. It can be changed to a standard form by using the distributive law to remove the
parentheses:

F3 = AB + C(D + E) = AB + CD + CE

The sum‐of‐products expression is implemented in Fig. 2.4 (b). In general, a two‐level implementation is
preferred because it produces the least amount of delay through the gates when the signal propagates
from the inputs to the output. However, the number of inputs to a given gate might not be practical.

2.5 Other Logic Operations


• n variables can be combined to form 2n (possible combinations) Min-Terms or Max-Terms, and
there are 22n possible functions.

• Example:

– For n = 2, the number of possible Boolean function is 16.

– The AND and OR functions are only two of a total of 16 possible functions.

10
The truth tables for the 16 functions formed with two binary variables are listed in Table 2.7. Each of the
16 columns F0 to F15 represents a truth table of one possible functions for the two given variables x & y.
Table 2.7 Boolean Expressions for the 16 Functions of Two Variables

The 16 functions can be expressed algebraically by means of Boolean functions, as is shown in the first
column of Table 2.8.
Table 2.8: Boolean Expressions for the 16 Functions of Two Variables

11
2.6 Digital Logic Gates
Since Boolean functions are expressed in terms of AND, OR, and NOT operations, it is easier to
implement a Boolean function with these type of gates. Still, the possibility of constructing gates for the
other logic operations is of practical interest. Factors when considering the construction of other types
of logic gates are:

1. The feasibility and economy of producing the gate with physical components.
2. The possibility of extending the gate to more than two inputs.
3. The feasibility and economy of producing the gate with physical components.
4. The possibility of extending the gate to more than two inputs.

The graphic symbols and truth tables of the 8 - gates are shown in Fig. 2.5 . Each gate has one or two
binary input variables, designated by x and y, and one binary output variable, designated by F.

12
13

You might also like