JP2002175179A - Integer dividing method and integer dividing device - Google Patents

Integer dividing method and integer dividing device

Info

Publication number
JP2002175179A
JP2002175179A JP2000372389A JP2000372389A JP2002175179A JP 2002175179 A JP2002175179 A JP 2002175179A JP 2000372389 A JP2000372389 A JP 2000372389A JP 2000372389 A JP2000372389 A JP 2000372389A JP 2002175179 A JP2002175179 A JP 2002175179A
Authority
JP
Japan
Prior art keywords
dividend
divisor
digit
shift amount
division
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
JP2000372389A
Other languages
Japanese (ja)
Inventor
Yukio Takase
行夫 高瀬
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co Ltd
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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP2000372389A priority Critical patent/JP2002175179A/en
Publication of JP2002175179A publication Critical patent/JP2002175179A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To provide an integer dividing method and an integer dividing device for realizing a high speed integer division by reducing the division processing amount without increasing the circuit scale. SOLUTION: A partial remainder and a partial quotient can be simultaneously determined, division processing processes can be saved, redundant calculations of a dividing circuit are reduced by a higher rank invalid bit number of a dividend and the number of times of repeated processing in the dividing circuit can be reduced without increasing the circuit scale, by providing an estimation digit matching circuit 100 for calculating shift amount based on the invalid bit number of 0 following highest rank figures of the dividend and a divisor, a left shifter 101 for left-shifting the dividend by the shift amount, a divisor converting part 102 for converting the divisor so as to simultaneously determine the partial remainder and the partial quotient when the divisor is subtracted from the dividend, and a division processing part 103 for repeatedly subtracting the divisor, left-shifting the left-shifted dividend 1-bit by 1-bit.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、マイクロプロセッ
サの演算装置等に用いられる整数除算方法および整数除
算装置に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an integer division method and an integer division device used for an arithmetic unit or the like of a microprocessor.

【0002】[0002]

【従来の技術】従来、この種の除算装置における除算ア
ルゴリズムとしては、例えば、パターソン&ヘネシー著
(成田光彰訳)「コンピュータの構成と設計:ハードウ
ェアとソフトウェアのインタフェース」(1996年、
日経BP社ISBN4−8222−8001−2)P
P.191〜201、第4章コンピュータにおける算術
論理計算、4.7節(除算)に示されているものや、人
が筆算で行う割算と同じ方法でシフトと引算を繰り返し
て除算を行うアルゴリズム等が知られている。
2. Description of the Related Art Conventionally, as a division algorithm in a division apparatus of this kind, for example, "Patterson &Hennessy" (translated by Mitsuaki Narita) "Computer Configuration and Design: Interface between Hardware and Software" (1996,
Nikkei BP ISBN4-8222-8001-2) P
P. 191 to 201, Chapter 4 Arithmetic and Logic Calculations in Computers, Algorithms shown in Section 4.7 (Division), and algorithms that repeatedly perform shift and subtraction in the same manner as division performed by hand Etc. are known.

【0003】以下、図7のブロック図を参照して、従来
の整数除算装置の構成例について説明する。図7におい
て、まず、a÷b(aは被除数、bは除数)の整数除算
を行う場合に、被除数aを被除数・商レジスタ701の
下位に記憶させ、上位は初期値0とする。また、除数b
は除数レジスタ702の上位に記憶させ、下位は初期値
0とする。
A configuration example of a conventional integer division device will be described below with reference to a block diagram of FIG. In FIG. 7, first, when performing integer division of a ÷ b (a is the dividend, b is the divisor), the dividend a is stored in the lower part of the dividend / quotient register 701, and the upper part is set to the initial value 0. Also, the divisor b
Is stored in the upper part of the divisor register 702, and the lower part is set to the initial value 0.

【0004】シフタ(シフト回路)703により、被除
数・商レジスタ701の内容を1ビット左シフトさせ
る。そのシフト結果の出力データを、減算を行う算術論
理ユニット(ALU)704の一方の入力側に供給し、
ALU704のもう一方の入力側には、除数レジスタ7
02から除数bが供給され、前述のシフト結果から除数
bを減算する。ALU704の演算結果は、部分剰余レ
ジスタ・部分商レジスタ705に出力される。
A shifter (shift circuit) 703 shifts the contents of the dividend / quotient register 701 left by one bit. The output data of the shift result is supplied to one input side of an arithmetic logic unit (ALU) 704 for performing subtraction,
The other input of the ALU 704 has a divisor register 7
The divisor b is supplied from 02, and the divisor b is subtracted from the shift result described above. The operation result of the ALU 704 is output to the partial remainder register / partial quotient register 705.

【0005】また、減算結果の符号判定信号サイン(Si
gn:+、−)は、インバータ706を通して、部分剰余
レジスタ・部分商レジスタ705のLSB(最下位ビッ
ト)に供給され、また、セレクタ707にも供給され
る。ALU704の演算結果が正である時にはその桁の
商は“1”であるので、符号判定信号サインの値“0”
を反転して部分商を“1”とし、ALU704の演算結
果が負である時にはその桁の商は“0”であるので、符
号判定信号サインの値“1”を反転して部分商を“0”
とする。
The sign determination signal sine (Si
gn: +,-) are supplied to the LSB (least significant bit) of the partial remainder register / partial quotient register 705 through the inverter 706, and are also supplied to the selector 707. When the operation result of the ALU 704 is positive, the quotient of the digit is “1”, so the value of the sign determination signal sign “0”
Is inverted to make the partial quotient "1". When the operation result of the ALU 704 is negative, the quotient of the digit is "0". Therefore, the value "1" of the sign determination signal sign is inverted and the partial quotient is changed to "1". 0 "
And

【0006】セレクタ707の一方の入力側にはシフタ
703の出力が供給され、もう一方の入力側には部分剰
余・部分商レジスタ705の出力が供給される。セレク
タ707は、ALU704から供給された符号判定信号
サインにより2つの入力のどちらか一方を下記のように
して選択し、その選択結果を被除数レジスタ・商レジス
タ701へ供給する。すなわち、ALU704の演算結
果が負であれば、符号判定信号サインは“1”となり、
この時は、ALU704がシフタ703の出力を減算し
なかったので、セレクタ707はシフタ703の出力デ
ータを選択し、ALU704の演算結果が正であれば、
符号判定信号サインは“0”となり、この時、セレクタ
707はALU704の減算結果である部分剰余レジス
タ・部分商レジスタ705の出力を選択する。
The output of the shifter 703 is supplied to one input side of the selector 707, and the output of the partial remainder / partial quotient register 705 is supplied to the other input side. The selector 707 selects one of the two inputs according to the sign determination signal signature supplied from the ALU 704 as follows, and supplies the selection result to the dividend register / quotient register 701. That is, if the operation result of the ALU 704 is negative, the sign determination signal sign becomes “1”,
At this time, since the ALU 704 did not subtract the output of the shifter 703, the selector 707 selects the output data of the shifter 703, and if the operation result of the ALU 704 is positive,
The sign determination signal sign becomes "0". At this time, the selector 707 selects the output of the partial remainder register / partial quotient register 705 which is the result of the subtraction of the ALU 704.

【0007】CLKはカウンタ708に入力されビット
ごとにカウントを行う。デコーダ709は、カウンタ7
08のカウントを入力して整数除算の語長に達したとき
にセレクタ710を開き、セレクタ707の出力が剰余
レジスタ・商レジスタ711に出力される。
[0007] CLK is input to a counter 708 and counts for each bit. The decoder 709 has a counter 7
When the count of 08 is input and the word length of the integer division is reached, the selector 710 is opened, and the output of the selector 707 is output to the remainder register / quotient register 711.

【0008】以下、図8のフローチャートを参照して、
従来の整数除算方法の一例について説明する。図8にお
いて、本従来例では、16ビット語長の整数除算を行う
ものとする。 <初期処理> ● ステップS801において、被除数aを変数RQに
代入する。 ● ステップS802において、除数bを左に16ビット
シフトして、除数bを変数DVに代入する。 ● ステップS803において、整数除算の語長を繰り
返し回数を表す変数Nに代入する。
Hereinafter, with reference to the flowchart of FIG.
An example of a conventional integer division method will be described. In FIG. 8, in the conventional example, it is assumed that integer division of a 16-bit word length is performed. <Initial processing> ● In step S801, the dividend a is substituted for a variable RQ. In step S802, the divisor b is shifted to the left by 16 bits, and the divisor b is substituted for the variable DV. In step S803, the word length of the integer division is assigned to a variable N representing the number of repetitions.

【0009】<繰返し処理> ● ステップS804において、変数RQを左に1ビッ
トシフトする。 ● ステップS805において、(RQ≧DVの場合)
は、ステップS806でRQからDVを引き、ステップ
S807でRQに1を加えて部分商を1とする。(RQ
<DVの場合)は、部分商は0となり、ステップS80
6、S807は行わない。 ● そして、ステップS808において、N回に達する
まで、ステップS804からS808を繰り返す。
<Repeated Processing> In step S804, the variable RQ is shifted left by one bit. ● In step S805 (when RQ ≧ DV)
Subtracts DV from RQ in step S806 and adds 1 to RQ in step S807 to set the partial quotient to 1. (RQ
In the case of <DV), the partial quotient becomes 0, and step S80
6, S807 is not performed. ● Then, in step S808, steps S804 to S808 are repeated until the number of times reaches N.

【0010】<終了処理> ● ステップS809において、変数RQの上位には剰
余rが、変数RQの下位には商qが求められる。このよ
うな、シフトと減算の繰り返しによる整数除算では、被
除数および除数の値に関わらずすべての桁について計算
されるため、整数除算の語長だけ繰り返して計算され
る。そのため、除算処理時間が長くなるという問題があ
った。
<End Processing> In step S809, a remainder r is obtained above the variable RQ, and a quotient q is obtained below the variable RQ. In such integer division by repetition of shift and subtraction, since the calculation is performed for all digits regardless of the values of the dividend and the divisor, the calculation is repeated by the word length of the integer division. Therefore, there has been a problem that the division processing time becomes long.

