Emulation of a fixed point operation using a corresponding floating point operation
First Claim
1. In a computer comprising a memory and a floating point unit, a method implemented in a set of instructions executable by said computer, the method comprising:
- said computer receiving a program, a portion of said program comprising an operand (hereinafter “
fixed-point operand”
) represented in a fixed-point representation;
wherein said fixed-point operand has at least one property selected from a group consisting of (signedness, precision, complexness);
said computer expanding said fixed-point operand into a floating-point representation to obtain a floating-point equivalent;
said computer storing a precision of the fixed-point operand;
said computer further receiving in said portion an instruction comprising an operation to be performed on the fixed-point operand by a fixed point processor;
said computer using said floating point unit to perform 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;
said computer reducing said at least one floating-point result generated by the floating-point operation into a fixed-point result;
said computer using the stored precision during reduction of the floating-point result into the fixed-point result; and
said computer displaying said fixed-point result to a user to enable said portion of said program to be debugged without use of said fixed point processor.
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
85 Claims
-
1. In a computer comprising a memory and a floating point unit, a method implemented in a set of instructions executable by said computer, the method comprising:
-
said computer receiving a program, a portion of said program comprising an operand (hereinafter “
fixed-point operand”
) represented in a fixed-point representation;wherein said fixed-point operand has at least one property selected from a group consisting of (signedness, precision, complexness); said computer expanding said fixed-point operand into a floating-point representation to obtain a floating-point equivalent; said computer storing a precision of the fixed-point operand; said computer further receiving in said portion an instruction comprising an operation to be performed on the fixed-point operand by a fixed point processor; said computer using said floating point unit to perform 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; said computer reducing said at least one floating-point result generated by the floating-point operation into a fixed-point result; said computer using the stored precision during reduction of the floating-point result into the fixed-point result; and said computer displaying said fixed-point result to a user to enable said portion of said program to be debugged without use of said fixed point processor. - 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, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43)
-
-
44. A method implemented in a set of instructions executable by a computer that comprises a floating point unit, the method comprising:
-
said computer receiving receiving a program, at least a portion of said program being written for execution on a fixed point processor, said fixed point processor being not available for execution of said program, said portion of said program comprising 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);said computer expanding said fixed-point operand into a floating-point representation to obtain a floating-point equivalent; said computer receiving an instruction comprising an operation to be performed on the fixed-point operand; said computer receiving another instruction that indicates a type of said fixed-point operand; wherein said another instruction comprises a call to a function; said computer using said floating point unit to perform 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; said computer 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 fixed-point result; and said computer displaying the fixed point result and receiving instructions for debugging said portion of said program without use of the fixed point processor. - View Dependent Claims (45, 46, 47, 48, 49, 50)
-
-
51. A method implemented in a set of instructions executable by a computer that comprises a floating point unit, the method comprising:
-
said computer receiving receiving a program, at least a portion of said program being written for execution on a fixed point processor, said fixed point processor being not available for execution of said program, said portion of said program comprising at least one operand represented in fixed-point representation (hereinafter “
fixed-point operand”
), said fixed-point representation having a precision identifying a first plurality of bits on a left side of a point and a second plurality of bits on a right side of said point;said computer expanding said fixed-point operand into a floating-point representation to obtain a floating-point equivalent; said computer receiving in said program an instruction comprising an operation to be performed on the fixed-point operand; wherein said instruction comprises overloading of an operator normally used to denote said corresponding floating-point operation; said computer using said floating point unit to perform 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; said computer reducing, based said precision, said at least one floating-point result generated by the floating-point operation into a fixed-point result; and said computer displaying the fixed point result and receiving instructions for debugging said portion of said program without use of the fixed point processor. - View Dependent Claims (52, 53, 54, 55)
-
-
56. In a computer comprising a floating point unit, a method implemented in a set of instructions executable by said computer, the method comprising:
-
said computer receiving at least one operand represented in fixed-point representation (hereinafter “
fixed-point operand”
);said computer expanding said fixed-point operand into a floating-point representation to obtain a floating-point equivalent; said computer receiving an instruction comprising a fixed-point operation to be performed on the fixed-point operand by a fixed point processor; said computer using said floating point unit to perform 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; said computer reducing said at least one floating-point result generated by the floating-point operation into a fixed-point result; and said computer displaying said fixed-point result and receiving instructions to debug a portion of a program comprising said fixed-point operand and said fixed-point operation without use of said fixed-point processor; 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; said computer 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; said computer replacing any negative numbers in the floating-point result with zero; said computer replacing any numbers in the floating-point result that are greater than the maximum value with the maximum value; said computer replacing any numbers in the floating-point result that are less than the minimum value with the minimum value. - View Dependent Claims (57, 58, 59, 60, 61)
-
-
62. A computer-implemented method implemented in a set of instructions, the computer-implemented method comprising:
-
receiving a program, at least a portion of said program being written for execution on a fixed point processor, said fixed point processor being not available for execution of said program, said portion of said program comprising at least one operand representing a real number expressed in fixed-point representation (hereinafter “
fixed-point operand”
), said fixed-point representation having a precision identifying a first plurality of bits on a left side of a point and a second plurality of bits on a right side of said point;said computer expanding said fixed-point operand into a floating-point representation to obtain a floating-point equivalent, said expanding comprising storing in said memory said precision of said fixed-point operand; said computer further receiving in said portion of said program an instruction to be performed on the fixed-point operand; said computer using said floating point unit to perform 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; said computer reducing based on kind of said instruction received, said at least one floating-point result generated by the floating-point operation into a fixed-point result; and said computer displaying said fixed-point result to a programmer to enable said portion of said program to be debugged without use of said fixed point processor. - View Dependent Claims (63)
-
-
64. A computer readable 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 encoded with a value of a signedness property of said fixed-point number; a second location encoded with a value of a complexness property of said fixed-point number; a plurality of location encoded with values of subproperties of a precision property of said fixed-point number; and at least one location encoded with a floating-point value of said fixed-point number; wherein the memory further comprises instructions that cause a computer to operate floating point hardware to use said floating-point value and display a result of said use thereby to help in debugging at least a portion of a program without use of a fixed point processor. - View Dependent Claims (65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76)
-
-
77. 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 encoded with a value of a signedness property of said fixed-point number; a second location encoded with a value of a complexness property of said fixed-point number; a plurality of locations encoded with values of subproperties of a precision property of said fixed-point number; and at least one location encoded with a floating-point value of said fixed-point number; wherein said precision property further comprises a number of bits to the right of said point in the fixed-point umber as another subproperty; wherein the memory further comprises a program written for execution on a fixed point processor, said fixed point processor being not available for execution of said program, said program comprising instructions to; use floating-point hardware on the floating-point value in said at least one location to generate a floating-point result; and display said fixed-point result to a user by use of at least said precision property to enable at least a portion of said program to be debugged without use of said fixed point processor. - View Dependent Claims (78, 79, 80)
-
-
81. A computer that supports floating-point arithmetic, the computer comprising:
-
means (hereinafter “
receiving means”
) for receiving and storing in a memory of said computer a program written for execution on a fixed point processor, said fixed point processor being not available for execution of said program, said program comprising 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; said program in said memory comprising a fixed-point operation to be performed on the fixed-point operand; a floating point unit coupled to the means for expanding to receive therefrom the floating-point equivalent and to generate at least one floating-point result by performance of at least one floating-point operation that corresponds to the fixed-point operation; means for reducing said at least one floating-point result generated by the floating-point operation into a fixed-point result; and means for displaying the fixed-point result and receiving instructions for debugging said program without use of the fixed point processor; wherein said memory is coupled to each of said means and said floating point unit, 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 encode with a value of a signedness property of said fixed-point operand; a second location encode with a value of a complexness property of said fixed-point operand; a group of locations encoded with values of subproperties of a precision property of said fixed-point operand; and at least one location encoded with a floating-point value of said fixed-point operand. - View Dependent Claims (82, 83, 84)
-
-
85. In a computer, a method implemented in a set of instructions executable by said computer, the method comprising:
-
said computer receiving a program, at least a portion of said program being written for execution on a fixed point processor, said fixed point processor being not available for execution of said program, said portion of said program comprising at least one operand representing a real number expressed in fixed-point representation (hereinafter “
fixed-point operand”
), said fixed-point representation having a precision identifying a plurality of first bits of the fixed-point operand on a first side of a point and a plurality of second bits of the fixed-point operand on a second side of the point;said computer adding to said program a sequence of instructions to expand said fixed-point operand into a floating-point representation to obtain a floating-point equivalent, said sequence comprising an instruction to store in said memory said precision of said fixed-point operand; said computer adding said program at least a first instruction to use a floating point unit to perform on the floating-point equivalent, at least one floating-point operation that corresponds to the fixed-point operation, to yield at least one floating-point result; said computer adding to said program at least a second instruction to reduce, based on said precision, said at least one floating-point result generated by the floating-point operation into a fixed-point result; and said computer displaying said fixed-point result and receiving instructions for debugging said program without use of said fixed point processor.
-
Specification