You are on page 1of 34

Switching Circuits & Logic Design

Application of Boolean Algebra


Minterm and Maxterm Expansion
Professor Chien-Mo James Li
Graduate Institute of Electronics Engineering
National Taiwan University
NTUEE C.M. Li

Logic Design

Review Questions
Programmed Exercise 3.1 to 3.5
What is Consensus Theorem?

Any good comparison?

Logic Design

NTUEE C.M. Li

Objective of this Chapter


How to design a combinational logic circuit starting with a word
description of the desired circuit behavior

Logic Design

NTUEE C.M. Li

Outline

Conversion of English Sentences to Boolean Equations.


Combinational Logic Design Using a Truth Table.
Minterm and Maxterm Expansions.
General Minterm and Maxterm Expansions.
Incompletely Specified Functions.
Examples of Truth Table Construction.
Design of Binary Adders.

Logic Design

NTUEE C.M. Li

Steps
From word description to circuits

1. Find a switching function which specifies the desired behavior


Boolean expression or Truth Table
2. Simplify the Boolean expression
3. Realize the simplified function using available logic elements

Logic Design

NTUEE C.M. Li

Example
Mary watches TV (F)

If it is Monday (A)
And
She has finished her homework (B)

Logic Design

NTUEE C.M. Li

Designing an Alarm
Your job:

Please design an alarm circuit that does the following

The alarm will ring (Z) iff

the alarm switch is on (A) and the door is not closed (B)
Or
It is after 6pm (C) and the window is not closed (D)

Logic Design

NTUEE C.M. Li

Answer
Z = AB +CD

Logic Design

NTUEE C.M. Li

Words can be Confusing


Example 1

Teacher says: you will fail the logic design class (F)
If you dont study hard (S) and pass the exam (P)
Does this mean:
F = SP ?
F = SP ?
F = (SP) ?

Example 2

Teacher says: you will fail the logic design class (F)
if you dont study hard (S) or cheat (C)
Does this mean:
F = S + C ?
F = S + C ?
F= (S+C) ? I do not think this one is a good idea
NTUEE C.M. Li

Logic Design

Words can be Confusing (2)


Example 3

You will get fat (F)


if you eat too much (E), or you do not exercise enough (X),
and your metabolism is low (L)
Does this mean:
F=(E+X)L ?
F=E+(XL) ?

Moral

You cannot translate words into Boolean expression literally


Listen to others very carefully

Logic Design

NTUEE C.M. Li

10

Logic Design Flow


Current flow

Near future

Words
(English
Chinese)

Words
(Formal
language)

Hardware description
Language (like Verilog)

IC

Dream
Words
(English
Chinese)

IC

IC

Logic Design

NTUEE C.M. Li

11

Outline

Conversion of English Sentences to Boolean Equations.


Combinational Logic Design Using a Truth Table.
Minterm and Maxterm Expansions.
General Minterm and Maxterm Expansions.
Incompletely Specified Functions.
Examples of Truth Table Construction.
Design of Binary Adders.

Logic Design

NTUEE C.M. Li

12

Design Using Truth Table


General steps

1. make a truth table according to the descriptions


2. produce a Boolean expression
In SOP
In POS
First in SOP, then convert to POS
3. simplify the Boolean expression

13

NTUEE C.M. Li

Logic Design

Threshold Detector
Function description

Design a detector that outputs 1 when input is greater than 2


Page 86
ABC
f
f

>2
?

000

001

010

011

100

101

110

111

Fig. 4-1
Logic Design

NTUEE C.M. Li

14

Solution One SOP


Derive the Boolean expression for f from truth table

Using the combination of values of ABC for which f=1

F=ABC+ABC+ABC+ABC+ABC
Simplify

F=ABC+AB+AB=A+BC

Circuit

ABC

000

001

010

011

100

101

110

111

15

NTUEE C.M. Li

Logic Design

Solution Two POS


Derive the Boolean expression for f from truth table

Using the combination of values of ABC for which f=0

F=(A+B+C)(A+B+C)(A+B+C)
Simplify

F=(A+B)(A+B+C)

Verify

F=A+BC

Logic Design

NTUEE C.M. Li

ABC

000

001

010

011

100

101

110

111

16

