Você está na página 1de 24

Karnaugh map (k-map)

• It is a simplification tool for managing Boolean algebraic


expressions.
• Complex boolean function can be simplified by using
boolean algebra but it lacks specific rules and becomes
tedious sometimes. The map method provides a simple and
straightforward mehtod.
• The Karnaugh Map will simplify logic faster and more easily
in most cases.
Karnaugh map
• K-map method is a graphical technique for simplifying
Boolean function.
• k-map is pictorial arrangement of truth table.Each combination
of variables in a truth table is called as Minterm.

• A function of n variables will have 2ⁿ minterms. A Boolean


function is equal to 1 for some minterms and to 0 for others.

• The map is a diagram made of squares with each square


representing a minterm.The rows and columns are ordered
according to the principles of Gray code.

• Boolean simplification is actually faster than the Karnaugh


map for a task involving two or fewer Boolean variables. It is
still quite usable at three variables, but a bit slower. At four
input variables, Boolean algebra becomes tedious.
Karnaugh map

2 variable map 3 variable map 4 variable map

• Note the sequence of numbers across the top of the map.


It is not in binary sequence which would be 00, 01, 10, 11.
It is 00, 01, 11, 10 which is Gray code sequence.
What is Gray code sequence?

• Gray code sequence only changes one bit as we go from one


number to the next in the sequence, unlike binary.
• Adjacent cells vary by only one bit because a Gray code
sequence varies by only one bit.
Karnaugh Maps - Rules of Simplification
The K-Map uses the following rules for simplification of
expressions by grouping together adjascent cells
containing ones.

1. Groups may not include any cell containing a zero


2. Groups may be horizontal or vertical, but not diagonal.

3. 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.
4. Each group should be as large as possible.

5. Each cell containing a one must be in at least one group.


6. Groups may overlap.

7. 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.
8. There should be as few groups as possible, as long as this
does not contradict any of the previous rules.

Summmary:
1. No zeros allowed.
2. No diagonals.
3. Only power of 2 number of cells in each group.
4. Groups should be as large as possible.
5. Every one must be in at least one group.
6. Overlapping allowed.
7. Wrap around allowed.
8. Fewest number of groups possible
3 variable map

Mapping the four product terms (p-


terms) yields a single group of four,
which is A’.
Mapping the four p-terms above yields a group of four. Visualize
the group of four by rolling up the ends of the map to form a
cylinder, then the cells are adjacent. We normally mark the group
of four as above left. Out of the variables A, B, C, there is a
common variable: C'. C' is a 0 over all four cells. Final result is C'
Larger 4-variable Karnaugh maps

The above Boolean expression has


seven product terms. The dashed
horizontal group corresponds the
the simplified product term AB. The
vertical group corresponds to
Boolean CD. Since there are two
groups, there will be two product
terms in the Sum-Of-Products result
of Out=AB+CD.
The four cells above are a group of four because B=0 for the four
cells, and D=0 for the four cells. Thus, these variables (A, B) are not
involved with this group of four. This single group comes out of the
map as one product term for the simplified result: Out=B'D'.
The above group of eight has one Boolean variable in common: B=0.
Therefore, the one group of eight is covered by one p-term: B'. The
original eight term Boolean expression simplifies to Out=B'
Boolean function obtained from a k-map may not be unique.
Often times there is more than one minimum cost solution to a
simplification problem. Such is the case illustrated below.
Both results above have four product terms of three Boolean
variable each. Both are equally valid minimal cost solutions. The
difference in the final solution is due to how the cells are grouped
as shown above. A minimal cost solution is a valid logic design
with the minimum number of gates with the minimum number of
inputs.
EXMP:
Out=A’B’C’D’+A’B’C’D+A’B’CD
+A’BC’D’+A’BC’D+A’BCD+
+ABC’D’+ABC’D+ABCD
Ans.=A’C’+A’D+BC’+BD
EXMP:////////////////
Out=A’B’C’D’+A’B’CD+A’BC’D’
+A’BCD+ABC’D’+ABC’D+
+ABCD+AB’C’D’+AB’CD
Ans.=C’D’+CD+ABC’
Ans.=C’D’+CD+ABD
EXMP:////////////
Out=A’B’C’D’+A’B’C’D+A’BC’D’
+A’BC’D+ABC’D’+ABC’D+
+ABCD+AB’C’D’+AB’C’D
Ans.=C’ +ABD
EXMP:
• F(A,B,C,D)= ∑(1,5,7,9,11,13,15)
Ans.=C’D+AD+BD = D(A+C’+B)
• F(A,B,C,D)= ∑(1,3,7,8,10,12,13,15)
Ans.=A’B’D+BCD+ABC’+AB’D’
• F(A,B,C,D)= ∑(1,2,9,10,11,14,15)////////////////
Ans.=B’C’D+AC+B’CD’
• F(A,B,C,D)= ∑(1,5,6,7,11,12,13,15)////////////////
Ans.=ABC’+A’BC+ACD+A’C’D
• F(A,B,C,D)= ∑(0,1,2,5, 13,15)
Ans.=A’B’D’+A’B’C’+BC’D+ABC
• F(A,B,C,D)= ∑(4,5, 7,11,15)
Ans.=A’BC’+BCD+ACD
Ans.=A’BC’+A’BD+ACD
Product-of-sum simplification:
• Generally Boolean expressions derived from the maps are
expressed in sum-of-product form. The product terms are AND
terms and sum denotes the ORing of these terms.
• But we can obtain product-of-sum form from the map. If we
mark the empty squares with 0’s and combine them into groups
of adjacent squares, we obtain the complement of the function,
F’. Taking the complement of F’ we will get expression for F in
product-of-sum form.

F(A,B,C,D)= ∑(0,1,2,5, 8,9,10)


Combining the squares with 1’s gives sum-of-product form.
F=B’D’+B’C’+A’C’D
A sum-of-products expression can be implemented with
NAND gates.
If squares marked with 0’s are combined, we obtain :
F’=AB+CD+BD’
(F’)’=( AB+CD+BD’)’
F=(A’+B’)(C’+D’)(B’+D)

A product-of- sum expression can be implemented with NOR


gates.
Don’t –care conditions:
• The 1’s and 0’s in the map represent the minterms and make the
function equals to 1 or 0.
• There are occasions when it does not matter if the function
produces 0 or 1 for a given minterm, we say that we don’t care
what the function o/p is to be for this minterm.
• Minterms that may produce either 0 or 1 for the function are said
to be don’t-care conditions and are marked with ‘X’ in the map.
These don’t -care conditions can be used to provide further
simplification of the algebraic expression.
Another expamle, consider the Boolean function together with
the don’t-care minterms:
F(A,B,C)= ∑ (0,2,6)
d(A,B,C)= ∑ (1,3,5)

By including don’t-care minterms the simplified expression is :


F=A’+BC’ (requires 1 AND and 1 OR gate)

If don’t-care minterms are not included the simplified expression


would be:
F=A’C’+BC’ (requires 2 AND and 1 OR gate)

Você também pode gostar