DOC PREVIEW
U of I CS 231 - Lecture notes

This preview shows page 1-2-3-24-25-26 out of 26 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 26 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 26 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 26 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 26 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 26 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 26 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 26 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

January 23, 2002 Karnaugh maps 1Karnaugh maps• Last week we saw applications of Boolean logic to circuit design.– The basic Boolean operations are AND, OR and NOT.– These operations can be combined to form complex expressions,which can also be directly translated into a hardware circuit.– Boolean algebra helps us simplify expressions and circuits.• Today we’ll look at a graphical technique for simplifying an expressioninto a minimal sum of products (MSP) form:– There are a minimal number of product terms in the expression.– Each term has a minimal number of literals.• Circuit-wise, this leads to a minimal two-level implementation.January 23, 2002 Karnaugh maps 2Re-arranging the truth table• A two-variable function has four possible minterms. We can re-arrangethese minterms into a Karnaugh map.• Now we can easily see which minterms contain common literals.– Minterms on the left and right sides contain y’ and y respectively.– Minterms in the top and bottom rows contain x’ and x respectively.x y minterm00 x’y’01 x’y10 xy’11 xyY010 x’y’ x’yX1 xy’ xyY0 10x’y’ x’yX1xy’ xyY’ YX’ x’y’ x’yXxy’ xyJanuary 23, 2002 Karnaugh maps 3Karnaugh map simplifications• Imagine a two-variable sum of minterms:x’y’ + x’y• Both of these minterms appear in the top row of a Karnaugh map, whichmeans that they both contain the literal x’.• What happens if you simplify this expression using Boolean algebra?x’y’ + x’y = x’(y’ + y) [ Distributive ]= x’ • 1 [ y + y’ = 1 ]= x’ [ x • 1 = x ]Yx’y’ x’yXxy’xyJanuary 23, 2002 Karnaugh maps 4More two-variable examples• Another example expression is x’y + xy.– Both minterms appear in the right side, where y is uncomplemented.– Thus, we can reduce x’y + xy to just y.• How about x’y’ + x’y + xy?– We have x’y’ + x’y in the top row, corresponding to x’.– There’s also x’y + xy in the right side, corresponding to y.– This whole expression can be reduced to x’ + y.Yx’y’ x’yXxy’ xyYx’y’ x’yXxy’xyJanuary 23, 2002 Karnaugh maps 5A three-variable Karnaugh map• For a three-variable expression with inputs x, y, z, the arrangement ofminterms is more tricky:• Another way to label the K-map (use whichever you like):Yx’y’z’ x’y’z x’yz x’yz’X xy’z’ xy’z xyz xyz’ZYm0m1m3m2Xm4m5m7m6ZYZ00 01 11 100 x’y’z’ x’y’z x’yz x’yz’X1 xy’z’ xy’z xyz xyz’YZ00 01 11 100m0m1m3m2X1m4m5m7m6January 23, 2002 Karnaugh maps 6Why the funny ordering?• With this ordering, any group of 2, 4 or 8 adjacent squares on the mapcontains common literals that can be factored out.• “Adjacency” includes wrapping around the left and right sides:• We’ll use this property of adjacent squares to do our simplifications.x’y’z + x’yz= x’z(y’ + y)=x’z • 1=x’zx’y’z’ + xy’z’ + x’yz’ + xyz’= z’(x’y’ + xy’ + x’y + xy)= z’(y’(x’ + x) + y(x’ + x))= z’(y’+y)=z’Yx’y’z’ x’y’z x’yz x’yz’X xy’z’ xy’z xyz xyz’ZYx’y’z’ x’y’z x’yz x’yz’X xy’z’ xy’z xyz xyz’ZJanuary 23, 2002 Karnaugh maps 7Example K-map simplification• Let’s consider simplifying f(x,y,z) = xy + y’z + xz.• First, you should convert the expression into a sum of minterms form, ifit’s not already.– The easiest way to do this is to make a truth table for the function,and then read off the minterms.– You can either write out the literals or use the minterm shorthand.• Here is the truth table and sum of minterms for our example:x y z f(x,y,z)000 0001 1010 0011 0100 0101 1110 1111 1f(x,y,z) = x’y’z + xy’z + xyz’ + xyz= m1+ m5+ m6+ m7January 23, 2002 Karnaugh maps 8Unsimplifying expressions• You can also convert the expression to a sum of minterms with Booleanalgebra.– Apply the distributive law in reverse to add in missing variables.– Very few people actually do this, but it’s occasionally useful.• In both cases, we’re actually “unsimplifying” our example expression.– The resulting expression is larger than the original one!– But having all the individual minterms makes it easy to combinethem together with the K-map.xy + y’z + xz = (xy • 1) + (y’z • 1) + (xz • 1)= (xy • (z’ + z)) + (y’z • (x’ + x)) + (xz • (y’ + y))= (xyz’ + xyz) + (x’y’z + xy’z) + (xy’z + xyz)= xyz’ + xyz + x’y’z + xy’zJanuary 23, 2002 Karnaugh maps 9Making the example K-map• Next up is drawing and filling in the K-map.– Put 1s in the map for each minterm, and 0s in the other squares.– You can use either the minterm products or the shorthand to showyou where the 1s and 0s belong.• In our example, we can write f(x,y,z) in two equivalent ways.• In either case, the resulting K-map is shown below.Y0 1 00X 0 1 1 1ZYx’y’z’ x’y’z x’yz x’yz’X xy’z’ xy’z xyz xyz’Zf(x,y,z) = x’y’z + xy’z + xyz’ + xyzYm0m1m3m2X m4m5m7m6Zf(x,y,z) = m1 + m5 + m6 + m7January 23, 2002 Karnaugh maps 10K-maps from truth tables• You can also fill in the K-map directly from a truth table.– The output in row i of the table goes into square mi of the K-map.– Remember that the rightmost columns of the K-map are “switched.”Ym0m1m3m2Xm4m5m7m6Zx y z f(x,y,z)000 0001 1010 0011 0100 0101 1110 1111 1Y0 1 00X0 1 1 1ZJanuary 23, 2002 Karnaugh maps 11Grouping the minterms together• The most difficult step is grouping together all the 1s in the K-map.– Make rectangles around groups of one, two, four or eight 1s.– All of the 1s in the map should be included in at least one rectangle.– Do not include any of the 0s.• Each group corresponds to one product term. For the simplest result:– Make as few rectangles as possible, to minimize the number ofproducts in the final expression.– Make each rectangle as large as possible, to minimize the number ofliterals in each term.– It’s all right for rectangles to overlap, if that makes them larger.Y0 1 00X 0 111ZJanuary 23, 2002 Karnaugh maps 12Reading the MSP from the K-map• Finally, you can find the MSP.– Each rectangle corresponds to one product term.– The product is determined by finding the common literals in thatrectangle.• For our example, we find that xy + y’z + xz = y’z + xy. (This is one of theadditional algebraic laws from last time.)Yx’y’z’ x’y’z x’yz x’yz’X xy’z’ xy’z xyz xyz’ZY0 1 00X 0 111ZJanuary 23,


View Full Document

U of I CS 231 - Lecture notes

Documents in this Course
Counters

Counters

23 pages

Latches

Latches

22 pages

Lecture

Lecture

33 pages

Lecture

Lecture

16 pages

Lecture

Lecture

4 pages

Datapaths

Datapaths

30 pages

Lecture

Lecture

6 pages

Registers

Registers

17 pages

Datapaths

Datapaths

28 pages

Decoders

Decoders

20 pages

Load more
Download Lecture notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?