# US 2012/0259904 A1 · Floating point format converter

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2012/0259904 A1
- Document ID: US20120259904A1
- Status: Published application
- Kind: A1
- Application number: 13/080,883
- Filed: 2011-04-06
- Published: 2012-10-11
- Earliest claimed: 2011-04-06
- Assignees: Kodak Alaris Inc.
- Inventors: David W. Bishop
- Web page: https://patentgrep.com/patent/US20120259904A1

## CPC

- H03M 7/02: Conversion to or from weighted codes, i.e. the weight given to a digit depending on the position of the digit within the block or code word
- H03M: CODING; DECODING; CODE CONVERSION IN GENERAL (using fluidic means F15C4/00; optical analogue/digital converters G02F7/00; coding, decoding or code conversion, specially adapted for particular applications, see the relevant subclasses, e.g. G01D, G01R, G06F, G06T, G09G, G10L, G11B, G11C, H04B, H04L, H04M, H04N; ciphering or deciphering for cryptography or other purposes involving the need for secrecy G09C)

## Abstract

A computer program product for converting from a first floating point format to a second floating point format, each floating point format having an associated base value and being represented by a significand value and a exponent value, comprising an executable algorithm to perform the steps of: determining the second exponent value by multiplying the first exponent value by a predefined constant and taking the integer portion of the result, the predefined constant being substantially equivalent to the logarithm of the first base value divided by the logarithm of the second base value; determining a bias value substantially equivalent to the second base value raised to the second exponent value divided by the first base value raised to the first exponent value; and determining the second significand value by multiplying the first significand value by the bias value.

## Claims

### Claim 1

A computer program product for converting a first floating point number represented in a first floating point format to an equivalent second floating point number in a second floating point format, the first floating point format having an associated first base value and being represented by a first significand value and a first exponent value, and the second floating point format having an associated second base value different from the first base value and being represented by a second significand value and a second exponent value, wherein either the first base value or the second base value is an integer power of two, and the other base value is not an integer power of two, comprising a non-transitory tangible computer readable storage medium storing an executable algorithm for causing a data processing system to perform the steps of:
determining the second exponent value for the second floating point number by multiplying the first exponent value by a predefined constant and taking the integer portion of the result, the predefined constant being substantially equivalent to the logarithm of the first base value divided by the logarithm of the second base value;
determining a bias value that is substantially equivalent to the first base value raised to the first exponent value divided by the second base value raised to the second exponent value wherein the determination of the bias value includes:
determining an intermediate bias value by addressing a look-up table with the exponent value corresponding to the base that is not an integer power of two; and
determining the bias value by applying a binary shift operation to the intermediate bias value, wherein a magnitude of the binary shift is determined responsive to the exponent value corresponding to the base that is an integer power of two; and
determining the second significand value for the second floating point number by multiplying the first significand value by the bias value.

### Claim 2 (depends on 1)

The computer program product of claim 1 wherein the binary shift operation is applied using a shift register.

### Claim 3 (depends on 1)

The computer program product of claim 1 wherein the first floating point format is a binary floating point format having a first base value of two and the second floating point format is a decimal floating point format having a second base value of ten.

### Claim 4 (depends on 3)

The computer program product of claim 3 wherein the binary floating point format is an IEEE 754-2008 binary floating point format and the decimal floating point format is an IEEE 754-2008 decimal floating point format.

### Claim 5 (depends on 1)

The computer program product of claim 1 wherein the first floating point format is a decimal floating point format having a first base value of ten and the second floating point format is a binary floating point format having a second base value of two.

### Claim 6 (depends on 5)

The computer program product of claim 5 wherein the binary floating point format is an IEEE 754-2008 binary floating point format and the decimal floating point format is an IEEE 754-2008 decimal floating point format.

### Claim 7 (depends on 1)

The computer program product of claim 1 wherein the first floating point format further includes a first sign value and the second floating point format further includes a second sign value, and wherein the second sign value is set to be equal to the first sign value.

### Claim 8 (depends on 1)

The computer program product of claim 1 further including performing a normalization process to the second floating point number, where the normalization process includes:
multiplying or dividing the second significand value by a scale value equal to the second base value raised to an integer power to provide a modified second significand value, wherein the modified second significand value falls within a specified range; and
decrementing or incrementing the second exponent value by a corresponding value equal to the integer power to provide a modified second exponent value.

### Claim 9 (depends on 1)

The computer program product of claim 1 wherein the first floating point format has an associated first binary encoding including a first set of exponent bits representing the first exponent value and a first set of significand bits representing the first significand value, and further including determining the first exponent value and the first significand value by decoding the first set of exponent bits and the first set of significand bits, respectively.

### Claim 10 (depends on 1)

The computer program product of claim 1 wherein the second floating point format has an associated second binary encoding including a second set of exponent bits representing the second exponent value and a second set of significand bits representing the second significand value, and further including performing an encoding process to determine the second set of significand bits and the second set of exponent bits needed to represent the second significand value and the second exponent value, respectively.

### Claim 11 (depends on 1)

The computer program product of claim 1 wherein the base value that is an integer power of two is equal to two so that the corresponding floating point number is a binary floating point number, wherein the base value that is not an integer power of two is equal to ten so that the corresponding floating point number is a decimal floating point number.

### Claim 12 (depends on 1)

