Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JPH0664529B2 - Rounding adder - Google Patents
[go: Go Back, main page]

JPH0664529B2 - Rounding adder - Google Patents

Rounding adder

Info

Publication number
JPH0664529B2
JPH0664529B2 JP62056712A JP5671287A JPH0664529B2 JP H0664529 B2 JPH0664529 B2 JP H0664529B2 JP 62056712 A JP62056712 A JP 62056712A JP 5671287 A JP5671287 A JP 5671287A JP H0664529 B2 JPH0664529 B2 JP H0664529B2
Authority
JP
Japan
Prior art keywords
carry
input
adder
output
block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP62056712A
Other languages
Japanese (ja)
Other versions
JPS63223918A (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.)
NTT Inc
Original Assignee
Nippon Telegraph and Telephone 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 Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP62056712A priority Critical patent/JPH0664529B2/en
Publication of JPS63223918A publication Critical patent/JPS63223918A/en
Publication of JPH0664529B2 publication Critical patent/JPH0664529B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Description

【発明の詳細な説明】 (産業上の利用分野) 本発明は入力データ語長(Mbitとする。)に対して出
力データ語長(kbitとする。k<N)が制限されてい
るときに、語長に合わせた丸め結果を出力する加算器回
路に関するものである。
DETAILED DESCRIPTION OF THE INVENTION (Industrial field of application) The present invention is applied when the output data word length (kbit. K <N) is limited with respect to the input data word length (Mbit.). The present invention relates to an adder circuit that outputs a rounding result according to a word length.

(従来の技術) 2入力加算において、後の回路の関係で出力データを丸
める必要がある場合、従来は以下のいずれかの方法がと
られていた。
(Prior Art) In the two-input addition, when it is necessary to round the output data due to the relationship of the subsequent circuit, one of the following methods has been conventionally used.

(1)切り捨て型加算法 その構成を第5図(a)に示す。これはNbitの入力データ
A,Bのうちからそれぞれ上位のkbitを入力して加算
しkbitのサムとキャリーとを得る2入力加算器と、下
位のN−kbitの切り捨て部とからなる。この構成によ
り、有効データ語長より下位の部分を入力データから切
り捨てた後に上位のkbit加算を行うので、下位N−kb
it分のデータは計算する必要がなくなる。そのため、そ
の分の加算器回路と計算時間とを減らすことができる。
(1) Truncation type addition method The configuration is shown in Fig. 5 (a). This is composed of a 2-input adder for inputting and adding an upper kbit from N-bit input data A and B to obtain a kbit sum and a carry, and a lower N-kbit truncation unit. With this configuration, since the lower part of the effective data word length is truncated from the input data, the upper kbit addition is performed, so the lower N-kb
It is not necessary to calculate the data for it. Therefore, the adder circuit and the calculation time can be reduced accordingly.

(2)丸め型加算法 その構成を第5図(b)に示す。これはNbitの入力データ
A,Bに対して、下位N−kbit用の2入力加算器1′
と上位kbit用の2入力加算器2′,半加算器アレイ
3′とから構成される。2入力加算器1′は入力データ
A,Bの下位N−kbitの加算を行い、最上位桁からキ
ャリーCN-kの1bitとサムSN-k-1の1bitのみを生成
し、それぞれ上位の2入力加算器2′の最下位桁への入
力とする。2入力加算器2′は入力データA,Bのそれ
ぞれ上位kbitと下位の2入力加算器1′からの前記キ
ャリーCN-kとサムSN-k-1の4データを加算し、kbit
のサム出力と最上位桁からのキャリー出力を得る。2入
力加算器2′は最下位桁への入力が4本となるので、2
入力加算器2′の前段へ半加算器アレイ3′を設置し、
加算入力本数を3本以下にした後に加算をする構成とす
る。この方法は、結果的に一度入力データ語長(Nbit)で
加算を行い、その後、誤差を小さくするため有効データ
語長の最下位桁にその1bit下位のサムSN-k-1を繰り上
げて加えるということに相当し、有効データ語長で十進
数の意味での四捨五入と同等の丸め効果が得られる。こ
のとき、丸め誤差は最小不偏となる。
(2) Rounding type addition method The configuration is shown in Fig. 5 (b). This is a 2-input adder 1'for lower N-kbits for N-bit input data A and B.
And an upper kbit 2-input adder 2'and a half adder array 3 '. The 2-input adder 1'adds the lower N-kbits of the input data A and B, generates only the 1 - bit of the carry C Nk and the 1-bit of the sum S Nk-1 from the most significant digit, and respectively adds the upper 2-inputs. Input to the least significant digit of the device 2 '. The 2-input adder 2'adds the upper kbits of the input data A and B, respectively, and the carry C Nk from the lower 2-input adder 1'and the 4 data of the sum S Nk-1 to obtain kbit.
Get the sum output of and the carry output from the most significant digit. Since the 2-input adder 2'has four inputs to the least significant digit,
Install the half adder array 3'in front of the input adder 2 ',
The configuration is such that addition is performed after the number of addition inputs is three or less. In this method, as a result, the input data word length (Nbit) is once added, and thereafter, in order to reduce the error, the sum S Nk-1 of 1 bit lower than that is added to the least significant digit of the effective data word length. Corresponding to the above, the rounding effect equivalent to rounding in the decimal number in the effective data word length is obtained. At this time, the rounding error becomes the minimum unbiased.

