JPH01155433A - Size comparing circuit - Google Patents

Size comparing circuit

Info

Publication number
JPH01155433A
JPH01155433A JP31448387A JP31448387A JPH01155433A JP H01155433 A JPH01155433 A JP H01155433A JP 31448387 A JP31448387 A JP 31448387A JP 31448387 A JP31448387 A JP 31448387A JP H01155433 A JPH01155433 A JP H01155433A
Authority
JP
Japan
Prior art keywords
circuit
value
bit
limit value
unknown
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
JP31448387A
Other languages
Japanese (ja)
Inventor
Hiroshi Matsushita
博 松下
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 JP31448387A priority Critical patent/JPH01155433A/en
Publication of JPH01155433A publication Critical patent/JPH01155433A/en
Pending legal-status Critical Current

Links

Landscapes

  • Logic Circuits (AREA)

Abstract

PURPOSE:To simplify circuit constitution, to reduce the quantity of hardware, and to lower a cost by unifying a comparator to check whether or not an inputted unknown number is within a regulated range and a decision circuit. CONSTITUTION:On registers 1 and 3, a lower limit value A of (n) bits and an upper limit value B of the same bits are set, respectively. And on a register 2, an unknown value X of (n) bits is set. Those values A, B, and X are inputted from the registers 1-3 to the decision circuit 8, respectively. Assuming the lower limit value A as A0, A1...An, the upper limit value B as B0, B1...Bn, and the unknown value X as X0, X1...Xn, the circuit 8 executes decision whether all of the high-order bits A0, B0, and X0 are 1s or 0s, whether or not the A0 and X0 are 0s and the B0 is 1, and whether or not the A0 is 0 and the X0 and B0 and 1s by an exclusive NOR and an OR. When all of the A0, X0, and B0 are 1s or 0s, the decision whether all of the A1, X1, and B1 are 1s or 0s, whether or not the A1 and X1 are 0s and the B1 is 1, and whether or not the A1 is 0 and the X1 and B1 are 1s are performed by the exclusive NOR and the OR, and a decision operation of A<X<B is repeated.

Description

【発明の詳細な説明】 〔概要〕 人力した未知の値が、予め定まる大小の値の範囲内にあ
るか判定する場合に、少ないハードウェア量で構成した
大小比較回路に関し、 回路構成を簡易化して、コストを低減すると共に、信頼
性を向上させることを目的とし、nビットで構成される
下限値Aと上限値Bを設定したレジスタと、nビットで
構成される未知の値Xを設定したレジスタから同時に入
力される値を比較し、A<X<Bを判定する回路であっ
て、上限値と下限値と未知の値の夫々の最上位ビットが
総て“0”か“1”かの判定と、下限値と未知の値が“
0”で上限値が“l”であるかの判定と、下限値が”0
″で未知の値と上限値が“1”であるかの判定を同時に
行い、総て“0″か“1”の場合は次の下位ビットに対
して、上記同様の判定を行う動作を繰り返し、下限値と
未知の値が“0″で上限値が“1”である場合は、次の
下位ビットの下限値と未知の値が共に“0”か“1”か
の判定と下限値が“0″で未知の値が“1”であるかの
判定を行い、下限値が“O”で未知の値と上限値が“1
″である場合は、次の下位ビットの未知の値と上限値が
共に“O”か“1″かの判定と未知の値が”0”で上限
値が“1”であるかの判定を行う動作を繰り返すことで
、A<X<Bか否かを判定する比較判定回路を設けて構
成する。
[Detailed Description of the Invention] [Summary] The present invention relates to a magnitude comparison circuit configured with a small amount of hardware when determining whether an unknown value manually generated is within a predetermined range of magnitude values, which simplifies the circuit configuration. In order to reduce costs and improve reliability, we set a register with a lower limit value A and an upper limit value B consisting of n bits, and an unknown value X consisting of n bits. This is a circuit that compares values that are simultaneously input from registers and determines whether A<X<B, and whether the most significant bits of the upper limit value, lower limit value, and unknown value are all "0" or "1". The lower limit value and unknown value are “
0" and the upper limit is "l", and the lower limit is "0".
” to determine whether the unknown value and the upper limit value are “1” at the same time, and if they are all “0” or “1”, repeat the same determination as above for the next lower bit. , if the lower limit value and unknown value are “0” and the upper limit value is “1”, it is necessary to determine whether the lower limit value and unknown value of the next lower bit are both “0” or “1”, and the lower limit value is “1”. It is determined whether the unknown value is “1” at “0”, and the lower limit is “O” and the unknown value and upper limit are “1”.
”, determine whether the unknown value and upper limit value of the next lower bit are both “O” or “1”, and determine whether the unknown value is “0” and the upper limit value is “1”. The configuration includes a comparison and determination circuit that determines whether A<X<B by repeating the operations to be performed.

