Analog Devices adsp-2100 Manual page 311

Adsp-2100 family programmable single-chip microprocessors
Table of Contents

Advertisement

14 Software Examples
quadrant.
The routine that implements this sine approximation, accurate to within
two LSBs, is shown in Listing 14.3. This routine accepts input values in
1.15 format. The coefficients, which are initialized in data memory in 4.12
format, have been adjusted to reflect an input value scaled to the
maximum range allowed by this format. On this scale, 180˚ equals the
maximum positive value, 0x7FFF, and –180˚ equals the maximum
negative value, 0x8000.
The routine shown in Listing 14.3 first adjusts the input angle to its
equivalent in the first quadrant. The sine of the modified angle is
calculated by multiplying increasing powers of the angle by the
appropriate coefficients. The result is adjusted if necessary to compensate
for the modifications made to the original input value.
.MODULE
{
Sine Approximation
Calling Parameters
Return Values
Altered Registers
Computation Time
14 – 8
Sin_Approximation;
Y = Sin(x)
AX0 = x in scaled 1.15 format
M3 = 1
L3 = 0
AR = y in 1.15 format
AY0,AF,AR,MY1,MX1,MF,MR,SR,I3
25 cycles

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents