JPS613244A - Data comparison system - Google Patents

Data comparison system

Info

Publication number
JPS613244A
JPS613244A JP59122942A JP12294284A JPS613244A JP S613244 A JPS613244 A JP S613244A JP 59122942 A JP59122942 A JP 59122942A JP 12294284 A JP12294284 A JP 12294284A JP S613244 A JPS613244 A JP S613244A
Authority
JP
Japan
Prior art keywords
data
state
bits
comparison
byte
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
JP59122942A
Other languages
Japanese (ja)
Inventor
Ushio Inoue
潮 井上
Haruo Hayamizu
速水 治夫
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.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone Corp
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 Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP59122942A priority Critical patent/JPS613244A/en
Publication of JPS613244A publication Critical patent/JPS613244A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

PURPOSE:To compare input data with a reference value of an optional numer or length simultaneously by looking up a table repeatedly on the basis of code numbers and state numbers. CONSTITUTION:The indication of the execution start of retrieving operation is sent to a decision circuit 11 and then the starting one byte of data read out of a file is applied to an input terminal 4. This data is set to the low-order 8 bits of a memory address register 7 and an address decoder 8 selects 9-bit information stored in the corresponding address of a random access memory 9. The low- order 8 bits of information stored in a memory data register 10 are stored in the high-order 8 bits of the address register 7 and the decision circuit 11 decides whether the high-order 1 bit is on or not. The 2nd byte of the data is processed similarly and the output of the decision circuit 11 corresponding to the one tail byte is the final comparison result.

Description

【発明の詳細な説明】 (発明の属する分野) 本発明は、データの大小関係がビットコードの大小関係
で定まる場合に、データの値が予め与えられた基準値の
中にあるかどうかを判定するデータ比較方式に関するも
のである。
DETAILED DESCRIPTION OF THE INVENTION (Field to which the invention pertains) The present invention is a method for determining whether a data value is within a predetermined reference value when the data size relationship is determined by the bit code size relationship. This relates to a data comparison method.

(従来の技術) データ処理システムの分野では、ファイル中に格納され
た多数のデータの中からその値が検索条件として指定さ
れた基準値の範囲内にあるもののみを選択することがし
ばしば必要となる。一般に、ファイルから電子計算機の
メインメモリへのデータの転送は1バイト(8ビツト)
ずつ直列に転送されるため、データの値と基準値とを1
バイトずつ比較していくことができれば、データの転送
と同時に選択を完了させることが原理的に可能となる。
(Prior Art) In the field of data processing systems, it is often necessary to select only data whose values are within a range of reference values specified as search conditions from among a large amount of data stored in a file. Become. Generally, data is transferred from a file to the computer's main memory in 1 byte (8 bits).
Since the data value and reference value are transferred serially,
If it is possible to compare byte by byte, it is theoretically possible to complete selection at the same time as data transfer.

第1図は、このようなデータ比較機能を実現するための
従来方式の説明図であり、1は基準値を予め格納してお
くレジスタ、2は1バイト幅の比較演算器、3は検索条
件の判定回路、4はデータの入力端子、5は判定結果の
出力端子である。
Figure 1 is an explanatory diagram of a conventional method for realizing such a data comparison function, in which 1 is a register that stores a reference value in advance, 2 is a 1-byte wide comparison calculator, and 3 is a search condition. 4 is a data input terminal, and 5 is a judgment result output terminal.

以下その動作につき説明する。The operation will be explained below.

まず、検索動作の実行に先立ってレジスタ1に基準値を
格納するとともに、判定回路3において比較演算器2の
出力の組合せに対して検索条件の真偽を判定するための
制御情報を格納しておく。
First, prior to execution of a search operation, a reference value is stored in register 1, and control information for determining whether the search conditions are true or false with respect to the combination of outputs of comparator 2 is stored in determination circuit 3. put.

第1図のレジスタ1に表示された例えば’31’。For example, '31' displayed in register 1 in FIG.

