JP3188042B2 - Table search device in digital computer - Google Patents

Table search device in digital computer

Info

Publication number
JP3188042B2
JP3188042B2 JP11999993A JP11999993A JP3188042B2 JP 3188042 B2 JP3188042 B2 JP 3188042B2 JP 11999993 A JP11999993 A JP 11999993A JP 11999993 A JP11999993 A JP 11999993A JP 3188042 B2 JP3188042 B2 JP 3188042B2
Authority
JP
Japan
Prior art keywords
data
address
register
stored
instruction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP11999993A
Other languages
Japanese (ja)
Other versions
JPH06332694A (en
Inventor
秀紀 大橋
高志 内野
隆 黒田
昭 吉田
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.)
Sanyo Electric Co Ltd
Original Assignee
Sanyo Electric 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 Sanyo Electric Co Ltd filed Critical Sanyo Electric Co Ltd
Priority to JP11999993A priority Critical patent/JP3188042B2/en
Publication of JPH06332694A publication Critical patent/JPH06332694A/en
Application granted granted Critical
Publication of JP3188042B2 publication Critical patent/JP3188042B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Executing Machine-Instructions (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Advance Control (AREA)

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明は、データメモリを有し、
そのデータメモリの内容を基に、処理を進めるディジタ
ル計算機に関し、特にそのデータメモリの内容からデー
タの最大値、最小値及びその値が格納されているアドレ
スを検索するテーブル検索装置に関するものである。
BACKGROUND OF THE INVENTION The present invention has a data memory,
The present invention relates to a digital computer that performs processing based on the contents of the data memory, and more particularly to a table search device that searches the contents of the data memory for the maximum and minimum values of data and the addresses where the values are stored.

【0002】[0002]

【従来の技術】半導体技術、マイクロプロセッサアーキ
テクチャなどの進歩により、プロセッサのメモリ空間を
プログラムメモリ空間とデータメモリ空間に分割し、命
令実行の高速化を図るハーバードアーキテクチャを採用
したRISCプロセッサ、ディジタルシグナルプロセッ
サ(DSP)などの実用化が進んでいる。
2. Description of the Related Art Due to advances in semiconductor technology and microprocessor architecture, RISC processors and digital signal processors employing a Harvard architecture which divides the memory space of a processor into a program memory space and a data memory space to increase the speed of instruction execution. (DSP) and the like are in practical use.

【0003】斯かるDSPで行う信号処理は、アナログ
部品による処理に比較して高精度処理が可能であり、ま
たパラメータの設定によりフィルタ特性などの任意の特
性が安定して均一に得られる。さらにDSPの使用によ
り、アナログ部品による構成に比べて部品の精度に起因
する微調整を行うことが不要であるなどの特徴を有して
おり、近年様々な分野で急速に普及が進んでいる。この
DSPの応用分野としては、音声信号処理、通信信号処
理、計測信号処理、画像信号処理、音響処理等のディジ
タル信号処理の幅広い分野において利用されている。
[0003] The signal processing performed by such a DSP can be performed with higher precision than the processing by analog parts, and arbitrary characteristics such as filter characteristics can be stably and uniformly obtained by setting parameters. Furthermore, the use of the DSP has such a feature that fine adjustment due to the accuracy of components is not required as compared with the configuration using analog components, and has been rapidly spreading in various fields in recent years. As an application field of this DSP, it is used in a wide range of digital signal processing such as audio signal processing, communication signal processing, measurement signal processing, image signal processing, and sound processing.

【0004】例えば、DSPで音声信号処理を行うに当
っては、あらかじめ決められた個数のデータの中から最
大値を求めて、その最大値を基準として、データの正規
化を一般的に行っており、その最大値を検索する場合に
は、データをデータレジスタに読み込みながら、夫々の
データの比較判定を行い、比較されたデータのうち大き
い方の値をアキュムレータに格納する命令を繰り返すこ
とにより、所望の最大値を得ていた。
For example, when performing audio signal processing in a DSP, a maximum value is obtained from a predetermined number of data, and the data is generally normalized based on the maximum value. In the case of searching for the maximum value, while reading the data into the data register, each data is compared and determined, and an instruction to store the larger value of the compared data in the accumulator is repeated, The desired maximum was obtained.

【0005】この比較判定は、DSPの内部に新たに読
み込まれたデータと、内部に蓄積されているデータの大
小関係の判定を行う比較器を設けることにより、実現さ
れている。
[0005] This comparison is realized by providing a comparator for judging the magnitude relationship between newly read data in the DSP and data stored in the DSP.

【0006】図4は、従来のディジタル計算機における
のテーブル検索装置の一実施例の概略構成図である。
FIG. 4 is a schematic block diagram of an embodiment of a table search apparatus in a conventional digital computer.

【0007】図4における1は次に実行するプログラム
のアドレスが格納されているプログラムカウンタ、2は
プログラムの命令コードなどが格納されているプログラ
ムメモリ、3はプログラムメモリ2に格納されている命
令コードを読み込み、解読するインストラクションレジ
スタ、4は演算に用いるデータが格納されているデータ
メモリ、5はデータメモリ4のアドレスを指定するアド
レスアロケーションユニット、6及び7はアドレスアロ
ケーションユニット5で生成するアドレスの基となるア
ドレスが格納されている第1及び第2のアドレスレジス
タ、8は演算に用いるデータが格納されるデータレジス
タ、9は後述の比較器10の比較判定結果に従って、デ
ータレジスタ8のデータを格納するアキュムレータ、1
0はデータレジスタ8の内容と、アキュムレータ9の内
容との比較を行い、その内容の大小関係を判定する比較
器、11はプログラムのル−プ回数が格納されるループ
カウンタ、12はループ終了アドレスが格納されている
ループアドレスレジスタ、13はプログラムカウンタ1
のアドレスとループアドレスレジスタ12のアドレスが
一致したか否かを判定するアドレス比較器、14はディ
ジタル計算機のクロックパルスとなるシステムクロック
である。
In FIG. 4, 1 is a program counter storing the address of a program to be executed next, 2 is a program memory storing instruction codes of the program, and 3 is an instruction code stored in the program memory 2. An instruction register that reads and decodes data, 4 is a data memory that stores data used for the operation, 5 is an address allocation unit that specifies an address of the data memory 4, and 6 and 7 are bases of addresses generated by the address allocation unit 5. First and second address registers storing addresses to be used, 8 is a data register for storing data used for calculation, 9 is data for storing data in the data register 8 in accordance with a comparison determination result of a comparator 10 described later. Accumulator, 1
0 is a comparator for comparing the contents of the data register 8 with the contents of the accumulator 9 to determine the magnitude relation between the contents, 11 is a loop counter for storing the number of loops of the program, and 12 is a loop end address. Is a loop address register storing the program counter 1
Is an address comparator for determining whether or not the address of the loop address register 12 matches the address of the loop address register 12, and a system clock 14 serving as a clock pulse of the digital computer.

【0008】次に、図5は比較判定命令を含んだプログ
ラムの一例であり、データメモリ4の100番地乃至1
03番地(図7参照)に格納されているデータの最大値
及びその最大値が格納されているアドレスを調べるプロ
グラムである。
Next, FIG. 5 shows an example of a program including a comparison judgment instruction.
This is a program for checking the maximum value of data stored at address 03 (see FIG. 7) and the address where the maximum value is stored.

【0009】図5におけるn−8、n−7、・・・・、n+
2、n+3はプログラムメモリ2のアドレスを、枠内は
プログラムを示しており、A0は第1のアドレスレジス
タ6、 A1は第2のアドレスレジスタ7、R0はデー
タレジスタ8、Accはアキュムレータ9を示してい
る。
In FIG. 5, n-8, n-7,..., N +
2, n + 3 indicates the address of the program memory 2, and the frame indicates the program. A0 indicates the first address register 6, A1 indicates the second address register 7, R0 indicates the data register 8, and Acc indicates the accumulator 9. ing.

【0010】また、load A0,100は第1のア
ドレスレジスタ6に定数<100>を格納する命令であ
ることを意味する機械語、load A1,200は第
2のアドレスレジスタ7に定数<200>を格納する命
令であることを意味する機械語、load Acc,0
はアキュムレータ9に0を格納する命令であることを意
味する機械語、move R0,(A0)は第1のアド
レスレジスタ6に格納されているアドレスが示すデータ
メモリ4の内容をデータレジスタに転送する命令である
ことを意味する機械語、do 4 n+2はdo命令の
次の命令、即ちn番地のプログラムからn+2番地に示
されるプログラムまでを4回繰り返す命令であることを
意味する機械語、cmpgs R0はアキュムレ−タ9
とデータレジスタ8の値を比較し、アキュムレータ9に
格納されているデータの値が大きい場合は、次の命令を
スキップし、アキュムレータ9に格納されているデータ
の値が小さい場合はデータレジスタ8の値をアキュムレ
ータ9に格納する命令であることを意味する機械語、m
ove (A1),A0は第1のアドレスレジスタ6の
内容を第2のアドレスレジスタ7に示されるアドレスに
格納する命令であることを意味する機械語、inr A
0;move R0,(A0)は第1のアドレスレジス
タ6の内容を1インクリメントするとともに、第1のア
ドレスレジスタ6に格納されているアドレスが示す内容
をデータレジスタ8に転送する命令であることを意味す
る機械語である。
Also, load A0,100 is a machine language meaning that it is an instruction for storing a constant <100> in the first address register 6, and load A1,200 is a constant <200> in the second address register 7. Load Acc, 0, which means that the instruction is an instruction for storing
Is a machine language meaning that it is an instruction to store 0 in the accumulator 9, and move R0, (A0) transfers the contents of the data memory 4 indicated by the address stored in the first address register 6 to the data register. A machine language that means an instruction, do 4 n + 2, is a machine language that means that the next instruction of the do instruction, that is, an instruction that repeats the program from the program at address n to the program at address n + 4 four times, cmpgs R0 Is the accumulator 9
And the value of the data register 8 are compared. If the value of the data stored in the accumulator 9 is large, the next instruction is skipped. If the value of the data stored in the accumulator 9 is small, A machine language that means an instruction to store a value in the accumulator 9, m
ove (A1), A0 is a machine language that means that an instruction to store the contents of the first address register 6 at the address indicated in the second address register 7 is inr A
0; move R0, (A0) is an instruction for incrementing the content of the first address register 6 by 1 and transferring the content indicated by the address stored in the first address register 6 to the data register 8. It is a machine language meaning.

【0011】図6は図5のプログラムのフローチャート
を示しており、S1においては、プログラムメモリ2の
n−7番地に格納されているデータ<100>が第1の
アドレスレジスタレジスタ6に読み込まれ、さらにS2
においては、プログラムメモリ2のn−5番地に格納さ
れているデータ<200>が第2のアドレスレジスタレ
ジスタ7に読み込まれる。S3においては、アキュムレ
ータ9にデータ<0>を設定する。S4においては、第
1のアドレスレジスタ6に格納されているアドレスが示
すデータメモリ4の内容をデータレジスタ8に格納す
る。S5においては、ループカウンタ11にループ回数
<4>とループアドレスレジスタにループ終了アドレス
<n+2>が読み込まれる。
FIG. 6 shows a flowchart of the program shown in FIG. 5. In S1, the data <100> stored at the address n-7 of the program memory 2 is read into the first address register 6; Further S2
, The data <200> stored at the address n-5 of the program memory 2 is read into the second address register 7. In S3, data <0> is set in the accumulator 9. In S4, the contents of the data memory 4 indicated by the address stored in the first address register 6 are stored in the data register 8. In S5, the loop counter 11 reads the loop count <4> and the loop address register reads the loop end address <n + 2>.

【0012】S6においては、データレジスタ8の内容
と、アキュムレータ9の内容を比較する。S7において
は、S6の比較結果に従って、値が大きい方のデータを
アキュムレータ9に格納するとともに、第1のアドレス
レジスタ6のアドレスを第2のアドレスレジスタ7によ
り生成されるアドレスに従ってデータメモリ4に転送す
る。S8においては、ループカウンタ11のループ回数
を1だけデクリメントし、第1のアドレスレジスタ6の
アドレス値を1だけインクリメントする。S9はループ
カウンタ11のループ回数が0になったか否かを判定
し、ループカウンタ11のループ回数が0でなければ、
S6に戻り、S6乃至S9を繰り返し、ループカウンタ
11のループ回数が0ならば、次の処理に移行する。
In S6, the contents of the data register 8 and the contents of the accumulator 9 are compared. In S7, the data having the larger value is stored in the accumulator 9 in accordance with the comparison result in S6, and the address of the first address register 6 is transferred to the data memory 4 in accordance with the address generated by the second address register 7. I do. In S8, the number of loops of the loop counter 11 is decremented by one, and the address value of the first address register 6 is incremented by one. In S9, it is determined whether or not the number of loops of the loop counter 11 has become 0, and if the number of loops of the loop counter 11 is not 0,
Returning to S6, S6 to S9 are repeated, and if the number of loops of the loop counter 11 is 0, the process proceeds to the next process.

【0013】図5に示すプログラムの流れを、図4及び
図6を参照して説明する。プログラムメモリ2のn−8
番地、n−6番地、n−4番地に格納されている命令が
実行されると、第1のアドレスレジスタ6には<100
>、第2のアドレスレジスタ7には<200>、アキュ
ムレータ9には<0>が格納される。データメモリ4の
100番地乃至103番地には、図7に示すようにデー
タが既に格納されているものとする(S1〜S3参
照)。
The flow of the program shown in FIG. 5 will be described with reference to FIGS. 4 and 6. N-8 of program memory 2
When the instructions stored at addresses, addresses n-6 and n-4 are executed, the first address register 6 stores <100
>, The second address register 7 stores <200>, and the accumulator 9 stores <0>. It is assumed that data is already stored at addresses 100 to 103 in the data memory 4 as shown in FIG. 7 (see S1 to S3).

【0014】n−2番地の命令move R0,(A
0)が実行されると、アドレスアロケーションユニット
5はデータメモリ4のアドレスを出力し、データメモリ
4のアドレスが確定し、そのアドレスの内容をデータバ
スを介してデータレジスタ8に格納する。従って、デー
タレジスタ8には、データメモリ4の100番地に格納
されているデータ<30>が読み込まれる(S4参
照)。
The instruction move R0, (A
When (0) is executed, the address allocation unit 5 outputs the address of the data memory 4, the address of the data memory 4 is determined, and the contents of the address are stored in the data register 8 via the data bus. Therefore, the data <30> stored at the address 100 of the data memory 4 is read into the data register 8 (see S4).

【0015】続いてn−1番地の命令do 4 n+2
が実行されると、ループカウンタ11にループ回数<4
>が、ループアドレスレジスタ12にループ終了アドレ
ス<n+2>が格納される(S5参照)。
Subsequently, an instruction do 4 n + 2 at address n−1
Is executed, the loop counter 11 stores the number of loops <4.
> Stores the loop end address <n + 2> in the loop address register 12 (see S5).

【0016】n+1番地の命令cmpgs R0が実行
されるとデータレジスタ8の内容<30>とアキュムレ
ータ9の内容<0>が比較され(S6参照)、データレ
ジスタ8の内容<30>が大きいので、アキュムレータ
9にデータレジスタ8の内容<30>を転送し、その
後、n+2番地の命令move (A1),A0を実行
する。第1のアドレスレジスタ6は<200>であり、
従ってデ−タメモリ4の200番地に第1のアドレスレ
ジスタ6の値である<100>が格納される(S7参
照)。
When the instruction cmpgs R0 at address n + 1 is executed, the content <30> of the data register 8 is compared with the content <0> of the accumulator 9 (see S6). Since the content <30> of the data register 8 is large, The contents <30> of the data register 8 are transferred to the accumulator 9, and thereafter, the instructions move (A1) and A0 at address n + 2 are executed. The first address register 6 is <200>,
Therefore, <100> which is the value of the first address register 6 is stored at address 200 of the data memory 4 (see S7).

【0017】次にn+3番地の命令inr A0;mo
ve R0,(A0)が実行され、第1のアドレスレジ
スタ6の値は<101>となり、データレジスタ8に
は、10が格納される。この命令が実行されると、ルー
プアドレスレジスタ12に格納されているアドレスとプ
ログラムカウンタ1の値が一致することがアドレス比較
器13で検出され(S8参照)、命令do 4 n+2
の次の命令cmpgsR0から再度実行するとともに、
ループカウンタ11のループ回数を1デクリメントし、
<3>とする(S9参照)。
Next, the instruction at address n + 3 inr A0; mo
ve R0, (A0) is executed, the value of the first address register 6 becomes <101>, and 10 is stored in the data register 8. When this instruction is executed, the address comparator 13 detects that the address stored in the loop address register 12 matches the value of the program counter 1 (see S8), and the instruction do 4 n + 2
Again from the next instruction cmpgsR0,
Decrement the loop count of the loop counter 11 by 1,
<3> (see S9).

【0018】n+1番地の命令cmpgs R0が実行
されるとデータレジスタ8の内容<10>とアキュムレ
ータ9の内容<0>が比較され、アキュムレータ9の内
容<30>が大きいので、n+3番地の命令inr A
0;move R0,(A0)が実行される。
When the instruction cmpgs R0 at address n + 1 is executed, the contents <10> of the data register 8 and the contents <0> of the accumulator 9 are compared. Since the contents <30> of the accumulator 9 are large, the instruction inr at address n + 3 is obtained. A
0; move R0, (A0) is executed.

【0019】以下同様にループカウンタ11のループ回
数が0となるまで繰り返される。
Thereafter, the same process is repeated until the number of loops of the loop counter 11 becomes zero.

【0020】以上の動作により、アキュムレータ9に
は、データメモリ4の100番地乃至103番地の内容
の最大値である<100>が格納され、データメモリ4
の200番地には、前記最大値が格納されているデータ
メモリ4のアドレス値<102>が格納される。
By the above operation, the accumulator 9 stores <100>, which is the maximum value of the contents of addresses 100 to 103 of the data memory 4, and
At address 200, the address value <102> of the data memory 4 in which the maximum value is stored is stored.

【0021】[0021]

【発明が解決しようとする課題】上述のようにディジタ
ル計算機においては、データメモリに格納されているデ
ータから最大値、或るいは最小値を検索するために比較
判定命令を用いていた。例えば、最大値を検索する場合
にはデータをデータレジスタに読み込みながら、比較判
定を行い、最大値をアキュムレータに格納する命令を繰
り返すことにより、所望の最大値を得ていた。しかしな
がら、このような演算を行う場合には、最大値ととも
に、最大値が格納されているデータメモリのアドレスを
情報として、以降の演算で用いることがしばしば起こっ
てくる。このような場合には、従来例に開示するよう
に、大小判定を行った後に、新たな最大値を得た場合に
は、そのアドレスを別のエリアに格納する命令を実行す
ることにより、最大値を与えるアドレスを記憶してい
た。従って、最大値が変わるたびに、最大値を与えるア
ドレスを別のエリアに格納する命令を実行する必要が生
じ、演算時間の高速化の妨げとなっていた。特に、パイ
プライン処理を前提とするDSPにおいては、比較器に
格納されているデータのアドレスと、アドレスレジスタ
に格納されているアドレスが異なるため、再度アドレス
計算を行ってアドレスを格納する必要があり、処理のオ
ーバーヘッドが生じていた。
As described above, in a digital computer, a comparison / judgment instruction is used to search for a maximum value or a minimum value from data stored in a data memory. For example, when searching for the maximum value, a comparison determination is made while reading data into the data register, and a command for storing the maximum value in the accumulator is repeated to obtain a desired maximum value. However, when such an operation is performed, the address of the data memory in which the maximum value is stored together with the maximum value is often used as information in subsequent operations. In such a case, as disclosed in the conventional example, when a new maximum value is obtained after performing a magnitude determination, an instruction to store the address in another area is executed, thereby obtaining the maximum value. The address giving the value was stored. Therefore, every time the maximum value changes, it is necessary to execute an instruction to store the address giving the maximum value in another area, which has hindered an increase in the operation time. In particular, in a DSP premised on pipeline processing, since the address of data stored in the comparator and the address stored in the address register are different, it is necessary to calculate the address again and store the address. , Processing overhead has arisen.

【0022】そこで、本発明は前述の問題点に鑑み成さ
れたものであり、ハードウエアにより、比較器で検出さ
れた最大値、或るいは最小値が格納されているメモリの
アドレスを蓄積することを可能とするテーブル検索装置
を提供することを目的とする。
Therefore, the present invention has been made in view of the above-mentioned problem, and accumulates, by hardware, an address of a memory in which a maximum value or a minimum value detected by a comparator is stored. It is an object of the present invention to provide a table search device capable of performing a search.

【0023】[0023]

【課題を解決するための手段】前記問題点を解決するた
めに、本発明のテーブル検索装置は、データが格納され
ているデータメモリと、データメモリのアドレスを生成
するアドレスアロケーションユニットと、アドレスアロ
ケーションユニットで生成されるアドレスの基となるア
ドレスが格納されているアドレスレジスタと、データメ
モリのデータが格納されるデータレジスタと、所望の最
大値、或るいは最小値が格納されているアキュムレータ
と、データレジスタに格納されているデータとアキュム
レータに格納されているデータとの大小関係を比較する
比較器と、アドレスアロケ−ションユニットの出力を蓄
えるテーブルレジスタと、比較器の演算結果に応じて発
生するテーブルレジスタ書き込み信号と、を備えること
により、比較器において、行われた比較結果がデータレ
ジスタの値をアキュムレータに格納することを示す場合
は、テーブルレジスタ書き込み信号を発生し、その信号
に従ってテーブルレジスタにアキュムレータに記憶され
たデータが格納されているデータメモリのアドレスを書
き込む機能を有する。
In order to solve the above-mentioned problems, a table retrieval apparatus of the present invention comprises a data memory storing data, an address allocation unit for generating an address of the data memory, an address allocation. An address register storing an address that is a basis of an address generated by the unit, a data register storing data of a data memory, an accumulator storing a desired maximum value or a minimum value, A comparator is provided for comparing the magnitude relationship between the data stored in the data register and the data stored in the accumulator, a table register for storing the output of the address allocation unit, and a signal generated according to the operation result of the comparator. And a table register write signal. When the result of the comparison indicates that the value of the data register is stored in the accumulator, a table register write signal is generated, and the data stored in the accumulator is stored in the table register according to the signal. Has the function of writing the address of

【0024】[0024]

【作用】上述の手段によれば、アドレスアロケ−ション
ユニットの出力であるデータメモリのアドレスを、シス
テムクロックに同期してテーブルレジスタに順次格納す
るとともに、比較命令実行時には、データレジスタに格
納されているデータと、アキュムレータに格納されてい
るデータとの比較判定を行うことにより、データレジス
タに格納されているデータを新たにアキュムレータに書
き込む場合には、前記テーブルレジスタの値を前記デー
タが格納されていたデータメモリのアドレスに新たに書
き替えることにより保存する。
According to the above means, the address of the data memory, which is the output of the address allocation unit, is sequentially stored in the table register in synchronization with the system clock, and is stored in the data register when the comparison instruction is executed. When the data stored in the data register is newly written to the accumulator by comparing and comparing the stored data with the data stored in the accumulator, the value of the table register is stored in the data stored in the accumulator. It is saved by newly rewriting the address of the data memory.

【0025】[0025]

【実施例】図1は本発明のテーブル検索装置を備えたデ
ィジタル計算機の一実施例の概略構成図を示す。
FIG. 1 is a schematic block diagram showing an embodiment of a digital computer provided with a table search apparatus according to the present invention.

【0026】図1において、従来例に示す図4と同一機
能を有するものについては、同一番号を付し、その説明
は省略する。
In FIG. 1, components having the same functions as those of the conventional example shown in FIG. 4 are denoted by the same reference numerals, and description thereof will be omitted.

【0027】本発明が従来例と異なる点は、テーブルレ
ジスタ15及びテーブルレジスタ書き込み信号16を備
えたことであり、該テーブルレジスタ15は、複数のバ
ッファにより構成される。例えば、演算の実行が3段の
パイプライン処理で行われる場合には、テーブルレジス
タ15は3段のバッファ構成となる。テーブルレジスタ
書き込み信号16は、比較器10における比較判定の結
果、データレジスタ8の値が所望の値の場合には、該デ
ータレジスタ8のデータが格納されているデータメモリ
4のアドレスを格納するための信号である。また、テー
ブルレジスタ15の第1のバッファ15a及び第2のバ
ッファ15bは、システムクロック14に同期して更新
され、第3のバッファ15cは、比較器10の演算結果
によるテーブルレジスタ書き込み信号16に応じて書き
替えられるものである。
The present invention is different from the conventional example in that it has a table register 15 and a table register write signal 16, and the table register 15 is composed of a plurality of buffers. For example, when the execution of the operation is performed by three-stage pipeline processing, the table register 15 has a three-stage buffer configuration. The table register write signal 16 is used to store the address of the data memory 4 where the data of the data register 8 is stored when the value of the data register 8 is a desired value as a result of the comparison judgment in the comparator 10. Signal. The first buffer 15a and the second buffer 15b of the table register 15 are updated in synchronization with the system clock 14, and the third buffer 15c responds to the table register write signal 16 based on the operation result of the comparator 10. It can be rewritten.

【0028】図2は本発明のテーブル検索装置を備えた
ディジタル計算機のプログラムの一例を示している。n
−4、n−3、・・・・、n+2はアドレスを、枠内はプロ
グラムを示している。従来例の図5に示すプログラムと
同一のものについては説明は省略する。本実施例が従来
例と異なるのは、n+2番地に格納されている命令R0
=(A0+);cmpg R0;であり、この命令は、
第1のアドレスレジスタ6に示されるアドレスに格納さ
れている内容をデータレジスタ8に転送し、第1のアド
レスレジスタ6の内容を1インクリメントし、さらに、
データレジスタ8に読み込まれた値とアキュムレータ9
に格納されている値を比較し、データレジスタ8の値が
大きい場合には、アキュムレータ9にデータレジスタ8
の値を格納するとともに、テーブルレジスタ書き込み信
号16を発生する命令を意味する機械語である。
FIG. 2 shows an example of a program of a digital computer provided with the table search device of the present invention. n
-4, n-3,..., N + 2 indicate addresses, and the frame indicates a program. The description of the same program as that of the conventional example shown in FIG. 5 is omitted. This embodiment differs from the conventional example in that the instruction R0 stored at address n + 2
= (A0 +); cmpg R0; and this instruction is:
The content stored at the address indicated by the first address register 6 is transferred to the data register 8, the content of the first address register 6 is incremented by 1, and
The value read into the data register 8 and the accumulator 9
Are compared, and if the value of the data register 8 is large, the data register 8 is stored in the accumulator 9.
Is a machine language that means an instruction for storing the value of the table register and generating the table register write signal 16.

【0029】図3は、図2に示すプログラムを実行した
場合のタイミングチャ−トを示す。図3において、CL
Kはディジタル計算機のクロックパルス波となるシステ
ムクロック14の波形、PCQはプログラムカウンタ1
の波形、IRQはインストラクションレジスタ3の波
形、AALU1はアドレスアロケーションユニット5の
波形、XR0はデータレジスタ8の波形、ACCRはア
キュムレータ9の波形、TBLR1、TBLR2、TB
LR3はそれぞれテーブルレジスタ15の第1、第2及
び第3のバッファの波形、TBLWRはテーブルレジス
タ書き込み信号16の波形である。
FIG. 3 shows a timing chart when the program shown in FIG. 2 is executed. In FIG. 3, CL
K is a waveform of the system clock 14 which is a clock pulse wave of the digital computer, and PCQ is a program counter 1
, IRQ is the waveform of the instruction register 3, AALU1 is the waveform of the address allocation unit 5, XR0 is the waveform of the data register 8, ACCR is the waveform of the accumulator 9, TBLR1, TBLR2, and TB.
LR3 is the waveform of the first, second, and third buffers of the table register 15, and TBLWR is the waveform of the table register write signal 16.

【0030】図2に示すプログラムを図1の回路構成で
実施した場合の動作を図3のタイミングチャートに従っ
て説明する。尚、n−4番地、n−2番地、n番地の命
令については従来例と動作は同じであるので説明は省略
する。
The operation when the program shown in FIG. 2 is implemented by the circuit configuration of FIG. 1 will be described with reference to the timing chart of FIG. The instructions at addresses n-4, n-2, and n are the same as those in the conventional example, and will not be described.

【0031】以下に、n+2番地の比較命令を実行する
場合について説明する。命令の実行はパイプライン処理
となっており、例えばCLKの立ち上がりBに同期し
て、n+2番地の命令R0=(A0+);cmpg R
0;がインストラクションレジスタ3に読み込まれ、命
令が解読される。続いてCLKの立ち上がりCに同期し
て、アドレスアロケーションユニット5からアドレスが
出力される。CLKの立ち上がりDに同期して、データ
メモリ4の内容がデータレジスタ8に格納され、CLK
の立ち上がりEに同期して比較器10においてアキュム
レータ9の内容とデータレジスタ8の内容が比較され
る。
The case where the comparison instruction at address n + 2 is executed will be described below. The execution of the instruction is a pipeline process. For example, the instruction R0 at address n + 2 = (A0 +); cmpg R in synchronization with the rising B of CLK.
0; is read into the instruction register 3, and the instruction is decoded. Subsequently, the address is output from the address allocation unit 5 in synchronization with the rising C of the CLK. The content of the data memory 4 is stored in the data register 8 in synchronization with the rising edge D of CLK,
The content of the accumulator 9 is compared with the content of the data register 8 in the comparator 10 in synchronization with the rise E of the data.

【0032】一方、テーブルレジスタ15の第1のバッ
ファ15aに、CLKの立ち上がりCに同期してアドレ
スアロケーションユニット5の出力<100>が格納さ
れる。同様にCLKの立ち上がりDに同期して、テーブ
ルレジスタ15の第2のバッファ15bに、これと共に
テーブルレジスタ15の第1のバッファ15aの値<1
00>が転送され、テーブルレジスタ15の第1のバッ
ファ15aにはアドレスアロケーションユニット5の出
力<101>が格納される。
On the other hand, the output <100> of the address allocation unit 5 is stored in the first buffer 15a of the table register 15 in synchronization with the rising C of CLK. Similarly, in synchronism with the rising edge D of the CLK, the value of the first buffer 15a of the table register 15 is stored in the second buffer 15b of the table register 15 <1.
00> is transferred, and the output <101> of the address allocation unit 5 is stored in the first buffer 15a of the table register 15.

【0033】CLKの立ち上がりEに同期して比較器1
0においてアキュムレータ9の値<0>とデータレジス
タ8の値<30>が比較される。このときデータレジス
タ8の値が大きいため、テーブルレジスタ書き込み信号
16を発生し、テーブルレジスタ15の第3のバッファ
15cは、前記テーブルレジスタ書き込み信号16を受
けて、テーブルレジスタ15の第2のバッファ15bに
格納されている値<100>を第3のバッファ15cに
書き込む。一方、比較器10は、データレジスタ8の内
容<30>をアキュムレータ9に格納する。
The comparator 1 is synchronized with the rising edge E of CLK.
At 0, the value <0> of the accumulator 9 is compared with the value <30> of the data register 8. At this time, since the value of the data register 8 is large, the table register write signal 16 is generated, and the third buffer 15 c of the table register 15 receives the table register write signal 16 and receives the table register write signal 16. Is written to the third buffer 15c. On the other hand, the comparator 10 stores the content <30> of the data register 8 in the accumulator 9.

【0034】n番地の命令do 4,n+2は、n+2
番地の命令まで4回繰り返すことを意味しており、同様
に2回目乃至4回目が実行される。
The instruction do 4, n + 2 at address n is n + 2
This means that the instruction is repeated four times up to the address, and the second to fourth times are similarly executed.

【0035】2回目は、CLKの立ち上がりFに同期し
て比較器10においてアキュムレータ9の値<30>と
データレジスタ8の値<10>が比較される。アキュム
レ−タ10の値が大きいため、テーブルレジスタ書き込
み信号16は発生されない。テーブルレジスタ15の第
3のバッファ15cは、テーブルレジスタ書き込み信号
16を受けないため、そのままのデータが保持される。
In the second time, the value <30> of the accumulator 9 is compared with the value <10> of the data register 8 in the comparator 10 in synchronization with the rising F of the CLK. Since the value of the accumulator 10 is large, the table register write signal 16 is not generated. Since the third buffer 15c of the table register 15 does not receive the table register write signal 16, the data is held as it is.

【0036】以上の動作を、データレジスタ8の値と、
アキュムレータ9の値とを比較器10で比較判定するこ
とを繰り返す。繰り返しが終了すると、アキュムレータ
9にはデータメモリ8の100番地乃至103番地に格
納されているデータのうちの最大値<100>が格納さ
れており、また、テーブルレジスタ15の第3のバッフ
ァ15cには最大値<100>が格納されているデータ
メモリ8のアドレス<102>が格納される。
The above operation is performed by comparing the value of the data register 8 with
The comparison of the value of the accumulator 9 with the comparator 10 is repeated. When the repetition is completed, the maximum value <100> of the data stored at addresses 100 to 103 of the data memory 8 is stored in the accumulator 9, and is stored in the third buffer 15 c of the table register 15. Is the address <102> of the data memory 8 where the maximum value <100> is stored.

【0037】尚、本発明のテーブルレジスタは3段構成
のバッファを用いたが、この段数はパイプライン処理の
段数に依存されるものであり、本発明の内容を限定する
ものではない。
Although the table register of the present invention uses a buffer having a three-stage configuration, the number of stages depends on the number of stages of pipeline processing, and does not limit the content of the present invention.

【0038】また、本実施例においては、比較判定の基
準としては、データの最大値を求める場合を例に説明し
たが、最小値、絶対値の最小値及び最大値などを求める
場合にも適用できる。さらに、比較判定結果が等しい場
合にも、テーブルレジスタを書き替えることも可能であ
る。
In this embodiment, the case where the maximum value of the data is obtained has been described as an example of the criterion for comparison. However, the present invention is also applicable to the case where the minimum value, the minimum value and the maximum value of the absolute value are obtained. it can. Further, even when the comparison and determination results are equal, the table register can be rewritten.

【0039】以上の説明が示す如く、比較判定命令の結
果により比較判定に用いられたデータが格納されている
アドレスを蓄積するテーブルレジスタを設けることによ
り、前記アドレスを格納する命令を実行する必要がな
く、プログラム実行の高速化を計ることが可能となる。
As described above, it is necessary to execute the instruction for storing the address by providing the table register for storing the address where the data used for the comparison and determination is stored according to the result of the comparison and determination instruction. Therefore, it is possible to speed up the execution of the program.

【0040】[0040]

【発明の効果】本発明は以上の説明から明らかなよう
に、テーブルレジスタ及びテーブルレジスタ書き込み信
号を設け、比較器において、比較判定命令の実行時にデ
ータレジスタとアキュムレータの内容を比較し、データ
レジスタが所望の値である場合には、所望の値を新たに
アキュムレータに格納するとともに、テーブルレジスタ
書き込み信号をテーブルレジスタに送出する。これによ
ってテーブルレジスタはテーブルレジスタ書き込み信号
を受け、データレジスタのデータが格納されているデー
タメモリのアドレスを格納する。この結果、DSPのプ
ログラムで行っていた所望の値を与えるデータメモリの
アドレスを格納するという命令が削減でき、比較判定命
令実行と同時に、所望の値を与えるデータメモリのアド
レスをテーブルレジスタに格納することができる。結
果、比較演算を効率よく高速に行うことが可能となる。
As is apparent from the above description, the present invention provides a table register and a table register write signal, and the comparator compares the contents of the data register and the accumulator at the time of execution of the comparison judgment instruction. If the value is the desired value, the desired value is newly stored in the accumulator and a table register write signal is sent to the table register. As a result, the table register receives the table register write signal and stores the address of the data memory where the data of the data register is stored. As a result, the instruction of storing the address of the data memory giving the desired value, which has been executed by the DSP program, can be reduced, and the address of the data memory giving the desired value is stored in the table register simultaneously with the execution of the comparison / determination instruction. be able to. As a result, the comparison operation can be performed efficiently and at high speed.

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

【図1】本発明のテーブル検索装置を備えたディジタル
計算機の一実施例の概略構成図
FIG. 1 is a schematic configuration diagram of an embodiment of a digital computer equipped with a table search device of the present invention.

【図2】本発明のテーブル検索装置を備えたディジタル
計算機において、比較判定命令を含んだプログラムの一
FIG. 2 shows an example of a program including a comparison / determination instruction in a digital computer provided with the table search device of the present invention.

【図3】本発明のテーブル検索装置を備えたディジタル
計算機において、比較判定命令を実行した場合のタイミ
ングチャート
FIG. 3 is a timing chart when a comparison / determination instruction is executed in a digital computer provided with the table search device of the present invention.

【図4】従来例のテーブル検索装置を備えたディジタル
計算機の概略構成図
FIG. 4 is a schematic configuration diagram of a digital computer including a conventional table search device.

【図5】従来例のテーブル検索装置を備えたディジタル
計算機において、比較判定命令を含んだプログラムの一
FIG. 5 shows an example of a program including a comparison / determination instruction in a digital computer having a conventional table search device.

【図6】従来例のテーブル検索装置を備えたディジタル
計算機において、比較判定命令を実行した場合のフロー
チャート
FIG. 6 is a flowchart when a comparison / determination instruction is executed in a digital computer having a conventional table search device.

【図7】比較判定命令の対象となるデータメモリの内容FIG. 7 shows the contents of a data memory targeted by a comparison / determination instruction.

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

4 データメモリ 5 アドレスアロケーションユニット 6 第1のアドレスレジスタ 8 データレジスタ 9 アキュムレータ 10 比較器 15 テーブルレジスタ 15a 第1のバッファ 15b 第2のバッファ 15c 第3のバッファ 16 テーブルレジスタ書き込み信号 4 Data Memory 5 Address Allocation Unit 6 First Address Register 8 Data Register 9 Accumulator 10 Comparator 15 Table Register 15a First Buffer 15b Second Buffer 15c Third Buffer 16 Table Register Write Signal

フロントページの続き (72)発明者 吉田 昭 大阪府守口市京阪本通2丁目18番地 三 洋電機株式会社内 (56)参考文献 特開 昭60−108973(JP,A) 特開 平2−28828(JP,A) 特開 平4−65713(JP,A) (58)調査した分野(Int.Cl.7,DB名) G06F 7/02 G06F 7/00 G06F 9/38 310 Continuation of the front page (72) Akira Yoshida 2-18-18 Keihanhondori, Moriguchi-shi, Osaka Sanyo Electric Co., Ltd. (56) References JP-A-60-108973 (JP, A) JP-A-2-28828 (JP, A) JP-A-4-65713 (JP, A) (58) Fields investigated (Int. Cl. 7 , DB name) G06F 7/02 G06F 7/00 G06F 9/38 310

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 演算に用いるデータが格納されているデ
ータメモリと、該データメモリのアドレスを指定するア
ドレスアロケーションユニットと、該アドレスアロケー
ションユニットで指定された前記データメモリのデータ
を格納するデータレジスタと、データの値の比較判定を
行う比較器と、該比較器の判定結果に基づいて、所望の
データを格納するアキュムレータと、前記アドレスアロ
ケーションユニットから出力されるアドレスをテーブル
レジスタ書き込み信号に従って格納するテーブルレジス
タと、を備え、 前記比較器での、比較判定命令実行時に、所望のデータ
が得られた場合、前記データを前記アキュムレータに格
納させるとともに、前記テーブルレジスタ書き込み信号
を発生させて、この信号に従って、前記データが格納さ
れている前記データメモリのアドレスを前記テーブルレ
ジスタに格納させることを特徴とするディジタル計算機
におけるテーブル検索装置。
1. A data memory storing data used for an operation, an address allocation unit for specifying an address of the data memory, and a data register for storing data of the data memory specified by the address allocation unit. A comparator for comparing and judging a data value, an accumulator for storing desired data based on the judgment result of the comparator, and a table for storing an address output from the address allocation unit in accordance with a table register write signal And a register, in the comparator, when a comparison determination command is executed, when desired data is obtained, the data is stored in the accumulator, the table register write signal is generated, and according to the signal, And the data is stored Table search unit in a digital computer address of said data memory are characterized by that stored in the table register.
【請求項2】 前記テーブルレジスタは、シリアルに接
続された複数のバッファにより構成されており、該バッ
ファは、パイプライン処理の所定のタイミングに従って
前記アドレスアロケーションユニットから順次出力され
るアドレスを格納及び次のバッファに転送し、前記バッ
ファのうち最終バッファへのアドレスの書き込みは、前
記テーブルレジスタ書き込み信号により決定されること
を特徴とする請求項1記載のディジタル計算機における
テーブル検索装置。
2. The table register includes a plurality of serially connected buffers. The buffers store addresses sequentially output from the address allocation unit in accordance with a predetermined timing of pipeline processing, and store the next addresses. 2. A table search apparatus in a digital computer according to claim 1, wherein the data is transferred to the last buffer, and the writing of the address to the last buffer among the buffers is determined by the table register write signal.
JP11999993A 1993-05-21 1993-05-21 Table search device in digital computer Expired - Fee Related JP3188042B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11999993A JP3188042B2 (en) 1993-05-21 1993-05-21 Table search device in digital computer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11999993A JP3188042B2 (en) 1993-05-21 1993-05-21 Table search device in digital computer

Publications (2)

Publication Number Publication Date
JPH06332694A JPH06332694A (en) 1994-12-02
JP3188042B2 true JP3188042B2 (en) 2001-07-16

Family

ID=14775394

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11999993A Expired - Fee Related JP3188042B2 (en) 1993-05-21 1993-05-21 Table search device in digital computer

Country Status (1)

Country Link
JP (1) JP3188042B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4896839B2 (en) * 2007-08-31 2012-03-14 ルネサスエレクトロニクス株式会社 Microprocessor and data processing method

Also Published As

Publication number Publication date
JPH06332694A (en) 1994-12-02

Similar Documents

Publication Publication Date Title
US4747045A (en) Information processing apparatus having an instruction prefetch circuit
JP2003050739A (en) Memory controller
JP2548428B2 (en) Timing generator
JP3188042B2 (en) Table search device in digital computer
KR100391041B1 (en) Method and apparatus for updating information about microcode instructions
KR100321745B1 (en) A micro controller unit for external memory access
JPH11110214A (en) Command control system and method for the same
JPS59197946A (en) Memory device
JP2004199608A (en) Memory control circuit
JP3366235B2 (en) Data read control device
KR100217384B1 (en) Method and apparatus of interrupt control
JP2760694B2 (en) Microprocessor
JP3434713B2 (en) Register control device and register control method
JP3005987B2 (en) Digital signal processor
JPH06348491A (en) Data processor for minimizing overhead at the time of execution of do loop
JPH07146814A (en) Memory device
JPH04262435A (en) Memory control system
JPS59132376A (en) Test pattern reading control system
JP3045731B2 (en) Sequence control method
JP3621539B2 (en) Real-time data buffer device
JPH047762A (en) Memory access method
JPH02136921A (en) Register access system
JPH0546463A (en) Information processor and read only memory
JPH1055289A (en) Debugging information generating circuit and information processor using the same
JPH04236643A (en) Memory predicting access system

Legal Events

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

Free format text: PAYMENT UNTIL: 20080511

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20090511

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20090511

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20100511

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20110511

Year of fee payment: 10

LAPS Cancellation because of no payment of annual fees