Solution 3 f in SOP
If you do not like solution 2, you can try this
First write f in SOP form

F=ABC + ABC + ABC


Then apply De Morgans Law
F = (A+B+C)(A+B+C)(A+B+C)
POS

Logic Design

ABC

000

001

010

011

100

101

110

111

NTUEE C.M. Li

17

Outline

Conversion of English Sentences to Boolean Equations.


Combinational Logic Design Using a Truth Table.
Minterm and Maxterm Expansions.
General Minterm and Maxterm Expansions.
Incompletely Specified Functions.
Examples of Truth Table Construction.
Design of Binary Adders.

Logic Design

NTUEE C.M. Li

18

Minterm
Definition

A minterm of n variables is a product of n literals in which each


variable appears exactly once in either true or complemented
form (but NOT BOTH)
A literal is a variable or its complement
Minterm examples (assume three variables)
ABC , ABC

Not minterm

AABC, AC

NTUEE C.M. Li

Logic Design

19

Minterm (2)
Each minterm has a value of 1 for exactly one combination of values
E.g. A=0 B=1 C=1 ABC=1
Abbreviated form: mi i is row number\
Table 4-1

Logic Design

Row No. i

ABC

minterm

000

ABC = m0

001

ABC = m1

010

ABC = m2

011

ABC = m3

100

ABC = m4

101

ABC = m5

110

ABC = m6

111

ABC = m7
NTUEE C.M. Li

20

Minterm Expansion
When a function is written as a sum of minterms

It is called minterm expansion


Or standard sum of product

Minterm expansion Example

F=ABC+ABC+ABC+ABC+ABC
m-notation
F=m3+m4+m5+m6+m7
F= m(3,4,5,6,7)

Other names of minterm expansion

Row
no.

ABC

minterm

000

m0

001

m1

010

m2

011

m3

100

m4

101

m5

110

m6

111

m7

Canonical sum of product


Or Disjunctive Normal Form (DNF)

21

NTUEE C.M. Li

Logic Design

Relationship
SOP includes minterm expansion

SOP

A+BC

Minterm Exp.
ABC+ABC+ABC+ABC+ABC

Logic Design

NTUEE C.M. Li

22

Maxterm
Definition

A maxterm of n variables is a sum of n literals in which each


variable appears exactly once in either true or complemented
form (but NOT BOTH)
A literal is a variable or its complement
Maxterm examples (assume 3 variables)
A+B+C , A+B+C

Not Maxterm

A+A+B+C, A+C

NTUEE C.M. Li

Logic Design

23

Maxterm (2)
Each maxterm has a value of 0 for exactly one combination of values
E.g. A=0 B=1 C=1 A+B+C=0
Abbreviated form: Mi i is row number
Table 4-1

Logic Design

Row No. i ABC

Maxterm

000

A+B+C = M0

001

A+B+C = M1

010

A+B+C = M2

011

A+B+C = M3

100

A+B+C = M4

101

A+B+C = M5

110

A+B+C = M6

111

A+B+C = M7
NTUEE C.M. Li

24

Maxterm Expansion
When a function is written as a product of maxterms

It is called maxterm expansion


Or standard product of sum

Example

F=(A+B+C)(A+B+C)(A+B+C)

M-notation

F=M0M1M2
F=M(0,1,2)

Other names of maxterm expansion

Row
no.

ABC

maxterm

000

M0

001

M1

010

M2

011

M3

100

M4

101

M5

110

M6

111

M7

Canonical product of sum


Conjunctive Normal Form (CNF)

Logic Design

NTUEE C.M. Li

25

Question
What is the relationship between POS and maxterm expansion?

Logic Design

NTUEE C.M. Li

26

Each minterm is complement of the corresponding maxterm

mi = Mi
Example: m0=ABC=(A+B+C)=M0
Table 4-1
Row No. i ABC

minterm

Maxterm

000

ABC = m0

A+B+C = M0

001

ABC = m1

A+B+C = M1

010

ABC = m2

A+B+C = M2

011

ABC = m3

A+B+C = M3

100

ABC = m4

A+B+C = M4

101

ABC = m5

A+B+C = M5

110

ABC = m6

A+B+C = M6

111

ABC = m7

A+B+C = M7

Logic Design

27

NTUEE C.M. Li