’30’、 ’30’、 ’30’等はそれぞれ入力デ
ータの先頭1バイトから逐次1バイトずつを比較するた
めに格納された基準値である。
'30', '30', '30', etc. are reference values stored for sequentially comparing each byte of input data starting from the first byte.

検索動作の実行開始を比較演算器2および判定回路3に
対して指示した後、ファイルから読み出したデータの先
頭1バイトを入力端子4に加える。
After instructing the comparator 2 and the determination circuit 3 to start executing the search operation, the first byte of the data read from the file is added to the input terminal 4.

比較演算器2ではレジスタの先頭1バイトを取り出し、
入力端子4に加えられた1バイトと比較する。次にデー
タの2バイト目を入力端子4に加えると、比較演算器2
ではレジスタの2バイト目と比較する。この動作をデー
タの末尾1バイトまでくり返した時点で、比較演算器2
はデータと基準値の大小関係を判定回路3に出力し、判
定回路3は各比較演算器の出力をもとに検索条件の真偽
を判定する。
Comparison unit 2 takes out the first byte of the register,
Compare with 1 byte added to input terminal 4. Next, when the second byte of data is added to the input terminal 4, the comparator 2
Now compare it with the second byte of the register. When this operation is repeated until the last 1 byte of data, the comparator 2
outputs the magnitude relationship between the data and the reference value to the determination circuit 3, and the determination circuit 3 determines whether the search condition is true or false based on the output of each comparator.

この時に使用する検索条件は例えば、 X=10000RX≧2500 AND X≦3500
0RX=5000(x:入力データ) のように与えられる。ここで、4桁の数字の各桁はそれ
ぞれ先頭1バイトから4番目の14イトに対応する検索
条件の数字を示している。
The search conditions used at this time are, for example, X=10000RX≧2500 AND X≦3500
It is given as follows: 0RX=5000 (x: input data). Here, each digit of the four-digit number indicates a search condition number corresponding to the fourth 14 bytes from the first byte.

以上説明した従来方式では、欠点として次の2つがあっ
た。
The conventional method described above has the following two drawbacks.

■ 基準値の個数分だけのレジスタと比較演算器を用意
しなければならず、多数の基準値を用いた比較を行なお
うとすると回路の規模が太きくなる。
- It is necessary to prepare as many registers and comparators as there are reference values, and if a comparison using a large number of reference values is attempted, the scale of the circuit becomes large.

■ 基準値との比較条件が等号(=)、不等号(>、 
< ) 、等帯付不等号(≧、≦)のいずれかに応じて
判定回路の論理を動的に設定しなければならず、制御が
複雑になる。
■ The conditions for comparison with the standard value are equal sign (=), inequality sign (>,
The logic of the determination circuit must be dynamically set according to either < ) or inequality with equal bands (≧, ≦), which makes control complicated.

(発明の目的) 本発明はこれらの欠点を解決するため、基準値と入力デ
ータとの比較を比較演算器で行なうのではなく、状態番
号とコード番号によるテーブルの索引を繰り返すことに
よって比較を実現することを特徴とし、その目的は単純
かつ小規模な回路構成により任意の個数の基準値とデー
タの値を比較できるようにしたデータ比較方式を提供す
ることにある。以下1図面について詳細に説明する。
(Objective of the Invention) In order to solve these drawbacks, the present invention realizes the comparison by repeatedly indexing a table using the state number and code number, instead of comparing the reference value and input data with a comparison calculator. The object of the present invention is to provide a data comparison method that can compare any number of reference values and data values with a simple and small-scale circuit configuration. One drawing will be explained in detail below.

(発明の構成および作用) 第2図は本発明の方式によるデータ比較機能の実現回路
の構成を示す一実施例の説明図であり、4はデータの入
力端子、5は判定結果の出力端子、6は入力データラッ
チ、7はメモリアドレスレジスタ、8はアドレスデコー
ダ、9はランダムアクセスメモリ、10はメモリデータ
レジスタ、11は判定回路である。
(Structure and operation of the invention) FIG. 2 is an explanatory diagram of an embodiment showing the structure of a circuit for realizing a data comparison function according to the method of the present invention, in which 4 is a data input terminal, 5 is a judgment result output terminal, 6 is an input data latch, 7 is a memory address register, 8 is an address decoder, 9 is a random access memory, 10 is a memory data register, and 11 is a determination circuit.

