Docsity

K-Maps, Logical Adjacency – Study Guide | CPSC 5155G, Study notes of Computer Architecture and Organization

Toggle sidebar
bg1
Karnaugh Maps
Logical Adjacency
K–Maps are a standard method for simplification of Boolean expressions.
The difference between K–Maps and Quine–McCluskey (Q–M) is that
K–M is well suited to manual solutions of small problems, and
Q–M lends itself to automated solutions.
Logical adjacency is the basis for all Boolean simplification methods.
The K–Map approach is a manual procedure that transforms logical adjacency
into physical adjacency on the paper. Simplification is done by inspection.
The key idea behind logical adjacency is expressed in the following
simplifications of Boolean expressions.
XY + X
Y
= X(Y +
Y
) = X1 = X
(X + Y)(X +
Y
) = XX + X
Y
+ YX +Y
Y
= XX + X
Y
+ XY + 0
= XX + X
Y
+ XY
= X + X(
Y
+ Y) = X1 = X + X = X
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download K-Maps, Logical Adjacency – Study Guide | CPSC 5155G and more Study notes Computer Architecture and Organization in PDF only on Docsity!

Logical Adjacency

K–Maps are a standard method for simplification of Boolean expressions. The difference between K–Maps and Quine–McCluskey (Q–M) is that K–M is well suited to manual solutions of small problems, and Q–M lends itself to automated solutions. Logical adjacency is the basis for all Boolean simplification methods. The K–Map approach is a manual procedure that transforms logical adjacency into physical adjacency on the paper. Simplification is done by inspection. The key idea behind logical adjacency is expressed in the following simplifications of Boolean expressions. XY + XY^ = X(Y + Y^ ) = X 1 = X (X + Y)(X + Y^ ) = XX + XY^ + YX +YY = XX + XY^ + XY + 0 = XX + XY^ + XY = X + X(Y^ + Y) = X1 = X + X = X

Logical Adjacency (Part 2)

Two Boolean terms are said to be logically adjacent when they contain the same variables and differ in the form of exactly one variable. Put another way, only one literal is different; a variable appears negated in one term and is not negated in the other term. All other variables appear in the same way. Consider the following lists of terms. List 1 X X List 2 XY XY^ X^ Y^ X^ Y List 3 (X + Y) (X + Y^ ) (X^ + Y^ ) (X^ + Y) In each of the lists, each term is logically adjacent not only to the term before it but also to the term following. In particular XY is adjacent to both XY^ and X^ Y (X + Y) is adjacent to both (X + Y^ ) and (X^ + Y). In other words, the adjacency list is “circular”; the first item follows the last one.

The “Complete” K–Map and Its Common Forms

Every entry in a K–map is either a 0 or a 1. These are the two values that a Boolean function can assume. While a “Complete” K–map has all entries filled, all common forms have only a subset filled. Either the 1’s are placed and the 0’s omitted or vice–versa. The three K–maps shown above contain identical information. The second K–map shows the entries with values equal to 1. Those entries not shown have value 0. The third K–map shows the entries with values equal to 0. Those entries not shown have value 1.

Creating a K–Map

The standard K–map is used to simplify Boolean expressions in canonical form; each term has exactly one literal for every Boolean variable. The method can be expanded to Boolean expressions not in canonical form. SOP Expressions Place a “1” in the K–Map for every term in the expression. The positions not filled with a “1” are assumed to have a “0”. POS Expressions Place a “0” in the K–Map for every term in the expression. The positions not filled with a “0” are assumed to have a “1”. POS K–Map SOP K–Map

Locating the SOP Terms (Part 2)

Let us examine the SOP expression F(X, Y, Z) = X^  YZ + XY^  Z + XYZ^ + XYZ We place four “1”, one for each of the terms. For X^  YZ , the “1” is placed at X = 0, Y = 1, Z = 1. For XY^  Z , the “1” is placed at X = 1, Y = 0, Z = 1. For XYZ^ , the “1” is placed at X = 1, Y = 1, Z = 0. For XYZ , the “1” is placed at X = 1, Y = 1, Z = 1.

Combining the SOP Terms

Terms are combined into rectangles containing 2, 4, 8, or 16 squares. Valid combinations: 2 by 1, 1 by 2 4 by 1, 2 by 2, 1 by 4 8 by 1, 4 by 2, 2 by 4, 1 by 8, and 4 by 4 Terms can be combined if the squares are adjacent either vertically or horizontally. Any term can be a part of more than one combination. The terms X^  YZ and XYZ, represented as 011 and 111, combine to –11, or YZ The terms XY^  Z and XYZ, represented as 101 and 111, combine to 1–1, or XZ The terms XYZ^ and XYZ, represented as 110 and 111, combine to 11–, or XY F(X, Y, Z) = XY + XZ + YZ. Note 111 is used three times.

Locating Terms for Product of Sums Expressions

In POS, each term is to be represented by a “0” in the K–map. Where should that term be put? Apply the “POS Copy Rule” to each of the terms.

  1. Write the variables in a standard uniform order.
  2. Replace each complemented variable with a 1 Replace each plain variable with a 0. Consider F(X, Y, Z) the term X+Y+Z corresponds to 0 0 0 the term X + Y + Z corresponds to 0 0 1 the term X + Y + Z corresponds to 0 1 0 the term X + Y + Z corresponds to 1 0 0 the term X + Y + Z corresponds to 1 1 1

Locating the POS Terms (Part 2)

Let us examine the POS expression F(X, Y, Z) = (X + Y + Z)(X + Y + Z^ )(X + Y^ + Z)(X^ + Y + Z) We place four “1”, one for each of the terms. For (X + Y + Z) , the “0” is placed at X = 0, Y = 0, Z = 0. For (X + Y + Z^ ) , the “0” is placed at X = 0, Y = 0, Z = 1. For (X + Y^ + Z) , the “0” is placed at X = 0, Y = 1, Z = 0. For ( X^ + Y + Z) , the “0” is placed at X = 1, Y = 0, Z = 0.

Handling Non–Canonical Terms

Suppose we have F(X, Y, Z) = (X + Y) (X + Y^ + Z)( X^ + Y + Z) How do we handle this? For (X + Y^ + Z) , denoted as 010 , the “0” is placed at X = 0, Y = 1, Z = 0. For ( X^ + Y + Z) , denoted as 100 , the “0” is placed at X = 1, Y = 0, Z = 0. But what about (X + Y), which is denoted as 00–? The answer is to view the term as equivalent to the two terms (X + Y + Z) , denoted as 000 and (X + Y + Z^ ) , denoted as 001. For the term (X + Y) we would fill boxes 000 and 001 each with a “0”.

An Example Four–Variable K–Map

Consider the Boolean function F(W, X, Y, Z) = W’X’Y’Z’ + W’X’Y’Z + WX’Y’Z’ + WX’Y’Z Using the SOP encoding method, these are terms 0000, 0001, 1000, and 1001. The K-Map is The last column is adjacent to the first column. Thus, the expression reduces to X’Y’. Combining the columns, the first row becomes -000 and the second row -. The two combine to -00- , or X’Y’.

Another Example Four–Variable K–Map

Consider the Boolean function F(W, X, Y, Z) = W’X’Y’Z’ + W’X’YZ’ + WX’Y’Z’ + WX’YZ’. Using the SOP encoding method, these are terms 0000, 0010, 1000, and 1010. The four corners are logically adjacent. The first row reduces to - The last row reduces to -. The two reduce to -0-0 , or X’Z’.