JP2002244843A - Method and device for calculating reciprocal - Google Patents

Method and device for calculating reciprocal

Info

Publication number
JP2002244843A
JP2002244843A JP2001386674A JP2001386674A JP2002244843A JP 2002244843 A JP2002244843 A JP 2002244843A JP 2001386674 A JP2001386674 A JP 2001386674A JP 2001386674 A JP2001386674 A JP 2001386674A JP 2002244843 A JP2002244843 A JP 2002244843A
Authority
JP
Japan
Prior art keywords
significant bits
look
memory
bits
entries
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2001386674A
Other languages
Japanese (ja)
Inventor
Alexei Krouglov
クロウグラブ アレクセイ
Jie Zhou
ゾウ ジエ
Daniel Gudmunson
ガドマンソン ダニエル
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sicon Video Corp
Original Assignee
Sicon Video Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from CA002329104A external-priority patent/CA2329104C/en
Application filed by Sicon Video Corp filed Critical Sicon Video Corp
Publication of JP2002244843A publication Critical patent/JP2002244843A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/02Digital function generators
    • G06F1/03Digital function generators working, at least partly, by table look-up
    • G06F1/035Reduction of table size
    • G06F1/0356Reduction of table size by using two or more smaller tables, e.g. addressed by parts of the argument
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/38Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
    • G06F7/48Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
    • G06F7/52Multiplying; Dividing
    • G06F7/535Dividing only
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2207/00Indexing scheme relating to methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F2207/535Indexing scheme relating to groups G06F7/535 - G06F7/5375
    • G06F2207/5355Using iterative approximation not using digit recurrence, e.g. Newton Raphson or Goldschmidt
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2207/00Indexing scheme relating to methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F2207/535Indexing scheme relating to groups G06F7/535 - G06F7/5375
    • G06F2207/5356Via reciprocal, i.e. calculate reciprocal only, or calculate reciprocal first and then the quotient from the reciprocal and the numerator
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/38Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
    • G06F7/48Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
    • G06F7/483Computations with numbers represented by a non-linear combination of denominational numbers, e.g. rational numbers, logarithmic number system or floating-point numbers
    • G06F7/487Multiplying; Dividing
    • G06F7/4873Dividing

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Complex Calculations (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a method and a device for calculating the reciprocal of normalized decimal part in a floating-point input number D. SOLUTION: An expression for determining the minimum size of a look-up table according to necessary precision and an expression for calculating a look-up entry are provided. The look-up table stores an initial approximation and a correction factor. The initial approximation and the correction factor are designated in address by a number corresponding to the highest position bit of a decimal part and are used for calculating a reciprocal of the initial approximate by a linear interpolation requiring a subtraction and a multiplication. A result of the linear interpolation can be supplied to a Newton-Raphson reiteration device requiring two multiplications and a complement calculation of 2 for each iteration to be able to double the precision of the reciprocal.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、信号処理に関し、
詳細には、逆数を計算するための方法および装置に関す
る。
TECHNICAL FIELD The present invention relates to signal processing.
In particular, it relates to a method and apparatus for calculating a reciprocal.

【0002】[0002]

【従来の技術】逆数を計算することは、特に浮動小数点
10進数での除算演算で重要な役割を果たす。逆数を使
用することにより、2つの数の除算の結果は、被除数に
除数の逆数を掛けることによって得ることができる。こ
の除算方法を使用して、コンピュータなどのデジタル処
理装置や、デジタル信号処理(DSP)プロセッサなど
のアプリケーション特有の集積回路で、複雑な計算を処
理する速度を向上することができる。
2. Description of the Related Art Calculating a reciprocal plays an important role especially in a division operation with a floating-point decimal number. By using the reciprocal, the result of dividing the two numbers can be obtained by multiplying the dividend by the reciprocal of the divisor. This division method can be used to increase the speed at which complex calculations are processed by digital processing devices such as computers and application-specific integrated circuits such as digital signal processing (DSP) processors.

【0003】参照により本明細書に組み込まれる2進浮
動小数点計算のためのIEEE標準0754P−198
5によれば、浮動小数点フォーマット中の浮動小数点標
準数は、単精度の仮数(小数部)24ビット長を有する
32ビット内にパックされ、または倍精度の仮数53ビ
ット長を有する64ビット内にパックされる。
[0003] IEEE Standard 0754P-198 for Binary Floating Point Computation, which is incorporated herein by reference.
According to 5, the floating-point standard number in the floating-point format is packed into 32 bits with a single-precision mantissa (decimal part) of 24 bits or 64 bits with a double-precision mantissa of 53 bits. Will be packed.

【0004】直接近似、線形補間、2次(squar
e)補間、3次(cubic)補間などを含むいくつか
の補間方法および反復方法が、逆数を計算するために開
発者によって広く使用されている。
[0004] Direct approximation, linear interpolation, quadratic (square)
e) Several interpolation and iterative methods, including interpolation, cubic interpolation, etc., are widely used by developers to calculate reciprocals.

【0005】逆数を得る直接近似方法では、逆数につい
てのすべての可能な小数部が、ROMテーブル中に格納
される。この方法を使用すれば結果を直ちに得ることが
できるが、この方法は、非常に大きいメモリ容量を必要
とする。例えば、IEEE標準754単精度浮動小数点
フォーマットによる逆数を得るためには、223×23=
184Mビットのメモリを必要とする。
In the direct approximation method for obtaining the reciprocal, all possible fractions for the reciprocal are stored in a ROM table. Although the results can be obtained immediately using this method, this method requires a very large amount of memory. For example, to obtain the reciprocal in the IEEE standard 754 single precision floating point format, 2 23 × 23 =
Requires 184 Mbits of memory.

