#04-2020-1002-110 lecture3 combinational logic design ii · systematic design procedures 1....

40
13.06.20 11:57 CSCI 150 Introduction to Digital and Computer System Design Lecture 3: Combinational Logic Design II Jetic Gū 2020 Summer Semester (S2)

Upload: others

Post on 10-Jul-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

13.06.20 11:57CSCI 150 Introduction to Digital and Computer

System Design Lecture 3: Combinational Logic Design II

Jetic Gū2020 Summer Semester (S2)

Page 2: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

Overview• Focus: Methodology

• Architecture: Combinatory Logical Circuits

• Textbook v4: Ch3 3.1, 3.2, 3.3; v5: Ch3 3.1, 3.2

• Core Ideas:

1. BCD-to-Seven-Segment Decoder

2. 4-bit Equity Comparator

3. Technology Mapping

Page 3: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

Systematic Design Procedures1. Specification: Write a specification for the circuit

2. Formulation: Derive relationship between inputs and outputs of the systeme.g. using truth table or Boolean expressions

3. Optimisation: Apply optimisation, minimise the number of logic gates and literals required

4. Technology Mapping: Transform design to new diagram using available implementation technology

5. Verification: Verify the correctness of the final design in meeting the specifications

Review

P0 Review

Page 4: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

BCD-to-Seven-Segment Decoder

Summary

P1 Example 3b

Ah, not again

Page 5: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

LED Seven Segment Display

• LED: Light-Emitting Diodes

• A single digit display takes 7bit inputs(and an optional one for decimal point)

Example

P1 Example 3b

Page 6: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

BCD to 7 Segment Display(s)

• BCD: Each digit is represented using 4bit binary int

• BCD-to-7-segment decoderA Combinational circuit that

• takes a decimal digit in BCD (4bit int ); and

• generates the appropriate control signals for the display unit

A, B, C, D

(a, b, c, d, e, f, g)

Example

P1 Example 3b

Page 7: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

Input

1. Specification

• BCD: Each digit is represented using 4bit binary int

• BCD-to-7-segment decoderA Combinational circuit that

• takes a decimal digit in BCD (4bit int ); and

• generates the appropriate control signals for the display unit

A, B, C, D

(a, b, c, d, e, f, g)

Example

P1 Example 3b

Output

Output

Page 8: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

2. Formulation

Example

P1 Example 3b

Output

Decimal A B C D a b c d e f g0 0 0 0 0 1 1 1 1 1 1

123456789

F B

CE

A

D

Page 9: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

2. Formulation

Example

P1 Example 3b

Output

Decimal A B C D a b c d e f g0 0 0 0 0 1 1 1 1 1 1

1 0 0 0 1 1 1

23456789

B

C

Page 10: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

2. Formulation

Example

P1 Example 3b

Output

Decimal A B C D a b c d e f g0 0 0 0 0 1 1 1 1 1 1

1 0 0 0 1 1 1

2 0 0 1 0 1 1 1 1 1

3456789

B

E

A

G

D

Page 11: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

2. Formulation

Example

P1 Example 3b

Output

Decimal A B C D a b c d e f g0 0 0 0 0 1 1 1 1 1 1

1 0 0 0 1 1 1

2 0 0 1 0 1 1 1 1 1

3 0 0 1 1 1 1 1 1 1

456789

B

C

A

G

D

Page 12: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

2. Formulation

Example

P1 Example 3b

Output

Decimal A B C D a b c d e f g0 0 0 0 0 1 1 1 1 1 1

1 0 0 0 1 1 1

2 0 0 1 0 1 1 1 1 1

3 0 0 1 1 1 1 1 1 1

4 0 1 0 0 1 1 1 1

56789

F B

C

G

Page 13: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

2. Formulation

Example

P1 Example 3b

Output

Decimal A B C D a b c d e f g0 0 0 0 0 1 1 1 1 1 1

1 0 0 0 1 1 1

2 0 0 1 0 1 1 1 1 1

3 0 0 1 1 1 1 1 1 1

4 0 1 0 0 1 1 1 1

5 0 1 0 1 1 1 1 1 1

6789

F

C

A

G

D

Page 14: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

2. Formulation

Example

P1 Example 3b

Output

Decimal A B C D a b c d e f g0 0 0 0 0 1 1 1 1 1 1

1 0 0 0 1 1 1

2 0 0 1 0 1 1 1 1 1

3 0 0 1 1 1 1 1 1 1

4 0 1 0 0 1 1 1 1

5 0 1 0 1 1 1 1 1 1

6 0 1 1 0 1 1 1 1 1 1

789

F

CE

A

G

D

Page 15: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

2. Formulation

