JPH05150951A - Division processing system - Google Patents

Division processing system

Info

Publication number
JPH05150951A
JPH05150951A JP4134254A JP13425492A JPH05150951A JP H05150951 A JPH05150951 A JP H05150951A JP 4134254 A JP4134254 A JP 4134254A JP 13425492 A JP13425492 A JP 13425492A JP H05150951 A JPH05150951 A JP H05150951A
Authority
JP
Japan
Prior art keywords
quotient
value
dividend
divisor
predicted
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
JP4134254A
Other languages
Japanese (ja)
Inventor
Tomomi Kasuya
智巳 粕谷
Takayuki Minegishi
孝行 峯岸
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP4134254A priority Critical patent/JPH05150951A/en
Publication of JPH05150951A publication Critical patent/JPH05150951A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To provide the division unit realizing the higher processing speed with small circuitry without using a normal digital multiplier having the slower processing speed with large scale circuitry. CONSTITUTION:After providing a value multiplying a divisor by a prediction of the first quotient by shifting a divider leftward by-2 (digit number of the number to be divided) with a shift register 1, the smaller value is estimated as the quotient when the number to be divided is smaller than the output of an adder 3 and when it is larger, the larger number is estimated as the quotient and the processing is repeated until the output of the adder 3 and the number to be divided become equal in the comparison by a comparator 4.

Description

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

【0001】[0001]

【産業上の利用分野】この発明は、ハードウェアで構成
されたディジタル除算器に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a digital divider composed of hardware.

【0002】[0002]

【従来の技術】図3は例えば特開昭64−84333号
公報に示された従来の除算器の構成を示すブロック図で
ある。図3において、21は乗算器、22は加算器、2
3はレジスタ、24は単位遅延回路である。
2. Description of the Related Art FIG. 3 is a block diagram showing the configuration of a conventional divider shown in Japanese Patent Laid-Open No. 64-84333. In FIG. 3, 21 is a multiplier, 22 is an adder, 2
3 is a register, and 24 is a unit delay circuit.

【0003】次に動作について説明する。図3におい
て、まず乗算器21によって“1”から除数Aを引いた
値の“1−A”を出力値Yに掛け合わせる。次に、乗算
器21の出力結果の値と被除数Xとを加算器22によっ
て加算する。そして、この加算器22の加算結果が単位
遅延回路24に入力されて、順次遅延されてからレジス
タ23より出力される。
Next, the operation will be described. In FIG. 3, first, the multiplier 21 multiplies the output value Y by "1-A" which is a value obtained by subtracting the divisor A from "1". Next, the value of the output result of the multiplier 21 and the dividend X are added by the adder 22. Then, the addition result of the adder 22 is input to the unit delay circuit 24, sequentially delayed, and then output from the register 23.

【0004】図3に示すように構成された除算器におい
て被除数Xを入力したときの出力値Y(n)を考えてみる
と、次の(1)式のように表わされる。
Considering the output value Y (n) when the dividend X is input to the divider configured as shown in FIG. 3, it is expressed by the following equation (1).

【0005】 Y(n)=X+Y(n-1)・(1−A) ・・・(1)Y (n) = X + Y (n-1) · (1-A) (1)

【0006】ここで、例えばX=1,A=0.5,Y
(0)=0,Yを4ビットとしたときの動作を考えると、
上記(1)式によって第1回目の演算出力Y(1)は、次
の(2)式に示すようになり、
Here, for example, X = 1, A = 0.5, Y
Considering the operation when (0) = 0 and Y is 4 bits,
According to the above equation (1), the first operation output Y (1) becomes as shown in the following equation (2),

【0007】 Y(1)=X+Y(0)・(1−0.5) =1+0・(1−0.5)=1 ・・・(2)Y (1) = X + Y (0) · (1-0.5) = 1 + 0 · (1-0.5) = 1 (2)

【0008】これをn=5まで繰り返すと、When this is repeated until n = 5,

【0009】 Y(2)=X+Y(1)・(1−0.5)=1+1・(1−0.5)=1.5 ・ ・ ・ Y(5)=X+Y(4)・(1−0.5)=1.9375=1/0.5−1/24 Y (2) = X + Y (1). (1-0.5) = 1 + 1. (1-0.5) = 1.5 ..... Y (5) = X + Y (4). (1- 0.5) = 1.9375 = 1 / 0.5-1 / 2 4

【0010】となり、Y(5)は、被除数1、除数0.5
の除算の4ビット精度の除算出力となる。
And Y (5) is the dividend 1 and the divisor 0.5
It has a 4-bit precision division calculation power.

【0011】[0011]

【発明が解決しようとする課題】従来の除算器は以上の
ように構成されているので、通常のデジタル乗算器を用
いなければならず、そのため回路規模が大きくなるとい
う問題点があった。また、デジタル乗算器は処理速度が
遅いため、除算器全体としての処理にも時間が多くかか
るという問題点があった。
Since the conventional divider is constructed as described above, a normal digital multiplier must be used, which causes a problem that the circuit scale becomes large. Further, since the processing speed of the digital multiplier is slow, there is a problem that it takes a lot of time for the processing of the entire divider.

