JPH0479014B2 - - Google Patents

Info

Publication number
JPH0479014B2
JPH0479014B2 JP57229421A JP22942182A JPH0479014B2 JP H0479014 B2 JPH0479014 B2 JP H0479014B2 JP 57229421 A JP57229421 A JP 57229421A JP 22942182 A JP22942182 A JP 22942182A JP H0479014 B2 JPH0479014 B2 JP H0479014B2
Authority
JP
Japan
Prior art keywords
logic
result
bit
zero
condition code
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
JP57229421A
Other languages
Japanese (ja)
Other versions
JPS59121539A (en
Inventor
Koichi Ueda
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP57229421A priority Critical patent/JPS59121539A/en
Publication of JPS59121539A publication Critical patent/JPS59121539A/en
Publication of JPH0479014B2 publication Critical patent/JPH0479014B2/ja
Granted legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30094Condition code generation, e.g. Carry, Zero flag

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)

Description

【発明の詳細な説明】 (A) 発明の技術分野 本発明は、条件コード決定回路、特に演算結果
が零になるとか比較結果が等しいとかいう零状態
の発生をキヤリ・インの制御を不要として可能な
限ぎり早期に検出できる結果非零検出ロジツクを
もうけた条件コード決定回路に関するものであ
る。
[Detailed Description of the Invention] (A) Technical Field of the Invention The present invention is directed to a condition code determination circuit, and in particular, to a condition code determination circuit, which enables generation of a zero state such as an operation result being zero or a comparison result being equal, without the need for carry-in control. The present invention relates to a condition code determining circuit that includes logic for detecting non-zero results that can be detected as early as possible.

(B) 技術の背景と問題点 従来から、演算結果が零になるとか比較結果が
等しいという如き状態を決定することは、言わば
すべての演算が終了することとなる可能性があ
り、早期に決定することは仲々困難である。
(B) Background and problems of the technology Conventionally, determining a state such as when the operation result is zero or when the comparison results are equal has the potential to end all operations, so it has been necessary to make decisions early. It is very difficult to do so.

(C) 発明の目的と構成 本発明は、上記の点を解決することを目的とし
ており、実効上、オペランド・データの連続する
2ビツトの論理をとる構成によつて高速度で条件
コードを決定できるようにすることを目的として
いる。そしてそのため、本発明の条件コード決定
回路は、演算を行つた結果の条件コードを決定す
る条件コード決定回路において、加算系の命令に
対応して被加数および加数の夫々に対して最下位
ビツトの下位に予め定めた論理値を附加したオペ
ランドを生成し、かつ減算系の命令に対応して減
数の各ビツトの反転を行つた数および被減数の
夫々に対して最下位ビツトの下位に上記予め定め
た論理値の逆の論理値を附加したオペランドを生
成するよう構成すると共に、上記オペランドを結
果非零検出ロジツクとキヤリ・ルツク・アヘツ
ド・ロジツクに供給するよう構成されてなり、上
記結果非零検出ロジツクは、2つのオペランドの
各ビツトに対応して、 EOR0〓OR1+EOR1〓OR2+……+EORi
ORi+1 なる演算を行うよう構成され、上記キヤリ・ルツ
ク・アヘツド・ロジツクの結果と上記結果非零検
出ロジツクの結果とにもとづいて、上記条件コー
ドが非零であることを決定するようにしたことを
特徴としている。以下図面を参照しつつ説明す
る。
(C) Object and structure of the invention The present invention aims to solve the above points, and effectively determines a condition code at high speed by using a structure that takes the logic of continuous 2-bit operand data. The purpose is to make it possible. Therefore, in the condition code determining circuit of the present invention, which determines the condition code of the result of an operation, the lowest-order Generates an operand by adding a predetermined logical value to the lower bit of the bit, and inverts each bit of the subtrahend in response to a subtraction instruction. It is configured to generate an operand to which a logical value opposite to a predetermined logical value is added, and is configured to supply the operand to a non-zero result detection logic and a carry-look-ahead logic, so that the result is non-zero. The zero detection logic calculates EOR 0 〓OR 1 +EOR 1 〓OR 2 +……+EOR i 〓 for each bit of the two operands.
It is configured to perform the operation OR i+1 , and determines that the condition code is non-zero based on the result of the carry-look-ahead logic and the result non-zero detection logic. It is characterized by what it did. This will be explained below with reference to the drawings.

