SlideShare a Scribd company logo
Karnaugh Maps
                                       Bob Harbort Bob Brown
                                     Computer Science Department
                                  Southern Polytechnic State University


Simplifying Boolean Expressions

         We can use the sum-of-products method to generate any digital logic circuit for which we
can write the truth table. While the sum-of-products method will always produce a correct
circuit, it usually does not produce the optimal circuit. We want the simplest possible circuit
because fewer gates or simpler gates mean reduced cost, improved reliability, and often
increased speed. We can simplify a circuit by simplifying the Boolean expression for it, then
using the techniques already learned to produce the circuit that is equivalent to the simplified
expression. The need to simplify Boolean expressions occurs in programming as well as
hardware design, and the techniques discussed here are equally applicable to programming.

       One way to simplify a Boolean expression is to apply the laws of Boolean algebra, some
of which are summarized in the table on p. 144 of Tanenbaum. We will apply the laws of
Boolean algebra to simplify AB + AB . We choose this expression because it is key to how
Karnaugh maps work; other expressions can also be simplified using Boolean algebra.
                      AB + AB        original expression
                      A(B + B)       after applying distributive law
                      A1             after applying inverse law
                      1A             after applying commutative law
                      A              after applying identity law
Therefore, AB + AB = A .

Karnaugh Maps

       Karnaugh maps are a graphical way of using the relationship AB + AB = A to simplify a
Boolean expression and thus simplify the resulting circuit. A Karnaugh map is a completely
mechanical method of performing this simplification, and so has an advantage over manipulation
of expressions using Boolean algebra. Karnaugh maps are effective for expressions of up to
about six variables. For more complex expressions the Quine-McKluskey method, not discussed
here, may be appropriate.

        The Karnaugh map uses a rectangle divided into rows and columns in such a way that
any product term in the expression to be simplified can be represented as the intersection of a
row and a column. The rows and columns are labeled with each term in the expression and its
complement. The labels must be arranged so that each horizontal or vertical move changes the
state of one and only one variable.


Copyright © 1999, 2001 by Bob Brown
Karnaugh Maps


To use a Karnaugh map to simplify an expression:
       1.     Draw a “map” with one box for each possible product term in the expression.
              The boxes must be arranged so that a one-box movement either horizontal or
              vertical changes one and only one variable. See Figure 1.
       2.     For each product term in the expression to be simplified, place a checkmark in the
              box whose labels are the product's variables and their complements.
       3.     Draw loops around adjacent pairs of checkmarks. Blocks are "adjacent"
              horizontally and vertically only, not diagonally. A block may be "in" more than
              one loop, and a single loop may span multiple rows, multiple columns, or both, so
              long as the number of checkmarks enclosed is a power of two.
       4.     For each loop, write an unduplicated list of the terms which appear; i.e. no matter
              how many times A appears, write down only one A.
       5.     If a term and its complement both appear in the list, e.g. both A and A , delete
              both from the list.
       6.     For each list, write the Boolean product of the remaining terms.
       7.     Write the Boolean sum of the products from Step 5; this is the simplified
              expression.

Karnaugh Maps for Expressions of Two Variables

       Start with the expression AB + AB . This is an expression of two variables. We draw a
rectangle and divide it so that there is a row or column for each variable and its complement.
                                                                                 A         A
        Next, we place checks in the boxes that represent each of the
product terms of the expression. The first product term is AB, so we
place a check in the upper left block of the diagram, the conjunction    B
of A and B. The second is AB , so we place a check in the lower left
block. Finally, we draw a loop around adjacent pairs of checks.
                                                                         B
          The loop contains A, B, A, and B . We remove one A so that
the list is unduplicated. The B and B "cancel," leaving only A,              Figure 1. Karnaugh map for
which is the expected result: AB + AB = A .                                  AB + AB .



       Let us try a slightly more interesting example: simplify A B + A B + A B . There are two
variables, so the rectangle is the same as in the first example. We perform the following steps:

   •   Place a check in the A B area.
   •   Place a check in the AB area.
   •   Place a check in the A B area.
   •   Draw loops around pairs of adjacent checks.


                                           -2-
Karnaugh Maps
                                                                                                          A           A
The Karnaugh map appears in Figure 2. Because there are two loops, there
will be two terms in the simplified expression. The vertical loop contains A ,                    B
B, A , and B . We remove one A to make an unduplicated list. The B and
B cancel, leaving the remaining A . From the horizontal loop we remove the
duplicate B , then remove A and A leaving only B in the second term. We                            B
write the Boolean sum of these, and the result is A + B , so:
 AB+AB+AB = A+B                                                                                       Figure 2. Karnaugh
                                                                                                      map for A B + A B + A B

Expressions of Three Variables

        Recall that an essential characteristic of a Karnaugh map is that moving one position
horizontally or vertically changes one and only one variable to its complement. For expression
of three variables, the basic Karnaugh diagram is shown in Figure 3.
                                                                     AB       AB        AB       AB
        As with the diagram for two variables, adjacent squares
