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

Lect#3

Uploaded by

Youssef Ebrahim
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Lect#3

Uploaded by

Youssef Ebrahim
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 53

Design of Logic Systems

(ELC 1710)
Lecture 3

1
2
3
4 bit ripple carry adder circuit.

4
Circuit Optimization
• Goal: To obtain the simplest implementation for a
given function
• Optimization is a more formal approach to
simplification that is performed using a specific
procedure or algorithm
• Optimization requires a cost criterion to measure
the simplicity of a circuit
• Two distinct cost criteria we will use:
• Literal cost (L)
• Gate input cost (G)
• Gate input cost with NOTs (GN)

Chapter 2 - Part 2 5 5
Circuit Optimization

Gate input costs: The number of inputs to the gates in the implementation
corresponding exactly to the given equation or equations. (G - inverters not
counted, GN - inverters counted)
• G (gate input count) adds the remaining OR (AND) gate inputs
• GN (gate input count with NOTs) adds the inverter inputs.
• For SOP and POS equations, it can be found from the equation(s) by finding the
sum of:
• all literal appearances
• the number of terms excluding single literal terms (G) and
• optionally, the number of distinct complemented single literals (GN).
• Example:

F(A, B, C, D) = BD + AB C + AC D L= 8, G = 11, GN = 14
F(A, B, C, D) = BD + AB C + AB D + ABC L= 11, G = 15, GN = 19
F(A, B, C, D) = ( A + B)( A + D)( B + C + D )( B + C + D)
L=10, G = 14, GN = 17
Which solution is the best?

6
Circuit Optimization
Gate input cost with NOTs (GN)
• Example 1: GN = G + 2 = 9
L=5
•F=A+BC+ B C
G=L+2= 7
B
C
A F

▪ L (literal count) counts the AND inputs and the single


literal OR input.
▪ G (gate input count) adds the remaining OR gate inputs
▪ GN(gate input count with NOTs) adds the inverter inputs
7
8 of 30 CSE255 Ch.3 Comb. Logic Prof Fawzy Ibrahim

8
Chapter 3
Gate-Level Minimization

9
Karnaugh (K) Maps

• A graphical representation of Boolean function


• Easy to perform functional reduction
• Relies on adjacency (Gray code) of minterms
• Adjacent (horizontal/vertical & wrap around) cells
differ in only one variable (complement)
• Number form and Variable form

10
K-Maps
• 2 Variable K-Map (Number Form)

Gray code!

Minterm numbers

11
Two Variable Maps
• A 2-variable Karnaugh Map:
• Note that minterm m0 and minterm m1 are “adjacent”
and differ in the value of the variable y
• Similarly, minterm m0 and minterm m2 differ in the x variable.
• Also, m1 and m3 differ in the x variable as well.
• Finally, m2 and m3 differ in the value of the variable y
K-Map and Truth Tables
• The K-Map is just a different form of the truth table.
• Example – Two variable function:
• We choose a,b,c and d from the set {0,1} to implement a particular
function, F(x,y).
Function Table
K-Map
Input Function
Values Value
(x,y) F(x,y) y=0 y=1
00 a x=0 a b
01 b
10 c x=1 c d
11 d
K-Map Function Representation
• Example: F(x,y) = x F=x y=0 y=1
x=0 0 0
x=1 1 1
• For function F(x,y), the two adjacent cells containing 1’s
can be combined using the Minimization Theorem:

F(x, y) = x y + x y = x
K-Map Function Representation
• Example: G(x,y) = x + y G = x+y y = 0 y = 1
x=0 0 1

x=1 1 1

• For G(x,y), two pairs of adjacent cells containing 1’s


can be combined using the Minimization Theorem:

G (x , y ) = (x y + x y )+ (xy + x y )= x + y

Duplicate x y

Chapter 2 - Part 2 15
K-Maps
• 3 Variable K-Map (Number Form)

Gray code!

Minterm numbers

16
K-Maps
• 4 Variable K-Map (Number Form)

Gray code!

Minterm numbers

17
K-Maps
• 2 Variable K-Map (Variable Form)

May be more useful if plotting partially


reduced functions

Careful! Preserve Gray code!

18
K-Maps
• 3 Variable K-Map (Variable Form)

19
K-Maps
• 4 Variable K-Map (Variable Form)

20
My Preference…
Y Y

Z 21
Plotting Functions in K-Maps
Plot the function F1(X,Y,Z) = S(2,5,6,7)
X Y Z F1
0 0 0 0
0 0 1 0
0 1 0 1
0 1 1 0
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1

22
Plotting Functions in K-Maps
Plot the function F2(A,B,C,D) = S(6,7,8,14,15) Plot 0s!

