JP3539077B2 - Division method by parallel operation method - Google Patents

Division method by parallel operation method

Info

Publication number
JP3539077B2
JP3539077B2 JP16108896A JP16108896A JP3539077B2 JP 3539077 B2 JP3539077 B2 JP 3539077B2 JP 16108896 A JP16108896 A JP 16108896A JP 16108896 A JP16108896 A JP 16108896A JP 3539077 B2 JP3539077 B2 JP 3539077B2
Authority
JP
Japan
Prior art keywords
bits
dividend
bit
division
divisor
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.)
Expired - Fee Related
Application number
JP16108896A
Other languages
Japanese (ja)
Other versions
JPH09319560A (en
Inventor
謙介 井谷
後藤  勝
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.)
Sony Corp
Original Assignee
Sony 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
Application filed by Sony Corp filed Critical Sony Corp
Priority to JP16108896A priority Critical patent/JP3539077B2/en
Publication of JPH09319560A publication Critical patent/JPH09319560A/en
Application granted granted Critical
Publication of JP3539077B2 publication Critical patent/JP3539077B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、例えば、中央処理
装置などの演算回路で用いる並列演算方式による除算方
法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a division method by a parallel operation system used in an operation circuit such as a central processing unit.

【0002】[0002]

【従来の技術】従来、デジタル演算において、CPU
(中央処理装置)でソフトウェアによって行う方法以外
に、高速な演算を行うためには、専用のハードウェアを
用いる必要があった。特に、除算を行う場合には、専用
の高速除算器を用いるようになっており、除算だけで、
1つの集積回路(LSI)となり、回路規模の増大、コ
ストアップにつながる。そこで、適切な速度と回路規模
となる高速除算器が望まれている。
2. Description of the Related Art Conventionally, in a digital operation, a CPU is used.
In addition to the method performed by software in the (central processing unit), dedicated hardware must be used to perform high-speed calculations. In particular, when performing division, a dedicated high-speed divider is used.
It becomes one integrated circuit (LSI), which leads to an increase in circuit scale and cost. Therefore, a high-speed divider having an appropriate speed and circuit scale is desired.

【0003】[0003]

【発明が解決しようとする課題】しかしながら、従来の
除算方法では、速度を向上させようとすると、回路規模
が大となり、回路規模を小さくしようとすると、速度が
低下するという問題があった。
However, in the conventional dividing method, there is a problem in that the circuit scale becomes large when trying to improve the speed, and the speed is reduced when trying to reduce the circuit scale.

【0004】そこで本発明は、回路規模を大とすること
なく、高速で除算できる並列演算方式による除算方法を
提供することを目的としている。
Accordingly, an object of the present invention is to provide a division method based on a parallel operation method capable of high-speed division without increasing the circuit scale.

【0005】[0005]

【課題を解決するための手段】上記目的を達成するた
め、この発明による並列演算方式による除算方法は、N
ビットの被除数をnビットずつ上位にシフトさせなが
ら、被除数の上位n+i(i=1,2,……,m;m=
N/n)ビットと、下位1ビットずつずらした2n−1
個のNビットの除数とをそれぞれ加算し、2n−1個の
Nビットの除数のうち、加算結果が正の最大値となる除
数を示すnビットの符号を前記被除数の下位に付加する
ことをm回繰り返し、前記正の最大値となる除数を示す
符号列を商とし、m=1のときの除数を示す符号と前記
被除数とからなる符号列を余りとすることを特徴とす
る。
In order to achieve the above-mentioned object, a division method using a parallel operation system according to the present invention comprises:
While the dividend of bits is shifted upward by n bits, the upper n + i of the dividend (i = 1, 2,..., M;
N / n) bits and 2 n -1 shifted by one lower bit
And n N-bit divisors are added to each other, and an n-bit code indicating a divisor whose addition result is a positive maximum value among 2 n −1 N-bit divisors is added below the dividend. Is repeated m times, a code string indicating the divisor having the positive maximum value is defined as a quotient, and a code string including the code indicating the divisor when m = 1 and the dividend is remainder.

【0006】[0006]

【発明の実施の形態】以下、本発明の実施の形態を図面
を参照して説明する。
Embodiments of the present invention will be described below with reference to the drawings.

