21.07.2015 Views

"TMS320C55x DSP Library DSPLIB Programmer's Reference"

"TMS320C55x DSP Library DSPLIB Programmer's Reference"

"TMS320C55x DSP Library DSPLIB Programmer's Reference"

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

subnxoflagNumber of elements of input and output vectors.Overflow flag. If oflag = 1, a 32-bit overflow has occurred. If oflag = 0, a 32-bit overflow has not occurred.DescriptionCalculates the square root for each element in input vector x, storing resultsin output vector r.Algorithm for (i 0; i nx; i ) r[i] (x(i)0 i nxOverflow Handling MethodologyNot applicableSpecial Requirements noneImplementation Notes The square root of a number(x) can be calculated using Newton’s method. Aninitial approximation is guessed and then the approximation gets recomputedusing the formula,new approximation old approximation (old approximation2 x).2The new approximation then becomes the old approximation and the processis repeated until the desired accuracy is reached.ExampleBenchmarksSee examples/sqrtv subdirectory(preliminary)Cycles † Core: 35 * nxOverhead: 14Code size(in bytes)84 program; 5 data† Assumes all data is in on-chip dual-access RAM and that there is no bus conflict due to twiddletable reads and instruction fetches (provided linker command file reflects those conditions).subFunctionVector Subtractshort oflag = sub (DATA *x, DATA *y, DATA *r, ushort nx, ushort scale)(defined in sub.asm)Argumentsx[nx]y[nx]Pointer to input data vector 1 of size nx. In-place processingallowed (r can be = x = y)Pointer to input data vector 2 of size nx4-90

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!