# Patent application title: METHOD AND APPARATUS FOR INTEGER DIVISION

##
Inventors:
Prasad Avss (Bagalore, IN)
Ravi Pathakota (Proddatur, IN)

Assignees:
AGERE SYSTEMS INC.

IPC8 Class: AG06F7487FI

USPC Class:
708653

Class name: Arithmetical operation division binary

Publication date: 2009-07-02

Patent application number: 20090172069

## Abstract:

The invention provides a method, arithmetic divider unit, and system for
dividing a dividend D_{Zm}. . . Z0 having a most significant bit and a plurality of less significant bits by a divisor having a most significant bit Z

_{N}and a plurality of less significant bits Z

_{N}-1 through Z

_{0}. The method, arithmetic divider unit, and system round the divisor to the next significant bit greater than the divisor's most significant bit Z

_{N}to produce a first partial divisor R

_{ZN}, divide the dividend D

_{Zm}. . . Z0 by the first partial divisor R

_{ZN}to produce a first partial quotient Q

_{N}, calculate one or more additional partial quotients based on one or more divisor bits selected from the plurality of divisor bits Z

_{N}-1 through Z

_{0}, and add the first partial quotient Q

_{N}and one or more additional partial quotients to produce an estimated final quotient.

## Claims:

**1.**A method for dividing a dividend D

_{Zm}. . . Z0 having a most significant bit and a plurality of less significant bits by a divisor having a most significant bit Z

_{N}and a plurality of less significant bits Z

_{N}-1 through Z

_{0}comprising the steps of:rounding the divisor to the next significant bit greater than the divisor's most significant bit Z

_{N}to produce a first partial divisor R

_{ZN}+1;dividing the dividend D

_{Zm}. . . Z0 by the first partial divisor R

_{ZN}+1 to produce a first partial quotient Q

_{N};calculating one or more additional partial quotients based on one or more divisor bits selected from the plurality of divisor bits Z

_{N}-1 through Z

_{0};adding the first partial quotient Q

_{N}and one or more additional partial quotients to produce an estimated final quotient.

**2.**The method of claim 1, wherein the step of calculating one or more additional partial quotient is performed iteratively.

**3.**The method of claim 1, wherein the step of calculating one or more additional partial quotients is performed for each divisor bit Z

_{N}-1 through Z

_{0}having a binary value of "0".

**4.**The method of claim 1, wherein the step of calculating one or more additional partial quotients includes the step of setting each additional partial quotient to a "0" value if a corresponding divisor bit has a value of "1".

**5.**The method of claim 1, further comprising the steps of:calculating an error component Q

_{ERR}; andadding the error component Q

_{ERR}to the estimated final quotient to produce a corrected final quotient.

**6.**An arithmetic divider unit for dividing a dividend D

_{Zm}. . . Z0 having a most significant bit and a plurality of less significant bits by a divisor having a most significant bit ZN and a plurality of less significant bits Z

_{N}-1 through Z

_{0}, comprising:arithmetic logic capable of rounding the divisor to the next significant bit greater than the divisor's most significant bit Z

_{N}to produce a first partial divisor R

_{ZN}+1;shift logic capable of dividing the dividend D

_{Zm}. . . Z0 by the first partial divisor R

_{ZN}+1 to produce a first partial quotient Q

_{N};processing logic capable of calculating one or more additional partial quotients based on one or more divisor bits selected from the plurality of divisor bits Z

_{N}-1 through Z

_{0}; andadder logic adding the first partial quotient Q

_{N}and one or more additional partial quotients to produce an estimated final quotient.

**7.**The arithmetic divider unit of claim 6, wherein the processing logic is capable of iteratively calculating the one or more additional partial quotient.

**8.**The arithmetic divider unit of claim 6, wherein the processing logic is capable of calculating one or more additional partial quotients for each divisor bit Z

_{N}-1 through Z

_{0}having a binary value of "0".

**9.**The arithmetic divider unit of claim 6, wherein the processing logic is capable of setting each additional partial quotient to a "0" value if a corresponding divisor bit has a value of "1".

**10.**The arithmetic divider unit of claim 6, further comprising:processing logic capable of calculating an error component Q

