5.6. REFERENCES 91
L5.3 LAB EXERCISES
1. Write a fixed-point C code to implement the Newton–Raphson iterative equation. Con-
sider Q15 format for the numbers. Use 16-bit variables for storage. Make sure appropriate
amount of scaling/shifting is done to generate the highest precision Q15 format result.
Compare the outcome with the outcome using a calculator. Next, adjust the number of
Newton–Raphson iterations and explain the effect on the approximated result. What is the
best tradeoff between number of iterations and accuracy of the resulting approximation?
Examine the effect of lowering the Q format on the outcome. Keep in mind that Q2.13
format needs to be used for the number “2”. Change your code to use 32-bit variables,
choose an appropriate Q format, and repeat the above steps.
2. e NEON coprocessor is useful for optimizing performance intensive vector compu-
tations. e division operation mentioned earlier is a VFP instruction supporting only
one set of operands. Reciprocal estimation and Newton–Raphson iteration functions are
available on the NEON coprocessor [7, 8]. A reference implementation of the Newton–
Raphson division using the NEON coprocessor is provided in the book software package.
Compare the initial estimation from VRECPE with the double-precision division result
(the reference case) from MATLAB, then add the VRECPS iteration and compare the
results as the number of iterations is increased.
3. Write a floating-point C code to compute division by square-root for two numbers b and
a by making use of NEON intrinsics. You should use the provided reference code for
Newton–Raphson division as the basis for your implementation. Compare the initial esti-
mation with the result produced from the square-root operation performed in MATLAB.
Add iterations as before and evaluate the outcome as the number of iterations is increased.
How does the rate of convergence for square-root approximation compare to the rate of
convergence for the division approximation?
5.6 REFERENCES
[1] http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0204j
/CIHCHECJ.html 87
[2] http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0204j
/CIHDIACI.html 87
[3] http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka
14282.html 87, 89
[4] http://infocenter.arm.com/help/topic/com.arm.doc.dui0491c/BABIIBBG.ht
ml 90
92 5. FIXED-POINT VS. FLOATING-POINT
[5] http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dht0002a
/ch01s03s02.html 90
[6] http://infocenter.arm.com/help/topic/com.arm.doc.dui0473c/CIHDIBDG.ht
ml 90
[7] http://infocenter.arm.com/help/topic/com.arm.doc.dui0204j/CIHCHECJ.ht
ml 91
[8] http://infocenter.arm.com/help/topic/com.arm.doc.dui0204j/CIHDIACI.ht
ml 91
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.19.17