differ by precisely one literal. The left and right edges are
                                                                C
considered to be adjacent, as though the map were wrapped
around to form a cylinder.
                                                                C
        Now we'll work through a complete example, starting
with deriving a circuit from a truth table using the sum of       Figure 3. Form of a Karnaugh map
products method, simplifying the sum of products expression,      for expressions of three variables.
and drawing the new, simpler circuit.

Truth Table           Product                Sum-of-Products                      Digital Logic
                      Terms                  Expression                           Circuit
A    B     C     X
0    0     0     1     ABC                     ABC+ABC+ ABC                      A      B     C
0    0     1     0
0    1     0     0
0    1     1     1     ABC
1    0     0     0
1    0     1     0
1    1     0     0
1    1     1     1    ABC

          a)                                           b)                                          c)
Figure 4. a) A truth table with product terms, b) the resulting sum-of-products expression, and c) the equivalent
digital logic circuit.




                                                   -3-
Karnaugh Maps

                                                                                           AB       AB      AB       AB
The truth table in Figure 4a generates an expression with three
product terms, as shown in Figure 4b. A measure of the complexity C
of a digital logic circuit is the number of gate inputs. The circuit in
Figure 4c has 15 gate inputs. The Karnaugh map for the expression C
in Figure 4b is shown at the right. In this Karnaugh map, the large
loop surrounds A B C and A B C ; note that it "wraps around" from                       Figure 5. Simplifying
the left edge of the map to the right edge. The A and A cancel, so                        A B C + A B C + A B C with a
these two terms simplify to BC.                                                         Karnaugh map.


         A B C is in a cell all by itself, and so contributes all three of its terms to the final
expression. The simplified expression is B C + A B C and the                                        C
                                                                                      A       B
simplified circuit is shown in Figure 6. In the simplified circuit, one
three-input AND gate was removed, a remaining AND gate was
changed to two inputs, and the OR gate was changed to two inputs,
resulting in a circuit with ten gate inputs.

        Let’s consider another example. The truth table in Figure 7a
generates a sum-of-products expression with five product terms of
three variables each. The sum-of-products expression is shown in
Figure 7b. The digital logic circuit for this expression, shown in                      Figure 6. Simplified circuit for the
Figure 7c, has nine gates and 23 gate inputs. The Karnaugh map for                      truth table of Figure 4a.
this expression is shown in Figure 8.

Truth Table           Product                Sum-of-Products                      Digital Logic
                      Terms                  Expression                           Circuit
A    B     C     X                                                                A       B    C
0    0     0     0                       A BC+A BC+A BC
0    0     1     0
                                         +A BC+A BC
0    1     0     1     ABC
0    1     1     1     ABC
1    0     0     0
1    0     1     1     ABC
1    1     0     1    ABC
1    1     1     1    A BC


                   a)                                  b)                                          c)
Figure 7. a) A truth table with product terms, b) the resulting sum-of-products expression, and c) the equivalent
digital logic circuit.



                                                   -4-
Karnaugh Maps



       After removing duplicates, the large loop contains A and A              AB       AB      AB       AB
and also C and C ; these cancel. All that's left after removing the     C
two complement pairs is B. The small loop contains B and B ,
which are removed, so it yields AC. We have simplified the
expression in Figure 7b to B+AC.                                        C

                                                                            Figure 8. Karnaugh map for the
        The circuit for B+AC is shown in Figure 9. We have                  expression of figure 7.
simplified the circuit from nine gates and 23 inputs to two two-input
gates. This is a substantial reduction in complexity.
                                                                               A
                                                                               B
                                                                              C
                                                                               Figure 9. Simplified circuit
                                                                               equivalent to Figure 7c.
Getting the Best Results

       For maximum simplification, you want to make the loops in a Karnaugh map as big as
possible. If you have a choice of making one big loop or two small ones, choose the big loop.
The restriction is that the loop must be rectangular and enclose a number of checkmarks that is a
power of two.

        When a map is more than two rows deep, i.e. when it represents more than three
variables, the top and bottom edges can be considered to be adjacent in the same way that the
right and left edges are adjacent in the two-by-four maps above.

        If all checkmarks in a loop are enclosed within other loops        AB       AB    AB      AB
as well, that loop can be ignored because all its terms are
accounted for. In the Karnaugh map in Figure 10, the vertical         C
loop is redundant and can be ignored.
                                                                      C
        Sometimes not all possible combinations of bits
represented in a truth table can occur. For example, if four bits are
used to encode a decimal digit, combinations greater than 1001          Figure 10. Karnaugh map showing a
                                                                        redundant loop.
cannot occur. In that case, you can place a “D” (for “don’t care”)
in the result column of the truth table. These D’s may be treated
as either ones or zeroes, and you can place check marks on the map in the D’s positions if doing
so allows you to make larger loops.



                                            -5-
