Publication number | US20020178201 A1 |

Publication type | Application |

Application number | US 10/036,133 |

Publication date | Nov 28, 2002 |

Filing date | Dec 28, 2001 |

Priority date | May 25, 2001 |

Also published as | US6976050 |

Publication number | 036133, 10036133, US 2002/0178201 A1, US 2002/178201 A1, US 20020178201 A1, US 20020178201A1, US 2002178201 A1, US 2002178201A1, US-A1-20020178201, US-A1-2002178201, US2002/0178201A1, US2002/178201A1, US20020178201 A1, US20020178201A1, US2002178201 A1, US2002178201A1 |

Inventors | Guy Steele |

Original Assignee | Sun Microsystems, Inc. |

Export Citation | BiBTeX, EndNote, RefMan |

Patent Citations (5), Classifications (33), Legal Events (3) | |

External Links: USPTO, USPTO Assignment, Espacenet | |

US 20020178201 A1

Abstract

A method and system determine a high part of a floating point operand. Exponent field bits and fraction field bits of a result are set to a zero if the determined format is an infinity format or an overflow format. The exponent field bits and the fraction field bits of the result are set to corresponding exponent field bits and corresponding fraction field bits of the floating point operand if the determined format is a not-a-number (NaN) format. At least one of the fraction field bits of the result is adaptively cleared if the determined format is a denormalized format or a delimited format.

Claims(24)

determining a format of the floating point operand;

setting a plurality of exponent field digits and a plurality of fraction field digits of a result to a zero if the determined format is one of a first group comprising an infinity format and an overflow format;

setting the exponent field digits and the fraction field digits of the result to corresponding exponent field digits and corresponding fraction field digits of the floating point operand if the determined format is a not-a-number (NaN) format; and

adaptively clearing at least one of the fraction field digits of the result if the determined format is one of a second group comprising a denormalized format and a delimited format, wherein the high part of the floating point operand is the result.

determining a format of the floating point operand;

setting a plurality of exponent field digits and a plurality of fraction field digits of a result to a zero if the determined format is one of a first group comprising an infinity format and an overflow format;

setting the exponent field digits and the fraction field digits of the result to corresponding exponent field digits and corresponding fraction field digits of the floating point operand if the determined format is a not-a-number (NaN) format; and

adaptively clearing at least one of the fraction field digits of the result if the determined format is one of a second group comprising a denormalized format and a delimited format, wherein the high part of the floating point operand is the result.

an operand analysis circuit that determines a format associated with the floating point operand;

a processing circuit that adaptively sets at least one digit of an intermediate result; and

a result generator circuit that assembles a final result equal to the high part of the floating point operand based on the format of the floating point operand and the intermediate result.

Description

[0001] U.S. patent application Ser. No. ______, filed on even date herewith in the name of Guy L. Steele Jr. and entitled “Floating Point Unit in which Floating Point Status Information is Encoded in Floating Point Representations,” assigned to the assignee of the present application, is hereby incorporated by reference.

[0002] 1. Field of the Invention

[0003] The present invention relates to floating point processing, and, more particularly, to systems and methods for computing the high part of a floating point number.

[0004] 2. Background of the Invention

[0005] IEEE Standard 754 (hereinafter “IEEE Std. 754” or “the Standard”) published in 1985 by the Institute of Electrical and Electronic Engineers, and adopted by the American National Standards Institute (ANSI), defines several standard formats for expressing values as a floating point number. In accordance with IEEE Std. 754, a floating point format is represented by a plurality of binary digits, or “bits,” having the structure:

[0006] se_{msb }. . . e_{lsb}f_{msb }. . . f_{lsb }

[0007] where “msb” represents “most significant bit” and “lsb” represents “least significant bit.” The bit string comprises a sign bit, s, which indicates whether the number is positive or negative. The bit string further comprises an exponent field having bits e_{msb }. . . e_{lsb }representing a biased exponent, e. Still further, the bit string comprises a fraction field having bits f_{msb }. . . f_{lsb }representing a fraction field of a significand. A significand comprises an explicit or implicit leading bit to the left of an implied binary point and a fraction field to the right of the implied binary point.

[0008] IEEE Std. 754 defines two general formats for expressing a value, namely, a “single” format, which comprises thirty-two bits, and a “double” format, which comprises sixty-four bits. In the single format, there is one sign bit, s, eight bits, e_{7 }. . . e_{0}, comprising the exponent field, and twenty-three bits, f_{22 }. . . f_{0}, comprising the fraction field. In the double format, there is one sign bit, s, eleven bits, e_{10 }. . . e_{0}, comprising the exponent field, and fifty-two bits, f_{51 }. . . f_{0}, comprising the fraction field.

