Boolean Algebra

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 21

34 Logic Circuit and Switching Theory

CHAPTER 4
LOGIC GATES

At the end of the discussion, you should be able to:


1. Describe the operation of the inverter, the AND, OR, NAND, NOR, XOR
and XNOR gates;
2. Recognize and use both the distinctive shape logic gate symbols and the
rectangular outline logic gate symbols of ANSI/lEEE Standard 91-1984;
3. Express the operation of NOT, AND, OR, NAND, and NOR gates with
Boolean algebra;
4. Simplify Boolean expression using Boolean algebra;
5. Identify a sum-of-products expression - Determine the domain of a
Boolean expression ;
6. Identify a product-of- sums expression ;
7. Convert from one standard form to the other; and
8. Identify the universal gates.

Lessons:
1. Introduction
2. Types of Logic Gates
3. Boolean Algebra
4. Standard Forms of Boolean Expression
5. NAND and NOR Implementation

LESSON 1: INTRODUCTION
The emphasis in this chapter is on the operation, application, and
troubleshooting of logic gates. The relationship of input and output waveforms of
a gate using timing diagrams is thoroughly covered.
Logic symbols used to represent the logic gates are in accordance with
ANSI/lEEE Standard 91-1984. This standard has been adopted by private
industry and the military for use in internal documentation as well as published
literature. Both programmable logic and fixed-function logic are discussed in this

Engr. Pablo B. Asi Engr. Leni A. Bulan Engr. Liza R. Maderazo


Logic Circuit and Switching Theory 35

chapter. Because integrated circuits (ICs) are used in all applications, the logic
function of a device is generally of greater importance to the technician or
technologist than the details of the component-level circuit operation within the IC
package.

LESSON 2: TYPES OF LOGIC GATES

Figure 3
Logic Gates Symbols

The Inverter

The inverter (NOT circuit) performs the operation called inversion or


complementation. The inverter changes one logic level to the opposite level. In
terms of bits, it changes a 1 to a 0 and a 0 to a 1. This operation is represented
by a prime (sometimes by a bar). For example, x’ = z (or x = z) is read “not x is
equal to z,” meaning that z is what x is not. In other words, if x = 1, then z = 0; but
if x = 0, then z = 1.

Engr. Pablo B. Asi Engr. Leni A. Bulan Engr. Liza R. Maderazo


36 Logic Circuit and Switching Theory

Figure 4
Inverter

The AND Gate

The AND gate is one of the basic gates that can be combined to form any
logic function. An AND gate can have two or more inputs and performs what is
known as logical multiplication. This operation is represented by a dot or by the
absence of an operator. For example, x.y=z or xy=z is read “x AND y is equal to
z.” the logical operation AND is interpreted to mean that z=1 if and only if x=1
and y=1; otherwise z=0.

Figure 5
AND Gate

THE OR GATE

The OR gate is another of the basic gates from which all logic functions
are constructed. An OR gate can have two or more inputs and performs what is
known as logical addition. This operation is represented by a plus sign. For

Engr. Pablo B. Asi Engr. Leni A. Bulan Engr. Liza R. Maderazo


Logic Circuit and Switching Theory 37

example, x + y=z is read “x OR y is equal to z,” meaning that z=1 if x=1 or if y=1
or both x=1 and y=1. If both x = 0 and y = 0, then z = 0.

Figure 6
OR Gate

THE NAND GATE

The NAND gate is a popular logic element because it can be used as a


universal gate: that is, NAND gates can be used in combination to perform the
AND, OR, and inverter operations.

Figure 7
NAND Gate

Engr. Pablo B. Asi Engr. Leni A. Bulan Engr. Liza R. Maderazo


38 Logic Circuit and Switching Theory

THE NOR GATE

The NOR gate, like the NAND gate, is a useful logic element because it
can also be used as a universal gate; that is, NOR gates can be used in
combination to perform the AND, OR, and inverter operations.

Figure 8
NOR Gate

THE EXCLUSIVE-OR AND EXCLUSIVE-NOR GATES


Exclusive-OR and exclusive-NOR gates are formed by a combination of
other gates already discussed. However, because of their fundamental
importance in many applications, these gates are often treated as basic logic
elements with their own unique symbols.

Figure 9
XOR Gate

Engr. Pablo B. Asi Engr. Leni A. Bulan Engr. Liza R. Maderazo


Logic Circuit and Switching Theory 39

Figure 10
XNOR Gate

LESSON 3: BOOLEAN ALGEBRA