【0006】線形補間方法は、計算からの平均値の定理
に基づき、逆数の計算に関して以下のように要約するこ
とができる。
[0006] The linear interpolation method is based on the mean value theorem from the calculation and can be summarized as follows for the calculation of the reciprocal.

【0007】[0007]

【数4】 (Equation 4)

【0008】上式で、ξ∈[x0,x]かつx≧x0であ
る。
In the above equation, ξ∈ [x 0 , x] and x ≧ x 0 .

【0009】2次補間、3次補間、および他の補間方法
を使用して、必要な精度を有する逆数を得ることも可能
である。しかし、これらの方法はすべて、追加の乗算演
算を必要とし、補正係数を格納するための追加のメモリ
を必要とする。補間方法の主な欠点は、所望の精度が向
上するにつれて、必要なデータを格納するために必要な
メモリ量も増大することである。
It is also possible to use quadratic, cubic and other interpolation methods to obtain the reciprocal with the required precision. However, all of these methods require additional multiplication operations and additional memory to store correction factors. A major drawback of the interpolation method is that as the desired accuracy increases, so does the amount of memory required to store the required data.

【0010】デジタルコンピュータにおいて、ニュート
ンラフソン反復法は、逆数を計算するために広く使用さ
れている。この方法により、方程式 f(z)=0 (2) の解が、以下の再帰式を使用することに基づいて与えら
れる。
In digital computers, the Newton-Raphson iteration method is widely used to calculate the reciprocal. In this way, a solution to the equation f (z) = 0 (2) is provided based on using the following recursive equation:

【0011】[0011]

【数5】 (Equation 5)

【0012】反復iの後に得られる値ziは、2次にz
に向かって収束し、その結果反復iおよびi+1の後の
対応する誤差εは、以下の式によって関係付けられる。 ε(zi+1)≦ε2(zi) (4)
The value z i obtained after iteration i is quadratic
And consequently the corresponding error ε after iterations i and i + 1 is related by: ε (z i + 1 ) ≦ ε 2 (z i ) (4)

【0013】逆数x=(1/a)を計算するためにニュ
ートンラフソン法を使用することにより、以下の式が生
成される。 xi+1=xi*(2−a*xi) (5)
By using the Newton-Raphson method to calculate the reciprocal x = (1 / a), the following equation is generated. x i + 1 = x i * (2-a * x i) (5)

【0014】方程式(5)からわかるように、この方法
のあらゆる反復ステップは、連続して実行される2つの
乗算演算と、1つの「2の補数」演算とを含む。したが
って、逆数の精度は各反復ステップの後に2倍になる。
ニュートンラフソン反復方法自体の欠点は、必要とする
精度を有する逆数を得るために複数の反復ステップを必
要とする可能性があることである。
As can be seen from equation (5), every iteration step of the method involves two multiplication operations performed in succession and one "two's complement" operation. Thus, the accuracy of the reciprocal is doubled after each iteration step.
A disadvantage of the Newton-Raphson iteration method itself is that it may require multiple iteration steps to obtain a reciprocal with the required accuracy.

【0015】上記の欠点を克服するために、あるタイプ
の補間方法を使用して逆数の初期近似を得、次いでこの
近似に基づいて反復方法を使用する方法が発展した。一
例として、逆テーブルを使用して連続する反復について
の初期値を得ることが提案された。
To overcome the above drawbacks, methods have been developed that use some type of interpolation method to obtain an initial approximation of the reciprocal, and then use an iterative method based on this approximation. As an example, it has been proposed to use an inverted table to obtain initial values for successive iterations.

【0016】[0016]

【発明が解決しようとする課題】本発明は、逆数を直ち
に、かつ高精度で送達することのできる、値を除算する
ための方法および装置を提供する。
SUMMARY OF THE INVENTION The present invention provides a method and apparatus for dividing values that can deliver reciprocals immediately and with high precision.

【0017】[0017]

【課題を解決するための手段】本発明の方法によれば、
逆数の近似を得るために線形補間が使用される。次い
で、この近似をニュートンラフソン反復のための入力値
として使用し、高精度で逆数を計算することができる。
According to the method of the present invention,
Linear interpolation is used to obtain an inverse approximation. This approximation can then be used as input for Newton-Raphson iterations to calculate the reciprocal with high accuracy.

【0018】従来技術の方法とは異なり、本発明の方法
は、必要な精度を有する逆数の近似を得るために、ルッ
クアップテーブル中のエントリの最小数を計算するため
の式を提供する。本発明の方法は、初期近似を計算する
ための式と、ルックアップテーブル中のエントリを構成
するための補正係数も提供する。本発明の方法を実装す
るための装置は、これらの値を格納するためのルックア
ップテーブルメモリ、整数乗算器、および減算器を備え
る。
Unlike the prior art methods, the method of the present invention provides an equation for calculating the minimum number of entries in the look-up table to obtain an approximation of the reciprocal with the required precision. The method of the present invention also provides an equation for calculating the initial approximation and a correction factor for constructing an entry in the look-up table. An apparatus for implementing the method of the present invention comprises a look-up table memory for storing these values, an integer multiplier, and a subtractor.

