33
1

Chapter 04 combinational logic

Embed Size (px)

Citation preview

Page 1: Chapter 04 combinational logic

1

Page 2: Chapter 04 combinational logic

COMBINATIONA L LOGIC

Zubair saif

DIGIAL LOGIC & DESIGN(EE-204)

Page 3: Chapter 04 combinational logic

Combinational Circuits

Output is function of input only

i.e. no feedback

•••

•••

n inputs m outputsCombinationalCircuits

When input changes, output may change (after a

delay)

Page 4: Chapter 04 combinational logic

Combinational Circuits

Design Given a desired function, determine

its circuit Function may be expressed as:

Boolean function Truth table

CBA

CBA

BA

CA

CB

F1

F2

?

?

?

AnalysisGiven a circuit, find out its function

Function may be expressed as: Boolean function Truth table

Page 5: Chapter 04 combinational logic

Design Procedure

The problem is statedThe number of available input variables and

required output variables is determinedThe input & output variables are assigned letter

symbolsThe truth table that defines the required

relationship between inputs and outputs is derivedThe simplified Boolean function for each output is

obtainedThe logic diagram is drawn

Page 6: Chapter 04 combinational logic

ADDERS

Digital computers perform a variety of information-processing tasks. Among the basic functions Encountered are the various arithmetic

operations. The most basic arithmetic operation, no doubt, is the addition

of two binary digits. This simple addition consists of adding two binary bits (0+0=0,

0+1=1, 1+0=1, & 1+1 =10). The first three operations produce a sum whose length is one digit,

but when both augend and addend bits are equal to 1, the binary sum consists of two digits.

The higher significant bit of this result is called a CARRY. When the augend and addend numbers contain more significant

digits, the carry obtained from the addition of two bits is added to the next higher-order pair of significant bits.

A combinational circuit that performs the addition of two bits is called a half-adder.

One that performs the addition of three bits (two significant bits and a previous carry) is a full-adder.

Page 7: Chapter 04 combinational logic

HALF ADDER

Half Adder Adds 1-bit plus 1-bit Produces Sum and Carry

HAx

yS

C

x y C S

0 0 0 0

0 1 0 1

1 0 0 1

1 1 1 0

x+ y───C S

x

y

S

C

Page 8: Chapter 04 combinational logic

HALF ADDER

Page 9: Chapter 04 combinational logic

FULL ADDER

Full Adder Adds 1-bit plus 1-bit plus 1-bit Produces Sum and Carry

x y z C S0 0 0 0 00 0 1 0 10 1 0 0 10 1 1 1 01 0 0 0 11 0 1 1 01 1 0 1 01 1 1 1 1

x+ y+ z───C S

FAxyz

S

C

y

0 1 0 1

x 1 0 1 0z

y

0 0 1 0

x 0 1 1 1z

S = xy'z'+x'yz'+x'y'z+xyz = x y z

C = xy + xz + yz

Page 10: Chapter 04 combinational logic

FULL ADDER

x

y

z

S

C

xy

xz

yz

xyzxyzxyzxyz

xyzx

y

z

xy

xz

yz

S

C

S = xy'z'+x'yz'+x'y'z+xyz = x y z

C = xy + xz + yz

Page 11: Chapter 04 combinational logic

FULL ADDER

x

y

z

S

C

HAxy

z

HAS

C

Page 12: Chapter 04 combinational logic

HALF SUBTRACTOR

Half Subtractor Subtracts 1-bit from 1-bit Produces Difference and Borrow

HSx

yD

B

x y B D

0 0 0 0

0 1 1 1

1 0 0 1

1 1 0 0

Bx

- y───

D

x

y

D

B

Page 13: Chapter 04 combinational logic

FULL SUBTRACTOR

Full Subtractor Subtracts 1-bit from 1-bit and

from another 1-bit Produces Difference and Borrow