[0009] The value of a number represented in accordance with IEEE Std. 754 is determined based on the bit patterns of the exponent field bits, e_{msb }. . . e_{lsb}, and the fraction field bits, f_{msb }. . . f_{lsb}, both for the single and double formats. The value of a number represented in accordance with IEEE Std. 754 is positive or negative infinity, depending on the value of the sign bit, s, if the exponent field bits, e_{msb }. . . e_{lsb}, are all binary ones (that is, if the bits represent a binary-encoded value of “255” in the single format or “2047” in the double format) and the fraction field bits, f_{msb }. . . f_{lsb}, are all binary zeros. In particular, the value, v, of the number is v=(−1)^{s}∞, where “∞” represents the value infinity. On the other hand, if the exponent field bits, e_{msb }. . . e_{lsb}, are all binary ones and the fraction field bits, f_{msb }. . . f_{lsb}, are not all zeros, then the value that is represented is deemed “not a number,” abbreviated “NaN.”

[0010] Further, if the exponent bits, e_{msb }. . . e_{lsb}, are neither all binary ones nor all binary zeros (that is, if the bits represent a binary-encoded value between 1 and 254 in the single format or between 1 and 2046 in the double format), the number is in a “normalized” format and the value of the number is v=(−1)^{s}2^{e−bias}(1.|f_{msb }. . . f_{lsb}), where “|” represents a concatenation operation. That is, in the normalized format, a leading bit having the value “one” followed by a binary point and the fraction field bits is implied thereby increasing the size of the fraction field by one bit to twenty four bits in the single format and to fifty three bits in the double format. In effect, the fraction field represents a value greater than or equal to one and less than two.

[0011] Still further, if the exponent field bits, e_{msb }. . . e_{lsb}, are all binary zeros and the fraction field bits, f_{msb }. . . f_{lsb}, are not all zero, the number is in a “de-normalized” format and the value of the number is v=(−1)^{s}2^{e-−bia+1}(0.|f_{msb }. . . f_{lsb}). The range of values that can be expressed in the de-normalized format is disjoint from the range of values that can be expressed in the normalized format, for both the single and double formats.

[0012] Finally, if the exponent field bits, e_{msb }. . . e_{lsb}, are all binary zeros and the fraction field bits, f_{msb }. . . f_{lsb}, are all zeros, the value of the number is “zero”. The value “zero” may be positive zero or negative zero, depending on the value of the sign bit.

[0013] In some floating-point computations, particularly in carefully written numerical libraries, it is desirable to extract a “high part” of an input floating point number to obtain a resulting floating point number with the same sign and exponent as the input floating point number and a smaller fraction than the input floating point number. The fraction of the resulting floating point number is chosen so that the difference between the fraction of the resulting floating point number and the fraction of the input floating point number is very small and the significand of the resulting floating point number can be squared exactly without loss of precision.

[0014] Conventionally, the high part of an input floating point number is determined by clearing a predetermined number of least significant fraction field bits of the input floating point number. For example, in the well-known “fdlibm” numerical library, the high part of a 64-bit input floating point number is computed by first storing the 64-bit input floating point number in memory. Type-cast operations are then used to regard the variable as two 32-bit integers. The 32-bit integer represented by the least significant fraction field bits is set equal to zero. Finally, the 64-bit floating point variable is read again, containing the high part of the 64-bit input floating point number originally stored.

[0015] There are several drawbacks to the conventional approach. First, setting the 32-bit integer represented by the least significant fraction field bits equal to zero produces a less accurate high part. In particular, it causes the difference between the fraction of the resulting floating point number and the fraction of the input floating point number to undesirably become too large. Second, storing the 64-bit input floating point number to memory typically requires more time than an operation performed in registers on most computers with their associated programming language compilers. Third, sensible results are not always obtained when the input floating point number is in a denormalized, NaN, infinity, or overflow format according to the floating-point number system disclosed in related U.S. patent application Ser. No. ______ or in an infinity or NaN format according to IEEE Std. 754. For example, typically, to compute the “low part” of a number, the “high part” of the number is subtracted from the number. However, if the number is infinity, the high part of the number will also be infinity using the conventional approach. The subtraction of the high part of the number from the number will produce a floating point number having the NaN format. Also, clearing the low bits of a NaN formatted operand may lose valuable information. Therefore, inputs in a denormalized, NaN, infinity, or overflow format according to the floating-point number system disclosed in related U.S. patent application Ser. No. ______ or in an infinity or NaN format according to IEEE Std. 754 must be tested for and handled separately as special cases in the conventional approach, which introduces additional undesirable costs in memory space and time.

[0016] There is provided a method for determining a high part of a floating point operand. The method comprises determining a format of the floating point operand and setting a plurality of exponent field digits and a plurality of fraction field digits of a result to a zero if the determined format is one of a first group comprising an infinity format and an overflow format. The method further comprises setting the exponent field digits and the fraction field digits of the result to corresponding exponent field digits and corresponding fraction field digits of the floating point operand if the determined format is a not-a-number (NaN) format. Still further, the method comprises adaptively clearing at least one of the fraction field digits of the result if the determined format is one of a second group comprising a denormalized format and a delimited format, wherein the high part of the floating point operand is the result.

[0017] Additional advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The advantages of the invention will be realized and attained by means of the elements and combinations particularly pointed out in the appended claims.

[0018] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed.

[0019] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate several embodiments of the invention and together with the description, serve to explain the principles of the invention.

[0020]FIG. 1 illustrates an exemplary floating point unit for computing the high part of a floating point operand according to an embodiment of the present invention.

