Efficiently determining a floor for a floating-point number
AssigneePasternak Solutions LLC
InventorStephen Clark Purcell
Life of this patent
Estimating the term…
Abstract
An apparatus, method and computer program product for processing a binary floating-point number having a sign bit and a mantissa having a fraction portion. It includes identifying the fraction portion of the binary floating-point number; and replacing each bit of the fraction portion with the sign bit, thereby producing a floor of the binary floating-point number.
Claims60
An apparatus for processing a binary floating-point number having a sign bit, an exponent portion, and a mantissa, the mantissa having a fraction portion, the apparatus comprising:
- a fraction mask table configured to identify the fraction portion of the binary floating-point number based at least on the exponent portion of the binary floating-point number;
- and
- a multiplexer configured to receive the fraction portion identified in the function mask table and operative to replace each constituent bit of the fraction portion with the sign bit, thereby producing a floor of the binary floating-point number.
A apparatus for determining the floating-point floor of a floating-point number, the apparatus comprising:
- means for identifying a binary floating-point number including a sign bit, exponent bits, and mantissa bits, wherein the binary floating-point number is negative when the sign bit is a one (“1”);
- means for concatenating an implicit bit and the mantissa bits, thereby producing a first binary number such that the implicit bit is the most significant bit (MSB) of the first binary number;
- a decrementer configured to decrement the first binary number when the sign bit is a one (“1”) and do nothing when the sign bit is a zero (“0”), thereby producing a second binary number;
- a fraction mask table configured to identify a fraction portion of the second binary number based at least on the exponent bits;
- a multiplexer operative to receive the fraction portion from the fraction mask table and configured to replace each bit of the fraction portion with the sign bit thereby producing a third binary number;
- an exclusive-OR configured to perform an exclusive-OR operation between each bit of the third binary number and the sign bit thereby producing a fourth binary number;
- means for concatenating the sign bit, the fourth binary number, and a first predetermined number of zeros, thereby producing a fifth binary number such that the sign bit is the MSB of the fifth binary number, and the zeros are the least significant bits of the fifth binary number;
- and
- a signed-right-shift configured to perform, upon the fifth binary number, a signed-right-shift operation by a number of bits equivalent to the difference between the exponent and a second predetermined number, thereby producing the floor of the binary floating-point number in integer format.
A method for processing a binary floating-point number having a sign bit, an exponent, and a mantissa, the mantissa comprising a fraction portion, the method comprising:
- identifying the fraction portion of the binary floating-point number based at least on the exponent;
- and
- replacing each bit of the fraction portion with the sign bit, thereby producing a floor of the binary floating-point number.
A method for determining the floating-point floor of a floating-point number, the method comprising:
- identifying a binary floating-point number including a sign bit, exponent bits, and mantissa bits, wherein the binary floating-point number is negative when the sign bit is a one (“1”);
- concatenating an implicit bit and the mantissa bits, thereby producing a first binary number such that the implicit bit is the most significant bit (MSB) of the first binary number;
- decrementing the first binary number when the sign bit is a one (“1”) and doing nothing when the sign bit is a zero (“0”), thereby producing a second binary number;
- identifying a fraction portion of the second binary number based at least on the exponent bits;
- replacing each bit of the fraction portion with the sign bit thereby producing a third binary number;
- performing an exclusive-OR operation between each bit of the third binary number and the sign bit thereby producing a fourth binary number;
- concatenating the sign bit, the fourth binary number, and a first predetermined number of zeros, thereby producing a fifth binary number such that the sign bit is the MSB of the fifth binary number, and the zeros are the least significant bits of the fifth binary number;
- and
- performing, upon the fifth binary number, a signed-right-shift operation by a number of bits equivalent to the difference between the exponent and a second predetermined number, thereby producing the floor of the binary floating-point number in integer format.
A computer program product, tangibly stored on a computer-readable medium, for processing a binary floating-point number having a sign bit, an exponent and a mantissa, the mantissa comprising a fraction portion, the computer program product comprising instructions operable to cause a programmable processor to:
- identify the fraction portion of the binary floating-point number based at least on the exponent;
- and
- replace each bit of the fraction portion with the sign bit, thereby producing a floor of the binary floating-point number.
A computer program product, tangibly stored on a computer-readable
- medium, for determining the floating-point floor of a floating-point number, comprising instructions operable to cause a programmable processor to:
- identify a binary floating-point number including a sign bit, exponent bits, and mantissa bits, wherein the binary floating-point number is negative when the sign bit is a one (“1”);
- concatenate an implicit bit and the mantissa bits, thereby producing a first binary number such that the implicit bit is the most significant bit (MSB) of the first binary number;
- decrement the first binary number when the sign bit is a one (“1”) and doing nothing when the sign bit is a zero (“0”), thereby producing a second binary number;
- identify a fraction portion of the second binary number based at least on the exponent bits;
- replace each bit of the fraction portion with the sign bit thereby producing a third binary number;
- perform an exclusive-OR operation between each bit of the third binary number and the sign bit thereby producing a four binary number;
- concatenate the sign bit, the fourth binary number, and a first predetermined number of zeros, thereby producing a fifth binary number such that the sign bit is the MSB of the
- fifth binary number, and the zeros are the least significant bits of the fifth binary number;
- and
- perform, upon the fifth binary number, a signed-right-shift operation by a number of bits equivalent to the difference between the exponent and a second predetermined number, thereby producing the floor of the binary floating-point number in integer format.
Dependencies are inferred from the claim text.