0% found this document useful (0 votes)
12 views

Lecture 09

Uploaded by

ozcan8479
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Lecture 09

Uploaded by

ozcan8479
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

Circuit Simplification/Optimization

Asst. Prof. Mohanad Alayedi


Department of Software Engineering
Haliç University
[email protected]

CEN203, Fall 2024

CEN203, Fall 2024 2024, Dr. Mohanad Alayedi (Haliç University) 1


Overview

 Systematic simplification
– Definitions
 Five variable K-map
 Don’t care conditions in K-maps
 Optimization algorithm

CEN203, Fall 2024 2024, Dr. Mohanad Alayedi (Haliç University) 2


Example

• Simplify using K-map


F(w,x,y,z) = (1,4,5,6,13,14,15)

CEN203, Fall 2024 2024, Dr. Mohanad Alayedi (Haliç University) 3


Example

F(w,x,y,z) = (1,4,5,6,13,14,15)
z

0 1 3 2

1
4 5 7 6

1 1 1
12 13 15 14
x
1 1 1
w 8 9 11 10

y
CEN203, Fall 2024 2024, Dr. Mohanad Alayedi (Haliç University) 4
Example

F(w,x,y,z) = (1,4,5,6,13,14,15)
z
(1,5) = w'y'z
0 1 3 2

1 (4,5) = w'xy'
4 5 7 6
(4,6) = w'xz'
1 1 1
12 13 15 14
x (5,13) = xy'z
1 1 1
w (6,14) = xyz'
8 9 11 10
(13,15) = wxz
(14,15) = wxy
y
CEN203, Fall 2024 2024, Dr. Mohanad Alayedi (Haliç University) 5
Example

F1 = w'y'z + w'xy' + xyz' + wxz


z
(1,5) = w'y'z
0 1 3 2 (4,5) = w'xy'
1
4 5 7 6
(4,6) = w'xz'
1 1 1 (5,13) = xy'z
13 15 14
x
(6,14) = xyz'
12
1 1 1
w 8 9 11 10 (13,15) = wxz
(14,15) = wxy
y
CEN203, Fall 2024 2024, Dr. Mohanad Alayedi (Haliç University) 6
Example

F2 = w'y'z + w'xz' + xy'z + wxy


z
(1,5) = w'y'z
0 1 3 2

1
4 5 7 6
(4,6) = w'xz'
1 1 1 (5,13) = xy'z
12 13 15 14
x
1 1 1
w 8 9 11 10

(14,15) = wxy
y
CEN203, Fall 2024 2024, Dr. Mohanad Alayedi (Haliç University) 7
Example

F3 = w'y'z + w'xz' + xyz' + wxz


z
(1,5) = w'y'z
0 1 3 2

1
4 5 7 6
(4,6) = w'xz'
1 1 1
13 15 14
x
(6,14) = xyz'
12
1 1 1
w 8 9 11 10 (13,15) = wxz

CEN203, Fall 2024 2024, Dr. Mohanad Alayedi (Haliç University) 8


Example

F(w,x,y,z) = (1,4,5,6,13,14,15)

F1 = w'y'z + w'xy' + xyz' + wxz


F2 = w'y'z + w'xz' + xy'z + wxy
F3 = w'y'z + w'xz' + xyz' + wxz

w'y'z is essential!
CEN203, Fall 2024 2024, Dr. Mohanad Alayedi (Haliç University) 9
Systematic simplification

 A Prime Implicant (PI) is a product term obtained by combining the


maximum possible number of adjacent squares in the map into a
rectangle with the number of squares a power of 2.
 A PI is called an Essential Prime Implicant (EPI) if it is the only PI
that covers (includes) one or more minterms.
 PIs and EPIs can be determined by inspection of a K- Map.
 A set of PIs "covers all minterms" if, for each minterm of the
function, at least one PI in the set of PI includes the minterm.

CEN203, Fall 2024 2024, Dr. Mohanad Alayedi (Haliç University) 10


