You are on page 1of 25

Cairo Faculty of Computers

University and Information

Logic Design
CS221
1st Term 2009-2010

K-Map
Administrivia

imagine cup (imaginecup.com): tutorial session,
Wednesday @3pm in seminar room

bonus winners (correct answer + explanation)
 Mostafa Ahmed Sayed - 20080311
 Mostafa Mohamed Mostafa - 20070434
 Mido Talaat, Aya Elkady - 20080088
 Mohamed Mahmoud Sayed - 20080272
 Ahmed Emad Samy Yossef - 20080020

lab 2 is significantly longer than lab 1

email subject must include the word CS221

project groups: GA and GB
http://www.fci.cu.edu.eg/~skhattab/cs221/project.php
13/10/2009 cs221 – sherif khattab 2
boolean functions

input -> output

binary variables (and constants) and logic
operations

defined by a truth table

for two variables, only 16 boolean functions
possible. why?
 how many possible truth tables?
2n

for n variables, 2 boolean functions

13/10/2009 cs221 – sherif khattab 3


gate-level minimization

Boolean function representation
 truth table: one way
 algebraic form (and logic circuit): many ways
 simplest and cheapest circuit

minimum # terms -> min. # gates

minimum # literals per term -> min. # inputs to each gate

not unique

gate-level minimization
 automatic (logic synthesis software)
 manual

algebraic: awkward

map method: simple, straightforward (Karnaugh map or
K-map)

13/10/2009 cs221 – sherif khattab 4


map

diagram of squares

each square represents one minterm (one row
in truth table)

For 2 variables:
 4 minterms
 x'y', x'y, xy', xy

columns in which x = 1

13/10/2009 cs221 – sherif khattab 5


two-variable map

Example: F = xy

13/10/2009 cs221 – sherif khattab 6


two-variable map

Example: F = x + y
= x (y + y') + y (x + x')
= xy + xy' + x'y

13/10/2009 cs221 – sherif khattab 7


Gray code

only one bit changes
from number to next:
 7 -> 0100
 8 -> 1100

2-bit Gray code
 00, 01, 11, 10

13/10/2009 cs221 – sherif khattab 8


three-variable map

8 minterms

column sequence in Gray code

row 1 and column 01 -> 1 01 = 5 -> m5
row x and column y'z -> x y'z

13/10/2009 cs221 – sherif khattab 9


2 adjacent cells

each two adjacent cells differ in how many
variables (bits)?

sum (OR) of two adjacent cells -> one AND
 e.g., m5 + m7 = xy'z + xyz = xz (y + y') = xz
 e.g., m1 + m5 = x'y'z + xy'z = y'z (x + x') = y'z

13/10/2009 cs221 – sherif khattab 10


2 adjacent cells

m0, m1 adjacent?

m0, m5 adjacent?

m0, m2 adjacent?

m4, m6 adjacent?

13/10/2009 cs221 – sherif khattab 11


4 adjacent cells

sum (OR) of four adjacent cells -> one literal
 e.g., m1 + m3 + m5 + m7
001 011 101 111
= x'y'z + x'yz + xy'z + xyz
= x'z (y + y') + xz (y + y') = x'z + xz
= z (x + x') = z

13/10/2009 cs221 – sherif khattab 12


4 adjacent cells

13/10/2009 cs221 – sherif khattab 13


3-variable map simplification

1 cell -> three literals (e.g., xyz)

2 adjacent cells -> two literals (e.g., xy)

4 adjacent cells -> one literal (e.g., z)

8 adjacent cells -> ??

13/10/2009 cs221 – sherif khattab 14


example 1
F = ∑(2,3,4,5)
= (010, 011, 100, 101) = xy' + x'y

13/10/2009 cs221 – sherif khattab 15


example 2
F = ∑(3,4,6,7)
= yz + xz'

13/10/2009 cs221 – sherif khattab 16


example 3
F = ∑(0,2,4,5,6)
= z' + xy'

13/10/2009 cs221 – sherif khattab 17


example 4
F = A'C + A'B + AB'C + BC (what form?)
=

13/10/2009 cs221 – sherif khattab 18


four-variable map

?? minterms

column sequence in Gray code

row 01 and column 01 -> 01 01 = 5 -> m5
row w'x and column y'z -> w'x y'z

13/10/2009 cs221 – sherif khattab 19


4-variable map simplification

1 cell -> four literals (e.g., wxyz)

2 adjacent cells -> three literals (e.g., w'xy)

4 adjacent cells -> two literals (e.g., wz)

8 adjacent cells -> one literal (e.g., x)

16 adjacent cells -> 1

adjacent?

13/10/2009 cs221 – sherif khattab 20


example 1
F = ∑(0,1,2,4,5,6,8,9,12,13,14)
=

13/10/2009 cs221 – sherif khattab 21


example 2
F = A'B'C' + B'CD' + A'BCD' + AB'C'
=

13/10/2009 cs221 – sherif khattab 22


5-variable map

?? minterms

the two 4-variable maps on top of each other

13/10/2009 cs221 – sherif khattab 23


5-variable map simplification

13/10/2009 cs221 – sherif khattab 24


example
F = ∑(0,2,4,6,9,13,21,23,25,29,31)

13/10/2009 cs221 – sherif khattab 25

You might also like