[0021]FIG. 2 illustrates an exemplary floating point operand.

[0022]FIG. 3 illustrates an exemplary operand analysis circuit for analyzing a floating point operand according to an exemplary embodiment of the present invention.

[0023]FIG. 4 illustrates an exemplary operand analysis circuit for analyzing a floating point operand according to an exemplary embodiment of the present invention.

[0024]FIG. 5 illustrates an exemplary processing circuit for processing a floating point operand according to an exemplary embodiment of the present invention.

[0025]FIG. 6 illustrates an exemplary processing circuit for processing a floating point operand according to an exemplary embodiment of the present invention.

[0026]FIG. 7 illustrates an exemplary result generator for assembling a result according to an exemplary embodiment of the present invention.

[0027]FIG. 8 illustrates a first embodiment of a floating point unit for computing the high part of a floating point operand according to an exemplary embodiment of the present invention.

[0028]FIG. 9 illustrates a second embodiment of a floating point unit for computing the high part of a floating point operand according to an exemplary embodiment of the present invention.

[0029]FIG. 10 illustrates a third embodiment of a floating point unit for computing the high part of a floating point operand according to an exemplary embodiment of the present invention.

[0030]FIG. 11 illustrates a fourth embodiment of a floating point unit for computing the high part of a floating point operand according to an exemplary embodiment of the present invention.

[0031]FIG. 12 illustrates exemplary formats for representing a floating point operand.

[0032]FIG. 13 illustrates additional exemplary formats for representing a floating point operand.

[0033] Reference will now be made in detail to exemplary embodiments of the invention, examples of which are illustrated in the accompanying drawings. Wherever possible, the same reference numbers will be used throughout the drawings to refer to the same or like parts.

[0034]FIG. 1 illustrates an exemplary floating point unit **100** that may be used to compute the high part of a floating point number. That is, the floating point unit **100** receives an input floating point number and outputs a resulting floating point number that may have a smaller fraction than the input floating point number and whose significand may be squared exactly, without loss of precision. The floating point unit **100** computes the high part of a floating point number based on the format of the floating point number. The floating point unit **100** computes the high part of special input floating point numbers that are in the overflow, infinity, or NaN format shown in FIG. 12 and also described in related U.S. patent application Ser. No. ______ or in the infinity or NaN format according to IEEE Std. 754 so that the low part of these special floating point numbers may be computed to produce sensible results. The floating point unit **100** may adaptively compute the high part of an input floating point number that is in a denormalized format according to IEEE Std. 754. That is, floating point unit **100** does not simply clear a predetermined number of least significant fraction field bits of the input floating point number. Instead, the number of least significant fraction field bits that may be cleared by floating point unit **100** depends on the number of leading zeros in the fraction field of the input floating point number.

[0035] Additionally, the floating point unit **100** may adaptively compute the high part of an input floating point number that is in a delimited format shown in FIG. 13 and also described in U.S. Pat. No. 6,131,106, entitled “System And Method For Floating-Point Computation For Numbers In Delimited Floating-Point Representation,” which hereby is incorporated by reference. More specifically, for an input floating point number in the delimited format, the number of least significant fraction field bits that may be cleared by floating point unit **100** depends on the placement of the delimiter flag in the fraction field of the input floating point number. Finally, the exemplary floating point unit **100** may not store an input floating point number in memory as part of the process to compute the high part of the input floating point number.

[0036] Referring to FIG. 1, the exemplary floating point unit **100** comprises an operand buffer **110**, an operand analysis circuit **120**, a processing circuit **130**, and a result generator **140**. In operation, the operand buffer **110** receives and stores a floating point operand. As shown in FIG. 2, an exemplary **32**-bit floating point operand **200** may include a sign bit **210**, an exponent field **220** having eight exponent field bits, e_{msb }. . . e_{lsb}, and a fraction field having a high part **230** and a low part **240** that together includes twenty-three fraction field bits, f_{msb }. . . f_{lsb}. To compute the high part of the floating point operand **200**, the floating point unit **100** operates by dividing the fraction field into two parts, the high part **230** and the low part **240**. In the 32-bit example, the fraction field high part **230** may consist of the eleven most significant bits, f_{msb }. . . f_{lsb+12}, of the operand fraction field. The fraction field low part **240** may consist of the remaining twelve least significant bits, f_{lsb+11 }. . . f_{lsb}, of the operand fraction field. In alternate embodiments, the bits of the operand **200** may be distributed among the various fields in a variety of different combinations. For example, the exponent field **220** may consist of eight bits, the fraction field high part **230** may consist of the twelve most significant bits, f_{msb }. . . f_{lsb+11}, of the operand fraction field, and the fraction field low part **240** may consist of the remaining eleven least significant bits, f_{lsb+10 }. . . f_{lsb}, of the operand fraction field.

[0037] The operand analysis circuit **120** analyzes the floating point operand **200** received from the operand buffer **110** and generates one or more signals that indicate the format of the operand. As discussed above, the floating point unit **100** computes the high part of the floating point operand **200** based on the format of the operand **200**. Accordingly, the signals indicating the format are provided to the result generator **140**.