Example

P1 Example 3b

Output

Decimal A B C D a b c d e f g0 0 0 0 0 1 1 1 1 1 1

1 0 0 0 1 1 1

2 0 0 1 0 1 1 1 1 1

3 0 0 1 1 1 1 1 1 1

4 0 1 0 0 1 1 1 1

5 0 1 0 1 1 1 1 1 1

6 0 1 1 0 1 1 1 1 1 1

7 0 1 1 1 1 1 1

89

B

C

A

Page 16: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

2. Formulation

Example

P1 Example 3b

Output

Decimal A B C D a b c d e f g0 0 0 0 0 1 1 1 1 1 1

1 0 0 0 1 1 1

2 0 0 1 0 1 1 1 1 1

3 0 0 1 1 1 1 1 1 1

4 0 1 0 0 1 1 1 1

5 0 1 0 1 1 1 1 1 1

6 0 1 1 0 1 1 1 1 1 1

7 0 1 1 1 1 1 1

8 1 0 0 0 1 1 1 1 1 1 1

9

F B

CE

A

G

D

Page 17: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

2. Formulation

Example

P1 Example 3b

Output

Decimal A B C D a b c d e f g0 0 0 0 0 1 1 1 1 1 1

1 0 0 0 1 1 1

2 0 0 1 0 1 1 1 1 1

3 0 0 1 1 1 1 1 1 1

4 0 1 0 0 1 1 1 1

5 0 1 0 1 1 1 1 1 1

6 0 1 1 0 1 1 1 1 1 1

7 0 1 1 1 1 1 1

8 1 0 0 0 1 1 1 1 1 1 1

9 1 0 0 1 1 1 1 1 1 1

F B

C

A

G

D

Page 18: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

3. OptimisationP1 Example 3b

Decimal A B C D a b c d e f g0 0 0 0 0 1 1 1 1 1 1 0

1 0 0 0 1 0 1 1 0 0 0 0

2 0 0 1 0 1 1 0 1 1 0 1

3 0 0 1 1 1 1 1 1 0 0 1

4 0 1 0 0 0 1 1 0 0 1 1

5 0 1 0 1 1 0 1 1 0 1 1

6 0 1 1 0 1 0 1 1 1 1 1

7 0 1 1 1 1 1 1 0 0 0 0

8 1 0 0 0 1 1 1 1 1 1 1

9 1 0 0 1 1 1 1 1 0 1 1

Example

• Convert to Boolean expression

• Indie: 27 AND7 OR gates

• Shared: 14 AND7 OR gates

Page 19: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

3. OptimisationP1 Example 3b

Example

COMBINATIONAL LOGIC DESIGN

plotting of the seven functions in map form is left as an exercise. One possible wayof simplifying the seven functions results in the following Boolean functions:

a !

b !

c !

d !

e !

f !

g !

Independent implementation of these seven functions requires 27 AND gates and7 OR gates. However, by sharing the six product terms common to the differentoutput expressions, the number of AND gates can be reduced to 14 along with asubstantial savings in gate input cost. For example, the term occurs in a, c,d, and e. The output of the AND gate that implements this product term goesdirectly to the inputs of the OR gates in all four functions. For this function, westop optimization with the two-level circuit and shared AND gates, realizing that itmight be possible to reduce the gate input cost even further by applying multiple-level optimization. !

Most manufacturers of integrated circuits use the term “BCD–to–seven-segment decoder” because this device decodes a binary code for a decimal digit.However, it is actually a code converter that converts a four-bit decimal code to aseven-bit code. The word “decoder” is usually reserved for another type ofcircuit.

In general, the total number of gates can be reduced in a multiple-outputcombinational circuit by using common terms of the output functions. The mapsof the output functions may help us find the common terms by finding identicalimplicants from two or more maps. Some of the common terms may not be primeimplicants of the individual functions. The designer must be inventive and com-bine squares in the maps in such a way as to create common terms. This can bedone more formally by using a procedure for simplifying multiple-output func-tions. The prime implicants are defined not only for each individual function, butalso for all possible combinations of the output functions. These prime implicantsare formed by using the AND operator on every possible nonempty subset of theoutput functions and finding the prime implicants of each of the results. Usingthis entire set of prime implicants, we can employ a formal selection process tofind the optimum two-level multiple-output circuit. Such a procedure is imple-mented in various forms in logic optimization software and is used to obtain theequations in Example 2.

AC ABD B C D AB C" " "

A B A C D ACD AB C" " "

AB AD B C D AB C" " "

ACD A BC B C D AB C ABCD" " " "

ACD B C D"

ABC A C D ABD AB C" " "

ACD A BC ABC AB C" " "

