JPH0836483A - Division device - Google Patents

Division device

Info

Publication number
JPH0836483A
JPH0836483A JP6173988A JP17398894A JPH0836483A JP H0836483 A JPH0836483 A JP H0836483A JP 6173988 A JP6173988 A JP 6173988A JP 17398894 A JP17398894 A JP 17398894A JP H0836483 A JPH0836483 A JP H0836483A
Authority
JP
Japan
Prior art keywords
dividend
circuit
quotient
value
error
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
JP6173988A
Other languages
Japanese (ja)
Inventor
Yoshiro Kashiwabara
芳郎 柏原
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 JP6173988A priority Critical patent/JPH0836483A/en
Publication of JPH0836483A publication Critical patent/JPH0836483A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To provide a division device which is capable of reducing the number of times of calculation, performing an arithmetic processing at high speed and is excellent in workability by performing a division by the multiplier of 2 which is larger than a divisor and is the closest to the divisor and determining a value which is close to a quotient by one time calculation. CONSTITUTION:This device has a constitution provided with an input port 1 inputting a dividend and a divisor, a switch circuit 2 performing a switching as to whether a calculation is performed for the inputted dividend or the calculation is performed by defining a feedbacked error value as the dividend, a latch circuit 3 preserving the value outputted from the switch circuit 2, synchronizing the value with a clock, an approximate quotient output circuit 4 outputting the approximate value of the quotient of the dividend and the devisor, a dividend error output circuit 5 calculating the error of the approximate value and the dividend, a data addition circuit 6 adding the approximate quotient, synchronizing the quotient with the clock, a data correction circuit 7 performing a data correction for the error value and the addition value and outputting the remainder and the quotient and a control circuit 8 controlling the whole of the device.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明はディジタル回路における
除算装置に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a dividing device in a digital circuit.

【0002】[0002]

【従来の技術】近年、ディジタル回路の技術発達に伴
い、各種機器の性能向上を図るために、各種機器に搭載
する回路の演算処理速度の高速化が進められている。
2. Description of the Related Art In recent years, with the technical development of digital circuits, in order to improve the performance of various devices, the operation processing speed of circuits mounted in various devices has been increased.

【0003】以下に従来の除算装置について、図面を参
照しながら説明する。図3は従来の除算装置における除
算方法の一例を示す図である。最初に、回復形の除算方
法について説明する。まず、被除数Dと除数dの値の比
較を行い、除数dの方が大きい場合には商が桁あふれを
おこすために演算不能を表示して、被除数Dの方が大き
い場合には被除数Dから除数dを減算して部分剰余Rを
求める。ここで、被除数Dと除数dがともに正数である
とすると、部分剰余Rが正数ならば減算を行えたことに
なるので商qに1をたて、Rが負数ならば減算を行えな
かったことになるのでq=0としてRにdを加算するこ
とにより元に戻す。次に、Rを1桁左シフトし、得られ
た部分剰余2Rに対してdの減算を行い、同様にして新
しい部分剰余から次の商を求める。この操作を商が必要
な桁数になるまで繰り返す。この関係を一般的に表すと
次式になる。 (数1)Ri+1 =2R−qi+1 ×d ここで、2Ri −d≧0ならばqi+1 =1 2Ri −d<0ならばqi+1 =0 である。商が全て求まると、その際の部分剰余が剰余の
下位の部分になる。符号と絶対値表現の場合には、商の
符号を決定して除算を終了する。
A conventional dividing device will be described below with reference to the drawings. FIG. 3 is a diagram showing an example of a division method in a conventional division device. First, the recovery type division method will be described. First, the value of the dividend D and the value of the divisor d are compared, and when the divisor d is larger, the quotient causes an overflow so that the calculation is not possible. When the dividend D is larger, the dividend D The partial remainder R is obtained by subtracting the divisor d. Here, if the dividend D and the divisor d are both positive numbers, it means that the subtraction can be performed if the partial remainder R is a positive number, so the quotient q is incremented by 1, and if R is a negative number, the subtraction cannot be performed. Since this is the case, the value is restored by adding d to R with q = 0. Then, R is shifted to the left by one digit, d is subtracted from the obtained partial remainder 2R, and the next quotient is similarly obtained from the new partial remainder. This operation is repeated until the quotient has the required number of digits. This relationship is generally expressed as follows. (Equation 1) R i + 1 = 2R−q i + 1 × d Here, if 2R i −d ≧ 0, then q i + 1 = 1 and if 2R i −d <0, then q i + 1 = 0. . When all quotients are obtained, the partial remainder at that time becomes the lower part of the remainder. In the case of the sign and the absolute value expression, the sign of the quotient is determined and the division is completed.