[0038] The processing circuit **130** receives the fraction field low part **240** of the floating point operand **200** and may clear one or more bits of the fraction field low part **240**, thereby reducing the value of the fraction of the floating point operand **200**, and outputs the resulting fraction field low part to the result generator **140**. Additionally, the processing circuit **130** adaptively clears the bits of the fraction field low part **240**, as discussed above and in greater detail below.

[0039] The result generator **140** receives the floating point operand **200** from the operand buffer **110**, the signals indicating the operand's format from the operand analysis circuit **120**, and the resulting fraction field low part provided by the processing circuit **130** to assemble a resulting floating point number equivalent to the high part of the floating point operand **200** stored in operand buffer **110**. In a more detailed description of an embodiment of the invention, the resulting floating point number assembled by result generator **140** may have the same sign as the floating point operand **200** stored in operand buffer **110**. Furthermore, the resulting floating point number assembled by result generator **140** may have the same exponent field **220** as the floating point operand **200** stored in operand buffer **110**, unless the floating point operand **200** is in an infinity or overflow format shown in FIG. 12 and in related U.S. patent application Ser. No. ______ or an infinity format according to IEEE Std. 754, as discussed in greater detail below. Still further, the resulting floating point number assembled by result generator **140** may have the same fraction field high part **230** as the floating point operand **200** stored in operand buffer **110**, unless the floating point operand **200** is in an infinity or overflow format shown in FIG. 12 and in related U.S. patent application Ser. No. ______ or an infinity format according to IEEE Std. 754, as discussed in greater detail below. Finally, the fraction field low part of the resulting floating point number assembled by result generator **140** may equal zero, unless the floating point operand **200** stored in operand buffer **110** is (1) in a NaN format according to U.S. patent application Ser. No. ______ or IEEE Std. 754; (2) a subprecise number in a delimited format according to U.S. Pat. No. 6,131,106; or (3) a denormalized format according to IEEE Std. 754. If the floating point operand **200** is in a NaN format according to U.S. patent application Ser. No. ______ or IEEE Std. 754, the fraction field low part of the resulting floating point number assembled by result generator **140** may equal the fraction field low part **240** of the operand **200**. If the floating point operand **200** is a subprecise number in a delimited format according to U.S. Pat. No. 6,131,106 or in a denormalized format according to IEEE Std. 754, the fraction field low part of the resulting floating point number assembled by result generator **140** may equal the fraction field low part provided by the processing circuit **130**. The resulting floating point number assembled by result generator **140** may have a smaller fraction than the input floating point operand stored in operand buffer **110** and may have a significand that may be squared exactly, without loss of precision.

[0040]FIG. 3 illustrates a first exemplary embodiment of the operand analysis circuit **120** that may be used when the floating point operand **200** stored in the operand buffer **110** is in a zero, underflow, overflow, infinity, or NaN format according to U.S. patent application Ser. No. ______ or in a normalized delimited format as disclosed in U.S. Pat. No. 6,131,106.

[0041]FIG. 12 illustrates several exemplary formats for an operand, such as the zero format **1210**, the underflow format **1220**, the normalized nonzero format **1230**, the overflow format **1240**, the infinity format **1250**, and the NaN format **1260**, as disclosed in U.S. patent application Ser. No. ______. As shown in the embodiment illustrated in FIG. 12, in the zero format **1210**, the exponent field bits, e_{msb }. . . e_{lsb}, and the fraction field bits, f_{msb }. . . f_{lsb}, are all binary zeros. In the underflow format **1220**, the exponent field bits, e_{msb }. . . e_{lsb}, are all binary zeros, the twenty-two most significant fraction field bits, f_{msb }. . . f_{lsb+1}, are all binary zeros, and the least significant fraction field bit, f_{lsb}, is a binary one. In the normalized nonzero format **1230**, the exponent field bits, e_{msb }. . . .e_{lsb}, are neither all binary ones nor all binary zeros. In the overflow format **1240**, the seven most significant exponent field bits, e_{msb }. . . e_{lsb+1}, are all binary ones, with the least significant bit, e_{lsb}, being a binary zero, and the fraction field bits, f_{msb }. . . f_{lsb}, are all binary ones. In the infinity format **1250**, the exponent field bits, e_{msb }. . . e_{lsb}, are all binary ones, the eighteen most significant fraction field bits, f_{msb }. . . f_{lsb+5}, are all binary zeros, and the five least significant fraction field bits, f_{lsb+4 }. . . f_{lsb}, are flags. In the NaN format **1260**, the exponent field bits, e_{msb }. . . e_{lsb}, are all binary ones, the eighteen most significant fraction field bits, f_{msb }. . . f_{lsb+5}, are not all binary zeros, and the five least significant fraction field bits, f_{lsb+4 }. . . f_{lsb}, are flags.

