JPS61201330A - Divider - Google Patents

Divider

Info

Publication number
JPS61201330A
JPS61201330A JP60043061A JP4306185A JPS61201330A JP S61201330 A JPS61201330 A JP S61201330A JP 60043061 A JP60043061 A JP 60043061A JP 4306185 A JP4306185 A JP 4306185A JP S61201330 A JPS61201330 A JP S61201330A
Authority
JP
Japan
Prior art keywords
divisor
equation
dividend
sign
reciprocal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP60043061A
Other languages
Japanese (ja)
Inventor
Hajime Yoneyama
米山 元
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.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP60043061A priority Critical patent/JPS61201330A/en
Publication of JPS61201330A publication Critical patent/JPS61201330A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/38Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
    • G06F7/48Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
    • G06F7/52Multiplying; Dividing
    • G06F7/535Dividing only

Abstract

PURPOSE:To obtain a divider by using a ROM, an inverter, an adder, and a fast multiplier. CONSTITUTION:The reciprocal (b) of a divisor (y) is found in a ROM 1 from an equation I. In equations I-III, Ps are compensation bits and INTs indicate integral values after figures below the decimal point are discarded. The sign bit (a) of a dividend (x) is inverted by a the inverter 2, whose output (c) is added by the adder 3 to an output (b) so that the sign of the remainder of the division result coincides with the sign of the divisor to obtain (d) shown by an equation IV. Then, it is inputted to the fast multiplier 4. In the equation IV, the sign bit (a) is 0 when the dividend (x) is plus and 1 when minus. The fast multiplier 4 calculates the (d) and dividend (x) to obtain a quotient.

Description

【発明の詳細な説明】 (産業上の利用分野) 本発明は、デジタル電子回路による除算装置に関する。[Detailed description of the invention] (Industrial application field) The present invention relates to a division device using a digital electronic circuit.

(従来の技術) 従来、この徨の除算装置は、マイクロプロセッサを使用
して減算を繰り返し行うことによって所望の除算結果を
得るか、予め商を格納したメモリを使用して被除数と除
数をアドレス情報として使用することによシ、除算結果
を読み出していた。
(Prior Art) Conventionally, this type of division device uses a microprocessor to repeatedly perform subtraction to obtain a desired division result, or uses a memory that stores the quotient in advance to calculate the dividend and the divisor using address information. By using it as a function, I was reading out the division result.

(発明が解決しようとする問題点) 上述の従来の除算装置においては、前者の方式では演算
に長時間を要し、また、後者の方式では莫大なメモリ容
量を必要とするという欠点があった。
(Problems to be Solved by the Invention) The above-mentioned conventional division devices have the drawbacks that the former method requires a long time to perform the calculation, and the latter method requires a huge amount of memory capacity. .

本発明は上記欠点を解決し、高精度の除算結果を高速に
得ることができ、必要なメモリ容量を少くできる除算装
置を提供するものである。
The present invention solves the above-mentioned drawbacks and provides a division device that can quickly obtain high-precision division results and can reduce the required memory capacity.

(問題点を解決するための手段) 本発明の除算装置は、除数を入力してl予め格納してお
いた前記除数の逆数を出力するROMと、被除数の符号
ビットに反転するインバータと、このインバータの出力
と前記ROMの出力である前記逆数の和を求める加算器
と、この加算器の出力と前記被除数の積を計算する乗算
器とを含んで構成される。
(Means for Solving the Problems) The division device of the present invention includes a ROM for inputting a divisor and outputting the reciprocal of the divisor stored in advance, an inverter for inverting the sign bit of the dividend, and an inverter for inverting the sign bit of the dividend. It is configured to include an adder that calculates the sum of the output of the inverter and the reciprocal number that is the output of the ROM, and a multiplier that calculates the product of the output of this adder and the dividend.

(実施例) 次に本発明の実施例について図面を参照して説明する。(Example) Next, embodiments of the present invention will be described with reference to the drawings.