【0019】したがって本発明は、入力信号によって表
される、正規化された小数部M(ただし1≦M<2)を
有する入力値Dの逆数を近似する出力値を表す出力信号
を生成するための方法を提供する。この方法は、入力信
号が、1組のN0個の最上位ビットを含み、出力信号
が、N≦N0として所望の精度ε=2-Nを有する逆数を
近似し、以下のステップを含む。
Accordingly, the present invention provides an output signal representing an output value, represented by an input signal, that approximates the reciprocal of an input value D having a normalized fractional part M, where 1 ≦ M <2. To provide a way. The method includes an input signal including a set of N 0 most significant bits and an output signal approximating a reciprocal having a desired accuracy ε = 2 −N as N ≦ N 0 , and includes the following steps: .

【0020】a. 入力信号の1組のP個の最上位ビッ
トに対して、n=2Pとして、複数のルックアップテー
ブル中のエントリの数nを生成するステップであって、
i.i=0,...,n−1として、第1ルックアップ
テーブル中の、1組のN個の有効ビットを含む1組の入
力エントリyiを生成するサブステップと、ii.i=
0,...,n−1として、第2ルックアップテーブル
中の、1組の(N−P)個の有効ビットを含む1組の入
力エントリKiを生成するサブステップとを含むステッ
プと、b. 入力信号のP個の最上位ビットの組に対応
するルックアップテーブル中のエントリyiおよびKi
見つけるステップと、c. Kiに、入力信号のP個の
最上位ビットの組に続く1組の(N−P)個の有効ビッ
トを含む信号を掛けるステップと、d. エントリyi
のN個の有効ビットの組から、(N−P)個の最上位ビ
ットの組を引くステップ。
A. Generating a number n of entries in a plurality of lookup tables, where n = 2 P for a set of P most significant bits of the input signal,
i. i = 0,. . . , N-1 generating a set of input entries y i in the first look-up table, including a set of N significant bits, as a first lookup table; ii. i =
0,. . . , N-1 to generate a set of input entries K i in the second look-up table including a set of (N−P) significant bits; b. Finding entries y i and K i in a look-up table corresponding to the set of P most significant bits of the input signal; c. Multiplying K i by a signal comprising a set of (N−P) significant bits following the set of P most significant bits of the input signal; d. Entry y i
Subtracting the (N−P) most significant bits from the N significant bits.

【0021】本発明の方法の別の態様では、ルックアッ
プテーブル中のn個のエントリを生成するステップは以
下のサブステップを含む。iii. 所望の精度よりも
高い精度を得るために必要なルックアップテーブルエン
トリの最小数lを計算するサブステップであって、
In another aspect of the method of the present invention, the step of generating n entries in the look-up table includes the following sub-steps. iii. Calculating a minimum number l of look-up table entries required to obtain an accuracy higher than the desired accuracy,

【0022】[0022]

【数6】 (Equation 6)

【0023】であるサブステップと、iv. 2P-1
lかつ2P≧lであるとして、n=2Pに対するルックア
ップテーブルエントリの必要な最小数nを見つけるサブ
ステップ。第1ルックアップテーブル中の1組の入力エ
ントリを生成するステップが以下のサブステップを含
む。A.
Iv. 2 P-1 <
substep of finding the required minimum number n of look-up table entries for n = 2 P , where l and 2 P ≧ l. Generating a set of input entries in the first look-up table includes the following sub-steps. A.

【0024】[0024]

【数7】 (Equation 7)

【0025】ここで、i=0,...,n−1、x0
1、および、xi+1=xi+(1/n)であるとして計算
するサブステップと、B. 1組のN個の有効ビットを
含み、i=0,...,n−1に対するy^iの小数部
を近似するエントリyiを見つけるサブステップであ
る。かつ/または第2ルックアップテーブル中の1組の
入力エントリを生成するステップが以下のサブステップ
を含む。
Here, i = 0,. . . , N−1, x 0 =
B.1, and calculating as x i + 1 = x i + (1 / n); It contains a set of N valid bits, i = 0,. . . A sub-step of finding an entry y i approximating the fractional portion of the y ^ i for n-1. And / or generating a set of input entries in the second lookup table includes the following sub-steps.

【0026】[0026]

【数8】 (Equation 8)

【0027】を計算するサブステップと、1組の(N−
P)個の有効ビットを含むエントリK iを見つけ、i=
0,...,n−1に対するK^iの整数部を近似する
サブステップ。
And a set of (N−
P) Entry K containing valid bits iAnd find i =
0,. . . , N−1}iApproximate the integer part of
Substep.

【0028】本発明は、N0≧Nとして1組のN0個の最
上位ビットを含む正規化された小数部M(ただし1≦M
<2)を有する入力値Dの精度ε=2-Nを有する逆数I
を計算するための装置をさらに提供する。この装置は、
少なくとも1つのプロセッサと、小数部MのP個の最上
位ビットの関数としてアドレス指定されるルックアップ
テーブルを形成し、1組のN個の有効ビットを含む出力
0を有する第1メモリと、小数部MのP個の最上位ビ
ットの関数としてアドレス指定されるルックアップテー
ブルを形成し、1組の(N−P)個の有効ビットを含む
出力Kを有する第2メモリと、小数部Mおよび出力Kの
P個の最上位ビットの組に続く1組の(N−P)個の有
効ビットの2つの入力と、1組の(N−P)×(N−
P)有効ビットを含む出力MUとを有する、サイズ(N
−P)×(N−P)の乗算器と、出力Iを有し、出力I
0と出力MUの(N−P)個の最上位ビットの組とをそ
れぞれ受け取るように接続される2つの入力を有する加
算器/減算器とを備える。
The present invention provides a normalized fraction M (where 1 ≦ M) containing a set of N 0 most significant bits, where N 0 ≧ N.
Reciprocal I with precision ε = 2- N of input value D having <2)
There is further provided an apparatus for calculating This device is
At least one processor and a first memory forming a look-up table addressed as a function of the P most significant bits of the fractional part M and having an output I 0 comprising a set of N significant bits; A second memory forming a look-up table addressed as a function of the P most significant bits of the fraction M and having an output K comprising a set of (NP) significant bits; And two inputs of a set of (NP) valid bits following the set of P most significant bits of output K, and a set of (NP) * (N-
P) with the output MU containing the significant bits
−P) × (NP) multiplier and an output I.
An adder / subtractor having two inputs connected to receive 0 and the (NP) most significant bit set of the output MU, respectively.

