Claims
- 1. A computer implemented method of calculating a square root Y=X.sup.1/2 with respect to a given value X in an arithmetic processing apparatus including an adder and a sticky digit generator, comprising the steps of:
- deriving by the processing apparatus an approximate square root Ya at an accuracy at which an error between the approximate square root Ya and an infinitely precise square root Y is smaller than a weight of a digit in a digit place which is lower by two digit places than a least significant digit place for a final square root;
- rounding by the processing apparatus the approximate square root Ya to an interim square root Yr equal to one of possible interim square roots which is closest to the approximate square root Ya, the possible interim square roots being represented by digits in predetermined digit places, wherein a lowest order digit place of said predetermined digit places is arbitrarily selected from a range starting from a digit place lower by at least one digit place than the lowest significant digit place for the final square root and ending at a digit place higher by at least one digit place than a digit place of a minimal weight, wherein a weight of a digit in the minimal-weight digit place is greater than a maximum of an error of the approximate square root Ya;
- deriving by the processing apparatus a square Xr=Yr.sup.2 from the interim square root Yr;
- setting by the sticky digit generator a sticky digit S to 0 when the values X and Xr are equal;
- setting by the sticky digit generator the sticky digit S to -1 when the value X is smaller than the value Xr;
- setting by the sticky digit generator the sticky digit S to 1 when the value X is greater than the value Xr;
- adding by the adder the sticky digit S to a digit place having an order immediately lower than a lowest order digit place of the interim square root Yr; and
- rounding by the processing apparatus a result of the adding in a designated rounding mode to obtain the final square root.
- 2. The method of claim 1 wherein the processing apparatus calculates the approximate square root Ya and the interim square root Yr so that a maximal value of an absolute value of a difference between the values Xr and X will be smaller than a weight of a digit place which is immediately lower than a least significant digit place of the given value X, and including the further step of
- examining digits by the processing apparatus, in digit places lower than a digit place of a digit of the square Xr which has a weight of the least significant digit place of the value X, to decide a relation in magnitude between the values Xr and X to generate the sticky digit S.
- 3. An apparatus for calculating a square root Y=X.sup.1/2 with respect to a given positive value X, comprising:
- means for generating a first digital signal representing an approximate square root Ya at an accuracy at which an error between the approximate square root Ya and an infinitely precise square root Y is smaller than a weight of a digit in a digit place which is lower by two digit places than a lowest significant digit place for an output digital signal representing a final square root;
- rounding means including an adder for rounding the approximate square root Ya to generate a second digital signal representing an interim square root Yr equal to one of possible interim square roots which is closest to the approximate square root Ya, the possible interim square roots including representations of digits in predetermined digit places, wherein a lowest order digit place of said predetermined digit places is arbitrarily selected from a range starting from a digit place lower by at least one digit than the least significant digit place for the output digital signal representing the final square root and ending at a digit place higher by at least one digit than a digit place of a minimal weight, wherein a weight of a digit in the minimal-weight digit place is greater than a maximum of an error of the approximate square root Ya;
- means for generating a third digital signal representing a square Xr=Yr.sup.2 derived from a value of said second digital signal representing the interim square root Yr;
- a sticky digit generator for generating a fourth digital signal representing a sticky digit S, including setting means for setting a value of the fourth digital signal representing the sticky digit S to O when the values of an input digital signal representing X and of said third digital signal representing Xr are equal;
- said setting means operating for setting the value of the fourth digital signal representing the sticky digit S to -1 when the value of said input digital signal representing X is smaller than the value of said third digital signal representing Xr;
- said setting means operating for setting the value of the fourth digital signal representing the sticky digit S to 1 when the value of said input digital signal representing X is greater than the value of said third digital signal representing Xr;
- said adder connected to receive said fourth digital signal representing the sticky digit S and the second digital signal representing the interim square root Yr for adding the sticky digit S to a digit place having an order immediately lower than a lowest order digit place of said second signal representing the interim square root Yr; and for generating an adder output signal; and
- means for rounding a value of said adder output signal representing a result of the addition in a designated rounding mode to generate the output digital signal representing the final square root.
- 4. The apparatus of claim 3 comprising further means for calculating values of the approximate square root Ya and the interim square root Yr so that a maximal value of an absolute value of a difference between the values X and Xr represented by said input digital signal and by said third digital signal will be smaller than a weight of a digit place which is immediately lower than a least significant digit place of the given value X, and for examining digits, in digit places lower than a digit place of a digit of the square Xr which has a weight of the least significant digit place of the value X, to decide a relation in magnitude between the values Xr and X to generate the sticky digit S.
Priority Claims (1)
| Number |
Date |
Country |
Kind |
| 1-268447 |
Oct 1989 |
JPX |
|
Parent Case Info
This application is a division of application Ser. No. 08/012,220, filed Feb. 2, 1993, now U.S. Pat. No. 5,313,415, which is a division of application Ser. No. 07/596,116, filed Oct. 11, 1990, now U.S. Pat. No. 5,212,661.
US Referenced Citations (8)
Foreign Referenced Citations (2)
| Number |
Date |
Country |
| 0394499 |
Oct 1990 |
EPX |
| 9005335 |
May 1990 |
WOX |
Non-Patent Literature Citations (2)
| Entry |
| Proceedings IEEE ICCD:VLSI in Computers & Processors, Mass. 2-4 Oct. 1989, pp. 366-368; Lu et al.; "A VLSI Module for IEEE Floating Point Multiplication/Division/Square Root". |
| "New Scalar and Vector Elementary Functions for the IBM System/370", by Ramesch C. Agarwal et al; IMB J. Res. Develop. vol. 30, No. 2 Mar. 1986; pp. 126-144. |
Divisions (2)
|
Number |
Date |
Country |
| Parent |
12220 |
Feb 1993 |
|
| Parent |
596116 |
Oct 1990 |
|