Article by Benson Mmari
The Karnaugh map, also known as the K-map, is a method of simplify Boolean algebra expressions. Maurice Karnaugh introduced it in 1953 as a refinement of Edward Veitch's 1952 Veitch diagram.
Karnaugh maps are used to simplify real-world logic requirements so that they can be implemented using a minimum number of physical logic gates. A sum-of-products expression can always be implemented using AND gates feeding into an OR gate, and a product-of-sums expression leads to OR gates feeding an AND gate.
Karnaugh maps can also be used to simplify logic expressions in software design. Boolean conditions, as used for example in conditional statements, can get very complicated, which makes the code difficult to read and to maintain. Once minimized, canonical sum-of-products and product-of-sums expressions can be implemented directly using AND and OR logic operators.
Karnaugh maps are used to facilitate the simplification of Boolean algebra functions. Take the Boolean function described by the following truth table.
Minterms and maxterms
Each row of a truth table can be associated with a minterm, which is a product (AND) of all variables in the function, in direct or complemented form. A minterm has the property that it is equal to 1 on exactly one row of the truth table.
Figure 1shows the miniterm as shown below:
| | | minterm | |
0 | 0 | 0 | | |
0 | 0 | 1 | | |
0 | 1 | 0 | | |
0 | 1 | 1 | | |
1 | 0 | 0 | | |
1 | 0 | 1 | | |
1 | 1 | 0 | | |
1 | 1 | 1 | | |
The subscript on the minterm is the number of the row on which it equals 1. (The row numbers are obtained by reading the values of the variables on that row as a binary number.)
Minterms provide a way to represent any boolean function algebraically, once its truth table is specified. The function is given by the sum (OR) of those minterms corresponding to rows where the function is 1. By the minterm property, the OR will contain a term equal to 1 (making the function 1) on exactly those rows where the function is supposed to be 1.
Example: suppose a function F is defined by the following truth table:
Figure 2
| | | |
0 | 0 | 0 | 0 |
0 | 0 | 1 | 1 |
0 | 1 | 0 | 1 |
0 | 1 | 1 | 0 |
1 | 0 | 0 | 1 |
1 | 0 | 1 | 0 |
1 | 1 | 0 | 0 |
1 | 1 | 1 | 1 |
Since F=1 on rows 1, 2, 4, and 7.
.
Each row of a truth table is also associated with a maxterm, which is a sum (OR) of all the variables in the function, in direct or complemented form. A maxterm has the property that it is equal to 0 on exactly one row of the truth table.
Belowis the three-variable truth table and the corresponding maxterms:
Figure 3
| | | maxterm | |
0 | 0 | 0 | | |
0 | 0 | 1 | | |
0 | 1 | 0 | | |
0 | 1 | 1 | | |
1 | 0 | 0 | | |
1 | 0 | 1 | | |
1 | 1 | 0 | | |
1 | 1 | 1 | | |
The function is given by the product (AND) of those maxterms corresponding to rows where the function is 0. By the maxterm property, the AND will contain a term equal to 0 (making the function 0) on exactly those rows where the function is supposed to be 0.
Two-Variable Karnaugh Map
Another approach to simplification is called the Karnaugh map, or K-map.
• A K-map is a truth table graph, which aids in visually simplifying logic.
• It is useful for up to 5 or 6 variables, and is a good tool to help understand the process of logic simplification
Figure 4
Three-Variable Karnaugh Map
A useful K-map is one of three variables.
• Each square represents a 3-variable minterm or maxterm.
• All of the 8 possible 3-variable terms are represented on the K-map.
Figure 5
A 4-variable K-map can simplify problems of four Boolean variables.
• The K-map has one square for each possible minterm (16 in this case).
Figure 6
K-map rules
The Karnaugh map uses the following rules for the simplification of expressions by grouping together adjacent cells containing ones.
- Groups may not include any cell containing a zero
- Groups may be horizontal or vertical, but not diagonal.
- Groups must contain 1, 2, 4, 8, or in general 2n cells.
That is if n = 1, a group will contain two 1's since 21 = 2. If n = 2, a group will contain four 1's since 22 = 4.
- Each group should be as large as possible.
- Each cell containing a one must be in at least one group.
- Groups may overlap.
- Groups may wrap around the table. The leftmost cell in a row may be grouped with the rightmost cell and the top cell in a column may be grouped with the bottom cell.
- There should be as few groups as possible, as long as this does not contradict any of the previous rules.
Summary
- No zeros allowed.
- No diagonals.
- Only power of 2 numbers of cells in each group.
- Groups should be as large as possible.
- Everyone must be in at least one group.
- Overlapping allowed.
- Wrap around allowed.
- Fewest numbers of groups possible.
REFERENCES
· The University of Texas at Dallas- Erik Jonson School of Engineering and Computer Science (https://goo.gl/drgZyR) Visited on 19th July 2016 at 15:03 hrs.
· WIKIPEDIA | Karnaugh Maps (https://en.wikipedia.org/wiki/Karnaugh_map) Site visited on 6th June, 2016 15:46 hrs
· Karnaugh Maps | Introduction, and Rules of simplification (http://www.ee.surrey.ac.uk/Projects/Labview/minimisation/karnaugh.html) Site visited on 6th June, 2016 at 16:58 hrs.
· What is Web – The introduction to Karnaugh Map (http://goo.gl/tfvitL) visited on 19th July 2016 at 13:39 hrs.
· All about Circuits – Karnaugh Map and its Procedures (http://goo.gl/p88MCy) visited on 19th July 2016 at 11:56 hrs.
· Surrey UK – Minimization and K-Map Rules (http://goo.gl/12cmRa) visited on 12th July 2016 at 23:32 hrs.