[0042]FIG. 13 illustrates an example of a delimited format **1310** as disclosed in U.S. Pat. No. 6,131,106. In the delimited format **1310**, the exponent field bits, e_{msb }. . . e_{lsb}, are all binary zeros. The bits in the fraction field correspond to the bits in the fraction field of the denormalized format **1320** shifted to the left by n bits, where n equals the number of leading zeros in the fraction field of the denormalized format **1320** plus one. Thus, the delimited format **1310** provides an implicit most significant digit having a value equal to a binary one in the fraction field. Further, in the delimited format **1310**, a delimiter flag **1330** is provided in the fraction field at a bit position to the right of the bit which corresponds to the least significant fraction field bit in the denormalized format **1320**. The delimiter flag **1330** indicates the series of fraction field bits of the delimited format **1310** that correspond to the series of bits immediately to the right of the most significant fraction field bit of the denormalized format **1320**. The number of successive fraction field bits, f_{msb }. . . f_{lsb}, from the most significant bit, f_{msb}, to the first bit f_{msb−n }that has the value one in the denormalized format **1320** will correspond to the number of bits f_{lsb+n }. . . f_{lsb }of the delimited format **1310** following the delimiter flag **1330**. The delimiter flag **1330** corresponds to the least significant bit of the delimited format having the value one.

[0043] Returning to FIG. 3, the exemplary operand analysis circuit **120** comprises comparators **305**-**335** and logic elements **340**-**360**. The comparator **305** generates an asserted signal if the exponent field bits, e_{msb }. . . e_{lsb}, of the operand **200** are all binary ones, which will be the case if the operand is in the infinity format **1250** or the NaN format **1260**. If the operand is in the overflow format **1240**, the comparator **310** generates an asserted signal. If the operand is in the zero format **1210**, underflow format **1220**, or delimited format **1310** the comparator **315** generates an asserted signal.

[0044] Further, the comparator **320** generates an asserted signal if the fraction field high part bits **230**, f_{msb }. . . f_{lsb+12}, of the operand are all binary ones, which may be the case if the operand is in the delimited format **1310**, denormalized format, normalized non-zero format **1230**, overflow format **1240**, or NaN format **1260**. The comparator **325** generates an asserted signal if the fraction field high part bits **230**, f_{msb }. . . f_{lsb+12}, of the operand **200** are all binary zeros, which will be the case if the operand is in the zero format **1210**, underflow format **1220**, or infinity format **1250**, and may be the case if the operand is in the delimited format **1310**, denormalized format, normalized non-zero format **1230**, or NAN format **1260**.

[0045] Still further, the comparator **330** generates an asserted signal if the fraction field low part bits **240**, f_{lsb+11 }. . . f_{lsb}, of the operand **200** are all binary ones, which may be the case if the operand is in the delimited format **1310**, normalized non-zero format **1230**, or NaN format **1260**, and which will be the case if the operand is in the overflow format **1240**. Finally, the comparator **335** generates an asserted signal if all of the fraction field low part bits **240**, f_{lsb+11 }f_{lsb }of the operand are all binary zeros, which will be the case if the operand is in the zero format **1210**, and which may be the case if the operand is in the delimited format **1310**, denormalized format, normalized non-zero format **1230**, infinity format **1250**, or NaN format **1260**.

[0046] The combinatorial logic elements **340**-**360** receive selected ones of the signals from the comparators **305**-**335** and generate asserted signals to provide information regarding the operand's format. More specifically, the gate **360** generates an asserted signal, indicating the operand **200** is in the NaN format **1260**, if the comparators **325** and **335** generate a negated signal and the comparator **305** generates an asserted signal. Furthermore, the AND gate **340** generates an asserted signal, indicating the operand **200** is in the infinity format **1250**, if the comparators **305**, **325**, and **335** all generate asserted signals. Still further, the AND gate **345** generates an asserted signal, indicating the operand **200** is in the overflow format **1240**, if the comparators **310**, **320**, and **330** all generate asserted signals. The OR gate **350** generates an asserted signal if the operand **200** is in the overflow format **1240** or infinity format **1250**.

[0047]FIG. 4 illustrates a second embodiment of the operand analysis circuit **120** that may be used when the floating point operand **200** stored in the operand buffer **110** is represented according to IEEE Std. 754. The operand analysis circuit **120** of FIG. 4 operates in a similar manner as the operand analysis circuit **120** of FIG. 3, except that comparators **310**, **320**, and **330** and logic elements **345** and **350** have been removed because there is no overflow format **1240** in IEEE Std. 754. Still further, the comparator **335** in FIG. 3 is replaced by comparator **435** in FIG. 4 because IEEE Std. 754 does not store status information in the operand.

