ece 4110– sequential logic design

7
Lecture #21 Page 1 ECE 4110– Sequential Logic Design Lecture #21 Agenda 1. MSI: Subtractors Announcements 1. n/a

Upload: dyanne

Post on 04-Jan-2016

30 views

Category:

Documents


1 download

DESCRIPTION

ECE 4110– Sequential Logic Design. Lecture #21 Agenda MSI: Subtractors Announcements n/a. Subtraction. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: ECE 4110– Sequential Logic Design

Lecture #21Page 1

ECE 4110– Sequential Logic Design

Lecture #21

• Agenda

1. MSI: Subtractors

• Announcements

1. n/a

Page 2: ECE 4110– Sequential Logic Design

Lecture #21Page 2

Subtraction

• Half Subtractor

- one bit subtraction can be accomplished using combinational logic (A-B) A B Bout D 0 0 0 0 0 1 1 1 D = A B 1 0 0 1 Bout = A'·B 1 1 0 0

Page 3: ECE 4110– Sequential Logic Design

Lecture #21Page 3

Subtraction

• Full Subtractor

- to create a full Subtractor, we need to include the “Borrow In” in the Difference

(A-B-Bin) A B Bin Bout D 0 0 0 0 0

0 0 1 1 1 D = A B Bin 0 1 0 1 1 Bout = A'∙B + A'∙Bin + B∙Bin 0 1 1 1 0 1 0 0 0 1

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

- notice this is very similar to addition.

- The Sum and Difference Logic are identical

- The Carry and Borrow Logic are close

Page 4: ECE 4110– Sequential Logic Design

Lecture #21Page 4

Subtraction

• Subtraction

- Can we manipulate the subtraction logic so that Full Adders can be used as Full Subtractors?

Addition Subtraction

S = A B Cin D = A B Bin Cout = A∙B + A∙Cin + B∙Cin Bout = A'∙B + A'∙Bin + B∙Bin

- Let's manipulate Bout to try to get it into a form similar to Cout

Bout = A'∙B + A'∙Bin + B∙Bin

Bout' = (A+B') ∙ (A+Bin') ∙ (B'+Bin') Generalized DeMorgan's Theorem

Now Multiply Out the Terms

Bout' = (A∙A∙B')+(A∙B'∙Bin')+(A∙B'∙B')+(B'∙B'∙Bin')+(A∙A∙Bin')+(A∙Bin'∙Bin')+(A∙B'∙Bin')+(B'∙Bin'∙Bin')

Now Remove Redundant Terms Bout' = (A∙B')+(A∙B'∙Bin')+(A∙Bin')+(B'∙Bin') Bout' = (A∙B')+(A∙Bin')+(B'∙Bin')

Page 5: ECE 4110– Sequential Logic Design

Lecture #21Page 5

Subtraction

• Subtraction

- Now we have similar expressions for Cout and Bout where

Addition Subtraction

Cout = A∙B + A∙Cin + B∙Cin Bout' = A∙B' + A∙Bin' + B'∙Bin'

- But this requires the Subtrahend and B in be inverted, how does this effect the Sum/Difference Logic?

Addition Subtraction

S = A B Cin D = A B Bin

- remember that both inputs of a 2-input XOR can be inverted without changing the logic function which gives us:

S = A B Cin D = A B' Bin'

Page 6: ECE 4110– Sequential Logic Design

Lecture #21Page 6

Subtraction

• Subtraction

- After all of this manipulation, we are left with

Addition Subtraction

S = A B Cin D = A B' Bin' Cout = A∙B + A∙Cin + B∙Cin Bout' = A∙B' + A∙Bin' + B'∙Bin'

- This means we can use "Full Adders" for subtraction as long as:

1) The Subtrahend is inverted 2) Bin is inverted 3) Bout is inverted - In a ripple carry subtractor, intermediate Bout's are fed into Bin's, which is a double inversion

- We can now invert by the first Bin and the last Bout by inserting a '1' into the first Bin of the chain

Page 7: ECE 4110– Sequential Logic Design

Lecture #21Page 7

Subtraction

• Subtraction

- this gives us the minimal logic for a "Ripple Carry Subtractor" using "Full Adders"

X-Y