AN2072 Freescale Semiconductor / Motorola, AN2072 Datasheet - Page 25

no-image

AN2072

Manufacturer Part Number
AN2072
Description
AN2072, Decision Feedback Equalizer for StarCore-Based DSPs
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
3.4.4 Square Root and Inverse Square Root
The square root and inverse square root routine computes the sqrt(x) and 1/sqrt(x). First, 1/sqrt(x) is computed;
multiplying it by x gives sqrt(x). The 1/sqrt(x) is computed by and iterative quadratic method as shown in
Equation 28.
After a few iterations, the results of the iterative quadratic method attain a good approximation of 1/sqrt(V). For the
purpose of implementation, Equation 28 is rewritten as 0.5U
scaled to ensure that the data going into the 16-bit multiplier yields good precession. The first step is to scale the
input x by 2
a scale factor (2
instruction ensures that d2 is even. The usefulness of this becomes obvious in the following example, which
expresses the relationship between the scale factor and the square root of the scale factor.
To compute the square root of x, we assume that a scale factor after a dynamic scaling on x (using the instruction
clb ) results in 16 (2
sqrt(x), which is sqrt(x
shows that the square root of the scale factor can be obtained simply by dividing the shifts by two (that is; asrr #1,
d2). The input is scaled by SC, and the result is expressed in Equation 29.
To find 1/sqrt(V), we must multiply the result 1/sqrt(V*SC) by sqrt(SC). As scale factors SC are always chosen to
be even shifts of two, the procedure in the example can be used to compute sqrt(SC).
Freescale Semiconductor
Loop_3:
x
(where x must be even) so that it is a number less than one (but as close to one as possible). To obtain
sub d1,d3,d7 move.l d3,r1 move.l d4,r0
asr d7,d7
; The best index is saved in d7l
tfr d7,d6 move.w (r1),d4
; The maximum value is saved in d4l
cmpgt d4,d0 add #<8,d6 max d0,d4 move.w (r0)+n3,d0
[ cmpgt d4,d0
]
x
loopstart3
tfrt d6,d7
tfrt d6,d7
rts
endsec
move.l d7,n3
) for the input, x is made even by an and operation of the form and #$0000fffe,d2,d2. This
loopend3
4
or left shift by 4). After the left shift operation, the number is x
×
2
Decision Feedback Equalizer for StarCore™-Based DSPs, Rev. 1
4
)/sqrt(2
doensh3 #<(N/8)-2
Ui = 1/sqrt(V*SC) = 1/[sqrt(V)*sqrt(SC)]
;load the delay index in to n3
max d0,d4
add #<8,d6
4
). This is exactly equal to shifting sqrt(x
Ui+1 = Ui/2*(3 – V*Ui*Ui)
move.w (r0)+n3,d0
move.w (r0)+n3,d0
i+1
= 0.25*U
i
- V*U
×
2
4
i
^3. Intermediate results must be
) right by two. Our example
Implementation of the Algorithm
×
2
4
. Our goal is to compute
Equation 28
Equation 29
25

Related parts for AN2072