## Digital Circuit And Logic Design I

Digital Circuit And Logic Design I Lecture 4 Outline  Combinational Logic Design Principles (2) 1. Combinational-circuit minimization 2. Karnaugh m...
Author: Sydney Skinner
Digital Circuit And Logic Design I Lecture 4

Outline 

Combinational Logic Design Principles (2) 1. Combinational-circuit minimization 2. Karnaugh maps 3. Quine-McCluskey procedure

Panupong Sornkhom, 2005/2

2

Combinational Logic Design Principles (2)

1

1. Combinational-circuit minimization 









The complexity of a logic circuit is a function of the number of gates in the circuit. The complexity of a gate generally is a function of number of inputs to it. Reducing the number of literals in the Boolean function should reduce the number of inputs to each gate and the number of gates in the circuit However, various other criteria are used in circuit minimization. For instance, in the design of ICs, minimizing the area used by the circuit on the silicon wafer is important In the design of logic circuit using ICs, reducing number of ICs in the circuit means reducing cost of the circuit Panupong Sornkhom, 2005/2

4

1. Combinational-circuit minimization (cont.) 



Nevertheless, we will concentrate here on the Boolean function-minimization procedures that reduce the literals count in the function The minimization methods reduce the cost of two-level ANDOR, OR-AND, NAND-NAND, or NOR-NOR circuit in three ways   



By minimizing the number of first-level gates By minimizing the number of inputs on each first-level gate By minimizing the number of inputs on the second-level gate. This is actually a side effect of the first reduction

Most minimization methods are based on a generalization of the combining theorems  X·Y+ X·Y′ = X and (X+Y)·(X+Y′) = X Panupong Sornkhom, 2005/2

5

2. Karnaugh maps (K-maps)  



A graphical representation of a logic function’s truth table The map for an n-input logic function is an array with 2n cells, one for each possible input combination or minterm Each cell corresponds to an input combination that differs from each of its immediately adjacent neighbors in only one variable

two-variable K-maps Pictures from textbook Introduction to logic design Panupong Sornkhom, 2005/2

6

2

2. K-maps (cont.) three-variable K-maps

four-variable K-maps

Pictures from textbook Introduction to logic design 7

Panupong Sornkhom, 2005/2

2. K-maps (cont.)

five-variable K-maps Pictures from textbook Introduction to logic design 8

Panupong Sornkhom, 2005/2

2. K-maps (cont.)

six-variable K-maps

Pictures from textbook Introduction to logic design Panupong Sornkhom, 2005/2

9

3

2. K-maps (cont.) 

Representation of functions on K-maps 





Place a 1 corresponding to each minterm, all others are 0 Or, place a 0 corresponding to each maxterm, all others are 1 Usually, 0s are not shown explicitly on the K-maps, only 1s are shown, with a blank block corresponding to a 0.

Pictures from textbook Introduction to logic design Panupong Sornkhom, 2005/2

10

2. K-maps (cont.) 

Minimization 



2i 1-cells may be combined to form a product term containing n-I literals, where n is the number of variables in the function The remaining literals are the variables that have the same value throughout that set. The corresponding variable is complemented if it appears as 0 in all of the 1-cells, and uncomplemented if it appears as 1. Pictures from textbook Introduction to logic design Panupong Sornkhom, 2005/2

11

2. K-maps (cont.)

F = ΣX,Y,Z(0,1,4,5,6): (a) initial K-map; (b) K-map with circled product terms; (c) AND-OR circuit Pictures from textbook DDPP Panupong Sornkhom, 2005/2

12

4

2. K-maps (cont.) 

Minimization (cont.) 

Definition 



 

A minimal sum of a logic function F(x1,…, xn) is a sum-of-products expression for F such that no sum-of-products expression for F has fewer product terms, and any sum-of-products expression with the same number of product terms has at least as many literals A logic function P(x1,…, xn) implies a logic function F(x1,…, xn) if for every input combination such that P = 1, then F = 1 also.

P => F , “P implies F”, “F includes P”, “F covers P” A prime implicant of a logic function F(x1,…, xn) is a normal product term P(x1,…, xn) that implies F, such that if any variable is removed from P, then the resulting product term does not imply F

Panupong Sornkhom, 2005/2

13

2. K-maps (cont.) 

Minimization (cont.) 

Definition (cont.) 



In term of K-map, a prime implicant of F is a circled set of 1cells satisfying our combining rule, such that if we try to make it larger (covering twice as many cells), it cover one or more 0s.

Prime-implicant theorem  