第1図は本発明の一実施例のブロック図である。FIG. 1 is a block diagram of one embodiment of the present invention.

入力被除数Xは16ビツト2の補数形式のデータであシ
、除数yは8ビツト2の補数形式のデータである。除数
の逆数を格納しであるaOMlは除数yをアドレス情報
として入力し、除数yの逆数すを出力する。
The input dividend X is data in a 16-bit two's complement format, and the divisor y is data in an eight-bit two's complement format. aOMl, which stores the reciprocal of the divisor, inputs the divisor y as address information and outputs the reciprocal of the divisor y.

ここでROMxに格納しである除数の逆数の桁数は、精
度を保持するため、被除数の有効桁数十除数の右行桁数
+1ビット+符号ビット+補償ビットを必要とする。即
ち本実施例では15+7+1+1+1=25ビツトとな
る。この除数の逆数すは予め次式によって求められてR
OMxに格納されている。
Here, the number of digits of the reciprocal of the divisor stored in the ROMx requires the number of significant digits of the dividend, the number of right row digits of the divisor + 1 bit + sign bit + compensation bit, in order to maintain accuracy. That is, in this embodiment, 15+7+1+1+1=25 bits. The reciprocal of this divisor is calculated in advance by the following formula and R
Stored in OMx.

b=INT(1/YX2”意)・2+PここでPは補償
ビットを与え、またINTは小数点以下を切捨てた整数
値を示す INT(x/yxz”)’q1/yxz” coときP
−=11NT(1/yX222)=1/YX2”のとき
p=Qである。
b=INT (1/YX2" meaning)・2+P Here, P gives the compensation bit, and INT indicates the integer value with the decimal point rounded down. INT(x/yxz")'q1/yxz" co when P
-=11NT(1/yX222)=1/YX2'', p=Q.

除数yは入力除数として考えられる全ての値をとシ、本
実施例では 一128≦y≦127 (但しOを除く)の整数である
。従って255種の除数yが存在し、逆数すとしてRO
Mtに格納すべきデータ数は25ビット255語となる
The divisor y excludes all possible values as an input divisor, and in this embodiment is an integer of -128≦y≦127 (excluding O). Therefore, there are 255 types of divisor y, and the reciprocal is RO
The number of data to be stored in Mt is 255 words with 25 bits.

被除数Xの符号ピッ)aはインバータ2により反転させ
られ、その出力Cは除算結果の剰余の符号が除数の符号
と一致するように加算器3によってaOMlの出力すと
加算され、LSBが切シ捨てられ高速乗算器4の入力d
となる。即ちd=INT((b+c)/2) =INT
((b−a)/2)ここで符号ピッ)aは被除数Xが正
のとき0であシ、負のとき1である。
The sign of the dividend Input d of discarded high-speed multiplier 4
becomes. That is, d=INT((b+c)/2)=INT
((b-a)/2) Here, a is 0 when the dividend X is positive, and 1 when it is negative.

また、入力dは24ビツトであシ、1/yの小数点以下
22ビツトを持っている。高速乗算器4は入力dと被除
数Xの積を計算する。即ちZ = x d ここで入力dはl/yの小数点以下22ビツトを持って
おシ、この結果高速乗算器4の出力ZのLSBから22
ビツトを切シ捨てたものが求める除算結果となる。
The input d is 24 bits and has 22 bits below the decimal point of 1/y. High speed multiplier 4 calculates the product of input d and dividend X. That is, Z = x d Here, the input d has 22 bits below the decimal point of l/y, and as a result, 22 bits from the LSB of the output Z of the high speed multiplier 4
The desired division result is obtained by truncating the bits.

以上の処理によシ、除算結果2がその剰余の符号が除数
yの符号と一致するような整数値の商を与えるものであ
る理由を以下に説明する。
The reason why the above processing gives the division result 2 a quotient of integer values such that the sign of the remainder matches the sign of the divisor y will be explained below.

