Floating point to logarithm converter
AssigneeTexas Instruments Incorporated
InventorKeith E. Larson
Life of this patent
Estimating the term…
Abstract
A method converts an n-bit floating point number to a logarithmic representation, the number having a first set of bits assigned to a mantissa, and a second set of bits assigned to an exponent. The logarithmic representation has a characteristic and a fraction. The method: (a) sets the characteristic of the logarithm equal to the second set of bits; (b) selects from a logarithm table a first logarithm of a first subset of the first set; (c) selects from the logarithm table a slope of a logarithmic function at the first logarithm; (d) multiplies the slope times a second subset of the first set to obtain an interpolated value; (e) adds the interpolated value to the first logarithm to obtain the fraction; and (f) adds the characteristic and the fraction to obtain the logarithmic representation.
Claims26
A method for converting an n-bit floating point number to a logarithmic representation with a digital processor, the number having a first set of bits assigned to a mantissa, and a second set of bits assigned to an exponent, the logarithmic representation having a characteristic and a fraction, comprising the steps of:
- a. setting the characteristic of the logarithm equal to the second set of bits;
- b. selecting from a logarithm table a first logarithm of a first subset of the first set;
- c. selecting from the logarithm table a slope of a logarithmic function at the first logarithm;
- d. multiplying the slope times a second subset of the first set with a multiplier to obtain an interpolated value;
- e. adding the interpolated value to the first logarithm with an adder to obtain the fraction;
- and
- f. adding the characteristic and the fraction to obtain the logarithmic representation.
A method for converting an n-bit floating point number to a logarithmic representation with a digital processor, the number having a first set of bits assigned to a mantissa, and a second set of bits assigned to an exponent, the logarithmic representation having a characteristic and a fraction, comprising the steps of:
- a. setting the characteristic of the logarithm equal to the second set of bits;
- b. selecting from a logarithm table a first logarithm of a first subset of the first set;
- c. calculating a slope of a logarithmic function at the first logarithm, comprising the steps of:
- i. selecting from the logarithm table a value adjacent to the first logarithm;
- and
- ii. calculating the difference between the value and the first logarithm;
- d. multiplying the slope times a second subset of the first set with a multiplier to obtain an interpolated value;
- e. adding the interpolated value to the first logarithm with an adder to obtain the fraction;
- and
- f. adding the characteristic and the fraction to obtain the logarithmic representation.
A method for converting an n-bit floating point number to a logarithmic representation with a digital processor, the number having a first set of bits assigned to a mantissa, and a second set of bits assigned to an exponent, the logarithmic representation having a characteristic and a fraction, comprising the steps of:
- a. setting the characteristic equal to the second set of bits;
- b. selecting from a first look-up table a first logarithm of a third subset of the first set:
- c. selecting from the first look-up table a first slope of a first logarithmic function at the first logarithm;
- d. selecting from the first look-up table a curvature of the first logarithmic function at the first logarithm;
- e. multiplying the first slope times a sum of a fourth and fifth subset of the first set with a multiplier to obtain a first interpolation;
- f. selecting from a second look-up table a seed as a function of a second logarithm of a fourth subset of the first set;
- g. selecting from the second look-up table a second slope of a second logarithmic function at the second logarithm;
- h. multiplying the second slope times a fifth subset of the first set to obtain a second interpolation;
- i. adding the second interpolation to the seed with an adder to obtain an arc;
- j. multiplying the arc by the curvature to obtain a scaled arc;
- k. adding the first interpolation and the scaled arc to the first logarithm to obtain the fraction;
- and
- l. adding the characteristic and the fraction to obtain the logarithmic representation.
A method for converting an n-bit floating point number to a logarithmic representation with a digital processor, the number having a first set of bits assigned to a mantissa, and a second set of bits assigned to an exponent, the logarithmic representation having a characteristic and a fraction, comprising the steps of:
- a. setting the characteristic equal to the second set of bits;
- b. selecting from a first look-up table a first logarithm of a third subset of the first set;
- c. calculating a first slope of a first logarithmic function at the first logarithm, comprising the steps of:
- i. selecting from the first look-up table a value adjacent to the first logarithm;
- and
- ii. calculating the difference between the value and the first logarithm;
- d. selecting from the first look-up table a curvature of the first logarithmic function at the first logarithm;
- e. multiplying the first slope times a sum of a fourth and fifth subset of the first set with a multiplier to obtain a first interpolation;
- f. selecting from a second look-up table a seed as a function of a second logarithm of a fourth subset of the first set;
- g. selecting from the second look-up table a second slope of a second logarithmic function at the second logarithm;
- h. multiplying the second slope times a fifth subset of the first set to obtain a second interpolation;
- i. adding the second interpolation to the seed with an adder to obtain an arc;
- j. multiplying the arc by the curvature to obtain a scaled arc;
- k. adding the first interpolation and the scaled arc to the first logarithm to obtain the fraction;
- and
- l. adding the characteristic and the fraction to obtain the logarithmic representation.
A method for converting an n-bit floating point number to a logarithmic representation with a digital processor, the number having a first set of bits assigned to a mantissa, and a second set of bits assigned to an exponent, the logarithmic representation having a characteristic and a fraction, comprising the steps of:
- a. setting the characteristic equal to the second set of bits;
- b. selecting from a first look-up table a first logarithm of a third subset of the first set;
- c. selecting from the first look-up table a first slope of a first logarithmic function at the first logarithm;
- d. selecting from the first look-up table a curvature of the first logarithmic function at the first logarithm;
- e. multiplying the first slope times a sum of a fourth and fifth subset of the first set with a multiplier to obtain a first interpolation;
- f. selecting from a second look-up table a seed as a function of a second logarithm of a fourth subset of the first set;
- g. calculating a second slope of a second logarithmic function at the second logarithm, comprising the steps of:
- i. selecting from the second look-up table a value adjacent to the second logarithm;
- and
- ii. calculating the difference between the value and the second logarithm;
- h. multiplying the second slope times a fifth subset of the first set to obtain a second interpolation;
- i. adding the second interpolation to the seed with an adder to obtain an arc;
- j. multiplying the arc by the curvature to obtain a scaled arc;
- k. adding the first interpolation and the scaled arc to the first logarithm to obtain the fraction;
- and
- l. adding the characteristic and the fraction to obtain the logarithmic representation.
A method for converting an n-bit floating point number to a logarithmic representation with a digital processor, the number having a first set of bits assigned to a mantissa, and a second set of bits assigned to an exponent, the logarithmic representation having a characteristic and a fraction, comprising the steps of:
- a. setting the characteristic equal to the second set of bits;
- b. selecting from a first look-up table a first logarithm of a third subset of the first set;
- c. selecting from the first look-up table a first slope of a first logarithmic function at the first logarithm;
- d. calculating a second-order derivative of the first logarithm, to obtain a curvature of the first logarithmic function at the first logarithm;
- e. multiplying the first slope times a sum of a fourth and fifth subset of the first set to obtain a first interpolation;
- f. selecting from a second look-up table a seed as a function of a second logarithm of a fourth subset of the first set;
- g. selecting from the second look-up table a second slope of a second logarithmic function at the second logarithm;
- h. multiplying the second slope times a fifth subset of the first set to obtain a second interpolation;
- i. adding the second interpolation to the seed to obtain an arc;
- j. multiplying the arc by the curvature to obtain a scaled arc;
- k. adding the first interpolation and the scaled arc to the first logarithm to obtain the fraction;
- and
- l. adding the characteristic and the fraction to obtain the logarithmic representation.
A method for converting an n-bit floating point number to a logarithmic representation with a digital processor, the number having a first set of bits assigned to a mantissa, and a second set of bits assigned to an exponent, the logarithmic representation having a characteristic and a fraction, comprising the steps of:
- a. setting the characteristic equal to the second set of bits;
- b. selecting from a first look-up table a first logarithm of a third subset of the first set;
- c. calculating a first slope of a first logarithmic function at the first logarithm, comprising the steps of:
- i. selecting from the first look-up table a first value adjacent to the first logarithm;
- and
- ii. calculating the difference between the first value and the first logarithm;
- d. calculating a curvature of the first logarithmic function at the first logarithm, comprising the steps of:
- i. selecting from the first look-up table a second value, wherein the second value is adjacent the first value, and is not the first logarithm;
- ii. calculating the difference between the first value and the second value to obtain a second slope of the first logarithmic function at the first value;
- and
- iii. calculating the difference between the first slope and the second slope;
- e. multiplying the first slope times a sum of a fourth and fifth subset of the first set to obtain a first interpolation;
- f. selecting from a second look-up table a seed as a function of a second logarithm of a fourth subset of the first set;
- g. selecting from the second look-up table a third slope of a second logarithmic function at the second logarithm;
- h. multiplying the third slope times a fifth subset of the first set to obtain a second interpolation;
- i. adding the second interpolation to the seed to obtain an arc;
- j. multiplying the arc by the curvature to obtain a scaled arc;
- k. adding the first interpolation and the scaled arc to the first logarithm to obtain the fraction;
- and
- l. adding the characteristic and the fraction to obtain the logarithmic representation.
A method for converting an n-bit floating point number to a logarithmic representation with a digital processor, the number having a first set of bits assigned to a mantissa, and a second set of bits assigned to an exponent, the logarithmic representation having a characteristic and a fraction, comprising the steps of:
- a. setting the characteristic equal to the second set of bits;
- b. selecting from a first look-up table a first logarithm of a third subset of the first set;
- c. selecting from the first look-up table a first slope of a first logarithmic function at the first logarithm;
- d. selecting from the first look-up table a curvature of the first logarithmic function at the first logarithm;
- e. multiplying the first slope times a sum of a fourth and fifth subset of the first set to obtain a first interpolation;
- f. selecting from a second look-up table a seed as a function of a second logarithm of a fourth subset of the first set;
- g. selecting from the second look-up table a second slope of a second logarithmic function at the second logarithm;
- h. multiplying the second slope times a fifth subset of the first set to obtain a second interpolation;
- i. adding the second interpolation to the seed to obtain an arc;
- j. multiplying the arc by the curvature to obtain a scaled arc;
- k. adding the first interpolation and the scaled arc to the first logarithm to obtain the fraction;
- and
- l. adding the characteristic and the fraction to obtain the logarithmic representation.
An apparatus for converting an n-bit floating point number to a logarithmic representation, the number having a first set of bits assigned to a mantissa, and a second set of bits assigned to an exponent, the logarithmic representation having a characteristic and a fraction, comprising:
- a. a first register for storing the number;
- b. a converter coupled to the first register, the converter responsive to a third subset of the first set for generating a first logarithm of a third subset of the first set and for generating a slope of a logarithmic function at the first logarithm;
- c. a multiplier coupled to the converter and coupled to the first register, the multiplier responsive to a sum of a fourth and fifth subset of the first set and responsive to the slope for generating an interpolated value;
- d. an adder coupled to the converter and coupled to the multiplier, the adder responsive to the interpolated value and responsive to the first logarithm for generating the fraction;
- and
- e. a second register coupled to the first register and coupled to the adder, for receiving the second set of bits in a first part and for receiving the fraction in a second part, wherein the logarithmic representation is a combination of the first and second parts.
An apparatus for converting an n-bit floating point number to a logarithmic representation, the number having a first set of bits assigned to a mantissa, and a second set of bits assigned to an exponent, the logarithmic representation having a characteristic and a fraction, comprising:
- a. a first register for storing the number;
- b. a first converter responsive to a third subset of the first set for generating a first logarithm of a third subset of the first set, for generating a first slope of a logarithmic function at the first logarithm, and for generating a curvature of the first logarithmic function at the first logarithm;
- c. a first multiplier responsive to a sum of a fourth and fifth subset of the first set and responsive to the slope for generating a first interpolation;
- d. a second converter responsive to a fourth subset of the first set for generating a seed as a function of a second logarithm of a fourth subset of the first set, and for generating a second slope of a second logarithmic function at the second logarithm;
- e. a second multiplier responsive to the second slope and to a fifth subset of the first set for generating a second interpolation;
- f. a first adder responsive to the second interpolation and to the seed for generating an arc;
- g. a third multiplier responsive to the arc and to the curvature for generating a scaled arc;
- h. a second adder responsive to the first interpolation and to the scaled arc and to the first logarithm for generating the fraction;
- and
- i. a second register for receiving the second set of bits in a first part and for receiving the fraction in a second part, wherein the logarithmic representation is a combination of the first and second parts.
A system having a high speed digital computation system, the digital computation system comprising an apparatus for converting an n-bit floating point number to a logarithmic representation, the number having a first set of bits assigned to a mantissa, and a second set of bits assigned to an exponent, the logarithmic representation having a characteristic and a fraction, comprising:
- a. a first register for storing the number;
- b. a converter coupled to the first register, the converter responsive to a third subset of the first set for generating a first logarithm of a third subset of the first set and for generating a slope of a logarithmic function at the first logarithm;
- c. a multiplier coupled to the converter and coupled to the first register, the multiplier responsive to a sum of a fourth and fifth subset of the first set and responsive to the slope for generating an interpolated value;
- d. an adder coupled to the converter and coupled to the multiplier, the adder responsive to the interpolated value and responsive to the first logarithm for generating the fraction;
- and
- e. a second register coupled to the first register and coupled to the adder, for receiving the second set of bits in a first part and for receiving the fraction in a second part, wherein the logarithmic representation is a combination of the first and second parts.
A system having a high speed digital computation system, the digital computation system comprising an apparatus for converting an n-bit floating point number to a logarithmic representation, the number having a first set of bits assigned to a mantissa, and a second set of bits assigned to an exponent, the logarithmic representation having a characteristic and a fraction, comprising:
- a. a first register for storing the number;
- b. a first converter responsive to a third subset of the first set for generating a first logarithm of a third subset of the first set, for generating a first slope of a logarithmic function at the first logarithm, and for generating a curvature of the first logarithmic function at the first logarithm;
- c. a first multiplier responsive to a sum of a fourth and fifth subset of the first set and responsive to the slope for generating a first interpolation;
- d. a second converter responsive to a fourth subset of the first set for generating a seed as a function of a second logarithm of a fourth subset of the first set, and for generating a second slope of a second logarithmic function at the second logarithm;
- e. a second multiplier responsive to the second slope and to a fifth subset of the first set for generating a second interpolation;
- f. a first adder responsive to the second interpolation and to the seed for generating an arc;
- g. a third multiplier responsive to the arc and to the curvature for generating a scaled arc;
- h. a second adder responsive to the first interpolation and to the scaled arc and to the first logarithm for generating the fraction;
- and
- i. a second register for receiving the second set of bits in a first part and for receiving the fraction in a second part, wherein the logarithmic representation is a combination of the first and second parts.
Dependencies are inferred from the claim text.