The computer program product of claim 1 wherein the non-transitory tangible computer readable storage medium is a component of a hardware floating-point unit.

### Claim 13

A computer program product for converting a binary floating point number represented in a binary floating point format to an equivalent decimal floating point number in a decimal floating point format, the binary floating point format having an associated first base value of two and being represented by a first significand value and a first exponent value, and the decimal floating point format having an associated second base value of ten and being represented by a second significand value and a second exponent value, comprising a non-transitory tangible computer readable storage medium storing an executable algorithm for causing a data processing system to perform the steps of:
determining the second exponent value for the decimal floating point number by multiplying the first exponent value by a predefined constant and taking the integer portion of the result, the predefined constant being substantially equivalent to the logarithm of two divided by the logarithm of ten;
determining a bias value that is substantially equivalent to two raised to the first exponent value divided by ten raised to the second exponent value, wherein the determination of the bias value includes:
determining an intermediate bias value by addressing a look-up table with the second exponent value; and
determining the bias value by applying a binary shift operation to the intermediate bias value, wherein a magnitude of the binary shift is determined responsive to the first exponent value; and
determining the second significand value for the second floating point number by multiplying the first significand value by the bias value.

### Claim 14 (depends on 12)

The computer program product of claim 12 wherein the look-up table stores representations of the intermediate bias values for a range of different possible second exponent values, and wherein the intermediate bias values are determined by:
bias1[E2]=10−E2
where E2 is the second exponent value and biasi[E2] is the intermediate bias value.

### Claim 15 (depends on 13)

The computer program product of claim 13 wherein the magnitude of the binary shift includes a term equal to the first exponent value.

### Claim 16 (depends on 13)

The computer program product of claim 13 wherein the stored representations of the intermediate bias values includes a fixed point number and a shift value, and wherein the magnitude of the binary shift includes a term equal to the shift value.

### Claim 17 (depends on 12)

The computer program product of claim 12 wherein the determination of the magnitude of the binary shift is also responsive to the second exponent value.

### Claim 18 (depends on 12)

The computer program product of claim 12 wherein the look-up table stores representations of the intermediate bias values for a range of different possible second exponent values, and wherein the intermediate bias values are determined by:
bias
i

[
E
2
]
=
2
Int

[
E
2

log
2

10
]
10
E
2
where E2 is the second exponent value and biasi[E2] is the intermediate bias value.

### Claim 19 (depends on 17)

The computer program product of claim 17 wherein the determination of the magnitude of the binary shift is given by:
ΔE1=E1−Int[E2 log210]
where E1 is the first exponent value, E2 is the second exponent value, and ΔE1 is the magnitude of the binary shift.

### Claim 20 (depends on 12)

The computer program product of claim 12 wherein the non-transitory tangible computer readable storage medium is a component of a hardware floating-point unit.

### Claim 21

A floating-point unit including a floating point format converter for converting a binary floating point number represented in a binary floating point format to an equivalent decimal floating point number in a decimal floating point format, the binary floating point format having an associated first base value of two and being represented by a first significand value and a first exponent value, and the decimal floating point format having an associated second base value of ten and being represented by a second significand value and a second exponent value, comprising:
a multiplier for determining the second exponent value for the decimal floating point number by multiplying the first exponent value by a predefined constant and taking the integer portion of the result, the predefined constant being substantially equivalent to the logarithm of two divided by the logarithm of ten;
a look-up table unit for determining an intermediate bias value by addressing an intermediate bias look-up table with the second exponent value;
a shift register for determining a bias value by applying a binary shift operation to the intermediate bias value, the magnitude of the binary shift being determined responsive to the first exponent value, wherein the determined bias value is substantially equivalent to two raised to the first exponent value divided by ten raised to the second exponent value; and
a multiplier for determining the second significand value for the second floating point number by multiplying the first significand value by the bias value.

### Claim 22 (depends on 20)

The floating-point unit of claim 20 further including a normalization unit for applying a normalization process to the second floating point number, where the normalization process includes:
a multiplier or divider for multiplying or dividing the second significand value by a scale value equal to the second base value raised to an integer power to provide a modified second significand value, wherein the modified second significand value falls within a specified range; and
a signed adder for decrementing or incrementing the second exponent value by a corresponding value equal to the integer power to provide a modified second exponent value.

### Claim 23 (depends on 20)

The floating-point unit of claim 20 wherein the first floating point format has an associated first binary encoding including a set of first exponent bits representing the first exponent value and a first set of significand bits representing the first significand value, and further including a decoding unit for applying a decoding process to determine the first exponent value and the first significand value by decoding the first set of exponent bits and the first set of significand bits, respectively.

### Claim 24 (depends on 20)

The floating-point unit of claim 20 wherein the second floating point format has an associated second binary encoding including a second set of exponent bits representing the second exponent value and a second set of significand bits representing the second significand value, and further including an encoding unit for applying an encoding process to determine the second set of significand bits and the second set of exponent bits needed to represent the second significand value and the second exponent value, respectively.

### Claim 25 (depends on 20)

The floating-point unit of claim 20 further including a reverse floating point format converter for converting a decimal floating point number represented in the decimal floating point format to an equivalent binary floating point number in the binary floating point format, wherein the reverse floating point format converter includes a look-up table unit for determining a bias value by addressing the intermediate bias look-up table associated with the floating point format converter using a negative of the exponent value for the decimal floating point number.
