JP2690175B2 - Unequal length code decoding circuit - Google Patents

Unequal length code decoding circuit

Info

Publication number
JP2690175B2
JP2690175B2 JP2151634A JP15163490A JP2690175B2 JP 2690175 B2 JP2690175 B2 JP 2690175B2 JP 2151634 A JP2151634 A JP 2151634A JP 15163490 A JP15163490 A JP 15163490A JP 2690175 B2 JP2690175 B2 JP 2690175B2
Authority
JP
Japan
Prior art keywords
circuit
output
bit
code
row
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.)
Expired - Lifetime
Application number
JP2151634A
Other languages
Japanese (ja)
Other versions
JPH0444466A (en
Inventor
司郎 藤原
Original Assignee
日本電気ホームエレクトロニクス株式会社
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 日本電気ホームエレクトロニクス株式会社 filed Critical 日本電気ホームエレクトロニクス株式会社
Priority to JP2151634A priority Critical patent/JP2690175B2/en
Publication of JPH0444466A publication Critical patent/JPH0444466A/en
Application granted granted Critical
Publication of JP2690175B2 publication Critical patent/JP2690175B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

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

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、ファクシミリ・画像圧縮等で用いられる不
等長符号の復号回路に関する。
The present invention relates to a decoding circuit for unequal length codes used in facsimile, image compression and the like.

〔従来の技術〕 上述の応用では、長さの異なる不等長符号語を連接し
たビット列として伝送する。従来このようなデータから
各符号語を復号する技術として、入力データから直接に
復号テーブルでデータを復号する技術(以下、従来技術
Aという)と、可変長符号は木構造をもつことを利用し
て1ビットずつ順次木を辿って復号する技術(以下、従
来技術Bという)とが周知である。
[Prior Art] In the above-mentioned application, unequal-length code words having different lengths are transmitted as a concatenated bit string. Conventionally, as a technique of decoding each code word from such data, a technique of directly decoding data from an input data using a decoding table (hereinafter referred to as conventional technique A) and a variable-length code having a tree structure are used. It is well known that a technique of sequentially tracing a tree by 1 bit and decoding (hereinafter referred to as a conventional technique B).

先ず従来技術Aにつき、第4図により説明する。バレ
ルシフタ1は復号すべきデータを入力し、たとえば16ビ
ットに区切って並列に出力する。そしてこの出力でROM2
をアドレスする。ROM2は各不等長符号語に対する復号デ
ータと、その符号長とが格納されている。ここで16ビッ
トの区切りは、符号語として最大符号長に対応するよう
に定めてある。最大符号長より短い符号語についても、
16ビットのアドレスで復号されるように復号データが記
録されている。ROM2からは復号データとともに符号長が
出力されるが、この符号長は加算器3で積算される。加
算器3の加算情報にもとづき、バレルシフタ1は解読さ
れた符号語のビット数だけシフトさせ、さらに16ビット
になるように復号するデータを入力させる。これによっ
てバレルシフタ1の出力の先頭は、常に次の符号語の先
頭になる。
First, the prior art A will be described with reference to FIG. The barrel shifter 1 inputs data to be decoded, divides it into, for example, 16 bits, and outputs them in parallel. And with this output ROM2
Address. The ROM 2 stores the decoded data for each unequal length code word and the code length thereof. Here, the 16-bit delimiter is defined so as to correspond to the maximum code length as a code word. For codewords shorter than the maximum code length,
The decoded data is recorded so that it can be decoded with a 16-bit address. The code length is output from the ROM 2 together with the decoded data, and the code length is integrated by the adder 3. Based on the addition information of the adder 3, the barrel shifter 1 shifts by the number of bits of the decoded codeword, and further inputs the data to be decoded into 16 bits. As a result, the head of the output of the barrel shifter 1 is always the head of the next code word.

次に従来技術Bについて第5図により説明する。ROM4
は解読テーブルで、入力データの1ビットごとにROM4内
に含ませた木構造に沿って探索をすすめ、最終的に終了
指標および復号データを格納するセルに到達させ、この
復号データを出力するものである。復号すべきデータの
Nビット目が1であればROM4で1000が出力される。次の
(N+1)ビット目が0であれば、前記1000と0とを合
わせて、次に探索すべきアドレスとする。このようにし
て、木構造を辿って、終了指標をもつセルに到達し、そ
の復号データを引き出すことができる。
Next, the related art B will be described with reference to FIG. ROM4
Is a decoding table, which advances the search along the tree structure contained in ROM4 for each bit of the input data, finally reaches the cell storing the end index and the decoded data, and outputs this decoded data. Is. If the Nth bit of the data to be decoded is 1, 1000 is output from ROM4. If the next (N + 1) th bit is 0, the addresses 1000 and 0 are combined to form the address to be searched next. In this way, the tree structure can be traced to reach the cell having the end index, and its decoded data can be extracted.

〔発明が解決しようとする課題〕[Problems to be solved by the invention]

従来技術Aでは、最大符号長のデータに対応させると
ともに、符号長を記憶しておくためにROMのデータ幅が
極めて大きくなる。またバレルシフタ等の複雑な回路が
必要となり、タイミングも厄介になる。従来技術Bで
は、ROMのエントリアドレスが多くなり、ROMの容量が大
きくなる。
In the prior art A, the data width of the ROM becomes extremely large in order to store the code length while making it correspond to the maximum code length data. In addition, a complicated circuit such as a barrel shifter is required, which makes timing difficult. In the conventional technique B, the number of ROM entry addresses increases, and the ROM capacity increases.

本発明の目的は、1ビットずつ符号語と比較してい
き、各ビットごとに一致がみられる符号語を簡単な構成
で求め、この符号語に該当する復号データを1対1対応
のROMから得られるようにしした復号回路を提供するこ
とにある。
The object of the present invention is to compare the code words bit by bit, find a code word that matches each bit with a simple configuration, and obtain the decoded data corresponding to this code word from the one-to-one correspondence ROM. It is to provide a decoding circuit adapted to be obtained.

〔課題を解決するための手段〕[Means for solving the problem]

本発明は、すべての符号語を、その最上位ビットを揃
えて、行方向に配列して記憶しているマトリクス状の符
号テーブルと、入力データの先頭から1ビットずつ順
次、前記符号テーブルの最上位列から低位例へと比較
し、列ごとに、一致した行から一致信号ビット“1"を、
不一致行について“0"を出力する比較回路と、各行ごと
に入力側からAND回路・ラッチ回路を接続し、前記ラッ
チ回路の出力をAND回路に正帰還させる回路構成を有
し、前記比較回路の出力を入力し、比較回路の現出力お
よび1ビット前の出力とがともに“1"であるときのみ、
ラッチ回路の出力を“1"とする中間的な符号一致判定部
と、前記符号一致判定部の出力が“1"になる複数の行に
ついて、符号テーブルの行番号上、最上位優先および最
下位優先となる行の番号数を求める2つの優先エンコー
ダと、前記2つのエンコーダの番号数の加算値から符号
語の一致判定がなされたことを検出して、データ復号を
行なう復号手段とを含むものである。
According to the present invention, all the code words are arranged in the row direction so that the most significant bits are aligned and stored, and a matrix-shaped code table is sequentially stored, one bit at a time from the beginning of the input data. Compare the column from the lower row to the lower row, and for each column, match signal bit “1” from the matched row,
The comparison circuit that outputs “0” for unmatched rows and the AND circuit / latch circuit connected from the input side for each row, and has a circuit configuration that positively feeds back the output of the latch circuit to the AND circuit, Only when the output is input and both the current output of the comparison circuit and the output one bit before are "1",
Regarding the intermediate code match determination unit that sets the output of the latch circuit to “1” and the plurality of lines whose output of the code match determination unit is “1”, the highest priority and the lowest order are given in the line numbers of the code table. It includes two priority encoders for obtaining the number of priority row numbers, and a decoding means for performing data decoding by detecting that a code word coincidence determination is made from the added value of the number numbers of the two encoders. .

〔作用〕[Action]

符号テーブルの行列は、仮りに行番号を0からn個ま
でつけると、この番号が各符号語を示すことになる。入
力データの最初のビットを各符号語の最上位ビットと比
較し、次に入力データの次のビットについて、符号語の
次位ビットと比較するように順次、1ビット比較回路で
ビットの一致を検出する。この比較回路の比較情報(た
とえば一致したとき“1",不一致のとき“0"とする)は
各行ごとに中間的な符号一致判定部に入力される。符号
一致判定部は前回のビット比較の結果を記憶しておき、
前回のビット比較で不一致であれば今回ビットについて
一致しても不一致“0"を出力する。このようにして符号
一致判定部は今回およびそれ以前までのビット比較の結
果がすべて一致した場合にのみ各行の出力を“1"として
いる。符号一致判定部の行で“1"なる行が複数個ある
か、1個であるかは上位および下位優先エンコーダの出
力値(行番号)を加算し、その加算値から判定できる。
“1"なる行が1個のみであれば、最終的に符号語が識別
されたことになり、行番号をアドレスとしてROMから復
号データを得ることができる。
If the row numbers from 0 to n are assigned to the matrix of the code table, this number indicates each code word. The first bit of the input data is compared with the most significant bit of each code word, and then the next bit of the input data is compared with the next bit of the code word. To detect. The comparison information of this comparison circuit (for example, "1" when they match and "0" when they do not match) is input to the intermediate code matching determination section for each row. The sign matching determination unit stores the result of the previous bit comparison,
If the previous bit comparison does not match, a mismatch “0” is output even if the current bit matches. In this way, the code coincidence determination unit sets the output of each row to "1" only when the results of bit comparison up to this time and up to that time all match. Whether there are a plurality of "1" lines or one line in the code matching determination unit can be determined by adding the output values (row numbers) of the upper and lower priority encoders and from the added value.
If there is only one "1" row, it means that the codeword is finally identified, and the decoded data can be obtained from the ROM using the row number as an address.

〔実施例〕〔Example〕

以下、図面を参照して、本発明の一実施例につき説明
する。第1図は概略構成図であって、100が符号テーブ
ルで、ここでは8個の符号語が最上位ビットを揃えてマ
トリクスに表示されている。110は復号すべきデータで
一連のビット列としてとぎれなく連続して入力される。
このデータの保持は図示していないが、1ビットのフリ
ップフロップでもよい。クロックCKにより順次データビ
ットと符号テーブル100の列方向のビットの各々と、比
較回路120で比較する。したがって比較を行なう入力デ
ータビットと、符号100の列方向ビットとが移動して比
較される。比較回路120はEX−NOR回路を各行ごとに備
え、入力と符号語との対応ビットが一致したときに、そ
の行出力として“1"を出力する。
An embodiment of the present invention will be described below with reference to the drawings. FIG. 1 is a schematic configuration diagram, in which 100 is a code table, in which eight code words are displayed in a matrix with the most significant bits aligned. Data 110 to be decoded is continuously input as a series of bit strings without interruption.
Although not shown in the figure for holding the data, a 1-bit flip-flop may be used. The comparison circuit 120 sequentially compares the data bit and each bit in the column direction of the code table 100 by the clock CK. Therefore, the input data bit to be compared and the column direction bit 100 are moved and compared. The comparison circuit 120 includes an EX-NOR circuit for each row, and outputs "1" as the row output when the corresponding bits of the input and the code word match.

次に、130は符号一致判定部で、内部構成はAND回路と
その出力をラッチするラッチ回路とからなり、ラッチ回
路の出力が符号一致判定部の出力となるとともに、この
出力は正帰還して入力側のAND回路の一方の入力となっ
ている。この回路構成からわかるように継続的に比較回
路1の出力が“1"である行のみが、符号一致判定部130
で“1"出力となる。なお、初期条件として符号一致判定
部130の各行出力は“1"としておく。
Next, 130 is a code matching determination unit, the internal configuration of which consists of an AND circuit and a latch circuit for latching its output. The output of the latch circuit becomes the output of the code matching determination unit, and this output is positively fed back. It is one input of the AND circuit on the input side. As can be seen from this circuit configuration, only the rows where the output of the comparison circuit 1 is “1” continuously are the code matching determination unit 130.
Outputs "1". As an initial condition, each row output of the code matching determination unit 130 is set to "1".

次に優先エンコーダ140,141は、第2図(a)(b)
の真理値表により、上位優先,下位優先の行番号数を出
力する。たとえば符号一致判定部130の“1"となる行が
2つあり第6行と第3行であるとすると、3ビット出力
として優先エンコーダ140の出力は110(すなわち6)、
優先エンコーダ141は101(すなわち5)となる。上記優
先の出力値を加算回路150で、加算し、その加算値(MOD
8),011(すなわち3)となる。一方、第6行1個のみ
が“1"となるとすると110,001となり加算して111(すな
わち7)となり符号数8から1をのぞいた数となる。こ
の関係はどの行でも1つの行のみ“1"となったとき、加
算値111となることから、符号判定が完了したことを検
出できる。
Next, the priority encoders 140 and 141 are shown in FIGS.
Outputs the number of line numbers of higher priority and lower priority according to the truth table of. For example, if there are two lines that are "1" in the code matching determination unit 130 and there are a sixth line and a third line, the output of the priority encoder 140 as a 3-bit output is 110 (that is, 6),
The priority encoder 141 becomes 101 (that is, 5). The above priority output value is added by the adder circuit 150, and the added value (MOD
8), 011 (that is, 3). On the other hand, if only one row in the 6th row is "1", it becomes 110,001 and is added to 111 (that is, 7), which is a number obtained by subtracting 1 from the code number 8. In this relationship, when only one row has a value of "1" in any row, the added value is 111, so that it is possible to detect that the code determination is completed.

