High precision integer division using low precision hardware operations and rounding techniques
First Claim
1. A computer-implemented method for performing integer division between a numerator and a denominator on a processing unit that supports operations using variables of a first bit size, wherein the numerator and the denominator are integers having a second bit size that is greater than the first bit size, the method comprising:
- subdividing the numerator into a plurality of equal sized partitions, wherein each partition has a third bit size;
converting the denominator into a variable of the first bit size;
dividing the numerator by the variable of the first bit size to obtain a current approximation of a current portion of a quotient, wherein the current approximation of the current portion of the quotient has the third bit size;
subtracting a product of the current approximation of the current portion of the quotient and the denominator from the numerator to generate a subsequent numerator, wherein a fourth bit size of most significant bits associated with the subsequent numerator represents a bit overflow error value utilized to correct the first approximation of the first portion of the quotient; and
storing the current approximation of the current portion of the quotient in a memory.
1 Assignment
0 Petitions
Accused Products
Abstract
One or more embodiments of the invention set forth techniques to perform integer division using a floating point hardware unit supporting floating point variables of a certain bit size. The numerator and denominator are integers having a bit size that is greater than the bit size of the floating point variables supported by the floating point hardware unit. Error correcting techniques are utilized to account for any loss of precision caused by the floating point operations.
28 Citations
20 Claims
-
1. A computer-implemented method for performing integer division between a numerator and a denominator on a processing unit that supports operations using variables of a first bit size, wherein the numerator and the denominator are integers having a second bit size that is greater than the first bit size, the method comprising:
-
subdividing the numerator into a plurality of equal sized partitions, wherein each partition has a third bit size; converting the denominator into a variable of the first bit size; dividing the numerator by the variable of the first bit size to obtain a current approximation of a current portion of a quotient, wherein the current approximation of the current portion of the quotient has the third bit size; subtracting a product of the current approximation of the current portion of the quotient and the denominator from the numerator to generate a subsequent numerator, wherein a fourth bit size of most significant bits associated with the subsequent numerator represents a bit overflow error value utilized to correct the first approximation of the first portion of the quotient; and storing the current approximation of the current portion of the quotient in a memory. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A non-transitory computer-readable medium including instructions that, when executed by a processing unit that supports operations using variables of a first bit size, causes the processing unit to perform integer division between a numerator and a denominator, wherein the numerator and the denominator are integers having a second bit size that is greater than the first bit size, by performing the steps of:
-
subdividing the numerator into a plurality of equal sized partitions, wherein each partition has a third bit size; converting the denominator into a variable of the first bit size; dividing the numerator by the variable of the first bit size to obtain a current approximation of a current portion of a quotient, wherein the current approximation of the current portion of the quotient has the third bit size; subtracting a product of the current approximation of the current portion of the quotient and the denominator from the numerator to generate a subsequent numerator, wherein a fourth bit size of most significant bits associated with the subsequent numerator represents a bit overflow error value utilized to correct the first approximation of the first portion of the quotient; and storing the current approximation of the current portion of the quotient in a memory. - View Dependent Claims (9, 10, 11, 12, 13, 14)
-
-
15. A computing system configured to perform integer division between a numerator and a denominator on a processing unit that supports operation using variables of a first bit size, wherein the numerator and the denominator are integers having a second bit size that is greater than the first bit size, the computer system comprising:
-
a system memory configured to store a code segment containing the integer division and a compiler; and a processor coupled to the system memory, wherein the processor is configured to execute the compiler to perform the steps of;
subdividing the numerator into a plurality of equal sized partitions, wherein each partition has a third bit size, converting the denominator into a variable of the first bit size, dividing the numerator by the variable of the first bit size to obtain a current approximation of a current portion of a quotient, wherein the current approximation of the current portion of the quotient has the third bit size, subtracting a product of the current approximation of the current portion of the quotient and the denominator from the numerator to generate a subsequent numerator, wherein a fourth bit size of most significant bits associated with the subsequent numerator represents a bit overflow error value utilized to correct the first approximation of the first portion of the quotient, and storing the current approximation of the current portion of the quotient in a memory. - View Dependent Claims (16, 17, 18, 19, 20)
-
Specification