_{ERR}; andadding logic capable of adding the error component Q

_{ERR}to the estimated final quotient to produce a corrected final quotient.

**11.**A system for dividing a dividend D

_{Zm}. . . Z0 having a most significant bit and a plurality of less significant bits by a divisor having a most significant bit Z

_{N}and a plurality of less significant bits Z

_{N}-1 through Z

_{0}, comprising:a processor configured to execute the following steps:rounding the divisor to the next significant bit greater than the divisor's most significant bit Z

_{N}to produce a first partial divisor R

_{ZN}+1;dividing the dividend D

_{Zm}. . . Z0 by the first partial divisor R

_{ZN}+1 to produce a first partial quotient Q

_{N};calculating one or more additional partial quotients based on one or more divisor bits selected from the plurality of divisor bits Z

_{N}-1 through Z

_{0}; andadding the first partial quotient Q

_{N}and one or more additional partial quotients to produce an estimated final quotient.

**12.**The processor of claim 11, wherein the processor is further configured to calculate one or more additional partial quotient is performed iteratively.

**13.**The processor of claim 11, wherein the processor is configured to calculate the one or more additional partial quotients for each divisor bit Z

_{N}-1 through Z

_{0}having a binary value of "0".

**14.**The processor of claim 11, wherein the processor is configured to set each additional partial quotient to a "0" value if a corresponding divisor bit has a value of "1".

**15.**The processor of claim 11, wherein the processor is configured to calculate an error component Q

_{ERR}and to add the error component Q

_{ERR}to the estimated final quotient to produce a corrected final quotient.

## Description:

**FIELD OF THE INVENTION**

**[0001]**The present invention relates generally to a processor including an arithmetic logic unit and preferably including a divider unit performing integer division within such processor.

**BACKGROUND OF THE INVENTION**

**[0002]**Digital devices perform a variety of arithmetic operations on binary numerical data. A processor within such digital devices includes a major subdivision called an arithmetic logic unit (ALU). The ALU performs a variety of data processing and arithmetic operations under the control of the processor. Although early processors had only one ALU, modern chips may have several ALUs, which may be classed into two types. One basic type of ALU is an integer unit which carries out simple integer mathematical operations including add, subtract, multiply, shift and logical instructions. More powerful processors also may include a second type of ALU, referred to as a floating-point unit, that handles advanced math operations on numbers with a wider range than simple integers (such as 1.03×10

^{-19}for example.) Floating-point units use separate, dedicated instructions for their advanced functions.

**[0003]**The basic integer unit may also include a dedicated divider to perform arithmetic division. Because floating-point numbers and integers are represented differently in binary, and because the operations differ as a result, separate floating point and integer dividers are generally provided. Typically, floating point division is considered to be more important for high-demand applications, such as graphics and multimedia applications. Also, integer division is not performed with the same frequency as other mathematical operations. And so, many manufacturers save die real estate by providing only the most basic single bit per cycle (radix-2) integer divider, which reduces performance.

**[0004]**The integer divider commonly operates based on one of a variety of well-known subtractive algorithms. Subtractive algorithms each include a sequence of shift, subtract, and compare operations. Among subtractive algorithms, restoring, non-restoring, non-performing, and the Sweeney, Robertson, and Tocher (SRT) division algorithms are known. These division algorithms tend to be very slow in generating quotient values.

**[0005]**For example, one conventional subtractive division technique for binary numbers works similarly to standard long division in base-10 numbers. Each digit of the dividend, starting with the most significant digit, is compared to the divisor, and a digit of the quotient is computed. In computers, this is accomplished by the typical one bit per cycle (radix-2) integer divider by aligning the most significant bit of the dividend with the least significant bit of the divisor, subtracting the aligned digits, shifting the partial remainder to the left, subtracting, shifting again, and so on. For a 64-bit number, the minimum number of cycles is 64, plus several cycles for setting up the computation. Even in cases where the numbers have significantly fewer digits or the dividend is smaller than the divisor (a case which always results in zero for integer numbers) the entire process is performed. Thus, even radix-4 and radix-8 integer dividers, which process multiple bits per cycle, can be very inefficient.