[0048]FIG. 5 illustrates a first embodiment of processing circuit **130** that may be used when the floating point operand **200** stored in the operand buffer **110** is subprecise and in a normalized delimited format as disclosed in U.S. Pat. No. 6,131,106. The processing circuit **130** may be used to adaptively clear one or more fraction field low part bits **240** of the operand **200** stored in operand buffer **110**. The processing circuit **130** receives the signals representative of the fraction field low part bits **240**, f_{lsb+11 }. . . f_{lsb}, of the operand **200** and sets all the bits equal to a binary zero, except the rightmost bit that equals a binary one (i.e., the delimiter flag). More specifically, the processing circuit **130** includes an array of k-1 AND gates, where k equals the number of fraction field low part bits **240**. In the present embodiment, k equals 12. However, k may be greater than or less than 12 in alternate embodiments. The n-th AND gate from the right outputs the resulting (n+1)-th fraction field low part bit from the right (n=1, 2, . . . , k-1). The n-th AND gate receives as a first input the (n+1)-th fraction field low part bit from the right. The second input to the n-th AND gate is a negated signal produced by the array of OR gates that (1) equals a binary one if no bit to the right of the (n+1)-th fraction field low part bit equals a binary one or (2) equals a binary zero if at least one bit to the right of (n+1)-th the fraction field low part bit equals a binary one. Therefore, the n-th AND gate clears the (n+1)-th fraction field low part bit of the operand **200** if there exists at least one bit to the right of the (n+1)-th fraction field low part bit that equals a binary one. Otherwise, the n-th AND gate outputs the (n+1)-th fraction field low part bit of the operand **200** as the resulting (n+1)-th fraction field low part bit if no bit to the right of the (n+1)-th fraction field low part bit equals a binary one. The least significant resulting fraction field low part bit equals the least significant fraction field low part bit, f_{lsb}, of the operand **200**. The processing circuit **130** adaptively clears the fraction field low part bits **240** of the operand **200** stored in operand buffer **110** because the number of bits cleared is not a predetermined number, but instead changes based on the fraction field low part bits **240** received by the processing circuit **130**.

[0049]FIG. 6 illustrates a second embodiment of processing circuit **130** that may be used when the floating point operand **200** stored in the operand buffer **110** is subprecise and in a denormalized format according to IEEE 754. The processing circuit **130** may be used to adaptively clear one or more fraction field low part bits **240** of the operand **200** stored in operand buffer **110**. The processing circuit **130** of FIG. 6 receives the signals representative of the fraction field high part bits **230**, f_{msb }. . . f_{lsb+12}, and the fraction field low part bits **240**, f_{lsb+11 }. . . f_{lsb}, of the operand **200**. The processing circuit **130** sets the fraction field low part bits **240**, f_{lsb+11 }. . . f_{lsb}, based on the fraction field high part bits **230**, f_{msb }. . . f_{lsb+12}. Generally, the smaller the number represented by the fraction field bit of the operand **200** (i.e., the greater the number of leading zeros in the fraction field high part bits **230**, f_{msb }. . . f_{lsb+12}), the fewer the number of least significant bits of the fraction field low part bits **240**, f_{lsb+11 }. . . f_{lsb}, that are set equal to a binary zero. For example, in the embodiment illustrated in FIG. 6, let the bit positions of a fraction field be numbered from 1 to 23, where 1 is the right-most fraction field bit and 23 is left-most fraction field bit, the n-th fraction field low part bit from the right (n=1 , . . . k-1, where k equals the number of fraction field low part bits **240**) is cleared if at least the (n+11)-th fraction field bit or any fraction field bit to the left of the (n+11)-th fraction field bit is equal to a binary one. If neither the (n+11)-th fraction field bit nor any fraction field bit to the left of the (n+11)-th fraction field bit is equal to a binary one, then the n-th fraction field low part bit of the operand **200** is not cleared by the processing circuit **130**.

[0050] More specifically, processing circuit **130** of FIG. 6 includes an array of k-1 AND gates. In the present embodiment, k equals 12. However, as discussed above, in alternate embodiments, k may be greater than or less than 12. The n-th AND gate from the right outputs the resulting n-th fraction field low part bit from the right (n=1, 2, . . . , k-1). The n-th AND gate receives as a first input the n-th fraction field low part bit from the right. The second input to the n-th AND gate is a negated signal produced by the array of OR gates that (1) equals a binary one if neither the (n+11)-th fraction field bit nor any fraction field bit to the left of the (n+11)-th fraction field bit equals a binary one or (2) equals a binary zero if at least the (n+11)-th fraction field bit or any fraction field bit to the left of the (n+11)-th fraction field bit equals a binary one. Therefore, the n-th AND gate clears the n-th fraction field low part bit from the right if at least the (n+11)-th fraction field bit or any fraction field bit to the left of the (n+11)-th fraction field bit equals a binary one. Otherwise, the n-th AND gate outputs the n-th fraction field low part bit as the resulting n-th fraction field low part bit if neither the (n+11)-th fraction field bit nor any fraction field bit to the left of the (n+11)-th fraction field bit equals a binary one.

[0051] The most significant resulting fraction field low part bit equals the most significant fraction field low part bit, f_{lsb+11}, of the operand **200**. The processing circuit **130** adaptively clears the fraction field low part bits **240** of the operand **200** stored in operand buffer **110** because the number of bits cleared changes based on the fraction field high part bits **230** received by the processing circuit **130**.

[0052]FIG. 7 illustrates an exemplary embodiment of the result generator **140**. The result generator **140** receives the signals from the operand analysis circuit **120**, the signal representative of the sign bit **210**, the signals representative of the exponent field bits **220**, e_{msb }. . . e_{lsb}, of the operand **200**, the signals representative of the fraction field high part bits **230**, f_{msb }. . . f_{lsb+12}, of the operand **200**, the signals representative of the fraction field low part bits **240**, f_{lsb+11 }. . . f_{lsb}, of the operand **200**, and the signals provided by the processing circuit **130**. In response, the result generator **140** assembles a result that is coupled onto a result bus **750**.

