0% found this document useful (0 votes)
6 views35 pages

EC4010Digital Design - Gate-Level Minimization L3

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)
6 views35 pages

EC4010Digital Design - Gate-Level Minimization L3

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/ 35

Gate level optimization

K-Map (Karnaugh Map)

• Find an optimal gate-level implementation of the Boolean


functions describing a digital circuit.

• The K- map method provides a simple and straightforward


procedure.

• The K-map is known as Karnaugh map.

• The K-map is a diagram made up with squares, with each


square represents one minterm of a function that is to be
minimized.
Two variable K-Map

Consider the following Boolean expressions F1 and F2,


below.
a) 𝐹1 = 𝑥𝑦
b) 𝐹2 = 𝑥 ! 𝑦 + 𝑥𝑦! + 𝑥𝑦
The representations of the above functions in K-Maps
with possible grouping are,
x\y 0 1
x\y 0 1
0 0 0 0 1
0
1 0 1
1 1 1

(a) (b)
Two variable K-Map

Consider the following Boolean expressions F1 and F2,


below.
a) 𝐹1 = 𝑥𝑦
b) 𝐹2 = 𝑥 ! 𝑦 + 𝑥𝑦! + 𝑥𝑦 = x+ y
The representations of the above functions in K-Maps
with possible grouping are,
x\y 0 1
x\y 0 1 y
0 0 0 0 1
0
1 0 1
1 1 1

x (b)
(a)
Three variable K-Map
• There are eight minterms for three variables.
• The minterms are arranged not in binary sequences
but in a sequence similar to Gray code.
• For example, the square assigned to m6
corresponds to row 1 and column 10.
Four variable K-Map
• There are 16 minterms for four variables.
K-map rules
Simplify Boolean functions

𝐹 𝑥, 𝑦, 𝑧 = ' (3,4,6,7)

𝐹 𝑥, 𝑦, 𝑧 = ∑ (3,4,6,7) = yz + xz’
Exercises.

𝐹 = 𝐴!𝐶 + 𝐴!𝐵 + 𝐴𝐵!𝐶 + 𝐵𝐶


1. Express this function as a sum of minterms.
2. Find the minimal sum-of-products expression.

𝐹 𝐴, 𝐵, 𝐶 = ∑ (1,2,3,5,7) = C + A’B
Exercises.
Simplify the Boolean expression, given below using K
– Map.
𝐹 𝑥, 𝑦, 𝑧 = ( (0,2,4,5,6)

F = z’ + xy’
Exercises.

Simplify the following Boolean expressions using K-


Map method.
𝐹 𝑤, 𝑥, 𝑦, 𝑧 = ∑(0, 1, 2, 4, 5, 6, 8, 9, 12, 13, 14)

a) 𝐹 𝑤, 𝑥, 𝑦, 𝑧 = 𝑦! + 𝑤 ! 𝑧 ! + 𝑥𝑧!
Exercises.

Simplify the following Boolean expressions using K-


Map method.
𝐹 𝐴, 𝐵, 𝐶, 𝐷 = 𝐴 ! 𝐵 ! 𝐶 ! + 𝐵 ! 𝐶𝐷 ! + 𝐴!𝐵𝐶𝐷! + 𝐴𝐵!𝐶′

𝐹 𝐴, 𝐵, 𝐶, 𝐷 = 𝐴 ! 𝐵 ! 𝐶 ! + 𝐵 ! 𝐶𝐷 ! + 𝐴!𝐵𝐶𝐷! + 𝐴𝐵 ! 𝐶 ! = 𝐵 ! 𝐷 ! + 𝐵 ! 𝐶 ! + 𝐴!𝐶𝐷′
Product of sums simplification in K-
Maps
1. Simplify the following Boolean expression into
a) sum of products form
b) product of sums form
𝐹 𝐴, 𝐵, 𝐶, 𝐷 = ; 𝑚 0, 1, 2, 5, 8, 9, 10

𝐹 𝐴, 𝐵, 𝐶, 𝐷 = ( 𝑚 0, 1, 2, 5, 8, 9, 10 = (𝐴! + 𝐵!)(𝐶! + 𝐷!)(𝐵! + 𝐷)


Product of sums simplification in K-
Maps.
Exercise.
2. Simplify the following Boolean expression into
a) sum of products form and
b) product of sums form
i. X’Z’ + Y’Z’ + YZ’ + XY
ii. ACD’ + C’D + AB’ + ABCD
iii. (A’ + B + D’)(A’ + B’ + C’)(A’ + B’ + C)(B’ +
C + D’)
Don’t care terms in K-map (2)

