Motorola CPU32 Reference Manual page 238

Hide thumbs Also See for CPU32:
Table of Contents

Advertisement

In Example 2, the data from Example 1 has been compressed by limiting the maximum
value of the independent variable. Instead of the range 0 ≤ 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.
Extreme table compression with many levels of interpolation is pos-
sible only with highly linear functions.
The table entries within the range of interest are as follows:
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:
Thus, Dx now contains the following bit pattern:
31
NOT USED
Using this information, the table instruction calculates dependent variable Y:
The function chosen for Examples 1 and 2 is linear between data points. If another
function had been used, interpolated values might not have been identical.
MOTOROLA
4-190
CAUTION
Entry
X
Number
Value
2
512
3
786
LSR.W #6,Dx
16
Table Entry Offset → Dx [8:15] = $02 = 2
Interpolation Fraction → Dx [0:7] = $8E = 142
Y = 1331 + (142 (1966 – 1311)) / 256 = 1674
INSTRUCTION SET
Y
Value
1311
1966
15
0 0 0 0 0 0 1 0 1 0 0 0 1 1 1 0
0
.
CPU32
REFERENCE MANUAL

Advertisement

Table of Contents
loading

Table of Contents