JPH05100821A - Priority encoder device - Google Patents

Priority encoder device

Info

Publication number
JPH05100821A
JPH05100821A JP25764991A JP25764991A JPH05100821A JP H05100821 A JPH05100821 A JP H05100821A JP 25764991 A JP25764991 A JP 25764991A JP 25764991 A JP25764991 A JP 25764991A JP H05100821 A JPH05100821 A JP H05100821A
Authority
JP
Japan
Prior art keywords
priority encoder
processing
bit
instruction
priority
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.)
Withdrawn
Application number
JP25764991A
Other languages
Japanese (ja)
Inventor
Naoto Okumura
直人 奥村
Masahito Matsuo
雅仁 松尾
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP25764991A priority Critical patent/JPH05100821A/en
Publication of JPH05100821A publication Critical patent/JPH05100821A/en
Withdrawn legal-status Critical Current

Links

Abstract

PURPOSE:To provide a priority encoder device which can speedily terminate a retrieval processing and which can execute the high speed processing of an instruction in a processing which sequentially retrieves a bit position where '1' is raised and encodes it for input data in n-bit width. CONSTITUTION:A first priority encoder 1a sequentially retrieves the bit position of '1' or '0' from the high-order-side of input data and encodes/outputs it. A second priority encoder 1b retrieves the bit position of initial '1' or '0' and encodes/outputs it. A comparison circuit 3 informs an external circuit of a retrieval processing termination signal when respective encoding outputs in the first and second priority encoders 1a and 1b coincide.

Description

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

【0001】[0001]

【産業上の利用分野】この発明は、プライオリティエン
コーダ装置に関し、より特定的には検索データの端部か
ら特定論理値のビット位置を順次検索してエンコードを
行なう機能を有したプライオリティエンコーダ装置に関
する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a priority encoder device, and more particularly to a priority encoder device having a function of sequentially searching for bit positions of a specific logical value from the end of search data and performing encoding.

【0002】[0002]

【従来の技術】図8は、たとえばマイクロプロセッサシ
ステム等のデータ処理装置において、1つの命令で複数
のレジスタにロードあるいはストアを行なう命令コード
の一例を示している。このような命令コードについての
詳細は、TRONWARE Vol.2(パーソナルメ
ディア,1990)P.14〜79「TRON仕様チッ
プの命令セット」に掲載されている。
2. Description of the Related Art FIG. 8 shows an example of an instruction code for loading or storing a plurality of registers with one instruction in a data processing device such as a microprocessor system. For details of such an instruction code, refer to TRONWARE Vol. 2 (Personal Media, 1990) P. 14-79 “TRON specification chip instruction set”.

【0003】図8(a)に示すLDM命令は、連続した
メモリアドレスに格納されたデータを、複数のレジスタ
にロードする命令である。ソースオペランドは、src
s31で指定されるアドレッシングモードに基づいて決
定され、デスティネーションオペランドは16ビットの
レジスタリスト33で指定される。srcs31とレジ
スタリスト33との間には、必要に応じsrcs31の
拡張部32が挿入される。
The LDM instruction shown in FIG. 8A is an instruction for loading data stored in consecutive memory addresses into a plurality of registers. Source operand is src
It is determined based on the addressing mode designated by s31, and the destination operand is designated by the 16-bit register list 33. An extension 32 of the srcs 31 is inserted between the srcs 31 and the register list 33 as needed.

【0004】図8(b)に示すSTM命令は、複数のレ
ジスタに格納されたデータを、連続したメモリアドレス
へストアする命令である。ソースオペランドは、16ビ
ットのレジスタリスト36で指定され、デスティネーシ
ョンオペランドは、8ビットのdests34で指定さ
れるアドレッシングモードに基づいて決定される。de
sts34とレジスタリスト36との間には、必要に応
じdests34の拡張部35が挿入される。
The STM instruction shown in FIG. 8B is an instruction for storing data stored in a plurality of registers in consecutive memory addresses. The source operand is specified by the 16-bit register list 36, and the destination operand is determined based on the addressing mode specified by the 8-bit dests 34. de
An expansion unit 35 of the dests 34 is inserted between the sts 34 and the register list 36 as needed.

