JPH05304480A - Fixed length converting circuit - Google Patents

Fixed length converting circuit

Info

Publication number
JPH05304480A
JPH05304480A JP10792692A JP10792692A JPH05304480A JP H05304480 A JPH05304480 A JP H05304480A JP 10792692 A JP10792692 A JP 10792692A JP 10792692 A JP10792692 A JP 10792692A JP H05304480 A JPH05304480 A JP H05304480A
Authority
JP
Japan
Prior art keywords
bits
bit
data
length
output
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
JP10792692A
Other languages
Japanese (ja)
Inventor
Mitsuo Yamazaki
充夫 山崎
Kazuo Konishi
和夫 小西
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.)
Toshiba Corp
Original Assignee
Toshiba 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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP10792692A priority Critical patent/JPH05304480A/en
Publication of JPH05304480A publication Critical patent/JPH05304480A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

PURPOSE:To accelerate a variable length/fixed length conversion processing. CONSTITUTION:In an adder 22, the low-order 3 bits of output are fed back thorugh an FF 23 and valid bit numbers and the low-order 3 bits the added. The low-order 3 bits of the output of the adder 22 indicate the remaining bit numbers from the previous time and an adder 28 attains shifting amount fromt these low-order 3 bits and Huffman code length. A parallel shifting circuit 21 shifts input data to the MSB side for the shifting amount and supplys the data to an 8-bit fixed length circuit 30. A control clock generating circuit 31 controls the processing of the 8-bit fixed length circuit 30 using the high-order 3 bits of the adder 22. The 8-bit fixed length circuit 30 is supplied with the 7-bit length output indicating the remaining bits from a decoding circuit 40 and synthsizes the remaining bits in the previous fixed length converting processing and the valid bits of the input data consecutively to be outputted in parallel at every 8-bit unit. The input data are processed in parallel so that the 8-bit fixed length converting processing can be accelerated.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、高速符号化処理を可能
にした電子スチルカメラ等に好適の固定長変換回路に関
する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a fixed length conversion circuit suitable for an electronic still camera or the like capable of high speed encoding processing.

【0002】[0002]

【従来の技術】近年、電子機器におけるディジタル技術
の進歩は著しい。ディジタル画像処理技術の分野におい
ては、画像圧縮技術の進歩に目覚ましいものがある。こ
の画像圧縮技術は、ディジタル伝送及び記録等の効率を
向上させるために、より小さいビットレイトで画像を符
号化する技術である。この技術としては、予測符号化技
術及び直交符号化技術(「TV画像の多次元信号処理」
吹抜敬彦著、日刊工業新聞社刊に詳述)等がある。更
に、これらの符号化によって圧縮された符号に対して、
可変長符号化を施すことによって、更に一層の画像圧縮
が可能である。可変長符号化は符号の発生頻度に応じ
て、符号化のビット幅を変化させるものであり、固定長
符号に比してビットレイトを小さくすることができる。
2. Description of the Related Art In recent years, the progress of digital technology in electronic equipment has been remarkable. In the field of digital image processing technology, progress in image compression technology is remarkable. This image compression technique is a technique for encoding an image with a smaller bit rate in order to improve the efficiency of digital transmission and recording. This technology includes predictive coding technology and orthogonal coding technology (“multidimensional signal processing of TV images”).
Fukubuki Takahiko, detailed in the Nikkan Kogyo Shimbun)) etc. Furthermore, for codes compressed by these encodings,
By applying variable length coding, further image compression is possible. Variable-length coding changes the bit width of coding according to the frequency of code generation, and can reduce the bit rate compared to fixed-length coding.

【0003】次に、可変長符号の一例としてハフマン符
号の生成方法を図9を参照して説明する。図9(a)は
ハフマン符号の生成過程を示し、図9(b)はハフマン
符号の木を示している。
Next, a method of generating a Huffman code as an example of a variable length code will be described with reference to FIG. FIG. 9A shows a Huffman code generation process, and FIG. 9B shows a Huffman code tree.

【0004】いま、t個の固定長符号S1 ,S2 ,…,
St をハフマン符号に変換するものとする。図9はt=
6の場合の例を示している。先ず、これらの符号S1 乃
至S6 をその発生頻度(生起確率)が大きい順に並べ
る。符号S1 乃至S6 の生起確率は、図9(a)に示す
ように、夫々0.35,0.20,0.15,0.15,0.10,0.05であ
り、符号S1 乃至S6 の順に並べられている。次に、生
起確率が最も小さい方から2つの符号を1組として、そ
の合成確率(2つの生起確率の和)を求める。図9で
は、符号S6 ,S5 の生起確率が小さく、その合成確率
は0.15である。
Now, t fixed length codes S1, S2, ...
Let St be converted to Huffman code. In FIG. 9, t =
An example in the case of 6 is shown. First, these codes S1 to S6 are arranged in descending order of occurrence frequency (occurrence probability). The occurrence probabilities of the symbols S1 to S6 are 0.35, 0.20, 0.15, 0.15, 0.10 and 0.05, respectively, as shown in FIG. 9A, and are arranged in the order of the symbols S1 to S6. Next, the combination probability (sum of two occurrence probabilities) is calculated by setting two codes from the smallest occurrence probability as one set. In FIG. 9, the occurrence probabilities of the symbols S6 and S5 are small, and the combination probability thereof is 0.15.

【0005】次に、この1組と他の符号について、生起
確率(又は合成確率)が大きい順に並べ変える。次い
で、生起確率(又は合成確率)が最も小さい方から2つ
の符号(又は組)を新たな1組として、その合成確率を
求める。以後、これらの処理を繰返し、図9(a)に示
すように、合成確率が1となるまで並び変えを行う。
Next, this set and other codes are rearranged in the descending order of occurrence probability (or combination probability). Next, two codes (or sets) from the smallest occurrence probability (or combination probability) are set as a new set, and the combination probability is obtained. After that, these processes are repeated, and as shown in FIG. 9A, rearrangement is performed until the synthesis probability becomes 1.

【0006】次に、図9(a)に基づいて、図9(b)
に示す符号の木を作成する。そして、この符号の木の枝
分かれに従って“0”と“1”を割当てる。図9(b)
では、上側の枝を“0”、下側の枝を“1”にしてい
る。この枝分かれに沿ってハフマン符号を得る。例え
ば、固定長符号S4 は、図9(b)の太線で示すよう
に、“0”の枝を通り、“1”の枝を通り、最後に
“0”の枝を通ることによって、“010”というハフ
マン符号に変換される。このようにして求めた符号S1
乃至S6 のハフマン符号を下記表1に示す。
Next, based on FIG. 9A, FIG.
Create a tree of codes shown in. Then, "0" and "1" are assigned according to the branching of the tree of this code. Figure 9 (b)
Then, the upper branch is set to "0" and the lower branch is set to "1". A Huffman code is obtained along this branch. For example, the fixed-length code S4 passes through the branch of "0", the branch of "1", and finally the branch of "0", as shown by the thick line in FIG. Is converted to the Huffman code ". Code S1 obtained in this way
The Huffman codes from S6 to S6 are shown in Table 1 below.

【0007】[0007]

【表1】 この表1に示すように、生起確率が高い場合には短いビ
ット長のハフマン符号に変換され、生起確率が低い場合
には長いビット長のハフマン符号に変換される。これに
より、全体ではビットレイトを低減することができる。
[Table 1] As shown in Table 1, when the occurrence probability is high, it is converted into a Huffman code having a short bit length, and when the occurrence probability is low, it is converted into a Huffman code having a long bit length. Thereby, the bit rate can be reduced as a whole.

【0008】ところで、最近、画像データの圧縮方法の
標準化が検討されている。この標準化案の一例では、図
10に示すように、画像データをハフマン符号化した後
に、その下位ビットに付加データを付加するようになっ
ている。付加データとしては有効ビットのみを付加す
る。例えば、十進表現の“1”と“15”とでは2進表
現におけるビット数が異なる(1ビット,4ビット)よ
うに、有効ビットのみによって構成された付加データも
ハフマン符号と同様に可変長符号である。なお、付加デ
ータは下位ビット側が有効ビットとなることから、付加
データについてはLSB(最下位ビット)から順に配列
するLSBファーストでハフマン符号に付加している。
By the way, recently, standardization of a compression method of image data has been studied. In an example of this standardization proposal, as shown in FIG. 10, after Huffman coding of image data, additional data is added to the lower bits. Only valid bits are added as additional data. For example, since the number of bits in the binary representation is different between the decimal representation "1" and "15" (1 bit, 4 bits), the additional data composed of only valid bits has a variable length like the Huffman code. It is a code. Since the lower bits of the additional data are effective bits, the additional data is added to the Huffman code by LSB first arranged in order from the LSB (least significant bit).