【0007】A.実施の形態 A−1.実施の形態の構成 図1は本発明の実施の形態による並列演算方式による除
算方法の手順(アルゴリズム)を示すフローチャートで
あり、図2は、本発明の並列演算方式による除算方法を
適用した除算器の一構成例を示す概念図である。まず、
図2を参照して本発明の並列演算方式による除算方法を
適用した除算器の構成について説明する。なお、本発明
では、A/Bなる除算を想定し、除算過程において、被
除数Aを多ビットシフトするようにしており、この実施
の形態では、特に、2ビットシフトで除算を行う例につ
いて説明する。図2において、1は、被除数A(32ビ
ット)が格納される65ビットのシフトレジスタであ
り、初期状態では、下位32ビットに被除数Aが格納さ
れる。除算過程において、被除数Aは、2ビットずつ上
位にシフトされるとともに、下位側から除算過程で得ら
れる演算結果(2ビット)が入力される。
A. Embodiment A-1. 1 is a flowchart showing a procedure (algorithm) of a division method by a parallel operation method according to an embodiment of the present invention, and FIG. 2 is a divider to which a division method by a parallel operation method of the present invention is applied. FIG. 3 is a conceptual diagram showing an example of the configuration of FIG. First,
With reference to FIG. 2, the configuration of a divider to which the division method according to the parallel operation method of the present invention is applied will be described. In the present invention, the division A is assumed to be A / B, and the dividend A is shifted by many bits in the division process. In this embodiment, an example in which division is performed by 2-bit shift will be described. . In FIG. 2, reference numeral 1 denotes a 65-bit shift register that stores a dividend A (32 bits). In an initial state, the dividend A is stored in lower 32 bits. In the division process, the dividend A is shifted upward by two bits, and the operation result (2 bits) obtained in the division process is input from the lower side.

【0008】また、2a,2b,2cは、各々、除数B
(32ビット)が格納される35ビットの加算ユニット
であり、除算過程においては、それぞれ下位1ビットを
ずらして演算に用いられる。また、上述したように、本
実施の形態では、2ビットシフトで除算を行うので、3
組の加算ユニットを用いている。
Further, 2a, 2b and 2c are divisors B, respectively.
(32 bits) is a 35-bit addition unit, which is used for calculation by shifting the lower one bit in each division process. Further, as described above, in the present embodiment, division is performed by 2-bit shift,
A set of adder units is used.

【0009】本実施の形態による除算方法では、シフト
レジスタ1の上位30ビット目〜34ビット目(図示の
C)と、加算ユニット2a,2b,2cに格納された除
数Bをそれぞれ下位2ビットをずらして加算し、加算結
果が正の最大値をとる加算ユニットを示す符号(2ビッ
ト:01,10,11)をシフトレジスタ1のLSB側
から入力するとともに、被除数Aを上位側に2ビットシ
フトするという一連の演算を、所定回数(2ビットシフ
トにおいて、32ビットの場合、16回、16ビットの
場合、8回)繰り返すことにより、除算を行うようにな
っている。
In the division method according to the present embodiment, the upper 30 bits to the 34th bit (C in the figure) of the shift register 1 and the divisor B stored in the addition units 2a, 2b, 2c are each replaced by the lower 2 bits. A code (2 bits: 01, 10, 11) indicating an addition unit whose addition result takes a positive maximum value is input from the LSB side of the shift register 1, and the dividend A is shifted upward by 2 bits. The division is performed by repeating a series of operations of performing a predetermined number of times (16 times for a 32-bit shift and 16 times for a 16-bit shift in a 2-bit shift).

【0010】B.実施の形態の動作 次に、上述した並列演算方式による除算方法の手順につ
いて説明する。まず、除算に先だって、被除数A、除数
Bが16ビットの場合、32ビット化を行い、被除数
A、除数Bが32ビットの場合には、そのままとする。
次に、図1に示すステップS10において、被除数Aお
よび除数Bに対して符号化を行う。
B. Operation of Embodiment Next, the procedure of the division method by the above-described parallel operation method will be described. First, prior to the division, if the dividend A and the divisor B are 16 bits, conversion to 32 bits is performed, and if the dividend A and the divisor B are 32 bits, they are left as they are.
Next, in step S10 shown in FIG. 1, the dividend A and the divisor B are encoded.