【0005】ここで、レジスタリスト33および36の
各ビット位置は、図9(a)に示すように各レジスタ番
号に対応している。図9(a)において、Rnはレジス
タ番号nのレジスタを表わしている。レジスタリスト3
3および36の各ビットに“1”が立っているときには
そのビット位置に対応したレジスタをロード、またはス
トアすることを示し、“0”が立っているときにはその
ビット位置に対応したレジスタのロード,ストアを行な
わないことを示している。ただし、STM命令でアドレ
ッシングモードがスタックプッシュのときは、図9
(b)に示すように、R0〜R15のビット割付は図9
(a)の場合と逆になっている。
Here, each bit position of the register lists 33 and 36 corresponds to each register number as shown in FIG. 9 (a). In FIG. 9A, Rn represents the register with the register number n. Register list 3
When "1" is set in each bit of 3 and 36, it indicates that the register corresponding to the bit position is loaded or stored, and when "0" is set, the register corresponding to the bit position is loaded, Indicates that the store will not be performed. However, when the addressing mode is stack push with the STM instruction,
As shown in (b), the bit allocation of R0 to R15 is shown in FIG.
This is the opposite of the case (a).

【0006】図4は、図8に示すような命令コードを処
理するために用いられている従来のプライオリティエン
コーダ装置の一例を示すブロック図である。このような
プライオリティエンコーダ装置は、たとえばマイクロプ
ロセッサシステムにおけるCPU(中央処理装置)の内
部に設けられている。図4に示すプライオリティエンコ
ーダ装置は、プライオリティエンコーダ1とマスク生成
回路2とを含む。プライオリティエンコーダ1には、た
とえば特開昭64−8437号公報に記載されているよ
うな回路が用いられる。
FIG. 4 is a block diagram showing an example of a conventional priority encoder device used for processing the instruction code as shown in FIG. Such a priority encoder device is provided inside a CPU (central processing unit) in a microprocessor system, for example. The priority encoder device shown in FIG. 4 includes a priority encoder 1 and a mask generation circuit 2. For the priority encoder 1, for example, a circuit described in JP-A-64-8437 is used.

【0007】図5は、図4に示すプライオリティエンコ
ーダ1のより詳細な構成を示すブロック図であり、たと
えば特開昭64−8437号公報に記載されている。図
5に示すプライオリティエンコーダは、0検出回路11
と、下位2ビットエンコード回路13と、上位2ビット
エンコード回路12とを含む。0検出回路11および上
位2ビットエンコード回路12は、16ビットの入力デ
ータをエンコードして、上位2ビットの出力オフセット
Oofs3,Oofs2を出力する。一方、下位2ビッ
トエンコード回路13は、16ビットの入力データをエ
ンコードして、下位2ビットの出力オフセットOofs
1,Oofs0を出力する。図4に示すマスク生成回路
2は、出力オフセットOofs3〜Oofs0に基づい
てマスク信号を生成する。このマスク信号は、0検出回
路11および下位2ビットエンコード回路13に入力オ
フセットIofs0〜Iofs3としてフィードバック
される。図5に示す各回路の機能および動作は、特開昭
64−8437号公報に詳細に記載されているので、こ
こではその説明を省略する。
FIG. 5 is a block diagram showing a more detailed structure of the priority encoder 1 shown in FIG. 4, and is described in, for example, Japanese Patent Laid-Open No. 64-8437. The priority encoder shown in FIG.
And a lower 2 bit encoding circuit 13 and an upper 2 bit encoding circuit 12. The 0 detection circuit 11 and the upper 2-bit encoding circuit 12 encode 16-bit input data and output the upper 2-bit output offsets Ofofs3, Ofs2. On the other hand, the lower 2 bit encoding circuit 13 encodes the 16-bit input data and outputs the lower 2 bits of the output offset Ofofs.
1, 1, Ofs0 is output. The mask generation circuit 2 shown in FIG. 4 generates a mask signal based on the output offsets Ofofs3 to Ofofs0. This mask signal is fed back to the 0 detection circuit 11 and the lower 2 bit encoding circuit 13 as input offsets Iofs0 to Iofs3. The function and operation of each circuit shown in FIG. 5 are described in detail in Japanese Patent Application Laid-Open No. 64-8437, so the description thereof will be omitted here.