【0009】このような可変長の符号化データを記録す
る場合には、記録素子の入力フォーマットに基づいて可
変長の符号化データを固定長に変換して記録する必要が
ある。例えば、記録素子としてICカードを採用した場
合には、入出力は1バイト単位で行われており、符号化
データを8ビットの固定長に変換しなければならない。
When recording such variable-length coded data, it is necessary to convert the variable-length coded data into a fixed length based on the input format of the recording element before recording. For example, when an IC card is used as the recording element, input / output is performed in 1-byte units, and encoded data must be converted into a fixed length of 8 bits.

【0010】図11はこのような可変長のハフマン符号
データを8ビットの固定長データに変換する従来の固定
長変換回路を示すブロック図である。なお、図11にお
いては各部の信号の状態も図示しており、MはMSB
(最上位ビット)を示し、LはLSBを示している。ま
た、有効データは斜線にて示している。
FIG. 11 is a block diagram showing a conventional fixed length conversion circuit for converting such variable length Huffman code data into 8-bit fixed length data. In addition, in FIG. 11, the state of the signal of each part is also illustrated, and M is the MSB.
(Most significant bit), and L indicates LSB. Also, valid data is indicated by diagonal lines.

【0011】ハフマン符号レジスタ1及び付加ビットレ
ジスタ2には、夫々独立に生成されたハフマン符号デー
タ及び付加データを格納している。ハフマン符号レジス
タ1は最大ビット長のハフマン符号を格納可能なビット
幅を有し、付加ビットレジスタ2は最大ビット長の付加
データを格納可能なビット幅を有している。このため、
各レジスタ1,2には図11の斜線にて示す有効データ
3,4の外に無効データ5,6が格納される。
The Huffman code register 1 and the additional bit register 2 store independently generated Huffman code data and additional data, respectively. The Huffman code register 1 has a bit width capable of storing the Huffman code having the maximum bit length, and the additional bit register 2 has a bit width capable of storing the additional data having the maximum bit length. For this reason,
Invalid data 5 and 6 are stored in each of the registers 1 and 2 in addition to the valid data 3 and 4 shown by hatching in FIG.

【0012】各レジスタ1,2の出力は信号7に示すよ
うに合成してシリアル変換シフタ8に与える。シリアル
変換シフタ8は、入力されたデータをシリアル変換した
後にシフトさせる。シリアル変換シフタ8の出力は余り
ビット付加回路9を介して固定長回路10に与える。固定
長回路10は順次入力されるシリアルデータを8ビットの
パラレル固定長データに変換して出力する。固定長回路
10はパラレル変換によって得たデータが8ビットに満た
ない場合には、このデータの各ビット(以下、余りビッ
トという)を余りビット付加回路9に出力すると共に、
そのビット数(余りビット数)をシフト量計算回路11に
出力する。例えば、固定長回路10に入力されるハフマン
符号及び付加データの有効ビットの合計ビット数が26
ビットである場合には、固定長回路10は3組の8ビット
固定長データを出力し、2ビットの余りビットを余りビ
ット付加回路9に帰還させる。
The outputs of the registers 1 and 2 are combined as shown by the signal 7 and given to the serial conversion shifter 8. The serial conversion shifter 8 serially converts the input data and then shifts it. The output of the serial conversion shifter 8 is given to the fixed length circuit 10 through the extra bit addition circuit 9. The fixed length circuit 10 converts serial data that are sequentially input into 8-bit parallel fixed length data and outputs the parallel fixed length data. Fixed length circuit
When the data obtained by parallel conversion is less than 8 bits, 10 outputs each bit of this data (hereinafter referred to as a remainder bit) to the remainder bit addition circuit 9, and
The bit number (remainder bit number) is output to the shift amount calculation circuit 11. For example, the total number of effective bits of the Huffman code and the additional data input to the fixed length circuit 10 is 26.
If it is a bit, the fixed-length circuit 10 outputs three sets of 8-bit fixed-length data, and feeds the 2-bit remainder bit back to the remainder-bit addition circuit 9.

【0013】固定長変換処理においては、余りビット及
び有効データ3,4を連続させる必要がある。このた
め、合成データ7をシリアル変換シフタ8でシフトさせ
ている。シフト量はシフト量計算回路11によって求め
る。シフト量計算回路11は、ハフマン符号及び付加デー
タの有効ビット数の情報も与えられており、データの最
大ビット数から有効ビット数及び余りビット数を減算し
てシフト量を求めている。シリアル変換シフタ8はデー
タをシリアルに変換した後、クロックに応じて1ビット
ずつシフトする。従って、固定長変換処理にはシフトす
るビット数分の時間が必要である。
In the fixed length conversion process, it is necessary to make the remaining bits and the valid data 3 and 4 continuous. Therefore, the synthetic data 7 is shifted by the serial conversion shifter 8. The shift amount is obtained by the shift amount calculation circuit 11. The shift amount calculation circuit 11 is also provided with information on the effective bit number of the Huffman code and the additional data, and obtains the shift amount by subtracting the effective bit number and the surplus bit number from the maximum bit number of the data. The serial conversion shifter 8 converts the data into serial data and then shifts it by 1 bit in accordance with the clock. Therefore, the fixed-length conversion processing requires time for the number of bits to be shifted.

【0014】シリアル変換シフタ8は、信号12に示すよ
うに、出力データ列の先頭に余りビット数分の無効デー
タ(網線部)を配列し、中央にハフマン符号及び付加デ
ータの有効ビット(斜線部)を配列し、LSB側に無効
ビットを配列したデータを出力する。このデータは余り
ビット付加回路9に与える。余りビット付加回路9は、
信号13の梨地模様部にて示すように、前データの余りビ
ット14を次のデータの有効ビットの先頭に付加して固定
長回路10に与える。こうして、固定長回路10は、ハフマ
ン符号及び付加データのビット数に拘らず、8ビット長
のパラレルデータを順次出力する。
As shown by the signal 12, the serial conversion shifter 8 arranges the invalid data (half-tone line portion) for the number of surplus bits at the head of the output data string, and the Huffman code and the effective bit (oblique line) of the additional data in the center. Section) and outputs the data in which the invalid bits are arranged on the LSB side. This data is applied to the surplus bit addition circuit 9. The surplus bit adding circuit 9 is
As shown by the satin pattern portion of the signal 13, the surplus bit 14 of the previous data is added to the head of the effective bit of the next data and given to the fixed length circuit 10. In this way, the fixed-length circuit 10 sequentially outputs parallel data of 8-bit length regardless of the number of bits of the Huffman code and the additional data.

【0015】ところで、処理を簡単化するために、シリ
アル変換シフタ8は付加データの有効ビットをシフトす
るときに、入力されるデータをシリアルに変換するよう
にしている。このため、固定長変換処理に長時間を要し
てしまう。したがって、例えば、電子スチルカメラの画
像データ圧縮用として採用した場合には、メモリカード
に対する書込みに長時間を要してしまうことから、比較
的早い速度で連写することができないという問題点があ
った。
In order to simplify the processing, the serial conversion shifter 8 converts the input data to serial when shifting the effective bit of the additional data. Therefore, it takes a long time to perform the fixed length conversion process. Therefore, for example, when it is used for compressing image data of an electronic still camera, it takes a long time to write to a memory card, and there is a problem that continuous shooting cannot be performed at a relatively high speed. It was

【0016】[0016]

【発明が解決しようとする課題】このように、上述した
従来の固定長変換回路においては、変換処理に長時間を
要してしまうという問題点があった。
As described above, the conventional fixed length conversion circuit described above has a problem that it takes a long time for the conversion process.