(発明が解決しようとする問題点) しかし、この従来の技術では、 (1)の場合、下位を完全に切り捨てる方法と、切り捨て
部の値の平均値を補うため有効データブロックの最下位
桁CN-kに無条件に1を加え偏差をなくす方法とがあ
る。前者の場合、切り捨て部の計算値がわからないため
出力結果の誤差が大きく、また切り捨て部の値を補償し
ないため結果に偏差がでる。後者の場合も偏差はなくな
るが誤差はいぜんとして大きい。
(Problems to be solved by the invention) However, in this conventional technique, in the case of (1), the method of completely truncating the lower order and the least significant digit C of the effective data block for compensating for the average value of the truncating section are used. There is a method of unconditionally adding 1 to Nk to eliminate the deviation. In the former case, the error in the output result is large because the calculated value of the truncation part is unknown, and the result is deviated because the value of the truncation part is not compensated. In the latter case, the deviation disappears, but the error is still large.

(2)の場合、加算が半加算器+2入力加算器の2段にな
り、かつ2入力加算器1′で最上位桁のサムSN-k-1
計算された時点から2入力加算器2′のキャリーが最下
位桁から最上位桁に向けて上がって行く。ゆえに計算時
間が2入力加算器1′の計算時間+2入力加算器2′の
計算時間分かかり遅い。
In the case of (2), the addition is performed in two stages of a half adder and a two-input adder, and the two-input adder 2 ′ starts from the time when the most significant digit sum S Nk−1 is calculated by the two-input adder 1 ′. Carry goes up from the least significant digit to the most significant digit. Therefore, the calculation time is slow because of the calculation time of the 2-input adder 1 '+ the calculation time of the 2-input adder 2'.

という欠点を有していた。It had a drawback.

(問題点を解決するための手段) 本発明では以上の点を踏まえ、誤差が小さくかつ偏差の
でない、丸め結果と高速性とを両立させた丸め加算器を
提供することを目的としている。
(Means for Solving Problems) In view of the above points, an object of the present invention is to provide a rounding adder which has both small rounding error and no deviation and which has both rounding result and high speed.

第1図は本発明の丸め加算器の概念図である。1は通常
の2入力加算器で、11は最上位桁のサム、12は最上位桁
から上位に送られるキャリーである。2は選択信号生成
回路で、出力は3−1セレクタ4に接続される。2入力
加算器1と選択信号生成回路2とにより構成される部分
が、「特許請求の範囲」における丸め補正用ブロックに
対応する。30は入力の和、31は和+1、32は和+2を計
算する2入力加算器である。3−1セレクタ4は2入力
加算器30,31,32の出力の1つを選択信号生成回路2の
出力信号により選択する。2入力加算器30,31,32と3
−1セレクタ4とにより構成される部分が、「特許請求
の範囲」における有効データブロックに対応する。
FIG. 1 is a conceptual diagram of the rounding adder of the present invention. Reference numeral 1 is a usual two-input adder, 11 is a sum of the most significant digit, and 12 is a carry sent from the most significant digit to the high order. Reference numeral 2 is a selection signal generation circuit, the output of which is connected to the 3-1 selector 4. A portion configured by the 2-input adder 1 and the selection signal generation circuit 2 corresponds to the rounding correction block in "Claims". Reference numeral 30 is a two-input adder that calculates the sum of inputs, 31 is the sum +1, and 32 is the sum +2. The 3-1 selector 4 selects one of the outputs of the two-input adders 30, 31, 32 by the output signal of the selection signal generation circuit 2. 2-input adders 30, 31, 32 and 3
-1 selector 4 corresponds to a valid data block in "Claims".