【0008】図6は、図4に示すプライオリティエンコ
ーダ装置を用いて、図8(b)に示したSTM命令を、
データ処理装置内でパイプライン処理を実行するとき
の、各ステージで行なう処理を示した図である。レジス
タリスト36として図10に示すレジスタリスト41が
与えられ、アドレッシングモードはスタックプッシュで
はなく、ビット位置とレジスタ番号は図9(a)に示す
ように相互に対応しているものとする。レジスタリスト
41内では、R5(番号5のレジスタ)とR10とに対
応するビットのみが“1”であるので、図6はR5とR
10のストアを連続して行なう処理を示している。な
お、図6において横軸は時間を表わしている。また、マ
イクロ命令の読出、演算実行、演算結果のメモリへのス
トアはパイプライン処理を用いて別ステージで行なわれ
る場合を考える。
FIG. 6 shows the STM instruction shown in FIG. 8B using the priority encoder device shown in FIG.
It is a figure showing processing performed at each stage when executing pipeline processing in a data processor. It is assumed that the register list 41 shown in FIG. 10 is given as the register list 36, the addressing mode is not stack push, and the bit positions and the register numbers correspond to each other as shown in FIG. 9A. In the register list 41, only the bits corresponding to R5 (register of number 5) and R10 are "1", so that in FIG.
A process of successively performing 10 stores is shown. In FIG. 6, the horizontal axis represents time. Further, consider a case where the reading of the micro instruction, the execution of the operation, and the storage of the operation result in the memory are performed in different stages using pipeline processing.

【0009】演算実行ステージ26では、プライオリテ
ィエンコーダ装置による“1”の検索、およびその結果
に基づくレジスタからメモリデータレジスタへのデータ
の転送が行なわれる。ここで、メモリデータレジスタ
は、メモリへ転送するデータを格納しておくレジスタで
あり、メモリデータレジスタの内容はストアステージ2
7においてメモリへ格納される。
In the operation execution stage 26, the priority encoder device searches for "1" and transfers the data from the register to the memory data register based on the result. Here, the memory data register is a register for storing data to be transferred to the memory, and the contents of the memory data register are stored in the store stage 2
Stored in memory at 7.

【0010】図7は、データ処理装置が図6に示す動作
をするときの、図4に示すプライオリティエンコーダ装
置の動作だけを抜き出して示した図である。
FIG. 7 is a diagram showing only the operation of the priority encoder device shown in FIG. 4 when the data processing device performs the operation shown in FIG.

【0011】以下、図4,図6および図7を参照して、
従来のプライオリティエンコーダ装置を用いた場合の演
算実行ステージ26の処理について説明する。
Hereinafter, with reference to FIGS. 4, 6 and 7,
The processing of the arithmetic execution stage 26 when the conventional priority encoder device is used will be described.

【0012】まず、ステップ1では、プライオリティエ
ンコーダ装置はレジスタリストの上位側から“1”を検
索し、オフセット値“5”をエンコードし出力する。
“1”の検索に成功したので、マイクロ命令読出ステー
ジ25に処理の継続を通知する。
First, in step 1, the priority encoder device retrieves "1" from the upper side of the register list, encodes the offset value "5", and outputs it.
Since the search for "1" was successful, the microinstruction read stage 25 is notified of the continuation of the process.

【0013】次に、ステップ2では、ステップ1でエン
コードされたオフセット値“5”に対応するR5をメモ
リデータレジスタに転送する。同時にプライオリティエ
ンコーダ装置は、マスク生成回路によりビット位置5ま
でが0マスクされたレジスタリストの上位側から“1”
を検索し、オフセット値“10”をエンコードし出力す
る。このとき、“1”の検索に成功したので、マイクロ
命令読出ステージ25に処理の継続を通知する。
Next, in step 2, R5 corresponding to the offset value "5" encoded in step 1 is transferred to the memory data register. At the same time, the priority encoder device sets “1” from the upper side of the register list in which the mask generation circuit masks 0 up to bit positions 5.
Is searched, and the offset value “10” is encoded and output. At this time, since the search for "1" has succeeded, the microinstruction read stage 25 is notified of the continuation of the processing.

【0014】次に、ステップ3では、ステップ2でエン
コードされたオフセット値“10”に対応するR10を
メモリデータレジスタに転送するとともに、プライオリ
ティエンコーダ装置はビット位置11から“1”を検索
するが、“1”が存在しないので検索に失敗する。その
結果、演算実行ステージ26はマイクロ命令読出ステー
ジ25へ、タイミング28で処理終了信号を出力する。
その処理終了信号を受けて、マイクロ命令読出ステージ
25は、STM命令の次の命令を処理するためのマイク
ロ命令の読出を開始する。
Next, in step 3, R10 corresponding to the offset value "10" encoded in step 2 is transferred to the memory data register, and the priority encoder apparatus retrieves "1" from the bit position 11. The search fails because "1" does not exist. As a result, the operation execution stage 26 outputs a processing end signal to the microinstruction read stage 25 at the timing 28.
Upon receiving the processing end signal, the microinstruction read stage 25 starts reading out a microinstruction for processing the instruction following the STM instruction.

