1 chapter 3 combinational logic design. 2 combinational circuits –n input bits 2 n possible...

14
1 Chapter 3 Combinational Logic Design

Upload: martin-garrison

Post on 21-Dec-2015

221 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Chapter 3 Combinational Logic Design. 2 Combinational Circuits –n input bits  2 n possible binary input combinations –For each possible input combination,

1

Chapter 3Combinational Logic Design

Page 2: 1 Chapter 3 Combinational Logic Design. 2 Combinational Circuits –n input bits  2 n possible binary input combinations –For each possible input combination,

2

Combinational Circuits

– n input bits 2n possible binary input combinations

– For each possible input combination, there is one possible output value

• truth table

• Boolean functions (with n input variables)

– Examples: adders, subtractors, comparators, decoders, encoders, and multiplexers.

Combinationalcircuit

(logic gates)

n binaryinputs

m binaryoutputs

Page 3: 1 Chapter 3 Combinational Logic Design. 2 Combinational Circuits –n input bits  2 n possible binary input combinations –For each possible input combination,

3

Possible Design Steps

1. Find out the number of inputs and outputs2. Derive the truth table that defines the

required relationship between inputs and outputs

3. Obtain a simplified Boolean function for each output

4. Draw the logic diagram5. Verify the correctness of the design

Page 4: 1 Chapter 3 Combinational Logic Design. 2 Combinational Circuits –n input bits  2 n possible binary input combinations –For each possible input combination,

4

Example: Design Process

• BCD-to-2421 Converter• Verbal specification:

– Given a BCD digit (i.e. {0, 1, …, 9}), the circuit computes 2421 code equivalent of the decimal number

• Step 1: how many inputs and how many outputs?– four inputs and four outputs

• Step 2:– Obtain the truth table– 0000 0000– 1001 1111– etc.

Page 5: 1 Chapter 3 Combinational Logic Design. 2 Combinational Circuits –n input bits  2 n possible binary input combinations –For each possible input combination,

5

BCD-to-2421 Converter• Truth Table

Inputs Outputs

A B C D x y z t

0 0 0 0 0 0 0 0

0 0 0 1 0 0 0 1

0 0 1 0 0 0 1 0

0 0 1 1 0 0 1 1

0 1 0 0 0 1 0 0

0 1 0 1 1 0 1 1

0 1 1 0 1 1 0 0

0 1 1 1 1 1 0 1

1 0 0 0 1 1 1 0

1 0 0 1 1 1 1 1

Page 6: 1 Chapter 3 Combinational Logic Design. 2 Combinational Circuits –n input bits  2 n possible binary input combinations –For each possible input combination,

6

BCD-to-2421 Converter

11

1110

0000

10

11

01

00

10110100CD

AB

• Step 3: Obtain simplified Boolean expression for each output

• Output x:

x = BD + BC + A

A B C D x

0 0 0 0 0

0 0 0 1 0

0 0 1 0 0

0 0 1 1 0

0 1 0 0 0

0 1 0 1 1

0 1 1 0 1

0 1 1 1 1

1 0 0 0 1

1 0 0 0 1

The rest Xx x xx

x x

Page 7: 1 Chapter 3 Combinational Logic Design. 2 Combinational Circuits –n input bits  2 n possible binary input combinations –For each possible input combination,

7

Boolean Expressions for OutputsCD

AB 00 01 11 10

00 0 0 0 001 1 0 1 111 X X X X10 1 1 X X

CDAB 00 01 11 10

00 0 0 1 101 0 1 0 011 X X X X10 1 1 X X

• Output y:

• Output z:

A B C D y z

0 0 0 0 0 0

0 0 0 1 0 0

0 0 1 0 0 1

0 0 1 1 0 1

0 1 0 0 1 0

0 1 0 1 0 1

0 1 1 0 1 0

0 1 1 1 1 0

1 0 0 0 1 1

1 0 0 0 1 1

The rest X X

Page 8: 1 Chapter 3 Combinational Logic Design. 2 Combinational Circuits –n input bits  2 n possible binary input combinations –For each possible input combination,

8

Boolean Expressions for Outputs

• Step 4: Draw the logic diagram

CDAB 00 01 11 10

00 0 1 1 001 0 1 1 011 X X X X10 0 1 X X

t = D

x = BC + BD + A

y = A + BD’ + BC

z = A + B’C + BC’D

• Output t:A B C D T

0 0 0 0 0

0 0 0 1 1

0 0 1 0 0

0 0 1 1 1

0 1 0 0 0

0 1 0 1 1

0 1 1 0 0

0 1 1 1 1

1 0 0 0 0

1 0 0 0 1

The rest X

Page 9: 1 Chapter 3 Combinational Logic Design. 2 Combinational Circuits –n input bits  2 n possible binary input combinations –For each possible input combination,

9

Example: Logic DiagramAB

CD

x = BC + BD + A

y = A + BD’ + BC

z = A + B’C + BC’D

t = D

Page 10: 1 Chapter 3 Combinational Logic Design. 2 Combinational Circuits –n input bits  2 n possible binary input combinations –For each possible input combination,

10

Example: Verification

• Step 5: Check the functional correctness of the logic circuit

• Apply all possible input combinations

• And check if the circuit generates the correct outputs for each input combinations

• For large circuits with many input combinations, this may not be feasible.

• Statistical techniques may be used to verify the correctness of large circuits with many input combinations

Page 11: 1 Chapter 3 Combinational Logic Design. 2 Combinational Circuits –n input bits  2 n possible binary input combinations –For each possible input combination,

Chapter 3 - Part 1 11

Design Example

1. Specification – BCD to Excess-3 code converter– Transforms BCD code for the decimal digits to

Excess-3 code for the decimal digits– BCD code words for digits 0 through 9: 4-bit

patterns 0000 to 1001, respectively– Excess-3 code words for digits 0 through 9: 4-

bit patterns consisting of 3 (binary 0011) added to each BCD code word

Page 12: 1 Chapter 3 Combinational Logic Design. 2 Combinational Circuits –n input bits  2 n possible binary input combinations –For each possible input combination,

Chapter 3 - Part 1 12

Design Example (continued)

2. Formulation (Find truth table)– Conversion of 4-bit codes can be most

easily formulated by a truth table– Variables

- BCD: A,B,C,D

– Variables- Excess-3 W,X,Y,Z

– Don’t Cares- BCD 1010 to 1111

Input BCD A B C D

Output Excess-3 WXYZ

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

Page 13: 1 Chapter 3 Combinational Logic Design. 2 Combinational Circuits –n input bits  2 n possible binary input combinations –For each possible input combination,

Chapter 3 - Part 1 13

Design Example (continued)

W = A + BC + BDX = C + D + B

Y = CD +

Z =

B

C

D

A

0 1 3 2

4 5 7 6

12 13 15 14

8 9 11 10

1

11

1

X X X

X X

X

1

B

C

D

A

0 1 3 2

4 5 7 6

12 13 15 14

8 9 11 10

1

11

1

X X X

X X

X

1

B

C

D

A

0 1 3 2

4 5 7 6

12 13 15 14

8 9 11 10

1 1

1

1

X X X

X X

X

1

B

C

D

A

0 1 3 2

4 5 7 6

12 13 15 14

8 9 11 10

1 1

1

X X X

X X

X

1

1

w

z y

x

B CDB

CD

D

Page 14: 1 Chapter 3 Combinational Logic Design. 2 Combinational Circuits –n input bits  2 n possible binary input combinations –For each possible input combination,

Chapter 3 - Part 1 14

Design Example (continued)

4. Technology Mapping

A

B

CD

W

X

Y

Z