EE357Unit2b_Division

EE357Unit2b_Division - EE 357 Unit 2b Division Techniques...

Info iconThis preview shows pages 1–15. Sign up to view the full content.

View Full Document Right Arrow Icon
© Mark Redekopp, All rights reserved EE 357 Unit 2b Division Techniques
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
© Mark Redekopp, All rights reserved DIVISION TECHNIQUES Restoring Division Non-Restoring Division
Background image of page 2
© Mark Redekopp, All rights reserved Binary Division Performed using same rules as decimal division 1001 -10 0001 10 0100 r. 0001 Human Method Check whether divisor can divide the dividend (dividend >= divisor) in our heads Divisor Dividend Quotient
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
© Mark Redekopp, All rights reserved Restoring Division Computer must subtract to check if current portion of the dividend >= divisor 1001 -10 11 +10 010 - 010 0000 - 0010 1110 +0010 00001 - 00010 11111 +00010 00001 10 Sub 2 Neg. => Can’t Divide (q=0) Add 2 (Restore) Get next bit Sub 2 Pos. => Divides (q=1) / Get next bit Sub 2 Neg. => Can’t Divide (q=0) Add 2 (Restore) Get Next bit Sub 2 Neg. => Can’t Divide (q=0) Add 2 (Restore) Remainder = 0001 0100 r. 0001
Background image of page 4
© Mark Redekopp, All rights reserved Restoring Division Sequential algorithm Similar to long division method Produce 1 bit of quotient each iteration Three n -bit Registers, 1 Adder M = Divisor Q = Start: Dividend / Finish: Quotient A = Start: 0 / Finish: Remainder Q will end with the n -bit quotient A will end with the remainder
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
© Mark Redekopp, All rights reserved 0 0010 A Q M Cout Cin 0 Division Hardware 0 0 0 1 0 0 1 2’s comp. Adder 0010 1110 Q(0) Logic msb
Background image of page 6
© Mark Redekopp, All rights reserved Restoring Algorithm Repeat n times 1. Shift A and Q left one bit 2. A = A M 3. Set q and possibly restore a. If MSB of A is 1 (negative), q 0 =0 and do A=A+M (restore) b. If MSB of A is 0 (positive), q 0 =1
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
© Mark Redekopp, All rights reserved 1001 10
Background image of page 8
© Mark Redekopp, All rights reserved 0 0010 A Q M Cout Cin 0 A Q Restoring Division 0000 1001 0 0 0 1 0 0 1 M = 0010 1001 10 2’s comp. Adder 0010 1110
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
© Mark Redekopp, All rights reserved 0 0010 A Q M Cout Cin 0 A Q Restoring Division 0000 1001 0 0 1 0 0 1 M = 0010 1001 10 2’s comp. 10 1 Shift 001_ 0001 Shift Left Adder 0010 1110
Background image of page 10
© Mark Redekopp, All rights reserved 0 0010 A Q M Cout Cin 0 A Q Restoring Division 0000 1001 0 0 1 0 0 1 M = 0010 1001 10 2’s comp. 0010 1110 10 1 Shift 001_ 0001 Subtract Adder 1111 1111 Sub (Add -2) 1110 +
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
© Mark Redekopp, All rights reserved 1 0010 A Q M Cout Cin 0 A Q Restoring Division 0000 1001 1 1 1 0 0 1 0 M = 0010 1001 10 2’s comp. 0010 1110 10 1 Shift 001_ 0001 A is neg. => set q 0 = 0 Adder Sub (Add -2) 1110 + 1 111 001 0 Set q 0 = 0 0
Background image of page 12
© Mark Redekopp, All rights reserved 1 0010 A Q M Cout Cin 0 A Q Restoring Division 0000 1001 1 1 1 0 0 1 0 M = 0010 1001 10 2’s comp. 0010 1110 10 1 Shift 001_ 0001 Restore Adder Sub (Add -2) 1110 + 1 111 001 0 Set q 0 = 0 Restore (+2) 0010 + 0001 0001 0
Background image of page 13

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
0 0010 A Q M Cout Cin 0 A Q Restoring Division 0000 1001 0 0 1 0 0 1 0 M = 0010 1001 10 2’s comp. 0010
Background image of page 14
Image of page 15
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/04/2010 for the course EE 357 taught by Professor Mayeda during the Spring '08 term at USC.

Page1 / 52

EE357Unit2b_Division - EE 357 Unit 2b Division Techniques...

This preview shows document pages 1 - 15. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online