Karnaugh Maps



One General Form for a Karnaugh Map

        There are several possible forms for a Karnaugh map, including some three-dimensional
versions. All that is required is that a movement of one position changes the value of one and
only one variable. We have shown a form for maps of two and three variables. Below are maps
for four and five variables.
                   AB    AB     AB    AB             ABC ABC ABC ABC ABC ABC ABC ABC

             CD                                 DE

             CD                                 DE

             CD
                                                DE

             CD
                                                DE


               Figure 11. One form of the Karnaugh map for expressions of four and five variables.




A Notation Reminder

The Boolean product of two variables is written as AB, A∧B or A·B; the variables are combined
using the AND function.

The Boolean sum of two variables is written as A+B or A∨B; the variables are combined using
the OR function.

The complement of a Boolean variable is written as A ; it is evaluated using the NOT function.

The product, sum, and complement can be applied to expressions as well as single variables.
Parentheses can be used to show precedence when needed.


Bibliography

Mendelson, Elliott, Schaum's Outline of Theory and Problems of Boolean Algebra, McGraw-
        Hill, 1970.
Stallings, William, Computer Organization and Architecture: Designing for performance,
        Prentice-Hall, 1996.
Tanenbaum, Andrew S., Structured Computer Organization, Prentice-Hall, 2006.

                                               -6-
Karnaugh Maps


Exercises

1. Verify that the circuit in Figure 9 is equivalent to the circuit in Figure 7c by deriving the
   truth table for the circuit in Figure 9 and comparing it to Figure 7a.

2. Sketch a Karnaugh map for expressions of six variables. Hint: See Figure 11.

3. The truth table for binary addition has three inputs: the addend, the augend, and the carry in.
   The output has two parts, the sum and the carry out. Write the truth table for the sum part of
   binary addition. Use a Karnaugh map to simplify the expression represented by this truth
   table. Hint: This is a sneaky question, but you will learn a lot about the power of Karnaugh
   maps.

4. Write the truth table for the carry part of binary addition. Use a Karnaugh map to simplify
   the sum-of-products expression which this truth table produces.

5. Use a Karnaugh map to simplify A B C + A B C + A B C .




                                                                                         January, 2001



                                            -7-

More Related Content

What's hot

Karnaugh maps
Karnaugh mapsKarnaugh maps
Karnaugh maps
Gaditek
 
K Map Simplification
K Map SimplificationK Map Simplification
K Map Simplification
Ramesh C
 
The Karnaugh Map
The Karnaugh MapThe Karnaugh Map
The Karnaugh Map
Soban Ahmad
 
sagar
sagarsagar
Fpure ch4
Fpure ch4Fpure ch4
Fpure ch4
tutulk
 
2.7 normal forms cnf & problems
2.7 normal forms  cnf & problems2.7 normal forms  cnf & problems
2.7 normal forms cnf & problems
Sampath Kumar S
 
Karnaugh Map
Karnaugh MapKarnaugh Map
Karnaugh Map
Syed Absar
 
11 2 Areas Of Parallelograms, Triangles, And
11 2 Areas Of Parallelograms, Triangles, And11 2 Areas Of Parallelograms, Triangles, And
11 2 Areas Of Parallelograms, Triangles, And
Mr. Hohman
 
2002 reflections day1
2002 reflections day12002 reflections day1
2002 reflections day1
jbianco9910
 
FoG 2.3 Congruent Segments
FoG 2.3 Congruent SegmentsFoG 2.3 Congruent Segments
FoG 2.3 Congruent Segments
ejfischer
 
Lec 04 - Gate-level Minimization
Lec 04 - Gate-level MinimizationLec 04 - Gate-level Minimization
Lec 04 - Gate-level Minimization
Vajira Thambawita
 
5 similar+triangles%26 power+of+a+point+%28solutions%29
5 similar+triangles%26 power+of+a+point+%28solutions%295 similar+triangles%26 power+of+a+point+%28solutions%29
5 similar+triangles%26 power+of+a+point+%28solutions%29
ponce Lponce
 
context free grammars_simplification
context free grammars_simplificationcontext free grammars_simplification
context free grammars_simplification
Shiraz316
 
2.8 normal forms gnf & problems
2.8 normal forms   gnf & problems2.8 normal forms   gnf & problems
2.8 normal forms gnf & problems
Sampath Kumar S
 
Translation, Dilation, Rotation, ReflectionTutorials Online
Translation, Dilation, Rotation, ReflectionTutorials OnlineTranslation, Dilation, Rotation, ReflectionTutorials Online
Translation, Dilation, Rotation, ReflectionTutorials Online
Winpossible.com
 
Context free grammars
Context free grammarsContext free grammars
Context free grammars
Shiraz316
 
Ch3.3 Segments and Angles
Ch3.3 Segments and AnglesCh3.3 Segments and Angles
Ch3.3 Segments and Angles
mdicken
 