【0011】そこで、上記のような問題点を解決しよう
とした従来方法としては、特開平7−244578号公
報に開示されているようなものがあった。それによる
と、桁合わせ処理により被除数aのシフト量を決定し、
この桁合わせ処理で得られたシフト量で被除数aをシフ
トしたビット位置から従来の除算手法を行うことによ
り、語長とシフト量の差分のビット数に対して除算を行
うので、繰り返し回数を語長より少なくした整数除算を
行うことができる。
Therefore, as a conventional method for solving the above-mentioned problems, there is a method disclosed in Japanese Patent Application Laid-Open No. Hei 7-244578. According to this, the shift amount of the dividend a is determined by digit alignment processing,
By performing the conventional division method from the bit position obtained by shifting the dividend a by the shift amount obtained by the digit alignment processing, the division is performed on the number of bits of the difference between the word length and the shift amount. Integer division with less than length can be performed.

【0012】以下、図9のフローチャートを参照して、
従来の桁合わせ処理による整数除算方法の一例について
説明する。 <初期処理> ● ステップS901において、被除数aを変数RQに
代入する。 ● ステップS902において、除数bを左に16ビッ
トシフトして、除数bを変数DVに代入する。 ● ステップS920において、桁合わせ処理を行い被
除数aのシフト量Sを決定する(桁合わせ処理は図10
で説明する)。 ● ステップS903において、繰返し回数Nを語長か
ら桁合わせシフト量Sを減算した値に設定する。 ● ステップS930において、桁合わせ処理で得られ
たシフト量Sだけ被除数aを左にシフトする。
Hereinafter, referring to the flowchart of FIG.
An example of a conventional integer division method by digit alignment processing will be described. <Initial processing> ● In step S901, the dividend a is substituted for a variable RQ. In step S902, the divisor b is shifted left by 16 bits, and the divisor b is substituted for the variable DV. In step S920, digit alignment processing is performed to determine the shift amount S of the dividend a.
Will be explained). In step S903, the number of repetitions N is set to a value obtained by subtracting the digit shift amount S from the word length. In step S930, the dividend a is shifted to the left by the shift amount S obtained by the digit alignment processing.

【0013】<繰返し処理>上記従来例と同じである。 ● 以下のステップS904からステップS909まで
は、上記従来の手法を実行する。
<Iterative processing> Same as the above conventional example. ● In the following steps S904 to S909, the above-described conventional method is executed.

【0014】次に、図10のフローチャートおよび図1
1のシフト量Sの決定手順の一例を参照して、図9のス
テップS920に示すシフト量Sの決定手順の詳細を説
明する。ここでは、例として、被除数a=601、除数
b=33の場合のシフト量Sを求める動作を説明する。
まず、図11に示すように、変数RQには値601(バ
イナリ数:W10−1に示す)が、変数DVには値(3
3<<16(16ビット左シフトされたバイナリ数3
3))が設定されているものとする。〔W10−1の状
態〕 以下、WQおよびW10等の文字は計算の中間結果を意
味する。
Next, the flowchart of FIG.
The details of the procedure for determining the shift amount S shown in step S920 of FIG. 9 will be described with reference to an example of the procedure for determining the shift amount S. Here, as an example, an operation of calculating the shift amount S when the dividend a = 601 and the divisor b = 33 will be described.
First, as shown in FIG. 11, the variable RQ has a value 601 (binary number: indicated by W10-1), and the variable DV has a value (3
3 << 16 (16-bit left-shifted binary number 3
It is assumed that 3)) is set. [State of W10-1] Hereinafter, characters such as WQ and W10 mean an intermediate result of the calculation.

【0015】<初期処理>ステップS921において、
シフト量Sを0に初期化する。ステップS922におい
て、シフト幅中間値Tを語長の半分に設定し、ここでは
T=8となる。
<Initial processing> In step S921,
The shift amount S is initialized to zero. In step S922, the shift width intermediate value T is set to half the word length, and here T = 8.

【0016】<繰返し1回目>ステップS923におい
て、今回のシフト量S=0+8を決定する。ステップS
924において、変数RQを今回のシフト量S=8だけ
左シフトする。〔W10−2の状態〕 ステップS925において、WQとDVの大小関係を判
定し、WQがDVより小さいのでステップS927へ進
む。ステップS927において、シフト幅中間値Tを現
在の半分に設定する。ここではT=4となる。ステップ
S928において、シフト幅中間値Tは0ではないの
で、繰返し処理を行う。
<First iteration> In step S923, the current shift amount S = 0 + 8 is determined. Step S
At 924, the variable RQ is shifted leftward by the current shift amount S = 8. [State of W10-2] In step S925, the magnitude relationship between WQ and DV is determined. Since WQ is smaller than DV, the process proceeds to step S927. In step S927, the shift width intermediate value T is set to half the current value. Here, T = 4. In step S928, since the shift width intermediate value T is not 0, the repetition processing is performed.

【0017】<繰返し2回目>ステップS923におい
て、今回のシフト量S=8+4を決定する。ステップS
924において、変数RQを今回のシフト量S=12で
左シフトする。〔W10−3の状態〕 ステップS925において、WQとDVの大小関係を判
定し、WQはDVより大きくなりすぎたのでステップS
926において、シフト量S=12−4にして元に戻
す。ステップS927において、シフト幅中間値Tを現
在の半分に設定する。ここではT=2となる。ステップ
S928において、シフト幅中間値Tは0ではないの
で、繰返し処理を行う。
<Second iteration> In step S923, the current shift amount S = 8 + 4 is determined. Step S
At 924, the variable RQ is shifted leftward by the current shift amount S = 12. [State of W10-3] In step S925, the magnitude relationship between WQ and DV is determined. Since WQ has become too larger than DV, step S925 is performed.
At 926, the shift amount S is set to 12-4, and the original value is restored. In step S927, the shift width intermediate value T is set to half the current value. Here, T = 2. In step S928, since the shift width intermediate value T is not 0, the repetition processing is performed.

【0018】<繰返し3回目>ステップS923におい
て、今回のシフト量S=8+2を決定する。ステップS
924において、変数RQを今回のシフト量S=10で
左シフトする。〔W10−4の状態〕 ステップS925において、WQとDVの大小関係を判
定し、WQはDVよりまだ小さいのでステップS927
へ進む。ステップS927において、シフト幅中間値T
を現在の半分に設定する。ここではT=1となる。ステ
ップS928において、、シフト幅中間値Tは0ではな
いので、繰返し処理を行う。
<Third iteration> In step S923, the current shift amount S = 8 + 2 is determined. Step S
At 924, the variable RQ is shifted to the left by the current shift amount S = 10. [State of W10-4] In step S925, the magnitude relationship between WQ and DV is determined. Since WQ is still smaller than DV, step S927 is performed.
Proceed to. In step S927, the shift width intermediate value T
Is set to half of the current. Here, T = 1. In step S928, since the shift width intermediate value T is not 0, the repetition processing is performed.

【0019】<繰返し4回目>ステップS923におい
て、今回のシフト量S=10+1を決定する。ステップ
S924において、変数RQを今回のシフト量S=11
で左シフトする。〔W10−5の状態〕 ステップS925において、WQとDVの大小関係を判
定し、WQはDVよりまだ小さいのでステップS927
へ進む。ステップS927において、シフト幅中間値T
を現在の半分に設定する。ここではT=0となる。ステ
ップS928において、シフト幅中間値Tは0であるの
で、繰返し処理を終了する。
<Fourth iteration> In step S923, the current shift amount S = 10 + 1 is determined. In step S924, the variable RQ is set to the current shift amount S = 11.
To shift left. [State of W10-5] In step S925, the magnitude relationship between WQ and DV is determined. Since WQ is still smaller than DV, step S927 is performed.
Proceed to. In step S927, the shift width intermediate value T
Is set to half of the current. Here, T = 0. In step S928, since the shift width intermediate value T is 0, the repetition processing ends.

【0020】以上説明したように、このシフト量Sの決
定手順は、二分探索のアルゴリズムにより、シフト幅中
間値を語長から半分半分と小さくして、被除数aと除数
bの大小関係によりシフト増分方向を左右に切替えて、
目的のシフト位置まで収束させて、シフト量Sを決定す
るというものである。
As described above, the procedure for determining the shift amount S is to reduce the shift width intermediate value to half of the word length by the binary search algorithm, and to determine the shift increment by the magnitude relationship between the dividend a and the divisor b. Switch the direction left and right,
The shift amount S is determined by converging to a target shift position.

【0021】[0021]

【発明が解決しようとする課題】しかしながら、上記第
1の従来技術の整数除算アルゴリズムを、除算器の有し
ていないDSP等においてソフトウェアで実現した場
合、1ビットあたり4ステップの手順を必要とし、さら
に被除数a、除数bの値に関わらず全ての桁について計
算が必要なため、除算にかかる時間コストは、最小でも
語長回数×4ステップを必要とし、例えば、16ビット
語長の場合は、16回×4ステップ=64ステップを必
要とするため、除算処理時間が大きいという問題があっ
た。
However, when the above-described integer division algorithm of the first prior art is realized by software in a DSP or the like that does not have a divider, a procedure of 4 steps per bit is required, Further, since calculation is required for all digits regardless of the values of the dividend a and the divisor b, the time cost required for the division requires a minimum of word length times × 4 steps. For example, in the case of a 16-bit word length, Since 16 times × 4 steps = 64 steps are required, there is a problem that the division processing time is long.

【0022】また、桁合わせ処理により繰り返し回数を
語長より少なくした第2の従来技術の除算方法では、除
算の繰返し回数を減少させることはできるが、桁合わせ
処理において、log2 N回(Nは語長)のシフト手順
と比較手順とシフト増分値の決定などに対し5ステップ
の手順を要し、従来の除算処理に入る前処理の手順が多
く、また語長が長くなればなるほど桁合わせ処理量が増
大し、例えば、16ビット語長の場合は、桁合わせ処理
にlog2 16×5=20ステップを必要とする等、除
算処理時間が大きいという問題があった。
In the second prior art division method in which the number of repetitions is made smaller than the word length by digit alignment processing, the number of repetitions of division can be reduced, but in the digit alignment processing, log 2 N times (N 5 steps are required for the shift procedure of the word length), the comparison procedure, and the determination of the shift increment value. There are many pre-processing procedures for the conventional division process, and the longer the word length, the more the digit alignment. processing amount is increased, for example, in the case of 16-bit word length, etc. require log 2 16 × 5 = 20 steps digit alignment treatment, there is a problem that division processing time is greater.