An example truth table with don’t care terms.


Inputs Output Inputs Output

A B C D Y A B C D Y

0 0 0 0 0 1 0 0 0 1

0 0 0 1 0 1 0 0 1 1

0 0 1 0 0 1 0 1 0 X

0 0 1 1 0 1 0 1 1 X

0 1 0 0 0 1 1 0 0 X

0 1 0 1 0 1 1 0 1 X

0 1 1 0 0 1 1 1 0 X

0 1 1 1 1 1 1 1 1 X
Don’t care terms in K-map.

• A don’t care condition is a combination of inputs


for which the designer don’t care what the output
is.
• A K-map can be used to minimize a function which
has don’t care terms
A don’t care term can be included or excluded
from any rectangular group of mapping.
Exercise

1. Simplify the Boolean function,


𝐹 𝑤, 𝑥, 𝑦, 𝑧 = ∑(1, 3, 7,11, 15) ,
which has the following don’t care terms.
𝑑= ; (0, 2, 5)
Prime implicants and Essential Prime
implicants.
• A prime implicant is a product term obtained by
combining maximum possible number of adjacent
squares in a map.
• If a minterm in a square is covered by only one
prime implicant, that prime implicant is said as an
essential prime implicant.

Prime implicants - 2 Prime implicants - 4


Essential prime implicants - 2
A B C D
m0 0 0 0 0
Quine–McCluskey algorithm m1 0 0 0 1
m3 0 0 1 1
m7 0 1 1 1
• 𝐹 𝐴, 𝐵, 𝐶, 𝐷 = ∑ 𝑚 0,1,3,7,8,9,11,15 m8 1 0 0 0
m9 1 0 0 1
m11 1 0 1 1
• Group minterms according to number of 1’s in their
m15 1 1 1 1
binary representations.
Group Minterm Binary Group Matched Binary representation
representation Pairs
A B C D
A B C D
m0 - m1
0 m0 0 0 0 0 0
m0 - m8
m1 0 0 0 1 m1 - m3
1
m8 1 0 0 0 1 m1 - m9

m3 0 0 1 1 m8 - m9
2 m3 - m7
m9 1 0 0 1
2 m3 - m11
m7 0 1 1 1
3 m7 - m11
m11 1 0 1 1
m9 - m15
4 m15 1 1 1 1 3
m11 - m15
Quine–McCluskey
algorithm-Tabular method
• K-Map & Boolean algebra become difficult to optimise
• When variable is > 6

• Quine-McCluskey minimize Boolean algebra in following steps


• Finding prime implicants.
• Optimizing prime implicants

• Example
• Minimize the following function using Quine-McCluskey method.

𝐹 𝐴, 𝐵, 𝐶, 𝐷 = ; 𝑚 0,1,3,7,8,9,11,15
A B C D
m0 0 0 0 0
Quine–McCluskey algorithm m1 0 0 0 1
m3 0 0 1 1
m7 0 1 1 1
• 𝐹 𝐴, 𝐵, 𝐶, 𝐷 = ∑ 𝑚 0,1,3,7,8,9,11,15 m8 1 0 0 0
m9 1 0 0 1
m11 1 0 1 1
• Group minterms according to number of 1’s in their
m15 1 1 1 1
binary representations.
Group Minterm Binary Group Matched Binary representation
representation Pairs
A B C D
A B C D
m0 - m1 0 0 0 _
0 m0 0 0 0 0 ✔ 0
m0 - m8 _ 0 0 0
m1 0 0 0 1 ✔ m1 - m3 0 0 _ 1
1
m8 1 0 0 0 ✔ 1 m1 - m9 _ 0 0 1

m3 0 0 1 1 ✔ m8 - m9 1 0 0 _
2 m3 - m7 0 _ 1 1
m9 1 0 0 1 ✔
2 m3 - m11 _ 0 1 1
m7 0 1 1 1 ✔
3 m7 - m11 1 0 _ 1
m11 1 0 1 1 ✔
m9 - m15 _ 1 1 1
4 m15 1 1 1 1 ✔ 3
m11 - m15 1 _ 1 1
A B C D
m0 0 0 0 0
Quine–McCluskey algorithm m1 0 0 0 1
m3 0 0 1 1
m7 0 1 1 1
• 𝐹 𝐴, 𝐵, 𝐶, 𝐷 = ∑ 𝑚 0,1,3,7,8,9,11,15 m8 1 0 0 0
m9 1 0 0 1
m11 1 0 1 1
m15 1 1 1 1

Group Matched Binary representation Group Matched Pairs Binary representation


