JPH03216727A - N-bit comparator - Google Patents

N-bit comparator

Info

Publication number
JPH03216727A
JPH03216727A JP1236490A JP1236490A JPH03216727A JP H03216727 A JPH03216727 A JP H03216727A JP 1236490 A JP1236490 A JP 1236490A JP 1236490 A JP1236490 A JP 1236490A JP H03216727 A JPH03216727 A JP H03216727A
Authority
JP
Japan
Prior art keywords
data
circuit
output
bit
priority
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
JP1236490A
Other languages
Japanese (ja)
Inventor
Kazumi Hayashi
和美 林
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 JP1236490A priority Critical patent/JPH03216727A/en
Publication of JPH03216727A publication Critical patent/JPH03216727A/en
Pending legal-status Critical Current

Links

Landscapes

  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

PURPOSE:To reduce the scale of a gate and to shorten a detection time by providing one n-bit comparator, functioning a priority order for respective bits and selecting the group of data whose priority is the highest when n-bits are compared. CONSTITUTION:The coincidence of data Ai and Bi (i=1-m) of two seqences whose data length in n-bits is compared n a coincidence circuit 30 for respective bits. Then, a comparison result is informed to a decoder 31. Since '0' is outputted, if dissidence occurs even by one bit for respective groups of data in the decoder 31, only one n-bit comparator is required. Then, the group of data whose priority is high is selected when n-bits are compared by functioning priority for respective bits. Thus, the scale of the gate is reduced and the detection time can be shortened.

Description

【発明の詳細な説明】 [概要] 優先順位付きのnビット比較回路に関し、ゲート規模の
削減と検出時間の短縮を図ることを目的とし、 データ長nビットの2系列のデータAtとBi(i−1
〜m)をそれぞれ対応するデータの組毎にビット毎の一
致をとる一致回路と、各データの組毎に一致回路の出力
を入力し、nビットのデタのうち1ビットでも不一致が
あると“0“を出力するデコーダと、該デコーダの出力
に一致するデータの組が複数ある時、優先順位の高いデ
ータの組を選択する信号を出力する優先順位回路と、前
記一致回路のm組の出力を受けて優先順位回路の出力に
応じていずれか一つをセレクトするセレクタと、該セレ
クタ出力を受けてnビットのデータ全てが一致した時に
キャリー信号を出力する比較回路と、該比較回路の出力
を受けて保護をがける保護回路と、これら各構成要素を
制御する制御回路とにより構成される。
[Detailed Description of the Invention] [Summary] Regarding an n-bit comparison circuit with priority, the purpose of this is to reduce the gate scale and shorten the detection time. -1
-m) are inputted to a matching circuit that matches bit by bit for each corresponding data set, and the output of the matching circuit for each data set, and if there is a mismatch in even one bit among the n bits of data, " a decoder that outputs "0", a priority circuit that outputs a signal for selecting a data set with a high priority when there are multiple data sets that match the output of the decoder, and m sets of outputs of the matching circuit. a selector that receives the output of the selector and selects one according to the output of the priority circuit; a comparison circuit that receives the selector output and outputs a carry signal when all n bits of data match; and an output of the comparison circuit. The device is composed of a protection circuit that protects the device by receiving it, and a control circuit that controls each of these components.

[産業上の利用分野] 本発明は優先順位付きのnビット比較回路に関する。[Industrial application field] The present invention relates to a prioritized n-bit comparison circuit.

