Analog Devices ADSP-BF53x Blackfin Reference page 534

Table of Contents

Advertisement

Instruction Overview
fractional (in 1.15 format) and therefore the upper 16 bits of the dividend
must have a smaller magnitude than the divisor to avoid a quotient over-
flow beyond 16 bits. If an overflow occurs,
to detect the overflow, rescale the operand, and repeat the division.
Dividing two integers (32.0 dividend by a 16.0 divisor) results in an
invalid quotient format because the result will not fit in a 16-bit register.
To divide two integers (dividend in 32.0 format and divisor in 16.0 for-
mat) and produce an integer quotient (in 16.0 format), one must shift the
dividend one bit to the left (into 31.1 format) before dividing. This
requirement to shift left limits the usable dividend range to 31 bits. Viola-
tions of this range produce an invalid result of the division operation.
The algorithm overflows if the result cannot be represented in the format
of the quotient as calculated above, or when the divisor is zero or less than
the upper 16 bits of the dividend in magnitude (which is tantamount to
multiplication).
Error Conditions
Two special cases can produce invalid or inaccurate results. Software can
trap and correct both cases.
1. The Divide Primitive instructions do not support signed division
by a negative divisor. Attempts to divide by a negative divisor result
in a quotient that is, in most cases, one LSB less than the correct
value. If division by a negative divisor is required, follow the steps
below.
• Before performing the division, save the sign of the divisor
in a scratch register.
• Calculate the absolute value of the divisor and use that value
as the divisor operand in the Divide Primitive instructions.
15-22
ADSP-BF53x/BF56x Blackfin Processor Programming Reference
is set. User software is able
AV0

Advertisement

Table of Contents
loading

This manual is also suitable for:

Adsp-bf56x blackfin

Table of Contents