【0004】次に、非回復形の除算方法について説明す
る。前述の回復形の除算方法では回復のための加算と次
の桁での減算を連続して行うために次式に示すように次
の桁での加算と同じことになる。 (数2){(2Ri −d)+d}×2−d=2(2Ri
−d)+d 左辺は部分剰余(2Ri −d)にdを加えてから1ビッ
ト左シフトすることにより2倍して除数dを減算するこ
とを示している。一方、右辺は部分剰余の符号を判断
し、正数ならば次の桁の演算は除数dの減算を行い、負
数ならば次の桁で除数dの加算を行う。この操作を同様
に繰り返して、最後の桁の演算の場合にのみ部分剰余が
負数ならば除数dを加算して補正を行いその補正を行っ
た値を剰余とし、正数ならば補正を行わずに剰余とす
る。
Next, a non-recovery type division method will be described. In the above-mentioned recovery type division method, since addition for recovery and subtraction at the next digit are continuously performed, it becomes the same as addition at the next digit as shown in the following equation. (Equation 2) {(2R i −d) + d} × 2-d = 2 (2R i
The left side of −d) + d indicates that d is added to the partial remainder (2R i −d) and then left-shifted by 1 bit to double and subtract the divisor d. On the other hand, the right side determines the sign of the partial remainder, and if the number is positive, the next digit is calculated by subtracting the divisor d, and if the number is negative, the next digit is added by the divisor d. This operation is repeated in the same manner. Only when the last digit is calculated, if the partial remainder is a negative number, the divisor d is added to make a correction, and the corrected value is taken as the remainder. If it is a positive number, no correction is made. To the remainder.

【0005】尚、従来の除算装置では、回復形の除算方
法の場合には、nビットの除算を行うに当たり、n回の
減算と平均してn/2回の加算が必要である。また、非
回復形の除算方法の場合にはn回の減算と平均してn/
2回の加算が必要であるが、回復のための加算を省略で
き、回復形の除算方法よりも演算時間を短縮することが
できる。
In the conventional division device, in the case of the restoration type division method, when performing n-bit division, n times of subtraction and n / 2 times of addition on average are required. In the case of the non-restoration type division method, n / th
Although addition is required twice, addition for restoration can be omitted, and the calculation time can be shortened as compared with the restoration type division method.

【0006】[0006]

【発明が解決しようとする課題】しかしながら上記従来
の構成では、回復形の除算方法では回復のための加算を
行う必要があるためにnビットの除算においてn回の減
算と、平均n/2回の加算が必要である。また、非回復
形の除算方法ではnビットの除算において、n回の減算
と、平均n/2回の加算が必要となり、1度の演算で商
の1桁分しか解を得ることができず演算処理速度が低下
するために作業性に欠けるという問題点を有していた。
However, in the above-mentioned conventional configuration, since the restoration type division method needs to perform addition for restoration, n number of subtractions and an average of n / 2 times are performed in the division of n bits. Must be added. In addition, in the non-restoration type division method, in n-bit division, n times of subtraction and an average of n / 2 times of addition are required, and a solution for only one digit of the quotient can be obtained by one operation. There is a problem in that workability is lacking because the calculation processing speed decreases.

【0007】本発明は上記従来の問題点を解決するもの
で、除数より大きくかつ最も除数に近い2の乗数で除算
を行い、1度の演算で商に近い値を求めることにより、
演算回数を減少させて高速に演算処理を行うことができ
る作業性に優れた除算装置を提供することを目的とす
る。
The present invention solves the above-mentioned conventional problems by dividing by a multiplier of 2 which is larger than the divisor and closest to the divisor, and obtains a value close to the quotient in one operation.
It is an object of the present invention to provide a dividing device with excellent workability that can reduce the number of calculations and perform calculation processing at high speed.

【0008】[0008]