Complement of Minterm Expansion


Original Minterm expansion (eq 4-5)

F=m3+m4+m5+m6+m7
F= m(3,4,5,6,7)

Complement of F

Minterm expansion
F = m0+m1+m2
m(0,1,2) (eq. 4-7)
Maxterm expansion
F= (m3+m4+m5+m6+m7)
= m3 m4 m5 m6 m7
= M3M4M5M6M7

Logic Design

Row
no.

ABC

minterm

000

m0

001

m1

010

m2

011

m3

100

m4

101

m5

110

m6

111

m7

NTUEE C.M. Li

28

Complement of Maxterm Expansion


Original Maxterm expansion (eq 4-6)

F=M0M1M2
F= M(0,1,2)

Complement of F

Maxterm expansion
F= M(3,4,5,6,7)
Minterm
F=(M0 M1 M2)
= M0 +M1 + M2
= m0+m1+m2

Logic Design

(eq 4-8)

Row
no.

ABC

maxterm

000

M0

001

M1

010

M2

011

M3

100

M4

101

M5

110

M6

111

M7

NTUEE C.M. Li

29

Boolean Expression Minterm


1. Use truth table

Sometimes there are too many terms


2. Use Boolean algebra
SOP minterm expansion
POS maxterm expansion
Example P.95 a(b+d)+acd
From SOP to Minterm
Multiplying out
Using X+X=1

From POS to Maxterm


Factoring out
Using XX=0

Logic Design

NTUEE C.M. Li

30

Food for Thought


Q: Why do we have to learn minterm/maxterm expansion since we
already spend a long time to simplify it?

e.g.

F = XY+XZ (simplified SOP)


Two 2-input AND gates, one 2-input OR gate
F = XYZ+XYZ+XYZ+XYZ (minterm expansion)
Four 3-input AND gates, one 3-input OR gate
Expansion results in more terms than simplified SOP/POS

A: hint: answer in text book

Logic Design

NTUEE C.M. Li

31

Outline

Conversion of English Sentences to Boolean Equations.


Combinational Logic Design Using a Truth Table.
Minterm and Maxterm Expansions.
General Minterm and Maxterm Expansions.
Incompletely Specified Functions.
Examples of Truth Table Construction.
Design of Binary Adders.

Logic Design

NTUEE C.M. Li

32

Question
Q: Given three Boolean variables A B C, how many different Boolean
functions can you produce?

Logic Design

ABC

000

001

010

011

100

101

110

111

33

NTUEE C.M. Li

Answer
Every ? Can be 0 or 1
So totally we have 28 =256 possible ways to fill the truth table

Including F=0 and F=1 degenerated cases

Q2: given n Boolean variables

How many possible different functions?

Logic Design

NTUEE C.M. Li

ABC

000

0/1

001

0/1

010

0/1

011

0/1

100

0/1

101

0/1

110

0/1

111

0/1

34

General Truth Table


A general truth table for 3 variables

TABLE 4-2
ai can be 1 or 0
Minterm expansion for a general function of 3 variables
eq.( 4-12)

ai=1 means the minterm is present

Maxterm expression for a general function of 3 variables

Eq. (4-13)

ai = 1 means that maxterm is NOT present

Logic Design

NTUEE C.M. Li

ABC f
000

a0

001

a1

010

a2

011

a3

100

a4

101

a5

110

a6

111

a7

35

Complement
Complement of maxterm expansion

(4.13) = (4.14)
Note: all the minterms that are NOT present in F are present in F

Complement of minterm expansion

(4-12) = (4.15)

Note: all the maxterms that are NOT present in F are present in F

Logic Design

NTUEE C.M. Li

36

Conversions Between Min/Max Terms


Rules

TABLE 4-3

minterm
F

Maxterm
F

minterm
F

Maxterm
F

minterm

m M
#

mM

Maxterm

Mm
#

Mm

37

NTUEE C.M. Li

Logic Design

Conversions Between Min/Max Terms


Example

TABLE 4-4
minterm
F

F=
m(3,4,5,6,7)
F=
M(0,1,2)

Logic Design

Maxterm
F

minterm
F

Maxterm
F

M(0,1,2)

m(0,1,2)

M(3,4,5,6,7)

m(0,1,2)

M(3,4,5,6,7)