【0015】次のステップ4では、読出されたマイクロ
命令は意味がないので、有効な演算処理は行なわれな
い。
In the next step 4, since the read microinstruction has no meaning, effective arithmetic processing is not performed.

【0016】そして、ステップ5で、STM命令の次の
命令の処理を開始する。
Then, in step 5, the processing of the instruction following the STM instruction is started.

【0017】[0017]

【発明が解決しようとする課題】上述のような命令を処
理するために、従来のプライオリティエンコーダ装置を
用いた場合、プライオリティエンコーダ装置は、“1”
の立っているビット位置のすべてを検索してエンコード
し出力し終えた後も、再び“1”を検索する試行を行な
い、その結果“1”が見つからず検索に失敗することで
検索処理の終了を判断していた。このため、終了判断が
遅れ、検索処理の終了を外部回路に知らせるタイミング
が遅れていた。
When the conventional priority encoder device is used to process the above-mentioned instruction, the priority encoder device is "1".
Even after all the bit positions with "" have been searched, encoded, and output is completed, a trial is made to search for "1" again, and as a result "1" is not found and the search fails, so the search processing ends. Had to judge. Therefore, the end determination is delayed, and the timing of notifying the external circuit of the end of the search process is delayed.

【0018】それゆえに、この発明の目的は、上記のよ
うな検索処理の終了を外部回路に知らせるタイミングを
早めることによって、上述のような命令を高速に処理し
得るプライオリティエンコーダ装置を提供することであ
る。
Therefore, an object of the present invention is to provide a priority encoder device capable of processing an instruction as described above at a high speed by advancing the timing of notifying the external circuit of the end of the search processing as described above. is there.

【0019】[0019]

【課題を解決するための手段】この発明にかかるプライ
オリティエンコーダ装置は、第1および第2のプライオ
リティエンコーダと、比較回路とを備えている。第1の
プライオリティエンコーダは、n(nは2以上の整数)
ビット幅の入力データに対し、その一方端から第1の論
理値である最初のビット位置を検索し、その検索結果を
所定ビット数のオフセット値にエンコードして出力す
る。第2のプライオリティエンコーダは、入力データの
他方端から、第1のプライオリティエンコーダの検索方
向とは逆方向に入力データの第1の論理値である最初の
ビット位置を検索し、その検索結果を所定ビット数のオ
フセット値にエンコードして出力する。比較回路は、第
1のプライオリティエンコーダにより出力されたオフセ
ット値と、第2のプライオリティエンコーダにより出力
されたオフセット値とを比較し、その比較結果を出力す
る。
A priority encoder device according to the present invention comprises first and second priority encoders and a comparison circuit. The first priority encoder is n (n is an integer of 2 or more)
The first bit position, which is the first logical value, is searched for from one end of the input data having the bit width, and the search result is encoded into an offset value of a predetermined number of bits and output. The second priority encoder searches the first bit position, which is the first logical value of the input data, from the other end of the input data in the direction opposite to the search direction of the first priority encoder, and determines the search result as a predetermined value. Encodes into offset value of bit number and outputs. The comparison circuit compares the offset value output by the first priority encoder with the offset value output by the second priority encoder, and outputs the comparison result.

【0020】[0020]

【作用】この発明においてては、第1および第2のプラ
イオリティエンコーダが入力データの両端から“1”ま
たは“0”を検索し、両方の検索結果が一致したときに
比較回路から外部回路に検索処理の終了が通知される。
そのため、従来のプライオリティエンコーダ装置のよう
に、検索処理の終了時において無駄な検索動作を行なう
必要がなくなり、検索処理の終了タイミングが早くな
り、命令を高速に処理できる。
In the present invention, the first and second priority encoders search for "1" or "0" from both ends of the input data, and when both search results match, the comparison circuit searches the external circuit. The end of processing is notified.
Therefore, unlike the conventional priority encoder device, it is not necessary to perform useless search operation at the end of the search process, the end timing of the search process is advanced, and the instruction can be processed at high speed.

【0021】[0021]