B C D

���

• Convert to Boolean expression

• Indie: 27 AND7 OR gates

• Shared: 14 AND7 OR gates

Page 20: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

4. Technology MappingP1 Example 3b

Example

COMBINATIONAL LOGIC DESIGN

plotting of the seven functions in map form is left as an exercise. One possible wayof simplifying the seven functions results in the following Boolean functions:

a !

b !

c !

d !

e !

f !

g !

Independent implementation of these seven functions requires 27 AND gates and7 OR gates. However, by sharing the six product terms common to the differentoutput expressions, the number of AND gates can be reduced to 14 along with asubstantial savings in gate input cost. For example, the term occurs in a, c,d, and e. The output of the AND gate that implements this product term goesdirectly to the inputs of the OR gates in all four functions. For this function, westop optimization with the two-level circuit and shared AND gates, realizing that itmight be possible to reduce the gate input cost even further by applying multiple-level optimization. !

Most manufacturers of integrated circuits use the term “BCD–to–seven-segment decoder” because this device decodes a binary code for a decimal digit.However, it is actually a code converter that converts a four-bit decimal code to aseven-bit code. The word “decoder” is usually reserved for another type ofcircuit.

In general, the total number of gates can be reduced in a multiple-outputcombinational circuit by using common terms of the output functions. The mapsof the output functions may help us find the common terms by finding identicalimplicants from two or more maps. Some of the common terms may not be primeimplicants of the individual functions. The designer must be inventive and com-bine squares in the maps in such a way as to create common terms. This can bedone more formally by using a procedure for simplifying multiple-output func-tions. The prime implicants are defined not only for each individual function, butalso for all possible combinations of the output functions. These prime implicantsare formed by using the AND operator on every possible nonempty subset of theoutput functions and finding the prime implicants of each of the results. Usingthis entire set of prime implicants, we can employ a formal selection process tofind the optimum two-level multiple-output circuit. Such a procedure is imple-mented in various forms in logic optimization software and is used to obtain theequations in Example 2.

AC ABD B C D AB C" " "

A B A C D ACD AB C" " "

AB AD B C D AB C" " "

ACD A BC B C D AB C ABCD" " " "

ACD B C D"

ABC A C D ABD AB C" " "

ACD A BC ABC AB C" " "

B C D

���

• Convert to Boolean expression

• Indie: 27 AND7 OR gates

• Shared: 14 AND7 OR gates

Page 21: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

5. Verification (Skipped here)P1 Example 3b

Example

COMBINATIONAL LOGIC DESIGN

plotting of the seven functions in map form is left as an exercise. One possible wayof simplifying the seven functions results in the following Boolean functions:

a !

b !

c !

d !

e !

f !

g !

Independent implementation of these seven functions requires 27 AND gates and7 OR gates. However, by sharing the six product terms common to the differentoutput expressions, the number of AND gates can be reduced to 14 along with asubstantial savings in gate input cost. For example, the term occurs in a, c,d, and e. The output of the AND gate that implements this product term goesdirectly to the inputs of the OR gates in all four functions. For this function, westop optimization with the two-level circuit and shared AND gates, realizing that itmight be possible to reduce the gate input cost even further by applying multiple-level optimization. !

Most manufacturers of integrated circuits use the term “BCD–to–seven-segment decoder” because this device decodes a binary code for a decimal digit.However, it is actually a code converter that converts a four-bit decimal code to aseven-bit code. The word “decoder” is usually reserved for another type ofcircuit.

In general, the total number of gates can be reduced in a multiple-outputcombinational circuit by using common terms of the output functions. The mapsof the output functions may help us find the common terms by finding identicalimplicants from two or more maps. Some of the common terms may not be primeimplicants of the individual functions. The designer must be inventive and com-bine squares in the maps in such a way as to create common terms. This can bedone more formally by using a procedure for simplifying multiple-output func-tions. The prime implicants are defined not only for each individual function, butalso for all possible combinations of the output functions. These prime implicantsare formed by using the AND operator on every possible nonempty subset of theoutput functions and finding the prime implicants of each of the results. Usingthis entire set of prime implicants, we can employ a formal selection process tofind the optimum two-level multiple-output circuit. Such a procedure is imple-mented in various forms in logic optimization software and is used to obtain theequations in Example 2.

AC ABD B C D AB C" " "

A B A C D ACD AB C" " "

AB AD B C D AB C" " "

ACD A BC B C D AB C ABCD" " " "

ACD B C D"

ABC A C D ABD AB C" " "

ACD A BC ABC AB C" " "

B C D

���

• Convert to Boolean expression

• Indie: 27 AND7 OR gates

• Shared: 14 AND7 OR gates