[従来の技術コ 第4図は従来のデータ送受信システムの構成ブロック図
である。1は送信装置、2は受信装置である。送信装置
lに入ったデータaはCRC (Cyclic  Re
dundancy  Check)算器1aによりCR
C演算を行った後、データbとして送信される。一方、
データaもそのまま送信される。受信装置2では、これ
ら2つのデータa,  bを受信し、データaについて
はCRC演算器2aによりCRC演算を行う。受信側に
そのまま入ったデータをBとし、CRC演算を行ったデ
タをAとする。
[Conventional Technology] FIG. 4 is a block diagram of a conventional data transmission/reception system. 1 is a transmitting device, and 2 is a receiving device. The data a that has entered the transmitting device l is CRC (Cyclic Re
dundancy Check) CR by calculator 1a
After performing the C calculation, it is transmitted as data b. on the other hand,
Data a is also transmitted as is. The receiving device 2 receives these two data a and b, and performs a CRC calculation on the data a using the CRC calculator 2a. Let B be the data that entered the receiving side as it is, and let A be the data that has been subjected to CRC calculation.

比較器2bは、これら2つのデータA,Bをビット毎に
比較する。しかしながら、CRC演算器2aのCRC演
算を始めるタイミングが変化するため、データAとBの
一致をとることが困難である。そこで、第5図に示すよ
うに、受信側に複数のCRC演算器2aを設け、データ
Bと一致するデータAiを出力するCRC演算器をセレ
クトすることか考えられる。つまり、各CRC演算器2
aの出力データAiをデータBと比較し、一致するデー
タをセレクタ2cでセレクトしてやるのである。
Comparator 2b compares these two data A and B bit by bit. However, since the timing at which the CRC calculator 2a starts the CRC calculation changes, it is difficult to match the data A and B. Therefore, as shown in FIG. 5, it may be possible to provide a plurality of CRC calculators 2a on the receiving side and select the CRC calculator that outputs data Ai that matches data B. In other words, each CRC calculator 2
The output data Ai of a is compared with data B, and matching data is selected by the selector 2c.

第6図は従来回路の構成ブロック図で、第5図の受信装
置2側の構成を示している。つまり、第5図のデータB
とデータAi以降の比較回路の構成例を示している。図
において、10は2組のm個のデータ(ビット長n)A
tとBt(i−1〜m)をビット毎に比較する比較部で
ある。なお、データAiとBiとは第5図に示したよう
に、どちらか一方が全て同じデータの場合(図ではBの
方)もあるし、そうでない場合もある。
FIG. 6 is a block diagram of a conventional circuit, showing the configuration of the receiving device 2 shown in FIG. In other words, data B in Figure 5
An example of the configuration of a comparison circuit after data Ai is shown. In the figure, 10 is two sets of m data (bit length n) A
This is a comparison unit that compares t and Bt (i-1 to m) bit by bit. Note that, as shown in FIG. 5, the data Ai and Bi may be the same data (B in the figure) or may not be the same.

l1は比較部10より出力される比較結果が、全ビット
が一致した組が複数存在する時、予め定められた優先順
位に基づいてその内の1組をセレクトする信号を出力す
る優先順位回路、12はm個のデータ比較結果を受けて
優先順位回路11の出力に基づいて1組をセレクトする
m−1セレクタである。13はセレクタ12の出力を受
ける保護回路である。
l1 is a priority circuit that outputs a signal to select one of the sets based on a predetermined priority when there are multiple sets in which all bits match in the comparison result output from the comparison unit 10; Reference numeral 12 denotes an m-1 selector that receives m data comparison results and selects one set based on the output of the priority circuit 11. A protection circuit 13 receives the output of the selector 12.

該保護回路13は、データの全ビットが一致しない状態
が例えば1回生じても直ちにデータ系列を他の系列に切
換えることはしないで、所定の数だけデータの全ビット
が一致しない状態が続いた時にはしめてデータ系列を切
換えるようにする働きをするものである。14は比較部
10,優先順位回路11及び保護回路13の制御を行う
制御回路である。このように構成された回路の動作を説
明すれば、以下のとおりである。
The protection circuit 13 does not immediately switch the data series to another series even if a state in which all bits of data do not match occurs once, and the state in which all bits of data do not match continues for a predetermined number of times. It sometimes closes to switch the data series. 14 is a control circuit that controls the comparator 10, the priority circuit 11, and the protection circuit 13. The operation of the circuit configured as described above will be explained as follows.

比較部10に入ったデータ(A系,B系)は各組毎に全
ビットの比較が行われる。第7図は比較部10の従来構
成例を示す図である。図では、1個の組のみ示している
が、実際には組の数mだけ、図に示す回路がある。シリ
アル/パラレル変換器20.21に入ったそれぞれの系
のデータAi,Biはn個のパラレルデータDi,D2
.・・・Dnに変換される。変換されたデータは、ビッ
ト毎に比較器22で比較され、その比較結果がオア回路
23に送られる。オア回路23は、n個の比較器22の
出力の内、1個でも不一致があれば、″0”を出力する
。全ビットが一致した場合にのみ、“1゜を出力する。
All bits of the data (A system, B system) input to the comparison section 10 are compared for each set. FIG. 7 is a diagram showing an example of the conventional configuration of the comparing section 10. In the figure, only one set is shown, but in reality, there are as many circuits as there are m sets. The data Ai, Bi of each system that entered the serial/parallel converter 20.21 is converted into n parallel data Di, D2.
.. ...Converted to Dn. The converted data is compared bit by bit by a comparator 22, and the comparison result is sent to an OR circuit 23. The OR circuit 23 outputs "0" if there is a mismatch in even one of the outputs of the n comparators 22. Outputs “1°” only when all bits match.

優先順位回路11は、各系から送られて《るm個の比較
結果を受けて、全ビットが一致した組をチェックする。
The priority circuit 11 receives the m comparison results sent from each system and checks for sets in which all bits match.

全ビットが一致した組が複数あった場合には、その内か
ら予め定められた優先順位に従って、最も優先度の高い
組を選択する信号をセレクタ12に出力する。セレクタ
12は優先順位回路11からの選択信号に従って1個の
組をセレクトし、出力する。出力結果は、保護回路l3
に入る。
If there are a plurality of sets in which all bits match, a signal is output to the selector 12 to select the set with the highest priority among them according to a predetermined priority order. The selector 12 selects one set according to the selection signal from the priority circuit 11 and outputs it. The output result is the protection circuit l3
to go into.

[発明が解決しようとする課題] 従来の優先順位付きnビット比較回路は、第7図に示す
ような全ビットの一致,不一致を比較する回路をデータ
系列の組mだけ用意する必要があり、ゲート規模が極め
て大きくなり、またnビットの比較後に優先順位の最も
高いものをセレクトするため、検出時間が長くなるとい
う不具合があった。
[Problems to be Solved by the Invention] In the conventional n-bit comparison circuit with priorities, it is necessary to prepare circuits for comparing whether or not all bits match or do not match, as shown in FIG. 7, for only m data series sets. The gate size becomes extremely large, and since the one with the highest priority is selected after comparing n bits, there are problems in that the detection time becomes long.

本発明はこのような課題に鑑みてなされたものであって
、ゲート規模の削減と検出時間の短縮を図ることができ
るnビット比較回路を提供することを目的としている。
The present invention has been made in view of these problems, and an object of the present invention is to provide an n-bit comparison circuit that can reduce the gate scale and shorten the detection time.

[課題を解決するための手段コ 第1図は本発明の原理ブロック図である。第6図と同一
のものは、同一の符号を付して示す。図において、30
はデータ長nビットの2系列のデタAtとBi(i−1
〜m)をそれぞれ対応するデータの組毎にビット毎の一
致をとる一致回路、31は各データの組毎に一致回路3
0の出力を入力し、nビットのデータのうち1ビットで
も不一致があると“O”を出力するデコーダ、11は該
デコーダ31の出力に一致するデータの組が複数ある時
、優先順位の高いデータの組を選択する信号を出力する
優先順位回路、12は前記一致回路30のm組の出力を
受けて優先順位回路11の出力に応じていずれか一つを
セレクトするセレクタ、32は該セレクタ12出力を受
けてnビットのデータ全てが一致した時にキャリー信号
を出力する比較回路、33は該比較回路32の出力を受
ける保護回路、34はこれら各構成要素を制御する制御
回路である。図に示すmは信号のビット数を示す。
[Means for Solving the Problems] FIG. 1 is a block diagram of the principle of the present invention. Components that are the same as those in FIG. 6 are designated by the same reference numerals. In the figure, 30
is two series of data At and Bi(i-1
- m) are matching circuits that match bit by bit for each corresponding data set, and 31 is a matching circuit 3 for each data set.
A decoder that inputs an output of 0 and outputs "O" if there is a mismatch in even one bit among n bits of data. 11 has a high priority when there are multiple sets of data that match the output of the decoder 31. A priority circuit outputs a signal for selecting a set of data; 12 is a selector that receives the m sets of outputs from the coincidence circuit 30 and selects one according to the output of the priority circuit 11; 32 is the selector; 33 is a protection circuit that receives the output of the comparison circuit 32, and 34 is a control circuit that controls each of these components. m shown in the figure indicates the number of bits of the signal.

[作用コ 一致回路30でデータの組毎にビットシリアルデータの
一致がとられ、順次デコーダ31に送られる。デコーダ
31は、入力したデータの組毎に通常は(データの一致
の場合)“1”を出力し、不一致が生じると“0”を出
力する。デコーダ31の出力は、優先順位回路11に送
られ、該優先順位回路11は予め定められた優先順位で
、デコーダ31の出力のうちの″1”を出力するデータ
の組を選択する信号を出力する。
[Action matching circuit 30 matches the bit serial data for each data set and sequentially sends it to the decoder 31. The decoder 31 normally outputs "1" (if the data match) for each set of input data, and outputs "0" if a mismatch occurs. The output of the decoder 31 is sent to the priority circuit 11, and the priority circuit 11 outputs a signal for selecting a data set to output "1" from among the outputs of the decoder 31 in a predetermined priority order. do.

セレクタ12は、優先順位回路11からの選択信号に従
って、データの組をセレクトし、比較回路32に送る。
The selector 12 selects a data set according to the selection signal from the priority circuit 11 and sends it to the comparison circuit 32.

優先順位回路11で選択していた組にデータの不一致が
出ると、優先順位回路11は出力“1”のデータの組の
中から、次に優先度の高いデータの組を選択する信号を
出力する。セレクタ12は、このようなデータの組を次
々に切換えながら比較回路32に送る。比較回路32は
、シリアルデータをクロツクに同期してカウントし、n
進カウンタがキャリーアウトしたら、少なくともnビッ
トの全てのビットが一致したデータの組が1組存在する
ことを示している。比較回路32の出力は保護回路33
に送られ、保護がかかる。
When a data mismatch occurs in the set selected by the priority circuit 11, the priority circuit 11 outputs a signal to select the data set with the next highest priority from among the data sets of output "1". do. The selector 12 sends such data sets to the comparison circuit 32 while switching them one after another. The comparator circuit 32 counts the serial data in synchronization with the clock, and
When the digit counter carries out, it indicates that there is one set of data in which all of the n bits match. The output of the comparison circuit 32 is sent to the protection circuit 33.
will be sent to and protected.

保護回路33の出力が、検出出力DETとなる。The output of the protection circuit 33 becomes the detection output DET.

本発明によれば、データAiとBiとの一致を一致回路
30でビット毎に比較し、比較結果をデコーダ31に知
らせるようにし、デコーダ31はデータの組毎に1ビッ
トでも不一致が生じれば“0”を出力するようにしてい
るので、nビット比較回路を1個ですませることができ
る。従って、ゲート規模を小さくすることができる。ま
た、ビット毎に優先順位を機能させることにより、nビ
ット比較した時点で最も優先順位の高いデータの組がセ
レクトされているため、検出時間を短縮することができ
る。
According to the present invention, the coincidence circuit 30 compares the coincidence of data Ai and Bi bit by bit, and informs the decoder 31 of the comparison result. Since "0" is output, only one n-bit comparison circuit is required. Therefore, the gate scale can be reduced. Furthermore, by making the priority order work for each bit, the data set with the highest priority is selected at the time when n bits are compared, so that the detection time can be shortened.

[実施例] 以下、図面を参照して本発明の実施例を詳細に説明する
[Example] Hereinafter, an example of the present invention will be described in detail with reference to the drawings.

第2図は本発明の一実施例を示す回路図である。FIG. 2 is a circuit diagram showing one embodiment of the present invention.

第1図と同一のものは、同一の符号を付して示す。Components that are the same as those in FIG. 1 are designated by the same reference numerals.

図に示す実施例は、A,Bのデータの組が4個でビット
長が6の場合を示している。一致回路30は、2人力の
EXNORゲートが4個で構成されている。従って、そ
のゲート出力は、2つの入力AiとBiが一致の時に“
1″となる。
The embodiment shown in the figure shows a case where there are four sets of data A and B and the bit length is six. The coincidence circuit 30 is composed of four EXNOR gates operated by two people. Therefore, when the two inputs Ai and Bi match, the gate output is “
1″.

デコーダ31は、アンドゲート31aとDタ」ブフリッ
プフロップ31bの組が4個で構成さすでいる。アンド
ゲート31aの一方の入力には一致回路30のゲート出
力が入り、他方の入力にC;フリップフロップ3lbの
Q出力が入っている。
The decoder 31 includes four sets of AND gates 31a and D-type flip-flops 31b. One input of the AND gate 31a receives the gate output of the coincidence circuit 30, and the other input receives the Q output of the flip-flop 3lb.

そして、アンドゲート31aの出力はフリップフロップ
3lbのD人力に入っている。フリップフロップ3lb
のクロック入力CKには、制御回胃34からのクロツク
が入っており、そのプリセ・シト入力Pには、制御回路
34からのブリセットa号が入っている。
The output of the AND gate 31a enters the D input of the flip-flop 3lb. flip flop 3lb
The clock input CK of the control circuit 34 contains the clock from the control circuit 34, and the preset input P thereof contains the preset number a from the control circuit 34.

デコーダ31の各フリップフロップ3lbのU力をそれ
ぞれD1〜D4とし、これら出力D1〜D4は優先順位
回路l1のラッチllgに入る。
The U power of each flip-flop 3lb of the decoder 31 is designated as D1 to D4, respectively, and these outputs D1 to D4 enter the latch llg of the priority circuit l1.

制御回路34からのクロツクは、アンドゲート11bに
入り、該アンドゲート11bの出力はラッチllaのク
ロック人力CKに入っている。デコーダ31の出力のう
ち、D1がラッチされたもCをS1、D2がラッチされ
たものを82、D3カ′ラッチされたものを83、D4
がラッチされたものを84とすると、これらラッチ出力
81〜S4は図に示すようなアンドゲート11c〜11
eとオアゲートllf.llgの組合わせよりなるゲー
ト回路に入る。
The clock from the control circuit 34 enters the AND gate 11b, and the output of the AND gate 11b enters the clock input CK of the latch lla. Among the outputs of the decoder 31, S1 is the output with D1 latched, 82 is the output with D2 latched, 83 is the output with D3, and D4 is the latched output.
If the latched output is 84, these latch outputs 81 to S4 are connected to AND gates 11c to 11 as shown in the figure.
e and orgatellf. A gate circuit consisting of a combination of llg is entered.

該ゲート回路は、優先順位の高い順(Sl>S2>S3
>S4)に“1”を保持して出力するようになっている
。例えば、先ずS1が“1”を出力している場合に、S
1が“0”に落ちたら(不一致が生じたら)、今度は次
に優先順位の高いS2が“1”になる。このようにして
、順次優先度の高い信号がセレクトされるようになって
いる。
The gate circuits are arranged in order of priority (Sl>S2>S3
>S4) is held as "1" and output. For example, first, if S1 is outputting "1", then
If 1 falls to "0" (if a mismatch occurs), then S2, which has the next highest priority, becomes "1". In this way, signals with higher priorities are sequentially selected.

優先順位回路11の出力を、それぞれSLI〜SL4と
する。
The outputs of the priority circuit 11 are designated as SLI to SL4, respectively.

セレクタ12は、一致回路30の各ゲートの出力H1〜
H4をラッチするラッチ12a,該ラッチ12aの各出
力Q1〜Q4を受けるアンドゲート12b〜12e及び
これらアンドゲート12b〜12eの出力を受けるオア
ゲート12fより構成されている。アンドゲート12b
〜12eの他方の入力には、それぞれ対応する優先順位
回路11の出力SLI〜SL4が入っている。
The selector 12 selects the outputs H1 to H1 of each gate of the coincidence circuit 30.
It is composed of a latch 12a that latches H4, AND gates 12b to 12e that receive the respective outputs Q1 to Q4 of the latch 12a, and an OR gate 12f that receives the outputs of these AND gates 12b to 12e. and gate 12b
The outputs SLI to SL4 of the corresponding priority circuits 11 are input to the other inputs of the filters 12e and 12e, respectively.

比較回路32は、セレクタl2の出力Qをその一方の入
力に、他方の入力にフィードバック信号を受けるアンド
ゲート32a,該アンドゲート32aの出力をイネーブ
ル人力ENに受ける8進カウンタ32b (CNTR2
)及び該カウンタ32bのキャリーアウト出力COを受
けるDタイプフリップフロップ32cより構成されてい
る。
The comparison circuit 32 includes an AND gate 32a which receives the output Q of the selector l2 at one input, a feedback signal at the other input, and an octal counter 32b (CNTR2) which receives the output of the AND gate 32a at an enable input EN.
) and a D-type flip-flop 32c which receives the carry-out output CO of the counter 32b.

カウンタ32bには、8進のブリセット値“1が入力さ
れており、制御回路34からのロードパルスTLO2に
よりブリセット値がセットされるまた、該カウンタ32
bのクロックは、制御回路34から与えられている。フ
リップフロップ32Cは、カウンタ32bのキャリー出
力COを制御回路34から出力されるラッチパルス(C
MP CK)によりラッチする。そして、ラッチされた
信号がCOPMとなる。このCOMP信号は、前記ゲー
トllbの他方の入力に入っている。
An octal preset value "1" is input to the counter 32b, and the preset value is set by the load pulse TLO2 from the control circuit 34.
The clock b is given from the control circuit 34. The flip-flop 32C converts the carry output CO of the counter 32b into a latch pulse (C
MPCK). Then, the latched signal becomes COPM. This COMP signal is input to the other input of the gate llb.

制御回路34は、タイミング信号TiMとマスタークロ
ツクMCKを受けて、クロック.初期値ロードパルスT
LO2及びラッチパルス(CMPCK)を作る。該制御
回路34は、Dタイプフリップフロップ34a〜34d
,8進カウンタ34e (CNTRI)及びアンドゲー
ト34fより構成されている。このように構成された回
路の動作を、第3図のタイミングチャートを参照しつつ
説明すれば、以下のとおりである。
The control circuit 34 receives the timing signal TiM and the master clock MCK, and outputs the clock . Initial value load pulse T
Create LO2 and latch pulse (CMPCK). The control circuit 34 includes D type flip-flops 34a to 34d.
, an octal counter 34e (CNTRI), and an AND gate 34f. The operation of the circuit configured as described above will be explained below with reference to the timing chart of FIG.

制御回路34には、(a)に示すようなマスタークロッ
クMCKと(b)に示すようなタイミング信号TiMが
入り、それぞれ(c),  (d)に示すような制御信
号TLOI,TLO2を出力する。カウンタ34eは(
e)に示すような7進カウント(実際は初期値1からの
6カウント)を行い、そのキャリーアウトCT I C
Oは(f)に示すようなちとなる。
The control circuit 34 receives a master clock MCK as shown in (a) and a timing signal TiM as shown in (b), and outputs control signals TLOI and TLO2 as shown in (c) and (d), respectively. . The counter 34e is (
Perform the heptadium count (actually 6 counts from the initial value 1) as shown in e), and calculate the carryout CT I C
O has a shape as shown in (f).

一致回路30の各ゲートの出力H1〜H4がそれぞれ(
h)〜(k)に示すようなものであったものとする。1
ビット目では、全組が“1”である。デコーダ31はク
ロツクでこれらデータH1〜H4をラッチし、その出力
D1〜D4は(IQ)〜(0)に示すように全て“1”
である。優先順位回路11は、これら信号D1〜D4を
受けると、クロックでラッチし、ラッチ出力81〜S4
は(p)〜(s)に示すようなものとなる。
The outputs H1 to H4 of each gate of the coincidence circuit 30 are respectively (
It is assumed that the conditions are as shown in h) to (k). 1
For the bit, all sets are "1". The decoder 31 latches these data H1 to H4 using a clock, and its outputs D1 to D4 are all "1" as shown in (IQ) to (0).
It is. When the priority circuit 11 receives these signals D1 to D4, it latches them with a clock and outputs latch outputs 81 to S4.
are as shown in (p) to (s).

これら出力81〜S4を受けるゲート回路の出力SL1
〜SL4は(t) 〜(w)に示すようなものとなり、
最も優先度の高いH1をセレクトするように信号をセレ
クタ12に与える。セレクタ12はH1をセレクトし、
(X)に示すQとして出力する。
Output SL1 of the gate circuit receiving these outputs 81 to S4
~SL4 will be as shown in (t) ~(w),
A signal is given to the selector 12 to select H1 having the highest priority. Selector 12 selects H1,
Output as Q shown in (X).

次に、2ビット目でAl,Blに不一致が生じたものと
する。この結果、該当するゲート出力H1が(h)に示
すように“0”に落ちる。このデータをデコーダ31が
デコードし、その出力D1がクロックに同期して“g″
に示すように“0”に落ちる。このデータD1をクロッ
クで同期してラッチし、ラッチ11aの出力S1が(p
)に示すように“0”に落ちる。
Next, it is assumed that a mismatch occurs between Al and Bl at the second bit. As a result, the corresponding gate output H1 falls to "0" as shown in (h). The decoder 31 decodes this data, and the output D1 is "g" in synchronization with the clock.
It falls to “0” as shown in . This data D1 is latched in synchronization with the clock, and the output S1 of the latch 11a is (p
) falls to “0” as shown.

優先順位回路11内のゲート回路は、ラッチ11aの出
力を受けて、(1)〜(W)に示すようにSLIが“0
゜に落ち、代わりに次の信号SL2が“11となるセレ
クト信号をセレクタ12に出力する。セレクタ12の出
力Qは(x)に示すようにラッチ12aのQ1が“0“
に落ちてから、次のクロツクまでの間に“0゛に落ちる
が、H2がセレクトされると同時に、再び“1”に上が
る。
The gate circuit in the priority circuit 11 receives the output of the latch 11a and sets the SLI to “0” as shown in (1) to (W).
°, and instead outputs a select signal to the selector 12 in which the next signal SL2 becomes "11".The output Q of the selector 12 is as shown in (x) when Q1 of the latch 12a is "0".
After falling to 0, it falls to ``0'' until the next clock, but at the same time as H2 is selected, it rises to ``1'' again.

次に、6ビット目でA2と82に不一致が生じH2が(
i)に示すように“0”に落ちたものとする。これを受
けてクロックに同期してデコーダ31の出力D2は(m
)に示すように“0“に落ちる。D2が“0″に落ちる
と、次のクロックに同期してS2が(q)に示すように
“0”に落ちる。この結果、優先順位回路11のゲート
回路は次に優先度の高いH3をセレクトするようなセレ
クト信号をセレクタ12に出力する。
Next, there is a mismatch between A2 and 82 at the 6th bit, and H2 becomes (
Assume that the value falls to "0" as shown in i). In response to this, the output D2 of the decoder 31 is (m
), it falls to “0”. When D2 falls to "0", S2 falls to "0" in synchronization with the next clock as shown in (q). As a result, the gate circuit of the priority circuit 11 outputs a select signal to the selector 12 to select H3, which has the next highest priority.

この結果、セレクタ12はH3をセレクトし、出力する
。この結果、セレクタ12の出力は(X)に示すように
一旦“O”に落ちるがH3がセレクトされると同時に再
度“1”に立ち上がる。このようにして、図に示す回路
は、常にデータの組AiとBiの一致しているものの内
の最も優先度の高いデータの組がセレクトされて比較回
路32に送られるようになっている。
As a result, the selector 12 selects and outputs H3. As a result, the output of the selector 12 temporarily drops to "O" as shown in (X), but rises to "1" again at the same time as H3 is selected. In this way, in the circuit shown in the figure, the data set with the highest priority among the matching data sets Ai and Bi is always selected and sent to the comparison circuit 32.

比較回路32では、初期値“1”からクロックカウント
を開始し、カウントアップしたらキャリーアウトCOを
出力する。前記セレクタ12の出力Qはアンドゲート3
2aを介してカウンタ32bのイネーブル人力ENに入
っており、ENが“1″の間にクロックをカウントする
。前記セレクタ12の出力Qは、データの組の内、一致
している組がある間は“1”を出力し続けるので、6ビ
ット全部が一致するデータの組がある限り、カウンタ3
2bは初期値1から6クロックカウントを行いキャリー
アウトCOを出力する。このCOは、制御回路34から
出力される(z)に示すようなラッチバルスCMPCK
によりラッチされ、(2−)に示すようなCOMP信号
として出力される。
The comparator circuit 32 starts clock counting from the initial value "1" and outputs a carry-out CO when the count is up. The output Q of the selector 12 is an AND gate 3
2a to the enable manual input EN of the counter 32b, and counts the clock while EN is "1". The output Q of the selector 12 continues to output "1" as long as there is a matching data set among the data sets, so as long as there is a data set that matches all 6 bits, the counter 3
2b counts 6 clocks from the initial value 1 and outputs carry-out CO. This CO is a latch pulse CMPCK as shown in (z) output from the control circuit 34.
is latched by and output as a COMP signal as shown in (2-).

このように、本発明によれば、一致回路30及びデコー
ダ31により、データの組毎にピットシリアルなデータ
を順次ビット毎に一致しているかどうかチェックできる
ので、第7図に示すようにシリアル/パラレル変換器は
不要となり、ゲート規模の削減を図ることができる。ま
た、ビット毎に優先順位を機能させることにより、6ビ
ット比較した時点で最も優先順位の高いデータの組がセ
レクタ12によりセレクトされているため、検出時間を
短縮することができる。
As described above, according to the present invention, the matching circuit 30 and the decoder 31 can sequentially check whether or not the pit serial data matches bit by bit for each data set. A parallel converter is no longer required, and the gate scale can be reduced. Further, by controlling the priority order for each bit, the data set with the highest priority is selected by the selector 12 at the time of 6-bit comparison, so that the detection time can be shortened.

上述の実施例ではデータの組(m)が4、ビット長(n
)が6の場合を例にとって説明したが、本発明はこれに
限るものでないことはいうまでもない。任意のデータの
組の任意のビット長のデータに本発明を適用することが
できる。
In the above embodiment, the data set (m) is 4 and the bit length (n
) is 6, but it goes without saying that the present invention is not limited to this. The present invention can be applied to data of any bit length in any data set.

[発明の効果] 以上、詳細に説明したように、本発明によれば、データ
AiとBiとの一致を一致回路30でビット毎に比較し
、比較結果をデコーダ31に知らせるようにし、デコー
ダ31はデータの組毎に1ビットでも不一致が生じれば
“O゜を出力するようにしているので、nビット比較回
路を1個ですませることができる。従って、ゲート規模
を小さくすることができる。また、ビット毎に優先順位
を機能させることにより、nビット比較した時点で最も
優先順位の高いデータの組がセレクトされているため、
検出時間を短縮することができる。
[Effects of the Invention] As described above in detail, according to the present invention, the matching circuit 30 compares the coincidence of data Ai and Bi bit by bit, and the comparison result is notified to the decoder 31. Since the circuit outputs "O°" if even one bit of mismatch occurs in each data set, only one n-bit comparison circuit is required. Therefore, the gate scale can be reduced. In addition, by using the priority order for each bit, the data set with the highest priority is selected when n bits are compared.
Detection time can be shortened.

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

第1図は本発明の原理ブロック図、 第2図は本発明の一実施例を示す回路図、第3図は各部
の動作を示すタイミングチャート、第4図は従来のデー
タ送受信システムの構成ブロック図、 第5図は従来のデータ送受信システムの構成ブロック図
、 第6図は従来回路の構成ブロック図、 第7図は比較部の従来構成例を示す図である。 第1図において、 11は優先順位回路、 12はセレクタ、 30は一致回路、 31はデコーダ、 32は比較回路、 33は保護回路、 34は制御回路である。
Fig. 1 is a block diagram of the principle of the present invention, Fig. 2 is a circuit diagram showing an embodiment of the invention, Fig. 3 is a timing chart showing the operation of each part, and Fig. 4 is a configuration block of a conventional data transmission/reception system. 5 is a configuration block diagram of a conventional data transmission/reception system, FIG. 6 is a configuration block diagram of a conventional circuit, and FIG. 7 is a diagram showing an example of a conventional configuration of a comparison section. In FIG. 1, 11 is a priority circuit, 12 is a selector, 30 is a matching circuit, 31 is a decoder, 32 is a comparison circuit, 33 is a protection circuit, and 34 is a control circuit.

Claims (1)

【特許請求の範囲】 データ長nビットの2系列のデータAiとBi(i=1
〜m)をそれぞれ対応するデータの組毎にビット毎の一
致をとる一致回路(30)と、各データの組毎に一致回
路(30)の出力を入力し、nビットのデータのうち1
ビットでも不一致があると“0”を出力するデコーダ(
31)と、該デコーダ(31)の出力に一致するデータ
の組が複数ある時、優先順位の高いデータの組を選択す
る信号を出力する優先順位回路(11)と、前記一致回
路(30)のm組の出力を受けて優先順位回路(11)
の出力に応じていずれか一つをセレクトするセレクタ(
12)と、 該セレクタ(12)出力を受けてnビットのデータ全て
が一致した時にキャリー信号を出力する比較回路(32
)と、 該比較回路(32)の出力を受けて保護をかける保護回
路(33)と、 これら各構成要素を制御する制御回路(34)とにより
構成されてなるnビット比較回路。
[Claims] Two series of data Ai and Bi (i=1
~m) are inputted to a matching circuit (30) that matches bit by bit for each corresponding data set, and inputs the output of the matching circuit (30) for each data set, and matches one of the n bits of data.
A decoder that outputs “0” if there is a bit mismatch (
31), a priority circuit (11) that outputs a signal for selecting a data set with a high priority when there are multiple data sets that match the output of the decoder (31), and the matching circuit (30). Priority circuit (11)
A selector that selects one depending on the output of (
12), and a comparison circuit (32) which receives the output of the selector (12) and outputs a carry signal when all n bits of data match.
), a protection circuit (33) that receives and protects the output of the comparison circuit (32), and a control circuit (34) that controls each of these components.
JP1236490A 1990-01-22 1990-01-22 N-bit comparator Pending JPH03216727A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1236490A JPH03216727A (en) 1990-01-22 1990-01-22 N-bit comparator

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1236490A JPH03216727A (en) 1990-01-22 1990-01-22 N-bit comparator

Publications (1)

Publication Number Publication Date
JPH03216727A true JPH03216727A (en) 1991-09-24

Family

ID=11803220

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1236490A Pending JPH03216727A (en) 1990-01-22 1990-01-22 N-bit comparator

Country Status (1)

Country Link
JP (1) JPH03216727A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7331003B2 (en) * 2003-05-09 2008-02-12 Hewlett-Packard Development Company, L.P. Match circuit for performance counter
WO2009015690A1 (en) * 2007-07-31 2009-02-05 Telefonaktiebolaget Lm Ericsson (Publ) Optical circuit for comparing two n-bit binary words

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7331003B2 (en) * 2003-05-09 2008-02-12 Hewlett-Packard Development Company, L.P. Match circuit for performance counter
WO2009015690A1 (en) * 2007-07-31 2009-02-05 Telefonaktiebolaget Lm Ericsson (Publ) Optical circuit for comparing two n-bit binary words
US7869107B2 (en) 2007-07-31 2011-01-11 Telefonaktiebolaget Lm Ericsson (Publ) Optical circuit for comparing two N-bit binary words

Similar Documents

Publication Publication Date Title
US3863224A (en) Selectively controllable shift register and counter divider network
US3938087A (en) High speed binary comparator
JPS6352494B2 (en)
US4069478A (en) Binary to binary coded decimal converter
JPH03216727A (en) N-bit comparator
US6012077A (en) Method and apparatus for indicating overflow status of bit-variable data employing pipelining adder
US3564225A (en) Serial binary coded decimal converter
US4159529A (en) Fibonacci code adder
JPH03216728A (en) N-bit comparator
EP4261623B1 (en) Method for recognizing order of signals
JPH083514B2 (en) Counter test equipment
EP4261622B1 (en) System for recognizing order of signals
US6522690B1 (en) Zero determination signal generating circuit
KR100418574B1 (en) Loadable up/down counter circuit
SU830390A1 (en) Device for detecting errors in parallel n-digit code with constant weigth
JPS63206828A (en) Stretch circuit for maximum value
JP2001350622A (en) Multiple input data sorting circuit
JPH0423451B2 (en)
JPH04314230A (en) Bit correlation deciding circuit
JPS62174827A (en) Digital signal prioritizing circuit
JPH01179297A (en) Shift register
JPH02201538A (en) Counter
JPH0191396A (en) Shift register
JPS63176021A (en) Serial/parallel conversion circuit
JPS62103747A (en) Selecting method for terminal equipment