【0029】本発明の装置の別の態様では、第1メモリ
および第2メモリが、I0およびKのどちらも格納する
記憶装置に組み合わされ、小数部MのP個の最上位ビッ
トの関数としてアドレス指定される。装置が、Iに基づ
いて、プログラムされたニュートンラフソン反復を実行
するための装置をさらに備える。第1メモリが読取り専
用メモリ(ROM)を備える。第2メモリが読取り専用
メモリ(ROM)を備える。記憶装置が少なくとも1つ
の読取り専用メモリ(ROM)を備える。および/また
は装置がデジタル信号処理装置中に含まれる。
In another aspect of the apparatus of the present invention, the first memory and the second memory are combined with a storage device that stores both I 0 and K, and as a function of the P most significant bits of the fractional part M. Addressed. The apparatus further comprises an apparatus for performing a programmed Newton-Raphson iteration based on I. The first memory comprises a read-only memory (ROM). The second memory comprises a read-only memory (ROM). The storage device includes at least one read-only memory (ROM). And / or a device is included in the digital signal processing device.

【0030】図面は、本発明の好ましい実施形態を例示
的にのみ示す。
The drawings show by way of example only preferred embodiments of the invention.

【0031】[0031]

【発明の実施の形態】本発明は、浮動小数点フォーマッ
ト中の2進数Dの小数部Mを使用する計算に適用可能で
ある。入力数の小数部Mは、あらかじめ正規化されてい
る、すなわち1以上かつ2未満、1≦M<2であると仮
定する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS The present invention is applicable to calculations using the fractional part M of a binary number D in floating point format. It is assumed that the decimal part M of the number of inputs is normalized in advance, that is, 1 or more and less than 2, and 1 ≦ M <2.

【0032】図1は、逆数を近似するために本発明の方
法で使用される線形補間方法の好ましい実施形態を示
す。直接近似方法と比べて、線形補間は、ルックアップ
テーブル中に格納する必要のあるエントリ数を著しく低
減する。直接近似方法を使用すると共に、逆数の小数部
Mに対してNビットの精度ε=2-Nを達成するために
は、ルックアップテーブルは、2N−1個の、等しく間
隔を置いて配置されたエントリを必要とするが、線形補
間方法を使用して、逆数の小数部に対して同じNビット
の精度ε=2-Nを得るためには、P≦Nとして、ルック
アップテーブル中に2P個のエントリを有することで十
分である。各エントリは前のエントリから2- Pだけ異な
るので、小数部MのP個の最上位ビット(MSB)は、
ルックアップテーブルアドレスを構成する。
FIG. 1 shows a preferred embodiment of the linear interpolation method used in the method of the present invention to approximate reciprocals. Compared to the direct approximation method, linear interpolation significantly reduces the number of entries that need to be stored in the look-up table. In order to use the direct approximation method and to achieve N-bit precision ε = 2- N for the reciprocal fraction M, the look-up table is 2 N −1 equally spaced requires a entries, using the linear interpolation method, in order to obtain the accuracy epsilon = 2 -N of the same N bit for the decimal part of the reciprocal, as P ≦ N, while the look-up table It is sufficient to have 2 P entries. Since each entry differs from the previous entry by 2 - P , the P most significant bits (MSB) of the fractional part M are
Configure the lookup table address.

【0033】図1の値xiおよびxi+1は、ルックアップ
テーブル中の2つの連続するエントリを表す。値y
iは、ルックアップテーブル中に格納される値(1/
i)の近似を表す。値(x−xi)は、小数部の最初の
P個のMSBのすぐ後ろのビットによって表される。
The values x i and x i + 1 in FIG. 1 represent two consecutive entries in the look-up table. Value y
i is the value stored in the lookup table (1 /
x i ). The value (x-x i) is represented by the bit immediately after the first of the P MSB of the fractional part.

【0034】必要な逆数の近似は、以下の式によって表
される。 y=yi−ki(x−xi) (6) 上式で、kiは補正係数であり、xi≦x<xi+1であ
る。
The required reciprocal approximation is represented by the following equation: y = In y i -k i (x-x i) (6) the above equation, k i is a correction factor, which is x i ≦ x <x i + 1.