【0011】次に、ステップS12で、被除数A、除数
Bが同符号であるか、異符号であるかをチェックし、被
除数Aを正の整数、除数Bを負の整数とする。これは、
本発明では、sign拡張を行って加算を行うことにより、
減算を行っているためである。次に、ステップS14
で、図2に示すように、シフトレジスタ1の上位35ビ
ット(被除数Aの上位2ビットを含む)Cと、加算ユニ
ット2a,2b,2cの除数B1,B2,B3(下位2
ビットをずらした除数)とを加算する。
Next, in step S12, it is checked whether the dividend A and the divisor B have the same sign or different signs, and the dividend A is a positive integer and the divisor B is a negative integer. this is,
In the present invention, by performing sign extension and performing addition,
This is because the subtraction is performed. Next, step S14
As shown in FIG. 2, the upper 35 bits (including the upper 2 bits of the dividend A) C of the shift register 1 and the divisors B1, B2, and B3 (lower 2 bits) of the addition units 2a, 2b, and 2c.
(Divisor with shifted bits).

【0012】次に、ステップS16で、上記加算結果
(C+Bl,C+B2,C+B3)のうち、正の最大値
となった加算ユニットを選択する。例えば、加算ユニッ
ト2cに対応する加算結果(C+B3)が正の最大値と
なった場合には、加算ユニット2cが選択される。次
に、ステップS18で、図3に示すように、シフトレジ
スタ1の被除数Aを左(上位側)に2ビットシフトし、
ステップS20で、シフトレジスタ1のLSBから上記
ステップで選択した加算ユニットを示す符号(この場
合、「11」)を入力する。なお、演算過程において
は、シフトレジスタの30ビット目〜64ビット目を
符号Dで表している。
Next, in step S16, the addition unit having the maximum positive value is selected from the addition results (C + B1, C + B2, C + B3). For example, when the addition result (C + B3) corresponding to the addition unit 2c has a positive maximum value, the addition unit 2c is selected. Next, in step S18, the dividend A of the shift register 1 is shifted to the left (upper side) by 2 bits as shown in FIG.
In step S20, a code (in this case, "11") indicating the addition unit selected in the above step is input from the LSB of the shift register 1. Note that, in the operation process, the 30th to 64th bits of the shift register 1 are represented by the symbol D.