一般に桁上げ選択加算器では、各ブロックに2つの加算
器を用意し、下位のブロックからのキャリーがそれぞれ であることを仮定して予め計算を行い、下位のブロック
からのキャリーが決定した時点で2つの仮定した出力の
うち1つを選択して出力する。本発明はこの考え方を丸
め加算器に応用したものである。つまり、丸め誤差を最
小不偏にする(言い換えれば十進法での四捨五入と同等
の結果を得る)ためには、「従来の技術」の丸め型加算
法で述べたように、丸め補正用ブロックの最上位桁から
のキャリーとサムとを有効データブロックの最下位桁に
加算する必要がある。その加算の実行について、そのキ
ャリーとサムとの和がとる3状態 に対して、それぞれ有効データブロックのとる値を予め
計算しておく方法をとることができる。それによって、
誤差が小さくかつ不偏な丸め結果を高速に得ることがで
きる。これを本発明の特徴とする。
Generally, in carry carry adder, two adders are prepared for each block, and carry from the lower block respectively It is calculated in advance on the assumption that the above condition is satisfied, and one of the two assumed outputs is selected and output when the carry from the lower block is determined. The present invention applies this idea to a rounding adder. In other words, in order to minimize the rounding error (in other words, to obtain the same result as rounding in decimal), the highest digit of the rounding correction block must be The carry and the sum from must be added to the least significant digit of the valid data block. About the execution of the addition, the three states of the sum of the carry and Sam On the other hand, it is possible to employ a method in which the value of each valid data block is calculated in advance. Thereby,
A rounding result with a small error and an unbiased result can be obtained at high speed. This is a feature of the present invention.

第1図において、入力データA,Bはそれぞれ出力有効
データ語長に対応する上位kbitの部分AH,BHと丸め
補正用の下位N−kbitの部分AL,BLとに分けられ
る。入力データA,Bの丸め補正用部分AL,BLは2入
力加算器1で加算され、最上位桁のサム11と最上位桁か
ら上位に送られるキャリー12とが計算される。この2つ
の信号(それぞれ1bit)は選択信号生成回路2で加算
され、結果は3−1セレクタ4の選択信号となる。一
方、入力データA,Bの有効データ語長に対応する部分
H,BHは2入力加算器30,31,32に入力され、2入力
加算器30ではAH+BH、2入力加算器31ではAH+BH
1、2入力加算器32ではAH+BH+2が2入力加算器1
と並行に計算される。2入力加算器30,31,32の出力は
3−1セレクタ4に入れ、選択信号生成回路2の加算結
果が のとき2入力加算器30、1のとき2入力加算器31、2の
とき2入力加算器32の出力が選択され系の出力となる。
In Figure 1, the input data A, B part A H of the upper kbit corresponding to the output valid data word length, respectively, part A L of the lower N-kbit for correction and rounding B H, is divided into a B L. The rounding correction portions A L and B L of the input data A and B are added by the 2-input adder 1, and the sum 11 of the most significant digit and the carry 12 sent from the most significant digit to the upper digit are calculated. These two signals (1 bit each) are added by the selection signal generation circuit 2, and the result becomes the selection signal of the 3-1 selector 4. On the other hand, the portions A H and B H corresponding to the effective data word lengths of the input data A and B are input to the 2-input adders 30, 31, and 32, and the 2-input adder 30 uses A H + B H and 2-input adder. In 31, A H + B H +
In the 1 and 2 input adder 32, A H + B H +2 is the 2 input adder 1
Is calculated in parallel with. The outputs of the 2-input adders 30, 31, 32 are input to the 3-1 selector 4, and the addition result of the selection signal generation circuit 2 is The output of the 2-input adder 30 in the case of 1, the output of the 2-input adder 31 in the case of 1, and the output of the 2-input adder 32 in the case of 2 becomes the output of the system.

(実施例) 第2図は本発明の実施例で入力16bit×2、出力8bit+
キャリーの加算器構成である。
(Embodiment) FIG. 2 shows an embodiment of the present invention, input 16 bits × 2, output 8 bits +
It is a carry adder configuration.

2入力加算器1としては任意の8bit加算器を用いるこ
とができる。選択信号生成回路2は、8bitの2入力加
算器1の最上位桁のサムS7と最上位桁から繰り上がる
キャリーC8とを入力としたときの2入力の和が のとき出力線20に、1のとき出力線21に、2のとき出力
線22に信号が負論理で出力されるように、ORゲート,
ENORゲート,NANDゲートで構成されている。
An arbitrary 8-bit adder can be used as the 2-input adder 1. The selection signal generation circuit 2 calculates the sum of the two inputs when the sum S 7 of the most significant digit and the carry C 8 carried from the most significant digit of the 8-bit two-input adder 1 are input. When the signal is output to the output line 20, the signal is output to the output line 21 when the signal is 1, and the signal is output to the output line 22 when the signal is 2 in the negative logic.
It is composed of an ENOR gate and a NAND gate.

第1図における2入力加算器30,31,32はキャリー計算
部以外は共通にし、第1図における3−1セレクタ4と
一緒に4bitごとにスライスして、第2図における加算
器+セレクタブロック51,52の2つにまとめ、ハード量
を減らしている。また、4bitごとにスライスすること
によってブロックごとに並行にキャリー計算ができ、高
速化が可能である。
The two-input adders 30, 31, 32 in FIG. 1 are common except for the carry calculation section, and sliced every 4 bits together with the 3-1 selector 4 in FIG. 1 to adder + selector block in FIG. We have reduced it to 51 and 52 to reduce the amount of hardware. By slicing every 4 bits, carry calculation can be performed in parallel for each block, and the speed can be increased.