【0012】この発明は上記のような問題点を解決する
ためになされたもので、回路規模の小規模化及び処理速
度の向上を図れる除算器を得ることを目的とする。
The present invention has been made to solve the above problems, and an object of the present invention is to obtain a divider capable of reducing the circuit scale and improving the processing speed.

【0013】[0013]

【課題を解決するための手段】この発明の請求項1に係
る除算処理方式は、除数をシフトするシフト回路を用い
て、商の予測値に除数を乗じた値を得る乗算手段と、こ
の乗算手段の出力と被除数とを比較する比較手段とを有
し、上記シフト回路を用いて除数を被除数の桁数によっ
て決まるビット数分左にシフトすることにより第1回目
の商の予測値に除数を乗じた値を得た後、比較手段によ
る比較において被除数の方が小さい場合は、より小さな
値を商として予測し、大きい場合は、より大きな値を商
として予測し、乗算手段の出力と被除数とが等しくなる
まで、この操作を繰り返すことにより商を求めるように
したものである。
A division processing method according to claim 1 of the present invention uses a shift circuit for shifting a divisor to obtain a value obtained by multiplying a predicted value of a quotient by a divisor, and a multiplication means. Comparing the output of the means with the dividend, the shift circuit is used to shift the divisor to the left by the number of bits determined by the number of digits of the dividend, thereby dividing the divisor into the predicted value of the first quotient. After the multiplied value is obtained, if the dividend in the comparison by the comparison means is smaller, the smaller value is predicted as the quotient, and if it is larger, the larger value is predicted as the quotient, and the output of the multiplication means and the dividend This operation is repeated until the quotients become equal to each other.

【0014】また、請求項2に係る除算処理方式は、除
数をシフトする第1のシフト回路を用いて、商の予測値
に除数を乗じた値を得る乗算手段と、この乗算手段の出
力と被除数とを比較する第1の比較手段と、被除数をシ
フトする第2のシフト回路と、被除数と除数の値を比較
する第2の比較手段とを有し、この第2の比較手段によ
る比較において被除数が除数以上の場合は、第1のシフ
ト回路を用いて除数を被除数の桁数によって決まるビッ
ト数分左にシフトすることにより第1回目の商の予測値
に除数を乗じた値を得た後、比較手段による比較におい
て被除数の方が小さい場合は、より小さな値を商として
予測し、大きい場合は、より大きな値を商として予測
し、乗算手段の出力と被除数とが等しくなるまで、この
操作を繰り返すことにより商を求め、また第2の比較手
段による比較において被除数より除数が大きい場合は、
第2のシフト回路を用いて被除数を除数以上となるまで
シフトするとともに、シフトしたビット数分の“0”を
小数点を表わす商の上位ビットした後、第1の比較手段
による比較において被除数の方が小さい場合は、より小
さな値を商として予測し、大きい場合は、より大きな値
を商として予測し、乗算手段の出力と被除数とが等しく
なるまで、この操作を繰り返すことにより商を求めるよ
うにしたものでる。
According to a second aspect of the division processing method, the first shift circuit for shifting the divisor is used to obtain a value obtained by multiplying the predicted value of the quotient by the divisor, and the output of the multiplication means. The first comparison means for comparing with the dividend, the second shift circuit for shifting the dividend, and the second comparison means for comparing the value of the dividend and the value of the divisor are provided, and in the comparison by the second comparison means, If the dividend is greater than or equal to the divisor, the first shift circuit is used to shift the divisor to the left by the number of bits determined by the number of digits of the dividend, thereby obtaining the value obtained by multiplying the predicted value of the first quotient by the divisor. After that, when the dividend is smaller in the comparison by the comparing means, a smaller value is predicted as a quotient, and when the dividend is larger, a larger value is predicted as a quotient, and until the output of the multiplying means and the dividend become equal, Repeating the operation If more calculated quotient and the divisor from the dividend is greater in comparison by the second comparison means,
The second shift circuit is used to shift the dividend until it becomes equal to or greater than the divisor, and "0" corresponding to the number of bits shifted is set to the higher bit of the quotient representing the decimal point, and then the dividend is compared in the comparison by the first comparison means. If is smaller, the smaller value is predicted as the quotient, and if it is larger, the larger value is predicted as the quotient, and the quotient is obtained by repeating this operation until the output of the multiplication means and the dividend are equal. It ’s done.

【0015】[0015]

【作用】この発明の請求項1において、乗算手段は除数
をシフトするシフト回路を用いて、商の予測値に除数を
乗じた値を得る。比較手段は乗算手段の出力と被除数と
を比較する。このような構成により、シフト回路を用い
て除数を被除数の桁数によって決まるビット数分左にシ
フトすることにより第1回目の商の予測値に除数を乗じ
た値を得た後、乗算手段の出力より被除数の方が小さい
場合は、より小さな値を商として予測し、大きい場合
は、より大きな値を商として予測し、乗算手段の出力と
被除数とが等しくなるまで、この操作を繰り返すことに
より、目的とする商が求められる。
In the first aspect of the present invention, the multiplication means obtains a value obtained by multiplying the predicted value of the quotient by the divisor by using the shift circuit for shifting the divisor. The comparison means compares the output of the multiplication means with the dividend. With such a configuration, the divisor is shifted to the left by the number of bits determined by the number of digits of the dividend by using the shift circuit to obtain a value obtained by multiplying the predicted value of the first quotient by the divisor, and then the multiplication means If the dividend is smaller than the output, the smaller value is predicted as the quotient, if it is larger, the larger value is predicted as the quotient, and this operation is repeated until the output of the multiplication means and the dividend are equal. , The desired quotient is required.