【実施例】図1は、この発明の一実施例のプライオリテ
ィエンコーダ装置の構成を示すブロック図である。図1
に示すプライオリティエンコーダ装置は、第1のプライ
オリティエンコーダ1aと、第2のプライオリティエン
コーダ1bと、マスク生成回路2と、比較回路3とを含
む。第1および第2のプライオリティエンコーダ1aお
よび1bは、並列に設けられ、それぞれに入力データが
与えられる。マスク生成回路2は、第1のプライオリテ
ィエンコーダ1aに関連して設けられる。したがって、
第1のプライオリティエンコーダ1aは、すでに検索の
終了したビットをマスクする機能を備えている。一方、
第2のプライオリティエンコーダ1bは、マスク機能を
備えていない。その他の点において、第1および第2の
プライオリティエンコーダ1a,1bは同様の機能を有
しており、それぞれの構成としてはたとえば図5に示す
ような構成を用いることができる。
1 is a block diagram showing the configuration of a priority encoder device according to an embodiment of the present invention. Figure 1
The priority encoder device shown in (1) includes a first priority encoder 1a, a second priority encoder 1b, a mask generation circuit 2, and a comparison circuit 3. The first and second priority encoders 1a and 1b are provided in parallel and are supplied with input data. The mask generation circuit 2 is provided in association with the first priority encoder 1a. Therefore,
The first priority encoder 1a has a function of masking bits that have already been searched. on the other hand,
The second priority encoder 1b does not have a mask function. In other respects, the first and second priority encoders 1a and 1b have the same function, and the respective configurations can be configured as shown in FIG. 5, for example.

【0022】第1のプライオリティエンコーダ1aは入
力データの一端から“1”のビットを検索するのに対
し、第2のプライオリティエンコーダ1bは入力データ
の他端から第1のプライオリティエンコーダ1aとは逆
方向に最初の“1”のビットを検索する。
The first priority encoder 1a searches for a "1" bit from one end of the input data, while the second priority encoder 1b moves from the other end of the input data in the opposite direction to the first priority encoder 1a. The first "1" bit is searched for.

【0023】比較回路3は、第1のプライオリティエン
コーダ1aによりエンコードされた出力と第2のプライ
オリティエンコーダ1bによりエンコードされた出力と
の比較を行なう回路である。マスク生成回路2は、一度
エンコードされ出力されたビット位置が再び出力されな
いために、前回検索されたオフセット値までをゼロにマ
スクするための信号を発生する。一部がマスクされたデ
ータに対し第1のプライオリティエンコーダ1aは次の
“1”のビット位置を検索する。
The comparison circuit 3 is a circuit for comparing the output encoded by the first priority encoder 1a and the output encoded by the second priority encoder 1b. The mask generation circuit 2 generates a signal for masking up to the previously searched offset value to zero because the bit position once encoded and output is not output again. The first priority encoder 1a searches for the next bit position of "1" for the partially masked data.

【0024】図2は、従来例の図6に対応するもので、
図1に示す本実施例のプライオリティエンコーダ装置を
用いて、図8(b)に示したSTM命令のレジスタリス
ト36として図10に示したレジスタリスト41が与え
られパイプライン処理を実行するときの、各ステージで
行なう処理を示した図である。レジスタリスト36のす
べてのビットが“0”でないことは、予めチェックして
あり、“1”であるビットが1つ以上あるものとする。
また、アドレッシングモードはスタックプッシュではな
く、ビット位置とレジスタ番号は図9(a)のように対
応しているものとする。図10のレジスタリスト41で
はR5とR10とに対応するビットのみが“1”である
ので、図2はR5とR10とのストアを連続して行なう
処理について示していることになる。なお、図2におい
て横軸は時間を表わしている。マイクロ命令の読出、演
算実行、演算結果のメモリへのストアはパイプライン処
理を用いて別ステージで行なれる場合を考える。マイク
ロ命令の読出ステージ60,演算実行ステージ61,ス
トアステージ62は、図6の各ステージに対応してい
る。
FIG. 2 corresponds to FIG. 6 of the conventional example.
When the register list 41 shown in FIG. 10 is given as the register list 36 of the STM instruction shown in FIG. 8B by using the priority encoder device of the present embodiment shown in FIG. It is a figure showing the processing performed in each stage. It is previously checked that all the bits of the register list 36 are not "0", and it is assumed that there is at least one bit which is "1".
Further, the addressing mode is not stack push, but the bit position and the register number correspond to each other as shown in FIG. Since only the bit corresponding to R5 and R10 is "1" in the register list 41 of FIG. 10, FIG. 2 shows the process of continuously storing R5 and R10. In FIG. 2, the horizontal axis represents time. Consider the case where the reading of microinstructions, the execution of operations, and the storage of the operation results in the memory can be performed in different stages using pipeline processing. The micro instruction read stage 60, the operation execution stage 61, and the store stage 62 correspond to the respective stages in FIG.