ここで、加算器+セレクタブロック51,52の入出力端子
を説明する。端子名の最後のIは負論理入出力端子を示
す。A3〜A0、B3〜B0は入力データの4bit×2の入
力端子、S3〜S0は結果の4bitの出力端子である。
Here, the input / output terminals of the adder + selector blocks 51 and 52 will be described. I at the end of the terminal name indicates a negative logic input / output terminal. A 3 to A 0 and B 3 to B 0 are input terminals of input data of 4 bits × 2, and S 3 to S 0 are output terminals of 4 bits of the result.

は入力端子で、加算器+セレクタブロックに繰り上がる
キャリーが のとき に、1のときCI1Iに、2のときCI2Iに信号が負論理で入
力される。
Is an input terminal, and carry carried to the adder + selector block When In the case of 1, a signal is input to CI1I and in the case of 2, a signal is input to CI2I in negative logic.

は出力端子で、次ブロックに繰り上げられるキャリーが のとき に、1のときにCO1Iに、2のときCO2Iに信号が負論理で
出力される。
Is an output terminal, and the carry carried to the next block is When When the signal is 1, the signal is output to CO1I, and when the signal is 2, the signal is output to CO2I in negative logic.

加算器+セレクタブロック51は有効データの下位4bit
分の加算結果と上位の加算器+セレクタブロック52に送
るキャリーとを選択信号生成回路2の出力の3状態 それぞれについて計算し、選択信号生成回路2の結果が
決定された時点でその中の1つを選択し出力する。加算
器+セレクタブロック52は有効データの上位4bit分の
加算結果とキャリー出力とを加算器+セレクタブロック
51からのキャリーの3状態 それぞれについて計算し、加算器+セレクタブロック51
の結果が決定した時点でその中の1つを選択し出力す
る。
Adder + selector block 51 is the lower 4 bits of valid data
The addition result of minutes and the carry sent to the upper adder + selector block 52 are the three states of the output of the selection signal generation circuit 2. Each of them is calculated, and when the result of the selection signal generation circuit 2 is determined, one of them is selected and output. The adder + selector block 52 adds the result of addition of the upper 4 bits of valid data and the carry output to the adder + selector block.
Carry three states from 51 Calculate for each and adder + selector block 51
When one of the results is determined, one of them is selected and output.

第3図はその加算器+セレクタブロック51,52のC−M
OSにおける構成例である。この部分は有効データ語長
におけるAH+BH,AH+BH+1,AH+BH+2の加算
を並行に計算する。AH+BHは通常の加算器、AH+BH
+1は通常の加算器の最下位桁へ1のキャリーを繰り上
げることによって実現が可能である。しかし、AH+BH
+2は通常の考え方では2度加算をしなければならな
い。これでは高速に計算ができないため、ここでは通常 と1の2状態しかとらないキャリーに3つの状態 をとらせて計算のできるようなハード構成をとってい
る。ここで、2のキャリーとは、基準となる桁にその下
位から2を繰り上げて加えることに相当する。この方法
をとれば、最下位桁へ2のキャリーを繰り上げることに
よってAH+BH+2を高速に実現することができる。以
下にそのハード構成について説明する。
FIG. 3 shows the CM of the adder + selector block 51, 52.
It is a configuration example in the OS. This part calculates in parallel the addition of A H + B H , A H + B H +1 and A H + B H +2 in the effective data word length. A H + B H is a normal adder, A H + B H
+1 can be realized by carrying a carry of 1 to the least significant digit of an ordinary adder. However, A H + B H
+2 must be added twice in the usual way of thinking. This is not a fast calculation, so 3 states for carry that can only take 2 states, 1 and It has a hardware configuration that can be calculated by taking Here, a carry of 2 corresponds to adding 2 to the reference digit by advancing from the lower order. According to this method, A H + B H +2 can be realized at high speed by moving the carry of 2 to the least significant digit. The hardware configuration will be described below.

図のCGはキャリージェネレータで、入力データA,Bの
各桁の入力と前の桁から繰り上がるキャリーに基づい
て、次の桁へ繰り上がるキャリーを計算するものであ
る。次の桁へ繰り上がるキャリーは各加算器+セレクタ
ブロックに繰り上がるキャリー入力の3状態 それぞれを仮定して、3状態それぞれについて計算す
る。
CG in the figure is a carry generator, which calculates the carry carried to the next digit based on the input of each digit of the input data A and B and the carry carried from the previous digit. Carry carried to the next digit is carried to each adder + selector block. Assuming each, calculate for each of the three states.