(D) 発明の実施例 第1図は本発明に用いるオペランドを説明する
説明図、第2図は第1図図示のオペランドの場合
に演算した結果が零となるパターンを説明する説
明図、第3図は第2図図示のパターンの存在を検
出する条件を説明する説明図、第4図A,Bは一
緒になつて1つの図面を形成している結果非零検
出ロジツクを説明する説明図、第5図は本発明の
一実施例条件コード決定回路、第6図は第5図図
示の結果非零検出ロジツクの一実施例構成を示
す。
(D) Embodiments of the Invention FIG. 1 is an explanatory diagram for explaining operands used in the present invention, FIG. 3 is an explanatory diagram explaining the conditions for detecting the existence of the pattern shown in FIG. , FIG. 5 shows a condition code determining circuit according to an embodiment of the present invention, and FIG. 6 shows an embodiment of the non-zero result detection logic shown in FIG.

本発明の場合、例えば減算処理の場合に減数の
1′S補数をとつて加算し最下位ビツトに論理「1」
を加算することを考慮し、加算系の演算を行う場
合には第1図図示オペランド群1として示す如き
オペランドOP1とOP2とを用い、また減算系の
演算を行う場合には第1図図示オペランド群2と
して示す如きオペランドOP1とOP2とを用いる
ようにする。即ち、加算系の演算の場合、最下位
ビツトの下位に論理「0」を附加した例えば33ビ
ツトのオペランドを用いて加算する。また減算系
の演算の場合、減数側の1′S補数をとると共に上
記と同様に最下位ビツトの下位に論理「1」を附
加した、例えば33ビツトのオペランドを用いて加
算する。
In the case of the present invention, for example, in the case of subtraction processing,
Take the 1′S complement, add it, and set the lowest bit to logic “1”
When performing an addition type operation, use operands OP1 and OP2 shown as operand group 1 in Figure 1, and when performing a subtraction type operation, use operands OP1 and OP2 shown in Figure 1. Operands OP1 and OP2 as shown in group 2 are used. That is, in the case of addition-based operations, addition is performed using, for example, a 33-bit operand in which logic "0" is added to the lower part of the least significant bit. In addition, in the case of subtraction operations, the 1'S complement on the subtractive side is taken, and addition is performed using, for example, a 33-bit operand in which logic "1" is added to the lower order of the least significant bit in the same manner as above.