第3図は第2図に示すランダムアクセスメモリ9に格納
されるテーブルの構成内容を表わした図であり、13は
テーブルアドレスの上位8ビツト、14はテーブルアド
レスの下位8ビツト、12はテーブルアドレスの上位8
ビツト13及び下位8ビツト14で表わされるテーブル
アドレスに格納された9ビツトの長さの情報である。な
お、テーブルアドレス及び情報のビット長は基準値の長
さ及び個数に応じて自由に変えられるものである。
FIG. 3 is a diagram showing the structure of the table stored in the random access memory 9 shown in FIG. 2, where 13 is the upper 8 bits of the table address, 14 is the lower 8 bits of the table address, and 12 is the table address. top 8
This is 9-bit length information stored in the table address represented by bit 13 and lower 8 bits 14. Note that the table address and the bit length of the information can be freely changed depending on the length and number of reference values.

以下、第2図を用いて比較機能の実現方法を説明した後
に、第3図のテーブルの構成について説明する。
Hereinafter, a method for realizing the comparison function will be explained using FIG. 2, and then the structure of the table in FIG. 3 will be explained.

まず、検索動作の実行の先立ってランダムアクセスメモ
リ9に第3図のようなテーブルを格納するとともに、メ
モリアドレスレジスタ7の上位8ビツトにX’01’(
Xは16進数)を設定しておく。
First, before executing the search operation, a table as shown in FIG. 3 is stored in the random access memory 9, and the upper 8 bits of the memory address register 7 are set to
X is a hexadecimal number).

検索動作の実行開始を判定回路11に指示した後、ファ
イルから読み出したデータの先頭1バイトを入力端子4
に加える。入力端子4に加えられたデータは入力データ
ラッチ6経由でメモリアドレスレジスタ7の下位8ビツ
トに設定され、アドレスデコーダ8によってランダムア
クセスメモリ9から当該アドレスに格納されていた9ビ
ツトの情報I2が選択され、メモリデータレジスタ10
に格納される。メモリデータレジスタ10に格納された
情報のうち下位8ピツ1〜はアドレスレジスタ7の上位
8ビツトに格納され、上位1ビツトがオンかどうかを判
定回路11で判定される。
After instructing the determination circuit 11 to start executing the search operation, the first byte of the data read from the file is sent to the input terminal 4.
Add to. The data applied to the input terminal 4 is set to the lower 8 bits of the memory address register 7 via the input data latch 6, and the 9-bit information I2 stored at the corresponding address is selected from the random access memory 9 by the address decoder 8. and memory data register 10
is stored in Of the information stored in the memory data register 10, the lower 8 bits 1 to 1 are stored in the upper 8 bits of the address register 7, and a determination circuit 11 determines whether the upper 1 bit is on.

データの2バイト目以後も前述の方法と全く同じに処理
され、データの末尾1バイトに対する判定回路11の出
力が最終的な比較結果となる。
The second and subsequent bytes of data are processed in exactly the same manner as described above, and the output of the determination circuit 11 for the last byte of data becomes the final comparison result.

次にテーブルの構成について説明する。テーブルに格納
された9ビツトの情報12のうち、上位1ビツトは比較
処理の実行中における当該情報が選択された時点での検
索条件の真偽を表示しており、このビットを除く下位8
ビツトは次に選択すべき情報のテーブル上のアドレスの
上位8ビツトを表示している。
Next, the structure of the table will be explained. Of the 9-bit information 12 stored in the table, the upper 1 bit indicates the truth or falsity of the search condition at the time the information was selected during the execution of the comparison process, and the lower 8 bits excluding this bit
The bits display the upper 8 bits of the address on the table of information to be selected next.