〔産業上の利用分野〕 本発明は入力した未知の値が、予め定まる大小の値の範
囲内にあるか判定する場合に、少ないハードウェア量で
構成することが可能な大小比較回路に関する。
[Industrial Application Field] The present invention relates to a magnitude comparison circuit that can be configured with a small amount of hardware when determining whether an input unknown value is within a predetermined range of magnitude values.

情報処理装置では入力された未知の数が規定の範囲内に
あるか調べるため、大小比較回路が使用されている。こ
のような大小比較回路は、−iに予め定めた上限値と未
知の値とを比較し、更に下限値と未知の値とを比較し、
双方の比較結果に基づき、上限値と下限値が示す範囲内
に未知の値があるか判定している。
In an information processing device, a magnitude comparison circuit is used to check whether an input unknown number is within a specified range. Such a magnitude comparison circuit compares a predetermined upper limit value for -i with an unknown value, further compares a lower limit value with an unknown value,
Based on the results of both comparisons, it is determined whether there is an unknown value within the range indicated by the upper and lower limits.

このような大小比較回路はハードウェア量が少なく信頼
性の高いことが望ましい。
It is desirable that such a magnitude comparison circuit has a small amount of hardware and high reliability.

〔従来の技術〕[Conventional technology]

第5図は従来の技術を説明するブロック図である。 FIG. 5 is a block diagram illustrating a conventional technique.

レジスタ1には予め定めた下限値Aがセットされ、レジ
スタ3には予め定めた上限値Bがセットされる。そして
、レジスタ2には未知の値Xがセットされる。
A predetermined lower limit value A is set in register 1, and a predetermined upper limit value B is set in register 3. Then, an unknown value X is set in register 2.

比較回路4はレジスタ1の値Aとレジスタ2の値Xを比
較し、レジスタ2の値Xがレジスタ1の値Aより大きけ
れば“1”を送出し、大きくなければ“0”を送出する
Comparison circuit 4 compares value A of register 1 and value X of register 2, and if value X of register 2 is larger than value A of register 1, it sends out "1", otherwise it sends out "0".

比較回路5はレジスタ3の値Bとレジスタ2の値Xを比
較し、レジスタ2の値Xがレジスタ3の値Bより小さけ
れば“1”を送出し、小さくなければ“0”を送出する
The comparison circuit 5 compares the value B of the register 3 and the value X of the register 2, and if the value X of the register 2 is smaller than the value B of the register 3, it sends out "1", and if it is not smaller, it sends out "0".

判定回路6は比較回路4と5が共に“1′″を送出する
とフリップフロップ7をセットする。従って、フリップ
フロップ7は“1”を送出して、A<X<Bであるとい
う結果を送出する。
The determination circuit 6 sets the flip-flop 7 when both the comparison circuits 4 and 5 send out "1'". Therefore, flip-flop 7 sends out a "1" and sends out the result that A<X<B.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

上記の如〈従来は、同一内容の比較回路4と5を必要と
し、比較回路4と5で比較した結果に基づき、判定回路
6が判定しているため、回路構成が複雑で、ハードウェ
ア量が多くなり、コストが上昇すると共に信頼性も低下
するという問題がある。
As mentioned above, conventionally, comparison circuits 4 and 5 with the same content are required, and judgment circuit 6 makes a judgment based on the results of comparison between comparison circuits 4 and 5, resulting in a complex circuit configuration and a large amount of hardware. There are problems in that the cost increases and the reliability decreases.

本発明はこのような問題点に鑑み、比較回路と判定回路
を一つにして、回路構成を簡易化し、ハードウェア量を
少なくすることで、コストを低減すると共に、信頼性を
向上させることを目的としている。
In view of these problems, the present invention aims to reduce costs and improve reliability by integrating a comparison circuit and a judgment circuit into one, simplifying the circuit configuration and reducing the amount of hardware. The purpose is

〔問題点を解決するための手段〕[Means for solving problems]

第1図は本発明の原理ブロック図である。 FIG. 1 is a block diagram of the principle of the present invention.

レジスタlには予め定めたnビットの下限値Aがセット
され、レジスタ3には予め定めたnビットの上限値Bが
セットされる。そして、レジスタ2にはnビットの未知
の値Xがセットされ、このA、B及びXの各値はレジス
タ1,2.3から夫々比較判定回路8に入力する。
A predetermined n-bit lower limit value A is set in register l, and a predetermined n-bit upper limit value B is set in register 3. Then, an n-bit unknown value X is set in the register 2, and each value of A, B, and