【0025】図3は、図1のプライオリティエンコーダ
装置を備えたデータ処理装置が図2の動作をするとき
の、図1のプライオリティエンコーダ装置の動作だけを
抜き出して示した図である。
FIG. 3 is a diagram showing only the operation of the priority encoder device of FIG. 1 when the data processing device having the priority encoder device of FIG. 1 performs the operation of FIG.

【0026】以下には、図1,図2および図3を参照し
て、図1に示す本実施例のプライオリティエンコーダ装
置を用いた場合の演算実行ステージ61の処理について
説明する。
The processing of the operation execution stage 61 when the priority encoder device of the present embodiment shown in FIG. 1 is used will be described below with reference to FIGS. 1, 2 and 3.

【0027】まず、ステップ1では、第1のプライオリ
ティエンコーダ1aはレジスタリスト(図3参照)の上
位側から“1”を検索し、オフセット値“5”をエンコ
ードし出力する。このとき、第2のプライオリティエン
コーダ1bはレジスタリストの下位側から“1”を検索
し、オフセット値“10”をエンコードし出力する。比
較回路3は、第1のプライオリティエンコーダ1aのエ
ンコード出力と第2のプライオリティエンコーダ1bの
エンコード出力とを比較し、一致しているか否かを検出
する。このとき、第1および第2のプライオリティエン
コーダ1aおよび1bのエンコード出力は一致していな
いので、比較回路3はマイクロ命令読出ステージ60に
処理継続を通知する。
First, in step 1, the first priority encoder 1a searches for "1" from the upper side of the register list (see FIG. 3), encodes the offset value "5" and outputs it. At this time, the second priority encoder 1b searches for "1" from the lower side of the register list, encodes the offset value "10", and outputs it. The comparison circuit 3 compares the encoded output of the first priority encoder 1a and the encoded output of the second priority encoder 1b, and detects whether they match. At this time, since the encoded outputs of the first and second priority encoders 1a and 1b do not match, the comparison circuit 3 notifies the microinstruction read stage 60 of the continuation of the processing.

【0028】次に、ステップ2では、ステップ1でエン
コードされたオフセット値“5”に対応するR5をメモ
リデータレジスタに転送するとともに、第1のプライオ
リティエンコーダ1aはマスク生成回路2により生成さ
れたマスク信号によってビット位置5までが0マスクさ
れたレジスタリストの上位側から“1”を検索し、オフ
セット値“10”をエンコードし出力する。このとき、
第2のプライオリティエンコーダ1bは、オフセット値
“10”をエンコードし出力している。比較回路3は、
第1のプライオリティエンコーダ1aのエンコード出力
と第2のプライオリティエンコーダ1bのエンコード出
力とを比較し、一致しているか否かを検出する。このと
き、両エンコード出力は一致しているので、比較回路3
はマイクロ命令読出ステージ60へタイミング63で処
理終了信号を出力する。この処理終了信号を受けて、マ
イクロ命令読出ステージ60ではSTM命令に対する処
理を終了し、STM命令の次の命令を処理するためのマ
イクロ命令の読出を開始する。
Next, in step 2, R5 corresponding to the offset value "5" encoded in step 1 is transferred to the memory data register, and the first priority encoder 1a uses the mask generated by the mask generation circuit 2. "1" is searched from the upper side of the register list in which bit positions up to bit position 5 are masked by a signal, and the offset value "10" is encoded and output. At this time,
The second priority encoder 1b encodes and outputs the offset value "10". The comparison circuit 3 is
The encoded output of the first priority encoder 1a and the encoded output of the second priority encoder 1b are compared to detect whether they match. At this time, since both encoded outputs match, the comparison circuit 3
Outputs a processing end signal to the micro instruction reading stage 60 at timing 63. Upon receiving this processing end signal, the microinstruction read stage 60 ends the processing for the STM instruction and starts reading the microinstruction for processing the instruction following the STM instruction.

【0029】次に、ステップ3では、ステップ2でエン
コードされたオフセット値“10”に対応するR10を
メモリデータレジスタに転送する。
Next, in step 3, R10 corresponding to the offset value "10" encoded in step 2 is transferred to the memory data register.

【0030】そして、ステップ4では、STM命令の次
の命令の処理を開始する。上記のように、図1に示す実
施例のプライオリティエンコーダ装置では、図4に示す
従来のプライオリティエンコーダ装置に比べ、STM命
令の処理に要するステップ数が4ステップ(4クロック
サイクル)から3ステップ(3クロックサイクル)へと
減少し、データ処理が高速化されている。
Then, in step 4, the processing of the instruction following the STM instruction is started. As described above, in the priority encoder device of the embodiment shown in FIG. 1, the number of steps required to process the STM instruction is from 4 steps (4 clock cycles) to 3 steps (3) as compared with the conventional priority encoder device shown in FIG. Clock cycles), and data processing is speeded up.

