Division using the Newton-Raphson method
AssigneeAdvanced Micro Devices, Inc.
InventorNicolai Hähnle
Life of this patent
Estimating the term…
Abstract
Systems, apparatuses, and methods for performing a division operation are disclosed. In one embodiment, a processor includes at least one arithmetic logic unit and a register file. In response to detecting a request to perform a division operation between a dividend and a divisor, the processor generates an initial approximation of the reciprocal of the divisor. Then, the processor converts the initial approximation of the reciprocal of the divisor into a fractional fixed point representation. The processor also introduces a small error into the initial approximation of the reciprocal of the divisor. Then, the processor implements one or more Newton-Raphson iterations for refining the approximation of the reciprocal and then multiplies the final reciprocal value by the dividend to generate the quotient.
Claims14
A system comprising:
- a memory;
- and
- a processor coupled to the memory;
- wherein the processor is configured to:
- detect a request to perform a division operation with a dividend and a divisor;
- responsive to detecting the request:
- generate an initial approximation of a reciprocal of the divisor in a N-bit floating point representation, wherein N is a positive integer;
- convert the initial approximation of the reciprocal of the divisor from the N-bit floating point representation to a fractional fixed point representation, wherein the fractional fixed point representation is a 1·(N−1)-bit fractional fixed point representation, wherein one bit is above a radix point and N−1 bits are below the radix point in the 1·(N−1)-bit representation;
- perform one or more iterations on the initial approximation of the reciprocal as converted to the fractional fixed point representation to generate a final version of the reciprocal;
- and
- perform a multiply operation of a final version of the reciprocal by the dividend to obtain a quotient as a result of the division operation.
A method for use in a computing device, the method comprising:
- detecting a request to perform a division operation with a dividend and a divisor;
- responsive to detecting the request:
- generating, by a processor, an initial approximation of a reciprocal of the divisor in a N-bit floating point representation, wherein N is a positive integer;
- converting, by the processor, the initial approximation of the reciprocal of the divisor from the N-bit floating point representation to a fractional fixed point representation, wherein the fractional fixed point representation is a 1·(N−1)-bit fractional fixed point representation, wherein one bit is above a radix point and N−1 bits are below the radix point in the 1·(N−1)-bit representation;
- performing, by the processor, one or more iterations on the initial approximation of the reciprocal as converted to the fractional fixed point representation to generate a final version of the reciprocal;
- and
- performing, by the processor, a multiply operation of a final version of the reciprocal by the dividend to obtain a quotient as a result of the division operation.
A processor comprising:
- a register file;
- and
- one or more arithmetic logic units (ALUs);
- wherein the processor is configured to:
- detect a request to perform a division operation with a dividend and a divisor;
- responsive to detecting the request:
- generate an initial approximation of a reciprocal of the divisor in a N-bit floating point representation, wherein N is a positive integer;
- convert the initial approximation of the reciprocal of the divisor from the N-bit floating point representation to a fractional fixed point representation, wherein the fractional fixed point representation is a 1·(N−1)-bit fractional fixed point representation, wherein one bit is above a radix point and N−1 bits are below the radix point in the 1·(N−1)-bit representation;
- perform one or more iterations on the initial approximation of the reciprocal as converted to the fractional fixed point representation to generate a final version of the reciprocal;
- and
- perform a multiply operation of a final version of the reciprocal by the dividend to obtain a quotient as a result of the division operation.
Dependencies are inferred from the claim text.