JPH05334178A - Loop-like data generating circuit - Google Patents

Loop-like data generating circuit

Info

Publication number
JPH05334178A
JPH05334178A JP13848892A JP13848892A JPH05334178A JP H05334178 A JPH05334178 A JP H05334178A JP 13848892 A JP13848892 A JP 13848892A JP 13848892 A JP13848892 A JP 13848892A JP H05334178 A JPH05334178 A JP H05334178A
Authority
JP
Japan
Prior art keywords
loop
data
value
range
output data
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
JP13848892A
Other languages
Japanese (ja)
Inventor
Junichi Tamura
純一 田村
Teruaki Uehara
輝昭 上原
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.)
Oki Electric Industry Co Ltd
Original Assignee
Oki Electric Industry Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oki Electric Industry Co Ltd filed Critical Oki Electric Industry Co Ltd
Priority to JP13848892A priority Critical patent/JPH05334178A/en
Publication of JPH05334178A publication Critical patent/JPH05334178A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To attain a loop-like data generating circuit having a small circuit size and capable of generating loop-like data (including addresses) at a high speed. CONSTITUTION:Loop width expressing the width of a loop range for successively generating data like a loop in a data space is so conditioned that it is less than a half of the data space size. The absolute value of an offset expressing a difference in the loop range between before and after outputting data is so conditioned that it is less than the loop width. Thereby, a state not on a case incapable of using an addition value obtained by adding the offset to the current output data as a next output data is reduced. A module circuit 105 is provided with a range inside/outside detecting means 203 for detecting that the added value is a value outside the loop range and an addition value correcting means 202 for correcting the addition value detected as a value outside the range and forming the succeeding output data by modifying the added value when it is detected as a constitution concerning to the case that the addition value is unable to be used for the succeeding output data.

Description

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

【0001】[0001]

【産業上の利用分野】本発明はループ状データ発生回路
に関し、例えば、デジタルシグナルプロセッサ(DS
P)のモジュールアドレス発生回路に適用し得るもので
ある。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a loop data generation circuit, for example, a digital signal processor (DS).
It can be applied to the module address generating circuit of P).

【0002】[0002]

【従来の技術】連続する所定範囲のアドレス値の中か
ら、所定個数ずつ異なるアドレスを順次発生するループ
状アドレス発生回路(モジュールアドレス発生回路)が
DSP等に設けられている。
2. Description of the Related Art A DSP or the like is provided with a loop-shaped address generation circuit (module address generation circuit) for sequentially generating a predetermined number of different addresses from a continuous predetermined range of address values.

【0003】図2は、従来のモジュールアドレス発生回
路の構成例を示すものである(文献『「ADSP−21
00/2100Aユーザーズ・マニュアル」ANALO
GDEVICES社発行』参照)。
FIG. 2 shows an example of the configuration of a conventional module address generation circuit (refer to the document "ADSP-21".
00 / 2100A User's Manual "ANALO
Issued by GDEVICES ").

【0004】図2において、このモジュールアドレス発
生回路300は、Lレジスタ301、Mレジスタ30
2、Iレジスタ303、加算器304及びモジュール回
路305から構成されている。
In FIG. 2, the module address generating circuit 300 includes an L register 301 and an M register 30.
2, I register 303, adder 304, and module circuit 305.

【0005】Lレジスタ301は、アドレス空間におい
てループ状に発生する出力アドレスが取り得る値の連続
範囲(以下、ループ範囲と呼ぶ)の大きさ(以下、ルー
プ幅と呼ぶ)より1だけ小さい、外部から与えられた値
を格納するものである。Mレジスタ302は、次のアド
レスを現在のアドレスよりループ範囲内だけで数えて何
個先のアドレスとするかを規定する外部から与えられた
オフセット(アドレス更新値)を格納するものである。
このオフセットは2の補数データで与えられており、こ
れにより正順及び逆順の両方向への出力アドレスのルー
プ状変化が可能となっている。Iレジスタ303は、出
力アドレスを格納するものであり、出力アドレスの初期
値は外部から与えられてこのIレジスタ303に格納さ
れる。加算器304は、Mレジスタ302に格納されて
いるオフセットとIレジスタ303に格納されている直
前アドレスとを加算するものである。モジュール回路3
05は、Lレジスタ301やMレジスタ302に格納さ
れている情報に基づいて、加算器304からの値をその
まま出力アドレスにできるか否かを確認し、できれば加
算値をIレジスタ303に出力し、できなければ加算値
を修正して次の出力アドレスを形成してIレジスタ30
3に出力するものである。
The L register 301 is smaller than the size (hereinafter, referred to as loop width) of the continuous range of values (hereinafter, referred to as loop range) that the output addresses generated in a loop form in the address space can take by one, and the external It stores the value given by. The M register 302 stores an offset (address update value) given from the outside that defines how many addresses the next address is to be counted from within the loop range from the current address.
This offset is given by 2's complement data, which allows a loop-like change of the output address in both forward and reverse directions. The I register 303 stores an output address, and the initial value of the output address is given from the outside and stored in the I register 303. The adder 304 adds the offset stored in the M register 302 and the immediately preceding address stored in the I register 303. Module circuit 3
05 confirms whether the value from the adder 304 can be directly used as an output address based on the information stored in the L register 301 or the M register 302, and if possible, outputs the added value to the I register 303, If not possible, the added value is modified to form the next output address and the I register 30
3 is output.

【0006】従って、以上の構成を有するモジュールア
ドレス発生回路300は、(1) 加算器304によってオ
フセットと直前アドレスを加算し、(2) モジュール回路
305が加算値を次の出力アドレスにできるか否かを確
認し、できる場合には加算値を次の出力アドレスとし、
できない場合には加算値から次の出力アドレスを形成
し、(3) このアドレスをIレジスタ303がラッチして
外部に出力する、という(1) 〜(3) の動作を繰返すこと
でループ状アドレスを順次発生する。
Therefore, the module address generating circuit 300 having the above configuration (1) adds the offset and the immediately preceding address by the adder 304, and (2) determines whether the module circuit 305 can use the added value as the next output address. Check if it is possible, and if possible, add the value to the next output address,
If not possible, the next output address is formed from the added value, and (3) this address is latched by the I register 303 and output to the outside. By repeating the operations of (1) to (3), the looped address is generated. Are sequentially generated.

【0007】次に、加算値をそのまま次の出力アドレス
とできない場合に行なうモジュール回路305の処理を
説明する。なお、従来回路の動作条件として、オフセッ
トがループ幅以下であるという条件があり、この条件下
ではモジュール回路305は、次の処理を行なう。な
お、処理(a) 及び(b) は処理(c) 及び(d) に対して優先
される。
Next, the processing of the module circuit 305 performed when the added value cannot be directly used as the next output address will be described. As an operating condition of the conventional circuit, there is a condition that the offset is equal to or less than the loop width, and under this condition, the module circuit 305 performs the following processing. Processes (a) and (b) have priority over processes (c) and (d).

【0008】(a) 加算器304の演算でキャリーが発生
した場合 加算器304の演算でキャリーが発生した場合には、次
の(1) 式を実行し、得られた値を次の出力アドレスとす
る。
(A) When a carry occurs in the operation of the adder 304 When a carry occurs in the operation of the adder 304, the following equation (1) is executed and the obtained value is used as the next output address. And

【0009】 (直前アドレス+オフセット)−ループ幅 =加算値−(Lレジスタの格納値+1) …(1) 図3は、この場合の説明図であり、ループ範囲がアドレ
ス0(2進数では0000;以下2進数を必要に応じて
括弧書きで併記する)からアドレス12(1100)ま
でであってループ幅が13(1101)であり、オフセ
ットが6(0110;2の補数データ)の場合を示して
いる。ここで、直前アドレスが11(1011)である
と、オフセットを足した加算値は17(10001)と
なってキャリーが発生する。この加算値は、ループ範囲
外のアドレス13、14、15も6個のオフセット中に
カウントしているため、得られた加算値17(アドレス
となる下位4ビットは0001)を出力アドレスとする
ことはできず、ループ範囲外のアドレス個数3(001
1)分をさらに加算することを要する。ここで、加算値
17にループ範囲外のアドレス個数を加算することは、
ループ範囲とループ範囲外とでアドレス空間が形成され
ているので、加算値17からループ幅13を減算するこ
とと等価であり、従って、上記(1) 式によって出力アド
レスを計算でき、図3の例の場合には出力アドレスは4
(0100)となる。
(Previous Address + Offset) -Loop Width = Additional Value- (L Register Storage Value + 1) (1) FIG. 3 is an explanatory diagram of this case, in which the loop range is address 0 (binary number 0000). A binary number is written in parentheses if necessary) to an address 12 (1100), a loop width is 13 (1101), and an offset is 6 (0110; two's complement data). ing. Here, when the immediately preceding address is 11 (1011), the added value obtained by adding the offsets is 17 (10001), and a carry occurs. Since this added value is also counted in the six offsets for the addresses 13, 14, and 15 outside the loop range, the obtained added value 17 (the lower 4 bits of the address is 0001) should be the output address. Cannot be performed, and the number of addresses outside the loop range is 3 (001
1) It is necessary to add minutes. Here, adding the number of addresses outside the loop range to the addition value 17 is
Since the address space is formed between the loop range and the outside of the loop range, it is equivalent to subtracting the loop width 13 from the addition value 17, and therefore the output address can be calculated by the above equation (1), In the case of the example, the output address is 4
(0100).

【0010】(b) 加算器304の演算でボローが発生し
た場合 加算器304の演算でボローが発生した場合には、次の
(2) 式を実行し、得られた値を出力アドレスとする。
(B) When a borrow occurs in the operation of the adder 304 When a borrow occurs in the operation of the adder 304,
Execute equation (2) and use the obtained value as the output address.

【0011】 (直前アドレス+オフセット)+ループ幅 =加算値+(Lレジスタの格納値+1) …(2) 図4は、この場合の説明図であり、ループ範囲がアドレ
ス0(0000)からアドレス12(1100)までで
あってループ幅が13(1101)であり、オフセット
が−7(1001;2の補数データ)の場合を示してい
る。ここで、直前アドレスが1(0001)であると、
オフセットを足した加算値は−6(1010)となって
ボローが発生する。この加算値は、ループ範囲外のアド
レス−1、−2、−3も6個のオフセット中にカウント
しているため、得られた加算値−6を出力アドレスとす
ることはできず、ループ範囲外のアドレス個数3(00
11)分をさらに減算することを要する。ここで、加算
値−6からループ範囲外のアドレス個数を減算すること
は、ループ範囲とループ範囲外とでアドレス空間が形成
されているので、加算値−6にループ幅13を加算する
ことと等価であり、従って、上記(2) 式によって出力ア
ドレスを計算でき、図4の例の場合には出力アドレスは
7(0111)となる。
(Previous address + offset) + loop width = added value + (stored value in L register + 1) (2) FIG. 4 is an explanatory diagram of this case, in which the loop range is from address 0 (0000) to address It shows a case in which the loop width is up to 12 (1100), the loop width is 13 (1101), and the offset is -7 (1001; 2's complement data). Here, if the immediately preceding address is 1 (0001),
The added value obtained by adding the offset becomes -6 (1010), and a borrow occurs. This added value cannot be used as the output address because the added value -6 obtained cannot be used as the output address because the addresses -1, -2, and -3 outside the loop range are also counted in the six offsets. Number of outside addresses 3 (00
11) Requires further subtraction of minutes. Here, subtracting the number of addresses outside the loop range from the addition value -6 means adding the loop width 13 to the addition value -6 because the address space is formed between the loop range and the outside of the loop range. Therefore, the output address can be calculated by the above equation (2), and in the case of the example of FIG. 4, the output address is 7 (0111).

【0012】(c) 加算器304からの加算値がループ範
囲外の値の場合(正順ループ) 直前アドレスに正のオフセットを加算して得た加算値が
ループ範囲外の値になった場合には、次の(3) 式を実行
し、得られた値を出力アドレスとする。
(C) When the added value from the adder 304 is outside the loop range (forward loop) When the added value obtained by adding a positive offset to the immediately preceding address is outside the loop range For this, execute the following equation (3) and use the obtained value as the output address.

【0013】 (直前アドレス+オフセット)−ループ幅 =加算値−(Lレジスタの格納値+1) …(3) 図5は、この場合の説明図であり、ループ範囲がアドレ
ス0(0000)からアドレス12(1100)までで
あってループ幅が13(1101)であり、オフセット
が4(0100;2の補数データ)の場合を示してい
る。ここで、直前アドレスが10(1010)である
と、オフセットを足した加算値は14(1110)とな
ってループ範囲外の値が発生する。この加算値はループ
回転方向に数えてループ範囲外の2番目の値であり、こ
れをループ範囲内の値に戻す場合、ループ範囲内の先頭
アドレス0(0000)を1番目とした2番目のアドレ
ス1(0001)に戻せば良い。すなわち、ループ範囲
外の何番目の値かを求め、それより1小さい値を出力ア
ドレスとする。ループ範囲外の何番目の値かは、加算値
からループ範囲内の最大値(ループ幅−1)を減算すれ
ば良く、最終的な出力アドレスはこれより1小さいの
で、結局(3) 式に従って正確な出力アドレスを得ること
ができ、図5の例の場合には出力アドレスは1(000
1)となる。
(Previous Address + Offset) -Loop Width = Additional Value- (Stored Value in L Register + 1) (3) FIG. 5 is an explanatory diagram of this case, where the loop range is from address 0 (0000) to address It shows a case in which the loop width is up to 12 (1100), the loop width is 13 (1101), and the offset is 4 (0100; 2's complement data). Here, when the immediately preceding address is 10 (1010), the added value obtained by adding the offsets is 14 (1110), and a value outside the loop range occurs. This added value is the second value outside the loop range counted in the loop rotation direction, and when returning this to the value within the loop range, the second address with the first address 0 (0000) in the loop range as the first value It is sufficient to return to address 1 (0001). That is, the number of the value outside the loop range is obtained, and the value smaller by 1 is used as the output address. To determine the number outside the loop range, subtract the maximum value within the loop range (loop width -1) from the added value, and the final output address will be one less than this, so according to equation (3), An accurate output address can be obtained, and in the case of the example of FIG. 5, the output address is 1 (000
1).

【0014】(d) 加算器304からの加算値がループ範
囲外の値の場合(逆順ループ) 直前アドレスに負のオフセットを加算して得た加算値が
ループ範囲外の値になった場合には、次の(4) 式を実行
し、得られた値を出力アドレスとする。
(D) When the added value from the adder 304 is outside the loop range (reverse order loop) When the added value obtained by adding a negative offset to the immediately preceding address is outside the loop range Executes the following equation (4) and uses the obtained value as the output address.

【0015】 (直前アドレス+オフセット)+ループ幅 =加算値+(Lレジスタの格納値+1) …(4) 図6は、この場合の説明図であり、ループ範囲がアドレ
ス0(0000)からアドレス12(1100)までで
あってループ幅が13(1101)であり、オフセット
が−3(1101;2の補数データ)の場合を示してい
る。ここで、直前アドレスが1(0001)であると、
オフセットを足した加算値は−2(1110)となって
ループ範囲外の値である。この加算値はループ回転方向
に数えてループ範囲外の2番目の値であり、これをルー
プ範囲内の値に戻す場合、ループ範囲内の回転方向の先
頭アドレス−4(1100)から2番目のアドレス−5
(1011)に戻せば良い。すなわち、ループ範囲外の
何番目の値かを求め、それより1小さい値を出力アドレ
スとする。詳述は省略するが、これは(4) 式に従って演
算することとなり、図6の例の場合には出力アドレスは
−5=11(1011)となる。
(Previous address + offset) + loop width = added value + (stored value in L register + 1) (4) FIG. 6 is an explanatory diagram of this case, in which the loop range is from address 0 (0000) to address It shows a case where the loop width is up to 12 (1100), the loop width is 13 (1101), and the offset is -3 (1101; 2's complement data). Here, if the immediately preceding address is 1 (0001),
The added value obtained by adding the offsets is -2 (1110), which is a value outside the loop range. This added value is the second value outside the loop range when counted in the loop rotation direction, and when returning to the value within the loop range, the second value from the start address-4 (1100) in the rotation direction within the loop range Address-5
It is sufficient to return to (1011). That is, the number of the value outside the loop range is obtained, and the value smaller by 1 is used as the output address. Although detailed description is omitted, this is calculated according to the equation (4), and in the case of the example of FIG. 6, the output address is −5 = 11 (1011).

【0016】[0016]

【発明が解決しようとする課題】しかしながら、従来の
ループ状アドレス発生回路(モジュールアドレス発生回
路)においては、モジュール回路305は、加算器30
4からの出力(加算値、キャリー、ボロー)、Lレジス
タ301の格納内容(ループ幅−1)、Mレジスタ30
2の格納内容(オフセット)に基づいて、加算値をその
まま出力アドレスとできるか否かを判断すると共に、で
きない場合には上記(a) 〜(d) のいずれの場合に該当す
るかをに判別してそれに応じた処理を実行するので、モ
ジュール回路305の規模が大きくなってしまうという
欠点があった。
However, in the conventional loop-shaped address generation circuit (module address generation circuit), the module circuit 305 includes the adder 30.
4 output (addition value, carry, borrow), stored contents of L register 301 (loop width-1), M register 30
Based on the stored contents (offset) of No. 2, it is judged whether the added value can be used as the output address as it is, and when it cannot be judged, it is judged which of the cases (a) to (d) is applicable. Then, the processing corresponding thereto is executed, so that there is a drawback that the scale of the module circuit 305 becomes large.

【0017】また、同様な理由によって、モジュール回
路305による演算時間が長くなって、アドレスの更新
周期も長くなってしまうという欠点があった。
Further, for the same reason, there is a drawback that the calculation time by the module circuit 305 becomes long and the address update cycle also becomes long.

【0018】さらに、加算器304及びモジュール回路
305間が加算値についてアドレス幅と同じビット幅で
接続されていると、上述の処理(a) の場合のように、加
算器304の演算でオーバーフローが発生したときに、
加算器304の正常な演算結果をモジュール回路305
に与えることができず、上記(1) 式を正しく実行するこ
とができなくなる。これを防止しようとすると、加算器
304及びモジュール回路305間を加算値については
アドレス幅より1ビット多い幅で接続しなければなら
ず、キャリー線やボロー線まで含めれる接続線が多くな
り、それだけ回路規模が大きくなってしまう。
Further, when the adder 304 and the module circuit 305 are connected with the same bit width as the address width for the added value, overflow occurs in the operation of the adder 304 as in the case of the above process (a). When it occurs,
The normal operation result of the adder 304 is calculated by the module circuit 305.
Therefore, the above equation (1) cannot be executed correctly. To prevent this, it is necessary to connect the adder 304 and the module circuit 305 with a width that is one bit larger than the address width for the added value, which increases the number of connection lines including the carry line and borrow line. The circuit scale becomes large.

【0019】以上、アドレスをループ状に発生する従来
回路における問題を述べたが、一般的なデータ(アドレ
ス以外のデータをいう)をループ状に発生する回路も、
上述した従来回路と同様な構成を有するので、同様な問
題が生じる。
The problem in the conventional circuit for generating addresses in a loop has been described above, but a circuit for generating general data (data other than addresses) in a loop also
Since it has the same configuration as the above-mentioned conventional circuit, the same problem occurs.

【0020】本発明は、以上の点を考慮してなされたも
のであり、回路規模が小さい、しかも、ループ状データ
(それがアドレスとして用いられる場合を含む)を高速
に発生することができるループ状データ発生回路を提供
しようとするものである。
The present invention has been made in consideration of the above points, and has a small circuit scale and can generate loop-shaped data (including the case where it is used as an address) at high speed. It is intended to provide a state data generation circuit.

【0021】[0021]

【課題を解決するための手段】かかる課題を解決するた
め、本発明においては、データ空間の中で出力データを
ループ状に順次発生するループ範囲の幅を表すループ幅
の情報(ループ幅自体であっても良く、またループ幅に
所定数を加減算したものであっても良い)と、ループ状
データの初期値と、相前後する出力データ間のループ範
囲内での相違量を表すオフセットとが設定されて、ルー
プ範囲内でオフセットずつ異なるデータを順次出力する
ものであって、現在の出力データにオフセットを加算す
る加算器と、この加算器による加算値を次の出力データ
にできるか否かを確認してできない場合に加算値を修正
して次の出力データを形成するモジュール回路とを備え
たループ状データ発生回路において、以下の条件を課す
と共に、以下の各手段を設けた。
In order to solve such a problem, according to the present invention, loop width information (the loop width itself represents the width of a loop range in which output data is sequentially generated in a loop in a data space). May be present, or may be a value obtained by adding or subtracting a predetermined number to the loop width), the initial value of the loop data, and an offset representing the amount of difference in the loop range between successive output data. It is set to sequentially output different data for each offset within the loop range, and whether the adder that adds the offset to the current output data and the value added by this adder can be the next output data In the loop-shaped data generation circuit including a module circuit that corrects the added value and forms the next output data when it cannot be confirmed that It provided the stage.

【0022】すなわち、設定可能なループ幅がデータ空
間の大きさの半分以下という条件と、設定可能なオフセ
ットの絶対値がループ幅以下という条件を課した。
That is, the condition that the settable loop width is half the size of the data space or less and the condition that the absolute value of the settable offset is the loop width or less are imposed.

【0023】また、モジュール回路の内部に、加算値を
次の出力データにできない場合に対応する構成として、
加算値がループ範囲外の値になっていることを検出する
範囲内外検出手段と、加算値がループ範囲外の値の場合
に、加算値がループ方向にみてループ範囲外の何番目の
値かに応じて加算値を修正して出力データを形成する加
算値修正手段とを設けた。
In addition, as a structure corresponding to the case where the added value cannot be the next output data, inside the module circuit,
A range inside / outside detection means for detecting that the added value is outside the loop range, and if the added value is outside the loop range, what number value is outside the loop range when viewed in the loop direction? And an addition value correction means for correcting the addition value according to the above to form output data.

【0024】ここで、オフセットを2の補数データで設
定することとし、出力データのループ方向が正逆いずれ
であっても対応することが好ましい。
Here, it is preferable that the offset is set by 2's complement data, and it corresponds to whether the loop direction of the output data is forward or reverse.

【0025】さらに、モジュール回路に、ループ範囲内
の全てのデータにおいて値が一致している上位ビット部
分のビット数と等しい、現在の出力データにおける上位
ビット部分の情報を含む上位情報データと、それより下
位ビット部分の情報を含む下位情報データとを形成する
現出力データ情報分離手段と、加算器又は加算値修正手
段から出力された次の出力データの下位情報データと現
出力データ情報分離手段から出力された上位情報データ
とから次の出力データを形成する上位下位合成手段とを
設けると共に、加算器、範囲内外検出手段及び加算値修
正手段が、現出力データ情報分離手段から出力された下
位情報データ又はこれから派生したデータにおいて有効
な下位ビット部分に対して処理を行なうようにすること
が好ましい。
Further, in the module circuit, upper information data including information of the upper bit portion in the current output data, which is equal to the number of bits of the upper bit portion whose values are the same in all the data in the loop range, and From the current output data information separating means for forming the lower information data including the information of the lower bit portion, the lower information data of the next output data output from the adder or the addition value correcting means, and the current output data information separating means. An upper order lower order synthesizing means for forming the next output data from the output upper order information data is provided, and the adder, the inside / outside range detecting means and the added value correcting means are provided with the lower order information output from the current output data information separating means. It is preferable to operate on the low-order bit portion that is effective in the data or the data derived therefrom.

【0026】[0026]

【作用】次の出力データを形成しようとすると、現出力
データにオフセットを加算することを要するが、データ
空間の一部にループ範囲が設定されることが多いので、
加算値をそのまま次の出力データとすることができる場
合の外、次の出力データにできない場合も生じる。次の
出力データにできない場合が生じることは避けることが
できないが、この場合の態様が多ければ加算値を修正し
て次の出力データを形成する構成は多くの態様を考慮し
た構成となるので複雑となり、その結果、出力データの
発生周期も長くならざるを得ない。
In order to form the next output data, it is necessary to add the offset to the current output data, but since the loop range is often set in a part of the data space,
In addition to the case where the added value can be directly used as the next output data, there are cases where it cannot be used as the next output data. It is unavoidable that the next output data cannot be generated. However, if there are many modes in this case, the structure for correcting the added value to form the next output data is complicated because many modes are taken into consideration. As a result, the generation cycle of output data must be extended.

【0027】そこで、本発明においては、設定可能なル
ープ幅がデータ空間の大きさの半分以下であるという条
件と、設定可能なオフセットの絶対値がループ幅以下で
あるという条件を課すこととし、加算値をそのまま次の
出力データとすることができない場合の態様を少なくす
ることとした。すなわち、加算値自体はループ範囲内の
値になるが、現出力データからループ範囲外のデータ個
数をも計数した加算値となっているような態様(図3や
図4参照)が生じることを排除している。従って、加算
値をそのまま次の出力データとすることができない場合
の態様は、加算値がループ範囲外の値になっているとき
だけである。
Therefore, in the present invention, the condition that the settable loop width is half the size of the data space or less and the condition that the absolute value of the settable offset is the loop width or less are imposed. It has been decided to reduce the number of cases in which the added value cannot be directly used as the next output data. That is, although the added value itself becomes a value within the loop range, a mode (see FIGS. 3 and 4) in which the added value is the added value obtained by counting the number of data items outside the loop range from the current output data may occur. Have been eliminated. Therefore, the case where the added value cannot be directly used as the next output data is only when the added value is outside the loop range.

【0028】そこで、本発明においては、モジュール回
路の内部に、加算値を次の出力データにできない場合に
対応する構成として上述した態様だけを考慮し、加算値
がループ範囲外の値になっていることを検出する範囲内
外検出手段と、加算値がループ範囲外の値の場合に、加
算値がループ方向にみてループ範囲外の何番目の値かに
応じて加算値を修正して次の出力データを形成する加算
値修正手段とを設け、構成の簡単化及び出力データの発
生周期の短縮化を計った。
In view of this, in the present invention, only the above-described mode is considered inside the module circuit as a structure corresponding to the case where the added value cannot be the next output data, and the added value becomes a value outside the loop range. If the added value is outside the loop range and the inside / outside detection means that detects that the added value is outside the loop range, the added value is corrected according to the number of the value outside the loop range when viewed in the loop direction. An addition value correction means for forming output data is provided to simplify the configuration and shorten the output data generation cycle.

【0029】本発明は、出力データのループ方向(ルー
プ範囲を円とみなしたした場合の出力データの回転方
向)が1方向だけのループ状データ発生回路に適用でき
るだけでなく、オフセットを2の補数データで設定する
こととすれば、出力データのループ方向が正逆いずれで
あっても対応でき、必要に応じてこのようにすることが
好ましい。
The present invention can be applied not only to a loop-shaped data generating circuit in which the loop direction of output data (the rotation direction of output data when the loop range is regarded as a circle) is only one direction, and the offset is a two's complement number. If the setting is made by data, it is possible to deal with whether the loop direction of the output data is forward or reverse, and it is preferable to do so if necessary.

【0030】ループ幅やオフセットや出力データの初期
値の設定によっては、順次発生される出力データで常に
変化しない上位ビット部分がある。このような固定の上
位ビット部分に対しても一々演算すると、演算ミスが発
生する確率を高くすると共に、処理速度を遅くする可能
性がある。
Depending on the setting of the loop width, the offset, and the initial value of the output data, there is a high-order bit portion that does not always change in the sequentially generated output data. If the fixed high-order bit portion is also calculated one by one, there is a possibility that a calculation error will occur and the processing speed will be slowed down.

【0031】そこで、このようなことを考慮した場合に
は、モジュール回路に、ループ範囲内の全てのデータに
おいて値が一致している上位ビット部分のビット数と等
しい、現在の出力データにおける上位ビット部分の情報
を含む上位情報データと、それより下位ビット部分の情
報を含む下位情報データとを形成する現出力データ情報
分離手段と、加算器又は加算値修正手段から出力された
次の出力データの下位情報データと現出力データ情報分
離手段から出力された上位情報データとから次の出力デ
ータを形成する上位下位合成手段とを設けると共に、加
算器、範囲内外検出手段及び加算値修正手段が、現出力
データ情報分離手段から出力された下位情報データ又は
これから派生したデータにおいて有効な下位ビット部分
に対して処理を行なうようにすることが好ましい。
Therefore, in consideration of such a case, the module circuit is arranged so that the upper bits in the current output data, which are equal to the number of bits in the upper bit portion whose values are the same in all the data within the loop range, are equal to each other. Current output data information separating means for forming upper information data including information of a portion and lower information data including information of a lower bit portion, and of the next output data output from the adder or the addition value correcting means. An upper order lower order synthesizing means for forming the next output data from the lower order information data and the higher order information data outputted from the current output data information separating means is provided, and the adder, the range inside / outside detecting means and the added value correcting means are Performs processing on the effective lower-order bit portion of the lower-order information data output from the output data information separation means or the data derived from this. It is preferable to Migihitsuji.

【0032】[0032]

【実施例】以下、本発明をループ状アドレス発生回路に
適用した一実施例を図面を参照しながら詳述する。ここ
で、図1がこの実施例の構成を示すブロック図である。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment in which the present invention is applied to a loop address generating circuit will be described in detail below with reference to the drawings. Here, FIG. 1 is a block diagram showing the configuration of this embodiment.

【0033】図1において、このループ状アドレス発生
回路(モジュールアドレス発生回路)100は、Lレジ
スタ101、Mレジスタ102、Iレジスタ103、加
算器104及びモジュール回路105から構成されてい
る。
In FIG. 1, the loop address generating circuit (module address generating circuit) 100 is composed of an L register 101, an M register 102, an I register 103, an adder 104 and a module circuit 105.

【0034】Lレジスタ101は、出力アドレスが取り
得るループ範囲のループ幅より1だけ小さい、外部から
与えられた値を格納するものである。Mレジスタ102
は、外部から与えられたオフセットを格納するものであ
り、このオフセットは2の補数データで与えられてい
る。これにより正順及び逆順の両方向へのアドレス変化
が可能となされている。Iレジスタ103は、出力アド
レスを格納するものである。なお、Iレジスタ103に
は、出力アドレスの初期値が外部から与えられるように
なされている。加算器104は、後述するような2入力
データを加算するものであり、次の出力アドレスの候補
値情報を形成するものである。モジュール回路105
は、ループ範囲やオフセット等を考慮して次の出力アド
レスを決定するものである。
The L register 101 stores a value given from the outside, which is smaller than the loop width of the loop range that the output address can take by one. M register 102
Stores an offset given from the outside, and this offset is given by 2's complement data. This makes it possible to change addresses in both forward and reverse directions. The I register 103 stores the output address. An initial value of the output address is externally given to the I register 103. The adder 104 adds two input data as will be described later and forms candidate value information of the next output address. Module circuit 105
Is for determining the next output address in consideration of the loop range, offset, and the like.

【0035】この実施例の場合、ループ幅及びオフセッ
トについて、次の条件が定められている。
In the case of this embodiment, the following conditions are defined for the loop width and the offset.

【0036】条件1 ループ幅≦[アドレス空間の最大値/2]+1 但し、[x]はガウスの記号(xの小数点以下を切捨
て)を表す条件2 オフセットの絶対値≦ループ幅 条件1は、換言すると設定可能なループ幅がアドレス空
間の大きさの半分以下という条件であり、条件2は、設
定可能なオフセットの絶対値がループ幅以下という条件
である。このような条件1及び2は、後述するように、
加算器104の加算演算でキャリーやボローが生じるこ
と(図3及び図4参照)がないようにしたものであり、
モジュール回路105が行なう処理態様を従来より少な
くするための条件である。これによりモジュール回路1
05の簡単化及びアドレス更新周期の短縮化を実現でき
る。
Condition 1 loop width ≤ [maximum value of address space / 2] +1 where [x] represents a Gaussian symbol (rounding down the decimal point of x) Condition 2 offset absolute value ≤ loop width Condition 1 In other words, the settable loop width is equal to or smaller than half the size of the address space, and the condition 2 is that the absolute value of the settable offset is equal to or smaller than the loop width. Such conditions 1 and 2 are, as described later,
This is to prevent carry or borrow from occurring in the addition operation of the adder 104 (see FIGS. 3 and 4).
This is a condition for reducing the number of processing modes performed by the module circuit 105 as compared with the conventional method. As a result, the module circuit 1
05 can be simplified and the address update cycle can be shortened.

【0037】因に、従来のループ状アドレス発生回路3
00におけるモジュール回路305においては、上述し
たようにモジュール回路305が加算結果に応じて切り
替える処理態様((a) 〜(d) )は4種類あったが、この
実施例の場合には2態様(図5及び図6参照)である。
Incidentally, the conventional loop-shaped address generation circuit 3
In the module circuit 305 of No. 00, there are four types of processing modes ((a) to (d)) that the module circuit 305 switches according to the addition result as described above, but in the case of this embodiment, two modes ( 5 and 6).

【0038】図7〜図9は、このような条件1及び2に
ついての意義の説明図である。これら図面は、アドレス
空間が4ビット幅の場合を示している。この場合、アド
レス空間の最大値は15(1111)であるので、条件
1によればループ幅は8以下であり、ループ幅を最大の
8とした場合には、そのループ幅(図7の斜線部分)は
図7に示すようにアドレス空間の半分の大きさとなる。
なお、図7の斜線部分以外の範囲をループ範囲とするこ
ともできる。このループ幅が最大の場合において(ルー
プ範囲外の幅が最小の場合において)、オフセットの絶
対値を最も大きくするとオフセットは8又は−8であ
る。図8は、オフセットが8であって直前出力アドレス
がループ範囲内で最も大きい値7(0111)の場合を
示しており、この場合に、直前出力アドレスにオフセッ
トを加算しても加算値はループ範囲外にあってループ範
囲外を通過してループ範囲内に進むことはない。すなわ
ち、従来の技術の項で説明した処理態様(a) が最も生じ
やすい状況を上記条件下で考えたとしても処理態様(a)
とはならない。図9は、従来の技術の項で説明した処理
態様(b) が最も生じやすい状況を上記条件下で考えた場
合であるが、この場合も処理態様(b) にはならない。
FIG. 7 to FIG. 9 are explanatory views of the meaning of the conditions 1 and 2 as described above. These drawings show the case where the address space has a 4-bit width. In this case, since the maximum value of the address space is 15 (1111), the loop width is 8 or less according to the condition 1, and when the maximum loop width is 8, the loop width (the diagonal line in FIG. (Portion) is half the size of the address space as shown in FIG.
The range other than the shaded area in FIG. 7 may be set as the loop range. When the loop width is maximum (when the width outside the loop range is minimum), the offset is 8 or -8 when the absolute value of the offset is maximized. FIG. 8 shows a case where the offset is 8 and the immediately previous output address is the largest value 7 (0111) in the loop range. It is outside the range and does not pass outside the loop range and into the loop range. That is, even if the processing mode (a) described in the section of the related art is most likely to occur under the above conditions, the processing mode (a)
Does not mean FIG. 9 shows a situation in which the processing mode (b) described in the section of the related art is most likely to occur under the above conditions, but in this case, the processing mode (b) is not the processing mode (b) either.

【0039】以上のように、上記条件下においては、従
来例で説明した処理態様(a) 及び(b) が生じることはな
く、モジュール回路105がこれら処理態様(a) 及び
(b) を考慮した構成とする必要はない。
As described above, under the above conditions, the processing modes (a) and (b) described in the conventional example do not occur, and the module circuit 105 allows the processing modes (a) and (b).
It is not necessary to consider the configuration in (b).

【0040】なお、条件1は、上述したように、ループ
幅がアドレス空間の半分以下であると言い換えることが
できるが、実際上、ループ幅がアドレス空間の半分を越
えることはなく、このような条件を設定しても問題とな
ることはない。
As described above, the condition 1 can be rephrased as being equal to or smaller than the half of the address space, but in reality, the loop width never exceeds half of the address space. Setting conditions does not pose a problem.

【0041】モジュール回路105は、マックス1検出
回路201、サブ加算器202、比較器203、2個の
アンド回路204及び205、オア回路206並びにセ
レクタ207から構成されている。
The module circuit 105 comprises a max 1 detection circuit 201, a sub-adder 202, a comparator 203, two AND circuits 204 and 205, an OR circuit 206 and a selector 207.

【0042】マックス1検出回路201は、Lレジスタ
101に格納されているループ幅情報(=ループ幅−
1)の論理が“1”であるビットの中で最も上位のビッ
トを検出するものであり、この検出結果に応じた2個の
マックス1検出データMax1(L)及びMax1(M) を形成す
る。マックス1検出データMax1(L) は、検出されたビッ
トを含めた下位側のビットを全て論理“1”にしたもの
であり、アンド回路205に入力される。他方のマック
ス1検出データMax1(M) は、マックス1検出データMax1
(L) の全ビットを反転したものであり、アンド回路20
4に入力される。これらマックス1検出データMax1(L)
及びMax1(M) は、出力アドレスで変化することがあるビ
ット位置(下位側)を明らかにしたものであり、逆に言
えば、出力アドレスで変化することがないビット位置
(上位側)を明らかにしたものである。
The maximum 1 detection circuit 201 has loop width information (= loop width−
The logic of 1) is to detect the most significant bit among the bits whose logic is "1", and form two pieces of Max1 detection data Max1 (L) and Max1 (M) according to this detection result. .. The max 1 detection data Max1 (L) is obtained by setting all the lower bits including the detected bit to logic “1” and is input to the AND circuit 205. The other Max1 detection data Max1 (M) is the Max1 detection data Max1.
It is an inversion of all bits of (L).
Input to 4. These Max1 detection data Max1 (L)
And Max1 (M) clarify the bit position (lower side) that may change with the output address. Conversely, the bit position that does not change with the output address (upper side) is clear. It is the one.

【0043】例えば、Lレジスタ101にデータ000
01100が格納されていると、マックス1検出データ
Max1(L) は00001111となり、他方のマックス1
検出データMax1(M) は11110000となる。
For example, data 000 is stored in the L register 101.
If 01100 is stored, Max 1 detection data
Max1 (L) becomes 00001111, and the other Max1
The detection data Max1 (M) becomes 11110,000.

【0044】アンド回路205は、Iレジスタ103に
格納されている現出力データとマックス1検出データMa
x1(L) とのビット毎の論理積をとるものである。従っ
て、このアンド回路205からの出力データは、変更さ
れることがあり得ない現出力アドレスの上位ビット側を
論理0に置き換えたものとなる。アンド回路204は、
Iレジスタ103に格納されている現出力アドレスとマ
ックス1検出データMax1(M) とのビット毎の論理積をと
るものである。従って、このアンド回路204からの出
力データは、変更されることがあり得る現出力データの
下位ビット側を論理0に置き換えたものとなる。
The AND circuit 205 receives the current output data and the max 1 detection data Ma stored in the I register 103.
It is the logical product of each bit with x1 (L). Therefore, the output data from the AND circuit 205 is obtained by replacing the high-order bit side of the current output address which cannot be changed with the logic 0. The AND circuit 204 is
It is a bit-wise logical product of the current output address stored in the I register 103 and the max 1 detection data Max1 (M). Therefore, the output data from the AND circuit 204 is the current output data, which may be changed, with the lower bit side replaced with the logic 0.

【0045】例えば、Lレジスタ101にデータ000
01100が格納され、Iレジスタ103にデータ01
101011が格納されていると、マックス1検出デー
タMax1(L) が00001111となるのでアンド回路2
05からの出力データは“00001011”となり、
また、他方のマックス1検出データMax1(M) が1111
0000となるのでアンド回路204からの出力データ
は01100000となる。
For example, data 000 is stored in the L register 101.
01100 is stored and data 01 is stored in the I register 103.
When 101011 is stored, the maximum 1 detection data Max1 (L) becomes 00001111, so the AND circuit 2
The output data from 05 becomes "00001011",
The other Max1 detection data Max1 (M) is 1111.
Therefore, the output data from the AND circuit 204 is 01100000.

【0046】アンド回路205からの出力データは加算
器104に与えられ、アンド回路204からの出力デー
タはオア回路206に与えられる。
The output data from the AND circuit 205 is given to the adder 104, and the output data from the AND circuit 204 is given to the OR circuit 206.

【0047】加算器104にはMレジスタ102に格納
されているオフセットも与えられるようになされてい
る。加算器104は、アンド回路05からの出力データ
にオフセットを加算して加算値を比較器203、サブ加
算器202及びセレクタ207に与える。なお、この実
施例の場合、ループ幅及びオフセットに対して上述した
条件を課しているので、ループ幅及びオフセットが条件
を満足する状態でどのように設定されても加算時にキャ
リーやボローが生じることはない。そのため、キャリー
やボローを他の回路に転送するための制御線は存在せ
ず、また、オーバーフローを考慮して加算値の出力線を
アドレス幅より1多くする必要もない。
The offset stored in the M register 102 is also given to the adder 104. The adder 104 adds an offset to the output data from the AND circuit 05 and gives the added value to the comparator 203, the sub adder 202, and the selector 207. In addition, in the case of this embodiment, since the above-mentioned conditions are imposed on the loop width and the offset, a carry or a borrow occurs at the time of addition regardless of how the loop width and the offset satisfy the conditions. There is no such thing. Therefore, there is no control line for transferring carry or borrow to another circuit, and it is not necessary to increase the output line of the added value by one more than the address width in consideration of overflow.

【0048】また、加算時にキャリーやボローが生じる
ことがないことは、従来例における態様(a) 及び(b) の
処理を必要とする機会が生じないことを意味する。
In addition, the fact that carry or borrow does not occur at the time of addition means that there is no opportunity to perform the processes of modes (a) and (b) in the conventional example.

【0049】比較器203には、Lレジスタ101に格
納されているデータ(=ループ幅−1)が与えられるよ
うになされている。比較器203は、加算値とLレジス
タ101の格納データとを大小比較し、加算値がLレジ
スタ101の格納データより大きいときに、セレクタ2
07にサブ加算器202からのサブ加算値を選択させ、
加算値がLレジスタ101の格納データ以下のときに、
セレクタ207に加算器104からの加算値を選択させ
る選択制御信号をセレクタ207に与える。この比較器
203による比較は、結局、加算器104からの加算値
がループ範囲内に属しているか否かを判断しているもの
である。
The data (= loop width-1) stored in the L register 101 is given to the comparator 203. The comparator 203 compares the added value with the data stored in the L register 101, and when the added value is larger than the data stored in the L register 101, the selector 2
07 to select the sub addition value from the sub adder 202,
When the added value is less than the data stored in the L register 101,
A selection control signal for causing the selector 207 to select the added value from the adder 104 is given to the selector 207. The comparison by the comparator 203 is, after all, to determine whether the added value from the adder 104 belongs to the loop range.

【0050】サブ加算器202は、加算器104からの
加算値がループ範囲外の場合に、その加算値をループ範
囲内の値に戻す演算を実行するものである。このサブ加
算器202には、加算器104からの加算値の外に、L
レジスタ101の格納データと、Mレジスタ102に格
納されているオフセットの最上位ビット(MSB)が与
えられている。
The sub-adder 202 executes an operation for returning the added value from the adder 104 to a value within the loop range when the added value is out of the loop range. This sub-adder 202 has the L value in addition to the addition value from the adder 104.
The data stored in the register 101 and the most significant bit (MSB) of the offset stored in the M register 102 are given.

【0051】加算器104からの加算値がループ範囲外
になった場合でも、上述した従来例の場合と同様にルー
プ方向によって、加算値をループ範囲内のデータに戻す
処理を変えなければならない。上述したように、オフセ
ットは2の補数データとして与えられているので、オフ
セットの最上位ビット(MSB)は、ループ方向を規定
するものになっており、そのため、加算器104からの
加算値がループ範囲外になった場合に戻す処理演算を実
行するサブ加算器202にオフセットの最上位ビット
(MSB)が与えられるようになっている。
Even when the added value from the adder 104 is out of the loop range, the process of returning the added value to the data within the loop range must be changed depending on the loop direction as in the case of the conventional example described above. As described above, since the offset is given as 2's complement data, the most significant bit (MSB) of the offset defines the loop direction. Therefore, the added value from the adder 104 is the loop. The most significant bit (MSB) of the offset is provided to the sub-adder 202 that executes the processing operation to return when the value is out of the range.

【0052】サブ加算器202は、オフセットの最上位
ビット(MSB)に応じて、次の(5) 式又は(6) 式のい
ずれかの演算を実行する。
The sub-adder 202 executes either of the following equations (5) or (6) according to the most significant bit (MSB) of the offset.

【0053】オフセットのMSB≧0の場合 加算器104からの加算値−(Lレジスタ101の格納データ+1) …(5) オフセットのMSB<0の場合 加算器104からの加算値+(Lレジスタ101の格納データ+1) …(6) なお、これら演算によって、加算値をループ範囲内の値
に戻せることの理由は、従来例の処理態様(c) 及び(d)
の場合の理由と同様であるので、その説明は省略する。
Offset MSB ≧ 0 : Added value from adder 104- (stored data in L register 101 + 1) (5) Offset MSB <0 : Added value from adder 104+ (L register 101 Stored data + 1) (6) The reason why the added value can be returned to the value within the loop range by these operations is that the processing modes (c) and (d) of the conventional example are used.
Since the reason is the same as that in the case of, the description thereof will be omitted.

【0054】例えば、サブ加算器202にフルアダー構
成の加算器を適用し、そのキャリー入力等を上手に利用
することで、(5) 式及び(6) 式が3項の演算であっても
実行することができる。すなわち、(5) 式及び(6) 式に
おける「1」部分の演算をそのための加算器によらずに
実行することができる。
For example, by applying a full adder-structured adder to the sub-adder 202 and making good use of its carry input, etc., even if the expressions (5) and (6) are the operations of the three terms, they are executed. can do. That is, the operation of the "1" part in the equations (5) and (6) can be executed without using the adder for that.

【0055】このような演算によって得られたサブ加算
値も、セレクタ207に与えられる。セレクタ207
は、比較器203からの選択制御信号に応じて、加算器
104からの加算値がループ範囲内のデータであるとき
にその加算値を選択し、加算器104からの加算値がル
ープ範囲外のデータであるときにサブ加算器202から
のサブ加算値を選択してオア回路206に与える。
The sub addition value obtained by such an operation is also given to the selector 207. Selector 207
Selects the addition value from the adder 104 when the addition value from the adder 104 is data within the loop range according to the selection control signal from the comparator 203, and the addition value from the adder 104 is outside the loop range. When it is data, the sub addition value from the sub adder 202 is selected and given to the OR circuit 206.

【0056】オア回路206は、セレクタ207によっ
て選択されたデータとアンド回路204からのデータと
のビット毎の論理和を得てこれを出力アドレスとしてI
レジスタ103に与える。ここで、アンド回路204か
らのデータは、上述したように、変更されることがあり
得る現出力アドレスの下位ビット側を論理0に置き換え
たものであって変更されることがない上位ビット側につ
いては現出力アドレスの論理値を維持しているので、オ
ア回路206からの出力は、上位ビット側については現
出力アドレス(アンド回路204の出力)の論理値を選
択し、下位ビット側についてはセレクタ207からのデ
ータの論理値を選択したものとなる。
The OR circuit 206 obtains a bitwise logical sum of the data selected by the selector 207 and the data from the AND circuit 204, and uses this as an output address.
It is given to the register 103. Here, as described above, the data from the AND circuit 204 is obtained by replacing the lower bit side of the current output address, which may be changed, with the logic 0, and the upper bit side which is not changed. Since the logical value of the current output address is maintained, the output from the OR circuit 206 selects the logical value of the current output address (output of the AND circuit 204) for the upper bit side and the selector for the lower bit side. The logical value of the data from 207 is selected.

【0057】Iレジスタ103は、与えられた新たな
(次の)出力アドレスをラッチして出力すると共に、さ
らに次の出力アドレスを形成させるためにアンド回路2
04及び205に与える。
The I register 103 latches and outputs the given new (next) output address, and at the same time, the AND circuit 2 forms the next output address.
Give to 04 and 205.

【0058】以上、この実施例によるモジュールアドレ
ス発生回路100の各部の機能を説明したが、上記説明
の流れは、出力アドレスがある値のときから次の出力ア
ドレスを形成するための一連の処理の流れにもなってい
る。
The function of each part of the module address generating circuit 100 according to this embodiment has been described above. The flow of the above description is based on a series of processes for forming the next output address when the output address has a certain value. It is also a flow.

【0059】図10は図1の各部データの真理値を示す
図表であり、図11は図10に係るアドレス空間をルー
プ状に示したものである。以下、これら図10及び図1
1に基づいて、上記実施例の動作例を説明する。なお、
数値については2進数を用いて説明する。
FIG. 10 is a table showing the truth value of each part data of FIG. 1, and FIG. 11 shows the address space according to FIG. 10 in a loop form. Hereinafter, these FIG. 10 and FIG.
Based on 1, the operation example of the above embodiment will be described. In addition,
Numerical values will be described using binary numbers.

【0060】図10及び図11は、アドレス幅が4ビッ
トであって、ループ幅として1000が指示され、オフ
セットとして0011が指示され、出力アドレスの初期
値として1000が指示された場合を示している。従っ
て、初期状態においては、図10の第1欄に記載のよう
に、Lレジスタ101、Mレジスタ102及びIレジス
タ103にはそれぞれ、0111、0011、1000
が格納される。なお、Lレジスタ101及びMレジスタ
102の格納値は、この条件下のアドレス発生が継続し
ている間だけ維持される。また、Lレジスタ101の格
納値0111が維持されるので、マックス1検出データ
Max1(L) 及びMax1(M) もそれぞれ、0111及び100
0に維持される。
FIGS. 10 and 11 show the case where the address width is 4 bits, the loop width is designated as 1000, the offset is designated as 0011, and the initial value of the output address is designated as 1000. .. Therefore, in the initial state, as described in the first column of FIG. 10, the L register 101, the M register 102, and the I register 103 are respectively 0111, 0011, and 1000.
Is stored. The values stored in the L register 101 and the M register 102 are maintained only while address generation continues under this condition. Further, since the value 0111 stored in the L register 101 is maintained, the maximum 1 detection data
Max1 (L) and Max1 (M) are also 0111 and 100, respectively.
It is maintained at 0.

【0061】Iレジスタ103に1000が格納されて
いるため、各アンド回路204、205の出力は100
0、0000となる。その結果、加算器104は000
0+0011の演算を行ない、0011を出力する。比
較器203は、加算値0011の方がLレジスタ101
の格納データ0111より小さいので、セレクタ207
に加算値0011を選択させる。オア回路206はアン
ド回路204からのデータ1000とセレクタ207か
らのデータ0011とのビット毎の論理和1011をI
レジスタ103に出力して格納させる。Iレジスタ10
3に格納されたデータ1011が2番目の出力アドレス
として送出される。
Since 1000 is stored in the I register 103, the output of each AND circuit 204, 205 is 100.
It becomes 0,0000. As a result, the adder 104
0 + 0011 is calculated and 0011 is output. In the comparator 203, the added value 0011 is the L register 101
Stored data 0111 is smaller than
Causes the addition value 0011 to be selected. The OR circuit 206 calculates the logical sum 1011 of each bit of the data 1000 from the AND circuit 204 and the data 0011 from the selector 207 by I
It is output to the register 103 and stored. I register 10
The data 1011 stored in No. 3 is transmitted as the second output address.

【0062】このようにしてIレジスタ103に101
1が格納されると、図10の第2欄に示すように、各ア
ンド回路204、205の出力は1000、0011と
なる。その結果、加算器104は0011+0011の
演算を行ない、0110を出力する。比較器203は、
加算値0110の方がLレジスタ101の格納データ0
111より小さいので、セレクタ207に加算値011
0を選択させる。オア回路206はアンド回路204か
らのデータ1000とセレクタ207からのデータ01
10とのビット毎の論理和1110をIレジスタ103
に出力して格納させる。Iレジスタ103に格納された
データ1110が3番目の出力アドレスとして送出され
る。
In this way, 101 is set in the I register 103.
When 1 is stored, the outputs of the AND circuits 204 and 205 are 1000 and 0011, respectively, as shown in the second column of FIG. As a result, the adder 104 calculates 0011 + 0011 and outputs 0110. The comparator 203 is
The added value 0110 is data 0 stored in the L register 101.
Since it is smaller than 111, the addition value 011 is added to the selector 207.
Select 0. The OR circuit 206 receives the data 1000 from the AND circuit 204 and the data 01 from the selector 207.
The bitwise OR 1110 with the I register 103
Output to and store. The data 1110 stored in the I register 103 is sent as the third output address.

【0063】このようにしてIレジスタ103に111
0が格納されると、図10の第3欄に示すように、各ア
ンド回路204、205の出力は1000、0110と
なる。その結果、加算器104は0110+0011の
演算を行ない、1001を出力する。比較器203は、
加算値1001の方がLレジスタ101の格納データ0
111より大きいので、セレクタ207にサブ加算器2
02からのデータを選択させる。ここで、サブ加算器2
02からのデータは、加算値1001からLレジスタ1
01の格納値0111に0001を加えた値1000を
減算するので0001となる。オア回路206はアンド
回路204からのデータ1000とセレクタ207から
のデータ0001とのビット毎の論理和1001をIレ
ジスタ103に出力して格納させる。Iレジスタ103
に格納されたデータ1001が4番目の出力アドレスと
して送出される。
In this way, the I register 103 has 111 bits.
When 0 is stored, the outputs of the AND circuits 204 and 205 become 1000 and 0110, respectively, as shown in the third column of FIG. As a result, the adder 104 calculates 0110 + 0011 and outputs 1001. The comparator 203 is
The added value 1001 is the stored data 0 of the L register 101.
Since it is larger than 111, the selector 207 has a sub-adder 2
Select data from 02. Where sub-adder 2
The data from 02 is added value 1001 to L register 1
Since the value 1000 obtained by adding 0001 to the stored value 0111 of 01 is subtracted, 0001 is obtained. The OR circuit 206 outputs a bitwise logical sum 1001 of the data 1000 from the AND circuit 204 and the data 0001 from the selector 207 to the I register 103 for storage. I register 103
The data 1001 stored in is transmitted as the fourth output address.

【0064】以下、同様な処理がLレジスタ101及び
Mレジスタ102の格納値が変更されるまで繰返され、
ループ状アドレスが順次出力される。
Hereinafter, similar processing is repeated until the values stored in the L register 101 and the M register 102 are changed,
Looped addresses are sequentially output.

【0065】従って、上記実施例によれば、ループ幅及
びオフセットに対して上述した条件1及び2を設定した
ので、加算器104の出力をそのまま利用できない態様
が従来より少ない2態様だけとなり、そのため、このよ
うな特殊な態様に応じる構成が従来より簡単になる。構
成が簡単になった結果、出力アドレス周期を短縮するこ
ともできる。
Therefore, according to the above embodiment, since the above conditions 1 and 2 are set for the loop width and the offset, there are only two modes in which the output of the adder 104 cannot be used as it is. The configuration according to such a special mode is simpler than the conventional one. As a result of the simple structure, the output address cycle can be shortened.

【0066】また、加算器104がオーバーフローする
ことがなく、また、キャリーやボローを出力することが
ないので、加算器104との接続線も従来より少なくな
り、この点からも構成を簡単なものとすることができ
る。
Further, since the adder 104 does not overflow and neither carry nor borrow is output, the number of connecting lines with the adder 104 is smaller than in the conventional case, and the configuration is simple in this respect as well. Can be

【0067】さらに、上記実施例によれば、ループ状の
出力アドレスとして論理値が変化することがある下位ビ
ット部分に対してのみ演算を行なうようにしたので、演
算ミスが発生する確率を低くすると共に、処理速度をこ
の点からも高めることができる。
Further, according to the above-described embodiment, since the operation is performed only on the lower bit portion where the logical value may change as the looped output address, the probability that an operation error will occur is reduced. At the same time, the processing speed can be increased also from this point.

【0068】なお、上記実施例においては、正逆どちら
の方向にも出力アドレスを変化させることができるもの
を示したが、一方向だけのループ状アドレス発生回路に
も本発明を適用することができる。
In the above embodiment, the output address can be changed in both forward and reverse directions, but the present invention can be applied to a loop-shaped address generation circuit in only one direction. it can.

【0069】また、上記実施例においては、ループ状の
出力アドレスとして論理値が変化することがある下位ビ
ット部分に対してのみ演算を行なうものを示したが、論
理値が変化しない上位ビット部分を含めた全体に対して
演算を行なうようにしても良い。
Further, in the above-mentioned embodiment, the operation is performed only on the lower bit portion whose logical value may change as the looped output address, but the upper bit portion whose logical value does not change is shown. The calculation may be performed on the whole including the data.

【0070】さらに、上記実施例においては、アドレス
をループ状に発生するものを示したが、アドレス以外の
一般的なデータをハードウェア的にループ状に発生する
ものに対しても本発明を適用することができる。なお、
特許請求の範囲における「出力データ」という用語にお
けるデータは、アドレス及びこれ以外のデータの双方を
含むものである。
Further, in the above embodiment, the address is generated in a loop, but the present invention is also applied to a general data other than the address is generated in a loop by hardware. can do. In addition,
The data in the term “output data” in the claims includes both address and other data.

【0071】さらにまた、上記実施例のIレジスタから
出力されたアドレスにループ範囲についてのオフセット
を加算するようにして、出力アドレスに係るループ範囲
の自由度を高めるようにしても良い。
Furthermore, the degree of freedom of the loop range related to the output address may be increased by adding the offset of the loop range to the address output from the I register of the above embodiment.

【0072】[0072]

【発明の効果】以上のように、本発明によれば、設定可
能なループ幅がデータ空間の大きさの半分以下という条
件と、設定可能なオフセットの絶対値がループ幅以下と
いう条件を課すと共に、モジュール回路の内部に、加算
値を次の出力データにできない場合に対応する構成とし
て、加算値がループ範囲外の値になっていることを検出
する範囲内外検出手段と、加算値がループ範囲外の値の
場合に、加算値がループ方向にみてループ範囲外の何番
目の値かに応じて加算値を修正して出力データを形成す
る加算値修正手段とを設けたので、回路規模が小さい、
しかも、ループ状データを高速に発生することができる
ループ状データ発生回路を実現できる。
As described above, according to the present invention, the condition that the settable loop width is half the size of the data space or less and the condition that the absolute value of the settable offset is the loop width or less are imposed. , Inside the module circuit, as a configuration corresponding to the case where the added value cannot be the next output data, the inside / outside detection means for detecting that the added value is outside the loop range, and the added value are in the loop range. In the case of an outside value, an addition value correction means for forming an output data by correcting the addition value according to the number value outside the loop range when the addition value is viewed in the loop direction is provided. small,
Moreover, it is possible to realize a loop data generation circuit that can generate loop data at high speed.

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

【図1】実施例の全体構成を示すブロック図である。FIG. 1 is a block diagram showing an overall configuration of an embodiment.

【図2】従来回路の全体構成を示すブロック図である。FIG. 2 is a block diagram showing an overall configuration of a conventional circuit.

【図3】従来回路の特殊処理態様の説明図(その1)で
ある。
FIG. 3 is an explanatory diagram (part 1) of a special processing mode of a conventional circuit.

【図4】従来回路の特殊処理態様の説明図(その2)で
ある。
FIG. 4 is an explanatory diagram (part 2) of the special processing mode of the conventional circuit.

【図5】従来回路の特殊処理態様の説明図(その3)で
ある。
FIG. 5 is an explanatory diagram (part 3) of the special processing mode of the conventional circuit.

【図6】従来回路の特殊処理態様の説明図(その4)で
ある。
FIG. 6 is an explanatory diagram (Part 4) of the special processing mode of the conventional circuit.

【図7】実施例の設定データに対する条件の意義説明図
(その1)である。
FIG. 7 is an explanatory view (1) of significance of conditions for setting data according to the embodiment.

【図8】実施例の設定データに対する条件の意義説明図
(その2)である。
FIG. 8 is a diagram (part 2) for explaining the significance of conditions for setting data according to the embodiment.

【図9】実施例の設定データに対する条件の意義説明図
(その3)である。
FIG. 9 is a diagram for explaining the meaning of conditions for setting data in the embodiment (No. 3).

【図10】実施例の動作例の各部データの真理値を示す
図表である。
FIG. 10 is a chart showing a truth value of each part data in the operation example of the embodiment.

【図11】図10に係る出力アドレス変化をループ状に
示す説明図である。
11 is an explanatory diagram showing a change in output address according to FIG. 10 in a loop shape.

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

100…ループ状アドレス発生回路(モジュールアドレ
ス発生回路)、101…Lレジスタ、102…Mレジス
タ、103…Iレジスタ、104…加算器、105…モ
ジュール回路、201…マックス1検出回路、202…
サブ加算器、203…比較器、204、205…アンド
回路、206…オア回路。
100 ... Loop address generation circuit (module address generation circuit), 101 ... L register, 102 ... M register, 103 ... I register, 104 ... Adder, 105 ... Module circuit, 201 ... Max1 detection circuit, 202 ...
Sub adder, 203 ... Comparator, 204, 205 ... AND circuit, 206 ... OR circuit.

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 データ空間の中でデータをループ状に順
次発生するループ範囲の幅を表すループ幅の情報と、ル
ープ状データの初期値と、相前後する出力データ間のル
ープ範囲内での相違量を表すオフセットとが設定され
て、ループ範囲内でオフセットずつ異なるデータを順次
出力するものであって、現在の出力データにオフセット
を加算する加算器と、この加算器による加算値を次の出
力データにできるか否かを確認してできない場合に加算
値を修正して次の出力データを形成するモジュール回路
とを備えたループ状データ発生回路において、 設定可能なループ幅がデータ空間の大きさの半分以下と
いう条件と、設定可能なオフセットの絶対値がループ幅
以下という条件を課すと共に、 上記モジュール回路が、 上記加算値を次の出力データにできない場合に対応する
構成として、 上記加算値がループ範囲外の値になっていることを検出
する範囲内外検出手段と、上記加算値がループ範囲外の
値の場合に、加算値がループ方向にみてループ範囲外の
何番目の値かに応じて加算値を修正して次の出力データ
を形成する加算値修正手段とを備えたことを特徴とする
ループ状データ発生回路。
1. A loop width information indicating a width of a loop range in which data is sequentially generated in a loop in a data space, an initial value of the loop data, and a loop range between consecutive output data. The offset representing the amount of difference is set to sequentially output data that differs by offset within the loop range. The adder that adds the offset to the current output data and the value added by this adder are In a loop data generation circuit that has a module circuit that corrects the added value and forms the next output data when it is not possible to confirm whether it can be output data or not, and the settable loop width is The condition that the absolute value of the offset that can be set is equal to or less than half, and the condition that the absolute value of the settable offset is equal to or less than the loop width is imposed. When the addition value is outside the loop range, the addition value is in the loop direction when the addition value is outside the loop range. In addition, the loop data generation circuit is provided with an addition value correction means for correcting the addition value according to the number of the value outside the loop range to form the next output data.
【請求項2】 上記オフセットを2の補数データで設定
し、出力データのループ方向が正逆いずれであっても対
応することを特徴とした請求項1に記載のループ状デー
タ発生回路。
2. The loop-shaped data generating circuit according to claim 1, wherein the offset is set by 2's complement data, and the output data can be processed in either forward or reverse loop directions.
【請求項3】 上記モジュール回路が、ループ範囲内の
全てのデータにおいて値が一致している上位ビット部分
のビット数と等しい、現在の出力データにおける上位ビ
ット部分の情報を含む上位情報データと、それより下位
ビット部分の情報を含む下位情報データとを形成する現
出力データ情報分離手段と、上記加算器又は上記加算値
修正手段から出力された次の出力データの下位情報デー
タと上記現出力データ情報分離手段から出力された上位
情報データとから次の出力データを形成する上位下位合
成手段とを備えると共に、 上記加算器、上記範囲内外検出手段及び上記加算値修正
手段が、上記現出力データ情報分離手段から出力された
下位情報データ又はこれから派生したデータにおいて有
効な下位ビット部分に対して処理を行なうことを特徴と
した請求項1又は2に記載のループ状データ発生回路。
3. The high-order information data, wherein the module circuit includes the information of the high-order bit portion in the current output data, which is equal to the number of bits of the high-order bit portion whose values match in all the data in the loop range, Current output data information separating means for forming lower information data including information of the lower bit portion, lower information data of the next output data output from the adder or the added value correcting means, and the current output data. The present output data information is provided with the upper and lower synthesizing means for forming the next output data from the upper information data output from the information separating means, and the adder, the range inside / outside detecting means and the addition value correcting means. Performing processing on a valid lower-order bit portion in lower-order information data output from the separating means or data derived therefrom. Loop data generator according to claim 1 or 2 characterized.
JP13848892A 1992-05-29 1992-05-29 Loop-like data generating circuit Pending JPH05334178A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP13848892A JPH05334178A (en) 1992-05-29 1992-05-29 Loop-like data generating circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP13848892A JPH05334178A (en) 1992-05-29 1992-05-29 Loop-like data generating circuit

Publications (1)

Publication Number Publication Date
JPH05334178A true JPH05334178A (en) 1993-12-17

Family

ID=15223275

Family Applications (1)

Application Number Title Priority Date Filing Date
JP13848892A Pending JPH05334178A (en) 1992-05-29 1992-05-29 Loop-like data generating circuit

Country Status (1)

Country Link
JP (1) JPH05334178A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2000033194A1 (en) * 1998-11-27 2000-06-08 Matsushita Electric Industrial Co., Ltd. Address generating device and moving vector detecting device
JP2008537620A (en) * 2005-03-21 2008-09-18 コーニンクレッカ フィリップス エレクトロニクス エヌ ヴィ Method for processing a data array in a serpentine scan order using a circular buffer memory

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2000033194A1 (en) * 1998-11-27 2000-06-08 Matsushita Electric Industrial Co., Ltd. Address generating device and moving vector detecting device
US6662288B1 (en) 1998-11-27 2003-12-09 Matsushita Electric Industrial Co., Ltd. Address generating apparatus and motion vector detector
JP2008537620A (en) * 2005-03-21 2008-09-18 コーニンクレッカ フィリップス エレクトロニクス エヌ ヴィ Method for processing a data array in a serpentine scan order using a circular buffer memory

Similar Documents

Publication Publication Date Title
US5043990A (en) Semiconductor integrated circuit device
US6049903A (en) Digital data error detection and correction system
US5936870A (en) Arithmetic operating device for digital signal processing and method therefor
US5957996A (en) Digital data comparator and microprocessor
JP2585649B2 (en) Division circuit
US5113362A (en) Integrated interpolator and method of operation
US5325321A (en) High speed parallel multiplication circuit having a reduced number of gate stages
US5574677A (en) Adaptive non-restoring integer divide apparatus with integrated overflow detect
US5376915A (en) Absolute value comparing apparatus for comparing absolute values of data at high speed
EP0431576A2 (en) BCH code decoder and method for decoding a BCH code
JPH05334178A (en) Loop-like data generating circuit
US4761757A (en) Carry-save-adder three binary dividing apparatus
JP2766133B2 (en) Parallel-serial data conversion circuit
JPH09222991A (en) Adding method and adder
US5146479A (en) Up/down counter for counting binary data stored in flip flops
US5031137A (en) Two input bit-serial multiplier
JP2991788B2 (en) Decoder
JP3260630B2 (en) Constant divider and constant division method
US5983250A (en) Arithmetic circuit for obtaining absolute-valued distance
JP3207997B2 (en) Data converter
JP2864598B2 (en) Digital arithmetic circuit
JP3281439B2 (en) Decoder and decoding method
JP3279243B2 (en) Digital comparator
US20010021989A1 (en) Parity checking device and method in data communication system
JP2834860B2 (en) Likelihood calculation method