• Tidak ada hasil yang ditemukan

Simple method of computing a function in fixed-point arithimetic

N/A
N/A
Protected

Academic year: 2024

Membagikan "Simple method of computing a function in fixed-point arithimetic"

Copied!
2
0
0

Teks penuh

(1)

:=:

ZY:;

n’

Simple method of computing a function in fixed-point arithimetic

S.S.

Deo and K.V.S. Hari

Indexing term: Digital arithmetic

The authors present a simple method, based on the principle of successive approxmation, of computing a function using a futed- point arithmetic processor. As an example, computing the square root function is considered and the performance is compared with Newton’s method, in terms of accuracy and the number of

;nstruct;on cycles requl-ed.

Introduction: The method of successive approximation (SA) is most commonly used in analogue to digital converters (ADCs). A simple method, based on this principle, for the computation of functions in fuced-point arithmetic is proposed. The effectiveness of this method in terms of accuracy, number of cycles etc.,

(2)

depends on how effectively the inverse fwzction is computed. This Letter presents the algorithm and presents the performance of the algorithm for square root computation on a fxed-point DSP proces- sor.

Method Newton-Raphson Successive approx

Successive approximation (SA) method for computing a function:

Consider a B bit fixed-point arithmetic processor and assume that the values are represented in fractional format as

X = bs.bObl

...

bB-2

with b, denoting the sign bit. Consider the function

Y

=

f

(")

which needs to be evaluated and let

f'(.)

denote the inverse func- tion.

(1)

Cycles per iteration Iterations Average error

32 40 5 x 104

24 15 2 x 10-5

Algorithm:

y , <= "b, = 0, b,, = 1, b, = 0, i # 0"; initial guess (usually mid-point)

. "

y , <= 'I& = 0, bi = 1, b, = 0, i # 1"; a constant named shift-Val-1 y2 <= "b, = 0, b,, = 1, b, = 0, i # 0 = 1;'; a constant named shift-val-2 START LOOP

FOR (LOOP = 1 to %I), I F (x

rf'bo))

Yo <= Yo OR yi;

shift right y1 by 1 bit position;

shift right y , by 1 bit position;

END IF IF (x < f ' C Y o ) )

Y O <= YO AND (NOTy2) OR yi;

shift right yi by 1 bit position;

shift right y , by 1 bit position;

END I F I F (X =

f'bo))

END I F

TERMINATE LOOP;

END LOOP STOP

A 4

<= yo;

Remarks:

(i) The number of iterations required for computation are equal to the number of bits used for representing y .

(ii) The accuracy and computational complexity of implementing the inverse function dictates the accuracy and computational com- plexity of the SA method of function evaluation.

Examples: Square root computation: Usually, the square root of a number is evaluated using the Newton Raphson method given by the iterative formula [l]:

y(n) = - y(n - 1)

+

~

2

"

Y(n

" I

- 1)

where n denotes the nth iteration. After some iterations, y(n) approximates to zix.

Using the SA method, it is easy to see that for square root com- putation, the inverse function is simply squaring, or multiplica- tion. This can effectively be carried out by a hardware multiplier in one clock cycle, which is part of a digital signal processing (DSP) processor (for e.g. [4]).

Performance comparison: A uniform random number generator was used to generate 100 random numbers between zero and one, and the square root was calculated for each of them using the two methods. The average error was chosen as the performance meas- ure. Table 1 presents the results.

Sine inverse computation: The proposed method was also used for computing the arcsin function in [5] and it has been shown that it

performs better than the standard method using a series expansion

PI.

Conclusion: A simple method, the SA method, is proposed for computing a function in fixed-point arithmetic. The method is general and its power lies in efficient implementation of the inverse function. As an example, it has been shown that using a DSP processor, computing the square root using the proposed method is more accurate and requires less computation compared to the conventional Newton-Raphson method.

References

1 PROAKIS, J.G., and MANOLAKIS, D.G.: 'Digital signal processing principles, algorithms and applications' (Prentice Hall of India, 1995)

2 DSP Applications using ADSP 2100 Family. Analog Devices, 1992 3 ADSP 210112102 Ez-Lab Manual. Analog Devices, 1990

4 ADSP 2100 Family User's Manual. Analog Devices, 1993 5 DEO, s.s.: 'Digital signal processing based interface for a fiber optic

gyroscope'. M.E. Thesis, Department of ECE, Indian Institute o f Science, Bangalore, India, 1997

Referensi

Dokumen terkait

Siti Rafi’atun: A.320 020 267, AN ANALYSIS OF GRAMMATICAL ERROR IN CONSTRUCTING SENTENCES IN SIMPLE PRESENT TENSE AND SIMPLE PAST TENSE MADE BY THE LEARNERS AT GAMA INTEGRA

The knowledge being learned in algorithms computing consists of: (1) data processing, including modular approach, (2) variables, parameters, data, constants, arithmetical

This conclusion can be used for solving the drawback of the convergence of Newton method since for most non convex function, Newton method will fail to obtain the closest solution

Jain [10] introduced the concept of a pair of semi compatible self maps in a fuzzy metric space to establish a fixed point theorem for four self mappings, which is extension of Vasuki

2456-1037 Vol.03, Issue 09, Conference IC-RASEM Special Issue 01, September 2018 Available Online: www.ajeee.co.in/index.php/AJEEE 1 SECURITY ISSUE IN CLOUD COMPUTING: A REVIEW

CLEAN AIR JOURNAL 20 Volume 28, No 2, 2018 Research brief: Radon-222 measurements at Cape Point: A characterization of a 15-year time series Page 2 of 2 term decreasing higher radon

The authors of [24] have also included a method for virtual machine allocation and migration in order to reduce carbon emissions and energy consumption in federal cloud systems.. The

ISSN: 1693-6930, DOI: 10.12928/TELKOMNIKA.v20i6.23449  1230 A dynamic S-box generation based on a hybrid method of new chaotic system and DNA computing Huda Rashid Shakir, Sadiq