English
Language : 

MC68340AB16E Datasheet, PDF (172/441 Pages) Motorola, Inc – Integrated Processor with DMA User’s Manual
Freescale Semiconductor, Inc.
First, the results of each TBL are rounded with the TBLS round-to-nearest-even algorithm.
The following values would be returned by TBLS:
TBL # 1
TBL # 2
TBL # 3
0010 0000 .
0011 1111 .
0000 0001 .
Summing, the following result is obtained:
0010 0000 .
0011 1111 .
0000 0001 .
0110 0000 .
Now, using the same TBL results, the sum is first calculated and then rounded according
to the same algorithm:
0010 0000 . 0111 0000
0011 1111 . 0111 0000
0000 0001 . 0111 0000
0110 0001 . 0101 0000
Rounding yields:
0110 0001 .
The second result is preferred. The following code sequence illustrates how addition of a
series of table interpolations can be performed without loss of precision in the intermediate
results:
L0:
TBLSN.B
TBLSN.B
TBLSN.B
ADD.L
〈ea〉, Dx
〈ea〉, Dx
〈ea〉, Dl
Dx, Dm
Long addition avoids problems with carry
ADD.L
Dm, Dl
ASR.L
#8, Dl
Move radix point
BCC.B
L1
Fraction MSB in carry
ADDQ.B
#1, Dl
L1: . . .
MOTOROLA
MC68340 USER’S MANUAL
5-35
For More Information On This Product,
Go to: www.freescale.com