JPH05233211A - Circuit for detecting longest coincident character string - Google Patents

Circuit for detecting longest coincident character string

Info

Publication number
JPH05233211A
JPH05233211A JP3773392A JP3773392A JPH05233211A JP H05233211 A JPH05233211 A JP H05233211A JP 3773392 A JP3773392 A JP 3773392A JP 3773392 A JP3773392 A JP 3773392A JP H05233211 A JPH05233211 A JP H05233211A
Authority
JP
Japan
Prior art keywords
coincidence
output
match
data
character string
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
JP3773392A
Other languages
Japanese (ja)
Inventor
Ryuji Omoto
隆二 大本
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.)
Seiko Epson Corp
Original Assignee
Seiko Epson 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 Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP3773392A priority Critical patent/JPH05233211A/en
Publication of JPH05233211A publication Critical patent/JPH05233211A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)

Abstract

PURPOSE:To rapidly detect the same character string included in sequential data only by an electric circuit. CONSTITUTION:This longest coincident character string detecting circuit is constituted of a first in first out type buffer 1 consisting of (N+1) bytes, N coincidence detectors 2, a coincidence existence detector 4 for detecting the existence of one or more coincidence, a coincident position detector 5 for calculating a coincident position, a storage device 6 for storing the output of the detector 5, a coincidence length counter 8 for counting up the length of coincidence, and a control circuit 7 for controlling the operation of the whole circuit.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、シーケンシャルデータ
を Ziv-Lempel アルゴリズムに基づいて圧縮するための
技術に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a technique for compressing sequential data based on the Ziv-Lempel algorithm.

【0002】[0002]

【従来の技術】コンピュータによって、文章データや画
像データなどの様々なデータを取り扱う場合、これらの
データ量が、しばしばあまりにも大きくなってしまうた
めに、データの記憶や、通信回線によりデータを転送す
ることが困難になってしまう。そこで、これらのデータ
の冗長性を利用して、より小さな大きさに圧縮し、必要
な時だけ元のデータを復元した後利用する。
2. Description of the Related Art When a computer handles various types of data such as text data and image data, the amount of data often becomes too large. Therefore, data is stored or data is transferred by a communication line. Becomes difficult. Therefore, the redundancy of these data is used to compress the data to a smaller size, and the original data is restored only when necessary before use.

【0003】データ圧縮の方法の、最も基本的なものと
しては、ハフマン符号があるが、これは、データを構成
するコードの出現率に従って、頻繁に現れるコードを短
い符号で表し、余り現れないコードを、長い符号で表
す。
The most basic data compression method is the Huffman code, which is a code that frequently appears with a short code and a code that rarely appears according to the appearance rate of the codes forming the data. Is represented by a long code.

【0004】しかし、ハフマン符号は、コードの出現率
だけを利用して圧縮しているため、圧縮率が悪い。
However, since the Huffman code is compressed using only the code appearance rate, the compression rate is poor.

【0005】そこで、コードとコードの並び方、文章で
いえば言葉や綴りのように現れやすい文字列を見つけ
て、データを圧縮する方法が考案された。
Therefore, a method has been devised for compressing the data by finding the codes, the arrangement of the codes, and the character string that is likely to appear in words such as words and spellings.

【0006】Jacob Ziv と Abraham Lempel の論文 "A
universal algorithm for sequentialdata compressio
n" IEEE Transactions on Information Theory,IT-23
(3):337-343,1977.で開示されたデータ圧縮アルゴリズ
ム Ziv-Lempel アルゴリズムは、高い圧縮率を得ること
が出来る。シーケンシャルデータに繰り返しパターンや
連続パターンがある場合、特に高い圧縮率を示す。
A paper by Jacob Ziv and Abraham Lempel "A
universal algorithm for sequential data compressio
n "IEEE Transactions on Information Theory, IT-23
The data compression algorithm Ziv-Lempel algorithm disclosed in (3): 337-343, 1977. can obtain a high compression rate. When the sequential data has a repeating pattern or a continuous pattern, a particularly high compression rate is shown.