Core 4 Parametric Equations 1
Core 4 Parametric Equations 1Core 4 Parametric Equations 1
Core 4 Parametric Equations 1
davidmiles100
 
Geo - 2.3&4
Geo - 2.3&4Geo - 2.3&4
Geo - 2.3&4
ejfischer
 
Harmonic division
Harmonic divisionHarmonic division
Harmonic division
Arvee Mae
 

What's hot (20)

Karnaugh maps
Karnaugh mapsKarnaugh maps
Karnaugh maps
 
K Map Simplification
K Map SimplificationK Map Simplification
K Map Simplification
 
The Karnaugh Map
The Karnaugh MapThe Karnaugh Map
The Karnaugh Map
 
sagar
sagarsagar
sagar
 
Fpure ch4
Fpure ch4Fpure ch4
Fpure ch4
 
2.7 normal forms cnf & problems
2.7 normal forms  cnf & problems2.7 normal forms  cnf & problems
2.7 normal forms cnf & problems
 
Karnaugh Map
Karnaugh MapKarnaugh Map
Karnaugh Map
 
11 2 Areas Of Parallelograms, Triangles, And
11 2 Areas Of Parallelograms, Triangles, And11 2 Areas Of Parallelograms, Triangles, And
11 2 Areas Of Parallelograms, Triangles, And
 
2002 reflections day1
2002 reflections day12002 reflections day1
2002 reflections day1
 
FoG 2.3 Congruent Segments
FoG 2.3 Congruent SegmentsFoG 2.3 Congruent Segments
FoG 2.3 Congruent Segments
 
Lec 04 - Gate-level Minimization
Lec 04 - Gate-level MinimizationLec 04 - Gate-level Minimization
Lec 04 - Gate-level Minimization
 
5 similar+triangles%26 power+of+a+point+%28solutions%29
5 similar+triangles%26 power+of+a+point+%28solutions%295 similar+triangles%26 power+of+a+point+%28solutions%29
5 similar+triangles%26 power+of+a+point+%28solutions%29
 
context free grammars_simplification
context free grammars_simplificationcontext free grammars_simplification
context free grammars_simplification
 
2.8 normal forms gnf & problems
2.8 normal forms   gnf & problems2.8 normal forms   gnf & problems
2.8 normal forms gnf & problems
 
Translation, Dilation, Rotation, ReflectionTutorials Online
Translation, Dilation, Rotation, ReflectionTutorials OnlineTranslation, Dilation, Rotation, ReflectionTutorials Online
Translation, Dilation, Rotation, ReflectionTutorials Online
 
Context free grammars
Context free grammarsContext free grammars
Context free grammars
 
Ch3.3 Segments and Angles
Ch3.3 Segments and AnglesCh3.3 Segments and Angles
Ch3.3 Segments and Angles
 
Core 4 Parametric Equations 1
Core 4 Parametric Equations 1Core 4 Parametric Equations 1
Core 4 Parametric Equations 1
 
Geo - 2.3&4
Geo - 2.3&4Geo - 2.3&4
Geo - 2.3&4
 
Harmonic division
Harmonic divisionHarmonic division
Harmonic division
 

Viewers also liked

Digital
DigitalDigital
Digital
Venkat Raman
 
digital Electronics
digital Electronicsdigital Electronics
digital Electronics
Venkat Raman
 
Karnaugh maps z 88
Karnaugh maps   z  88Karnaugh maps   z  88
Karnaugh maps z 88
سلطان الشهري
 
Presentation on Karnaugh Map
Presentation  on Karnaugh MapPresentation  on Karnaugh Map
Presentation on Karnaugh Map
Kawsar Ahmed
 
Minimization of Boolean Functions
Minimization of Boolean FunctionsMinimization of Boolean Functions
Minimization of Boolean Functions
blaircomp2003
 
Truth table, Karnaugh map & logic circuit with 5 outputs and 8 inputs
Truth table, Karnaugh map & logic circuit with 5 outputs and 8 inputsTruth table, Karnaugh map & logic circuit with 5 outputs and 8 inputs
Truth table, Karnaugh map & logic circuit with 5 outputs and 8 inputs
Abir Chowdhury
 
Logic gates
Logic gatesLogic gates
karnaugh maps
karnaugh mapskarnaugh maps
karnaugh maps
Bala Ganesh
 
Kmap Slideshare
Kmap SlideshareKmap Slideshare
Kmap Slideshare
tech4us
 
K-map method
K-map methodK-map method
K-map method
Harekushna Patel
 
Digital design chap 3
Digital design   chap 3Digital design   chap 3
Digital design chap 3
Mohammad Bappy
 
Module 2 logic gates
Module 2  logic gatesModule 2  logic gates
Module 2 logic gates
Deepak John
 
STLD- Switching functions
STLD- Switching functions STLD- Switching functions
STLD- Switching functions
Abhinay Potlabathini
 