【0017】本発明は、高速処理を可能にすることがで
きる固定長変換回路を提供することを目的とする。
An object of the present invention is to provide a fixed length conversion circuit capable of high speed processing.

【0018】[0018]

【課題を解決するための手段】本発明に係る固定長変換
回路は、入力可変長データの有効ビット長を示すデータ
が与えられると共に出力の下位nビットが帰還されて前
記有効ビット長と帰還された下位nビットとを加算する
加算手段と、前記下位nビットと前記有効ビット長のデ
ータとを用いて前回の固定長処理における余りビットと
前記有効ビットとを連続させるためのシフト量を求める
シフト量演算手段と、前記入力可変長データを前記シフ
ト量に基づいてビットシフトして出力するシフト手段
と、前記加算手段の出力の下位nビットを用いて前記シ
フト手段の出力の有効ビットと前記余りビットとを連続
させた合成データを得る合成手段と、前記加算手段の出
力の最上位ビットから下位n+1ビットまでのデータを
用いて前記合成データをnビット長の固定長データに変
換する場合の処理タイミングを制御する制御クロック発
生手段と、この制御クロック発生手段からのクロックを
用いて前記合成データをnビット単位で固定長変換処理
して出力する固定長手段とを具備したものである。
In a fixed length conversion circuit according to the present invention, data indicating the effective bit length of input variable length data is given and the lower n bits of the output are fed back to be fed back to the effective bit length. Shift means for adding the lower n bits and the lower n bits and the data of the effective bit length to obtain a shift amount for making the remaining bits and the effective bit in the previous fixed length processing continuous. Quantity calculating means, shift means for bit-shifting and outputting the input variable-length data based on the shift amount, effective bits of the output of the shift means and the remainder using lower n bits of the output of the adding means. The combining data is obtained by using combining means for obtaining combined data in which bits are consecutive and data from the most significant bit to the lower n + 1 bits of the output of the adding means. To a fixed-length data of n-bit length, and a control clock generation means for controlling the processing timing, and a fixed-length conversion processing of the synthetic data in n-bit units using the clock from the control clock generation means, and output. And a fixed length means.

【0019】[0019]

【作用】本発明において、加算手段は入力可変長データ
の有効ビット長を示すデータと出力の下位nビットとを
加算する。加算結果の下位nビットは前回のnビット固
定長変換処理における余りビット数を示しており、シフ
ト手段は下位nビット及び有効ビット長のデータを用い
て入力可変長データをビットシフトさせて出力する。合
成手段は下位nビットを用いて余りビットと有効ビット
とを連続させた合成データを得て固定長手段に与える。
制御クロック発生手段は加算手段出力の最上位ビットか
ら下位n+1ビットまでのデータを用いて固定長手段の
処理を制御する。こうして、固定長手段はnビット長の
固定長データを出力する。
In the present invention, the adding means adds the data indicating the effective bit length of the input variable length data and the lower n bits of the output. The lower n bits of the addition result indicate the number of residual bits in the previous n-bit fixed length conversion processing, and the shift means bit-shifts the input variable length data using the lower n bits and the effective bit length data and outputs the data. .. The synthesizing means obtains synthetic data in which the remainder bits and the effective bits are consecutive by using the lower n bits, and gives them to the fixed length means.
The control clock generating means controls the processing of the fixed length means by using the data from the most significant bit to the lower n + 1 bits of the output of the adding means. In this way, the fixed length means outputs fixed length data having an n-bit length.

【0020】[0020]

【実施例】以下、図面を参照して本発明の実施例につい
て説明する。図1は本発明に係る固定長変換回路の一実
施例を示すブロック図である。本実施例は最大ビット長
が16ビットのハフマン符号と最大ビット長が11ビッ
トの付加データとからなる画像データを8ビット長のパ
ラレル固定長データに変換する例を示している。
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram showing an embodiment of a fixed length conversion circuit according to the present invention. This embodiment shows an example in which image data composed of a Huffman code having a maximum bit length of 16 bits and additional data having a maximum bit length of 11 bits is converted into parallel fixed-length data having an 8-bit length.

【0021】先ず、図2を参照して本実施例の動作原理
を説明する。最大16ビット長のハフマン符号及び最大
11ビット長の付加データを合成し、図2(a)の斜線
部にて示すように、有効ビット同士が連続したパラレル
データを入力する。この全27ビットのパラレルデータ
においては常に一定位置にハフマン符号のLSBが位置
する。
First, the operating principle of this embodiment will be described with reference to FIG. The Huffman code having a maximum length of 16 bits and the additional data having a maximum length of 11 bits are combined, and parallel data in which effective bits are consecutive is input as shown by a hatched portion in FIG. In all the 27-bit parallel data, the LSB of the Huffman code is always located at a fixed position.

【0022】次に、図2(a),(b)に示すように、
このパラレルデータをビットシフトさせる。いま、ハフ
マン符号がyビット、前回の符号化における余りビット
がhビットであるものとすると、本実施例では、下記式
(1)に示すxビットだけMSB側にシフトさせる。
Next, as shown in FIGS. 2 (a) and 2 (b),
This parallel data is bit-shifted. Now, assuming that the Huffman code is y bits and the remaining bits in the previous encoding are h bits, in the present embodiment, x bits shown in the following equation (1) are shifted to the MSB side.

【0023】 x=16−h−y …(1) これにより、MSB側に余りビット分だけ無効データを
配列し、この無効データのLSB側にハフマン符号及び
付加データを連続させる。次に、図2(c)に示すよう
に、MSB側の無効データ部分に余りビットを配列し、
最後に、MSB側から8ビットずつパラレル出力する
(図2(a))。こうして、8ビット固定長変換を行
う。
X = 16−h−y (1) As a result, the invalid data is arranged on the MSB side by the extra bits, and the Huffman code and the additional data are continuous on the LSB side of the invalid data. Next, as shown in FIG. 2C, the surplus bits are arranged in the invalid data portion on the MSB side,
Finally, 8 bits are output in parallel from the MSB side (FIG. 2 (a)). In this way, 8-bit fixed length conversion is performed.

【0024】図1において、図2(a)に示すハフマン
符号と付加データとの合成データはパラレルシフト回路
21に与える。一方、加算器22にはパラレルシフト回路21
に与える合成データの有効ビット数eを与える。加算器
22は有効ビット数eとフリップフロップ(以下、FFと
いう)23の出力を加算し、加算結果fの下位3ビットを
FF23,24に与え、上位3ビットをFF25に与える。F
F23は入力クロックのタイミングで、1クロック前の加
算器22出力の下位3ビットgを加算器22に与える。こう
して、加算器22及びFF23によって部分積分が行われ
る。FF23出力の下位3ビットは、ビット長を8で割っ
た余り、すなわち、8ビットデータに固定長変換する場
合の余りビット数を示している。加算器22は、FF23か
らの前回の変換処理における余りビット数と入力データ
の有効ビット数eとを加算して出力する。
In FIG. 1, the combined data of the Huffman code and the additional data shown in FIG. 2A is a parallel shift circuit.
Give to 21. On the other hand, the adder 22 includes a parallel shift circuit 21
The effective bit number e of the composite data given to Adder
22 adds the number of effective bits e and the output of a flip-flop (hereinafter referred to as FF) 23, and gives the lower 3 bits of the addition result f to FFs 23 and 24 and the upper 3 bits to FF 25. F
F23 gives the lower 3 bits g of the output of the adder 22 one clock before to the adder 22 at the timing of the input clock. Thus, partial integration is performed by the adder 22 and the FF 23. The lower 3 bits of the FF23 output indicate the remainder obtained by dividing the bit length by 8, that is, the number of remainder bits in the case of performing fixed length conversion into 8-bit data. The adder 22 adds the remaining bit number in the previous conversion process from the FF 23 and the effective bit number e of the input data and outputs the result.

【0025】いま、後述する8ビット固定長回路30が可
変長データを2のn乗ビット長の固定長データに変換す
るものとすると、加算器22出力の下位nビットによって
余りビット数が示される。例えば、8ビット固定長回路
30が8ビットの固定長データを出力する場合には、加算
器22出力の下位3ビットによって余りビット数が示され
ることになる。
Now, assuming that an 8-bit fixed-length circuit 30 described later converts variable-length data into fixed-length data having a power of 2 to the n-th bit, the number of surplus bits is indicated by the lower n bits of the output of the adder 22. .. For example, 8-bit fixed length circuit
When 30 outputs 8-bit fixed-length data, the number of surplus bits is indicated by the lower 3 bits of the adder 22 output.

