You are on page 1of 12

EE 120 LECTURE NOTES CHAPTER 3: BOOLEAN ALGEBRA AND LOGIC GATES 3.

Chapter Objectives:
This chapter aims to help the student to:
 be familiar with the basic logic gates and how these are used for logic circuits
 implement circuits from Boolean expressions
 evaluate Boolean expressions and logic circuit outputs for a given input combination
 identify the different Boolean theorems and apply these to simplify logic circuits
 determine minterms given maxterms and vice versa.
 use universal gates to represent basic logic gates
 be acquainted with two-level implementation of logic gates

1. BOOLEAN ALGEBRA FOUNDATION

George Boole
 a british mathematician
 published his paper, “An Investigation of the Laws of Thought ” in 1854.
 paper became the foundation of mathematical theories of logic and probabilities

Claude Shannon
 „father of information theory‟
 first to use Boole‟s work for a concrete application in 1938
 application: analysis and design of telephone switching circuits
 wrote a thesis at MIT on “A Symbolic Analysis of Relay and Switching Circuits”
 became the foundation of switching algebra

2. TERMINOLOGIES AND DEFINITIONS

Boolean algebra – mathematical system of binary logic


– also referred to as switching algebra
variable – a symbol used to represent a logical quantity
literal – a variable, either in complemented or uncomplemented form
truth table – a table that shows how the logic circuit‟s output responds to the various combinations of
logic levels at the inputs
logic gate – a block of hardware that produces a logic 1 or logic 0 output signal if the input logic
requirements are satisfied
– circuit that behaves like a switch according to a set of Boolean rule
– circuit with one or more inputs and only one output
inverter – a logic circuit with only one input and one output wherein the output is always the
complement of the input.
or gate – a logic circuit with at least 2 inputs and only one output wherein a high output is produced
when at least one input is high.
and gate – a logic circuit with at least 2 inputs and only one output wherein a high output is produced
when all of the inputs are high.
minterms – product term that contains all the variables in complemented or uncomplemented form
maxterms – sum term that contains all the variables in complemented or uncomplemented form
EE 120 LECTURE NOTES CHAPTER 3: BOOLEAN ALGEBRA AND LOGIC GATES 3. 2

3. BOOLEAN CONSTANTS AND VARIABLES

 Boolean algebra differs from ordinary algebra in its constants and variables used
 literals may only have two possible values: 0 and 1

 Boolean 0 or 1 do not represent an actual number but the state of a logic level:
logic 0 logic 1
false true
off on
low high
no yes
open switch closed switch

 common application of Boolean variables: representation of voltage levels present on a wire


or at the input/output terminals of a circuit
 easier to manipulate than ordinary algebra for it does not involve fractions, decimals,
negative numbers, nth roots, logarithms, imaginary numbers and the like.
 Boolean algebra is the backbone of computer circuits and other digital circuit since it is used
as a tool for the analysis and design of digital systems.

4. TRUTH TABLE

 illustrates all the possible combinations of inputs for a given number of inputs
 total number of possible input combinations: 2N (where N: no. of input bits)
example: no. of inputs = 3
no. of inputs in the truth table: 23 = 8
truth table:

inputs output
A B C Y
0 0 0 ?
0 1 0 ?
0 0 1 ?
0 1 1 ?
1 0 0 ?
1 0 1 ?
1 1 0 ?
1 1 1 ?

5. BOOLEAN OPERATIONS AND LOGIC GATES

a) Logical Complement or Inversion


 NOT operation, inversion or complementation
 common symbol used: overbar ( a ), prime symbol ( ‟ )
 produces an output which is opposite to the logic value of the input
 example: B
EE 120 LECTURE NOTES CHAPTER 3: BOOLEAN ALGEBRA AND LOGIC GATES 3. 3

 truth table:
input, A output, A
0
1

 NOT circuit: the inverter A A


 The presence of a bubble denotes ___________.
 waveforms:

b) Logical Addition
 OR addition or OR operation
 common symbol used: plus sign (+)
 produces a sum term (sum of literals) wherein the output would be equal to 1 when
___________ ____ of the inputs is 1.
 example: A+ B + C
 truth table:

input output
A B Y
0 0
0 1
1 0
1 1

 OR circuit: OR gate A
Y
B
 waveforms:
EE 120 LECTURE NOTES CHAPTER 3: BOOLEAN ALGEBRA AND LOGIC GATES 3. 4

c) Logical Multiplication
 AND multiplication or AND operation
 common symbol used: dot ( )
 produces a product term (product of literals) wherein the output would be equal to 1 only
when _______ of the inputs are 1.
 example: A B C

 truth table:
input output
A B Y
0 0
0 1
1 0
1 1
A
 AND circuit: AND gate Y
B
 waveforms:

6. LOGIC CIRCUITS AND EXPRESSIONS

a) Algebraic Description of Logic Circuits

Example 1: Describe the circuit below algebraically:


A
Y
B

Example 2: Write the Boolean expression for the given circuit:


A
B Z
C

D
EE 120 LECTURE NOTES CHAPTER 3: BOOLEAN ALGEBRA AND LOGIC GATES 3. 5

b) Circuit Implementation From Boolean Expressions

Example 3: Implement the circuit described by the Boolean expression:


X A B C A D A B C D

Example 4: Illustrate the logic circuit described by the Boolean function below:
W D C A B B D A C

c) Evaluation of Logic Circuit Outputs

Example 5: Evaluate the output of the circuit in example 1 if A = 0 and B = 1

Example 6: Evaluate Z in example 2 given that A = B = 1 and C = D = 0

d) Evaluation of Boolean Expression Outputs

Example 7: Evaluate the output of the Boolean expression in example 3 if A, B and C = 1, D = 0

Example 8: Evaluate W in example 4 if A and C = 0, B and D = 1


EE 120 LECTURE NOTES CHAPTER 3: BOOLEAN ALGEBRA AND LOGIC GATES 3. 6

7. BOOLEAN THEOREMS AND PROPERTIES

a) Boolean Theorems

(1) Single-variable Theorems


(1) x 0 =0
(2) x 1 =x (identity)
(3) x x =x
(4) x x =0 (complement)
(5) x + 0 = x (identity)
(6) x + 1 = 1
(7) x + x = x
(8) x + x = 1 (complement)

(2) Multi-variable Theorems


(9) x + y = y + x (commutative)
(10) x y = y x (commutative)
(11) x +(y + z) = (x + y) + z (associative)
(12) x(yz) = (x y)z (associative)
(13) a) x (y + z) = xy + xz (distributive)
b) y + xz = (x + y)(y + z)
c) (w+x)(y+z) = wy + wz + xy + xz
(14) x + xy = x (proof: factoring)
(15) x + xy = x + y (absorption, proof: trial and error)

b) DeMorgan‟s Theorems
(1) (x + y) = x y
(2) (x y) = x + y

8. SIMPLIFICATION OF BOOLEAN EXPRESSIONS

Order of Precedence
1. parenthesis
2. NOT
3. AND
4. OR

Example 9: Simplify the following Boolean expressions:


a) z ACD ABCD

b) z A + C  B+ D
EE 120 LECTURE NOTES CHAPTER 3: BOOLEAN ALGEBRA AND LOGIC GATES 3. 7

Example 10: Reduce the following Boolean expressions to the indicated number of literals:
a) Y =zD A B AB CD CD AC to 3 literals

b) z A B C A B C A B A B to 1 literal

9. FUNCTIONAL REPRESENTATION OF BOOLEAN EXPRESSIONS

a) Boolean Function in Standard Form


 function expressed as sum of products (SOP) or product of sums (POS) wherein each term
may or may not contain all the variables in the function
examples: F A, B,C = A B+C D
F A, B, C = A+ B+C B+ D D+C

b) Boolean Function in Canonical Form


 function is expressed as a sum of minterms or a product of maxterms wherein each term
contains all the variables in the function

 minterm (mj)
– symbol used to indicate a sum of minterms: mj
– each minterm is obtained from an AND term of n variables
– an uncomplemented variable corresponds to a logic 1 whereas a complemented variable
corresponds to a logic 0

 maxterm (Mj)
– symbol used to indicate a product of maxterms: Mj
– each maxterm is obtained from an OR term of n variables
– an uncomplemented variable corresponds to a logic 0 whereas a complemented variable
corresponds to a logic 1
EE 120 LECTURE NOTES CHAPTER 3: BOOLEAN ALGEBRA AND LOGIC GATES 3. 8

 Number of minterms or maxterms for a Boolean function with n variables: 2N


 Each minterm is the complement of its maxterm:
inputs minterm maxterm
A B C product term mj sum term Mj
0 0 0 m0 M0
0 0 1 m1 M1
0 1 0 m2 M2
0 1 1 m3 M3
1 0 0 m4 M4
1 0 1 m5 M5
1 1 0 m6 M6
1 1 1 m7 M7

c) Minterms/Maxterms Conversion
Determining minterms/maxterms from:

1. Boolean Expressions
Steps:
Change all ORs to ANDs and ANDs to ORs.
Complement each individual variable.
Complement the entire function.
Eliminate all groups of double overbars.

Example 11:
Convert the given expressions to their minterm equivalent:

a.

b. (X+Y+Z) (X+Y+Z) (X+Y+Z)

Example 12:
Convert the given expressions to their maxterm equivalent:
a. MNO + MNO + MNO + MNO

b. ABC + ABC + ABC


EE 120 LECTURE NOTES CHAPTER 3: BOOLEAN ALGEBRA AND LOGIC GATES 3. 9

2. Canonical Forms
A summary of conversion of forms is shown in the table below:

DESIRED FORM
GIVEN minterm maxterm minterm maxterm
FORM expansion of F expansion of F expansion of expansion of
minterm maxterm nos. list minterms maxterm nos.
expansion of F are those nos. not present in are the same as
not on the F. minterms nos.
minterm list for of F.
F.
maxterm minterm nos. minterm nos. list maxterms
expansion of F are those nos. are the same as not present in
not on the maxterm nos. F.
maxterm list of F.
for F.

Example 13:
Given the canonical form:

Find:
a. minterms of F
b. minterms and maxterms of

10. UNIVERSAL GATES


- other types of gates combined from basic gates which could function as basic gates
- easier to fabricate with electronic components and are the basic gates used in IC digital logic
families.

a) Kinds of Universal Gates


(1) NOR gate
 NOT-OR gate (OR gate followed by an INVERTER [simplified through a bubble] )
 common symbol used: plus sign with an overbar
 produces a sum term wherein the output would be equal to 1 when ____ of the inputs are
0.
 example: A B C
EE 120 LECTURE NOTES CHAPTER 3: BOOLEAN ALGEBRA AND LOGIC GATES 3. 10

 truth table:
input output
A B Y
0 0
0 1
1 0
1 1
A
 NOR circuit: OR gate with a bubble or NOR gate Y
B
 waveforms:

(2) NAND gate


 NOT-AND gate (AND gate with a bubble)
 common symbol used: dot with an overbar
 produces a product term wherein the output would be equal to 0 only when _____ of the
inputs are 1.
 example: A B C
 truth table:
input output
A B Y
0 0
0 1
1 0
1 1
A
 NAND circuit: AND gate with a bubble or NAND gate B Y
 waveforms:

b) Alternative Graphical Symbols (using DeMorgan‟s Theorems)

(1) NAND gate: invert-OR (2) NOR gate: invert-AND


A A Y
Y
B B
EE 120 LECTURE NOTES CHAPTER 3: BOOLEAN ALGEBRA AND LOGIC GATES 3. 11

c) Universality of NAND Gate


used as:
(1) Inverter
A A

(2) AND gate


A AB
B

(3) OR gate
A

A+B
B

d) Universality of NOR Gate


used as:
(1) Inverter

A A

(2) OR gate
A
B A+B

(3) AND gate

A
AB

Example 14:
Implement the following functions using minimum number of universal gates:
1) Z = (A+B)(A+C) 2) X = AB + AC
EE 120 LECTURE NOTES CHAPTER 3: BOOLEAN ALGEBRA AND LOGIC GATES 3. 12

e) Two-Level Universal Gates in Boolean Function Implementations


(1) Using Two-Level NAND gates (NAND- NAND)
Steps:
(a) Simplify the given Boolean function F and express it in SOP form
(b) Determine the Boolean expression for F .
(c) Evaluate F by applying DeMorgan‟s theorem once.
(d) For the first level NAND gates: implement each product term that are complemented
using NAND gates
(e) For the second level NAND gates: connect the output of the first-level NAND gates to
a single NAND gate.

Example 15: Implement the Boolean function F using two-level NAND gates, assuming that complemented
inputs are available.
F = AB+AB

(2) Using Two-Level NOR gates (NOR - NOR)


Steps:
(a) Simplify the given Boolean function F and express it in POS form
(b) Determine the Boolean expression for F .
(c) Evaluate F by applying DeMorgan‟s theorem once.
(d) For the first level NOR gates: implement each product term that are complemented
using NOR gates
(e) For the second level NOR gates: connect the outputs of the first-level NOR gates to a
single NOR gate.

Example 16: Implement the Boolean function F using two-level NOR gates, assuming that complemented inputs
are available.
F = AB+AB

References:
 Nagayo, A. M., Swidlec Lecture Notes, DLSU
 Roth, C.H., Jr., Fundamentals of Logic Design, 3rd edition, West Publishing Company, 1985.
 Tocci, R. J., Digital Systems: Principles and Applications, 5 th edition, Prentice Hall Inc., 1991.
 Tokheim, R. L., Digital Electronics: Principles and Applications, 5 th edition, Glencoe Division of Mcmillan/McGraw-Hill
School Publishing Company, 1999.

You might also like