**[0006]**An exemplary prior art non-restoring integer divider 20 is schematically represented in FIG. 1. The 64-bit dividend is right shifted by 63 bits using concatenation 22. The concatenated 128 bit word is stored in flip-flop 26. The left 65 bits, including one sign bit and the 64 bit partial remainder are read out and added in adder 34. The divisor is stored in flip-flop 28, converted into its two's compliment form using XOR 32, and added in carry-lookahead adder 34. The result from adder 34 is the partial remainder from which quotient digit 38 q(i) is calculated. Concatenation 36 combines the right 63 bits from split 29 with result from adder 34 and q(i). The cycle repeats 64 times and the final result is stored in the least significant 64 bits of flip-flop 26.

**[0007]**It would be desirable to improve the performance of integer division and to reduce real estate requirements on the integrated circuit die while at the same time improving division performance on integer numbers.

**SUMMARY OF THE INVENTION**

**[0008]**Broadly speaking, the present invention fills these needs by providing a fast and efficient method and device for dividing an integer dividend by an integer divisor.

**[0009]**It should be appreciated that the present invention can be implemented in numerous ways, including as a process, an apparatus, a system, a device, or a method. Several inventive embodiments of the present invention are described below.

**[0010]**In one embodiment, the invention provides a method for dividing a dividend D

_{Zm}. . . Z0 having a most significant bit and a plurality of less significant bits by a divisor having a most significant bit Z

_{N}and a plurality of less significant bits Z

_{N}-1 through Z

_{0}. The method includes: rounding the divisor to the next significant bit greater than the divisor's most significant bit Z

_{N}to produce a first partial divisor R

_{ZN}+1; dividing the dividend D

_{Zm}. . . Z0 by the first partial divisor R

_{ZN}+1 to produce a first partial quotient Q

_{N}; calculating one or more additional partial quotients based on one or more divisor bits selected from the plurality of divisor bits Z

_{N}-1 through Z

_{0}; and adding the first partial quotient Q

_{N}and one or more additional partial quotients to produce an estimated final quotient.

**[0011]**In another embodiment, the invention provides an arithmetic divider unit for dividing a dividend D

_{Zm}. . . Z0 having a most significant bit and a plurality of less significant bits by a divisor having a most significant bit Z

_{N}and a plurality of less significant bits Z

_{N}-1 through Z

_{0}. The arithmetic divider unit includes: arithmetic logic capable of rounding the divisor to the next significant bit greater than the divisor's most significant bit Z

_{N}to produce a first partial divisor R

_{ZN}+1; shift logic capable of dividing the dividend D

_{Zm}. . . Z0 by the first partial divisor R

_{ZN}+1 to produce a first partial quotient Q

_{N}; processing logic capable of calculating one or more additional partial quotients based on one or more divisor bits selected from the plurality of divisor bits Z

_{N}-1 through Z

_{0}; and adder logic adding the first partial quotient Q

_{N}and one or more additional partial quotients to produce an estimated final quotient.

**[0012]**In yet another embodiment, the invention provides a system for dividing a dividend D

_{Zm}. . . Z0 having a most significant bit and a plurality of less significant bits by a divisor having a most significant bit Z

_{N}and a plurality of less significant bits Z

_{N}-1 through Z

_{0}. The system includes a processor configured to execute the following steps: rounding the divisor to the next significant bit greater than the divisor's most significant bit Z

_{N}to produce a first partial divisor R

_{ZN}+1; dividing the dividend D

_{Zm}. . . Z0 by the first partial divisor R

_{ZN}+1 to produce a first partial quotient Q

_{N}; calculating one or more additional partial quotients based on one or more divisor bits selected from the plurality of divisor bits Z

_{N}-1 through Z

_{0}; and adding the first partial quotient Q

_{N}and one or more additional partial quotients to produce an estimated final quotient.

**[0013]**The advantages of the present invention will become apparent from the following detailed description, taken in conjunction with the accompanying drawings, illustrating by way of example the principles of the invention.

**BRIEF DESCRIPTION OF THE DRAWINGS**

**[0014]**The present invention will be readily understood by the following detailed description in conjunction with the accompanying drawings, and like reference numerals designate like structural elements.