[0053] Generally, the result generator **140** passes the signal representative of the sign bit **210** to the result bus **750**. Accordingly, the sign bit of the result may be the same as the sign bit **210** of the operand **200**.

[0054] Multiplexer **710** receives signals representative of the exponent field bits **220**, e_{msb }. . . e_{lsb}, of the operand **200** and signals representative of a bit pattern of all zeros. The multiplexer **710** may be controlled by signals “B” from the operand analysis circuit **120** and may selectively couple one set of signals to the result bus **750**. More specifically, if the signals “B” from the operand analysis circuit **120** indicate that the operand **200** is in an infinity **1250** or overflow **1240** format, the multiplexer **710** may couple the signals representative of the bit pattern of all zeros to the result bus **750** as the exponent field bit of the result. Otherwise, the multiplexer **710** may couple the signals representative of the exponent field bits, e_{msb }. . . e_{lsb}, of the operand **200** to the result bus **750** as the exponent field bits of the result.

[0055] Similarly, multiplexer **720** receives signals representative of the fraction field high part bits, f_{msb }. . . f_{lsb+12}, of the operand **200** and signals representative of a bit pattern of all zeros. The multiplexer **720** may be controlled by signals “B” from the operand analysis circuit **120** and may selectively couple one set of signals to the result bus **170**. More specifically, if the signals from the operand analysis circuit **120** indicate that the operand **200** is an infinity **1250** or overflow **1240** format, the multiplexer **720** may couple the signals representative of the bit pattern of all zeros to the result bus **750** as the fraction field high part bits of the result. Otherwise, the multiplexer **720** may couple the signals representative of the fraction field high part bits **230**, f_{msb }. . . f_{lsb+12}, of the operand **200** to the result bus **750** as the fraction field high part bits of the result.

[0056] The selector **730** receives the signals representative of the fraction field low part bits **240**, f_{lsb+11 }. . . f_{lsb}, of the operand **200**, the signals “D” representing the resulting fraction field low part bits provided by the processing circuit **130**, and signals representative of a bit pattern of all zeros. The selector **730** may be controlled by signals “A” and “C” from the operand analysis circuit **120** and may selectively couple one set of signals to the result bus **750**. More specifically, if the signals from the operand analysis circuit **120** indicate that the operand **200** is in the NaN format **1260**, the selector **730** may couple the signals representative of the fraction field low part bits **240**, f_{lsb+11 }. . . f_{lsb}, of the operand **200** to the result bus **750** as the fraction field low part bits of the result. If the signals from the operand analysis circuit **120** indicate that the operand **200** is a subprecise number, the selector **730** may couple the signals “D” provided by the processing circuit **130** to the result bus **750** as the fraction field low part bits of the result. Otherwise, the selector **730** may couple the signals representative of the bit pattern of all zeros to the result bus **750** as the fraction field low part bits of the result.

[0057] FIGS. **8**-**11** illustrates four exemplary embodiments of the floating point unit **100** with the different embodiments of the operand analysis circuit **120**, the processing circuit **130**, and the result generator **140** combined in various combinations. The floating point unit of FIG. 8 may be used when the floating point operand **200** stored in the operand buffer **110** may be in an zero, underflow, overflow, infinity, or NaN format according to U.S. patent application Ser. No. ______ or in a normalized delimited format according to U.S. Pat. No. 6,131,106. The floating point unit **100** of FIG. 9 may be used when the floating point operand **200** stored in the operand buffer **110** may be in an overflow, infinity, or NaN format according to U.S. patent application Ser. No. ______ or in a denormalized format according to IEEE 754. The floating point unit of FIG. 10 may be used when the floating point operand **200** stored in the operand buffer **110** may be represented according to IEEE Std. 754 or in a normalized delimited format according to U.S. Pat. No. 6,131,106. The floating point unit of FIG. 11 may be used when the floating point operand **200** stored in the operand buffer **110** may be represented according to IEEE Std. 754 including the denormalized format according to IEEE 754.

[0058] In summary, floating point unit **100** may be used to compute the high part of a floating point operand. The sign of the result generated by the floating point unit **100** may be the same as the sign **210** of the floating point operand **200** stored in the operand buffer **110**. If the operand **200** is in a NaN format according to U.S. patent application Ser. No. ______ or IEEE Std. 754, then the result generated by the floating point unit **100** may be the same NaN format (i.e., no bits are cleared). If the operand **200** is in an infinity format according to U.S. patent application Ser. No. ______ or IEEE Std. 754 or an overflow format **1240**, then the result generated by the floating point unit **100** may be a binary zero with the same sign as the operand **200**. If the operand **200** is in a zero format according to U.S. patent application Ser. No. ______ or IEEE Std. 754, then the result generated by the floating point unit **100** may be in a zero format with the same sign as the operand **200**. If the operand **200** is a subprecise number, then the sign bit, the exponent field bits, and the fraction field high part bits of the result may be the same as the sign bit **210**, the exponent field bits **220**, and the fraction field high part bits **230** of the of the operand **200**, respectively. The resulting fraction field low part bits are adaptively determined based on the fraction field low part bits **240** and/or the fraction field high part bits **230** of the operand **200**. If the operand **200** is in any other format, then the sign bit, the exponent field bits, and the fraction field high part bits of the result may be the same as the sign bit **210**, the exponent field bits **220**, and the fraction field high part bits **230** of the operand **200**, respectively. The resulting fraction field low part bits may be cleared.