テーブル中には2つの特別な状態を表現するために、比
較を行なう基準値とは無関係に常に一定の情報f及びt
が格納されている部分があり、例えば第3図の状態番号
’oo’とFF’で表現された状態が該当する。状態番
号″′009は入力されたデータの値が基準値の範囲内
にはないことが確定した状態であり、テーブルアドレス
の上位8ビツトが’oo’に格納されるすべての情報は
、テーブルアドレスの下位8ビツトの値の如何にかかわ
らずすべて同一のビットパターン’ooo’となってい
る。状態番号’FF’は入力されたデータの値が基準値
の範囲内にあることが確定した状態であり、テーブルア
ドレスの上位8ビツトが’FF”に格納されるすべての
情報はテーブルアドレスの下位8ビツトの値の如何にか
かわらずすべて同一のビットパタ−ン’IFF’となっ
ている。これら2つの特別な状態に対応する情報がテー
ブル中から一旦選択されると、それ以後は常に上位アド
レスが同じ場所に格納された情報を選択し続けるため、
その上位1ビツトの値は一定となる。
In order to represent two special states, the table contains constant information f and t, regardless of the reference value for comparison.
For example, the states expressed by the state numbers 'oo' and FF' in FIG. State number ``'009'' is a state in which it is determined that the input data value is not within the standard value range, and all information whose upper 8 bits of the table address are stored in 'oo' is stored in the table address. Regardless of the value of the lower 8 bits, the bit pattern is the same 'ooo'.The state number 'FF' indicates the state where it is determined that the input data value is within the standard value range. All information stored in the upper 8 bits of the table address 'FF' has the same bit pattern 'IFF' regardless of the value of the lower 8 bits of the table address. Once the information corresponding to these two special states is selected from the table, the information whose upper address is stored in the same location will continue to be selected.
The value of the upper 1 bit remains constant.

従って1判定回路11の動作は検索の途中で入力データ
が基準値の範囲内にあるかどうかが確定してしまうか否
かに関係なく、無条件に選択された情報の上位1ビツト
のみを判定すればよいことになり、判定回路11のロジ
ックは単純となる。さらにテーブルの作成に際しても、
入力データの途中で基準値の範囲内にあるかどうかが確
定した段階で状態番号’FF’または’oo’に遷移さ
せておけば。
Therefore, the operation of the 1 judgment circuit 11 judges only the top 1 bit of the unconditionally selected information, regardless of whether it is determined during the search whether the input data is within the reference value range or not. Therefore, the logic of the determination circuit 11 becomes simple. Furthermore, when creating a table,
If it is determined midway through the input data whether or not it is within the reference value range, the state number should be changed to 'FF' or 'oo'.

それ以後の状態遷移を考慮する必要がなくなり、テーブ
ルの大きさを小さくできるという利点もある。
There is also the advantage that there is no need to consider subsequent state transitions, and the size of the table can be reduced.

第4図は、テーブルの作成アルゴリズムを示したフロー
チャートであり、ここでは紙面の都合上第4図(A)と
第4図(B)の2枚に分割してあり、図中、tはテーブ
ル、Xはアドレスの下位8ビツト、yはアドレスの上位
8ビツト、t□はテーブルの上位1ビツトの値、t2は
テーブルの下位1ビツトの値をそれぞれ示している。第
3図に示したようなテーブルの作成は、予め与えられた
基準値に応じて第4図に示すような比較的単純なアルゴ
リズムにより行なうことが可能であり、また、テーブル
の物理的な容量の範囲内ならば、任意の数の任意の長さ
を持つ基準値を扱うことができる。
Figure 4 is a flowchart showing the table creation algorithm, which is divided into two parts, Figure 4 (A) and Figure 4 (B), due to space constraints. , X indicates the lower 8 bits of the address, y indicates the upper 8 bits of the address, t□ indicates the value of the upper 1 bit of the table, and t2 indicates the value of the lower 1 bit of the table. The table shown in Fig. 3 can be created using a relatively simple algorithm as shown in Fig. 4 according to pre-given reference values, and the table's physical capacity Any number of reference values with any length can be handled within the range of .