Page 22: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

BCD to 7 Segment Display

• 'BCD-to-seven-segment decoder'

• 'decodes' binary code for decimal digit

• usually decoders mean something different, which we’ll discuss later

Example

P1 Example 3b

Page 23: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

4-bit Equity Comparator

Summary

P2 Example 3c

Ah, not again

Page 24: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

4-bit Equity Comparator

• Compare two numbers

• Equal or not

Example

P2 Example 3c

Page 25: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

1. Specification

• Input: ,

• Output: for equal, for not

A3A2A1A0 B3B2B1B0

E = 1 0

Example

P2 Example 3c

Page 26: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

2. Formulation

• 2 things are happening

• We need to compare pairs of binary values and see if they are equal

• We need to combine the comparison of all these different bits to make up E

Example

P2 Example 3c

B3B2B1B0

A3A2A1A0

Y/N Y/N Y/N Y/N E

Page 27: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

Hierarchical Design

• "divide-and-conquer"

• Circuit is broken up into individual functional pieces (blocks)

• Each block has explicitly defined Interface (I/O) and Behaviour

• A single block can be reused multiple times to simplify design process

• If a single block is too complex, it can be further divided into smaller blocks, to allow for easier designs

Concep

t

P2 Example 3c

Page 28: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

3. Optimisation

• 2 things are happening

• We need to compare pairs of binary values and see if they are equal

• We need to combine the comparison of all these different bits to make up E

Example

P2 Example 3c

Y/N Y/N Y/N Y/N E

MX

ME

A3A2A1A0

B3B2B1B0

MXMXMX

Page 29: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

3. Optimisation

Example

P2 Example 3c

E

A3

A2

A1

A0

B3

B2

B1

B0

3-1 / Beginning Hierarchical Design 115

cumbersome and K-maps impossible. Thus, direct application of the basic combina-tional design approach, as used in Chapter 2, is dif!cult.

EXAMPLE 3-1 Design of a 4-Bit Equality Comparator

Specification: An equality comparator is a circuit that compares two binary vectors to determine whether they are equal or not. The inputs to this speci!c circuit consist of two vectors: A(3:0) and B(3:0). Vector A consists of four bits, A(3), A(2), A(1), and A(0), with A(3) as the most signi!cant bit. Vector B has a similar description with B replaced by A. The output of the circuit is a single-bit variable E. Output E is equal to 1 if vectors A and B are equal and equal to 0 if vectors A and B are unequal.

formulation: The formulation attempts to bypass the use of a truth table due to its size. In order for A and B to be equal, the bit values in each of the respective positions, 3 down to 0, of A and B must be equal. If all of the bit positions for A and B contain equal values in every position, then E = 1—otherwise, E = 0. Intuitively, we can see from this formulation of the problem that the circuit can be developed as a simple 2-level hierarchy with the complete circuit at the top level and !ve circuits at the bottom level. Since comparison of a bit from A and the corresponding bit from B must be done in each of the bit positions, we can decompose the problem into four 1-bit comparison circuits MX and an additional circuit ME that combines the four comparison-circuit outputs to obtain E. A logic diagram of the hierarchy showing the interconnection of the !ve blocks is shown in Figure 3-1(a).

(a)

A0 N0MX

MX

MX

MX

ME

N1

N2

N3

E

B0

A1

B1

A2

B2

A3

B3

Ai

Ni

MXBi

N0N1 E

MEN2N3

(b) (c)

FIGURE 3-1Hierarchical Diagram for a 4-Bit Equality Comparator

M03_MANO0637_05_SE_C03.indd 115 23/01/15 1:51 PM

MX

MX

MX

MX

ME

Page 30: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

3. Optimisation

Example

P2 Example 3c

E

A3

A2

A1

A0

B3

B2

B1

B0

3-1 / Beginning Hierarchical Design 115

cumbersome and K-maps impossible. Thus, direct application of the basic combina-tional design approach, as used in Chapter 2, is dif!cult.

EXAMPLE 3-1 Design of a 4-Bit Equality Comparator

Specification: An equality comparator is a circuit that compares two binary vectors to determine whether they are equal or not. The inputs to this speci!c circuit consist of two vectors: A(3:0) and B(3:0). Vector A consists of four bits, A(3), A(2), A(1), and A(0), with A(3) as the most signi!cant bit. Vector B has a similar description with B replaced by A. The output of the circuit is a single-bit variable E. Output E is equal to 1 if vectors A and B are equal and equal to 0 if vectors A and B are unequal.