【0007】このアルゴリズムを実現するためには、シ
ーケンシャルデータの一部分のデータ列と他の部分のデ
ータ列との一致を検出する必要があるが、 Edward R.Fi
ala,Daniel H.Greene の米国特許第 4,906,991号明細書
には、コンピュータのソフトウェアの分野で用いられる
データ構造である”木構造”の一種を使ってシーケンシ
ャルデータの一致を検出する方法が開示されている。
In order to realize this algorithm, it is necessary to detect a match between a data string of a part of sequential data and a data string of another part, but Edward R. Fi
U.S. Pat. No. 4,906,991 to ala, Daniel H. Greene discloses a method for detecting matching of sequential data using a type of "tree structure", which is a data structure used in the field of computer software. There is.

【0008】[0008]

【発明が解決しようとする課題】しかしながら、この方
法を実現するには、コンピュータか、コンピュータと同
様に順次計算を行っていく電気回路が必要であるし、一
つの一致を検出するためには、複数のステップの計算が
必要となるためシーケンシャルデータを圧縮するために
必要となる時間が長くなる。
However, in order to realize this method, a computer or an electric circuit for sequentially performing calculation similarly to the computer is required, and in order to detect one match, The time required to compress the sequential data becomes long because the calculation of multiple steps is required.

【0009】本発明は、このような問題点を解決するた
めに、簡単な電気回路だけで、シーケンシャルデータ内
のデータ列の一致を検出する、最長一致文字列検出回路
を提案するものである。
In order to solve such a problem, the present invention proposes a longest match character string detection circuit which detects a match of a data string in sequential data with only a simple electric circuit.

【0010】[0010]

【課題を解決するための手段】このような問題を解消す
るために本発明においては、N+1バイトの先入れ後だ
し式のバッファと、N個の一致検出器と、該N個の一致
検出器の一致出力が一つでも有るかどうかを見つける一
致有無検出器と、一致の位置を計算する一致位置検出器
と、該一致位置検出器の出力を記憶する記憶装置と、一
致の長さを数える一致長カウンタと、回路全体の動作を
制御する制御回路とからなり、シーケンシャルデータの
繰り返しパターンを検出することを特徴とする。
In order to solve such a problem, according to the present invention, an N + 1 byte first-in / first-out buffer, N match detectors, and N match detectors are provided. Of whether or not there is at least one match output, a match position detector that calculates the position of the match, a storage device that stores the output of the match position detector, and the length of the match It is characterized by comprising a coincidence length counter and a control circuit for controlling the operation of the entire circuit, and detecting a repeating pattern of sequential data.

【0011】[0011]

【実施例】Ziv-Lempel アルゴリズムはシーケンシャル
データにおいて、過去に現れた文字列を引用することで
データを圧縮している。例えば A B C E 0 1 2 A B C X Y Z というシーケンシャルデータは”A B C ”という文字列
が2回あるので後ろにある”A B C ”を7文字前からの
3文字と同じであることを示す符号に置き換えて [A] [B] [C] [E] [0] [1] [2] [7文字前からの3文字]
[X] [Y] [Z] という符号列に変換される。また次のような連続データ A A A A A A A A A は、 [A] [1文字前からの8文字] という符号列に変
換される。
[Example] The Ziv-Lempel algorithm compresses data in sequential data by referring to character strings that have appeared in the past. For example, the sequential data ABCE 0 1 2 ABCXYZ has the character string "ABC" twice, so replace the trailing "ABC" with a code that indicates that it is the same as the three characters from the previous 7 characters [A] [ B] [C] [E] [0] [1] [2] [3 characters from 7 characters before]
It is converted to the code string [X] [Y] [Z]. In addition, the following continuous data AAAAAAAAA is converted into the code string [A] [8 characters from 1 character before].

【0012】図1は本発明の最長一致文字列検出回路の
構成を示すものであって、データバッファ1は過去に蓄
えたデータを1つ下方向にずらした後、外部から送られ
てきたデータを最上部Xに入れる。
FIG. 1 shows the configuration of the longest match character string detection circuit according to the present invention. The data buffer 1 shifts the data stored in the past downward by one and then sends the data sent from the outside. Put in the top X.