(効 果) 以上説明したように、本発明は基準値と入力データとの
比較を比較演算器で行なうのではなく、コード番号と状
態番号によるテーブルの索引をくり返すことによって比
較を実現するものであるから、テーブルの容量の範囲な
らば任意の数の任意の長さを持つ基準値に対する比較を
同時に行なうことができ、かつそのための回路構成もき
わめて単純であるという利点がある。また、入力データ
に対する比較動作の途中で基準値の範囲内にあるかどう
かが確定した場合、それぞれに対応する特別な状態に遷
移してテーブルの索引結果を一定に保つため、不等号を
含む比較条件に対するテーブルサイズの縮小化と判定回
路の単純化が実現できる。さらに、テーブルの容量とレ
ジスタのビット幅を大きくするだけで扱える基準値の個
数および長さを大きくすることができ、拡張性、柔軟性
に富むという利点もある。
(Effects) As explained above, the present invention does not compare the reference value and input data using a comparator, but instead realizes the comparison by repeatedly indexing a table using code numbers and status numbers. Therefore, within the capacity of the table, comparisons can be made against any number of reference values having any length at the same time, and the circuit configuration for this purpose is also advantageously simple. In addition, if it is determined whether the input data is within the reference value range during the comparison operation, the comparison condition including the inequality sign is changed to a special state corresponding to each state to keep the table index result constant. Therefore, it is possible to reduce the table size and simplify the determination circuit. Furthermore, the number and length of reference values that can be handled can be increased simply by increasing the capacity of the table and the bit width of the register, which has the advantage of being highly extensible and flexible.

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

第1図はデータ比較機能を実現するための従来方式の説
明図、第2図は本発明の方式によるデータ比較機能の実
現回路の構成を示す一実施例の説明図、第3図は第2図
のランダムアクセスメモリに格納されるテーブルの構成
内容を示す図、第4図はテーブルの作成アルゴリズムを
示すフローチャートである。 1 ・ レジスタ、 2 ・ 比較演算器、 3・・・
判定回路、 4 ・・・入力端子、 5・・・出力端子
、6 ・・・入力データラッチ、 7 ・・・メモリア
ドレスレジスタ、 8 ・・・アドレスデコーダ、9 
・・・ランダムアクセスメモリ、10・・・メモリデー
タレジスタ、11・・・判定回路、12・・・テーブル
に格納された9ビツトの情報、13・・テーブルアドレ
スの上位8ピツI〜、14・・・テーブルアドレスの下
位8ビツト・ 第1図 第2図 ρ 4−X
FIG. 1 is an explanatory diagram of a conventional method for realizing a data comparison function, FIG. 2 is an explanatory diagram of an embodiment showing the configuration of a circuit for realizing a data comparison function according to the method of the present invention, and FIG. FIG. 4 is a flowchart showing the table creation algorithm. 1. Register, 2. Comparison calculator, 3...
Judgment circuit, 4...Input terminal, 5...Output terminal, 6...Input data latch, 7...Memory address register, 8...Address decoder, 9
... Random access memory, 10... Memory data register, 11... Judgment circuit, 12... 9-bit information stored in table, 13... Upper 8 bits of table address I~, 14...・Lower 8 bits of table address・Figure 1Figure 2ρ 4-X

Claims (1)

