JPS59211137A - Comparison system - Google Patents

Comparison system

Info

Publication number
JPS59211137A
JPS59211137A JP8535283A JP8535283A JPS59211137A JP S59211137 A JPS59211137 A JP S59211137A JP 8535283 A JP8535283 A JP 8535283A JP 8535283 A JP8535283 A JP 8535283A JP S59211137 A JPS59211137 A JP S59211137A
Authority
JP
Japan
Prior art keywords
data
comparison
arithmetic
comparator
logical
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
JP8535283A
Other languages
Japanese (ja)
Inventor
Shigemi Uemoto
重美 上元
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 JP8535283A priority Critical patent/JPS59211137A/en
Publication of JPS59211137A publication Critical patent/JPS59211137A/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/02Comparing digital values
    • G06F7/026Magnitude comparison, i.e. determining the relative order of operands based on their numerical value, e.g. window comparator

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Executing Machine-Instructions (AREA)

Abstract

PURPOSE:To realize an operation to supply two operands as they are in a logic comparison processing mode and another operation to supply the two operands after inverting only the code bits of these operands in an arithmetic comparison processing mode, by constituting a comparator only of a logic comparison function. CONSTITUTION:A logic comparator 4 has only output functions for coincidence (=), larger (>) and smaller (<) states, respectively. Both the 1st and 2nd operand data 1 and 2 are supplied to the comparator 4 via exclusive OR circuit 3 and 3, respectively. An arithmetic comparison signal C is used as an input of the other side of the circuit 3. The data 1 and 2 are supplied to the comparator 4 as they are if they are logic data. While the signal C is applied to the comparator 4 in the form of a signal obtained by inverting only the code bit in the case of the arithmetic data. Thus it is possible to perform a comparison operation between the arithmetic data and the logic data through a single comparator.

Description

【発明の詳細な説明】 (al  発明の技術分野 本発明はデータ処理装置の比較回路に関するものであり
、特に論理比較、算術比較処理を少ない回路で実現する
方式に関す。
DETAILED DESCRIPTION OF THE INVENTION Technical Field of the Invention The present invention relates to a comparison circuit for a data processing device, and particularly to a system for realizing logical comparison and arithmetic comparison processing with a small number of circuits.

山)技術の背景 デ〜り処理装置で演算する機能の1つに比較演算機能が
あるが、算術データと論理データの2つのオペランドデ
ータに対する比較を行うのに、それぞれ専用の比較回路
(1部を専用回路とし、その他を共用化することもある
)を準備し、該回路を算術比較処理か、論理比較処理か
を区別する制御信号で切り替えて処理する方式とか、比
較機能とビット検査機能等を混在させた回路を設けて、
その回路に適合した制御信号で制御する方式とかが一般
的であり、いづれの場合もハードウェア量。
Technical Background One of the functions operated by a data processing device is a comparison calculation function. A method is to prepare a dedicated circuit (sometimes one is a dedicated circuit and the other is shared), and the circuit is switched by a control signal to distinguish between arithmetic comparison processing and logical comparison processing, a comparison function and a bit inspection function, etc. By setting up a circuit that mixes
The most common method is to use a control signal that is suitable for the circuit, and in either case it depends on the amount of hardware.

論理段数が増加したり、制御方法が複雑になる等して、
方式的な改善が望まれていた。
As the number of logic stages increases or the control method becomes complicated,
A systematic improvement was desired.

IcI  従来技術と問題点 従来技術の一実施例を第1図に示す。この図面から明ら
かな如く、2つのオペランドが比較器に入力され、外部
より論理比較か、算術比較かの2つの制御信号が入力さ
れている。従って、比較回路も、例えば論理比較、算術
比較、それぞれの比較を行うことができる2種類の比較
回路を持つ構成で実現されており、回路数が増加し、2
つのオペランドデータが入力されてから比較結果が得ら
れる迄の論理段数も増加し、ハードウェア量の増加、演
算時間の増加する問題があった。
IcI Prior Art and Problems An example of the prior art is shown in FIG. As is clear from this figure, two operands are input to the comparator, and two control signals for logical comparison and arithmetic comparison are input from the outside. Therefore, the comparison circuit is also realized with a configuration that includes two types of comparison circuits that can perform each type of comparison, for example, logical comparison and arithmetic comparison, and the number of circuits increases.
The number of logic stages from inputting operand data to obtaining a comparison result also increases, resulting in an increase in the amount of hardware and calculation time.

+dl  発明の目的 本発明は上記従来の欠点に鑑み、ハードウェア量を少な
くして、且つ論理段数も少なくできるオペランドデータ
の比較方式を提供することを目的とするものである。
+dl OBJECTS OF THE INVENTION In view of the above-mentioned conventional drawbacks, it is an object of the present invention to provide an operand data comparison method that can reduce the amount of hardware and the number of logic stages.

tel  発明の構成 そしてこの目的は、本発明によれば論理比較。tel Structure of the invention And this purpose, according to the invention, is a logical comparison.

