JPH0778724B2 - Divider - Google Patents

Divider

Info

Publication number
JPH0778724B2
JPH0778724B2 JP1241260A JP24126089A JPH0778724B2 JP H0778724 B2 JPH0778724 B2 JP H0778724B2 JP 1241260 A JP1241260 A JP 1241260A JP 24126089 A JP24126089 A JP 24126089A JP H0778724 B2 JPH0778724 B2 JP H0778724B2
Authority
JP
Japan
Prior art keywords
redundant binary
quotient
divisor
converter
subtractor
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
JP1241260A
Other languages
Japanese (ja)
Other versions
JPH03102519A (en
Inventor
英世 鶴田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP1241260A priority Critical patent/JPH0778724B2/en
Publication of JPH03102519A publication Critical patent/JPH03102519A/en
Publication of JPH0778724B2 publication Critical patent/JPH0778724B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】 産業上の利用分野 本発明は2の補数表現数同士あるいは符号なし数同士の
除算を行うセル配列方式に基づく減算シフト型除算器に
関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a subtraction shift type divider based on a cell array method for performing division of two's complement representation numbers or unsigned numbers.

従来の技術 従来の除算器としては、例えば、高木、安浦、矢島:
“冗長2進表現を利用したVLSI向き高速除算器",電子通
信学会論文誌(D),J67−D,No4,pp450−457(昭59−0
4)、特開昭63−49836号公報に示されている。
2. Description of the Related Art Conventional dividers include, for example, Takagi, Yasuura, and Yajima:
"High-speed divider for VLSI using redundant binary representation", IEICE Transactions (D), J67-D, No4, pp450-457 (SHO 59-0)
4), JP-A-63-49836.