Example of PIs

bc
00 01 11 10
a
Essentials
0 1 3 2
0
1 bc
00 01 11 10
4 1 5 7 1 6 1 a
1
0 1 3 2
0
1
AC'
BC 1 4 1 5 7 1 6 1
AB
AC'
BC
CEN203, Fall 2024 2024, Dr. Mohanad Alayedi (Haliç University) 11
Example of PIs

z yz
x'z' x'y
1 1 1
xz 1 1
x
1 1
w
1 1 1 1

y wx'
wz
CEN203, Fall 2024 2024, Dr. Mohanad Alayedi (Haliç University) 12
Example of EPIs

z yz
x'z' x'y
1 1 1
xz 1 1
x
1 1
w
1 1 1 1

y wx'
wz
CEN203, Fall 2024 2024, Dr. Mohanad Alayedi (Haliç University) 13
PI Exercise 01

• Find all PIs for


F (w,x,y,z) = (0,2,3,8,9,10,11,12,13,14,15)

CEN203, Fall 2024 2024, Dr. Mohanad Alayedi (Haliç University) 14


PI Exercise 01

F = (0,2,3,8,9,10,11,12,13,14,15)
x'y
x'z' 1 1 1

x
1 1 1 1
w
1 1 1 1

y w
CEN203, Fall 2024 2024, Dr. Mohanad Alayedi (Haliç University) 15
PI Exercise 02

• Find all PIs for


F (w,x,y,z) = (0,2,3,4,7,12,13,14,15)

CEN203, Fall 2024 2024, Dr. Mohanad Alayedi (Haliç University) 16


PI Exercise 02

F = (0,2,3,4,7,12,13,14,15)
z
PIs w'x'y
w'x'z' 1 1 1

w'y'z' 1 1
w'y'z
x
xy'z' 1 1 1 1 xy'z
w
wx
y
CEN203, Fall 2024 2024, Dr. Mohanad Alayedi (Haliç University) 17
PI Exercise 02

F = (0,2,3,4,7,12,13,14,15)
z

EPIs 1 1 1

1 1
x
1 1 1 1
w
wx
y
CEN203, Fall 2024 2024, Dr. Mohanad Alayedi (Haliç University) 18
Five variable k-maps

 For five variable problems, we use two adjacent K-maps. It is harder to visualize
adjacent minterms for selecting PIs.
z z
v=0 v=1

x x
w w

y y
CEN203, Fall 2024 2024, Dr. Mohanad Alayedi (Haliç University) 19
Don’t cares in K-maps

 Sometimes a function table or map contains entries for


which it is known:
– the input values for the minterm will never occur, or
– the output value for the minterm is not used
 In these cases, the output value need not be defined
 Instead, the output value is defined as a “don't care”
 By placing “don't cares” ( an “x” entry) in the function table or
map, the cost of the logic circuit may be lowered.

CEN203, Fall 2024 2024, Dr. Mohanad Alayedi (Haliç University) 20


Don’t cares in K-maps

Example 1:
 A logic function having the binary codes for the BCD digits as its inputs. Only the
codes for 0 through 9 are used. The six codes, 1010 through 1111 never occur, so
the output values for these codes are “x” to represent “don’t cares.”

Example 2:
 A circuit that represents a very common situation that occurs in computer design
has two distinct sets of input variables:
– A, B, and C which take on all possible combinations, and
– Y which takes on values 0 or 1.
and a single output Z. The circuit that receives the output Z observes it only for
(A,B,C) = (1,1,1) and otherwise ignores it. Thus, Z is specified only for the
combinations (A,B,C,Y) = 1110 and 1111. For these two combinations, Z = Y. For all
of the 14 remaining input combinations, Z is a don’t care.

CEN203, Fall 2024 2024, Dr. Mohanad Alayedi (Haliç University) 21


Don’t cares in K-maps

 Ultimately, each “x” entry may take on either a 0 or 1 value in


