You are on page 1of 6

Representing Logic Operations

• Each function can be represented


equivalently in 3 ways:
Digital Logic Design – Truth table
– Boolean logic expression
– Schematics
ENGG1015 Truth Table

1st Semester, 2011

Dr. Kenneth Wong

Boolean
Schematics
Department of Electrical and Expression
Electronic Engineering
5

Determining output level from a diagram Implementing Circuits From Boolean Expressions
• When the operation of a circuit is defined by a Boolean expression, we
can draw a logic-circuit diagram directly from that expression.
• Example: draw the circuit for y = AC + BC + ABC
– Done in two steps

6 7

Truth Table to Boolean Expression Laws of Boolean Algebra


• List all combinations that give 1 at output • Commutative Laws

• Sum up all terms A+ B = B +A

• Sum of products (SOP) – more later


A•B=B•A

ABC • Associative Laws


A BC
x=? A + (B + C) = (A + B) + C

ABC A • (B • C) = (A • B) • C

x = A B C + A BC + ABC 8 9

1
• Distributive Law

A • (B + C) = A • B + A • C
A (B + C) = A B + A C • Rule 1

OR Truth Table
• Rule 2
Rules of Boolean Algebra

• Rule 3

AND Truth Table

10 • Rule 4 11

• Rule 5 • Rule 9

• Rule 10: A + AB = A
– Proof: A+AB = A(1+B) by distributive law
• Rule 6 OR Truth Table
= A·1 by rule 2
=A by rule 4
– Or prove by truth table

• Rule 7

AND Truth Table

• Rule 8 12 13

• Rule 11: A + AB = A + B • Examples:


– Simplify y = ABD + ABD y = AB(D + D) by distributive law
• This rule can only be proved by constructing the truth table (?)
= AB ⋅1 by rule 6
= AB by rule 4

( )
– Simplify z = A + B ( A + B ) z = AA + AB + BA + BB by distributive law
AB = 0 + AB + BA + B by rule 8 and rule 7
= AB + BA + B by rule 1
A
• Rule 12: (A + B)(A + C) = A + BC = B( A + A + 1) by distributive law
AB = B ⋅1 by rule 6 and rule 2
• This rule can only be proved by constructing the truth table (?)
B =B by rule 4

– Simplify x = ACD+ ABCD x = CD ( A + AB) by distributive law


= CD ( A + B ) by rule 11
= ACD + BCD by distributive law

14 15

2
Review Questions DeMorgan’s Theorems
• Theorem 1
• Simplify
y = AC + AB C x + y = x⋅ y Remember:

y = AC • Theorem 2
“Break the bar,
change the operator”
x⋅ y = x + y
y
• Simplify y = A BC D + A BC D – D
DeMorgan's
M ' th
theorem iis very useful
f l iin di
digital
it l circuit
i it d design
i

y = ABD – It allows ANDs to be exchanged with ORs by using invertors


– DeMorgan's Theorem can be extended to any number of
variables. E.g, for three variables x, y and z

• Simplify y = AD + ABD x + y + z = x⋅ y⋅ z
y = AD + BD x⋅ y⋅z = x + y + z
16 17

Quick Quiz (1) Quick Quiz (2)

„ Simplify ( AB + C ) „ Simplify AB ⋅ CD ⋅ EF
• AC + BC • AB + CD + EF
• AC + BC • AB + CD + EF
• AC + BC • AB + CD + EF
• AC + BC • ABCDEF
„ Simplify ( A + C ) ⋅ ( B + D) „ Determine the output expression for the below
• AC + BD circuit and simplify it using DeMorgan’s Theorem
• AC + BD • ABC
• AC + BD • ABC
• AC + BD • A+ B +C
18 • A+ B +C 19