被除数Xがnx+1ビット、除数yがn y + lビ
ットで入力されるとするとs  (” )ct ”yは
有効桁数)x、yの範囲は次のようになるっ −2≦X≦2”−1(1) z n Y≦y≦2”Y−1(21 今、真の商をZアとすると Z?=x/y              131剰余
の符号が除数の符号と一致するような整数の商をZlと
すると、 Z r ” ” t ” et           
  (41剰余をrとすると x−r=Z1・y 、’、Z?−r/y=Z1 +”+ Z 1 + e l == Z 1 + r 
/ 7パ・e 1= r / y          
    (s)(5)式よシ、剰余rの符号が除数yの
符号と一致するとすると、 el ≧O またr / yは剰余rが−2”Y+1.除数yが一2
nyのとき最大となるので 0≦e1 ≦(2”−1)/2ny(6)一方、除数y
の逆数としてdを高速乗算器(2人力した場合、dOL
8Bの重みをωとすると1/Y=d+et  (6)<
ex <ω)      (71(7)式の辺々にXを
乗すると(4)式よシZ〒=xd+xe2 :=Z1 +el +”+ xd =Z1 + el  X e2よってI
NT(xd)を除算結果とした場合にzlと一致する為
の条件は O≦el−XJ (1(81 dとして1/yを切り上げて用いるが、切シ下げて用い
るかは以下のように導かれる。
If the dividend ”-1 (1) z n Y≦y≦2”Y-1 (21 Now, if the true quotient is Za, then Z?=x/y 131 An integer whose sign of the remainder matches the sign of the divisor Letting the quotient be Zl, Z r ” ” t ” et
(If the 41 remainder is r, then x-r=Z1・y,', Z?-r/y=Z1 +"+ Z 1 + e l == Z 1 + r
/ 7pa・e 1= r / y
(s) According to equation (5), if the sign of the remainder r matches the sign of the divisor y, then el ≧O and r / y means that the remainder r is -2''Y+1.The divisor y is -2
Since it is maximum when ny, 0≦e1≦(2”-1)/2ny(6) On the other hand, the divisor y
d as the reciprocal of
If the weight of 8B is ω, then 1/Y=d+et (6)<
ex <ω) (71 Multiplying each side of equation (7) by
When NT(xd) is the division result, the condition for matching zl is O≦el−XJ (1(81 1/y is rounded up and used as d, but whether to round it down is as follows. be guided.

(8)式よシ O≦el−xe2 全てのX、elについてe1≧0、および(71,(9
)式が満足されるだめの条件は 一ω<ex≦0    (X≧O) O≦ex<ω    (x<0)     Qo)一方
、 1/y−ω<INT(1/y・1/ω)・ω≦1/y 
  (u)(10)式を満足するdを以下の場合に分け
て考察する。
(8) Formula, O≦el−xe2, e1≧0 for all X, el, and (71, (9
) formula is satisfied: ω<ex≦0 (X≧O) O≦ex<ω (x<0) )・ω≦1/y
(u) d that satisfies equation (10) will be considered in the following cases.

1)  X≧OかつINT(1/y・1/ω)\1/y
・1/ωのとき d==INT(i/y・1/ω)・ω+ω    (1
2)とすると(11)式よシ 1/y−ω〈d−ω<1/y  (・、・工NT(1/
y・1/ω)\x/y・1/ω) (7)式よシ、 d+62−ω(d−ω(d+e2 辺々がらd+e2を減すると 一ω〈−e2−ω〈0 、°、−ω<ex<0 よって(10)式が満足される。
1) X≧O and INT (1/y・1/ω)\1/y
・When 1/ω, d==INT(i/y・1/ω)・ω+ω (1
2), then according to equation (11),
y・1/ω)\x/y・1/ω) According to equation (7), d+62−ω(d−ω(d+e2) If we subtract d+e2 from all sides, we get 1ω〈−e2−ω〈0,°, −ω<ex<0 Therefore, equation (10) is satisfied.

11)x≧0かツIN’I’ (l/Y −1/(t3
 ) =17Y −1/ωa=INT(1/y・1/ω
)・ω   (13)とすると条件よ) d = 1 / y よって(7)式よシ ez=Q これは(10)式を満足する。
11) x≧0 or IN'I' (l/Y -1/(t3
) =17Y -1/ωa=INT(1/y・1/ω
)・ω (13) then the condition) d = 1 / y Therefore, equation (7), ez = Q This satisfies equation (10).

1ii)X<00とき d=INT(1/y −1/ω)・ω   (14)と
すると、(11)式よシ 1/y−ωくd≦1 / y (7)式よ〕 d十e意−ω〈d≦die。
1ii) When X < 00, d = INT (1/y - 1/ω) ω (14), then from equation (11), 1/y - ω, d≦1/y from equation (7)] d 10e meaning-ω〈d≦die.

両辺からdie鵞を減じて 一ωく−C!≦0 ・°・0≦e意 〈ω よって(10)式を満足する。Subtract die goose from both sides Ichiωku-C! ≦0 ・°・0≦e meaning〈ω Therefore, formula (10) is satisfied.

以上から、(12)、(13)、(14)式のようKd
を作成すれば、除算結果の剰余の符号が除数と一致する
ような整数の商が得られる。本実施例では、これを実現
する為にaOMlから出力される逆数すはそのL8Bに
補償ビットを持っておシ、被除数Xの符号ピッ)1反転
させたものを加えることKよシ、(12)、(13)、
(14)式のよりなdを乗算器に入力している。
From the above, as in equations (12), (13), and (14), Kd
By creating , we can obtain an integer quotient such that the sign of the remainder of the division result matches the divisor. In this embodiment, in order to realize this, the reciprocal number output from aOMl has a compensation bit in its L8B, and the sign of the dividend ), (13),
The value d in equation (14) is input to the multiplier.

次に重みωの満足すべき条件を考察する。Next, consider the conditions that the weight ω should satisfy.

(8)式よシ ex>(et  1)/X  (X≧O)    (1
5)ex<(et  1)/X  (X<0)    
(16)(15)式の右辺は(6)式よ)常に負であシ
、その最大値はel、Xがともに最大のときである。ま
た(16)式の右辺は(6)式より常に正であシ、その
最小値はelが最大、Xが最小のときである。
(8) Formula: ex>(et 1)/X (X≧O) (1
5) ex<(et 1)/X (X<0)
(16) The right side of equation (15) (as in equation (6)) is always negative, and its maximum value is when both el and X are maximum. Also, the right side of equation (16) is always positive from equation (6), and its minimum value is when el is maximum and X is minimum.