【0016】また、請求項2においては、被除数より除
数が大きい場合、被除数を除数以上の値になるようシフ
トすることにより、被除数より除数が大きい場合でも、
小規模で、かつ、処理速度の速い除算器を得ることがで
きる。
Further, in the present invention, when the divisor is larger than the dividend, the dividend is shifted to a value equal to or larger than the divisor so that the divisor is larger than the dividend.
It is possible to obtain a divider with a small scale and a high processing speed.

【0017】[0017]

【実施例】【Example】

実施例1.図1はこの発明の一実施例に係る除算器の構
成を示すブロック図である。図1において、1は除数を
シフトし2N倍するシフトレジスタ(シフト回路)、2
は前回の予測した商の値に除数を乗じた値を保持するレ
ジスタ、3はこのレジスタ2の出力,即ち前回予測した
商の値に除数を乗じた値とシフトレジスタ1の出力とを
加算し、今回予測した商の値に除数を乗じた値を出力す
る加算器、4は加算器3の出力と被除数とを比較し商を
出力する比較手段としての比較器である。この実施例に
おいて、商の値の予測値は、被除数の桁数と前回予測し
た商の値とにより今回商が取り得る範囲の中心の値であ
り、かつ2の倍数である。なお、上記シフトレジスタ1
とレジスタ2と加算器3により、除数をシフトするシフ
ト回路を用いて商の予測値に除数を乗じた値を得る乗算
手段10が構成されている。
Example 1. 1 is a block diagram showing the configuration of a divider according to an embodiment of the present invention. In FIG. 1, 1 is a shift register (shift circuit) for shifting a divisor and multiplying it by 2 N , 2
Is a register for holding a value obtained by multiplying a previously predicted quotient value by a divisor, and 3 is an output of the register 2, that is, a value obtained by multiplying a previously predicted quotient value by a divisor and an output of the shift register 1. An adder 4 that outputs a value obtained by multiplying the quotient value predicted this time by a divisor is a comparator that compares the output of the adder 3 and the dividend and outputs a quotient. In this embodiment, the predicted value of the quotient is the center value of the range that the present quotient can take and is a multiple of 2 depending on the number of digits of the dividend and the previously predicted quotient value. In addition, the shift register 1
The register 2 and the adder 3 constitute a multiplication means 10 that obtains a value obtained by multiplying the predicted value of the quotient by the divisor by using a shift circuit that shifts the divisor.

【0018】次に動作について説明する。正の整数の除
算であり、かつ、被除数の値が除数以上の場合、除数が
1の場合を除けば商の値は1以上,被除数の1/2以下
の値となるので、商の値はこの範囲内より予測されるこ
とになる。これを2進数で考えた場合、商の値は被除数
の桁数より1桁少ない桁数の範囲内で予測されることに
なる。
Next, the operation will be described. If it is a division of a positive integer and the value of the dividend is greater than or equal to the divisor, the value of the quotient is 1 or more and less than or equal to 1/2 of the dividend, so the value of the quotient is It will be predicted from this range. If this is considered as a binary number, the value of the quotient is predicted within the range of the number of digits that is one digit less than the number of digits of the dividend.

【0019】そこで、まず商を{(商の取り得る最大値
+1)/2}と予測する。つまり、予測された商は、商
の取り得る最大値の中心となる。これが第1回目の商の
予測である。次に、予測された商と除数の積を求める。
これは除数を左にシフトすることにより求めることがで
きる。予測された商は商の取り得る最大値の半分,つま
り被除数の1/4であるので、(被除数の桁数−2)の
ビット数分左にシフトすればよい。
Therefore, first, the quotient is predicted as {(maximum value of the quotient + 1) / 2}. That is, the predicted quotient becomes the center of the maximum value that the quotient can take. This is the first quotient prediction. Next, the product of the predicted quotient and the divisor is calculated.
This can be obtained by shifting the divisor to the left. Since the predicted quotient is half of the maximum value that the quotient can take, that is, ¼ of the dividend, it may be shifted to the left by the number of bits of (digit number of dividend-2).

【0020】さて、除数と被除数が他の装置より送られ
て来ると、シフトレジスタ1は第1回目の予測した商と
除数の積を求めるため、(被除数の桁数−2)のビット
数分除数を左シフトする。また、この時同時にレジスタ
2はゼロクリアされる。次に、加算器3は予測した商と
除数の積にレジスタ2の値を加えたものを出力する。こ
の時点では、レジスタ2の値はゼロクリアされているの
で、出力は第1回目の商の予測値と除数の積がそのまま
出力される。加算器3が加算結果を出力すると、比較器
4は、加算器3の出力値,つまり第1回目の商の予測値
と除数の積と、被除数を比較する。
Now, when the divisor and the dividend are sent from another device, the shift register 1 obtains the product of the quotient and the divisor predicted for the first time, so that the number of bits of (the number of digits of the dividend-2) is obtained. Shift the divisor left. At the same time, the register 2 is cleared to zero. Next, the adder 3 outputs the product of the predicted quotient and the divisor plus the value of the register 2. At this point of time, the value of the register 2 is cleared to zero, so that the product of the predicted value of the first quotient and the divisor is output as it is. When the adder 3 outputs the addition result, the comparator 4 compares the output value of the adder 3, that is, the product of the predicted value of the first quotient and the divisor, with the dividend.