算術比較処理を行うデータ処理装置において、論理比較
処理の時は2つのオペランドはその侭比較回路に入力し
、算術比較処理の時は2つのオペランドの符号ビットの
み反転して入力し、上記比較回路は論理比較機能のみで
実現された比較回路で構成される方式を提供することに
よって達成され、比較回路の簡単化、演算時間の短縮化
ができる。
In a data processing device that performs arithmetic comparison processing, when performing logical comparison processing, two operands are input to the side comparison circuit, and when performing arithmetic comparison processing, only the sign bits of the two operands are inverted and input, and the above comparison circuit is inputted. This is achieved by providing a method consisting of a comparison circuit that is realized only with a logical comparison function, which makes it possible to simplify the comparison circuit and shorten the calculation time.

(f)  発明の実施例 以下本発明を図面によって詳述する。第2図は算術デー
タ、即ち符号付きデータと論理データについて、本発明
の詳細な説明する図であり、第3図が本発明の一実施例
を説明する図である。
(f) Examples of the Invention The present invention will be explained in detail below with reference to the drawings. FIG. 2 is a diagram for explaining the present invention in detail with respect to arithmetic data, that is, signed data and logical data, and FIG. 3 is a diagram for explaining one embodiment of the present invention.

第2図の(イ)は符号付きデータを示しており、左側の
データ列は本発明を実施しない場合のデータ列である。
(A) in FIG. 2 shows signed data, and the data string on the left is a data string when the present invention is not implemented.

符号付きデータの場合、その最上位ビットが符号ビット
で、2進数の負の最大値(=2の31乗)を示している
。従って、最上位ピントが“0”であると、最大の負数
値に0が掛けられることになり、結果的には正のデータ
を示し、その最大値は011−1 となり、以下順次小
さくなって000−1.そして零であるooo−oとな
る。
In the case of signed data, the most significant bit is the sign bit, which indicates the maximum negative value of the binary number (=2 to the 31st power). Therefore, if the top focus is "0", the maximum negative value will be multiplied by 0, resulting in positive data, the maximum value will be 011-1, and the values will become smaller sequentially. 000-1. And it becomes ooo-o which is zero.

その次のデータは負の最大値(−2の31乗)に11−
1 (2の31乗−1)を加算した形となって、結果的
には−1を示し、順次小さくなって負の最大値100−
0となることが示されている。この符号付きデータの符
号ビットのみを反転すると、右側に示したデータ列とな
り、論理データの最大値から最小値までのデータ列とな
っている事が理解できる。
The next data is 11-
1 (2 to the 31st power - 1), the result is -1, which gradually decreases to the maximum negative value of 100 -
It has been shown that the value is 0. If only the sign bit of this signed data is inverted, the data string shown on the right side is obtained, and it can be understood that it is a data string from the maximum value to the minimum value of the logical data.

第2図の(ロ)は論理データであって、最下位ビットか
ら最−ヒ位ビットまでが総て2進数のデータとなってい
るので、その最大値は111−1で。
(b) in FIG. 2 is logical data, and since all of the data from the least significant bit to the most significant bit is binary data, its maximum value is 111-1.

最小値はooo−oであって、その侭のデータ列で大小
比較をすれば良いことになる。
The minimum value is ooo-o, and it is sufficient to compare the sizes of the data strings on that side.

本発明は、符号付きデータと論理データの上記特性に着
目してなされたもので、第3図がその一実施例である。
The present invention was made by paying attention to the above-mentioned characteristics of signed data and logical data, and FIG. 3 shows one embodiment thereof.

図面において、1が第1オペランドデータ、2が第2オ
ペランドデータ、3が排他的論理和回路、4が比較器で
一致出力(−)、より大出力(〉)、より小出力(〈)
を出力する。
In the drawing, 1 is the first operand data, 2 is the second operand data, 3 is the exclusive OR circuit, and 4 is the comparator, which indicates a match output (-), a larger output (>), and a smaller output (<).
Output.