23
Don’t Care
Outputs
Don’t Care Outputs
BCD
A B C D Prime
• Output of Function Doesn’t Matter 0 0 0 0 0 0
• Typically impossible input condition 1 0 0 0 1 1
2 0 0 1 0 1
• Use X instead of 0 or 1 3 0 0 1 1 1
4 0 1 0 0 0
5 0 1 0 1 1
6 0 1 1 0 0
7 0 1 1 1 1
8 1 0 0 0 0
9 1 0 0 1 0
. 1 0 1 0 X
. 1 0 1 1 X
. 1 1 0 0 X
. 1 1 0 1 X
. 1 1 1 0 X
. 1 1 1 1 X

25
Don’t Care Outputs
Compact Minterm and Maxterm Form

• F3(A,B,C) = S(2,6) + Smd(3,5,7) A B C F3


• F3(A,B,C) = S(0,1,4) + Smd(3,5,7) 0 0 0 0
0 0 1 0
• F3(A,B,C) = P(0,1,4)  PMd(3,5,7) 0 1 0 1

• F3(A,B,C) = P(2,6)  PMd(3,5,7) 0 1 1 X


1 0 0 0
1 0 1 X
1 1 0 1
1 1 1 X

26
Plotting K-Maps from functions
in partially reduced form
F4(A,B,C,D) = ABCD + BCD + AB + C
p1 p2 p3 p4

27
Plotting K-Maps from functions
in partially reduced form
F4(A,B,C,D) = ABCD + ABCD + ABC
r1 r2 r3

28
K-Maps for functions of 5 variables
F(V,W,X,Y,Z)

m0 through m15

m16 through m31

29
K-Maps for functions of 5 variables
F(V,W,X,Y,Z) = S(3,7,9,11,12,15,16,19,23,24,27,28,31)
+ Smd(4,18,20,26,30)

30
Using K-Maps
to Reduce
Functions
Using K-Maps to Reduce Functions
Assume you’ve plotted the K-map for F(X,Y,Z) as follows:

32
Using K-Maps to Reduce Functions
You want to obtain a reduced expression for F(X,Y,Z) in SOP form

33
Using K-Maps to Reduce Functions
You want to obtain a reduced expression for F(X,Y,Z) in SOP form

• Need to “cover” 1s
• Fewest product terms
• Simplest expressions
• (fewest variables)

34
Using K-Maps to Reduce Functions
• Circle all isolated 0-cubes

• Circle all 1-cubes not completely


contained in a larger cube

• Continue for 2, 3, 4-cubes

• Write the product terms (prime


implicants) and OR them together

• Write the expression for each product


term

35
Using K-Maps to Reduce Functions

F(X,Y,Z) = p1 + p2 + p3 = XZ + XZ + Y


36
Using K-Maps to Reduce Functions

F(X,Y,Z) = r1 + r2 = XYZ + XYZ


37
K-Map with only essential prime implicants

38
K-Map with no essential prime implicants

39
K-Map with no essential prime implicants

40
K-Map with no essential prime implicants:
alternative!

41
Covering Order is Essential

42
Using K-Maps to Reduce Functions
Given the following K-map, which minimum SOP form of the function
has the smallest literal count (the one for the 1s or the 0s)?

F(W,X,Y,Z) =
F(W,X,Y,Z) =

43
Using K-Maps to Reduce Functions

lc = 6

F(W,X,Y,Z) = p1 + p2 + p3 = XZ + WZ + WY 44


Using K-Maps to Reduce Functions

lc = 7

F(W,X,Y,Z) = r1 + r2 + r3 = WXY + WZ + YZ 45


Using K-Maps to Reduce Functions
Given the following K-map, which minimum SOP form of the function
has the smallest literal count (the one for the 1s or the 0s)?

F(W,X,Y,Z) = p1 + p2 + p3 = XZ + WZ + WY lc = 6

F(W,X,Y,Z) = r1 + r2 + r3 = WXY + WZ + YZ lc = 7

46
Using K-Maps to Reduce Functions
Given the following K-map, which minimum SOP form of the function
has the smallest literal count (the one for the 1s or the 0s)?

F(W,X,Y,Z) =
F(W,X,Y,Z) =
Only use don’t cares to allow larger cube
sizes to be covered

47
Using K-Maps to Reduce Functions

Only use don’t cares to allow larger cube


sizes to be covered

lc = 10

F(W,X,Y,Z) = p1+p2+p3+p4 = XYZ + WXY + WZ + YZ


48
Using K-Maps to Reduce Functions
Only use don’t cares to allow larger cube
sizes to be covered

lc = 7

F(W,X,Y,Z) = r1 + r2 + r3 = WYZ+ XZ + WY


49
K-Maps for functions of 5 variables
F(V,W,X,Y,Z) = S(3,7,9,11,12,15,16,19,23,24,27,28,31)
+ Smd(4,18,20,26,30)

50
Circuits with Multiple Outputs
Product Term Sharing

x1
f1
x2 f2
x3
x4

51
Product Term Sharing
May Result in K-Maps Different from Optimizing Separate Functions

52
53

You might also like