ここで、キャリージェネレータCGの入出力端子を説明す
る。ND,NRは入力端子で、入力データA,Bの各桁ごと
の和がとる3状態を区別するための入力で、入力端子ND
にはAiとBiを、入力端子NRにはAiとBiを入力する。
Here, the input / output terminals of the carry generator CG will be described. ND and NR are input terminals, which are inputs for distinguishing the three states of the sum of input data A and B for each digit.
Of A i and B i To the input terminal NR of A i and B i Enter.

は入力端子で、加算器+セレクタブロックに繰り上がる
キャリーが のとき に、1のときI1Iに前の桁から繰り上がるキャリーが負
論理で入力される。
Is an input terminal, and carry carried to the adder + selector block When When 1, the carry carried from the previous digit is input to I1I in negative logic.

は入力端子で、加算器+セレクタブロックに繰り上がる
キャリーが2であるときに、前桁から繰り上がるキャリ
ーが であるならば に、1であるならばI21Iに、2であるならばI22Iに負論
理で信号が入力される。
Is an input terminal, and when the carry carried to the adder + selector block is 2, the carry carried from the previous digit is If it is If it is 1, a signal is input to I21I, and if it is 2, a signal is input to I22I in negative logic.

は出力端子で、ブロックに繰り上がるキャリーが のとき に、1のとき01Iに次の桁へ繰り上がるキャリーが負論
理で出力される。
Is an output terminal, and a carry carried to the block When In the case of 1, the carry carried to the next digit is output in negative logic at 01I.

は出力端子で、ブロックに繰り上がるキャリーが2であ
るときに前桁から繰り上がるキャリーが であるならば に、1であるならば021Iに、2であるならば022Iに信号
が負論理で出力される。このようにブロックに繰り上が
るキャリーが2のときの各桁のキャリーの3状態を3本
の信号線で表わしたのは、エンコード,デコード回路を
省いて回路を高速にするためである。
Is an output terminal, and when the carry carried to the block is 2, the carry carried from the first digit is If it is When the value is 1, the signal is output to 021I, and when the value is 2, the signal is output to 022I in negative logic. In this way, the three states of the carry of each digit when the carry carried to the block is 2 are represented by three signal lines in order to omit the encoding and decoding circuits and to speed up the circuit.