【0023】さらに、桁合わせ回路により繰り返し回数
を語長より少なくした第2の従来技術の除算装置では、
処理量の増大に加え、桁合わせを行うためにシフト量決
定回路の規模が大きくなるという問題があった。
Further, in the second prior art division device in which the number of repetitions is made smaller than the word length by a digit matching circuit,
In addition to an increase in the processing amount, there is a problem that the scale of the shift amount determination circuit becomes large in order to perform digit alignment.

【0024】本発明は、上記のような従来の問題を解決
するためになされたもので、回路規模を増大せずに、除
算処理量を減少して高速な整数除算を実現する整数除算
方法および整数除算装置を提供するものである。
SUMMARY OF THE INVENTION The present invention has been made to solve the above-mentioned conventional problems, and an integer division method for realizing a high-speed integer division by reducing the amount of division processing without increasing the circuit scale. An integer division device is provided.

【0025】[0025]

【課題を解決するための手段】本発明における整数除算
方法は、被除数から除数を減算したときに部分剰余と部
分商とが同時に求めるべく除算処理前に前記除数を変換
し、被除数を1ビットづつ左シフトしながら前記被除数
から除数を繰返し減算して各桁の商を求めるという構成
を有している。この構成により、被除数から除数を減算
したときに部分剰余と部分商とが同時に求められるよう
除数を変換することにより、部分剰余を求める手順と部
分商を求める手順とが同時に行なわれ、除算処理におい
て1工程節約することができる。
The integer division method according to the present invention converts the divisor before the division processing so that the partial remainder and the partial quotient are simultaneously obtained when the divisor is subtracted from the dividend, and the dividend is divided by one bit. The divisor is repeatedly subtracted from the dividend while shifting to the left, and the quotient of each digit is obtained. According to this configuration, the divisor is converted so that the partial remainder and the partial quotient are simultaneously obtained when the divisor is subtracted from the dividend, so that the procedure for obtaining the partial remainder and the procedure for obtaining the partial quotient are simultaneously performed. One process can be saved.

【0026】本発明における整数除算方法は、被除数の
最上位桁に続く0からなる無効ビット数をもとに概算に
より前記被除数のシフト量を求め、求めた前記シフト量
だけ前記被除数を左シフトし、左シフトしたビット位置
から1ビットづつ左シフトしながら前記被除数から前記
除数を繰返し減算する各工程からなるという構成を有し
ている。この構成により、部分剰余と部分商とが同時に
求められる上、被除数の最上位桁に続く0からなる無効
ビット数をもとに被除数を左シフトすることにより、事
前に除算処理手順の冗長な演算を削減し、除算処理手順
の繰返し回数を減少させることができる。
According to the integer division method of the present invention, the shift amount of the dividend is obtained by rough estimation based on the number of invalid bits consisting of 0 following the most significant digit of the dividend, and the dividend is left-shifted by the obtained shift amount. , And repeatedly subtracting the divisor from the dividend while shifting left by one bit from the left-shifted bit position. According to this configuration, the partial remainder and the partial quotient are obtained simultaneously, and the dividend is left-shifted based on the number of invalid bits consisting of 0s following the most significant digit of the dividend, whereby the redundant operation of the division processing procedure is performed in advance. Can be reduced, and the number of repetitions of the division processing procedure can be reduced.

【0027】本発明における整数除算方法は、被除数の
最上位桁に続く0からなる無効ビット数と除数の最上位
桁に続く0からなる無効ビット数とをもとに概算により
前記被除数の最終的なシフト量を求め、求めた最終的な
シフト量だけ前記被除数を左シフトし、左シフトしたビ
ット位置から1ビットづつ左シフトしながら前記被除数
から前記除数を繰返し減算して各桁の商を求めるという
構成を有している。この構成により、部分剰余と部分商
とが同時に求められる上、被除数の最上位桁に続く0か
らなる無効ビット数と、除数の最上位桁に続く0からな
る無効ビット数とをもとに被除数を左シフトすることに
より、事前に除算処理手順の冗長な演算を削減し、除算
処理手順の繰返し回数を減少させることができる。
In the integer division method according to the present invention, the final number of the dividend is approximated based on the number of invalid bits consisting of 0 following the most significant digit of the dividend and the number of invalid bits consisting of 0 following the most significant digit of the divisor. The dividend is left-shifted by the obtained final shift amount, and the divisor is repeatedly subtracted from the dividend while shifting left by one bit from the left-shifted bit position to obtain a quotient of each digit. It has the structure of. With this configuration, the partial remainder and the partial quotient are simultaneously obtained, and the dividend is calculated based on the number of invalid bits consisting of 0 following the most significant digit of the dividend and the number of invalid bits consisting of 0 following the most significant digit of the divisor. Is shifted to the left, redundant operations in the division procedure can be reduced in advance, and the number of repetitions of the division procedure can be reduced.

【0028】本発明における整数除算装置は、入力した
被除数の最上位桁に続く0からなる無効ビット数をもと
に概算により前記被除数のシフト量を求める第1の桁合
わせ回路と、求めた前記シフト量だけ前記被除数を左シ
フトするシフト回路と、左シフトしたビット位置から1
ビットづつ左シフトしながら前記被除数から前記除数を
繰返し減算して各桁の商を求める除算回路とを備えると
いう構成を有している。この構成により、第1の桁合わ
せ回路により被除数の最上位桁に続く無効ビット数から
被除数のシフト量を荒い概算で決定し、被除数をシフト
回路により左シフトすることにより、事前に除算回路の
冗長な演算を削減して、回路規模を増大せずに、除算回
路における繰返し処理回数を減少させることができる。
The integer division device according to the present invention comprises: a first digit matching circuit for roughly calculating the shift amount of the dividend based on the number of invalid bits consisting of 0s following the most significant digit of the input dividend; A shift circuit that shifts the dividend to the left by a shift amount;
And a division circuit for repeatedly subtracting the divisor from the dividend while shifting left by a bit to obtain a quotient of each digit. With this configuration, the shift amount of the dividend is roughly determined from the number of invalid bits following the most significant digit of the dividend by the first digit matching circuit, and the dividend is left-shifted by the shift circuit, whereby the redundancy of the division circuit is determined in advance. The number of repetitive processes in the division circuit can be reduced without increasing the number of operations and increasing the circuit scale.

【0029】本発明における整数除算装置は、入力した
被除数の最上位桁に続く0からなる無効ビット数と入力
した除数の最上位桁に続く0からなる無効ビット数とを
もとに概算により前記被除数のシフト量を求める第2の
桁合わせ回路と、求めた前記シフト量だけ前記被除数を
左シフトするシフト回路と、左シフトした前記ビット位
置から1ビットづつ左シフトしながら前記被除数から前
記除数を繰返し減算して各桁の商を求める除算回路とを
備えるという構成を有している。この構成により、第1
の桁合わせ回路により被除数および除数の最上位桁に続
く無効ビット数から被除数のシフト量を概算で決定し、
被除数をシフト回路により左シフトすることにより、事
前に除算回路の冗長な演算を削減して、回路規模を増大
せずに、除算回路における繰返し処理回数を減少させる
ことができる。
The integer division device according to the present invention approximates the number of invalid bits consisting of 0 following the most significant digit of the input dividend and the number of invalid bits consisting of 0 following the most significant digit of the inputted divisor. A second digit alignment circuit for calculating the shift amount of the dividend, a shift circuit for shifting the dividend left by the determined shift amount, and calculating the divisor from the dividend while shifting left by one bit from the bit position left shifted. And a division circuit for repeatedly subtracting to obtain a quotient of each digit. With this configuration, the first
The shift amount of the dividend is roughly determined from the number of invalid bits following the most significant digit of the dividend and the divisor by the digit matching circuit of
By shifting the dividend to the left by the shift circuit, redundant operations of the division circuit can be reduced in advance, and the number of repetitive processes in the division circuit can be reduced without increasing the circuit scale.

【0030】本発明における整数除算装置は、入力した
被除数の最上位桁に続く0からなる無効ビット数と入力
した除数の最上位桁に続く0からなる無効ビット数とを
もとに概算によりシフト量を算出する概算桁合わせ回路
と、算出したシフト量だけ前記被除数を左シフトする左
シフタと、被除数から除数を減算したときに部分剰余と
部分商とが同時に求められるよう除算処理前に前記除数
を変換する除数変換部と、左シフトされた前記被除数を
1ビットづつ左シフトしながら変換された前記除数を繰
返し減算して各桁の商を求める除算処理部とを備えると
いう構成を有している。この構成により、除数変換手段
により被除数から除数を減算したときに部分剰余と部分
商とが同時に求められるよう除数を変換することによ
り、除算回路による除算処理において1工程節約するこ
とができる上、桁合わせ回路により被除数および除数の
最上位桁に続く無効ビット数から被除数のシフト量を概
算で決定し、被除数をシフト回路によりそのシフト量だ
け左シフトすることにより、事前に除算回路の冗長な演
算を削減して、回路規模を増大せずに、除算回路におけ
る繰返し処理回数を減少させることができる。
The integer division device according to the present invention shifts by approximation based on the number of invalid bits consisting of 0 following the most significant digit of the input dividend and the number of invalid bits consisting of 0 following the most significant digit of the inputted divisor. An approximate digit matching circuit for calculating the quantity, a left shifter for shifting the dividend to the left by the calculated shift amount, and the divisor before the division process so that a partial remainder and a partial quotient are obtained simultaneously when the divisor is subtracted from the dividend. And a division processing unit for repeatedly subtracting the converted divisor while shifting the dividend left-shifted by one bit to the left to obtain a quotient of each digit. I have. With this configuration, the divisor is converted so that the partial remainder and the partial quotient are obtained at the same time when the divisor is subtracted from the dividend by the divisor conversion means, so that one step can be saved in the division process by the division circuit. Approximately determining the shift amount of the dividend from the dividend and the number of invalid bits following the most significant digit of the divisor by the matching circuit, and shifting the dividend to the left by the shift amount by the shift circuit to perform the redundant operation of the division circuit in advance. It is possible to reduce the number of repetitive processes in the division circuit without reducing the circuit scale.

