Presentation is loading. Please wait.

Presentation is loading. Please wait.

Karnaugh Maps (K-Maps)

Similar presentations


Presentation on theme: "Karnaugh Maps (K-Maps)"— Presentation transcript:

1 Karnaugh Maps (K-Maps)
for Simplification Part I 2-3 variable K-Maps Odd/Even Parity

2 Karnaugh Maps Boolean algebra helps us simplify expressions and circuits Try and error May not reach the simplest form Needs experience Karnaugh Map: A graphical technique for simplifying a Boolean expression into either form: minimal sum of products (MSoP) minimal product of sums (MPoS) Goal of the simplification. There are minimal number of product/sum terms Each term has a minimal number of literals Circuit-wise, this leads to a minimal two-level implementation

3 K-Maps: Re-arranging the Truth Table
A two-variable function has four possible minterms. We can re-arrange these 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

4 Karnaugh Map Simplifications
Imagine a two-variable function, its sum of minterms = m0, m1 : x’y’ + x’y Both of these minterms appear in the top row of a Karnaugh map, which means 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 ]

5 More 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

6 A+B Example 1 B 1 1 A 2-variable K-maps are trivial
But, it can be used to introduce the methods you need to learn. The map for a 2-input OR gate looks like this: B 1 A 1 B 1 1 1 A B Y 1 A A+B

7 A Three-Variable Karnaugh Map
For a three-variable expression with inputs x, y, z, the arrangement of minterms is more tricky: Another way to label the K-map (use whichever you like):

8 Why the funny ordering? With this ordering, any group of 2, 4 or 8 adjacent squares on the map contains 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. F = x’y’z + x’yz = x’z(y’ + y) = x’z  1 = x’z F = x’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’

9 K-maps From Truth Tables
We can 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”

10 Reading the MSoP from the K-map
You can find the minimal SoP expression as follows: Each rectangle corresponds to one product term The product is determined by finding the common literals in that rectangle xy y’z F(x,y,z)= y’z + xy

11 Grouping the Minterms Together
The most difficult step is grouping together all the 1s in the K-map Make biggest rectangles around groups of one, two, four or eight 1s Why biggest??? (Bonus) 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

12 For the Simplest Result
Make as few rectangles as possible, to minimize the number of products in the final expression. Make each rectangle as large as possible, to minimize the number of literals in each term. Rectangles can be overlapped, if that makes them larger.

13 Filling the K-Map You should convert (unsimplify) the SoP expression into a sum of minterms form, Through boolean algebra (not recommended) Through truth table (takes time) Through K-map directly

14 Example: Fill K-Map through Boolean Unsimplification
You can also convert the expression to a sum of minterms with Boolean algebra 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 combine them 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’z = m1 + m5 + m6 + m7

15 Example: Fill K-Map through Truth Table
Let’s consider simplifying f(x,y,z) = xy + y’z + xz Here is the truth table and sum of minterms for our example: -y’z xy- x-z f(x,y,z) = x’y’z + xy’z + xyz’ + xyz = m1 + m5 + m6 + m7

16 Example: Fill K-Map Directly
f(x,y,z) = xy + y’z + xz f(x,y,z) = xy + y’z 1 1

17 Practice 1: m1 + m3 + m5 + m6 Here is the filled in K-map, with all groups shown The magenta and green groups overlap, which makes each of them as large as possible Minterm m6 is in a group all by its lonesome The final MSoP here is x’z + y’z + xyz’

18 K-maps can be tricky! There may not necessarily be a unique MSP. The K-map below yields two valid and equivalent MSPs, because there are two possible ways to include minterm m7 Remember that overlapping groups is possible, as shown above y’z + yz’ + xy y’z + yz’ + xz

19 Review: Minimization of SoP with K-maps
Draw a K-map Fill 1’s into the K-map (minterms) Combine maximum number of 1’s in groups, with rules: Only adjacent (Vertical/Horizontal) squares/Rectangles can be combined All 1’s must be covered Covering rectangles must be of size 1,2,4,8, … 2n Check if all groups are really needed. Generate the Minimal SoP MSoP expression

20 Odd K-Map Cases: How to Simplify?
/\/ \/\ Grouping of single 1’s No Simplification is possible!

21 Different symbols for XNOR
More Gates: XOR vs. XNOR Exclusive OR (XOR) outputs 1 if: Inputs are different Number of 1’s is odd X Y Z=XY 1 X Y Z F = X’Y + XY’ = X  Y X Y Z=(XY)’ 1 Exclusive NOR (XNOR) Outputs 1 if: Inputs are same Number of 1’s is even F = XY + X’Y’ = (X  Y)’ = X  Y = X Y Different symbols for XNOR X Y Z

22 XOR XNOR More Gates: XOR vs. XNOR X  0 = X X  0 = X’
X  Y’ = X’  Y = (X  Y)’ = X  Y X  Y = X’  Y’ (same with XNOR) X  Y = Y  X (commutative, same with XNOR) X  (Y  Z) = (X  Y)  Z (associative, same with XNOR)

23 Odd Detector Function = Even Parity Function
The Exclusive OR function acts as an ODD detector function or as an even parity function. It equals 1 only if the number of 1’s in the input is odd. A B C F 1 A B C

24 Even Detector Function = Odd Parity Function
The Exclusive NOR function acts as an EVEN detector function or as an ODD parity function. It equals 1 only if the number of 1’s in the input is even. Obtained by placing an inverter (NOT) in front of the odd function A B C F 1 A B C


Download ppt "Karnaugh Maps (K-Maps)"

Similar presentations


Ads by Google