Coverting a number from a first base to a second base
AssigneeIntel Corporation
InventorMarius A. Cornea-Hasegan
Life of this patent
Estimating the term…
Abstract
A machine-implemented method converts a number from a first base to a second base. Each one of a first group of machine operation computes a product whose factors include the number in the first base, and a previously calculated approximation to a respective negative power of the second base. A second group of machine operations are performed, each one using results of the first operations, to obtain further results. A respective one or more digits of the number in the second base is also determined, using each of these further results. Other embodiments are also described and claimed.
Claims22
A machine-implemented method for converting a number from a first base to a second base, comprising:
- performing a first plurality of machine operations where in each one a product is computed whose factors include the number in the first base and a previously calculated approximation by a computer to a respective negative power of the second base;
- performing a second plurality machine operations using results of the first operations by the computer to obtain a plurality of further results;
- and
- determining a respective one or more digits of the number in the second base by the computer using each of the further results.
A processor comprising:
- a plurality of instruction execution units of a processor, which include
- a multiply unit having an operand input to receive a number in a first base and another operand input to receive a constant;
- a truncation unit having an operand input coupled to a result output of the multiply unit;
- and
- a multiply-add unit having an operand input coupled to receive a result from the truncation unit, another operand input coupled to receive another result from the truncation unit, and yet another operand input to receive another constant, wherein an output of the multiply-add unit represents one or more digits of the number in a second base.
An article of manufacture comprising:
- a machine-accessible storage medium having stored therein data that when accessed by a processor
- converts a binary number into its decimal representation by multiplying each of a plurality of constants by the binary number, where each constant approximates ten taken to a different negative power,
- computes a plurality of lookup table index values each from an arithmetic operation involving a respective pair of results of said multiplications, and
- for each value obtains a plurality of digits, using a lookup table, that are those of the decimal representation.
A machine-implemented method for converting a number in a first base to a second base, comprising:
- calculating in parallel a plurality of first quantities including, for each quantity, multiplying by a computer a number in a first base by a respective constant;
- truncating to an integer by the computer each of the plurality of first quantities;
- calculating in parallel a plurality of second quantities including, for each quantity, computing by the computer a linear combination of two of the first quantities;
- and
- using each of the second quantities to obtain by the computer a respective one or more digits of the number in the second base.
Dependencies are inferred from the claim text.