この場合、下限値Aを^。、A1.八2+ ’−9A6
とし、上限値BをBo、 81. B2.・−・、B、
、とし、未知の値XをXo、 L、 Xz、  ・−・
、Xfiとすると、比較判定回路8は上位ピッ)Ao、
 Xo、 Boが総て“1″が又は“0′″かの判定と
、八〇とxoが“0”で80が“1”かの判定と、八〇
が“0”でXoと80が共に“1”かの判定とを排他的
NORと論理和とにより実行し、Ao、 L。
In this case, the lower limit value A is ^. , A1. 82+ '-9A6
and the upper limit B is Bo, 81. B2.・-・、B、
, and the unknown value X is Xo, L, Xz, ...
,
Determining whether Xo and Bo are all “1” or “0′”, determining whether 80 and xo are “0” and 80 is “1”, and determining whether 80 is “0” and Xo and 80 are Execute exclusive NOR and logical OR to determine whether both are "1", Ao, L.

Boが総て“1”か又は“O”の時は、次のビット、即
ち、AI、 X、、 B、が総て@1″か又は“0”か
の判定と、A1とXIが“0”でB、が“1″かの判定
と、A1が“0″でχ1とB、が共に“1”かの判定を
排他的NORと論理和とにより実行する動作を繰り返す
When Bo is all “1” or “O”, it is determined whether the next bits, namely AI, X, B, are all @1” or “0”, and A1 and XI are “0”. The operation of determining whether B is "1" when A1 is "0" and determining whether both χ1 and B are "1" when A1 is "0" is repeated using exclusive NOR and logical sum.

又、八〇とxoが“0″で80が11”である時は、次
のビット、即ち、^1.X、が共に“1″か又はO”か
の判定を排他的NORで、A1が“0”でXlが“1”
かの判定を論理積で行い、これの論理和によりX、が八
Also, when 80 and xo are "0" and 80 is 11", use exclusive NOR to determine whether the next bit, ^1.X, is both "1" or O. is “0” and Xl is “1”
Judgment is made using logical product, and the logical sum of these results in 8.

よ、り大きいことを判定し、八〇が“0”でxoと80
が共に“1″である時は、L、 B+が共に“1”か又
は“0”かの判定を排他的NORで、XIが“0”で8
1が“1″かの判定を論理積で行い、これの論理和によ
りXlが81より小さいことを判定して、最初の大小判
定結果を得て、A<X<Bであれば“1”を送出してフ
リップフロップ7をセットする。
It is determined that 80 is "0" and xo and 80
When both are “1”, determine whether L and B+ are both “1” or “0” using exclusive NOR, and if XI is “0”, 8
Determine whether 1 is "1" by logical product, determine that Xl is smaller than 81 by the logical sum of this, obtain the first magnitude determination result, and if A<X<B, "1" is sent to set the flip-flop 7.

又、前記の如くAI+ xIn Blが総て“l”か又
は“0”かの判定と、A1とxlが“0”でB、が“1
”かの判定と、A、が“0”で×1とB、が共に“1”
かの判定とを行い、A1とXlが”O”で8.が“1′
である時は、Az、 Xzが共に“1”か又は“o″か
の判定と、A2が“0”でX2が“1”かの判定を行い
、これの論理和によりX2が八2より大きいことを判定
し、八、が“0”でxlと81が共に“l”である時は
、Xz、 Bgが共に“1”が又は“0”かの判定と、
X2が“0”で82が“1”がの判定を行い、これの論
理和によりX2が82より小さいことを判定し、次段の
大小判定結果を得て、A<X<Bであれば“1”を送出
してフリップフロップ7をセットする。
Also, as mentioned above, it is necessary to determine whether AI+ xIn Bl are all "l" or "0", and whether A1 and xl are "0" and B is "1".
”, A is “0” and ×1 and B are both “1”
A1 and Xl are "O" and 8. is “1′”
When , it is determined whether Az and Xz are both "1" or "o", and whether A2 is "0" and X2 is "1", and by the logical sum of these, If 8 is "0" and xl and 81 are both "l", determine whether Xz and Bg are both "1" or "0".
Determine whether X2 is "0" and 82 is "1", and by logical sum of these, determine that X2 is smaller than 82, obtain the next stage size determination result, and if A<X<B Sends "1" and sets the flip-flop 7.

比較判定回路8は、このような判定回路を積み重ねるこ
とで、nビットの未知の値Xが下限値Aと上限値Bの間
にあるが判定する。
The comparison and determination circuit 8 determines whether the n-bit unknown value X is between the lower limit value A and the upper limit value B by stacking such determination circuits.

上記の如くに構成された比較判定回路8の論理式は第2
図に示す如くになる。
The logical formula of the comparison/judgment circuit 8 configured as described above is the second
The result will be as shown in the figure.