よって、(7)式よシ ω≦2−FIX * 2−nY とすれば ex >  2−nxe 2−ny(x≧0 )ex 
< 2−” ・2″″fly(X < 0 )となシ、
全てのX、egに関して、(15)、(16)式が満足
される。ROMIに格納するデータの語長をできるだけ
小とするために前述の本発明の実施例では ω=2−fl!・2−fiy(18) とした。またyの絶対値の最小値は工なので、dは最大
lを増シ得る。
Therefore, according to equation (7), if ω≦2-FIX * 2-nY, then ex > 2-nxe 2-ny (x≧0) ex
<2-"・2"" fly (X < 0),
Equations (15) and (16) are satisfied for all X and eg. In order to minimize the word length of data stored in ROMI, in the embodiment of the present invention described above, ω=2-fl!・2-fiy(18). Also, since the minimum absolute value of y is d, d can increase by the maximum l.

以上の考察によシ、ROMIに格納すべき逆数bKは被
除数の有効桁数+除数の有効桁数+1+符号と、ト+補
償ビットが必要となる。
According to the above considerations, the reciprocal bK to be stored in the ROMI requires the number of significant digits of the dividend + the number of significant digits of the divisor + 1 + sign, and + compensation bit.

なお、本実施例ではnxが1511yが7で(18)式
よシω=2 ・2−2 である。
In this embodiment, nx is 1511y is 7, and according to equation (18), ω=2·2−2.