**[0015]**FIG. 1 shows an implementation schematic for an exemplary prior art non-restoring integer divider.

**[0016]**FIG. 2 shows a flowchart describing an exemplary method for efficiently carrying out integer division.

**DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS**

**[0017]**The integer division algorithm of the present invention may be implemented as a sequence of steps within a processor lacking a dedicated divider but having a basic ALU including add, subtract, multiply, shift and logical instructions but lacking a dedicated divider. In an alternative embodiment, the integer divider may be implemented in hardware as a separate divider unit using conventional combinational logic blocks in accordance with known techniques.

**[0018]**FIG. 2 shows a flowchart describing an exemplary method for efficiently carrying out integer division, given a dividend D having bits Z

_{M}. . . Z

_{0}and a divisor R having bits Z

_{N}. . . Z

_{0}. Bit Z

_{M}is the most significant bit (MSB) of the dividend D, and bit Z

_{N}is the MSB of divisor R. Further, M is assumed to be greater than N.

**[0019]**Dividend D and divisor R may include leading zeros before the MSB bits Z

_{M}and Z

_{N}. Such leading zeros may be eliminated by scanning dividend D and divisor R from the left to identify the first bit position that has a value of `1` and then dropping any leading zeros.

**[0020]**The procedure starts in detail at block 200 as shown. In step 205, the divisor R

_{ZN}. . . Z0. is rounded to the next significant bit greater than the divisor's most significant bit Z

_{N}to produce a partial divisor R

_{ZN}. For binary division, this step may be performed by taking the highest bit position (MSB) in the divisor D and multiplying it by 2 (e.g., via a multiply subunit or a shift register unit). Next, in step 210, the dividend D

_{Zm}. . . Z0 is divided by the partial divisor R

_{ZN}+1 to produce a first partial quotient Q

_{N}. This division can be accomplished, for example, by performing a right shift operation, e.g., via a shift register.

**[0021]**In steps 215 through 230, additional partial quotients are calculated iteratively for each remaining divisor bit Z

_{N}-1 through Z

_{0}having a binary value of "0." For the sake of illustration and not by way of limitation, in the method depicted in FIG. 2, a counter Y is used to step through each remaining divisor bit Z

_{N}-1 through Z

_{0}of the divisor R.

**[0022]**In step 215, counter Y is incremented (from an initial starting value of zero), and a comparison is made between the counter Y and the number of bits N of divisor D.

**[0023]**In block 220, assuming that the value of counter Y is equal to or less than the number of bits N in divisor R, the bit value R

_{ZN}-Y is compared to a binary value "0." If divisor bit value R

_{ZN}-Y is equal to zero, then operation continues in block 225. In block 225, a partial quotient Q

_{N}-Y is calculated, preferably iteratively, by dividing the previously calculated partial quotient Q

_{N}+1-Y, by a binary 2 (e.g., via a shift register unit), except where the previously calculated partial quotient is zero. In the case where the previously calculated partial quotient is zero (and the value R

_{ZN}-Y is equal to zero), the new quotient value is preferably computed by dividing Q

_{N}by 2

^{Y}, which computation can be performed by a shift register) If divisor bit value R

_{ZN}-Y is one, however, then in block 230 the partial quotient Q

_{N}-Y is set to a value of zero.

**[0024]**Finally, in step 235, the partial quotients Q

_{0}through Q

_{N}calculated in step 225 are added together to produce an estimated final quotient Q

_{EST}. The estimated final quotient Q

_{EST}represents a good approximation of the value that would be obtained using conventional long binary division. Further, the estimated final quotient Q

_{EST}may be very quickly obtained, especially when the above method is implemented in hardware via combinational logic.

**[0025]**An example of the method described above with reference to steps 200 through 235 follows, given the following 8-bit dividend D and 4-bit divisor R

_{ZN}. . . Z0 (where N=3):

**D Z**7Z6Z5Z4_Z3Z2Z1Z0 R Z 3 Z 2 Z 1 Z 0 = 1010 _ 1001 1010 ##EQU00001##

**[0026]**In this example, in step 205 of FIG. 2, the divisor R

_{ZN}. . . Z0=1010 is rounded to the next significant bit greater than the divisor's most significant bit. Partial divisor R

_{ZN}+1 would thus be binary 10000 (decimal 16). Next, in step 210, the dividend D=1010

_{--}1001 is divided by the partial divisor R

_{ZN}+1 (i.e., binary 10000) to produce the first partial quotient Q

_{3}=1010. In step 215, counter Y is incremented from 0 to 1 and then compared to N of 3. After incrementing, counter Y equals one, which is not greater than N, and operation thus continues to step 220. In step 220, the bit value of the second most significant bid Z2 of the divisor R is compared to zero. Because divisor bit R

_{Z2}=0, operation proceeds to step 225, in which the second partial quotient Q

_{2}is calculated by dividing Q

_{3}by the value 2, as follows:

**Q**

_{2}=Q

_{3}/2=1010/2=101.

**[0027]**Operation again returns to step 215, and counter Y is incremented from 1 to 2. After incrementing again, counter Y equals two, which is not greater than N=3, and operation thus continues to step 220. In step 220, the bit value of the third most significant bid Z

_{1}of the divisor R is compared to zero. Because divisor bit R

_{Z1}=0, operation proceeds to step 225, in which the third partial quotient Q

_{1}is set to zero.

**[0028]**Finally in this example, operation yet again returns to step 215. Counter Y is incremented from 2 to 3 and then compared to N of 3. After incrementing, counter Y equals three, which is not greater than N=3, and operation thus proceeds again to step 220. In step 220, the bit value of the least significant bid Z

_{0}of the divisor R is compared to zero. Because divisor bit R

_{Z0}=1, operation again proceeds to step 225, in which the fourth partial quotient Q

_{0}is calculated by dividing Q

_{2}by the value 4, as follows:

**Q**

_{0}=Q

_{2}4/=101/4=1

**[0029]**Finally, in step 235 in this example, the estimated final quotient Q

_{EST}is obtained by summing all of the partial quotients Q

_{0}. . . Q

_{3}.

**Q**

_{EST}=Q

_{3}+Q

_{2}+Q

_{1}+Q

_{3}=1010+101+0+1=16

**[0030]**The estimated quotient Q

_{EST}obtained in step 235 may include an error component Q

_{ERR}. The present inventors have determined that the accuracy of the present method for division may be improved by performing an error correction calculation, because the error Q

_{ERR}that is introduced by the above method is determinative. Accordingly, in step 240 the error Q

_{ERR}is calculated, and in step 245 the corrected final quotient Q

_{FINAL}is determined by calculating Q

_{EST}+Q

_{ERR}.

**[0031]**An exemplary formula for determining the error Q

_{ERR}is derived as follows.

**[0032]**The first approximation in the present method for division is performed in step 205, when the divisor R

_{ZN}. . . Z0 is rounded to the next significant bit. In so doing, one assumes that all bits in the divisor R

_{ZN}. . . Z0 are zero except the most significant bit R

_{ZN}(having value `1`), when scanned from the left. This most significant bit R

_{ZN}is rounded by shifting left by one bit. The resulting rounded value (e.g., R

_{ZN}+1=10000) will always be at least one bit-value greater than the maximum possible value of the divisor--i.e., the case where all of the divisor bits have a value of `1` (e.g., R

_{ZN}. . . Z0=1111). Further, where the rounded value R

_{ZN}+1 equals the divisor R

_{ZN}. . . Z0+1, no correctable error exists. Thus, an error will arise only where the lesser significant bits (i.e., all of the divisor bits excluding the MSB. In that event, the estimated quotient value must be increased by the error Q

_{ERR}.

**[0033]**In order to derive the amount by which the estimated quotient should be increased, one may consider a 4-bit binary number Z including bits Z

_{3}Z

_{2}Z

_{1}Z

_{0}(where Z

_{3}is the MSB). The method for division performed in steps 200 through 235 may then be written in equation form as follows:

**1 Z ≈ 1 16 + Z 2 ' 1 32 + Z 1 ' 1 64 + Z 0 ' 1 128 ( 1 ) ##EQU00002##**

**where Z**'

_{x}is the one's complement of Z

_{x}, and Z

_{3}, as the most significant bit of the divisor, is assumed to equal `1`. This equation may be rewritten as

**1 Z ≈ 8 + 4 Z 2 ' + 2 Z 1 ' + Z 0 ' 128 ##EQU00003##**

**and further rewritten as**

**Z**(8+4Z'

_{2}+2Z'

_{1}+Z'

_{0})≈128 (2)

**[0034]**By letting A equal Z

_{2}Z

_{1}Z

_{0}and substituting 8+A into the equation for Z, equation (1) may now be rewritten as

**1 ( 8 + A ) ≈ ( 8 + A ' ) 128 ( 3 ) ##EQU00004##**

**where A is Z**2Z1Z0 and A' is one's complement of A (i.e., A'=Z'

_{2}Z'

_{1}Z'

_{0}).

**[0035]**Further, the relationship between the the accurate corrected final quotient Q

_{FINAL}, the estimated final quotient Q

_{EST}and the definite error Q

_{ERR}in the quotient is given by:

**Q**

_{FINAL}=Q

_{EST}(1+Q

_{ERR}) (4)

**[0036]**By using equations (3) and (4),

**1 ( 8 + A ) ≈ ( 8 + A ' ) 128 * ( 1 + Q ERR ) ##EQU00005##**

**[0037]**By introducing the definite error quantity Q

_{ERR}, the left hand side of this resulting equation may now be defined to be exactly equal, rather than merely approximately equal, to the right hand side of the equation. Simplifying this further, one obtains

**( 8 + A ) ( 8 + A ' ) * ( 1 + Q ERR ) = 128 ##EQU00006## 1 + Q ERR = 128 ( 120 + AA ' ) ##EQU00006.2##**

**where A**+A' is always equal to 7. Thus, the error Q

_{ERR}may be accurately determined by the equation:

**Q ERR**= ( 8 - AA ' ) ( 120 + AA ' ) ( 5 ) ##EQU00007##

**[0038]**Because equation (5) itself requires a division operation, it is desirable to simplify this error equation by providing an error estimation (or mapping) algorithm that may be implemented in hardware using a shift operation rather than a division operation.

**[0039]**Toward this end, the above theory for deriving the error quotient may be extended to include the generic case with n-bit divisor (with MSB as `1`):

**1 Z ≈ 1 2 n + Z ( n - 2 ) ' 1 2 ( n + 1 ) + Z ( n - 3 ) ' 1 2 ( n + 2 ) + + Z 0 ' 1 2 ( n + n - 1 ) ( 6 ) ##EQU00008##**

**[0040]**Since the MSB (i.e., the nth bit) is always 1, the bits in divisor Z may be written as

**Z**=1 Z

_{n-2}Z

_{n}-3 Z

_{n}-4 . . . Z

_{0}

**[0041]**Letting A=(Z

_{n-2}Z

_{n}-3 Z

_{n}-4 . . . Z

_{0}), divisor Z may be rewritten as

**Z**=2

^{n}-1+A

**[0042]**Equation (6) may then be written as:

**1 ( 2 ( n - 1 ) + A ) = ( 2 ( n - 1 ) + A ' ) ( 2 ( 2 n - 1 ) ) * ( 1 + Q ERR ) ( 7 ) 2 ( 2 n - 1 ) = ( 2 ( n - 1 ) + A ' ) * ( 2 ( n - 1 ) + A ) * ( 1 + Q ERR ) ( 8 ) 2 ( 2 n - 1 ) = { ( 2 ( 2 n - 2 ) + 2 ( n - 1 ) * ( A ' + A ) + AA ' } * ( 1 + Q ERR ) ( 9 ) ##EQU00009##**

**[0043]**Because A+A' is always equal to 2.sup.(n-1)-1, is equation (9) may be further rewritten as:

**2 ( 2 n - 1 ) = { 2 ( 2 n - 2 ) + 2 ( n - 1 ) * ( 2 ( n - 1 ) - 1 ) + AA ' } * ( 1 + Q ERR ) ( 10 ) 2 ( 2 n - 1 ) = { 2 ( 2 n - 2 ) + 2 ( 2 n - 2 ) - 2 ( n - 1 ) + AA ' } * ( 1 + Q ERR ) ( 11 ) 2 ( 2 n - 1 ) = { 2 ( 2 n - 1 ) - 2 ( n - 1 ) + AA ' } * ( 1 + Q ERR ) ( 12 ) ( 1 + Q ERR ) = 2 ( 2 n - 1 ) 2 ( 2 n - 1 ) - 2 ( n - 1 ) + AA ' ( 13 ) Q ERR = 2 ( 2 n - 1 ) 2 ( 2 n - 1 ) - 2 ( n - 1 ) + AA ' - 1 = 2 ( n - 1 ) - AA ' 2 ( 2 n - 1 ) - ( 2 ( n - 1 ) - AA ' ) ( 14 ) ##EQU00010##**

**[0044]**Letting the numerator be `P`, then

**Q ERR**= P 2 ( 2 n - 1 ) - P , where P = ( 2 ( n - 1 ) - AA ' ' ) ( 15 ) Q ERR = P 2 ( 2 n - 1 ) * ( 1 1 - P 2 ( 2 n - 1 ) ) = P 2 ( 2 n - 1 ) * ( 1 - P 2 ( 2 n - 1 ) ) - 1 ( 16 ) ##EQU00011##

**[0045]**By using the well-known series expansion, one may write (1-q)

^{-1}as (1+q+q

^{2}+q

^{3}+ . . . ), if q is less than 1. In the above expression, (P/(2

^{2}n-1)) is always less than `1`. Accordingly,

**Q ERR**= P 2 ( 2 n - 1 ) * ( 1 + P 2 ( 2 n - 1 ) + [ P 2 ( 2 n - 1 ) ] 2 + [ P 2 ( 2 n - 1 ) ] 3 + ) ( 17 ) ##EQU00012##

**[0046]**This equation (17) may be further rewritten in final form as:

**Q ERR**= ( P 2 ( 2 n - 1 ) + [ P 2 ( 2 n - 1 ) ] 2 + [ P 2 ( 2 n - 1 ) ] 3 + ) , where P = ( 2 ( n - 1 ) - AA ' ) ( 18 ) ##EQU00013##

**[0047]**This resulting equation (18) for error estimation may be implemented in hardware or software using multiplication, substraction and shift modules, which are relatively fast and which require less space on an integrated circuit than a division module.

**[0048]**It will be recognized that the error estimation equation (18) still introduces a small amount of error, because in practice the number of series expansion terms must be finite and limited. The number of terms may be increased or decreased in accordance with the invention, based on the needs of the application for accuracy and speed and on the hardware and software that is available. In a preferred embodiment, the number of terms for the error correction may be determined based on the difference between the dividend and the divisor. For example, if the dividend is a 32 bit number (with MSB as `1`) and the divisor is a 2-bit number (with MSB `1`), then about 13 terms are needed to ensure that the error in the quotient is less than a bit value of `1`. Alternatively, for a 32-bit dividend and a 4-bit divisor (with MSB `1`), then about 7 terms are needed to ensure that the error in the quotient is less than a bit value of `1`.

**[0049]**Although the foregoing invention has been described in some detail for purposes of clarity of understanding, it will be apparent that certain changes and modifications may be practiced within the scope of the appended claims. Accordingly, the present embodiments are to be considered as illustrative and not restrictive, and the invention is not to be limited to the details given herein, but may be modified within the scope and equivalents of the appended claims.

User Contributions:

Comment about this patent or add new information about this topic:

People who visited this patent also read: | |

Patent application number | Title |
---|---|

20140155156 | SYSTEM AND METHOD FOR LOCATION-BASED GAMING WITH REAL WORLD LOCATIONS AND POPULATION CENTERS |

20140155155 | INTEGRATED ONLINE GAMING PORTAL OFFERING ENTERTAINMENT-RELATED CASUAL GAMES AND USER-GENERATED MEDIA |

20140155154 | SYSTEM AND METHOD FOR SHARING GAMEPLAY EXPERIENCES |

20140155153 | App Promotion System Using Data-driven dynamically Generated Mini-Games |

20140155152 | PROVIDING FEEDBACK AT A GAMING MACHINE BASED ON A PHYSICAL IMPAIRMENT OF A PLAYER |