JPH0573270A - Flag generation circuit for adder - Google Patents

Flag generation circuit for adder

Info

Publication number
JPH0573270A
JPH0573270A JP23458191A JP23458191A JPH0573270A JP H0573270 A JPH0573270 A JP H0573270A JP 23458191 A JP23458191 A JP 23458191A JP 23458191 A JP23458191 A JP 23458191A JP H0573270 A JPH0573270 A JP H0573270A
Authority
JP
Japan
Prior art keywords
carry
digit
circuit
function
adder
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.)
Granted
Application number
JP23458191A
Other languages
Japanese (ja)
Other versions
JP3370688B2 (en
Inventor
Toshinori Maeda
俊則 前田
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 JP23458191A priority Critical patent/JP3370688B2/en
Publication of JPH0573270A publication Critical patent/JPH0573270A/en
Application granted granted Critical
Publication of JP3370688B2 publication Critical patent/JP3370688B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

PURPOSE:To execute the flag generation and the discrimination of the condi tional branch at a high speed with the addition of small number of circuits. CONSTITUTION:An (n)-digit input adder is provided with a PG generation circuit 5 generating the carry generation function for each digit of input, carry propagation function, and NAND for each digit, a carry forecasting circuit 6 generating a carry flag by taking the carry generation function for each digit, carry propagation function, and the carry 15 to the lowest digit as input, and a zero detection circuit 7 inputting an internal signal 21 to be generated by the carry forecasting circuit 6, the NAND for each digit, and the carry 15 to the lowest digit. Accordingly, the high-speed flag generation and the judgment of the conditional branch can be performed with the addition of few circuits by using the internal signal of the carry forecasting circuit, the processing ability of the computer is improved.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、2入力加算器における
フラグ生成回路に関し、特にキャリー先見回路の内部信
号を利用して零フラグの生成および条件分岐の判定を高
速に行う回路に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a flag generation circuit in a 2-input adder, and more particularly to a circuit for generating a zero flag and determining a conditional branch at high speed by using an internal signal of a carry lookahead circuit. ..

【0002】[0002]

【従来の技術】例えば加算命令の後に、加算結果を反映
したフラグを用いて分岐判定を行う条件分岐命令が続く
ような命令列の場合、高速処理のためには加算器の高速
化のみならず、各フラグの生成、そして生成されたフラ
グによる分岐判定の高速化をも図る必要がある。このフ
ラグの中で最も生成の遅れるのが零フラグである。この
ように高速処理を行う上で、加算器の零フラグを高速に
生成することは、益々重要になってきている。
2. Description of the Related Art For example, in the case of an instruction sequence in which an addition instruction is followed by a conditional branch instruction that makes a branch decision using a flag that reflects the addition result, not only is the speed of the adder increased for high-speed processing. It is also necessary to speed up the generation of each flag and the branch determination based on the generated flag. The zero flag is the most delayed of these flags. In such high speed processing, it is becoming more and more important to generate the zero flag of the adder at high speed.

【0003】高速な加算器の零フラグ生成の方法として
は、例えば特開昭55−87243号がある。この方法
は各桁ごとに、加算時には加数と被加数が共に零である
ことを減算時には減数と被減数が等しいことを検出する
加算の中間結果を生成し、全桁についてこの中間結果の
論理積をとることで零フラグを高速に求めようというも
のである。
As a method for generating a zero flag in a high-speed adder, there is, for example, Japanese Patent Laid-Open No. 55-87243. This method generates, for each digit, an intermediate result of addition that detects that the addend and the augend are both zero at the time of addition and that the subtraction and the dividend are equal at the time of subtraction. This is to obtain the zero flag at high speed by taking the product.

【0004】[0004]

【発明が解決しようとする課題】しかしながら上記従来
方法では、最下位桁へのキャリー入力が考慮されていな
いことから、キャリーの加算を伴う場合には対応できな
いという問題点を有していた。
However, the above-mentioned conventional method has a problem that it cannot handle the case where the carry is added because the carry input to the least significant digit is not taken into consideration.

【0005】本発明は上記問題点に鑑み、加算器の加算
出力が確定する時点よりも早い時点で加算器の零フラグ
の生成を行える、2進加算器のフラグ生成回路を提供す
るものである。
In view of the above problems, the present invention provides a flag generating circuit for a binary adder capable of generating the zero flag of the adder at a time earlier than the time when the addition output of the adder is determined. ..

【0006】[0006]

【課題を解決するための手段】上記問題点を解決するた
めに本発明の加算器のフラグ生成回路は、n桁2入力加
算器において、入力の各桁毎にキャリー生成関数とキャ
リー伝搬関数と各桁毎の否定論理和とを生成するPG生
成回路と、前記各桁毎のキャリー生成関数とキャリー伝
搬関数と最下位桁へのキャリーとを入力としキャリーフ
ラグを生成するキャリー先見回路と、前記キャリー先見
回路で生成される内部信号である、(数1)で示される
論理信号と前記各桁毎の否定論理和と前記最下位桁への
キャリーとを入力とする零検出回路とを備えたものであ
る。
In order to solve the above-mentioned problems, the flag generation circuit of the adder of the present invention is an n-digit 2-input adder, which has a carry generation function and a carry propagation function for each input digit. A PG generating circuit for generating a NAND operation for each digit, a carry look-ahead circuit for generating a carry flag by inputting the carry generating function, the carry propagating function, and the carry to the least significant digit for each digit. A zero detection circuit, which is an internal signal generated by the carry look-ahead circuit, represented by (Equation 1), the above-mentioned NOT-OR for each digit, and the carry to the least significant digit is provided. It is a thing.

【0007】[0007]

【作用】n桁の加算器において、キャリーフラグCn-1
は、(数2)によって求まる。
In the n-digit adder, the carry flag Cn-1
Is calculated by (Equation 2).

【0008】[0008]

【数2】 [Equation 2]

【0009】ただし、Gi はキャリー生成関数、Pi は
キャリー伝搬関数であって、それぞれ(数3)で表さ
れ、PG生成回路で生成される。
However, Gi is a carry generation function, and Pi is a carry propagation function, which are represented by (Equation 3) and are generated by the PG generation circuit.

【0010】[0010]

【数3】 [Equation 3]

【0011】また、C-1は最下位桁へのキャリーであ
る。ここで、Pi・Gi はPi とGi の論理積を、Pi
+Gi はPi とGi の論理和を、ai (i=0〜n−
2)は被加数のi桁目を、bi (i=0〜n−2)は加
数のi桁目を示す。このキャリーフラグCn-1 は、キャ
リー先見回路を用いて高速に生成される。
C-1 is a carry to the least significant digit. Here, Pi · Gi is the logical product of Pi and Gi
+ Gi is the logical sum of Pi and Gi, ai (i = 0 to n-
2) indicates the i-th digit of the augend, and bi (i = 0 to n-2) indicates the i-th digit of the addend. This carry flag Cn-1 is generated at high speed by using a carry look-ahead circuit.

【0012】また零フラグは、加算出力がすべて零のと
き1となることから(数4)によって求まる。
Further, the zero flag is 1 when the addition outputs are all zero, and is therefore obtained by (Equation 4).

【0013】[0013]

【数4】 [Equation 4]

【0014】ただし、Si (i=0〜n−1)はi桁目
の加算出力を示し、XSi はSi の論理否定を示す。
However, Si (i = 0 to n-1) represents the addition output of the i-th digit, and XSi represents the logical negation of Si.

【0015】ここで、キャリーフラグの式と零フラグの
式を比較すると、下線部の論理において一致がみられ
る。また零フラグの式中のXPi・XGi(i=0〜n
−2)の項は、(数5)のように簡単に求められる。
Here, when the carry flag expression and the zero flag expression are compared, there is a match in the logic underlined. Further, XPi · XGi (i = 0 to n in the formula of the zero flag)
The term of -2) is easily obtained as in (Equation 5).

