[slides] Microprocessor-Based Systems - 48/32-bit division algorithm - flow chart
-
Upload
project-symphony-collection -
Category
Documents
-
view
328 -
download
1
description
Transcript of [slides] Microprocessor-Based Systems - 48/32-bit division algorithm - flow chart
START
Sign Check
If ( A > 0 ) If ( B > 0 )
If ( A < 0 ) If ( B < 0 )
CH = 0
CL = 1CH = 1
CL = 0
PUSH CX
The first bit of A and B is set to 0as if they were positive number
Original values are restoredat the end
15th bit check
To reduce the number ofiterations we round the number
up by adding 1 to the MSB of thenumber (if this doesn't cause
overflow)
Estimation of Results
Using the invariance propertywe compute an estimated result
A* = TMP_low*B_low + + (TMP_low*B_high + TMP_high*B_low)*2^16 +
+ TMP_high*B_high*2^32
Then we calculate A* by multiplying theobtained value with the second operand
A > A*
S = A - A*A = A* - B
S < BA* = A* + B
END
YN
Y
N
A = A* ENDY
N
R = S
Restoration
Finally we restore the sign of theoperands by popping CX andwe make final controls on the
residual