Download Std_DevelopersKit User`s Manual

Transcript
Std_Regpak
mod
CONVENTIONAL BINARY RESTORING ALGORITHM:
Let A be the dividend.
Let D be the divisor.
Let B be the quotient.
Let R be the remainder.
Let i be a counter.
Let n be the length of the dividend assuming that it is larger than the divisor and
that the most significant bit is a 1. Then A, D, and R are extended to 2n bits.
1
2
3
4
5
6
R <-- A
D <-- D shifted n bits to the left
B <-- 0
i <-- 0
R <-- 2R - D
If R >= 0 then
B <-- 2B + 1
else
R <-- R + D
B <-- 2B
i <-- i + 1
if i < n then go to 2
end
X HANDLING:
When the inputs are converted to unsigned representation, the X’s are handled as
follows.For all of the representations if the number is positive then X’s are simply
echoed in the Unsigned vector. This is also true for negative SignMagnitude and
OnesComp vectors. If the sign bit is an X for these representations then the
negation is performed. For negative TwosComp vectors, X’s are propagated as
appropriate for negating a TwosComp vector. Once again, if the sign bit is X the
negation is performed. The sign of the result is calculated assuming an X in the
sign bit represents a negative number. During the implementation of the restoring
algorithm, X’s are propagated as would be expected for unsigned addition and
subtraction. When determining whether the remainder is greater than 0 an X in the
sign bit is treated as a 1. In the conversion back to the appropriate arithmetic
representation X’s are propagated as described for the appropriate functions (i.e.
To_OnesComp, To_TwosComp, and To_Unsign).
Std_DevelopersKit User’s Manual, V2.2
3-31