【0013】一致検出器2は、XのデータとB0〜B7
の一致を検出するための物であり、この回路を制御する
信号Gが、「0」の時一致を検出すると出力が「1」に
変化し、信号Gが「1」の時不一致を検出すると出力が
「0」に変化する。一致有無検出器4は、B0からB7
の内1つでも一致が有る時は「1」を出力し一致がまっ
たく無い時は「0」を出力する。一致位置検出器5は、
B0からB7の出力H0からH7のうち,どの信号が
「1」で有るかを示す数値を出力する。一致位置記憶回
路6は、一致位置検出器の出力を記憶する。
The coincidence detector 2 outputs X data and B0 to B7.
When the signal G that controls this circuit is "0", the output changes to "1", and when the signal G is "1", it detects the mismatch. The output changes to "0". The coincidence detector 4 is from B0 to B7.
If even one of them has a match, "1" is output, and if there is no match, "0" is output. The coincidence position detector 5 is
Among the outputs H0 to H7 of B0 to B7, a numerical value indicating which signal is “1” is output. The coincidence position storage circuit 6 stores the output of the coincidence position detector.

【0014】制御回路7は、一致有無検出器4の出力D
に従って回路全体を制御する。一致長カウンタ8は一致
が幾つ続いたかを数える。
The control circuit 7 outputs the output D of the coincidence detector 4
Control the whole circuit according to. The match length counter 8 counts how many matches have continued.

【0015】以下に実際のデータを使って最長一致文字
列を検出する様子を説明する。
The manner in which the longest matching character string is detected using actual data will be described below.

【0016】ABCEABCF という文字列が来たと
き、ABCという同じ文字列を検出する。
When the character string ABCEABCF comes, the same character string ABC is detected.

【0017】初め制御回路7の出力GがG=0であるの
で、一致有無検出器4の出力Dが「1」に変化するのを
待つ。
Initially, since the output G of the control circuit 7 is G = 0, it waits until the output D of the coincidence detector 4 changes to "1".

【0018】一致が無い間は一致無しを表す信号とXに
入っているデータを外部に出力し続ける。
While there is no match, the signal indicating no match and the data contained in X are continuously output to the outside.

【0019】 G N P Q D H7 H6 H5 H4 H3 H2 H1 H0 B7 B6 B5 B4 B3 B2 B1 B0 X 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 A 出力D=0であるから”A”を出力し、B7〜B0,X
を左にシフトする。
G N P Q D H7 H6 H5 H4 H3 H2 H1 H0 B7 B6 B5 B4 B3 B2 B1 B0 X 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 A Output D = Since it is 0, "A" is output and B7 to B0, X
Shift left.

【0020】Xには、外部からのデータが入る。Data from the outside is stored in X.

【0021】 G N P Q D H7 H6 H5 H4 H3 H2 H1 H0 B7 B6 B5 B4 B3 B2 B1 B0 X 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 A B 出力D=0であるから”B”を出力し、B7〜B0,X
を左にシフトする。
G N P Q D H7 H6 H5 H4 H3 H2 H1 H0 B7 B6 B5 B4 B3 B2 B1 B0 X 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 A B Output D = Since it is 0, "B" is output, and B7 to B0, X
Shift left.

【0022】 G N P Q D H7 H6 H5 H4 H3 H2 H1 H0 B7 B6 B5 B4 B3 B2 B1 B0 X 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 A B C 出力D=0であるから”C”を出力し、B7〜B0,X
を左にシフトする。
G N P Q D H7 H6 H5 H4 H3 H2 H1 H0 B7 B6 B5 B4 B3 B2 B1 B0 X 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 A B C Output D = Since it is 0, "C" is output and B7 to B0, X
Shift left.

【0023】 G N P Q D H7 H6 H5 H4 H3 H2 H1 H0 B7 B6 B5 B4 B3 B2 B1 B0 X 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 A B C E 出力D=0であるから”E”を出力し、B7〜B0,X
を左にシフトする。
G N P Q D H7 H6 H5 H4 H3 H2 H1 H0 B7 B6 B5 B4 B3 B2 B1 B0 X 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 A B C E Output D = Since it is 0, "E" is output and B7 to B0, X
Shift left.

【0024】 G N P Q D H7 H6 H5 H4 H3 H2 H1 H0 B7 B6 B5 B4 B3 B2 B1 B0 X 0 0 3 0 1 0 0 0 0 1 0 0 0 0 0 0 0 A B C E A 出力D=1が見つかったのでN=0、G=1とし、一致
が終わってD=0となるのを待つ。
G N P Q D H7 H6 H5 H4 H3 H2 H1 H0 B7 B6 B5 B4 B3 B2 B1 B0 X 0 0 3 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 A B C E A Output D = Since 1 is found, N = 0 and G = 1 are set, and the process waits until the match ends and D = 0.

