50
1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified by map method as Karnaugh map or K-map. n The map is made up of squares, with each square representing one minterm of the function. n This produces a circuit diagram with a minimum number of gates and the minimum number of inputs to the gate. n It is sometimes possible to find two or more expressions that satisfy the minimization criteria.

Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

Embed Size (px)

Citation preview

Page 1: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

1

Chapter 3 Gate-Level Minimization

n The Boolean functions also can be simplified by map method as Karnaugh map or K-map.

n The map is made up of squares, with each squarerepresenting one minterm of the function.

n This produces a circuit diagram with a minimum number of gates and the minimum number of inputs to the gate.

n It is sometimes possible to find two or more expressions that satisfy the minimization criteria.

Page 2: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

2

Two-Variable mapn Two-variable has four minterms, and consists of

four squares.n m1 + m2 + m3 = x’y + xy’ + xy = x + y

Page 3: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

3

Three-Variable mapn Note that the minterms are not arranged in a binary

sequence, but similar to the Gray code.n For simplifying Boolean functions, we must recognize the

basic property possessed by adjacent squares.

n m5+m7= xy’z + xyz = xz(y’ + y) = xz

y

cancel

Page 4: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

4

Simplification of the number of adjacent squares

n A larger number of adjacent squares are combined, we obtain a product term with fewer literals.

1 square = 1 minterm = three literals.

2 adjacent squares = 1 term = two literals.

4 adjacent squares = 1 term = one literal.

8 adjacent squares encompass the entire map and produce a function that is always equal to 1.

n It is obviously to know the number of adjacent squares is combined in a power of two such as 1,2,4, and 8.

Page 5: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

5

ExampleEx. 3-3 F(x, y, z) = ? (0, 2, 4, 5, 6)

F = z’+ xy’

Page 6: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

6

3-2. Four-variable map1 square = 1 minterm = 4 literals2 adjacent squares = 1 term = 3 literals4 adjacent squares = 1 term = 2 literals8 adjacent squares = 1 term = 1 literal16 adjacent squares = 1

Page 7: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

7

ExampleEx. 3-6 F = A’B’C’ + B’CD’ + A’BCD’ + AB’C’

= B’D’ B’C’+ A’CD’+

Page 8: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

8

Essential prime implicants

n If a minterm in a square is covered by only one prime implicant, that the prime implicant is said to be essential.

Page 9: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

9

Prime implicantn A prime implicant is a product

term obtained by combining the maximum possible number of adjacent squares in the map.

n This shows all possible ways that the three minterms(m3,m9,m11) can be covered with prime implicants.

F = BD+B’D’+CD+AD= BD+B’D’+CD+AB’= BD+B’D’+B’C+AD= BD+B’D’+B’C+AB’

Page 10: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

10

3-3. Five-variable mapn Fig.3-12, the left-hand four-variable map represents the 16 squares

where A=0, and the other four-variable map represents the squares where A=1.

n In addition, each square in the A=0 map is adjacent to the corresponding square in the A=1 map.

Page 11: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

11

Five-variable mapn It is possible to show that any 2k adjacent squares, for

k=(0,1,2,… ,n) in an n-variable map, will represent an area that gives a term of n- k literals(n>k). When n=k, it is identity function.

Page 12: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

12

exampleEx. 3-7 F(A, B, C, D, E) = (0, 2, 4, 6, 9, 13, 21, 23, 25, 29, 31)Because of both parts of the map have the common term (A’BD’E+ABD’E)

so the sum of products isF = A’B’E’ + BD’E + ACE

common

Page 13: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

13

3-4. Product of sums simplification

n If we mark the empty squares by 0’s rather than 1’s and combine them into valid adjacent squares, we obtain the complement of the function, F’. Use the DeMorgan’s theorem, we can get the product of sums.

Ex.3-8 Simplify the Boolean function in

(a) sum of products

(b) product of sums

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

Page 14: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

14

Example(a) SOPs

F=

(b) POSsF’=By DeMorgan’s thmF=

B’D’+ B’C’+ A’C’D

AB + CD + BD’

(A’+B’) .(C’+D’)

.(B’+D)

Page 15: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

15

Gate implementation

Page 16: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

16

Exchange minterm and maxtermn Consider the truth table

that defines the function F in Table 3-2.

Sum of mintermsF(x, y, z) = ? (1, 3, 4, 6)Product of maxtermsF(x, y, z) = ? (0, 2, 5, 7)n In the other words, the 1’s