【0031】本発明における記録媒体は、請求項1ない
し3のいずれかに記載の整数除算方法における各処理工
程をコンピュータに実行させるためのプログラムをコン
ピュータ読み取り可能に記録したという構成を有してい
る。この構成により、本発明における整数除算方法を実
現するプログラムを複数種類の記録媒体に格納し、他の
コンピュータで読み取ることができるようにする。
The recording medium according to the present invention has a configuration in which a program for causing a computer to execute each processing step in the integer division method according to any one of claims 1 to 3 is recorded in a computer-readable manner. . With this configuration, a program that implements the integer division method according to the present invention is stored in a plurality of types of recording media, and can be read by another computer.

【0032】[0032]

【発明の実施の形態】以下、添付図面に基づき、本発明
の第1ないし第7の実施の形態を詳細に説明する。 (第1の実施の形態)まず、図2のフローチャートを参
照して、本発明の第1の実施の形態における整数除算方
法の処理手順(処理工程)について説明する。本実施の
形態では、図12に見られるように、変数RQの上位に
は部分剰余a’が、下位には部分商a”が設定され、変
数DVには(除数b<<16−1)が設定されるものと
する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, first to seventh embodiments of the present invention will be described in detail with reference to the accompanying drawings. (First Embodiment) First, a processing procedure (processing step) of an integer division method according to a first embodiment of the present invention will be described with reference to a flowchart of FIG. In the present embodiment, as shown in FIG. 12, a partial remainder a 'is set at an upper position of a variable RQ, and a partial quotient a "is set at a lower position, and (divisor b << 16-1) is set as a variable DV. Is set.

【0033】<初期処理> ● ステップS201において、被除数aを変数RQに
代入する。 ● 除数変換ステップS202において、除数bを左に
16ビットシフトしたものから1引いた値を変数DVに代
入する。(※従来例との相違点は、1を減じることであ
る) ● ステップS203において、整数除算の語長を繰り
返し回数を表す変数Nに代入する。
<Initial Processing> In step S201, the dividend a is substituted for a variable RQ. ● In the divisor conversion step S202, the divisor b is shifted to the left.
The value obtained by subtracting 1 from the value shifted by 16 bits is substituted for the variable DV. (* The difference from the conventional example is that 1 is subtracted.) In step S203, the word length of the integer division is substituted into a variable N representing the number of repetitions.

【0034】<繰返し処理> ● ステップS204において、変数RQ(部分被除数
・部分商)を左に1ビットシフトする。 ● ステップS205において、〔RQ>DVの場合〕
は、ステップS206において、RQからDVを引くだ
けで、部分商を1とする。(※従来例との相違点は、不
等号のイコールの有無である) 〔RQ≦DVの場合〕は、部分商は0となり、ステップ
S206は行わず、ステップS207に進む。 ● ステップS207において、N回に達するまで、ス
テップS204からS207を繰り返す。
<Repetition Processing> In step S204, the variable RQ (partial dividend / partial quotient) is shifted one bit to the left. ● In step S205, [if RQ> DV]
Sets the partial quotient to 1 only by subtracting DV from RQ in step S206. (* The difference from the conventional example is the presence or absence of an equality sign.) [In the case of RQ ≦ DV], the partial quotient becomes 0, and the process proceeds to step S207 without performing step S206. ● In step S207, steps S204 to S207 are repeated until N times are reached.

【0035】<終了処理> ● ステップS208において、変数RQの上位には剰
余rが、変数RQの下位には商qが求められる。
<End Processing> In step S208, the remainder r is obtained above the variable RQ, and the quotient q is obtained below the variable RQ.

【0036】次に、図12の動作原理の説明図を参照し
て、本発明の第1の実施の形態における整数除算方法の
動作原理を詳細に説明する。本実施の形態では、変数R
Qの上位には部分剰余a’が、下位には部分商a”が設
定され、変数DVには、(除数b<<16−1)を設定
しているので、変数DVの上位には(除数b−1)が、
下位には(−1)が設定されていることになる。〔RQ
>DVの場合〕、すなわち RQ>b−1の場合は、R
Q←RQ−DVの減算が行われ、変数RQの下位は、
a”−(−1)でa”+1となる。変数RQの上位は、
下位からのボーローがあるので、a’−1−(b−1)
でa’−bとなる 〔RQ=DVの場合〕、すなわち RQ=b−1となり
RQ<bであるから何も演算を行わない。〔RQ<DV
の場合〕、すなわち RQ<b−1となりRQ<bであ
るから何も演算を行わない。従って、従来方式と等価な
演算が行われる。
Next, the operation principle of the integer division method according to the first embodiment of the present invention will be described in detail with reference to FIG. In the present embodiment, the variable R
The partial remainder a 'is set at the upper part of Q, the partial quotient a "is set at the lower part, and (divisor b << 16-1) is set as the variable DV. The divisor b-1) is
That is, (−1) is set in the lower order. [RQ
> DV], that is, if RQ> b-1, then R
Q ← RQ−DV is subtracted, and the lower order of the variable RQ is
a ″ +1 is obtained by a ″ − (− 1). The top of the variable RQ is
Since there is a Borrow from the bottom, a'-1- (b-1)
[In the case of RQ = DV], that is, RQ = b−1, and since RQ <b, no operation is performed. [RQ <DV
In other words, RQ <b-1 and RQ <b, so that no operation is performed. Therefore, an operation equivalent to the conventional method is performed.

【0037】以上説明したように、本発明の第1の実施
の形態によれば、除算の繰返し手順の前に除数変換ステ
ップS202を追加することにより、繰返し手順の中の
ステップS206により、被除数aから除数bを減算し
て部分剰余を求める手順と部分商を求める手順とを同時
に行うことが可能となり、従来1ビットあたり4ステッ
プの手順を必要としていたものが3ステップの手順で行
うことができ、1ビットあたりの処理量を減少させるこ
とができる。
As described above, according to the first embodiment of the present invention, by adding the divisor conversion step S202 before the repetition procedure of division, the dividend a The procedure for obtaining the partial remainder by subtracting the divisor b from the above and the procedure for obtaining the partial quotient can be performed at the same time, and the procedure which conventionally required a 4-step procedure per bit can be performed in a 3-step procedure. , The amount of processing per bit can be reduced.

【0038】例えば、16ビット語長の場合は、従来1
6回×4ステップ=64ステップを必要としていた処理
量が、16回×3ステップ=48ステップの処理量に減
らすことができ、整数除算を高速に行うことができる。
For example, in the case of a 16-bit word length,
The processing amount that required 6 steps × 4 steps = 64 steps can be reduced to the processing amount of 16 times × 3 steps = 48 steps, and integer division can be performed at high speed.

【0039】(第2の実施の形態)次に、図3のフロー
チャートを参照して、本発明の第2の実施の形態におけ
る、被除数の桁合わせ処理によりそのシフト量を算出す
る整数除算方法の処理手順について説明する。 <初期処理> ● ステップS301のリーディングゼロ(Leading Ze
ro)処理において、被除数aのMSB(最上位桁)に続
く0からなる無効なビット数を求める。このビット数を
そのまま、荒い概算として桁合わせのシフト量Sとす
る。 ● ステップS302において、被除数aをシフト量S
だけ左シフトして、変数RQに代入する。 ● 除数変換ステップS303において、除数bを左に
16ビットシフトしたものから1引いた値を変数DVに代
入する。 ● ステップS304において、整数除算の語長から先
にシフトしたシフト量Sを減じた値を繰り返し回数とし
て変数Nに代入する。 <繰返し処理>ステップS305以下の繰返し処理は、
上記の第1の実施の形態のものと同様である。
(Second Embodiment) Next, referring to a flowchart of FIG. 3, an integer division method for calculating a shift amount by digit alignment processing of a dividend in a second embodiment of the present invention. The processing procedure will be described. <Initial processing> ● Leading zero in step S301
ro) In the process, an invalid bit number consisting of 0 following the MSB (most significant digit) of the dividend a is obtained. This bit number is used as a rough approximation as the shift amount S for digit alignment. In step S302, the dividend a is shifted by the shift amount S
Is shifted to the left, and assigned to the variable RQ. ● In the divisor conversion step S303, the divisor b is shifted to the left.
The value obtained by subtracting 1 from the value shifted by 16 bits is substituted for the variable DV. In step S304, a value obtained by subtracting the shift amount S shifted earlier from the word length of the integer division is substituted into the variable N as the number of repetitions. <Repeated processing> The repeated processing from step S305
This is the same as that of the first embodiment.

【0040】次に、図13の動作原理の説明図を参照し
て、本発明の第2の実施の形態における、被除数の桁合
わせ処理によりそのシフト量を算出する整数除算方法の
動作原理を詳細に説明する。ここでは、被除数a=60
1、除数b=33の場合の動作を説明する。図13にお
いて、被除数aのMSB(最上位桁)に続く無効な0が
続く間は、少なくとも、ステップS306の(RQ>D
V)は成立しない。すなわち、無駄な繰返し処理を行っ
ていることになる。そのため、被除数aの値601のM
SB(最上位桁)に続く0をリーディングゼロ手順によ
りカウントするとS=6ビットとなる。このシフト量S
を桁合わせ処理の荒い概算として使用し、ステップS3
02であらかじめ被除数aをシフトしておくことによ
り、除算処理手順の冗長な演算を削減することができ
る。
Next, the operation principle of the integer division method for calculating the shift amount by digit alignment processing of the dividend in the second embodiment of the present invention will be described in detail with reference to the explanatory view of the operation principle of FIG. Will be described. Here, the dividend a = 60
The operation when 1, the divisor b = 33 will be described. In FIG. 13, as long as the invalid 0 following the MSB (most significant digit) of the dividend a continues, at least (RQ> D
V) does not hold. That is, useless repetitive processing is performed. Therefore, M of the value 601 of the dividend a
When 0 following the SB (most significant digit) is counted by the leading zero procedure, S = 6 bits. This shift amount S
Is used as a rough estimate of the digit alignment process, and the
By shifting the dividend a in advance at 02, redundant calculations in the division processing procedure can be reduced.