この図において、第1オペランドデータ1. 第2オペ
ランドデータ2が算術データとして入力され、制御部(
図示せず)より算術比較信号Cが入力されると、排他的
論理和回路3で上記オペランドデータの符号ビット(最
上位ビット)と制御信号Cとの排他的論理和がとられ、
第1,2オペランドデータの符号ビットのみが反転され
、その他のビットはその侭比較器4に入力されて、2つ
の算術データが論理データとして扱われ、比較が行われ
る。
In this figure, first operand data 1. The second operand data 2 is input as arithmetic data, and the control unit (
When an arithmetic comparison signal C is inputted from (not shown), the exclusive OR circuit 3 performs an exclusive OR of the sign bit (most significant bit) of the operand data and the control signal C.
Only the sign bits of the first and second operand data are inverted, the other bits are input to the comparator 4, and the two arithmetic data are treated as logical data and compared.

そして、前記第1.2オペランドデータが論理データの
時は、前記制御部より送られてくる制御信号Cは算術比
較でない信号となるので、この時の論理データの最上位
ビットは反転されないで比較器4に入力され、2つの論
理データの比較が行われる。
When the 1.2nd operand data is logical data, the control signal C sent from the control section is not an arithmetic comparison signal, so the most significant bit of the logical data at this time is not inverted and compared. The two logical data are input to the device 4, and the two logical data are compared.

尚、ここでいう比較器は加算器を主体とした演算回路で
実現しても良く、父上位ビットよりビット対応で順次走
査して、大小比較を行う専用回路で実現しても良く、そ
の実現手段の如□何によって、本発明の実施を妨げる要
因は起こらない。
The comparator referred to here may be realized by an arithmetic circuit mainly consisting of an adder, or it may be realized by a dedicated circuit that sequentially scans bits from the uppermost bit and compares the magnitude. No matter the means used, there will be no impediment to the implementation of the present invention.

(a 発明の効果 以上詳細に説明したように、本発明によれば論理データ
の比較と、算術データの比較が1つの比較器に、算術比
較か、論理比較かを区別する制御信号を送出するのみで
、算術比較の時は2つのオペランドデータの最上位ビッ
ト(符号ビット)を反転し、算術データを論理データと
同じ扱いをする事で、簡単に算術比較、論理比較の演算
ができ、ハードウェア量と論理段数との削減ができる効
果がある。
(a) Effects of the Invention As explained in detail above, according to the present invention, a control signal is sent to a single comparator for comparing logical data and comparing arithmetic data to distinguish whether it is an arithmetic comparison or a logical comparison. When performing an arithmetic comparison, the most significant bit (sign bit) of the two operand data is inverted and the arithmetic data is treated the same as logical data, making it easy to perform arithmetic and logical comparisons. This has the effect of reducing the amount of hardware and the number of logical stages.

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

第1図は従来技術の一実施例をブロック図で示す図、第
2図は算術データと論理データについて本発明の詳細な
説明する図、第3図は本発明の一実施例をブロック図で
示す図である。 図面において1は第1オペランドデータ、2は第2オペ
ランドデータ、3は排他的論理和回路。 4は比較器、Cは算術演算を示す制御信号をそれぞれ示
す。 −(θ  1 つ     Q θ 一 種 顯  。− 幅 205− ト −      \    −一 も     も膓
FIG. 1 is a block diagram showing an embodiment of the prior art, FIG. 2 is a diagram illustrating the present invention in detail regarding arithmetic data and logical data, and FIG. 3 is a block diagram showing an embodiment of the present invention. FIG. In the drawing, 1 is first operand data, 2 is second operand data, and 3 is an exclusive OR circuit. 4 indicates a comparator, and C indicates a control signal indicating an arithmetic operation. - (1 θ 1 Q θ 1 type. - Width 205 - To - \ -1 Momo 1

Claims (1)

【特許請求の範囲】[Claims] 論理比較、算術比較処理を行うデータ処理装置において
、論理比較処理の時は2つのオペランドはその侭比較回
路に入力し、算術比較処理の時は2つのオペランドの符
号ピントのみ反転して入力し、上記比較回路は論理比較
機能のみで実現された比較回路で構成されることを特徴
とする比較方式。
In a data processing device that performs logical comparison and arithmetic comparison processing, when performing logical comparison processing, two operands are input to the side comparison circuit, and when performing arithmetic comparison processing, only the sign focus of the two operands is inverted and input; A comparison method characterized in that the comparison circuit is constituted by a comparison circuit realized only with a logical comparison function.
JP8535283A 1983-05-16 1983-05-16 Comparison system Pending JPS59211137A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP8535283A JPS59211137A (en) 1983-05-16 1983-05-16 Comparison system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP8535283A JPS59211137A (en) 1983-05-16 1983-05-16 Comparison system

Publications (1)

Publication Number Publication Date
JPS59211137A true JPS59211137A (en) 1984-11-29

Family

ID=13856288

Family Applications (1)

Application Number Title Priority Date Filing Date
JP8535283A Pending JPS59211137A (en) 1983-05-16 1983-05-16 Comparison system

Country Status (1)

Country Link
JP (1) JPS59211137A (en)

Similar Documents

Publication Publication Date Title
JPH0746310B2 (en) Semiconductor logic circuit
JPH08339291A (en) Selection circuit of maximum value
JPH0228830A (en) Integer number dividing circuit
JPS6125245A (en) Rounding process circuit
US6629118B1 (en) Zero result prediction
JPS59211137A (en) Comparison system
JPH01220528A (en) Parity generator
JPH0619700B2 (en) Arithmetic unit
JPH0223421A (en) Arithmetic processing unit
JPS61275936A (en) Condition determining device
JPH01163836A (en) Method of apparatus for evaluate conditions of data processor clearly
JPS59229659A (en) Data processing method
JPH03102265A (en) Maximum value detecting circuit
JPS6041772B2 (en) Parity creation circuit
JPH0736665A (en) Arithmetic unit
JPS62269228A (en) Arithmetic and logic unit
JPS6175926A (en) Hardware divider
JPH0254333A (en) Value comparator
JPH03257630A (en) Priority detecting circuit
JPH0795265B2 (en) Comparison circuit
JPH02148140A (en) Conditional branch control system for information processor
JPH03135209A (en) Arithmetic processing unit
JPS62274334A (en) Data processor
JPH06175822A (en) Decimal arithmetic instruction processor
JPH03178224A (en) Decoder with enable signal