INSTRUCTION SET DESCRIPTIONS

RND

Round Accumulator

RND

Convergent rounding differs from ‘‘standard’’ rounding in that convergent rounding attempts to remove the aforementioned positive bias by equally distributing the round-off error. The convergent rounding technique initially performs “standard” rounding as previ- ously described. Again, the rounding constant depends on the scaling mode being used. Once “standard” rounding has been done, the convergent rounding method tests the result to determine if all bits including and to the right of the rounding position are zero. If, and only if, this special condition is true, the convergent rounding method will clear the bit immediately to the left of the rounding position. When this special condition is true, numbers which have a “1” in the bit immediately to the left of the rounding posi- tion are rounded up; numbers with a “0” in the bit immediately to the left of the rounding position are rounded down. Thus, these numbers are rounded up half the time and rounded down the rest of the time. Therefore, the roundoff error averages out to zero. The LS bits of the convergently rounded result are then cleared so that the rounded result may be immediately used by the next instruction.

Example:

:

RND A #$123456,X1 B,Y1

:

 

 

 

 

Before Execution

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Case I: A

 

 

$00:123456:789AB

 

 

 

 

 

 

 

;round A accumulator into A1, zero A0

 

 

 

After Execution

 

 

 

 

 

 

 

 

$00:123456:000000

A

 

 

 

 

 

 

Case II: A

$00:123456:800000

A

$00:123456:000000

Case III: A

$00:123456:800000

A

$00:123456:000000

Explanation of Example: Prior to execution, the 56-bit A accumulator contains the value $00:123456:789ABC for Case I, the value $00:123456:800000 for Case II, and the value $00:123455:800000 for Case III. The execution of the RND A instruction rounds the value in the A accumulator into the MSP portion of the A accumulator (A1), using convergent rounding, and then zeros the LSP portion of the A accumulator (A0). Note that Case II is the special case that distinguishes convergent rounding from standard or biased rounding.

MOTOROLA

INSTRUCTION SET DETAILS

A - 259

Page 528
Image 528
Motorola DSP56000, 24-Bit Digital Signal Processor manual RND a #$123456,X1 B,Y1