【課題を解決するための手段】この目的を達成するため
に本発明の除算装置は、被除数と除数を入力する入力ポ
ートと、入力ポートから入力された被除数に対して演算
を行うか被除数誤差出力回路からフィードバックされた
誤差値を被除数として演算を行うか切替えを行う切替え
回路と、切替え回路から出力される値をクロックに同期
しながら保存するラッチ回路と、ラッチ回路に保存され
る被除数と除数との商の近似値を出力する近似商出力回
路と、近似商出力回路から出力される近似商をもとに入
力ポートから入力された被除数との誤差を算出する被除
数誤差出力回路と、近似商出力回路から出力される近似
商をクロックに同期しながら加算していくデータ加算回
路と、被除数誤差出力回路から出力される誤差値及びデ
ータ加算回路から出力される近似商の加算値に対してデ
ータ補正を行い余り及び商を出力するデータ補正出力回
路と、装置全体の制御を行うコントロール回路と、を備
えている構成を有している。
In order to achieve this object, a dividing apparatus according to the present invention is provided with an input port for inputting a dividend and a divisor, and performing an operation on a dividend input from the input port or outputting a dividend error. A switching circuit that performs calculation or switching using the error value fed back from the circuit as the dividend, a latch circuit that stores the value output from the switching circuit in synchronization with the clock, and the dividend and divisor that are stored in the latch circuit. Approximate quotient output circuit that outputs an approximate value of the quotient, and a dividend error output circuit that calculates the error between the dividend input from the input port based on the approximate quotient output from the approximate quotient output circuit, and the approximate quotient output From the data addition circuit that adds the approximate quotient output from the circuit in synchronization with the clock, and the error value and data addition circuit output from the dividend error output circuit Has a data correction output circuit for outputting the remainder and quotient performs data correction on the sum of the approximate quotient being force, the arrangement being and a control circuit for controlling the entire apparatus.

【0009】[0009]

【作用】この構成によって、入力ポートが被除数と除数
を入力し、切替え回路が入力ポートから入力された被除
数に対して演算を行うか後述の被除数誤差出力回路から
フィードバックされた誤差値を被除数として演算を行う
か切替えを行い、ラッチ回路が切替え回路から出力され
る値をクロックに同期しながら保存し、近似商出力回路
がラッチ回路に保存される被除数と除数との商の近似値
を出力し、被除数誤差出力回路が近似商出力回路から出
力される近似商をもとに入力ポートから入力された被除
数との誤差を算出し、データ加算回路が近似商出力回路
から出力される近似商をクロックに同期しながら加算
し、データ補正出力回路が被除数誤差出力回路から出力
される誤差値及びデータ加算回路から出力される近似商
の加算値に対してデータ補正を行い余り及び商を出力
し、コントロール回路が装置全体の制御を行うために、
除数より大きくかつ最も除数に近い2の乗数で除算を行
うので、1度の演算で商に近い値を求めることにより、
演算回数を減少させて演算処理速度を向上させることが
できる。
With this configuration, the input port inputs the dividend and the divisor, and the switching circuit operates on the dividend input from the input port or calculates the error value fed back from the dividend error output circuit described later as the dividend. The latch circuit stores the value output from the switching circuit in synchronization with the clock, and the approximate quotient output circuit outputs an approximate value of the quotient of the dividend and the divisor stored in the latch circuit, The dividend error output circuit calculates the error with the dividend input from the input port based on the approximate quotient output from the approximate quotient output circuit, and the data addition circuit uses the approximate quotient output from the approximate quotient output circuit as a clock. The data correction output circuit adds the data while synchronizing, and the data correction output circuit outputs a deduction for the error value output from the dividend error output circuit and the addition value of the approximate quotient output from the data addition circuit. Outputs the remainder and quotient performs data correction, in order to control circuit controls the entire apparatus,
Since division is performed by a power of 2 that is larger than the divisor and is closest to the divisor, by obtaining a value close to the quotient with one operation,
The number of calculations can be reduced and the processing speed can be improved.

【0010】[0010]