In 1854, George Boole introduced a systematic treatment of logic and
developed for this purpose an algebraic system now called Boolean Algebra. In
1938, Claude E. Shannon introduced a two-valued Boolean Algebra called
switching algebra, in which he demonstrated that the properties of bi-stable
electrical switching circuits can be represented by this algebra.
For the formal definition of Boolean Algebra, we shall employ the
postulates formulated by E. V. Huntington in 1904, which states that “Boolean
Algebra is a mathematical notation used to represent the function of the digital
circuit. A notation that allows variables & constant to have only two possible
values 0 or 1.”

Boolean Function
It is an expression formed with binary variables, the two binary operates
OR & AND and a unary operators NOT, parenthesis & equal sign. A Boolean
function consists of an algebraic expression formed with binary variables, the
constants 0 and 1, the logic operation symbols, parenthesis, and an equal sign.
For example,
F(X,Y,Z) = X + Y’ Z or F = X + Y’ Z
where X, Y and Z are Boolean variables. A literal is the appearance of a variable
or its complement in a Boolean expression

Engr. Pablo B. Asi Engr. Leni A. Bulan Engr. Liza R. Maderazo


40 Logic Circuit and Switching Theory

A Boolean function can be represented with a truth table and a logic circuit
diagram composed of logic gates. The operator precedence for evaluating
Boolean expressions are as follows:
1. parentheses
2. NOT
3. AND
4. OR
In other words, the expression inside the parentheses must be evaluated
before all other operations. The next operation that holds precedence is the
complement, then follows the AND, and finally OR.

Duality Principle
It states that every algebraic expression deducible from the postulates of
Boolean Algebra remains valid if the operators and identity elements are
interchanged.

Logic Functions: Rationale for Simplification

 Logic Minimization: reduce complexity of the gate level implementation

o reduce number of literals (gate inputs, circuit inputs)

o reduce number of gates

o reduce number of levels of gates

 fewer inputs implies faster gates in some technologies

 fan-ins (number of gate inputs) are limited in some technologies

 Fewer circuit inputs implies fewer I/O pins

 fewer levels of gates implies reduced signal propagation delays

 number of gates (or gate packages) influences manufacturing costs

 In general, need to make tradeoff between circuit delay and reduced


gate count.

Engr. Pablo B. Asi Engr. Leni A. Bulan Engr. Liza R. Maderazo


Logic Circuit and Switching Theory 41

Postulates/Theorems of Boolean Algebra

Table 5
Boolean Algebra

Boolean Boolean
Postulate/Theorem
Addition Multiplication
Postulate 2 x+ 0 = x x.1 = x
Postulate 3, Commutative x+y=y+x xy = yx
Postulate 4, Distributive x(y +z) = xy + xz x + yz = (x + y)(x + z)
Postulate 5 x + x’ = 1 x.x’ = 0
Theorem 1, Idempotency x+x=x x.x = x
Theorem 2, Boundedness x+1=1 x.0 = 0
Theorem 3, Involution (x’)’ = x (x’)’ = x
x + (y + z) =
Theorem 4, Associative x(yz) = (xy)z
(x + y) + z
Theorem 5, De Morgan (x + y)’ =x’y’ (xy)’ = x’ + y’
Theorem 6, Absorption x + xy= x x(x + y) = x

Examples:

Simplify the following Boolean functions to minimum number of literals

1. F = AB + A(B + C) + B(B + C)
ANS:

2. F = (AB’(C + BD) + A’B’)C


ANS:

3. F = A’BC + AB’C’ + A’B’C’ + ABC


ANS:

4. F = (AB + AC)’ + A’B’C


ANS:

Engr. Pablo B. Asi Engr. Leni A. Bulan Engr. Liza R. Maderazo


42 Logic Circuit and Switching Theory

5. F = x’y’ + xy + x’y
ANS:

6. F = (x + y)(x + y’)
ANS:

7. F = x’y + xy’ + xy + x’y’


ANS:

8. F = x’ + xy +xz’ + xy’z’
ANS:

9. F = (X + Y) + (X + Y)Z
ANS:

10. F = AB’(AB’ + B’C)


ANS:

11. F = ABC + AB’C


ANS:

12. F = (AD + B + C)(AD + (B + C)’)


ANS:

13. F = B + AB’C’D
ANS:

14. F = Y’(X + Y + Z)
ANS:

15. F = (X + Y)((X + Y)’ + Z)


ANS:

Engr. Pablo B. Asi Engr. Leni A. Bulan Engr. Liza R. Maderazo


Logic Circuit and Switching Theory 43

Name and section:__________________________ Date:________________


Instructor:_________________________________ Student No:____________

EXERCISE 5
BOOLEAN ALGEBRA

I. Prove the identity of each of the following Boolean equations using algebraic
manipulation
1. X’Y’ + X’Y + XY = X’ + Y
2. A’B + B’C’ + AB + B’C = 1
3. Y + X’Z + XY’ = X + Y + Z
4. X’Y’ + Y’Z + XZ + XY + YZ’ = X’Y’ + XZ + YZ’

II. Reduce the following Boolean expressions to the indicated number of literals
1. F = X’Y’ + XYZ + X’Y TO THREE LITERALS
ANS: _______________________________________

2. F = X + Y(Z + (X + Z)’) TO TWO LITERALS


ANS: _______________________________________

3. F = W’X(Z’ +Y’Z) + X(W + W’YZ) TO ONE LITERAL


ANS: _______________________________________

4. F = (AB + A’B’)(C’D’ + CD) + (AC)’ TO FOUR LITERALS


ANS: _______________________________________

III. Simplify the following Boolean expressions to expressions containing a


minimum number of literals
1. F = BC + B(AD + C’D)
ANS: _______________________________________

2. F = (B+ C’ + BC’)(BC + AB’ + AC)


ANS: _______________________________________

Engr. Pablo B. Asi Engr. Leni A. Bulan Engr. Liza R. Maderazo


44 Logic Circuit and Switching Theory

LESSON 4: STANDARD FORMS OF BOOLEAN EXPRESSIONS


All Boolean expressions, regardless of their form, can be converted into
either of two standard forms: the sum-of-products form or the product-of-sums
form. Standardization makes the evaluation, simplification, and implementation of
Boolean expressions much more systematic and easier.

The Sum-of-Products (SOP) Form


SOP occurs when two or more product terms are summed by Boolean
addition. Some examples are
AB + ABC
ABC + CDE + B’CD’
A’B + A’BC’ + AC
Also, an SOP expression can contain a single-variable term, as in A + A’B’C +
BCD’. In an SOP expression, a single overbar cannot extend over more than one
variable; however, more than one variable in a term can have an overbar. For
example, an SOP expression can have the term A’B’C’ but not (ABC)’

AND/OR Implementation of an SOP Expression


Implementing an SOP expression simply requires ORing the outputs of
two or more AND gates. A product term is produced by an AND operation, and
the sum (addition) of two or more product terms is produced by an OR operation.
Therefore, an SOP expression can be implemented by AND-OR logic in which
the outputs of a number (equal to the number of product terms in the expression)
of AND gates connect to the inputs of an OR gate,

Conversion of a General Expression to SOP Form


Any logic expression can be changed into SOP form by applying Boolean
algebra techniques. For example, the expression A(B + CD) can be converted to
SOP form by applying the distributive law:
A(B + CD) = AB + ACD

Engr. Pablo B. Asi Engr. Leni A. Bulan Engr. Liza R. Maderazo


Logic Circuit and Switching Theory 45

Examples:
Convert each of the following Boolean expressions to SOP form:
(a) F = AB + B(CD + EF)
(b) F = (A + B)(B + C + D)
(c) F = ((A + B)’ + C)’

The Standard SOP Form

So far, you have seen SOP expressions in which some of the product
terms do not contain all of the variables in the domain of the expression. For
example, the expression A’BC’ + AB’D + A’BC’D has a domain made up of the
variables A, B, C. and D. However, notice that the complete set of variables in
the domain is not represented in the first two terms of the expression; that is, D
or D’ is missing from the first term and C or C’ is missing from the second term.
A standard SOP expression is one in which all the variables in the domain
appear in each product term in the expression. For example, AB’CD + A’B’CD’ +
ABC’D’ is a standard SOP expression.

Converting Product Terms to Standard SOP


Each product term in an SOP expression that does not contain all the
variables in the domain can be expanded to standard form to include all variables
in the domain and their complements. As stated in the following steps, a nonstan-
dard SOP expression is converted into standard form using Boolean algebra rule:
A variable added to its complement equals 1.
Step 1. Multiply each nonstandard product term by a term made up of the
sum of a missing variable and its complement. This results in two
product terms. As you know, you can multiply anything by 1 without
changing its value.
Step 2. Repeat Step 1 until all resulting product terms contain all variables
in the domain in either complemented or un-complemented form. In
converting a product term to standard form, the number of product
terms is doubled for each missing variable.

Engr. Pablo B. Asi Engr. Leni A. Bulan Engr. Liza R. Maderazo


46 Logic Circuit and Switching Theory