【0041】以上説明したように、本発明の第2の実施
の形態によれば、除算の繰返し手順の前に、桁合わせ処
理として、ステップS301で荒い概算でシフト量を求
め、この桁合わせ処理の荒い概算で得られた最終的なシ
フト量で被除数aをシフトしたビット位置から除算を行
うことにより、少ない手順で繰返し回数を減少させるこ
とができる。但し、概算精度が荒いため、繰返し回数は
従来の桁合わせ処理に比べて多くなるが、桁合わせ処理
量は、従来のlog2 N(Nは語長)×5ステップに比
べ、わずか2ステップに減少させることができ、また語
長にも影響されず少なくなる。特に、被除数aの値が小
さい時に効果が大きい。例えば、16ビット語長の場合
は、桁合わせ処理において従来log2 16×5ステッ
プ=20ステップを必要としていた処理量が、2ステッ
プの処理量に減らすことができ、整数除算を高速に行う
ことができる。
As described above, according to the second embodiment of the present invention, prior to the repetition procedure of division, as a digit alignment process, a rough shift is calculated in step S301 to obtain a shift amount. By performing the division from the bit position where the dividend a is shifted by the final shift amount obtained by the rough estimation, the number of repetitions can be reduced with a small number of procedures. However, the number of repetitions is larger than that of the conventional digit alignment processing because of the rough estimation accuracy, but the digit alignment processing amount is only two steps compared to the conventional log 2 N (N is the word length) × 5 steps. It can be reduced and it is not affected by the word length. In particular, the effect is large when the value of the dividend a is small. For example, in the case of a 16-bit word length, the processing amount which conventionally required log 2 16 × 5 steps = 20 steps in the digit alignment processing can be reduced to the processing amount of 2 steps, and the integer division can be performed at high speed. Can be.

【0042】(第3の実施の形態)次に、図4のフロー
チャートを参照して、本発明の第3の実施の形態におけ
る、被除数および除数の桁合わせ処理により被除数のシ
フト量を算出する整数除算方法の処理手順について説明
する。 <初期処理> ● ステップS401のリーディングゼロ処理におい
て、被除数aのMSB(最上位桁)に続く0からなる無
効なビット数S1を求める。 ● ステップS402のリーディングゼロ処理におい
て、除数bのMSB(最上位桁)に続く0からなる無効
なビット数S2を求める。 ● ステップS403において、桁合わせのシフト量S
=S1−S2+15を概算で求める。 ● ステップS404において、被除数aをシフト量S
だけ左シフトして、変数RQに代入する。 ● 除数変換ステップS405において、除数bを左に
16ビットシフトしたものから1引いた値を、除数bを
格納する変数DVに代入する。 ● ステップS406において、整数除算の語長から先
にシフトしたシフト量Sを減じた値を繰り返し回数を表
す変数Nに代入する。 <繰返し処理>ステップS407以下の繰返し処理は、
上記の第1の実施の形態のものと同様である。
(Third Embodiment) Next, with reference to the flowchart of FIG. 4, an integer for calculating a shift amount of a dividend by digit alignment processing of a dividend and a divisor in a third embodiment of the present invention. The processing procedure of the division method will be described. <Initial processing> In the leading zero processing of step S401, an invalid bit number S1 consisting of 0 following the MSB (most significant digit) of the dividend a is obtained. In the leading zero process of step S402, an invalid bit number S2 consisting of 0 following the MSB (most significant digit) of the divisor b is obtained. ● In step S403, a digit shift amount S
= S1-S2 + 15 is roughly calculated. In step S404, the dividend a is shifted by the shift amount S
Is shifted to the left, and assigned to the variable RQ. In the divisor conversion step S405, a value obtained by subtracting 1 from a value obtained by shifting the divisor b 16 bits to the left is substituted for a variable DV storing the divisor b. In step S406, a value obtained by subtracting the shift amount S shifted earlier from the word length of the integer division is substituted for a variable N representing the number of repetitions. <Repetition processing> The repetition processing from step S407 is as follows.
This is the same as that of the first embodiment.

【0043】次に、図14の動作原理の説明図を参照し
て、本発明の第3の実施の形態における、被除数および
除数の桁合わせ処理により被除数のシフト量を算出する
整数除算方法の動作原理を詳細に説明する。ここでは、
被除数a=601、除数b=33の場合の動作を説明す
る。被除数aのMSB(最上位桁)に続く無効な0が続
く間と除数bの有効なビットが続く間は、少なくとも、
ステップS408の(RQ>DV)は成立しない。すな
わち、無駄な繰返し処理を行っていることになる。そこ
で、被除数aの値601のMSB(最上位桁)に続く0
をリーディングゼロ手順でカウントするとS1=6ビッ
トとなる。次に、除数bの値33のMSB(最上位桁)
に続く0をリーディングゼロ手順でカウントするとS2
=10ビットとなる。シフト量S=S1+(16−S
2)−1=S1−S2+15を桁合わせ処理の概算とし
て使用し、ステップS404で被除数aをあらかじめシ
フトしておくことにより、除算処理手順の冗長な演算を
削減することができる。
Next, with reference to the explanatory diagram of the operation principle of FIG. 14, the operation of the integer division method for calculating the shift amount of the dividend by digit alignment of the dividend and the divisor in the third embodiment of the present invention. The principle will be described in detail. here,
The operation when the dividend a = 601 and the divisor b = 33 will be described. As long as the invalid 0 following the MSB (most significant digit) of the dividend a and the valid bits of the divisor b continue at least,
(RQ> DV) in step S408 does not hold. That is, useless repetitive processing is performed. Therefore, 0 following the MSB (most significant digit) of the value 601 of the dividend a
Are counted in the leading zero procedure, S1 = 6 bits. Next, the MSB (most significant digit) of the value 33 of the divisor b
When the following 0 is counted in the leading zero procedure, S2
= 10 bits. Shift amount S = S1 + (16−S
2) By using -1 = S1−S2 + 15 as an approximation for digit alignment processing and shifting the dividend a in advance in step S404, redundant calculations in the division processing procedure can be reduced.

【0044】以上説明したように、本発明の第3の実施
の形態によれば、除算の繰返し手順の前に、桁合わせ処
理として、ステップS401からステップS403にお
いて概算でシフト量を求め、この桁合わせ処理の概算で
得られた最終的なシフト量だけ被除数aをシフトし、シ
フトしたビット位置から除算を行うことにより、少ない
手順で除算の繰返し回数を減少させることができる。
As described above, according to the third embodiment of the present invention, before the repetition procedure of the division, as a digit alignment process, the shift amount is roughly calculated in steps S401 to S403. By shifting the dividend a by the final shift amount obtained by the approximation of the matching process and performing the division from the shifted bit position, the number of times of division can be reduced in a small number of steps.

【0045】本実施の形態における整数除算方法による
と、概算精度が高く、繰返し回数は従来の桁合わせ処理
に比べて同等か1回多くなるだけである。それに対し、
桁合わせ処理量は、従来のlog2 N(Nは語長)×5
ステップに比べ、わずか5ステップに減少させることが
でき、また語長にも影響されず少なくなる。上記例の被
除数a=601、除数b=33の場合は、従来方式と同
等である。もし、被除数a=601、除数b=40の場
合は、最初の判定で(RQ>DV)は成立しないので、
従来方式に比べて1回多くなるだけである。
According to the integer division method of the present embodiment, the accuracy of the estimation is high, and the number of repetitions is equal to or one more than that of the conventional digit alignment processing. For it,
The digit alignment processing amount is the conventional log 2 N (N is the word length) × 5.
The number of steps can be reduced to only 5 steps, and the number is not affected by the word length. The case where the dividend a = 601 and the divisor b = 33 in the above example is equivalent to the conventional method. If the dividend a = 601 and the divisor b = 40, since (RQ> DV) is not established in the first determination,
Only one increase compared to the conventional method.

【0046】例えば、16ビット語長の場合は、桁合わ
せ処理において、従来log2 16×5ステップ=20
ステップを必要としていた処理量が、5ステップの処理
量に減らすことができ、整数除算を高速に行うことがで
きる。
For example, in the case of a 16-bit word length, the conventional log 2 16 × 5 steps = 20
The processing amount that required a step can be reduced to a processing amount of five steps, and integer division can be performed at high speed.

【0047】(第4の実施の形態)次に、図5のブロッ
ク図を参照して、本発明の第4の実施の形態における整
数除算装置について説明する。図5に示す本実施の形態
における整数除算装置は、被除数aのリーディングゼロ
をカウントするリーディングゼロカウント回路(リーデ
ィングゼロ回路、以下同じ)521からなる荒い概算桁
合わせ回路520と、被除数aをリーディングゼロの数
だけ左シフトするシフタ(シフト回路)510と、リー
ディングゼロだけ左シフトした被除数aを除数bで除算
する除算器500とにより構成される。
(Fourth Embodiment) Next, an integer division device according to a fourth embodiment of the present invention will be described with reference to the block diagram of FIG. The integer division device according to the present embodiment shown in FIG. 5 includes a rough approximation digit matching circuit 520 including a leading zero count circuit (leading zero circuit, the same applies hereinafter) 521 for counting the leading zero of the dividend a, (Shift circuit) 510 that shifts left by the number of, and a divider 500 that divides the dividend a shifted left by leading zero by the divisor b.

【0048】すなわち、本実施の形態における整数除算
装置は、桁合わせ回路520におけるリーディングゼロ
回路521により、被除数aのMSB(最上位桁)に続
く無効な0をカウントし、この値を荒い概算のシフト量
Sとし、この荒い概算桁合わせ回路520の荒い概算に
よって得られた最終的なシフト量Sだけ、被除数aをシ
フタ510によりシフトしたビット位置から従来の除算
器500で除算を行う。
That is, in the integer dividing apparatus according to the present embodiment, the leading zero circuit 521 in the digit matching circuit 520 counts invalid 0s following the MSB (most significant digit) of the dividend a, and converts this value to a rough approximation. The conventional divider 500 divides the dividend a from the bit position shifted by the shifter 510 by the final shift amount S obtained by the rough approximation of the coarse approximation circuit 520 as the shift amount S.