【実施例】以下本発明の一実施例における除算装置につ
いて、図面を参照しながら説明する。図1は本発明の一
実施例における除算装置の回路ブロック図であり、図2
は本発明の一実施例における除算装置のフローチャート
である。1は被除数Dと除数dの入力を行う入力ポー
ト、2は記入力ポート1より入力された被除数Dまたは
後述の被除数誤差出力回路5からフィードバックされた
誤差値を被除数として演算を行うか切替えを行う切替え
回路、3は切替え回路2から出力される値をクロックに
同期しながら保存するラッチ回路、4はラッチ回路3に
保存される被除数と除数との商の近似値を出力する近似
商出力回路、5は近似商出力回路4から出力される近似
商をもとに入力ポート1から入力された被除数との誤差
を算出する被除数誤差出力回路、6は近似商出力回路4
から出力される近似商をクロックに同期しながら加算し
ていくデータ加算回路、7は被除数誤差出力回路5から
出力される誤差値及びデータ加算回路6から出力される
加算値に対してデータ補正を行い余り及び商を出力する
データ補正回路、8は装置全体の制御を行うコントロー
ル回路である。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS A divider according to an embodiment of the present invention will be described below with reference to the drawings. 1 is a circuit block diagram of a divider according to an embodiment of the present invention.
3 is a flowchart of a dividing device according to an embodiment of the present invention. 1 is an input port for inputting the dividend D and the divisor d, 2 is a switch for performing calculation with the dividend D input from the input port 1 or an error value fed back from a dividend error output circuit 5 described later as a dividend A switching circuit 3 is a latch circuit for storing the value output from the switching circuit 2 in synchronization with a clock, and 4 is an approximate quotient output circuit for outputting an approximate value of a quotient of a dividend and a divisor stored in the latch circuit 3, 5 is a dividend error output circuit for calculating an error from the dividend input from the input port 1 based on the approximate quotient output circuit 4; 6 is the approximate quotient output circuit 4
A data adder circuit for adding the approximate quotient output from the data adder in synchronization with a clock, and 7 for data correction with respect to the error value output from the dividend error output circuit 5 and the added value output from the data adder circuit 6. A data correction circuit 8 outputs a remainder and a quotient, and a control circuit 8 controls the entire apparatus.

【0011】以上のように構成された本発明の除算装置
について、以下その動作を説明する。最初に、10進数
の除算例として146363÷93について説明する。
まず、この除算において除数93を近似して100で演
算を行うと、10の乗数に対してビットシフトのみで商
は1463と求めることができ、146363÷93の
商は1463以上になることがわかる。次に、近似した
商をもとに、被除数との誤差値10304(=1463
63−1463×93)を求める。次に、誤差値に対し
て同様に近似値を用いて除算を行う。ここでは、103
04÷93に対して除数93を近似して100で除算を
行い、商103を算出し、誤差値725(=10304
−103×93)を求める。次に、誤差値に対して同様
に近似値を用いて除算を行う。ここでは、725÷93
に対して除数93を近似して100で除算を行い、商7
を算出し、誤差値74(=1034−103×93)を
求める。以上のように、商が0になるまで演算を行うと (数3) 146363=74+0×93+7×93+103×93+1463×93 =(1463+103+7)×93+74 =1573×93+74 (数3)を導きだすことができるとともに、商が157
3,余りが74と導きだすことができる。
The operation of the dividing apparatus of the present invention constructed as above will be described below. First, 146363/93 will be described as an example of decimal division.
First, in this division, when the divisor 93 is approximated and an operation is performed by 100, the quotient can be obtained as 1463 by only the bit shift with respect to the multiplier of 10, and the quotient of 146363 ÷ 93 becomes 1463 or more. . Next, based on the approximated quotient, the error value with the dividend is 10304 (= 1463).
63-1463 × 93). Next, the error value is similarly divided using the approximate value. Here, 103
04 ÷ 93 is approximated by a divisor 93 and divided by 100 to calculate a quotient 103, and an error value 725 (= 10304
−103 × 93) is calculated. Next, the error value is similarly divided using the approximate value. Here, 725/93
To the divisor 93 and divide by 100 to obtain the quotient 7
Is calculated to obtain an error value 74 (= 1034-103 × 93). As described above, if calculation is performed until the quotient becomes 0, (Mathematical formula 3) 146363 = 74 + 0 × 93 + 7 × 93 + 103 × 93 + 1463 × 93 = (1463 + 103 + 7) × 93 + 74 = 1573 × 93 + 74 (Mathematical formula 3) can be derived. And the quotient is 157
3, the surplus can be derived as 74.

