JP2995721B2 - Division device and division method - Google Patents

Division device and division method

Info

Publication number
JP2995721B2
JP2995721B2 JP5180336A JP18033693A JP2995721B2 JP 2995721 B2 JP2995721 B2 JP 2995721B2 JP 5180336 A JP5180336 A JP 5180336A JP 18033693 A JP18033693 A JP 18033693A JP 2995721 B2 JP2995721 B2 JP 2995721B2
Authority
JP
Japan
Prior art keywords
value
divisor
shift
processing
bit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP5180336A
Other languages
Japanese (ja)
Other versions
JPH0736669A (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 Corp
Panasonic Holdings Corp
Original Assignee
Panasonic Corp
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 Panasonic Corp, Matsushita Electric Industrial Co Ltd filed Critical Panasonic Corp
Priority to JP5180336A priority Critical patent/JP2995721B2/en
Publication of JPH0736669A publication Critical patent/JPH0736669A/en
Application granted granted Critical
Publication of JP2995721B2 publication Critical patent/JP2995721B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

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

【0001】[0001]

【産業上の利用分野】本発明はディジタル計算機の中央
処理装置等に用いられ、符号なし数または符号付き数の
2進数の除算を行う除算装置に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a divider for dividing a binary number of an unsigned number or a signed number and used in a central processing unit of a digital computer.

【0002】[0002]

【従来の技術】従来の除算装置における除算アルゴリズ
ムとしては、例えば、Kai Hwang 著、堀越彌監訳「コン
ピュータの高速演算方式」(昭和55年9月1日、近代
科学社)PP.222〜224 、7.5 節(2進非回復型除算)に
示されているものがある。この除算アルゴリズムでは、
以下のようにして商および剰余を求めるようになってい
る。
2. Description of the Related Art As a division algorithm in a conventional division device, for example, Kai Hwang, edited by Yasushi Horikoshi, "High-speed operation method of computer" (September 1, 1980, Modern Science Co., Ltd.) PP. Some are shown in section 7.5 (binary non-restoring division). In this division algorithm,
The quotient and remainder are obtained as follows.

【0003】まず、除算の最初においては、被除数から
除数を減算して部分剰余を求め、この部分剰余が正なら
ば部分商を1とし、負ならば0とするとともに、上記部
分剰余を2倍(上位ビット方向に1ビットシフト)す
る。その後は、前回の演算によって得られた部分剰余が
正ならば部分剰余の2倍数から除数を減算し、負ならば
部分剰余の2倍数に除数を加算して新たな部分剰余を
得、この新たな部分剰余が正ならば部分商を1とし、負
ならば0とするとともに、上記新たな部分剰余を2倍す
る。この処理を被除数のビット数と除数のビット数との
差の分だけ繰り返す。
First, at the beginning of division, the divisor is subtracted from the dividend to obtain a partial remainder. If the partial remainder is positive, the partial quotient is set to 1, if the partial remainder is negative, 0 is set, and the partial remainder is doubled. (Shift by one bit in the upper bit direction). Thereafter, if the partial remainder obtained by the previous operation is positive, the divisor is subtracted from the multiple of the partial remainder, and if negative, the divisor is added to the multiple of the partial remainder to obtain a new partial remainder. If the partial remainder is positive, the partial quotient is set to 1; if negative, it is set to 0, and the new partial remainder is doubled. This process is repeated by the difference between the number of bits of the dividend and the number of bits of the divisor.

【0004】すなわち、部分剰余の2倍数と除数との大
小関係に係らず、部分剰余が正であれば除数の減算を行
う一方、負であれば除数の加算を行うとともに、加減算
結果が正の場合には部分商を1にし、負の場合には部分
商を0にすることにより、アルゴリズムを簡素化して、
除算速度の高速化や回路規模の低減を図り得るようにな
っている。
That is, irrespective of the magnitude relationship between the double of the partial remainder and the divisor, if the partial remainder is positive, the divisor is subtracted. If the partial remainder is negative, the divisor is added and the addition / subtraction result is positive. The algorithm is simplified by setting the partial quotient to 1 in the case and 0 in the negative case.
It is possible to increase the division speed and reduce the circuit scale.

【0005】ところで、上記部分剰余の正負の判定は、
前回の演算によって得られた部分剰余の2倍数と除数と
の加減算における、符号ビットを除く最上位ビットから
のキャリの有無によって行われる。すなわち、上記加減
算は、実質的には常に正数と負数との加算になり、最上
位ビットからのキャリがあれば符号ビットは必ず0にな
るので加減算結果は正数と判定できる一方、最上位ビッ
トからのキャリがなければ符号ビットは必ず1になるの
で加減算結果は負数と判定できる。
By the way, whether the partial remainder is positive or negative is determined as follows.
In addition and subtraction between the divisor and the double of the partial remainder obtained by the previous operation, the addition is performed based on the presence or absence of a carry from the most significant bit excluding the sign bit. That is, the above addition / subtraction is essentially always addition of a positive number and a negative number, and if there is a carry from the most significant bit, the sign bit is always 0. If there is no carry from the bit, the sign bit is always 1 and the result of addition / subtraction can be determined as a negative number.

【0006】また、上記除算アルゴリズムは、被除数お
よび除数が共に非負の場合にのみ適用可能であるため、
符号付き数どうしの除算を行い得る従来の除算装置は、
あらかじめ被除数および除数の絶対値を求めて非負の数
を得る絶対値生成手段と、非負の被除数と除数との商
(商の絶対値)を求める絶対値除算手段と、被除数と除
数とが異符号の場合には商の符号を負と決定し、被除数
と除数とが同符号の場合には商の符号を正と決定する符
号決定手段と、商の絶対値を符号付き数に変換する符号
付き数変換手段とを有していた。
Further, the above-mentioned division algorithm can be applied only when both the dividend and the divisor are non-negative.
A conventional division device that can perform division between signed numbers is
Absolute value generating means for previously obtaining the absolute values of the dividend and divisor to obtain a non-negative number, absolute value dividing means for obtaining the quotient (absolute value of the quotient) between the non-negative dividend and the divisor, and the dividend and the divisor having different signs. In the case of, the sign of the quotient is determined to be negative, and when the dividend and the divisor have the same sign, the sign determining means for determining the sign of the quotient to be positive, and a sign for converting the absolute value of the quotient to a signed number Number conversion means.

【0007】[0007]

【発明が解決しようとする課題】しかしながら、上記従
来の除算アルゴリズムでは、部分剰余の正負の判定を、
前回の演算によって得られた部分剰余の2倍数と除数と
の加減算における、符号ビットを除く最上位ビットから
のキャリの有無によって行うために、上記加減算は除数
のビット幅より少なくとも1ビット多いビット幅で行う
必要がある。なぜならば、前回の演算によって得られる
部分剰余は除数と同じビット幅を有し、この2倍数(上
位ビット方向に1ビットシフトした数)における最上位
ビットから最下位ビットまでのビット幅は、除数のビッ
ト幅よりも1ビット多いビット幅になるからである。な
お、厳密には、上記最上位ビットを無視して除数のビッ
ト幅で加減算を行った場合でも、最上位ビットの値と符
号ビットの値とが同値(共に0または1)の場合には、
加減算結果の正負は正しく判定されるが、同値でない
(0と1、または1と0)場合に、いわゆるシフトオー
バフローによる符号の逆転が生じるので、正しい正負の
判定が行えない。
However, in the above-mentioned conventional division algorithm, whether the partial remainder is positive or negative is determined as follows.
In addition / subtraction of the divisor with the double of the partial remainder obtained by the previous operation, the addition / subtraction is performed at least one bit larger than the bit width of the divisor in order to perform the addition / subtraction depending on the presence / absence of a carry from the most significant bit excluding the sign bit. Must be done in This is because the partial remainder obtained by the previous operation has the same bit width as the divisor, and the bit width from the most significant bit to the least significant bit in the double (the number shifted by one bit in the upper bit direction) is the divisor This is because the bit width becomes one bit larger than the bit width of the above. Strictly speaking, even when the most significant bit is ignored and addition / subtraction is performed with a divisor bit width, if the value of the most significant bit and the value of the sign bit are the same (both 0 or 1),
The sign of the addition / subtraction result is correctly determined, but if they are not the same (0 and 1, or 1 and 0), the sign is reversed due to a so-called shift overflow, so that the correct sign cannot be determined.

【0008】したがって、従来の除算装置は、加減算回
路のビット幅を短くして回路規模を低減することができ
ないという問題点を有していた。また、符号付き数どう
しの除算を行い得るようにするためには、絶対値除算手
段に加えて、絶対値生成手段と、符号決定手段と、符号
付き数変換手段と、およびこれらの手段による処理ステ
ップを必要とするため、やはり回路規模の低減が困難で
あるうえ、除算速度の高速化も困難であるという問題点
を有していた。
Therefore, the conventional divider has a problem that the circuit width cannot be reduced by shortening the bit width of the addition / subtraction circuit. Further, in order to be able to perform division between signed numbers, in addition to the absolute value dividing means, an absolute value generating means, a sign determining means, a signed number converting means, and a process by these means Because of the necessity of steps, it is also difficult to reduce the circuit scale and to increase the division speed.

【0009】本発明は上記の点に鑑み、回路規模の低
減、および除算速度の高速化を図り得る除算装置および
除算方法の提供を目的としている。
SUMMARY OF THE INVENTION In view of the foregoing, it is an object of the present invention to provide a division device and a division method capable of reducing the circuit scale and increasing the division speed.

【0010】[0010]

【課題を解決するための手段】上記目的を達成するた
め、本発明は、符号なし2進数の除算を行う除算装置で
あって、除数と同じビット幅を有し、被除数、または部
分剰余の2倍数と、除数とを部分商の値に応じて加減算
する演算手段と、加減算結果を1ビット上位ビット側に
シフトするシフト手段と、初回の部分商を前記演算手段
からの桁上げの値とし、次回以降の部分商を、前記演算
手段からの桁上げの値、シフト手段からのシフトあふれ
の値、および直前の部分商の値のうちの、少なくとも2
つの値が1であれば1とし、そうでなければ0とする部
分商算出手段とを備えたことを特徴としている。
In order to achieve the above object, the present invention relates to a division device for performing division of an unsigned binary number, which has the same bit width as the divisor and has a dividend or a partial remainder of 2. Calculating means for adding and subtracting a multiple and a divisor in accordance with the value of the partial quotient ; shifting means for shifting the result of addition and subtraction to the upper bit side by one bit;
From the next time, the partial quotient from the next
Carry value from means, shift overflow from shift means
At least two of the value of
If one of the values is 1, set it to 1, otherwise set it to 0
And a quotient calculation means .

【0011】また、符号なし2進数の除算を行う除算方
法であって、被除数、または部分剰余の2倍数と、除数
とを部分商の値に応じて除数と同じビット幅で加減算す
る演算ステップと、加減算結果を1ビット上位ビット側
にシフトするシフトステップと、初回の部分商を前記演
算ステップの演算による桁上げの値とし、次回以降の部
分商を、前記演算ステップの演算による桁上げの値、シ
フトステップによるシフトあふれの値、および直前の部
分商の値のうちの、少なくとも2つの値が1であれば1
とし、そうでなければ0とする部分商算出ステップと
有することを特徴としている。
A division method for performing division of an unsigned binary number, the method comprising: adding and subtracting a double of a dividend or a partial remainder and a divisor with the same bit width as the divisor according to a value of a partial quotient; the Starring a shift step, a partial quotient of the first shifting the subtraction result to the 1-bit high-order bit side
The value of the carry from the calculation step
The quotient is calculated as the carry value,
Value of shift overflow due to shift step, and
1 if at least two of the quotient values are 1
And a partial quotient calculation step of setting the value to 0 otherwise .

【0012】また、符号付き2進数の除算を行う除算装
置であって、部分剰余に対して除数を直前の部分商の値
に応じて加減算することにより新たな部分剰余を求める
演算手段と、前記除数の符号が負でかつ、現在および1
つ前の処理における部分剰余がともにゼロでない場合に
は、前記演算手段からの桁上げの値の反転を部分商と
し、それ以外の場合には、前記演算手段からの桁上げの
値を部分商とする部分商算出手段とを備えたことを特徴
としている。
A division device for performing division of a signed binary number, wherein a divisor for a partial remainder is calculated by using a value of a partial quotient immediately before the divisor.
Find a new partial remainder by adding and subtracting according to
Arithmetic means, and the sign of the divisor is negative,
If both partial remainders in the previous process are not zero
Is the partial quotient of the inversion of the carry value from the arithmetic means.
Otherwise, the carry from the arithmetic means is
And a partial quotient calculation unit that uses the value as a partial quotient .

【0013】また、符号付き2進数の除算を行う除算方
法であって、部分剰余に対して除数を直前の部分商の値
に応じて加減算することにより新たな部分剰余を求める
演算ステップと、前記除数の符号が負でかつ、現在およ
び1つ前の処理における部分剰余がともにゼロでない場
合には、前記演算ステップによる桁上げの値の反転を部
分商とし、それ以外の場合には、前記演算ステップによ
る桁上げの値を部分商とする部分商算出ステップとを有
することを特徴とする除算方法。
A division method for performing a division of a signed binary number, wherein a divisor for a partial remainder is calculated by adding a value of the immediately preceding partial quotient to the partial remainder
Find a new partial remainder by adding and subtracting according to
An operation step, wherein the sign of the divisor is negative and
If the partial remainders in the previous and next processing are not both zero
In this case, the inversion of the value of the carry in the calculation step is included.
Otherwise, the calculation step
And calculating a partial quotient using a carry value as a partial quotient .

【0014】[0014]

【作用】上記の構成により、符号なし2進数の除算を行
う除算装置または除算方法においては、初回の部分商は
前記演算手段(ステップ)の桁上げの値とし、次回以降
の部分商は、前記演算手段(ステップ)の桁上げの値、
シフト手段(ステップ)のシフトあふれの値、および直
前の部分商の値のうちの、少なくとも2つの値が1であ
れば1とし、そうでなければ0する。
According to the above arrangement, in the division device or the division method for dividing an unsigned binary number, the first partial quotient is
The carry value of the calculating means (step) is used, and
The partial quotient is the value of the carry of the calculating means (step),
The value of the shift overflow of the shift means (step)
At least two of the previous partial quotient values are 1
If it is 1, set it to 0, otherwise set it to 0.

【0015】また、符号付き2進数の除算を行う除算装
置または除算方法においては、前記除数の符号が負でか
つ、現在および1つ前の処理における部分剰余がともに
ゼロでない場合には、前記演算手段(ステップ)の桁上
げの値の反転を部分商とし、それ以外の場合には、前記
演算手段(ステップ)による桁上げの値を部分商とす
る。
In a division apparatus or a division method for dividing a signed binary number, the sign of the divisor may be negative.
And the partial remainders in the current and previous processes are both
If not zero, the carry of the arithmetic means (step)
Is the partial quotient, otherwise,
The value of the carry by the calculation means (step) is used as the partial quotient.
You.

【0016】[0016]

【実施例】【Example】

(第1実施例)図1は本発明の第1実施例における符号
なし数どうしの除算を行う除算装置のブロック図であ
る。図1において、1は除数を保持する除数レジスタで
ある。
(First Embodiment) FIG. 1 is a block diagram of a division device for dividing unsigned numbers according to a first embodiment of the present invention. In FIG. 1, reference numeral 1 denotes a divisor register for holding a divisor.

【0017】2はA入力(被除数または部分剰余の上位
ビット)とB入力(除数)とが入力され、上記A入力と
B入力とを加算してその結果を出力するか、またはA入
力からB入力を減算してその結果を出力するか、または
A入力をそのまま転送して出力する演算回路である。上
記加減算は、除数レジスタ1と同じビット幅で行われ、
その最上位ビットからの桁上げ(ACRY)が出力され
るようになっている。
2 is an input to which the A input (the higher-order bit of the dividend or the partial remainder) and the B input (the divisor) are input, and adds the A input and the B input and outputs the result, or outputs the B signal from the A input. An arithmetic circuit that subtracts the input and outputs the result, or transfers the A input as it is and outputs it. The addition and subtraction are performed with the same bit width as that of the divisor register 1.
The carry (ACRY) from the most significant bit is output.

【0018】3は演算回路2の出力(部分剰余)を上位
ビット方向に1ビットシフトするか、またはそのまま転
送して出力する第一シフタである。この第一シフタ3の
シフト時には、後述する第二シフタ5のシフトあふれの
値が最下位ビットに挿入される。4は被除数の上位ビッ
ト、または第一シフタ3の出力(部分剰余の2倍数の上
位ビット)を一旦保持し、その値をレジスタR2を介し
て演算回路2のA入力として出力する第一レジスタであ
る。
Reference numeral 3 denotes a first shifter which shifts the output (partial remainder) of the arithmetic circuit 2 by one bit in the upper bit direction, or transfers and outputs the output as it is. When the first shifter 3 shifts, a shift overflow value of the second shifter 5 described later is inserted into the least significant bit. Reference numeral 4 denotes a first register which temporarily holds the upper bits of the dividend or the output of the first shifter 3 (the upper bits of a multiple of 2 times the partial remainder), and outputs the value as an A input of the arithmetic circuit 2 via the register R2. is there.

【0019】5は入力された値を上位ビット方向に1ビ
ットシフトするか、またはそのまま転送して出力する第
二シフタである。この第二シフタ5のシフト時には、後
述する制御回路8から与えられる部分商Q(n) が順次最
下位ビットに挿入される。6は被除数の下位ビット、ま
たは第二シフタ5の出力(部分剰余の2倍数の下位ビッ
ト)を一旦保持し、その値をレジスタR2を介して再び
第二シフタ5に入力する第二レジスタである。この第二
レジスタ6は、また、商を保持するレジスタも兼ねてい
る。
Reference numeral 5 denotes a second shifter which shifts the input value by one bit in the upper bit direction, or transfers and outputs the value as it is. When the second shifter 5 shifts, a partial quotient Q (n) given from the control circuit 8 described later is sequentially inserted into the least significant bit. Reference numeral 6 denotes a second register which temporarily holds the lower bits of the dividend or the output of the second shifter 5 (lower bits of a multiple of two times the partial remainder) and inputs the value to the second shifter 5 again via the register R2. . The second register 6 also serves as a register for holding a quotient.

【0020】7は第一シフタ3からのシフトあふれ(S
CRY)を保持し、レジスタR2を介して出力するシフ
トあふれ保持レジスタである。8は内部に処理ステップ
数(n)を計数する図示しないカウンタを持ち、上記処
理ステップ数(n)、演算回路2の最上位ビットからの
桁上げ(ACRY)、シフトあふれ保持レジスタ7の値
(SCRY)、および第二レジスタ6の最下位ビットの
値(1つ前の部分商Q(n-1) )に基づいて、演算回路2
の演算の種類(OPR)、第一シフタ3のシフト数(S
FT1)、および第二シフタ5のシフト数(SFT2)
を指示するとともに、第二シフタ5の1ビットシフト時
の最下位ビットへの挿入値(部分商Q(n) )を生成する
制御回路である。
Reference numeral 7 denotes a shift overflow (S) from the first shifter 3.
CRY), and is a shift-overflow holding register that outputs via a register R2. Numeral 8 has a counter (not shown) for counting the number of processing steps (n). The number of processing steps (n), carry from the most significant bit of the arithmetic circuit 2 (ACRY), and the value of the shift overflow holding register 7 ( SCRY) and the value of the least significant bit of the second register 6 (the previous partial quotient Q (n-1)).
(OPR), the number of shifts of the first shifter 3 (S
FT1), and the number of shifts of the second shifter 5 (SFT2)
, And generates an insertion value (partial quotient Q (n)) to the least significant bit when the second shifter 5 shifts by 1 bit.