【0049】以上説明したように、本発明の第4の実施
の形態によれば、荒い概算桁合わせ回路520で、荒い
概算によりシフト量を求め、この荒い概算桁合わせ回路
520の荒い概算で得られた最終的なシフト量により被
除数aをシフトしたビット位置から除算を行うことによ
り、結果が得られるまでのクロック数を減少させること
ができる。但し、概算精度が荒いため、桁合わせ後のク
ロック数は、従来の桁合わせ回路に比べて多くなる。荒
い概算桁合わせ回路520は、従来log2 N(Nは語
長)回の桁合わせでシフト量を求めていたのに比べ、荒
い概算桁合わせ回路520によりわずか1クロックによ
って求めることができ、語長にも影響されず少なくな
る。特に、被除数aの値が小さい時には効果が大きい。
回路規模も、被除数aのリーディングゼロ回路521の
追加のみであり、小規模な回路で実現することができ
る。
As described above, according to the fourth embodiment of the present invention, the rough approximate digit alignment circuit 520 obtains the shift amount by the rough estimation, and the rough approximate digit alignment circuit 520 obtains the shift amount. By performing division from the bit position where the dividend a is shifted by the final shift amount obtained, the number of clocks until a result is obtained can be reduced. However, because of the rough estimation accuracy, the number of clocks after digit alignment is larger than that of a conventional digit alignment circuit. The rough approximation digit matching circuit 520 can obtain the shift amount by only one clock by the rough approximation digit matching circuit 520 as compared with the case where the shift amount is obtained by log 2 N (N is the word length) conventionally. It is less affected by length. In particular, the effect is large when the value of the dividend a is small.
The circuit scale is only the addition of the leading zero circuit 521 of the dividend a, and can be realized by a small-scale circuit.

【0050】例えば、16ビット語長の場合は、荒い概
算桁合わせ回路520において従来log2 16=4回
の桁合わせでシフト量を求めていたのに対し、わずか1
クロックで求めることができ、回路規模を増大させず
に、整数除算を高速に行うことができる。
For example, in the case of a 16-bit word length, the rough approximate digit alignment circuit 520 conventionally calculates the shift amount by log 2 16 = 4 times alignment, but only 1
It can be obtained with a clock, and integer division can be performed at high speed without increasing the circuit scale.

【0051】(第5の実施の形態)次に、図6のブロッ
ク図を参照して、本発明の第5の実施の形態における整
数除算装置について説明する。図6に示す本実施の形態
における整数除算装置は、被除数aのリーディングゼロ
をカウントするリーディングゼロカウント回路(リーデ
ィングゼロ回路、以下同じ)621と、除数bのリーデ
ィングゼロをカウントするリーディングゼロ回路622
と、リーディングゼロ回路621の出力からリーディン
グゼロ回路622の出力を減算する減算器623と、減
算器623の出力に15を加算して概算シフト量を出力
する加算器624とからなる概算桁合わせ回路620
と、被除数aを概算シフト量の数だけ左シフトするシフ
タ610と、概算シフト量の数だけ左シフトした被除数
aを除数bで除算する除算器600とにより構成され
る。
(Fifth Embodiment) Next, an integer division apparatus according to a fifth embodiment of the present invention will be described with reference to the block diagram of FIG. The integer division device according to the present embodiment shown in FIG. 6 includes a leading zero count circuit (leading zero circuit, hereinafter the same) 621 for counting leading zero of dividend a and a leading zero circuit 622 for counting leading zero of divisor b.
An approximate digit matching circuit comprising: a subtractor 623 for subtracting the output of the leading zero circuit 622 from the output of the leading zero circuit 621; and an adder 624 for adding 15 to the output of the subtractor 623 and outputting an approximate shift amount. 620
And a shifter 610 that shifts the dividend a left by the approximate shift amount, and a divider 600 that divides the dividend a left shifted by the approximate shift amount by the divisor b.

【0052】すなわち、本実施の形態における整数除算
装置は、概算桁合わせ回路620において、リーディン
グゼロ回路621で被除数aのMSB(最上位桁)に続
く無効な0をカウントし、リーディングゼロ回路622
で除数bのMSB(最上位桁)に続く無効な0をカウン
トし、減算器623でリーディングゼロ回路621の出
力からリーディングゼロ回路622の出力を減算し、加
算器624で減算器623の出力に値15を加えた値を
概算のシフト量とし、この概算桁合わせ回路620の概
算で得られた最終的なシフト量でシフタ610により被
除数aをシフトしたビット位置から従来のように除算器
600で除算を行う。
That is, in the integer dividing apparatus according to the present embodiment, in the approximate digit matching circuit 620, the leading zero circuit 621 counts invalid 0 following the MSB (most significant digit) of the dividend a, and the leading zero circuit 622
, The invalid 0 following the MSB (most significant digit) of the divisor b is counted, the output of the leading zero circuit 622 is subtracted from the output of the leading zero circuit 621 by the subtractor 623, and the output of the subtractor 623 is output by the adder 624. The value obtained by adding the value 15 is regarded as an approximate shift amount, and the divider 600 is shifted from the bit position where the dividend a is shifted by the shifter 610 with the final shift amount obtained by the estimation of the approximate digit aligning circuit 620 as in the related art. Performs division.

【0053】以上説明したように、本発明の第5の実施
の形態によれば、概算桁合わせ回路620で、被除数a
と除数bの概算シフト量を求め、この概算桁合わせ回路
620の概算で得られた最終的なシフト量だけ被除数a
を左シフトし、左シフトしたビット位置から除数bを除
算することにより、従来方式に比べ、結果が得られるま
でのクロック数を減少させることができる。
As described above, according to the fifth embodiment of the present invention, the dividend a
And the approximate shift amount of the divisor b, and the dividend a by the final shift amount obtained by the approximate calculation of the approximate digit alignment circuit 620.
Is shifted to the left, and the divisor b is divided from the bit position shifted to the left, whereby the number of clocks until a result is obtained can be reduced as compared with the conventional method.

【0054】本実施の形態における整数除算装置の概算
桁合わせ回路620は、概算精度は高いにも関わらず、
桁合わせ後のクロック数は従来の桁合わせ回路に比べて
同等か1回多くなるだけである。概算桁合わせ回路62
0は、従来のlog2 N(Nは語長)回の桁合わせでシ
フト量を求めていたのに比べ、概算桁合わせ回路620
によりわずか1クロックで求めることができ、語長にも
影響されずに少なくなる。回路規模も、被除数aのリー
ディングゼロ回路、除数bのリーディングゼロ回路、減
算器および加算器の追加のみであり、小規模な回路で実
現することができる。
Although the approximate digit matching circuit 620 of the integer division device according to the present embodiment has a high approximate accuracy,
The number of clocks after digit matching is equal to or one more than that of the conventional digit matching circuit. Approximate digit matching circuit 62
0 is an approximate digit matching circuit 620 compared to the conventional method of finding the shift amount by log 2 N (N is word length) digit matching.
Can be obtained with only one clock, and the number is reduced without being affected by the word length. The circuit scale can be realized by a small-scale circuit only by adding a leading zero circuit of the dividend a, a leading zero circuit of the divisor b, a subtractor and an adder.

【0055】例えば、16ビット語長の場合は、概算桁合
わせ回路620において、従来log2 16=4回の桁
合わせでシフト量を求めていたのに対し、わずか1クロ
ックで求めることができ、回路規模を増大させずに、整
数除算を高速に行うことができる。
For example, in the case of a 16-bit word length, in the approximate digit alignment circuit 620, the shift amount can be obtained with only one clock, as compared with the conventional method in which log 2 16 = 4 times of alignment was obtained. Integer division can be performed at high speed without increasing the circuit scale.

【0056】(第6の実施の形態)本発明の実施の形態
における整数除算方法は、ソフトウェアプログラムによ
って実現することが可能であり、そのソフトウェアプロ
グラムをフロッピー(登録商標)ディスク等の記録媒体
に記録して移送することができる。記録媒体に記録した
ソフトウェアプログラムは独立した他のコンピュータ・
システムにより記録媒体から読み出して、本発明の実施
の形態を容易に実施することができる。
(Sixth Embodiment) The integer division method according to the embodiment of the present invention can be realized by a software program, and the software program is recorded on a recording medium such as a floppy (registered trademark) disk. Can be transported. The software program recorded on the recording medium is independent of other computer
The embodiment of the present invention can be easily implemented by reading from the recording medium by the system.

【0057】すなわち、コンピュータ・システムに接続
されたフロッピーディスク装置により、例えば、フロッ
ピーディスクのような記録媒体に対してソフトウェアプ
ログラムを記録し再生することができる。記録する場合
は、コンピュータ・システムのフロッピーディクス装置
よりソフトウェアプログラムをフロッピーディスクに記
録する。再生する場合は、フロッピーディスク装置によ
ってソフトウェアプログラムをフロッピーディスクから
読み出し、コンピュータ・システムに転送して実施する
ことができる。
That is, the software program can be recorded and reproduced on a recording medium such as a floppy disk by the floppy disk device connected to the computer system. When recording, a software program is recorded on a floppy disk from a floppy disk device of the computer system. When reproducing, a software program can be read from a floppy disk by a floppy disk device and transferred to a computer system for execution.

【0058】記録媒体としては、フロッピーディスクの
他に、光ディスク、光磁気ディクス等を用いても同様に
行うことができる。また、記録媒体は、これらに限られ
ず、ICカード、ROMカセット等、プログラムを記録
できるものであれば、如何なるものでも同様に実施する
ことができる。
As a recording medium, in addition to a floppy disk, an optical disk, a magneto-optical disk or the like may be used. Further, the recording medium is not limited to these, and any recording medium such as an IC card and a ROM cassette, which can record a program, can be similarly implemented.