【0012】ここで、前述の方法を2進数で用いると被
除数をD、除数をd、商をP、余りをQ、除数dより大
きく最も小さい2の乗数をA、被除数DをAで割った結
果の商をp(0),余りをqa(0)、被除数Dとp
(0)を商とした場合の誤差をq(0)と仮定した場合
に、 (数4)D÷d=P ・・・余りQ D=d×P+Q また、除数dより大きくかつ最も除数dに近い2の乗数
をAとおくことにより (数5)A=2m (但し、2m-1 <d≦2m ) 被除数をD、除数をAとおいた場合の商がp(0)で余
りqa(0)より (数6)D÷A=p(0)・・・余りqa(0) D=A×p(0)+qa(0) 被除数Dとp(0)を商とした場合の誤差がq(0)よ
り (数7)q(0)=D−d×p(0) D=d×p(0)+q(0) 以下、同様にして被除数をq(0)、除数をAとおいた
場合の商がp(1)、余りがqa(1)より (数8)q(0)=A×p(1)+qa(1) 同様に誤差q(1)は (数9)q(1)=q(0)−d×p(1) q(0)=d×p(1)+q(1) 従って、一般式は被除数をq(n)、除数をAとおいた
場合の商をp(n+1)、余りをqa(n+1)とおけ
るので (数10) q(n)=A×p(n+1)+qa(n+1) また、誤差q(n+1)は (数11)q(n+1)=q(n)−d×p(n+1) q(n)=d×p(n+1)+q(n+1) という式を導くことができる。
When the above-mentioned method is used in binary, the dividend is D, the divisor is d, the quotient is P, the remainder is Q, the smallest power of 2 larger than the divisor d is divided by A, and the dividend D is divided by A. The resulting quotient is p (0), the remainder is qa (0), and the dividends D and p
Assuming that the error when q is (0) is q (0), (Equation 4) D ÷ d = P ... remainder Q D = d × P + Q Further, it is larger than divisor d and most divisor d. By setting the multiplier of 2 that is close to to A, (Equation 5) A = 2 m (where 2 m−1 <d ≦ 2 m ), where the dividend is D and the divisor is A, the quotient is p (0) From remainder qa (0) (Equation 6) D / A = p (0) ... remainder qa (0) D = A × p (0) + qa (0) When dividend D and p (0) are quotients Error of q (0) (Equation 7) q (0) = D−d × p (0) D = d × p (0) + q (0) Below, similarly, the dividend is q (0), the divisor When p is A, the quotient is p (1) and the remainder is qa (1). (Equation 8) q (0) = A × p (1) + qa (1) Similarly, the error q (1) is ) Q (1) = q (0) -d * p (1) q (0) = d × p (1) + q (1) Therefore, in the general formula, if the dividend is q (n) and the divisor is A, the quotient is p (n + 1) and the remainder is qa (n + 1). (N) = A × p (n + 1) + qa (n + 1) Further, the error q (n + 1) is (Equation 11) q (n + 1) = q (n) −d × p (n + 1) q (n) = d × p The formula (n + 1) + q (n + 1) can be derived.

【0013】(数11)より q(n)−q(n+1)=d×p(n+1) となるが、d及びp(n+1)は共に正の整数なので左
辺≦0を導くことができる。但し、等号が成立するのは
p(n+1)=0の場合のみであるので、この場合にq
(n)−q(n+1)=0が成立し、p(n+1)≠0
の場合にq(0)−q(n+1)>0となる。ここで、
p(n)はq(n−1)をAで割った場合の商であり、
p(n+1)はq(n)をAで割った場合の商であるの
でp(n)とp(n+1)との関係はnが大きくなるに
つれて小さくなり、p(n)がAよりも小さくなった時
点でp(n)=0となり、収束することを導くことがで
きる。以上の(数7),(数9)より (数12)D=d×p(0)+d×p(1)+q(1) =d×(p(0)+p(1))+q(1) となる。同様に(数11),(数12)において、nを
1づつ増加させながらn=kまで代入していくと (数13)D=d×(p(0)+p(1)+p(2)+
p(3)+・・・+p(k+1))+q(k+1) となる。
From (Equation 11), q (n) -q (n + 1) = d * p (n + 1), but since d and p (n + 1) are both positive integers, the left side ≤0 can be derived. However, since the equal sign holds only when p (n + 1) = 0, in this case, q
(N) -q (n + 1) = 0 holds, and p (n + 1) ≠ 0
In this case, q (0) -q (n + 1)> 0. here,
p (n) is the quotient when q (n-1) is divided by A,
Since p (n + 1) is the quotient when q (n) is divided by A, the relationship between p (n) and p (n + 1) becomes smaller as n becomes larger, and p (n) becomes smaller than A. When it becomes p (n) = 0, it is possible to guide the convergence. From the above (Equation 7) and (Equation 9) (Equation 12) D = d × p (0) + d × p (1) + q (1) = d × (p (0) + p (1)) + q (1 ). Similarly, in (Equation 11) and (Equation 12), when n is incremented by 1 and substituted until n = k, (Equation 13) D = d × (p (0) + p (1) + p (2) +
p (3) + ... + p (k + 1)) + q (k + 1).

【0014】ここで、p(n)は、nの値が大きくなる
につれて小さくなり、0に収束するので、その収束した
時点のnの値をhとおくと(数13)は (数14)D=d×(p(0)+p(1)+p(2)+
p(3)+・・・+p(h))+q(h) となる。
Here, p (n) decreases as the value of n increases and converges to 0. Therefore, if the value of n at the time of convergence is h, then (Equation 13) becomes (Equation 14) D = d × (p (0) + p (1) + p (2) +
p (3) + ... + p (h)) + q (h).