【0035】Nビットの精度を有する逆数の小数部Mを
得るためには、小数部MのP個のMSBの後ろの少なく
とも(N−P)ビットが、図1に示す補正係数kiの少
なくとも(N−P)個の有効ビットと一致しなければな
らない。これらの係数は、整数形Ki=2N-P×kiでル
ックアップテーブル中に格納される。したがって、Nビ
ットの精度を有する逆数の小数部Mを得ることは、サイ
ズ(N−P)×(N−P)の整数の乗算器中で、小数部
Mの(N−P)ビットに係数Kiの(N−P)ビットを
掛け、結果を2N-Pで割り、次いでその商をyiから引く
ステップを含む。
In order to obtain a reciprocal fraction M with N-bit precision, at least (NP) bits after the P MSBs of the fraction M are at least (NP) bits of the correction coefficient k i shown in FIG. Must match (NP) valid bits. These coefficients are stored in a look-up table in the integer form K i = 2 NP × k i . Therefore, to obtain a reciprocal fraction M having N-bit precision, a coefficient is added to the (NP) bits of the fraction M in an integer multiplier of size (NP) × (NP). Multiplying the ( NP ) bits of K i , dividing the result by 2 NP , and then subtracting the quotient from y i .

【0036】yiに関する小数部MのNビットと、整数
iに関する(N−P)ビットとは、ルックアップテー
ブル中に格納される。値yiおよびKiは、以下の式に従
って、それぞれNおよび(N−P)の精度で計算され
る。
The N bits of the decimal part M for y i and the (N−P) bits for integer K i are stored in a look-up table. The values y i and K i are calculated with N and (N−P) precision, respectively, according to the following equations:

【0037】[0037]

【数9】 (Equation 9)

【0038】上式で、nはルックアップテーブル中のエ
ントリ数である。
In the above equation, n is the number of entries in the look-up table.

【0039】小数部Mの逆数を見つけるための線形補間
方法の最大誤差εは、nに応じて1から2の間にあるよ
うに正規化され、以下の式によって表される。
The maximum error ε of the linear interpolation method for finding the reciprocal of the decimal part M is normalized to be between 1 and 2 depending on n, and is expressed by the following equation.

【0040】[0040]

【数10】 (Equation 10)

【0041】必要とする最大誤差εが周知である場合、
ルックアップテーブル中のエントリの必要数nを式
(9)から決定することができる。
If the required maximum error ε is known,
The required number n of entries in the lookup table can be determined from equation (9).

【0042】例えば、n=64に対しては、逆数を得る
ための線形補間方法の最大誤差εはε≒2.98*10
-5>2-16に等しく、n=128に対しては、線形補間
方法による最大誤差はε≒7.54*10-6<2-16
等しい。
For example, for n = 64, the maximum error ε of the linear interpolation method for obtaining the reciprocal is ε ≒ 2.98 * 10
-5 > 2-16 , and for n = 128, the maximum error by the linear interpolation method is equal to ε ≒ 7.54 * 10 -6 <2 -16 .

【0043】図2は、上述のような方法を実装する、本
発明による逆数を計算するための装置10を示す。入力
数Dの小数部MのP個のMSBは、2P個のエントリを
有するROM 12のアドレス線を形成する。ROM
12は、線形補間を実行するために、小数部のP個のM
SBの逆数yiに関するNビットを格納し(しかし、逆
数の先頭ビットは常に「0」であるので、(N−1)ビ
ットを格納することで十分である)、補正係数Ki
(N−P)ビットを格納することが好ましい。
FIG. 2 shows an apparatus 10 for calculating a reciprocal according to the invention, implementing a method as described above. The P MSBs of the fractional part M of the input number D form an address line of the ROM 12 having 2 P entries. ROM
12 performs P fractional M executions to perform linear interpolation.
Stores N bits for reciprocal y i of SB (However, since the first bit of the inverse is always "0", (N-1) it is sufficient to store a bit), the correction coefficient K i (N -P) It is preferable to store bits.

【0044】補正係数Kの(N−P)ビットは、サイズ
(N−P)×(N−P)を有する整数乗算器14の1つ
の入力に供給される。乗算器14の別の入力には、入力
小数部MのP個のMSBのすぐ後の(N−P)ビットが
供給される。(N−P)×(N−P)ビット長を掛ける
ことによって得られる積の(N−P)個のMSB MU
は、サイズNを有する整数減算器16の入力に供給され
る。入力MUのP個のMSBはすべて「0」であり、積
の(N−P)個の最下位ビット(LSB)は廃棄され
る。減算器16の別の入力には、ROM12からの逆数
の近似yiのNビット(図2にI0として示す)が供給さ
れる。減算の結果は、装置10のNビット出力(図2に
Iとして示す)を形成する。
The (NP) bits of the correction coefficient K are supplied to one input of an integer multiplier 14 having a size (NP) × (NP). Another input of the multiplier 14 is provided with the (NP) bits immediately following the P MSBs of the input fraction M. (NP) MSB MUs of the product obtained by multiplying by (NP) x (NP) bit length
Is supplied to the input of an integer subtractor 16 having size N. The P MSBs of the input MU are all "0" and the (NP) least significant bits (LSB) of the product are discarded. Another input of the subtractor 16 is supplied with N bits (shown as I 0 in FIG. 2) of the reciprocal approximation y i from the ROM 12. The result of the subtraction forms the N-bit output of device 10 (shown as I in FIG. 2).

【0045】入力小数部MのP個のMSBが「1」に等
しい(すなわち、最上位ビットが「1」であり、他の
(P−1)ビットが「0」である)場合、出力IはMU
の(N−P)ビットの1の補数として表すことができ、
計算が簡単になることに留意されたい。
If the P MSBs of the input fraction M are equal to "1" (ie, the most significant bit is "1" and the other (P-1) bits are "0"), the output I Is MU
(N−P) bits of one's complement,
Note that the calculations are simplified.

【0046】図3は、結果の精度をNビットから2Nビ
ット精度に向上させるために、線形補間の結果のニュー
トンラフソン反復を実行するための装置20を示す。補
間装置10からの出力IのNビットは、サイズN×2N
を有する整数乗算器22の入力に供給される。乗算器2
2の別の入力には、マルチプレクサ24からの出力の2
Nビットが供給される。マルチプレクサ24は、(必要
な場合追加の「0」で埋められる)入力小数部Mの2N
個のMSBと、2の補数装置26の出力の2Nビットと
を交互に選択する。
FIG. 3 shows an apparatus 20 for performing a Newton-Raphson iteration of the result of a linear interpolation to increase the precision of the result from N bits to 2N bits. The N bits of the output I from the interpolation device 10 are of size N × 2N
Is provided to the input of the integer multiplier 22. Multiplier 2
Another input of 2 is the output 2 of multiplexer 24.
N bits are provided. Multiplexer 24 provides 2N of input fraction M (filled with additional "0" if necessary).
The MSBs and the 2N bits of the output of the two's complement device 26 are alternately selected.

【0047】乗算器22は、3Nビット長の結果を生成
する。この乗算の積のN個の最下位の組が廃棄される。
積の2N個の最上位ビットMU1が2の補数装置26に
供給される。2Nビット長の2の補数装置26の出力が
マルチプレクサ24に供給される。乗算器22を2回目
に通過する際、乗算の積の2N個のMSBは、装置20
の2Nビット出力(図3にI1として示す)を形成す
る。
The multiplier 22 generates a result having a length of 3N bits. The N least significant sets of products of this multiplication are discarded.
The 2N most significant bits MU1 of the product are provided to a two's complement unit 26. The output of the 2N-bit two's complement device 26 is supplied to the multiplexer 24. On the second pass through the multiplier 22, the 2N MSBs of the product of the multiplication are
2N bit output (shown as I 1 in FIG. 3).

【0048】本発明の好ましい実施形態を例示的にのみ
示し、説明したが、頭記の特許請求の範囲で述べるよう
な本発明の範囲から逸脱することなく、変更および修正
を行うことができることは当業者には明らかであろう。
While the preferred embodiment of the invention has been illustrated and described by way of example only, it is to be understood that changes and modifications can be made without departing from the scope of the invention as set forth in the claims below. It will be clear to those skilled in the art.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明で使用する線形補間方法を示すグラフで
ある。
FIG. 1 is a graph showing a linear interpolation method used in the present invention.

【図2】逆数の小数部についてNビットの精度を得るた
めの、本発明による線形補間装置を示すブロック図であ
る。
FIG. 2 is a block diagram showing a linear interpolation device according to the present invention for obtaining N-bit precision for a reciprocal fraction part.

【図3】逆数の小数部について2Nビットの精度を得る
ための、ニュートンラフソン反復装置を示すブロック図
である。
FIG. 3 is a block diagram showing a Newton-Raphson iterator for obtaining 2N-bit precision for the reciprocal fraction part.

【符号の説明】[Explanation of symbols]

12 ROM 14 整数乗算器 16 整数減算器 22 乗算器 24 マルチプレクサ 26 2の補数装置 12 ROM 14 Integer Multiplier 16 Integer Subtractor 22 Multiplier 24 Multiplexer 26 Two's Complement Device

───────────────────────────────────────────────────── フロントページの続き (71)出願人 501488860 1550 16th Avenue,Bldg. F,2nd Floor Richmon d Hill,Ontario Cana da L4B 3K9 (72)発明者 アレクセイ クロウグラブ カナダ エム8ワイ 4シー5 オンタリ オ州 エトビコーク クラウン ヒル プ レイス 9 ナンバー310 (72)発明者 ジエ ゾウ カナダ エム2エム 3エー5 オンタリ オ州 ノース ヨーク ロウバンク コー ト 29 (72)発明者 ダニエル ガドマンソン カナダ エル3エックス 1エス6 オン タリオ州 ニューマーケット ジェリー アベニュー 200 Fターム(参考) 5B016 AA05 BA07 CD01 EA15 5B022 BA01 FA06  ──────────────────────────────────────────────────続 き Continuation of the front page (71) Applicant 501488860 1550 16th Avenue, Bldg. F, 2nd Floor Richmond d Hill, Ontario Cana da L4B 3K9 (72) Inventor Alexei Crowgrab Canada M8 W 4 Sea 5 Ontario Etobicoke Crown Hill Place 9 No. 310 (72) Inventor Jie Zou Canada M2M 3A5 Ontario North York Rowbank Court 29 (72) Inventor Daniel Gadmanson Canada El 3X 1S6 Ontario Newmarket Jerry Avenue 200 F term (reference) 5B016 AA05 BA07 CD01 EA15 5B022 BA01 FA06

Claims (11)

