Motorola CPU32 Reference Manual page 251

M68300 series central processor unit
Hide thumbs Also See for CPU32:
Table of Contents

Advertisement

III
In Example 2, the data from Example 1 has been compressed by limiting the
maximum value of the independent variable.
Instead of the range
o
~
X
=
65535, X is limited to 0
~
X
~
1023. The table has been compressed to
only 5 entries, but up to 256 levels of interpolation are allowed between entries.
CAUTION
Extreme table compression with many levels of interpolation is
possible only with highly linear functions.
The table entries within the range of interest are as follows:
Entry
X
y
Number
Value
Value
2
512
1311
3
786
1966
Since the table is reduced from 257 to 5 entries, independent variable X must
be scaled appropriately. In this case the scaling factor is 64, and the scaling is
done by a single instruction:
LSR.W #6,Ox
Thus, Ox now contains the following bit pattern:
31
16
15
0
NOT USED
0 0 0 0 0 0 1 0 1 0 0 0 1 1 1 0 1
Table Entry Offset
=>
Dx [8:15]
=
$02
=
2
Interpolation Fraction
=>
Dx [0:7]
=
$8E
=
142
Using this information, the table instruction calculates dependent variable Y:
Y = 1331
+
(142 (1966 -1311)) /256 = 1674
The function chosen for Examples 1 and 2 is linear between data points. If
another function been been used, interpolated values might not have been
identical.
MOTOROLA
4-198
INSTRUCTION SET
CPU32 REFERENCE MANUAL

Advertisement

Table of Contents
loading

Table of Contents