オペランドOP1とOP2とが第1図に示す如き
ものであるとした場合に、演算結果が33ビツトの
範囲内でオール零となるパターンは、第2図図示
パターン1−1、2−1、1−2、1−3に絞ら
れる。パターン1−1は、全ビツトがすべて論理
「0」である場合を表わしている。パターン2−
1は、附加ビツト(#32ビツト)を除いて、他の
ビツトについて、オペランドOP1のビツトとOP
2のビツトとがEOR関係にある場合を表わして
いる。パターン1−2は、オペランドOP1のビ
ツトとOP2のビツトとについて任意の或るビツ
ト位置以下が共に論理「0」であり、当該位置の
上位位置についてのビツトがEOR関係にある場
合を表わしている。パターン1−3は、オペラン
ドOP1とOP2との最上位ビツトが共に論理
「1」であり他ビツトが夫々共に論理「0」であ
る場合を表わしている。これらのパターンは、両
者オペランドを加算すると、33ビツトの範囲内で
オール零となる。
Assuming that operands OP1 and OP2 are as shown in Figure 1, the patterns in which the operation result is all zero within a range of 33 bits are patterns 1-1, 2-1, and 1 shown in Figure 2. -2, narrowed down to 1-3. Pattern 1-1 represents the case where all bits are all logic "0". Pattern 2-
1 is the bit of operand OP1 and OP for other bits except for the additional bit (#32 bit).
This shows the case where there is an EOR relationship with bit 2. Pattern 1-2 represents a case where the bits of operands OP1 and OP2 below an arbitrary bit position are both logic "0", and the bits at the upper position of that position are in an EOR relationship. . Patterns 1-3 represent the case where the most significant bits of operands OP1 and OP2 are both logic "1" and the other bits are both logic "0". In these patterns, when both operands are added, they become all zeros within a range of 33 bits.

本発明の場合、演算結果がオール零となるケー
スを早期に検出しようとするものであるが、上記
演算結果において、例えばパターン1−3の場合
に、オーバフローが生じたか否かなどについて
は、第5図に示すキヤリ・ルツク・アヘツド・ロ
ジツクによつて判定される。
In the case of the present invention, a case where the calculation result is all zero is detected early, but it is not possible to determine whether or not an overflow has occurred in the above calculation result, for example, in the case of pattern 1-3. This is determined by the carry look head logic shown in FIG.

該オーバフローの判定などをキヤリ・ルツク・
アヘツド・ロジツクによつて判定するものとした
場合、オペランドOP1とOP2とが第2図図示パ
ターン1−1、2−1、1−2、1−3のいずれ
かとなつているか否かは、オペランドOP1とOP
2との夫々の連続する3ビツト(ao、ao+1
ao+2)と(bo、bo+1、bo+2)とについて、第3図
図示ないしの演算が論理「1」となるか否か
を調べれば足りる。
Carry/look/check the overflow judgment, etc.
If the determination is made by ahead logic, whether or not operands OP1 and OP2 have any of the patterns 1-1, 2-1, 1-2, and 1-3 shown in FIG. OP1 and OP
2 and each successive 3 bits (a o , a o+1 ,
It is sufficient to check whether or not the operations not shown in FIG. 3 result in logic "1" for a o+2 ) and (b o , b o+1 , b o+2 ).

なお、ちなみに、例えばoはビツトaoとbo
のオア論理の否定(oo)を表わしており、
また例えばEORoは同様に(aobo)を表わし、
ANDoは同様に(ao・bo)を表わしている。
By the way, for example, o represents the negation of the OR logic between bits a o and b o ( o + o ),
Also, for example, EOR o similarly represents (a o b o ),
AND o similarly represents (a o・b o ).

第3図図示ないしの夫々の演算について、
ビツト0、1、……32まで、即ち(n=0、1、
……32)ついて調べ、「いずれも論理「1」にな
らない場合には、演算結果はオール零にならな
い」ことが判る。逆に言えば、「オール零となる
のはいずれかが論理「1」となる場合に限られ
る」ことが判る。
Regarding each calculation not shown in Fig. 3,
Bits 0, 1, ... up to 32, i.e. (n=0, 1,
...32) and find out that ``if none of them becomes logical ``1'', the result of the operation will not be all zero''. Conversely, it can be seen that ``all zeros occur only when one of them becomes logical ``1.''

この結果を整理して、結果非零を検出する条件
を示すと、第4図に示す如きものとなる。即ち、 n=0、1、2、……30 について、第3図図示のまたはまたはまた
はまたはでない条件〓RESULT NOT
ZERO”は結局、いわば (aobo)(ao+1+bo+1) なる演算をn=0、1、……、31まで行つて、い
ずれかが論理「1」となることを検出すれば足り
ることとなる。
When the results are organized and the conditions for detecting a non-zero result are shown, the results are as shown in FIG. That is, for n = 0, 1, 2, ...30, the condition shown in Figure 3 is RESULT NOT
ZERO” is a so-called (a o b o ) (a o+1 + b o+1 ) operation until n=0, 1, ..., 31, and one of them becomes logical “1”. Detection is sufficient.

第5図は本発明の一実施例条件コード決定回路
を表わしている。図中の符号3はオペランドOP
1セツト部、4はオペランドOP2セツト部、5
はキヤリ・ルツク・アヘツド・ロジツク、6は結
果非零検出ロジツクを表わしている。
FIG. 5 shows a condition code determining circuit according to an embodiment of the present invention. Code 3 in the diagram is operand OP
1 set part, 4 is operand OP2 set part, 5
6 represents the carry-look-ahead logic, and 6 represents the result non-zero detection logic.

加算系演算の場合、図示のOP1DATAの最下
位ビツトの下位に#32ビツトを用意して論理
「0」を附加し、OP2DATAにも同様に#32ビ
ツトを用意して論理「0」を附加して、夫々オペ
ランド・セツト部3,4にセツトされる。また減
算系演算の場合には、図示のOP1DATAには
#32ビツトとして論理「1」が附加され、OP2
DATAにはビツト反転された上で#32ビツトと
して論理「1」が附加されて、夫々セツトされ
る。
For addition operations, prepare #32 bit below the least significant bit of OP1DATA shown in the figure and add logic "0" to it, and similarly prepare #32 bit to OP2DATA and add logic "0" to it. Then, they are set in the operand set sections 3 and 4, respectively. In addition, in the case of subtraction type operations, logic "1" is added as #32 bit to OP1DATA shown in the figure, and OP2
After the bits of DATA are inverted, a logic "1" is added as bit #32, and the data is set.

キヤリ・ルツク・アヘツド・ロジツク5は従来
公知の如く所望の出力を発生し、結果非零検出ロ
ジツク6は第4図に関連して説明した処理を行
う。そして、両者ロジツクの出力にもとづいて、
演算結果が零でないことを高速度で判定するよう
にする。
Carry look head logic 5 generates the desired output as is known in the art, and non-zero result detection logic 6 performs the processing described in connection with FIG. Then, based on the output of both logics,
To quickly determine whether a calculation result is not zero.

第6図は結果非零検出ロジツクの一実施例構成
を示す。図中の符号OP1o,OP1o+1……は上述
のビツトao、ao+1……に対応し、OP2o,OP2o+
……は同じくビツトbo、bo+1……に対応してい
る。+SUBは減算系の演算であるとき論理「1」
とされる。また7o、7o+1は減算系演算時にOP2
のビツト反転を行うEOR回路、8oは(aobo)を
行うEOR回路、9o+1は(ao+1+bo+1)を行うOR
回路、10oは (aobo)(ao+1+bo+1) を行うEOR回路、11は全体をまとめるための
NOR回路を表わしている。
FIG. 6 shows an embodiment of the non-zero result detection logic. The symbols OP1 o , OP1 o+1 ... in the figure correspond to the above-mentioned bits a o , a o+1 ..., and OP2 o , OP2 o+
1 ...corresponds to bits b o , b o+1 ... as well. +SUB is logic “1” when it is a subtraction type operation
It is said that Also, 7 o and 7 o+1 are OP2 during subtraction operations.
8 o is an EOR circuit that performs bit inversion of (a o b o ), 9 o+1 is an OR circuit that performs (a o+1 + b o+1 )
The circuit, 10 o is an EOR circuit that performs (a o b o ) (a o+1 + b o+1 ), and 11 is the EOR circuit that performs (a o b o ) (a o+1 + b o+1 ).
It represents a NOR circuit.

(E) 発明の効果 以上説明した如く、本発明によれば、キヤリ・
インの制御を不要でかつ結果が非零となる状態を
より詳しく高速度で判定することが可能となる。
またいわば連続する2ビツト分のみを調べてゆく
状態をスキヤンさせた形をとればよく、回路構成
も簡単となる。
(E) Effect of the invention As explained above, according to the present invention,
This makes it possible to determine in more detail and at high speed the state in which the result is non-zero without the need for control of input.
In addition, it is sufficient to scan the state in which only two consecutive bits are examined, so that the circuit configuration becomes simple.

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

第1図は本発明に用いるオペランドを説明する
説明図、第2図は第1図図示のオペランドの場合
に演算した結果が零となるパターンを説明する説
明図、第3図は第2図図示のパターンの存在を検
出する条件を説明する説明図、第4図A,Bは一
緒になつて1つの図面を形成している結果非零検
出ロジツクを説明する説明図、第5図は本発明の
一実施例条件コード決定回路、第6図は第5図図
示の結果非零検出ロジツクの一実施例構成を示
す。 図中、1はオペランド群、2はオペランド群、
3,4はオペランド・セツト部、5はキヤリ・ル
ツク・アヘツド・ロジツク、6は結果非零検出ロ
ジツクを表わしている。
Figure 1 is an explanatory diagram for explaining the operands used in the present invention, Figure 2 is an explanatory diagram for explaining the pattern in which the result of calculation is zero in the case of the operands illustrated in Figure 1, and Figure 3 is an explanatory diagram for explaining the operands illustrated in Figure 2. Fig. 4A and B together form one drawing; Fig. 5 is an explanatory drawing explaining the logic for detecting non-zero results; Fig. 5 is an explanatory drawing explaining the conditions for detecting the existence of a pattern; FIG. 6 shows a configuration of an embodiment of the non-zero result detection logic shown in FIG. 5. In the figure, 1 is an operand group, 2 is an operand group,
3 and 4 represent an operand set section, 5 a carry look ahead logic, and 6 a result non-zero detection logic.

Claims (1)

【特許請求の範囲】 1 演算を行つた結果の条件コードを決定する条
件コード決定回路において、加算系の命令に対応
して被加数および加数の夫々に対して最下位ビツ
トの下位に予め定めた論理値を附加したオペラン
ドを生成し、かつ減算系の命令に対応して減数の
各ビツトの反転を行つた数および被減数の夫々に
対して最下位ビツトの下位に上記予め定めた論理
値の逆の論理値を附加したオペランドを生成する
よう構成すると共に、上記オペランドを結果非零
検出ロジツクとキヤリ・ルツク・アヘツド・ロジ
ツクに供給するよう構成されてなり、上記結果非
零検出ロジツクは、2つのオペランドの各ビツト
に対応して、 EOR0〓OR1+EOR1〓OR2+……+EORi
ORi+1 なる演算を行うよう構成され、上記キヤリ・ルツ
ク・アヘツド・ロジツクの結果と上記結果非零検
出ロジツクの結果とにもとづいて、上記条件コー
ドが非零であることを決定するようにしたことを
特徴とする条件コード決定回路。
[Scope of Claims] 1. In a condition code determination circuit that determines the condition code of the result of an operation, in response to an addition-related instruction, a predetermined value is added to the lower order of the least significant bit for each of the summand and addend. Generates an operand with a predetermined logical value added to it, and inverts each bit of the subtrahend in response to a subtraction instruction, and adds the predetermined logical value below the least significant bit for each number and minuend. is configured to generate an operand to which a logical value opposite to Corresponding to each bit of the two operands, EOR 0 〓OR 1 +EOR 1 〓OR 2 +……+EOR i
It is configured to perform the operation OR i+1 , and determines that the condition code is non-zero based on the result of the carry-look-ahead logic and the result non-zero detection logic. A condition code determination circuit characterized by:
JP57229421A 1982-12-28 1982-12-28 Circuit for deciding conditional code Granted JPS59121539A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP57229421A JPS59121539A (en) 1982-12-28 1982-12-28 Circuit for deciding conditional code

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP57229421A JPS59121539A (en) 1982-12-28 1982-12-28 Circuit for deciding conditional code

Publications (2)

Publication Number Publication Date
JPS59121539A JPS59121539A (en) 1984-07-13
JPH0479014B2 true JPH0479014B2 (en) 1992-12-14

Family

ID=16891958

Family Applications (1)

Application Number Title Priority Date Filing Date
JP57229421A Granted JPS59121539A (en) 1982-12-28 1982-12-28 Circuit for deciding conditional code

Country Status (1)

Country Link
JP (1) JPS59121539A (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2532083B2 (en) * 1987-02-26 1996-09-11 株式会社日立製作所 Flag generation circuit
JPH01277931A (en) * 1988-04-29 1989-11-08 Nec Ic Microcomput Syst Ltd Zero detecting circuit
US5598514A (en) * 1993-08-09 1997-01-28 C-Cube Microsystems Structure and method for a multistandard video encoder/decoder
US5910909A (en) * 1995-08-28 1999-06-08 C-Cube Microsystems, Inc. Non-linear digital filters for interlaced video signals and method thereof

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS51147932A (en) * 1975-06-02 1976-12-18 Ibm Sum detection logical circuit
JPS5587243A (en) * 1978-12-25 1980-07-01 Fujitsu Ltd Zero detection system of adder output

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS51147932A (en) * 1975-06-02 1976-12-18 Ibm Sum detection logical circuit
JPS5587243A (en) * 1978-12-25 1980-07-01 Fujitsu Ltd Zero detection system of adder output

Also Published As

Publication number Publication date
JPS59121539A (en) 1984-07-13

Similar Documents

Publication Publication Date Title
US5373459A (en) Floating point processor with high speed rounding circuit
US5508950A (en) Circuit and method for detecting if a sum of two multibit numbers equals a third multibit constant number prior to availability of the sum
JPH0479013B2 (en)
JPH07210368A (en) Efficient handling method by hardware of positive and negative overflows generated as result of arithmetic operation
JPH02144624A (en) Normalization apparatus and method by prospect-zero forecast
JPH01211119A (en) Forecaster for conditions code
US3825895A (en) Operand comparator
JPH0479014B2 (en)
JP3012357B2 (en) Shift amount detection circuit
US6629118B1 (en) Zero result prediction
JP2511527B2 (en) Floating point arithmetic unit
JPS59226944A (en) Addition and subtraction system of floating point data
JPH0464091B2 (en)
JPH05150948A (en) Rounding circuit in floating point multiplier
JPH0511980A (en) Overflow detecting method and circuit
US20080177816A1 (en) Method And Decimal Arithmetic Logic Unit Structure To Generate A Magnitude Result of a Mathematic
JPH0319568B2 (en)
JPH0799808B2 (en) Arithmetic logic unit
JP2752698B2 (en) Floating point addition / subtraction circuit
US5689721A (en) Detecting overflow conditions for negative quotients in nonrestoring two's complement division
JP3696669B2 (en) Comparator mechanism and comparator
JP2591250B2 (en) Data processing device
JP3298119B2 (en) Zero flag generation adder / subtractor
JPS6336434A (en) Arithmetic unit
JPH031228A (en) Floating point multiplier