【特許請求の範囲】[Claims] 固定長のコード番号と状態番号をエントリ番号とする2
次元の状態遷移テーブルを格納するためのランダムアク
セスメモリと、そのメモリへのデータ書込み及び読出し
をするための機構を備え、まず状態遷移テーブル中の状
態番号(f)をエントリ番号とするエントリについてコ
ード番号の如何にかかわらず遷移先の状態番号をf、比
較の判定結果を偽とする情報を書き込むとともに、別の
状態番号(t)をエントリ番号とするエントリについて
コード番号の如何にかかわらず遷移先の状態番号をt、
比較の判定結果を真とする情報を書き込み、次に設定す
べき複数の基準値に基づいて状態遷移テーブル中に遷移
先の状態番号と比較の判定結果を示す情報を書き込んで
おき、その後判定対象となるデータが入力されるごとに
、そのデータを固定長のコード番号の系列に分解し、コ
ード番号と状態番号によるテーブルの索引を繰り返し、
系列内の最後のコード番号を用いたテーブルの索引結果
によって、入力されたデータの値が予め設定された複数
の基準値の範囲内にあるか否かを判定することを特徴と
するデータ比較方式。
Fixed-length code number and state number are used as entry numbers 2
Equipped with a random access memory for storing a dimensional state transition table and a mechanism for writing and reading data into the memory, first, a code is generated for an entry whose entry number is the state number (f) in the state transition table. Regardless of the number, the state number of the transition destination is f, and information that makes the comparison judgment result false is written, and for entries whose entry number is another state number (t), the transition destination regardless of the code number. Let the state number of t be
Write information that makes the comparison judgment result true, then write information indicating the state number of the transition destination and the comparison judgment result in the state transition table based on the multiple reference values that should be set, and then write the information that indicates the judgment result of the comparison. Each time data is input, the data is broken down into a series of fixed-length code numbers, and the table is indexed by the code number and state number repeatedly.
A data comparison method characterized by determining whether the value of input data is within a range of a plurality of preset reference values based on the index result of a table using the last code number in a series. .
JP59122942A 1984-06-16 1984-06-16 Data comparison system Pending JPS613244A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP59122942A JPS613244A (en) 1984-06-16 1984-06-16 Data comparison system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP59122942A JPS613244A (en) 1984-06-16 1984-06-16 Data comparison system

Publications (1)

Publication Number Publication Date
JPS613244A true JPS613244A (en) 1986-01-09

Family

ID=14848427

Family Applications (1)

Application Number Title Priority Date Filing Date
JP59122942A Pending JPS613244A (en) 1984-06-16 1984-06-16 Data comparison system

Country Status (1)

Country Link
JP (1) JPS613244A (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5354937A (en) * 1976-10-28 1978-05-18 Nec Corp Non-synchronous sequence circuit

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5354937A (en) * 1976-10-28 1978-05-18 Nec Corp Non-synchronous sequence circuit

Similar Documents

Publication Publication Date Title
US3675211A (en) Data compaction using modified variable-length coding
US5608887A (en) Method of processing data strings
US9240237B2 (en) Semiconductor device and method of writing/reading entry address into/from semiconductor device
JPH06222903A (en) Method and means for provision of static dictionary structure for unfolding of compressed data by compressing character data
US4059850A (en) Memory system word group priority device with least-recently used criterion
US5081608A (en) Apparatus for processing record-structured data by inserting replacement data of arbitrary length into selected data fields
JPH01182992A (en) Semiconductor memory device
US3771142A (en) Digital data storage system
US5903780A (en) Data sorting device having multi-input comparator comparing data input from latch register and key value storage devices
WO2024066561A1 (en) Apparatus and method for searching for free memory and chip
JPH024026B2 (en)
JPS613244A (en) Data comparison system
JPS60105040A (en) Sentence retrieving system
JP3027754B2 (en) Associative memory
US6513053B1 (en) Data processing circuit and method for determining the first and subsequent occurences of a predetermined value in a sequence of data bits
EP0227348A2 (en) Content addressable memory circuit and method
JPH0746362B2 (en) String matching method
JP4785492B2 (en) Memory system and search method
JPS6143338A (en) Searching of thin data base using association technology
JPS63187334A (en) Character-string pattern matching device
JPH0512337A (en) Data retrieval system using hash method
JP3113765B2 (en) Variable length code decoding circuit
JPH0650478B2 (en) Data compression storage system
JPH01205250A (en) Method for controlling cache memory
JP2590866B2 (en) Data retrieval device