次に第3図の回路の動作を説明する。入力データA,B
それぞれのある桁の入力(例としてA1,B1をとる。)
は和の3状態を示すようにNANDゲート501,NOR
ゲート502によりそれぞれNANDとNORとをとり、
それぞれキャリージェネレータ503の入力端子ND,NRに
入力される。キャリージェネレータ503は加算器+セレ
クタブロックに繰り上がるキャリー入力のとり得る3状
のそれぞれに対して、前の桁から繰り上がるキャリーの
計算値 とND,NRの各入力によって次の桁に繰り上がるキャリー を計算する。また、NANDゲート501の出力とNOR
ゲート502の出力とからEORゲート504によりEOR
(A1とB1のEORと同等)をとり、各桁に対する下位
からのキャリーを考慮しない仮のサムを計算する。その
あと、加算器+セレクタブロックに対する下位からのキ
ャリーが決定した時点で前の桁からその桁へ繰り上がる
真のキャリーがセレクタ505により選択される。そし
て、キャリーがあった場合、仮のサム出力を反転させる
ため、仮のサム(EORゲート504の出力)と真のキャ
リー(セレクタ505の出力)とのEORをEORゲート5
06によりとる。それによって、真のその桁のサム出力を
得ることができる。ここで、加算器+セレクタブロック
に対して2のキャリーが入力されたとき、ある桁の結果
に影響を及ぼす前の桁から繰り上がるキャリーは1だけ
であるため(2のキャリーはその桁を基準に“1
{2}”を加えるのと同等なので影響がその桁より上に
行き、その桁自身には関係しない。)、セレクタ505へ
の入力には、ブロックに繰り上がるキャリーが2のとき
に前の桁から繰り上がるキャリーが1であることを示す
キャリージェネレータの負論理出力端子021Iから信号を
もってくればよい。加算器+セレクタブロックの3桁目
から次ブロックへ繰り上がるキャリーは、そのブロック
に対するキャリーが入力された時点で3桁目のキャリー
ジェネレータの出力からセレクタ507,508,509によっ
て選択され、次ブロックに繰り上がるキャリーが2のと
きC02Iに、1のときC01Iに、 のとき に信号が負論理で出力される。
Next, the operation of the circuit shown in FIG. 3 will be described. Input data A, B
Input each digit (take A 1 and B 1 as an example)
Is a NAND gate 501, NOR to indicate the three states of the sum.
Gate 502 takes NAND and NOR respectively,
Input to input terminals ND and NR of carry generator 503, respectively. Carry generator 503 has three possible states for carry input carried to adder + selector block. Calculated carry carry from the previous digit for each of Carry carried to the next digit by each input of ND and NR To calculate. The output of the NAND gate 501 and NOR
EOR from the output of gate 502 by EOR gate 504
(Equivalent to E 1 of A 1 and B 1 ) to calculate a provisional sum that does not consider the carry from the lower order for each digit. After that, when the carry from the lower order for the adder + selector block is determined, the true carry carried from the previous digit to that digit is selected by the selector 505. If there is a carry, the temporary sum output is inverted, so the EOR of the temporary sum (output of the EOR gate 504) and the true carry (output of the selector 505) is set to the EOR gate 5.
Take by 06. Thereby, the true sum output of that digit can be obtained. Here, when a carry of 2 is input to the adder + selector block, the carry carried from the previous digit that affects the result of a certain digit is only 1 (the carry of 2 is based on that digit. To "1
It is equivalent to adding 0 {2} ", so the effect goes above that digit and is not related to that digit itself.), The input to the selector 505 is the previous carry when the carry carried to the block is 2. It is sufficient to bring a signal from the negative logic output terminal 021I of the carry generator indicating that the carry carried from the digit is 1. The carry carried from the third digit of the adder + selector block to the next block is the carry for that block. When it is input, it is selected by the selectors 507, 508, and 509 from the output of the carry generator at the third digit, and when the carry carried to the next block is 2, it is C02I, when it is 1, it is C01I, When The signal is output in negative logic.

ここで、キャリージェネレータ部の説明をする。第1表
は前桁から繰り上がるキャリー(キャリー入力)と入力
データA,Bのある桁の値Ai,biに対する次桁へ繰り
上がるキャリー(キャリー出力)との数値としての対応
を示したものである。ここで、キャリー入力 はキャリー出力 に対応し加算器+セレクタブロックに繰り上がるキャリ
ーが である場合有効となる値、I1は01に対応し加算器+セレ
クタブロックに繰り上がるキャリーが1である場合有効
となる値、I2は02に対応し加算器+セレクタブロックに
繰り上がるキャリーが2である場合有効となる値であ
る。第1表において、例えば、キャリー出力 の左列の各出力値は、キャリー入力 の場合に加算入力Ai,Biの各入力値に対して出力され
る値である。同様に、例えば、キャリー出力02の最右列
の各出力値は、キャリー入力I2が2の場合に加算入力A
i,Biの各入力値に対して出力される値である。
Here, the carry generator section will be described. Table 1 shows the correspondence between the carry carried from the previous digit (carry input) and the carry carried to the next digit (carry output) with respect to the value A i , b i of a certain digit of the input data A and B as a numerical value. It is a thing. Where carry input Is carry output Corresponding to, carry carried to adder + selector block Is valid, I1 corresponds to 01, and the carry carried to the adder + selector block is 1; I2 corresponds to 02; carry carried to the adder + selector block is 2 Is a valid value. In Table 1, for example, carry output Each output value in the left column of is the carry input In the case of, the value is output for each input value of the addition inputs A i and B i . Similarly, for example, the output values in the rightmost column of carry output 02 are addition inputs A when carry input I2 is 2.
It is a value output for each input value of i and B i .

第1表の各キャリー出力Onと各キャリー入力Inおよ
び加算入力Ai,Biとの間に論理式 [x]はxを越えない最大の整数 が成り立つ。
A logical expression is provided between each carry output On and each carry input In and addition inputs A i and B i in Table 1. [X] is a maximum integer that does not exceed x.

この加算器では加算器+セレクタブロックに繰り上がる
キャリーの3状態 それぞれについて結果を予め計算するため、以上の対応 を別々にロジックで構成する。ここで、対応表から
i,Biの加算入力はAi∩Bi(後述する第2表ではD
と示す。)とAi∪Bi(第2表ではRと示す。)の形で
しかキャリー出力に関与していないことに着目し、これ
を中間論理としてAi,Biの代わりにキャリージェネレ
ータへの入力として用いる。また、I2,02は3状態をと
らなければならないので、I2は の3信号、02は の3信号で状態を表わす。そして、第1表のI2における の状態を で、1の状態を で、2の状態を で表わす。同じく02における の状態を で、1の状態を で、2の状態を で表わす。以上のように入出力端子を定義した場合の第
1表に対応する入出力論理対応表を第2表に示す。
This adder has three states: carry carried to adder + selector block Since the results are calculated in advance for each, the above correspondence Are separately configured with logic. Here, A i from the correspondence table, addition input of B i is A i ∩B i (D in Table 2 to be described later
Indicates. ) And A i ∪ B i (indicated as R in Table 2) are involved in the carry output, and this is used as an intermediate logic to replace the A i and B i with the carry generator. Used as input. Also, I2,02 must take three states, so I2 3 signals of 02, The three signals represent the status. And in I2 of Table 1 The state Then, the state of 1 Then, the state of 2 Express with. Also at 02 The state Then, the state of 1 Then, the state of 2 Express with. Table 2 shows an input / output logic correspondence table corresponding to the first table when the input / output terminals are defined as described above.

構成例の回路の入出力は負論理で構成されている。対応
は、 となっている。端子名の最後のIは負論理入出力端子を
示す。そして、前記のようにキャリージェネレータの入
出力端子を決めたときの各端子間の論理対応とキャリー
入力 を選択信号、中間論理入力D、、R、を被選択信号
と見た場合の第2表に対応するキャリー出力の対応表を
第3表に示す。
The input and output of the circuit of the configuration example are configured by negative logic. The correspondence is Has become. I at the end of the terminal name indicates a negative logic input / output terminal. Then, when the input / output terminals of the carry generator are determined as described above, the logical correspondence between the terminals and the carry input Table 3 shows a correspondence table of carry outputs corresponding to the second table when the selection signal and the intermediate logic inputs D and R are regarded as the selected signal.

ここで、 の2信号、I1Iと▲▼の2信号、 と▲▼と▲▼の3信号は、それぞれ互
いに排他的であるので、キャリージェネレータ内のロジ
ックは以下のような式で示すことができる。
here, 2 signals, I1I and ▲ ▼ signals, Since the three signals of ,, and are mutually exclusive, the logic in the carry generator can be expressed by the following equation.

第4図はキャリージェネレータ(CG)503部の回路構成の
例を示す。これは第3表に示すキャリージェネレータの
キャリー発生の規約を実現するものである。
FIG. 4 shows an example of the circuit configuration of the carry generator (CG) 503. This realizes the carry generation rules of the carry generator shown in Table 3.

ここで、 桁目のキャリージェネレータの構成は以下のように実現
される。まず、仮想的にブロックの−1桁目から 桁目に上がるキャリーを考える。これは前ブロックから
そのブロックに繰り上がるキャリーと同じ意味であるか
ら、ブロックに繰り上がるキャリーが のときは 1のときはI1=1、2のときはI2=2である。この加算
器はこれを予め仮定して計算を行うのであるから、これ
をそのまま符号化して送ればよい。つまり、−1桁目か
が繰り上がったとして 桁目のキャリージェネレータのロジックをつくればよ
い。そうすると、ブロックの 桁目から1桁目に繰り上がるキャリーは第3表によっ
て、 となる。これの実現例が第3図の 桁目から1桁目へのキャリー計算回路である。
here, The configuration of the carry generator of the digit is realized as follows. First, virtually from the -1st digit of the block Consider a carry that goes up to the number of digits. This has the same meaning as the carry carried from the previous block to that block, so the carry carried to the block is When When it is 1, I1 = 1, and when it is 2, I2 = 2. Since this adder performs calculations on the assumption of this in advance, it can be encoded as it is and sent. That is, from the -1st digit As All you have to do is create the logic of the carry generator for the digit. Then, of the block According to Table 3, carry carried from the first digit to the first digit is Becomes An example of this is shown in Figure 3. It is a carry calculation circuit from the first digit to the first digit.

(発明の効果) 以上のように本発明にあっては、計算結果から有効語長
を制限して出力する加算器において、上位の有効データ
ブロックと下位の丸め補正用ブロックとから構成し、前
記丸め補正用ブロックから前記有効データブロックへ繰
り上がるキャリー出力と前記丸め補正用ブロックの最上
位のサム出力との和がとり得る の3状態それぞれについて、前記有効データブロックの
計算結果を予め前記丸め補正用ブロックの計算と並行に
求め、前記丸め補正用ブロックのキャリーとサムとから
なる3状態の1つが決まった時点で該当する前記有効デ
ータブロックの計算結果の1つを選択して出力するよう
にしたので、 (イ)有効データより下位のデータの加算結果を考慮に入
れているので誤差が小さく偏差がでない。
(Effects of the Invention) As described above, according to the present invention, in an adder that limits and outputs the effective word length from the calculation result, the adder is composed of an upper effective data block and a lower rounding correction block. The sum of the carry output carried from the rounding correction block to the valid data block and the highest sum output of the rounding correction block can be obtained. For each of the three states, the calculation result of the valid data block is obtained in advance in parallel with the calculation of the rounding correction block, and one of the three states consisting of the carry and the sum of the rounding correction block is applicable when it is determined. Since one of the calculation results of the valid data block is selected and output, (b) the addition result of the data lower than the valid data is taken into consideration, so the error is small and there is no deviation.

(ロ)計算が並行に行われるので処理が高速となる。(B) Since the calculation is performed in parallel, the processing speed is high.

等の効果がある。And so on.

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

第1図は本発明の丸め加算器の概念図、第2図は本発明
を入力16bit×2,出力8bit+キャリーの場合に適用し
た実施例、第3図は第2図における4bitの加算器+セ
レクタブロックの回路構成の例、第4図は第3図におけ
るキャリージェネレータの回路構成の例、第5図(a),
(b)は従来の丸め加算器の例である。 1……2入力加算器、11……サム、12……キャリー、2
……選択信号生成回路、30,31,32……2入力加算器、
4……3−1セレクタ
FIG. 1 is a conceptual diagram of a rounding adder of the present invention, FIG. 2 is an embodiment in which the present invention is applied to a case of input 16 bits × 2, output 8 bits + carry, and FIG. 3 is a 4-bit adder in FIG. An example of the circuit configuration of the selector block, FIG. 4 is an example of the circuit configuration of the carry generator in FIG. 3, FIG. 5 (a),
(b) is an example of a conventional rounding adder. 1 …… 2 input adder, 11 …… Sam, 12 …… Carry, 2
...... Selection signal generation circuit, 30, 31, 32 …… 2-input adder,
4 …… 3-1 selector

フロントページの続き (56)参考文献 特開 昭52−112249(JP,A) 特開 昭60−129832(JP,A) 特開 昭60−129833(JP,A) 特開 昭58−92036(JP,A)Continuation of front page (56) Reference JP-A-52-112249 (JP, A) JP-A-60-129832 (JP, A) JP-A-60-129833 (JP, A) JP-A-58-92036 (JP , A)

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】計算結果から有効語長を制限して出力する
加算器において、上位の有効データブロックと下位の丸
め補正用ブロックとから構成し、前記丸め補正用ブロッ
クから前記有効データブロックへ繰り上がるキャリー出
力と前記丸め補正用ブロックの最上位のサム出力との和
がとり得る の3状態それぞれについて、前記有効データブロックの
計算結果を予め前記丸め補正用ブロックの計算と並行に
求め、前記丸め補正用ブロックのキャリーとサムとから
なる3状態の1つが決まった時点で該当する前記有効デ
ータブロックの計算結果の1つを選択して出力すること
を特徴とした丸め加算器。
1. An adder for limiting and outputting a valid word length from a calculation result, which comprises an upper valid data block and a lower rounding correction block, and repeats from the rounding correction block to the valid data block. The sum of the carry output that rises and the highest sum output of the rounding correction block can be taken. For each of the three states, the calculation result of the valid data block is obtained in advance in parallel with the calculation of the rounding correction block, and one of the three states consisting of the carry and the sum of the rounding correction block is applicable when it is determined. A rounding adder characterized by selecting and outputting one of the calculation results of the valid data block.
JP62056712A 1987-03-13 1987-03-13 Rounding adder Expired - Lifetime JPH0664529B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62056712A JPH0664529B2 (en) 1987-03-13 1987-03-13 Rounding adder

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62056712A JPH0664529B2 (en) 1987-03-13 1987-03-13 Rounding adder

Publications (2)

Publication Number Publication Date
JPS63223918A JPS63223918A (en) 1988-09-19
JPH0664529B2 true JPH0664529B2 (en) 1994-08-22

Family

ID=13035092

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62056712A Expired - Lifetime JPH0664529B2 (en) 1987-03-13 1987-03-13 Rounding adder

Country Status (1)

Country Link
JP (1) JPH0664529B2 (en)

Also Published As

Publication number Publication date
JPS63223918A (en) 1988-09-19

Similar Documents

Publication Publication Date Title
US4953115A (en) Absolute value calculating circuit having a single adder
US8745472B2 (en) Memory with segmented error correction codes
JP3244506B2 (en) Small multiplier
US4623982A (en) Conditional carry techniques for digital processors
US4761760A (en) Digital adder-subtracter with tentative result correction circuit
KR100202206B1 (en) Data processing unit for calculating multiplicative inverses of finite bodies
Okano et al. A construction method of high-speed decoders using ROM's for Bose–Chaudhuri–Hocquenghem and Reed–Solomon codes
EP0416869B1 (en) Digital adder/accumulator
US4110831A (en) Method and means for tracking digit significance in arithmetic operations executed on decimal computers
JPH0545982B2 (en)
WO1995005633A2 (en) Carry-look-ahead adder with reduces number of stages
US3842250A (en) Circuit for implementing rounding in add/subtract logic networks
Boo et al. A VLSI architecture for arithmetic coding of multilevel images
JPH0664529B2 (en) Rounding adder
JPH0149973B2 (en)
US3982112A (en) Recursive numerical processor
US4538237A (en) Method and apparatus for calculating the residue of a binary number
US6470371B1 (en) Parallel multiplier
US4879675A (en) Parity generator circuit and method
GB2127187A (en) Circuits for operating on N- digit operands
US5781465A (en) Method and apparatus for fast carry generation detection and comparison
JPH0519170B2 (en)
JP2001517887A (en) Viterbi decoding method and apparatus for puncture code
JPH0778748B2 (en) Galois field arithmetic unit
JPH10215187A (en) Error detection encoding and decoding device and method

Legal Events

Date Code Title Description
EXPY Cancellation because of completion of term