【0059】(第7の実施の形態)次に、図1のブロッ
ク図を参照して、本発明の第7の実施の形態における整
数除算装置について説明する。本実施の形態における整
数除算装置は本発明の実施の形態における整数除算装置
の全体構成を示すものである。本実施の形態における整
数除算装置は、被除数aおよび除数bのリーディングゼ
ロをカウントして被除数aのシフト量を求める桁合わせ
処理部と、求めたシフト量だけ被除数aを左シフトする
左シフタ101と、被除数aから除数bを減算したとき
に部分剰余と部分商とが同時に求められるよう除数bを
変換する除数変換部102と、被除数aから除数bを減
算する除算処理部103と、ビット処理数をクロック
(CLK)によりカウントするカウンタ104と、カウ
ント結果をデコードするデコーダ105と、除算処理部
103の演算結果を出力するセレクタ106とにより構
成される。すなわち、本実施の形態における整数除算装
置は、第1の実施の形態ないし第5の実施の形態におけ
る整数除算装置を実現するための構成を全て備えたもの
である。
(Seventh Embodiment) Next, an integer division device according to a seventh embodiment of the present invention will be described with reference to the block diagram of FIG. The integer division device according to the present embodiment shows the entire configuration of the integer division device according to the embodiment of the present invention. The integer division device according to the present embodiment includes a digit alignment processing unit that counts leading zeros of a dividend a and a divisor b to determine a shift amount of a dividend a, and a left shifter 101 that shifts the dividend a left by the determined shift amount. A divisor conversion unit 102 for converting the divisor b so that a partial remainder and a partial quotient are simultaneously obtained when the divisor b is subtracted from the dividend a, a division processing unit 103 for subtracting the divisor b from the dividend a, A counter 104 counts the clock by a clock (CLK), a decoder 105 decodes the count result, and a selector 106 outputs a calculation result of the division processing unit 103. That is, the integer division device according to the present embodiment has all the components for realizing the integer division devices according to the first to fifth embodiments.

【0060】次に、図1を参照して、本発明の第7の実
施の形態における整数除算装置の動作を説明する。ま
ず、桁合わせ処理部100は、被除数aおよび除数bの
ビットパターンを調べ除算処理における冗長な演算を削
減するためのシフト量を概算で求め、左シフタ101と
デコーダ105に伝える。左シフタ101は、求めたシ
フト量に基づき被除数aを左にシフトする。除数変換部
102は、除数bを事前に、例えば、16ビット左シフ
トして1を減算して変換する。除算処理部103は、左
シフタ101の出力から加工された被除数aを入力し、
除数変換部102の出力から加工された除数bを入力
し、被除数aを1ビットづつ左シフトしながら部分被除
数aから除数bを減算して、各桁の商を繰返し求める引
き戻し法による整数除算を行う。
Next, the operation of the integer division device according to the seventh embodiment of the present invention will be described with reference to FIG. First, the digit alignment processing unit 100 checks the bit patterns of the dividend a and the divisor b, roughly calculates a shift amount for reducing redundant operations in the division process, and transmits the shift amount to the left shifter 101 and the decoder 105. The left shifter 101 shifts the dividend a to the left based on the obtained shift amount. The divisor conversion unit 102 converts the divisor b by, for example, shifting left by 16 bits and subtracting 1 in advance. The division processing unit 103 inputs the dividend a processed from the output of the left shifter 101,
Input the processed divisor b from the output of the divisor conversion unit 102, subtract the divisor b from the partial dividend a while shifting the dividend a left one bit at a time, and perform integer division by the pullback method for repeatedly obtaining the quotient of each digit. Do.

【0061】また、カウンタ104はCLKに同期して
除算処理のビット数をカウントアップする。デコーダ1
05はカウント結果をデコードして所定のカウントにな
るとセレクタ106に信号を出力し、セレクタ106は
除算処理部103の演算結果を選択して出力し、剰余r
と商qとが求められる。
The counter 104 counts up the number of bits of the division process in synchronization with CLK. Decoder 1
05 decodes the count result and outputs a signal to the selector 106 when the count reaches a predetermined count. The selector 106 selects and outputs the operation result of the division processing unit 103, and outputs the remainder r
And quotient q.

【0062】以上説明したように、本発明の第7の実施
の形態によれば、除数bを除数変換部102であらかじ
め変換することにより、除算処理部103におけるビッ
トあたりの除算処理量を減少させることができる。ま
た、桁合わせ処理部100において、被除数aと除数b
のリーディングゼロに基づき、概算で桁合わせのシフト
量を決定し、左シフタ101でこのシフト量だけ被除数
aを事前にシフトし、除算処理部103でシフト後のビ
ット位置から除算を行うことにより、除算の繰返し回数
を減少させることができる。以上のビットあたり処理量
の減少と、繰返し回数の減少とにより、高速に整数除算
を実現することができる。
As described above, according to the seventh embodiment of the present invention, the divisor b is converted in advance by the divisor conversion unit 102, thereby reducing the amount of division processing per bit in the division processing unit 103. be able to. In the digit matching processing unit 100, the dividend a and the divisor b
Based on the leading zero of, the shift amount of the digit alignment is roughly determined, the dividend a is previously shifted by the shift amount by the left shifter 101, and division is performed from the bit position after the shift by the division processing unit 103. The number of times of division can be reduced. Due to the reduction in the processing amount per bit and the reduction in the number of repetitions, integer division can be realized at high speed.

【0063】[0063]

【発明の効果】本発明における整数除算方法および整数
除算装置は、上記のように構成され、特に、除算の繰返
し手順の前に除数変換手順を追加することにより、被除
数から除数を減算したときに、部分剰余と部分商とが同
時に求められ、1ビットあたりの除算処理量を減少し
て、高速に整数除算を行うことができる。
The integer division method and the integer division apparatus according to the present invention are constructed as described above. In particular, when the divisor is subtracted from the dividend by adding a divisor conversion procedure before the repetition procedure of the division. , The partial remainder and the partial quotient are obtained at the same time, and the amount of division processing per bit is reduced, whereby integer division can be performed at high speed.

【0064】また、本発明における整数除算方法および
整数除算装置は、僅かな回路により、除算の繰返し手順
の前に被除数のMSB(最上位桁)に続く0からなる無
効なビット数に基づき、荒い概算で求めたシフト量によ
り被除数をシフトして、被除数と除数の桁合わせ処理を
行うことにより、回路を増大することなく、除算処理の
繰返し回数を減少して、高速に整数除算を行うことがで
きる。
In addition, the integer division method and the integer division apparatus according to the present invention can provide a rough circuit based on an invalid bit number consisting of 0s following the MSB (most significant digit) of the dividend before repeating the division by a few circuits. By shifting the dividend by the approximate shift amount and performing digit alignment processing of the dividend and the divisor, the number of repetitions of the division processing can be reduced and the integer division can be performed at high speed without increasing the circuit. it can.

【0065】また、本発明における整数除算方法および
整数除算装置は、僅かな回路により、除算の繰返し手順
の前に、被除数のMSB(最上位桁)に続く0からなる
無効なビット数と、除数のMSB(最上位桁)に続く0
からなる無効なビット数とに基づき概算で求めたシフト
量により被除数をシフトして、被除数と除数の桁合わせ
処理を実行することにより、回路を増大することなく、
除算処理の繰返し回数を減少して、高速に整数除算を行
うことができる。
Further, the integer division method and the integer division apparatus according to the present invention can reduce the number of invalid bits consisting of zeros following the MSB (most significant digit) of the dividend and the divisor before repeating the division by a small circuit. 0 following MSB (most significant digit) of
By shifting the dividend by the shift amount roughly calculated based on the invalid bit number consisting of and executing the digit alignment processing of the dividend and the divisor, without increasing the circuit,
Integer division can be performed at high speed by reducing the number of repetitions of the division process.

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

【図1】本発明の実施の形態における整数除算装置の全
体構成を示すブロック図、
FIG. 1 is a block diagram showing an entire configuration of an integer division device according to an embodiment of the present invention;

【図2】本発明の第1の実施の形態における整数除算方
法を示すフローチャート、
FIG. 2 is a flowchart showing an integer division method according to the first embodiment of the present invention;

【図3】本発明の第2の実施の形態における整数除算方
法を示すフローチャート、
FIG. 3 is a flowchart showing an integer division method according to the second embodiment of the present invention;

【図4】本発明の第3の実施の形態における整数除算方
法を示すフローチャート、
FIG. 4 is a flowchart illustrating an integer division method according to a third embodiment of the present invention;

【図5】本発明の第4の実施の形態における整数除算装
置の構成を示すブロック図、
FIG. 5 is a block diagram showing a configuration of an integer division device according to a fourth embodiment of the present invention;

【図6】本発明の第5の実施の形態における整数除算装
置の構成を示すブロック図、
FIG. 6 is a block diagram showing a configuration of an integer division device according to a fifth embodiment of the present invention;

【図7】従来の整数除算装置の一例の構成を示すブロッ
ク図、
FIG. 7 is a block diagram showing a configuration of an example of a conventional integer division device;

【図8】従来の整数除算方法の一例を示すフローチャー
ト、
FIG. 8 is a flowchart showing an example of a conventional integer division method;

【図9】従来の桁合わせ処理付き整数除算方法の一例を
示すフローチャート、
FIG. 9 is a flowchart showing an example of a conventional integer division method with digit matching processing;

【図10】従来の桁合わせ処理付き整数除算方法におけ
るシフト量の決定方法の一例を示すフローチャート、
FIG. 10 is a flowchart showing an example of a method of determining a shift amount in the conventional integer division method with digit alignment processing;

【図11】従来の桁合わせ処理付き整数除算方法の一例
を説明する説明図、
FIG. 11 is an explanatory diagram illustrating an example of a conventional integer division method with digit alignment processing;

【図12】本発明の第1の実施の形態における整数除算
方法を説明する説明図、
FIG. 12 is an explanatory diagram illustrating an integer division method according to the first embodiment of the present invention;

【図13】本発明の第2の実施の形態における整数除算
方法の桁合わせ処理手順を説明する説明図、
FIG. 13 is an explanatory diagram for explaining a digit alignment processing procedure of the integer division method according to the second embodiment of the present invention;

【図14】本発明の第3の実施の形態における整数除算
方法の桁合わせ処理手順を説明する説明図。
FIG. 14 is an explanatory diagram illustrating a digit alignment processing procedure of the integer division method according to the third embodiment of the present invention.

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

