A Variable Latency Goldschmidt's Floating Point Number Square Root Computation

가변 시간 골드스미트 부동소수점 제곱근 계산기

  • 김성기 (부경대학교 전자컴퓨터정보통신공학부) ;
  • 송홍복 (동의대학교 전자정보통신공학부) ;
  • 조경연 (부경대학교 전자컴퓨터정보통신공학부)
  • Published : 2005.02.01

Abstract

The Goldschmidt iterative algorithm for finding a floating point square root calculated it by performing a fixed number of multiplications. In this paper, a variable latency Goldschmidt's square root algorithm is proposed, that performs multiplications a variable number of times until the error becomes smaller than a given value. To find the square root of a floating point number F, the algorithm repeats the following operations: $R_i=\frac{3-e_r-X_i}{2},\;X_{i+1}=X_i{\times}R^2_i,\;Y_{i+1}=Y_i{\times}R_i,\;i{\in}\{{0,1,2,{\ldots},n-1} }}'$with the initial value is $'\;X_0=Y_0=T^2{\times}F,\;T=\frac{1}{\sqrt {F}}+e_t\;'$. The bits to the right of p fractional bits in intermediate multiplication results are truncated, and this truncation error is less than $'e_r=2^{-p}'$. The value of p is 28 for the single precision floating point, and 58 for the doubel precision floating point. Let $'X_i=1{\pm}e_i'$, there is $'\;X_{i+1}=1-e_{i+1},\;where\;'\;e_{i+1}<\frac{3e^2_i}{4}{\mp}\frac{e^3_i}{4}+4e_{r}'$. If '|X_i-1|<2^{\frac{-p+2}{2}}\;'$ is true, $'\;e_{i+1}<8e_r\;'$ is less than the smallest number which is representable by floating point number. So, $\sqrt{F}$ is approximate to $'\;\frac{Y_{i+1}}{T}\;'$. Since the number of multiplications performed by the proposed algorithm is dependent on the input values, the average number of multiplications per an operation is derived from many reciprocal square root tables ($T=\frac{1}{\sqrt{F}}+e_i$) with varying sizes. The superiority of this algorithm is proved by comparing this average number with the fixed number of multiplications of the conventional algorithm. Since the proposed algorithm only performs the multiplications until the error gets smaller than a given value, it can be used to improve the performance of a square root unit. Also, it can be used to construct optimized approximate reciprocal square root tables. The results of this paper can be applied to many areas that utilize floating point numbers, such as digital signal processing, computer graphics, multimedia, scientific computing, etc.

부동소수점 제곱근 계산에 많이 사용하는 골드스미트 제곱근 알고리즘은 곱셈을 반복하여 제곱근을 계산한다. 본 논문에서는 골드스미트 제곱근 알고리즘의 반복 과정의 오차를 예측하여 오차가 정해진 값보다 작아지는 시점까지 반복 연산하는 알고리즘을 제안한다. 'F'의 제곱근 계산은 초기값 $X_0=Y_0=T^2{\times}F,\;T=\frac{1}{\sqrt {F}}+e_t$에 대하여, $R_i=\frac{3-e_r-X_i}{2},\;X_{i+1}=X_i{\times}R^2_i,\;Y_{i+1}=Y_i{\times}R_i,\;i{\in}\{{0,1,2,{\ldots},n-1} }}'$을 반복한다 곱셈 결과는 소수점 이하 p 비트 미만을 절삭하며, 절삭 오차는 $e_r=2^{-p}$보다 작다. p는 단정도실수에서 28, 배정도실수에서 58이다. $X_i=1{\pm}e_i$ 이면 $X_{i+1}$ = $1-e_{i+1}$ $e_{i+1} {\frac{3e^2_i}{4}{\mp}\frac{e^3_i}} $ +4$e_{r}$이다. $|X_i-1|$ < $2^{\frac{-p+2}{2}}$이면, $e_{i+1}$ < $8e_{r}$ 이 부동소수점으로 표현할 수 있는 최소값보다 작게 되며, $\sqrt{F}$ {\fallingdotseq}\frac{Y_{i+1}}{T}}$이다. 본 논문에서 제안한 알고리즘은 입력 값에 따라서 곱셈 횟수가 다르므로, 평균 곱셈 횟수를 계산하는 방식을 도출하고, 여러 크기의 근사 역수 제곱근 테이블 ($T=\frac{1}{\sqrt{F}}+e_i$)에서 단정도실수 및 배정도실수의 제곱근 계산에 필요한 평균 곱셈 횟수를 계산한다. 이들 평균 곱셈 횟수를 종래 알고리즘과 비교하여 본 논문에서 제안한 알고리즘의 우수성을 증명한다. 본 논문에서 제안한 알고리즘은 오차가 일정한 값보다 작아질 때까지만 반복하므로 제곱근 계산기의 성능을 높일 수 있다. 또한 최적의 근사 역수 제곱근 테이블을 구성할 수 있다. 본 논문의 연구 결과는 디지털 신호처리, 컴퓨터 그래픽스, 멀티미디어, 과학 기술 연산 등 부동소수점 계산기가 사용되는 분야에서 폭 넓게 사용될 수 있다.

Keywords

References

  1. Peter Soderquist and Miriam Leaser, 'Division And Square Root, Choosing the Right Implementation,' IEEE Micro, pp. 56-66, Jul. 1997
  2. S. F. Oberman and M. J. Flynn, 'Design Issues in Division and Other Floating Point Operations,' IEEE Transactions on Computer, Vol. C-46, pp. 154-161, 1997
  3. S. F. McQuillan, J. V. McCanny, and R. Hamill, 'New Algorithms and VLSI Architectures for SRT Division and Square Root,' Proc. 11th IEEE Symp. Computer Arithmetic, IEEE, pp. 80-86, 1993
  4. D. L. Harris, S. F. Oberman, and M. A. Horowitz, 'SRT Division Architectures and Implementations,' Proc. 13th IEEE Symp. Computer Arithmetic, Jul. 1997
  5. M. Flynn, 'On Division by Functional Iteration,' IEEE Transactions on Computers, Vol. C-19, no. 8, pp. 702-706, Aug. 1970 https://doi.org/10.1109/T-C.1970.223019
  6. R. Goldschmidt, Application of division by convergence, master's thesis, MIT, Jun. 1964
  7. M. D. Ercegovac, et aI, 'Improving Goldschmidt Division, Square Root, and Square Root Reciprocal,' IEEE Transactions on Computer, Vol. 49, No.7, pp.759-763, Jul. 2000 https://doi.org/10.1109/12.863046
  8. D. L. Fowler and J. E. Smith, 'An Accurate, High Speed Implementation of Division by Reciprocal Approximation,' Proc. 9th IEEE symp. Computer Arithmetic, IEEE, pp. 60-67, Sep. 1989
  9. S. Oberman, 'Floating Point Division and Square Root Algorithms and Implementation in the AMD-K7 Microprocessors, ' Proc. 14th IEEE Symp. Computer Arithmetic, pp. 106-115, Apr. 1999
  10. IEEE, IEEE Standard (or Binary Floating- Point Arithmetic, ANSI/IEEE Standard, Std. 754-1985
  11. D. DasSarma and D. Matula, 'Measuring and Accuracy of ROM Reciprocal Tables,' IEEE Transactions on Computer, Vol.43, No.8, pp. 932-930, Aug. 1994 https://doi.org/10.1109/12.295855