You are on page 1of 93

Switching Algebra & Combinational

Logic Design

1
Outline of this chapter
3.1 Overview
3.2 Switching Algebra
3.3 Basic Gates
3.4 Theorems
3.4.1 One-variable theorems
3.4.2 Two- and Three-variable theorems
3.4.3 n-variable theorems
3.5 Duality
3.6 Standard Representation and Logic Functions
3.6.1 Truth table
3.6.2 Minterm và maxterm
3.6.3 Simplification of logic functions
3.7 Combinational Logic Analysis & Synthesis

2
Reference
• Digital Design: Principles & Practices – John F
Wakerly – Printice Hall

3
3.1 Overview

4
3.1 Boolean Algebra
• 1854: A English mathematician-Gorge Boole
(1815-1864) investigated
• 1938 at Bell Lab: Claude E. Shannon applied
Boole algebra for circuit based on relay,
equivalent with digital circuit.

5
3.2 Axioms
• Axiom 1:
(A1) X = 0 if X ≠ 1
(A1’) X = 1 if X ≠ 0
• Axiom 2: (inverter)
(A2): If X = 0 then X’ = 1
~ X, X
(A2’): If X = 1 then X’ = 0

6
3.2 Axioms
• Axioms 3 , 4 & 5: AND and OR logic gate:

AND : ·
OR : +

7
Basic Gates

8
Basic Gates: NOT

9
Basic Gates: AND

10
Basic Gates: OR

Biểu thức đại số F=A+B


11
More Gates

12
More Gates: NAND

13
More Gates: NOR

14
More Gates: XOR

15
More Gates: XNOR

16
Why we manipulate equation?

17
3.4 Theorems
3.4.1 One-variable theorems

18
3.4.2 Two- and Three variable
Theorems

19
3.4.3 n-variable Theorems

20
Ví dụ: Proof by truth table
Theorem 7’

21
Theorems (T8) – (T11)

22
De Morgan’s Theorem
[F(X1,X2,…,Xn)]’ = FD(X1’, X2’,…,Xn’)

F(X1,X2,…,Xn) = [FD(X1’, X2’,…,Xn’)]’

23
De Morgan’s Theorem

24
Designing with NAND gates

25
Example of De Morgan’s Theorem
NAND gates: 2 ways to view

26
Designing with NOR gates

27
Example of De Morgan’s Theorem
NOR gates: 2 ways to view

28
Exclusive OR Logic Gates: properties

29
XOR & XNOR Gates

30
Example: Complement Funtion

31
Prove F1=F2 (1/3)
By truth table

32
Prove F1=F2 (2/3)

33
Prove F1=F2 (3/3)
• To be completed in class….

34
Ex 1: minimization

35
Ex 2: Minimization

36
Ex 3:

F=?

37
Minimization of F

38
3.6 Standard Representation and Logic Functions

39
3.6 Standard Representation and Logic Functions
3.6.1 Truth table

40
3.6 Standard Representation and Logic Functions
3.6.1 Truth table

41
3.6 Standard Representation and Logic Functions
3.6.2 Minterm and maxterm

Basic definitions

42
3.6 Standard Representation and Logic Functions
3.6.2 Minterm and maxterm

Basic definitions: Minterms

43
3.6 Standard Representation and Logic Functions
3.6.2 Minterm and maxterm

Basic definitions: Minterms

44
3.6 Standard Representation and Logic Functions
3.6.2 Minterm and maxterm

Basic definitions

45
3.6 Standard Representation and Logic Functions
3.6.2 Minterm and maxterm

46
3.6 Standard Representation and Logic Functions
3.6.2 Minterm and maxterm

• A function logic can be represented by:


– canonical sum: Sum of Products (sum of minterms)
corresponding with the row of truth table where the function has
1 logic
– canonical product: Products of Sums (product of maxterms)
corresponding with the row of truth table where the function has
0 logic
• In order to reduce the required gates to have potential
for faster operation, simplification is required

47
Sum of minterm

Product of maxterm

48
49
3.6 Standard Representation and Logic Functions
3.6.2 Minterm and maxterm

• A function logic can be represented by:


– canonical sum: Sum of Products (sum of minterms)
corresponding with the row of truth table where the function has
1 logic
– canonical product: Products of Sums (product of maxterms)
corresponding with the row of truth table where the function has
0 logic
• In order to reduce the required gates to have potential
for faster operation, simplification is required

