22.02.2014 Views

Discrete Mathematics University of Kentucky CS 275 Spring ... - MGNet

Discrete Mathematics University of Kentucky CS 275 Spring ... - MGNet

Discrete Mathematics University of Kentucky CS 275 Spring ... - MGNet

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Karnaugh maps: The area <strong>of</strong> a K-map rectangle is determined by the number <strong>of</strong><br />

variables (n) and how many (k) are used in a Boolean expression: 2 n4k . Common<br />

arrangements are<br />

• 2 variables: 2$2,<br />

• 3 variables: 4$2, and<br />

• 4 variables: 4$4.<br />

Each variable contributes two possibilities to each possibility <strong>of</strong> every other<br />

variable in the system. K-maps are organized so that all the possibilities <strong>of</strong> the<br />

system are arranged in a grid form and between two adjacent boxes only one<br />

variable can change value. Each square in a K-map corresponds to a minterm.<br />

Cover the ones on the map by rectangule that contain a number <strong>of</strong> boxes equal<br />

to a power <strong>of</strong> 2 (e.g., 4 boxes in a line, 4 boxes in a square, 8 boxes in a<br />

rectangle, etc.). Once the ones are covered, a term <strong>of</strong> a sum <strong>of</strong> products is<br />

produced by finding the variables that do not change throughout the entire<br />

covering, and taking a 1 to mean that variable and a 0 as the complement <strong>of</strong> that<br />

variable. Doing this for every covering produces a matching function.<br />

215<br />

Given a Boolean function f with inputs x 1 , …, x n , make a table with all possible<br />

inputs and outputs. Then create a K-map with the variables on the left and top<br />

sides <strong>of</strong> the rectangle. Look for 1’s. The rectangle is a torus, so look for wrap<br />

arounds, too.<br />

Example: f: B 4 %B with a corresponding K-map <strong>of</strong><br />

x 1 , x 2<br />

00 01 11 10<br />

00 0 0 1 1<br />

x 3 , 01 0 0 1 1<br />

x 4 11 0 0 0 1<br />

10 0 1 1 1<br />

The K-map is colored to try to find patterns in the Boolean expression that can<br />

be simplified. It is quite common to eliminate some <strong>of</strong> the Boolean variables<br />

using this approach. Use high quality s<strong>of</strong>tware if you use the K-map approach.<br />

216

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!