Karnaugh Map (K-Map) Ch. 2.4 Ch. 2.5 Simplification using K-map A graphical map method to simplify Boolean function up to 6 variables A diagram made up of squares Each square represents one minterm (or maxterm) of a given Boolean function 2 Karnaugh Map Examples Karnaugh Map Note that the Hamming Distance between adjacent columns or adjacent rows (including cyclic ones) must be for simplification purposes Adjacent columns or rows allow grouping of minterms (maxterms) for simplification 3 4
Implicant A product term is an Implicant of a Boolean function if the function has an output for all minterms of the product term. In K map, an Implicant is bubble covers only (bubble size must be a power of 2) AB Prime Implicant If the removal of any literal from an implicant I results in a product term that is not an implicant of the Boolean function, then I is an Prime Implicant. Examples B is an implicant, but or BD or BC do not imply a in this function; B is a PI B C D is an implicant, but B C is not an implicant, thus B C D is not a PI In K map, a Prime Implicant (PI) is AB bubble that is expanded as big as possible (bubble size must be a power of 2) 5 6 Essential Prime Implicant If a minterm of a Boolean function is included in only one PI, then this PI is an Essential Prime Implicant. In K map, an Essential Prime Implicant is Bubble that contains a covered only by itself and no other PI bubbles AB Non Essential Prime Implicant A Non Essential Prime Implicant is a PI that is not an Essential PI. In K map, an Non Essential Prime Implicant is A covered by more than one PI bubble AB 7 8
Simplification for SOP Form K-Map for the given Boolean function Example for SOP PIs for s Identify all Essential Prime Implicants for s in the K- map Identify non-essential Prime Implicants in the K-map for the s which are not covered by the Essential Prime Implicants PIs to cover s Form an SOP based on A BC Form a sum-of-products (SOP) with all Essential Prime Implicants and the necessary non-essential Prime Implicants to cover all s 9 Example for SOP PIs for s Example for SOP PIs for s PIs to cover s Form an SOP based on AB PIs to cover s Form an SOP based on AB 2
Prime Implicants Simplification for POS All the prior definitions apply to (or maxterm) as well Consider these implicants imply a output Form K-Map for the given Boolean function Identify all Essential Prime Implicants for s in the K- map Identify non-essential Prime Implicants in the K-map for the s which are not covered by the Essential Prime Implicants Form a product-of-sums (POS) with all Essential Prime Implicants and the necessary non-essential Prime Implicants to cover all s 3 4 Example for POS PIs for s Example for POS PIs for s PIs to cover s Form an POS based on A BC PIs to cover s Form an POS based on AB 5 6
Don t Care Condition X Don t care (X) Those input combinations which are irrelevant to the target function (i.e. If the input combination signals can be guaranteed never occur) Can be used to simplify Boolean equations, thus simply logic design In K-map Use X to express Don t Care in the map Don t care can be bubbled as or depending on SOP or POS simplification to result into bigger bubble Don t Care Example B to Gray Code B-coded input Gray Code Output B stands for Binary Decimal b3 b2 b b g3 g2 g g Coded Decimal Each digit of a decimal 2 4 3 5 number is represented by one code 6 B only encodes from 7 8 to 9 9 X X X X X X X X 2 X X X X 3 X X X X 4 X X X X 5 X X X X Require 4 bits Only use out of 6 encoding space 7 8 B to Gray Code (Do not use Don Care) B-coded input Gray Code Output B stands for Binary Decimal b3 b2 b b g3 g2 g g Coded Decimal Each digit of a decimal 2 4 3 5 number is represented by one code 6 B only encodes from 7 8 to 9 9 2 3 4 5 Require 4 bits Only use out of 6 encoding space What g2 is? g2 = F(b3, b2, b, b) 9 2
Example: g2 of B to Gray Another Example of Don t Care (SOP) Without using Don t Care Take Don t Care into account b b b 3 b 2 b b b 3 b 2 X X X X X X AB X X X 2 22 Another Example of Don t Care (POS) Use Karnaugh Map in B 5 or B 6 AB X X X In B 5 2 K-maps are to be constructed (2 submaps) Consider one submap is on top of the other Cells that occupy the same relative position in 2 maps are considered adjacent Bubble can be constructed in vertical dimension when stacking up 2 maps In B 6 4 K-maps are to be constructed (4 submaps) Similar to B 5, yet another dimension needs to be considered 23 24
Karnaugh Map Example in B 5 Karnaugh Map Example in B 6 AB AB E = E = WX U,V=, WX X WX U,V=, WX 25 26 U,V=, U,V=, Minimal SOP and POS w/ Don t care Could lead to different function if the same x is treated as in SOP but as in POS. Even though the final Boolean functions could be different, but for those ones with non don t care square, correct functionality was maintained. A B x x F = Ā (SOP) F = B (POS) F = Ā (POS) Use Karnaugh Map in B 5 or B 6 It is getting hard and complicated Eye-ball simplification on several submaps is error-prone, leading to sub-optimal results Do we have a better algorithm? Quine-McCluskey Method 27 28