【0026】FF24はクロックckのタイミングで余り
ビット数hをインバータ26を介して加算器27に出力す
る。加算器27はインバータ26の出力と“16”とを加算
して加算器28に出力する。加算器28にはハフマン符号長
yがインバータ29によって反転されて入力されており、
加算器28は加算器27出力とハフマン符号長yの反転出力
とを加算する。加算器27,28によって上記式(1)の演
算を行って、シフト量xを求めるようになっている。な
お、ハフマン符号の最大ビット長が明らかであるので、
本実施例では“16”を加算することを省略する。シフ
ト量xはパラレルシフト回路21に与える。
The FF 24 outputs the surplus bit number h to the adder 27 via the inverter 26 at the timing of the clock ck. The adder 27 adds the output of the inverter 26 and “16” and outputs the result to the adder 28. The Huffman code length y is inverted by the inverter 29 and input to the adder 28.
The adder 28 adds the output of the adder 27 and the inverted output of the Huffman code length y. The adder 27, 28 calculates the above equation (1) to obtain the shift amount x. Since the maximum bit length of Huffman code is clear,
In this embodiment, adding "16" is omitted. The shift amount x is given to the parallel shift circuit 21.

【0027】図3は図1中のパラレルシフト回路21の具
体的な構成を示すブロック図である。
FIG. 3 is a block diagram showing a specific structure of the parallel shift circuit 21 shown in FIG.

【0028】パラレルシフト回路21に入力される合成デ
ータのLSBa0 乃至MSBa26を夫々セレクタS0 乃
至S26の端子1に与え、セレクタS27乃至S33の端子1
にもMSBa26を与える。セレクタS1 乃至S6 の端子
2には“0”を与え、セレクタS7 乃至S33の端子2に
は出力a0 乃至a26を与える。また、セレクタS1 乃至
S14の端子3には“0”を与え、セレクタS15乃至S33
の端子3にはa0 乃至a18を与える。
The LSBa0 to MSBa26 of the composite data input to the parallel shift circuit 21 are applied to the terminals 1 of the selectors S0 to S26, respectively, and the terminals 1 of the selectors S27 to S33 are supplied.
Also give MSBa26. "0" is applied to the terminals 2 of the selectors S1 to S6, and outputs a0 to a26 are applied to the terminals 2 of the selectors S7 to S33. Further, "0" is given to the terminals 3 of the selectors S1 to S14, and the selectors S15 to S33 are
A0 to a18 are applied to the terminal 3 of.

【0029】本実施例においては、シフト量xは5ビッ
トで表現することができ、シフト量xの上位2ビットを
セレクタS0 乃至S33の制御端sに与える。セレクタS
0 乃至S33は制御端sに入力される値が0であれば端子
1に入力されたデータを出力し、1であれば端子2に入
力されたデータを出力し、2であれば端子3に入力され
たデータを出力する。すなわち、セレクタS0 乃至S33
によって、8ビット単位のパラレルシフトが可能であ
る。
In this embodiment, the shift amount x can be represented by 5 bits, and the upper 2 bits of the shift amount x are given to the control terminals s of the selectors S0 to S33. Selector S
0 to S33 output the data input to the terminal 1 when the value input to the control terminal s is 0, output the data input to the terminal 2 when the value is 1, and output the terminal 3 when the value is 2 Output the input data. That is, the selectors S0 to S33
By this, parallel shift in 8-bit units is possible.

【0030】セレクタS0 乃至S33の出力SO0 乃至S
O33は夫々セレクタSS0 乃至SS33の端子0に与え
る。また、出力SO0 乃至SO32を夫々セレクタSS1
乃至SS33の端子1に与え、出力SO0 乃至SO31を夫
々セレクタSS2 乃至SS33の端子2に与える。以後同
様にして、各出力をシフトさせてセレクタSS0 乃至S
S33の各端子0乃至7に与え、例えば、セレクタSS7
乃至SS33の端子7には出力SO0 乃至SO26を与え
る。出力SO0 乃至SO33が入力されない各セレクタS
S0 乃至SS33の端子には“0”を与える。
Outputs SO0 to S of selectors S0 to S33
O33 is given to the terminals 0 of the selectors SS0 to SS33, respectively. In addition, the outputs SO0 to SO32 are respectively connected to the selector SS1.
Through SO33 to terminals 1 and outputs SO0 through SO31 to terminals 2 of selectors SS2 through SS33, respectively. Thereafter, similarly, each output is shifted to select the selectors SS0 to S0.
It is given to each terminal 0 to 7 of S33, for example, selector SS7
Outputs SO0 to SO26 are applied to terminals 7 to SS33. Selectors S to which outputs SO0 to SO33 are not input
"0" is given to the terminals of S0 to SS33.

【0031】セレクタSS0 乃至SS33の制御端sには
シフト量xの下位3ビットを与える。セレクタSS0 乃
至SS33は制御端sに入力される値と同一番号の端子に
入力されるデータを選択して出力する。これにより、セ
レクタSS0 乃至SS33は0乃至7ビットだけ入力され
たデータをパラレルシフトして、出力b0 乃至b33を8
ビット固定長回路30に出力する。
The lower 3 bits of the shift amount x are given to the control terminals s of the selectors SS0 to SS33. The selectors SS0 to SS33 select and output the data input to the terminal having the same number as the value input to the control terminal s. As a result, the selectors SS0 to SS33 perform parallel shift on the data input by 0 to 7 bits to output the outputs b0 to b33 to 8 bits.
Output to the fixed bit length circuit 30.

【0032】前述したように、加算器22は、有効ビット
数とFF23からの余りビット数とを加算する。すなわ
ち、加算器22出力fの上位3ビットは、可変長データが
何個の8ビット固定長データに変換されるか、すなわ
ち、何クロックで可変長−固定長変換処理が終了するか
を示している。本実施例では可変長−固定長変換に必要
な時間は(上位3ビットによって示される値)+2クロ
ック期間である。この上位3ビットをFF25を介して制
御クロック発生回路31に与えることにより、可変長−固
定長変換処理の動作タイミングを制御している。
As described above, the adder 22 adds the number of effective bits and the number of residual bits from the FF 23. That is, the upper 3 bits of the output f of the adder 22 indicate how many pieces of variable-length data are converted into 8-bit fixed-length data, that is, how many clocks the variable-length to fixed-length conversion process ends. There is. In this embodiment, the time required for the variable length-fixed length conversion is (the value indicated by the upper 3 bits) +2 clock periods. By supplying the upper 3 bits to the control clock generating circuit 31 via the FF 25, the operation timing of the variable length-fixed length conversion processing is controlled.

【0033】図4は図1中の制御クロック発生回路31の
具体的な構成を示すブロック図である。また、図5は図
4の動作を説明するためのタイミングチャートである。
図5では上位3ビットの値が2である場合の例を示して
いる。
FIG. 4 is a block diagram showing a specific structure of the control clock generating circuit 31 in FIG. FIG. 5 is a timing chart for explaining the operation of FIG.
FIG. 5 shows an example in which the value of the upper 3 bits is 2.