Pairs
A B C D A B C D
m0 - m1 0 0 0 _ m0 - m1 - m8 - m9
0 0
m0 - m8 _ 0 0 0 m0 - m8 - m1 - m9
m1 - m3 0 0 _ 1 m1 - m3 - m9 - m11
1
1 m1 - m9 _ 0 0 1 m1 - m9 - m3 - m11
m8 - m9 1 0 0 _ m3 - m7 - m11 - m15
2
m3 - m7 0 _ 1 1 m3 - m11 - m7 - m15
2 m3 - m11 _ 0 1 1
m9 - m11 1 0 _ 1
m7 - m15 _ 1 1 1
3
m11 - m15 1 _ 1 1
A B C D
m0 0 0 0 0
Quine–McCluskey algorithm m1 0 0 0 1
m3 0 0 1 1
m7 0 1 1 1
• 𝐹 𝐴, 𝐵, 𝐶, 𝐷 = ∑ 𝑚 0,1,3,7,8,9,11,15 m8 1 0 0 0
m9 1 0 0 1
m11 1 0 1 1
m15 1 1 1 1

Group Matched Binary representation Group Matched Pairs Binary representation


Pairs
A B C D A B C D
m0 - m1 0 0 0 _ ✔ m0 - m1 - m8 - m9 _ 0 0 _
0 0 B’C’
m0 - m8 _ 0 0 0 ✔ m0 - m8 - m1 - m9 _ 0 0 _
m1 - m3 0 0 _ 1 ✔ m1 - m3 - m9 - m11 _ 0 _ 1
1 B’D
1 m1 - m9 _ 0 0 1 ✔ m1 - m9 - m3 - m11 _ 0 _ 1
m8 - m9 1 0 0 _ ✔ m3 - m7 - m11 - m15 _ _ 1 1
2 CD
m3 - m7 0 _ 1 1 ✔ m3 - m11 - m7 - m15 _ _ 1 1
2 m3 - m11 _ 0 1 1 ✔
m9 - m11 1 0 _ 1 ✔
m7 - m15 _ 1 1 1 ✔
3
m11 - m15 1 _ 1 1 ✔
A B C D
m0 0 0 0 0
Quine–McCluskey algorithm m1 0 0 0 1
m3 0 0 1 1
m7 0 1 1 1
• 𝐹 𝐴, 𝐵, 𝐶, 𝐷 = ∑ 𝑚 0,1,3,7,8,9,11,15 m8 1 0 0 0
m9 1 0 0 1
m11 1 0 1 1
m15 1 1 1 1

Primary Matched Pairs Binary representation


Implica
nts 0 1 3 7 8 9 11 15

B’C’ m0, m1, m8, m9


B’D m1, m3, m9, m11
CD m3, m7, m11, m15

𝐹 𝐴, 𝐵, 𝐶, 𝐷 = 𝐵 ! 𝐶 ! + 𝐶𝐷
A B C D
m0 0 0 0 0
Quine–McCluskey algorithm m1 0 0 0 1
m3 0 0 1 1
m7 0 1 1 1
• 𝐹 𝐴, 𝐵, 𝐶, 𝐷 = ∑ 𝑚 0,1,3,7,8,9,11,15 m8 1 0 0 0
m9 1 0 0 1
m11 1 0 1 1
m15 1 1 1 1

Primary Matched Pairs Binary representation


Implica
nts 0 1 3 7 8 9 11 15

B’C’ m0, m1, m8, m9 x x x x


B’D m1, m3, m9, m11 x x x x
CD m3, m7, m11, m15 x x x x

𝐹 𝐴, 𝐵, 𝐶, 𝐷 = 𝐵 ! 𝐶 ! + 𝐶𝐷
Exercise
Minimize the following function using Quine McCulskey method.

𝐹 𝐴, 𝐵, 𝐶, 𝐷 = ෍ 𝑚 2,4,10,12, 14 + 𝑑(0,1,5,8)
Universal logic gates
NAND and NOR gates are said to be as universal logic gates, as
these gates can be used to construct any other logic gates.
e.g.

Not gate AND gate OR gate


NAND and NOR gates are easier to fabricate with electronic
components.
NAND & NOR implementation

• Digital circuits are frequently constructed


• NAND or NOR gates rather than with AND and OR gates.

• The NAND gate is said to be a universal gate because any logic circuit
can be implemented with it.
Exercise

• Implement the following with NAND gates


𝐹 𝑤, 𝑥, 𝑦, 𝑧 = ∑(1, 2,3,4,5,7)
F = xy’ + x’y + z

You might also like