Emulation of a fixed point operation using a corresponding floating point operation
First Claim
1. A method implemented in a set of instructions executable by a computer that supports floating-point arithmetic operations, the method comprising:
- receiving at least one operand represented in fixed-point representation (hereinafter “
fixed-point operand”
), said fixed-point operand having at least one property selected from a group consisting of (signedness, precision, complexness);
expanding said fixed-point operand into a floating-point representation to obtain a floating-point equivalent;
receiving an instruction comprising an operation to be performed on the fixed-point operand;
performing on the floating-point equivalent, at least one floating-point operation that corresponds to the fixed-point operation, yielding at least one floating-point result; and
reducing, based on a value of said at least one property, said at least one floating-point result generated by the floating-point operation into a corresponding fixed-point result.
4 Assignments
0 Petitions
Accused Products
Abstract
A computer is programmed to emulate a fixed-point operation that is normally performed on fixed-point operands, by use of a floating-point operation that is normally performed on floating-point operands. Several embodiments of the just-described computer emulate a fixed-point operation by: expanding at least one fixed-point operand into a floating-point representation (also called “floating-point equivalent”), performing, on the floating-point equivalent, a floating-point operation that corresponds to the fixed-point operation, and reducing a floating-point result into a fixed-point result. The just-described fixed-point result may have the same representation as the fixed-point operand(s) and/or any user-specified fixed-point representation, depending on the embodiment. Also depending on the embodiment, the operands and the result may be either real or complex, and may be either scalar or vector. The above-described emulation may be performed either with an interpreter or with a compiler, depending on the embodiment. A conventional interpreter for an object-oriented language (such as MATLAB version 6) may be extended with a toolbox to perform the emulation. Use of type propagation and operator overloading minimizes the number of changes that a user must make to their program, in order to be able to use such emulation.
-
Citations
52 Claims
-
1. A method implemented in a set of instructions executable by a computer that supports floating-point arithmetic operations, the method comprising:
-
receiving at least one operand represented in fixed-point representation (hereinafter “
fixed-point operand”
), said fixed-point operand having at least one property selected from a group consisting of (signedness, precision, complexness);
expanding said fixed-point operand into a floating-point representation to obtain a floating-point equivalent;
receiving an instruction comprising an operation to be performed on the fixed-point operand;
performing on the floating-point equivalent, at least one floating-point operation that corresponds to the fixed-point operation, yielding at least one floating-point result; and
reducing, based on a value of said at least one property, said at least one floating-point result generated by the floating-point operation into a corresponding fixed-point result. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30)
-
-
31. A method for using a first program comprising floating-point arithmetic operations to simulate a second program that uses fixed-point arithmetic operations, the method comprising:
-
a person inserting in the first program an indicator of fixed-point type for each variable that is to be treated as a fixed-point operand while keeping intact any instructions comprising said fixed-point operand, to obtain the second program; and
a computer emulating each fixed-point arithmetic operation using a corresponding floating-point arithmetic operation during execution of the second program. - View Dependent Claims (32, 33, 34)
-
-
35. A computer that supports floating-point arithmetic, the computer comprising:
-
means (hereinafter “
receiving means”
) for receiving an indication that an operand is to be expressed in a fixed-point representation (hereinafter “
fixed-point operand”
) and for receiving a fixed-point arithmetic operation to be performed on at least the fixed-point operand;
means, coupled to the receiving means, for expanding the fixed-point operand into a floating-point representation (hereinafter “
floating-point equivalent”
) and for storing a position of a binary point of the fixed-point operand; and
means for performing on the floating-point equivalent a floating-point arithmetic operation that corresponds to the fixed-point arithmetic operation. - View Dependent Claims (36, 37)
-
-
38. A method of writing a computer program, the method comprising:
-
making a function call to identify a variable as being of fixed-point type; and
using the variable in a statement without making another function call to identify the fixed-point type of the variable. - View Dependent Claims (39)
-
-
40. A method implemented in a set of instructions executable by a computer (hereinafter “
- execution-level language”
)that supports floating-point arithmetic operations, the method comprising;
receiving at least one operand represented in fixed-point representation (hereinafter “
fixed-point operand”
), said fixed-point operand having at least one property selected from a group consisting of (signedness, precision, complexness);
expanding said fixed-point operand into a floating-point representation to obtain a floating-point equivalent;
receiving an instruction comprising a fixed-point operation to be performed on the fixed-point operand;
performing on the floating-point equivalent, at least one floating-point operation that corresponds to the fixed-point operation, yielding at least one floating-point result; and
reducing said at least one floating-point result generated by the floating-point operation into a corresponding fixed-point result;
wherein if the fixed-point operation is specified as saturation arithmetic and if said floating-point result is a vector or array, said act of reducing comprises;
setting a maximum value and a minimum value for a fixed-point result to be obtained from reducing the floating-point result generated by the floating-point operation, based on the precision and signedness of at least said fixed-point operand;
replacing any negative numbers in the floating-point result with zero;
replacing any numbers in the floating-point result that are greater than the maximum value with the maximum value;
replacing any numbers in the floating-point result that are less than the minimum value with the minimum value. - View Dependent Claims (41)
- execution-level language”
-
42. A method implemented in a set of instructions executable by a computer that supports floating-point arithmetic operations, the method comprising:
-
receiving at least one operand represented in fixed-point representation (hereinafter “
fixed-point operand”
);
expanding said fixed-point operand into a floating-point representation to obtain a floating-point equivalent;
receiving an instruction to be performed on the fixed-point operand;
performing on the floating-point equivalent, at least one floating-point operation that corresponds to the fixed-point operation, yielding at least one floating-point result; and
reducing, based on kind of said instruction received, said at least one floating-point result generated by the floating-point operation into a corresponding fixed-point result. - View Dependent Claims (43)
-
-
44. A memory encoded with a plurality of objects, each object representing at least one fixed-point number, each object being encoded in a plurality of locations comprising:
-
a first location being encoded with a value of a signedness property of said fixed-point number;
a second location being encoded with a value of a complexness property of said fixed-point number;
a plurality of locations being encoded with values of subproperties of a precision property of said fixed-point number;
at least one location being encoded with a floating-point value of said fixed-point number. - View Dependent Claims (45, 46, 47, 48, 49, 50, 51)
-
-
52. A computer that supports floating-point arithmetic, the computer comprising:
-
means (hereinafter “
receiving means”
) for receiving at least one operand represented in fixed-point representation (hereinafter “
fixed-point operand”
), said fixed-point operand having at least one property selected from a group consisting of (signedness, precision, complexness);
means, coupled to said receiving means, for expanding said fixed-point operand into a floating-point representation to obtain a floating-point equivalent;
means for receiving an instruction comprising a fixed-point operation to be performed on the fixed-point operand;
means for performing on the floating-point equivalent, at least one floating-point operation that corresponds to the fixed-point operation, yielding at least one floating-point result;
means for reducing said at least one floating-point result generated by the floating-point operation into a corresponding fixed-point result; and
memory, coupled to each of said means, said memory being encoded with a plurality of objects, at least one object representing at least said fixed-point operand, said object being encoded in a plurality of locations comprising;
a first location being encoded with a value of a signedness property of said fixed-point operand;
a second location being encoded with a value of a complexness property of said fixed-point operand;
a plurality of locations being encoded with values of subproperties of a precision property of said fixed-point operand; and
at least one location being encoded with a floating-point value of said fixed-point operand.
-
Specification