100 桁合わせ処理部 101 左シフタ 102 除数変換部 103 除算処理部 S202、S303、S405 除数変換手順 S301 荒い概算桁合わせ処理手順 S401 概算桁合わせ処理手順1 S402 概算桁合わせ処理手順2 S403 概算桁合わせ処理手順3 S302、S404 シフト手順 520 荒い概算桁合わせ回路 620 概算桁合わせ回路 510、610、703 シフタ(シフト回路) 500、600 除算回路 623 減算器 624 加算器 521、621、622 リーディングゼロ回路(リー
ディングゼロカウント回路) 701 被除数レジスタ・商レジスタ 702 除数レジスタ 704 算術論理ユニット(ALU) 705 部分剰余レジスタ・部分商レジスタ 706 インバータ 707、710 セレクタ 708 カウンタ 709 デコーダ 711 剰余レジスタ・商レジスタ
100 digit alignment processing unit 101 left shifter 102 divisor conversion unit 103 division processing unit S202, S303, S405 divisor conversion procedure S301 rough approximate digit alignment procedure S401 approximate digit alignment procedure 1 S402 approximate digit alignment procedure 2 S403 approximate digit alignment procedure Procedure 3 S302, S404 Shift procedure 520 Rough approximate digit matching circuit 620 Approximate digit matching circuit 510, 610, 703 Shifter (shift circuit) 500, 600 Division circuit 623 Subtractor 624 Adder 521, 621, 622 Reading zero circuit (Reading zero) Count circuit) 701 dividend register / quotient register 702 divisor register 704 arithmetic logic unit (ALU) 705 partial remainder register / partial quotient register 706 inverter 707, 710 selector 708 cow Data 709 decoder 711 remainder register and business register

Claims (7)

【特許請求の範囲】[Claims] 【請求項1】被除数から除数を減算したときに部分剰余
と部分商とが同時に求めるべく除算処理前に前記除数を
変換し、被除数を1ビットづつ左シフトしながら前記被
除数から除数を繰返し減算して各桁の商を求めることを
特徴とする整数除算方法。
1. A divisor is converted before a division process so that a partial remainder and a partial quotient are simultaneously obtained when the divisor is subtracted from the dividend, and the divisor is repeatedly subtracted from the dividend while shifting the dividend left by one bit. An integer division method, wherein the quotient of each digit is obtained by using
【請求項2】被除数の最上位桁に続く0からなる無効ビ
ット数をもとに荒い概算により前記被除数のシフト量を
求め、求めた前記シフト量だけ前記被除数を左シフト
し、左シフトしたビット位置から1ビットづつ左シフト
しながら前記被除数から前記除数を繰返し減算すること
を特徴とする請求項1記載の整数除算方法。
2. A method of calculating a shift amount of the dividend by rough estimation based on the number of invalid bits consisting of 0s following the most significant digit of the dividend, shifting the dividend left by the determined shift amount, 2. The method according to claim 1, wherein the divisor is repeatedly subtracted from the dividend while shifting left by one bit from the position.
【請求項3】被除数の最上位桁に続く0からなる無効ビ
ット数と除数の最上位桁に続く0からなる無効ビット数
とをもとに概算により前記被除数の最終的なシフト量を
求め、求めた最終的なシフト量だけ前記被除数を左シフ
トし、左シフトしたビット位置から1ビットづつ左シフ
トしながら前記被除数から前記除数を繰返し減算して各
桁の商を求めることを特徴とする請求項1記載の整数除
算方法。
3. A final shift amount of the dividend is obtained by rough estimation based on the number of invalid bits consisting of 0 following the most significant digit of the dividend and the number of invalid bits consisting of 0 following the most significant digit of the dividend. The dividend is left-shifted by the obtained final shift amount, and the divisor is repeatedly subtracted from the dividend while shifting leftward by one bit from the left-shifted bit position to obtain a quotient of each digit. Item 1. The integer division method according to Item 1.
【請求項4】入力した被除数の最上位桁に続く0からな
る無効ビット数をもとに概算により前記被除数のシフト
量を求める第1の桁合わせ回路と、求めた前記シフト量
だけ前記被除数を左シフトするシフト回路と、左シフト
したビット位置から1ビットづつ左シフトしながら前記
被除数から前記除数を繰返し減算して各桁の商を求める
除算回路とを備えることを特徴とする整数除算装置。
4. A first digit aligning circuit for calculating a shift amount of the dividend by approximation based on the number of invalid bits consisting of 0s following the most significant digit of the input dividend, and calculating the dividend by the determined shift amount. An integer division device comprising: a shift circuit for shifting left; and a division circuit for repeatedly subtracting the divisor from the dividend while shifting left by one bit from the left-shifted bit position to obtain a quotient of each digit.
【請求項5】入力した被除数の最上位桁に続く0からな
る無効ビット数と入力した除数の最上位桁に続く0から
なる無効ビット数とをもとに概算により前記被除数のシ
フト量を求める第2の桁合わせ回路と、求めた前記シフ
ト量だけ前記被除数を左シフトするシフト回路と、左シ
フトした前記ビット位置から1ビットづつ左シフトしな
がら前記被除数から前記除数を繰返し減算して各桁の商
を求める除算回路とを備えることを特徴とする整数除算
装置。
5. The shift amount of the dividend is obtained by rough estimation based on the number of invalid bits consisting of 0 following the most significant digit of the input dividend and the number of invalid bits consisting of 0 following the most significant digit of the inputted divisor. A second digit aligning circuit, a shift circuit for shifting the dividend to the left by the determined shift amount, and repeatedly subtracting the divisor from the dividend while shifting left by one bit from the bit position shifted left; And a division circuit for obtaining a quotient of the integer.
【請求項6】入力した被除数の最上位桁に続く0からな
る無効ビット数と入力した除数の最上位桁に続く0から
なる無効ビット数とをもとに概算によりシフト量を算出
する概算桁合わせ回路と、算出したシフト量だけ前記被
除数を左シフトする左シフタと、被除数から除数を減算
したときに部分剰余と部分商とが同時に求められるよう
除算処理前に前記除数を変換する除数変換部と、左シフ
トされた前記被除数を1ビットづつ左シフトしながら変
換された前記除数を繰返し減算して各桁の商を求める除
算処理部とを備えることを特徴とする整数除算装置。
6. An approximate digit for calculating a shift amount by rough estimation based on the number of invalid bits consisting of 0 following the most significant digit of the input dividend and the number of invalid bits consisting of 0 following the most significant digit of the inputted divisor. A matching circuit, a left shifter that shifts the dividend left by the calculated shift amount, and a divisor conversion unit that converts the divisor before the division process so that a partial remainder and a partial quotient are simultaneously obtained when the divisor is subtracted from the dividend. And a division processing unit for repeatedly subtracting the converted divisor while shifting the dividend left-shifted one bit at a time to obtain a quotient of each digit.
【請求項7】請求項1ないし3のいずれかに記載の整数
除算方法における各処理工程をコンピュータに実行させ
るためのプログラムを記録したコンピュータ読み取り可
能な記録媒体。
7. A computer-readable recording medium in which a program for causing a computer to execute each processing step in the integer division method according to claim 1 is recorded.
JP2000372389A 2000-12-07 2000-12-07 Integer dividing method and integer dividing device Pending JP2002175179A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000372389A JP2002175179A (en) 2000-12-07 2000-12-07 Integer dividing method and integer dividing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000372389A JP2002175179A (en) 2000-12-07 2000-12-07 Integer dividing method and integer dividing device

Publications (1)

Publication Number Publication Date
JP2002175179A true JP2002175179A (en) 2002-06-21

Family

ID=18841944

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000372389A Pending JP2002175179A (en) 2000-12-07 2000-12-07 Integer dividing method and integer dividing device

Country Status (1)

Country Link
JP (1) JP2002175179A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005004755A (en) * 2003-06-10 2005-01-06 Korea Advanced Inst Of Science & Technology Division unit of three-dimensional computer graphic system
JP2007241694A (en) * 2006-03-09 2007-09-20 Sanyo Electric Co Ltd Arithmetic mapping method to reconfigurable circuit, reconfigurable circuit and data flow graph
US9009209B2 (en) 2009-07-21 2015-04-14 Fujitsu Limited Processor, control method of processor, and computer readable storage medium storing processing program for division operation

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005004755A (en) * 2003-06-10 2005-01-06 Korea Advanced Inst Of Science & Technology Division unit of three-dimensional computer graphic system
JP2007241694A (en) * 2006-03-09 2007-09-20 Sanyo Electric Co Ltd Arithmetic mapping method to reconfigurable circuit, reconfigurable circuit and data flow graph
JP4597075B2 (en) * 2006-03-09 2010-12-15 三洋電機株式会社 Operation mapping method to reconfigurable circuit, reconfigurable circuit, and data flow graph
US9009209B2 (en) 2009-07-21 2015-04-14 Fujitsu Limited Processor, control method of processor, and computer readable storage medium storing processing program for division operation

Similar Documents

Publication Publication Date Title
US6564239B2 (en) Computer method and apparatus for division and square root operations using signed digit
KR20080055985A (en) Floating-point processor with selectable subprecision
US7188133B2 (en) Floating point number storage method and floating point arithmetic device
JP6407001B2 (en) Electronic device and system for converting floating point number to integer and method for operating the same
US5023827A (en) Radix-16 divider using overlapped quotient bit selection and concurrent quotient rounding and correction
US5132925A (en) Radix-16 divider using overlapped quotient bit selection and concurrent quotient rounding and correction
Hormigo et al. Measuring improvement when using HUB formats to implement floating-point systems under round-to-nearest
JP3313560B2 (en) Floating point processor
JPH0573269A (en) Adder
JP4273071B2 (en) Divide and square root calculator
JP2001222410A (en) Divider
JP3003467B2 (en) Arithmetic unit
US6233595B1 (en) Fast multiplication of floating point values and integer powers of two
Tsen et al. A combined decimal and binary floating-point multiplier
US5798952A (en) Leading bit anticipator
JP2002175179A (en) Integer dividing method and integer dividing device
CN115268832A (en) Floating point number rounding method and device and electronic equipment
JP2018097864A (en) Leading zero anticipation
JP4439060B2 (en) Floating point adder
US8185723B2 (en) Method and apparatus to extract integer and fractional components from floating-point data
RU2276805C2 (en) Method and device for separating integer and fractional components from floating point data
JP4163967B2 (en) Floating point arithmetic unit
JP3793505B2 (en) Arithmetic unit and electronic circuit device using the same
JP3257278B2 (en) Normalizer using redundant shift number prediction and shift error correction
Natarajan et al. Arithmetic Operations and Circuits