70 likes | 203 Views
ECE 4110– Sequential Logic Design. Lecture #21 Agenda MSI: Subtractors Announcements n/a. Subtraction.
E N D
ECE 4110– Sequential Logic Design Lecture #21 • Agenda • MSI: Subtractors • Announcements • n/a
Subtraction • Half Subtractor- one bit subtraction can be accomplished using combinational logic (A-B) A BBoutD 0 0 0 0 0 1 1 1 D = A B 1 0 0 1 Bout = A'·B 1 1 0 0
Subtraction • Full Subtractor- to create a full Subtractor, we need to include the “Borrow In” in the Difference(A-B-Bin) A B BinBoutD 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
Subtraction • Subtraction- Can we manipulate the subtraction logic so that Full Adders can be used as Full Subtractors?AdditionSubtraction S = A B Cin D = A B BinCout = A∙B + A∙Cin + B∙CinBout = 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')
Subtraction • Subtraction- Now we have similar expressions for Cout and Bout whereAdditionSubtractionCout = A∙B + A∙Cin + B∙CinBout' = A∙B' + A∙Bin' +B'∙Bin' - But this requires the Subtrahend and Bin be inverted, how does this effect the Sum/Difference Logic?AdditionSubtraction 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'
Subtraction • Subtraction- After all of this manipulation, we are left withAdditionSubtraction S = A B Cin D = A B' Bin' Cout = A∙B + A∙Cin + B∙CinBout' = 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
Subtraction • Subtraction- this gives us the minimal logic for a "Ripple Carry Subtractor" using "Full Adders" X-Y