【0021】より詳しくは、制御回路8は、処理ステッ
プごとに、図2に示すような制御を行う。すなわち、制
御回路8は、同図におけるOPRの欄が”A”ならばA
入力の転送を、”A+B”ならばA入力とB入力の加算
を、”A−B”ならばA入力からB入力の減算を演算回
路2に指示する。また、SFT1またはSFT2の欄
が”L1”ならば上位ビット方向に1ビットのシフト
を、”0”ならば0ビットシフトすなわち転送を、第一
シフタ3または第二シフタ5に指示する。さらに、Q
(n) の欄が”ACRY”ならば演算回路2の最上位ビッ
トからの桁上げを、”Z”ならば下記(1)式で決まる
値を第二シフタ5の最下位ビットに部分商Q(n) として
挿入する。ここで、(1)式において、「・」はビット
論理積を、「+」はビット論理和を表す。
More specifically, the control circuit 8 performs control as shown in FIG. 2 for each processing step. That is, if the OPR column in FIG.
Input transfer is instructed to the arithmetic circuit 2 to add the A and B inputs if "A + B", and to subtract the B input from the A input if "AB". If the column of SFT1 or SFT2 is "L1", it instructs the first shifter 3 or the second shifter 5 to shift 1 bit in the upper bit direction, and if "0", shifts 0 bits, that is, transfers. Furthermore, Q
If the field (n) is "ACRY", the carry from the most significant bit of the arithmetic circuit 2 is carried out. If the value is "Z", the value determined by the following equation (1) is added to the least significant bit of the second shifter 5 by the partial quotient Q. Insert as (n). Here, in the expression (1), “•” represents a bit AND, and “+” represents a bit OR.

【0022】 Z=ACRY・(Q(n-1) +SCRY)+Q(n-1) ・SCRY ……(1) 上記Zは、Q(n-1) と、SCRYと、ACRYとのうち
の少なくとも何れか2つの値が1である場合に1とな
り、部分剰余が正であることを示す。すなわち、図2に
示すように、n=1〜2の場合において、Q(n-1) =0
(前の処理ステップの部分剰余が負)のときには除数
(B)の加算が行われる一方、Q(n-1) =1(前の処理
ステップの部分剰余が正)のときには除数の減算が行わ
れるので、上記減算を除数の2の補数(−B)の加算と
考えると、加数(Bまたは−B)における除数のビット
幅より1ビット上位のビットの値は、Q(n-1) =0のと
きに0、Q(n-1) =1のときに1となる。また、SCR
Yは、被加数(A)における除数のビット幅より1ビッ
ト上位のビットの値であり、ACRYは、除数のビット
幅の加算における除数のビット幅より1ビット上位のビ
ットへの桁上げである。
Z = ACRY · (Q (n−1) + SCRY) + Q (n−1) · SCRY (1) Z is at least one of Q (n−1), SCRY and ACRY When any two values are 1, the value becomes 1, indicating that the partial remainder is positive. That is, as shown in FIG. 2, when n = 1 to 2, Q (n-1) = 0
When the partial remainder of the previous processing step is negative, the divisor (B) is added, while when Q (n-1) = 1 (the partial remainder of the previous processing step is positive), the divisor is subtracted. Assuming that the above subtraction is the addition of the two's complement (-B) of the divisor, the value of the bit one bit higher than the bit width of the divisor in the addend (B or -B) is Q (n-1) 0 when Q = 0, and 1 when Q (n-1) = 1. Also, SCR
Y is the value of the bit one bit higher than the bit width of the divisor in the augend (A), and ACRY is the carry to the bit one bit higher than the bit width of the divisor in the addition of the bit width of the divisor. is there.

【0023】そこで、演算回路2による加算は除数のビ
ット幅だけで行われるが、除数のビット幅よりも1ビッ
ト多いビット幅の加算を行う場合における除数のビット
幅より1ビット上位のビットからの桁上がりの有無(部
分剰余の正負)は、Q(n-1)、SCRY、ACRYのう
ちの少なくとも何れか2つの値が1であるかどうか(Z
=1であるかどうか)によって判別できる。
Therefore, although the addition by the arithmetic circuit 2 is performed only with the bit width of the divisor, the addition from the bit one bit higher than the bit width of the divisor in the case of adding the bit width one bit larger than the bit width of the divisor. The presence / absence of a carry (positive / negative of the partial remainder) is determined by determining whether at least any two values of Q (n-1), SCRY, and ACRY are 1 (Z
= 1).

【0024】したがって、上記Zの値によって部分剰余
の正負が正確に判定でき、このZを部分商Q(n) とする
ことにより、部分剰余の正負に応じた正しい部分商Q
(n) が得られる。上記除数レジスタ1、演算回路2、第
一シフタ3、第一レジスタ4、第二シフタ5、第二レジ
スタ6およびこれら相互間の接続線は、多くの場合はい
ずれも16ビットや32ビットなど2のべき乗のデータ
幅に構成されるが、ここでは説明の簡単のために3ビッ
トのデータ幅を持つとして説明する。なお、原理的には
どのようなデータ幅であってもよい。
Therefore, the sign of the partial remainder can be accurately determined from the value of Z, and by setting this Z as the partial quotient Q (n), the correct partial quotient Q according to the sign of the partial remainder can be obtained.
(n) is obtained. In many cases, the divisor register 1, the arithmetic circuit 2, the first shifter 3, the first register 4, the second shifter 5, the second register 6, and the connection lines between them are all 16 bits or 32 bits. The data width is a power of. However, for the sake of simplicity, the description will be made assuming that the data width is 3 bits. Note that in principle, any data width may be used.

【0025】また、第一レジスタ4、第二レジスタ6、
およびシフトあふれ保持レジスタ7は、それぞれ入力さ
れたデータをクロック信号φ1に同期して保持し、除数
レジスタ1、および各レジスタR2は、それぞれ入力さ
れたデータをクロック信号φ2に同期して保持する。な
お、実際には上記の他にも商のオーバフローを検出する
手段や除数を正規化する手段等が設けられるが、本発明
の主眼ではないので説明を省略する。
The first register 4, the second register 6,
The shift overflow holding register 7 holds the input data in synchronization with the clock signal φ1, and the divisor register 1 and each register R2 hold the input data in synchronization with the clock signal φ2. Actually, in addition to the above, there are provided a means for detecting a quotient overflow, a means for normalizing the divisor, and the like.

【0026】以上のように構成された本実施例の除算装
置について、制御回路8の制御に基づく動作を説明す
る。 (1)処理ステップ開始前(初期化処理) まず、制御回路8の内部のカウンタの値(n)を0にク
リアするとともに、3ビットの符号なし数の除数を除数
レジスタ1に格納する。また、被除数が6ビットの符号
なし数の場合には、その上位3ビットを第一レジスタ4
に、下位3ビットを第二レジスタ6にそれぞれ格納する
一方、被除数が3ビットの符号なし数の場合には、第一
レジスタ4を0にクリアするとともに、被除数を第二レ
ジスタ6に格納する。 (2)第1処理ステップ(n=0) まず、第一レジスタ4に保持されている値と除数レジス
タ1に保持されている除数とをそれぞれ演算回路2のA
入力とB入力とに入力して演算を行う。この時の演算
は、図2のOPRの欄に示すように、A入力からB入力
の減算となる。
The operation of the dividing device according to the present embodiment configured as described above under the control of the control circuit 8 will be described. (1) Before Starting Processing Step (Initialization Processing) First, the value (n) of the counter inside the control circuit 8 is cleared to 0, and the divisor of the 3-bit unsigned number is stored in the divisor register 1. When the dividend is a 6-bit unsigned number, the upper 3 bits are stored in the first register 4.
While the lower three bits are stored in the second register 6 respectively, if the dividend is a 3-bit unsigned number, the first register 4 is cleared to 0 and the dividend is stored in the second register 6. (2) First Processing Step (n = 0) First, the value held in the first register 4 and the divisor held in the divisor register 1 are stored in the A
Calculation is performed by inputting to the input and the B input. The calculation at this time is a subtraction of the B input from the A input as shown in the OPR column of FIG.

【0027】次に、上記演算の演算結果および第二レジ
スタ6の値を、それぞれ第一シフタ3または第二シフタ
5で上位ビット方向に1ビットシフトし、シフト結果を
それぞれ第一レジスタ4または第二レジスタ6に格納す
る。その際、シフトあふれ保持レジスタ7には、第一シ
フタ3の最上位ビットからのシフトあふれ(SCRY)
が格納され、第一シフタ3の最下位ビットには、第二シ
フタ5の最上位ビットからのシフトあふれが挿入され、
第二シフタ5の最下位ビットには、図2のQ(n) の欄に
示すように、演算回路2の桁上げ(ACRY)が制御回
路8から与えられて挿入される。
Next, the operation result of the above operation and the value of the second register 6 are shifted by one bit in the upper bit direction by the first shifter 3 or the second shifter 5, respectively. Two are stored in the register 6. At this time, the shift overflow holding register 7 stores a shift overflow (SCRY) from the most significant bit of the first shifter 3.
Is stored in the least significant bit of the first shifter 3, and a shift overflow from the most significant bit of the second shifter 5 is inserted.
As shown in the column of Q (n) in FIG. 2, the carry (ACRY) of the arithmetic circuit 2 is given from the control circuit 8 and inserted into the least significant bit of the second shifter 5.

【0028】また、制御回路8の内部のカウンタの値
(n)を1増分する。 (3)第2〜第3処理ステップ(n=1〜2) まず、第一レジスタ4に保持されている値と除数レジス
タ1に保持されている除数とをそれぞれ演算回路2のA
入力とB入力とに入力して演算を行う。この時の演算
は、図2のOPRの欄に示すように、第二レジスタ6の
最下位ビットの値(1つ前の部分商Q(n-1) )が0なら
ばA入力とB入力の加算、1ならばA入力からB入力の
減算となる。
Further, the value (n) of the counter inside the control circuit 8 is incremented by one. (3) Second and third processing steps (n = 1 to 2) First, the value held in the first register 4 and the divisor held in the divisor register 1 are stored in the A
Calculation is performed by inputting to the input and the B input. At this time, as shown in the OPR column of FIG. 2, if the value of the least significant bit of the second register 6 (the previous partial quotient Q (n-1)) is 0, the A input and the B input If the addition is 1, then the B input is subtracted from the A input.

【0029】次に、前記第1処理ステップと同様に、演
算結果および第二レジスタ6の値を、それぞれ第一シフ
タ3または第二シフタ5で上位ビット方向に1ビットシ
フトし、シフト結果を第一レジスタ4または第二レジス
タ6に格納する。その際、やはり第1処理ステップと同
様に、シフトあふれ保持レジスタ7には、第一シフタ3
の最上位ビットからのシフトあふれ(SCRY)が格納
され、第一シフタ3の最下位ビットには、第二シフタ5
の最上位ビットからのシフトあふれが挿入されるが、第
二シフタ5の最下位ビットには、図2のQ(n) の欄に示
すように、演算回路2の桁上げ(ACRY)と第二レジ
スタ6の最下位ビットの値(Q(n-1) )とシフトあふれ
保持レジスタ7の値(SCRY)とから前記(1)式に
よって求められるZの値が制御回路8から与えられて挿
入される。
Next, similarly to the first processing step, the operation result and the value of the second register 6 are shifted by one bit in the upper bit direction by the first shifter 3 or the second shifter 5, respectively. It is stored in one register 4 or the second register 6. At this time, as in the first processing step, the shift overflow holding register 7 stores the first shifter 3
, The shift overflow (SCRY) from the most significant bit of the first shifter 3 is stored in the least significant bit of the first shifter 3.
The shift overflow from the most significant bit of the second shifter 5 is inserted. The least significant bit of the second shifter 5, as shown in the column of Q (n) in FIG. From the value of the least significant bit (Q (n-1)) of the second register 6 and the value of the shift overflow holding register 7 (SCRY), the value of Z obtained by the above equation (1) is given from the control circuit 8 and inserted. Is done.

【0030】また、制御回路8の内部のカウンタの値
(n)を1増分し、その値が3になるまで上記処理を繰
り返す。 (4)第4処理ステップ(n=3) まず、第2〜第3処理ステップと同様に、第一レジスタ
4に保持されている値と除数レジスタ1に保持されてい
る除数とをそれぞれ演算回路2のA入力とB入力とに入
力し、第二レジスタ6の最下位ビットの値(Q(n-1) )
に応じて加算または減算を行う。
Further, the value (n) of the counter inside the control circuit 8 is incremented by 1, and the above processing is repeated until the value becomes 3. (4) Fourth Processing Step (n = 3) First, similarly to the second and third processing steps, the value held in the first register 4 and the divisor held in the divisor register 1 are each calculated by an arithmetic circuit. 2 and the value of the least significant bit (Q (n-1)) of the second register 6
Addition or subtraction is performed according to.

【0031】次に、演算結果は、そのまま第一シフタ3
を経由して第一レジスタ4に格納する一方、第二レジス
タ6の値は第二シフタ5で上位ビット方向に1ビットシ
フトし、シフト結果を第二レジスタ6に格納する。この
場合、第二シフタ5の最上位ビットからのシフトあふれ
は、第一シフタ3の最下位ビットに挿入されることなく
捨てられるが、第二シフタ5の最下位ビットには、第2
〜第3処理ステップと同様に、演算回路2の桁上げ(A
CRY)と第二レジスタ6の最下位ビットの値とシフト
あふれ保持レジスタ7の値(SCRY)とから(1)式
によって求められるZの値が制御回路8から与えられて
挿入される。すなわち、部分商Q(n) は、第2〜第3処
理ステップと同様に求められて第二シフタ5に格納され
るが、演算回路2から出力される演算結果は最終剰余な
ので、2倍されることなく第一レジスタ4に格納され
る。
Next, the operation result is directly input to the first shifter 3.
, While the value of the second register 6 is shifted by one bit in the upper bit direction by the second shifter 5, and the shift result is stored in the second register 6. In this case, the shift overflow from the most significant bit of the second shifter 5 is discarded without being inserted into the least significant bit of the first shifter 3, but the least significant bit of the second shifter 5 has the second least significant bit.
To the third processing step, the carry (A
CRY), the value of the least significant bit of the second register 6, and the value of the shift overflow holding register 7 (SCRY), the value of Z determined by equation (1) is given from the control circuit 8 and inserted. That is, the partial quotient Q (n) is obtained and stored in the second shifter 5 in the same manner as in the second and third processing steps. However, since the operation result output from the operation circuit 2 is the final remainder, it is doubled. Without being stored in the first register 4.