【0034】FF25からの上位3ビットはダウンカウン
タ32のデータ端Dに与える。ダウンカウンタ32はインバ
ータ33からの出力(図5(d))によって、データ端D
に上位3ビットの値をロードする(図5(c))。ダウ
ンカウンタ32は、クロックMCK(図5(a))をダウ
ンカウントする。カウント出力Qは図5(e)に示すも
のとなる。ダウンカウンタ32はカウントダウンすると、
図5(f)に示すリップルキャリーkを出力する。FF
34は、このリップルキャリーkをクロックMCKのタイ
ミングでクロックck(図5(b))として8ビット固
定長回路30に与える。また、クロックckをFF35によ
ってクロックMCKに同期させ、インバータ33を介して
ロード端LOに供給する。こうして、クロックckの発
生から(上位3ビットの値+2)個のMCKクロック経
過後に次のクロックckは発生する。このクロックck
を8ビット固定長回路30に供給する。
The upper 3 bits from the FF 25 are given to the data terminal D of the down counter 32. The down counter 32 receives the data end D according to the output from the inverter 33 (FIG. 5 (d)).
The value of the upper 3 bits is loaded into (FIG. 5 (c)). The down counter 32 counts down the clock MCK (FIG. 5A). The count output Q is as shown in FIG. When the down counter 32 counts down,
The ripple carry k shown in FIG. 5 (f) is output. FF
34 applies this ripple carry k to the 8-bit fixed length circuit 30 as the clock ck (FIG. 5B) at the timing of the clock MCK. Further, the clock ck is synchronized with the clock MCK by the FF 35 and supplied to the load end LO through the inverter 33. In this way, the next clock ck is generated after the passage of (the value of the upper 3 bits + 2) MCK clocks from the generation of the clock ck. This clock ck
Is supplied to the 8-bit fixed length circuit 30.

【0035】また、加算器22の下位3ビットはデコード
回路40に与える。デコード回路40は入力された余りビッ
トを7ビット長のデータに変換して出力する。デコード
回路40の出力は、下記表2に示すように、下位3ビット
で示される値だけLSB側から“0”が連続し、他のビ
ットは“1”の7ビットデータである。デコード回路40
の出力は8ビット固定長回路30に与える。
The lower 3 bits of the adder 22 are applied to the decoding circuit 40. The decoding circuit 40 converts the input surplus bits into 7-bit data and outputs the data. As shown in Table 2 below, the output of the decoding circuit 40 is 7-bit data in which "0" continues from the LSB side by the value indicated by the lower 3 bits and the other bits are "1". Decoding circuit 40
Is output to the 8-bit fixed length circuit 30.

【0036】[0036]

【表2】 また、加算器22の上位3ビットはFF25、FF41、アン
ド回路42、FF43及びFF44を介して信号mとして8ビ
ット固定長回路30に与える。信号mは加算器22出力の上
位3ビットが全て“0”である場合にのみローレベル
(以下、“L”という)となる。
[Table 2] Further, the upper 3 bits of the adder 22 are given to the 8-bit fixed length circuit 30 as a signal m through the FF 25, FF 41, the AND circuit 42, FF 43 and FF 44. The signal m becomes low level (hereinafter referred to as "L") only when all the upper 3 bits of the output of the adder 22 are "0".

【0037】図6は図1中の8ビット固定長回路30の具
体的な構成を示すブロック図である。
FIG. 6 is a block diagram showing a specific structure of the 8-bit fixed length circuit 30 shown in FIG.

【0038】パラレルシフト回路21の34ビットの出力b
0 乃至b34は夫々8ビット固定長回路30のセレクタSA
0 乃至SA33の端子1に与える。セレクタSA0 乃至S
A18の出力O0 乃至O18は夫々FFA0 乃至A18を介し
てセレクタSA8 乃至SA26の端子0に与え、セレクタ
SA19乃至SA25の出力O19乃至O25は夫々FFA19乃
至A25を介してセレクタSB27乃至SB33の端子1に与
える。セレクタSB27乃至SB33の出力はセレクタSA
27乃至SA33の端子0に与える。セレクタSA26乃至S
A33の出力O26乃至O33は夫々FFA26乃至A33を介し
て8ビットのパラレルデータとして出力される。後述す
るように、FFA26乃至A33からの8ビットパラレルデ
ータの出力と同時に、FFA0 乃至A25からのデータが
8ビット分MSB側のセレクタにシフトするようになっ
ている。
34-bit output b of the parallel shift circuit 21
0 to b34 are selectors SA of the 8-bit fixed length circuit 30, respectively
0 to the terminal of SA33. Selectors SA0 to S
Outputs O0 to O18 of A18 are applied to terminals 0 of selectors SA8 to SA26 via FFA0 to A18, respectively, and outputs O19 to O25 of selectors SA19 to SA25 are applied to terminals 1 of selectors SB27 to SB33 via FFA19 to A25, respectively. .. The outputs of the selectors SB27 to SB33 are the selector SA.
27 to SA33 terminal 0. Selector SA26 to S
The outputs O26 to O33 of A33 are output as 8-bit parallel data via the FFAs 26 to A33, respectively. As will be described later, simultaneously with the output of 8-bit parallel data from FFA26 to A33, the data from FFA0 to A25 is shifted by 8 bits to the selector on the MSB side.

【0039】制御クロック発生回路31からのクロックc
kはFF51,52の直列回路に与える。FF51,52はクロ
ックckを2MCKクロックだけ遅延させてクロックc
k1をセレクタSA0 乃至SA26に与える。セレクタS
A0 乃至SA26はクロックckのハイレベル(以下、
“H”という)で端子1を選択してパラレルシフト回路
21の出力を取込んで出力し、“L”で端子0を選択して
8ビットLSB側のセレクタ出力を取込んで出力する。
Clock c from control clock generation circuit 31
k is given to the series circuit of FF51,52. The FFs 51 and 52 delay the clock ck by 2MCK clocks to obtain the clock c.
k1 is given to the selectors SA0 to SA26. Selector S
A0 to SA26 are high levels of the clock ck (hereinafter,
Select the terminal 1 with "H") and select parallel shift circuit
The output of 21 is taken in and outputted, terminal 0 is selected by "L" and the selector output on the 8-bit LSB side is taken in and outputted.

【0040】セレクタSA27乃至SA33から出力される
余りビットは、次の固定長変換処理においてパラレルシ
フト回路21の出力と合成されて出力される。すなわち、
この場合には、セレクタSA27乃至SA33は後述する信
号ii6 乃至ii0 に制御されて、セレクタSB27乃至
SB33の出力を取込んで出力するようになっている。ま
た、セレクタSA27乃至SA33の出力は夫々FFB27乃
至B33を介してセレクタSB27乃至SB33の端子0にも
与える。セレクタSB27乃至SB33には信号mがFF53
を介して与えられており、セレクタSB27乃至SB33
は、信号mmの“H”で端子1を選択して8ビットLS
B側のセレクタ出力を取込んでセレクタSA27乃至SA
33に出力し、“L”で端子0を選択してセレクタSA27
乃至SA33の出力(余りビット)を取込んでセレクタS
A27乃至SA33に出力する。従って、前回の余りビット
と合成データの有効ビット数の和が8ビットに満たない
場合(mは“0”)には、セレクタSA27乃至SA33に
は8ビットLSB側のセレクタ出力はシフトされない。
The remainder bits output from the selectors SA27 to SA33 are combined with the output of the parallel shift circuit 21 and output in the next fixed length conversion process. That is,
In this case, the selectors SA27 to SA33 are controlled by signals ii6 to ii0, which will be described later, to take in and output the outputs of the selectors SB27 to SB33. The outputs of the selectors SA27 to SA33 are also given to the terminals 0 of the selectors SB27 to SB33 via the FFB27 to B33, respectively. The signal m is fed to the selectors SB27 to SB33 by FF53.
Given through the selectors SB27 to SB33.
Selects 8-bit LS by selecting terminal 1 by "H" of signal mm
Selector SA27 to SA by taking in the selector output on the B side
Output to 33, select terminal 0 with "L" and select SA27
To the output of SA33 (remainder bit) and the selector S
Output to A27 to SA33. Therefore, when the sum of the previous remaining bits and the number of effective bits of the combined data is less than 8 bits (m is “0”), the selector outputs on the 8-bit LSB side are not shifted to the selectors SA27 to SA33.

【0041】余りビットとパラレルシフト回路21出力と
の合成はデコード回路40の7ビットの出力iによって制
御される。すなわち、出力iの各ビットi0 乃至i6 は
FF54を介して夫々アンド回路C33乃至C27に与える。
アンド回路C33乃至C27にはクロックck1 も与えられ
ており、クロックck1 の“H”期間に出力ii0 乃至
ii6 を夫々セレクタSA33乃至SA27に与える。
The synthesis of the remainder bits and the output of the parallel shift circuit 21 is controlled by the 7-bit output i of the decoding circuit 40. That is, the bits i0 to i6 of the output i are given to the AND circuits C33 to C27 via the FF54, respectively.
The clock ck1 is also applied to the AND circuits C33 to C27, and the outputs ii0 to ii6 are applied to the selectors SA33 to SA27 during the "H" period of the clock ck1.