m(3,4,5,6,7)

NTUEE C.M. Li

38

AND of Two Minterm Expansions


Give f1 and f2 in minterm expansion, what is f1 AND f2 in minterm
expansion?
Take the numbers that appear in both expansions
(4-18) (4-19)

Example

f1 = m(0, 2, 3, 5, 9, 11) f2 = m(0, 3 ,9 ,11, 13, 14)


f1 f2 = m(0,3,9,11)

NTUEE C.M. Li

Logic Design

39

Food for Thought


Give f1 and f2 in maxterm expansion, what is f1 AND f2 in maxterm
expansion?

HINT: see problem 4.23

Logic Design

NTUEE C.M. Li

40

Outline

Conversion of English Sentences to Boolean Equations.


Combinational Logic Design Using a Truth Table.
Minterm and Maxterm Expansions.
General Minterm and Maxterm Expansions.
Incompletely Specified Functions.
Examples of Truth Table Construction.
Design of Binary Adders.

NTUEE C.M. Li

Logic Design

41

Circuit Partition
Two subcircuits N1 and N2

If N1 doesnt generate all possible combinations of values for A, B, C

it is not necessary to specify all possible input combinations for


N2

Logic Design

NTUEE C.M. Li

42

Incompletely Specified Functions


Function F is incompletely
specified if some input
combinations will not occur in
normal operation
Input combinations that never
occurs are dont care terms

Example

Truth Table with Dont Cares


(D.C.)
TABLE 4-5

Logic Design

43

NTUEE C.M. Li

Simplification of Functions w/ D.C.


One solution (may be stupid but works for now)

Try exhaustive combinations of D.C. to find optimal simplification

P. 94

Logic Design

NTUEE C.M. Li

44

Minterm expansion with Dont Care minterm

F= m(0,3,7) + d(1,6)

Maxterm expansion with Dont Care maxterm

F= M(2,4,5) D(1,6)

Note Dont Care minterm and maxterm have the same numbers
Logic Design

NTUEE C.M. Li

45

Outline

Conversion of English Sentences to Boolean Equations.


Combinational Logic Design Using a Truth Table.
Minterm and Maxterm Expansions.
General Minterm and Maxterm Expansions.
Incompletely Specified Functions.
Examples of Truth Table Construction.
Design of Binary Adders.

Logic Design

NTUEE C.M. Li

46

Example 1
Design a simple binary adder that adds two 1-bit binary numbers to give

a 2-bit sum
P 100
this is called a half adder
a

Sum

00

(0+0=0)

01

(0+1=0)

01

(1+0=0)

10

(1+1=2)

X=AB
Y=AB+AB
Logic Design

Example 2
Design a binary adder that adds two 2bit binary numbers to give a 3-bit binary
sum
P 101

Note

In forming truth table, the variables


A B C D are treated like binary
numbers having numeric values
When forming switching function,
the variables are treated as Boolean
variables having non-numeric
values {0,1}

Logic Design

47

NTUEE C.M. Li

NTUEE C.M. Li

48

Example 3
P.102
6-3-1-1 error detector

Circuit implementation

Logic Design

NTUEE C.M. Li

Example 4
P.103
Design a circuit that

Input 8-4-2-1 BCD code digit


Output =1 iff input decimal
number exactly divisible by 3

Q: why X?

Logic Design

NTUEE C.M. Li

49

50

Outline

Conversion of English Sentences to Boolean Equations.


Combinational Logic Design Using a Truth Table.
Minterm and Maxterm Expansions.
General Minterm and Maxterm Expansions.
Incompletely Specified Functions.
Examples of Truth Table Construction.
Design of Binary Adders.

Logic Design

NTUEE C.M. Li

51

Parallel Adder
Design Goal

a parallel adder that adds two 4-bit unsigned binary numbers


9 inputs : {A1B1 A2 B2 A3 B3 A4 B4} Carry in C0
5 outputs: Sum , Carry out C4
How?
Use a single truth table too big !

Fig. 4-2
Logic Design

NTUEE C.M. Li

52

Parallel Adder Composed of Four FA


Decompose the 4 bit adder into four modules

Each modules adds two bits and a carry


This module is a Full Adder (FA)

Fig 4-3

NTUEE C.M. Li

