MOTOROLA
DSP96002 USER’S MANUAL
B-45
indspc equ 5.0 ;index spacing
rindspc equ 1.0/indspc ;reciprocal of index spacing
move #table,n0 ;point to start of table
move #firstindex,d6.s ;value of first index
move #rindspc,d7.s ;reciprocal of index spacing
fsub.s d6,d0 ;adjust input relative to index 1 1
fmpy.s d7,d0,d0 ;reduce range and create index 1 1
floor d0,d1 ;get index 1 1
int d1 d1.s,d2.s ;convert index to int,copy int part 1 1
fsub.s d2,d0 d1.l,r0 ;x-X(i), get ptr to table 1 1
nop ;clear address ALU pipe 1 1
move (r0)+n0 ;point to Y(i) 1 1
move x:(r0)+,d4.s ;get Y(i) 1 1
move x:(r0),d5.s ;get Y(i+1) 1 1
fsub.s d4,d5 ;Y(i+1)-Y(i) 1 1
fmpy.s d0,d5,d5 ; *(x-X(i)) 1 1
fadd.s d5,d4 ;+Y(i) 1 1
--- ---
Totals: 12 12
B.1.25
Argument Reduction
Argument reduction (AR) is the problem of having a desired floating point number range and an argument
that is outside of the range. The argument is placed inside of the desired range by adding or subtracting
multiples of the desired number range. Of course, adding and subtracting multiples of a number is inher-
ently slow and requires infinite precision. Some simple methods can be used with some assumptions on
the precision of the data and relative argument sizes.
The following program performs AR when the desired range is arbitrary and the input value is arbitrary. This
may be used to reduce an angle to the range of -pi to pi.
The following variables are defined:
rmin = range minimum value, -pi in this example
rmax = range maximum value, pi in this example
range = rmax-rmin, 2*pi in this example
o_range = 1.0/range
Assume the input is in d0.
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: ......