【0042】また、クロックckをFF55,56を介して
ノア回路57に与えると共に、FF56の出力をノア回路57
に与える。ノア回路57の出力はアンド回路58に与え、ア
ンド回路58はノア回路57の出力とクロックMCKとの論
理積をクロックACKとしてFFA0 乃至FFA33に出
力するようになっている。これにより、1MCKクロッ
ク前後のクロックckが“L”である場合に、次のMC
KクロックのタイミングでクロックACKが発生する。
このクロックACKのタイミングでFFA0 乃至FFA
33はセレクタSA0 乃至SA33の出力O0 乃至O33を出
力する。すなわち、(クロックck相互間のMCKクロ
ックの数)−1だけ8ビット固定長出力を出力させ、余
りビットは出力させないようになっている。
The clock ck is applied to the NOR circuit 57 via the FFs 55 and 56, and the output of the FF 56 is output to the NOR circuit 57.
Give to. The output of the NOR circuit 57 is given to the AND circuit 58, and the AND circuit 58 outputs the logical product of the output of the NOR circuit 57 and the clock MCK to the FFA0 to FFA33 as the clock ACK. Therefore, when the clock ck before and after 1 MCK clock is “L”, the next MC
A clock ACK is generated at the timing of K clocks.
FFA0 to FFA at the timing of this clock ACK
33 outputs the outputs O0 to O33 of the selectors SA0 to SA33. That is, the 8-bit fixed-length output is output by (the number of MCK clocks between clocks ck) -1, and the remaining bits are not output.

【0043】次に、このように構成された実施例の動作
について図7の説明図及び図8のタイミングチャートを
参照して説明する。図7のタイミングA乃至Fは夫々図
8のMCKクロックA乃至Fの各タイミングを示してい
る。図7(a)はFFB27乃至B33の出力を示し、図7
(b)はパラレルシフト回路21からの8ビットパラレル
データを示し、図7(c)はアンド回路C33乃至C27の
出力ii0 乃至ii6を示し、図7(d)はセレクタS
A0 乃至SA33の出力O0 乃至O33を示すと共に、FF
A0 乃至FFA25の出力を括弧で囲って示し、図7
(e)はFFA27乃至A33の出力dを示している。ま
た、図8(a)はMCKクロックを示し、図8(b)は
クロックckを示し、図8(c)はクロックck1 を示
し、図8(d)は出力iを示し、図8(e)はアンド回
路C33乃至C27からの出力ii0 乃至ii6 を示し、図
8(f)はクロックACKを示し、図8(g)は信号m
を示し、図8(h)は信号mmを示している。
Next, the operation of the embodiment thus constructed will be described with reference to the explanatory view of FIG. 7 and the timing chart of FIG. Timings A to F in FIG. 7 indicate respective timings of the MCK clocks A to F in FIG. 8, respectively. FIG. 7A shows the outputs of FFB27 to B33, and FIG.
7B shows 8-bit parallel data from the parallel shift circuit 21, FIG. 7C shows outputs ii0 to ii6 of the AND circuits C33 to C27, and FIG.
A0 to SA33 outputs O0 to O33 are shown and FF
The outputs of A0 to FFA25 are shown in parentheses in FIG.
(E) shows the outputs d of the FFA 27 to A 33. 8A shows the MCK clock, FIG. 8B shows the clock ck, FIG. 8C shows the clock ck1, FIG. 8D shows the output i, and FIG. 8) shows the outputs ii0 to ii6 from the AND circuits C33 to C27, FIG. 8 (f) shows the clock ACK, and FIG. 8 (g) shows the signal m.
8 (h) shows the signal mm.

【0044】いま、図2(a)に示すように、図示しな
いレジスタから有効ビット長が8ビットのハフマン符号
と有効ビット長が6ビットの付加データとの合成データ
がパラレルシフト回路21に入力されるものとする。ま
た、この時点において、前回の固定長変換処理における
余りビットが3ビットで、次に入力される合成データの
ハフマン符号及び付加データの有効ビット長はいずれも
2ビットであるものとする。更に、その次に入力される
合成データのハフマン符号及び付加データの有効ビット
長は夫々3ビット,2ビットであるものとする。
As shown in FIG. 2A, the parallel shift circuit 21 is supplied with composite data of a Huffman code having an effective bit length of 8 bits and additional data having an effective bit length of 6 bits from a register (not shown). Shall be. At this point, the remaining bits in the previous fixed length conversion process are 3 bits, and the effective bit length of the Huffman code and the additional data of the next input synthetic data are both 2 bits. Furthermore, the effective bit lengths of the Huffman code and the additional data of the synthetic data input next are 3 bits and 2 bits, respectively.

【0045】有効ビット数e(=14)は加算器22に与
える。加算器22出力fの下位3ビットは8ビット固定長
変換処理における余りビット数を示しており、FF23は
クロックckのタイミングでこの余りビット数を加算器
22に出力する。加算器22は有効ビット数eとFF23の出
力とを加算することにより、下位3ビットによって今回
の固定長変換処理における余りビット数を示し、上位3
ビットによって今回の8ビット固定長変換処理によるパ
ラレルデータ数を示す。
The effective bit number e (= 14) is given to the adder 22. The lower 3 bits of the output f of the adder 22 indicate the number of residual bits in the 8-bit fixed length conversion processing, and the FF 23 calculates the number of residual bits at the timing of the clock ck.
Output to 22. The adder 22 adds the effective bit number e and the output of the FF 23 to indicate the remaining number of bits in the fixed length conversion processing of this time by the lower 3 bits, and the upper 3
The number of parallel data by the current 8-bit fixed length conversion processing is shown by the bit.

【0046】下位3ビットはFF24を介してデコード回
路40に与えて、上記表2の変換を行って7ビット長の出
力iを8ビット固定長回路30に出力する。また、下位3
ビットは余りビットhとしてインバータ26を介して加算
器27に与える。更に、加算器27出力を加算器28に与え、
加算器27,28によって上記式(1)の演算を行い、シフ
ト量xを求めてパラレルシフト回路21に与える。
The lower 3 bits are given to the decoding circuit 40 via the FF 24, the conversion of Table 2 is performed, and the output i of 7-bit length is output to the 8-bit fixed length circuit 30. Also, the bottom 3
The bits are supplied to the adder 27 via the inverter 26 as the remainder bit h. Further, the output of the adder 27 is given to the adder 28,
The adder 27, 28 calculates the above equation (1), obtains the shift amount x, and supplies it to the parallel shift circuit 21.

【0047】この場合には、シフト量xは5であるの
で、パラレルシフト回路21のセレクタS0 乃至S33は端
子1を選択し、セレクタSS0 乃至SS33は端子5を選
択する。これにより、パラレルシフト回路21は、図2
(b)に示すように、入力されたデータを5ビットMS
B側にシフトさせて8ビット固定長回路30に出力する。
In this case, since the shift amount x is 5, the selectors S0 to S33 of the parallel shift circuit 21 select the terminal 1 and the selectors SS0 to SS33 select the terminal 5. As a result, the parallel shift circuit 21 operates as shown in FIG.
As shown in (b), the input data is converted into a 5-bit MS.
It is shifted to the B side and output to the 8-bit fixed length circuit 30.