【特許請求の範囲】[Claims] 【請求項1】 入力信号によって表される正規化された
小数部M(ただし1≦M<2)を有する入力値Dの、逆
数を近似する出力値を表す出力信号を生成するための方
法であって、入力信号が、1組のN0個の最上位ビット
を含み、出力信号が、N≦N0として所望の精度ε=2
-Nを有する逆数を近似し、 a. 入力信号の1組のP個の最上位ビットに対して、
n=2Pとして、複数のルックアップテーブル中のエン
トリの数nを生成するステップであって、 i. i=0,...,n−1として、第1ルックアッ
プテーブル中の、1組のN個の有効ビットを含む1組の
入力エントリyiを生成するサブステップと、 ii. i=0,...,n−1として、第2ルックア
ップテーブル中の、1組の(N−P)個の有効ビットを
含む1組の入力エントリKiを生成するサブステップと
を含むステップと、 b. 入力信号のP個の最上位ビットの組に対応するル
ックアップテーブル中のエントリyiおよびKiを見つけ
るステップと、 c. Kiに、入力信号のP個の最上位ビットの組に続
く1組の(N−P)個の有効ビットを含む信号を掛ける
ステップと、 d. エントリyiのN個の有効ビットの組から、(N
−P)個の最上位ビットの組を引くステップとを具えた
ことを特徴とする方法。
1. A method for generating an output signal representing an output value approximating a reciprocal of an input value D having a normalized fractional part M (where 1 ≦ M <2) represented by the input signal. Thus, the input signal includes a set of N 0 most significant bits, and the output signal has the desired precision ε = 2, where N ≦ N 0
Approximate the reciprocal with -N , a. For a set of P most significant bits of the input signal,
generating the number n of entries in the plurality of look-up tables, where n = 2 P , i. i = 0,. . . , N-1 generating a set of input entries y i in the first look-up table, including a set of N significant bits, as a first lookup table; ii. i = 0,. . . , N-1 to generate a set of input entries K i in the second look-up table including a set of (N−P) valid bits, b. Finding entries y i and K i in a look-up table corresponding to the set of P most significant bits of the input signal; c. Multiplying K i by a signal comprising a set of (N−P) significant bits following the set of P most significant bits of the input signal; d. From the set of N valid bits of entry y i , (N
-P) drawing a set of the most significant bits.
【請求項2】 ルックアップテーブル中のN個のエント
リを生成するステップは、 iii. 所望の精度よりも高い精度を得るために必要
なルックアップテーブルエントリの最小数lを計算する
サブステップであって、 【数1】 であるサブステップと、 iv. 2P-1<lかつ2P≧lであるとして、n=2P
に対するルックアップテーブルエントリの必要な最小数
nを見つけるサブステップとを含むことを特徴とする請
求項1記載の方法。
2. Creating N entries in a look-up table, comprising: iii. A sub-step of calculating the minimum number l of look-up table entries required to obtain an accuracy higher than the desired accuracy, And iv. Assuming that 2 P−1 <l and 2 P ≧ l, n = 2 P
Sub-step of finding the required minimum number n of look-up table entries for.
【請求項3】 前記第1ルックアップテーブル中の1組
の入力エントリを生成するステップは、 A. 【数2】 ここで、i=0,...,n−1、x0=1、および xi+1=xi+(1/n) を計算するサブステップと、 B. 1組のN個の有効ビットを含むエントリyiを見
つけ、i=0,...,n−1に対するy^iの小数部
を近似するサブステップとを含むことを特徴とする請求
項1記載の方法。
3. The step of generating a set of input entries in said first look-up table comprises: (Equation 2) Here, i = 0,. . . B., n-1, x 0 = 1, and x i + 1 = x i + (1 / n); Find an entry y i that contains a set of N significant bits, i = 0,. . . , N-1 for approximating the fractional part of y ^ i .
【請求項4】 前記第2ルックアップテーブル中の1組
の入力エントリを生成するステップは、 A. 【数3】 ここで、i=0,...,n−1、x0=1、および xi+1=xi+(1/n) を計算するサブステップと、 B. 1組の(N−P)個の有効ビットを含み、i=
0,...,n−1に対するK^iの整数部を近似する
エントリKiを見つけるサブステップとを含むことを特
徴とする請求項1記載の方法。
4. The step of generating a set of input entries in said second look-up table comprises: (Equation 3) Here, i = 0,. . . B., n-1, x 0 = 1, and x i + 1 = x i + (1 / n); Contains a set of (NP) valid bits, i =
0,. . . , N-1 to find an entry K i approximating the integer part of K ^ i .
【請求項5】 N0≧Nとして1組のN0個の最上位ビッ
トを含む正規化された小数部M(ただし1≦M<2)を
有する入力値Dの精度ε=2-Nを有する逆数Iを計算す
るための装置であって、 少なくとも1つのプロセッサと、 小数部MのP個の最上位ビットの関数としてアドレス指
定されるルックアップテーブルを形成し、1組のN個の
有効ビットを含む出力I0を有する第1メモリと、 小数部MのP個の最上位ビットの関数としてアドレス指
定されるルックアップテーブルを形成し、1組の(N−
P)個の有効ビットを含む出力Kを有する第2メモリ
と、 小数部Mおよび出力KのP個の最上位ビットの組に続く
1組の(N−P)個の有効ビットの2つの入力と、1組
の(N−P)×(N−P)有効ビットを含む出力MUと
を有する、サイズ(N−P)×(N−P)の乗算器と、 出力Iを有し、出力I0と出力MUの(N−P)個の最
上位ビットの組とをそれぞれ受け取るように接続される
2つの入力を有する加算器/減算器とを具えたことを特
徴とする装置。
5. The precision ε = 2- N of an input value D having a normalized fraction M (1 ≦ M <2) including a set of N 0 most significant bits, where N 0 ≧ N. An apparatus for calculating a reciprocal I having at least one processor and a look-up table addressed as a function of the P most significant bits of a fraction M, comprising a set of N valid bits. a first memory having an output I 0 including bit, to form a look-up table which is addressed as a function of the P most significant bits of the fractional part M, 1 set of (N-
A second memory having an output K containing P) significant bits, and two inputs of a set of (NP) valid bits following the fraction M and the set of P most significant bits of the output K. And a multiplier of size (NP) * (NP) having an output MU comprising a set of (NP) * (NP) significant bits; An apparatus, comprising: an adder / subtractor having two inputs connected to receive I 0 and a set of (N−P) most significant bits of an output MU, respectively.
【請求項6】 前記第1メモリおよび前記第2メモリ
は、I0およびKのどちらも格納する記憶装置に組み合
わされ、小数部MのP個の最上位ビットの関数としてア
ドレス指定されることを特徴とする請求項5記載の装
置。
6. The memory of claim 1, wherein the first memory and the second memory are combined with a storage device that stores both I 0 and K and are addressed as a function of the P most significant bits of the fractional part M. An apparatus according to claim 5, characterized in that:
【請求項7】 前記Iに基づいて、プログラムされたニ
ュートンラフソン反復を実行するための装置をさらに具
えたことを特徴とする請求項5記載の装置。
7. The apparatus of claim 5, further comprising an apparatus for performing a programmed Newton-Raphson iteration based on I.
【請求項8】 前記第1メモリは、読取り専用メモリ
(ROM)を具えたことを特徴とする請求項5記載の装
置。
8. The apparatus according to claim 5, wherein said first memory comprises a read only memory (ROM).
【請求項9】 前記第2メモリは、読取り専用メモリ
(ROM)を具えたことを特徴とする請求項5記載の装
置。
9. The apparatus of claim 5, wherein said second memory comprises a read only memory (ROM).
【請求項10】 前記記憶装置は、少なくとも1つの読
取り専用メモリ(ROM)を具えたことを特徴とする請
求項6記載の装置。
10. The apparatus of claim 6, wherein said storage device comprises at least one read only memory (ROM).
【請求項11】 請求項5の装置を具えたことを特徴と
するデジタル信号処理装置。
11. A digital signal processing device comprising the device of claim 5.
JP2001386674A 2000-12-20 2001-12-19 Method and device for calculating reciprocal Pending JP2002244843A (en)

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
CA002329104A CA2329104C (en) 2000-12-20 2000-12-20 Method and apparatus for calculating a reciprocal
CA2,329,104 2000-12-20
US09/781,951 US6769006B2 (en) 2000-12-20 2001-02-14 Method and apparatus for calculating a reciprocal