formulation: The formulation attempts to bypass the use of a truth table due to its size. In order for A and B to be equal, the bit values in each of the respective positions, 3 down to 0, of A and B must be equal. If all of the bit positions for A and B contain equal values in every position, then E = 1—otherwise, E = 0. Intuitively, we can see from this formulation of the problem that the circuit can be developed as a simple 2-level hierarchy with the complete circuit at the top level and !ve circuits at the bottom level. Since comparison of a bit from A and the corresponding bit from B must be done in each of the bit positions, we can decompose the problem into four 1-bit comparison circuits MX and an additional circuit ME that combines the four comparison-circuit outputs to obtain E. A logic diagram of the hierarchy showing the interconnection of the !ve blocks is shown in Figure 3-1(a).

(a)

A0 N0MX

MX

MX

MX

ME

N1

N2

N3

E

B0

A1

B1

A2

B2

A3

B3

Ai

Ni

MXBi

N0N1 E

MEN2N3

(b) (c)

FIGURE 3-1Hierarchical Diagram for a 4-Bit Equality Comparator

M03_MANO0637_05_SE_C03.indd 115 23/01/15 1:51 PM

MX

MX

MX

MX

ME

MX

ME

Page 31: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

3-1 / Beginning Hierarchical Design 115

cumbersome and K-maps impossible. Thus, direct application of the basic combina-tional design approach, as used in Chapter 2, is dif!cult.

EXAMPLE 3-1 Design of a 4-Bit Equality Comparator

Specification: An equality comparator is a circuit that compares two binary vectors to determine whether they are equal or not. The inputs to this speci!c circuit consist of two vectors: A(3:0) and B(3:0). Vector A consists of four bits, A(3), A(2), A(1), and A(0), with A(3) as the most signi!cant bit. Vector B has a similar description with B replaced by A. The output of the circuit is a single-bit variable E. Output E is equal to 1 if vectors A and B are equal and equal to 0 if vectors A and B are unequal.

formulation: The formulation attempts to bypass the use of a truth table due to its size. In order for A and B to be equal, the bit values in each of the respective positions, 3 down to 0, of A and B must be equal. If all of the bit positions for A and B contain equal values in every position, then E = 1—otherwise, E = 0. Intuitively, we can see from this formulation of the problem that the circuit can be developed as a simple 2-level hierarchy with the complete circuit at the top level and !ve circuits at the bottom level. Since comparison of a bit from A and the corresponding bit from B must be done in each of the bit positions, we can decompose the problem into four 1-bit comparison circuits MX and an additional circuit ME that combines the four comparison-circuit outputs to obtain E. A logic diagram of the hierarchy showing the interconnection of the !ve blocks is shown in Figure 3-1(a).

(a)

A0 N0MX

MX

MX

MX

ME

N1

N2

N3

E

B0

A1

B1

A2

B2

A3

B3

Ai

Ni

MXBi

N0N1 E

MEN2N3

(b) (c)

FIGURE 3-1Hierarchical Diagram for a 4-Bit Equality Comparator

M03_MANO0637_05_SE_C03.indd 115 23/01/15 1:51 PM

3. Optimisation

Example

P2 Example 3c

E

A3

A2

A1

A0

B3

B2

B1

B0

3-1 / Beginning Hierarchical Design 115

cumbersome and K-maps impossible. Thus, direct application of the basic combina-tional design approach, as used in Chapter 2, is dif!cult.

EXAMPLE 3-1 Design of a 4-Bit Equality Comparator

Specification: An equality comparator is a circuit that compares two binary vectors to determine whether they are equal or not. The inputs to this speci!c circuit consist of two vectors: A(3:0) and B(3:0). Vector A consists of four bits, A(3), A(2), A(1), and A(0), with A(3) as the most signi!cant bit. Vector B has a similar description with B replaced by A. The output of the circuit is a single-bit variable E. Output E is equal to 1 if vectors A and B are equal and equal to 0 if vectors A and B are unequal.

formulation: The formulation attempts to bypass the use of a truth table due to its size. In order for A and B to be equal, the bit values in each of the respective positions, 3 down to 0, of A and B must be equal. If all of the bit positions for A and B contain equal values in every position, then E = 1—otherwise, E = 0. Intuitively, we can see from this formulation of the problem that the circuit can be developed as a simple 2-level hierarchy with the complete circuit at the top level and !ve circuits at the bottom level. Since comparison of a bit from A and the corresponding bit from B must be done in each of the bit positions, we can decompose the problem into four 1-bit comparison circuits MX and an additional circuit ME that combines the four comparison-circuit outputs to obtain E. A logic diagram of the hierarchy showing the interconnection of the !ve blocks is shown in Figure 3-1(a).

(a)

A0 N0MX

MX

MX

MX

ME

N1

N2

N3