加算回路150の出力が111なることを終了検出回路151
で検出することで符号語を分別して識別でき、上記優先
エンコーダ140の出力をアドレス入力とするROM152と、
上記終了検出回路151で復号手段を形成し、終了検出回
路151からの検出信号151aによりROM152から復号データ
を出力させる。このようにして本実施例では、連続入力
データに対し、連続的に復号データを得ることができ
る。
When the output of the addition circuit 150 becomes 111, the end detection circuit 151
It is possible to distinguish and identify the codewords by detecting with, and the ROM 152 that outputs the output of the priority encoder 140 as an address input,
The end detecting circuit 151 forms a decoding means, and the detection signal 151a from the end detecting circuit 151 causes the decoded data to be output from the ROM 152. In this way, in this embodiment, it is possible to continuously obtain decoded data for continuous input data.

以下に、本実施例の動作を明らかにするために第3図
(a)〜(b)において具体的に1ビットずつ本実施回
路の動作を追跡して示す。第3図(a)は初期設定で、
符号一致判定部130の出力はすべて“1"としておく。ま
た優先エンコーダ140と141は同一回路で入力結線のみ反
転して継続している。この動作の説明は省略するが、加
算回路150が111(すなわち7)になったとき復号は完成
し、ROM152から復号データを出力するし、また検出信号
151aにより符号一致判定部130の出力をすべて1に初期
設定する。
Below, in order to clarify the operation of the present embodiment, the operation of the present embodiment circuit will be traced and shown concretely bit by bit in FIGS. 3 (a) and 3 (b). Figure 3 (a) shows the default settings.
The outputs of the code matching determination unit 130 are all set to "1". Further, the priority encoders 140 and 141 are the same circuit, and only the input connections are inverted and continued. Although the description of this operation is omitted, when the adder circuit 150 becomes 111 (that is, 7), the decoding is completed, the decoded data is output from the ROM 152, and the detection signal is output.
151a initializes all outputs of the code matching determination unit 130 to 1.

〔発明の効果〕〔The invention's effect〕

以上、説明したように、本発明は入力データを1ビッ
トずつ、符号テーブルの各行のビットと順次比較して、
各ビットが符号テーブルの各ビットと連続して一致して
いるかぎり符号一致判定部の出力を“1"とし、符号一致
判定部の出力が“1"である行、すなわち符号テーブルに
おける符号語番号を上位および下位優先エンコーダで求
め、このエンコーダの出力値を加算して、特定の出力値
になったとき、符号一致判定部の出力が1個の行にのみ
“1"なることを検出して、入力データから符号語を分別
する。前記の“1"になる行は符号語番号を表わすので、
この符号語番号をROMの復号テーブルのアドレスとする
ことで1対1で復号データをうることができる。
As described above, the present invention sequentially compares the input data bit by bit with the bits of each row of the code table,
As long as each bit continuously matches each bit of the code table, the output of the code match determination unit is set to "1" and the output of the code match determination unit is "1", that is, the code word number in the code table. Is calculated by the upper and lower priority encoders, and when the output value of this encoder is added to reach a specific output value, it is detected that the output of the code matching determination unit is "1" in only one row. , Separates codewords from input data. Since the line that becomes "1" represents the codeword number,
By using this code word number as the address of the ROM decoding table, the decoded data can be obtained in a one-to-one manner.