Publications (1)

Publication Number Publication Date
JP2002244843A true JP2002244843A (en) 2002-08-30

Family

ID=25682301

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001386674A Pending JP2002244843A (en) 2000-12-20 2001-12-19 Method and device for calculating reciprocal

Country Status (3)

Country Link
JP (1) JP2002244843A (en)
FR (1) FR2818407A1 (en)
GB (1) GB2372353A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006065633A (en) * 2004-08-27 2006-03-09 Sony Computer Entertainment Inc Arithmetic method and device

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8015228B2 (en) 2005-02-16 2011-09-06 Arm Limited Data processing apparatus and method for performing a reciprocal operation on an input value to produce a result value
US7747667B2 (en) 2005-02-16 2010-06-29 Arm Limited Data processing apparatus and method for determining an initial estimate of a result value of a reciprocal operation

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0377992B1 (en) * 1989-01-13 1996-04-17 International Business Machines Corporation Floating point division method and apparatus

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006065633A (en) * 2004-08-27 2006-03-09 Sony Computer Entertainment Inc Arithmetic method and device

Also Published As

Publication number Publication date
GB0129122D0 (en) 2002-01-23
FR2818407A1 (en) 2002-06-21
GB2372353A (en) 2002-08-21

Similar Documents

Publication Publication Date Title
JP5236804B2 (en) Sine / cosine generator
US7689639B2 (en) Complex logarithmic ALU
TWI351640B (en) Exponent processing systems and related methods
JP2001510596A (en) Logarithmic / antilogarithmic converter using quadratic term and method of using the same
US7711764B2 (en) Pipelined real or complex ALU
CA2329104C (en) Method and apparatus for calculating a reciprocal
JP3551113B2 (en) Divider
JP5229314B2 (en) CORDIC arithmetic circuit and method
US8868633B2 (en) Method and circuitry for square root determination
JP3003467B2 (en) Arithmetic unit
JP2002244843A (en) Method and device for calculating reciprocal
US7366745B1 (en) High-speed function approximation
JP3279462B2 (en) Digital multiplier, digital transversal equalizer, and digital product-sum operation circuit
Lewis An accurate LNS arithmetic unit using interleaved memory function interpolator
US6549924B1 (en) Function generating interpolation method and apparatus
WO2003096182A1 (en) “emod” a fast modulus calculation for computer systems
US10353671B2 (en) Circuitry and method for performing division
JPH08504046A (en) Device for converting a floating point binary number to a logarithm in binary form and vice versa
JP7476175B2 (en) Multiply-accumulate circuit
JP3195609B2 (en) Reciprocal calculator and computer equipped with reciprocal calculator
Mohan et al. Scaling, base extension, sign detection and comparison in RNS
JP2000010763A (en) Division circuit
JP3616385B2 (en) Divide-by-two unit, multiplier, and program recording medium thereof
JPH06105421B2 (en) Inverse trigonometric function calculator
Li et al. New redundant CORDIC algorithms with fast variable scale factor compensations