E

B0

A1

B1

A2

B2

A3

B3

Ai

Ni

MXBi

N0N1 E

MEN2N3

(b) (c)

FIGURE 3-1Hierarchical Diagram for a 4-Bit Equality Comparator

M03_MANO0637_05_SE_C03.indd 115 23/01/15 1:51 PM

MX

MX

MX

MX

MEMX

Ai

Bi

Ni

if MX(Ai, Bi) = Ni = 0 Ai = Bi

MX(Ai, Bi) = Ni = AiBi + AiBi

ME

Page 32: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

3-1 / Beginning Hierarchical Design 115

cumbersome and K-maps impossible. Thus, direct application of the basic combina-tional design approach, as used in Chapter 2, is dif!cult.

EXAMPLE 3-1 Design of a 4-Bit Equality Comparator

Specification: An equality comparator is a circuit that compares two binary vectors to determine whether they are equal or not. The inputs to this speci!c circuit consist of two vectors: A(3:0) and B(3:0). Vector A consists of four bits, A(3), A(2), A(1), and A(0), with A(3) as the most signi!cant bit. Vector B has a similar description with B replaced by A. The output of the circuit is a single-bit variable E. Output E is equal to 1 if vectors A and B are equal and equal to 0 if vectors A and B are unequal.

formulation: The formulation attempts to bypass the use of a truth table due to its size. In order for A and B to be equal, the bit values in each of the respective positions, 3 down to 0, of A and B must be equal. If all of the bit positions for A and B contain equal values in every position, then E = 1—otherwise, E = 0. Intuitively, we can see from this formulation of the problem that the circuit can be developed as a simple 2-level hierarchy with the complete circuit at the top level and !ve circuits at the bottom level. Since comparison of a bit from A and the corresponding bit from B must be done in each of the bit positions, we can decompose the problem into four 1-bit comparison circuits MX and an additional circuit ME that combines the four comparison-circuit outputs to obtain E. A logic diagram of the hierarchy showing the interconnection of the !ve blocks is shown in Figure 3-1(a).

(a)

A0 N0MX

MX

MX

MX

ME

N1

N2

N3

E

B0

A1

B1

A2

B2

A3

B3

Ai

Ni

MXBi

N0N1 E

MEN2N3

(b) (c)

FIGURE 3-1Hierarchical Diagram for a 4-Bit Equality Comparator

M03_MANO0637_05_SE_C03.indd 115 23/01/15 1:51 PM

3-1 / Beginning Hierarchical Design 115

cumbersome and K-maps impossible. Thus, direct application of the basic combina-tional design approach, as used in Chapter 2, is dif!cult.

EXAMPLE 3-1 Design of a 4-Bit Equality Comparator

Specification: An equality comparator is a circuit that compares two binary vectors to determine whether they are equal or not. The inputs to this speci!c circuit consist of two vectors: A(3:0) and B(3:0). Vector A consists of four bits, A(3), A(2), A(1), and A(0), with A(3) as the most signi!cant bit. Vector B has a similar description with B replaced by A. The output of the circuit is a single-bit variable E. Output E is equal to 1 if vectors A and B are equal and equal to 0 if vectors A and B are unequal.

formulation: The formulation attempts to bypass the use of a truth table due to its size. In order for A and B to be equal, the bit values in each of the respective positions, 3 down to 0, of A and B must be equal. If all of the bit positions for A and B contain equal values in every position, then E = 1—otherwise, E = 0. Intuitively, we can see from this formulation of the problem that the circuit can be developed as a simple 2-level hierarchy with the complete circuit at the top level and !ve circuits at the bottom level. Since comparison of a bit from A and the corresponding bit from B must be done in each of the bit positions, we can decompose the problem into four 1-bit comparison circuits MX and an additional circuit ME that combines the four comparison-circuit outputs to obtain E. A logic diagram of the hierarchy showing the interconnection of the !ve blocks is shown in Figure 3-1(a).

(a)

A0 N0MX

MX

MX

MX

ME

N1

N2

N3

E

B0

A1

B1

A2

B2

A3

B3

Ai

Ni

MXBi

N0N1 E

MEN2N3

(b) (c)

FIGURE 3-1Hierarchical Diagram for a 4-Bit Equality Comparator

M03_MANO0637_05_SE_C03.indd 115 23/01/15 1:51 PM

3. Optimisation

Example

P2 Example 3c

E

A3

A2

A1

A0

B3

B2

B1

B0

3-1 / Beginning Hierarchical Design 115

cumbersome and K-maps impossible. Thus, direct application of the basic combina-tional design approach, as used in Chapter 2, is dif!cult.

