Motorola DSP96002 User Manual page 573

32-bit digital signal processor
Table of Contents

Advertisement

9. Dynamic bit field clear. Register d1.l contains FOFF, d2.l contains
FSIZE.
move
d2,d3
d3.l,d3.h
;trim mask, get foff
mask
and clear
Totals:
10. Dynamic bit field set. Register d1.l contains FOFF, d2.l contains FSIZE.
move
d2,d3
d3.l,d3.h
;trim mask, get foff
mask
field
Totals:
B.1.29 Newton-Raphson Approximation for 1.0/SQRT(x)
The Newton-Raphson iteration can be used to approximate the function:
y= -------
sqrt(x)
by minimizing the function:
Given an initial approximate value y=1/sqrt(x), the Newton-Raphson iteration for refining the estimate is:
y(n+1)=y(n) * (3.0-x * y * y)/2.0
Newton-Raphson Approximation
B-54
#32,d3.l
#-1,d2.l
;32-fsize, get 1s mask 2
;move shift count
1
1
1
1
1
7
7
#32,d3.l
#-1,d2.l
;32-fsize, get 1s mask 2
;move shift count
1
1
1
1
1
7
7
1.0
F(y) = x
-
-------
of 1.0/SQRT(x)
DSP96002 USER'S MANUAL
;register size
1
1
lsr
1
lsl
d1,d2
andc
d2,d0
---
---
;register size
1
1
lsr
1
lsl
d1,d2
or
d2,d0
---
---
1.0
y * y
Program
ICycles
Words
1
1
sub
2
move
d3,d2
d1.l,d1.h
;align
;invert mask
Program
ICycles
Words
1
1
sub
2
move
d3,d2
d1.l,d1.h
;align
;clear bit
Program
ICycles
Words
MOTOROLA

Advertisement

Table of Contents
loading

Table of Contents