【0048】一方、加算器22出力の上位3ビットはFF
25を介して制御クロック発生回路31に与える。制御クロ
ック発生回路31のダウンカウンタ32はロード端LOに図
5(d)に示す信号が入力されて、上位3ビットの値
(2)をロードする。ダウンカウンタ32はMCKクロッ
クによってダウンカウントを開始して、カウントダウン
すると図5(f)に示すリップルキャリーkを出力す
る。このリップルキャリーkはFF34を介してクロック
ckとして8ビット固定長回路30に出力する。なお、今
回の固定長変換処理における余りビット数は1で、次に
入力されるデータの有効ビット数が4であるので、次の
加算器22出力の上位3ビットの値は“0”であり、図8
のMCKクロックC,Dに示すように、次のクロックc
kは2MCKクロックの間隔で発生する。更に、次に有
効ビット長が5ビットの合成データを入力するので、次
の加算器22出力の上位3ビットの値は“1”となり、次
のクロックckは3MCKクロック間隔で発生する(図
8(a),(b))。
On the other hand, the upper 3 bits of the output of the adder 22 are FF
It is given to the control clock generation circuit 31 via 25. The down counter 32 of the control clock generation circuit 31 receives the signal shown in FIG. 5D at the load end LO and loads the value (2) of the upper 3 bits. The down counter 32 starts down counting by the MCK clock, and outputs a ripple carry k shown in FIG. 5 (f) when counting down. This ripple carry k is output to the 8-bit fixed length circuit 30 as a clock ck via the FF34. Since the number of remaining bits in the fixed length conversion processing this time is 1, and the number of effective bits of the next input data is 4, the value of the upper 3 bits of the output of the next adder 22 is “0”. , Fig. 8
MCK clocks C and D as shown in FIG.
k is generated at an interval of 2MCK clocks. Further, since synthetic data having an effective bit length of 5 bits is input next, the value of the upper 3 bits of the output of the next adder 22 becomes "1", and the next clock ck is generated at 3MCK clock intervals (Fig. 8). (A), (b)).

【0049】こうして、図7(b)に示すように、8ビ
ット固定長回路30のセレクタSA0乃至SA9 の端子1
には“0”が入力され、セレクタSA10乃至SA23の端
子1には付加データ及びハフマン符号の有効ビットが入
力され、セレクタSA24乃至SA26の端子1には無効デ
ータが入力される。デコード回路40の出力i(“111
1000”)は、図8(d)に示すように、クロックc
kのタイミングでFF54に与える。また、クロックck
はFF51,52によって2MCKクロック遅延してクロッ
クck1 としてアンド回路C27乃至C33に与えており、
FF54の出力i0 乃至i6 は図8(a)のMCKクロッ
クAのタイミングで出力ii0 乃至ii6 (図7
(c))としてセレクタSA33乃至SA27に供給され
る。これにより、セレクタSA31乃至SA33は夫々セレ
クタSB27乃至SB33の出力を選択し、FFA23乃至A
25から前回の余りビットを取込む(図7(d)の梨地模
様部)。
Thus, as shown in FIG. 7B, the terminals 1 of the selectors SA0 to SA9 of the 8-bit fixed length circuit 30.
Is input to the terminals SA of the selectors SA10 to SA23, the additional data and the valid bit of the Huffman code are input to the terminals SA1 to SA26, and the invalid data is input to the terminal 1 of the selectors SA24 to SA26. Output i of decoding circuit 40 (“111
1000 ") is the clock c as shown in FIG.
It is given to the FF 54 at the timing of k. Also clock ck
Is delayed by 2MCK clocks by FF51 and FF52 and given to AND circuits C27 to C33 as clock ck1.
The outputs i0 to i6 of the FF 54 are output ii0 to ii6 (see FIG. 7) at the timing of the MCK clock A in FIG.
It is supplied to the selectors SA33 to SA27 as (c)). As a result, the selectors SA31 to SA33 select the outputs of the selectors SB27 to SB33, respectively, and the FFA23 to AFA are selected.
Take in the surplus bit from the previous time from 25 (the matte pattern part in Fig. 7 (d)).

【0050】一方、クロックckはFF55によって1M
CKクロック期間遅延させてノア回路57に与えると共
に、FF55,56によって2MCKクロック期間遅延させ
てノア回路57に与える。アンド回路58はノア回路57の出
力とMCKクロックとの論理積を求めてACKクロック
として出力しており、ACKクロックは固定長出力数を
示す。図8に示すように、MCKクロックBのタイミン
グでACKクロックが発生し、図7(e)のタイミング
Bに示すように、FFA26乃至A33はセレクタSA26乃
至SA33が選択した前回の余りビット及びハフマン符号
の有効ビットから成る8ビット長のデータをパラレル出
力する。また、FFA0 乃至A25はセレクタの出力O0
乃至O25をセレクタSA7 乃至SA33に与えて、8ビッ
トMSB側にシフトさせる(図7(d))。
On the other hand, the clock ck is 1M by the FF55.
It is delayed by the CK clock period and given to the NOR circuit 57, and delayed by 2FFK clock periods by the FFs 55 and 56 and given to the NOR circuit 57. The AND circuit 58 obtains the logical product of the output of the NOR circuit 57 and the MCK clock and outputs it as an ACK clock, and the ACK clock indicates a fixed length output number. As shown in FIG. 8, an ACK clock is generated at the timing of MCK clock B, and as shown at timing B of FIG. 8 bits of data consisting of the effective bits of are output in parallel. Further, FFA0 to A25 are output O0 of the selector.
To O25 are applied to the selectors SA7 to SA33 to shift them to the 8-bit MSB side (FIG. 7 (d)).

【0051】また、この場合には、加算器22の出力の下
位3ビットは“0”となり、図8(e)に示すように、
信号ii0 乃至ii6 は全て“0”となって、セレクタ
SA27乃至SA33はセレクタSB27乃至SB33の出力を
選択する。
Further, in this case, the lower 3 bits of the output of the adder 22 become "0", and as shown in FIG.
The signals ii0 to ii6 all become "0", and the selectors SA27 to SA33 select the outputs of the selectors SB27 to SB33.

【0052】次のMCKクロックCのタイミングでも同
様の動作が行われて、FFA23乃至FFA33はハフマン
符号及び付加データの有効ビットを出力する。また、セ
レクタSA25の出力O25(余りビット)はFFA25を介
してセレクタSB33に与えられる(図7(d)のタイミ
ングC)。一方、MCKクロックCのタイミングで発生
するクロックckによって次のデータ(図7(b)のタ
イミングC)がセレクタSA0 乃至SA32の端子1に入
力される。デコード回路40は余りビット数が1であるこ
とを示す出力i(“1111110”)(図8(d))
をFF54に与えており、アンド回路C33の出力ii0
(図8(e))によってMCKクロックDのタイミング
でセレクタSA33はセレクタSB33の出力(余りビッ
ト)を選択する。
The same operation is performed at the next MCK clock C timing, and the FFA23 to FFA33 output the Huffman code and the effective bit of the additional data. The output O25 (remainder bit) of the selector SA25 is given to the selector SB33 via the FFA25 (timing C in FIG. 7D). On the other hand, the next data (timing C in FIG. 7B) is input to the terminals 1 of the selectors SA0 to SA32 by the clock ck generated at the timing of the MCK clock C. The decoding circuit 40 outputs i (“1111110”) indicating that the number of remaining bits is 1 (FIG. 8D).
To the FF54 and output ii0 of the AND circuit C33.
As shown in FIG. 8E, the selector SA33 selects the output (remainder bit) of the selector SB33 at the timing of the MCK clock D.

【0053】このMCKクロックDのタイミングでは、
有効ビット長が8ビット未満であり、図8(f)に示す
ように、ACKクロックは発生しない。MCKクロック
Dの次のMCKクロックのタイミングで図1のFF44の
出力m(図8(g))が“L”となり、MCKクロック
Eのタイミングで信号mmが“L”となって、セレクタ
SB27乃至SB33は夫々セレクタSA27乃至SA33の出
力を選択する。一方、MCKクロックEのタイミングで
は有効ビット数が5の次のデータがセレクタSA0 乃至
SA28の端子1に入力される。セレクタSA24乃至SA
33は、これらの余りビット及び入力データの有効ビット
(図7(d)のタイミングEの斜線部)をMCKクロッ
クEのタイミングで取込む。
At the timing of this MCK clock D,
The effective bit length is less than 8 bits, and the ACK clock is not generated as shown in FIG. At the timing of the MCK clock next to the MCK clock D, the output m (FIG. 8 (g)) of the FF44 of FIG. 1 becomes "L", and the signal mm becomes "L" at the timing of the MCK clock E, and the selectors SB27 to SB27 through SB33 selects the outputs of the selectors SA27 to SA33, respectively. On the other hand, at the timing of the MCK clock E, the next data having 5 effective bits is input to the terminals 1 of the selectors SA0 to SA28. Selector SA24 to SA
33 captures these remainder bits and the valid bits of the input data (hatched portion of timing E in FIG. 7D) at the timing of MCK clock E.