【0013】そして、ステップS22で、所定回数だけ
演算を行ったか否かを判断し、所定回数に達していなけ
れば、ステップS14に戻る。以下、ステップSl4〜
S20を所定回数(32ビットの場合には16回、16
ビットの場合には8回)だけ繰り返し実行する。ここ
で、図4は、最後の演算過程における状態を示す模式図
であり、図示するように、被除数Aは、シフトレジスタ
lの30ビット目〜61ビット目にシフトされている。
この状態で、上述した演算を行い、加算結果(D十B
l,D十B2,D十B3)のうち、正の最大値となった
加算ユニットを選択し、図5に示すように、シフトレジ
スタ1の被除数Aを左(上位側)に2ビットシフトし、
シフトレジスタ1のLSBから上記ステップで選択した
加算ユニットを示す符号を入力する。
[0013] Then, in step S 22, it is determined whether or not performing an operation a predetermined number of times, does not reach the predetermined number, the flow returns to step S14. Hereinafter, steps Sl4 to
S20 is performed a predetermined number of times (16 times for 32 bits, 16 times
(8 times for bits). Here, FIG. 4 is a schematic diagram showing a state in the last operation process, and as shown, the dividend A is shifted to the 30th to 61st bits of the shift register l.
In this state, the above calculation is performed, and the addition result (D10B
1, D 十 B2, D 十 B3), the addition unit having the maximum positive value is selected, and the dividend A of the shift register 1 is shifted to the left (upper side) by 2 bits as shown in FIG. ,
The code indicating the addition unit selected in the above step is input from the LSB of the shift register 1.

【0014】この結果、図5に示すように、シフトレジ
スタ1の0ビット目〜31ビット目に除算結果(商)が
得られ、シフトレジスタ1の30ビット目〜64ビット
目に余りが得られる。次に、ステップS24において、
除算結果が同符号であれば、そのまま除算結果とし、一
方、異符号であれば、sign拡張(符号化)を行う。
なお、符号なしデータの場合には、符号化の時間が不要
となるので、より高速に除算することができる。
As a result, as shown in FIG. 5, a division result (quotient) is obtained at the 0th to 31st bits of the shift register 1, and a remainder is obtained at the 30th to 64th bits of the shift register 1. . Next, in step S24,
If the division result is the same sign, the division result is used as it is. On the other hand, if the division result is a different sign, sign extension (encoding) is performed.
In the case of unsigned data, since the encoding time is not required, the division can be performed at higher speed.

【0015】このように、上述した実施の形態では、3
2ビットのデータの場合、16サイクルで、16ビット
のデータの場合、8サイクルで計算できる(符号化を含
めると、18サイクルおよび10サイクル)。また、3
ビットシフトとすれば、32ビットのデータの場合、1
1サイクルで、16ビットのデータの場合、6サイクル
で計算できる(符号化を含めると、13サイクルおよび
8サイクル)。
As described above, in the above-described embodiment, 3
In the case of 2-bit data, calculation can be performed in 16 cycles, and in the case of 16-bit data, calculation can be performed in 8 cycles (including encoding, 18 and 10 cycles). Also, 3
Assuming a bit shift, for 32-bit data, 1
In one cycle, in the case of 16-bit data, calculation can be performed in six cycles (13 cycles and 8 cycles including encoding).

【0016】[0016]

【発明の効果】以上説明したように、この発明によれ
ば、Nビットの被除数をnビットずつ上位にシフトさせ
ながら、被除数の上位n+i(i=1,2,……,m;
m=N/n)ビットと、下位1ビットずつずらした2n
−1個のNビットの除数とをそれぞれ加算し、2n−1
個のNビットの除数のうち、加算結果が正の最大値とな
る除数を示すnビットの符号を前記被除数の下位に付加
することをm回繰り返し、前記正の最大値となる除数を
示す符号列を商とし、m=1のときの除数を示す符号と
前記被除数とからなる符号列を余りとするようにしたこ
とにより、回路規模を大とすることなく、高速で除算で
きるという利点が得られる。
As described above, according to the present invention, the upper n + i (i = 1, 2,..., M;
m = N / n) bits and 2 n shifted by 1 lower bit
−1 N-bit divisors are added, and 2 n −1
Of the N-bit divisors, a code indicating the divisor having the positive maximum value is repeated m times by adding an n-bit code indicating the divisor whose addition result is the maximum positive value to the lower part of the dividend. By using a string as a quotient and leaving a code string consisting of a code indicating the divisor when m = 1 and the dividend as a remainder, an advantage is obtained in that division can be performed at high speed without increasing the circuit scale. Can be

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

【図1】本発明の実施の形態による並列演算方式による
除算方法の手順(アルゴリズム)を示すフローチャート
である。
FIG. 1 is a flowchart illustrating a procedure (algorithm) of a division method using a parallel operation method according to an embodiment of the present invention.

【図2】並列演算方式による除算方法を適用した除算器
の一構成例を示す概念図である。
FIG. 2 is a conceptual diagram illustrating a configuration example of a divider to which a division method based on a parallel operation method is applied.

【図3】除算過程を説明するための模式図である。FIG. 3 is a schematic diagram for explaining a division process.

【図4】除算過程を説明するための模式図である。FIG. 4 is a schematic diagram for explaining a division process.

【図5】除算過程を説明するための模式図である。FIG. 5 is a schematic diagram for explaining a division process.

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

1……シフトレジスタ、2a,2b,2c……加算ユニ
ット。
1 shift register, 2a, 2b, 2c addition unit.

Claims (4)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 Nビットの被除数をnビットずつ上位に
シフトさせながら、被除数の上位n+i(i=1,2,
……,m;m=N/n)ビットと、下位1ビットずつず
らした2n−1個のNビットの除数とをそれぞれ加算
し、2n−1個のNビットの除数のうち、加算結果が正
の最大値となる除数を示すnビットの符号を前記被除数
の下位に付加することをm回繰り返し、前記正の最大値
となる除数を示す符号列を商とし、m=1のときの除数
を示す符号と前記被除数とからなる符号列を余りとする
ことを特徴とする並列演算方式による除算方法。
1. While shifting an N-bit dividend upward by n bits, the highest n + i (i = 1, 2, 2)
..., M; m = N / n) bits and 2 n −1 N-bit divisors shifted by the lower one bit, respectively, and among the 2 n −1 N-bit divisors, Repeating the addition of an n-bit code indicating the divisor having a positive maximum value to the lower part of the dividend m times, the quotient is a code string indicating the divisor having the positive maximum value, and m = 1 And a code string consisting of a code indicating the divisor and the dividend as a remainder.
【請求項2】 前記シフトは、n=2ビットであること
を特徴とする請求項1記載の並列演算方式による除算方
法。
2. The method according to claim 1, wherein the shift is n = 2 bits.
【請求項3】 前記被除数および除数がN=16ビット
の場合には、前記被除数および除数を予め32ビットに
変換しておくことを特徴とする請求項1記載の並列演算
方式による除算方法。
3. The division method according to claim 1 , wherein when the dividend and the divisor are N = 16 bits, the dividend and the divisor are converted into 32 bits in advance.
【請求項4】 前記m回の繰り返し演算に先だって、前
記被除数を正の整数、前記除数を負の整数に変換するこ
とを特徴とする請求項1記載の並列演算方式による除算
方法。
4. The division method according to claim 1, wherein the dividend is converted into a positive integer and the divisor is converted into a negative integer before the m iterations.
JP16108896A 1996-05-30 1996-05-30 Division method by parallel operation method Expired - Fee Related JP3539077B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP16108896A JP3539077B2 (en) 1996-05-30 1996-05-30 Division method by parallel operation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP16108896A JP3539077B2 (en) 1996-05-30 1996-05-30 Division method by parallel operation method

