logic design cs221 1 st term 2009-2010 k-map cairo university faculty of computers and information

25
Logic Design CS221 1 st Term 2009-2010 K-Map Cairo University Faculty of Computers and Information

Upload: erica-parks

Post on 26-Dec-2015

215 views

Category:

Documents


1 download

TRANSCRIPT

Logic DesignCS221

1st Term 2009-2010

K-MapK-Map

Cairo University

Faculty of Computers and Information

13/10/2009 cs221 – sherif khattab 2

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 3

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?

for n variables, 22n boolean functions

13/10/2009 cs221 – sherif khattab 4

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 5

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 6

two-variable map Example: F = xy

13/10/2009 cs221 – sherif khattab 7

two-variable map Example: F = x + y = x (y + y') + y (x + x') = xy + xy' + x'y

13/10/2009 cs221 – sherif khattab 8

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 9

three-variable map 8 minterms column sequence in Gray code row 1 and column 01 -> 1 01 = 5 -> m

5

row x and column y'z -> x y'z

13/10/2009 cs221 – sherif khattab 10

2 adjacent cells each two adjacent cells differ in how many

variables (bits)? sum (OR) of two adjacent cells -> one AND

e.g., m5 + m

7 = xy'z + xyz = xz (y + y') = xz

e.g., m1 + m

5 = x'y'z + xy'z = y'z (x + x') = y'z

13/10/2009 cs221 – sherif khattab 11

2 adjacent cells m

0, m

1 adjacent?

m0, m

5 adjacent?

m0, m

2 adjacent?

m4, m

6 adjacent?

13/10/2009 cs221 – sherif khattab 12

4 adjacent cells sum (OR) of four adjacent cells -> one literal

e.g., m1 + m

3 + m

5 + m

7

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 13

4 adjacent cells

13/10/2009 cs221 – sherif khattab 14

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 15

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

13/10/2009 cs221 – sherif khattab 16

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

13/10/2009 cs221 – sherif khattab 17

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

13/10/2009 cs221 – sherif khattab 18

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

13/10/2009 cs221 – sherif khattab 19

four-variable map ?? minterms column sequence in Gray code row 01 and column 01 -> 01 01 = 5 -> m

5

row w'x and column y'z -> w'x y'z

13/10/2009 cs221 – sherif khattab 20

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 21

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

13/10/2009 cs221 – sherif khattab 22

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

13/10/2009 cs221 – sherif khattab 23

5-variable map ?? minterms the two 4-variable maps on top of each other

13/10/2009 cs221 – sherif khattab 24

5-variable map simplification

13/10/2009 cs221 – sherif khattab 25

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