【0015】(数10)より、p(n)はq(n−1)
をAで割った場合の商の値であるが、n=hの場合はp
(h)は0に収束しているのでq(h−1)はAより小
さいことより (数15)q(h−1)<A を導くことができる。
From (Equation 10), p (n) is q (n-1).
Is the value of the quotient when A is divided by A, but when n = h, p
Since (h) has converged to 0, q (h-1) is smaller than A, and therefore (Equation 15) q (h-1) <A can be derived.

【0016】この時のq(h)は(数11)より (数16)q(h−1)=d×p(h)+q(h) q(h−1)=q(h) となる。従って(数15),(数16)より (数17)q(h)<A(=2m ) ここで、(数5)よりdの値は2m-1 <d≦2m なの
で、次に示す場合が存在する。
At this time, q (h) becomes (Equation 16) q (h-1) = d * p (h) + q (h) q (h-1) = q (h) from (Equation 11). . Therefore, from (Equation 15) and (Equation 16), (Equation 17) q (h) <A (= 2 m ) Here, from (Equation 5), the value of d is 2 m-1 <d ≦ 2 m, so There are cases shown in.

【0017】(1)q(h)<dの場合は(数4),
(数14)より (数18)P=p(0)+p(1)+p(2)+p
(3)+・・・+p(h) Q=q(h) (2)q(h)≧dの場合はq(h)の方がdより大き
いので、 (数19)q(h)=a×d+b ここで、aを2以上の数と仮定すると2m-1 <q(h)
≦2m の場合には、d<2m-1 となり、2m-1 <d≦q
(h)≦2m を満たさなくなるのでa=1を導くことが
できる。よって、(数14)は (数20)D=d×(p(0)+p(1)+p(2)+
p(3)+・・・+p(h)+h)+q(h)−d を導き出すことができ、(数4),(数20)より (数21)P=p(0)+p(1)+p(2)+p
(3)+・・・+p(h)+h Q=q(h)−d となる。
(1) When q (h) <d, (Equation 4),
From (Equation 14) (Equation 18) P = p (0) + p (1) + p (2) + p
(3) + ... + p (h) Q = q (h) (2) If q (h) ≧ d, then q (h) is larger than d, so (Equation 19) q (h) = a × d + b Here, assuming that a is a number of 2 or more, 2 m−1 <q (h)
In the case of ≤2 m , d <2 m-1 and 2 m-1 <d≤q
Since (h) ≦ 2 m is not satisfied, a = 1 can be derived. Therefore, (Equation 14) is (Equation 20) D = d × (p (0) + p (1) + p (2) +
p (3) + ... + p (h) + h) + q (h) -d can be derived, and from (Equation 4) and (Equation 20) (Equation 21) P = p (0) + p (1) + P (2) + p
(3) + ... + p (h) + h Q = q (h) -d.

【0018】ここで、上述の演算方法を用いた除算回路
について説明する。図2に示すように、まず、入力ポー
ト1に被除数Dと除数dが入力される(S1)。次に、
入力ポート1に入力された被除数Dと除数dを演算する
ために、切替え回路2が入力ポート側に切替えを行うと
ともにデータ加算回路6がクリアされる(S2)。次
に、切替え回路2を介して送出された被除数Dと除数d
がラッチ回路3で保存される(S3)。次に、近似商出
力回路4によって、ラッチ回路3で保存される除数dの
近似値をもとに除算が行われ近似商が算出される(S
4)。次に、被除数誤差出力回路5によって、S4で算
出された近似商をもとに入力ポート1に入力された被除
数Dとの誤差値を算出するとともにデータ加算回路6に
よって近似商の加算が行われる(S5)。次に、近似商
出力回路4から出力された商p(0)が0であるか判断
する(S6)。Yesである場合はS12にジャンプ、
Noである場合はS5で算出された誤差値に対して演算
を行うために切替え回路2が被除数誤差出力回路5側に
切替えを行う(S7)。次に、切替え回路2を介して送
出された誤差値が被除数としてラッチ回路3で保存され
る(S8)。次に、S4と同様にして近似商が算出され
る(S9)。次に、S5と同様に誤差値の算出と近似商
の加算が行われる(S10)。次に、S6と同様に商の
値p(0)が0であるか判断する(S11)。Noであ
る場合は、S8へジャンプし、Yesである場合は商及
び余りの確定信号を送出して終了する(S12)。
Here, a division circuit using the above-described calculation method will be described. As shown in FIG. 2, first, the dividend D and the divisor d are input to the input port 1 (S1). next,
In order to calculate the dividend D and the divisor d input to the input port 1, the switching circuit 2 switches to the input port side and the data addition circuit 6 is cleared (S2). Next, the dividend D and the divisor d sent through the switching circuit 2
Is stored in the latch circuit 3 (S3). Next, the approximate quotient output circuit 4 performs division based on the approximate value of the divisor d stored in the latch circuit 3 to calculate the approximate quotient (S
4). Next, the dividend error output circuit 5 calculates an error value with the dividend D input to the input port 1 based on the approximate quotient calculated in S4, and the data addition circuit 6 adds the approximate quotient. (S5). Next, it is determined whether the quotient p (0) output from the approximate quotient output circuit 4 is 0 (S6). If Yes, jump to S12,
If No, the switching circuit 2 switches to the dividend error output circuit 5 side in order to perform the calculation on the error value calculated in S5 (S7). Next, the error value sent via the switching circuit 2 is stored in the latch circuit 3 as a dividend (S8). Next, the approximate quotient is calculated in the same manner as in S4 (S9). Next, similarly to S5, the calculation of the error value and the addition of the approximate quotient are performed (S10). Next, as in S6, it is determined whether the quotient value p (0) is 0 (S11). If No, the process jumps to S8, and if Yes, a quotient and a remainder confirmation signal are transmitted and the process ends (S12).