x y z B D0 0 0 0 00 0 1 1 10 1 0 1 10 1 1 1 01 0 0 0 11 0 1 0 01 1 0 0 01 1 1 1 1

x- y- z

───B D

FSxyz

D

B

y

0 1 0 1

x 1 0 1 0z

y

0 1 1 1

x 0 0 1 0z

D = xy'z'+x'yz'+x'y'z+xyz = x y z

D = x'y + x'z + yz

Page 14: Chapter 04 combinational logic

FULL SUBTRACTOR

x

y

z

D

B

xy

xz

yz

xyzxyzxyzxyz

xyzx

y

z

xy

xz

yz

D

B

D = xy'z'+x'yz'+x'y'z+xyz = x y z

B = x'y + x'z + yz

Page 15: Chapter 04 combinational logic

FULL SUBTRACTOR

x

y

z

D

B

HSxy

z

HSD

B

Page 16: Chapter 04 combinational logic

BCD TO EXCESS-3 CODE CONERTER

A B C D w x y z

0 0 0 0 0 0 1 10 0 0 1 0 1 0 00 0 1 0 0 1 0 10 0 1 1 0 1 1 00 1 0 0 0 1 1 10 1 0 1 1 0 0 00 1 1 0 1 0 0 10 1 1 1 1 0 1 01 0 0 0 1 0 1 11 0 0 1 1 1 0 01 0 1 0 x x x x

1 0 1 1 x x x x1 1 0 0 x x x x1 1 0 1 x x x x1 1 1 0 x x x x1 1 1 1 x x x x

C

1 1 1B

Ax x x x

1 1 x x

D

C

1 1 11

BA

x x x x

1 x x

D

C

1 11 1

BA

x x x x

1 x x

D

C

1 11 1

BA

x x x x

1 x x

D

w = A+BC+BD x = B’C+B’D+BC’D’

y = C’D’+CD z = D’

Page 17: Chapter 04 combinational logic

BCD TO EXCESS-3 CODE CONERTER

A B C D w x y z

0 0 0 0 0 0 1 10 0 0 1 0 1 0 00 0 1 0 0 1 0 10 0 1 1 0 1 1 00 1 0 0 0 1 1 10 1 0 1 1 0 0 00 1 1 0 1 0 0 10 1 1 1 1 0 1 01 0 0 0 1 0 1 11 0 0 1 1 1 0 01 0 1 0 x x x x

1 0 1 1 x x x x1 1 0 0 x x x x1 1 0 1 x x x x1 1 1 0 x x x x1 1 1 1 x x x x

w

x

D

C

z

y

B

A

w = A + B(C+D)

x = B’(C+D) + B(C+D)’

y = (C+D)’ + CD

z = D’

Page 18: Chapter 04 combinational logic

SEVEN SEGMENT DECODER

a

b

c

g

e

d

f?

w

x

y

z

abcdefg

w x y z a b c d e f g

0 0 0 0 1 1 1 1 1 1 00 0 0 1 0 1 1 0 0 0 00 0 1 0 1 1 0 1 1 0 10 0 1 1 1 1 1 1 0 0 10 1 0 0 0 1 1 0 0 1 10 1 0 1 1 0 1 1 0 1 10 1 1 0 1 0 1 1 1 1 10 1 1 1 1 1 1 0 0 0 01 0 0 0 1 1 1 1 1 1 11 0 0 1 1 1 1 1 0 1 11 0 1 0 x x x x x x x

1 0 1 1 x x x x x x x1 1 0 0 x x x x x x x1 1 0 1 x x x x x x x1 1 1 0 x x x x x x x1 1 1 1 x x x x x x x

y

1 1 1

1 1 1x

wx x x x

1 1 x x

z

BCD code

a = w + y + xz + x’z’

b = . . .c = . . .d = . . .

Page 19: Chapter 04 combinational logic

DESIGN PROBLEMS

1. Design a combinational circuit with three inputs and one output. The output is equal to logic-1 when the binary value of the input is less than 3. The output is logic-0 otherwise.

