Karnaugh Map Tutorial
Minimize a Boolean function by circling groups on a Gray-code grid.
What a K-map is
A Karnaugh map is a truth table rearranged into a grid so that neighboring cells differ in exactly one input. Groups of adjacent 1s then correspond to simpler product terms.
Steps
- Fill each cell with the function's output (1, 0, or X for don't care).
- Circle rectangular groups of 1s. Group sizes must be a power of two: 1, 2, 4, 8, 16.
- Make groups as large as possible. Groups may wrap around the edges, because the rows and columns are in Gray-code order (00, 01, 11, 10).
- Cover every 1 with as few groups as possible. Don't-care cells may help a group grow, but need not be covered.
- Each group becomes one AND term. Keep the variables that do not change inside the group. OR the terms together.
Example: majority of three
The function is 1 when at least two of A, B and C are 1. Its map has three groups of two cells, giving Y = A·B + B·C + A·C.
Terms to know
- A prime implicant is a group that cannot be made any larger.
- An essential prime implicant covers a 1 that no other prime implicant covers, so it must be in the answer.
The app's Analysis tab does this for you with the Quine-McCluskey method, draws the loops on the map, and can synthesize the resulting gates. See the manual chapter.