50
Karnaugh Maps
• Truth table in graphic representation:

51
Karnaugh Map Simplification

52
Simplification: Sum of products

53
2-Varial Map

54
55
Example

56
3-variable map

57
3-variable map

58
Ex: 3-variable map

59
Question 1:

60
4-variable map

61
Example

62
Example 2

63
Incorrected

64
Prime Implicant

65
Ex: K-map with Prime Implicants

66
Ex: K-map with Prime Implicants
• Essential Prime Implicants: EPIs

67
Ex. Covering the other Minterms

68
Example
5-variable K-map

Example
6-variable K-map

69
Converting to Negative Logic

Các biểu thức


biểu diễn các
mạch số này?

70
Example: SOP of F

71
Karnaugh Maps: Summary

72
Karnaugh Maps: Summary

73
Karnaugh Maps: Summary
• Don’t Care cases:

74
Example: Design procedure

75
BCD and I/O

76
BCD 7-Segment: Truth table
A BC D

77
K-map for ‘a’

How about “b”? 78


Testing 1:

79
When the Variable is too much

• From more than 6-variable. algorithm:


– Quine-McCluskey
– Espresso II, Espresso-MV (reference)

80
Quine-McCluskey
• Proposed by W.V. Quine và E.J. McCluskey
in 1950s.

• There are 2 main steps:

 First, find the terms that are candidates for inclusion


in the minimum expansion as a sum of Boolean
products which we call prime elements.
 Second, find the minimized equation from prime
elements.

81
Quine-McCluskey method to find the
minimized sum of minterm

Suppose F is a Boolean function with n variables x1, x2, …, xn. Each


elementary assembly of these n variables is represented by a sequence of n
symbols in the table {0, 1, −} by convention:

•The i-th character is 1 if xi present in the elementary assembly is normal or is


0 with a negative sign, and if xi is not present, the character is −.

•Two elementary assemblies are said to be contiguous if their above


representations differ by only one position 0, 1. Obviously, elementary
assemblies can only be mixed together if they are contiguous.
Quine-McCluskey algorithm

Create a multi-column table to record intermediate


results
•Step 1: Write in the first column the representations
of the minterms of rank n of the Boolean function F.
– The representations are divided into groups, the
representations in each group have an equal number of
bit-1
– the groups are in ascending order of number of bit-1.
Quine-McCluskey algorithm
• Step 2: Perform all the mix of the representations
in group i with the representations in group i+1
(i=1, 2, ...) in turn. Any representation that
participates in at least one mix will be marked with
an * next to it. The results are recorded in the next
column.
• Step 3: Repeat Step 2 for the next column until no
new columns are obtained. Then all
representations without the * will be the prime
elements of F.
Example

• Find prime elements of the following Boole


Function:
• From the above tables, we have the prime
mintern elements form of F1 :
• From the above tables, we have the prime
mintern elements form of F2 :
Quine-McCluskey find minimized
equation:
After finding the reduced sum of the Boolean
function F (all prime elements), we continue the
Quine-McCluskey method to find the minimum
sum of F as follows:
• Make a rectangular table, each column corresponds to a unit
composition of F and each row corresponds to a prime element
of F. In cell (i, j), we mark plus (+) if the prime element in line i is
a subsection of the unit composition in column j.

• The selection of the prime elements on the marked table in order


to obtain a minimized form of sum can proceed according to the
following steps:
• Substep 1: Detect all the principal prime
elements.
• Substep 2: Delete all columns covered by
principal prime elements.
• Substep 3: Delete all the columns without “+”.
• Substep 4: find a set of prime elements S with
the least number of variables covering the
remaining columns .
The sum of the principal prime elements and all
elements of S will be the minimized form of the
functions F.
Example:
• Find the minimized form of Boole for F1.

• All prime elements are principal elements so


F1 is:
Find the minimized form of Boole for F2.

• The principal prime elements are in rows 1 and


2. After reduction, the table remainds rows 3, 4
and a column of 3.
• We can choose one of the two remaining prime
for S. The minimized form of F2:
Exercise Quine-McCluskey

92
Designing Combinational Circuits

93

You might also like