【0032】また、制御回路8の内部のカウンタの値
(n)を1増分する。 (5)第5処理ステップ(n=4) 第一レジスタ4に保持されている値と除数レジスタ1に
保持されている除数とをそれぞれ演算回路2のA入力と
B入力に入力して演算を行う。この時の演算は、図2の
OPRの欄に示すように第二レジスタ6の最下位ビット
の値(Q(n-1))が0ならばA入力とB入力の加算、1
ならばA入力の転送となる。すなわち、最終剰余が負で
ある場合に、除数を加算して最終剰余を補正する。
The value (n) of the counter inside the control circuit 8 is incremented by one. (5) Fifth processing step (n = 4) The value held in the first register 4 and the divisor held in the divisor register 1 are input to the A input and the B input of the arithmetic circuit 2, respectively, to perform the operation. Do. At this time, as shown in the OPR column of FIG. 2, if the value of the least significant bit (Q (n-1)) of the second register 6 is 0, the A input and the B input are added.
Then, the A input is transferred. That is, when the final remainder is negative, the divisor is added to correct the final remainder.

【0033】また、演算結果および第二レジスタ6の値
を、それぞれ第一シフタ3または第二シフタ5をそのま
ま経由して、第一レジスタ4または第二レジスタ6に格
納する。以上の処理が行われた後、第一レジスタ4に格
納されている値が求める剰余で、第二レジスタ6に格納
されている値が求める商である。
The operation result and the value of the second register 6 are stored in the first register 4 or the second register 6 via the first shifter 3 or the second shifter 5 as they are. After the above processing is performed, the value stored in the first register 4 is the remainder to be determined, and the value stored in the second register 6 is the quotient to be determined.

【0034】上記のような処理によって行われる具体的
な計算の過程を筆算の書式で図3に示す。ここで、同図
における「X」、「C」は、それぞれ演算回路2の加算
における除数のビット幅より1ビット上位のビットへの
桁上げ(ACRY)を示し、アンダーラインは、第一シ
フタ3の最上位ビットからのシフトあふれ(SCRY)
を示している。
FIG. 3 shows a specific calculation process performed by the above processing in a handwriting format. Here, “X” and “C” in the figure respectively indicate carry (ACRY) to a bit one bit higher than the bit width of the divisor in the addition of the arithmetic circuit 2, and the underline indicates the first shifter 3. Overflow from the most significant bit of (SCRY)
Is shown.

【0035】なお、上記の例では、第二レジスタ6を被
除数または部分剰余の格納と、商の格納とに兼用する例
を示したが、商を格納するレジスタを独立して設けても
よい。この場合には、第一シフタ3と第二シフタ5との
分割が不要になるとともに、商のビット数を任意に設定
することも容易になる。 (第2実施例)図4は本発明の第2実施例における符号
付き数どうしの除算を行う除算装置のブロック図であ
る。この除算装置は、商を負方向に丸め、剰余の符号を
除数の符号と同じにするようになっている。具体的に
は、例えば被除数が−10、除数が3の場合には、商は
−4、剰余は2となる。なお、本第2実施例において、
前記第1実施例と同様の機能を有する構成要素は、対応
する番号を付して説明を省略する。
In the above example, the second register 6 is used for storing the dividend or partial remainder and storing the quotient, but the register for storing the quotient may be provided independently. In this case, it is not necessary to divide the first shifter 3 and the second shifter 5, and it is easy to arbitrarily set the number of quotient bits. (Second Embodiment) FIG. 4 is a block diagram of a division device for performing division between signed numbers according to a second embodiment of the present invention. This division device rounds the quotient in the negative direction and makes the sign of the remainder the same as the sign of the divisor. Specifically, for example, when the dividend is -10 and the divisor is 3, the quotient is -4 and the remainder is 2. In the second embodiment,
Components having the same functions as those of the first embodiment are denoted by the corresponding reference numerals, and description thereof is omitted.

【0036】図4において、15、19は入力された値
を上位ビット方向に1ビットシフトするか、またはその
まま転送して出力する第二シフタおよび第三シフタ、1
6は被除数の下位ビット、または第二シフタ15の出力
(部分剰余の2倍数の下位ビット)を一旦保持し、その
値を再び第二シフタ15に入力する第二レジスタ、20
は商を保持するレジスタである。すなわち、第1実施例
と異なり、被除数等をシフトまたは保持する手段と、商
をシフトまたは保持する手段とが独立して設けられてい
る。なお、第二シフタ15のシフト時には、値”0”が
最下位ビットに挿入され、第三シフタ19のシフト時に
は、後述する制御回路18から与えられる部分商Q(n)
が順次最下位ビットに挿入される。
In FIG. 4, reference numerals 15 and 19 denote a second shifter and a third shifter which shift the input value by one bit in the higher-order bit direction or transfer and output the input value as it is.
Reference numeral 6 denotes a second register which temporarily holds the lower bits of the dividend or the output of the second shifter 15 (lower bits of a multiple of two times the partial remainder) and inputs the value to the second shifter 15 again.
Is a register for holding a quotient. That is, different from the first embodiment, the means for shifting or holding the dividend and the like and the means for shifting or holding the quotient are provided independently. When the second shifter 15 shifts, a value “0” is inserted into the least significant bit. When the third shifter 19 shifts, a partial quotient Q (n) given from a control circuit 18 described later.
Are sequentially inserted into the least significant bit.

【0037】21は被除数の符号(S1)、すなわち被
除数の最上位ビットの値を保持する被除数符号レジスタ
である。22は第一レジスタ14の全てのビットに保持
されている値が0であるときに、値(Z1)として1を
出力する第一零検出回路である。23は第二レジスタ1
6の全てのビットに保持されている値が0であるとき
に、値(Z2)として1を出力する第二零検出回路であ
る。
Reference numeral 21 denotes a dividend code register that holds the sign (S1) of the dividend, that is, the value of the most significant bit of the dividend. Reference numeral 22 denotes a first zero detection circuit that outputs 1 as the value (Z1) when the values held in all the bits of the first register 14 are 0. 23 is the second register 1
This is a second zero detection circuit that outputs 1 as the value (Z2) when the value held in all the bits of 6 is 0.

【0038】24は第一零検出回路22の検出結果を保
持する第一零検出保持レジスタである。25は第二零検
出回路23の検出結果を保持する第二零検出保持レジス
タである。18は内部に処理ステップ数(n)を計数す
る図示しないカウンタを持ち、上記処理ステップ数
(n)、被除数符号レジスタ21の値(S1)、除数の
符号である除数レジスタ11の最上位ビットの値(S
2)、演算回路12の最上位ビットからの桁上げ(AC
RY)、第三レジスタ20の最下位ビットの値(1つ前
の部分商Q(n-1) )、および第一零検出回路22と、第
二零検出回路23と、第一零検出保持レジスタ24と、
第二零検出保持レジスタ25との検出結果または保持内
容(Z1、Z2、PZ1、PZ2)に基づいて、演算回
路12の演算の種類(OPR)、第一シフタ13のシフ
ト数(SFT1)、第二シフタ15のシフト数(SFT
2)、および第三シフタ19のシフト数(SFT3)を
指示するとともに、第三シフタ19の1ビットシフト時
の最下位ビットへの挿入値(部分商Q(n) )を生成する
制御回路である。
Reference numeral 24 denotes a first zero detection holding register for holding the detection result of the first zero detection circuit 22. Reference numeral 25 denotes a second zero detection holding register that holds the detection result of the second zero detection circuit 23. Reference numeral 18 has a counter (not shown) for counting the number of processing steps (n) therein. The number of processing steps (n), the value of the dividend code register 21 (S1), and the most significant bit of the divisor register 11 which is the sign of the divisor are shown. Value (S
2), carry from the most significant bit of the arithmetic circuit 12 (AC
RY), the value of the least significant bit of the third register 20 (the previous partial quotient Q (n-1)), the first zero detection circuit 22, the second zero detection circuit 23, and the first zero detection hold A register 24;
Based on the detection result with the second zero detection holding register 25 or the held contents (Z1, Z2, PZ1, PZ2), the type of operation of the arithmetic circuit 12 (OPR), the number of shifts of the first shifter 13 (SFT1), Number of shifts of the second shifter 15 (SFT
2) and a control circuit for instructing the shift number (SFT3) of the third shifter 19 and generating an insertion value (partial quotient Q (n)) to the least significant bit when the third shifter 19 shifts by 1 bit. is there.

【0039】図5は、第1実施例の図2と同様に、制御
回路18の処理ステップごとの具体的な制御内容を示す
説明図である。同図のQ(n) の欄における”ACRY”
および上線付きの”ACRY”は、演算回路12の最上
位ビットからの桁上げ、またはそのビット反転値を第三
シフタ19の最下位ビットに部分商Q(n-1) として挿入
することを示す。
FIG. 5 is an explanatory diagram showing specific control contents for each processing step of the control circuit 18 as in FIG. 2 of the first embodiment. "ACRY" in the column of Q (n) in FIG.
And "ACRY" with an overline indicates that the carry from the most significant bit of the arithmetic circuit 12 or the bit inverted value thereof is inserted into the least significant bit of the third shifter 19 as a partial quotient Q (n-1). .

【0040】また、除数レジスタ11、演算回路12、
第一シフタ13、第一レジスタ14、第二シフタ15、
第二レジスタ16、第三シフタ19、第三レジスタ2
0、第一零検出回路22、第二零検出回路23、および
これら相互間の接続線はいずれも3ビットのデータ幅を
持つ。以上のように構成された本実施例の除算装置につ
いて、制御回路18の制御に基づく動作を説明する。 (1)処理ステップ開始前(初期化処理) まず、制御回路18の内部のカウンタの値(n)、第一
零検出保持レジスタ24、および第二零検出保持レジス
タ25の値(PZ1、PZ2)を0にクリアするととも
に、3ビットの符号付き数の除数を除数レジスタ11に
格納する。また、被除数が6ビットの符号付き数の場合
には、その上位3ビットを第一レジスタ14に、下位3
ビットを第二レジスタ16にそれぞれ格納する一方、被
除数が3ビットの符号付き数の場合には、第一レジスタ
14の全ビットに被除数の符号ビットの値をコピーする
とともに、被除数を第二レジスタ16に格納する。 (2)第1処理ステップ(n=0) まず、第一レジスタ14に保持されている値と除数レジ
スタ11に保持されている除数とをそれぞれ演算回路1
2のA入力とB入力とに入力して演算を行う。この時の
演算は、図5のOPRの欄に示すように、被除数符号レ
ジスタ21の値(S1)と除数レジスタ11の最上位ビ
ットの値(S2)とが同じ値ならば、A入力からB入力
の減算、異なる値ならばA入力とB入力の加算となる。
The divisor register 11, the arithmetic circuit 12,
A first shifter 13, a first register 14, a second shifter 15,
Second register 16, third shifter 19, third register 2
0, the first zero detection circuit 22, the second zero detection circuit 23, and the connection lines between them have a data width of 3 bits. The operation of the dividing device configured as described above according to the present embodiment based on the control of the control circuit 18 will be described. (1) Before the start of the processing step (initialization processing) First, the value (n) of the counter inside the control circuit 18, the values of the first zero detection holding register 24 and the second zero detection holding register 25 (PZ1, PZ2) Is cleared to 0, and the divisor of the 3-bit signed number is stored in the divisor register 11. If the dividend is a 6-bit signed number, the upper 3 bits are stored in the first register 14 and the lower 3
While the bits are stored in the second register 16 respectively, if the dividend is a 3-bit signed number, the value of the sign bit of the dividend is copied to all bits of the first register 14 and the dividend is stored in the second register 16. To be stored. (2) First Processing Step (n = 0) First, the value held in the first register 14 and the divisor held in the divisor register 11 are respectively calculated by the arithmetic circuit 1
2 and input to the A and B inputs to perform the operation. At this time, as shown in the OPR column of FIG. 5, if the value (S1) of the dividend code register 21 and the value of the most significant bit (S2) of the divisor register 11 are the same value, the input from the A input to the B The input is subtracted, and if different, the A and B inputs are added.

【0041】次に、上記演算の演算結果、第二レジスタ
16の値、および第三レジスタ20の値を、それぞれ第
一シフタ13、第二シフタ15、または第三シフタ19
で上位ビット方向に1ビットシフトし、シフト結果をそ
れぞれ第一レジスタ14、第二レジスタ16、または第
三レジスタ20に格納する。その際、第一シフタ13の
最下位ビットには、第二シフタ15の最上位ビットから
のシフトあふれが挿入され、第二シフタ15の最下位ビ
ットには、値”0”が挿入され、第三シフタ19の最下
位ビットには、図5のQ(n) の欄に示すように、演算回
路12の桁上げ(ACRY)、またはそのビット反転値
が制御回路18から与えられて挿入される。
Next, the operation result of the above operation, the value of the second register 16 and the value of the third register 20 are stored in the first shifter 13, the second shifter 15, and the third shifter 19, respectively.
Shifts one bit in the upper bit direction, and stores the shift result in the first register 14, the second register 16, or the third register 20, respectively. At this time, the shift overflow from the most significant bit of the second shifter 15 is inserted into the least significant bit of the first shifter 13, the value “0” is inserted into the least significant bit of the second shifter 15, and As shown in the column of Q (n) in FIG. 5, the carry (ACRY) of the arithmetic circuit 12 or its bit inverted value is given from the control circuit 18 and inserted into the least significant bit of the three shifters 19. .

【0042】より詳しくは、除数レジスタ11の最上位
ビットの値(S2)が1で、かつ第一零検出回路22お
よび第二零検出回路23の検出結果(Z1、Z2)の少
なくとも一方が0で、さらに第一零検出保持レジスタ2
4および第二零検出保持レジスタ25の保持内容(PZ
1、PZ2)の少なくとも一方が0である場合には、演
算回路12の桁上げ(ACRY)のビット反転値が挿入
され、その他の場合には、演算回路12の桁上げ(AC
RY)がそのまま挿入される。
More specifically, the value (S2) of the most significant bit of the divisor register 11 is 1, and at least one of the detection results (Z1, Z2) of the first zero detection circuit 22 and the second zero detection circuit 23 is 0. And the first zero detection holding register 2
4 and second zero detection holding register 25 (PZ
1, PZ2) is 0, a bit inversion value of the carry (ACRY) of the arithmetic circuit 12 is inserted, otherwise, the carry (AC) of the arithmetic circuit 12 is inserted.
RY) is inserted as it is.

【0043】また、制御回路18の内部のカウンタの値
(n)を1増分する。 (3)第2〜第3処理ステップ(n=1〜2) まず、第一レジスタ14に保持されている値と除数レジ
スタ1に保持されている除数とをそれぞれ演算回路12
のA入力とB入力とに入力して演算を行う。この時の演
算は、図5のOPRの欄に示すように、第三レジスタ2
0の最下位ビットの値(1つ前の部分商Q(n-1) )が0
ならばA入力とB入力の加算、1ならばA入力からB入
力の減算となる。
Further, the value (n) of the counter inside the control circuit 18 is incremented by one. (3) Second and third processing steps (n = 1 to 2) First, the value held in the first register 14 and the divisor held in the divisor register 1 are calculated by the arithmetic circuit 12
Is input to the A input and the B input. The operation at this time is as shown in the OPR column of FIG.
If the value of the least significant bit of 0 (the previous partial quotient Q (n-1)) is 0
If so, the A input and the B input are added, and if 1, the A input and the B input are subtracted.

【0044】次に、前記第1処理ステップと同様に、演
算結果、第二レジスタ16および第三レジスタ20の値
を、それぞれ第一シフタ13、第二シフタ15、または
第三シフタ19で上位ビット方向に1ビットシフトし、
シフト結果を第一レジスタ14、第二レジスタ16、ま
たは第三レジスタ20に格納する。その際、やはり第1
処理ステップと同様に、第一シフタ13の最下位ビット
には、第二シフタ15の最上位ビットからのシフトあふ
れが挿入され、第二シフタ15の最下位ビットには、
値”0”が挿入され、第三シフタ19の最下位ビットに
は、図5のQ(n) の欄に示すように、演算回路12の桁
上げ(ACRY)、またはそのビット反転値が制御回路
18から与えられて挿入される。
Next, similarly to the first processing step, the operation result and the values of the second register 16 and the third register 20 are respectively shifted by the first shifter 13, the second shifter 15 or the third shifter 19 to the upper bit. Shift one bit in the direction
The shift result is stored in the first register 14, the second register 16, or the third register 20. At that time, the first
Similarly to the processing step, the shift overflow from the most significant bit of the second shifter 15 is inserted into the least significant bit of the first shifter 13, and the least significant bit of the second shifter 15 is
The value "0" is inserted, and the least significant bit of the third shifter 19 is controlled by the carry (ACRY) of the arithmetic circuit 12 or its bit inverted value, as shown in the column of Q (n) in FIG. Provided from circuit 18 and inserted.

【0045】また、制御回路18の内部のカウンタの値
(n)を1増分し、その値が3になるまで上記処理を繰
り返す。 (4)第4処理ステップ(n=3) まず、第2〜第3処理ステップと同様に、第一レジスタ
14に保持されている値と除数レジスタ11に保持され
ている除数とをそれぞれ演算回路12のA入力とB入力
とに入力し、第三レジスタ20の最下位ビットの値(Q
(n-1) )に応じて加算または減算を行う。
Further, the value (n) of the counter inside the control circuit 18 is incremented by one, and the above processing is repeated until the value becomes three. (4) Fourth Processing Step (n = 3) First, similarly to the second and third processing steps, the value held in the first register 14 and the divisor held in the divisor register 11 are each calculated by an arithmetic circuit. 12 to the A and B inputs, and the value of the least significant bit (Q
Addition or subtraction is performed according to (n-1)).