Logic Design

53

Truth Table of FA
Fig 4-4

X
Y
Cin

Logic Design

Cout
Sum

NTUEE C.M. Li

54

FA (contd)
After simplification

Sum = . = X XOR Y XOR Cin


Cout = YCin + XCin + XY

Circuit implementation

Logic Design

NTUEE C.M. Li

55

How about Signed Numbers?


Review:

For 2s complement, the carry out is discarded


For 1s complement, need end-around carry
The above answers are correct as long as NO OVERFLOW

Surprisingly, the circuit we just design can also add signed


numbers.
For 2s complement, just tie c0 to 0 and ignore c4
The first FA can be further simplified

For 1s complement, feedback c4 to c0

Logic Design

NTUEE C.M. Li

56

Dealing with Overflow


Add an overflow indicator

V= 1 iff
Adding two positive numbers gives a negative result
Or
Adding two negative numbers gives a positive result

V = A3B3S3 + A3B3S3

Logic Design

NTUEE C.M. Li

57

Final Notices about Parallel Adder


Why Parallel?

All inputs are applied altogether, output are produced altogether


In contrast, serial adders , inputs are applied one bit by one bit
This is called a ripple-carry adder because carry bits propagate
along the carry chain FA by FA
Maybe slow when the chain is long
Need smarter design like carry-look-ahead adders

Fig. 4-3

Logic Design

NTUEE C.M. Li

58

Subtracter
X-Y = D
Method 1: reuse the adder to do subtract

Just change the sign of Y


X+(-Y)
Method 2: redesign a subtracter
Using full subtracter (FS)

Logic Design

NTUEE C.M. Li

59

Subtraction Using Adder (1/2)


Change B to 2s complement

Complement each bit


Then add one
The last carry out is ignored

Fig. 4-6
Logic Design

NTUEE C.M. Li

60

Subtraction Using Adder (2/2)


Change B to 1s complement

Complement each bit


Then end-around carry C5 C0

C5

To C0

Logic Design

NTUEE C.M. Li

61

Parallel Subtracter
Figure 4-7
Parallel subtracter can be decomposed into Full Subtracters (FS)

X-Y = D
B is borrow

Logic Design

NTUEE C.M. Li

62

Truth Table of FS
TABLE 4-6
Exercise

Find the simplified Boolean


Expression for the FS
Find the minterm expansion for
FS
Find maxterm expansion for FS

Logic Design

xi

yi

bi

bi+1

Di

NTUEE C.M. Li

63

Food for Thought


Q: Why do we have to learn minterm/maxterm expansion since it
takes us a long time to simplify it?
Expansion results in more terms than simplified SOP/POS forms

e.g.

F = XY+XZ (simplified SOP)


Two 2-input AND gates, one 2-input OR gate
F = XYZ+XYZ+XYZ+XYZ (minterm expansion)
Four 3-input AND gates, one 3-input OR gate

Logic Design

NTUEE C.M. Li

64

Answer
Minterm expansion is canonical

Which means the expansion is unique as long as two Boolean


expressions are the same
i.e. if F=G, their expansions must be the same
Very useful in verification

E.g.

F = XY+XZ (simplified SOP)


G = XY + XZ + YZ (not simplified SOP)
F = XYZ+XYZ+XYZ+XYZ (minterm expansion)
G = XYZ+XYZ+XYZ+XYZ (minterm expansion)
F and G are identical in minterm expansion form (also true to
maxterm expansion)
So F=G

Logic Design

NTUEE C.M. Li

65

Prove of Equations
Because the terms in minterm expansion of a function F correspond

one-to-one with the rows of the truth table for which F=1
The minterm expansion of F is unique
Prove the equation by finding the minterm expansion of each
side and show their expansions are the same
Example
P.96
Show that ac+bc+ab=ab+bc+ac

Logic Design

NTUEE C.M. Li

66

Next Time
ch 1 Introduction Number Systems
and Conversion
ch 2 Boolean Algebra
ch 3 Boolean Algebra (contd)
ch 4. Application of Boolean Algebra
ch 5 Karnaugh Maps
ch 7 Multi-Level Gate Circuits;
NAND NOR Gates
ch 8 Combinational Ckt Design

Logic Design

NTUEE C.M. Li

67

You might also like