【0025】もし、G=1かつD=1ならN=N+1と
なる。H7〜H0 の内 H3 が「1」であるから一致位置検
出器の出力Pは、「3」になっている。
If G = 1 and D = 1, then N = N + 1. Since H3 of H7 to H0 is "1", the output P of the coincidence position detector is "3".

【0026】 G N P Q D H7 H6 H5 H4 H3 H2 H1 H0 B7 B6 B5 B4 B3 B2 B1 B0 X 1 0 3 3 1 0 0 0 0 1 0 0 0 0 0 0 A B C E A B 出力D=1であるからN=N+1とし、B7〜B0,X
を左にシフトする。
G N P Q D H7 H6 H5 H4 H3 H2 H1 H0 B7 B6 B5 B4 B3 B2 B1 B0 X 1 0 3 3 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 A B B C E A B Output D = Since it is 1, N = N + 1, and B7 to B0, X
Shift left.

【0027】 G N P Q D H7 H6 H5 H4 H3 H2 H1 H0 B7 B6 B5 B4 B3 B2 B1 B0 X 1 1 3 3 1 0 0 0 0 1 0 0 0 0 0 A B C E A B C 出力D=1であるからN=N+1とし、B7〜B0,X
を左にシフトする。
G N P Q D H7 H6 H5 H4 H3 H2 H1 H0 B7 B6 B5 B4 B3 B2 B1 B0 X 1 1 3 3 1 1 0 0 0 0 0 1 0 0 0 0 0 0 A B C E E A B C Output D = Since it is 1, N = N + 1, and B7 to B0, X
Shift left.

【0028】 G N P Q D H7 H6 H5 H4 H3 H2 H1 H0 B7 B6 B5 B4 B3 B2 B1 B0 X 1 2 0 3 0 0 0 0 0 0 0 0 0 0 A B C E A B C F 出力D=0となったので、文字列の一致が終わったこと
がわかり、XからのN+1=3文字ABCは、Q+1=
4文字前からの文字列ABCと一致していることを検出
できた。
G N P Q D H7 H6 H5 H4 H3 H2 H1 H0 B7 B6 B5 B4 B3 B2 B1 B0 X 1 2 0 3 0 0 0 0 0 0 0 0 0 0 0 0 A B C F E D B = Since it became 0, it was found that the matching of the character strings had ended, and N + 1 = 3 characters ABC from X was Q + 1 =
It was possible to detect that it matched the character string ABC from the previous four characters.

【0029】次の検出は、一旦G=0とし、出力Dの値
がどうなるか調べる。
In the next detection, G = 0 is set once and the value of the output D is examined.

【0030】 G N P Q D H7 H6 H5 H4 H3 H2 H1 H0 B7 B6 B5 B4 B3 B2 B1 B0 X 0 0 0 3 0 0 0 0 0 0 0 0 0 3 A B C E A B C F もし出力D=1ならば、N=0、G=1とし次の一致文
字列判定に入るが、この場合は、D=0であるからG=
0のままで、D=1になるのを待つ。
G N P Q D H7 H6 H5 H4 H3 H2 H1 H0 B7 B6 B5 B4 B3 B2 B1 B0 X 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 3 A B C F E A B C F If Output D If = 1, N = 0 and G = 1 are set and the next matching character string determination is started. In this case, however, since D = 0, G =
Wait 0 and wait for D = 1.

【0031】図2は、図1の一致検出器2の1具体例を
示すものである。
FIG. 2 shows a specific example of the coincidence detector 2 of FIG.

【0032】[0032]

【発明の効果】以上説明したように本発明の最長一致文
字列検出回路は、N個のデータからNステップの計算
で、最長一致文字列を取り出すことができる。
As described above, the longest match character string detection circuit of the present invention can extract the longest match character string from N pieces of data by calculating N steps.

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

【図1】本発明の1実施例を示す回路図。FIG. 1 is a circuit diagram showing an embodiment of the present invention.