resulting solutions
 For example, an “x” may take on value “0” in an SOP solution
and value “1” in a POS solution, or vice-versa.
 Any minterm with value “x” need not be covered by a
prime implicant.

CEN203, Fall 2024 2024, Dr. Mohanad Alayedi (Haliç University) 22


Example: BCD “6 or more”

 The map below gives a function F1(w,x,y,z) which is defined as “6 or more" over
BCD inputs with treating don’t cares as 0’s.
Z
0 1 3 2

0 0 0 0 F1 = wx'y' + w'xy Cost (G) = 8

4 5 7 6

0 0 1 1
12 13 15 14
x
X X X X
w 8 9 11 10
1 1 X X

y
CEN203, Fall 2024 2024, Dr. Mohanad Alayedi (Haliç University) 23
Example: BCD “6 or more”

 The map below gives a function F2(w,x,y,z) which is defined as “6 or more" over BCD
inputs with treating don’t cares as 1’s.
Z
0 1 3 2

0 0 0 0 F1 = w + xy Cost (G) = 4

4 5 7 6

0 0 1 1
12 13 15 14
x
X X X X
w 8 9 11 10
1 1 X X

y
CEN203, Fall 2024 2024, Dr. Mohanad Alayedi (Haliç University) 24
Product of Sums Example

 Find the optimum POS solution:


F (A,B,C,D) = m(3,9,11,12,13,14,15)+d(1,4,6)

CEN203, Fall 2024 2024, Dr. Mohanad Alayedi (Haliç University) 25


Product of Sums Example

F (A,B,C,D) = m(3,9,11,12,13,14,15)+d(1,4,6)
D
0 1 3 2

0 X 1 0 F1 = AB + AD + B'CD
4 5 7 6

X 0 0 X
12 13 15 14
B
1 1 1 1
A 8 9 11 10
0 1 1 0

C
CEN203, Fall 2024 2024, Dr. Mohanad Alayedi (Haliç University) 26
Product of Sums Example

F (A,B,C,D) = m(3,9,11,12,13,14,15)+d(1,4,6)
D
0 1 3 2

0 X 1 0 F2 = AB + B'D
4 5 7 6

X 0 0 X
12 13 15 14
B
1 1 1 1
A 8 9 11 10
0 1 1 0

C
CEN203, Fall 2024 2024, Dr. Mohanad Alayedi (Haliç University) 27
Optimization Algorithm

 Find all PIs.


 Include all EPIs in the solution
 Select a minimum cost set of non-essential PIs to cover all
minterms not yet covered:
– Obtaining a good simplified solution: Use the Selection Rule

CEN203, Fall 2024 2024, Dr. Mohanad Alayedi (Haliç University) 28


PI Selection Rule

 Minimize the overlap among PIs as much as possible. In


particular, in the final solution, make sure that each PI
selected includes at least one minterm not included in any
other PI selected.

CEN203, Fall 2024 2024, Dr. Mohanad Alayedi (Haliç University) 29


Selection Rule Example

 Simplify
F(A,B,C,D) on K-map
C C

1 1 1 1

1 1 1 1 1 1 1 1
B B
1 1
A A
1 1 1 1

D D
Minterms covered by essential prime implicants
CEN203, Fall 2024 2024, Dr. Mohanad Alayedi (Haliç University) 30
Selection Rule Rxample w/ don’t cares

 Simplify
F(A,B,C,D) on K-map Selected Essential
C C

1 x 1 x

1 x x 1 1 x x 1
B B
x x
A A
1 1 x 1 1 x

D D
Minterms covered by essential prime implicants
CEN203, Fall 2024 2024, Dr. Mohanad Alayedi (Haliç University) 31
References

Logic and Computer Design Fundamentals, by Charles Kime and Thomas Kaminski,
Pearson Education.

CEN203, Fall 2024 2024, Dr. Mohanad Alayedi (Haliç University) 32

You might also like