【0046】次に、演算結果は、そのまま第一シフタ1
3を経由して第一レジスタ14に格納する一方、第二レ
ジスタ16および第三レジスタ20の値は第二シフタ1
5または第三シフタ19で上位ビット方向に1ビットシ
フトし、シフト結果を第二レジスタ16または第三レジ
スタ20に格納する。この場合、第二シフタ15の最上
位ビットからのシフトあふれは、第一シフタ13の最下
位ビットに挿入されることなく捨てられるが、第二シフ
タ15の最下位ビットには、第2〜第3処理ステップと
同様に値”0”が挿入され、第三シフタ19の最下位ビ
ットには、やはり第2〜第3処理ステップと同様に、除
数レジスタ11の最上位ビットの値(S2)、および第
一零検出回路22と、第二零検出回路23と、第一零検
出保持レジスタ24と、第二零検出保持レジスタ25と
の検出結果または保持内容(Z1、Z2、PZ1、PZ
2)に応じて、演算回路12の桁上げ(ACRY)、ま
たはそのビット反転値が制御回路18から与えられて挿
入される。すなわち、部分商Q(n) は、第2〜第3処理
ステップと同様に求められて第二シフタ15に格納され
るが、演算回路12から出力される演算結果は最終剰余
なので、2倍されることなく第一レジスタ14に格納さ
れる。
Next, the operation result is directly input to the first shifter 1.
3, while the value of the second register 16 and the value of the third register 20 are stored in the first register 14.
The data is shifted by one bit in the upper bit direction by the fifth or third shifter 19 and the shift result is stored in the second register 16 or the third register 20. In this case, the shift overflow from the most significant bit of the second shifter 15 is discarded without being inserted into the least significant bit of the first shifter 13, but the least significant bit of the second shifter 15 includes the second to second bits. The value “0” is inserted in the same manner as in the third processing step, and the least significant bit of the third shifter 19 is also the value (S2) of the most significant bit of the divisor register 11, similarly to the second and third processing steps, And the first zero detection circuit 22, the second zero detection circuit 23, the first zero detection holding register 24, and the second zero detection holding register 25 for the detection results or holding contents (Z1, Z2, PZ1, PZ1).
According to 2), the carry (ACRY) of the arithmetic circuit 12 or the bit inverted value thereof is given from the control circuit 18 and inserted. That is, the partial quotient Q (n) is obtained and stored in the second shifter 15 in the same manner as in the second and third processing steps. However, since the operation result output from the operation circuit 12 is the final remainder, it is doubled. Without being stored in the first register 14.

【0047】また、制御回路18の内部のカウンタの値
(n)を1増分する。 (5)第5処理ステップ(n=4) 第一レジスタ14に保持されている値と除数レジスタ1
1に保持されている除数とをそれぞれ演算回路12のA
入力とB入力に入力して演算を行う。この時の演算は、
図5のOPRの欄に示すように第三レジスタ20の最下
位ビットの値(Q(n-1) )が0ならばA入力とB入力の
加算、1ならばA入力の転送となる。すなわち、最終剰
余が負である場合に、除数を加算して最終剰余を補正す
る。
Further, the value (n) of the counter inside the control circuit 18 is incremented by one. (5) Fifth processing step (n = 4) The value held in the first register 14 and the divisor register 1
The divisor held at 1 is represented by A
Calculation is performed by inputting to the input and the B input. The operation at this time is
As shown in the OPR column of FIG. 5, if the value of the least significant bit (Q (n-1)) of the third register 20 is 0, the A and B inputs are added, and if it is 1, the A input is transferred. That is, when the final remainder is negative, the divisor is added to correct the final remainder.

【0048】また、演算結果、第二レジスタ16、およ
び第三レジスタ20の値を、それぞれ第一シフタ13ま
たは第二シフタ15、または第三シフタ19をそのまま
経由して、第一レジスタ14、第二レジスタ16、また
は第三レジスタ20に格納する。以上の処理が行われた
後、第一レジスタ14に格納されている値が求める剰余
で、第三レジスタ20に格納されている値が求める商で
ある。
Further, the operation result, the values of the second register 16 and the third register 20 are directly passed through the first shifter 13 or the second shifter 15 or the third shifter 19, respectively, and the first register 14 and the third register The data is stored in the second register 16 or the third register 20. After the above processing is performed, the value stored in the first register 14 is the remainder to be determined, and the value stored in the third register 20 is the quotient to be determined.

【0049】上記のような処理によって行われる具体的
な計算の過程を筆算の書式で図6に示す。ここで、第1
実施例と同様に、同図における「X」、「C」は、それ
ぞれ演算回路2の加算における除数のビット幅より1ビ
ット上位のビットへの桁上げ(ACRY)を示し、アン
ダーラインは、第一シフタ3の最上位ビットからのシフ
トあふれ(SCRY)を示している。
FIG. 6 shows a specific calculation process performed by the above-described processing in a handwriting format. Here, the first
As in the embodiment, “X” and “C” in the figure indicate carry to one bit higher than the bit width of the divisor in the addition of the arithmetic circuit 2 (ACRY), respectively. The shift overflow (SCRY) from the most significant bit of one shifter 3 is shown.

【0050】なお、本第2実施例においては、第三シフ
タ19と第三レジスタ20とを設け、制御回路18の生
成する部分商Q(n) を第三シフタ19の最下位ビットに
挿入して第三レジスタ20に蓄積しているが、第三シフ
タ19と第三レジスタ20とを設けずに制御回路18の
生成する部分商Q(n) を第二シフタ15の最下位ビット
に挿入して第二レジスタ16に蓄積するようにするとと
もに、第二零検出回路23が、第二レジスタ16に入力
される値のうち、第二シフタ15によって挿入され蓄積
された部分商を除く部分の全てのビットが0であるとき
に値(Z2)として1を出力するようにすればよい。こ
の場合、商は、第5処理ステップが終了した時に第二レ
ジスタ16に格納される。 (第3実施例)上記第2実施例の変形例として、商を0
方向に丸め、剰余の符号は被除数の符号と同じになる除
算装置を説明する。すなわち、例えば、被除数が−1
0、除数が3の場合、商は−3、剰余は−1となる。
In the second embodiment, the third shifter 19 and the third register 20 are provided, and the partial quotient Q (n) generated by the control circuit 18 is inserted into the least significant bit of the third shifter 19. Is stored in the third register 20, but without providing the third shifter 19 and the third register 20, the partial quotient Q (n) generated by the control circuit 18 is inserted into the least significant bit of the second shifter 15. And the second zero detection circuit 23 detects all of the values input to the second register 16 except for the partial quotient inserted and stored by the second shifter 15. Is output as the value (Z2) when the bit is zero. In this case, the quotient is stored in the second register 16 when the fifth processing step ends. (Third Embodiment) As a modification of the second embodiment, the quotient is set to 0.
A divider will be described in which the sign of the remainder is rounded in the direction and the sign of the remainder is the same as the sign of the dividend. That is, for example, if the dividend is -1
When 0 and the divisor is 3, the quotient is -3 and the remainder is -1.

【0051】この除算装置は、制御回路18の制御内容
が、第2実施例の除算装置と異なる。すなわち、図7に
示すように、第1処理ステップ(n=0)においては、
第三シフタ19の最下位ビットに挿入する値(Q(n-1)
)として、第一零検出回路22の出力(Z1)および
第二零検出回路23の出力(Z2)の値に係らず、除数
レジスタ11の最上位ビット(S2)が1ならば演算回
路2の桁上げの反転値が、0ならば演算回路2の桁上げ
が制御回路18から与えられる。
This division device is different from the division device of the second embodiment in the control contents of the control circuit 18. That is, as shown in FIG. 7, in the first processing step (n = 0),
The value (Q (n-1)) to be inserted into the least significant bit of the third shifter 19
), If the most significant bit (S2) of the divisor register 11 is 1 regardless of the value of the output (Z1) of the first zero detection circuit 22 and the output (Z2) of the second zero detection circuit 23, If the inverted value of the carry is 0, the carry of the arithmetic circuit 2 is given from the control circuit 18.

【0052】また、第2〜第3処理ステップ(n=1〜
2)、および第4処理ステップ(n=3)においては、
第三シフタ19の最下位ビットに挿入する値(Q(n-1)
)として、被除数符号レジスタ21の値(S1)が0
でかつ除数レジスタ11の最上位ビット(S2)が1の
場合、被除数符号レジスタ21の値(S1)が1でかつ
除数レジスタ11の最上位ビットが0でさらにZ1・Z
2+PZ1・PZ2が1の場合、および被除数符号レジ
スタ21の値(S1)が1でかつ除数レジスタ11の最
上位ビットが1でさらにZ1・Z2+PZ1・PZ2が
0の場合は、演算回路12の桁上げの反転値が、制御回
路18から与えられる一方、それ以外の場合は、演算回
路12の桁上げが制御回路18から与えられる。
The second and third processing steps (n = 1 to
2) and the fourth processing step (n = 3)
The value (Q (n-1)) to be inserted into the least significant bit of the third shifter 19
), The value (S1) of the dividend code register 21 is 0
And the most significant bit (S2) of the divisor register 11 is 1, the value (S1) of the dividend code register 21 is 1, the most significant bit of the divisor register 11 is 0, and Z1 · Z
When 2 + PZ1 · PZ2 is 1, and when the value (S1) of the dividend code register 21 is 1 and the most significant bit of the divisor register 11 is 1 and Z1 · Z2 + PZ1 · PZ2 is 0, the carry of the arithmetic circuit 12 is carried out. Is supplied from the control circuit 18, while in other cases, the carry of the arithmetic circuit 12 is supplied from the control circuit 18.

【0053】また、第5処理ステップ(n=4)では、
第一レジスタ14に保持されている値と除数レジスタ1
1に保持されている除数との演算回路12による演算と
して、被除数符号レジスタ21の値(S1)と除数レジ
スタ11の最上位ビット(S2)とが同じ値の場合に
は、さらに第三レジスタ20の最下位ビット(Q(n-
1))が0ならばA入力とB入力の加算、1ならばA入力
の転送となる一方、異なる値の場合には、さらに第三レ
ジスタ20の最下位ビットが0ならばA入力の転送、1
ならばA入力からB入力の減算となる。
In the fifth processing step (n = 4),
The value held in the first register 14 and the divisor register 1
If the value (S1) of the dividend code register 21 and the most significant bit (S2) of the divisor register 11 have the same value as an operation of the divisor held in 1 by the arithmetic circuit 12, the third register 20 Least significant bit (Q (n-
If 1)) is 0, the A input and the B input are added, and if it is 1, the A input is transferred. On the other hand, if the value is different, if the least significant bit of the third register 20 is 0, the A input is transferred. , 1
Then, the B input is subtracted from the A input.

【0054】また、求める商は、被除数と除数が同符号
の場合には、第三レジスタ20に格納されている値であ
るが、異符合の場合には、第三レジスタ20に格納され
ている値に1が加算され、結果を再び第三レジスタ20
に格納された値が求める商である。すなわち、符号なし
数の除算を行う場合と同じかもしくは1だけ多い処理ス
テップ数で、しかも大幅なハードウェアの増大を伴うこ
となく符号付き数の商および剰余を求めることができ
る。なお、上記1の加算は、第三シフタ19にシフトお
よび転送の機能に加えて1だけ加算(インクリメント)
する機能を持たせて行うようにしてもよいし、演算回路
12を用いるようにしてもよいし、また、図示しない別
の加算器を用いて行うようにしてもよい。
The quotient to be obtained is a value stored in the third register 20 when the dividend and the divisor have the same sign, but is stored in the third register 20 when the dividend and the divisor have different signs. 1 is added to the value, and the result is again stored in the third register 20.
Is the quotient to be found. In other words, the quotient and remainder of the signed number can be obtained with the same number of processing steps as that in the case of dividing an unsigned number or by one more processing number and without a significant increase in hardware. The addition of 1 is performed by adding (incrementing) 1 to the third shifter 19 in addition to the shift and transfer functions.
The function may be performed with a function to perform the calculation, the arithmetic circuit 12 may be used, or another adder (not shown) may be used.

【0055】上記のような処理によって行われる具体的
な計算の過程を筆算の書式で図8に示す。なお、上記第
2実施例および第3実施例では、商が2の補数表現数と
して得られるように構成した例を示したが、冗長2進表
現数として得られるように構成してもよい。
FIG. 8 shows a specific calculation process performed by the above processing in a handwriting format. In the second and third embodiments, an example has been described in which the quotient is obtained as a two's complement representation number. However, the quotient may be obtained as a redundant binary representation number.

【0056】また、各実施例ではハードウェアにより除
算装置を構成する例を示したが、これに限らず、例えば
上記各ブロックに対応する基本的な回路と、これらの回
路の動作を制御する基本的な命令列により構成すること
などもできる。
In each of the embodiments, an example has been described in which the dividing device is configured by hardware. However, the present invention is not limited to this. For example, basic circuits corresponding to the above blocks and basic circuits for controlling the operations of these circuits are provided. It can also be configured by a general instruction sequence.

【0057】[0057]

【発明の効果】以上説明したように、本発明によれば、
符号なし2進数の除算を行う除算装置または除算方法に
おいては、被除数、または部分剰余の2倍数と、除数と
の、部分商の値に応じた加減算による桁上げの値、加減
算結果の1ビット上位ビット側へのシフトによるシフト
あふれの値、および直前の部分商の値に基づいて、新た
な部分商が求められるので、除数と同じビット幅の加減
算によって正確な商を得ることができ、したがって、回
路規模の低減や除算速度の高速化を図ることができると
いう効果を奏する。
As described above, according to the present invention,
In a division apparatus or a division method for performing division of an unsigned binary number, a carry value by addition / subtraction according to a value of a partial quotient between a dividend or a multiple of a partial remainder and a divisor, and one bit higher than an addition / subtraction result Since a new partial quotient is obtained based on the value of the shift overflow due to shifting to the bit side and the value of the previous partial quotient, an accurate quotient can be obtained by addition and subtraction with the same bit width as the divisor, and This has the effect of reducing the circuit scale and increasing the division speed.

【0058】また、符号付き2進数の除算を行う除算装
置または除算方法においては、被除数、または部分剰余
の2倍数と、除数との、部分商の値に応じた加減算によ
る桁上げの値、除数と被除数との符号、直前の部分商の
値、および最新の加減算結果または直前の加減算結果の
うちの少なくとも何れか一方が0であるかどうかに基づ
いて、新たな部分商が求められるので、被除数および除
数の絶対値を求めたり商の絶対値を符号付き数に変換し
たりすることなく、符号付きの商を得ることができ、や
はり、回路規模の低減や除算速度の高速化を図ることが
できるという効果を奏する。
Further, in a division apparatus or a division method for dividing a signed binary number, a carry value or a divisor value obtained by addition / subtraction of a multiple of a dividend or a partial remainder and a divisor according to a value of a partial quotient is provided. Since the new partial quotient is determined based on the sign of the dividend and the dividend, the value of the previous partial quotient, and whether at least one of the latest addition / subtraction result or the previous addition / subtraction result is 0, the dividend It is possible to obtain a signed quotient without calculating the absolute value of the divisor or converting the absolute value of the quotient to a signed number, again reducing the circuit scale and increasing the division speed. It has the effect of being able to.

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

【図1】本発明の第1実施例における除算装置の構成を
示すブロック図である。
FIG. 1 is a block diagram illustrating a configuration of a division device according to a first embodiment of the present invention.

【図2】同、除算装置の制御内容を示す説明図である。FIG. 2 is an explanatory diagram showing control contents of a division device.

【図3】同、除算の過程の具体的な例を示す説明図であ
る。
FIG. 3 is an explanatory diagram showing a specific example of a division process.

【図4】本発明の第2実施例における除算装置の構成を
示すブロック図である。
FIG. 4 is a block diagram illustrating a configuration of a division device according to a second embodiment of the present invention.

【図5】同、除算装置の制御内容を示す説明図である。FIG. 5 is an explanatory diagram showing the control contents of the division device.

【図6】同、除算の過程の具体的な例を示す説明図であ
る。
FIG. 6 is an explanatory diagram showing a specific example of a division process.

【図7】本発明の第3実施例における除算装置の制御内
容を示す説明図である。
FIG. 7 is an explanatory diagram showing control contents of a divider in a third embodiment of the present invention.

【図8】同、除算の過程の具体的な例を示す説明図であ
る。
FIG. 8 is an explanatory diagram showing a specific example of a division process.

【符号の説明】 R2 レジスタ 1 除数レジスタ 2 演算回路 3 第一シフタ 4 第一レジスタ 5 第二シフタ 6 第二レジスタ 7 シフトあふれ保持レジスタ 8 制御回路 11 除数レジスタ 12 演算回路 13 第一シフタ 14 第一レジスタ 15 第二シフタ 16 第二レジスタ 18 制御回路 19 第三シフタ 20 第三レジスタ 21 被除数符号レジスタ 22 第一零検出回路 23 第二零検出回路 24 第一零検出保持レジスタ 25 第二零検出保持レジスタ[Description of Signs] R2 register 1 divisor register 2 operation circuit 3 first shifter 4 first register 5 second shifter 6 second register 7 shift overflow holding register 8 control circuit 11 divisor register 12 operation circuit 13 first shifter 14 first Register 15 Second shifter 16 Second register 18 Control circuit 19 Third shifter 20 Third register 21 Dividend sign register 22 First zero detection circuit 23 Second zero detection circuit 24 First zero detection holding register 25 Second zero detection holding register

