Motorola DSP96002 User Manual page 642

32-bit digital signal processor
Table of Contents

Advertisement

move
fcmp
d7,d6
fsub.x
d6,d7
ftfr.x
d6,d7
;
;
First quadrant CORDIC trig computation
;
Input angle in d7 in degrees
;
Output d1=sine, d0=cosine
;
move
fclr
d1
fclr
d5
do
#tabsize,_cordic
fcmp
d5,d7
fneg.x
d4
fsub.x
d6,d5
fadd.x
d6,d5
fmpy.x
d1,d4,d2
fmpy
d0,d4,d2 fsub.x d2,d0
fadd.x
d2,d1
fscale.x #-1,d6
_cordic
fcopys.s d3,d1
end
Argument Reduction
Quadrantizing
CORDIC Algorithm
B.1.52
Four Quadrant Trigonometric COSINE (CORDIC Algorithm)
page
opt
tabsize
MOTOROLA
#90.0,d7.s
#180.0,d7.s
ffge
fflt
#tantab,r0
#scale,d0.s
#45.0,d6.s
x:(r0)+,d4.s
fflt
fflt
ffge
Totals:
132,60,1,1
mex,cex
equ
16
DSP96002 USER'S MANUAL
;get pi/2
;see if greater than 90
;reduce to less than 90
;copy if no change
;point to tangent table
;y=0, x=scale
;z=0,alp=45
;angle < z? get tangent
;yes, rotate cw
;yes, subtract angle
;no, add angle for ccw
;y*tan
;x*tan, x'=x-y*tan
;y'=y+x*tan
;alp=alp/2
;fix sign of sine
Program
ICycles
Words
10
10
7
7
16
8N+9
----
-------
33
8N+26
B-123

Advertisement

Table of Contents
loading

Table of Contents