JPH05252398A - Method and circuit for generating address - Google Patents

Method and circuit for generating address

Info

Publication number
JPH05252398A
JPH05252398A JP4647592A JP4647592A JPH05252398A JP H05252398 A JPH05252398 A JP H05252398A JP 4647592 A JP4647592 A JP 4647592A JP 4647592 A JP4647592 A JP 4647592A JP H05252398 A JPH05252398 A JP H05252398A
Authority
JP
Japan
Prior art keywords
value
output
bit
input
register
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.)
Granted
Application number
JP4647592A
Other languages
Japanese (ja)
Other versions
JP2833327B2 (en
Inventor
Toshiaki Inoue
俊明 井上
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.)
NEC Corp
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP4647592A priority Critical patent/JP2833327B2/en
Publication of JPH05252398A publication Critical patent/JPH05252398A/en
Application granted granted Critical
Publication of JP2833327B2 publication Critical patent/JP2833327B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)
  • Image Input (AREA)
  • Image Processing (AREA)

Abstract

PURPOSE:To provide an address generating method and an address generating circuit capable of suppressing the increase of hardwares and rapidly executing the zigzag scanning of memories in zigzag scanning to be used for high efficiency image coding technique. CONSTITUTION:The address generating circuit is provided with a register 1 for storing an initial address value SA, registers 4, 5 for changing stored offset values in accordance with zigzag scanning, an adder 2 for adding the output SA of the register 1 to a bit string connecting value(OFY, OFX) setting up the output OFY of the register 4 as an upper bit and the output OFX of the register 5 as a lower bit, and selectors 7, 8, 15, 16, comparators 11, 12, adders 9, 10, a toggle FF 14, FFs 3, 6, an AND gate 17, and an OR gate 13 which are used for controlling the changing procedure of each offset value.

Description

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

【0001】[0001]

【産業上の利用分野】本発明はアドレス発生方法および
アドレス発生回路に関し、特に高能率画像符号化処理に
用いられるジグザグスキャンアドレスのアドレス発生方
法およびアドレス発生回路に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an address generating method and an address generating circuit, and more particularly to an address generating method and an address generating circuit for a zigzag scan address used for high efficiency image coding processing.

【0002】[0002]

【従来の技術】従来、この種のジグザグスキャンアドレ
スのアドレス発生方法は、対象とするメモリに対して、
プログラムによりアドレス順序を逐次指定するか、また
は変換テーブルを用いて、線形アドレスをジグザグスキ
ャンアドレスに変換することによって実現されていた。
2. Description of the Related Art Conventionally, an address generating method for a zigzag scan address of this type is
It is realized by sequentially designating the address order by a program or by converting a linear address into a zigzag scan address using a conversion table.

【0003】図4は従来のジグザグスキャンアドレスに
よるメモリアクセス方法の一例を示す図である。たとえ
ば、8×8のジグザグスキャンを行なうには、線形の6
4のアドレス空間(アドレス0〜63)を8×8の2次
元領域とし、初期アドレス0から0→1→8→16→9
→2→3→10→…→63のように、ジグザグ状にスキ
ャンする。
FIG. 4 is a diagram showing an example of a conventional memory access method using a zigzag scan address. For example, to perform an 8x8 zigzag scan, a linear 6
The address space of 4 (addresses 0 to 63) is set as an 8 × 8 two-dimensional area, and initial addresses 0 to 0 → 1 → 8 → 16 → 9
→ Zigzag scanning is performed as in → 2 → 3 → 10 → ... → 63.

【0004】図5は、このようなジグザグスキャンアド
レスを発生するアドレス発生方法を用いるアドレス発生
回路の一例を示すブロック図である。従来のアドレス発
生方法およびアドレス発生回路は、図5に示すように、
デコーダ31と、変換テーブル32と、読出回路33と
を備えて構成されていた。
FIG. 5 is a block diagram showing an example of an address generating circuit using an address generating method for generating such a zigzag scan address. The conventional address generation method and address generation circuit are as shown in FIG.
It has a decoder 31, a conversion table 32, and a reading circuit 33.

【0005】次に、従来のアドレス発生方法およびアド
レス発生回路の動作について説明する。0→1→2…→
62→63なる線形アドレスALの入力に対して、変換
テーブル32を用いて、0→1→8→…→63なるジグ
ザグスキャンアドレスAZに変換して、読出回路33か
ら出力するというものであった。
Next, the conventional address generating method and the operation of the address generating circuit will be described. 0 → 1 → 2… →
The input of the linear address AL of 62 → 63 is converted into the zigzag scan address AZ of 0 → 1 → 8 → ... → 63 using the conversion table 32, and is output from the read circuit 33. ..

【0006】[0006]

【発明が解決しようとする課題】上述した従来のアドレ
ス発生方法およびアドレス発生回路は、変換テーブルを
用いて実現する場合には、スキャン範囲を拡大したとき
変換テーブルのハードウェア量がビット長の2乗に比例
するので急速に増大するという欠点があった。たとえ
ば、スキャン範囲を8×8から16×16に拡大する
と、変換テーブルの大きさは4倍となる。また、プログ
ラムによりアドレス順序を逐次指定する方法では、スキ
ャン範囲を拡大したときマシンサイクル毎のアドレス発
生が困難となるという問題点があった。
When the conventional address generating method and address generating circuit described above are implemented by using a conversion table, the hardware amount of the conversion table is 2 bits long when the scan range is expanded. Since it is proportional to the power, it has the drawback of increasing rapidly. For example, if the scan range is expanded from 8 × 8 to 16 × 16, the size of the conversion table is quadrupled. Further, the method of sequentially specifying the address order by the program has a problem that it becomes difficult to generate an address for each machine cycle when the scan range is expanded.

【0007】本発明の目的は、スキャン範囲を拡大した
ときのハードウェア量の急速な増加を緩和し、かつ、マ
シンサイクル毎に効率よくジグザグスキャンアドレスを
発生するアドレス発生方法およびアドレス発生回路を提
供することにある。
An object of the present invention is to provide an address generating method and an address generating circuit which alleviate a rapid increase in hardware amount when a scan range is expanded and efficiently generate a zigzag scan address for each machine cycle. To do.

【0008】[0008]

【課題を解決するための手段】第一発明のアドレス発生
方法は、n(n≧2m;mは自然数)ビットのアドレス
空間を有する記憶装置をアクセスするためのアドレス発
生方法において、nビットの初期アドレスの値に、それ
ぞれ以下の(A)〜(F)の処理を順に実行して与えら
れるmビットの第一の2の補数である第一のオフセット
値を上位ビットとしmビットの第二の2の補数である第
二のオフセット値を下位ビットとするビット列の連接に
より得られる2mビットの第三のオフセット値を加算し
て生成されることを特徴とするものである。 (A)前記第三のオフセット値の初期値を(0,0)と
し、前記第一および第二のオフセット値にそれぞれ加算
する現在の加算値を第一の加算値(−1,+1)とす
る。 (B)現在の前記第三のオフセット値に前記第一の加算
値(−1,+1)を加算し続け、前記第一のオフセット
値が負になった場合にはこの第一のオフセット値を0に
補正して次の前記第三のオフセット値とするとともに次
の前記加算値を第二の加算値(+1,−1)とする。 (C)現在の前記第三のオフセット値に前記第二の加算
値(+1,−1)を加算し続け、前記第一のオフセット
値が負になった場合にはこの第一のオフセット値を0に
補正して次の前記第三のオフセット値とするとともに次
の前記加算値を前記第一の加算値(−1,+1)とす
る。 (D)現在の前記第三のオフセット値に前記第二の加算
値(+1,−1)を加算し続け、前記第一のオフセット
値が2m-1 −1になった場合には次の前記加算値を前記
第一の加算値(−1,+1)とし、前記次の加算値で計
算される前記第一のオフセット値を2m-1 −1に保持す
る。 (E)現在の前記第三のオフセット値に前記第一の加算
値(−1,+1)を加算し続け、前記第二のオフセット
値が2m-1 −1になった場合には次の前記加算値を前記
第二の加算値(+1,−1)とし、前記次の加算値で計
算される前記第二のオフセット値を2m-1 −1に保持す
る。 (F)現在の前記第三のオフセット値が(2m-1 −1,
m-1 −1)になった場合にはアドレス発生を終了す
る。
According to a first aspect of the present invention, there is provided an address generating method for accessing a storage device having an address space of n (n ≧ 2m; m is a natural number) bits, wherein an initial n-bit address is used. The first offset value, which is the first 2's complement of m bits, which is given to the address value by sequentially performing the following processes (A) to (F), is defined as the upper bit, and the second offset of m bits is set. It is characterized by being generated by adding a 2 m-bit third offset value obtained by concatenating bit strings having a second offset value which is a two's complement as a lower bit. (A) The initial value of the third offset value is (0,0), and the current addition value to be added to the first and second offset values is the first addition value (-1, + 1). To do. (B) Continuing to add the first addition value (-1, +1) to the current third offset value, and if the first offset value becomes negative, this first offset value is The value is corrected to 0 to obtain the next third offset value, and the next addition value is set to the second addition value (+1, −1). (C) Continuing to add the second addition value (+1, -1) to the current third offset value, and when the first offset value becomes negative, this first offset value is The value is corrected to 0 to obtain the next third offset value, and the next addition value is set to the first addition value (-1, + 1). (D) Continuing to add the second added value (+1, -1) to the current third offset value, and when the first offset value becomes 2 m-1 -1, The added value is set to the first added value (−1, + 1), and the first offset value calculated by the next added value is held at 2 m−1 −1. (E) Continuing to add the first addition value (-1, +1) to the current third offset value, and when the second offset value becomes 2 m-1 -1, The added value is set to the second added value (+1, -1), and the second offset value calculated by the next added value is held at 2 m-1 -1. (F) The current third offset value is (2 m-1 -1,
When it becomes 2 m-1 -1), the address generation is terminated.

【0009】また、第2の発明のアドレス発生回路は、
n(n≧2m;mは自然数)ビットの初期アドレス値と
1 ビットのアドレス発生開始信号を入力とし、nビッ
トのアドレスと1ビットのアドレス発生終了信号を出力
し前記アドレス発生開始信号をメモリイネーブル信号と
して出力するアドレス発生回路において、データ入力お
よびロード入力を有し前記初期アドレス値を格納するn
ビットの第一のレジスタと、データ入力とホールド入力
およびクリア入力とをそれぞれ有するmビットの第一お
よび第二のレジスタと、前記第一のレジスタの出力と、
前記第二のレジスタの出力のビット列を上位ビットとと
し前記第三のレジスタの出力のビット列を下位ビットと
するビット列の連接値とを加算する第一の加算器と、そ
れぞれ前記第一および第二のレジスタの前記ホールド入
力を印加するイネーブル入力およびクリア入力付きの第
一および第二の1ビットレジスタと、1ビットの第一の
制御入力を有し、前記第一の制御入力が’0’のときは
それぞれ+1および−1を出力し、前記第一の制御入力
が’1’のときはそれぞれ−1および+1のmビットの
2の補数を出力する第一および第二のセレクタと、前記
第一および第二のセレクタのそれぞれ前記第一の制御入
力を印加するイネーブル入力およびクリア入力付きの1
ビットのトグルフリップフロップと、前記第二のレジス
タの出力と前記第一のセレクタの出力とを加算する第二
の加算器と、前記第三のレジスタの出力と前記第二のセ
レクタの出力とを加算する第三の加算器と、前記第二の
加算器の出力が−1であることを示し前記第一の1ビッ
トレジスタの前記イネーブル入力に与える第一の出力お
よび前記第二の加算器の出力が2m-1 −1であることを
示す第二の出力を有するmビットの第一の比較器と、前
記第三の加算器の出力が−1であることを示し前記第二
の1ビットレジスタの前記イネーブル入力に与える第三
の出力および前記第三の加算器の出力が2m-1 −1であ
ることを示す第四の出力を有するmビットの第二の比較
器と、前記第一,第二,第三,第四の出力を入力とし前
記トグルフリップフロップの前記イネーブル入力に出力
を与えるOR回路と、mビットの値’0’および前記第
二の加算器の出力をデータ入力とし前記第一の出力を第
二の制御入力とし前記第二の制御入力が’1’のとき
は’0’を出力し前記第二の制御入力が’0’のときは
前記第二の加算器の出力を出力して前記第二のレジスタ
のデータ入力に与える第三のセレクタと、mビットの
値’0’および前記第三の加算器の出力をデータ入力と
し前記第三の出力を第三の制御入力とし前記第三の制御
入力が’1’のときは’0’を出力し前記第三の制御入
力が’0’のときは前記第三の加算器の出力を出力して
前記第三のレジスタのデータ入力に与える第四のセレク
タと、前記第二および第四の出力を入力とし前記アドレ
ス発生終了信号を出力するAND回路とを備えることに
より構成されている。
The address generating circuit of the second invention is
The initial address value of n (n ≧ 2m; m is a natural number) and 1-bit address generation start signal are input, the n-bit address and 1-bit address generation end signal are output, and the address generation start signal is memory-enabled. An address generating circuit for outputting as a signal has a data input and a load input and stores the initial address value n
A first register of bits, m-bit first and second registers each having a data input, a hold input and a clear input; and an output of the first register,
A first adder for adding a concatenated value of the bit string having the bit string of the output of the second register as the upper bit and the bit string of the output of the third register as the lower bit; and the first and second respectively A first and a second 1-bit register with enable and clear inputs for applying the hold input of the register and a 1-bit first control input, the first control input being '0'. First and second selectors which respectively output +1 and -1 when the first control input is '1' and which output a two's complement of m bits of -1 and +1 respectively. 1 with an enable input and a clear input for applying said first control input to one and a second selector respectively
A bit toggle flip-flop, a second adder for adding the output of the second register and the output of the first selector, and the output of the third register and the output of the second selector. A third adder for adding and a first output for indicating to the enable input of the first 1-bit register that the output of the second adder is -1, and the second adder An m-bit first comparator having a second output indicating that the output is 2 m −1 −1 and the second 1 indicating that the output of the third adder is −1. An m-bit second comparator having a third output applied to the enable input of a bit register and a fourth output indicating that the output of the third adder is 2 m-1 -1; The first, second, third, and fourth outputs are input, and the toggle flip flag is used. An OR circuit for providing an output to the enable input of the loop, an m-bit value "0" and the output of the second adder as a data input, the first output as a second control input, and the second control When the input is '1', '0' is output, and when the second control input is '0', the output of the second adder is output and given to the data input of the second register. When the three selectors, the m-bit value '0' and the output of the third adder are data inputs, the third output is the third control input, and the third control input is '1' A fourth selector which outputs "0" and outputs the output of the third adder to the data input of the third register when the third control input is "0"; And an AND circuit which inputs the fourth output and outputs the address generation end signal. Has been.

【0010】[0010]

【実施例】次に、本発明の実施例について図面を参照し
て説明する。
Embodiments of the present invention will now be described with reference to the drawings.

【0011】図1は本発明のアドレス発生方法の一実施
例を示す図である。
FIG. 1 is a diagram showing an embodiment of the address generating method of the present invention.

【0012】本実施例のアドレス発生方法は、図1に示
すように、初期アドレスSAとしてして与えられるnビ
ットのアドレス101と、制御論理106にしたがって
各々の値が変化する2つの4ビットのオフセット103
の値OFYを上位ビットとし、オフセット104の値O
FXを下位ビットとするビット列の連接により得られる
8ビットのオフセット105の値(OFY,OFX)と
を、加算器102により加算した加算結果をアドレス出
力AZとするものである。
As shown in FIG. 1, the address generating method according to the present embodiment has an n-bit address 101 given as an initial address SA and two 4-bit addresses whose values change according to a control logic 106. Offset 103
Value OFY of the offset 104 as the upper bit
An 8-bit offset 105 value (OFY, OFX) obtained by concatenating a bit string having FX as a lower bit is added by an adder 102, and the addition result is used as an address output AZ.

【0013】制御論理106は、表1に示すように、現
在のオフセット105の値(OFY,OFX)と、オフ
セット103の値OFY,104の値OFXに対する現
在の加算値(+1,−1)または(−1,+1)との加
算により次の時刻のオフセット105の値(OFY,O
FX)を算出することを基本の動作とする。
The control logic 106, as shown in Table 1, the current value of the offset 105 (OFY, OFX) and the current addition value (+1, -1) for the value OFX of the offset 103, the value OFX of 104, or The value of the offset 105 at the next time (OFY, O
The basic operation is to calculate FX).

【0014】次に、補正1と、補正2の2つの補正方法
がある。
Next, there are two correction methods, correction 1 and correction 2.

【0015】補正1は、オフセット103の値OFYま
たは104の値OFXが−1になったらこの−1を0に
補正をし、次の時刻での加算値を変更する補正方法であ
る。
The correction 1 is a correction method in which when the value OFY of the offset 103 or the value OFX of 104 becomes -1, this -1 is corrected to 0 and the added value at the next time is changed.

【0016】補正2は、オフセット103の値OFYま
たは104の値OFXが7になったら次の時刻でこの7
を保持し、加算値を変更する補正方法である。
In the correction 2, when the value OFY of the offset 103 or the value OFX of 104 becomes 7, the value 7
Is held and the added value is changed.

【0017】ここで、加算値の変更とは、現在の加算値
が(+1,−1)である場合には次の時刻で(−1,+
1)に、現在の加算値が(−1,+1)である場合には
次の時刻で(+1,−1)にそれぞれ変更することであ
る。
Here, the change of the added value means that when the current added value is (+1, -1), it is (-1, +) at the next time.
In 1), if the current added value is (-1, + 1), it is changed to (+ 1, -1) at the next time.

【0018】[0018]

【表1】 [Table 1]

【0019】図2は本発明のアドレス発生回路の一実施
例を示すブロック図である。
FIG. 2 is a block diagram showing an embodiment of the address generating circuit of the present invention.

【0020】本実施例のアドレス発生回路は、図2に示
すように、初期アドレスSAを格納するロード入力付き
のレジスタ1と、nビットの加算器2と、イネーブル付
きの1ビットのレジスタ3,6と、2つの4ビットのオ
フセット値OFY,OFXをそれぞれ格納しクリア入力
およびホールド入力付の4ビットのレジスタ4,5
と、’+1’,’−1’の2つの値を入力しオフセット
値OFY,OFXをそれぞれを選択する2入力4ビット
セレクタ7,8と、セレクタ7の出力とレジスタ4の出
力およびセレクタ8の出力とレジスタ5の出力とをそれ
ぞれ加算する4ビットの加算器9,10と、加算器9,
10の出力をそれぞれ比較する4ビットの比較器11,
12と、比較器11の出力により加算器9の出力と’
0’とのいずれかを選択する2入力4ビットセレクタ1
5と、比較器12の出力により加算器10の出力と’
0’とのいずれかを選択する2入力4ビットセレクタ1
6と、比較器11,12の出力のORをとるORゲート
13と、ORゲート13を入力するクリア入力付きの1
ビットのトグルフリップフロップ(TGL)14と、比
較器11,12の出力が入力されアドレス発生終了信号
AEを出力するANDゲート17とを備えて構成されて
いる。
As shown in FIG. 2, the address generation circuit of this embodiment has a register 1 with a load input for storing an initial address SA, an n-bit adder 2, an enable 1-bit register 3, 6 and two 4-bit offset values OFY and OFX are stored respectively, and 4-bit registers 4 and 5 with clear input and hold input are provided.
, Two-input 4-bit selectors 7 and 8 for inputting two values of “+1” and “−1” and selecting offset values OFY and OFX, an output of the selector 7, an output of the register 4 and a selector 8. 4-bit adders 9 and 10 for respectively adding the output and the output of the register 5, and the adder 9 and
A 4-bit comparator 11 for comparing the outputs of 10 respectively,
12 and the output of the adder 9 by the output of the comparator 11
2-input 4-bit selector 1 that selects either 0 '
5 and the output of the adder 10 depending on the output of the comparator 12,
2-input 4-bit selector 1 that selects either 0 '
6, an OR gate 13 that takes the OR of the outputs of the comparators 11 and 12, and a 1 with a clear input that inputs the OR gate 13.
It comprises a bit toggle flip-flop (TGL) 14 and an AND gate 17 which receives the outputs of the comparators 11 and 12 and outputs an address generation end signal AE.

【0021】次に、本実施例のアドレス発生回路の動作
について説明する。
Next, the operation of the address generating circuit of this embodiment will be described.

【0022】まず、nビットの初期アドレスSAがレジ
スタ1に格納される。次にアドレス発生信号AGによ
り、レジスタ1の初期アドレスSAは、レジスタ4のオ
フセット値OFYを上位ビットとし、レジスタ5のオフ
セット値OFXを下位ビットとするビット列の連接によ
り得られる8ビットのオフセット値(OFY,OFX)
と加算器2で加算され、クロックサイクル毎にアドレス
出力AZとして出力される。
First, the n-bit initial address SA is stored in the register 1. Next, the address generation signal AG causes the initial address SA of the register 1 to be an 8-bit offset value (the offset value OFY of the register 4 is set as the upper bit and the offset value OFX of the register 5 is set as the lower bit, which is an 8-bit offset value ( OFY, OFX)
Is added by the adder 2 and is output as the address output AZ every clock cycle.

【0023】レジスタ4のオフセット値OFYは、セレ
クタ7により選択される値’+1’,’−1’のいずれ
か一方が加算器9により加算され、この加算結果AYは
比較器11と、セレクタ15とに入力される。
The offset value OFY of the register 4 is added by the adder 9 with one of the values "+1" and "-1" selected by the selector 7, and the addition result AY is obtained by the comparator 11 and the selector 15. Entered in and.

【0024】次に、比較器11では、加算器9の加算結
果AYが2つの値−1(1111)と7(0111)と
同時に比較され、それぞれの比較結果CY1,CY2が
出力される。まず、比較結果CY1が−1に等しい場合
には、セレクタ15から出力DYとして0が出力され
る。また、比較結果CY1が−1に等しくない場合に
は、セレクタ15から加算器9の加算結果AYがそのま
ま出力される。セレクタ15の出力DYはレジスタ4に
格納される。
Next, in the comparator 11, the addition result AY of the adder 9 is simultaneously compared with the two values -1 (1111) and 7 (0111), and the respective comparison results CY1 and CY2 are output. First, when the comparison result CY1 is equal to -1, 0 is output from the selector 15 as the output DY. When the comparison result CY1 is not equal to -1, the selector 15 outputs the addition result AY of the adder 9 as it is. The output DY of the selector 15 is stored in the register 4.

【0025】また、比較結果CY2が7に等しい場合に
は、比較結果CY2がレジスタ3のイネーブル入力Eに
入力され、次のクロックサイクルでレジスタ3の出力H
Yはレジスタ4のホールド入力に入力される。この結
果、レジスタ4のオフセット値OFYは次のクロックサ
イクルでは7となっており、また、2クロックサイクル
後も7に保持される。
When the comparison result CY2 is equal to 7, the comparison result CY2 is input to the enable input E of the register 3 and the output H of the register 3 is output in the next clock cycle.
Y is input to the hold input of the register 4. As a result, the offset value OFY of the register 4 is 7 in the next clock cycle, and is held at 7 even after 2 clock cycles.

【0026】次に、比較器11の2つの比較結果CY
1,CY2が−1または7に等しい場合には、比較器1
1の出力CY1,CY2はORゲート13に入力され
る。ORゲート13の出力はTGL14に入力され、次
のクロックサイクルでTGLの出力を反転し、これによ
りセレクタ7の出力を切替る。
Next, the two comparison results CY of the comparator 11
1, CY2 is equal to -1 or 7, the comparator 1
The outputs CY1 and CY2 of 1 are input to the OR gate 13. The output of the OR gate 13 is input to the TGL 14, which inverts the output of the TGL in the next clock cycle, thereby switching the output of the selector 7.

【0027】一方、レジスタ5のオフセット値OFX
は、セレクタ8により選択される値’+1’,’−1’
のいずれか一方が加算器10により加算され、この加算
結果AXは比較器12と、セレクタ16とに入力され
る。
On the other hand, the offset value OFX of the register 5
Are values “+1” and “−1” selected by the selector 8.
Any one of the above is added by the adder 10, and the addition result AX is input to the comparator 12 and the selector 16.

【0028】次に、比較器12では、加算器10の加算
結果AXが2つの値−1(1111)と7(0111)
と同時に比較され、それぞれの比較結果CX1,CX2
が出力される。まず、比較結果CX1が−1に等しい場
合には、セレクタ16から0が出力される。また、比較
結果CX1が−1に等しくない場合には、セレクタ16
から加算器10の加算結果AXがそのまま出力される。
セレクタ16の出力はレジスタ4に格納される。
Next, in the comparator 12, the addition result AX of the adder 10 has two values -1 (1111) and 7 (0111).
At the same time, they are compared and the respective comparison results CX1, CX2
Is output. First, when the comparison result CX1 is equal to -1, the selector 16 outputs 0. If the comparison result CX1 is not equal to -1, the selector 16
Outputs the addition result AX of the adder 10 as it is.
The output of the selector 16 is stored in the register 4.

【0029】また、比較結果CX2が7に等しい場合に
は、比較結果CX2がレジスタ6のイネーブル入力Eに
入力され、次のクロックサイクルでレジスタ6の出力H
Xはレジスタ5のホールド入力に入力される。この結
果、レジスタ5のオフセット値OFYは次のクロックサ
イクルでは7となっており、また、2クロックサイクル
後も7に保持される。
When the comparison result CX2 is equal to 7, the comparison result CX2 is input to the enable input E of the register 6 and the output H of the register 6 is output in the next clock cycle.
X is input to the hold input of the register 5. As a result, the offset value OFY of the register 5 becomes 7 in the next clock cycle, and is held at 7 even after 2 clock cycles.

【0030】次に、比較器12の2つの比較結果CX
1,CX2が−1または7に等しい場合には、比較器1
2の出力はORゲート13に入力される。ORゲート1
3の出力はTGL14に入力され、次のクロックサイク
ルでTGLの出力を反転し、これによりセレクタ8の出
力を切替る。
Next, the two comparison results CX of the comparator 12
1, CX2 is equal to -1 or 7, comparator 1
The output of 2 is input to the OR gate 13. OR gate 1
The output of 3 is input to the TGL 14, and the output of TGL is inverted in the next clock cycle, whereby the output of the selector 8 is switched.

【0031】セレクタ7,8はそれぞれの出力の極性が
相補の関係となるような制御信号が与えられる。たとえ
ば、セレクタ7が−1を出力しているときにはセレクタ
8は+1を出力する。
Control signals are supplied to the selectors 7 and 8 so that the polarities of their outputs are in a complementary relationship. For example, when the selector 7 outputs -1, the selector 8 outputs +1.

【0032】アドレス発生信号AGは、レジスタ1のロ
ード入力と、レジスタ3〜6およびTGL14のクリア
入力に与えられ、0または1のいずれか一方の値でイネ
ーブルとなるものとする。
The address generation signal AG is applied to the load input of the register 1 and the clear inputs of the registers 3 to 6 and the TGL 14, and is enabled with either 0 or 1.

【0033】比較器11の比較結果CY2と比較器12
の比較結果CX2とはANDゲート17に入力され、両
者共7に等しい場合の出力のときにはアドレス発生終了
信号AEを出力して処理を終了する。
The comparison result CY2 of the comparator 11 and the comparator 12
The comparison result CX2 is input to the AND gate 17, and when both are equal to 7, the address generation end signal AE is output and the processing ends.

【0034】以上、本発明の実施例を説明したが、本発
明は上記実施例に限られることなく種々の変形が可能で
ある。たとえば、実施例は8×8のジグザグスキャンを
例にとって説明しているが、任意の大きさのジグザグス
キャンの場合にも、本発明の主旨を逸脱しない限り適用
できることは勿論である。またこれを記憶装置に組込む
アドレス発生回路のみでなく、本発明を含む記憶装置を
一部とする他のシステムにおいても、本発明の主旨を逸
脱しない限り適用できることは勿論である。
Although the embodiments of the present invention have been described above, the present invention is not limited to the above embodiments, and various modifications can be made. For example, although the embodiment has been described by taking an 8 × 8 zigzag scan as an example, it is needless to say that the present invention can be applied to a zigzag scan of an arbitrary size without departing from the scope of the present invention. Further, it is needless to say that the present invention can be applied not only to an address generation circuit incorporating this into a storage device, but also to other systems having a storage device including the present invention as a part without departing from the gist of the present invention.

【0035】[0035]

【発明の効果】以上説明したように、本発明のアドレス
発生方法およびアドレス発生回路は、スキャン範囲を拡
大することによる制御論理のハードウェア量の増加は、
ほぼビット長に比例するので、従来のビット長の2乗に
比例する変換テーブルに比較すると大幅にハードウェア
量の増加を低減できこれを用いたシステムの小型化が可
能になるという効果がある。また、制御論理はハードワ
イヤで実現されるので、マシンサイクル毎のジグザグス
キャンアドレスの発生が可能となり、メモリのジグザグ
スキャンの高速化が可能になるという効果がある。
As described above, according to the address generating method and the address generating circuit of the present invention, the hardware amount of the control logic is increased by expanding the scan range.
Since it is almost proportional to the bit length, there is an effect that an increase in the amount of hardware can be significantly reduced and a system using the conversion table can be downsized as compared with the conventional conversion table proportional to the square of the bit length. Further, since the control logic is realized by a hard wire, it is possible to generate a zigzag scan address for each machine cycle, and it is possible to speed up the zigzag scan of the memory.

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

【図1】本発明のアドレス発生方法の一実施例を示すブ
ロック図である。
FIG. 1 is a block diagram showing an embodiment of an address generating method of the present invention.

【図2】本発明のアドレス発生回路の一実施例を示すブ
ロック図である。
FIG. 2 is a block diagram showing an embodiment of an address generation circuit of the present invention.

【図3】従来のアドレス発生方法の一例を示す図であ
る。
FIG. 3 is a diagram showing an example of a conventional address generation method.

【図4】従来のアドレス発生方法およびアドレス発生回
路の一例を示すブロック図である。
FIG. 4 is a block diagram showing an example of a conventional address generating method and address generating circuit.

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

1,3〜6 レジスタ 2,9,10 加算器 7,8,15,16 セレクタ 11,12 比較器 13 ORゲート 14 トグルフリップフロップ(TGL) 17 ANDゲート 31 デコーダ 32 変換テーブル 33 読出回路 101 初期アドレス 102,103,104 オフセット 105 制御論理 1,3 to 6 Registers 2,9,10 Adder 7,8,15,16 Selector 11,12 Comparator 13 OR gate 14 Toggle flip-flop (TGL) 17 AND gate 31 Decoder 32 Conversion table 33 Read circuit 101 Initial address 102, 103, 104 Offset 105 Control logic

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 n(n≧2m;mは自然数)ビットのア
ドレス空間を有する記憶装置をアクセスするためのアド
レス発生方法において、 nビットの初期アドレスの値に、それぞれ以下の(A)
〜(F)の処理を順に実行して与えられるmビットの第
一の2の補数である第一のオフセット値を上位ビットと
しmビットの第二の2の補数である第二のオフセット値
を下位ビットとするビット列の連接により得られる2m
ビットの第三のオフセット値を加算して生成されること
を特徴とするアドレス発生方法。 (A)前記第三のオフセット値の初期値を(0,0)と
し、前記第一および第二のオフセット値にそれぞれ加算
する現在の加算値を第一の加算値(−1,+1)とす
る。 (B)現在の前記第三のオフセット値に前記第一の加算
値(−1,+1)を加算し続け、前記第一のオフセット
値が負になった場合にはこの第一のオフセット値を0に
補正して次の前記第三のオフセット値とするとともに次
の前記加算値を第二の加算値(+1,−1)とする。 (C)現在の前記第三のオフセット値に前記第二の加算
値(+1,−1)を加算し続け、前記第一のオフセット
値が負になった場合にはこの第一のオフセット値を0に
補正して次の前記第三のオフセット値とするとともに次
の前記加算値を前記第一の加算値(−1,+1)とす
る。 (D)現在の前記第三のオフセット値に前記第二の加算
値(+1,−1)を加算し続け、前記第一のオフセット
値が2m-1 −1になった場合には次の前記加算値を前記
第一の加算値(−1,+1)とし、前記次の加算値で計
算される前記第一のオフセット値を2m-1 −1に保持す
る。 (E)現在の前記第三のオフセット値に前記第一の加算
値(−1,+1)を加算し続け、前記第二のオフセット
値が2m-1 −1になった場合には次の前記加算値を前記
第二の加算値(+1,−1)とし、前記次の加算値で計
算される前記第二のオフセット値を2m-1 −1に保持す
る。 (F)現在の前記第三のオフセット値が(2m-1 −1,
m-1 −1)になった場合にはアドレス発生を終了す
る。
1. An address generation method for accessing a storage device having an address space of n (n ≧ 2m; m is a natural number) bits, wherein the value of an initial address of n bits is (A)
The first offset value, which is the first 2's complement of m bits, which is given by sequentially performing the processing of (F) to (F), is defined as the upper bits, and the second offset value that is the second 2's complement of m bits is set. 2m obtained by concatenating the bit string that is the lower bit
An address generation method characterized by being generated by adding a third offset value of bits. (A) The initial value of the third offset value is (0,0), and the current addition value to be added to the first and second offset values is the first addition value (-1, + 1). To do. (B) Continuing to add the first addition value (-1, +1) to the current third offset value, and if the first offset value becomes negative, this first offset value is The value is corrected to 0 to obtain the next third offset value, and the next addition value is set to the second addition value (+1, −1). (C) Continuing to add the second addition value (+1, -1) to the current third offset value, and when the first offset value becomes negative, this first offset value is The value is corrected to 0 to obtain the next third offset value, and the next addition value is set to the first addition value (-1, + 1). (D) Continuing to add the second added value (+1, -1) to the current third offset value, and when the first offset value becomes 2 m-1 -1, The added value is set to the first added value (−1, + 1), and the first offset value calculated by the next added value is held at 2 m−1 −1. (E) Continuing to add the first addition value (-1, +1) to the current third offset value, and when the second offset value becomes 2 m-1 -1, The added value is set to the second added value (+1, -1), and the second offset value calculated by the next added value is held at 2 m-1 -1. (F) The current third offset value is (2 m-1 -1,
When it becomes 2 m-1 -1), the address generation is terminated.
【請求項2】 n(n≧2m;mは自然数)ビットの初
期アドレス値と1ビットのアドレス発生開始信号を入力
とし、nビットのアドレスと1ビットのアドレス発生終
了信号を出力し前記アドレス発生開始信号をメモリイネ
ーブル信号として出力するアドレス発生回路において、 データ入力およびロード入力を有し前記初期アドレス値
を格納するnビットの第一のレジスタと、 データ入力とホールド入力およびクリア入力とをそれぞ
れ有するmビットの第一および第二のレジスタと、 前記第一のレジスタの出力と、前記第二のレジスタの出
力のビット列を上位ビットととし前記第三のレジスタの
出力のビット列を下位ビットとするビット列の連接値と
を加算する第一の加算器と、 それぞれ前記第一および第二のレジスタの前記ホールド
入力を印加するイネーブル入力およびクリア入力付きの
第一および第二の1ビットレジスタと、 1ビットの第一の制御入力を有し、前記第一の制御入力
が’0’のときはそれぞれ+1および−1を出力し、前
記第一の制御入力が’1’のときはそれぞれ−1および
+1のmビットの2の補数を出力する第一および第二の
セレクタと、 前記第一および第二のセレクタのそれぞれ前記第一の制
御入力を印加するイネーブル入力およびクリア入力付き
の1ビットのトグルフリップフロップと、 前記第二のレジスタの出力と前記第一のセレクタの出力
とを加算する第二の加算器と、 前記第三のレジスタの出力と前記第二のセレクタの出力
とを加算する第三の加算器と、 前記第二の加算器の出力が−1であることを示し前記第
一の1ビットレジスタの前記イネーブル入力に与える第
一の出力および前記第二の加算器の出力が2m-1 −1で
あることを示す第二の出力を有するmビットの第一の比
較器と、 前記第三の加算器の出力が−1であることを示し前記第
二の1ビットレジスタの前記イネーブル入力に与える第
三の出力および前記第三の加算器の出力が2m-1 −1で
あることを示す第四の出力を有するmビットの第二の比
較器と、 前記第一,第二,第三,第四の出力を入力とし前記トグ
ルフリップフロップの前記イネーブル入力に出力を与え
るOR回路と、 mビットの値’0’および前記第二の加算器の出力をデ
ータ入力とし前記第一の出力を第二の制御入力とし前記
第二の制御入力が’1’のときは’0’を出力し前記第
二の制御入力が’0’のときは前記第二の加算器の出力
を出力して前記第二のレジスタのデータ入力に与える第
三のセレクタと、 mビットの値’0’および前記第三の加算器の出力をデ
ータ入力とし前記第三の出力を第三の制御入力とし前記
第三の制御入力が’1’のときは’0’を出力し前記第
三の制御入力が’0’のときは前記第三の加算器の出力
を出力して前記第三のレジスタのデータ入力に与える第
四のセレクタと、 前記第二および第四の出力を入力とし前記アドレス発生
終了信号を出力するAND回路とを備えることを特徴と
するアドレス発生回路。
2. The address generation is performed by inputting an initial address value of n bits (n ≧ 2m; m is a natural number) and a 1-bit address generation start signal, and outputting an n-bit address and a 1-bit address generation end signal. An address generation circuit that outputs a start signal as a memory enable signal has an n-bit first register that has a data input and a load input and stores the initial address value, and a data input, a hold input, and a clear input. m-bit first and second registers, a bit string in which the output of the first register and a bit string of the output of the second register are upper bits, and a bit string of the output of the third register is lower bits And a hold input of each of the first and second registers, respectively. It has first and second 1-bit registers with enable and clear inputs to apply, and a 1-bit first control input, and +1 and -1 respectively when said first control input is '0'. Of the first and second selectors for outputting the two's complement of m bits of -1 and +1 respectively when the first control input is '1'. A 1-bit toggle flip-flop with an enable input and a clear input for applying the first control input, and a second adder for adding the output of the second register and the output of the first selector, respectively. A third adder for adding the output of the third register and the output of the second selector, and showing that the output of the second adder is -1. Said enable An m-bit first comparator having a first output applied to a bull input and a second output indicating that the output of the second adder is 2 m −1 −1; A third output to the enable input of the second 1-bit register and an output of the third adder to 2 m-1 -1. An m-bit second comparator having four outputs; an OR circuit which receives the first, second, third and fourth outputs as an input and gives an output to the enable input of the toggle flip-flop; Value of "0" and the output of the second adder as a data input, the first output as a second control input, and the second control input being "1" outputs "0". When the second control input is '0', the output of the second adder is output to output the second register. A third selector for giving a data input, an m-bit value of "0" and the output of the third adder as a data input, the third output as a third control input, and the third control input as " A fourth selector which outputs "0" when it is 1 and outputs the output of the third adder when the third control input is "0" and gives it to the data input of the third register. And an AND circuit which receives the second and fourth outputs and outputs the address generation end signal.
JP4647592A 1992-03-04 1992-03-04 Address generation method and address generation circuit Expired - Lifetime JP2833327B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4647592A JP2833327B2 (en) 1992-03-04 1992-03-04 Address generation method and address generation circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4647592A JP2833327B2 (en) 1992-03-04 1992-03-04 Address generation method and address generation circuit

Publications (2)

Publication Number Publication Date
JPH05252398A true JPH05252398A (en) 1993-09-28
JP2833327B2 JP2833327B2 (en) 1998-12-09

Family

ID=12748222

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4647592A Expired - Lifetime JP2833327B2 (en) 1992-03-04 1992-03-04 Address generation method and address generation circuit

Country Status (1)

Country Link
JP (1) JP2833327B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7529412B2 (en) 2002-11-07 2009-05-05 Samsung Electronics Co., Ltd. Image processing apparatus and method for converting image data between raster scan order and block scan order

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7529412B2 (en) 2002-11-07 2009-05-05 Samsung Electronics Co., Ltd. Image processing apparatus and method for converting image data between raster scan order and block scan order

Also Published As

Publication number Publication date
JP2833327B2 (en) 1998-12-09

Similar Documents

Publication Publication Date Title
JP3166447B2 (en) Image processing apparatus and image processing method
JP2833327B2 (en) Address generation method and address generation circuit
KR20050065976A (en) Apparatus and method for computing sha-1 hash function
JP2000134064A (en) Digital signal processor
US5621337A (en) Iterative logic circuit
US7064987B2 (en) Memory address generator with scheduled write and read address generating capability
KR100235537B1 (en) Variable tap of digital filter and multiplier circuit thereof
JP3000293B2 (en) Virtual shift circuit
JP2956636B2 (en) Wave processing device
JP2002171412A (en) Simd type information processing apparatus provided with x-branch tree instruction
JP4086481B2 (en) Arithmetic decoding method and apparatus, and storage medium
JPH0619806A (en) Address generation circuit for data compression
JP3135252B2 (en) Addressing device
JPH04195266A (en) Bit conversion circuit
JP3567256B2 (en) Stepping motor drive circuit
CN113792511A (en) Single-variable random circuit with high calculation accuracy and low hardware overhead and configuration method thereof
KR0153051B1 (en) Progrommable mapping circuit
JPS62237523A (en) Sorting circuit
JPH0728220B2 (en) Data conversion processing circuit
JPH05266060A (en) Matrix arithmetic circuit
JPH0991202A (en) List vector processor
JPH06188743A (en) Variable length code generating device
JPH0668246A (en) Binary image expanding/reducing device
Karagianni et al. A novel hardware algorithm for residue evaluation
JPH02243060A (en) Magnification and reduction circuit for picture data

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 19980901

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

Free format text: PAYMENT UNTIL: 20071002

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20081002

Year of fee payment: 10

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

Free format text: PAYMENT UNTIL: 20091002

Year of fee payment: 11

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

Free format text: PAYMENT UNTIL: 20091002

Year of fee payment: 11

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

Free format text: PAYMENT UNTIL: 20101002

Year of fee payment: 12

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

Free format text: PAYMENT UNTIL: 20111002

Year of fee payment: 13

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

Free format text: PAYMENT UNTIL: 20121002

Year of fee payment: 14

EXPY Cancellation because of completion of term
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121002

Year of fee payment: 14