A minimal sum is a sum of prime implicants The sum of all the prime implicants of a logic function is called the complete sum. Although the complete sum is always a legitimate way to realize a logic function, it’s not always minimal. So, how to select prime implicants to achieve a minimal sum?

Panupong Sornkhom, 2005/2

14

2. K-maps (cont.)

F = ΣX,Y,Z(5,7,12,13,14,15): (a) K-map; (b) prime implicants Pictures from textbook DDPP Panupong Sornkhom, 2005/2

15

5

2. K-maps (cont.) 

Minimization (cont.) 

Definition (cont.) 









A distinguished 1-cell of a logic function is an input combination that is covered only one prime implicant An essential prime implicant of a logic function is a prime implicant that covers one or more distinguished 1-cells

Essential prime implicant must be included in every minimal sum for the logic function. So, the first step in the prime-implicant selection is identify distinguished 1-cells and the corresponding prime implicants and include the essential prime implicants in the minimal sum Then we need only determine how to cover 1-cells, if any, that are not covered by the essential prime implicant Panupong Sornkhom, 2005/2

16

2. K-maps (cont.)

F = ΣX,Y,Z(1,3,4,5,9,11,12,13,14,15): (a) K-map; (b) prime implicants and distinguished 1-cells Pictures from textbook DDPP Panupong Sornkhom, 2005/2

17

2. K-maps (cont.) 

Minimization (cont.) 

Definition (cont.) 



Given two prime implicants P and Q in a reduced map, P is said to eclipse Q (written P…Q) if P covers at least all the 1-cells covered by Q

I P…Q and P costs no more than Q, then removing Q from consideration cannot prevent us from finding a minimal sum; that is, P is at least as good as Q. In such case, P is a secondary essential prime implicant

Panupong Sornkhom, 2005/2

18

6

2. K-maps (cont.) F = ΣX,Y,Z(0,1,2,3,4,5,7, 14,15): (a) K-map; (b) prime implicants and distinguished 1-cells; (c) reduce map after removal of essential prime implicants and covered 1cells

Pictures from textbook DDPP 19

Panupong Sornkhom, 2005/2

2. K-maps (cont.) 

Minimization (cont.) 



Some logic function may not have essential prime implicants, we can find a minimal sum by trial and error method or use the branching method. Starting with any 1-cell, we arbitrarily select one of the prime implicants that cover it, and we include it if it were essential. This simplifies the remaining problem, which we can complete the usual way to find a tentative minimal sum. We repeat this process starting with all other prime implicants that cover the starting 1-cell, generating a different tentative minimal sum from each starting point. Finally, we examine all of the tentative minimal sums that we generated in this way and select one that is truly minimal

20

Panupong Sornkhom, 2005/2

2. K-maps (cont.) F = ΣX,Y,Z(1,5,7,9,11,15): (a) K-map; (b) prime implicants; (c) minimal sum; (d) another minimal sum

Pictures from textbook DDPP

Panupong Sornkhom, 2005/2

21

7

2. K-maps (cont.) 

Don’t-Care input combinations 





Sometimes the specification of a combinational circuit is such that its output doesn’t matter for certain input combinations, called don’t-cares. The d(…) list specifies the don’t-care input combinations for the function, also known as the d-set. The procedure for circling set of prime implicants in K-map with don’t care is modified as follow: 



Allow d’s to be included when circling sets of1s, to make the sets as large as possible. Do not circle any sets that contain only d’s.

Panupong Sornkhom, 2005/2

22

2. K-maps (cont.)

Prime BCD-digit detector: (a) initial K-map; (b) K-map with prime implicants and distinguished 1-cells

Pictures from textbook DDPP Panupong Sornkhom, 2005/2

23

3. Quine-McCluskey procedure (QM procedure) K-maps are useful for function of up to five or six variables. Since the number of blocks doubles with addition of each variable, minimizing function with many variables becomes tedious The QM procedure is a tabular procedure that is useful in such cases The QM procedure uses the following step





 





First, the minterms (and don’t cares) of the function are classified into groups such that each term in a group contains the same number of 1s in the binary representation of the term Then the groups formed in step 1 are arranged in the increasing order of numbers of 1s. Let the number of groups be n. Each minterm in the group i (i = 1 to n-1) is compared those in group (i+1); if the two terms are adjacent, a combined term is formed. The variable thus eliminated is represent as “-” in the combined term. Panupong Sornkhom, 2005/2

24

8

3. QM procedure (cont.) 

The QM procedure (cont.) 



 



