Analog Devices ADSP-BF53x Blackfin Reference page 535

Table of Contents

Advertisement

• After the divide sequence concludes, multiply the resulting
quotient by the original divisor sign.
• The quotient then has the correct magnitude and sign.
2. The Divide Primitive instructions do not support unsigned divi-
sion by a divisor greater than 0x7FFF. If such divisions are
necessary, prescale both operands by shifting the dividend and divi-
sor one bit to the right prior to division. The resulting quotient
will be correctly aligned.
Of course, prescaling the operands decreases their resolution, and
may introduce one LSB of error in the quotient. Such error can be
detected and corrected by the following steps.
• Save the original (unscaled) dividend and divisor in scratch
registers.
• Prescale both operands as described and perform the divi-
sion as usual.
• Multiply the resulting quotient by the unscaled divisor. Do
not corrupt the quotient by the multiplication step.
• Subtract the product from the unscaled dividend. This step
produces an error value.
• Compare the error value to the unscaled divisor.
Tested examples of these solutions are planned to be added in a later edi-
tion of this document.
ADSP-BF53x/BF56x Blackfin Processor Programming Reference
• If error > divisor, add one LSB to the quotient.
• If error < divisor, subtract one LSB from the
quotient.
• If error = divisor, do nothing.
Arithmetic Operations
15-23

Advertisement

Table of Contents
loading

This manual is also suitable for:

Adsp-bf56x blackfin

Table of Contents