Examples:
Convert the following Boolean expression into standard SOP form:
1. F = AB’C + A’B’ + ABC’D
2. F = WX’Y + X’YZ’ + WXY’

The Product-of-Sums (POS) Form


When two or more sum terms are multiplied, the resulting expression is a
product-of-sums (POS). Some examples are
(A’ + B)(A + B’ + C)
(A’ + B’ + C’)( C + D’ + E)(B’ + C + D)
(A + B)(A + B’ + C)(A’ + C)
A POS expression can contain a single-variable term, as in A’(A + B’ +
C)(B’ + C ‘+ D’).
In a POS expression, a single overbar cannot extend over more than one
variable; however, more than one variable in a term can have an overbar. For
example, a POS expression can have the term A’ + ‘B + C’ but not (A + B + C)’.

Implementation of a POS Expression


Implementing a pas expression simply requires ANDing the outputs of two
or more OR gates. A sum term is produced by an OR operation and the product
of two or more sum terms is produced by an AND operation. Therefore, a POS
expression can be implemented by logic in which the outputs of a number (equal
to the number of sum terms in the expression) of OR gates connect to the inputs
of an AND gate.

The Standard POS Form


So far, you have seen POS expressions in which some of the sum terms
do not contain all of the variables in the domain of the expression. For example,
the expression has a domain
(A + B’ + C) (A + B + D’) (A + B’ + C’ + D)

Engr. Pablo B. Asi Engr. Leni A. Bulan Engr. Liza R. Maderazo


Logic Circuit and Switching Theory 47

made up of the variables A. B. C, and D. Notice that the complete set of variables
in the domain is not represented in the first two terms of the expression; that is, D
or D’ is missing from the first term and C or C’ is missing from the second term.
A standard POS expression is one in which all the variables in the domain
appear in each sum term in the expression. For example,
(A’ + B’ + C’ + D’)(A + B’ + C + D)(A + B + C’ + D)
is a standard POS expression. Any nonstandard pas expression (referred to
simply as POS) can be converted to the standard form using Boolean algebra.

Converting a Sum Term to Standard POS


Each sum term in a POS expression that does not contain all the variables
in the domain can be expanded to standard form to include all variables in the
domain and their complements. As stated in the following steps, a nonstandard
POS expression is converted into standard form using Boolean algebra rule: A
variable multiplied by its complement equals O.

Step 1. Add to each nonstandard product term a term made up of the


product of the missing variable and its complement. This results in
two sum terms. As you know, you can add 0 to anything without
changing its value.
Step 2. Apply: A + BC = (A + B)(A + C)
Step 3. Repeat Step 1 until all resulting sum terms contain all variables in
the domain in either complemented or uncomplemented form.

Examples:
Convert the following Boolean expression into standard POS form:
1. F = (A + B’ + C)(B’ + C + D’)(A + B ‘+ C’ + D)
2. F = (A + B’)(B + C)

Engr. Pablo B. Asi Engr. Leni A. Bulan Engr. Liza R. Maderazo


48 Logic Circuit and Switching Theory

Converting Standard SOP to Standard POS


The binary values of the product terms in a given standard SOP
expression are not present in the equivalent standard POS expression. Also, the
binary values that are not represented in the SOP expression are present in the
equivalent POS expression. Therefore, to convert from standard SOP to
standard POS, the following steps are taken:
Step 1. Evaluate each product term in the SOP expression. That is,
determine the binary numbers that represent the product terms.
Step 2. Determine all of the binary numbers not included in the evaluation
in Step 1.
Step 3. Write the equivalent sum term for each binary number from Step 2
and express in POS form.
Using a similar procedure, you can go from POS to SOP.

Example:
Convert the following SOP expression to an equivalent POS expression:
A’B’C’ + A’BC’ + A’BC + ABC + ABC

LESSON 5: NAND & NOR IMPLEMENTATION


NAND and NOR are universal gates. Any basic logic function (AND, OR
and NOT) can be implemented using these gates only. Therefore digital circuits
are more frequently constructed with NAND or NOR gates that with AND, OR
and NOT gates. Moreover NAND and NOR gates are easier to fabricate with
electronic components and are the basic gates used in all IC digital logic families.
Because of this prominence, rules and procedures have been developed for
implementation of Boolean functions by using either NAND gates only or NOR
gates only.

Engr. Pablo B. Asi Engr. Leni A. Bulan Engr. Liza R. Maderazo


Logic Circuit and Switching Theory 49

Implementation of a Multistage (or Multilevel) Digital Circuit using NAND


Gates Only
To facilitate the implementation using NAND gates only, we first define
two graphic symbols for these gates as follows.