KARNAUGH MAP(K-MAP)
KARNAUGH MAP(K-MAP)KARNAUGH MAP(K-MAP)
KARNAUGH MAP(K-MAP)
mihir jain
 
Karnaugh Graph or K-Map
Karnaugh Graph or K-MapKarnaugh Graph or K-Map
Karnaugh maps
Karnaugh mapsKarnaugh maps
Karnaugh maps
AJAL A J
 
Digital logic circuits important question and answers for 5 units
Digital logic circuits important question and answers for 5 unitsDigital logic circuits important question and answers for 5 units
Digital logic circuits important question and answers for 5 units
Lekashri Subramanian
 

Viewers also liked (17)

Digital
DigitalDigital
Digital
 
digital Electronics
digital Electronicsdigital Electronics
digital Electronics
 
Karnaugh maps z 88
Karnaugh maps   z  88Karnaugh maps   z  88
Karnaugh maps z 88
 
Presentation on Karnaugh Map
Presentation  on Karnaugh MapPresentation  on Karnaugh Map
Presentation on Karnaugh Map
 
Minimization of Boolean Functions
Minimization of Boolean FunctionsMinimization of Boolean Functions
Minimization of Boolean Functions
 
Truth table, Karnaugh map & logic circuit with 5 outputs and 8 inputs
Truth table, Karnaugh map & logic circuit with 5 outputs and 8 inputsTruth table, Karnaugh map & logic circuit with 5 outputs and 8 inputs
Truth table, Karnaugh map & logic circuit with 5 outputs and 8 inputs
 
Logic gates
Logic gatesLogic gates
Logic gates
 
karnaugh maps
karnaugh mapskarnaugh maps
karnaugh maps
 
Kmap Slideshare
Kmap SlideshareKmap Slideshare
Kmap Slideshare
 
K-map method
K-map methodK-map method
K-map method
 
Digital design chap 3
Digital design   chap 3Digital design   chap 3
Digital design chap 3
 
Module 2 logic gates
Module 2  logic gatesModule 2  logic gates
Module 2 logic gates
 
STLD- Switching functions
STLD- Switching functions STLD- Switching functions
STLD- Switching functions
 
KARNAUGH MAP(K-MAP)
KARNAUGH MAP(K-MAP)KARNAUGH MAP(K-MAP)
KARNAUGH MAP(K-MAP)
 
Karnaugh Graph or K-Map
Karnaugh Graph or K-MapKarnaugh Graph or K-Map
Karnaugh Graph or K-Map
 
Karnaugh maps
Karnaugh mapsKarnaugh maps
Karnaugh maps
 
Digital logic circuits important question and answers for 5 units
Digital logic circuits important question and answers for 5 unitsDigital logic circuits important question and answers for 5 units
Digital logic circuits important question and answers for 5 units
 

Similar to Karnaugh

Boolean variables r010
Boolean variables   r010Boolean variables   r010
Boolean variables r010
arunachalamr16
 
NOTA TOPIK 2_SSK20152 (3).pptx
NOTA TOPIK 2_SSK20152 (3).pptxNOTA TOPIK 2_SSK20152 (3).pptx
NOTA TOPIK 2_SSK20152 (3).pptx
eedayaya1
 
All aboutcircuits karnaugh maps
All aboutcircuits karnaugh mapsAll aboutcircuits karnaugh maps
All aboutcircuits karnaugh maps
marangburu42
 
simplification of boolean algebra
simplification of boolean algebrasimplification of boolean algebra
simplification of boolean algebra
mayannpolisticoLNU
 
Karnaugh maps
Karnaugh mapsKarnaugh maps
Karnaugh maps
krishna0024
 
discrete_BOOLEAN ALGEBRA
discrete_BOOLEAN ALGEBRAdiscrete_BOOLEAN ALGEBRA
discrete_BOOLEAN ALGEBRA
ZULFIQ RASHID
 
1.2 Ruler Postulates
1.2 Ruler Postulates1.2 Ruler Postulates
1.2 Ruler Postulates
Dee Black
 
Karnaugh mapping allaboutcircuits
Karnaugh mapping allaboutcircuitsKarnaugh mapping allaboutcircuits
Karnaugh mapping allaboutcircuits
marangburu42
 
K Maps.pptx
K Maps.pptxK Maps.pptx
K Maps.pptx
saneeshoo7
 
3,EEng k-map.pdf
3,EEng k-map.pdf3,EEng k-map.pdf
3,EEng k-map.pdf
DamotTesfaye
 
A some basic rules of tensor calculus
A some basic rules of tensor calculusA some basic rules of tensor calculus
A some basic rules of tensor calculus
Tarun Gehlot
 
Kmap..(karnaugh map)
Kmap..(karnaugh map)Kmap..(karnaugh map)
Kmap..(karnaugh map)
Zain Jafri
 
9402730.ppt
9402730.ppt9402730.ppt
9402730.ppt
qquwandiq19
 
