Rounding And Truncating - Analog Devices ADSP-BF53x Blackfin Reference

Table of Contents

Advertisement

occur when a 40-bit value is written to a 32-bit destination. If there was
any useful information in the upper 8 bits of the 40-bit value, then infor-
mation is lost in the process. Some processor instructions report overflow
conditions in the arithmetic flags, as noted in the instruction descriptions.
The arithmetic flags reside in the Arithmetic Status (
the Blackfin Processor Hardware Reference for your specific product for
more details on the

Rounding and Truncating

Rounding is a means of reducing the precision of a number by removing a
lower-order range of bits from that number's representation and possibly
modifying the remaining portion of the number to more accurately repre-
sent its former value. For example, the original number will have N bits of
precision, whereas the new number will have only M bits of precision
(where N>M), so N-M bits of precision are removed from the number in
the process of rounding.
The round-to-nearest method returns the closest number to the original.
By convention, an original number lying exactly halfway between two
numbers always rounds up to the larger of the two. For example, when
rounding the 3-bit, two's-complement fraction 0.25 (binary 0.01) to the
nearest 2-bit two's-complement fraction, this method returns 0.5 (binary
0.1). The original fraction lies exactly midway between 0.5 and 0.0
(binary 0.0), so this method rounds up. Because it always rounds up, this
method is called biased rounding.
The convergent rounding method also returns the closest number to the
original. However, in cases where the original number lies exactly halfway
between two numbers, this method returns the nearest even number, the
one containing an LSB of 0. So for the example above, the result would be
0.0, since that is the even numbered choice of 0.5 and 0.0. Since it rounds
up and down based on the surrounding values, this method is called unbi-
ased rounding.
ADSP-BF53x/BF56x Blackfin Processor Programming Reference
Register.
ASTAT
Introduction
) Register. See
ASTAT
1-19

Advertisement

Table of Contents
loading

This manual is also suitable for:

Adsp-bf56x blackfin

Table of Contents