Module 2 AnimatedDataRepCompArith Bhanu Chander
Module 2 AnimatedDataRepCompArith Bhanu Chander
D=Q*M+R
Simple Integer Division: Pencil-Paper Method
Let,
Dividend, D=1000011
Divisor, M=1001
Fixed Point Division
Restoring Division
Non-Restoring Division
Restoring Division Algorithm
Restoring Division Flowchart
Q=7=0111
M=3=0011
Solution:
Quotient =0010=2
Remainder=0001=1
Non-restoring Division
Modifying the basic division algorithm by eliminating restoring step is
non-restoring division
Algorithm
1. Start by initializing register A to 0 and repeat steps (2-4) n times
2. If A is positive,
2.1 Shift A and Q left by one bit position
2.2 Subtract M from A
3. If A is negative
3.1 Shift A and Q left by one bit position
3.2 Add M to A
4. If A is positive, set Q0 to 1, else Q0 to 0
5. If A is negative, add M to A as a final corrective step
Non-Restoring Division
Flowchart
Q=7=0111
M=3=0011
Solution:
Quotient =0010=2
Remainder=0001=1
Restoring Division Non-Restoring Division
In each cycle content of register A is first shifted left In each cycle content of register A is first shifted left
and then divisor is subtracted from it. and then divisor is added or subtracted with A
depending on the sign of A
Initialize A
and Q-1 to 0
10
01 Q0 Q-1
00 or 11
A=A+M A=A-M
ashr A, Q and
count = count-1
No
Count=0
Yes
End
Modified Booth’s Algorithm