You are on page 1of 18

Badass unit 4 combinational logic kmaps, prime imp don't care ! ! ! ! Ms Sandhya Rani Dash !

UNIT 4: COMBINATIONAL LOGIC MINIMISATION AND DESIGN USING KARNAUGH MAP ! ! Structure ! ! 4.1 Introduction 4.2 Objectives ! 4.3 Karnaugh Map ! 4.3.1 2, 3, 4 variable Karnaugh map ! 4.3.2 Definition of implicates 4.3.3 Prime implicates ! 4.3.4 Essential and Non-Essential prime implicates ! 4.3.5 Truth table representation on Karnaugh Map 4.4 Logic Minimization using Karnaugh Map ! 4.5Five&Six Variable Maps ! 4.6 Minimization of Logic Functions using minterm/maxterm 4.7DontcareConditions ! 4.8 Unit Summary ! ! 4.1 Introduction ! ! In the previous unit we have discussed about logic operations and Boolean algebra. ! Boolean algebraic theorems are used for the manipulation of logical expressions. In ! this unit we will discuss about the minimization of logical functions using karnaugh ! maps. it is the simplest and most commonly used method for simplifying Boolean ! expressions .The n-variable k- map methods for simplification of Boolean or ! switching functions are described here. The methods for minimization of ! combinational logics are also explained in this unit ! ! 4.2 Objectives ! After going through this unit you will be able to: ! ! i) define a combinational circuit. ! ii) explain the n-variable karnaugh maps. ! iii) define different types of implicantes ! iv)convert a standard SOP &POS expression into truth table format ! iv) simplify the combinational logic functions using k- map. ! v) minimize the SOP & POS expressions ! ! ! !

! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !

vi) usethedontcareconditionsinkarnaughmapforfurthersimplification. COMBINATIONAL CIRCUITS Combinational circuits consist of logic gates whose output depends only on the current inputs at any given time. It does not store the history of the circuit. So memory is not required for a combinational circuit. A combinational circuit consists of input variables, logic gates and output variables. The logic gates accept signals from the inputs and generate signal to the output. The information transfer from input to output is in the binary form. A Block diagram of a combinational circuit is shown below.

n input Variables . . .

Combinational Logic circuit

m output variables . . .

The n input binary variables come from an external source: The m output variables go to an external destination. In many applications, the source and the destination are storage registers. For n input variables, there are 2n possible combinations of binary input values. A combinational circuit can be described by m Boolean functions, one for each output variable. 4.3 Karnaugh Map The simplification of logical functions using Boolean laws and theorems become complex with the increase in the number of variables and terms. So to avoid this type of complexity, the K-Map method was first proposed by Veitch and Gightly. It was latter modified by Karnaugh and is now popularly known as the Veitch Diagram or Karnaugh Map (or K-map). The K-map technique provides a systematic method foe simplifying and manipulating Boolean expression. It is a graph composed of an arrangement of an adjacent cells. Each cell represent a particular combinations of variables in sum or product form. The

! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !

K-Map is actually a modified form of a truth table. Here the combinations are conveniently arranged to aid the simplification process by applying the rule AB + AB' = A. Although the K-map technique may be used for any number of variables, it is generally used up to six variables. Beyond which it would be very difficult. 4.3.1 2, 3, 4 variable Karnaugh map

In an n-variable K-map, there are 2n cells where each cell corresponds to one combination of n-variables. Therefore, for a 2-variable K-map, there are 22= 4 possible combinations of minterms. Similarly, for 3 and 4 variable K-map, there should be 23= 8 and 24= 16, number of minterms and so on. The 2, 3, 4 variable Kmaps are shown in the figure given below.

The decimal codes corresponding to each combination of variables (minterm) written in each cell at the right corner. The variables have been designated as A, B, C, D and the binary numbers formed by them are taken as AB, ABC, and ABCD for 2, 3, 4 variables respectively. The decimal codes given in 3 and 4 variable K-maps are cyclic, or unit distance codes. This code differs in one variable. This make easier for the simplification of Boolean function by grouping of the adjacent cells. The left and right most cells of the

! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !

three variables K-map are adjacent. For example: The cells 0 & 4 are adjacent and the cells 1 & 5 are adjacent. In 4 variables K-map the cells to the extreme left and right as well as at the top and bottom portion are adjacent. 4.3.2 Truth table representation on K-map The truth table is a common way of representing the logical expressions of a circuit. It consists of a list of the possible combinations of input variable values and the corresponding output values (1 or 0). The standard SOP & POS expressions can be determined from a truth table. Also the outputs of a truth table of a logic function can be represented on the k-map. Let us consider a truth table of 3 variable logical functions as follows. A 0 0 0 0 1 1 1 1 Input B 0 0 1 1 0 0 1 1 C 0 1 0 1 0 1 0 1 Output Y 0 1 1 0 1 0 0 1

Corresponding to the output of logic 1, Y can be written in standard SOP form as __ _ _ __ Y= ABC + ABC + ABC + ABC Corresponding to logic 0, y can be written in POS form as _ _ _ _ _ _ Y= (A + B + C) (A + B + C) (A + B + C) (A + B + C) The value of the output variable Y (0 or 1) for each row of truth table is entered in the corresponding cells of the K-map The K-Map for the above three variable expression is shown below. Variables _ C C __ AB 00 0 1 0 1 _ AB 01 1 0 AB 11 0 1 _ AB 10 1 0

! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !

This is the common procedure used to represent a truth table on the K-map. On the other hand a truth table can also b e prepared, if a K-map is given by following the reverse process. Conversion of SOP expression to truth table format The steps for converting a SOP expression to truth table format are as follows. Step-1: List all possible combinations of binary values of the variables in the expression. Step-2: Convert the SOP expression to standard form if it is not already. Step-3: Finally place a 1 in the output column for each binary value that makes the standard SOP expression and place a 0 for all the remaining binary values. Example: Develop a truth table for the standard Sop expression _ _ _ ABC + ABC SOLUTION: The truth table for the above standard Sop expression is given below A 0 0 0 0 1 1 1 1 B 0 0 1 1 0 0 1 1 C 0 1 0 1 0 1 0 1 OUTPUT 0 0 1 0 0 1 0 0 _ ABC _ _ ABC PRODUCT TERM

! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !

Conversion of POS expression to truth table format A POS expression is equal to 0 only if at least one of the sum term is equal to 0. To construct a truth table from a POS expression, the steps are as follows. Step-1: List all possible combinations of binary values of the variables in the

expression just as was done for the SOP expression Step-2: Convert the SOP expression to standard form if it is not already. Step-3: Finally place a 0 in the output column for each binary value that makes the standard SOP expression and place a 1 for all the remaining binary values. Example: Develop a truth table for the standard POS expression _ _ _ _ _ (A + B + C) (A + B + C) (A + B + C) SOLUTION: The truth table for the above standard POS expression is given below A 0 0 0 0 1 1 1 1 B 0 0 1 1 0 0 1 1 C 0 1 0 1 0 1 0 1 OUTPUT 1 0 0 1 1 1 1 0 _ _ _ A+B+C __ A+B+C _ A+B+C PRODUCT TERM

! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !

Self Check Exercise 1 1) Draw a 2, 3, 4 variable K-map and label each cell according to its binary value. 2) Write the problem term for each cell in a 2, 3, 4 variable K- map 3) Develop a truth table for each of the standard SOP expression _ _ _ i) ABC +ABC _ __ ii) ABC + ABC 4) Develop a truth table for each of the standard POS expression _ _ _ _ _ i) (A+B+C) (A+B+C) (A+B+C) _ _ _ _ ii) (A+B+C) (A+B+C) (A+B+C)