Claims (16)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 符号なし2進数の除算を行う除算装置で
あって、 除数と同じビット幅を有し、被除数、または部分剰余の
2倍数と、除数とを部分商の値に応じて加減算する演算
手段と、 加減算結果を1ビット上位ビット側にシフトするシフト
手段と、初回の部分商を前記演算手段からの桁上げの値とし、次
回以降の部分商を、前記演算手段からの桁上げの値、シ
フト手段からのシフトあふれの値、および直前の部分商
の値のうちの、少なくとも2つの値が1であれば1と
し、そうでなければ0とする部分商算出手段と を備える
ことを特徴とする除算装置。
1. A division device for performing division of an unsigned binary number, the division device having the same bit width as the divisor, and adding and subtracting a dividend or a multiple of a partial remainder and a divisor according to a value of a partial quotient. Arithmetic means; shift means for shifting the result of addition / subtraction to the upper bit side by one bit; and a first partial quotient as a carry value from the arithmetic means;
Subsequent partial quotients are calculated as carry values from the arithmetic means,
Value of the shift overflow from the shift means and the previous partial quotient
If at least two of the values are 1, then 1
And a partial quotient calculation unit that otherwise sets the division quotient to 0 .
【請求項2】 符号なし2進数の除算を行う除算方法で
あって、 被除数、または部分剰余の2倍数と、除数とを部分商の
値に応じて除数と同じビット幅で加減算する演算ステッ
プと、 加減算結果を1ビット上位ビット側にシフトするシフト
ステップと、初回の部分商を前記演算ステップの演算による桁上げの
値とし、次回以降の部分商を、前記演算ステップの演算
による桁上げの値、シフトステップによるシフトあふれ
の値、および直前の部分商の値のうちの、少なくとも2
つの値が1であれば1とし、そうでなければ0とする部
分商算出ステップと を有することを特徴とする除算方
法。
2. A division method for performing division of an unsigned binary number, comprising: an operation step of adding / subtracting a dividend or a multiple of a partial remainder and a divisor with the same bit width as the divisor according to a value of a partial quotient. A shift step of shifting the result of addition / subtraction to the upper bit side by 1 bit, and a carry of the first partial quotient by the calculation of the calculation step.
Value and the next and subsequent partial quotients
Value due to carry, overflow due to shift step
At least two of the value of
If one of the values is 1, set it to 1, otherwise set it to 0
A division method comprising : a quotient calculation step .
【請求項3】 符号なし数の除数を保持する除数保持手
段と、 第1と第2の2つの入力に対して加算を行いその結果を
出力するかもしくは第1の入力から第2の入力の減算を
行いその結果を出力するかもしくは第1の入力をそのま
ま転送して出力する演算手段と、 前記演算手段の出力を上位ビット方向に1ビットシフト
するかもしくはそのまま転送する第一シフト手段と、 除算処理の開始時には、符号なし数の被除数の前記除数
保持手段の語長に等しい語長の上位部分を保持し、処理
の実行中には、前記第一シフト手段の出力を保持し、処
理の終了時には、剰余を保持する第一データ保持手段
と、 処理の開始時には、前記被除数の残りの下位部分を保持
し、処理の実行中には、上位ビット方向にシフトされた
前記被除数の下位部分と商の一部とを保持し、処理の終
了時には、商を保持する第二データ保持手段と、 前記第二データ保持手段に保持された値を上位ビット方
向に1ビットシフトするかもしくはそのまま転送して結
果を再び前記第二データ保持手段に格納する第二シフト
手段と、 前記第一シフト手段における最上位ビットからのシフト
あふれを保持する第三データ保持手段と、 内部に計数手段を持ち、前記演算手段に対しては、前記
計数手段が処理の開始を示すときには減算を指示し、前
記計数手段が処理の開始から終了までの間であることを
示すときには、前記第二データ保持手段の最下位ビット
の値が0ならば加算を指示する一方1ならば減算を指示
し、前記計数手段が処理の終了を示すときには、前記第
二データ保持手段の最下位ビットの値が0ならば加算を
指示する一方1ならば第1入力の転送を指示し、前記第
一シフト手段に対しては、前記計数手段が処理の終了ま
たは直前の処理でないことを示すときには、上位ビット
方向の1ビットシフトを指示し、前記計数手段が処理の
終了またはその直前の処理であることを示すときには転
送を指示し、前記第二シフト手段に対しては、前記計数
手段が処理の開始を示すときには前記演算手段における
桁上げを最下位ビットに挿入する上位ビット方向の1ビ
ットシフトを指示し、前記計数手段が処理の開始から終
了までの間であることを示すときには、前記演算手段に
おける桁上げと前記第二データ保持手段の最下位ビット
の値と前記第三データ保持手段に保持された値のうち
の、少なくとも2つの値が1であれば1とし、そうでな
ければ0とする値を最下位ビットに挿入する上位ビット
方向の1ビットシフトを指示し、前記計数手段が処理の
終了を示すときには転送を指示する制御手段とを備え、 前記第一データ保持手段に保持された値および前記除数
保持手段に保持された値をそれぞれ前記演算手段の第1
および第2の入力とし、前記第一シフト手段の最下位ビ
ットに挿入する値を前記第二シフト手段における最上位
ビットからのシフトあふれとし、前記演算手段における
演算と前記第一シフト手段および前記第二シフト手段に
おけるシフトとを前記被除数のビット数と前記除数のビ
ット数との差に等しい回数だけ繰り返して商および剰余
を求めるように構成されていることを特徴とする除算装
置。
3. A divisor holding means for holding a divisor of an unsigned number, adding the first and second inputs and outputting the result, or outputting the result from the first input to the second input. Calculating means for performing the subtraction and outputting the result or transferring and outputting the first input as it is; first shifting means for shifting the output of the calculating means by one bit in the upper bit direction or transferring the output as it is; At the start of the division process, the upper part of the word length equal to the word length of the divisor holding unit of the unsigned number dividend is held, and during execution of the process, the output of the first shift unit is held. At the end, the first data holding means for holding the remainder; At the start of the processing, the remaining lower part of the dividend is held, and during the processing, the lower part of the dividend shifted in the upper bit direction is stored. Part of the quotient And at the end of the processing, a second data holding means for holding a quotient, and shifting the value held by the second data holding means by one bit in the higher-order bit direction or transferring the result as it is, and returning the result again. A second shift means for storing in the second data holding means, a third data holding means for holding a shift overflow from the most significant bit in the first shift means, and a counting means therein, When the counting means indicates the start of the processing, subtraction is instructed, and when the counting means indicates that the processing is from the start to the end, the value of the least significant bit of the second data holding means is 0 indicates addition, while 1 indicates subtraction, and when the counting means indicates the end of processing, addition is instructed if the value of the least significant bit of the second data holding means is 0. On the other hand, if it is 1, it instructs the transfer of the first input, and instructs the first shift means to shift one bit in the upper bit direction when the counting means indicates that the processing is not the end or the immediately preceding processing. When the counting means indicates the end of the processing or the processing immediately before, the transfer is instructed. When the counting means indicates the start of the processing, the digit in the arithmetic means is instructed to the second shift means. When a 1-bit shift in the direction of the upper bit for instructing the carry to be inserted in the least significant bit is indicated, and the counting means indicates that the processing is between the start and the end of the processing, the carry in the arithmetic means and the second data holding of the values held value of the least significant bits and the third data holding means means
If at least two of the values are 1, then 1;
Control means for instructing a one-bit shift in the upper bit direction in which a value to be set to 0 is inserted in the least significant bit if the counting means indicates the end of processing, and The value held in the divisor holding means and the value held in the divisor holding means are respectively stored in the first
And a second input, the value to be inserted into the least significant bit of the first shift means is a shift overflow from the most significant bit in the second shift means, and the operation in the arithmetic means and the first shift means and the A division apparatus characterized in that a shift in the two-shift means is repeated a number of times equal to the difference between the number of bits of the dividend and the number of bits of the divisor, thereby obtaining a quotient and a remainder.
【請求項4】 除算処理の開始時に、符号なし数の被除
数を符号なし数の除数の語長に等しい語長の上位部分と
残りの下位部分とに分け、それぞれを第一の値または第
二の値として保持する初期設定ステップと、 繰り返し処理の処理回数を数える計数ステップと、 前記計数ステップにより処理の開始が示されるときに
は、前記第一の値から前記除数を減じ、前記計数ステッ
プにより処理の開始から終了までの間であることが示さ
れるときには、前記第二の値の最下位ビットが0ならば
前記第一の値と前記除数とを加える一方、1ならば前記
第一の値から前記除数を減じ、前記計数ステップにより
処理の終了が示されるときには、前記第二の値の最下位
ビットが0である場合に第一の値と前記除数とを加える
演算ステップと、 前記計数ステップにより処理の終了または終了直前の処
理でないことが示されるときに、第二のシフトステップ
における最上位ビットからのシフトあふれを最下位ビッ
トへ挿入するとともに前記演算ステップで得られる値を
上位ビット方向へ1ビットシフトしてそのシフト結果を
新たな第一の値とする第一のシフトステップと、 前記第一のシフトステップにおける最上位ビットからの
シフトあふれを第三の値として保持するシフト桁上げ格
納ステップと、 前記計数ステップにより処理の開始が示されるときに
は、前記演算ステップにおける桁上げを最下位ビットへ
挿入するとともに前記第二の値を上位ビット方向へ1ビ
ットシフトしてそのシフト結果を新たな第二の値とし、
前記計数ステップにより処理の開始から終了までの間で
あることが示されるときには、前記演算ステップにおけ
る桁上げ、前記第二の値の最下位ビット、および現ステ
ップの直前のステップにおける前記第三の値のうちの、
少なくとも2つの値が1であれば1とし、そうでなけれ
ば0とする値を最下位ビットへ挿入するとともに前記第
二の値を上位ビット方向へ1ビットシフトしてそのシフ
ト結果を新たな第二の値とする第二のシフトステップと
を有し、 前記計数ステップによる計数に基づいて、処理の開始か
ら終了までの間に、前記演算ステップと前記第一のシフ
トステップと前記シフト桁上げ格納ステップと前記第二
のシフトステップとを前記被除数のビット数と前記除数
のビット数との差に等しい回数だけ繰り返して得られる
第一の値および第二の値をそれぞれ剰余および商とする
ことを特徴とする除算方法。
4. At the start of the division process, the dividend of the unsigned number is divided into an upper part of the word length equal to the word length of the divisor of the unsigned number and a remaining lower part, each of which is a first value or a second value. An initial setting step to hold the value of the above, a counting step of counting the number of times of the repetitive processing, and when the counting step indicates the start of the processing, the divisor is subtracted from the first value, and the processing of the processing is performed by the counting step. When it is indicated from the start to the end, if the least significant bit of the second value is 0, the first value and the divisor are added. When the divisor is reduced and the counting step indicates the end of the process, an arithmetic step of adding the first value and the divisor if the least significant bit of the second value is 0; When it is indicated that the process is not the end of the process or the process immediately before the end, the shift overflow from the most significant bit in the second shift step is inserted into the least significant bit, and the value obtained in the operation step is shifted toward the upper bit. A first shift step of shifting by one bit to make the shift result a new first value; and a shift carry storage for holding a shift overflow from the most significant bit in the first shift step as a third value. When the start of the process is indicated by the step and the counting step, the carry in the operation step is inserted into the least significant bit, and the second value is shifted by one bit in the direction of the higher bit, and the shift result is converted into a new result. The second value,
When the counting step indicates that it is between the start and the end of the processing, the carry in the calculation step, the least significant bit of the second value, and the third value in the step immediately before the current step Of the
1 if at least two values are 1; otherwise
A second shift step of inserting a value to be 0 into the least significant bit and shifting the second value by one bit in the direction of the higher bit to make the shift result a new second value; On the basis of the counting by the counting step, during the period from the start to the end of the processing, the calculation step, the first shift step, the shift carry storage step, and the second shift step are performed by the number of bits of the dividend. And a first value and a second value obtained by repeating the number of times equal to the difference between the number of bits and the number of bits of the divisor, respectively, as a remainder and a quotient, respectively.
【請求項5】 符号付き2進数の除算を行う除算装置で
あって、部分剰余に対して除数を直前の部分商の値に応じて加減
算することにより新たな部分剰余を求める 演算手段と、前記除数の符号が負でかつ、現在および1つ前の処理に
おける部分剰余がともにゼロでない場合には、前記演算
手段からの桁上げの値の反転を部分商とし、それ以外の
場合には、前記演算手段からの桁上げの値を部分商とす
部分商算出手段とを備えたことを特徴とする除算装
置。
5. A division device for performing division of a signed binary number, wherein a divisor is added to or subtracted from a partial remainder in accordance with a value of a previous partial quotient.
Calculating means for obtaining a new partial remainder by performing the calculation, and performing the current and previous processing when the sign of the divisor is negative.
If both partial remainders are not zero,
The inversion of the carry value from the means is used as the partial quotient,
In this case, the value of the carry from the arithmetic means is used as a partial quotient.
And a partial quotient calculating means.
【請求項6】 符号付き2進数の除算を行う除算方法で
あって、部分剰余に対して除数を直前の部分商の値に応じて加減
算することにより新たな部分剰余を求める 演算ステップ
と、前記除数の符号が負でかつ、現在および1つ前の処理に
おける部分剰余がともにゼロでない場合には、前記演算
ステップによる桁上げの値の反転を部分商とし、それ以
外の場合には、前記演算ステップによる桁上げの値を部
分商とする 部分商算出ステップとを有することを特徴と
する除算方法。
6. A division method for performing a division of a signed binary number, wherein a divisor is added to or subtracted from a partial remainder in accordance with a value of an immediately preceding partial quotient.
Calculating the new partial remainder by performing the calculation, and performing the current and previous processing when the sign of the divisor is negative.
If both partial remainders are not zero,
The inversion of the carry value by the step is used as the partial quotient,
If not, the value of the carry in the above calculation step is
A partial quotient calculation step of dividing the quotient.
【請求項7】7. 符号付き2進数の除算を行う除算装置でA division device that divides a signed binary number
あって、So, 部分剰余に対して除数を直前の部分商の値に応じて加減The divisor for the partial remainder is adjusted according to the value of the previous partial quotient.
算することにより新たな部分剰余を求める演算手段と、Calculating means for obtaining a new partial remainder by calculating 初回の部分商については、For the first partial quotation, 前記除数の符号が負の場合には前記演算手段からの桁上If the sign of the divisor is negative, carry from the arithmetic means
げの値の反転を部分商とし、それ以外の場合には前記演Is the partial quotient, otherwise the above
算手段からの桁上げの値を部分商とし、次回以降の部分The value of the carry from the arithmetic means is used as the partial quotient, and
商については、About the quotient, 前記除数の符号が負でかつ、被除数の符号が非負の場If the sign of the divisor is negative and the sign of the dividend is non-negative,
合、または、Or 前記除数の符号が非負でかつ、被除数の符号が負でかWhether the sign of the divisor is non-negative and the sign of the dividend is negative
つ、現在または1つ前の処理における部分剰余のいずれEither the current remainder or the partial remainder in the previous process
かがゼロの場合、またはIs zero or 前記除数の符号が負でかつ、被The sign of the divisor is negative and
除数の符号が負でかつ、現在および1つ前の処理におけThe sign of the divisor is negative and the current and previous processing
る部分剰余がともにゼロでない場合には、If both partial remainders are not zero, 前記演算手段からの桁上げの値の反転を部分商とし、Inversion of the value of the carry from the arithmetic means is a partial quotient, それ以外の場合には、前記演算手段からの桁上げの値をOtherwise, the carry value from the arithmetic means is
部分商とする部分商算出手段とを備えたことを特徴とすAnd a partial quotient calculating means for setting a partial quotient.
る除算装置。Divider.
【請求項8】Claim 8. 符号付き2進数の除算を行う除算方法でIn the division method of dividing a signed binary number
あって、So, 部分剰余に対して除数を直前の部分商の値に応じて加減The divisor for the partial remainder is adjusted according to the value of the previous partial quotient.
算することにより新たな部分剰余を求める演算ステップCalculation step for obtaining a new partial remainder by calculating
と、When, 初回の部分商については、For the first partial quotation, 前記除数の符号が負の場合には前記演算ステップによるWhen the sign of the divisor is negative,
桁上げの値の反転を部分商とし、それ以外の場合には前The inversion of the carry value is used as the partial quotient;
記演算ステップによる桁上げの値を部分商とし、The value of the carry in the notation step is a partial quotient, 次回以降の部分商については、For the next and subsequent partial quotations, 前記除数の符号が負でかつ、被除数の符号が非負の場If the sign of the divisor is negative and the sign of the dividend is non-negative,
合、または、Or 前記除数の符号が非負でかつ、被除数の符号が負でかWhether the sign of the divisor is non-negative and the sign of the dividend is negative
つ、現在または1つ前の処理における部分剰余のいずれEither the current remainder or the partial remainder in the previous process
かがゼロの場合、またはIs zero or 前記除数の符号が負でかつ、被除数の符号が負でかつ、The sign of the divisor is negative, and the sign of the dividend is negative,
現在および1つ前の処理における部分剰余がともにゼロBoth partial remainders in current and previous processing are zero
でない場合には、If not, 前記演算ステップによる桁上げの値の反転を部分商とThe inversion of the value of the carry in the calculation step is a partial quotient.
し、And それ以外の場合には、前記演算ステップによる桁上げのOtherwise, the carry of the calculation step
値を部分商とする部分商算出ステップとを備えたことをAnd calculating a partial quotient using the value as a partial quotient.
特徴とする除算方法。Characteristic division method.
【請求項9】 処理の開始時に、符号付き数の被除数を
符号付き数の除数の語長に等しい語長の上位部分と残り
の下位部分とに分け、それぞれを第一の値または第二の
値として保持する初期設定ステップと、 繰り返しの処理回数を数える計数ステップと、 前記計数ステップにより処理の開始が示されるときに
は、前記被除数と前記除数とが同符号ならば前記第一の
値から前記除数を減じる一方異符号ならば前記第一の値
と前記除数とを加え、前記計数ステップにより処理の開
始から終了までの間であることが示されるときには、前
記第二の値の最下位ビットが0ならば前記第一の値と前
記除数とを加える一方1ならば前記第一の値から前記除
数を減じ、前記計数ステップにより処理の終了が示され
るときには、前記第二の値の最下位ビットが0ならば第
一の値と前記除数とを加える演算ステップと、 前記計数ステップにより処理の終了または終了直前の処
理でないことが示されるときに、第二のシフトステップ
における最上位ビットからのシフトあふれを最下位ビッ
トへ挿入するとともに前記演算ステップで得られる値を
上位ビット方向へ1ビットシフトしてそのシフト結果を
新たな第一の値とする第一のシフトステップと、 前記計数ステップにより処理の終了でないことが示され
るときには、前記演算ステップにおける桁上げまたはそ
の反転値を最下位ビットへ挿入するとともに前記第二の
値を上位ビット方向へ1ビットシフトしてそのシフト結
果を新たな第二の値とする第二のシフトステップとを有
し、 前記第二のシフトステップにおいて最下位ビットへ挿入
する値を、前記除数の符号が負でかつ現在および1つ前
の処理における前記第一の値のいずれかのビットまたは
前記第二の値のうち直前のステップまでに最下位ビット
に挿入されたものを除く部分のいずれかのビットが1の
ときには、前記演算ステップにおける桁上げの反転と
し、それ以外のときには前記演算ステップにおける桁上
げとし、前記計数ステップによる計数に基づいて、処理
の開始から終了までの間に、前記演算ステップと前記第
一のシフトステップと前記第二のシフトステップとを前
記被除数のビット数と前記除数のビット数との差に等し
い回数だけ繰り返して得られる第一の値および第二の値
をそれぞれ剰余および商とすることを特徴とする除算方
法。
9. At the start of the processing, the dividend of the signed number is divided into an upper part of the word length equal to the word length of the divisor of the signed number and the remaining lower part, each of which is a first value or a second value. An initial setting step of holding as a value, a counting step of counting the number of repetitive processes, and when the counting step indicates the start of processing, if the dividend and the divisor have the same sign, the divisor from the first value If the sign is a different sign, the first value and the divisor are added. When the counting step indicates that the processing is from the start to the end, the least significant bit of the second value is set to 0. If the first value and the divisor are added, the divisor is subtracted from the first value if 1, and the end of the processing is indicated by the counting step, the least significant bit of the second value is Then, an operation step of adding the first value and the divisor, and when the counting step indicates that the processing is not the end of the processing or the processing immediately before the end, the shift overflow from the most significant bit in the second shift step is performed. A first shift step of inserting into the least significant bit and shifting the value obtained in the operation step by one bit in the direction of the higher order bit and setting the shift result as a new first value; and terminating the processing by the counting step If not, the carry in the operation step or its inverted value is inserted into the least significant bit, and the second value is shifted by one bit in the direction of the upper bit, and the shift result is converted into a new second value. A second shift step, wherein the value to be inserted into the least significant bit in the second shift step is The sign of the number is negative and the portion of any of the first value or the second value in the current and previous process, except for the one inserted in the least significant bit by the previous step When any one of the bits is 1, the carry in the operation step is inverted, otherwise, the carry in the operation step is performed, and based on the count in the counting step, from the start to the end of the process, A first value and a second value obtained by repeating the operation step, the first shift step, and the second shift step a number of times equal to the difference between the number of bits of the dividend and the number of bits of the divisor. Is a remainder and a quotient, respectively.
【請求項10】 処理の開始時に、符号付き数の被除数
を符号付き数の除数の語長に等しい語長の上位部分と残
りの下位部分とに分け、それぞれを第一の値または第二
の値として保持する初期設定ステップと、 繰り返しの処理回数を数える計数ステップと、 前記計数ステップにより処理の開始が示されるときに
は、前記被除数と前記除数とが同符号ならば前記第一の
値から前記除数を減じる一方異符号ならば前記第一の値
と前記除数とを加え、前記計数ステップにより処理の開
始から終了までの間であることが示されるときには、第
三の値の最下位ビットが0ならば前記第一の値と前記除
数とを加える一方1ならば前記第一の値から前記除数を
減じ、前記計数ステップにより処理の終了が示されると
きには、前記第三の値の最下位ビットが0ならば第一の
値と前記除数とを加える演算ステップと、 前記計数ステップにより処理の終了またはその直前の処
理でないことが示されるときには、第二のシフトステッ
プにおける最上位ビットからのシフトあふれを最下位ビ
ットへ挿入するとともに前記演算ステップで得られる値
を上位ビット方向へ1ビットシフトしてそのシフト結果
を新たな第一の値とする第一のシフトステップと、 前記計数ステップにより処理の終了でないことが示され
るときには、0を最下位ビットへ挿入するとともに前記
第二の値を上位ビット方向へ1ビットシフトしてそのシ
フト結果を新たな第二の値とする第二のシフトステップ
と、 前記計数ステップにより処理の終了でないことが示され
るときには、前記演算ステップにおける桁上げまたはそ
の反転値を最下位ビットへ挿入するとともに前記第三の
値を上位ビット方向へ1ビットシフトしてそのシフト結
果を新たな第三の値とする第三のシフトステップとを有
し、 前記第三のシフトステップにおいて最下位ビットへ挿入
する値を、前記除数の符号が負でかつ現在および1つ前
の処理における前記第一の値のいずれかのビットまたは
前記第二の値のいずれかのビットが1のときには、前記
演算ステップにおける桁上げの反転とし、それ以外のと
きには、前記演算ステップにおける桁上げとし、前記計
数ステップによる計数に基づいて、処理の開始から終了
までの間に、前記演算ステップと前記第一のシフトステ
ップと前記第二のシフトステップと前記第三のシフトス
テップとを前記被除数のビット数と前記除数のビット数
との差に等しい回数だけ繰り返して得られる第一の値お
よび第三の値をそれぞれ剰余および商とすることを特徴
とする除算方法。
10. At the start of the process, the dividend of the signed number is divided into an upper part of the word length equal to the word length of the divisor of the signed number and the remaining lower part, each of which is a first value or a second value. An initial setting step of holding as a value, a counting step of counting the number of repetitive processes, and when the counting step indicates the start of processing, if the dividend and the divisor have the same sign, the divisor from the first value If the sign is a different sign, the first value and the divisor are added, and when the counting step indicates that the processing is from the start to the end, if the least significant bit of the third value is 0, For example, while adding the first value and the divisor, if 1, the divisor is subtracted from the first value, and when the end of processing is indicated by the counting step, the least significant bit of the third value is set to 0. If the calculation step indicates that the processing is not the end of the processing or the processing immediately before the counting step, the shift overflow from the most significant bit in the second shift step is minimized. A first shift step of inserting the value obtained in the arithmetic step by one bit in the direction of the upper bit while shifting the value obtained in the arithmetic step to a new first value, and the counting step does not end the processing. A second shift step of inserting 0 into the least significant bit and shifting the second value by one bit in the direction of the higher bit to make the shift result a new second value; When the counting step indicates that the processing is not completed, the carry in the calculation step or its inverted value is changed to the lowest order. And a third shift step of inserting the third value by one bit in the direction of the higher bits and making the shift result a new third value. When the value of the divisor is negative and any of the bits of the first value or the bit of the second value in the current and previous processing is 1, The carry in the calculation step is inverted, otherwise, the carry in the calculation step is based on the count in the counting step, from the start to the end of the processing, the calculation step and the first The shift step, the second shift step, and the third shift step are repeated a number of times equal to the difference between the number of bits of the dividend and the number of bits of the divisor. A first value and a third value obtained as a remainder and a quotient, respectively.
【請求項11】 符号付き数の除数を保持する除数保持
手段と、 第1と第2の2つの入力に対して加算を行いその結果を
出力するかもしくは第1の入力から第2の入力の減算を
行いその結果を出力するかもしくは第1の入力をそのま
ま転送して出力する演算手段と、 前記演算手段の出力を上位ビット方向に1ビットシフト
するかもしくはそのまま転送する第一シフト手段と、 除算処理の開始時には、符号付き数の被除数の前記除数
保持手段の語長に等しい語長の上位部分を保持し、処理
の実行中には、前記第一シフト手段の出力を保持し、処
理の終了時には、剰余を保持する第一データ保持手段
と、 処理の開始時には、前記被除数の残りの下位部分を保持
し、処理の実行中には、上位ビット方向にシフトされた
前記被除数の下位部分と商の一部とを保持し、処理の終
了時には、商を保持する第二データ保持手段と、 前記第二データ保持手段に保持された値を上位ビット方
向に1ビットシフトするかもしくはそのまま転送して結
果を再び前記第二データ保持手段に格納する第二シフト
手段と、 内部に計数手段を持ち、前記演算手段に対しては、前記
計数手段が処理の開始を示すときには、前記被除数と前
記除数とが同符号ならば減算を指示する一方異符号なら
ば加算を指示し、前記計数手段が処理の開始から終了ま
での間であることを示すときには、前記第二データ保持
手段の最下位ビットの値が0ならば加算を指示する一方
1ならば減算を指示し、前記計数手段が処理の終了を示
すときには、前記第二データ保持手段の最下位ビットの
値が0ならば加算を指示する一方1ならば第1入力の転
送を指示し、前記第一シフト手段に対しては、前記計数
手段が処理の終了または直前の処理でないことを示すと
きには、上位ビット方向の1ビットシフトを指示し、前
記計数手段が処理の終了またはその直前の処理を示すと
きには転送を指示し、前記第二シフト手段に対しては、
前記計数手段が処理の終了でないことを示すときには、
前記演算手段における桁上げまたはその反転値を最下位
ビットに挿入する上位ビット方向の1ビットシフトを指
示し、前記計数手段が処理の終了を示すときには転送を
指示する制御手段とを備え、 前記第一データ保持手段に保持された値および前記除数
保持手段に保持された値をそれぞれ前記演算手段の第1
および第2の入力とし、前記第一シフト手段の最下位ビ
ットに挿入する値を前記第二シフト手段における最上位
ビットからのシフトあふれとし、さらに前記制御手段に
おける前記第二シフト手段へ挿入するビットに関する指
示を、前記除数の符号が負でかつ現在および1つ前の処
理における前記第一データ保持手段のいずれかのビット
または前記第二データ保持手段のうち既に前記第二シフ
ト手段によって最下位ビットに挿入されている値のすべ
てを除く部分のいずれかのビットが1のときには前記演
算手段における桁上げの反転とし、それ以外のときには
前記演算手段における桁上げとし、前記計数ステップに
よる計数に基づいて、処理の開始から終了までの間に、
前記演算手段における演算と前記第一シフト手段および
前記第二シフト手段におけるシフトとを前記被除数のビ
ット数と前記除数のビット数との差に等しい回数だけ繰
り返して商および剰余を求めることを特徴とする除算装
置。
11. A divisor holding means for holding a divisor of a signed number, adding to the first and second inputs and outputting the result, or outputting the result of the first input to the second input. Calculating means for performing the subtraction and outputting the result or transferring and outputting the first input as it is; first shifting means for shifting the output of the calculating means by one bit in the upper bit direction or transferring the output as it is; At the start of the division process, the upper part of the word length equal to the word length of the divisor holding unit of the dividend of the signed number is held, and during the execution of the process, the output of the first shift unit is held. At the end, the first data holding means for holding the remainder; At the start of the processing, the remaining lower part of the dividend is held, and during the processing, the lower part of the dividend shifted in the upper bit direction is stored. Quotient And a second data holding means for holding a quotient at the end of the processing, and shifting the value held by the second data holding means by one bit in the upper bit direction or transferring the result as it is, and The second shift means for storing the data in the second data holding means again, and the counting means therein, and when the counting means indicates the start of the processing, the dividend and the divisor are the same. If the sign indicates a subtraction, if the sign is a different sign, an addition is indicated, and if the counting means indicates that the processing is from the start to the end, the value of the least significant bit of the second data holding means is 0. If the value indicates the end of the process, and if the value of the least significant bit of the second data holding means is 0, the instruction indicates addition. No. When the transfer of an input is instructed and the counting means indicates to the first shift means that the processing is not the end or the immediately preceding processing, a one-bit shift in the upper bit direction is instructed. When indicating the end of the process or the process immediately before, the transfer is instructed, and for the second shift means,
When the counting means indicates that the processing is not completed,
Control means for instructing a one-bit shift in a higher-order bit direction to insert a carry or its inverted value in the least significant bit in the arithmetic means, and instructing transfer when the counting means indicates the end of processing, The value held in the data holding means and the value held in the divisor holding means are respectively stored in the first
And the second input, the value to be inserted into the least significant bit of the first shift means is the shift overflow from the most significant bit in the second shift means, and the bit to be inserted into the second shift means in the control means. The instruction regarding the sign of the divisor is negative and any of the bits of the first data holding means in the current and previous processing or the least significant bit of the second data holding means has already been output by the second shift means. When any of the bits except for all of the values inserted in is 1, the carry in the arithmetic means is inverted, otherwise, the carry in the arithmetic means is used. , Between the start and end of the process,
Calculating the quotient and the remainder by repeating the operation in the arithmetic means and the shift in the first shift means and the second shift means a number of times equal to the difference between the number of bits of the dividend and the number of bits of the divisor. To divide.
【請求項12】 符号付き数の除数を保持する除数保持
手段と、 第1と第2の2つの入力に対して加算を行いその結果を
出力するかもしくは第1の入力から第2の入力の減算を
行いその結果を出力するかもしくは第1の入力をそのま
ま転送して出力する演算手段と、 前記演算手段の出力を上位ビット方向に1ビットシフト
するかもしくはそのまま転送する第一シフト手段と、 除算処理の開始時には、符号付き数の被除数の前記除数
保持手段の語長に等しい語長の上位部分を保持し、処理
の実行中には、前記第一シフト手段の出力を保持し、処
理の終了時には、剰余を保持する第一データ保持手段
と、 処理の開始時には、前記被除数の残りの下位部分を保持
し、処理の実行中には、上位ビット方向にシフトされた
前記被除数の下位部分を保持し、処理の終了時には0を
保持する第二データ保持手段と、 処理の実行中には商の一部を保持して、処理の終了時に
は商を保持する第三データ保持手段と、 0を最下位ビットに挿入して前記第二データ保持手段に
保持された値を上位ビット方向に1ビットシフトするか
もしくは前記第二データ保持手段に保持された値をその
まま転送して結果を再び前記第二データ保持手段に格納
する第二シフト手段と、 前記第三データ保持手段に保持された値を上位ビット方
向に1ビットシフトするかもしくはそのまま転送して結
果を再び前記第三データ保持手段に格納する第三シフト
手段と、 内部に計数手段を持ち、前記演算手段に対しては、前記
計数手段が処理の開始を示すときには、前記被除数と前
記除数とが同符号ならば減算を指示する一方異符号なら
ば加算を指示し、前記計数手段が処理の開始から終了ま
での間であることを示すときには、前記第三データ保持
手段の最下位ビットの値が0ならば加算を指示する一方
1ならば減算を指示し、前記計数手段が処理の終了を示
すときには、前記第三データ保持手段の最下位ビットの
値が0ならば加算を指示する一方1ならば第1入力の転
送を指示し、前記第一シフト手段に対しては、前記計数
手段が処理の終了または直前の処理でないことを示すと
きには、上位ビット方向の1ビットシフトを指示し、前
記計数手段が処理の終了またはその直前の処理を示すと
きには転送を指示し、前記第二シフト手段に対しては、
前記計数手段が処理の終了でないことを示すときには、
上位ビット方向の1ビットシフトを指示し、前記計数手
段が処理の終了を示すときには転送を指示し、前記第三
シフト手段に対しては、前記計数手段が処理の終了でな
いことを示すときには、前記演算手段における桁上げ
よびその反転値を最下位ビットに挿入する上位ビット方
向の1ビットシフトを指示し、前記計数手段が処理の終
了を示すときには転送を指示する制御手段とを備え、 前記第一データ保持手段に保持された値および前記除数
保持手段に保持された値をそれぞれ前記演算手段の第1
および第2の入力とし、前記第一シフト手段の最下位ビ
ットに挿入する値を前記第二シフト手段における最上位
ビットからのシフトあふれとし、さらに前記制御手段に
おける前記第三シフト手段へ挿入するビットに関する指
示を、前記除数の符号が負でかつ現在または1つ前の処
理における前記第一データ保持手段のいずれかのビット
または前記第二データ保持手段のいずれかのビットが1
のときには、前記演算手段における桁上げの反転とし、
それ以外のときには、前記演算手段における桁上げと
し、前記計数手段による計数に基づいて、処理の開始か
ら終了までの間に、前記演算手段における演算と前記第
一シフト手段および前記第二シフト手段および前記第三
シフト手段におけるシフトとを前記被除数のビット数と
前記除数のビット数との差に等しい回数だけ繰り返して
商および剰余を求めるように構成されていることを特徴
とする除算装置。
12. A divisor holding means for holding a divisor of a signed number, adding the first and second inputs and outputting the result, or outputting the result from the first input to the second input. Calculating means for performing the subtraction and outputting the result or transferring and outputting the first input as it is; first shifting means for shifting the output of the calculating means by one bit in the upper bit direction or transferring the output as it is; At the start of the division process, the upper part of the word length equal to the word length of the divisor holding unit of the dividend of the signed number is held, and during the execution of the process, the output of the first shift unit is held. At the end, first data holding means for holding a remainder, at the start of processing, the remaining lower part of the dividend is held, and during the processing, the lower part of the dividend shifted in the upper bit direction is stored. Hold A second data holding means for holding 0 at the end of the processing, a third data holding means for holding a part of the quotient during the execution of the processing and holding the quotient at the end of the processing, The value held in the second data holding means is shifted by one bit in the upper bit direction by inserting it into bits, or the value held in the second data holding means is transferred as it is, and the result is returned to the second data holding means. A second shifting means for storing in the holding means; and a second means for shifting the value held in the third data holding means by one bit in the upper bit direction or transferring the value as it is and storing the result in the third data holding means again. A three-shift means, and a counting means therein, and for the arithmetic means, when the counting means indicates the start of processing, if the dividend and the divisor have the same sign, the subtraction is instructed. If the value of the least significant bit of the third data holding means is 0, the addition is instructed, and if the value of the least significant bit of the third data holding means is 0, the addition is instructed. When the subtraction is instructed and the counting means indicates the end of the processing, if the value of the least significant bit of the third data holding means is 0, the addition is instructed, while if the value is 1, the transfer of the first input is instructed. When the counting means indicates that the processing is not the end of the processing or the processing immediately before, the first shifting means instructs the first shifting means to shift one bit in the upper bit direction. When indicated, a transfer is instructed, and for the second shift means,
When the counting means indicates that the processing is not completed,
When the counting means indicates the end of the processing, the transfer is instructed. When the counting means indicates the end of the processing, the counting means indicates the end of the processing. O a carry in the arithmetic means
And instructs the 1-bit shift of the upper bit direction of inserting the inverted value to the least significant bit, when the counting means indicate the end of the processing and control means for instructing forward, held in the first data holding means The obtained value and the value held in the divisor holding means are respectively stored in the first
And the second input, the value to be inserted into the least significant bit of the first shift means is the shift overflow from the most significant bit in the second shift means, and the bit to be inserted into the third shift means in the control means. The instruction regarding the divisor is negative, and any bit of the first data holding unit or any bit of the second data holding unit in the current or previous processing is 1
In the case of, carry carry inversion in the arithmetic means,
At other times, the carry in the arithmetic means is used, and based on the count by the counting means, between the start and the end of the processing, the arithmetic in the arithmetic means and the first shift means and the second shift means and A dividing apparatus characterized in that a quotient and a remainder are obtained by repeating the shift in the third shift means a number of times equal to the difference between the number of bits of the dividend and the number of bits of the divisor.
【請求項13】 処理の開始時に、符号付き数の被除数
を符号付き数の除数の語長に等しい語長の上位部分と残
りの下位部分とに分け、それぞれを第一の値または第二
の値として格納する初期設定ステップと、 繰り返しの処理回数を数える計数ステップと、 前記計数ステップにより処理の開始が示されるときに
は、前記被除数と前記除数とが同符号ならば前記第一の
値から前記除数を減じる一方異符号ならば前記第一の値
と前記除数とを加え、前記計数ステップにより処理の開
始から終了までの間であることが示されるときには、前
記第二の値の最下位ビットが0ならば前記第一の値と前
記除数とを加える一方1ならば前記第一の値から前記除
数を減じ、前記計数ステップにより処理の終了が示され
かつ前記被除数と前記除数とが同符号の時は前記第二の
値の最下位ビットが0ならば第一の値と前記除数とを加
え、前記計数ステップにより処理の終了が示されかつ前
記被除数と前記除数とが異符号の時は前記第二の値の最
下位ビットが1ならば第一の値から前記除数を減ずる演
算ステップと、 前記計数ステップにより処理の終了または終了直前の処
理でないことが示されるときに、第二のシフトステップ
における最上位ビットからのシフトあふれを最下位ビッ
トへ挿入するとともに前記演算ステップで得られる値を
上位ビット方向へ1ビットシフトしてそのシフト結果を
新たな第一の値とする第一のシフトステップと、 前記計数ステップにより処理の終了でないことが示され
るときには、前記演算ステップにおける桁上げまたはそ
の反転値を最下位ビットへ挿入するとともに前記第二の
値を上位ビット方向へ1ビットシフトしてそのシフト結
果を新たな第二の値とする第二のシフトステップと、 前記第二の値に1を加える商補正ステップとを有し、 前記第二のシフトステップにおいて最下位ビットへ挿入
する値を、前記計数ステップにより処理の開始が示され
るときには、前記除数の符号が負ならば前記演算ステッ
プにおける桁上げの反転とする一方正ならば前記演算ス
テップにおける桁上げとし、前記計数ステップにより処
理の開始でないことが示されるときには、前記被除数が
正かつ前記除数が負の場合または前記被除数が負かつ前
記除数が正でかつ現在または1つ前の処理における前記
第一の値の全部のビットおよび前記第二の値のうち直前
のステップまでに最下位ビットに挿入されたものを除く
部分のビットがいずれも0の場合または前記被除数が負
かつ前記除数が負でかつ現在および1つ前の処理におけ
る前記第一の値のいずれかのビットまたは前記第二の値
のうち直前のステップまでに最下位ビットに挿入された
ものを除く部分のいずれかのビットが1の場合は前記演
算ステップにおける桁上げの反転とし、それ以外の場合
は前記演算ステップにおける桁上げとし、前記計数ステ
ップによる計数に基づいて、処理の開始から終了までの
間に、前記演算ステップと前記第一のシフトステップと
前記第二のシフトステップとを前記被除数のビット数と
前記除数のビット数との差に等しい回数だけ繰り返し、
得られる第一の値を剰余とし、前記被除数と前記除数と
が異符号の時は前記商補正ステップを行い、同符号の時
は前記商補正ステップを行わずに得られる第二の値を商
とすることを特徴とする除算方法。
13. At the start of the processing, the dividend of the signed number is divided into an upper part of the word length equal to the word length of the divisor of the signed number and the remaining lower part, each of which is a first value or a second value. An initial setting step of storing the value as a value; a counting step of counting the number of repetition processes; and a start of the process being indicated by the counting step, if the dividend and the divisor have the same sign, the divisor from the first value. If the sign is a different sign, the first value and the divisor are added. When the counting step indicates that the processing is from the start to the end, the least significant bit of the second value is set to 0. If the first value and the divisor are added, the divisor is subtracted from the first value if 1, and the end of the processing is indicated by the counting step, and the dividend and the divisor have the same sign. If the least significant bit of the second value is 0, the first value and the divisor are added, and the end of the process is indicated by the counting step, and when the dividend and the divisor have different signs, the second value is used. If the least significant bit of the value is 1, the arithmetic step of subtracting the divisor from the first value, and when the counting step indicates that the processing is not the end of the processing or the processing immediately before the end, the last shift in the second shifting step A first shift step of inserting a shift overflow from the upper bit into the least significant bit and shifting the value obtained in the operation step by one bit in the direction of the upper bit to make the shift result a new first value; When the counting step indicates that the processing is not completed, the carry in the calculation step or its inverted value is inserted into the least significant bit, and the A second shift step of shifting the value of by 1 bit in the upper bit direction and setting the shift result as a new second value, and a quotient correction step of adding 1 to the second value. In the second shift step, when the value to be inserted in the least significant bit in the counting step indicates the start of the processing, if the sign of the divisor is negative, the carry in the arithmetic step is inverted. If the carry is a step, and the counting step indicates that processing is not started, the dividend is positive and the divisor is negative, or the dividend is negative and the divisor is positive and the current or previous processing is performed. Of all bits of the first value and bits of the second value other than those inserted into the least significant bit by the immediately preceding step. If the shift is also 0 or the dividend is negative and the divisor is negative and the last step of any one of the bits of the first value or the second value in the current and previous processing, If any of the bits in the portion except for the bits inserted are 1, the carry in the operation step is inverted, otherwise, the carry in the operation step is used. From the start to the end of the process, repeat the operation step and the first shift step and the second shift step the number of times equal to the difference between the number of bits of the dividend and the number of bits of the divisor,
The obtained first value is a remainder, and the quotient correction step is performed when the dividend and the divisor have different signs, and when the dividend has the same sign, the second value obtained without performing the quotient correction step is a quotient. A division method characterized by:
【請求項14】 処理の開始時に、符号付き数の被除数
を符号付き数の除数の語長に等しい語長の上位部分と残
りの下位部分とに分け、それぞれを第一の値または第二
の値として保持する初期設定ステップと、 繰り返しの処理回数を数える計数ステップと、 前記計数ステップにより処理の開始が示されるときに
は、前記被除数と前記除数とが同符号ならば前記第一の
値から前記除数を減じる一方異符号ならば前記第一の値
と前記除数とを加え、前記計数ステップにより処理の開
始から終了までの間であることが示されるときには、第
三の値の最下位ビットが0ならば前記第一の値と前記除
数とを加える一方1ならば前記第一の値から前記除数を
減じ、前記計数ステップにより処理の終了が示されかつ
前記被除数と前記除数とが同符号のときには前記第二の
値の最下位ビットが0ならば第一の値と前記除数とを加
え、前記計数ステップにより処理の終了が示されかつ前
記被除数と前記除数とが異符号の時は前記第二の値の最
下位ビットが1ならば第一の値から前記除数を減ずる演
算ステップと、 前記計数ステップにより処理の終了またはその直前の処
理でないことが示されるときには、第二のシフトステッ
プにおける最上位ビットからのシフトあふれを最下位ビ
ットへ挿入するとともに前記演算ステップで得られる値
を上位ビット方向へ1ビットシフトしてそのシフト結果
を新たな第一の値とする第一のシフトステップと、 前記計数ステップにより処理の終了でないことが示され
るときには、0を最下位ビットへ挿入するとともに前記
第二の値を上位ビット方向へ1ビットシフトしてそのシ
フト結果を新たな第二の値とする第二のシフトステップ
と、 前記計数ステップにより処理の終了でないことが示され
るときには、前記演算ステップにおける桁上げまたはそ
の反転値を最下位ビットへ挿入するとともに前記第三の
値を上位ビット方向へ1ビットシフトしてそのシフト結
果を新たな第三の値とする第三のシフトステップと、 前記第三の値に1を加える商補正ステップとを有し、 前記第三のシフトステップにおいて最下位ビットへ挿入
する値を、前記計数ステップにより処理の開始が示され
るときには、前記除数の符号が負ならば前記演算ステッ
プにおける桁上げの反転とする一方正ならば前記演算ス
テップにおける桁上げとし、前記計数ステップにより処
理の開始でないことが示されるときには、前記被除数が
正かつ前記除数が負の場合または前記被除数が負かつ前
記除数が正でかつ現在または1つ前の処理における前記
第一の値の全部のビットおよび前記第二の値の全部のビ
ットがいずれも0の場合または前記被除数が負かつ前記
除数が負でかつ現在および1つ前の処理における前記第
一の値のいずれかのビットまたは前記第二の値のいずれ
かのビットが1の場合は前記演算ステップにおける桁上
げの反転とし、それ以外の場合は前記演算ステップにお
ける桁上げとし、前記計数ステップによる計数に基づい
て、処理の開始から終了までの間に、前記演算ステップ
と前記第一のシフトステップと前記第二のシフトステッ
プと前記第三のシフトステップとを前記被除数のビット
数と前記除数のビット数との差に等しい回数だけ繰り返
し、得られる第一の値を剰余とし、前記被除数と前記除
数とが異符号の時は前記商補正ステップを行い、同符号
の時は前記商補正ステップを行わずに得られる第三の値
を商とすることを特徴とする除算方法。
14. At the start of processing, the dividend of the signed number is divided into an upper part of the word length equal to the word length of the divisor of the signed number and the remaining lower part, each of which is a first value or a second value. An initial setting step of holding as a value, a counting step of counting the number of repetitive processes, and when the counting step indicates the start of processing, if the dividend and the divisor have the same sign, the divisor from the first value If the sign is a different sign, the first value and the divisor are added, and when the counting step indicates that the processing is from the start to the end, if the least significant bit of the third value is 0, For example, if the first value and the divisor are added, and if 1, the subtractor subtracts the divisor from the first value, the counting step indicates the end of processing, and the dividend and the divisor have the same sign. If the least significant bit of the second value is 0, the first value and the divisor are added, and the end of the process is indicated by the counting step, and when the dividend and the divisor have different signs, the second value is used. If the least significant bit of the value is 1, the arithmetic step of subtracting the divisor from the first value, and if the counting step indicates that the processing is not the end of the processing or the processing immediately before it, the most significant bit in the second shifting step A first shift step of inserting a shift overflow from a bit into a least significant bit, shifting the value obtained in the operation step by one bit in the direction of a higher bit, and setting the shift result as a new first value; When the counting step indicates that the processing is not completed, 0 is inserted into the least significant bit, and the second value is shifted by one bit toward the upper bit. A second shift step in which the result of the shift is a new second value, and when the counting step indicates that the processing is not completed, the carry in the operation step or its inverted value is inserted into the least significant bit. A third shift step of shifting the third value by one bit in the direction of the higher-order bit to make the shift result a new third value; and a quotient correction step of adding 1 to the third value. When the start of the process is indicated by the counting step, the value to be inserted into the least significant bit in the third shift step is set to the inversion of the carry in the calculation step if the sign of the divisor is negative. Then, the carry in the calculation step is performed. When the counting step indicates that the processing is not started, the dividend is positive and the previous When the divisor is negative, or when the dividend is negative, the divisor is positive, and all bits of the first value and all bits of the second value in the current or previous processing are both 0. Alternatively, if the dividend is negative, the divisor is negative, and any one of the bits of the first value or any one of the second values in the current and previous processing is 1, Carry inversion, otherwise, carry in the calculation step, based on the count in the counting step, from the start to the end of the processing, the calculation step and the first shift step and the The second shift step and the third shift step are repeated a number of times equal to the difference between the number of bits of the dividend and the number of bits of the divisor, and the obtained first value is a remainder. When the dividend and the divisor have different signs, the quotient correction step is performed. When the dividend has the same sign, the third value obtained without performing the quotient correction step is used as a quotient. Method.
【請求項15】 符号付き数の除数を保持する除数保持
手段と、 第1と第2の2つの入力に対して加算を行いその結果を
出力するかもしくは第1の入力から第2の入力の減算を
行いその結果を出力するかもしくは第1の入力をそのま
ま転送して出力する演算手段と、 前記演算手段の出力を上位ビット方向に1ビットシフト
するかもしくはそのまま転送する第一シフト手段と、 除算処理の開始時には、符号付き数の被除数の前記除数
保持手段の語長に等しい語長の上位部分を保持し、処理
の実行中には、前記第一シフト手段の出力を保持し、処
理の終了時には、剰余を保持する第一データ保持手段
と、 処理の開始時には、前記被除数の残りの下位部分を保持
し、処理の実行中には、上位ビット方向にシフトされた
前記被除数の下位部分と商の一部とを保持し、処理の終
了時には、商を保持する第二データ保持手段と、 前記第二データ保持手段に保持された値を上位ビット方
向に1ビットシフトするかもしくはそのまま転送して結
果を再び前記第二データ保持手段に格納する第二シフト
手段と、 内部に計数手段を持ち、前記演算手段に対しては、前記
計数手段が処理の開始を示すときには、前記被除数と前
記除数とが同符号ならば減算を指示する一方異符号なら
ば加算を指示し、前記計数手段が処理の開始から終了ま
での間であることを示すときには、前記第二データ保持
手段の最下位ビットの値が0ならば加算を指示する一方
1ならば減算を指示し、前記計数手段が処理の終了を示
しかつ前記被除数と前記除数とが同符号のときには、前
記第二データ保持手段の最下位ビットの値が0ならば加
算を指示する一方1ならば第1入力の転送を指示し、前
記計数手段が処理の終了を示しかつ前記被除数と前記除
数とが異符号のときには、前記第二データ保持手段の最
下位ビットの値が0ならば第1入力の転送を指示する一
方1ならば減算を指示して、前記第一シフト手段に対し
ては、前記計数手段により処理の終了または終了直前の
処理でないことが示されるときに、上位ビット方向の1
ビットシフトを指示し、前記計数手段が処理の終了また
はその直前の処理であることを示すときには、転送を指
示し、前記第二シフト手段に対しては、前記計数手段が
処理の終了でないことを示すときには、前記演算手段に
おける桁上げまたはその反転値を最下位ビットに挿入す
る上位ビット方向の1ビットシフトを指示し、前記計数
手段が処理の終了を示すときには転送を指示する制御手
段と、 前記第二データ保持手段に保持された値に1を加える商
補正手段とを備え、 前記第一データ保持手段に保持された値および前記除数
保持手段に保持された値をそれぞれ前記演算手段の第1
および第2の入力とし、前記第一シフト手段の最下位ビ
ットに挿入する値を前記第二シフト手段における最上位
ビットからのシフトあふれとし、さらに前記制御手段に
おける前記第二シフト手段へ挿入するビットに関する指
示を、前記計数手段が処理の開始を示すときは前記除数
の符号が負ならば前記演算手段における桁上げの反転と
する一方正ならば前記演算手段における桁上げとし、前
記計数手段が処理の開始でないことを示すときには、前
記被除数が正かつ前記除数が負の場合または前記被除数
が負かつ前記除数が正でかつ現在または1つ前の処理に
おける前記第一データ保持手段の全部のビットおよび前
記第二データ保持手段のうち既に前記第二シフト手段に
よって最下位ビットに挿入されている値のすべてを除く
部分のビットがいずれも0の場合または前記被除数が負
かつ前記除数が負でかつ現在および1つ前の処理におけ
る前記第一データ保持手段のいずれかのビットまたは前
記第二データ保持手段のうち既に前記第二シフト手段に
よって最下位ビットに挿入されている値のすべてを除く
部分のいずれかのビットが1の場合は前記演算手段にお
ける桁上げの反転とし、それ以外の場合は前記演算手段
における桁上げとし、前記計数手段による計数に基づい
て、処理の開始から終了までの間に、前記演算手段にお
ける演算と前記第一シフト手段および前記第二シフト手
段におけるシフトとを前記被除数のビット数と前記除数
のビット数との差に等しい回数だけ繰り返し、前記第一
データ保持手段に保持されている値を剰余とし、前記被
除数と前記除数とが異符号のときには前記商補正手段に
より前記第二データ保持手段に保持している値に1を加
える一方同符号のときには何も行わずに前記第二データ
保持手段に保持されている値を商とするように構成され
ていることを特徴とする除算装置。
15. A divisor holding means for holding a divisor of a signed number, adding the first and second inputs and outputting the result, or outputting the result from the first input to the second input. Calculating means for performing the subtraction and outputting the result or transferring and outputting the first input as it is; first shifting means for shifting the output of the calculating means by one bit in the upper bit direction or transferring the output as it is; At the start of the division process, the upper part of the word length equal to the word length of the divisor holding unit of the dividend of the signed number is held, and during the execution of the process, the output of the first shift unit is held. At the end, the first data holding means for holding the remainder; At the start of the processing, the remaining lower part of the dividend is held, and during the processing, the lower part of the dividend shifted in the upper bit direction is stored. Quotient And a second data holding means for holding a quotient at the end of the processing, and shifting the value held by the second data holding means by one bit in the upper bit direction or transferring the result as it is, and The second shift means for storing the data in the second data holding means again, and the counting means therein, and when the counting means indicates the start of the processing, the dividend and the divisor are the same. If the sign indicates a subtraction, if the sign is a different sign, an addition is indicated, and if the counting means indicates that the processing is from the start to the end, the value of the least significant bit of the second data holding means is 0. If the value is 1, the subtraction is instructed. If the counting means indicates the end of the processing and the dividend and the divisor have the same sign, the value of the least significant bit of the second data holding means is If the instruction is 1, the transfer of the first input is instructed. If the counting means indicates the end of the processing, and the dividend and the divisor have different signs, the least significant bit of the second data holding means. If the value of the bit is 0, it indicates the transfer of the first input, while if it is 1, it indicates the subtraction. When indicated, a one in the high order bit direction
When the bit shift is instructed and the counting means indicates the end of the processing or the processing immediately before it, a transfer is instructed, and the second shifting means is informed that the counting means is not the end of the processing. Control means for instructing a one-bit shift in the upper bit direction to insert a carry or its inverted value in the least significant bit in the arithmetic means, and instructing transfer when the counting means indicates the end of processing, Quotient correcting means for adding 1 to the value held in the second data holding means, wherein the value held in the first data holding means and the value held in the divisor holding means are respectively stored in the first of the arithmetic means.
And the second input, the value to be inserted into the least significant bit of the first shift means is the shift overflow from the most significant bit in the second shift means, and the bit to be inserted into the second shift means in the control means. When the counting means indicates the start of the processing, if the sign of the divisor is negative, the carry in the calculating means is inverted, while if the sign is positive, the carry in the calculating means is performed. When the dividend is positive and the divisor is negative, or when the dividend is negative and the divisor is positive and all bits of the first data holding means in the current or previous processing and Bits of the second data holding unit other than all the values already inserted in the least significant bit by the second shift unit are bits. If both are 0 or the dividend is negative and the divisor is negative and any one of the bits of the first data holding means or the second shift of the second data holding means in the current and previous processing, If any one of the bits except for all of the values inserted in the least significant bit by the means is 1, the carry in the arithmetic means is inverted, otherwise, the carry in the arithmetic means is used, On the basis of the counting by the counting means, between the start and the end of the processing, the calculation in the calculation means and the shift in the first shift means and the second shift means are performed by the number of bits of the dividend and the number of bits of the divisor. Repeat the number of times equal to the difference, the value held in the first data holding means as a remainder, when the dividend and the divisor have different signs The quotient correction unit adds 1 to the value held in the second data holding unit, but does not perform any operation when the value is the same, and the value held in the second data holding unit is used as the quotient. A dividing device.
【請求項16】 符号付き数の除数を保持する除数保持
手段と、 第1と第2の2つの入力に対して加算を行いその結果を
出力するかもしくは第1の入力から第2の入力の減算を
行いその結果を出力するかもしくは第1の入力をそのま
ま転送して出力する演算手段と、 前記演算手段の出力を上位ビット方向に1ビットシフト
するかもしくはそのまま転送する第一シフト手段と、 除算処理の開始時には、符号付き数の被除数の前記除数
保持手段の語長に等しい語長の上位部分を保持し、処理
の実行中には、前記第一シフト手段の出力を保持し、処
理の終了時には、剰余を保持する第一データ保持手段
と、 処理の開始時には、前記被除数の残りの下位部分を保持
し、処理の実行中には、上位ビット方向にシフトされた
前記被除数の下位部分を保持し、処理の終了時には0を
保持する第二データ保持手段と、 処理の実行中には商の一部を保持して、処理の終了時に
は商を保持する第三データ保持手段と、 0を最下位ビットに挿入して前記第二データ保持手段に
保持された値を上位ビット方向に1ビットシフトするか
もしくは前記第二データ保持手段に保持された値をその
まま転送して結果を再び前記第二データ保持手段に格納
する第二シフト手段と、 前記第三データ保持手段に保持された値を上位ビット方
向に1ビットシフトするかもしくはそのまま転送して結
果を再び前記第三データ保持手段に格納する第三シフト
手段と、 内部に計数手段を持ち、前記演算手段に対しては、前記
計数手段が処理の開始を示すときには、前記被除数と前
記除数とが同符号ならば減算を指示する一方異符号なら
ば加算を指示し、前記計数手段が処理の開始から周力ま
での間であることを示すときには、前記第三データ保持
手段の最下位ビットの値が0ならば加算を指示する一方
1ならば減算を指示し、前記計数手段が処理の終了を示
しかつ前記被除数と前記除数とが同符号のときには、前
記第三データ保持手段の最下位ビットの値が0ならば加
算を指示する一方1ならば第1入力の転送を指示し、前
記計数手段が処理の終了を示しかつ前記被除数と前記除
数とが異符号のときには、前記第三データ保持手段の最
下位ビットの値が0ならば第1入力の転送を指示する一
方1ならば減算を指示して、前記第一シフト手段に対し
ては、前記計数手段により処理の終了またはその直前の
処理でないことが示されるときに、上位ビット方向の1
ビットシフトを指示し、前記計数手段が処理の終了また
はその直前の処理であることを示すときには、転送を指
示し、前記第二シフト手段に対しては、前記計数手段が
処理の終了でないことを示すときには、上位ビット方向
の1ビットシフトを指示し、前記計数手段が処理の終了
を示す時は転送を指示し、前記第三シフト手段に対して
は、前記計数手段が処理の終了でないことを示すときに
は、前記演算手段における桁上げまたはその反転値を最
下位ビットに挿入する上位ビット方向の1ビットシフト
を指示し、前記計数手段が処理の終了を示すときには転
送を指示する制御手段と、 前記第三データ保持手段に保持された値に1を加える商
補正手段とを備え、 前記第一データ保持手段に保持された値および前記除数
保持手段に保持された値をそれぞれ前記演算手段の第1
および第2の入力とし、前記第一シフト手段の最下位ビ
ットに挿入する値を前記第二シフト手段における最上位
ビットからのシフトあふれとし、さらに前記制御手段に
おける前記第三シフト手段へ挿入するビットに関する指
示を、前記計数手段が処理の開始を示すときは前記除数
の符号が負ならば前記演算手段における桁上げの反転と
する一方正ならば前記演算手段における桁上げとし、前
記計数手段が処理の開始でないことを示すときには、前
記被除数が正かつ前記除数が負の場合または前記被除数
が負かつ前記除数が正でかつ現在または1つ前の処理に
おける前記第一データ保持手段の全部のビットおよび前
記第二データ保持手段の全部のビットがいずれも0の場
合または前記被除数が負かつ前記除数が負でかつ現在お
よび1つ前の処理における前記第一データ保持手段のい
ずれかのビットまたは前記第二データ保持手段のいずれ
かのビットが1の場合は前記演算手段における桁上げの
反転とし、それ以外の場合は前記演算手段における桁上
げとし、前記除数の符号が負でかつ前記第一データ保持
手段のいずれかのビットまたは前記第二データ保持手段
のいずれかのビットが1のときには前記演算手段におけ
る桁上げの反転とし、それ以外の時は前記演算手段にお
ける桁上げとし、前記計数手段による計数に基づいて、
処理の開始から終了までの間に、前記演算手段における
演算と前記第一シフト手段および前記第二シフト手段お
よび前記第三シフト手段におけるシフトとを前記被除数
のビット数と前記除数のビット数との差に等しい回数だ
け繰り返し、前記第一データ保持手段に保持されている
値を剰余とし、前記被除数と前記除数とが異符号の時は
前記商補正手段により前記第三データ保持手段に保持し
ている値に1を加える一方同符号の時は何も行わずに前
記第三データ保持手段に保持されている値を商とするよ
うに構成されていることを特徴とする除算装置。
16. A divisor holding means for holding a divisor of a signed number, adding the first and second inputs and outputting the result, or outputting the result of the addition from the first input to the second input. Calculating means for performing the subtraction and outputting the result or transferring and outputting the first input as it is; first shifting means for shifting the output of the calculating means by one bit in the upper bit direction or transferring the output as it is; At the start of the division process, the upper part of the word length equal to the word length of the divisor holding unit of the dividend of the signed number is held, and during the execution of the process, the output of the first shift unit is held. At the end, first data holding means for holding a remainder, at the start of processing, the remaining lower part of the dividend is held, and during the processing, the lower part of the dividend shifted in the upper bit direction is stored. Hold A second data holding means for holding 0 at the end of the processing, a third data holding means for holding a part of the quotient during the execution of the processing and holding the quotient at the end of the processing, The value held in the second data holding means is shifted by one bit in the upper bit direction by inserting it into bits, or the value held in the second data holding means is transferred as it is, and the result is returned to the second data holding means. A second shifting means for storing in the holding means; and a second means for shifting the value held in the third data holding means by one bit in the upper bit direction or transferring the value as it is and storing the result in the third data holding means again. A three-shift means, and a counting means therein, and for the arithmetic means, when the counting means indicates the start of processing, if the dividend and the divisor have the same sign, the subtraction is instructed. If the value of the least significant bit of the third data holding means is 0, the addition is instructed, and if the value of the least significant bit of the third data holding means is 0, the addition is instructed. If the counting means indicates the end of the process and the dividend and the divisor have the same sign, if the value of the least significant bit of the third data holding means is 0, then the addition means 1 Then, transfer of the first input is instructed, and when the counting means indicates the end of the process and the dividend and the divisor have different signs, if the value of the least significant bit of the third data holding means is 0, the second data is transferred. Instructs transfer of one input while instructs subtraction if it is one, and instructs the first shift means to terminate the processing or to indicate that the processing is not immediately preceding by the counting means. Of 1
When the bit shift is instructed and the counting means indicates the end of the processing or the processing immediately before it, a transfer is instructed, and the second shifting means is informed that the counting means is not the end of the processing. When it indicates, it instructs a one-bit shift in the upper bit direction, when the counting means indicates the end of processing, instructs transfer, and instructs the third shift means that the counting means does not end processing. Control means for instructing a one-bit shift in the upper bit direction to insert a carry or its inverted value in the least significant bit in the arithmetic means, and instructing transfer when the counting means indicates the end of processing, Quotient correction means for adding 1 to the value held in the third data holding means, wherein the value held in the first data holding means and the value held in the divisor holding means are provided. First respectively the arithmetic means
And the second input, the value to be inserted into the least significant bit of the first shift means is the shift overflow from the most significant bit in the second shift means, and the bit to be inserted into the third shift means in the control means. When the counting means indicates the start of the processing, if the sign of the divisor is negative, the carry in the calculating means is inverted, while if the sign is positive, the carry in the calculating means is performed. When the dividend is positive and the divisor is negative, or when the dividend is negative and the divisor is positive and all bits of the first data holding means in the current or previous processing and When all the bits of the second data holding means are 0 or the dividend is negative, the divisor is negative, and the current and previous processing is performed. If any of the bits of the first data holding means or any of the bits of the second data holding means are 1, the carry in the arithmetic means is inverted; otherwise, the carry in the arithmetic means is reversed. When the sign of the divisor is negative and any bit of the first data holding means or any bit of the second data holding means is 1, the carry in the arithmetic means is inverted, Time is a carry in the calculating means, and based on the count by the counting means,
Between the start and the end of the processing, the calculation in the calculation means and the shift in the first shift means and the second shift means and the third shift means are performed by using the number of bits of the dividend and the number of bits of the divisor. Repeat the number of times equal to the difference, the remainder held in the first data holding means as a remainder, when the dividend and the divisor are different signs, the quotient correction means to hold the third data holding means A dividing device configured to add 1 to a stored value and do nothing at the same sign, and use the value held in the third data holding means as a quotient.
JP5180336A 1993-07-21 1993-07-21 Division device and division method Expired - Fee Related JP2995721B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5180336A JP2995721B2 (en) 1993-07-21 1993-07-21 Division device and division method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5180336A JP2995721B2 (en) 1993-07-21 1993-07-21 Division device and division method