【0031】なお、上記実施例でおいては、一度出力さ
れたビット位置が再び出力されないようにする方法とし
て、入力データをマスク生成回路を用いてゼロマスクす
る方法を用いたが、入力データの所定位置までをゼロク
リアする方法を用いてもよいし、その他の方法を用いて
もよい。
In the above embodiment, the method of zero masking the input data by using the mask generation circuit is used as a method of preventing the bit position once output from being output again. A method of clearing up to the position to zero may be used, or another method may be used.

【0032】また、上記実施例では、第2のプライオリ
ティエンコーダ1bは、レジスタリストの下位側から最
初の“1”を検索したところでその動作を停止するもの
として示されている。しかしながら、レジスタリストの
ビット幅が長い場合、第2のプライオリティエンコーダ
1bにもマスク生成回路を設け、第1および第2のプラ
イオリティエンコーダ1aおよび1bがレジスタリスト
の両端側から順次“1”のビット位置を検索する構成と
してもよい。この場合、第1のプライオリティエンコー
ダ1aのエンコード出力と第2のプライオリティエンコ
ーダ1bのエンコード出力とが行き違う場合があるの
で、両者のエンコード出力の差が所定値以下になったと
きは第1および第2のプライオリティエンコーダ1aお
よび1bのいずれかの検索動作を停止させるような構成
とすればよい。このように、第1および第2のプライオ
リティエンコーダ1aおよび1bがレジスタリストの両
端側から順次検索動作を行なうような実施例では、図1
に示す実施例に比べてさらにデータ処理の高速化が図れ
る。
Further, in the above embodiment, the second priority encoder 1b is shown to stop its operation when the first "1" is searched from the lower side of the register list. However, when the bit width of the register list is long, a mask generation circuit is also provided in the second priority encoder 1b, so that the first and second priority encoders 1a and 1b sequentially have bit positions of "1" from both ends of the register list. May be configured to be searched. In this case, the encoded output of the first priority encoder 1a and the encoded output of the second priority encoder 1b may be different from each other. The search operation of either of the two priority encoders 1a and 1b may be stopped. As described above, in the embodiment in which the first and second priority encoders 1a and 1b sequentially perform the search operation from both ends of the register list, in FIG.
The data processing speed can be further increased as compared with the embodiment shown in FIG.

【0033】[0033]

【発明の効果】以上のように、この発明によれば、nビ
ット幅のデータに対し、たとえば“1”の立っているビ
ット位置を順次検索しエンコードするような処理におい
て、互いに入力データの逆方向から検索を行なう2つの
プライオリティエンコーダを設け、2つのプライオリテ
ィエンコーダの出力を比較することにより検索の終了を
判定するように構成されているため、処理の終了を速い
タイミングで外部回路に通知できる。その結果、連続す
るビット検索を伴うデータ処理において、処理時間を大
幅に短縮化できるという効果を奏する。
As described above, according to the present invention, in the process of sequentially retrieving and encoding the bit position where "1" is set, for the data of the n-bit width, the input data is reversed. Since two priority encoders that perform a search from the direction are provided and the end of the search is determined by comparing the outputs of the two priority encoders, the end of the processing can be notified to the external circuit at a fast timing. As a result, there is an effect that the processing time can be significantly shortened in the data processing involving continuous bit search.

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

【図1】この発明の一実施例のプライオリティエンコー
ダ装置の構成を示すブロック図である。
FIG. 1 is a block diagram showing the configuration of a priority encoder device according to an embodiment of the present invention.

【図2】図1に示すプライオリティエンコーダ装置を用
いたSTM命令のパイプライン処理を示した図である。
2 is a diagram showing pipeline processing of an STM instruction using the priority encoder device shown in FIG.

【図3】図1に示すプライオリティエンコーダ装置の動
作を示した図である。
3 is a diagram showing the operation of the priority encoder device shown in FIG. 1. FIG.

【図4】従来のプライオリティエンコーダ装置の構成の
一例を示すブロック図である。
FIG. 4 is a block diagram showing an example of a configuration of a conventional priority encoder device.

【図5】プライオリティエンコーダの構成の一例を示す
ブロック図である。
FIG. 5 is a block diagram showing an example of a configuration of a priority encoder.