第2図において=は排他的NORを示し、・は論理積を
示し、十は論理和を示す。従って、例えば、Ao=Xo
=Boは排他的NOR回路T:Ao、 Xo、 B。
In FIG. 2, = indicates exclusive NOR, . indicates logical product, and 10 indicates logical sum. Therefore, for example, Ao=Xo
=Bo is exclusive NOR circuit T: Ao, Xo, B.

の各ビットが総て“O”か又は“1”か判定され、厄・
xo・BoはAND回路で八〇とχ。が“0”で80が
“1′であるか判定され、Ao ” Xo・BoはAN
D回路で八〇が“O”でX。とBoは“1”であるか判
定される。
It is determined whether each bit is all “O” or “1”.
xo・Bo is an AND circuit with 80 and χ. It is determined whether ``0'' and 80 are ``1'', and Ao''
In the D circuit, 80 is “O” and X. It is determined whether or not Bo is "1".

Ao、 Xo、 Boの各ビットが総て“0″か又は“
1”で無く、八〇とXoが“0″で80が“1”であれ
ば、xoが80より小さいことが判明する。この場合、
^。が“0″でxoと80が共に“l”であることは有
り得ないことであるため、xoが八〇より大きいか否が
は、次のビットの状態で判定される。
Each bit of Ao, Xo, Bo is all “0” or “
If 80 and Xo are "0" and 80 is "1" instead of "1", it turns out that xo is smaller than 80. In this case,
^. Since it is impossible for xo and 80 to both be "l" when xo is "0", it is determined whether xo is greater than 80 or not based on the state of the next bit.

即ち、AtとXlが共に“0”か“1”かと、八、が“
0”でxlが“1”であるかにより、AがXより小さい
ことが判明することになる。
That is, whether At and Xl are both "0" or "1", and 8 is "
0" and xl is "1", it becomes clear that A is smaller than X.

つまり、A、 −X、において^、が“0”でX、が“
1′″であれば、X、はA、より大きく、A<X<Bの
条件が得られたこととなるため、AND回路から1”が
送出され、比較判定回路8は最も少ない段階で大小の判
定結果を送出する。
That is, in A, −X, ^ is “0” and X is “
If it is 1'', X is larger than A, and the condition of A<X<B is obtained, so 1'' is sent from the AND circuit, and the comparison judgment circuit 8 determines the size at the lowest stage. Sends the judgment result.

この時、AI、 Xtの各ビットが“0”か又は“1″
であれば、こ″こで大小の判定が出来ないため、第3ビ
ツトの状態で判定することとなる。即ち、i“・XZニ
オイテAZカ”O’T:Xd)< ”1”TニアFLハ
、X、ハAzより大きく、A<X<Bの条件が得られた
こととなるため、AND回路から“1”が送出される。
At this time, each bit of AI and Xt is “0” or “1”
If so, since it is not possible to judge the size here, the judgment will be made based on the state of the third bit. In other words, i "・Since FL is larger than C, X, and C and the condition of A<X<B is obtained, "1" is sent from the AND circuit.

このようにして、順次下位ビットの状態で判定するが、
最後は最下位ビットの一つ上位のA 6−1、X、、の
各ビットが共に“0”が又は“1”かを判定する条件に
、Afiが“0”でX7が“1”であるかの判定条件を
追加する。
In this way, judgment is made sequentially based on the state of the lower bits,
Finally, the condition for determining whether each bit of A 6-1, X, etc. is both “0” or “1” is that Afi is “0” and Add a condition for determining whether it exists.