EXAMPLE 3-1 Design of a 4-Bit Equality Comparator

Specification: An equality comparator is a circuit that compares two binary vectors to determine whether they are equal or not. The inputs to this speci!c circuit consist of two vectors: A(3:0) and B(3:0). Vector A consists of four bits, A(3), A(2), A(1), and A(0), with A(3) as the most signi!cant bit. Vector B has a similar description with B replaced by A. The output of the circuit is a single-bit variable E. Output E is equal to 1 if vectors A and B are equal and equal to 0 if vectors A and B are unequal.

formulation: The formulation attempts to bypass the use of a truth table due to its size. In order for A and B to be equal, the bit values in each of the respective positions, 3 down to 0, of A and B must be equal. If all of the bit positions for A and B contain equal values in every position, then E = 1—otherwise, E = 0. Intuitively, we can see from this formulation of the problem that the circuit can be developed as a simple 2-level hierarchy with the complete circuit at the top level and !ve circuits at the bottom level. Since comparison of a bit from A and the corresponding bit from B must be done in each of the bit positions, we can decompose the problem into four 1-bit comparison circuits MX and an additional circuit ME that combines the four comparison-circuit outputs to obtain E. A logic diagram of the hierarchy showing the interconnection of the !ve blocks is shown in Figure 3-1(a).

(a)

A0 N0MX

MX

MX

MX

ME

N1

N2

N3

E

B0

A1

B1

A2

B2

A3

B3

Ai

Ni

MXBi

N0N1 E

MEN2N3

(b) (c)

FIGURE 3-1Hierarchical Diagram for a 4-Bit Equality Comparator

M03_MANO0637_05_SE_C03.indd 115 23/01/15 1:51 PM

MX

MX

MX

MX

ME

MX

Ai

Bi

Ni

ME EN0N1N2N3

MX(Ai, Bi) = Ni = AiBi + AiBi

ME(N0, N1, N2, N3) = E = N0 + N1 + N2 + N3

Page 33: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

Technology Mapping

Summary

P3 Tech. Mapping

Mostly Old Tech, no new iPhones

Page 34: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

Technology Mapping

• Technology

• Available physical components

• Programmable implementation technology e.g. Field-Programmable Gate Array (FPGA)

• VHDL; Verilog Language

Concep

t

P3 Tech. Mapping

Page 35: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

Technology Mapping

• NAND == AND + Inverter;

• AND == NAND + Inverter;

• NOR == OR + Inverter;

• OR == NOR + Inverter;

• DeMorgen’s Rule

Concep

t

P3 Tech. Mapping

3-2 / Technology Mapping 119

2. Cancel all inverter pairs.

3. Without changing the logic function, (a) “push” all inverters lying between (i) either a circuit input or a driving NAND (NOR) gate output and (ii) the driven NAND (NOR) gate inputs toward the driven NAND (NOR) gate in-puts. Cancel pairs of inverters in series whenever possible during this step. (b) Replace inverters in parallel with a single inverter that drives all of the outputs of the parallel inverters. (c) Repeat (a) and (b) until there is at most one inverter between the circuit input or driving NAND (NOR) gate output and the attached NAND (NOR) gate inputs.

In Figure 3-3(c), the rule for pushing an inverter through a “dot” is illustrated. The inverter on the input line to the dot is replaced with inverters on each of the

FIGURE 3-3Mapping of AND Gates, OR Gates, and Inverters to NAND Gates, NOR Gates, and Inverters

......

......

(a) Mapping to NAND gates

...

......

...

(b) Mapping to NOR gates

......

(c) Pushing an inverter through a “dot”

(d) Canceling inverter pairs

M03_MANO0637_05_SE_C03.indd 119 23/01/15 1:51 PM

Page 36: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

Technology Mapping

• Implement the circuit diagram with NAND gates and Inverters only

1. Replacement

2. Simplification

Example

P3 Tech. Mapping

120 CHAPTER 3 / COMBINATIONAL LOGIC!DESIGN

output lines from the dot. The cancelation of pairs of inverters in Figure 3-3(d) is based on the Boolean algebraic identity

X = X

The next example illustrates this procedure for NAND gates.

EXAMPLE 3-2 Implementation with NAND Gates

Implement the following optimized function with NAND gates:

F = AB + (AB)C + (AB)D + E