【図6】図4に示す従来のプライオリティエンコーダ装
置を用いたSTM命令のパイプライン処理を示した図で
ある。
6 is a diagram showing pipeline processing of an STM instruction using the conventional priority encoder device shown in FIG.

【図7】図4に示す従来のプライオリティエンコーダ装
置の動作を示した図である。
7 is a diagram showing an operation of the conventional priority encoder device shown in FIG.

【図8】LDM命令とSTM命令との命令フォーマット
を示した図である。
FIG. 8 is a diagram showing instruction formats of an LDM instruction and an STM instruction.

【図9】レジスタリストの各ビット位置と各レジスタと
の対応関係を示した図である。
FIG. 9 is a diagram showing a correspondence relationship between each bit position in the register list and each register.

【図10】LDM命令,STM命令におけるレジスタリ
ストの一例を示す図である。
FIG. 10 is a diagram showing an example of a register list in an LDM instruction and an STM instruction.

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

1a 第1のプライオリティエンコーダ 1b 第2のプライオリティエンコーダ 2 マスク生成回路 3 比較回路 1a 1st priority encoder 1b 2nd priority encoder 2 mask generation circuit 3 comparison circuit

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 n(nは2以上の整数)ビット幅の入力
データに対し、その一方端から第1の論理値である最初
のビット位置を検索し、その検索結果を所定ビット数の
オフセット値にエンコードして出力する第1のプライオ
リティエンコーダ、 前記入力データの他方端から、前記第1のプライオリテ
ィエンコーダの検索方向とは逆方向に前記入力データの
第1の論理値である最初のビット位置を検索し、その検
索結果を所定ビット数のオフセット値にエンコードして
出力する第2のプライオリティエンコーダ、および前記
第1のプライオリティエンコーダにより出力されたオフ
セット値と、前記第2のプライオリティエンコーダによ
り出力されたオフセット値とを比較し、その比較結果を
出力する比較回路を備える、プライオリティエンコーダ
装置。
1. An input data having a bit width of n (n is an integer of 2 or more) is searched for a first bit position having a first logical value from one end thereof, and the search result is offset by a predetermined number of bits. A first priority encoder that encodes and outputs a value, a first bit position that is a first logical value of the input data in a direction opposite to the search direction of the first priority encoder from the other end of the input data And a second priority encoder which outputs the search result by encoding the search result into an offset value having a predetermined number of bits, and the offset value output by the first priority encoder and the second priority encoder. The priority encoder that includes a comparison circuit that compares the offset value and the output result. Apparatus.
JP25764991A 1991-10-04 1991-10-04 Priority encoder device Withdrawn JPH05100821A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP25764991A JPH05100821A (en) 1991-10-04 1991-10-04 Priority encoder device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP25764991A JPH05100821A (en) 1991-10-04 1991-10-04 Priority encoder device

Publications (1)

Publication Number Publication Date
JPH05100821A true JPH05100821A (en) 1993-04-23

Family

ID=17309185

Family Applications (1)

Application Number Title Priority Date Filing Date
JP25764991A Withdrawn JPH05100821A (en) 1991-10-04 1991-10-04 Priority encoder device

Country Status (1)

Country Link
JP (1) JPH05100821A (en)

Similar Documents

Publication Publication Date Title
US4476525A (en) Pipeline-controlled data processing system capable of performing a plurality of instructions simultaneously
JPH0562390B2 (en)
US5081608A (en) Apparatus for processing record-structured data by inserting replacement data of arbitrary length into selected data fields
JP2620511B2 (en) Data processor
EP0094535A2 (en) Pipe-line data processing system
JPH0786875B2 (en) Vector processor
US5390306A (en) Pipeline processing system and microprocessor using the system
JP2748957B2 (en) Data processing device
JPH05100821A (en) Priority encoder device
US5838944A (en) System for storing processor register data after a mispredicted branch
US6513053B1 (en) Data processing circuit and method for determining the first and subsequent occurences of a predetermined value in a sequence of data bits
JPS6236575B2 (en)
US4935849A (en) Chaining and hazard apparatus and method
JPS63261421A (en) Character string processor
JP2812610B2 (en) Pipeline control method
JPH0248733A (en) Information processor
JP3014701B2 (en) Information processing device
JP2636566B2 (en) Pipeline control method
JPH06162067A (en) Device and method for controlling vector instruction
JPH0271327A (en) Sorting processor
JPS5925264B2 (en) Vector instruction processing method
JPH05127894A (en) Instruction executing system
JPS6337412B2 (en)
JPS6373422A (en) Information retrieving device
JPH02144670A (en) Comparator

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 19990107