Publications (2)

Publication Number Publication Date
JPH0736669A JPH0736669A (en) 1995-02-07
JP2995721B2 true JP2995721B2 (en) 1999-12-27

Family

ID=16081446

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5180336A Expired - Fee Related JP2995721B2 (en) 1993-07-21 1993-07-21 Division device and division method

Country Status (1)

Country Link
JP (1) JP2995721B2 (en)

Also Published As

Publication number Publication date
JPH0736669A (en) 1995-02-07

Similar Documents

Publication Publication Date Title
JP2835153B2 (en) High radix divider
KR100203468B1 (en) Arithmetic apparatus for floating point numbers
EP0356153B1 (en) Radix-2**n divider method and apparatus using overlapped quotient bit selection and concurrent quotient rounding and correction
JP2006227939A (en) Arithmetic unit
JP2585649B2 (en) Division circuit
US4677583A (en) Apparatus for decimal multiplication
JP2995721B2 (en) Division device and division method
JP2645422B2 (en) Floating point processor
JP2605715B2 (en) Division circuit
JP3028165B2 (en) High radix division control method and high radix divider
JP2664750B2 (en) Arithmetic device and arithmetic processing method
JP3074958B2 (en) Serial multiplier with addition function
JP2777265B2 (en) High radix square root arithmetic unit
JP2608090B2 (en) High radix non-restoring divider
JPH0368415B2 (en)
JPH06195206A (en) Divider
JPH0449138B2 (en)
JPH10333885A (en) Multiplying circuit
JP2996024B2 (en) Multiplication circuit
JP3205020B2 (en) Arithmetic unit
JP3100868B2 (en) Arithmetic unit for floating point numbers
JPH08263271A (en) Non-restoring division device
JPH0427587B2 (en)
JPH01237831A (en) Divider
JPH08249161A (en) Cubic root arithmetic unit

Legal Events

Date Code Title Description
FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20081029

Year of fee payment: 9

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20091029

Year of fee payment: 10

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20091029

Year of fee payment: 10

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101029

Year of fee payment: 11

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111029

Year of fee payment: 12

LAPS Cancellation because of no payment of annual fees