【0021】この結果、加算器3の出力値の方が大きけ
れば予測した商の値が大きかったということになるの
で、この桁に関しては商が“0”ということになる。そ
こで比較器4は、この桁,つまり最上位ビットの商を
“0”として出力する。また、加算器3の出力値の方が
小さかった場合、予測した商の値が小さかったというこ
とになるので、この桁に関しては商が“1”ということ
になり、比較器4は最上位ビットの商を“1”として出
力する。また、加算器3の出力値と被除数が等しかった
場合、予測した商が正しいということになるので、この
桁の商を“1”とし、残りの桁,つまり除数をシフトし
たビット数から1を引いたビット数分を“0”として出
力する。また、この場合は処理を終了する。
As a result, if the output value of the adder 3 is larger, it means that the value of the predicted quotient is larger, so that the quotient is "0" for this digit. Therefore, the comparator 4 outputs this digit, that is, the quotient of the most significant bit, as "0". Also, if the output value of the adder 3 is smaller, it means that the value of the predicted quotient is smaller, so the quotient is “1” for this digit, and the comparator 4 sets the most significant bit. The quotient is output as "1". Also, if the output value of the adder 3 and the dividend are equal, the predicted quotient is correct, so the quotient of this digit is set to "1", and the remaining digit, that is, the number of bits obtained by shifting the divisor, is set to 1 The subtracted number of bits is output as "0". Further, in this case, the processing ends.

【0022】次にレジスタ2は、比較器4の比較結果に
より加算器3の出力結果を格納する。比較結果が“0”
の場合、第1回目の商の予測は大きかったため第2回目
の商の予測は第1回目の予測値未満となるので、加算器
3の出力結果をレジスタ2には格納しない。反対に比較
結果が“1”であった場合、第1回目の予測値は小さか
ったため第2回目の予測は第1回目の予測値より大きく
なるので、加算器3の出力をレジスタ2に格納する。
Next, the register 2 stores the output result of the adder 3 according to the comparison result of the comparator 4. Comparison result is "0"
In this case, the prediction of the quotient of the first time is large, and the prediction of the quotient of the second time is less than the predicted value of the first time. Therefore, the output result of the adder 3 is not stored in the register 2. On the contrary, when the comparison result is “1”, the second predicted value is larger than the first predicted value because the first predicted value is small, and the output of the adder 3 is stored in the register 2. ..

【0023】次に第2回目の予測を行なう。第2回目の
予測は第1回目の予測の1/2の範囲で行なう。そこ
で、シフトレジスタ1は除数を1ビット右にシフトす
る。このことにより、シフトレジスタ1の出力は、商の
取り得る最大値の1/4の値と除数の積が出力されるこ
とになる。このシフトレジスタ1の出力と、第1回の比
較結果により格納されているレジスタ2の出力とを加算
することにより、第2回目の商の予測値と除数の積が作
成され、比較器4により被除数と比較される。
Next, the second prediction is performed. The second prediction is performed in the range of 1/2 of the first prediction. Therefore, the shift register 1 shifts the divisor right by 1 bit. As a result, the output of the shift register 1 is the product of the value 1/4 of the maximum value of the quotient and the divisor. By adding the output of the shift register 1 and the output of the register 2 stored by the first comparison result, a product of the predicted value of the second quotient and the divisor is created, and the comparator 4 It is compared with the dividend.

【0024】このようにして、比較器4の出力が“等し
い”となるか、(被除数の桁数−2)のビット数分,前
記のように商の値を順次限定し予測することにより、比
較器4より1ビットずつ商が出力される。
In this way, the output of the comparator 4 becomes "equal" or the value of the quotient is sequentially limited and predicted by the number of bits of (the number of digits of the dividend-2), as described above. The quotient is output from the comparator 4 bit by bit.