(発明の効果) 以上説明したように1本発明の除算装置は、比較的小容
量のROMとインバータ、加算器、高速乗算器を用いる
ことによシ、大容量のメモリを必要とせずに高精度の除
算結果を高速に得ることができる効果を有する。
(Effects of the Invention) As explained above, the division device of the present invention uses a relatively small-capacity ROM, an inverter, an adder, and a high-speed multiplier. This has the effect of allowing high-precision division results to be obtained quickly.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明の一実施例を示すブロック図である。 1・・・・・・ROM、2・・・・・・インバータ、3
・・・・・・加算器、4・・・・・・高速乗算器。
FIG. 1 is a block diagram showing one embodiment of the present invention. 1...ROM, 2...Inverter, 3
...Adder, 4...High speed multiplier.

Claims (1)

【特許請求の範囲】[Claims] 除数を入力して、予め格納しておいた前記除数の逆数を
出力するROMと、被除数の符号ビットを反転するイン
バータと、このインバータの出力と前記ROMの出力で
ある前記逆数の和を求める加算器と、この加算器の出力
と前記被除数の積を計算する乗算器とを含むことを特徴
とする除算装置。
A ROM that inputs a divisor and outputs the reciprocal of the divisor stored in advance, an inverter that inverts the sign bit of the dividend, and an addition that calculates the sum of the output of this inverter and the reciprocal that is the output of the ROM. and a multiplier for calculating the product of the output of the adder and the dividend.
JP60043061A 1985-03-05 1985-03-05 Divider Pending JPS61201330A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP60043061A JPS61201330A (en) 1985-03-05 1985-03-05 Divider

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP60043061A JPS61201330A (en) 1985-03-05 1985-03-05 Divider

Publications (1)

Publication Number Publication Date
JPS61201330A true JPS61201330A (en) 1986-09-06

Family

ID=12653349

Family Applications (1)

Application Number Title Priority Date Filing Date
JP60043061A Pending JPS61201330A (en) 1985-03-05 1985-03-05 Divider

Country Status (1)

Country Link
JP (1) JPS61201330A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0326006A2 (en) * 1988-01-18 1989-08-02 Kabushiki Kaisha Toshiba Format converting circuit for numeric data
EP0631228A1 (en) * 1993-06-21 1994-12-28 Questech Limited Accurate digital divider

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0326006A2 (en) * 1988-01-18 1989-08-02 Kabushiki Kaisha Toshiba Format converting circuit for numeric data
EP0631228A1 (en) * 1993-06-21 1994-12-28 Questech Limited Accurate digital divider

Similar Documents

Publication Publication Date Title
US3777132A (en) Method and apparatus for obtaining the reciprocal of a number and the quotient of two numbers
JPS6347874A (en) Arithmetic unit
JPS61201330A (en) Divider
JPS5939774B2 (en) Exponential function calculation method
CN110784226A (en) Data processing method and data processing device based on PCM compression coding
JPS6027024A (en) Arithmetic device
JP2645422B2 (en) Floating point processor
JPH03192429A (en) Square root arithmetic unit
SU1397903A1 (en) Division device
JPH0585924B2 (en)
JPS59140560A (en) Floating point multiplier
JP3201097B2 (en) Multiplication prescription method in multiplier
JP3626611B2 (en) Data arithmetic unit
Natarajan et al. Arithmetic Operations and Circuits
JPH06180640A (en) Device and method for division
CN112541582A (en) Arithmetic circuit
CN115081021A (en) Privacy algorithm construction method and device, electronic equipment and readable storage medium
JPH05508721A (en) Apparatus and method for calculating trigonometric functions
CN114691082A (en) Multiplier circuit, chip, electronic device, and computer-readable storage medium
JPS60129834A (en) Multiplier and divider
JPH05100762A (en) Function value calculating device
JPH0789315B2 (en) Rational arithmetic unit
JPH04348424A (en) Integer division system
JPS62147526A (en) Multiplier
JPH03241421A (en) Multiplier