KARNAUGH MAPS
KARNAUGH MAPSKARNAUGH MAPS
KARNAUGH MAPS
Wasan Jitjumnong
 
Karnaugh maps
Karnaugh mapsKarnaugh maps
Karnaugh maps
kanyuma jitjumnong
 
Combinational circuit
Combinational circuitCombinational circuit
Combinational circuit
saravana kumaar
 
Ch.08
Ch.08Ch.08
DigitalLogic_BooleanAlgebra_P.pdf
DigitalLogic_BooleanAlgebra_P.pdfDigitalLogic_BooleanAlgebra_P.pdf
DigitalLogic_BooleanAlgebra_P.pdf
k vimal kumar
 
K map.
K map.K map.
4.vectors Further Mathematics Zimbabwe Zimsec Cambridge
4.vectors   Further Mathematics Zimbabwe Zimsec Cambridge4.vectors   Further Mathematics Zimbabwe Zimsec Cambridge
4.vectors Further Mathematics Zimbabwe Zimsec Cambridge
alproelearning
 

Similar to Karnaugh (20)

Boolean variables r010
Boolean variables   r010Boolean variables   r010
Boolean variables r010
 
NOTA TOPIK 2_SSK20152 (3).pptx
NOTA TOPIK 2_SSK20152 (3).pptxNOTA TOPIK 2_SSK20152 (3).pptx
NOTA TOPIK 2_SSK20152 (3).pptx
 
All aboutcircuits karnaugh maps
All aboutcircuits karnaugh mapsAll aboutcircuits karnaugh maps
All aboutcircuits karnaugh maps
 
simplification of boolean algebra
simplification of boolean algebrasimplification of boolean algebra
simplification of boolean algebra
 
Karnaugh maps
Karnaugh mapsKarnaugh maps
Karnaugh maps
 
discrete_BOOLEAN ALGEBRA
discrete_BOOLEAN ALGEBRAdiscrete_BOOLEAN ALGEBRA
discrete_BOOLEAN ALGEBRA
 
1.2 Ruler Postulates
1.2 Ruler Postulates1.2 Ruler Postulates
1.2 Ruler Postulates
 
Karnaugh mapping allaboutcircuits
Karnaugh mapping allaboutcircuitsKarnaugh mapping allaboutcircuits
Karnaugh mapping allaboutcircuits
 
K Maps.pptx
K Maps.pptxK Maps.pptx
K Maps.pptx
 
3,EEng k-map.pdf
3,EEng k-map.pdf3,EEng k-map.pdf
3,EEng k-map.pdf
 
A some basic rules of tensor calculus
A some basic rules of tensor calculusA some basic rules of tensor calculus
A some basic rules of tensor calculus
 
Kmap..(karnaugh map)
Kmap..(karnaugh map)Kmap..(karnaugh map)
Kmap..(karnaugh map)
 
9402730.ppt
9402730.ppt9402730.ppt
9402730.ppt
 
KARNAUGH MAPS
KARNAUGH MAPSKARNAUGH MAPS
KARNAUGH MAPS
 
Karnaugh maps
Karnaugh mapsKarnaugh maps
Karnaugh maps
 
Combinational circuit
Combinational circuitCombinational circuit
Combinational circuit
 
Ch.08
Ch.08Ch.08
Ch.08
 
DigitalLogic_BooleanAlgebra_P.pdf
DigitalLogic_BooleanAlgebra_P.pdfDigitalLogic_BooleanAlgebra_P.pdf
DigitalLogic_BooleanAlgebra_P.pdf
 
K map.
K map.K map.
K map.
 
4.vectors Further Mathematics Zimbabwe Zimsec Cambridge
4.vectors   Further Mathematics Zimbabwe Zimsec Cambridge4.vectors   Further Mathematics Zimbabwe Zimsec Cambridge
4.vectors Further Mathematics Zimbabwe Zimsec Cambridge
 

Recently uploaded