以下の記述中で、冗長2進を[ ]SD2で、符号なし2
進数を[ ]で、2の補数表現数を[ ]2Cでそれぞ
れ囲んで表記する。英大文字記号で表された数値の各桁
を例えば X=[x0.x1x2…xnSD2 のように英小文字に添字の番号を付して表す。また以下
の記述中で用いる記号の説明を表1に掲げる。
In the following description, redundant binary is [] SD2 , unsigned 2
Enclose the notation in [] 2 and the two's complement number in [] 2C . Each digit of a numerical value represented by an uppercase letter is represented by a lowercase letter and a subscript number such as X = [x 0. x 1 x 2 ... x n ] SD2 . The explanation of the symbols used in the following description is given in Table 1.

第5図は従来の除算器のブロック図を示すもの であり、同図の例では特にn=6としている。同図にお
いて、1は正規化された2の補数表現の正または負の除
数を冗長2進数へ変換する除数変換器、2は正または負
の2の補数表現の被除数を冗長2進数へ変換する被除数
変換器、3は冗長2進数同士の加算または減算を行う冗
長2進加減算器、4は対応する段の冗長2進加減算器に
おいて加算もしくは減算のいずれの演算を行うべきかを
決定すると共にその段に対応する商の桁を決定する商決
定用回路、5は冗長2進表現の商を2の補数表現数へ変
換する商変換器、6は最終段の前記冗長2進加減算器の
演算結果である冗長2進数を2の補数表現数へ変換する
剰余変換器である。以下各図面において、同一物に対し
ては共通の番号を使用している。
FIG. 5 shows a block diagram of a conventional divider. Therefore, in the example of the figure, n = 6 is set in particular. In the figure, 1 is a divisor converter for converting a positive or negative divisor of a normalized 2's complement representation into a redundant binary number, and 2 is a divisor converter for converting a positive or negative 2's complement dividend into a redundant binary number. The dividend converter 3, 3 is a redundant binary adder / subtractor that performs addition or subtraction between redundant binary numbers, and 4 is a function that determines whether addition or subtraction should be performed in the redundant binary adder / subtractor of the corresponding stage. A quotient determination circuit for determining the digit of the quotient corresponding to the stage, 5 is a quotient converter for converting the quotient of the redundant binary representation into a two's complement representation number, and 6 is the operation result of the redundant binary adder / subtractor at the final stage 2 is a remainder converter for converting a redundant binary number that is a number into a two's complement number. In the drawings below, common numbers are used for the same items.

以上のように構成された従来の除算器について、以下に
その原理及び動作を説明する。従来の除算器に対して符
号なし2進表現の被除数Xと除数Yが与えられる。従来
の除算器は浮動小数点数の仮数部の処理のために構成さ
れているため、XとYはあらかじめ正規化されているこ
とを前提とする。初めに、被除数Xは除数Yはそれぞれ
被除数変換器2と除数変換器1により冗長2進数R(0)
Dへ変換される。
The principle and operation of the conventional divider configured as above will be described below. An unsigned binary representation of the dividend X and the divisor Y is provided to the conventional divider. Since the conventional divider is configured for processing the mantissa part of a floating point number, it is assumed that X and Y have been normalized in advance. First, the dividend X and the divisor Y are converted into redundant binary numbers R (0) and D by the dividend converter 2 and the divisor converter 1, respectively.

ここで符号なし2進表現から冗長2進表現への変換規則
を次に示す。
Here, the conversion rule from the unsigned binary representation to the redundant binary representation is shown below.

<符号なし2進表現から冗長2進表現への変換規則> [X]=[0.x1x2…xn [X]SD2←[X] とすると、 [X]SD2=[0.x1x2…xnSD2 ここで、←は数表現の変換を表す。即ち符号なし2進表
現数はそのままで値として冗長2進表現数である。
When [X] 2 = [0.x 1 x 2 ... x n] 2 [X] SD2 ← [X] 2 < conversion rule to the redundant binary representation from the unsigned binary representation>, [X] SD2 = [0.x 1 x 2 ... x n ] SD2 Here, <-represents the conversion of the number expression. That is, the unsigned binary representation number is a redundant binary representation number as a value.

次にR(0)は初段の冗長2進加減算器3に対する被減数と
して入力され、Dは第5図に示すように冗長2進加減算
器に対する演算数(加数もしくは減数)として各段の冗
長2進加減算器3に一斉に供給される。初段の冗長2進
加減算器3では、減算が行われる。初段より後の冗長2
進加減算器3では、その段に対応する商決定用回路4の
判断に従って加算または減算のいずれかが行われる。商
決定用回路4は前段の冗長2進加減算器3の演算結果の
上位3桁を見てその段の演算及び商の桁の値を決定す
る。n段すべてに対応する商と第(n+1)段の冗長2
進加減算器3の演算結果が求められると、冗長2進表現
の商と剰余が計算結果として得られる。冗長2進表現の
商は商変換器5により、剰余は剰余変換器6によりそれ
ぞれ2の補数表現数へ変換される。
Next, R (0) is input as the augend for the redundant binary adder / subtractor 3 in the first stage, and D is the redundant 2 of each stage as the operation number (addend or subtraction) for the redundant binary adder / subtractor as shown in FIG. It is supplied all at once to the adder / subtractor 3. Subtraction is performed in the redundant binary adder / subtractor 3 in the first stage. Redundancy after the first stage 2
In the addition / subtraction adder / subtractor 3, either addition or subtraction is performed according to the judgment of the quotient determination circuit 4 corresponding to that stage. The quotient determining circuit 4 looks at the upper 3 digits of the operation result of the redundant binary adder / subtractor 3 in the preceding stage and determines the value of the operation and quotient digit of that stage. The quotient corresponding to all n stages and the redundancy of the (n + 1) th stage 2
When the operation result of the adder-subtractor 3 is obtained, the quotient and the remainder of the redundant binary representation are obtained as the calculation result. The quotient of the redundant binary representation is converted by the quotient converter 5 and the remainder is converted by the remainder converter 6 into a two's complement representation number.

ここで冗長2進表現から2の補数表現への変換規則を次
に示す。
Here, the conversion rule from the redundant binary representation to the two's complement representation is shown below.

<冗長2進表現から2の補数表現への変換規則> [X]SD2=[0.x1x2…xnSD2 [X]2C←[X]SD2 とすると、冗長2進表現から2の補数表現への変換は2
つの符号なし2進数の減算により行える。冗長2進数の
各桁を見て、1の桁だけを集めて他の桁を0とした2進
数から、の桁だけを選んで1とし他の桁を0とした2
進数を減ずることにより、2の補数表現数に変換でき
る。この変換は各桁に入力選択器を設けた2の補数加算
器を用いて実現できる。
<Conversion Rule from Redundant Binary Representation to 2's Complement Representation> [X] SD2 = [0.x 1 x 2 ... x n ] SD2 [X] 2C ← [X] If SD2 , the redundant binary representation becomes 2 2 is the conversion of to
This can be done by subtracting two unsigned binary numbers. Looking at each digit of the redundant binary number, only the ones are collected and the other digits are set to 0. From the binary number, only the ones are selected and the other digits are set to 0.
It can be converted into a two's complement number by reducing the base number. This conversion can be implemented using a two's complement adder with an input selector at each digit.

以上で述べた処理の内容と商決定用回路における演算と
商決定のアルゴリズムを下のようにまとめる。
The contents of the processing described above and the calculation and quotient decision algorithm in the quotient decision circuit are summarized as follows.

<従来例の除算アルゴリズム> ステップ1 [R(0)SD2←[X] [D]SD2←[Y] ステップ2 [q0SD2:=1 [R(1)SD2:=[R(0)SD2−[D]SD2 ステップ3 ステップ4 Q:=[q0.q1q2…qnSD2 [Z]←[Q]SD2 [R]←[R(n+1)SD2 表2に示すように、従来の除算器に対する入力値の範囲
は制限される。従って商Zの値の範囲も 1/2≦Z<2 となる。もし与えられたXとYが任意の整数であった場
合、XとYは絶対値をとられ、正規化されねばならな
い。
<Conventional division algorithm> Step 1 [R (0) ] SD2 ← [X] 2 [D] SD2 ← [Y] 2 Step 2 [q 0 ] SD2 : = 1 [R (1) ] SD2 : = [ R (0) ] SD2- [D] SD2 Step 3 Step 4 Q: = [q 0. q 1 q 2 ... q n ] SD2 [Z] 2 ← [Q] SD2 [R] 2 ← [R (n + 1) ] SD2 As shown in Table 2, The range of input values for the divider is limited. Therefore, the range of the value of quotient Z is also 1/2 ≦ Z <2. If the given X and Y are arbitrary integers, then X and Y must be absolute and normalized.

冗長2進数同士の加算及び減算はそれぞれ表3,表4のよ
うに定義される。本従来の除算器の場合、演算数(加数
もしくは減数)の取り得る値が非負に制限されるので次
のような利点がある。
Addition and subtraction of redundant binary numbers are defined as shown in Tables 3 and 4, respectively. The conventional divider has the following advantages because the value that can be taken by the number of operations (addition or subtraction) is limited to non-negative.

(1)計算規則が簡単になる。(1) The calculation rule becomes simple.

(2)伝達ディジットが高々1桁しか伝播しない。(2) The transmission digit propagates only at most one digit.

ここで伝達ディジットtiは次のように定義される。Here, the transmission digit ti is defined as follows.

冗長2進数UとVの加算もしくは減算において、UとV
の第i番目の桁をそれぞれui,viとしたときに、 ui±vi=2ti-1+wi si=wi+ti ui,vi,si,ti,wi{1,0,1} si:和(差)ディジット ti:伝達ディジット wi:中間和(差) 即ち、伝達ディジットは2の補数表現数の加減算におけ
るキャリまたはボローと同じような意味を持つ。
In addition or subtraction of redundant binary numbers U and V, U and V
Let ui and vi be the i-th digits of u i ± v i = 2t i-1 + w i s i = w i + t i u i , v i , s i , t i , w i { 1,0,1} s i : Sum (difference) digit t i : Transfer digit w i : Intermediate sum (difference) That is, the transfer digit has the same meaning as carry or borrow in addition and subtraction of two's complement representation .

一般的な冗長2進数同士の加減算では伝達ディジットが
2桁まで伝播するが、(2)で述べたように演算数(加
数もしくは減数)を非負に限定すると伝達ディジットは
高々1桁しか伝播しない。従って上記の加減算は桁上げ
伝播がなく、演算数の桁数に無関係に一定時間で行え
る。
In addition and subtraction of redundant general binary numbers, a transmission digit propagates up to two digits, but if the operation number (addend or subtraction) is limited to non-negative as described in (2), the transmission digit propagates at most one digit. . Therefore, the above-mentioned addition and subtraction does not have carry propagation, and can be performed in a fixed time regardless of the number of digits of the operation number.

以上述べたように、本従来の除算器では、正規化された
符号なし2進同士のみしか除算できない。即ち被除数X,
除数Yが取り得る値の範囲は、表2のように制限され
る。
As described above, the conventional divider can divide only normalized unsigned binary. That is, the dividend X,
The range of values that the divisor Y can take is limited as shown in Table 2.

この値の範囲は浮動小数点表示数の仮数部の条件と合致
しており、実際このような制限の下での除 算は、特に浮動小数点表示数の仮数部同士の除算用に考
案されたものである。
The range of this value matches the condition of the mantissa part of the floating-point display number, and in practice, division under such restrictions is Arithmetic was designed specifically for the division of the mantissa parts of floating-point display numbers.

発明が解決しようとする課題 しかし上記のような構成では、例えば2つの補数表示さ
れた整数の被除数X、整数の除数Yが与えられたときに X÷Y=Z,余りR 但し、商Z,剰余Rは整数。商Zの小数点以下は切り捨て
られる。剰余Rの符号は問わない。
However, in the above configuration, for example, when two complemented integer dividends X and integer divisors Y are given, X ÷ Y = Z, remainder R where quotient Z, The remainder R is an integer. The fractional part of the quotient Z is truncated. The sign of the remainder R does not matter.

なる整数除算に適用することはできない。従来の除算器
を拡張して整数徐算を行おうとする場合、徐算前の被除
数X、除数Yの絶対値化及び正規化、徐算後の商Zの符
号,小数点位置の補数及び剰余Rの小数点位置の補正が
必要になる。結果として、除算器全体のハードウェア量
と計算時間が増大する。
Cannot be applied to integer division. When the conventional divider is expanded to perform integer division, absolute value and normalization of dividend X and divisor Y before division, sign of quotient Z after division, complement of decimal point position and remainder R It is necessary to correct the decimal point position of. As a result, the hardware amount and the calculation time of the entire divider increase.

本発明はかかる点に鑑み、セル配列方式による除算器で
正規化数同士の除算を含めて整数同士の除算をも演算で
きる除算器を提供することを目的とする。
In view of the above point, the present invention has an object to provide a divider that can also perform division of integers including division of normalized numbers by a divider using a cell array method.

課題を解決するための手段 上記の課題を解決するために請求項1および3記載の発
明は、正または負の2の補数表現の被除数を冗長2進数
へ変換する被除数変換器と、正規化された2の補数表現
の正または負の除数を冗長2進数へ変換する除数変換器
と、冗長2進表現された加数あるいは減数のMSBに対し
て3値{−1,0,1}をとることを許し加数あるいは減数
のMSB以外の各桁の取り得る値を2値{0,1}のみに限定
すると共に前記被除数変換器から出力された冗長2進数
と前記除数変換器から出力された冗長2進数との間で加
減算を行う初段の冗長2進加減算器と、冗長2進表現さ
れた加数あるいは減数のMSBに対して3値{−1,0,1}を
とることを許し加数あるいは減数のMSB以外の各桁の取
り得る値を2値{0,1}のみに限定すると共に前記除数
変換器から出力された冗長2進数と前段の冗長2進加減
算器からの出力を左へ1ビットシフトした冗長2進数と
の間で加減算を行う冗長2進加減算器を前記初段の冗長
2進加減算器の後にn段積み重ねた冗長2進加減算器配
列と、前段の前記冗長2進加減算器の演算結果及び除数
の符号より次段の冗長2進加減算器において加算もしく
は減算のいずれの演算を行うべきかを決定するとと共に
その段に対応する商の桁を決定する商決定用回路と、各
段における前記商決定用回路により決定された商の各桁
を合わせた冗長2進表現の商を2の補数表現へ変換する
商変換器と、最終段の前記冗長2進加減算器の演算結果
である冗長2進数を2の補数表現数へ変換する剰余変換
器とを備え、前記商決定用回路において、除数が正であ
るとき、甲が負なら−1、0なら0、正なら1を対応す
る商の桁の値とし、除数が負であるとき、甲が負なら
1、0なら0、正なら−1を対応する商の桁の値とする
判断を行うことを特徴とする除算器である。
Means for Solving the Problems In order to solve the above problems, the inventions according to claims 1 and 3 include a dividend converter for converting a dividend of a positive or negative two's complement representation into a redundant binary number, and a normalized dividend converter. And a divisor converter that converts a positive or negative divisor in 2's complement notation to a redundant binary number, and takes three values {−1,0,1} for the MSB of the addend or subtraction represented in redundant binary. The value that can be taken by each digit other than the MSB of the addend or the subtraction is limited to binary {0,1} and the redundant binary number output from the dividend converter and the output from the divisor converter A redundant binary adder / subtractor at the first stage that performs addition / subtraction with a redundant binary number, and allows addition of three values {−1,0,1} to the MSB of the addend or subtraction expressed in redundant binary. The possible values of each digit other than the MSB of a number or a divisor are limited to binary {0,1} and the divisor conversion is performed. The redundant binary adder / subtractor for performing addition / subtraction between the redundant binary number output from the above and the redundant binary number obtained by shifting the output from the preceding redundant binary adder / subtractor by 1 bit to the left is the redundant binary adder / subtractor of the first stage. Based on the redundant binary adder / subtractor array stacked n stages later and the operation result of the preceding redundant binary adder / subtractor and the sign of the divisor, whether the addition or subtraction operation should be performed in the redundant binary adder / subtractor of the next stage is performed. A quotient determining circuit for determining and determining the quotient digit corresponding to the stage, and a quotient in a redundant binary representation in which each digit of the quotient determined by the quotient determining circuit in each stage is combined into a two's complement representation. A quotient converter for converting into a quotient converter, and a residue converter for converting a redundant binary number, which is the operation result of the redundant binary adder / subtractor at the final stage, into a two's complement representation number. -1 if positive and negative instep , 0 if 0, positive if 1 is the value of the corresponding quotient digit, if the divisor is negative, if the instep A is 0, 0 if positive, -1 if positive, the corresponding quotient digit value It is a divider characterized by performing.

また請求項2および4記載の発明は、2の補数表現の正
規化された除数が負のときに除数の1の補数をとり負で
ないときに除数の値を素通りさせる1の補数器と、2の
補数表現の正または負の被除数を冗長2進数へ変換する
被除数変換器と、前記1の補数器からの出力を冗長2進
数へ変換する除数変換器と、冗長2進表現された加数あ
るいは減数の全桁の取り得る値を2値{0,1}のみに限
定すると共に前記被除数変換器から出力された冗長2進
数と前記除数変換器から出力され更に除数が負のときに
1を加えられた冗長2進数との間で加減算を行う初段の
冗長2進加減算器と、冗長2進表現された加数あるいは
減数の全桁の取り得る値を2値{0,1}のみに限定する
と共に前段の冗長2進加減算器からの出力を左へ1ビッ
トシフトした冗長2進数と前記除数変換器から出力され
更に除数が負のときに1を加えられた冗長2進数との間
で加減算を行う冗長2進加減算器を前記初段の冗長2進
加減算器の後にn段積み重ねた冗長2進加減算器配列
と、前記前段の冗長2進加減算器の演算結果より次段の
冗長2進加減算器において加算もしくは減算のいずれの
演算を行うべきかを決定すると共にその段に対応する商
の桁を決定する商決定用回路と、各段における前記商決
定用回路により決定された商の各桁を合わせて冗長2進
表現の商とし且つ除数が負の場合にこの商の符号を反転
し且つ冗長2進表現の商を2の補数表現数へ変換する商
変換器と、最終段の前記冗長2進加減算器の演算結果で
ある冗長2進数を2の補数表現数へ変換する剰余変換器
とを備え、前記商決定用回路において、甲が負なら−
1、0なら0、正なら1を対応する商の桁の値とする判
断を行うことを特徴とする除算器である。
Further, the inventions according to claims 2 and 4 include a one's complement calculator which takes the one's complement of the divisor when the normalized divisor of the two's complement expression is negative and allows the divisor value to pass through when the divisor is not negative; , A dividend converter for converting a positive or negative dividend of a complement expression of the above into a redundant binary number, a divisor converter for converting an output from the one's complement unit into a redundant binary number, and a redundant binary-added sum or The possible values of all digits of the divisor are limited to binary {0,1}, and the redundant binary number output from the dividend converter and 1 output from the divisor converter are added when the divisor is negative. The redundant binary adder / subtractor at the first stage that performs addition and subtraction with the redundant binary number that has been created, and the possible values of all digits of the redundant binary-added addend or subtraction are limited to binary {0,1} only. With the redundant binary, the output from the preceding redundant binary adder / subtractor is shifted to the left by 1 bit. And a redundant binary adder / subtractor for performing addition / subtraction between the redundant binary number output from the divisor converter and added with 1 when the divisor is negative, are stacked n stages after the first stage redundant binary adder / subtractor. Based on the redundant binary adder / subtractor array and the operation result of the preceding redundant binary adder / subtractor, it is determined whether addition or subtraction should be performed in the redundant binary adder / subtractor of the next stage, and the quotient corresponding to that stage is determined. Of the quotient determined by the quotient determining circuit in each stage is combined into a redundant binary representation quotient and the sign of the quotient is inverted when the divisor is negative. And a quotient converter for converting the quotient of the redundant binary representation into a two's complement representation number, and a residue conversion for converting the redundant binary number which is the operation result of the redundant binary adder / subtractor at the final stage into the two's complement representation number. In the quotient decision circuit, If the negative -
The divider is characterized by making a determination that the value of the digit of the quotient is 0 if 1 or 0 and 1 if positive.

作用 上記した手段により、請求項1記載の発明は、冗長2進
加減算器を、冗長2進表現された加数あるいは減数のMS
Bに対して3値{−1,0,1}をとることを許し加数あるい
は減数のMSB以外の各桁の取り得る値を2進{0,1}のみ
に限定するように改良したことと、商決定用回路におい
て、除数が正であるとき、甲が負なら−1、0なら0、
正なら1を対応する商の桁の値とし、除数が負であると
き、甲が負なら1、0なら0、正なら−1を対応する商
の桁の値とする判断を行うことにより、被除数に対して
任意の2の補数表現された整数を許し、除数に対して負
の数を許すことが可能である。
With the above-mentioned means, the invention according to claim 1 is configured such that the redundant binary adder / subtractor is used as a redundant binary representation of an addend or a subtraction MS.
Allowed to take three values {−1,0,1} for B, and improved so that the possible values of each digit other than MSB of addend or subtraction are limited to binary {0,1} And in the quotient decision circuit, when the divisor is positive, if the instep is negative, it is -1, if 0, 0,
If it is positive, 1 is taken as the value of the corresponding quotient digit, and when the divisor is negative, it is determined that if the instep A is negative, 0 is 0, if positive, -1 is the corresponding quotient digit value. It is possible to allow any two's complement represented integer for the dividend and negative numbers for the divisor.

請求項3記載の発明は、更に正規化器と商バレルシフタ
と剰余バレルシフタとを設けることにより、請求項1記
載の発明に加えて除数に対しても任意の2の補数表現さ
れた整数を許すことが可能である。
According to the invention described in claim 3, by further providing a normalizer, a quotient barrel shifter and a remainder barrel shifter, in addition to the invention described in claim 1, an integer represented by any two's complement is allowed for the divisor. Is possible.

請求項2記載の発明は、1の補数器と、冗長2進表現さ
れた加数あるいは減数の全桁の取り得る値を2値{0,
1}のみに限定すると共に前記被除数変換器から出力さ
れた冗長2進数と前記除数変換器から出力され更に除数
が負のときに1を加えられた冗長2進数との間で加減算
を行う冗長2進加減算器と、除数が負の場合に冗長2進
表現された商の符号を反転する商変換器とを設けること
により、被除数に対して任意の2の補数表現された整数
を許し、除数に対して負の数を許すことが可能である。
According to the second aspect of the present invention, the value that can be taken by the one's complementer and all the digits of the addend or the subtraction represented by the redundant binary is represented by the binary value {0,
Redundant 2 which is limited to only 1} and which performs addition and subtraction between the redundant binary number output from the dividend converter and the redundant binary number output from the divisor converter and added with 1 when the divisor is negative. By providing an adder-subtractor and a quotient converter that inverts the sign of the quotient represented in the redundant binary form when the divisor is negative, any two's complement represented integer is allowed for the dividend, and the divisor is On the other hand, it is possible to allow negative numbers.

請求項4記載の発明は、更に正規化器と商バレルシフタ
と剰余バレルシフタとを設けることにより、請求項2記
載の発明に加えて除数に対しても任意の2の補数表現さ
れた整数を許すことが可能である。
The invention according to claim 4 further includes a normalizer, a quotient barrel shifter, and a remainder barrel shifter, thereby allowing an integer represented by any two's complement to the divisor in addition to the invention according to claim 2. Is possible.

実 施 例 以下本発明の4つの実施例の除算器について、図面を参
照しながら説明する。
Examples Hereinafter, dividers according to four examples of the present invention will be described with reference to the drawings.

第1の実施例は本発明において請求項1記載の除算器の
構成例である。第1図は同実施例におけるn=6のとき
の除算器のブロック構成図である。同図において1は正
規化された2の補数表現の正または負の除数を冗長2進
数へ変換する除数変換器、2は正または負の2の補数表
現の被除数を冗長2進数へ変換する被除数変換器、3は
冗長2進同士の加算または減算を行う冗長2進加減算
器、4は対応する段の冗長2進加減算器3において加算
もしくは減算のいずれの演算を行うべきかを決定すると
共にその段に対応する商の桁を決定する商決定用回路、
5は冗長2進表現の商を2の補数表現へ変換する商変換
器、6は最終段の前記冗長2進加減算器3の演算結果で
ある冗長2進数を2の補数表現数へ変換する剰余変換器
である。
The first embodiment is a configuration example of the divider according to the first aspect of the present invention. FIG. 1 is a block diagram of the divider when n = 6 in the embodiment. In the figure, 1 is a divisor converter for converting a positive or negative divisor of a normalized 2's complement representation into a redundant binary number, and 2 is a dividend for converting a dividend of a positive or negative 2's complement representation into a redundant binary number. A converter 3 is a redundant binary adder / subtractor for performing addition or subtraction between redundant binary codes, and a reference numeral 4 is for determining whether addition or subtraction should be performed in the redundant binary adder / subtractor 3 of the corresponding stage. A quotient determination circuit for determining the quotient digit corresponding to the stage,
5 is a quotient converter for converting the quotient of the redundant binary representation into 2's complement representation, and 6 is a remainder for converting the redundant binary number which is the operation result of the redundant binary adder / subtractor 3 in the final stage into the 2's complement representation number. It is a converter.

以上のように構成された本実施例の除算器について、以
下にその原理と動作を説明する。
The principle and operation of the divider of this embodiment configured as above will be described below.

本実施例の除算器に対して2の補数表現の被除数Xと除
数Yが与えられており、除数Yはあらかじめ正規化され
ているとする。初めに、被除数Xと除数Yはそれぞれ被
除数変換器2と除数変換器1により冗長2進数R(0)とD
へ変換される。
It is assumed that the dividend X and the divisor Y in the two's complement representation are given to the divider of this embodiment, and the divisor Y is normalized in advance. First, dividend X and divisor Y are redundant binary numbers R (0) and D by dividend converter 2 and divisor converter 1, respectively.
Is converted to.

ここで2の補数表現から冗長2進表現への変換規則を次
に示す。
Here, the conversion rule from 2's complement representation to redundant binary representation is shown below.

<2の補数表現から冗長2進表現への変換規則> [X]2C=[xS.x1x2…xn2C [X]SD2←[X]2C とすると、 [X]SD2=[S.x1x2…xnSD2 ここで、←は数表現の変換を表し、 =1 if xS=0 =0 if xS=1 である。即ち2の補数表現から冗長2進表現への変換
は、符号ビット(MSB)の符号を反転させるだけでよ
い。
<Conversion rule from 2's complement representation to redundant binary representation> [X] 2C = [x S. x 1 x 2 ... x n ] 2C [X] SD2 ← [X] 2C , then [X] SD2 = [ S. x 1 x 2 ... x n ] SD2 Here, ← represents a conversion of a numerical expression, and S = 1 if x S = 0 = 0 if x S = 1. That is, the conversion from the two's complement representation to the redundant binary representation only needs to invert the sign of the sign bit (MSB).

次にR(0)は初段の冗長2進加減算器に対する被演算数
(被加数もしくは被減数)として入力され、Dは第1図
に示すように冗長2進加減算器に対する演算数(加数も
しくは減数)として各段の冗長2進加減算器3に一斉に
供給される。各段の冗長2進加減算器3では、その段に
対応する商決定用回路4の判断に従って加算または減算
のいずれかが行われる。
Next, R (0) is input as an operand to the redundant binary adder / subtractor at the first stage (augend or subtraction), and D is an operand to the redundant binary adder / subtractor (addend or addend) as shown in FIG. It is simultaneously supplied to the redundant binary adder / subtractor 3 of each stage as a subtraction). In the redundant binary adder / subtractor 3 of each stage, either addition or subtraction is performed according to the judgment of the quotient determination circuit 4 corresponding to that stage.

本実施例における冗長2進加減算器3では、負の除数に
対処するためMSBの冗長2進加減算器セルに対してだけ
計算規則を拡張している。MSBの冗長2進加減算器セル
に対する計算規則を表5,6に掲げる。この計算規則では
伝達ディジットに関する規則性が乱れているが、この冗
長2進加減算器セルはMSBにあるのでその桁上げがそれ
以上上位に伝播することはない。
In the redundant binary adder / subtractor 3 in this embodiment, the calculation rule is extended only to the redundant binary adder / subtractor cell of the MSB in order to deal with the negative divisor. The calculation rules for the redundant binary adder / subtractor cells of the MSB are listed in Tables 5 and 6. In this calculation rule, the regularity of the transmission digit is disturbed, but since this redundant binary adder / subtractor cell is in the MSB, its carry cannot be propagated higher.

商決定用回路4は前段の冗長2進加減算器3の演算結果
の上位3桁及び除数Yの符号を見てその段の演算及び商
の桁の値を決定する。n段すべてに対応する商と第(n
+1)段の冗長2進加減算器3の演算結果が求められる
と、冗長2進表現の商と剰余が計算結果として得られ
る。冗長2進表現の商は商変換器5により、剰余は剰余
変換器6によりそれぞれ2の補数表現数へ変換される。
The quotient determining circuit 4 determines the value of the digit of the operation and quotient at that stage by looking at the upper 3 digits of the operation result of the redundant binary adder / subtractor 3 at the preceding stage and the sign of the divisor Y. The quotient corresponding to all n stages and the (n
When the operation result of the +1) stage redundant binary adder / subtractor 3 is obtained, the quotient and the remainder of the redundant binary representation are obtained as the calculation result. The quotient of the redundant binary representation is converted by the quotient converter 5 and the remainder is converted by the remainder converter 6 into a two's complement representation number.

以上で述べた処理の内容と商決定用回路における演算と
商決定のアルゴリズムを下のようにまとめる。
The contents of the processing described above and the calculation and quotient decision algorithm in the quotient decision circuit are summarized as follows.

<第1の実施例の除算アルゴリズム> ステップ1 [R(0)SD2←[X]2C [D]SD2←[Y]2C ステップ2 ステップ3 ステップ4 Q:=[q0.q1q2…qnSD2 [Z]2C←[Q]SD2 [R]2C←[R(n+1)SD2 第2の実施例は本発明において請求項2記載の除算器の
構成例である。第2図は同実施例におけるn=6のとき
の除算器のブロック構成図である。同図において1は正
規化された2の補数表現の正または負の除数を冗長2進
数へ変換する除数変換器、2は正または負の2の補数表
現の被除数を冗長2進数へ変換する被除数変換器、3は
冗長2進同士の加算または減算を行う冗長2進加減算
器、4は対応する段の冗長2進加減算器において加算も
しくは減算のいずれの演算を行うべきかを決定すると共
にその段に対応する商の桁を決定する商決定用回路、5
は商決定用回路4で得られた商の符号の補正を行うと共
に冗長2進表現の商を2の補数表現数へ変換する商変換
器、6は最終段の前記冗長2進加減算器の演算結果であ
る冗長2進数を2の補数表現数へ変換する剰余変換器で
ある。
<Division algorithm of the first embodiment> Step 1 [R (0) ] SD2 ← [X] 2C [D] SD2 ← [Y] 2C Step 2 Step 3 Step 4 Q: = [q 0. q 1 q 2 … q n ] SD2 [Z] 2C ← [Q] SD2 [R] 2C ← [R (n + 1) ] SD2 The second embodiment is a configuration example of the divider according to the second aspect of the present invention. FIG. 2 is a block diagram of the divider when n = 6 in the embodiment. In the figure, 1 is a divisor converter for converting a positive or negative divisor of a normalized 2's complement representation into a redundant binary number, and 2 is a dividend for converting a dividend of a positive or negative 2's complement representation into a redundant binary number. A converter 3, a redundant binary adder / subtractor for performing addition or subtraction between redundant binary numbers, and 4 determines whether addition or subtraction should be performed in the redundant binary adder / subtractor of the corresponding stage, and the stage Quotient decision circuit for deciding the digit of the quotient corresponding to
Is a quotient converter for correcting the sign of the quotient obtained by the quotient determination circuit 4 and for converting the quotient of the redundant binary representation into a two's complement representation number; 6 is the operation of the redundant binary adder / subtractor at the final stage It is a remainder converter for converting the resulting redundant binary number into a two's complement representation number.

以上のように構成された本実施例の除算器について、以
下にその原理と動作を説明する。
The principle and operation of the divider of this embodiment configured as above will be described below.

本実施例の除算器に対して2の補数表現の被除数Xと除
数Yが与えられており、除数Yはあらかじめ正規化され
ているとする。初めに、除数Yは1の補数器によりもし
Yが負の場合Yの1の補数に変換される。被除数Xと1
の補数器の出力はそれぞれ被除数変換器2と除数変換器
1により冗長2進数R(0)とDへ変換される。次にR(0)
初段の冗長2進加減算器に対する被演算数(被加数もし
くは被減数)として入力され、Dは第1図に示すように
冗長2進加減算器に対する演算数(加数もしくは減数)
として各段の冗長2進加減算器3に一斉に供給される。
各段の冗長2進加減算器3では、その段に対応する商決
定用回路4の判断に従って加算または減算のいずれかが
行われる。
It is assumed that the dividend X and the divisor Y in the two's complement representation are given to the divider of this embodiment, and the divisor Y is normalized in advance. First, the divisor Y is converted to a one's complement of Y if Y is negative by a one's complement calculator. Dividend X and 1
The outputs of the complement units of the above are converted into redundant binary numbers R (0) and D by the dividend converter 2 and the divisor converter 1, respectively. Next, R (0) is input as an operand to the redundant binary adder / subtractor at the first stage (augend or subtraction), and D is an operand to the redundant binary adder / subtractor (addend or addend) as shown in FIG. Reduction)
Are simultaneously supplied to the redundant binary adder / subtractor 3 of each stage.
In the redundant binary adder / subtractor 3 of each stage, either addition or subtraction is performed according to the judgment of the quotient determination circuit 4 corresponding to that stage.

ここで、もし除数Yが負であった場合、既に除数Yは1
の補数に変換されているので、これを除数Yの2の補数
に変換するためDに対して1を加えるという補正を行
う。この補正は各段の冗長2進加減算器3で加減算を行
うときに、同時に行う。表9,10に示すようにこの補正
は、各段の冗長2進加減算器3のLSBにおける計算規則
を修正することにより実現されている。このようにLSB
の計算規則を修正しても、LSBより下位からの桁上げ
(伝達ディジット)はないので、LSBから上位側へ桁上
げ伝播が発生することはない。
Here, if the divisor Y is negative, the divisor Y is already 1
Since it has been converted into the complement of, the correction of adding 1 to D is performed in order to convert this into the complement of 2 of the divisor Y. This correction is simultaneously performed when the redundant binary adder / subtractor 3 in each stage performs addition / subtraction. As shown in Tables 9 and 10, this correction is realized by modifying the calculation rule in the LSB of the redundant binary adder / subtractor 3 in each stage. Like this LSB
Even if the calculation rule of is modified, carry does not occur from the lower part of the LSB (transmission digit), so carry propagation from the LSB to the upper part does not occur.

商決定用回路4は前段の冗長2進加減算器3の演算結果
の上位3桁を見てその段の演算及び商の桁の値を決定す
る。n段すべてに対応する商と第(n+1)段の冗長2
進加減算器3の演算結果が求められると、冗長2進表現
の商と剰余が計算結果として得られる。冗長2進表現の
商は商変換器5により、剰余は剰余変換器6によりそれ
ぞれ2の補数表現数へ変換される。本実施例では商変換
器5において商の符号に関する補正も行う。
The quotient determining circuit 4 looks at the upper 3 digits of the operation result of the redundant binary adder / subtractor 3 in the preceding stage and determines the value of the operation and quotient digit of that stage. The quotient corresponding to all n stages and the redundancy of the (n + 1) th stage 2
When the operation result of the adder-subtractor 3 is obtained, the quotient and the remainder of the redundant binary representation are obtained as the calculation result. The quotient of the redundant binary representation is converted by the quotient converter 5 and the remainder is converted by the remainder converter 6 into a two's complement representation number. In this embodiment, the quotient converter 5 also corrects the quotient code.

これは、先に除数の絶対値をとったため、除数が負の場
合に商の符号が反転してしまうためである。よって、除
数が負の場合は商の符号を反転させればよい。これは商
変換器5において冗長2進表現の商を2の補数表現数へ
変換するときに行う減算で、被減算を交換することによ
り実現できる。商変換器5における商変換のアルゴリズ
ムを、表12に掲げる。
This is because the absolute value of the divisor is taken first, so that the sign of the quotient is inverted when the divisor is negative. Therefore, if the divisor is negative, the sign of the quotient may be inverted. This is a subtraction performed when the quotient of the redundant binary representation is converted into the number of 2's complement representation in the quotient converter 5, and can be realized by exchanging the subtracted numbers. Table 12 shows the quotient conversion algorithm in the quotient converter 5.

以上で述べた処理の内容と商決定用回路における演算と
商決定のアルゴリズムを下のようにまとめる。
The contents of the processing described above and the calculation and quotient decision algorithm in the quotient decision circuit are summarized as follows.

<第2の実施例の除算アルゴリズム> ステップ1 [R(0)SD2←[X]2C if Y>0then [D]SD2←[Y]2C else [D]SD2←[]2C ステップ2 ステップ3 ステップ4 Q:=[q0.q1q2…qnSD2 if Y>0then [Z]2C←[Q]SD2 else [Z]2C←[−Q]SD2 [R]2C←[R(n+1)SD2 ここで、はYの1の補数、即ち各桁のビットを反転さ
せた数値を示す。修正されたステップ2を表11に、第2
の実施例の商変換器の動作表を表12に掲げる。
<Division algorithm of the second embodiment> Step 1 [R (0) ] SD2 ← [X] 2C if Y> 0then [D] SD2 ← [Y] 2C else [D] SD2 ← [] 2C Step 2 Step 3 Step 4 Q: = [q 0. q 1 q 2 … q n ] SD2 if Y> 0then [Z] 2C ← [Q] SD2 else [Z] 2C ← [−Q] SD2 [R] 2C ← [R ( n + 1) ] SD2 Here, represents the one's complement of Y, that is, the numerical value obtained by inverting the bit of each digit. Table 11 shows the modified Step 2
Table 12 shows an operation table of the quotient converter of the embodiment.

上第1,2の実施例で演算結果の剰余の符号を問わないの
は、除算器を含む演算処理装置全体の規格の都合により
それが左右されることが多いからである。
The sign of the remainder of the operation result does not matter in the first and second embodiments because it is often influenced by the standard of the entire operation processing device including the divider.

以上のように第1,2の実施例によれば、被除数として2
の補数表現数を直接演算することが可能となる。更に除
数についても負の数を演算することができるので、本実
施例の除算を行う前処理としては、除数を本実施例の除
算器へ入力される前に正規化するだけで済むという効果
を有する。また本実施例の除算器では被除数のビット長
は2nだから、整数除算の内、 (2nビット)÷(nビット) =(nビット) 余り(nビット) のような倍精度の除算を行っていることになる。
As described above, according to the first and second embodiments, the dividend is 2
It is possible to directly calculate the complement expression number of. Further, since it is possible to calculate a negative number for the divisor, the effect of only normalizing the divisor before it is input to the divider of the present embodiment is provided as preprocessing for performing the division of the present embodiment. Have. In the divider of this embodiment, since the bit length of the dividend is 2n, a double precision division such as (2n bits) ÷ (n bits) = (n bits) remainder (n bits) is performed in integer division. Will be there.

単精度除算 (nビット)÷(nビット) =(nビット) 余り(nビット) を行う場合、単にnビットの被除数を2nビットに符号拡
張すればよい。
Single-precision division (n bits) / (n bits) = (n bits) When performing the remainder (n bits), the n-bit dividend is simply sign-extended to 2n bits.

第3の実施例は本発明において請求項3記載の除算器の
構成例である。
The third embodiment is a configuration example of the divider according to the third aspect of the present invention.

第3図は同実施例における除算器のブロック構成図であ
る。同図において、8は除数の正規化器、9は第1の実
施例の除算器、10は商バレルシフタ、11は剰余バレルシ
フタである。正規化器8は例えば、除数のMSBの右隣の
ビットから右向きに探索して最初にMSBと異なるビット
の位置を見つけるプライオリティエンコーダと、それに
より数えたビット数分だけ除数を左へシフトするバレル
シフタより構成される。
FIG. 3 is a block diagram of the divider in the embodiment. In the figure, 8 is a divisor normalizer, 9 is the divider of the first embodiment, 10 is a quotient barrel shifter, and 11 is a remainder barrel shifter. The normalizer 8 is, for example, a priority encoder that searches rightward from the right adjacent bit of the MSB of the divisor to find the position of a bit different from the MSB first, and a barrel shifter that shifts the divisor to the left by the number of bits counted by the priority encoder. It is composed of

第3の実施例の除算器の原理は第1の実施例と同じであ
る。以下に第3の実施例の動作を説明する。
The principle of the divider of the third embodiment is the same as that of the first embodiment. The operation of the third embodiment will be described below.

(1)除数Yを正規化する。(1) Normalize the divisor Y.

(2)第1の実施例による除算を実行し、仮の商Zと仮
の剰余Rを求める。
(2) The division according to the first embodiment is executed to obtain the temporary quotient Z and the temporary remainder R.

(3)得られた商Zの小数点正しい位置まで移動する。
除数Yを正規化したときのシフト数より商の小数点の移
動量、即ちシフト数を求める。
(3) Move to the position where the decimal point of the obtained quotient Z is correct.
The shift amount of the quotient of the quotient, that is, the shift number is obtained from the shift number when the divisor Y is normalized.

(4)得られた剰余Rの小数点を正しい位置まで移動す
る。このときのシフト数は(3)のそれと同じである。
(4) Move the decimal point of the obtained remainder R to the correct position. The number of shifts at this time is the same as that of (3).

上記のようにして第1の実施例の除算器による除算の前
処理として除数を正規化し、後処理として商と剰余を補
正することにより、任意の2の補数表示数を除数として
許している。第6図に本実施例における除算ステップの
動作の流れを説明する流れ図を掲げる。
As described above, the divisor is normalized as the pre-processing of the division by the divider of the first embodiment, and the quotient and the remainder are corrected as the post-processing to allow the arbitrary two's complement display number as the divisor. FIG. 6 is a flow chart for explaining the operation flow of the division step in this embodiment.

第4の実施例は本発明において請求項4記載の除算器の
構成例である。第4図は同実施例における除算器のブロ
ック構成図である。同図において、7は1の補数器、8
は正規化器、10は商バレルシフタ、11は剰余バレルシフ
タ、12は第2の実施例の除算器から1の補数器を除いた
除算器である。正規化器8は例えば、除数のMSBの右隣
のビットから右向きに探索して最初にMSBと異なるビッ
トの位置を見つけるプライオリティエンコーダと、それ
により数えたビット数分だけ除数を左へシフトするバレ
ルシフタより構成される。
The fourth embodiment is a configuration example of the divider according to the fourth aspect of the present invention. FIG. 4 is a block diagram of the divider in the same embodiment. In the figure, 7 is a one's complementer, 8
Is a normalizer, 10 is a quotient barrel shifter, 11 is a remainder barrel shifter, and 12 is a divider obtained by removing the 1's complement unit from the divider of the second embodiment. The normalizer 8 is, for example, a priority encoder that searches rightward from the right adjacent bit of the MSB of the divisor to find the position of a bit different from the MSB first, and a barrel shifter that shifts the divisor to the left by the number of bits counted by the priority encoder. It is composed of

第4の実施例の除算器の原理は第2の実施例と同じであ
る。以下に第4の実施例の動作を説明する。
The principle of the divider of the fourth embodiment is the same as that of the second embodiment. The operation of the fourth embodiment will be described below.

(1)除数Yがもし負の場合、Yの1の補数をとる。(1) If the divisor Y is negative, take the 1's complement of Y.

(2)除数Yを正規化する。(2) Normalize the divisor Y.

(3)第2の実施例に従った除算を実行し(但しYの1
の補数をとることは除く)、仮の商Zと仮の剰余Rを求
める。
(3) Perform division according to the second embodiment (provided that 1 of Y
, Except that the temporary quotient Z and the temporary remainder R are obtained.

(4)得られた商Zの小数点を正しい位置まで移動す
る。除数Yを正規化したときのシフト数より商の小数点
の移動量、即ちシフト数を求める。同時に除数Yが負の
場合、商Zの符号を反転させる。
(4) Move the decimal point of the obtained quotient Z to the correct position. The shift amount of the quotient of the quotient, that is, the shift number is obtained from the shift number when the divisor Y is normalized. At the same time, when the divisor Y is negative, the sign of the quotient Z is inverted.

(5)得られた剰余Rの小数点を正しい位置まで移動す
る。このときのシフト数は(4)のそれと同じである。
(5) Move the decimal point of the obtained remainder R to the correct position. The number of shifts at this time is the same as that of (4).

上記のようにして第2の実施例の除算器による除算の前
後において除数を補正することにより、任意の2の補数
表示数を除数として許している。第7図に本実施例にお
ける除算ステップの動作の流れを説明する流れ図を掲げ
る。
By correcting the divisor before and after the division by the divider of the second embodiment as described above, any two's complement display number is allowed as the divisor. FIG. 7 is a flow chart for explaining the operation flow of the division step in this embodiment.

以上説明したように、第3,4の実施例の除算器より符号
なし2進数及び2の補数表示数、正規化数及び非正規化
数、倍精度整数及び単精度整数のいずれの数表現による
除算も可能となる。第3,4の実施例の除算器が例えば演
算処理装置の一部として組み込まれた場合、整数の除算
器及び浮動小数点演算器の仮数部の除算器の両方の働き
をさせることができる。従って、ほとんどハードフェア
量を増加させることなく、整数除算と浮動小数点除算の
両方を高速化することが可能である。なおこの実現方法
の場合、第1,2の実施例の除算器に対する除数入力を正
規化器と既に正規化された仮数のいずれかから選択でき
るようにして仮数が正規化器を通らないようにすること
により、 浮動小数点除算の実行時間を更に高速化することもでき
る。
As described above, by the divider of the third and fourth embodiments, the unsigned binary number, the two's complement number, the normalized number and the denormalized number, the double-precision integer and the single-precision integer are represented. Division is also possible. When the divider of the third and fourth embodiments is incorporated, for example, as a part of the arithmetic processing unit, it can function as both an integer divider and a mantissa divider of a floating point arithmetic unit. Therefore, it is possible to speed up both integer division and floating-point division without increasing the amount of hardware. In the case of this implementation method, the divisor input to the divider of the first and second embodiments can be selected from either the normalizer or the already-normalized mantissa so that the mantissa does not pass through the normalizer. By doing The execution time of floating point division can be further speeded up.

表13の4つの実施例により取り扱える演算数の範囲の拡
張に関する効果をまとめた。
The effects of expanding the range of the number of operations that can be handled by the four examples in Table 13 are summarized.

発明の効果 以上説明したように、本発明では、冗長2進加減算器に
供給する冗長2進数の一部あるいは全部の桁の取り得る
値を2値{0,1}のみに限定することにより、直接2の
補数表現数同士を除算することが可能となる。従って整
数(固定小数点数)同士を直接除算できる。従来、正規
化された正数のみしか除算できなかったので、誤除算器
を浮動小数点除算にしか適用できなかったが、本発明の
除算器は整数(固定小数点数)と浮動小数点の両方の除
算に適用できる。
EFFECTS OF THE INVENTION As described above, according to the present invention, by limiting the possible values of some or all digits of the redundant binary number supplied to the redundant binary adder / subtractor to binary {0,1}, It is possible to directly divide two's complement representation numbers. Therefore, integers (fixed point numbers) can be directly divided. In the past, since only normalized positive numbers could be divided, the mis-divider could only be applied to floating point division, but the divider of the present invention divides both integer (fixed point number) and floating point numbers. Applicable to

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

第1図は本発明の第1の実施例における除算器のブロッ
ク図、第2図は本発明の第2の実施例における除算器の
ブロック図、第3図は本発明の第3の実施例における除
算器のブロック図、第4図は本発明の第4の実施例にお
ける除算器のブロック図、第5図は従来の除算器のブロ
ック図、第6図は本発明の第3の実施例における除算ス
テップの動作の流れを示す流れ図、第7図は本発明の第
4の実施例における除算ステップの動作の流れを示す流
れ図である。 1……除数変換器、2……被除数変換器、3……冗長2
進加減算器、4……商決定用回路、5……商変換器、6
……剰余変換器、7……1の補数器、8……正規化器、
9……第1の実施例の除算器、10……商バレルシフタ、
11……剰余バレルシフタ、12……第2の実施例の除算器
から1の補数器を除いた除算器
FIG. 1 is a block diagram of a divider according to the first embodiment of the present invention, FIG. 2 is a block diagram of a divider according to the second embodiment of the present invention, and FIG. 3 is a third embodiment of the present invention. 4 is a block diagram of a divider in FIG. 4, FIG. 4 is a block diagram of a divider in a fourth embodiment of the present invention, FIG. 5 is a block diagram of a conventional divider, and FIG. 6 is a third embodiment of the present invention. 7 is a flowchart showing the operation flow of the division step in FIG. 7, and FIG. 7 is a flowchart showing the operation flow of the division step in the fourth embodiment of the present invention. 1 ... Divisor converter, 2 ... Dividend converter, 3 ... Redundancy 2
Addition / subtraction device, 4 ... Quotation determination circuit, 5 ... Quotation converter, 6
... Residue converter, 7 ... 1's complementer, 8 ... normalizer,
9 ... Divider of the first embodiment, 10 ... Quartz barrel shifter,
11 ... remainder barrel shifter, 12 ... divider obtained by removing the 1's complement unit from the divider of the second embodiment

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】nを除数のビット長として、正または負の
2の補数表現の被除数を基数が2で各桁が{−1,0,1}
のいずれかの要素で表される冗長性を持った符号付きデ
ィジット数(以下冗長2進数と呼ぶ)へ変換する被除数
変換器と、絶対値を1/2から1の間に納められた(以下
正規化されたと略す)2の補数表現の正または負の除数
を冗長2進数へ変換する除数変換器と、冗長2進表現さ
れた加数あるいは減数の最上位ビット(以下MSBと略
す)に対して3値{−1,0,1}をとることを許し加数あ
るいは減数のMSB以外の各桁の取り得る値を2進{0,1}
のみに限定すると共に前記被除数変換器から出力された
冗長2進数と前記除数変換器から出力された冗長2進数
との間で加減算を行う初段の冗長2進加減算器と、冗長
2進表現された加数あるいは減数のMSBに対して3値
{−1,0,1}をとることを許し加数あるいは減数のMSB以
外の各桁の取り得る値を2値{0,1}のみに限定すると
共に前記除数変換器から出力された冗長2進数と前段の
冗長2進加減算器からの出力を左へ1ビットシフトした
冗長2進数との間で加減算を行う冗長2進加減算器を前
記初段の冗長2進加減算器の後にn段積み重ねた冗長2
進加減算器配列と、被除数の値もしくは前段の前記冗長
2進加減算器の演算結果及び除数の符号より対応する段
の冗長2進加減算器において加算もしくは減算のいずれ
の演算を行うべきかを決定すると共にその段に対応する
商の桁を決定する商決定用回路と、各段における前記商
決定用回路により決定された商の各桁を合わせた冗長2
進表現の商を2の補数表現数へ変換する商変換器と、最
終段の前記冗長2進加減算器の演算結果である冗長2進
数を2の補数表現数へ変換する剰余変換器とを備え、前
記商決定用回路において、除数が正であるとき、初段の
前記冗長2進加減算器では被除数の上位3ビット、また
初段より後の前記冗長2進加減算器では前段の冗長2進
加減算器の演算結果の上位3ビット(以下甲と略す)が
負なら−1、0なら0、正なら1を対応する商の桁の値
とし、除数が負であるとき、甲が負なら1、0なら0、
正なら−1を対応する商の桁の値とする判断を行うこと
を特徴とする除算器。
1. A dividend of a positive or negative two's complement representation, where n is a bit length of the divisor, has a radix of 2 and each digit is {−1,0,1}.
A dividend convertor for converting into a signed digit number with redundancy (hereinafter referred to as redundant binary number) represented by any of the elements, and the absolute value is stored between 1/2 and 1 (hereinafter For a divisor converter that converts a positive or negative divisor in 2's complement notation into a redundant binary number, and the most significant bit (abbreviated as MSB below) of the addend or subtraction in redundant binary representation. Allowed to take three values {−1,0,1} and the binary value of the possible value of each digit other than the MSB of the addend or subtraction is {0,1}.
And a redundant binary adder / subtractor at the first stage for performing addition / subtraction between the redundant binary number output from the dividend converter and the redundant binary number output from the divisor converter, and a redundant binary representation. Allows three values {−1,0,1} for the addend or subtraction MSB and limits the possible values of each digit other than the addend or subtraction MSB to only binary {0,1} A redundant binary adder / subtractor for performing addition / subtraction between the redundant binary number output from the divisor converter and the redundant binary number obtained by shifting the output from the preceding redundant binary adder / subtractor by 1 bit to the left is a redundant binary adder / subtractor at the first stage. Redundant 2 stacked n stages after the binary adder / subtractor
The addition / subtraction operation is performed by the redundant addition / subtraction device array, the value of the dividend or the operation result of the redundant binary addition / subtraction device in the preceding stage and the sign of the divisor to determine whether addition or subtraction should be performed in the corresponding redundant binary addition / subtraction device. Also, a quotient determining circuit that determines the quotient digit corresponding to the stage and a redundancy 2 that combines each digit of the quotient determined by the quotient determining circuit in each stage
A quotient converter for converting a quotient of a binary expression into a two's complement expression number, and a residue converter for converting a redundant binary number which is the operation result of the redundant binary adder / subtractor at the final stage into a two's complement expression number In the quotient determination circuit, when the divisor is positive, the redundant binary adder / subtractor at the first stage has the upper 3 bits of the dividend, and the redundant binary adder / subtractor after the first stage has the redundant binary adder / subtractor at the preceding stage. If the upper 3 bits (abbreviated as "A") of the operation result are negative, -1, if 0, 1 is taken as the value of the corresponding quotient digit. If the divisor is negative, if A is negative, then 1 0,
If positive, a divider that makes a decision that -1 is the value of the corresponding quotient digit.
【請求項2】2の補数表現の正規化された除数が負のと
きに除数の1の補数をとり負でないときに除数の値を素
通りさせる1の補正器と、2の補数表現の正または負の
被除数を冗長2進数へ変換する被除数変換器と、前記1
の補数器からの出力を冗長2進数へ変換する除数変換器
と、冗長2進表現された加数あるいは減数の全桁の取り
得る値を2値{0,1}のみに限定すると共に前記被除数
変換器から出力された冗長2進数と前記除数変換器から
出力され更に除数が負のときに1に加えられた冗長2進
数との間で加減算を行う初段の冗長2進加減算器と、冗
長2進表現された加数あるいは減数の全桁の取り得る値
を2値{0,1}のみに限定すると共に前段の冗長2進加
減算器からの出力を左へ1ビットシフトした冗長2進と
前記除数変換器から出力され更に除数が負のときに1を
加えられた冗長2進数との間で加減算を行う冗長2進加
減算器を前記初段の冗長2進加減算器の後にn段積み重
ねた冗長2進加減算器配列と、被除数の値もしくは前記
前段の冗長2進加減算器の演算結果より対応する段の冗
長2進加減算器において加算もしくは減算のいずれの演
算を行うべきかを決定すると共にその段に対応する商の
桁を決定する商決定用回路と、各段における前記商決定
用回路により決定された商の各桁を合わせて冗長2進表
現の商とし且つ除数が負の場合にこの商の符号を反転し
且つ冗長2進表現の商を2の補数表現数へ変換する商変
換器と、最終段の前記冗長2進加減算器の演算結果であ
る冗長2進数を2の補数表現数へ変換する剰余変換器と
を備え、前記商決定用回路において、甲が負なら−1、
0なら0、正なら1を対応する商の桁の値とする判断を
行うことを特徴とする除算器。
2. A one-corrector for taking the one's complement of the divisor when the normalized divisor of the two's complement expression is negative and passing the divisor value through when it is not negative, and a positive or two-complement expression. A dividend converter for converting a negative dividend into a redundant binary number;
And a divisor converter for converting the output from the complementer of the above into a redundant binary number, limiting the possible values of all digits of the redundant binary representation of the addend or subtraction to binary {0,1} and A redundant binary adder / subtractor at the first stage for performing addition and subtraction between the redundant binary number output from the converter and the redundant binary number output from the divisor converter and further added to 1 when the divisor is negative; The possible values of all digits of the addend or the subtraction expressed in binary are limited to binary {0,1}, and the output from the redundant binary adder / subtractor at the preceding stage is shifted to the left by one bit and the redundant binary A redundant binary adder / subtractor for adding / subtracting to / from the redundant binary number output from the divisor converter and added with 1 when the divisor is negative is redundant 2 in which n stages are stacked after the redundant binary adder / subtractor at the first stage. Array of adder / subtractor and value of dividend or redundant binary add / subtract in the preceding stage A quotient determination circuit that determines which addition or subtraction operation should be performed in the redundant binary adder / subtractor of the corresponding stage and the quotient digit corresponding to that stage, and the quotient determination circuit in each stage. The respective digits of the quotient determined by the quotient determination circuit are combined into a quotient of redundant binary representation, and when the divisor is negative, the sign of this quotient is inverted and the quotient of redundant binary representation is converted into a two's complement representation. A quotient converter for converting and a residue converter for converting a redundant binary number, which is the operation result of the redundant binary adder / subtractor at the final stage, into a two's complement representation number. Then -1,
A divider which makes a determination that 0 is 0 if 0 and 1 is positive if the value is a digit of a corresponding quotient.
【請求項3】正または負の2の補数表現の除数を左もし
くは右へシフトすることにより正規化しその値を除数変
換器に対する入力とすると共にそのときにシフトしたビ
ット数を数える正規化器と、前記正規化器で数えたシフ
ト数の分だけしかも前記正規化器でシフトした方向とは
逆向きに商変換器の出力をシフトする商バレルシフタ
と、前記正規化器で数えたシフト数の分だけしかも前記
正規化器でシフトした方向とは逆向きに剰余変換器の出
力をシフトする剰余バレルシフタとを備えた請求項1記
載の除算器。
3. A normalizer for normalizing by shifting a divisor of a positive or negative two's complement representation to the left or right, inputting the value to the divisor converter, and counting the number of bits shifted at that time. , A quotient barrel shifter that shifts the output of the quotient converter by the number of shifts counted by the normalizer and in the direction opposite to the direction shifted by the normalizer, and the number of shifts counted by the normalizer. The divider according to claim 1, further comprising: a remainder barrel shifter that shifts the output of the remainder converter in the direction opposite to the direction shifted by the normalizer.
【請求項4】1の補数器の出力を左もしくは右へシフト
することにより正規化しその値を除数変換器に対する入
力とすると共にそのときにシフトしたビット数を数える
正規化器と、前記正規化器で数えたシフト数の分だけし
かも前記正規化器でシフトした方向とは逆向きに商変換
器の出力をシフトする商バレルシフタと、前記正規化器
で数えたシフト数の分だけしかも前記正規化器でシフト
した方向とは逆向きに剰余変換器の出力をシフトする剰
余バレルシフタとを備えた請求項2記載の除算器。
4. A normalizer for normalizing an output of a one's complementer by shifting it to the left or right, using the value as an input to a divisor converter and counting the number of bits shifted at that time, and the normalization. The shift number counted by the normalizer and the quotient barrel shifter for shifting the output of the quotient converter in the direction opposite to the direction shifted by the normalizer, and the shift number counted by the normalizer and the normal number. The divider according to claim 2, further comprising: a remainder barrel shifter that shifts an output of the remainder converter in a direction opposite to a direction shifted by the digitizer.
JP1241260A 1989-09-18 1989-09-18 Divider Expired - Fee Related JPH0778724B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1241260A JPH0778724B2 (en) 1989-09-18 1989-09-18 Divider

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1241260A JPH0778724B2 (en) 1989-09-18 1989-09-18 Divider

Publications (2)

Publication Number Publication Date
JPH03102519A JPH03102519A (en) 1991-04-26
JPH0778724B2 true JPH0778724B2 (en) 1995-08-23

Family

ID=17071602

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1241260A Expired - Fee Related JPH0778724B2 (en) 1989-09-18 1989-09-18 Divider

Country Status (1)

Country Link
JP (1) JPH0778724B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0546363A (en) * 1991-08-08 1993-02-26 Mitsubishi Electric Corp Divider
JPH06282416A (en) * 1993-03-30 1994-10-07 Mitsubishi Electric Corp Divider and computer equipped with the same
JP2006218251A (en) * 2005-02-08 2006-08-24 Toyo Seimitsu Kogyo Kk Photograph stand

Also Published As

Publication number Publication date
JPH03102519A (en) 1991-04-26

Similar Documents

Publication Publication Date Title
JP2622896B2 (en) Division device
JP4388543B2 (en) 3-input floating-point adder / subtracter
KR100203468B1 (en) Arithmetic apparatus for floating point numbers
JP3845009B2 (en) Product-sum operation apparatus and product-sum operation method
US6175851B1 (en) Fast adder/subtractor for signed floating point numbers
US5623435A (en) Arithmetic unit capable of performing concurrent operations for high speed operation
KR20020063058A (en) apparatus and method for design of the floating point ALU performing addition and round operations in parallel
US6847986B2 (en) Divider
US5818745A (en) Computer for performing non-restoring division
US20200183650A1 (en) Radix-1000 decimal floating-point numbers and arithmetic units using a skewed representation of the fraction
KR19980082906A (en) How to Convert Floating-Point Numbers to Integer Types
JPH0778724B2 (en) Divider
JP2558669B2 (en) Floating point arithmetic unit
JP2695178B2 (en) Arithmetic circuit
JP2645422B2 (en) Floating point processor
JP2578482B2 (en) Floating point arithmetic unit
JPH086766A (en) Sine and cosine arithmetic device
JPS63158626A (en) Arithmetic processing unit
JP3100868B2 (en) Arithmetic unit for floating point numbers
JP2795253B2 (en) Divider
JPH0635671A (en) Floating point adder-subtracter
JP2796063B2 (en) Mathematical function operation device using table information
JP2993119B2 (en) Floating point arithmetic unit
JPH03282926A (en) Floating-point numerical arithmetic unit
JPH0667852A (en) Divider

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees