[go: up one dir, main page]

JPH06266532A - Data compression processor - Google Patents

Data compression processor

Info

Publication number
JPH06266532A
JPH06266532A JP5081391A JP8139193A JPH06266532A JP H06266532 A JPH06266532 A JP H06266532A JP 5081391 A JP5081391 A JP 5081391A JP 8139193 A JP8139193 A JP 8139193A JP H06266532 A JPH06266532 A JP H06266532A
Authority
JP
Japan
Prior art keywords
register
data
character
input
sent
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
JP5081391A
Other languages
Japanese (ja)
Inventor
Meiji Sakata
明治 坂田
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP5081391A priority Critical patent/JPH06266532A/en
Publication of JPH06266532A publication Critical patent/JPH06266532A/en
Pending legal-status Critical Current

Links

Landscapes

  • Document Processing Apparatus (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

(57)【要約】 【目的】 辞書をテーブルの形で構成して検索の高速化
を図り、また、照合する文字列の長さに制限を設けない
データ圧縮処理装置を提供することにある。 【構成】 出現文字列を入力レジスタに記憶し、出現文
字列のハッシュ値をアドレスとして辞書から文字列とポ
インタを読出しかつ該出現文字列とポインタを格納し、
入力バッファに出現文字列の先頭文字を格納しかつ辞書
からのポインタに基づき文字を読出しかつポインタを生
成し、入力バッファから読出した文字と出現文字列の先
頭文字を比較しかつ辞書から読出した文字列と出現文字
列を比較し、これら比較結果とフラグレジスタの値を入
力として動作決定論理で論理値を出力し、フラグレジス
タとカウンタの値を該論理値により更新し、辞書からの
ポインタと上記生成ポインタとの差分値をとり、出現文
字列の先頭文字とフラグレジスタとカウンタと差分回路
の値を論理値に基づき編集し、編集結果を出力する。
(57) [Abstract] [Purpose] To provide a data compression processing device in which a dictionary is configured in the form of a table to speed up a search, and the length of a character string to be collated is not limited. [Arrangement] The appearance character string is stored in an input register, the character string and the pointer are read from the dictionary with the hash value of the appearance character string as an address, and the appearance character string and the pointer are stored.
Store the first character of the appearance character string in the input buffer, read the character based on the pointer from the dictionary and generate the pointer, compare the character read from the input buffer with the first character of the appearance character string, and read the character from the dictionary The column and the appearance character string are compared, the comparison result and the value of the flag register are input, a logical value is output by the operation determination logic, the values of the flag register and the counter are updated by the logical value, and the pointer from the dictionary and the above The difference value with the generation pointer is taken, the first character of the appearance character string, the flag register, the counter, and the value of the difference circuit are edited based on the logical value, and the edited result is output.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、データ処理においてデ
ータの記憶媒体上でのデータ量の縮小化を図り、データ
の格納コストやデータの通信コストの削減などに利用さ
れるデータ圧縮処理装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a data compression processing device which is used for reducing the amount of data on a storage medium in data processing and reducing the data storage cost and the data communication cost. .

【0002】[0002]

【従来の技術】従来より、出現する文字パターンを辞書
に登録する圧縮処理方式では、ある文字の次にどの文字
が続くかを記憶する事によって、辞書を探索木として構
成していた。
2. Description of the Related Art Conventionally, in a compression processing method for registering an appearing character pattern in a dictionary, a dictionary is constructed as a search tree by storing which character follows a certain character.

【0003】[0003]

【発明が解決しようとする課題】しかしながら、上述し
た従来の辞書に基づく圧縮処理では、1文字照合する毎
にポインタを参照して探索木をたどる必要があり、高速
化が望めず、また、木の高さ以上の文字列の照合には難
があった。本発明では、辞書をテーブルの形で構成して
検索の高速化を図り、また、照合する文字列の長さに制
限を設けないデータ圧縮処理装置を提供することにあ
る。
However, in the above-described conventional dictionary-based compression processing, it is necessary to refer to the pointer every time one character is collated to follow the search tree, and it is not possible to increase the speed. There was a problem in collating a character string whose height was higher than. SUMMARY OF THE INVENTION It is an object of the present invention to provide a data compression processing device in which a dictionary is constructed in the form of a table to speed up a search, and the length of a character string to be collated is not limited.

【0004】[0004]

【課題を解決するための手段】上記目的を達成するた
め、本発明のデータ圧縮処理装置は、出現文字列を記憶
する入力レジスタと、エントリー使用状態フラグと文字
列と該文字列の出現位置を示すポインタをエントリーと
する辞書を有し、出現文字列のハッシュ値をアドレスと
してエントリーを読み出しかつ該出現文字列を含むエン
トリーを格納する辞書記憶手段と、入力バッファに出現
文字列の先頭文字を格納し、辞書記憶手段から読み出さ
れたエントリーのポインタに基づき文字を読み出し、か
つポインタを生成して出力する入力バッファ手段と、入
力バッファ手段から読み出された文字と出現文字列の先
頭文字を比較して結果を出力しかつ辞書記憶手段から読
み出されたエントリーの文字列と出現文字列を比較して
結果を出力する比較手段と、比較手段の出力とフラグレ
ジスタの値を入力として論理値を出力する動作決定論理
と、該論理値により値の更新されるフラグレジスタとカ
ウンタと、辞書記憶手段から読み出されたエントリーの
ポインタと入力バッファ手段で生成されたポインタとの
差分値をとる差分手段と、出現文字列の先頭文字とフラ
グレジスタとカウンタと差分回路の値を前記論理値に基
づき編集し、編集結果を出力する編集手段を備えるよう
にしている。
In order to achieve the above object, the data compression processing apparatus of the present invention provides an input register for storing an appearance character string, an entry use state flag, a character string and an appearance position of the character string. A dictionary storage unit that has a dictionary having the pointer as an entry, reads the entry with the hash value of the appearance character string as an address, and stores the entry including the appearance character string, and stores the first character of the appearance character string in the input buffer. Then, a character is read based on the pointer of the entry read from the dictionary storage means, and the input buffer means for generating and outputting the pointer is compared with the character read from the input buffer means and the first character of the appearance character string. Then, the result is output, and the character string of the entry read from the dictionary storage means is compared with the appearance character string, and the result is output. A stage, an operation determination logic for outputting a logical value by using the output of the comparing means and the value of the flag register as an input, a flag register and a counter whose value is updated by the logical value, and an entry read from the dictionary storage means. The difference means for obtaining the difference value between the pointer and the pointer generated by the input buffer means, the first character of the appearance character string, the flag register, the counter, and the value of the difference circuit are edited based on the logical value, and the edited result is output. It is equipped with editing means.

【0005】[0005]

【作用】データ列の照合に際して、入力データと辞書内
のデータ列の照合を行う。これによって1文字毎にポイ
ンタを参照して比較を行う必要がなくなる。また、辞書
内に登録してあるデータ列よりも長いデータ列の照合に
際しては、エントリー内のポインタの指すデータとの比
較を行うので、データ列の照合では長さの制限がない。
When the data string is collated, the input data and the data string in the dictionary are collated. This eliminates the need to refer to the pointer for each character for comparison. Further, when collating a data string longer than the data string registered in the dictionary, the comparison is made with the data pointed to by the pointer in the entry, so there is no limit on the length of the data string collation.

【0006】[0006]

【実施例】図1は本発明の一実施例における圧縮回路5
0の説明図であり、1はn文字の入力レジスタ、2はm
文字の出力レジスタであり、3はハッシュ回路、4は辞
書登録/読出回路、5は辞書であり3、4、5により辞
書記憶手段が構成される。6は入力バッファ登録/読出
回路、7は入力バッファであり6、7により入力バッフ
ァ手段が構成される。8は比較回路、9は編集回路、1
0は動作決定論理、11は差分回路、12は1ビットの
フラグレジスタ、13はカウンタ、14は辞書内のエン
トリーを指すアドレスレジスタ、15はOR回路、16
は入力バッファ内の書き込みアドレスを指すアドレスレ
ジスタ、17は1を加える加算器、18はセレクタ、1
9は入力バッファ内のアドレスを指すアドレスレジス
タ、20は1文字のレジスタ、21は1文字のレジス
タ、22は3文字のレジスタ、23は3文字のレジス
タ、24、25は比較器、26はセレクタ、27は入力
バッファ内の読み出しアドレスを指すアドレスレジス
タ、28は1を加える加算器である。900は比較器2
5から動作決定論理10への信号線C1、901は比較
器24から動作決定論理10への信号線C2、902は
動作決定論理10からカウンタ13と編集回路9への信
号線XC、903は動作決定論理10からフラグレジス
タ12とセレクタ26と編集回路9への信号線XF、9
04は動作決定論理10から編集回路9と出力レジスタ
2への信号線XI、905はフラグレジスタ12から動
作決定論理10と編集回路9への信号線Fである。ま
た、本実施例では22、23の幅を3文字としたが、こ
れは2文字以上なら何でもよく、1の幅は22または2
3の幅以上あればよい。なお、本発明で言う所の圧縮と
は、復元可能なコード変換の事である。
1 is a block diagram of a compression circuit 5 according to an embodiment of the present invention.
It is explanatory drawing of 0, 1 is an input register of n characters, 2 is m
A character output register, 3 is a hash circuit, 4 is a dictionary registration / readout circuit, 5 is a dictionary, and 3, 4, and 5 constitute a dictionary storage means. 6 is an input buffer registration / readout circuit, 7 is an input buffer, and 6 and 7 constitute an input buffer means. 8 is a comparison circuit, 9 is an editing circuit, 1
0 is an operation determination logic, 11 is a difference circuit, 12 is a 1-bit flag register, 13 is a counter, 14 is an address register that points to an entry in the dictionary, 15 is an OR circuit, 16
Is an address register indicating a write address in the input buffer, 17 is an adder for adding 1, 18 is a selector, 1
9 is an address register indicating an address in the input buffer, 20 is a 1-character register, 21 is a 1-character register, 22 is a 3-character register, 23 is a 3-character register, 24 and 25 are comparators, 26 is a selector , 27 is an address register indicating a read address in the input buffer, and 28 is an adder for adding 1. 900 is the comparator 2
The signal lines C1 and 901 from 5 to the operation decision logic 10 are signal lines C2 and 902 from the comparator 24 to the operation decision logic 10, and the signal lines XC and 903 from the operation decision logic 10 to the counter 13 and the editing circuit 9 are operation. Signal lines XF, 9 from the decision logic 10 to the flag register 12, selector 26 and editing circuit 9
Reference numeral 04 is a signal line XI from the operation decision logic 10 to the editing circuit 9 and the output register 2, and 905 is a signal line F from the flag register 12 to the operation decision logic 10 and the editing circuit 9. Further, in the present embodiment, the width of 22 and 23 is set to 3 characters, but any width of 2 or more may be used, and the width of 1 is 22 or 2
It is sufficient if the width is 3 or more. The compression in the present invention means a code conversion that can be restored.

【0007】まず、外部より送られてきたn文字の入力
データは入力レジスタ1に入る。ここで入力レジスタ1
への入力の仕方は、1文字ずつずらしながらn文字ずつ
である。例えば、データをABCDEとし、nの値を3
とすると、最初はABC、が入力され、次はBCD、そ
の次はCDEが入力される。圧縮回路50と外部とのデ
ータのやりとりは図5で説明する。入力レジスタ1内の
入力データの内、先頭の3文字はハッシュ回路3に送ら
れハッシュ値が計算される。ハッシュの計算方法は任意
でよいが、通常適当な奇数値、例えば1023による余
りが取られる。このハッシュ値はに辞書登録/読出回路
4のレジスタ14に送られ辞書5のエントリーアドレス
として使われる。詳しくは図8で説明するが、辞書5
は、フラグと3文字の文字パターンと入力バッファ7へ
のポインタをエントリーとするメモリである。
First, n characters of input data sent from the outside enter the input register 1. Input register 1 here
The input method is to shift n characters and shift n characters. For example, the data is ABCDE, and the value of n is 3
Then, ABC is input first, BCD is input next, and CDE is input next. Data exchange between the compression circuit 50 and the outside will be described with reference to FIG. The first three characters of the input data in the input register 1 are sent to the hash circuit 3 and the hash value is calculated. The method of calculating the hash may be arbitrary, but a proper odd value, for example, a remainder of 1023 is usually taken. This hash value is sent to the register 14 of the dictionary registration / readout circuit 4 and used as the entry address of the dictionary 5. The dictionary 5 will be described in detail with reference to FIG.
Is a memory having entries of a flag, a character pattern of three characters, and a pointer to the input buffer 7.

【0008】レジスタ14内のデータをエントリーアド
レスとして辞書5からエントリーの読み出しが行われ
る。但し、読み出しが行われるのはフラグが1の場合の
みであり、フラグが0の場合は読み出されない。エント
リーの読み出し先は、3文字の文字パターン部分がレジ
スタ22であり、ポインタ部分は差分回路11とセレク
タ26である。
An entry is read from the dictionary 5 using the data in the register 14 as an entry address. However, the reading is performed only when the flag is 1, and when the flag is 0, the reading is not performed. In the read destination of the entry, the character pattern portion of three characters is the register 22, and the pointer portion is the difference circuit 11 and the selector 26.

【0009】差分回路11、セレクタ26の説明に先だ
って、レジスタ16、加算器17の説明をする。レジス
タ16は入力バッファ7への入力データの書き込みアド
レスを格納しておくためのレジスタであり、加算器17
はレジスタ16内のデータを1加算するための加算器で
ある。なお、レジスタ16の初期値は0である。差分回
路11の詳細を図2によって説明する。図2で30はレ
ジスタ、31はレジスタ、32はレジスタ30内のデー
タから、レジスタ31内のデータを引く減算器である。
レジスタ16内のデータは、差分回路11のレジスタ3
0へ送られ、辞書5のエントリーの内、ポインタはレジ
スタ31へ送られる。これらのデータは減算器32で減
算が実行され、その結果(以下オフセットと呼ぶ)は編
集回路9へ送られる。
Before explaining the difference circuit 11 and the selector 26, the register 16 and the adder 17 will be described. The register 16 is a register for storing the write address of the input data to the input buffer 7, and the adder 17
Is an adder for adding 1 to the data in the register 16. The initial value of the register 16 is 0. Details of the difference circuit 11 will be described with reference to FIG. In FIG. 2, 30 is a register, 31 is a register, and 32 is a subtracter for subtracting the data in the register 31 from the data in the register 30.
The data in the register 16 is the register 3 of the difference circuit 11.
0, and of the entries of the dictionary 5, the pointer is sent to the register 31. These data are subtracted by the subtractor 32, and the result (hereinafter referred to as offset) is sent to the editing circuit 9.

【0010】セレクタ26には辞書5のエントリーの
内、ポインタが送られ、また、加算器28で加算された
データが送られる。この選択動作は、動作決定論理10
より送られてくる信号が0の時は辞書5より送られてく
るデータが選択され、信号が1の時は加算器28より送
られてくるデータが選択される。セレクタ26で選択さ
れたデータはレジスタ27へ入る。これは加算器28と
セレクタ18へ送られる。加算器28では1加算され、
この結果はセレクタ26へ送られる。セレクタ18には
レジスタ27内のデータが送られ、また、レジスタ16
内のデータが送られる。セレクタ18のデータ選択のタ
イミングは、レジスタ27にデータが設定された次のサ
イクルで、レジスタ27より送られてきたデータが選択
され、更に、次のサイクルでレジスタ16より送られて
きたデータが選択され、レジスタ19へ送られる。ま
た、後者のサイクルで、加算器17で加算されたデータ
がレジスタ16へ設定され、一方、OR回路15で、1
ビットのフラグ”1”、入力レジスタ1の先頭3文字、
レジスタ16内のデータがこの順序で結合され、これが
レジスタ14内のデータの指すエントリーアドレスへ格
納される。入力バッファ7では、レジスタ19へレジス
タ27のデータが入った次のサイクルで、レジスタ19
内のデータをアドレスとするデータが、入力バッファ7
より比較回路8内のレジスタ20へ読み出される。一
方、レジスタ19へレジスタ16のデータが入った次の
サイクルで、入力レジスタ1の先頭1文字が、レジスタ
19内のデータをアドレスとして、入力バッファ7へ格
納される。比較回路8では、レジスタ21に入力レジス
タ1の先頭1文字が入り、これが入力バッファ7よりレ
ジスタ20へ読み出されたデータと、比較器24で比較
される。比較結果は信号線901(C2)によって動作
決定論理10へ送られる。レジスタ22では、辞書5よ
り読み出されたエントリーの内、3文字のパターンが入
り、レジスタ23は入力レジスタ1内のデータの内、先
頭3文字が入り、これらが比較器25で比較される。比
較結果は信号線900(C1)によって動作決定論理1
0へ送られる。フラグレジスタ12では、動作決定論理
10より信号線903(XF)によって送られてくる信
号が0のとき0に設定され、信号が1のとき1に設定さ
れる。フラグレジスタ12内のフラグは信号線905
(F)によって、動作決定論理10と編集回路9へ送ら
れる。カウンタ13は、動作決定論理10より信号1が
送られてくるときにカウンタ更新が行なわれ、信号が0
のときにカウンタの初期化が行なわれ、初期値は1であ
る。ここで、信号が0のときに、初期値が3ではなく1
となる理由は、比較器25で3文字分のデータを比較し
たのちも、比較器24で同じデータの2文字目と3文字
目の比較を実行し、その都度カウンタを更新するからで
ある。
A pointer out of the entries of the dictionary 5 is sent to the selector 26, and the data added by the adder 28 is sent. This selection operation is the operation decision logic 10
When the signal sent from is 0, the data sent from the dictionary 5 is selected, and when the signal is 1, the data sent from the adder 28 is selected. The data selected by the selector 26 enters the register 27. This is sent to the adder 28 and the selector 18. In the adder 28, 1 is added,
This result is sent to the selector 26. The data in the register 27 is sent to the selector 18, and the register 16
The data in is sent. The data selection timing of the selector 18 is such that the data sent from the register 27 is selected in the next cycle in which the data is set in the register 27, and the data sent from the register 16 in the next cycle is selected. And sent to the register 19. In the latter cycle, the data added by the adder 17 is set in the register 16, while the OR circuit 15 sets 1
Bit flag “1”, the first 3 characters of input register 1,
The data in the register 16 are combined in this order and stored in the entry address pointed to by the data in the register 14. In the input buffer 7, in the next cycle after the data of the register 27 is stored in the register 19, the register 19
The data whose address is the data in the input buffer 7
The data is read out to the register 20 in the comparison circuit 8. On the other hand, in the next cycle after the data in the register 16 is stored in the register 19, the first character of the input register 1 is stored in the input buffer 7 by using the data in the register 19 as an address. In the comparison circuit 8, the first character of the input register 1 is entered in the register 21, and this is compared with the data read from the input buffer 7 to the register 20 by the comparator 24. The comparison result is sent to the operation decision logic 10 by the signal line 901 (C2). The register 22 stores the pattern of three characters of the entries read from the dictionary 5, the register 23 stores the first three characters of the data in the input register 1, and these are compared by the comparator 25. The comparison result is the operation decision logic 1 by the signal line 900 (C1)
Sent to 0. In the flag register 12, when the signal sent from the operation decision logic 10 via the signal line 903 (XF) is 0, it is set to 0, and when the signal is 1, it is set to 1. The flag in the flag register 12 is the signal line 905.
(F) sends it to the operation decision logic 10 and the editing circuit 9. The counter 13 is updated when the signal 1 is sent from the operation decision logic 10, and the signal is set to 0.
At that time, the counter is initialized and the initial value is 1. Here, when the signal is 0, the initial value is 1 instead of 3.
The reason for this is that after the comparator 25 compares data for three characters, the comparator 24 also compares the second and third characters of the same data and updates the counter each time.

【0011】編集回路9の動作を図3によって説明す
る。図3で40はセレクタ、41はOR回路である。編
集回路9への入力の内、データはレジスタ12からのフ
ラグ、カウンタ13からのカウンタ値、入力レジスタ1
内のデータの先頭1文字、差分回路11からのオフセッ
ト、入力信号は動作決定論理10から信号線904(X
I)によって送られてくる信号と、信号線903(X
F)によって送られてくる信号と、信号線902(X
C)によって送られてくる信号である。セレクタ40に
は、差分回路11のオフセットと、入力レジスタ1の先
頭1文字が送られてくる。そして、信号線903(X
F)によって送られてくる信号が0のときは入力データ
1より送られてきたデータが選択され、信号が1のとき
は差分回路11より送られてきたオフセットが選択され
る。OR回路41ではフラグレジスタ12より送られて
きたフラグと、カウンタ13より送られてきたカウンタ
値と、セレクタ40より送られてきたデータと、入力レ
ジスタ1より送られてきたデータがこの順序で結合さ
れ、その結果が出力レジスタ2へ送られる。まず、信号
線904(XI)によって送られてくる信号が1のとき
にのみ、フラグレジスタ12からのフラグと、セレクタ
40からのデータがOR回路41を通過し、出力レジス
タ2へ送られ保持され続ける。カウンタ13からのカウ
ンタ値は、信号線902(XC)によって送られてくる
信号が0のときにのみOR回路41を通過し、出力レジ
スタ2へ送られ保持される。また、信号線903(X
F)によって送られてくる信号が0のとき(XF=0)
のみ入力レジスタ2から送られてきた1文字のデータを
出力レジスタ2へ送る。この場合、1文字送る度毎に1
文字分づつ出力レジスタ上のアドレスを上昇させる様に
ずらして送る。
The operation of the editing circuit 9 will be described with reference to FIG. In FIG. 3, 40 is a selector and 41 is an OR circuit. Of the inputs to the editing circuit 9, the data is the flag from the register 12, the counter value from the counter 13, and the input register 1.
The first character of the data in, the offset from the difference circuit 11, and the input signal are from the operation determination logic 10 to the signal line 904 (X
I) and the signal line 903 (X
F) and the signal line 902 (X
This is the signal sent by C). The offset of the difference circuit 11 and the first character of the input register 1 are sent to the selector 40. Then, the signal line 903 (X
When the signal sent by F) is 0, the data sent from the input data 1 is selected, and when the signal is 1, the offset sent from the difference circuit 11 is selected. In the OR circuit 41, the flag sent from the flag register 12, the counter value sent from the counter 13, the data sent from the selector 40, and the data sent from the input register 1 are combined in this order. And the result is sent to the output register 2. First, only when the signal sent by the signal line 904 (XI) is 1, the flag from the flag register 12 and the data from the selector 40 pass through the OR circuit 41 and are sent to the output register 2 and held therein. to continue. The counter value from the counter 13 passes through the OR circuit 41 only when the signal sent by the signal line 902 (XC) is 0, and is sent to the output register 2 and held therein. In addition, the signal line 903 (X
When the signal sent by F) is 0 (XF = 0)
Only the one-character data sent from the input register 2 is sent to the output register 2. In this case, 1 for every character sent
The address on the output register is shifted by character and sent so as to increase.

【0012】動作決定論理10は図4の仕様に基づき組
み合わせ論理によって実現された回路である。図4で1
0aは入力信号と出力信号を表の形式で表したものであ
る。10aで第1行は入力信号と出力信号の区別を示し
たものであり、第2行は項番と信号線を表したものであ
る。項番1は入力信号として、Fが0、C1が0のとき
に、出力信号は、XFが0、XCが1、XIが0であ
る。項番2は入力信号として、Fが0、C1が1のとき
に、出力信号は、XFが1、XCが0、XIが1であ
る。項番3は入力信号として、Fが1、C2が1のとき
に、出力信号は、XFが1、XCが1、XIが0であ
る。項番4は入力信号として、Fが1、C1が0、C2
が0のときに、出力信号は、XFが0、XCが0、XI
が1である。項番5は入力信号として、Fが1、C1が
1、C2が0のときに、出力信号は、XFが1、XCが
0、XIが1である。出力レジスタ2では、信号線90
4(XI)によって送られてくる信号が1のるとき(X
I=1)に出力コードを出力する。出力レジスタに設定
されるデータは、圧縮データの場合は、最初にフラグと
オフセットが格納され、次に、信号線904(XI)に
よって信号1が送られて来ているときに、編集回路9か
らカウンタ値が送られてくると、これが出力レジスタ2
へ格納され、フラグ、カウンタ値、オフセットのこの順
序の対を出力する。出力終了後直ちに、フラグと、オフ
セットあるいは入力レジスタ1の先頭1文字が格納され
る。非圧縮データの場合は、最初にフラグと入力レジス
タ1の先頭1文字が格納され、次に、非圧縮データが尽
きるまで入力レジスタ1の先頭1文字が順次格納され、
信号線904(XI)によって信号1が送られて来てい
るときに、編集回路9からカウンタ値が送られてくる
と、これが出力レジスタ2へ格納され、フラグ、カウン
タ値、文字列のこの順序の対を出力する。出力終了後直
ちに、フラグと、オフセットあるいは入力レジスタ1の
先頭1文字が格納される。
The operation decision logic 10 is a circuit implemented by combinational logic based on the specifications of FIG. 1 in FIG.
0a represents the input signal and the output signal in the form of a table. In 10a, the first row shows the distinction between the input signal and the output signal, and the second row shows the item number and the signal line. Item No. 1 is an input signal, when F is 0 and C1 is 0, the output signal is 0 for XF, 1 for XC, and 0 for XI. Item No. 2 is an input signal when F is 0 and C1 is 1, and the output signal is XF is 1, XC is 0, and XI is 1. Item No. 3 is an input signal in which F is 1 and C2 is 1, and the output signal is 1 in XF, 1 in XC, and 0 in XI. No. 4 is an input signal, F is 1, C1 is 0, C2
Is 0, XF is 0, XC is 0, XI
Is 1. Item No. 5 is an input signal, when F is 1, C1 is 1, and C2 is 0, the output signal is 1 for XF, 0 for XC, and 1 for XI. In the output register 2, the signal line 90
When the signal sent by 4 (XI) is 1 (X
The output code is output at I = 1). As for the data set in the output register, in the case of compressed data, the flag and the offset are stored first, and then, when the signal 1 is sent by the signal line 904 (XI), the data is output from the editing circuit 9. When the counter value is sent, this is output register 2
Stored in and outputs this ordered pair of flags, counter values, and offsets. Immediately after the output is completed, the flag and the offset or the first character of the input register 1 are stored. In the case of uncompressed data, the flag and the first 1 character of the input register 1 are stored first, and then the first 1 character of the input register 1 is sequentially stored until the uncompressed data is exhausted.
When the counter value is sent from the editing circuit 9 while the signal 1 is sent through the signal line 904 (XI), the counter value is stored in the output register 2, and the flag, the counter value, and the character string are arranged in this order. Outputs a pair of. Immediately after the output is completed, the flag and the offset or the first character of the input register 1 are stored.

【0013】図5は本発明の一実施例を応用したシステ
ム構成図である。図中、50は図1の圧縮回路、50は
記憶装置、60は記憶装置、100は記憶装置60内に
ある入力データ、101は記憶装置70内にある出力結
果である。記憶装置60にある入力データ100は圧縮
回路50に読み込まれ、圧縮回路50内で圧縮が実行さ
れ、記憶装置70へ出力され、出力結果101となる。
圧縮回路50への入力はn文字を単位として1文字づつ
ずらしながら行なう。例えば、入力データとしてABC
DEを考え、nを3とすると、最初はABCが入力さ
れ、次は、1文字ずれるので、BCDが入力され、その
次は、CDEが入力される。圧縮回路50からの出力
は、一般に可変長になる。圧縮データの場合はフラグと
カウンタ値、オフセットが出力されるが、通常、フラグ
とカウンタ値とを合わせて1文字分のデータとし、オフ
セットは1文字分のデータとするから、計2文字分のデ
ータが出力される。非圧縮データの場合、フラグとカウ
ンタ値、文字列が出力されるが、通常、フラグとカウン
タ値を合わせて1文字分とするので、文字列の長さ+1
の長さのデータを出力する。なお、本発明では圧縮とは
復元可能なコード変換の事であるが、入力データの長さ
と出力データの長さとは必ずしも一致しない。即ち、圧
縮によりデータ長が短くなる事もあれば長くなる事もあ
る。一般に結果のデータ長はデータそのものに依存して
決まる。
FIG. 5 is a system configuration diagram to which an embodiment of the present invention is applied. In the figure, 50 is the compression circuit of FIG. 1, 50 is a storage device, 60 is a storage device, 100 is input data in the storage device 60, and 101 is an output result in the storage device 70. The input data 100 in the storage device 60 is read by the compression circuit 50, is compressed in the compression circuit 50, is output to the storage device 70, and becomes the output result 101.
The input to the compression circuit 50 is performed while shifting by one character in units of n characters. For example, as input data ABC
Considering DE, if n is 3, ABC is input first, then one character is shifted, so BCD is input, and then CDE is input. The output from the compression circuit 50 is generally of variable length. In the case of compressed data, the flag, the counter value, and the offset are output. Normally, the flag and the counter value are combined into one character data, and the offset is the data for one character. The data is output. In the case of uncompressed data, the flag, the counter value, and the character string are output. Normally, the flag and the counter value are combined into one character, so the character string length +
The data of the length of is output. In the present invention, compression means decompressible code conversion, but the length of input data and the length of output data do not necessarily match. That is, the data length may be shortened or lengthened due to the compression. Generally, the resulting data length depends on the data itself.

【0014】図6は編集回路9において生成される出力
コードである。図中102は非圧縮コード、103は圧
縮コードである。非圧縮コード102の構造は、先頭に
非圧縮コードである事を表すフラグ0があり、次に非圧
縮長、即ち、非圧縮データの文字数を表すカウンタ値が
あり、最後に非圧縮文字列が付随している。通常、フラ
グとカウンタ値で1文字分とし、非圧縮文字列は1文字
以上あるため、非圧縮コードは2文字以上のデータであ
る。一般に、非圧縮文字列の文字数は不定であり、非圧
縮コードは可変長コードになる。圧縮コード103の構
造は、先頭に圧縮コードである事を表すフラグ1があ
り、次にパターン長、即ち、現データと一致するパター
ンの長さを表すカウンタ値があり、最後に現データから
以前に出現したパターンまでのオフセットが付随してい
る。圧縮コードは、不定になる部分がないため、固定長
コードになっている。通常、フラグとカウンタ値で1文
字とし、オフセットを1文字分とするので、圧縮コード
は2文字分の長さのコードになる。
FIG. 6 shows an output code generated in the editing circuit 9. In the figure, 102 is a non-compressed code and 103 is a compressed code. The structure of the uncompressed code 102 has a flag 0 indicating that it is an uncompressed code, a counter value that indicates the uncompressed length, that is, the number of characters of uncompressed data, and an uncompressed character string at the end. It is attached. Normally, the flag and the counter value are one character, and the uncompressed character string has one or more characters. Therefore, the uncompressed code is data of two or more characters. Generally, the number of characters in an uncompressed character string is indefinite, and the uncompressed code is a variable length code. The structure of the compressed code 103 has a flag 1 indicating that it is a compressed code at the beginning, then a pattern length, that is, a counter value indicating the length of a pattern that matches the current data, and finally from the current data to the previous one. The offset to the pattern that appears in is attached. The compressed code is a fixed length code because there is no undefined part. Normally, the flag and the counter value are one character, and the offset is one character, so the compression code has a length of two characters.

【0015】図7は入力データ100と圧縮結果101
の詳細である。入力データ100において、先頭文字よ
り初めて6文字目までのABCDEFは非圧縮部分であ
るため、図6に従って非圧縮コードを生成すると、ま
ず、先頭は非圧縮フラグ0、次に、非圧縮部分の長さ
6、最後が非圧縮文字ABCDEF、即ち、06ABC
DEFが非圧縮コードとなる。更に、入力データ100
の7文字目から11文字目のABCDEは、先頭から5
文字分に全く同じデータが存在する。従って、この部分
が圧縮でき、図6に従って圧縮コードを生成すると、ま
ず、先頭は圧縮フラグ1、次にパターン長であるが、こ
れは5文字分のデータが同じであるため5になり、最後
にオフセットであるが、これは7文字目のAからみて先
頭1文字目のAまでの距離であり、従って差を取って6
となる。即ち、圧縮コードは156となる。入力データ
100において残った2文字XYについては、これは非
圧縮文字であるため、同様にして、非圧縮コード02X
Yが生成される。以上によって、入力データ100に対
して圧縮結果101が生成される。
FIG. 7 shows input data 100 and compression result 101.
Is the details. In the input data 100, since the first character up to the sixth character ABCDEF is an uncompressed part, when an uncompressed code is generated according to FIG. 6, first, the uncompressed flag is 0, then the length of the uncompressed part. 6 and the last is uncompressed character ABCDEF, that is, 06ABC
DEF becomes the uncompressed code. Furthermore, input data 100
ABCDE from the 7th character to the 11th character is 5 from the beginning
The exact same data exists for each character. Therefore, this portion can be compressed, and when the compression code is generated according to FIG. 6, first, the compression flag is 1, and then the pattern length. However, this is 5 because the data for 5 characters is the same, and the last. This is the offset, but this is the distance from the 7th character A to the first 1st character A.
Becomes That is, the compressed code is 156. Since the two characters XY remaining in the input data 100 are uncompressed characters, similarly, the uncompressed code 02X
Y is generated. As a result, the compression result 101 is generated for the input data 100.

【0016】図8は辞書5の詳細である。辞書はフラグ
付きのメモリである。図中、第1列は使用フラグであ
り、使用フラグが0の場合そのエントリー内のデータは
無効である事を表し、使用フラグが1の場合そのエント
リー内のデータは使用可能である事を表す。第2列には
データのパターンが登録されており、本実施例において
は3文字のパターンが登録されている。これはハッシュ
検索時に、入力データとの照合に使用される。これによ
って3文字までのデータの照合は辞書内にあるパターン
データのみで行える。第3列には、入力バッファ7にお
ける、第2列目のパターンデータの2文字目へのポイン
タが登録されている。このポインタは4文字以上のデー
タとの照合に使用される。この使用法については後述す
る。
FIG. 8 shows the details of the dictionary 5. The dictionary is a memory with flags. In the figure, the first column is a use flag. When the use flag is 0, it means that the data in the entry is invalid, and when the use flag is 1, it means that the data in the entry is usable. . A data pattern is registered in the second column, and in this embodiment, a three-character pattern is registered. This is used for matching with input data during hash search. As a result, the collation of data up to 3 characters can be performed only with the pattern data in the dictionary. A pointer to the second character of the pattern data of the second column in the input buffer 7 is registered in the third column. This pointer is used for collation with data of 4 characters or more. This usage will be described later.

【0017】図9は、図1の圧縮回路50における検索
照合処理を説明するための図であり、入力データ100
のABCDEFを処理し、次のAを処理する所を示して
いる。図中100は入力データ、5は辞書、7は入力バ
ッファ、104は図1のハッシュ回路3において計算さ
れたハッシュ値である。
FIG. 9 is a diagram for explaining the search / collation processing in the compression circuit 50 of FIG.
Processing of ABCDEF and processing of the next A. In the figure, 100 is input data, 5 is a dictionary, 7 is an input buffer, and 104 is a hash value calculated in the hash circuit 3 of FIG.

【0018】以下、図1、図7、図9を参照して圧縮処
理について説明する。
The compression process will be described below with reference to FIGS. 1, 7, and 9.

【0019】入力データ100において、最初は先頭文
字のABCが図1の入力レジスタ1へ入力される。ま
ず、3文字のABCはハッシュ回路3でハッシュ値が計
算され、その結果(これを1とする)はレジスタ14に
入る。次にレジスタ14内の1を辞書5のエントリアド
レスとして辞書を引くが、第1エントリはフラグが0で
あるため参照されない。従って、差分回路11、レジス
タ22、セレクタ26へのデータ転送は行なわれない。
これにより、差分回路11、レジスタ22に入っている
データは無意味なデータである。一方レジスタ16内の
データ(初期値0)はセレクタ18、加算器17へ送ら
れる。セレクタ18ではレジスタ16より送られてきた
データがレジスタ19へ入る。このタイミングはレジス
タ14にデータが設定されるタイミングである。レジス
タ19のデータを入力バッファ7のアドレスとして入力
レジスタ1の先頭1文字のAが入力バッファ7へ格納さ
れる。また、レジスタ19へデータが格納されたタイミ
ングでレジスタ16にデータは加算器17で加算され、
レジスタ16へ設定される。これはまた、差分回路1
1、OR回路15へ送られる。OR果色15では、1と
ABCとレジスタ16から送られてきた1の対を辞書5
へ送り、レジスタ14のデータに基づき、エントリ1に
格納する。また、差分回路11では無意味な差分値を計
算し、それを編集回路9へ送る。また、セレクタ26で
は無意味なデータが選ばれレジスタ27へ送られる。レ
ジスタ27のデータはセレクタ18と加算器28へ送ら
れる。加算器28では加算され、その結果がセレクタ2
6へ送られる。セレクタ18ではレジスタ27から送ら
れてきたデータがレジスタ19へ送られる。レジスタ1
9のデータをアドレスとし、入力バッファより1文字の
無意味なデータがレジスタ20へ設定される。レジスタ
21へは入力レジスタ1の先頭1文字のAがレジスタ1
4にハッシュ値が設定されるタイミングで格納され、レ
ジスタ20のデータ(上記のレジスタ20に設定された
データではなく、その前に入力バッファ7よりレジスタ
20に設定されていたデータである)と、次のサイクル
で比較器24で比較され、不一致信号0が信号線C2に
より動作決定論理10へ送られる。レジスタ23へは入
力レジスタ1内のデータ3文字ABCが格納され、レジ
スタ22と、比較器25で比較され、不一致信号0が信
号線C1により動作決定論理10へ送られる。また、レ
ジスタ12内のフラグ0が動作決定論理10へ送られ
る。すなわち、F=0、C1=0、C2=0となる。こ
れにより動作決定論理10の出力は、XF=0、XC=
1、XI=0になる。動作決定論理10で発生した信号
により、レジスタ12は0に設定され、カウンタ13は
1になる。編集回路9では、初期処理の場合だけは、X
I=0でもフラグ0と入力レジスタ1の先頭1文字Aが
出力レジスタ21に送られ設定される。以下、BCD〜
EFAの入力に対して同様の処理が行なわれ、フラグレ
ジスタは0に、カウンタ13は5となる。また、これら
の場合には、XF=0となり、入力レジスタ1の先頭文
字のみは編集回路9から出力レジスタ2へ出力される。
In the input data 100, the first character ABC is input to the input register 1 shown in FIG. First, the hash value of the three-character ABC is calculated by the hash circuit 3, and the result (which is 1) is stored in the register 14. Next, the dictionary is looked up with 1 in the register 14 as the entry address of the dictionary 5, but the first entry is not referenced because the flag is 0. Therefore, data transfer to the difference circuit 11, the register 22 and the selector 26 is not performed.
As a result, the data stored in the difference circuit 11 and the register 22 is meaningless data. On the other hand, the data in the register 16 (initial value 0) is sent to the selector 18 and the adder 17. In the selector 18, the data sent from the register 16 enters the register 19. This timing is the timing when data is set in the register 14. The first character A of the input register 1 is stored in the input buffer 7 using the data in the register 19 as the address of the input buffer 7. Further, at the timing when the data is stored in the register 19, the data is added to the register 16 by the adder 17,
It is set in the register 16. This is also the difference circuit 1
1, sent to the OR circuit 15. In the OR fruit color 15, the pair of 1 and 1 sent from ABC and the register 16 is used as the dictionary 5
To the entry 1 based on the data in the register 14. Further, the difference circuit 11 calculates a meaningless difference value and sends it to the editing circuit 9. Further, meaningless data is selected by the selector 26 and sent to the register 27. The data in the register 27 is sent to the selector 18 and the adder 28. The adder 28 performs addition, and the result is the selector 2
Sent to 6. The data sent from the register 27 is sent to the register 19 in the selector 18. Register 1
Using the data of 9 as an address, meaningless data of one character is set in the register 20 from the input buffer. To the register 21, the first character A of the input register 1 is the register 1
4 is stored at the timing when the hash value is set, and the data of the register 20 (not the data set in the register 20 described above but the data set in the register 20 by the input buffer 7 before that), In the next cycle, it is compared by the comparator 24, and the mismatch signal 0 is sent to the operation decision logic 10 by the signal line C2. The three-character data ABC in the input register 1 is stored in the register 23, which is compared with the register 22 by the comparator 25, and the disagreement signal 0 is sent to the operation decision logic 10 by the signal line C1. Also, flag 0 in register 12 is sent to operation decision logic 10. That is, F = 0, C1 = 0, and C2 = 0. As a result, the output of the operation decision logic 10 is XF = 0, XC =
1, XI = 0. The signal generated by the operation decision logic 10 sets the register 12 to 0 and the counter 13 to 1. In the editing circuit 9, only in the case of initial processing, X
Even if I = 0, the flag 0 and the first character A of the input register 1 are sent to the output register 21 and set. Below, BCD ~
The same process is performed on the EFA input, and the flag register becomes 0 and the counter 13 becomes 5. In these cases, XF = 0 and only the first character of the input register 1 is output from the editing circuit 9 to the output register 2.

【0020】入力データ100において、6番目の入力
は3文字のFABが図1の入力レジスタ1へ入力され
る。まず、この3文字FABはハッシュ回路3でハッシ
ュ値が計算され、その結果(これを6とする)はレジス
タ14に入る。次にレジスタ14内の6を辞書5のエン
トリーアドレスとして辞書を引くが、第6エントリーは
フラグが0であるため参照されない。従って、差分回路
11、レジスタ22、セレクタ26へのデータ転送は行
なわれない。これにより差分回路11、レジスタ22に
入っているデータは無意味なデータである。一方、レジ
スタ16内のデータ(5)はセレクタ18、加算器17
へ送られる。セレクタ18ではレジスタ16より送られ
てきたデータがレジスタ19へ入る。このタイミングは
レジスタ14にデータが設定されるタイミングである。
レジスタ19のデータを入力バッファ7のアドレスとし
て入力レジスタ1の先頭1文字のFが入力バッファ7へ
格納される。レジスタ19へデータが格納されたタイミ
ングで、レジスタ16のデータは加算器17で加算さ
れ、レジスタ16へ設定される。これはまた、差分回路
11、OR回路15へ送られる。OR回路15では、1
とFABとレジスタ16から送られてきた6との対を辞
書5へ送り、レジスタ14のデータに基づき、エントリ
ー6に格納する。また、差分回路11では無意味な差分
値を計算し、それを編集回路9へ送る。
In the input data 100, the FAB of three characters is input to the input register 1 of FIG. 1 for the sixth input. First, the hash value of the three-character FAB is calculated by the hash circuit 3, and the result (which is 6) is stored in the register 14. Next, the dictionary is looked up using 6 in the register 14 as the entry address of the dictionary 5, but the sixth entry is not referenced because the flag is 0. Therefore, data transfer to the difference circuit 11, the register 22 and the selector 26 is not performed. As a result, the data stored in the difference circuit 11 and the register 22 is meaningless data. On the other hand, the data (5) in the register 16 is the selector 18 and the adder 17
Sent to. In the selector 18, the data sent from the register 16 enters the register 19. This timing is the timing when data is set in the register 14.
The first character F of the input register 1 is stored in the input buffer 7 by using the data in the register 19 as the address of the input buffer 7. At the timing when the data is stored in the register 19, the data in the register 16 is added by the adder 17 and set in the register 16. This is also sent to the difference circuit 11 and the OR circuit 15. In the OR circuit 15, 1
And the pair of FAB and 6 sent from the register 16 are sent to the dictionary 5 and stored in the entry 6 based on the data in the register 14. Further, the difference circuit 11 calculates a meaningless difference value and sends it to the editing circuit 9.

【0021】また、セレクタ26では無意味なデータが
選ばれレジスタ27へ送られる。レジスタ27のデータ
はセレクタ18と加算器28へ送られる。加算器28で
は加算され、その結果がセレクタ26へ送られる。セレ
クタ18ではレジスタ27から送られてきたデータがレ
ジスタ19へ送られる。レジスタ19のデータをアドレ
スとし、入力バッファ7より1文字の無意味なデータが
レジスタ20へ設定される。レジスタ21へは入力レジ
スタ1の先頭1文字のFがレジスタ14にハッシュ値が
設定されるタイミングで格納され、レジスタ20のデー
タ(上記のレジスタ20に設定されたデータではなく、
その前に入力バッファ7よりレジスタ20に設定されて
いたデータである)と、次のサイクルで比較器24で比
較され、不一致信号0が信号線C2により動作決定論理
10へ送られる。レジスタ23へは入力レジスタ1内の
データ3文字FABが格納され、レジスタ22と、比較
器25で比較され、不一致信号0が信号線C1により動
作決定論理10へ送られる。また、レジスタ12内のフ
ラグ0が動作決定論理10へ送られる。すなわち、F=
0、C1=0、C2=0となる。これにより動作決定論
理10の出力は、XF=0、XC=1、XI=0にな
る。動作決定論理10で発生した信号により、レジスタ
12は0に設定され、カウンタ13は6になる。編集回
路9では、XF=0であるので入力レジスタ1の先頭1
文字のみが出力レジスタ2に送られ設定される。
Further, meaningless data is selected by the selector 26 and sent to the register 27. The data in the register 27 is sent to the selector 18 and the adder 28. Addition is performed by the adder 28, and the result is sent to the selector 26. The data sent from the register 27 is sent to the register 19 in the selector 18. Using the data in the register 19 as an address, meaningless data of one character is set in the register 20 from the input buffer 7. The first character F of the input register 1 is stored in the register 21 at the timing when the hash value is set in the register 14, and the data of the register 20 (not the data set in the register 20,
The data which has been set in the register 20 from the input buffer 7 before that) is compared with the comparator 24 in the next cycle, and the mismatch signal 0 is sent to the operation decision logic 10 through the signal line C2. The three-character data FAB in the input register 1 is stored in the register 23, which is compared with the register 22 by the comparator 25, and the disagreement signal 0 is sent to the operation decision logic 10 by the signal line C1. Also, flag 0 in register 12 is sent to operation decision logic 10. That is, F =
0, C1 = 0, C2 = 0. As a result, the output of the operation decision logic 10 becomes XF = 0, XC = 1, and XI = 0. The signal generated by the operation decision logic 10 sets the register 12 to 0 and the counter 13 to 6. In the editing circuit 9, since XF = 0, the head 1 of the input register 1
Only the characters are sent to the output register 2 and set.

【0022】入力データ100において、7番目は3文
字のABCが図1の入力レジスタ1へ入力される。ま
ず、この3文字ABCはハッシュ回路3でハッシュ値が
計算され、その結果(これを1とする)はレジスタ14
に入る。次にレジスタ14内の1を辞書5のエントリー
アドレスとして辞書を引くが、第1エントリーはフラグ
が1であるため参照される。従って、差分回路11、レ
ジスタ22、セレクタ26へのデータ転送は行なわれ
る。これにより差分回路11へ1、レジスタ22にAB
Cが入る。一方、レジスタ16内のデータ(6)はセレ
クタ18、加算器17へ送られる。セレクタ18ではレ
ジスタ16より送られてきたデータがレジスタ19へ入
る。このタイミングはレジスタ14にデータが設定され
るタイミングである。レジスタ19のデータを入力バッ
ファ7のアドレスとして入力レジスタ1の先頭1文字の
Aが入力バッファ7へ格納される(Fの次の位置に)。
また、レジスタ19へデータが格納されたタイミング
で、レジスタ16のデータは加算器17で加算され、レ
ジスタ16へ設定される。これはまた、差分回路11、
OR回路15へ送られる。OR回路15では、1とAB
Cとレジスタ16から送られてきた7との対を辞書5へ
送り、レジスタ14のデータに基づき、エントリー1に
格納する。また差分回路11では差分値を計算し、その
結果である6を編集回路9へ送る。また、セレクタ26
では辞書からのデータである1が選ばれレジスタ27へ
送られる。レジスタ27のデータはセレクタ18と加算
器28へ送られる。加算器28では加算され、その結果
がセレクタ26へ送られる。セレクタ18ではレジスタ
27から送られてきたデータがレジスタ19へ送られ
る。レジスタ19のデータをアドレスとし、入力バッフ
ァ7より1文字のデータBがレジスタ20へ設定され、
これは次の入力文字との比較に使用される。レジスタ2
1へは入力レジスタ1の先頭1文字のAがレジスタ14
にハッシュ値が設定されるタイミングで格納され、レジ
スタ20のデータ(前記データBの前にレジスタ20に
格納されたデータ)と、次のサイクルで比較器24で比
較され、不一致信号0が信号線C2により動作決定論理
10へ送られる。レジスタ23へは入力レジスタ1内の
データ3文字ABCが格納され、レジスタ22と、比較
器25で比較され、一致信号1が信号線C1により動作
決定論理10へ送られる。また、レジスタ12内のフラ
グ0が動作決定論理10へ送られる。すなわち、F=
0、C1=0、C2=0となる。これにより動作決定論
理10の出力は、XF=1、XC=0、XI=1にな
る。動作決定論理10で発生した信号により、レジスタ
12は1に設定され、カウンタ13は1になる。
In the input data 100, the third three-character ABC is input to the input register 1 of FIG. First, the hash value of the three-character ABC is calculated by the hash circuit 3, and the result (which is set to 1) is stored in the register 14
to go into. Next, the dictionary is looked up with 1 in the register 14 as the entry address of the dictionary 5, and the first entry is referred to because the flag is 1. Therefore, data transfer to the difference circuit 11, register 22, and selector 26 is performed. As a result, 1 is input to the difference circuit 11 and AB is input to the register 22.
Enter C. On the other hand, the data (6) in the register 16 is sent to the selector 18 and the adder 17. In the selector 18, the data sent from the register 16 enters the register 19. This timing is the timing when data is set in the register 14. Using the data in the register 19 as the address of the input buffer 7, the first character A of the input register 1 is stored in the input buffer 7 (at the position next to F).
Further, at the timing when the data is stored in the register 19, the data in the register 16 is added by the adder 17 and set in the register 16. This is also the difference circuit 11,
It is sent to the OR circuit 15. In the OR circuit 15, 1 and AB
The pair of C and 7 sent from the register 16 is sent to the dictionary 5 and stored in the entry 1 based on the data in the register 14. Further, the difference circuit 11 calculates the difference value and sends the result of 6 to the editing circuit 9. In addition, the selector 26
Then, 1 which is the data from the dictionary is selected and sent to the register 27. The data in the register 27 is sent to the selector 18 and the adder 28. Addition is performed by the adder 28, and the result is sent to the selector 26. The data sent from the register 27 is sent to the register 19 in the selector 18. Using the data in the register 19 as an address, one character of data B is set in the register 20 from the input buffer 7,
It is used to compare with the next input character. Register 2
To enter 1, the first character A of input register 1 is register 14
Is stored at the timing when the hash value is set to the data in the register 20 (data stored in the register 20 before the data B) and is compared by the comparator 24 in the next cycle. Sent to the action decision logic 10 by C2. The three-character data ABC in the input register 1 is stored in the register 23, which is compared with the register 22 by the comparator 25, and the coincidence signal 1 is sent to the operation decision logic 10 through the signal line C1. Also, flag 0 in register 12 is sent to operation decision logic 10. That is, F =
0, C1 = 0, C2 = 0. As a result, the output of the operation decision logic 10 becomes XF = 1, XC = 0, and XI = 1. The signal generated by the operation decision logic 10 sets the register 12 to 1 and the counter 13 to 1.

【0023】カウンタ13が1に初期化される前に、カ
ウンタ値6は編集回路9から出力レジスタ2へ送られ
る。出力レジスタ2にデータが設定される様子のみ取り
出して図3により説明すると、最初はフラグ0とAが編
集回路9の中のOR回路41、セレクタ40によって出
力レジスタ2へ送られる。以下順次、B、C、D、E、
FがOR回路41を通って出力レジスタ2へ送られる。
そして、入力データ100の7文字目からのABCの処
理の際に、今までカウンタ13より送られ無視されつづ
けてきたカウンタ値が更新直前に有効になり(カウンタ
値は6)、これがOR回路41を通って出力レジスタ2
へ送られる。これで出力レジスタ2ではデータ06AB
CDEFが設定され、これが図7の圧縮結果に示すよう
に出力される。出力レジスタ2よりデータが出力された
後は、レジスタ12からのフラグ1と差分回路11から
のオフセット6が編集回路9から出力レジスタ2へ送ら
れ設定される。以下、BCD〜DEXの入力に対して処
理が行なわれ、カウンタ13は更新されて行く。
The counter value 6 is sent from the editing circuit 9 to the output register 2 before the counter 13 is initialized to 1. 3 will be described by taking out only the state where data is set in the output register 2, the flags 0 and A are first sent to the output register 2 by the OR circuit 41 and the selector 40 in the editing circuit 9. Hereafter, B, C, D, E,
F is sent to the output register 2 through the OR circuit 41.
Then, during the ABC processing from the 7th character of the input data 100, the counter value that has been sent from the counter 13 and has been ignored so far becomes valid immediately before the update (the counter value is 6), and this is the OR circuit 41. Through output register 2
Sent to. Now the output register 2 has data 06AB
CDEF is set, and this is output as shown in the compression result of FIG. After the data is output from the output register 2, the flag 1 from the register 12 and the offset 6 from the difference circuit 11 are sent from the editing circuit 9 to the output register 2 and set. After that, the processing is performed on the inputs of BCD to DEX, and the counter 13 is updated.

【0024】入力データ100において、11文字目か
らの3文字のEXYが図1の入力レジスタ1へ入力され
る。まず、この3文字EXYはハッシュ回路3でハッシ
ュ値が計算され、その結果(これを1とする)はレジス
タ14に入る。次にレジスタ14内の1を辞書5のエン
トリーアドレスとして辞書を引くが、第1エントリーは
フラグが1であるため参照される。従って、差分回路1
1、レジスタ22、セレクタ26へのデータ転送は行な
われる。これにより差分回路11には7、レジスタ22
にABCが入る。一方、レジスタ16内のデータ(1
0)はセレクタ18、加算器17へ送られる。セレクタ
18ではレジスタ16より送られてきたデータがレジス
タ19へ入る。このタイミングはレジスタ14にデータ
が設定されるタイミングである。レジスタ19のデータ
を入力バッファ7のアドレスとして入力レジスタ1の先
頭1文字のEが入力バッファ7へ格納される。また、レ
ジスタ19へデータが格納されたタイミングでレジスタ
16のデータは加算器17で加算され、レジスタ16へ
設定される。これはまた、差分回路11、OR回路15
へ送られる。OR回路15では、1とEXYとレジスタ
16から送られてきた11との対を辞書5へ送り、レジ
スタ14のデータに基づき、エントリー1に格納する。
また、差分回路11では差分値を計算し、その結果であ
る4を編集回路9へ送る。また、セレクタ26では加算
器28で加算したデータが選ばれレジスタ27へ送られ
る。レジスタ27のデータはセレクタ18と加算器28
へ送られる。加算器28では加算され、その結果がセレ
クタ26へ送られる。セレクタ18ではレジスタ27か
ら送られてきたデータがレジスタ19へ送られる。レジ
スタ19のデータをアドレスとし、入力バッファ7より
1文字のデータFがレジスタ20へ設定され、これは次
の入力文字との比較に使用される。レジスタ21へは入
力レジスタ1の先頭1文字のEがレジスタ14にハッシ
ュ値が設定されるタイミングで格納され、レジスタ20
のデータ(前記データFの前にレジスタ20に格納され
たデータE)と、次のサイクルで比較器24で比較さ
れ、一致信号1が信号線C2により動作決定論理10へ
送られる。レジスタ23へは入力レジスタ1内のデータ
3文字EXYが格納され、レジスタ22と、比較器25
で比較され、不一致信号0が信号線C1により動作決定
論理10へ送られる。また、レジスタ12内のフラグ1
が動作決定論理10へ送られる。すなわち、F=1、C
1=0、C2=1となる。これにより動作決定論理10
の出力は、XF=1、XC=1、XI=0になる。動作
決定論理10で発生した信号により、レジスタ12は1
に設定され、カウンタ13は5になる。編集回路9で
は、送られてくるデータが全て無視され、出力レジスタ
2へは何も出力されない。
In the input data 100, EXY of three characters from the eleventh character is input to the input register 1 of FIG. First, the hash value of the three-character EXY is calculated by the hash circuit 3, and the result (which is 1) is stored in the register 14. Next, the dictionary is looked up with 1 in the register 14 as the entry address of the dictionary 5, and the first entry is referred to because the flag is 1. Therefore, the difference circuit 1
1, data transfer to the register 22, the selector 26 is performed. As a result, the difference circuit 11 has seven registers 22
ABC enters. On the other hand, the data (1
0) is sent to the selector 18 and the adder 17. In the selector 18, the data sent from the register 16 enters the register 19. This timing is the timing when data is set in the register 14. The first character E of the input register 1 is stored in the input buffer 7 by using the data in the register 19 as the address of the input buffer 7. The data in the register 16 is added by the adder 17 at the timing when the data is stored in the register 19 and set in the register 16. This is also the difference circuit 11 and the OR circuit 15
Sent to. In the OR circuit 15, the pair of 1 and EXY and 11 sent from the register 16 is sent to the dictionary 5 and stored in the entry 1 based on the data in the register 14.
Further, the difference circuit 11 calculates a difference value and sends the result of 4 to the editing circuit 9. The selector 26 selects the data added by the adder 28 and sends it to the register 27. The data of the register 27 is the selector 18 and the adder 28.
Sent to. Addition is performed by the adder 28, and the result is sent to the selector 26. The data sent from the register 27 is sent to the register 19 in the selector 18. Using the data in the register 19 as an address, one character data F is set in the register 20 from the input buffer 7 and is used for comparison with the next input character. The first character E of the input register 1 is stored in the register 21 at the timing when the hash value is set in the register 14, and the register 20
Data (data E stored in the register 20 before the data F) is compared by the comparator 24 in the next cycle, and the coincidence signal 1 is sent to the operation decision logic 10 by the signal line C2. The register 23 stores the three-character data EXY in the input register 1, and the register 22 and the comparator 25
And the mismatch signal 0 is sent to the operation decision logic 10 through the signal line C1. Also, flag 1 in register 12
Are sent to the motion decision logic 10. That is, F = 1, C
1 = 0 and C2 = 1. This enables the operation decision logic 10
Output becomes XF = 1, XC = 1, and XI = 0. The register 12 is set to 1 by the signal generated by the operation decision logic 10.
, And the counter 13 becomes 5. The editing circuit 9 ignores all the data that has been sent and outputs nothing to the output register 2.

【0025】入力データ100において、12番目から
の2文字のXYが図1の入力レジスタ1へ入力される。
まず、この2文字XYはハッシュ回路3でハッシュ値が
計算され、その結果(これを1とする)はレジスタ14
に入る。次にレジスタ14内の1を辞書5のエントリー
アドレスとして辞書を引くが、第1エントリーはフラグ
が1であるため参照される。従って、差分回路11、レ
ジスタ22、セレクタ26へのデータ転送は行なわれ
る。これにより差分回路11には11、レジスタ22に
はEXYが入る。一方、レジスタ16内のデータ(1
1)はセレクタ18、加算器17へ送られる。セレクタ
18ではレジスタ16より送られてきたデータがレジス
タ19へ入る。このタイミングはレジスタ14にデータ
が設定されるタイミングである。レジスタ19のデータ
を入力バッファ7のアドレスとして入力レジスタ1の先
頭1文字のXが入力バッファ7へ格納される。また、レ
ジスタ19へデータが格納されたタイミングで、レジス
タ16のデータは加算器17で加算され、レジスタ16
へ設定される。これはまた、差分回路11、OR回路1
5へ送られる。OR回路15では、1とXYとレジスタ
16から送られてきた12との対を辞書5へ送り、レジ
スタ14のデータに基づき、エントリー1に格納する。
また差分回路11では差分値を計算し、その結果である
1を編集回路9へ送る。また、セレクタ26では加算器
28で加算したデータが選ばれレジスタ27へ送られ
る。レジスタ27のデータはセレクタ18と加算器28
へ送られる。加算器28では加算され、その結果がセレ
クタ26へ送られる。セレクタ18ではレジスタ27か
ら送られてきたデータがレジスタ19へ送られる。レジ
スタ19のデータをアドレスとし、入力バッファ7より
1文字のデータXがレジスタ20へ設定され、これは次
の入力文字との比較に使用される。レジスタ21へは入
力レジスタ1の先頭1文字のXがレジスタ14にハッシ
ュ値が設定されるタイミングで格納され、レジスタ20
のデータ(前記データXの前にレジスタ20に格納され
たデータF)と、次のサイクルで比較器24で比較さ
れ、不一致信号0が信号線C2により動作決定論理10
へ送られる。レジスタ23へは入力レジスタ1内のデー
タ2文字XYが格納され、レジスタ22と、比較器25
で比較され、不一致信号0が動作決定論理10へ送られ
る。また、レジスタ12内のフラグ1が信号線C1によ
り動作決定論理10へ送られる。すなわち、F=1、C
1=0、C2=0となる。これにより動作決定論理10
の出力は、XF=0、XC=0、XI=1になる。動作
決定論理10で発生した信号により、レジスタ12は0
に設定され、カウンタ13は1になる。カウンタ13が
1に初期化される前に、カウンタ値5は編集回路9から
出力レジスタ2へ送られる。
In the input data 100, the two-character XY from the 12th character is input to the input register 1 of FIG.
First, the hash value of the two-character XY is calculated by the hash circuit 3, and the result (which is 1) is stored in the register 14
to go into. Next, the dictionary is looked up with 1 in the register 14 as the entry address of the dictionary 5, and the first entry is referred to because the flag is 1. Therefore, data transfer to the difference circuit 11, register 22, and selector 26 is performed. As a result, 11 is input to the difference circuit 11 and EXY is input to the register 22. On the other hand, the data (1
1) is sent to the selector 18 and the adder 17. In the selector 18, the data sent from the register 16 enters the register 19. This timing is the timing when data is set in the register 14. The first character X of the input register 1 is stored in the input buffer 7 using the data in the register 19 as the address of the input buffer 7. At the timing when the data is stored in the register 19, the data in the register 16 is added by the adder 17,
Is set to. This is also the difference circuit 11 and the OR circuit 1.
Sent to 5. In the OR circuit 15, the pair of 1 and XY and 12 sent from the register 16 is sent to the dictionary 5 and stored in the entry 1 based on the data in the register 14.
Further, the difference circuit 11 calculates a difference value and sends 1 as a result to the editing circuit 9. The selector 26 selects the data added by the adder 28 and sends it to the register 27. The data of the register 27 is the selector 18 and the adder 28.
Sent to. Addition is performed by the adder 28, and the result is sent to the selector 26. The data sent from the register 27 is sent to the register 19 in the selector 18. Using the data in the register 19 as an address, one character of data X is set in the register 20 from the input buffer 7 and is used for comparison with the next input character. The first character X of the input register 1 is stored in the register 21 at the timing when the hash value is set in the register 14, and the register 20
Data (data F stored in the register 20 before the data X) is compared by the comparator 24 in the next cycle, and the disagreement signal 0 is determined by the operation determination logic 10 by the signal line C2.
Sent to. The two-character data XY in the input register 1 is stored in the register 23, and the register 22 and the comparator 25
And the mismatch signal 0 is sent to the operation decision logic 10. Further, the flag 1 in the register 12 is sent to the operation decision logic 10 by the signal line C1. That is, F = 1, C
1 = 0 and C2 = 0. This enables the operation decision logic 10
Output becomes XF = 0, XC = 0, and XI = 1. The signal generated by the operation decision logic 10 causes the register 12 to reach 0.
Is set to 1, and the counter 13 becomes 1. The counter value 5 is sent from the editing circuit 9 to the output register 2 before the counter 13 is initialized to 1.

【0026】出力レジスタ2にデータが設定される様子
のみ取り出して図3により説明すると、2度目のABC
の処理によってフラグ1とオフセット6が編集回路9の
中のOR回路41、セレクタ40によって出力レジスタ
2へ送られる。そして、入力データXYの処理を行なう
まで編集回路9に入ってくるデータは無視され続け、X
Yの処理の際に、更新直前のカウンタ値が有効になり
(カウンタ値は5)、これがOR回路41を通って出力
レジスタ2へ送られる。これで出力レジスタ2ではデー
タ15 6 が設定され、これが図7の圧縮結果に示すよ
うに出力される(XI=1であるため)。出力レジスタ
2よりデータが出力された後は、レジスタ12からのフ
ラグ0と入力レジスタ1からのXが編集回路9から出力
レジスタ2へ送られ設定される。
Only the manner in which the data is set in the output register 2 will be extracted and explained with reference to FIG.
The flag 1 and the offset 6 are sent to the output register 2 by the OR circuit 41 and the selector 40 in the editing circuit 9 by the processing of. Then, the data coming into the editing circuit 9 is continuously ignored until the input data XY is processed, and X
During the processing of Y, the counter value immediately before the update becomes valid (the counter value is 5), and this is sent to the output register 2 through the OR circuit 41. As a result, the data 15 6 is set in the output register 2 and is output as shown in the compression result of FIG. 7 (since XI = 1). After the data is output from the output register 2, the flag 0 from the register 12 and the X from the input register 1 are sent from the editing circuit 9 to the output register 2 and set.

【0027】[0027]

【発明の効果】以上説明したように、本発明では辞書を
テーブルの形で構成し、かつ、辞書のエントリー内に登
録してあるデータ列以上の長さを照合できるため、高速
にデータ列の照合が行え、しかも照合するデータ列の長
さに制限がないという効果がある。
As described above, according to the present invention, the dictionary is constructed in the form of a table, and the length of the data string registered in the entry of the dictionary or more can be collated. There is an effect that the collation can be performed and the length of the data string to be collated is not limited.

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

【図1】 本発明の一実施例における圧縮回路の構成を
示すブロック図である。
FIG. 1 is a block diagram showing a configuration of a compression circuit according to an embodiment of the present invention.

【図2】図1の差分回路の詳細構成を示す図である。FIG. 2 is a diagram showing a detailed configuration of a difference circuit in FIG.

【図3】図1の編集回路の詳細構成を示す図である。3 is a diagram showing a detailed configuration of an editing circuit in FIG.

【図4】図1の動作決定論理の仕様を示す図である。FIG. 4 is a diagram showing the specifications of the operation decision logic of FIG.

【図5】本発明の一実施例の使用例を説明する図であ
る。
FIG. 5 is a diagram illustrating a usage example of an embodiment of the present invention.

【図6】出力コードのフォーマットを示す図である。FIG. 6 is a diagram showing a format of an output code.

【図7】入力データに対する圧縮結果を示す図である。FIG. 7 is a diagram showing a compression result for input data.

【図8】辞書の構成を示す図である。FIG. 8 is a diagram showing a configuration of a dictionary.

【図9】図1の圧縮回路50における検索照合処理を説
明する図である。
FIG. 9 is a diagram illustrating a search and collation process in the compression circuit 50 in FIG.

【符号の説明】[Explanation of symbols]

1 入力レジスタ 2 出力レジスタ 3 ハッシュ回路 4 辞書登録/読出回路 5 辞書 6 入力バッファ登録/読出回路 7 入力バッファ 8 比較回路 9 編集回路 10 動作決定論理 11 差分回路 12 フラグレジスタ 13 カウンタ 50 圧縮回路 1 Input Register 2 Output Register 3 Hash Circuit 4 Dictionary Registration / Readout Circuit 5 Dictionary 6 Input Buffer Registration / Readout Circuit 7 Input Buffer 8 Comparison Circuit 9 Editing Circuit 10 Operation Decision Logic 11 Difference Circuit 12 Flag Register 13 Counter 50 Compression Circuit

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 テキストデータ列のデータ圧縮をするデ
ータ圧縮処理装置において、 出現文字列を記憶する入力レジスタと、 エントリー使用状態フラグと文字列と該文字列の出現位
置を示すポインタをエントリーとする辞書を有し、前記
出現文字列のハッシュ値をアドレスとしてエントリーを
読み出しかつ該出現文字列を含むエントリーを格納する
辞書記憶手段と、 入力バッファに前記出現文字列の先頭文字を格納し、前
記辞書記憶手段から読み出されたエントリーのポインタ
に基づき文字を読み出し、かつポインタを生成して出力
する入力バッファ手段と、 前記入力バッファ手段から読み出された文字と前記出現
文字列の先頭文字を比較して結果を出力しかつ前記辞書
記憶手段から読み出されたエントリーの文字列と前記出
現文字列を比較して結果を出力する比較手段と、 前記比較手段の出力とフラグレジスタの値を入力として
論理値を出力する動作決定論理と、 該論理値により値の更新されるフラグレジスタとカウン
タと、 前記辞書記憶手段から読み出されたエントリーのポイン
タと前記入力バッファ手段で生成されたポインタとの差
分値をとる差分手段と、 前記出現文字列の先頭文字と前記フラグレジスタとカウ
ンタと差分回路の値を前記論理値に基づき編集し、編集
結果を出力する編集手段を備えることを特徴とするデー
タ圧縮処理装置。
1. A data compression processing device for compressing data of a text data string, wherein an input register for storing an appearing character string, an entry usage status flag, a character string, and a pointer indicating an appearance position of the character string are entries. Dictionary storage means for reading an entry with a hash value of the appearing character string as an address and storing an entry including the appearing character string; and storing the first character of the appearing character string in an input buffer, the dictionary The input buffer means for reading out a character based on the entry pointer read out from the storage means and for generating and outputting the pointer is compared with the character read out from the input buffer means and the first character of the appearance character string. And outputs the result and compares the character string of the entry read from the dictionary storage means with the appearance character string. Comparing means for outputting a result and outputting a result, operation decision logic for outputting a logical value with the output of the comparing means and the value of the flag register as input, a flag register and a counter whose value is updated by the logical value, and the dictionary Difference means for taking a difference value between the pointer of the entry read from the storage means and the pointer generated by the input buffer means, the first character of the appearance character string, the flag register, the counter, and the value of the difference circuit A data compression processing apparatus comprising: an editing unit that edits based on a logical value and outputs an edited result.
JP5081391A 1993-03-16 1993-03-16 Data compression processor Pending JPH06266532A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5081391A JPH06266532A (en) 1993-03-16 1993-03-16 Data compression processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5081391A JPH06266532A (en) 1993-03-16 1993-03-16 Data compression processor

Publications (1)

Publication Number Publication Date
JPH06266532A true JPH06266532A (en) 1994-09-22

Family

ID=13745010

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5081391A Pending JPH06266532A (en) 1993-03-16 1993-03-16 Data compression processor

Country Status (1)

Country Link
JP (1) JPH06266532A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014236449A (en) * 2013-06-04 2014-12-15 国立大学法人 筑波大学 Data compressor and data decompressor

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014236449A (en) * 2013-06-04 2014-12-15 国立大学法人 筑波大学 Data compressor and data decompressor

Similar Documents

Publication Publication Date Title
US20020196166A1 (en) Data compression method and data compression apparatus
EP0470798B1 (en) Dictionary searching system
JP3016868B2 (en) LZW data compression using associative memory
EP0621557A1 (en) Font definition conversion method
EP0961966B1 (en) N-way processing of bit strings in a dataflow architecture
JPH06266532A (en) Data compression processor
JPH10107647A (en) CRC circuit
JPH09246995A (en) Code error detection circuit
JPH1098392A (en) CRC code generation circuit, code error detection circuit, and CRC circuit
JPS6362151B2 (en)
JP3269415B2 (en) CRC operation circuit
JP3317079B2 (en) Variable length code decoding device
JPH07152533A (en) Data compression device
JP4726046B2 (en) Character string search device, computer program, and character string search method
JP2001148789A (en) Mmr compression method for binary image and its device
JPH06242923A (en) Data compression processor and data expansion processor
JPH06266795A (en) Delay time improving system
JP2000357970A (en) Character string data compression encoding apparatus, character string data decompression apparatus, and character string data arithmetic processing apparatus
JP2610028B2 (en) Voiced and semi-voiced sound conversion processor
JPS6373422A (en) information retrieval device
JPH05265698A (en) Information processing equipment
JPH06274310A (en) Data compression processor
JPH04332035A (en) Data compressing device
JPS6132867B2 (en)
JPS6219976A (en) Compressing system for quantity of pattern information