DALU
SC140 DSP Core Reference Manual
2-21
2.2.2.5.2 Unsigned Comparison
When performing an unsigned comparison, the condition code computation is different from signed
comparisons. The most significant bit of the unsigned operand has a positive weight, while in signed
representation it has a negative weight. Special instructions are implemented to support unsigned
comparison such as CMPHI (compare greater).
2.2.2.6 Rounding Modes
The SC140 DALU performs rounding of the full register to single precision if requested in the instruction.
The high portion of the register is rounded according to the contents of the low portion of the register.
Then the low portion is cleared. The boundary between the low portion and the high portion is determined
by the scaling mode bits (S0 and S1) in the SR. Two types of rounding are implemented, convergent
rounding and two’s complement rounding. The type of rounding is selected by the rounding mode (RM)
bit in the SR.
Table 2-13 shows the boundary between the high portion and the low portion depending on scaling. The
scaling adjustment is disabled if arithmetic saturation mode is selected.
2.2.2.6.1 Convergent Rounding
Convergent rounding (also called round-to-nearest even number) is the default rounding mode. It is
selected when the rounding mode (RM) bit in the SR is cleared. The traditional rounding method rounds up
any value greater than one-half, and rounds down any value less than one-half. However, the question
arises as to which way one-half should be rounded. If it is always rounded one way, the results are
eventually biased in that direction. Convergent rounding, however, removes the bias by rounding down if
the high portion is even (LSB = 0) and rounding up if the high portion is odd (LSB = 1).
For no scaling, the higher portion (HP) of the register is bits 39:16; the low portion (LP) is bits 15:0. The
HP is incremented by one bit if the LP was > 1/2, or if the LP = 1/2 and bit 16 was 1 (odd). The HP is left
alone if the LP was <1/2, or if LP = 1/2 and bit 16 was 0 (even). After rounding, the LP is cleared. If
scaling down is selected, the HP is bits 39:17 and the LP is bits 16:0. If scaling up is selected, the HP is bits
39:15 and the LP is bits 14:0.
Table 2-13. Rounding Position in Relation to Scaling Mode
S1
S0
Scaling Mode
High Portion
Low Portion
0
0
No Scaling
39–16
15–0
0
1
Scale Down
39–17
16–0
1
0
Scale Up
39–15
14–0
Содержание SC140 DSP Core
Страница 12: ...xii SC140 DSP Core Reference Manual ...
Страница 18: ...xviii SC140 DSP Core Reference Manual ...
Страница 32: ...1 6 SC140 DSP Core Reference Manual Core Architecture Features ...
Страница 180: ...4 70 SC140 DSP Core Reference Manual Trace Unit Registers ...
Страница 250: ...6 70 SC140 DSP Core Reference Manual Programming Rules ...
Страница 314: ...7 64 SC140 DSP Core Reference Manual NOP Definition ...
Страница 385: ...BMCHG W SC140 DSP Core Reference Manual A 71 u16 iiiiiiiiiiiiiiii 16 bit unsigned immediate data ...
Страница 388: ...A 74 SC140 DSP Core Reference Manual BMCHG W s16 AAAAAAAAAAAAAAAA 16 bit signed SP address offset ...
Страница 391: ...BMCLR SC140 DSP Core Reference Manual A 77 u16 iiiiiiiiiiiiiiii 16 bit unsigned immediate data ...
Страница 454: ...A 140 SC140 DSP Core Reference Manual DECA u5 iiiii 5 bit unsigned immediate data 1 set by the assembler ...
Страница 463: ...DI SC140 DSP Core Reference Manual A 149 15 8 7 0 DI 1 1 4 1 0 0 1 1 1 1 1 0 1 1 1 1 1 0 1 ...
Страница 478: ...A 164 SC140 DSP Core Reference Manual EI ...
Страница 592: ...A 278 SC140 DSP Core Reference Manual MOVE L a32 aaaaaaaaaaaaaaaaAAAAAAAAAAAAAAAA 32 bit absolute long address ...
Страница 618: ...A 304 SC140 DSP Core Reference Manual MOVES 4F s15 sssssssssssssss Signed 15 bit offset ...
Страница 638: ...A 324 SC140 DSP Core Reference Manual MPYR ...
Страница 660: ...A 346 SC140 DSP Core Reference Manual OR W s16 AAAAAAAAAAAAAAAA Signed 16 bit SP address offset ...
Страница 746: ...A 432 SC140 DSP Core Reference Manual ZXTA x ...
Страница 758: ...I 10 Index ...
Страница 759: ...SC140 DSP Core Reference Manual i ...
Страница 760: ......