【0025】以上のことを実際に被除数を15=(11
11)2、除数3=(11)2としたときの動作を考えて
みると、第1回目の演算では、まずシフトレジスタ1に
は除数を左に2だけシフトした値である(1100)2
が設定される。この値は、レジスタ2が“0”に初期設
定されているため、そのまま比較器4に入力され被除数
(1111)2と比較される。比較器4では比較の結
果、被除数の方が大きいため商の最上位ビットとして
“1”を出力する。第2回目の演算ではシフトレジスタ
1の値は1ビット右シフトされて(110)2、レジス
タ2の値は第1回目の加算器3の出力が保持されている
ので(1100)2となっており、加算器3は(100
10)2を比較器4に出力する。比較器4は加算器3の
出力の方が大きいため商の2ビット目として“0”を出
力する。第3回目の演算ではシフトレジスタ1の値はさ
らに1ビット右にシフトされて(11)2、レジスタ2
の値は第2回目の演算の比較結果により新たに値を取り
込まないため第1回目の加算器3の出力が保持されてい
るので(1100)2となっており、加算器3は(11
11)2を比較器4に出力する。比較器4では加算器3
の出力と被除数が等しいため、商の3ビット目を“1”
として出力し処理を終了する。ここで比較器4より順次
1ビットずつ出力される値を並べると(101)2=5
で、被除数15、除数3の除算出力となる。
The above is actually the dividend 15 = (11
Considering the operation when 11) 2 and divisor 3 = (11) 2 , in the first calculation, the shift register 1 first has a value obtained by shifting the divisor by 2 to the left (1100) 2.
Is set. This value is input to the comparator 4 as it is and compared with the dividend (1111) 2 because the register 2 is initially set to "0". As a result of the comparison, the comparator 4 outputs "1" as the most significant bit of the quotient because the dividend is larger. In the second operation, the value of the shift register 1 is right-shifted by 1 bit (110) 2 , and the value of the register 2 is (1100) 2 because the output of the first adder 3 is held. And the adder 3 (100
10) Output 2 to the comparator 4. The comparator 4 outputs "0" as the second bit of the quotient because the output of the adder 3 is larger. In the third operation, the value in shift register 1 is further shifted to the right by 1 bit (11) 2 , and register 2
The value of is (1100) 2 because the output of the adder 3 of the first time is held because a new value is not taken in according to the comparison result of the second operation, and the value of
11) 2 is output to the comparator 4. Comparator 4 has adder 3
Since the output of is equal to the dividend, the third bit of the quotient is "1"
Is output and the processing ends. Here, when the values output from the comparator 4 one by one are arranged, (101) 2 = 5
Then, it becomes the divisor calculation power of the dividend 15 and the divisor 3.

【0026】実施例2.上記実施例1では、被除数の値
より除数の値が大きい場合は除算を行なうことができな
いが、これを可能にした一実施例を図2に示す。図2に
おいて、1は除数をシフトし2N倍するシフトレジスタ
(第1のシフト回路)、2は前回の予測した商の値に除
数を乗じた値を保持するレジスタ、3はこのレジスタ2
の出力,即ち前回予測した商の値に除数を乗じた値とシ
フトレジスタ1の出力とを加算し、今回予測した商の値
に除数を乗じた値を出力する加算器、4は加算器3の出
力と被除数とを比較し商を出力する第1の比較手段とし
ての比較器、5は被除数をシフトし2N倍するシフトレ
ジスタ(第2のシフト回路)、6は前記シフトレジスタ
5や比較器4から出力される商を蓄積する商レジスタ、
7は被除数と除数を比較する第2の比較手段としての比
較器、8はこの比較器6の比較結果に基づき除数,被除
数のシフト動作を制御し、被除数より除数が大きい場合
には小数点を表わす商の上位ビットをシフトレジスタ5
から商レジスタ6に出力する制御回路である。なお、前
記実施例同様、上記シフトレジスタ1とレジスタ2と加
算器3により、除数をシフトする第1のシフト回路を用
いて商の予測値に除数を乗じた値を得る乗算手段10が
構成されている。
Example 2. In the above-mentioned first embodiment, when the value of the divisor is larger than the value of the dividend, the division cannot be performed, but an embodiment that makes this possible is shown in FIG. In FIG. 2, reference numeral 1 is a shift register (first shift circuit) for shifting a divisor and multiplying it by 2 N , 2 is a register for holding a value obtained by multiplying a previously predicted quotient value by a divisor, and 3 is this register 2
, That is, the value of the previously predicted quotient multiplied by a divisor and the output of the shift register 1 are added, and an adder for outputting the value of the currently predicted quotient multiplied by a divisor, 4 is an adder 3 Comparator as a first comparing means for comparing the output of the above with the dividend and outputting the quotient, 5 is a shift register (second shift circuit) for shifting the dividend and multiplying it by 2 N , 6 is the shift register 5 or the comparison A quotient register for accumulating the quotient output from the container 4,
Reference numeral 7 is a comparator as a second comparing means for comparing the dividend and the divisor, and 8 is for controlling the shift operation of the divisor and the dividend based on the comparison result of the comparator 6, and represents the decimal point when the divisor is larger than the dividend. Shift register 5 with upper bit of quotient
From the quotient register 6 to the quotient register 6. As in the above embodiment, the shift register 1, the register 2, and the adder 3 constitute a multiplication means 10 for obtaining a value obtained by multiplying the predicted value of the quotient by the divisor by using the first shift circuit for shifting the divisor. ing.

【0027】次に動作について説明する。本実施例によ
る除算器に除数および被除数が入力されると、比較器7
において除数と被除数の比較が行なわれる。この結果、
被除数が除数以上の場合は、制御回路8がシフトレジス
タ1を用いて除数を(被除数の桁数−2)だけ左にシフ
トする。これは前記実施例1でも述べたように、商の値
を{(商の取り得る範囲の最大値+1)/2}と予測す
ることであり、言い換えると前記被除数の桁数で決定さ
れる商の値の範囲の中心の値を第1回目の商の予測値と
し、さらにこの予測値に除数を乗じるということにな
る。また、この時レジスタ2には“0”が設定されてお
り、“0”と第1回目の予測値に除数を乗じた値が加算
器3に入力される。さらに、この時のシフトレジスタ5
は制御回路8により動作が停止され、被除数のシフトは
行なわない。
Next, the operation will be described. When the divisor and dividend are input to the divider according to this embodiment, the comparator 7
The divisor and dividend are compared in. As a result,
When the dividend is greater than or equal to the divisor, the control circuit 8 shifts the divisor to the left by (the number of digits of the dividend-2) using the shift register 1. This is to predict the value of the quotient as {(maximum value of quotient +1) / 2} as described in the first embodiment. In other words, the quotient determined by the number of digits of the dividend. The value at the center of the value range of is the predicted value of the first quotient, and this predicted value is multiplied by the divisor. Further, at this time, “0” is set in the register 2, and the value obtained by multiplying “0” and the first predicted value by the divisor is input to the adder 3. Furthermore, the shift register 5 at this time
The operation is stopped by the control circuit 8 and the dividend is not shifted.