[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
Jason Yip
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Precisely
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
Neo4j
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
c5vrf27qcz
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
Edge AI and Vision Alliance
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
Miro Wengner
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
Alex Pruden
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 

Recently uploaded (20)

[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 

Karnaugh

  • 1. Karnaugh Maps Bob Harbort Bob Brown Computer Science Department Southern Polytechnic State University Simplifying Boolean Expressions We can use the sum-of-products method to generate any digital logic circuit for which we can write the truth table. While the sum-of-products method will always produce a correct circuit, it usually does not produce the optimal circuit. We want the simplest possible circuit because fewer gates or simpler gates mean reduced cost, improved reliability, and often increased speed. We can simplify a circuit by simplifying the Boolean expression for it, then using the techniques already learned to produce the circuit that is equivalent to the simplified expression. The need to simplify Boolean expressions occurs in programming as well as hardware design, and the techniques discussed here are equally applicable to programming. One way to simplify a Boolean expression is to apply the laws of Boolean algebra, some of which are summarized in the table on p. 144 of Tanenbaum. We will apply the laws of Boolean algebra to simplify AB + AB . We choose this expression because it is key to how Karnaugh maps work; other expressions can also be simplified using Boolean algebra. AB + AB original expression A(B + B) after applying distributive law A1 after applying inverse law 1A after applying commutative law A after applying identity law Therefore, AB + AB = A . Karnaugh Maps Karnaugh maps are a graphical way of using the relationship AB + AB = A to simplify a Boolean expression and thus simplify the resulting circuit. A Karnaugh map is a completely mechanical method of performing this simplification, and so has an advantage over manipulation of expressions using Boolean algebra. Karnaugh maps are effective for expressions of up to about six variables. For more complex expressions the Quine-McKluskey method, not discussed here, may be appropriate. The Karnaugh map uses a rectangle divided into rows and columns in such a way that any product term in the expression to be simplified can be represented as the intersection of a row and a column. The rows and columns are labeled with each term in the expression and its complement. The labels must be arranged so that each horizontal or vertical move changes the state of one and only one variable. Copyright © 1999, 2001 by Bob Brown
  • 2. Karnaugh Maps To use a Karnaugh map to simplify an expression: 1. Draw a “map” with one box for each possible product term in the expression. The boxes must be arranged so that a one-box movement either horizontal or vertical changes one and only one variable. See Figure 1. 2. For each product term in the expression to be simplified, place a checkmark in the box whose labels are the product's variables and their complements. 3. Draw loops around adjacent pairs of checkmarks. Blocks are "adjacent" horizontally and vertically only, not diagonally. A block may be "in" more than one loop, and a single loop may span multiple rows, multiple columns, or both, so long as the number of checkmarks enclosed is a power of two. 4. For each loop, write an unduplicated list of the terms which appear; i.e. no matter how many times A appears, write down only one A. 5. If a term and its complement both appear in the list, e.g. both A and A , delete both from the list. 6. For each list, write the Boolean product of the remaining terms. 7. Write the Boolean sum of the products from Step 5; this is the simplified expression. Karnaugh Maps for Expressions of Two Variables Start with the expression AB + AB . This is an expression of two variables. We draw a rectangle and divide it so that there is a row or column for each variable and its complement. A A Next, we place checks in the boxes that represent each of the product terms of the expression. The first product term is AB, so we place a check in the upper left block of the diagram, the conjunction B of A and B. The second is AB , so we place a check in the lower left block. Finally, we draw a loop around adjacent pairs of checks. B The loop contains A, B, A, and B . We remove one A so that the list is unduplicated. The B and B "cancel," leaving only A, Figure 1. Karnaugh map for which is the expected result: AB + AB = A . AB + AB . Let us try a slightly more interesting example: simplify A B + A B + A B . There are two variables, so the rectangle is the same as in the first example. We perform the following steps: • Place a check in the A B area. • Place a check in the AB area. • Place a check in the A B area. • Draw loops around pairs of adjacent checks. -2-
  • 3. Karnaugh Maps A A The Karnaugh map appears in Figure 2. Because there are two loops, there will be two terms in the simplified expression. The vertical loop contains A , B B, A , and B . We remove one A to make an unduplicated list. The B and B cancel, leaving the remaining A . From the horizontal loop we remove the duplicate B , then remove A and A leaving only B in the second term. We B write the Boolean sum of these, and the result is A + B , so: AB+AB+AB = A+B Figure 2. Karnaugh map for A B + A B + A B Expressions of Three Variables Recall that an essential characteristic of a Karnaugh map is that moving one position horizontally or vertically changes one and only one variable to its complement. For expression of three variables, the basic Karnaugh diagram is shown in Figure 3. AB AB AB AB As with the diagram for two variables, adjacent squares differ by precisely one literal. The left and right edges are C considered to be adjacent, as though the map were wrapped around to form a cylinder. C Now we'll work through a complete example, starting with deriving a circuit from a truth table using the sum of Figure 3. Form of a Karnaugh map products method, simplifying the sum of products expression, for expressions of three variables. and drawing the new, simpler circuit. Truth Table Product Sum-of-Products Digital Logic Terms Expression Circuit A B C X 0 0 0 1 ABC ABC+ABC+ ABC A B C 0 0 1 0 0 1 0 0 0 1 1 1 ABC 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1 ABC a) b) c) Figure 4. a) A truth table with product terms, b) the resulting sum-of-products expression, and c) the equivalent digital logic circuit. -3-
  • 4. Karnaugh Maps AB AB AB AB The truth table in Figure 4a generates an expression with three product terms, as shown in Figure 4b. A measure of the complexity C of a digital logic circuit is the number of gate inputs. The circuit in Figure 4c has 15 gate inputs. The Karnaugh map for the expression C in Figure 4b is shown at the right. In this Karnaugh map, the large loop surrounds A B C and A B C ; note that it "wraps around" from Figure 5. Simplifying the left edge of the map to the right edge. The A and A cancel, so A B C + A B C + A B C with a these two terms simplify to BC. Karnaugh map. A B C is in a cell all by itself, and so contributes all three of its terms to the final expression. The simplified expression is B C + A B C and the C A B simplified circuit is shown in Figure 6. In the simplified circuit, one three-input AND gate was removed, a remaining AND gate was changed to two inputs, and the OR gate was changed to two inputs, resulting in a circuit with ten gate inputs. Let’s consider another example. The truth table in Figure 7a generates a sum-of-products expression with five product terms of three variables each. The sum-of-products expression is shown in Figure 7b. The digital logic circuit for this expression, shown in Figure 6. Simplified circuit for the Figure 7c, has nine gates and 23 gate inputs. The Karnaugh map for truth table of Figure 4a. this expression is shown in Figure 8. Truth Table Product Sum-of-Products Digital Logic Terms Expression Circuit A B C X A B C 0 0 0 0 A BC+A BC+A BC 0 0 1 0 +A BC+A BC 0 1 0 1 ABC 0 1 1 1 ABC 1 0 0 0 1 0 1 1 ABC 1 1 0 1 ABC 1 1 1 1 A BC a) b) c) Figure 7. a) A truth table with product terms, b) the resulting sum-of-products expression, and c) the equivalent digital logic circuit. -4-
  • 5. Karnaugh Maps After removing duplicates, the large loop contains A and A AB AB AB AB and also C and C ; these cancel. All that's left after removing the C two complement pairs is B. The small loop contains B and B , which are removed, so it yields AC. We have simplified the expression in Figure 7b to B+AC. C Figure 8. Karnaugh map for the The circuit for B+AC is shown in Figure 9. We have expression of figure 7. simplified the circuit from nine gates and 23 inputs to two two-input gates. This is a substantial reduction in complexity. A B C Figure 9. Simplified circuit equivalent to Figure 7c. Getting the Best Results For maximum simplification, you want to make the loops in a Karnaugh map as big as possible. If you have a choice of making one big loop or two small ones, choose the big loop. The restriction is that the loop must be rectangular and enclose a number of checkmarks that is a power of two. When a map is more than two rows deep, i.e. when it represents more than three variables, the top and bottom edges can be considered to be adjacent in the same way that the right and left edges are adjacent in the two-by-four maps above. If all checkmarks in a loop are enclosed within other loops AB AB AB AB as well, that loop can be ignored because all its terms are accounted for. In the Karnaugh map in Figure 10, the vertical C loop is redundant and can be ignored. C Sometimes not all possible combinations of bits represented in a truth table can occur. For example, if four bits are used to encode a decimal digit, combinations greater than 1001 Figure 10. Karnaugh map showing a redundant loop. cannot occur. In that case, you can place a “D” (for “don’t care”) in the result column of the truth table. These D’s may be treated as either ones or zeroes, and you can place check marks on the map in the D’s positions if doing so allows you to make larger loops. -5-
  • 6. Karnaugh Maps One General Form for a Karnaugh Map There are several possible forms for a Karnaugh map, including some three-dimensional versions. All that is required is that a movement of one position changes the value of one and only one variable. We have shown a form for maps of two and three variables. Below are maps for four and five variables. AB AB AB AB ABC ABC ABC ABC ABC ABC ABC ABC CD DE CD DE CD DE CD DE Figure 11. One form of the Karnaugh map for expressions of four and five variables. A Notation Reminder The Boolean product of two variables is written as AB, A∧B or A·B; the variables are combined using the AND function. The Boolean sum of two variables is written as A+B or A∨B; the variables are combined using the OR function. The complement of a Boolean variable is written as A ; it is evaluated using the NOT function. The product, sum, and complement can be applied to expressions as well as single variables. Parentheses can be used to show precedence when needed. Bibliography Mendelson, Elliott, Schaum's Outline of Theory and Problems of Boolean Algebra, McGraw- Hill, 1970. Stallings, William, Computer Organization and Architecture: Designing for performance, Prentice-Hall, 1996. Tanenbaum, Andrew S., Structured Computer Organization, Prentice-Hall, 2006. -6-
  • 7. Karnaugh Maps Exercises 1. Verify that the circuit in Figure 9 is equivalent to the circuit in Figure 7c by deriving the truth table for the circuit in Figure 9 and comparing it to Figure 7a. 2. Sketch a Karnaugh map for expressions of six variables. Hint: See Figure 11. 3. The truth table for binary addition has three inputs: the addend, the augend, and the carry in. The output has two parts, the sum and the carry out. Write the truth table for the sum part of binary addition. Use a Karnaugh map to simplify the expression represented by this truth table. Hint: This is a sneaky question, but you will learn a lot about the power of Karnaugh maps. 4. Write the truth table for the carry part of binary addition. Use a Karnaugh map to simplify the sum-of-products expression which this truth table produces. 5. Use a Karnaugh map to simplify A B C + A B C + A B C . January, 2001 -7-