[0059] An embodiment of the present invention produces a zero result when the operand is in an infinity or overflow format. Accordingly, when computing the low part of an operand that is in an infinity or overflow format by subtracting the high part of the operand from the operand, the result is not in a NaN format. Further, an embodiment of the present invention produces a result equal to the operand when the operand is in a NaN format, thereby preserving useful status information stored in the operand. Further, when computing the low part of an operand that is in the NaN format by subtracting the high part of the operand from the operand, the result is in the NaN format, if the subtraction operation is performed according to the IEEE Std. 754. Finally, an embodiment of the present invention receives a floating point operand from an operand buffer **110** and computes the high part of the floating point operand without storing the floating point operand in additional memory as part of the process to compute the high part of the operand.

[0060] The above description of the floating point unit **100** assumes a 32-bit floating point operand **200**. However, the floating point unit **100** may be adapted to receive a floating point operand having any number of bits. For example, the floating point unit **100** may be adapted to receive a 64-bit floating-point operand with 52 fraction field bits. Adapting the floating point unit **100** to receive a floating point operand having any number of bits is known to those skilled in the art.

[0061] Further, the above description of the floating point unit **100** assumed that the floating point operands are represented in a number base of two. However, the floating point unit **100** may be adapted for floating point operands represented in number bases other than base two, using, for example, decimal digits or hexadecimal (base 16) digits rather than binary bits. Adapting the floating point unit **100** to receive floating point operands represented in other number bases will be obvious to those of ordinary skill in the art.

[0062] Still further, the above description of the floating point unit **100** has been limited to operands according to U.S. patent application Ser. No. ______, filed on even date herewith in the name of Guy L. Steele Jr. and entitled “Floating Point System That Represents Status Flag Information Within A Floating Point Operand,” assigned to the assignee of the present application, U.S. Pat. No. 6,131,106, and IEEE Std. 754. However, the floating point unit may be adapted to receive a floating point operand having a different format including having a different bit positions for storing status information. Adapting the floating point unit to receive a floating point operand having a different format will be obvious to those of ordinary skill in the art.

[0063] Finally, the floating point unit **100** and all or part of its functionality may be implemented in software, firmware, hardware, or any combination thereof. For example, the invention may be practiced in an electrical circuit comprising discrete electronic elements, packaged or integrated electronic chips containing logic gates, a circuit utilizing a microprocessor, or on a single chip containing electronic elements or microprocessors. It may also be provided using other technologies capable of performing logical operations such as, for example, AND, OR, and NOT, including but not limited to mechanical, optical, fluidic, and quantum technologies. Any program may in whole or in part comprise part of or be stored on the system in a conventional manner, or it may in whole or in part be provided in to the system over a network or other mechanism for transferring information in a conventional manner. In addition, it will be appreciated that the system may be operated and/or otherwise controlled by means of information provided by an operator using operator input elements which may be connected directly to the system or which may transfer the information to the system over a network or other mechanism for transferring information in a conventional manner.

[0064] Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. For example, the floating point unit **100** may be implemented in software, firmware, hardware, or any combination thereof. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.

Patent Citations

Cited Patent | Filing date | Publication date | Applicant | Title |
---|---|---|---|---|

US2151733 | May 4, 1936 | Mar 28, 1939 | American Box Board Co | Container |

CH283612A * | Title not available | |||

FR1392029A * | Title not available | |||

FR2166276A1 * | Title not available | |||

GB533718A | Title not available |

Classifications

U.S. Classification | 708/495, 712/E09.079, 712/E09.06, 712/E09.02, 712/E09.071 |

International Classification | G06F7/57, G06F9/30, G06F9/38, G06F9/32, G06F5/01, G06F7/552, G06F7/52 |

Cooperative Classification | G06F9/3885, G06F9/30014, G06F9/30094, G06F9/3861, G06F7/4873, G06F7/552, G06F7/483, G06F5/012, G06F9/30021, G06F5/015, G06F7/49905, G06F7/4876 |

European Classification | G06F9/30B, G06F9/30A1A, G06F9/30A1C, G06F9/38S, G06F7/483, G06F5/01F, G06F7/487C, G06F7/552, G06F9/38H |

Legal Events

Date | Code | Event | Description |
---|---|---|---|

Dec 28, 2001 | AS | Assignment | Owner name: SUN MICROSYSTEMS, INC., CALIFORNIA Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:STEELE, GUY L. JR.;REEL/FRAME:012442/0997 Effective date: 20011228 |

May 13, 2009 | FPAY | Fee payment | Year of fee payment: 4 |

Mar 8, 2013 | FPAY | Fee payment | Year of fee payment: 8 |

Rotate