【0028】また、比較器7における比較結果が被除数
より除数が大きいとなった場合、制御回路8はシフトレ
ジスタ5により被除数を除数以上の値になるまでシフト
する。またこの時同時に、シフトしたビット数分“0”
を商レジスタ6に出力する。これが、小数点を表わす商
の上位ビットとなる。さらにこの時、制御回路8はシフ
トレジスタ1による除数のシフトを行なわず、除数がそ
のまま加算器3に出力され、この値が第1回目の商の予
測値と除数を乗じた値となる。レジスタ2はこの時
“0”に設定されており、“0”とシフトレジスタ1の
値が加算器3に出力される。
When the comparison result in the comparator 7 indicates that the divisor is larger than the dividend, the control circuit 8 shifts the dividend by the shift register 5 until the dividend becomes a value equal to or larger than the divisor. At the same time, at the same time, "0" for the number of bits shifted
Is output to the quotient register 6. This is the upper bit of the quotient representing the decimal point. Further, at this time, the control circuit 8 does not shift the divisor by the shift register 1 and outputs the divisor as it is to the adder 3, and this value becomes a value obtained by multiplying the predicted value of the first quotient by the divisor. The register 2 is set to "0" at this time, and "0" and the value of the shift register 1 are output to the adder 3.

【0029】次に、加算器3は予測した商と除数の積に
レジスタ2の値を加えたものを出力する。上述したよう
にこの時点では、レジスタ2の値はゼロクリアされてい
るので、出力は第1回目の商の予測値と除数の積がその
まま出力される。加算器3が加算結果を出力すると、比
較器4は加算器3の出力値,つまり第1回目の商の予測
値と除数の積と、被除数を比較する。
Next, the adder 3 outputs the product of the predicted quotient and the divisor plus the value of the register 2. As described above, since the value of the register 2 is cleared to zero at this point, the product of the predicted value of the first quotient and the divisor is output as it is. When the adder 3 outputs the addition result, the comparator 4 compares the output value of the adder 3, that is, the product of the predicted value of the first quotient and the divisor with the dividend.

【0030】この結果、加算器3の出力値の方が大きけ
れば予測した商の値が大きかったということになるの
で、この桁に関しては商が“0”ということになる。そ
こで比較器4はこの桁,つまり最上位ビットの商を
“0”として商レジスタ6に出力する。また、加算器3
の出力値の方が小さかった場合、予測した商の値が小さ
かったということになるので、この桁に関しては商が
“1”ということになり、比較器4は最上位ビットの商
を“1”として商レジスタ6に出力する。また、加算器
3の出力値と被除数が等しかった場合、予測した商が正
しいということになるので、この桁の商を“1”とし、
残りの桁,つまり除数をシフトしたビット数から1を引
いたビット数分を“0”として商レジスタ6に出力す
る。比較結果が等しくなかった場合、次にレジスタ2
は、比較器4の比較結果により加算器3の出力結果を格
納する。
As a result, if the output value of the adder 3 is larger, it means that the value of the predicted quotient is larger, so that the quotient is "0" for this digit. Therefore, the comparator 4 outputs the quotient of this digit, that is, the most significant bit, to the quotient register 6 as "0". Also, adder 3
If the output value of is smaller, it means that the value of the predicted quotient was smaller. Therefore, the quotient is “1” for this digit, and the comparator 4 sets the quotient of the most significant bit to “1”. Is output to the quotient register 6. If the output value of the adder 3 and the dividend are equal, the predicted quotient is correct, so the quotient of this digit is set to “1”,
The remaining digits, that is, the number of bits obtained by subtracting 1 from the number of bits obtained by shifting the divisor, is output to the quotient register 6 as "0". If the comparison results are not equal, then register 2
Stores the output result of the adder 3 according to the comparison result of the comparator 4.

【0031】比較結果が“0”の場合、第1回目の商の
予測は大きかったため第2回目の商の予測は第1回目の
予測値未満となるので、加算器3の出力結果をレジスタ
2には格納しない。反対に比較結果が“1”であった場
合、第1回目の予測値は小さかったため第2回目の予測
は第1回目の予測値より大きくなるので、加算器3の出
力をレジスタ2に格納する。
When the comparison result is "0", the prediction of the quotient at the first time is large and the prediction of the quotient at the second time is less than the predicted value of the first time. Therefore, the output result of the adder 3 is set to the register 2 Not stored in. On the contrary, when the comparison result is “1”, the second predicted value is larger than the first predicted value because the first predicted value is small, and the output of the adder 3 is stored in the register 2. ..