4.4 Logic Minimization Using Karnaugh Map Simplification of logic functions with K-map is based on the principle of combining terms in adjacent cells. The adjacent (Horizontal & vertical but not diagonal) cells differ in only one variable. So the minimization of logical functions are achieved by groupingadjacent1sor 0singroupsof2i ,wherei=1,2,3,.,nisthenumberof variables. The process of simplification involves grouping of minterms by drawing a loop around the c ells and identifying prime implicants and essential prime implicants. Prime Implicant A prime implicant is a group of minterms that can not be combined with any other minterms or groups. Essential Prime Implicant An essential prime implicant is a prime implicant in which one or more minterms are unique. i.e. it contains at least one minterm which is not contain in any other prime implicant.

! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !

! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !

! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !

4.5 Five & Six Variable Maps A 5-variable K-map contains 25 =32 number of squares. The no. of square is always equal to the no. of minterms. The 32 minterms are designated as m0 , m1 , m2 . . . . . m31. _ __ _ _ The input variables are A B C D E ,E , . . . . . . ABCDE in SOP form. In POS form the _ _ _ _ _ _ input variables are marked as A +B +C + D + E, A + B + C +D +E, A +B +C +D +E with max term designations M0, M1, M2 . . . . . M31. Boolean functions with five variables can be simplified using two 4-variable maps (16 cells each) For 6- variable K-map, we need 26 = 64 no. of squares. Maps of more than four variables are not as simple to use. Maps with seven or more variables need too many squares. So these become more complicated to solve the logical functions. The five and six variable K-maps are shown in the figure.
AB CDE 000 001 011 010 110 111 101 100

00 01 11 10
ABC

0 8 24 16
DEF 000

1 9 25 17
001

3 11 27 19
011

2 10 26 18
010

6 14 30 22
110

7 15 31 23

5 13 29 21
111

4 12 28 20
101 100

Five-variable map

000 001 011 010 110 111 101 100

0 8 24 16 48 56 40 32

1 9 25 17 49 57 41 33

3 11 27 19 51 59 43 35

2 10 26 18 50 58 42 34

6 14 30 22 54 62 46 38

7 15 31 23 55 63 47 39

5 13 29 21 53 61 45 37

4 12 28 20 52 60 44 36

six-variable map

! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !

The decimal code of the rows and columns are given in a reflected code sequence; the minterm assigned to each square is read from these numbers. For example the square in the second row (01) and fourth column (010), in the five variable map, is number 01010, the equivalent of decimal 10. Therefore, this square represents minterm m10. The simplification of 5 & 6 variable K-maps can be done in the same way as 4variable K-map 4.6 Minimization of Logic Functions Specified in Minterm/Maxterm If an expression is simplified to a stage beyond which it cant be simplified, it will require minimum number of gates with minimum number of inputs to the gates. Such an expression is referred to as the minimized expression. For minimizing a given logic expression specified in minterm/maxterm, we have to prepare the k-map first. Then look for combination of 1sfortheminterm(SOP form) or0sforthemaxterm(POS form).Wehavetocombinethe1sor0sinsuchaway that the resulting expression is minimum. To achieve this, following rules can be used which will lead to minimized expression. Identifyingthe1s thatcantbecombinedwithanyother1sandformgroups with such single 1. These are essential prime implicants. Identifythe1s which are adjacent to only one other 1 and form groups any group of containinganytwocellsandwhicharentpartof any group of four or eight cells. A group of two cells is called a pair. Group the 1s which results in groups of four cells but arent of an eight cells. A group of four cells is called a quad. Groupthe1swhichresultsingroupsofeightcells.Agroupofeightc ells is called a octet. Afteridentifyingtheessentialgroupsof2,4and81s,iftherestillremains 1swhichhaventbeenencircledthenthesearetobecombined Witheachotherorwithotherencircled1s Discard any redundant group.

! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !

Form the logical sum of all the terms generated by each group. When one or more than one variable appear in both complemented and un complemented form with in a group , then that variable is eliminated from the term corresponding to that group. A larger group of 1s eliminates more variables. A group of two eliminates one variable; a group of four eliminates two variables; similarly a group eight eliminates three variables. The above rules are used to minimize the logical functions in the following example given below. Example: Simplify the expression Y= (7, 9, 10, 11, 12, 13, 14, 15) , using the kmap method. SOLUTION: The above function is in SOP form. The k-map for the function is as shown in the figure.

In the given k-map there are three pairs and one quad. The! output for each of the above group is given as _ Y1 = CD (AB + AB) = BCD __ _ _ Y2 = AB (CD + CD + CD + CD) _ _ _ Y3= AB (CD + CD ) + AB (CD + CD) _ = ABC + ABC = AC _ _ _ Y4 = AB (CD + CD) + AB (CD + CD) _ = ABD + ABD

! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"!#$! %&'(')*('+!,!"!,-!.!,/!.!,0!.,1!
= AB+ AD + AC + BCD

It can be further simplified by using Boolean algebra. Y = A (B + D + C) + BCD Example 2: Simplify the expression Y = ( 0, 1 ,4, 5, 6, 8, 9, 12, 13, 14) using KMap method SOLUTION: The given function is in the POS form. This can also be written as :

Y = (A + B + C + D) (A + B + C + D) (A + B + C + D) _ _ _ _ _ = (A + B + C + D) (A + B + C + D) (A + B + C + D) _ _ _ _ _ _ _ _ = (A + B + C + D) (A + B + C + D) (A + B + C + D) _ _ _ = (A + B + C + D) To simplify a POS expression for each maxterm in the given expression, a 0 has to be entered in the corresponding cells and groups must be formed with 0 cells instead of one cell to get the minimal expression. Here, a variable corresponding to 0 has to be represented in the uncomplemented form and that corresponding to 1 in the complemented form The K-map for the above function is shown in the figure given below:

! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !

!"#$%&#'()*&#+,-'./#)"&#)0$&$#'"1#)"&#23'1#'4&#.4)130&1#(5#0)-(6"6"7#8#0&99:;# <%&#:6-.96=6&1#=)4-#)=#$%&#)0$&$#6:#76*&"#':# _ _ _ _ _ =(C + D) [ (A + B ) (A + B ) (A + B ) (A + B )] _ _ _ _ _ _ =(C + D) [ (A + A.B + A + B +0 ) (A + A.B + A B +0 )] _ _ _ _ =(C + D) [ (A + A + B ) (A + A B )] _ _ _ =(C + D) [ (A + B ) (A)] _ _ =(C + D) [ A B )] _ _ =C + A BD 4.7 Dont Care Conditions Theentryof1s&0sinthek-map specify the combination of input variables (or the minterm) that makes the function equal to 1or 0, respectively. The maps are simplifiedbyusingSOPorPOSmethod.So1sare entered in case of SOP method and 0s are entered in case of POS method. The cells which dont contain 1 are assumedtocontain0&viceversa.Butthisisntalwaystrue.Sinceincertaindigital systems, some input combinations never occur during the process of normal operation as long as the system is working properly. Because they are guaranteed never to occur. As a result we dont care what the function output is for such input combinations. That means the output may be 0 or 1 that depends upon the choice of the designer. This condition is known as dontcareconditions. Definition: The combination of output variables for which the value function isnt specified by either 0 or 1are called don,t care conditions. These combinations are representedbyd or X. In k-map method when we choose the adjacent squares for simplification, the choice of X may be either 0 or 1 , whichever gives the simplest expression. Also, a dont carecombinationneedntbeusedingroupingifitdoesntcoveralargearea. Example: Using the K-map method, simplify the following Boolean expression.

! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !

f ( A, B, C, D) = m (1, 3, 7, 11, 15) + d(0, 2, 5) Solution: The above expression is in SOP form. The K- map for this is given below.

Grouping of 1 gives __ __ _ _ Y1 = AB (CD + CD + CD + CD) __ _ = AB(C + C) __ = AB Grouping of 2 gives __ _ _ Y2 = CD (AB + AB + AB + AB) _ = CD (A + A) =CD Therefore Y = Y1 + Y2 _ _ = AB +CD

! ! ! ! ! ! ! ! ! ! ! ! !

Example 2: Using the K-map method, simplify the following Boolean expression. f ( A, B, C, D) = M(4, 5, 6, 7, 8, 12) + d(1, 2, 3, 9, 11, 14) SOLUTION: The above expression is in POS form. The K- map for this is given below.

Grouping of 1 gives _ Y1 = A + B Grouping of 2 gives


_ Y2 = A+C +D _ _ Y =( A + B) ( A + C + D)

Self check exercise 2 5. Use a K-map to find the minimized SOP for each expression _ i) A + BC + CD ____ ___ _ ii) ABCD + ABCD + ABCD + ABCD _ iii) AC (B + C) ___ __ _ _ _ iv) ABC + ABC + ABC + ABC 6. Use a K-map to find the minimized POS for each expression _ _ _ _ _ _ i) (A + B) (A + C) (A + B + C) (A + B + C) _ _ _ _ _ _ _ _ ii) (A + B + C + D) (A + B + C + D) (A + B + C + D)

7. Reduce the expressio nm(1,5,6,12,13,14)+d(2,4) 8. Using K-map method, reduce the following expression to the simplest possible POS & SOP forms. m (0, 2, 3, 6, 7) + d(8, 10, 11, 15) 4.8 Unit Summary In this unit we have considered the simplification of logical expressions by using the n-variable K-map technique. The K-map is a chart or graph composed of an arrangement of adjacent cells, each representing a particular combination of variables in a sum or product term. The n-variable K-map has 2n cells or squares and its use is limited to six variables. The truth table representation of the Boolean expressions is also discussed here. The truth table representation is a common way of representing the logical expression of a circuit in a concise format. The standard SOP & POS expressions can be determined from a truth table. In K-maps, dont care terms are also used to help in reducing the expression. Combinations for which the value of an expression isnt specified, are called dont care combinations. A dontcaretermisaminterm/maxterminalogicfunctionwhich may or may not included. Answers to Check Your Progress 1) A 3-vaiable K-map has i) Eight cells ii) three cells iii) sixteen cells iv) four cells 2)In a 4-vaiable K-map, a 2-vaiable product term is produced by i) atwocellgroupof1s ii) aneightcellgroupof1s iii) afourcellgroupof1s iv) afourcellgroupof0s

3) On a K-map,groupingthe0sproduces i) a product of sum expression ii) a sum of product expression iii) a dontcarecondition iv) AND-OR logic 4) A 5-variable K-map has i) sixteen cells ii) thirty-two cells iii sixty-four cells iv) eight cells

5) Dontcaretermsarerepresentedbywhichalphabetofthefollowing i) Y & Z ii) X & d iii) T & C iv) N & C

6) Thedontcaretermink-map can have the value i) 0 ii) 1 iii) both 0 or 1 2 (iii) 3 (i) 4 (ii) 5 (ii) 6 (iii)

Answers: 1 (i)

Unit End Exercise


1. Simplify the following expression using K-map __ ___ _ _ __ i) ABC + ABC + ABC + ABC _ _ _ ii) ABC + AB + C + BC + DB 2. Simplify the following expression using K-map _ _ _ i) A(A + B + C)(A + B + C)(A + B +C)(A + B + C) _ _ ii) (A + B) (A + B + C) (A + C) 3. Draw a truth table for the equations given below: _ _ i) Y= AC + AB ii) y= A(B + C)

You might also like