![]() |
![]() |
|
![]() |
![]() |
Encyclopedia :
K :
KA :
KAR :
Karnaugh map |
|
|
Karnaugh mapThe Karnaugh map, also known as a Veitch diagram (K-map or KV-map for short), is a tool to facilitate management of Boolean algebraic expressions. The Karnaugh map was invented in 1950 by Maurice Karnaugh, a telecommunications engineer at Bell Labs. Normally, extensive calculations are required to obtain the minimal expression of a Boolean function, but one can use a Karnaugh map instead. Karnaugh maps make use of the human brain's excellent pattern-matching capability to decide which terms should be combined to get the simplest expression. In addition, K-maps permit the rapid identification and elimination of potential race hazards, something that boolean equations alone cannot do. A Karnaugh map is an excellent aid for simplification of up to six variables, but with more variables it becomes hard even for our brain to discern optimal patterns. For expressions having more than 4 variables, the Quine-McCluskey algorithm, also called the method of prime implicants, should be used. This algorithm uses a deterministic approach to simplification of boolean expressions. Thus, following the steps of the algorithm ensures that the simplest expression can be found. This is especially useful for creating software programs that simplify any given boolean expression. Karnaugh maps also help teach about Boolean functions and minimization. ExampleConsider the following function:
The input variables can be combined in 16 different ways, so our Karnaugh map has to have 16 positions. The most convenient way to arrange this is in a 4x4 grid.
After the Karnaugh map has been constructed our next task is to find the minimal terms to use in the final expression. These terms are found by encircling the 1's in the map. The encirclings can only encompass 2n fields, where n is an integer ≥ 0 (1, 2, 3, 4...). They should be as large as possible. The optimal encirclings in this map are marked by the green, red and blue lines. For each of these encirclings we find those variables that have the same state in each of the fields in the encircling. For the first encircling (the red one) we find that:
For the green encircling we see that A and B maintains the same state, C and D changes. But B is 0 and has to be negated before it can be included. The second term becomes AB'. By working the blue encircling the same way we find the term BC'D' and our final expression for the function is ready: AC + AB' + BC'D'. It should be mentioned that encirclings can wrap around edges, so ABD' is a proper encircling, even though it is not an optimal encircling. The inverse of a function is solved in the same way by encircling the 0's instead. It is worth mentioning that the number of product terms for an encircling P is:
Race hazards Karnaugh maps are useful for detecting and eliminating race hazards. In the above example, a potential race condition exists when C and D are both 0, A is a 1, and B changes from a 0 to a 1 (moving from the green state to the blue state). For this case, the output is defined to remain unchanged at 1, but because this transition is not covered by a specific term in the equation, a potential for a glitch (a momentary transition of the output to 0) exists. This is very easy to spot using a Karnaugh map, because a race condition may exist when moving between any pair of adjacent, but disjointed, regions circled on the map. A harder possible glitch to spot is if D was 0 and A and B were both 1, with C changing from 0 to 1. In this case the glitch wraps around from the bottom of the map to the top of the map. See alsoExternal linksReferences
|
|
|
This article is from Wikipedia. All text is available under the terms of the GNU Free Documentation License. |
|
| © 2008 Chamas Enterprises Inc. |