したがって、本発明におけるROMとしては符号テーブ
ルと復号データ用メモリとの2つでよく、しかもこのRO
M容量は最小ですむ。さらにクロックで入力データを入
力し、リアルタイムで復号データを得ることができる。
また、従来技術Aで必要であったバレルシフタ、および
そのタイミング回路等は不要で回路構成が簡単化でき
る。
Therefore, the ROM in the present invention need only be a code table and a decoded data memory.
M capacity is minimum. Furthermore, input data can be input by a clock to obtain decoded data in real time.
Further, the barrel shifter and its timing circuit, which are required in the prior art A, are not necessary, and the circuit configuration can be simplified.

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

第1図は本発明の一実施例の概略構成図、第2図は優先
エンコーダの真理値表、第3図(a)〜(d)は1ビッ
トずつの回路動作を示す図、第4図および第5図はそれ
ぞれ従来技術を示す。 100……符号テーブル、110……入力データ、120……比
較回路、130……符号一致判定部、140,141……優先エン
コーダ、 150……加算回路、151……終了検出回路、 152……復号用ROM。
FIG. 1 is a schematic configuration diagram of an embodiment of the present invention, FIG. 2 is a truth table of a priority encoder, and FIGS. 3 (a) to 3 (d) are diagrams showing a circuit operation for each bit, and FIG. 5 and FIG. 5 respectively show the prior art. 100 ... Code table, 110 ... Input data, 120 ... Comparison circuit, 130 ... Code matching determination section, 140,141 ... Priority encoder, 150 ... Addition circuit, 151 ... End detection circuit, 152 ... For decoding ROM.

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】不等長符号語が連接して、連続ビットとし
て入力されるデータから、各符号語を識別して復号する
回路であって、 a. すべての符号語を、その最上位ビットを揃えて、行
方向に配列して記憶しているマトリクス状の符号テーブ
ルと、 b. 入力データの先頭から1ビットずつ順次、前記符号
テーブルの最上行列から低位例へと比較し、列ごとに、
一致した行から一致信号ビット“1"を、不一致行につい
て“0"を出力する比較回路と、 c. 各行ごとに入力側からAND回路・ラッチ回路を接続
し、前記ラッチ回路の出力をAND回路に正帰還させる回
路構成を有し、前記比較回路の出力を入力し、比較回路
の現出力および1ビット前の出力とがともに“1"である
ときのみ、ラッチ回路の出力を“1"とする中間的な符号
一致判定部と、 d. 前記符号一致判定部の出力が“1"になる複数の行に
ついて、符号テーブルの行番号上、最上位優先および最
下位優先となる行の番号数を求める2つの優先エンコー
ダと、 e. 前記2つのエンコーダの番号数の加算値から符号語
の一致判定がなされたことを検出して、データ復号を行
なう復号手段 とを含むことを特徴とする不等長符号復号回路。
1. A circuit for identifying and decoding each codeword from data input as consecutive bits by concatenating unequal-length codewords, and a. Are arranged in a row direction and stored in a matrix form, and b. The input data is sequentially bit by bit from the beginning, and the uppermost matrix of the code table is compared to the low-order example. ,
A comparison circuit that outputs a match signal bit “1” from the matched row and a “0” for the non-matched row, and c. An AND circuit / latch circuit is connected from the input side for each row, and the output of the latch circuit is an AND circuit. The output of the comparison circuit is input, and the output of the latch circuit is set to "1" only when both the current output of the comparison circuit and the output one bit before are "1". An intermediate code match determination unit, and d. The number of lines having the highest priority and the lowest priority in the line numbers of the code table for a plurality of lines for which the output of the code match determination unit is "1". And a decoding means for performing data decoding by detecting that a codeword coincidence determination is made from the added value of the number numbers of the two encoders. Isometric code decoding circuit.
JP2151634A 1990-06-12 1990-06-12 Unequal length code decoding circuit Expired - Lifetime JP2690175B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2151634A JP2690175B2 (en) 1990-06-12 1990-06-12 Unequal length code decoding circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2151634A JP2690175B2 (en) 1990-06-12 1990-06-12 Unequal length code decoding circuit