of the function represent the minterms, and the 0’srepresent the maxterms.

Page 17: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

17

3-5. Don’t care conditionsEx.3-9 Simplify the F (w, x, y, z)= ? (1, 3, 7, 11, 15) with

don’t-care conditions d(w, x, y, z) = ? (0, 2, 5)In part (a) with minterms 0 and 2à F = yz + w’x’In part (b) with minterm 5 à F = yz + w’z

Page 18: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

18

3-6. NAND and NOR implementation

n NAND gate is a universal gate because any digital system can be implemented with it.

n NAND gate can be used to express the basic gates, NOT, AND, and OR.

Page 19: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

19

Two graphic symbols for NAND gate

n In part (b), we can place a bubble (NOT) in each input and apply the DeMorgan’s theorem, then get a Boolean function in NAND type.

Page 20: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

20

Two-level implementationF = AB + CD

Double complementation, so can be removed

=

OR gate,Fig.3-18

=

Page 21: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

21

Multilevel NAND circuitsn To convert a multilevel AND-OR diagram into an

all-NAND diagram using mixed notation is as follows:

1. Convert all AND gates to NAND gates with AND-invertgraphic symbols.

2. Convert all OR gates to NAND gates with invert-ORgraphic symbols.

3. Check all the bubbles in the diagram. For every bubblethat is not compensated by another small circle along the same line, insert an inverter or complement the input literal.

Page 22: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

22

Multilevel NAND circuits

,

,

Page 23: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

23

NOR implementationn The NOR operation is the dual of the NAND operation, all

procedures and rules for NOR logic are the dual of NAND logic.

n NOR gate is also a universal gate.

Page 24: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

24

Two graphic symbols for NOR gate

n In part (b), we can place a bubble (NOT) in each input and apply the DeMorgan’s theorem, then get a Boolean function in NOR type.

Page 25: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

25

Implementing F with NOR gatesF = (AB’ + A’B)(C + D’)n To compensate for the bubbles in four inputs, it is

necessary to complement the corresponding input literals.

Page 26: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

26

3-7. Other two-level implementations

n Some NAND or NOR gates allow the possibility of a wire connection between the outputs of two gates to provide a wired logic.

n Open-collector TTL NAND gates, when tied together, perform the wired-AND logic (Fig.3-28).

n The wired-AND gate is not a physical gate.

Wired-And

Page 27: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

27

Nondegenerate formsn We consider four types of gates: AND, OR, NAND,

and NOR. These will have 16 combinations of two-level forms.

n Eight of these combinations are said to be degenerate forms, because they degenerate to a single operation.

n The other eight nondegenerate forms produce an SOPs or POSs as follows:

AND-OR à 3-4 OR-AND à 3-4NAND-NAND à 3-6 NOR-NOR à 3-6NOR-OR NAND-ANDOR-NAND AND-NOR

Page 28: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

28

AND-OR-INVERT implementationn The two forms NAND-AND and AND-NOR are equivalent

forms and can be treated together.F = (AB + CD + E)’

Shift back

Page 29: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

29

OR-AND-INVERT implementationn The OR-NAND form resembles the OR-AND form, except for

the inversion done by the bubble in the NAND gate.F = [(A + B)(C + D)E]’

Shift back

Page 30: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

30

Tabular summary and examplen Because of the INVERT part in each case, it is

convenient to use the simplification of F’ of the function.

Page 31: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

31

ExampleEx.3-11 Implement the function of Fig.3-31(a) with the four

two-level forms listed in Table 3-3.The complement of the function by combining the 0’s:

F’ = x’y + xy’ + zThe normal output for this function

F = (x’y + x’y + z)’Which is in the AND-OR-INVERT form.

Page 32: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

32

Examplen The AND-NOR and NAND-AND implementations are

shown as follows.

Page 33: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

33

Examplen The OR-AND-INVERT forms require a simplified expression

of the complement of the function in POSs.Combine the 1’s in the map

F = x’y’z’ + xyz’Complement of the function

F’ = (x + y + z)(x’ + y’ + z)

Page 34: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

34

ExampleThe normal output F

F = (x + y + z)(x’ + y’ + z)]’We can implement the function in the OR-NAND and NOR-OR

forms as follows.

Page 35: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

35

3-8. Exclusive-OR functionn The XOR symbol denote as ⊕, the Boolean

operation: x ⊕ y = xy’+ x’yn The X-NOR symbol denote as ☉, the Boolean

operation: x ☉ y = (x ⊕ y )’= xy + x’y’n The identities of the XOR operation:

x ⊕ 0 = x x ⊕ 1 = x’ x ⊕ x = 0x ⊕ x’= 1 x ⊕ y’= x’⊕ y = (x ⊕ y)’

n Commutative and associative:A ⊕ B = B ⊕ A(A ⊕ B) ⊕ C = A ⊕ (B ⊕ C) = A ⊕ B ⊕ C

Page 36: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

36

Exclusive-OR implementationsn Fig.3-32(b), the first NAND gate performs the operation (xy)’= (x’+ y’).

(x’+ y’)x + (x’+ y’)y = xy’+ x’y = x ⊕ y

Page 37: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

37

Odd functionn Boolean expression of three-variable of the XOR:

A ⊕ B ⊕ C = (AB’+ A’B)C’+ (AB + A’B’)C= AB’C’+ A’BC’+ ABC + A’B’C=? (1, 2, 4, 7)

n Odd function defined as the logical sum of the 2n/2 mintermswhose binary numerical values have an odd number of 1’s.

Page 38: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

38

Odd and Even functionsn The 3-input odd function is implemented by means of 2-

input exclusive-OR gates.

Page 39: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

39

Parity generation and checkingn Table 3-4, the P make the total number of 1’s

even(including P). P constitutes an odd function.n A parity bit is an extra bit included with a binary message to

make the number of 1’s either odd or even.

P=x ⊕ y ⊕ z

Page 40: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

40

Parity generation and checkingn The circuit that generates the parity bit in the

transmitter(receiver) is called a parity generator(checker).

Transmitter Receiver

Page 41: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

41

Example of even parityn Since the information was

transmitted with even parity, the four bits received must have an even number of 1’s.

n An error occurs during the transmission if the four bits received have an odd number of 1’s.

n The output of the parity checker, denoted by C, will be equal to 1 if an error occurs, that is, if the four bits received have an odd number of 1’s.

n C = x ⊕ y ⊕ z ⊕ P

Error

Page 42: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

42

3-9. Hardware Description Language (HDL)

n It resembles a programming language, but is specifically oriented to describing hardware structures and behavior.

n There are two applications of HDL processing:

1. Logic simulation: allows the detection of functional errors in a design without having to physically create the circuit.

2. Logic synthesis: the process of deriving a list of components and their interconnections (called a netlist) from the model of a digital system described in HDL.

Page 43: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

43

Module representationn Identifiers must start with an alphabetic character

or an underscore.

HDL Example 3-1//Description of simple circuit Fig. 3-37Module smpl_circuit(A,B,C,x,y);

input A,B,C;output x,y;wire e;and g1(e,A,B);not g2(y,C);or g3(x,e,y);

endmodule

keywords

Page 44: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

44

Gate delaysn The delay is specified in terms of time units and

the symbol #.

‘timescale 1ns/100ps

The first number specifies the unit of measurement for time

delays. The second number specifies the precision for which

the delays are rounded-off.

n If no timescale is specified, the simulator defaults to a certain time unit, usually 1 ns.

Page 45: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

45

Gate delays

Page 46: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

46

Stimulus and circuit description modules

Page 47: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

47

Boolean expressionsn Boolean expressions are specified in Verilog HDL with a

continuous assignment statement consisting of the keyword assign followed by a Boolean expression.

assign x = (A & B) ∣ ~ C ;

Page 48: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

48

User-Defined primitives (UDP)

Page 49: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

49

User-Defined primitives (UDP)n With keywords and, or, etc… ,are referred to as

system primitives. The user can create additional primitives by defining them in a tabular form, so-called UDP.

n UDP use the keyword “primitive” instead of keyword “module”.

n HDL proceeds according to the following rules:

1. It is declared with the keyword primitive followed by a name and port list.

2. There can be only one output and it must be listed first in the ort list and declared with an output keyword.

Page 50: Chapter3 Gate-Level Minimization - 中興電機web.ee.nchu.edu.tw/~cpfan/FY92b-digital/Chapter3.pdf · 1 Chapter 3 Gate-Level Minimization n The Boolean functions also can be simplified

50

User-Defined primitives (UDP)3. There can be any number of inputs. The order in which

they are listed in the input declaration must conform to the order in which they are given values in the table that follows.

4. The truth table is enclosed within the keywords table and endtable.

5. The values of the inputs are listed in order ending with a colon(:). The output is always the last entry in a row followed by a semicolon(;).

6. It ends with the keyword endprimitive.