AO+ X(1,8(+の各ビットが総て“0”が又は
“1″で無く、八〇とXoが“0”でBoが“1”でな
ければ、L・xo・Boにおいて八〇が“0″でX。と
B。が共に“1″であるか判定する。八。が“0”でX
oが“1”ならば、xoは八。より大きいが、Boより
小さいが不明であり、次のビットの状態で判定する。
AO+ 〇 is “0” and X. Determine whether both B. and B. are “1”. 8. is “0” and X
If o is "1", xo is 8. Although it is larger than Bo, it is unknown whether it is smaller than Bo, and it is determined based on the state of the next bit.

即ち、て・B1において、xlが“0”で81が“1”
であれば、XlはA1より小さく、A<X<Bの条件が
得られたこととなるため、AND回路から“1″が送出
され、比較判定回路8は少ない段階で大小の判定結果を
送出する。
That is, in TeB1, xl is “0” and 81 is “1”
If so, Xl is smaller than A1, and the condition of A<X<B is obtained, so "1" is sent from the AND circuit, and the comparison judgment circuit 8 sends out the judgment result of size in a small number of steps. do.

しかし、L、 B+の各ビットが“0′″か又は“l”
であれば、ここで大小の判定が出来ないため、第3ビツ
トの状態で判定することとなる。即ち、X2・B2にお
いてx2が“0”で81が“1”であれば、xtはB。
However, if each bit of L and B+ is “0′” or “l”
If so, since the magnitude cannot be determined here, the determination will be made based on the state of the third bit. That is, if x2 is "0" and 81 is "1" in X2·B2, xt is B.

より小さ(、A<X<Bの条件が得られたこととなるた
め、AND回路から“1”が送出される。
Since the condition of A<X<B is obtained, "1" is sent from the AND circuit.

このようにして、順次下位ビットの状態で判定するが、
最後は最下位ビットの一つ上位のX 、、+ 。
In this way, judgment is made sequentially based on the state of the lower bits,
The last bit is X, , + which is one higher than the least significant bit.

+Bn−1の各ビットが共に“0”か又は“1”かを判
定する条件に、x7が0”で87が“1”であるかの判
定条件を追加する。
A condition for determining whether x7 is 0 and 87 is 1 is added to the conditions for determining whether each bit of +Bn-1 is both "0" or "1".

^。、 XI BOの各ビットが総て“0”か又は1″
であった場合、次のビットの状態で判定するため、At
、 L、 B+の各ビットが総て“0”か又は“1″で
あるか判定し、At、 L、 B+の各ビットが総て“
0”か又は“1”でない場合は、上記同様にして大小の
判定を行うが、At、 X+、 B+の各ビットが総て
“0″か又は“l”である場合は、又次のビットの状態
で判定する。しかし、A q、−1+  Xn−2+ 
 86−tの各ビットが総て“0”か又は11′″であ
った場合、最下位ビットとその一つ上位のビットの大小
判定において、A n−、とX。−1のビットが“0″
で、B f、−1のビットが“1”であるか、八〇のビ
ットが“0”でX7のビットが“l”であるかを判定す
る条件と、Af、−1が“O”でX9−1とB。−1の
ビットが“1”であるか、X7のビットが“0”で87
のビットが“1”であるかを判定する条件とする。
^. , Each bit of XI BO is all “0” or 1″
If At
, L, and B+ are all “0” or “1”, and each bit of At, L, and B+ is all “0” or “1”.
If it is not “0” or “1”, judge the size in the same way as above, but if each bit of At, X+, B+ is all “0” or “l”, then the next bit Judgment is made in the state of .However, A q, -1+ Xn-2+
If all bits of 86-t are "0" or 11'", in determining the magnitude of the least significant bit and the next higher bit, the bits of A n- and X.-1 are " 0″
Then, the conditions for determining whether the bit of B f, -1 is "1", the bit of 80 is "0" and the bit of X7 is "l", and the condition that determines whether the bit of B f, -1 is "O" So X9-1 and B. -1 bit is “1” or X7 bit is “0” and 87
This is the condition for determining whether the bit of is “1”.

〔作用〕[Effect]

上記の如(構成することにより、比較判定回路8はレジ
スタ1と3から入力する上限値と下限値の間に、レジス
タ2から入力する未知の値があるか否かを判定すること
が可能となるため、同一内容の比較回路を2個使用する
必要が無く、回路構成を簡易化して、コストを低減する
と共に、信頼性を向上させることが出来る。
By configuring as described above, the comparison judgment circuit 8 can judge whether there is an unknown value input from register 2 between the upper limit value and lower limit value input from registers 1 and 3. Therefore, there is no need to use two comparison circuits with the same content, and the circuit configuration can be simplified, cost can be reduced, and reliability can be improved.

〔実施例〕〔Example〕

第3図は本発明の一実施例を示す回路のブロック図で、
第4図は第3図の動作論理を説明する図である。
FIG. 3 is a block diagram of a circuit showing one embodiment of the present invention.
FIG. 4 is a diagram illustrating the operational logic of FIG. 3.

第3図は第1図の比較判定回路8の詳細ブロック図であ
り、前記nビットが4ビツトの場合を示す。レジスタl
から八〇〜^3の各ビットが端子80〜a3に、レジス
タ2からX0〜X、の各ビットが端子X。
FIG. 3 is a detailed block diagram of the comparison/judgment circuit 8 shown in FIG. 1, and shows the case where the n bits are 4 bits. register l
Each bit from 80 to ^3 is connected to terminal 80 to a3, and each bit from register 2 to X0 to X is connected to terminal X.

〜x3に、レジスタ3から80〜B3の各ビットが端子
b0〜b、に夫々入力する。
~x3, each bit of register 3 to 80~B3 is input to terminals b0~b, respectively.

第4図に示すAo=に。=8.は排他的NOR回路30
により実行され、A + = X t = [1tは排
他的NOR回路44で実行され、At ・Xg ・Rt
 ’ A:I ’ XsはNOT回路10.12.13
とAND回路11.14゜15.17で実行され、て・
×2・B2・モ・B、はNOT回路16とAND回路1
B、19,20.25で実行される。
At Ao= shown in FIG. =8. is exclusive NOR circuit 30
A + = X t = [1t is executed in the exclusive NOR circuit 44, At ・Xg ・Rt
'A:I' Xs is NOT circuit 10.12.13
It is executed with AND circuit 11.14°15.17, and
×2・B2・Mo・B, is NOT circuit 16 and AND circuit 1
B, 19, 20. Executed at 25.

又、石・X+−8+はAND回路27と43で実行され
、Az=Xz ・A3−X5十Az−Xzは排他的NO
R回路21とAND回路23.20及びOR回路24で
実行され、A、・×1・B1はNOT回路46とAND
回路47.50で実行され、Xz=Ih ・Xs ・B
3+Xz ’ Bgは排他的NOR回路22とNOT回
路16とAND回路18.49とOR回路48で実行さ
れる。
Also, the stone ・X+-8+ is executed by AND circuits 27 and 43, and Az=Xz ・A3-X5 0Az-Xz is an exclusive NO
It is executed by the R circuit 21, the AND circuit 23, 20, and the OR circuit 24, and A,・×1・B1 is executed by the NOT circuit 46 and the AND
Executed in circuit 47.50, Xz=Ih ・Xs ・B
3+Xz' Bg is executed by exclusive NOR circuit 22, NOT circuit 16, AND circuit 18, 49, and OR circuit 48.

又、■・乙・BoはNOT回路34.35及びAND回
路33.36で実行され、八1=XIは排他的NOR回
路44”?!執行サす、Ih=Xz ・A3−X3+/
h”Lは排他的NOR回路21とAND回路23とOR
回路24で実行され、At ” X+はNOT回路46
とAND回路47で実行される。
Also, ■・Otsu・Bo is executed by the NOT circuit 34.35 and the AND circuit 33.36, and 81=XI is executed by the exclusive NOR circuit 44''?Ih=Xz・A3−X3+/
h”L is ORed with exclusive NOR circuit 21 and AND circuit 23
is executed in circuit 24, and At”X+ is executed in NOT circuit 46.
and is executed by the AND circuit 47.

又、Ao・Xo・BoはNOT回路34とAND回路3
9.40で実行され、X、 =B、は排他的NOR回路
44で実行され、Xt=Bz ・X、・Bi+Xz ・
IlzはAND回路49とOR回路48で実行され、χ
1・B。
Also, Ao, Xo, and Bo are the NOT circuit 34 and the AND circuit 3.
9.40, X, =B, is executed in the exclusive NOR circuit 44, and Xt=Bz ・X, ・Bi+Xz ・
Ilz is executed by an AND circuit 49 and an OR circuit 48, and χ
1.B.

はNOT回路45とAND回路43で実行される。is executed by the NOT circuit 45 and the AND circuit 43.

ここで、例えば下限値Aがooooで、上限値Bが00
11で、未知値Xが0001であるとすると、端子ao
、 XO+ beには“0”が入力する。従って、排他
的NOR回路30は“1”を送出する。又AND回路3
9は”0″を送出するため、AND回路40も“0”を
送出する。又NOT回路34,35は“l”を送出する
が、AND回路36は端子b0から“0″が入力するた
め“0”を送出する。従って、AND回路33もO”を
送出する。
Here, for example, the lower limit value A is oooo and the upper limit value B is 00.
11, if the unknown value X is 0001, the terminal ao
, "0" is input to XO+be. Therefore, exclusive NOR circuit 30 sends out "1". Also, AND circuit 3
9 sends out "0", so the AND circuit 40 also sends out "0". Furthermore, the NOT circuits 34 and 35 send out "l", but the AND circuit 36 sends out "0" because "0" is input from the terminal b0. Therefore, the AND circuit 33 also sends out O''.

端子aI+ XI+ blには“O”が入力する。従っ
て、排他的NOR回路44は“l”を送出し、N(1)
T回路45は“1”を送出するがAND回路43は“0
″を送出する。又N07回路46は“1″を送出するが
AND回路47は“0”を送出するため、AND回路5
0も“O”を送出する。
“O” is input to the terminals aI+XI+bl. Therefore, exclusive NOR circuit 44 sends "l" and N(1)
The T circuit 45 sends out "1", but the AND circuit 43 sends out "0".
''.Also, the N07 circuit 46 sends out "1", but the AND circuit 47 sends out "0", so the AND circuit 5
0 also sends "O".

端子a2. xiには“0”が端子b2にはl″が入力
する。従って、NOT回路12.13は“1”を送出し
、AND回路14が“1”を送出するため、AND回路
15も“1”を送出する。従って、OR回路48は“1
”を送出する。従って、AND回路42は排他的NOR
回路44が“1″を送出しているので、“1”をOR回
路41を経てAND回路40に送出するが、AND回路
40は前記の如く ”O”を送出する。
Terminal a2. "0" is input to xi, and "l" is input to terminal b2. Therefore, NOT circuits 12 and 13 send out "1", and AND circuit 14 sends out "1", so AND circuit 15 also sends "1". ”. Therefore, the OR circuit 48 outputs “1
”.Therefore, the AND circuit 42 outputs an exclusive NOR
Since the circuit 44 is sending out "1", it sends "1" to the AND circuit 40 via the OR circuit 41, but the AND circuit 40 sends out "O" as described above.

又排他的NOR回路22は”0”を送出するため、AN
D回路49は“0′″を送出する。又、排他的NOR回
路21は“1”を送出する。又、AND回路20は“0
”を送出し、AND回路19.25も“0”を送出する
Also, since the exclusive NOR circuit 22 sends out "0", the AN
D circuit 49 sends out "0'". Further, the exclusive NOR circuit 21 sends out "1". Also, the AND circuit 20 is “0”.
”, and the AND circuits 19.25 also send out “0”.

端子a、には“0”が端子x5.b、には1”が入力す
る。従って、NOT回路10は“1”を送出し、AND
回路11は“1”を送出する。しかし、NOT回路16
は“0”を送出するため、AND回路18は”0″を送
出する。AND回路17はAND回路11と15が“l
”を送出するため“1′をOR回路26を経てAND回
路28に送出する。AND回路28は排他的NOR回路
44が“1′を送出しているため、l″をOR回路29
を経てAND回路31に送出する。AND回路31は排
他的NOR回路30が“1″を送出しているため、OR
回路32を経て“l”を送出する。
Terminal a, "0" is terminal x5. 1” is input to b. Therefore, the NOT circuit 10 sends out “1” and
Circuit 11 sends out "1". However, NOT circuit 16
outputs "0", so the AND circuit 18 outputs "0". AND circuit 17 indicates that AND circuits 11 and 15 are "l".
”, “1′ is sent to the AND circuit 28 via the OR circuit 26. Since the exclusive NOR circuit 44 is sending out "1", the AND circuit 28 outputs "l" to the OR circuit 29.
The signal is then sent to the AND circuit 31. Since the exclusive NOR circuit 30 is sending out "1", the AND circuit 31 is ORed.
It sends "l" through circuit 32.

AND回路23はAND回路11と排他的N。The AND circuit 23 and the AND circuit 11 are exclusive N.

R回路21が“1”を送出するため、“1”をOR回路
24を経てAND回路27に送出する。しかし、AND
回路43が“0”を送出しているため0″を送出する。
Since the R circuit 21 sends out "1", it sends out "1" to the AND circuit 27 via the OR circuit 24. However, AND
Since the circuit 43 is sending out "0", it sends out "0".

AND回路37は排他的NOR回路44とOR回路24
が“ドを送出するため“1″をOR回路38を経てAN
D回路33に送出するが、前記の如<AND回路33は
“0”を送出する。
AND circuit 37 includes exclusive NOR circuit 44 and OR circuit 24
“1” is passed through the OR circuit 38 and AN is sent out.
The signal is sent to the D circuit 33, but as described above, the AND circuit 33 sends "0".

〔発明の効果〕〔Effect of the invention〕

以上説明した如(、本発明は回路構成を簡易化して、ハ
ードウェア量を少なくし、コストを低減すると共に、信
頼性を向上させることが出来る。
As described above, the present invention can simplify the circuit configuration, reduce the amount of hardware, reduce costs, and improve reliability.

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

第1図は本発明の原理ブロック図、 第2図は本発明の詳細な説明する図、 第3図は本発明の一実施例を示す回路のブロック図、 第4図は第3図の動作論理を説明する図、第5図は従来
の技術を説明するブロック図である。 図において、 1.2.3はレジスタ、 4.5は比較回路、6は判定
回路、    7はフリップフロップ、8は比較判定回
路、 21.22.30.44は排他的NOR回路である。 序弓トF1月の!’[ブ゛口・ソ2Q 亭  I  Q 茅 4 図
Fig. 1 is a block diagram of the principle of the present invention, Fig. 2 is a diagram explaining the invention in detail, Fig. 3 is a block diagram of a circuit showing an embodiment of the present invention, and Fig. 4 is the operation of Fig. 3. FIG. 5 is a block diagram explaining the conventional technology. In the figure, 1.2.3 is a register, 4.5 is a comparison circuit, 6 is a judgment circuit, 7 is a flip-flop, 8 is a comparison judgment circuit, and 21.22.30.44 is an exclusive NOR circuit. Prelude F January! '[Bukuchi・So2Q Tei I Q Kaya 4 Figure

Claims (1)

【特許請求の範囲】 nビットで構成される下限値Aと上限値Bを設定したレ
ジスタ(1)(3)と、nビットで構成される未知の値
Xを設定したレジスタ(2)から同時に入力される値を
比較し、A<X<Bを判定する回路であって、 上限値と下限値と未知の値の夫々の最上位ビットが総て
“0”か“1”かの判定と、該最上位ビットの下限値と
未知の値が“0”で上限値が“1”であるかの判定と、
該最上位ビットの下限値が“0”で未知の値と上限値が
“1”であるかの判定を行い、該最上位ビットが総て“
0”か“1”の場合は、次の下位ビットに対して、上記
同様の判定を行う動作を上位ビットから順次下位ビット
の方向に対し、同位のビット毎に繰り返し、該最上位ビ
ットの下限値と未知の値が“0”で上限値が“1”であ
る場合は、次の下位ビットの下限値と未知の値が共に“
0”か“1”かの判定と、下限値が“0”で未知の値が
“1”であるかの判定を行い、該最上位ビットの下限値
が“0”で未知の値と上限値が“1”である場合は、次
の下位ビットの未知の値と上限値が共に“0”か“1”
かの判定と未知の値が“0”で上限値が“1”であるか
の判定を行う動作を、上位ビットから順次下位ビットの
方向に対し、同位のビット毎に繰り返すことで、A<X
<Bか否かを判定する比較判定回路(8)を設けたこと
を特徴とする大小比較回路。
[Claims] Simultaneously from registers (1) and (3) in which a lower limit value A and an upper limit value B consisting of n bits are set, and register (2) in which an unknown value X consisting of n bits is set. A circuit that compares input values and determines A<X<B, and determines whether the most significant bits of the upper limit value, lower limit value, and unknown value are all “0” or “1”. , determining whether the lower limit value and unknown value of the most significant bit are “0” and the upper limit value is “1”;
It is determined whether the lower limit value of the most significant bit is “0” and the unknown value and upper limit value are “1”.
If it is 0 or 1, the same judgment as above is repeated for each bit of the same order from the upper bit to the lower bit, and the lower limit of the most significant bit is determined. If the value and unknown value are “0” and the upper limit value is “1”, the lower limit value and unknown value of the next lower bit are both “
0” or “1” and whether the lower limit value is “0” and the unknown value is “1”. If the value is “1”, the unknown value of the next lower bit and the upper limit value are both “0” or “1”.
By repeating the operation of determining whether the unknown value is "0" and the upper limit value is "1" from the upper bit to the lower bit for each bit of the same order, A< X
A magnitude comparison circuit characterized in that a comparison determination circuit (8) for determining whether or not <B is provided.
JP31448387A 1987-12-11 1987-12-11 Size comparing circuit Pending JPH01155433A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP31448387A JPH01155433A (en) 1987-12-11 1987-12-11 Size comparing circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP31448387A JPH01155433A (en) 1987-12-11 1987-12-11 Size comparing circuit

Publications (1)

Publication Number Publication Date
JPH01155433A true JPH01155433A (en) 1989-06-19

Family

ID=18053853

Family Applications (1)

Application Number Title Priority Date Filing Date
JP31448387A Pending JPH01155433A (en) 1987-12-11 1987-12-11 Size comparing circuit

Country Status (1)

Country Link
JP (1) JPH01155433A (en)

Similar Documents

Publication Publication Date Title
Hayes On modifying logic networks to improve their diagnosability
US4903005A (en) Comparator circuit
US4734876A (en) Circuit for selecting one of a plurality of exponential values to a predetermined base to provide a maximum value
JP2004531141A (en) Digital system and error detection method for the digital system
JPH01155433A (en) Size comparing circuit
US3459927A (en) Apparatus for checking logical connective circuits
JPH01220528A (en) Parity generator
JP2564881B2 (en) Bit string comparison method
Josephs An analysis of determinacy using a trace-theoretic model of asynchronous circuits
JP4772210B2 (en) Arbitration control method and circuit
JP2959303B2 (en) Arithmetic circuit
JP2844716B2 (en) Logical matching method for sequential circuits
US4980890A (en) Semiconductor integrated circuit
JPS61275936A (en) Condition determining device
JP2558152B2 (en) Counter error detector
JPH0254333A (en) Value comparator
JPS62154140A (en) Merge processor
JPH05322994A (en) Semiconductor device
JPH0490196A (en) Clock pulse detecting circuit
JPS6374308A (en) Digital arithmetic circuit
JPH01154239A (en) Parity detecting device
JPH0779247B2 (en) Decode circuit
JPH01101731A (en) Coincidence detecting circuit
JPH035855A (en) Single chip microcomputer
JPS62174827A (en) Digital signal prioritizing circuit