【0032】次に第2回目の予測を行なう。第2回目の
予測は第1回目の予測の1/2の範囲で行なう。そこ
で、シフトレジスタ1は除数を1ビット右にシフトす
る。このことにより、シフトレジスタ1の出力は、商の
取り得る最大値の1/4の値と除数の積が出力されるこ
とになる。このシフトレジスタ1の出力と、第1回目の
比較結果により格納されているレジスタ2の出力とを加
算することにより、第2回目の商の予測値と除数の積が
作成され、比較器4により被除数と比較される。
Next, the second prediction is performed. The second prediction is performed in the range of 1/2 of the first prediction. Therefore, the shift register 1 shifts the divisor right by 1 bit. As a result, the output of the shift register 1 is the product of the value 1/4 of the maximum value of the quotient and the divisor. By adding the output of the shift register 1 and the output of the register 2 stored by the first comparison result, the product of the predicted value of the second quotient and the divisor is created, and the comparator 4 It is compared with the dividend.

【0033】このようにして、比較器4の出力が“等し
い”となるか、(被除数の桁数−2)のビット数分前記
のように商の値を順次限定し予測することにより、比較
器4より1ビットずつ商が出力され、商レジスタ6に格
納される。
In this way, the output of the comparator 4 becomes "equal", or the value of the quotient is sequentially limited and predicted by the number of bits of (the number of digits of the dividend-2) as described above. The quotient is output from the container 4 bit by bit and stored in the quotient register 6.

【0034】[0034]

【発明の効果】以上のように、この発明によれば、除数
をシフトするシフト回路を用いて、商の予測値に除数を
乗じた値を得る乗算手段と、この乗算手段の出力と被除
数とを比較する比較手段とを有し、上記シフト回路を用
いて除数を被除数の桁数によって決まるビット数分左に
シフトすることにより第1回目の商の予測値に除数を乗
じた値を得た後、比較手段による比較において被除数の
方が小さい場合は、より小さな値を商として予測し、大
きい場合は、より大きな値を商として予測し、乗算手段
の出力と被除数とが等しくなるまで、この操作を繰り返
すことにより商を求めるようにしたので、回路規模が大
きく処理速度の遅い乗算器を用いずに、小規模で処理速
度の速い除算器が得られるという効果がある。
As described above, according to the present invention, using the shift circuit for shifting the divisor, the multiplication means for obtaining the value obtained by multiplying the predicted value of the quotient by the divisor, and the output of this multiplication means and the dividend And a comparing means for comparing with each other, and by shifting the divisor to the left by the number of bits determined by the number of digits of the dividend using the shift circuit, a value obtained by multiplying the predicted value of the first quotient by the divisor is obtained. After that, when the dividend is smaller in the comparison by the comparing means, a smaller value is predicted as a quotient, and when the dividend is larger, a larger value is predicted as a quotient, and until the output of the multiplying means and the dividend become equal, Since the quotient is obtained by repeating the operation, there is an effect that a small-scale divider having a high processing speed can be obtained without using a multiplier having a large circuit scale and a low processing speed.

【0035】またさらに、被除数をシフトするシフト回
路を設けて、被除数より除数が大きい場合にこれを動作
させ、被除数を除数以上としてから前記操作により商を
求めるようにしたことにより、除算器に入力される除数
が被除数より大きい場合でも、小規模で処理速度の速い
除算器が得られるという効果がある。
Furthermore, a shift circuit for shifting the dividend is provided, and when the divisor is larger than the dividend, it is operated so that the quotient is obtained by the above operation after the dividend is greater than or equal to the divisor. Even if the divisor to be used is larger than the dividend, it is possible to obtain a small-scale divider having a high processing speed.

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

【図1】この発明の実施例1による除算器のブロック図
である。
FIG. 1 is a block diagram of a divider according to a first embodiment of the present invention.

【図2】この発明の実施例2による除算器のブロック図
である。
FIG. 2 is a block diagram of a divider according to a second embodiment of the present invention.

【図3】従来の除算器のブロック図である。FIG. 3 is a block diagram of a conventional divider.

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