【0016】[0016]

【数5】 [Equation 5]

【0017】本発明は、上記した構成によって、2入力
加算器の入力の各桁の論理否定和と、一致する論理部分
をキャリー先見回路の内部信号を用いて零フラグを生成
することで、少ない回路量の増加でキャリーフラグと同
様、高速に零フラグを生成できることとなる。
According to the present invention, with the above-mentioned configuration, the logical negation of each digit of the input of the 2-input adder and the coincident logical part are generated by using the internal signal of the carry look-ahead circuit to generate a zero flag, which is small. As the carry flag increases, the zero flag can be generated at a high speed similarly to the carry flag.

【0018】[0018]

【実施例】【Example】

(実施例1)以下、本発明の一実施例の零フラグ生成回
路について、図面を参照しながら説明する。以下の説明
で用いる図面中の同一の数字および文字は、全図面を通
じて同じ要素を示す。
(Embodiment 1) Hereinafter, a zero flag generation circuit according to an embodiment of the present invention will be described with reference to the drawings. The same numerals and characters in the drawings used in the following description denote the same elements throughout the drawings.

【0019】図1は、本発明の実施例における零フラグ
生成回路のブロック図を示すものである。図1におい
て、1−a、1−bは入力制御部、2はキャリー先見回
路付き2入力2進加算器であって、それぞれの入力に入
力制御部1−a、1−bの出力する演算データA13、
演算データB14と、最下位桁へのキャリー15が与え
られる。また出力として、2進加算出力S16と、演算
結果を反映した零フラグ17とキャリーフラグ18を出
力する。3はPSR(Processor Status Register )3
であって、零フラグ17とキャリーフラグ18を入力し
これを保持する。4はキャリー制御回路であって、PS
R3の出力するキャリー19と演算制御線10を入力と
する。加算/減算の演算モードは、入力制御部1−bと
キャリー制御部4に入力された演算制御線10によって
制御され、減算時には入力データB(減数)12とキャ
リー19を反転(1の補数)し加算器2に与える。入力
制御部1−aは、加算/減算にかかわらず入力データA
11を演算データA13として出力し加算器2に与え
る。5はPG生成回路であって、演算データA13、演
算データB14を入力とし各桁毎にキャリー生成関数G
i 、キャリー伝搬関数Pi と2入力の否定論理和をとっ
た関数Zi を生成し、PG出力関数20として出力す
る。6はキャリー先見回路、7は零検出回路であって、
それぞれPG生成回路5の出力するPG出力関数20と
キャリー15を入力する。零検出回路7はキャリー先見
回路6の内部信号21をも入力とする。零検出回路7は
零フラグ17を、キャリー先見回路6はキャリーフラグ
18をそれぞれ生成し、PSR3に出力する。
FIG. 1 is a block diagram of a zero flag generation circuit according to an embodiment of the present invention. In FIG. 1, 1-a and 1-b are input control units, 2 is a two-input binary adder with a carry look-ahead circuit, and an operation output from the input control units 1-a and 1-b is given to each input. Data A13,
Operation data B14 and carry 15 to the least significant digit are given. Also, as outputs, a binary addition output S16, a zero flag 17 and a carry flag 18 reflecting the calculation result are output. 3 is PSR (Processor Status Register) 3
Therefore, the zero flag 17 and the carry flag 18 are input and held. 4 is a carry control circuit, PS
The carry 19 output from R3 and the operation control line 10 are input. The addition / subtraction operation mode is controlled by the operation control line 10 input to the input control unit 1-b and the carry control unit 4, and at the time of subtraction, the input data B (subtraction) 12 and the carry 19 are inverted (1's complement). Then, it is given to the adder 2. The input control unit 1-a receives the input data A regardless of addition / subtraction.
11 is output as operation data A13 and given to the adder 2. Reference numeral 5 denotes a PG generation circuit, which receives the operation data A13 and the operation data B14 as input and carries out a carry generation function G for each digit.
A function Zi which is the logical sum of i and the carry propagation function Pi and two inputs is generated and output as the PG output function 20. 6 is a carry look-ahead circuit, 7 is a zero detection circuit,
The PG output function 20 and the carry 15 output from the PG generation circuit 5 are input respectively. The zero detection circuit 7 also receives the internal signal 21 of the carry look-ahead circuit 6. The zero detection circuit 7 generates the zero flag 17, and the carry look-ahead circuit 6 generates the carry flag 18, and outputs the carry flag 18 to the PSR 3.

【0020】以下、図1の動作を説明する。ここでの説
明は、4ビットの加算器(n=4)を例に行う。加算器
2において、加算時のキャリーフラグ18(=C3 )は
(数6)で与えられる。
The operation of FIG. 1 will be described below. The description here will be given by taking a 4-bit adder (n = 4) as an example. In the adder 2, the carry flag 18 (= C3) at the time of addition is given by (Equation 6).

【0021】[0021]

【数6】 [Equation 6]

【0022】ここで、Gi はキャリー生成関数、Pi は
キャリー伝搬関数であってそれぞれ、(数3)で求める
ことができる。
Here, Gi is a carry generation function, and Pi is a carry propagation function, which can be obtained by (Equation 3).

【0023】また、C-1は最下位桁へのキャリー15で
ある。ただし、ai 、bi は演算データA13、演算デ
ータB14の各ビットのデータを、ai ・bi はai と
biの論理積を、ai +bi はai とbi の論理和を、
ai xor biはai とbi の排他的論理和を示す。
C-1 is a carry 15 to the least significant digit. However, ai and bi are data of each bit of the operation data A13 and operation data B14, ai.bi is the logical product of ai and bi, and ai + bi is the logical sum of ai and bi,
ai xor bi represents the exclusive OR of ai and bi.

【0024】減算時には、入力データB(減数)12と
キャリー(ボロー)19を反転(1の補数)して加算器
2に与えることにより、加算時と同様(数6)でキャリ
ー(ボロー)フラグ18を得ることができる。この加算
/減算の制御は、演算制御線10によって行われる。よ
って、以下の説明は加算の場合について述べる。
At the time of subtraction, the input data B (decrement) 12 and the carry (borrow) 19 are inverted (1's complement) and given to the adder 2, so that the carry (borrow) flag is obtained at the same time as the addition (expression 6). 18 can be obtained. This addition / subtraction control is performed by the arithmetic control line 10. Therefore, in the following description, the case of addition will be described.

【0025】また、零フラグ17は、各ビットのキャリ
ー生成関数Gi 、キャリー伝搬関数Pi を用いて(数
7)のように表せる。
The zero flag 17 can be expressed as shown in (Equation 7) using the carry generation function Gi and the carry propagation function Pi of each bit.

【0026】[0026]

【数7】 [Equation 7]

【0027】ここで、キャリーフラグの(数6)と零フ
ラグ17の(数7)の第3項目に注目してみる。(数
6)の第3項目つまりG1 ・P3 ・P2は、第1桁目で
キャリーが発生しこれが上位桁へ伝搬することを示して
おり、(数7)の第3項目つまりG1 ・P3 ・P2 ・X
G0・XP0は、最下位桁へのキャリーがない場合で第0
桁目の2入力が共に零でかつ第1桁目でキャリーが発生
し上位桁へ伝搬することで演算結果が零になることを示
している。また(数6)と(数7)を比較すると、各項
の下線部の論理がそれぞれ一致していることが分かる。
また、(数7)において下線部以外の項XGi ・XPi
(i=0〜2) は、(数5)のように2入力の否定論
理和をとればよく、PG生成回路においてPi 、Gi 同
様簡単に求めることができる。
Attention is now paid to the third item of the carry flag (Equation 6) and the zero flag 17 (Equation 7). The third item of (Equation 6), that is, G1 · P3 · P2, indicates that a carry occurs at the first digit and propagates to the upper digit, and the third item of (Equation 7), that is, G1 · P3 · P2 x
G0 and XP0 are 0th when there is no carry to the least significant digit.
It is shown that both the two inputs of the digit are zero and a carry occurs at the first digit and propagates to the upper digit, so that the operation result becomes zero. Further, comparing (Equation 6) and (Equation 7), it can be seen that the underlined logics of the respective terms match.
Also, in (Equation 7), the terms other than the underlined parts XGi and XPi
(I = 0 to 2) may be obtained by a two-input NOR operation as in (Equation 5), and can be easily obtained in the PG generation circuit similarly to Pi and Gi.

【0028】下線部の論理をそれぞれ、(数8)The underlined logic is expressed by (Equation 8)

【0029】[0029]

【数8】 [Equation 8]

【0030】と置き、各桁の否定論理和Xai ・Xbi
をZi と置けば、零フラグの(数7)は、(数9)とな
る。
Is put, and the NOR of each digit Xai.Xbi
If is set to Zi, then the (equation 7) of the zero flag becomes (equation 9).

【0031】[0031]

【数9】 [Equation 9]

【0032】次に、キャリーフラグ18と零フラグ17
を生成する回路について、図2を用いて説明する。図2
は、零フラグの生成を説明する加算器2の構成を示すブ
ロック図である。PG生成回路5は、演算データA1
3、演算データB14を入力とし、各桁毎のキャリー生
成関数Gi 、キャリー伝搬関数Piと各桁の論理否定和
をとった関数Zi を生成し、PG出力関数20として出
力する。キャリー先見回路6は、最下位桁へのキャリー
15とPG出力関数20のうちキャリー生成関数Gi と
キャリー伝搬関数Pi を入力し、キャリーフラグ18と
内部信号21(U、V、W、BP・C-1)を出力する。
7は零フラグ生成回路であって、最下位桁へのキャリー
15とキャリー先見回路6の出力する内部信号21とP
G生成回路5の出力するPG出力関数20の一部である
キャリー伝搬関数P3を論理否定したXP3と前述の関数
Zi(i=0〜2)を入力し零フラグ17を出力する。
Next, carry flag 18 and zero flag 17
A circuit for generating will be described with reference to FIG. Figure 2
FIG. 3 is a block diagram showing a configuration of an adder 2 for explaining generation of a zero flag. The PG generation circuit 5 calculates the operation data A1.
3. With the operation data B14 as input, a carry generation function Gi for each digit, a carry propagation function Pi, and a function Zi which is the logical NOT sum of the digits are generated and output as the PG output function 20. The carry look-ahead circuit 6 inputs the carry generation function Gi and the carry propagation function Pi of the carry 15 to the least significant digit and the PG output function 20, and carries the carry flag 18 and the internal signal 21 (U, V, W, BP.C). -1 ) is output.
Reference numeral 7 denotes a zero flag generation circuit, which carries the carry 15 to the least significant digit and the internal signal 21 and P output from the carry look-ahead circuit 6.
XP3 obtained by logically negating the carry propagation function P3 which is a part of the PG output function 20 output from the G generation circuit 5 and the above-mentioned function Zi (i = 0 to 2) are input and the zero flag 17 is output.

【0033】零フラグの(数7)の下線部の論理を、キ
ャリー先見回路6の内部信号21(U、V、W、BP・
-1)を利用して求めれば、少ない回路量の増加でキャ
リーフラグ18と同様に零フラグ17の生成を高速に行
える。
The logic of the underlined portion of the zero flag (Equation 7) is represented by the internal signals 21 (U, V, W, BP.
If it is obtained using C −1 ), the zero flag 17 can be generated at high speed like the carry flag 18 with a small increase in the circuit amount.

【0034】以上のように、本実施例によれば零フラグ
17の生成は、図2のようにゲート通過段数的にはキャ
リーフラグ18より高々1段程度の増加で求めることが
できる。
As described above, according to this embodiment, the generation of the zero flag 17 can be obtained by increasing the number of gate passage stages by one stage at most from the carry flag 18 as shown in FIG.

【0035】図1、図2では、キャリー先見回路付き4
ビット加算器について説明したが、語長の長い加算の場
合を図3、図4を用いて説明する。図3は、下位桁側加
算器のキャリー先見回路で生成したキャリーを、上位桁
側加算器のキャリー入力に接続することで、各加算器間
のキャリーをリップルキャリー方式で伝搬させる多語長
加算器のブロック図を、図4は、2段のブロックキャリ
ー先見方式を用いた多語長加算器のブロック図を示す。
In FIGS. 1 and 2, the carry look-ahead circuit 4 is provided.
The bit adder has been described, but the case of addition with a long word length will be described with reference to FIGS. 3 and 4. FIG. 3 is a multi-word length addition in which the carry generated by the carry look-ahead circuit of the lower digit side adder is connected to the carry input of the upper digit side adder to propagate the carry between the adders by the ripple carry method. FIG. 4 is a block diagram of a multi-word length adder using a two-stage block carry look-ahead method.

【0036】まず、図3について説明する。各加算器内
のキャリー生成はキャリー先見回路で生成する。各加算
器間のキャリーの伝搬は、下位桁側加算器のキャリー出
力Co を、上位桁側加算器のキャリー入力Cinに接続す
ることで、リップルキャリー方式で伝搬させている。ま
た、キャリー出力Coと共に零検出出力Zo が下位桁側
加算器から出力され、上位桁側加算器の零検出入力Zin
に入力されている。零フラグの式(数7)と下位桁側か
ら入力される零検出入力Zinとの論理積をとることで、
各加算器での零検出出力が得られる。(数10)に最下
位桁加算器での零検出出力の論理式を示す。このように
語長の長い加算においてもキャリーフラグと同程度のゲ
ート通過段数で高速に零フラグの生成が行える。
First, FIG. 3 will be described. The carry generation in each adder is performed by a carry look-ahead circuit. The carry propagation between the adders is carried out in the ripple carry system by connecting the carry output Co of the lower digit side adder to the carry input Cin of the upper digit side adder. Further, the zero detection output Zo is output from the lower digit side adder together with the carry output Co, and the zero detection input Zin of the upper digit side adder is output.
Has been entered in. By taking the logical product of the expression of the zero flag (Equation 7) and the zero detection input Zin input from the lower digit side,
The zero detection output at each adder is obtained. (Equation 10) shows a logical expression of the zero detection output in the least significant digit adder. In this way, even in the addition with a long word length, the zero flag can be generated at high speed with the same number of gate passage stages as the carry flag.

【0037】[0037]

【数10】 [Equation 10]

【0038】ただし、最下位桁加算器のZinには常に1
が入力されて最上位桁加算器の零検出出力が零フラグ1
7となる。
However, Zin of the least significant digit adder is always 1
Is input and the zero detection output of the most significant digit adder is the zero flag 1
It becomes 7.

【0039】次に、図4に示した2段のブロックキャリ
ー先見方式において、各ブロックの桁数を4ビットと
し、4ブロックに分割して16ビットの加算器を構成し
た場合について述べる。図4において、PG生成回路5
で生成されたPG出力関数20はブロックPG生成回路
8に出力される。ブロックPG生成回路8において、ブ
ロックキャリー生成関数BGi 、ブロックキャリー伝搬
関数BPi 、ブロックの2入力が共に零であることを示
す関数BZi 、ブロックの2入力が共に零でなくかつブ
ロックでの演算結果が零であることを示す関数BYi が
生成され、ブロックPG出力関数22として零検出回路
7とブロックキャリー先見回路9に出力される。9はブ
ロックキャリー先見回路でブロックPG出力関数22と
キャリーCin15より、キャリーC3 、C7 、C11とキ
ャリーフラグ18を生成する。7は零検出回路であって
ブロックPG出力関数22とキャリーCin15より零フ
ラグ17を生成し出力する。
Next, in the two-stage block carry look-ahead system shown in FIG. 4, the case where the number of digits of each block is 4 bits and the block is divided into 4 blocks to form a 16-bit adder will be described. In FIG. 4, the PG generation circuit 5
The PG output function 20 generated in (4) is output to the block PG generation circuit 8. In the block PG generation circuit 8, the block carry generation function BGi, the block carry propagation function BPi, the function BZi indicating that the two inputs of the block are both zero, and the two inputs of the block are both not zero and the operation result in the block is A function BYi indicating zero is generated and output to the zero detection circuit 7 and the block carry look-ahead circuit 9 as the block PG output function 22. A block carry look-ahead circuit 9 generates carries C3, C7, C11 and carry flag 18 from the block PG output function 22 and carry Cin15. Reference numeral 7 is a zero detection circuit, which generates and outputs a zero flag 17 from the block PG output function 22 and the carry Cin15.

【0040】最下位ブロックのブロックキャリー生成関
数BG0 と、ブロックキャリー伝搬関数BP0 は、(数
11)であり、他ブロックのブロックキャリー生成関数
BGi (i=1〜3)、ブロックキャリー伝搬関数BP
i (i=1〜3)でも同様の論理式で求まる。
The block carry generation function BG0 and the block carry propagation function BP0 of the least significant block are (Equation 11), and the block carry generation function BGi (i = 1 to 3) and the block carry propagation function BP of the other blocks.
The same logical expression can be obtained for i (i = 1 to 3).

【0041】[0041]

【数11】 [Equation 11]

【0042】またキャリーフラグは、(数12)で求め
られる。
The carry flag is calculated by (Equation 12).

【0043】[0043]

【数12】 [Equation 12]

【0044】同様に最下位ブロックにおける零フラグを
表わす式(数9)を、(数13)
Similarly, the equation (Equation 9) representing the zero flag in the least significant block is given by (Equation 13)

【0045】[0045]

【数13】 [Equation 13]

【0046】のように変形し、最下位ブロックの関数B
Z0 、関数BY0 を(数14)
The function B of the lowest block is transformed as follows.
Z0 and function BY0 (Equation 14)

【0047】[0047]

【数14】 [Equation 14]

【0048】と置けば零フラグの式は、(数15)とな
る。
When the expression is put, the expression of the zero flag becomes (Equation 15).

【0049】[0049]

【数15】 [Equation 15]

【0050】ここでもBYi (i=0〜3)は、ブロッ
クキャリー生成関数BGi を生成する際の内部信号U、
V、Wなどを利用して生成することで、少ない回路量の
増加で高速に求めることができる。
Also here, BYi (i = 0 to 3) is the internal signal U when the block carry generation function BGi is generated,
By using V, W, and the like, generation can be performed at high speed with a small increase in the circuit amount.

【0051】つまり、本方式は語長の長い加算器におい
ても適用可能であり、少ない回路量の増加で高速な零フ
ラグの生成が行える。
That is, this method can be applied to an adder having a long word length, and a high-speed zero flag can be generated with a small increase in the circuit amount.

【0052】(実施例2)ここでは、条件分岐命令にお
ける分岐条件の成立/不成立の判定を高速に実行する回
路について説明する。(表1)に、分岐条件とその判定
論理式を示した。条件分岐の判定において最も処理時間
を要するのが、他のフラグに比べ生成に時間のかかる零
フラグを用いる”Branch on Less or Equal,Unsigned”
(以下BLEUと呼ぶ)と、”Branch on Less or Equal ”
である。
(Embodiment 2) Here, a circuit for rapidly determining whether or not a branch condition in a conditional branch instruction is satisfied will be described. (Table 1) shows the branching conditions and their judgment logical expressions. "Branch on Less or Equal, Unsigned" uses the zero flag, which takes longer to generate than other flags, in the case of conditional branch determination.
(Hereinafter called BLEU) and "Branch on Less or Equal"
Is.

【0053】ここでは、BLEUの判定を高速に実行する回
路について図5を用いて説明する。図5において、23
は分岐判定回路であって、キャリー先見回路6の内部信
号21(U,V,W,BP・C-1)と零検出回路7の内部
信号24とPG生成関数20の一部であるG3を入力
し、分岐判定結果BLEU25を出力する。BLEUの
分岐判定は、(表1)のようにキャリーフラグと零フラ
グの論理和をとることで行える。零フラグの(数7)と
キャリーフラグの(数6)の論理和をとると、(数1
6)となる。
Here, a circuit for executing the BLEU judgment at high speed will be described with reference to FIG. In FIG. 5, 23
Is a branch determination circuit, which is an internal signal 21 (U, V, W, BP.C-1) of the carry look-ahead circuit 6, an internal signal 24 of the zero detection circuit 7 and a G3 which is a part of the PG generation function 20. It inputs and outputs the branch determination result BLEU25. The branch determination of BLEU can be performed by taking the logical sum of the carry flag and the zero flag as shown in (Table 1). When the logical sum of the zero flag (Equation 7) and the carry flag (Equation 6) is taken, (Equation 1
6).

【0054】[0054]

【数16】 [Equation 16]

【0055】となる。(数16)式の論理を実現するの
が分岐判定回路23である。分岐判定回路23は、キャ
リー先見回路6の内部信号U,V,W,BP・C-1と零
検出回路7の内部信号24と最上位桁のキャリー生成関
数G3とを入力とすることで(数16)の論理を実現す
る。ここで(数16)の下線部の論理は零検出回路7の
内部信号24で実現できる。つまり、キャリー先見回路
6の内部信号U、V、W、BP・C-1を用い、キャリー
フラグ、零フラグと並列に分岐条件BLEUの成立/不
成立の判定を行うことで加算結果が確定するより早く分
岐の判定が行える。 なお、第1の実施例では加算器、
分割したブロックとも4ビットのものを例にとって説明
したが、桁数として4ビット以外の加算器、ブロックで
もよい。また多語長加算器を実現する上で桁数の異なる
加算器、ブロックを混用することも可能であることはい
うまでもない。
It becomes The branch determination circuit 23 implements the logic of the equation (16). The branch determination circuit 23 inputs the internal signals U, V, W, BP · C-1 of the carry look-ahead circuit 6, the internal signal 24 of the zero detection circuit 7 and the carry generation function G3 of the most significant digit ( The logic of Expression 16) is realized. Here, the underlined logic of (Equation 16) can be realized by the internal signal 24 of the zero detection circuit 7. That is, the addition result is determined by using the internal signals U, V, W, and BP · C-1 of the carry look-ahead circuit 6 to determine whether or not the branch condition BLEU is satisfied in parallel with the carry flag and the zero flag. The branch can be judged quickly. In the first embodiment, an adder,
Although the divided blocks have been described by taking 4-bit ones as an example, the number of digits may be an adder or a block other than 4-bit. Needless to say, it is possible to mix adders and blocks having different numbers of digits in order to realize a multi-word length adder.

【0056】[0056]

【表1】 [Table 1]

【0057】[0057]

【発明の効果】以上のように本発明は、n桁2入力加算
器において入力の各桁毎にキャリー生成関数とキャリー
伝搬関数と各桁毎の否定論理和とを生成するPG生成回
路と、前記各桁毎のキャリー生成関数とキャリー伝搬関
数と最下位桁へのキャリーとを入力としキャリーフラグ
を生成するキャリー先見回路と、前記キャリー先見回路
で生成される内部信号である、(数1)で示される論理
信号と前記各桁毎の否定論理和と前記最下位桁へのキャ
リーとを入力とする零検出回路とを設けることにより、
キャリー先見回路の内部信号を利用することで少ない回
路の付加でフラグの高速な生成、および分岐判定の高速
化が可能であることから、計算機の処理性能を向上させ
ることができる。
As described above, the present invention includes a PG generating circuit for generating a carry generating function, a carry propagating function, and a NOR operation for each digit in an n-digit 2-input adder. A carry look-ahead circuit that inputs a carry generation function, a carry propagation function, and a carry to the least significant digit for each digit to generate a carry flag, and an internal signal generated by the carry look-ahead circuit (Equation 1). By providing a zero detection circuit that receives as inputs the logical signal shown by the above, the NOR of each digit, and the carry to the least significant digit,
By using the internal signal of the carry look-ahead circuit, it is possible to generate flags at high speed by adding a small number of circuits and to speed up branch determination, so that the processing performance of the computer can be improved.

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

【図1】本発明の第1の実施例における零フラグ生成回
路のブロック図
FIG. 1 is a block diagram of a zero flag generation circuit according to a first embodiment of the present invention.

【図2】同実施例における零フラグ生成を説明する加算
器の構成を示すブロック図
FIG. 2 is a block diagram showing a configuration of an adder for explaining generation of a zero flag in the embodiment.

【図3】同実施例における加算器間のキャリー伝搬をリ
ップルキャリー方式で行う加算器のブロック図
FIG. 3 is a block diagram of an adder in which carry propagation between adders in the embodiment is performed by a ripple carry method.

【図4】同実施例における2段のブロックキャリー先見
方式を用いた加算器のブロック図
FIG. 4 is a block diagram of an adder using a two-stage block carry look-ahead system in the same embodiment.

【図5】BLEUの判定を高速に実行する回路のブロック図FIG. 5 is a block diagram of a circuit for executing BLEU judgment at high speed.

【符号の説明】[Explanation of symbols]

1−a 入力制御部 1−b 入力制御部 2 2入力2進加算器 3 PSR 4 キャリー制御部 5 PG生成回路 6 キャリー先見回路 7 零検出回路 1-a input control unit 1-b input control unit 2 2 input binary adder 3 PSR 4 carry control unit 5 PG generation circuit 6 carry look-ahead circuit 7 zero detection circuit

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】n桁2入力加算器において、入力の各桁毎
にキャリー生成関数とキャリー伝搬関数と各桁毎の否定
論理和とを生成するPG生成回路と、前記各桁毎のキャ
リー生成関数とキャリー伝搬関数と最下位桁へのキャリ
ーとを入力としキャリーフラグを生成するキャリー先見
回路と、前記キャリー先見回路で生成される内部信号で
ある、 【数1】 (数1)で示される論理信号と前記各桁毎の否定論理和
と前記最下位桁へのキャリーとを入力とする零検出回路
とを備えたことを特徴とする加算器のフラグ生成回路。
1. An n-digit 2-input adder, a PG generating circuit for generating a carry generating function, a carry propagating function, and a NOR operation for each digit of each input digit, and a carry generating for each digit. A carry look-ahead circuit that inputs a function, carry propagator, and carry to the least significant digit, and a carry look-ahead circuit, and an internal signal that is generated by the carry look-ahead circuit. A flag generation circuit for an adder, comprising: a logic signal represented by (Equation 1); a zero detection circuit which receives the NOR of each digit and a carry to the least significant digit as inputs.
【請求項2】請求項1記載において、少なくとも2つ以
上の加算器を備え、下位桁側加算器の零検出回路で生成
された零検出出力を、上位桁側加算器の零検出回路に入
力するごとく加算器を直列に接続することを特徴とする
加算器のフラグ生成回路。
2. The zero detection circuit according to claim 1, further comprising at least two adders, wherein the zero detection output generated by the zero detection circuit of the lower digit side adder is input to the zero detection circuit of the higher digit side adder. A flag generation circuit for an adder, characterized in that the adders are connected in series.
【請求項3】請求項1記載において、加算器を複数のブ
ロックに分割して多語長加算器を構成し、PG生成回路
の生成する各桁毎のキャリー生成関数とキャリー伝搬関
数と各桁毎の否定論理和を入力としブロックキャリー生
成関数とブロックキャリー伝搬関数と共に前記各桁毎の
否定論理和の論理積をとることでブロックの2入力が全
て零であることを示す関数とブロックの2入力が共に零
でなくかつブロックでの演算結果が零であることを示す
関数とを生成するブロックPG生成回路と、前記ブロッ
クキャリー生成関数とブロックキャリー伝搬関数と最下
位桁へのキャリーとを入力とするブロックキャリー先見
回路と、前記ブロックキャリー伝搬関数とブロックへの
2入力が共に零であることを示す関数とブロックの2入
力が共に零でなくかつブロックでの演算結果が零である
ことを示す関数と最下位桁へのキャリーとを入力する零
検出回路とを備えたことを特徴とする加算器のフラグ生
成回路。
3. The carry generation function, the carry propagation function, and the digits for each digit generated by the PG generation circuit, wherein the adder is divided into a plurality of blocks to form a multiword length adder. Each of the two inputs of the block and the two of the block are obtained by logically ANDing the negative carry of each digit with the negative carry of each input as well as the block carry generation function and the block carry propagation function. A block PG generation circuit for generating a function indicating that the inputs are not both zero and the operation result in the block is zero, the block carry generation function, the block carry propagation function, and the carry to the least significant digit are input. And the block carry look-ahead circuit, which indicates that both the block carry propagation function and the two inputs to the block are zero, and the two inputs of the block are not zero. Flag generation circuit of the adder, characterized in that a zero detection circuit for inputting a carry to the function and the least significant digit indicating that One block calculation result at is zero.
【請求項4】請求項1記載において、(数1)で示され
る論理信号と前記各桁毎の論理否定和と前記最下位桁へ
のキャリーとを入力とする分岐判定回路を備えたことを
特徴とする加算器のフラグ生成回路。
4. The branch determination circuit according to claim 1, further comprising a logic signal represented by (Equation 1), a logical NOT sum for each digit, and a carry to the least significant digit. A flag generation circuit of a featured adder.
JP23458191A 1991-09-13 1991-09-13 Flag generation circuit of adder Expired - Fee Related JP3370688B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP23458191A JP3370688B2 (en) 1991-09-13 1991-09-13 Flag generation circuit of adder

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP23458191A JP3370688B2 (en) 1991-09-13 1991-09-13 Flag generation circuit of adder

Publications (2)

Publication Number Publication Date
JPH0573270A true JPH0573270A (en) 1993-03-26
JP3370688B2 JP3370688B2 (en) 2003-01-27

Family

ID=16973263

Family Applications (1)

Application Number Title Priority Date Filing Date
JP23458191A Expired - Fee Related JP3370688B2 (en) 1991-09-13 1991-09-13 Flag generation circuit of adder

Country Status (1)

Country Link
JP (1) JP3370688B2 (en)

Also Published As

Publication number Publication date
JP3370688B2 (en) 2003-01-27

Similar Documents

Publication Publication Date Title
US5963461A (en) Multiplication apparatus and methods which generate a shift amount by which the product of the significands is shifted for normalization or denormalization
JP2508912B2 (en) Floating point adder
US6820107B1 (en) Square root extraction circuit and floating-point square root extraction device
JPH09269891A (en) Method and device for adding partial product, method and device for multiplying floating point, and method and device for floating point product-sum operation
JP4388543B2 (en) 3-input floating-point adder / subtracter
JP2002108606A (en) Sticky bit generating circuit and multiplier
JPH06348454A (en) Detection of result of computation of arithmetic or logic operation
JP2618374B2 (en) Finding the position of the most significant digit
JP2683488B2 (en) 3-1 Logical operation device
JPH0823811B2 (en) Method for determining overflow in a three-operand arithmetic logic mechanism and mechanism for detecting arithmetic overflow
JP3018754B2 (en) Carry look-ahead addition method and apparatus
JPH0552530B2 (en)
US6061707A (en) Method and apparatus for generating an end-around carry in a floating-point pipeline within a computer system
US6813628B2 (en) Method and apparatus for performing equality comparison in redundant form arithmetic
JPH08161152A (en) Arithmetic unit for floating point
US20030061253A1 (en) Adder increment circuit
US5117384A (en) Method and apparatus for exponent adder
Lutz et al. The half-adder form and early branch condition resolution
JP3370688B2 (en) Flag generation circuit of adder
US6202078B1 (en) Arithmetic circuit using a booth algorithm
US6826588B2 (en) Method and apparatus for a fast comparison in redundant form arithmetic
JP3745759B2 (en) Hybrid carry lookahead / carry select adder including carry logic for generating complementary hot carry signals and method of making the carry logic
US11442696B1 (en) Floating point multiply-add, accumulate unit with exception processing
JP3286793B2 (en) Circuit and method for determining carry-out
JP2685466B2 (en) Address calculator

Legal Events

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