【0019】以上のように本実施例によれば1回の演算
で商の近似値を求めることができるので演算の回数を減
少させることができる。
As described above, according to this embodiment, the approximate value of the quotient can be obtained by one operation, so that the number of operations can be reduced.

【0020】[0020]

【発明の効果】以上のように本発明は、入力ポートが被
除数と除数を入力し、切替え回路が入力ポートから入力
された被除数に対して演算を行うか後述の被除数誤差出
力回路からフィードバックされた誤差値を被除数として
演算を行うか切替えを行い、ラッチ回路が切替え回路か
ら出力される値をクロックに同期しながら保存し、近似
商出力回路がラッチ回路に保存される被除数と除数との
商の近似値を出力し、被除数誤差出力回路が近似商出力
回路から出力される近似商をもとに入力ポートから入力
された被除数との誤差を算出し、データ加算回路が近似
商出力回路から出力される近似商をクロックに同期しな
がら加算し、データ補正出力回路が被除数誤差出力回路
から出力される誤差値及びデータ加算回路から出力され
る近似商の加算値に対してデータ補正を行い余り及び商
を出力し、コントロール回路が装置全体の制御を行うた
めに、除数より大きくかつ最も除数に近い2の乗数で除
算を行うので、1度の演算で商に近い値を求めることに
より、演算回数を減少させて演算処理速度を向上させる
ことができる作業性に優れた除算装置を実現できるもの
である。
As described above, according to the present invention, the input port inputs the dividend and the divisor, and the switching circuit operates on the dividend input from the input port or is fed back from the dividend error output circuit described later. The error value is used as the dividend and the operation is performed or switched, and the latch circuit stores the value output from the switching circuit in synchronization with the clock, and the approximate quotient output circuit stores the quotient of the dividend and divisor stored in the latch circuit. The approximate value is output, and the dividend error output circuit calculates the error with the dividend input from the input port based on the approximate quotient output from the approximate quotient output circuit, and the data adder circuit outputs the approximate quotient output circuit. The sum of the approximate quotient output by the data correction output circuit and the approximate quotient output by the data addition circuit On the other hand, the data is corrected, the remainder and the quotient are output, and since the control circuit controls the entire apparatus, the division is performed by the power of 2 which is larger than the divisor and is the closest to the divisor. By obtaining the value, it is possible to realize a dividing device with excellent workability that can reduce the number of calculations and improve the calculation processing speed.

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

【図1】本発明の一実施例における除算装置の回路ブロ
ック図
FIG. 1 is a circuit block diagram of a divider according to an embodiment of the present invention.

【図2】本発明の一実施例における除算装置のフローチ
ャート
FIG. 2 is a flowchart of a dividing device according to an embodiment of the present invention.

【図3】従来の除算装置における除算方法の一例を示す
FIG. 3 is a diagram showing an example of a division method in a conventional division device.

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