【図2】図1の一致検出器の内部構造を表した図。FIG. 2 is a diagram showing an internal structure of the coincidence detector shown in FIG.

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

1 データバッファ 2 一致検出器 4 一致有無検出器 5 一致位置検出器 6 一致位置記憶装置 7 制御回路 8 一致長カウンタ 1 data buffer 2 coincidence detector 4 coincidence presence / absence detector 5 coincidence position detector 6 coincidence position storage device 7 control circuit 8 coincidence length counter

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 N+1バイトの先入れ後だし式のバッフ
ァと、N個の一致検出器と、該N個の一致検出器の一致
出力が一つでも有るかどうかを見つける一致有無検出器
と、一致の位置を計算する一致位置検出器と、該一致位
置検出器の出力を記憶する記憶装置と、一致の長さを数
える一致長カウンタと、回路全体の動作を制御する制御
回路とからなり、シーケンシャルデータの繰り返しパタ
ーンを検出することを特徴とする最長一致文字列検出回
路。
1. A first-in-first-out buffer of N + 1 bytes, N coincidence detectors, and a coincidence detector for detecting whether or not there is any coincidence output of the N coincidence detectors, A match position detector that calculates the match position, a storage device that stores the output of the match position detector, a match length counter that counts the match length, and a control circuit that controls the operation of the entire circuit. A longest match character string detection circuit characterized by detecting a repeating pattern of sequential data.
JP3773392A 1992-02-25 1992-02-25 Circuit for detecting longest coincident character string Pending JPH05233211A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3773392A JPH05233211A (en) 1992-02-25 1992-02-25 Circuit for detecting longest coincident character string

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3773392A JPH05233211A (en) 1992-02-25 1992-02-25 Circuit for detecting longest coincident character string

Publications (1)

Publication Number Publication Date
JPH05233211A true JPH05233211A (en) 1993-09-10

Family

ID=12505692

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3773392A Pending JPH05233211A (en) 1992-02-25 1992-02-25 Circuit for detecting longest coincident character string

Country Status (1)

Country Link
JP (1) JPH05233211A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0886207A2 (en) * 1997-06-19 1998-12-23 Nec Corporation Longest coincidence data detection using associative memory units having interleaved data

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0886207A2 (en) * 1997-06-19 1998-12-23 Nec Corporation Longest coincidence data detection using associative memory units having interleaved data
EP0886207A3 (en) * 1997-06-19 1999-12-08 Nec Corporation Longest coincidence data detection using associative memory units having interleaved data
US6098147A (en) * 1997-06-19 2000-08-01 Nec Corporation Longest coincidence data detection using associative memory units having interleaved data

Similar Documents

Publication Publication Date Title
JP3009727B2 (en) Improved data compression device
JP3913004B2 (en) Data compression method and apparatus, computer program, and storage medium
JP2000505968A (en) Data compression and decompression system with immediate dictionary update interleaved with string search
US6169499B1 (en) LZW data compression/decompression apparatus and method with embedded run-length encoding/decoding
CA2381381C (en) Lzw data compression apparatus and method using look-ahead mathematical run processing
JPH05241777A (en) Data compression system
US6426711B1 (en) Character table implemented data compression method and apparatus
JPH05233211A (en) Circuit for detecting longest coincident character string
JP3038223B2 (en) Data compression method
JP3631144B2 (en) Data compression method and apparatus using embedded run-length coding using mathematical run processing
JP3241787B2 (en) Data compression method
JP3242795B2 (en) Data processing device and data processing method
US6501395B1 (en) System, method and computer readable medium for compressing a data sequence
JP3653226B2 (en) Data compression method and apparatus using embedded run length coding
JP3104302B2 (en) Data compression device
JPH09181610A (en) Pattern compression method and device
US6674374B1 (en) Data compressor utilizing switched input coincidence elements
US6653949B1 (en) Data compression apparatus and method utilizing tandem coupled matrices
JPH0969785A (en) Method and device for data compression
JPH07264075A (en) Data compression device
JPH03209923A (en) Data compressing system
US6756923B1 (en) Data compressor utilizing switched input coincidence elements arranged in virtual levels
JPH06332666A (en) Compressing method for data
JPH03247168A (en) Data compression system
JP2000036756A (en) Character string compression system