JP2605848B2 - Non-restoring divider - Google Patents

Non-restoring divider

Info

Publication number
JP2605848B2
JP2605848B2 JP63321183A JP32118388A JP2605848B2 JP 2605848 B2 JP2605848 B2 JP 2605848B2 JP 63321183 A JP63321183 A JP 63321183A JP 32118388 A JP32118388 A JP 32118388A JP 2605848 B2 JP2605848 B2 JP 2605848B2
Authority
JP
Japan
Prior art keywords
remainder
dividend
divisor
quotient
positive
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP63321183A
Other languages
Japanese (ja)
Other versions
JPH02165326A (en
Inventor
一郎 山根
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 JP63321183A priority Critical patent/JP2605848B2/en
Publication of JPH02165326A publication Critical patent/JPH02165326A/en
Application granted granted Critical
Publication of JP2605848B2 publication Critical patent/JP2605848B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Description

【発明の詳細な説明】 産業上の利用分野 本発明は、1ビットのセット、リセット可能なレジス
タを設けることにより、符号付きの除算を高速に行うこ
とのできる非回復型除算器に関するものである。
Description: BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a non-restoring divider capable of performing signed division at high speed by providing a register that can set and reset one bit. .

従来の技術 第2図は、従来の非回復型除算器のブロック図であ
る。第2図において、1は、nビットのレジスタ(SR
H)、2は、mビットのレジスタ(SRL)、3は、nビッ
トのレジスタ(DR)、4は、上記SRH1に上記DR3を加算
または減算する加減算器である。
2. Description of the Related Art FIG. 2 is a block diagram of a conventional non-restoring divider. In FIG. 2, 1 is an n-bit register (SR
H), 2 is an m-bit register (SRL), 3 is an n-bit register (DR), and 4 is an adder / subtractor for adding or subtracting DR3 to SRH1.

非回復型除算では回復のための加算が不要であるが、
かわりに前の行での加減算器出力の符号と被除数の符号
が一致するか否かによって、各行での演算を加算と減算
に切り変える必要がある。つまり、減算が失敗したため
に部分剰余の符号が被除数と反対になったときには、商
としては“0"を生成すると同時に、次の行では除数を加
算せねばならない。また、部分剰余の符号が反転しない
ときには、商を1とし、次の行では減算をしなければな
らない。
Non-restoring division does not require addition for restoration,
Instead, it is necessary to switch the operation in each row to addition and subtraction depending on whether the sign of the adder / subtractor output in the previous row matches the sign of the dividend. That is, when the sign of the partial remainder is opposite to the dividend due to the failed subtraction, the quotient must be “0” and the divisor must be added in the next row. When the sign of the partial remainder is not inverted, the quotient must be set to 1 and the next row must be subtracted.

表1に計算例を示す。 Table 1 shows a calculation example.

試行演算が失敗したときに除数を右にシフト後(すな
わち1/2にする)加算した場合には、試行演算を行わず
最初から除数の1/2を減算した場合と同一結果を得てい
る。つまり、回復型2進除算において再び加算して部分
剰余を回復後、除数を右にシフトして(除数の1/2)減
算した場合と同一結果を得る。表2はこの対応を表にし
たものである。
When the divisor is shifted to the right (ie, halved) when the trial operation fails, the same result is obtained as when the divisor is subtracted from the beginning without trial operation. . In other words, the same result as in the case where the divisor is shifted to the right (1/2 of the divisor) and subtracted after recovering the partial remainder by adding again in the recovery type binary division is obtained. Table 2 shows this correspondence.

すなわち、第2図においての符号なし2進数の除算の
動作は次のようにする。SRH1は最初“0"が代入され、SR
L2は正の被除数Sが代入され、DR3は正の除数Dが代入
される。次に、SRH1,SRL2は1ビット左へシフトされ、
その後SRH1よりDR3を減算し、その結果をSRH1へ返す。
また、そのときの部分剰余、即ち、加減算器の出力が負
であれば減算失敗として“0"を、そうでなければ“1"を
SRL2の最下位ビットに代入する。
That is, the operation of dividing an unsigned binary number in FIG. 2 is as follows. “0” is initially assigned to SRH1 and SR
L2 is assigned a positive dividend S, and DR3 is assigned a positive divisor D. Next, SRH1 and SRL2 are shifted left by one bit,
After that, DR3 is subtracted from SRH1, and the result is returned to SRH1.
Also, if the partial remainder at that time, that is, the output of the adder / subtractor is negative, “0” is determined as a subtraction failure, and “1” otherwise.
Substitute for the least significant bit of SRL2.

次に、また、SRH1,SRL2を1ビット左へシフトし、先
の加減算結果に基づき、加減算を行い、その結果をSRH1
へ返す。また部分剰余の正負により、“1"又は“0"をSR
L2の最下位ビットに代入する。あとは、これを合計m回
繰り返す。
Next, SRH1 and SRL2 are shifted one bit to the left, and addition / subtraction is performed based on the previous addition / subtraction result.
Return to Also, depending on the sign of the partial remainder, “1” or “0” is converted to SR
Assign to the least significant bit of L2. Then, this is repeated m times in total.

すると、商はSRL2に残り、余はSRH1に残る。但し、余
は負になることが考えられるので、負の場合は最後の減
算に失敗したとして余を回復、即ち、除数Dを加算して
やらねばならない。
Then, the quotient remains in SRL2 and the remainder remains in SRH1. However, since the remainder can be negative, if the result is negative, the last subtraction has failed and the remainder must be recovered, that is, the divisor D must be added.

発明が解決しようとする課題 しかしながら上記従来の構成では、正の数しか扱えず
負の数の場合は一度正に直してから演算し、演算後、再
び、商余を必要であれば負へ戻すという操作が必要であ
るという欠点を有していた。
SUMMARY OF THE INVENTION However, in the above-described conventional configuration, only a positive number can be handled, and in the case of a negative number, calculation is performed after correcting the value once, and after the calculation, the quotient is returned to negative again if necessary. Operation is required.

本発明は、上記従来の問題点を解決するもので、1ビ
ットのセット、リセット可能なレジスタを設けることに
より、被除数が負である場合にも同一アルゴリズムで除
算が行える非回復型除算器を提供することを目的として
いる。
The present invention solves the above-mentioned conventional problems, and provides a non-restoring divider that can perform division by the same algorithm even when the dividend is negative by providing a register that can set and reset 1 bit. It is intended to be.

課題を解決するための手段 この目的を達成するために、本発明の非回復型除算器
は部分剰余が“0"であることを判別するための、各行で
の演算結果が“0"のときセットされ、被除数の各行での
最下位ビットに“1"が入ってきたときリセットされる1
ビットのレジスタを持ち、このレジスタの結果を用い
て、商余の補正を行う。
Means for Solving the Problems In order to achieve this object, a non-restoring divider according to the present invention provides a method for determining whether a partial remainder is "0" when an operation result in each row is "0". Set and reset when the least significant bit in each row of the dividend enters "1"
It has a bit register and uses the result of this register to correct the quotient.

作用 この構成によって、被除数、または、除数が負である
ときも、簡単に商余の補正が可能であるため、被除数、
または、除数を正の数に置き換え直すことなしに除算を
実行することができる。
Operation With this configuration, even when the dividend or the divisor is negative, the quotient can be easily corrected.
Alternatively, the division can be performed without replacing the divisor with a positive number.

実施例 以下、本発明の一実施例について、図面を参照しなが
ら説明する。
Embodiment Hereinafter, an embodiment of the present invention will be described with reference to the drawings.

第1図は本発明の一実施例における非回復型除算器の
ブロック図であり、1〜4は上記従来例と同様であり、
5は加減算の結果が“0"であった場合、出力(ZFLG)が
“1"となり、SRH1,SRL2のシフト時、SRH1の最下位ビッ
トに“1"が入ってきた場合ZFLGが“0"になるレジスタで
ある。
FIG. 1 is a block diagram of a non-restoring divider according to an embodiment of the present invention.
5 indicates that the output (ZFLG) is “1” when the result of addition / subtraction is “0”, and that the ZFLG is “0” when “1” is input to the least significant bit of SRH1 when shifting SRH1 and SRL2. Is a register.

2の補数表現をとる符号つき数の除算は上記従来例の
符号なし数のアルゴリズムを拡張して実現する。
The division of a signed number taking a two's complement representation is realized by extending the above-described conventional algorithm for an unsigned number.

まず、被除数が正かつ除数が正の場合は、従来と同じ
方法で演算する。
First, when the dividend is positive and the divisor is positive, the calculation is performed in the same manner as in the related art.

次に、被除数が正かつ除数が負の場合については、上
記被除数が正かつ除数が正の場合の演算に対して加算と
減算を反転することにより実現する。すなわち、(正の
数)÷(負の数)の除算を(正の数)÷(正の数)の演
算に置き換えて行う。このため、得られる商は本来の商
に比べて符号が反転してしまう。従って、商に対して符
号を反転する補正すなわちビット反転し1加算する補正
が必要となる。
Next, the case where the dividend is positive and the divisor is negative is realized by inverting the addition and subtraction with respect to the operation when the dividend is positive and the divisor is positive. That is, the division of (positive number) ÷ (negative number) is replaced with the operation of (positive number) ÷ (positive number). Therefore, the sign of the obtained quotient is inverted as compared with the original quotient. Therefore, a correction for inverting the sign of the quotient, that is, a correction for inverting the bit and adding 1 is required.

また、余は被除数が正かつ除数が正の場合と同様に求
める。但し、余が0未満の場合は、除数が負であるため
除数が正のときと符号を反転した補正すなわち余から除
数を減算して余を0以上にする補正が必要となる。
The remainder is obtained in the same manner as when the dividend is positive and the divisor is positive. However, when the remainder is less than 0, the divisor is negative, so that when the divisor is positive, a correction in which the sign is inverted, that is, a correction in which the divisor is subtracted from the remainder to make the remainder 0 or more is necessary.

次に、被除数が負かつ除数が正の場合について説明す
る。
Next, a case where the dividend is negative and the divisor is positive will be described.

被除数が負の場合も、演算は基本的に被除数が正の場
合と同じ方式で行い、後で商及び余の補正を行う。
When the dividend is negative, the calculation is basically performed in the same manner as when the dividend is positive, and the quotient and remainder are corrected later.

もともと、非回復型除算の方法は、被除数が正である
ことを前提としたものであるため、被除数が負である場
合には対応できない。
Originally, the non-restoring division method is based on the assumption that the dividend is positive, and therefore cannot cope with the case where the dividend is negative.

すなわち、非回復型除算の方法の本質的な考え方は、
被除数から除数を減算しすぎた場合は次で加算を行い、
一方加算しすぎた場合は次で減算を行うことにより商及
び余を求めるものである。これに対して、本発明で採用
している演算方法によれば非回復型除算の方法は被除数
が正か負であるに関わらず、部分剰余が正である場合は
減算を行い、負である場合は加算を行う。このため、被
除数が負である場合は、被除数が正である場合に対して
減算しすぎたかまたは加算しすぎたかを逆に判断してし
まい、加算と減算とが逆に行われることになる。
That is, the essential idea of the non-restoring division method is
If the divisor is too much subtracted from the dividend, add
On the other hand, if the addition is excessive, the quotient and the remainder are obtained by performing the subtraction in the next step. On the other hand, according to the arithmetic method adopted in the present invention, the non-restoring division method performs subtraction when the partial remainder is positive, regardless of whether the dividend is positive or negative, and it is negative. In this case, add. For this reason, when the dividend is negative, it is determined in reverse whether the subtraction is too large or too large in the case where the dividend is positive, and the addition and the subtraction are performed in reverse.

従って、被除数が負かつ除数が正の場合に上記演算に
より得られる商は、被除数が正かつ除数が正の場合の商
をビット反転したものに等しくなる。
Therefore, when the dividend is negative and the divisor is positive, the quotient obtained by the above operation is equal to a bit-reversed quotient when the dividend is positive and the divisor is positive.

ところが、本来被除数が負かつ除数が正の場合の商は
被除数が正かつ除数が正の場合の商を符号反転すなわち
ビット反転し1加えたものでなければならない。従っ
て、上記演算によりビット反転のみした商が得られると
いうことは、本来の商より1少ない商が得られたことに
なる。
However, when the dividend is negative and the divisor is positive, the quotient when the dividend is positive and the divisor is positive must be obtained by sign-inverting, that is, bit-inverting, the quotient when the dividend is positive and adding one. Therefore, the fact that a quotient obtained only by bit inversion by the above operation is obtained means that one less quotient than the original quotient is obtained.

このため、被除数が負かつ除数が正の場合は、得られ
た商に1加える補正が必要となる。
Therefore, when the dividend is negative and the divisor is positive, it is necessary to add one to the obtained quotient.

ここで注意すべき事は、部分剰余が“0"かつシフトの
とき入力される全データが“0"である場合すなわち余が
なく割り切れた場合、被除数が負であるにも関わらず正
の場合の商に対して単に符号を反転した商が得られるこ
とである。
It should be noted here that when the partial remainder is “0” and all data input when the shift is “0”, that is, when the remainder is divisible without any remainder, and when the dividend is negative even though it is negative Is obtained by simply inverting the sign of the quotient of.

図4を用いて、“−6÷3"すなわち“(11010)÷
(011)を例にとり説明する。
Referring to FIG. 4, “−6−3”, that is, “(11010) 2 ÷
(011) This will be described by taking 2 as an example.

図4(a)に示すように、商(110)と余(101)
とを得るが、下位から2ビット目の商“1"が問題とな
る。すなわち、この商“1"は部分剰余“000"を判断した
ことに基づくものであるが、上述のように被除数が正か
つ除数が負である場合の除算と全く逆に除算を行うため
には、部分剰余“000"を負と判断し商“0"を得るととも
に次段では加算を行わなければならない。
As shown in FIG. 4A, the quotient (110) 2 and the remainder (101) 2
However, the quotient “1” of the second bit from the lower order becomes a problem. In other words, this quotient “1” is based on the determination of the partial remainder “000”. However, as described above, in order to perform the division completely opposite to the case where the dividend is positive and the divisor is negative, , The partial remainder "000" is determined to be negative, a quotient "0" is obtained, and addition must be performed in the next stage.

ところが、2の補数において“000"は正の数であるた
め、部分剰余が“000"であっても正の数と判断し減算し
てしまう。このため、3つ目の部分剰余が“000"となっ
てしまい、下位から1ビット目の商が“0"となる。
However, since “000” is a positive number in the two's complement, even if the partial remainder is “000”, it is determined to be a positive number and subtracted. Therefore, the third partial remainder becomes "000", and the quotient of the first bit from the lower order becomes "0".

従って、図4(b)に示す被除数が正かつ除数が正で
ある“6÷3"の商(010)と対比すると、“−6÷3"
ではビット反転し1加算された商(110)すなわち単
に符号を反転した商が得られることとなる。
Accordingly, in comparison with the quotient (010) 2 of “6 ÷ 3” where the dividend is positive and the divisor is positive shown in FIG. 4B, “−6 ÷ 3”
In this case, a quotient (110) 2 in which the bit is inverted and 1 is added, that is, a quotient whose sign is simply inverted is obtained.

このように、被除数が負かつ除数が正であって部分剰
余が“0"かつシフトのとき入力される全データが“0"で
ある場合は、被除数が除数で割り切れないときと比べて
1加えたものが商として得られる。すなわち、補正が不
要な商が得られる。従って、部分剰余が“0"かつシフト
のとき入力される全データが“0"である場合を検出した
場合には商の補正を行わない。
As described above, when the dividend is negative, the divisor is positive, the partial remainder is “0”, and all the data input when the shift is “0”, the dividend is one more than when the dividend is not divisible by the divisor. Is obtained as a quotient. That is, a quotient that does not require correction is obtained. Therefore, when it is detected that the partial remainder is “0” and all the data input when the shift is “0”, the quotient is not corrected.

なお、部分剰余が“0"かつシフトのとき入力される全
データが“0"である場合は必ず被除数が除数で割り切れ
るが、被除数が除数で割り切れる場合であっても部分剰
余が“0"かつシフトのとき入力される全データが“0"と
ならない場合がある。
Note that the dividend is always divisible by the divisor if the partial remainder is “0” and all the input data is “0” when shifting, but even if the dividend is divisible by the divisor, the partial remainder is “0” and All data input during the shift may not be "0".

また、余についても被除数が正かつ除数が正の場合
と、実質的に同じ方式で補正をする必要がある。
Also, the remainder needs to be corrected in substantially the same manner as when the dividend is positive and the divisor is positive.

具体的には、被除数が負であることから余は負でなけ
ればならないので、余が0以上のときは補正を行う必要
がある。従って、この場合は被除数が正かつ除数が正の
場合の余の補正について符号を反転した補正、すなわち
余から除数を減算する補正を行う。なお、余が0以上で
あるときは補正を行う必要はない。
Specifically, the remainder must be negative because the dividend is negative, so that when the remainder is 0 or more, it is necessary to perform correction. Therefore, in this case, the sign of the remainder is corrected when the dividend is positive and the divisor is positive, that is, the subtraction is performed on the remainder. When the remainder is 0 or more, there is no need to perform correction.

但し、部分剰余が“0"かつシフトのとき入力される全
データが“0"の場合は、被除数が除数で割り切れること
を意味するので、余を“0"にする補正を行う。
However, if the partial remainder is “0” and all the input data is “0” when the shift is performed, it means that the dividend is divisible by the divisor, so that the remainder is corrected to “0”.

次に、被除数が負かつ除数が負の場合について説明す
る。
Next, a case where the dividend is negative and the divisor is negative will be described.

この場合、被除数が正かつ除数が負の場合と、基本的
に同じ方式で演算を行う。
In this case, the operation is basically performed in the same manner as when the dividend is positive and the divisor is negative.

このため、被除数が負かつ除数が正の場合と同様に、
被除数が正かつ除数が負の場合の商をビット反転したも
のが商として得られる。ここで、除数が負の場合の商は
上述した除数が正の場合の商の符号を反転したものとな
るので、本来の商に1加えた商が得られたことになる。
Therefore, as in the case where the dividend is negative and the divisor is positive,
A quotient is obtained by bit-inverting the quotient when the dividend is positive and the divisor is negative. Here, the quotient when the divisor is negative is obtained by inverting the sign of the quotient when the divisor is positive, so that a quotient obtained by adding one to the original quotient is obtained.

従って、被除数が負かつ除数が負の場合、得られた商
をビット反転する補正が必要となる。
Therefore, when the dividend is negative and the divisor is negative, it is necessary to perform a bit inversion of the obtained quotient.

但し、部分剰余が“0"かつシフトのとき入力される全
データが“0"である場合、被除数が負かつ除数が正のと
きと同様に被除数が除数で割り切れないときの商に1加
えたものが商として得られる。従って、被除数が負かつ
除数が正の場合と同じ補正を行う必要がある。
However, when the partial remainder is “0” and all data input is “0” when shifted, one is added to the quotient when the dividend is not divisible by the divisor, as in the case where the dividend is negative and the divisor is positive. Things are obtained as quotients. Therefore, it is necessary to perform the same correction as when the dividend is negative and the divisor is positive.

また、余についても被除数が正かつ除数が負の場合
と、実質的に同じ方式で補正をする必要がある。
Also, the remainder needs to be corrected in substantially the same manner as when the dividend is positive and the divisor is negative.

具体的には、被除数が負かつ除数が正の場合と同様に
被除数が負であることから余は負でなければならないの
で、余が0以上のときは補正を行う必要がある。従っ
て、この場合は被除数が正かつ除数が負の場合の余の補
正について符号を反転した補正、すなわち余に除数を加
算する補正を行う。なお、余が0以上であるときは補正
を行う必要はない。
More specifically, since the dividend is negative as in the case where the dividend is negative and the divisor is positive, the remainder must be negative. Therefore, when the remainder is 0 or more, it is necessary to perform correction. Therefore, in this case, the correction in which the sign is inverted with respect to the remaining correction when the dividend is positive and the divisor is negative, that is, correction for adding the divisor extra is performed. When the remainder is 0 or more, there is no need to perform correction.

但し、部分剰余が“0"かつシフトのとき入力される全
データが“0"の場合は、被除数が除数で割り切れること
を意味するので、余を“0"にする補正を行う。
However, if the partial remainder is “0” and all the input data is “0” when the shift is performed, it means that the dividend is divisible by the divisor, so that the remainder is corrected to “0”.

第3図に8ビットの被除数(11011010)=(−38)
10を4ビットの除数(1101)=(−3)10で割った例
の算出フローチャートを示す。被除数は、SRL2(m=
8)に収められ、SRH1(n=5)には、SRL2が符号拡張
され、(11111)が入る。除数は符号拡張され(1110
1)が入る。
FIG. 3 shows an 8-bit dividend (11011010) 2 = (− 38).
10 shows a calculation flowchart of an example in which 10 is divided by a 4-bit divisor (1101) 2 = (− 3) 10 . The dividend is SRL2 (m =
8), SRL2 is sign-extended to SRH1 (n = 5), and (11111) 2 is entered. The divisor is sign-extended (1110
1) Enter 2 .

まず、左シフトが行われ、SRH1に(11111)が入
る。このとき、最下位ビットは“1"であるから、ZFLGは
リセットされる。次に、初期qが“0"として減算が行わ
れる。ここでは減算の結果(00010)であるため、ZFL
Gは保持されたままである。次に、再び左シフトが行わ
れ、SRH1に(00101)が入る。このとき、上記同様最
下位ビットは“1"であるため、ZFLGはリセットされる。
但し、値は実際には変化していないのと同じである。次
にq0が“1"であったので加算を行う。ここでは加算の結
果は(00010)のためZFLGは保持される。以下は同様
の過程を繰り返し、最終的に商(11110011)、余(00
01)を得る。ここで加減算の対応と商余の補正を第3
表に示す。
First, a left shift is performed, and (11111) 2 enters SRH1. At this time, since the least significant bit is "1", ZFLG is reset. Next, subtraction is performed assuming that the initial q is “0”. Here, the result of subtraction (00010) 2
G remains retained. Next, the left shift is performed again, and (00101) 2 is entered in SRH1. At this time, the least significant bit is “1” as described above, and thus the ZFLG is reset.
However, the value is the same as not actually changing. Then perform the addition because there was a q 0 is "1". Here, since the result of the addition is (00010) 2 , the ZFLG is held. Hereinafter, the same process is repeated until the quotient (11110011) 2 and the remainder (00
01) Get 2 . Here, the correspondence of addition and subtraction and the correction of the quotient are the third.
It is shown in the table.

商は、上記第3表より、被除数は負、除数は負、ZFLG
は“0"であるから、ビット反転すればよい。また、余
は、余+除数を求めればよい。すると、商(00001100)
=12、余(0001)+(1101)=(1110)=−2
を得る。これは、(−38)÷(−3)=12…(−2)の
答えと一致している。
From Table 3 above, the quotient is negative for the dividend, negative for the divisor, and ZFLG
Is “0”, the bit may be inverted. For the remainder, the remainder + divisor may be obtained. Then, quotient (00001100)
2 = 12, remainder (0001) 2 + (1101) 2 = (1110) 2 = -2
Get. This is consistent with the answer of (−38) ÷ (−3) = 12... (−2).

さて、第3表に示した論理であるが、各制御信号は簡
単である。
Now, based on the logic shown in Table 3, each control signal is simple.

初期q信号は、被除数の符号ビットの反転をとればよ
い。また、加算、減算は、除数の符号ビットとq信号で
制御する。ZFLGは上記の通りであり、余の正負は余の符
号ビットで判別できる。
The initial q signal may be obtained by inverting the sign bit of the dividend. The addition and subtraction are controlled by the sign bit of the divisor and the q signal. ZFLG is as described above, and the remaining sign can be determined by the remaining sign bit.

なお、被除数が“0"の場合、上記手順で商余を求める
とZFLGにセット、リセットが一度もかからず、値が初期
値のままであることが考えられる。この場合、初期値は
セットされていても、リセットされていても商余は正し
いのであるが、ZFLGの初期値を“1"にすることで余の補
正において、被除数が負であり、ZFLG=“1"のとき、余
に“0"を代入するという補正を被除数が正のときにも行
っても支障がないため、回路を軽減できる。また、シミ
ュレーション等で不確定の信号を残さないため、回路検
討時の負担を軽減できる。
When the dividend is "0", when the quotient is obtained by the above-described procedure, it is conceivable that the ZFLG is not set and reset once, and the value remains at the initial value. In this case, the quotient is correct whether the initial value is set or reset, but by setting the initial value of ZFLG to "1", the dividend is negative in the remainder correction and ZFLG = When the dividend is "1", there is no problem even if the dividend is corrected even when the dividend is positive, so that the circuit can be reduced. In addition, since an uncertain signal is not left in a simulation or the like, a burden when studying a circuit can be reduced.

発明の効果 本発明によれば、セット、リセット可能な1ビットの
レジスタを設けることにより、被除数、又は、除数が負
である場合に、一度正の数に置きなおして除算するとい
う過程を省略でき、高速に、また、符号によらない一定
のアルゴリズムで商余を求めることのできる優れた非回
復型除算器を実現できる。
According to the present invention, by providing a 1-bit register that can be set and reset, when the dividend or the divisor is negative, it is possible to omit the process of once replacing it with a positive number and dividing. It is possible to realize an excellent non-restoring type divider which can obtain the quotient with high speed and with a constant algorithm independent of the sign.

【図面の簡単な説明】 第1図は本発明の一実施例非回復型除算器のブロック
図、第2図は従来例非回復型除算器のブロック図、第3
図は8ビット÷4ビット算出のフローチャート、第4図
は被除数が負かつ除数が正の場合および被除数が正かつ
除数が正の場合の除算のフローチャートである。 1……nビットのレジスタ(SRH)、2……mビットの
レジスタ(SRL)、3……nビットのレジスタ(DR)、
4……加減算器、5……1ビットのセットリセット,可
能なレジスタ(ZFLG)。
BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a block diagram of a non-restoring divider according to one embodiment of the present invention, FIG. 2 is a block diagram of a conventional non-restoring divider, FIG.
FIG. 4 is a flowchart for calculating 8 bits ÷ 4 bits, and FIG. 4 is a flowchart of division when the dividend is negative and the divisor is positive, and when the dividend is positive and the divisor is positive. 1... N-bit register (SRH), 2... M-bit register (SRL), 3... N-bit register (DR),
4... Add / subtractor, 5... 1-bit set reset, possible register (ZFLG).

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】部分剰余が“0"のときセットされ、前記部
分剰余のシフトのとき入力されるデータが“1"のときリ
セットされるレジスタを有し、 被除数が正かつ除数が正の場合、商に補正を行わないと
ともに、余が0以上のときは余に対して補正を行わず、
また余が0未満のときは余に対して除数を加算する補正
を行い、 被除数が正かつ除数が負の場合、商に対してビット反転
し1加算する補正を行うとともに、余が0以上のときは
余に対して補正を行わず、また余が0未満のときは余に
対して除数を減算する補正を行い、 前記レジスタのデータが“0"、被除数が負かつ除数が正
の場合、商に対して1を加える補正を行うとともに、余
が0以上のときは余に対して除数を減算する補正を行
い、また余が0未満のときは余を補正せず、一方前記レ
ジスタのデータが“1"、被除数が負かつ除数が正の場
合、商に対して補正しないとともに、余を“0"とする補
正を行い、 前記レジスタのデータが“0"、被除数が負かつ除数が負
の場合、商に対してビットを反転する補正を行うととも
に、余が0以上のときは余に対して除数を加算する補正
を行い、また余が0未満のときは余を補正せず、一方前
記レジスタのデータが“1"、被除数が負かつ除数が負の
とき、商に対してビットを反転し1加算する補正を行う
とともに、余を“0"とする補正を行うことを特徴とする
非回復型除算器。
1. A register which is set when a partial remainder is "0", and is reset when input data is "1" when the partial remainder is shifted, wherein a dividend is positive and a divisor is positive , The quotient is not corrected, and the remainder is not corrected when the remainder is 0 or more,
When the remainder is less than 0, the divisor is added to the remainder, and when the dividend is positive and the divisor is negative, the quotient is bit-inverted and added to the quotient. When the remainder is less than 0, and when the remainder is less than 0, the divisor is subtracted from the remainder. When the data of the register is “0”, the dividend is negative and the divisor is positive, In addition to the correction of adding 1 to the quotient, when the remainder is 0 or more, the divisor is subtracted from the remainder. When the remainder is less than 0, the remainder is not corrected. If the dividend is “1”, the dividend is negative and the divisor is positive, the quotient is not corrected, and the remainder is corrected to “0”. The register data is “0”, the dividend is negative and the divisor is negative. , When the quotient is corrected by inverting the bit and the remainder is 0 or more The remainder is corrected by adding a divisor. When the remainder is less than 0, the remainder is not corrected. On the other hand, when the data of the register is “1”, the dividend is negative and the divisor is negative, the quotient is A non-restoring divider which performs a correction for inverting a bit and adding 1 and a correction for setting the remainder to "0".
JP63321183A 1988-12-20 1988-12-20 Non-restoring divider Expired - Lifetime JP2605848B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63321183A JP2605848B2 (en) 1988-12-20 1988-12-20 Non-restoring divider

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63321183A JP2605848B2 (en) 1988-12-20 1988-12-20 Non-restoring divider

Publications (2)

Publication Number Publication Date
JPH02165326A JPH02165326A (en) 1990-06-26
JP2605848B2 true JP2605848B2 (en) 1997-04-30

Family

ID=18129715

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63321183A Expired - Lifetime JP2605848B2 (en) 1988-12-20 1988-12-20 Non-restoring divider

Country Status (1)

Country Link
JP (1) JP2605848B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2720172B1 (en) * 1994-05-20 1996-06-28 Sgs Thomson Microelectronics Device for digital implementation of a division operation.
JP5870699B2 (en) * 2012-01-10 2016-03-01 ミツミ電機株式会社 Sensor output correction circuit, sensor output correction device, and sensor output correction method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0619704B2 (en) * 1986-08-20 1994-03-16 日本電気株式会社 Divider

Also Published As

Publication number Publication date
JPH02165326A (en) 1990-06-26

Similar Documents

Publication Publication Date Title
JP2835153B2 (en) High radix divider
US4992969A (en) Integer division circuit provided with a overflow detector circuit
JPH01144122A (en) Dividing circuit
US9009209B2 (en) Processor, control method of processor, and computer readable storage medium storing processing program for division operation
JP2605848B2 (en) Non-restoring divider
JP3544821B2 (en) Division circuit
JPH0317132B2 (en)
JPH0234054B2 (en)
JPH0374419B2 (en)
JPH0511980A (en) Overflow detecting method and circuit
JP2645422B2 (en) Floating point processor
JPH07118654B2 (en) Arithmetic unit
JP2991788B2 (en) Decoder
GB2116757A (en) Division apparatus
JP3071607B2 (en) Multiplication circuit
CN115809041B (en) Configurable complement arithmetic device and computing equipment
JP2664750B2 (en) Arithmetic device and arithmetic processing method
JPS63259767A (en) Averaging circuit
JP4042215B2 (en) Arithmetic processing apparatus and method
JP2995721B2 (en) Division device and division method
JPH0426495B2 (en)
JP3213982B2 (en) Division circuit
JP3539077B2 (en) Division method by parallel operation method
JP3284717B2 (en) Barrel shifter
JPH0799496B2 (en) Floating point mantissa digit matching circuit