2. Design a combinational circuit with three inputs, x, y, and z, and three outputs, A, B, and C. When the binary input is 0, 1, 2, or 3, the binary output is one greater than the input. When the binary input is 4, 5, 6, or 7, the binary output is one less than the input.

3. A majority function is generated in a combinational circuit when the output is equal to 1 if the input variables have more 1's than 0's. The output is 0 otherwise. Design a 3-input majority function.

4. Design a combinational circuit that adds one to a 4-bit binary number, A3A2A1A0. For example, if the input of the circuit is A3A2A1A0 = 1101, the output is 11 10. The circuit can be designed using four half-adders.

5. A combinational circuit produces the binary sum of two 2-bit numbers, X1X0 and Y1Y0. The outputs are C, S1, and S0. Provide a truth table of the combinational circuit.

Page 20: Chapter 04 combinational logic

DESIGN PROBLEMS

6. Design the circuit of Problem 4-5 using two full-adders.7. Design a combinational circuit that multiplies two 2-Bit numbers,

A1A0 and B1B0, to produce a 4-bit product, C3C2C1C0. Use AND gates and half-adders.

8. Show that a Full-Subtractor can be constructed with two half-Subtractors and an OR gate.

9. Design a combinational circuit with three inputs and six outputs. The output binary number should he the square of the input binary number.

10.Design a combinational circuit with four inputs that represent a decimal digit in BCD and four outputs that produce the 9's complement of the input digit. The six unused combinations can be treated as don't-care conditions.

11.Design a combinational circuit with four inputs and four outputs. The output generates the 2's complement of the input binary number.

Page 21: Chapter 04 combinational logic

21

DESIGN PROBLEMS

12. Design a combinational circuit that detects an error in the representation of a decimal digit in BCD. The output of the circuit must he equal to Logic -1 when the input contains any one of the six unused bit combinations in the BCD code.

13. 4-13 Design a code converter that converts a decimal digit from the 8 4 -2 -1 code to BCD

14. Design a combinational circuit that converts a decimal digit from the 2 4 2 1 code to the 8 4 -2 - 1 code

15. Design a combinational circuit that converts a binary number of four bits to a decimal number in BCD. Note that the BCD number is the same as the binary number as long as the input is less than or equal to 9. The binary number from 1010 to 1111 converts into BCD numbers from 1 0000 to 1 0101.

Page 22: Chapter 04 combinational logic

ANALYSIS PROCEDURE(BOOLEAN EXPRESSION APPROACH)

1. Label with arbitrary symbols all gate outputs that are a function of the input variables.

Obtain the Boolean functions for each gate.

2. Label with other arbitrary symbols those gates that are a function of input variables and/or previously labeled gates.

Find the Boolean functions for these gates.

3. Repeat the process outlined in step 2 until the outputs of the circuit are obtained.

4. By repeated substitution of previously defined functions, obtain the output Boolean functions in terms of input variables only.

Page 23: Chapter 04 combinational logic

ANALYSIS PROCEDURE(BOOLEAN EXPRESSION APPROACH)

CBA

CBA

BA

CA

CB

F1

F2

ABCA+B+C

AB+AC+BC

(A’+B’)(A’+C’)(B’+C’)

AB'C'+A'BC'+A'B'C

F1=AB'C'+A'BC'+A'B'C+ABCF2=AB+AC+BC

Page 24: Chapter 04 combinational logic

ANALYSIS PROCEDURE(TRUTH TABLE APPROACH)

1. Determine the number of input variables to the circuit. For n inputs, form the 2n possible input combinations of 1's and 0's by listing the binary numbers from 0 to 2n - 1.

2. Label the outputs of selected gates with arbitrary symbols.

3. Obtain the truth table for the outputs of those gates that are a function of the input variables only.

4. Proceed to obtain the truth table for the outputs of those gates that are a function of previously defined values until the columns for all outputs are determined.