Publications (2)

Publication Number Publication Date
JPH0444466A JPH0444466A (en) 1992-02-14
JP2690175B2 true JP2690175B2 (en) 1997-12-10

Family

ID=15522834

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2151634A Expired - Lifetime JP2690175B2 (en) 1990-06-12 1990-06-12 Unequal length code decoding circuit

Country Status (1)

Country Link
JP (1) JP2690175B2 (en)

Also Published As

Publication number Publication date
JPH0444466A (en) 1992-02-14

Similar Documents

Publication Publication Date Title
US8095526B2 (en) Efficient retrieval of variable-length character string data
US6876774B2 (en) Method and apparatus for compressing data string
EP0380294A1 (en) String matching
EP0628228A1 (en) Data compression using hashing
US4285049A (en) Apparatus and method for selecting finite success states by indexing
US20050187898A1 (en) Data Lookup architecture
EP0127815B1 (en) Data compression method
KR0163464B1 (en) Huffman code decoding circuit
JP2690175B2 (en) Unequal length code decoding circuit
JPS60105040A (en) Sentence retrieving system
US6734813B2 (en) Data receiving device for receiving serial data according to over-sampling
JP3130324B2 (en) Data compression method
JPS62179083A (en) Reference system for character string
JP3199291B2 (en) Method of configuring Huffman decoding table
JP3229690B2 (en) Variable length code decoder
JPH03179562A (en) Data recorder and data editing
JP3009007B2 (en) Binary code decoding circuit
JP3038234B2 (en) Dictionary search method for data compression equipment
JP2952068B2 (en) Data compression and decompression method
JPH0650478B2 (en) Data compression storage system
JP3722231B2 (en) Product with a set of strings encoded and stored compactly
JPH11184858A (en) Two division search method/device
JPH09101965A (en) Information registering method and information retrieving method
JP2773657B2 (en) String search device
JPH05341953A (en) Method and device for compressing data

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20070829

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080829

Year of fee payment: 11

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080829

Year of fee payment: 11

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090829

Year of fee payment: 12

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090829

Year of fee payment: 12

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100829

Year of fee payment: 13

EXPY Cancellation because of completion of term