Publications (2)

Publication Number Publication Date
JPH09319560A JPH09319560A (en) 1997-12-12
JP3539077B2 true JP3539077B2 (en) 2004-06-14

Family

ID=15728393

Family Applications (1)

Application Number Title Priority Date Filing Date
JP16108896A Expired - Fee Related JP3539077B2 (en) 1996-05-30 1996-05-30 Division method by parallel operation method

Country Status (1)

Country Link
JP (1) JP3539077B2 (en)

Also Published As

Publication number Publication date
JPH09319560A (en) 1997-12-12

Similar Documents

Publication Publication Date Title
JP3736741B2 (en) Data processing unit
JP2585649B2 (en) Division circuit
JPH0728227B2 (en) Decoding device for BCH code
JP2502836B2 (en) Preprocessing device for division circuit
JP2001222410A (en) Divider
JP3539077B2 (en) Division method by parallel operation method
JP4057876B2 (en) Control method of Galois field multiplier
JP2991788B2 (en) Decoder
JP3028165B2 (en) High radix division control method and high radix divider
JP3415569B2 (en) Decimal data division method and program recording medium therefor
JP3613466B2 (en) Data arithmetic processing apparatus and data arithmetic processing program
JP2777265B2 (en) High radix square root arithmetic unit
JP3610564B2 (en) Information processing device
JP2753922B2 (en) Fixed-point division method
JP2591250B2 (en) Data processing device
JP2907276B2 (en) Arithmetic processing unit
JP2674507B2 (en) Bit error number calculation circuit
JP4042215B2 (en) Arithmetic processing apparatus and method
JP2611721B2 (en) Erasure location polynomial multiplication circuit
JPH06112848A (en) Viterbi decoding arithmetic unit
JPH1065552A (en) Arithmetic processing method for error correction and processing circuit
JP2000010763A (en) Division circuit
JPH071876B2 (en) Decoding device for BCH code
JPH06243194A (en) Method and device for automatic logic circuit design
JPH0553768A (en) Divider

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20040130

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20040302

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040315

LAPS Cancellation because of no payment of annual fees