1 入力ポート 2 切替え回路 3 ラッチ回路 4 近似商出力回路 5 被除数誤差出力回路 6 データ加算回路 7 データ補正回路 8 コントロール回路 1 Input Port 2 Switching Circuit 3 Latch Circuit 4 Approximate Quotient Output Circuit 5 Dividend Error Output Circuit 6 Data Addition Circuit 7 Data Correction Circuit 8 Control Circuit

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】被除数と除数を入力する入力ポートと、前
記入力ポートから入力された被除数に対して演算を行う
か被除数誤差出力回路からフィードバックされた誤差値
を被除数として演算を行うか切替えを行う切替え回路
と、前記切替え回路から出力される値をクロックに同期
しながら保存するラッチ回路と、前記ラッチ回路に保存
される被除数と除数との商の近似値を出力する近似商出
力回路と、前記近似商出力回路から出力される近似商を
もとに前記入力ポートから入力された被除数との誤差を
算出する前記被除数誤差出力回路と、前記近似商出力回
路から出力される近似商をクロックに同期しながら加算
していくデータ加算回路と、前記被除数誤差出力回路か
ら出力される誤差値及び前記データ加算回路から出力さ
れる近似商の加算値に対してデータ補正を行い余り及び
商を出力するデータ補正出力回路と、装置全体の制御を
行うコントロール回路と、を備えていることを特徴とす
る除算装置。
1. An input port for inputting a dividend and a divisor, and switching between an arithmetic operation on a dividend input from the input port or an arithmetic operation using an error value fed back from a dividend error output circuit as a dividend. A switching circuit; a latch circuit that stores the value output from the switching circuit in synchronization with a clock; an approximate quotient output circuit that outputs an approximate value of the quotient of the dividend and the divisor stored in the latch circuit; The dividend error output circuit for calculating an error from the dividend input from the input port based on the approximate quotient output circuit, and the approximate quotient output from the approximate quotient output circuit are synchronized with a clock A data adding circuit for adding while adding, an error value output from the dividend error output circuit, and an addition value of an approximate quotient output from the data adding circuit Divider unit to the data correction output circuit for outputting the remainder and quotient performs data correction, characterized in that it and a control circuit for controlling the whole apparatus against.
JP6173988A 1994-07-26 1994-07-26 Division device Pending JPH0836483A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP6173988A JPH0836483A (en) 1994-07-26 1994-07-26 Division device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6173988A JPH0836483A (en) 1994-07-26 1994-07-26 Division device

Publications (1)

Publication Number Publication Date
JPH0836483A true JPH0836483A (en) 1996-02-06

Family

ID=15970700

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6173988A Pending JPH0836483A (en) 1994-07-26 1994-07-26 Division device

Country Status (1)

Country Link
JP (1) JPH0836483A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000076584A (en) * 1998-08-31 2000-03-14 Matsushita Electric Works Ltd Terminal equipment for vehicle operation management system
US9032008B2 (en) 2009-12-22 2015-05-12 Fujitsu Limited Communication device, reception data length determination method, multiple determination circuit, and recording medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000076584A (en) * 1998-08-31 2000-03-14 Matsushita Electric Works Ltd Terminal equipment for vehicle operation management system
US9032008B2 (en) 2009-12-22 2015-05-12 Fujitsu Limited Communication device, reception data length determination method, multiple determination circuit, and recording medium

Similar Documents

Publication Publication Date Title
JP2835153B2 (en) High radix divider
EP0356153B1 (en) Radix-2**n divider method and apparatus using overlapped quotient bit selection and concurrent quotient rounding and correction
JP2585649B2 (en) Division circuit
EP0366155A2 (en) Logarithmic function arithmetic unit including means for separately processing pseudo division and multiplication
JPH0836483A (en) Division device
JP3768613B2 (en) Log approximate value calculation circuit
JPH0546363A (en) Divider
JPH086766A (en) Sine and cosine arithmetic device
JPH0326114A (en) Multiplication remainder computing element
JP2943255B2 (en) Reciprocal calculation circuit
JP2790327B2 (en) Remainder multiplication circuit and remainder multiplication method
JP2951685B2 (en) Fixed-point arithmetic unit
JP3074958B2 (en) Serial multiplier with addition function
JPH08147146A (en) Division arithmetic operation device
JPH0368415B2 (en)
JPH08249161A (en) Cubic root arithmetic unit
KR920006324B1 (en) Optimization method of 2&#39;s complement code multplier
JPH07160480A (en) Decimal divider
JP2995721B2 (en) Division device and division method
JPS60247736A (en) Dividing circuit
JPH0553768A (en) Divider
JPH01125625A (en) Division device
JPS61118835A (en) Hardware divider
JP2001092639A (en) Division and square root arithmetic unit
JP2001344093A (en) Division device