L5. LAB 5: FIXED-POINT AND FLOATING-POINT OPERATIONS 89
is instruction is named VRSQRTE which is used to provide an estimate of 1=sqrt.x/ [3].
VRSQRTS provides the recursive equation part .3 x wŒn/=2, where wŒn D vŒn vŒn.
A multiplication operation with the previous vŒn is then needed for one full iteration of the
previous equation.
L5 LAB 5:
FIXED-POINT AND FLOATING-POINT OPERATIONS
In this lab, a typical computation function is implemented using both floating-point and fixed-
point arithmetic and the differences in the outcomes are compared. e function considered is
division.
A division instruction exists on ARM processors, which is performed by the floating-
point coprocessor VFP. is instruction is generally slower than a multiplication instruction in
terms of the number of clock cycles it takes to complete the computation. For example, on an
ARM Cortex-A9 processor, the timing for fixed-point division is 15 cycles and for floating-
point division is 25 cycles. Division can be obtained by using the following inversion operation:
y=x D y 1=x: (L5.1)
e inversion
1
x
can be approximated using the iterative Newton–Raphson algorithm. Consider
vŒ0 D 1 to be an initial estimate. e Newton–Raphson iterative equation for the reciprocal
operation can be written as
f .y/ D x 1=y D 0 (L5.2)
v.i C .1/ D v.i/ .f .v.i///=.f
0
.v.i/// (L5.3)
D v.i/ .x 1=v.i//=
1=Œv.i/
2
(L5.4)
D v.i/ C .1 x v.i// v.i/ (L5.5)
D v.i/ .2 x v.i//: (L5.6)
To double the accuracy, inputs can be scaled .1 < x < 2/ by appropriately moving the (binary)
decimal point in x and y. is scaling needs to be removed to produce the final output.
L5.1 APP STRUCTURE
e base code provided in the previous labs is changed here as the real-time data processing is
not the focus; rather, the accuracy of the output is the focus. A shell is provided in which C
codes can get inserted. An option named Iteration is included in the Settings menu of the app
to control the number of Newton–Raphson iterations that are to be performed to compute the
reciprocal. e iteration needs to be implemented as a loop accepting the iteration variable as
the number of times the loop will run.
..................Content has been hidden....................

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