The matching operation of step 3 is repeated on the combined terms until no more combinations can be done. Each combined term in the final list is a prime implicant A prime implicant chart is then constructed, in which there is one column for each minterm (don’t cares are not listed) and one row for each prime implicant. An X in a row-column intersection indicates that the prime implicant corresponding to the row covers the minterm corresponding to the column. Then all the essential prime implicants are located . A minimum number of prime implicants from the remaining ones are selected to cover those minterms not cover by the essential prime implicants. The set of prime implicants thus selected forms the minimum function

25

Panupong Sornkhom, 2005/2

3. QM procedure (cont.) 

Example 



F = ΣA,B,C,D(0,2,4,5,6,9,10) + d(7,11,12,13,14,15)

Step 1 and 2 



Each minterm and don’t-care is expanded into binary form, and groups of terms with the same number of 1s are formed. The group are then arranged in the order of increasing number of 1s. Note that don’t-cares are treated as equivalent to minterms until selection of PIs in step 5

0

0000

Group 0

2 4

0010 0100

Group 1

5 6 9 10 12

0101 0110 1001 1010 1100

Group 2

7 11 13 14

0111 1011 1101 1110

Group 3

15

1111

Group 4

26

Panupong Sornkhom, 2005/2

3. QM procedure (cont.) 

Step 3 



The minterm in group 0 is compared with each minterm in group 1. Because 0 is adjacent to both 2 and 4, we obtain (0,2) and (0,4). The term that were combined are shown with a check mark. We now repeat comparison between term in groups 1 and 2. Minterm 2 combines with only 6 and 10, and minterm 4 combins only with 5, 6 and 12. This matching process is repeated between group 2 and 3 and group 3 and 4.

Panupong Sornkhom, 2005/2

3(0,2) 3(0,4)

00-0 0-00

Groups 0 and 1

3(2,6) 3(2,10) 3(4,5) 3(4,6) 3(4,12)

0-10 -010 01001-0 -100

Groups 1 and 2

3(5,7) 3(5,13) 3(6,7) 3(6,14) 3(9,11) 3(1,13) 3(10,11) 3(10,14) 3(12,13) 3(12,14)

01-1 -101 011-110 10-1 1-01 1011-10 11011-0

Groups 2 and 3

3(7,15) 3(11,15) 3(13,15) 3(14,15)

-111 1-11 11-1 111-

Groups 3 and 4

27

9

3. QM procedure (cont.) 

Step 4 





Continue with the process of matching the terms obtained from previous step. Repeat the matching until no other combination are possible Hence, the remaining term in the list are prime implicants

(0,2,4,6)

0--0

(2,6,10,14) 3(4, 5, 6, 7) 3(4,5,12,13) 3(4,6,12,14)

--10 01--10-1-0

3(5,7,13,15) 3(6,7,14,15) (9,11,13,15) (10,11,14,15) 3(12,13,14,15)

-1-1 -111--1 1-111--

(0,2,4,6)

0--0

PI1

(2,6,10,14) (4, 5, 6, 7,12,13,14,15)

--10 -1--

PI2 PI3

(9,11,13,15) (10,11,14,15)

1--1 1-1-

PI4 PI5

28

Panupong Sornkhom, 2005/2

3. QM procedure (cont.) 

Step 5 





minterm

Draw PI chart which there will be one row corresponding to each PI and one column corresponding to each minterm. Don’t-cares are ignored. An × symbol in the row-column intersection indicates that the minterm corresponding to the column is covered by the PI corresponding to the row.

PI1

3

3

3

3

3

3

0

2

4

5

6

9

×

×

×

×

×

PI2

× ×

PI3

×

If there is a single × in any column, the corresponding PI is essential

×

×

Step 6 

10

×

PI4

×

PI5

29

Panupong Sornkhom, 2005/2

3. QM procedure (cont.) 

Step 7 





minterm

Once PI1, PI3, and PI4 are selected, all the minterms except 10 are covered To cover minterm 10, we can select either PI2 or PI5 , since they have the same number of literals

Step 8 

Reduce function is F(A,B,C,D) = PI1 + PI3 + PI4 + PI2 or PI5 = 0--0 + -1-- + 1--1 + --10 or 11= A′·D′+B+AD+ A′·B′ or A′·D′+B+AD+ A·C

PI1

3

3

3

3

3

3

0

2

4

5

6

9

×

×

×

PI2 PI3 PI4 PI5

Panupong Sornkhom, 2005/2

×

×

× ×

10

×

×

× × ×

30

10