EE357Unit2b_Division

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

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

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

View Full Document
© 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

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

View Full Document
© 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
© 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

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

View Full Document
© 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
© 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

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

View Full Document
© 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

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

View Full Document
© 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
© 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 +

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

View Full Document
© 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
© 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

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

View Full Document
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
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### 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
Ask a homework question - tutors are online