1 シフトレジスタ(第1のシフト回路) 2 レジスタ 3 加算器 4 比較器(第1の比較手段) 5 シフトレジスタ(第2のシフト回路) 6 商レジスタ 7 比較器(第2の比較手段) 8 制御回路 10 乗算手段 1 shift register (first shift circuit) 2 register 3 adder 4 comparator (first comparing means) 5 shift register (second shift circuit) 6 quotient register 7 comparator (second comparing means) 8 control Circuit 10 multiplication means

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 除数をシフトするシフト回路を用いて、
商の予測値に除数を乗じた値を得る乗算手段と、この乗
算手段の出力と被除数とを比較する比較手段とを有し、
上記シフト回路を用いて除数を被除数の桁数によって決
まるビット数分左にシフトすることにより第1回目の商
の予測値に除数を乗じた値を得た後、比較手段による比
較において被除数の方が小さい場合は、より小さな値を
商として予測し、大きい場合は、より大きな値を商とし
て予測し、乗算手段の出力と被除数とが等しくなるま
で、この操作を繰り返すことにより商を求めることを特
徴とする除算処理方式。
1. Using a shift circuit for shifting a divisor,
And a multiplication means for obtaining a value obtained by multiplying the predicted value of the quotient by a divisor, and a comparison means for comparing the output of the multiplication means with the dividend.
After shifting the divisor to the left by the number of bits determined by the number of digits of the dividend using the shift circuit, a value obtained by multiplying the predicted value of the first quotient by the divisor is obtained, and then the dividend is compared in the comparison by the comparison means. If is smaller, the smaller value is predicted as the quotient, and if it is larger, the larger value is predicted as the quotient, and the quotient is obtained by repeating this operation until the output of the multiplication means and the dividend are equal. Characteristic division processing method.
【請求項2】 除数をシフトする第1のシフト回路を用
いて、商の予測値に除数を乗じた値を得る乗算手段と、
この乗算手段の出力と被除数とを比較する第1の比較手
段と、被除数をシフトする第2のシフト回路と、被除数
と除数の値を比較する第2の比較手段とを有し、この第
2の比較手段による比較において被除数が除数以上の場
合は、第1のシフト回路を用いて除数を被除数の桁数に
よって決まるビット数分左にシフトすることにより第1
回目の商の予測値に除数を乗じた値を得た後、比較手段
による比較において被除数の方が小さい場合は、より小
さな値を商として予測し、大きい場合は、より大きな値
を商として予測し、乗算手段の出力と被除数とが等しく
なるまで、この操作を繰り返すことにより商を求め、ま
た第2の比較手段による比較において被除数より除数が
大きい場合は、第2のシフト回路を用いて被除数を除数
以上となるまでシフトするとともに、シフトしたビット
数分の“0”を小数点を表わす商の上位ビットした後、
第1の比較手段による比較において被除数の方が小さい
場合は、より小さな値を商として予測し、大きい場合
は、より大きな値を商として予測し、乗算手段の出力と
被除数とが等しくなるまで、この操作を繰り返すことに
より商を求めることを特徴とする除算処理方式。
2. A multiplication means for obtaining a value obtained by multiplying a predicted value of a quotient by a divisor by using a first shift circuit for shifting a divisor.
It has a first comparing means for comparing the output of the multiplying means and the dividend, a second shift circuit for shifting the dividend, and a second comparing means for comparing the values of the dividend and the divisor. When the dividend is greater than or equal to the divisor in the comparison by the comparing means of 1, the first shift circuit is used to shift the divisor to the left by the number of bits determined by the number of digits of the dividend.
After obtaining the value obtained by multiplying the predicted value of the quotient of the second time by the divisor, when the dividend is smaller in the comparison by the comparing means, the smaller value is predicted as the quotient, and when the dividend is larger, the larger value is predicted as the quotient. Then, the quotient is obtained by repeating this operation until the output of the multiplication means becomes equal to the dividend, and when the divisor is larger than the dividend in the comparison by the second comparison means, the dividend is calculated using the second shift circuit. Is shifted until it is equal to or greater than the divisor, and "0" for the number of shifted bits is set to the high-order bit of the quotient representing the decimal point.
When the dividend is smaller in the comparison by the first comparing means, a smaller value is predicted as the quotient, and when the dividend is larger, the larger value is predicted as the quotient, until the output of the multiplying means becomes equal to the dividend. A division processing method characterized in that a quotient is obtained by repeating this operation.
JP4134254A 1991-04-30 1992-04-27 Division processing system Pending JPH05150951A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4134254A JPH05150951A (en) 1991-04-30 1992-04-27 Division processing system

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP12688891 1991-04-30
JP3-126888 1991-04-30
JP4134254A JPH05150951A (en) 1991-04-30 1992-04-27 Division processing system

Publications (1)

Publication Number Publication Date
JPH05150951A true JPH05150951A (en) 1993-06-18

Family

ID=26462977

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4134254A Pending JPH05150951A (en) 1991-04-30 1992-04-27 Division processing system

Country Status (1)

Country Link
JP (1) JPH05150951A (en)

Similar Documents

Publication Publication Date Title
US4722069A (en) Nonrestoring divider
JPH04205026A (en) Divider circuit
JP2001222410A (en) Divider
JP3003467B2 (en) Arithmetic unit
JPH09325955A (en) Square root arithmetic circuit for sum of squares
JP3660075B2 (en) Dividing device
JPS58137045A (en) Parallel multiplier
JPH05150951A (en) Division processing system
US5691930A (en) Booth encoder in a binary multiplier
JP2991788B2 (en) Decoder
JPH0368415B2 (en)
JP3074958B2 (en) Serial multiplier with addition function
JP3851024B2 (en) Multiplier
JP2000010763A (en) Division circuit
JPH02114324A (en) Multiplier
KR0161485B1 (en) A multiplier of booth algorithm using arithmetic unit
JP2777265B2 (en) High radix square root arithmetic unit
JP2864598B2 (en) Digital arithmetic circuit
KR920006324B1 (en) Optimization method of 2's complement code multplier
JPH1049347A (en) Multiplicator
JPH0553768A (en) Divider
JPH11134174A (en) Arithmetic circuit
JPH06110661A (en) Divider
JPH0387924A (en) Decimal integer division circuit
JPH0635678A (en) Decimal dividing circuit