Examples (Summary):
Review Questions
a) ( AB + C ) = AB ⋅ C = ( A + B ) ⋅ C = AC + BC
• Using DeMorgan’s Theorems to convert the
b) ( A + C ) ⋅ ( B + D) = ( A + C ) + ( B + D) = A ⋅ C + B ⋅ D = AC + BD
expressions to one that has only single-variable
c) A + B ⋅ C = A ⋅ ( B ⋅ C ) = A ⋅ ( B + C ) = A( B + C ) inversions.
d) ( A + BC ) ⋅ ( D + EF ) = ( A + BC ) + ( D + EF ) y = R ST + Q y = (R + S +T )Q
= ( A ⋅ BC ) + ( D ⋅ EF )
= A ⋅ (B + C) + D ⋅ (E + F ) z = ( A + B )⋅ C z = AB + C
= AB + AC + DE + DF
e) AB ⋅ CD ⋅ EF = AB + CD + EF = AB + CD + EF y = A + B + CD y = A B (C + D )
f ) Determine the output expression for the below circuit and simplify it
using DeMorgan’s Theorem

20 21

3
Implications of DeMorgan’s Theorems Universality of NAND gates
• Any expression can be implemented using combinations of OR gates, AND gates and
x + y = x⋅ y INVERTERs
• However, it is also possible to implement any logic expression using only NAND
Usually redrawn gates and no other type of gate
• i.e., The AND gate with INVERTERs in this way • This is because NAND gates, in proper combination, can perform Boolean operations
on each of its inputs is equivalent to a OR, AND, and INVERTER
NOR gate

x⋅ y = x+ y

Usually redrawn
• i.e., The OR gate with INVERTERs on in this way
each of its inputs is equivalent to a NAND
gate

22 23

• Example: Suppose we want to implement x=AB+CD.


-- If we directly implement the expression, we need 2 AND gates and 1 OR
gate => we need two ICs
Universality of NOR gate
-- If we transform the circuit into one having only NAND gates, we need • In a similar manner, it can be shown that NOR gates can be arranged to implement
only one IC any of the Boolean operations

IC in Dual-in-line
package (DIP)

Pin diagrams for


the ICs containing NAND,
AND, and OR gates

24 25

Alternate Logic-Gate Representations Several points to note


• Apart from standard logic gate
• The equivalences can be extended to gates with
symbols we have seen so far, there any number of inputs.
are alternate symbols for the
• None of the standard symbols have bubbles on
commonly used gates
• The alternate symbols are obtained their inputs, and all the alternate symbols do.
by performing the following two • The standard and alternate symbols for each gate
steps:
1. Invert each input
p and output p of the represent the same physical circuit; there is no
standard symbol. This is done by difference in the circuits represented by the two
adding bubbles (small circles) on symbols.
input and output lines that do not
have bubbles and by removing • NAND and NOR gates are inverting gates, and so
bubbles that are already there. both the standard and the alternate symbols for
2. Change the operation symbol from
AND to OR, or from OR to AND. each will have a bubble on either the input or the
(In the special case of the output, AND and OR gates are non-inverting
INVERTER, the operation symbol gates, and so the alternate symbols for each will
is not changed.)
have bubbles on both inputs and output.
26 27

4
Why we need alternate representation?
• Proper use of the alternate gate symbols in the circuit diagram can make the
Canonical Form
circuit operation much more easy to understand • Boolean expression can be expressed in
• E.g., the two circuits on the many different ways
(A + D)(B + C) ≡ AB + AC + BD + CD
right are equivalent
• However, circuit (a) does not
facilitate an understanding of • Two standard ways:
how the circuit function
• Circuit (b) is easy to – Sum of Product
understand: Z will go HIGH
whenever either A=B=1 or
– Product of Sum
C=D=1 (or both) • Canonical SOP
• Canonical POS

28 29

Canonical SOP Canonical POS


• Boolean expression expressed as a sum of • Boolean expression expressed as a product
product of basic inputs of sum of basic inputs
– Basic input may optionally negated – Basic input my optionally negated

AB C + BD + AD (A + B + C)(B + D )(A + D)
Product Sum
Product – NOT canonical:
Sum
– NOT canonical: A + B(C + D) – Many parenthesis A + B(C + D)
– No parenthesis • Not too natural for human, but equally good
• Most natural for human for computers.

30 31

Example: This example illustrate the complete procedure for designing a Example: Conversion through the opposite direction: Truth Table
logic circuit. Suppose the logic circuit having 3 inputs, A, B, C will have its
output HIGH only when a majority of the inputs are HIGH.
A B C x
Step 1 Set up the truth table
0 0 0 0
Step 2 Write the AND term for 0 0 1 0

each case where the output 0 1 0 0 y Boolean


Schematics
0 1 1 1 → ABC Expression
is a 1. 1 0 0 0