Figure 11
NAND Gate Representations

To obtain a multilevel NAND circuit from a given Boolean function, the


procedure is as follows:
1. From the given Boolean function, draw the logic diagram using basic
gates (AND, OR and NOT). In implementing digital circuit, it is
assumed that both normal and inverted inputs are available. (e.g., If x
and x’ both are given in function, we can apply them directly that is
there is no need to use an inverter or NOT gate to obtain x’ from x).
2. Convert all AND gates to NAND using AND-invert symbol.
3. Convert all OR gates to NAND using Invert-OR symbol.
4. Since each symbol used for NAND gives inverted output, therefore it is
necessary to check that if we are getting the same value as it was at
input. [For example if the input is in its normal form say x, the output
must also be x, not x’ (inverted or complemented value). Similarly if
input is in its complemented form say x’, the output must also be x’, not
x (normal value)]. If it is not so, then for every small circle that is not
compensated by another small circle in the same line, insert an
inverter (i.e., one input NAND gate) or complement the input variable.

Engr. Pablo B. Asi Engr. Leni A. Bulan Engr. Liza R. Maderazo


50 Logic Circuit and Switching Theory

Now consider a Boolean function to demonstrate the procedure:


Y = A + (B + C’) (D’E + F)

Step 1. We first draw the logic diagram using basic gates. (It is assumed that
both normal and complemented forms are available i.e., no need of
inverter).

Step 2 and 3

Step 4. From the above figures obtained from step 2 and 3, it is very clear that
only two inputs D’ and E are emerging in the original forms at the output. Rest
i.e., A, B’, C and F are emerging as the complement of their original form. So we
need an inverter after inputs A, B’, C and F or alternatively we can complement
these variables Now because both the symbols AND-invert and invert-OR

Engr. Pablo B. Asi Engr. Leni A. Bulan Engr. Liza R. Maderazo


Logic Circuit and Switching Theory 51

represent a NAND gate, thus it can be converted into one symbol diagram shown
below. The two symbols were taken just for simplicity of implementation.

Implementation of a Multilevel digital circuit using NOR gates only


We first define two basic graphic symbols for NOR gates as shown

Figure 12
NOR Gate Representations

Procedures to obtain a multilevel NOR circuit from a given Boolean


function are as follows:
1. Draw the AND-OR logic diagram from the given expression. Assume
that both normal and complemented forms are available.
2. Convert all OR gates to NOR gates using OR-invert symbol.
3. Convert all AND gates to NOR gates using invert-AND symbol.
4. Any small circle that is not complement by another small circle along
the same line needs an inverter (one input NOR gate) or the
complementation of input variable.

Consider a Boolean expression to demonstrate the procedure:


Y = (A’ + B)(C + D’) E + (F + G’)

Engr. Pablo B. Asi Engr. Leni A. Bulan Engr. Liza R. Maderazo


52 Logic Circuit and Switching Theory

Step 1. We first draw the AND-OR logic diagram shown

Step 2 and 3. Here we have to convert all OR gates to NOR using OR-invert and
all AND gates to NOR using invert AND symbol.

Step 4. From figure above it is clear that all the input variables are emerging in
the same form at the output Y as they were at input. Therefore there is no need
of inverter at inputs or complementing the input variables. Here again, both
symbols OR-invert and invent-AND represent a NOR gate.

Engr. Pablo B. Asi Engr. Leni A. Bulan Engr. Liza R. Maderazo


Logic Circuit and Switching Theory 53

Name and section:__________________________ Date:________________


Instructor:_________________________________ Student No:____________

EXERCISE 6
STANDARD FORMS OF BOOLEAN EXPRESSIONS

1. For the Boolean functions E and F, as given in the following truth table:
x y z E F
0 0 0 1 0
0 0 1 0 0
0 1 0 1 1
0 1 1 0 0
1 0 0 0 1
1 0 1 1 0
1 1 0 1 1
1 1 1 0 1

a. List the minterms and maxterms of each function.


b. List the minterms of E’ and F’.
c. List the minterms of E+F and E•F.
d. Express E and F in sum-of-minterms algebraic form
e. Simplify E and F to a expression with a minimum of literals and draw
the equivalent logic circuit.

2. Using NAND gates produce a graphical realization of


a. Inverter c. OR

b. AND d. XOR

3. Using NOR gates also produce a graphical realization of

Engr. Pablo B. Asi Engr. Leni A. Bulan Engr. Liza R. Maderazo


a. Inverter

b. AND c. OR

Engr. Pablo B. Asi Engr. Leni A. Bulan Engr. Liza R. Maderazo

You might also like