Data Types
2-20
ADSP-BF535 Blackfin Processor Hardware Reference
In
Figure 2-7
,
A0
bit 16 is forced to zero. This algorithm is employed on
every rounding operation, but is evident only when the bit patterns shown
in the lower 16 bits of the next example are present.
Biased Rounding
The
round-to-nearest
method also returns the number closest to the origi-
nal. However, 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
RND_MOD
bit in the
ASTAT
register enables biased rounding. When the
RND_MOD
bit is cleared, the
RND
option in multiplier instructions uses the
normal, unbiased rounding operation, as discussed in
“Unbiased Round-
ing” on page 2-18
.
When the
RND_MOD
bit is set (=1), the processor uses biased rounding
instead of unbiased rounding. When operating in biased rounding mode,
all rounding operations with
A0.L/A1.L
set to 0x8000 round up, rather
than only rounding odd values up. For an example of biased rounding, see
Figure 2-8
.
Figure 2-7. Avoiding Net Bias in Unbiased Multiplier Rounding
........|................|................
xxxxxxxx|xxxxxxxx01100110|1000000000000000
........|................|1...............
xxxxxxxx|xxxxxxxx01100111|0000000000000000
Unrounded value:
Add 1 and carry:
A0 bit 16=1:
xxxxxxxx|xxxxxxxx01100110|0000000000000000
Rounded value:
A0.X
A0.W
Содержание ADSP-BF535 Blackfin
Страница 80: ...Development Tools 1 26 ADSP BF535 Blackfin Processor Hardware Reference...
Страница 312: ...Working With Memory 6 86 ADSP BF535 Blackfin Processor Hardware Reference...
Страница 332: ...System Interfaces 7 20 ADSP BF535 Blackfin Processor Hardware Reference...
Страница 360: ...Dynamic Power Management Controller 8 28 ADSP BF535 Blackfin Processor Hardware Reference...
Страница 446: ...Beginning and Ending an SPI Transfer 10 40 ADSP BF535 Blackfin Processor Hardware Reference...
Страница 522: ...Timing Examples 11 76 ADSP BF535 Blackfin Processor Hardware Reference...
Страница 562: ...IrDA Support 12 40 ADSP BF535 Blackfin Processor Hardware Reference...
Страница 608: ...PCI I O Issues 13 46 ADSP BF535 Blackfin Processor Hardware Reference...
Страница 672: ...References 14 64 ADSP BF535 Blackfin Processor Hardware Reference...
Страница 810: ...SDRAM Controller SDC 18 86 ADSP BF535 Blackfin Processor Hardware Reference...
Страница 811: ...ADSP BF535 Blackfin Processor Hardware Reference 18 87 External Bus Interface Unit...
Страница 812: ...SDRAM Controller SDC 18 88 ADSP BF535 Blackfin Processor Hardware Reference...
Страница 860: ...DMA Bus Debug Registers 20 30 ADSP BF535 Blackfin Processor Hardware Reference...
Страница 908: ...SDRAM Controller External Bus Interface Unit B 36 ADSP BF535 Blackfin Processor Hardware Reference...