Page 25: Chapter 04 combinational logic

CBA

CBA

BA

CA

CB

F1

F2

ANALYSIS PROCEDURE(TRUTH TABLE APPROACH)

A B C F1 F2

0 0 0

= 0 = 0= 0= 0= 0= 0

= 0= 0

= 0= 0

= 0= 0

0

0

0

0

0

0

1

0

00 0

Page 26: Chapter 04 combinational logic

CBA

CBA

BA

CA

CB

F1

F2

= 0 = 0= 1= 0= 0= 1

= 0= 0

= 0= 1

= 0= 1

0

1

0

0

0

0

1

1

1 A B C F1 F2

0 0 0 0 00 0 1 1 0

ANALYSIS PROCEDURE(TRUTH TABLE APPROACH)

Page 27: Chapter 04 combinational logic

CBA

CBA

BA

CA

CB

F1

F2

= 0 = 1= 0= 0= 1= 0

= 0= 1

= 0= 0

= 1= 0

0

1

0

0

0

0

1

1

1 A B C F1 F2

0 0 0 0 00 0 1 1 00 1 0 1 0

ANALYSIS PROCEDURE(TRUTH TABLE APPROACH)

Page 28: Chapter 04 combinational logic

CBA

CBA

BA

CA

CB

F1

F2

= 0 = 1= 1= 0= 1= 1

= 0= 1

= 0= 1

= 1= 1

0

1

0

0

1

1

0

0

0 A B C F1 F2

0 0 0 0 00 0 1 1 00 1 0 1 00 1 1 0 1

ANALYSIS PROCEDURE(TRUTH TABLE APPROACH)

Page 29: Chapter 04 combinational logic

CBA

CBA

BA

CA

CB

F1

F2

= 1 = 0= 0= 1= 0= 0

= 1= 0

= 1= 0

= 0= 0

0

1

0

0

0

0

1

1

1 A B C F1 F2

0 0 0 0 00 0 1 1 00 1 0 1 00 1 1 0 11 0 0 1 0

ANALYSIS PROCEDURE(TRUTH TABLE APPROACH)

Page 30: Chapter 04 combinational logic

CBA

CBA

BA

CA

CB

F1

F2

= 1 = 0= 1= 1= 0= 1

= 1= 0

= 1= 1

= 0= 1

0

1

0

1

0

1

0

0

0 A B C F1 F2

0 0 0 0 00 0 1 1 00 1 0 1 00 1 1 0 11 0 0 1 01 0 1 0 1

ANALYSIS PROCEDURE(TRUTH TABLE APPROACH)

Page 31: Chapter 04 combinational logic

CBA

CBA

BA

CA

CB

F1

F2

= 1 = 1= 0= 1= 1= 0

= 1= 1

= 1= 0

= 1= 0

0

1

1

0

0

1

0

0

0 A B C F1 F2

0 0 0 0 00 0 1 1 00 1 0 1 00 1 1 0 11 0 0 1 01 0 1 0 11 1 0 0 1

ANALYSIS PROCEDURE(TRUTH TABLE APPROACH)

Page 32: Chapter 04 combinational logic

CBA

CBA

BA

CA

CB

F1

F2

= 1 = 1= 1= 1= 1= 1

= 1= 1

= 1= 1

= 1= 1

1

1

1

1

1

1

0

0

1

A B C F1 F2

0 0 0 0 00 0 1 1 00 1 0 1 00 1 1 0 11 0 0 1 01 0 1 0 11 1 0 0 11 1 1 1 1

B

0 1 0 1

A 1 0 1 0C

B

0 0 1 0

A 0 1 1 1C

F1=AB'C'+A'BC'+A'B'C+ABC F2=AB+AC+BC

ANALYSIS PROCEDURE(TRUTH TABLE APPROACH)

Page 33: Chapter 04 combinational logic

QUESTIONS