B-46
DSP96002 USER’S MANUAL
MOTOROLA
rmin equ -3.14159
range equ 2*3.14159
o_range equ 1.0/range
Program ICycles
Words
move #range,d7.s ;load desired range
move #rmin,d2.s ;load range min
move #o_range,d3.s ;load reciprocal of range
fadd.s d2,d0 ;adjust to rmin 1 1
fmpy.s d0,d3,d0 ;scale the input 1 1
floor d0,d1 ;get integer part 1 1
fsub.s d1,d0 ;get fractional part 1 1
fmpy.s d7,d0d0 ;spread out fraction to range 1 1
fadd.s d2,d0 ;adjust to rmin 1 1
--- ---
Totals: 6 6
The output is in d0. Note that the constant initialization is not included in the benchmark because it does
not need to be executed every time argument reduction is desired and is therefore application dependent.
If the desired range begins at zero (i.e. the desired range is zero to two pi), then the first and last fadd in-
structions can be deleted for a four cycle argument reduction.
This is one possible method for AR and it is efficient. This method will not work when the argument divided
by the result range has no fractional part (in the current precision). This is obvious since it is the fractional
part that contains the information relating to how far the scaled argument is in the reduced range. The in-
teger part tells how many times the range has wrapped around. Typically, a good programmer will keep
the argument to a few multiples of the desired range. In most practical applications, the argument may ex-
ceed the desired range by several integral values. In this case, the presented algorithms work very well.
After the final reduced argument has been obtained, any increments should be made from the reduced ar-
gument to prevent eventual overflow and maintain maximum precision.
B.1.26
Non-IEEE floating-point Division
The following code segments perform the division of d0/d5. The resulting quotient is in d0. These code
segments are used for a fast division without the need to conform to the error checking or error bounds of
the IEEE standard.
The code uses a "convergent division" algorithm. The initial seed obtained from the FSEEDD instruction
has 8 bits of accuracy. Two iterations of the convergent division algorithm provide approximately 32 bits
of accuracy. For more information on the convergent division algorithm, consult "Computer Arithmetic,
Principles, Architecture, and Design" by Kai Hwang, 1979, John Wiley and Sons, New York.
Non-IEEE Division Algorithm
Summary of Contents for DSP96002
Page 3: ...1 2 DSP96002 USER S MANUAL MOTOROLA ...
Page 38: ...MOTOROLA DSP96002 USER S MANUAL 3 15 Figure 3 4 Modulo Arithmetic Unit Block Diagram ...
Page 39: ...3 16 DSP96002 USER S MANUAL MOTOROLA ...
Page 53: ...4 14 DSP96002 USER S MANUAL MOTOROLA ...
Page 76: ...MOTOROLA DSP96002 USER S MANUAL 5 23 Figure 5 8 Address Modifier Summary ...
Page 86: ...6 10 DSP96002 USER S MANUAL MOTOROLA ...
Page 101: ...MOTOROLA DSP96002 USER S MANUAL 7 15 Figure 7 9 HI Block Diagram One Port ...
Page 140: ...7 54 DSP96002 USER S MANUAL MOTOROLA ...
Page 166: ...9 10 DSP96002 USER S MANUAL MOTOROLA ...
Page 181: ...MOTOROLA DSP96002 USER S MANUAL 10 15 Figure 10 8 Program Address Bus FIFO ...
Page 337: ...MOTOROLA DSP96002 USER S MANUAL A 149 ...
Page 404: ...A 216 DSP96002 USER S MANUAL MOTOROLA PC xxxx D ...
Page 460: ...A 272 DSP96002 USER S MANUAL MOTOROLA SIOP Not affected ...
Page 484: ...A 296 DSP96002 USER S MANUAL MOTOROLA SSH PC SSL SR SP 1 SP ...
Page 519: ...MOTOROLA DSP96002 USER S MANUAL A 331 ...
Page 718: ...MOTOROLA DSP96002 USER S MANUAL B 199 ...
Page 871: ... MOTOROLA INC 1994 MOTOROLA TECHNICAL DATA SEMICONDUCTOR M Addendum ...
Page 888: ...MOTOROLA INDEX 1 INDEX ...
Page 889: ......