Step 3 Write the SOP form the output 1 0 1 1 → ABC A B C y

x = ABC + ABC + ABC + ABC


1 1 0 1 → ABC 0 0 0 0
1 1 1 1
→ ABC Step 1 Start from the circuit
0 0 1 0
Step 4 Simplify the output expression A BC ← 0 1 0 1
Step 2 Obtain Boolean expression 0 1 1 1 → ABC
x = ABC + ABC + ABC + ABC + ABC + ABC 1 0 0 0
from the circuit (in SOP form)
= BC ( A + A) + AC ( B + B ) + AB (C + C ) 1 0 1 1 → A BC
= BC + AC + AB y = AC + BC + A BC ABC ← 1 1 0 1
1 1 1 1 → ABC
Step 5 Implement the circuit
32 33
Step 3 Write the truth table

5
Forms of Boolean Expressions Simplifying Logic Circuits
• Once the expression for a logic circuit is obtained, we may try to simplify
• There are two general forms of logic expression: SOP, POS it, so that the implementation requires fewer gates
• Sum-of-products form (SOP) • Example: below two circuits are the same, but the second one is much
more simpler
– first the product (AND) terms are formed then these are summed
(OR)
– eg: ABC + DEF + GHI
• Product-of-sum form (POS)
– first the sum (OR) terms are formed then the products are taken
(AND)
– eg: (A+B+C)(D+E+F)(G+H+I)
• It is possible to convert between these two forms using
Boolean algebra • Two methods for simplifying
– Algebraic method (use Boolean algebra theorems)
– Karnaugh mapping method (next lesson)

34 35

Minimization by Boolean Algebra • Example: Simplify z = ABC + ABC + ABC


• Make use of relationships and theorems of Boolean algebra to simplify
– The expression is already in SOP form
the expressions z = AB (C + C ) + ABC
– this method relies on your algebraic skill = AB (1) + ABC
• Mainly consists of two steps:
= AB + ABC
– The original expression is put into SOP form by repeated application of
DeMorgan’s theorems and multiplication of terms = A( B + BC )
– Once the original expression is in SOP form, the product terms are = A( B + C ) [by rule 11 in previous chapter]
checked for common factors, and factoring is performed wherever
possible • Example: Simplify x = ( A + B )( A + B + D ) D
• Example: Simplify z = ABC + AB ⋅ ( AC )
x = AAD + ABD + ADD + BAD + BBD + BDD [multiply out]
z = ABC + AB ⋅ ( A + C ) [by DeMorgan thm]
= ABD + BAD + BD [AA = 0 and DD = 0]
= ABC + AB ⋅ ( A + C ) [cancel double inverions]
= ABC + ABA + ABC [multiply out] = BD ( A + A + 1) [factoring]
= ABC + AB + ABC [A ⋅ A = A] = BD [A + A = 1 and 1+1=1]
= AC ( B + B ) + AB
= AC + AB [B + B = 1]
= A(C + B ) 36 37

• Example: Simplify z = AC ( ABD ) + ABCD + ABC


– First expand it into SOP form In conclusion…
z = AC ( A + B + D) + ABCD + ABC [DeMorgan thm]
= ACA + ACB + ACD + ABCD + ABC [multiply out] • All logic functions can be represented as
= ACB + ACD + ABCD + ABC [AA = 0] (1) truth table (2) schematics (3) Boolean
– Then look for the largest common factor between any two or more
product terms: first and last terms have BC , while the second and third
expressions, interchangeably
terms share AD • Laws of Boolean algebra helps to simplify
– Grouping the terms gives
z = BC ( A + A) + AD(C + BC ) the Boolean expression
p
= BC + AD(C + B ) [by A + A = 1, C + BC = C + B ] • DeMorgan’s theorems
• We might think that the above expression is the simplest since it
cannot be simplified further • NAND/NOR gates are universal gates
• However, in fact, the simplest form of this equation is z = ABD + BC
• It turns out that we missed an operation earlier that could have led to
• Non-standard representation is equivalent
the simpler form to DeMorgan’s theorems
• Question: How could we have known that we missed a step??
• Ans: There is no way we can know. This illustrate the frustration often
• Canonical SOP/POS
encountered in Boolean simplification
38 39

You might also like