【0054】次のMCKクロックFのタイミングでは、
セレクタSA26乃至SA33が選択した有効ビットがAC
KクロックによってFFA26乃至A33から出力される。
また、セレクタSA24,SA25の出力O24,O25はFF
A24,A25を介してセレクタSB32,SB33の端子1に
供給する。以後、同様の動作が繰返されて、順次8ビッ
トパラレルデータが出力される。
At the next MCK clock F timing,
The valid bit selected by the selectors SA26 to SA33 is AC
The signals are output from FFA26 to A33 by K clock.
The outputs O24 and O25 of the selectors SA24 and SA25 are FF.
It is supplied to the terminal 1 of the selectors SB32, SB33 via A24, A25. After that, the same operation is repeated, and 8-bit parallel data is sequentially output.

【0055】このように、本実施例においては、入力さ
れるパラレルデータをパラレルシフト回路21がシリアル
データに変換することなくパラレルシフトし、8ビット
固定長回路30は数クロックで順次8ビット固定長データ
に変換して出力しており、高速な可変長−固定長変換が
可能である。
As described above, in this embodiment, the parallel shift circuit 21 shifts the input parallel data in parallel without converting it to serial data, and the 8-bit fixed length circuit 30 sequentially shifts the 8-bit fixed length by several clocks. The data is converted and output, and high-speed variable-to-fixed length conversion is possible.

【0056】[0056]

【発明の効果】以上説明したように本発明によれば、高
速処理を可能にすることができるという効果を有する。
As described above, according to the present invention, there is an effect that high speed processing can be realized.

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

【図1】本発明に係る固定長変換回路の一実施例を示す
ブロック図。
FIG. 1 is a block diagram showing an embodiment of a fixed length conversion circuit according to the present invention.

【図2】実施例の動作原理を説明するための説明図。FIG. 2 is an explanatory diagram for explaining the operation principle of the embodiment.

【図3】図1中のパラレルシフト回路の具体的な構成を
示すブロック図。
FIG. 3 is a block diagram showing a specific configuration of a parallel shift circuit in FIG.

【図4】図1中の制御クロック発生回路の具体的な構成
を示すブロック図。
4 is a block diagram showing a specific configuration of a control clock generation circuit in FIG.

【図5】図4の動作を説明するためのタイミングチャー
ト。
5 is a timing chart for explaining the operation of FIG.

【図6】図1中の8ビット固定長回路の具体的な構成を
示すブロック図。
FIG. 6 is a block diagram showing a specific configuration of an 8-bit fixed length circuit in FIG.

【図7】実施例の動作を説明するための説明図。FIG. 7 is an explanatory diagram for explaining the operation of the embodiment.

【図8】実施例の動作を説明するためのタイミングチャ
ート。
FIG. 8 is a timing chart for explaining the operation of the embodiment.

【図9】ハフマン符号を説明するための説明図。FIG. 9 is an explanatory diagram for explaining a Huffman code.

【図10】ハフマン符号と付加データの組合わせを説明
するための説明図。
FIG. 10 is an explanatory diagram for explaining a combination of Huffman code and additional data.

【図11】従来の固定長変換回路を示すブロック図。FIG. 11 is a block diagram showing a conventional fixed length conversion circuit.

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

21…パラレルシフト回路、22,27,28…加算器、30…8
ビット固定長回路、31…制御クロック発生回路、40…デ
コード回路
21 ... Parallel shift circuit, 22, 27, 28 ... Adder, 30 ... 8
Bit fixed length circuit, 31 ... Control clock generation circuit, 40 ... Decode circuit

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 入力可変長データの有効ビット長を示す
データが与えられると共に出力の下位nビットが帰還さ
れて前記有効ビット長と帰還された下位n(nは自然
数)ビットとを加算する加算手段と、 前記下位nビットと前記有効ビット長のデータとを用い
て前回の固定長処理における余りビットと前記有効ビッ
トとを連続させるためのシフト量を求めるシフト量演算
手段と、 前記入力可変長データを前記シフト量に基づいてビット
シフトして出力するシフト手段と、 前記加算手段の出力の下位nビットを用いて前記シフト
手段の出力の有効ビットと前記余りビットとを連続させ
た合成データを得る合成手段と、 前記加算手段の出力の最上位ビットから下位n+1ビッ
トまでのデータを用いて前記合成データをnビット長の
固定長データに変換する場合の処理タイミングを制御す
る制御クロック発生手段と、 この制御クロック発生手段からのクロックを用いて前記
合成データをnビット単位で固定長変換処理して出力す
る固定長手段とを具備したことを特徴とする固定長変換
回路。
1. Addition in which data indicating the effective bit length of input variable-length data is given and lower n bits of output are fed back to add the effective bit length and the fed back lower n (n is a natural number) bits. Means for calculating a shift amount for making the remainder bit and the valid bit in the previous fixed length processing continuous by using the lower n bits and the data of the valid bit length; and the input variable length. Shift means for bit-shifting and outputting the data based on the shift amount; and composite data in which the effective bit and the remainder bit of the output of the shift means are consecutively formed by using the lower n bits of the output of the adding means. A fixed length data of n-bit length is obtained by using the synthesizing means for obtaining and the data from the most significant bit to the lower n + 1 bits of the output of the adding means. Control clock generation means for controlling the processing timing in the case of conversion, and fixed length means for performing fixed length conversion processing of the synthesized data in units of n bits using the clock from the control clock generation means and outputting the fixed data are provided. Fixed length conversion circuit characterized by.
JP10792692A 1992-04-27 1992-04-27 Fixed length converting circuit Pending JPH05304480A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10792692A JPH05304480A (en) 1992-04-27 1992-04-27 Fixed length converting circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10792692A JPH05304480A (en) 1992-04-27 1992-04-27 Fixed length converting circuit

Publications (1)

Publication Number Publication Date
JPH05304480A true JPH05304480A (en) 1993-11-16

Family

ID=14471558

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10792692A Pending JPH05304480A (en) 1992-04-27 1992-04-27 Fixed length converting circuit

Country Status (1)

Country Link
JP (1) JPH05304480A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPWO2003084077A1 (en) * 2002-03-25 2005-08-04 アライドテレシスホールディングス株式会社 Variable length / fixed length data conversion method and apparatus

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPWO2003084077A1 (en) * 2002-03-25 2005-08-04 アライドテレシスホールディングス株式会社 Variable length / fixed length data conversion method and apparatus

Similar Documents

Publication Publication Date Title
EP0058997B1 (en) Digital processing circuit having a multiplication function
US5801650A (en) Decoding apparatus and method
EP0098153B1 (en) Digital data code conversion circuit for variable-word-length data code
US5428356A (en) Variable length code decoder utilizing a predetermined prioritized decoding arrangement
EP1014589B1 (en) A variable length codeword decoder
JPH03274920A (en) Signal encoder
US7821430B2 (en) Arithmetic decoding apparatus
JPH07307675A (en) Variable length code decoder and method for decoding variable length code value
JPH09181921A (en) Digital information encoding device, digital information decoding device, digital information encoding/decoding device, digital information encoding method and digital information decoding method
EP1158807B1 (en) Data stream conversion apparatus and method, variable length coded data stream generation apparatus and method, and camera system
US4534055A (en) Code conversion system
JPH05304480A (en) Fixed length converting circuit
JP3275224B2 (en) Digital signal processing system
US7916048B2 (en) Encoding a gray code sequence for an odd length sequence
US4551706A (en) Apparatus for decoding run-length encoded data
JP3034293B2 (en) Fixed length conversion circuit for variable length code
US6496602B2 (en) Sorting device of variable-length code
JP3095558B2 (en) Variable length coded data decoding circuit device and decoding method
JPH07200252A (en) Burrel shifter circuit
EP0470793A2 (en) Digital signal orthogonal transformer apparatus
JPH05206870A (en) Encoding circuit
JP3083153B2 (en) Encoding circuit
JPS6226101B2 (en)
JPH0214821B2 (en)
KR100304872B1 (en) Variable length code decoder