The AND, OR, inverter implementation is given in Figure 3-4(a). In Figure 3-4(b), step 1 of the procedure has been applied, replacing each AND gate and OR gate with its equivalent circuit using NAND gates and inverters from Figure 3-3(a). Labels appear on dots and inverters to assist in the explanation. In step 2, the inverter pairs (1, 2) and (3, 4), cancel, giving direct connections between the corresponding NAND gates in Figure 3-4(d). As shown in Figure 3-4(c), inverter 5 is pushed through X and cancels with inverters 6 and 7, respectively. This gives direct connections between the corresponding NAND gates in Figure 3-4(d). No further steps can be applied, since inverters 8 and 9 cannot be paired with other inverters and must remain in the !nal mapped circuit in Figure 3-4(d). The next example illustrates this procedure for NOR gates.

AB

C

D

F

E(a)

AB

C7

5

1

6

2

4

9

X

Y

38DE

F

(b)

AB

C

D

E

F

(d)

X

5

5

7

6Y

(c)

FIGURE 3-4Solution to Example 3-2 !

M03_MANO0637_05_SE_C03.indd 120 23/01/15 1:51 PM

Page 37: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

Technology Mapping

• Implement the circuit diagram with NAND gates and Inverters only

1. Replacement

2. Simplification

Example

P3 Tech. Mapping

120 CHAPTER 3 / COMBINATIONAL LOGIC!DESIGN

output lines from the dot. The cancelation of pairs of inverters in Figure 3-3(d) is based on the Boolean algebraic identity

X = X

The next example illustrates this procedure for NAND gates.

EXAMPLE 3-2 Implementation with NAND Gates

Implement the following optimized function with NAND gates:

F = AB + (AB)C + (AB)D + E

The AND, OR, inverter implementation is given in Figure 3-4(a). In Figure 3-4(b), step 1 of the procedure has been applied, replacing each AND gate and OR gate with its equivalent circuit using NAND gates and inverters from Figure 3-3(a). Labels appear on dots and inverters to assist in the explanation. In step 2, the inverter pairs (1, 2) and (3, 4), cancel, giving direct connections between the corresponding NAND gates in Figure 3-4(d). As shown in Figure 3-4(c), inverter 5 is pushed through X and cancels with inverters 6 and 7, respectively. This gives direct connections between the corresponding NAND gates in Figure 3-4(d). No further steps can be applied, since inverters 8 and 9 cannot be paired with other inverters and must remain in the !nal mapped circuit in Figure 3-4(d). The next example illustrates this procedure for NOR gates.

AB

C

D

F

E(a)

AB

C7

5

1

6

2

4

9

X

Y

38DE

F

(b)

AB

C

D

E

F

(d)

X

5

5

7

6Y

(c)

FIGURE 3-4Solution to Example 3-2 !

M03_MANO0637_05_SE_C03.indd 120 23/01/15 1:51 PM

OR

AND

AND

AND

Page 38: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

Technology Mapping

• Implement the circuit diagram with NAND gates and Inverters only

1. Replacement

2. Simplification

Example

P3 Tech. Mapping

120 CHAPTER 3 / COMBINATIONAL LOGIC!DESIGN

output lines from the dot. The cancelation of pairs of inverters in Figure 3-3(d) is based on the Boolean algebraic identity

X = X

The next example illustrates this procedure for NAND gates.

EXAMPLE 3-2 Implementation with NAND Gates

Implement the following optimized function with NAND gates:

F = AB + (AB)C + (AB)D + E

The AND, OR, inverter implementation is given in Figure 3-4(a). In Figure 3-4(b), step 1 of the procedure has been applied, replacing each AND gate and OR gate with its equivalent circuit using NAND gates and inverters from Figure 3-3(a). Labels appear on dots and inverters to assist in the explanation. In step 2, the inverter pairs (1, 2) and (3, 4), cancel, giving direct connections between the corresponding NAND gates in Figure 3-4(d). As shown in Figure 3-4(c), inverter 5 is pushed through X and cancels with inverters 6 and 7, respectively. This gives direct connections between the corresponding NAND gates in Figure 3-4(d). No further steps can be applied, since inverters 8 and 9 cannot be paired with other inverters and must remain in the !nal mapped circuit in Figure 3-4(d). The next example illustrates this procedure for NOR gates.

AB

C

D

F

E(a)

AB

C7

5

1

6

2

4

9

X

Y

38DE

F

(b)

AB

C

D

E

F

(d)

X

5

5

7

6Y

(c)

FIGURE 3-4Solution to Example 3-2 !

M03_MANO0637_05_SE_C03.indd 120 23/01/15 1:51 PM

Page 39: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

Verification

Summary

P4 Verification

Manual vs Auto

Page 40: #04-2020-1002-110 Lecture3 Combinational Logic Design II · Systematic Design Procedures 1. Specification: Write a specification for the circuit 2. Formulation: Derive relationship

Verification

• Manual

• Use the truth table, row by row

• Auto

• Use computer simulation to go through the truth table

Concep

t

P4 Verification