JPH10312279A - Bit retrieval circuit and method processor having the same - Google Patents

Bit retrieval circuit and method processor having the same

Info

Publication number
JPH10312279A
JPH10312279A JP9121149A JP12114997A JPH10312279A JP H10312279 A JPH10312279 A JP H10312279A JP 9121149 A JP9121149 A JP 9121149A JP 12114997 A JP12114997 A JP 12114997A JP H10312279 A JPH10312279 A JP H10312279A
Authority
JP
Japan
Prior art keywords
bit
circuit
register
search
register list
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
JP9121149A
Other languages
Japanese (ja)
Inventor
Takao Katayama
貴雄 片山
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.)
Ricoh Co Ltd
Original Assignee
Ricoh 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 Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP9121149A priority Critical patent/JPH10312279A/en
Publication of JPH10312279A publication Critical patent/JPH10312279A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To provide a bit retrieval circuit capable of detecting bit retrieval and the termination without the need of a circuit such as an offset circuit, a counter circuit or a subtraction circuit. SOLUTION: This bit retrieval circuit 8 is provided with a register list holding circuit 11 holding a register list, a bit position detection circuit 12 detecting the bit position of first '1' from the register list which the register list holding circuit 11 holds and a bit rejecting circuit 13 rewriting the bit of the detected position into '0' and making the register list holding circuit 11 hold it. The bit position detection circuit 12 is provided with a terminal part (IQ- NULL) outputting a signal '1' showing that all bits in the register list which the register list holding circuit 11 holds become '0'.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、検索対象ビット列
から所定のビットを検索するビット検索回路、およびこ
れを有して構成され、ビット検索を必要とする命令処理
をマイクロプログラムにて行うマイクロプロセッサに関
する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a bit retrieval circuit for retrieving a predetermined bit from a bit string to be retrieved, and a microprocessor having the bit retrieval circuit and performing an instruction processing requiring a bit retrieval by a microprogram. About.

【0002】[0002]

【従来の技術】C言語やC++のような高級言語におい
て、プログラム実行中に他の関数を呼び出す際のデータ
の退避や、呼び出した関数の処理から元に戻すためのデ
ータのロードなどの処理を行う場合、マイクロプロセッ
サは複数のレジスタの値をメモリにストアしたり、その
逆にメモリから複数のレジスタにロードしたりといった
処理を行う。このような複数のレジスタを扱う命令セッ
トがマイクロプロセッサには用意されていることが多
い。また、高級言語でのプログラムにはこのような処理
が頻繁に行われるため、マイクロプロセッサに備えられ
る複数のレジスタを扱う命令としてはマシンサイクルの
少ないものが望まれる。
2. Description of the Related Art In a high-level language such as C or C ++, data is saved when calling another function during execution of a program, or data is loaded to restore the original function from processing of the called function. When performing the processing, the microprocessor performs processing such as storing the values of the plurality of registers in the memory, and conversely, loading the values from the memory into the plurality of registers. An instruction set for handling such a plurality of registers is often provided in a microprocessor. In addition, since such processing is frequently performed in a program in a high-level language, it is desired that an instruction that handles a plurality of registers provided in the microprocessor has a small number of machine cycles.

【0003】複数のレジスタを扱う命令セットには、例
えば、LDM、STM、EXTD、或いはENTERと
いったものがある。LDMは、メモリに連続して配置さ
れいる複数のデータを複数のレジスタにロードする命令
である。STMは、その逆に、複数のレジスタのデータ
をメモリ上に連続してストアする命令である。ENTE
Rは自動変数領域を確保し、複数のレジスタのデータを
メモリに退避する命令である。EXTDは、ENTER
により退避されたレジスタのデータをレジスタにロード
し、自動変数領域を解放し、ENTERが実行される前
に実行されるJSR(サブルーチンジャンプ命令)の後
のアドレスに復帰する命令である。
[0003] Instruction sets handling a plurality of registers include, for example, LDM, STM, EXTD, and ENTER. The LDM is an instruction to load a plurality of data continuously arranged in a memory into a plurality of registers. The STM is, on the contrary, an instruction for successively storing data of a plurality of registers on a memory. ENTER
R is an instruction for securing an automatic variable area and saving data of a plurality of registers in a memory. EXTD is ENTER
This is an instruction to load the data of the register saved by the above into the register, release the automatic variable area, and return to the address after the JSR (subroutine jump instruction) executed before the ENTER is executed.

【0004】このような複数のレジスタを扱う命令にお
いては、レジスタリストといった記述が用いられる。こ
こで、例えば16本の汎用レジスタを備えたマイクロプ
ロセッサがあるとすると、レジスタリストは、図6に示
すように、レジスタr0〜r15の個々に対応した合計
16個のビットからなるデータとして与えられる。即
ち、対象とするレジスタに相当するビットを“1”とす
ることでそのレジスタを指定することができ、例えば、
即値モードで指定する場合、r0〜r7までのレジスタ
を指定するのであれば、“1111111100000
000b”(2進記述の場合)またはFF00h(16
進記述の場合)と記述され、r0,r2,r4,r6,
r8,r10,r12,r14の8つのレジスタを指定
するには、1010101010101010b(2進
記述の場合)またはA0A0h(16進記述の場合)と
記述される。
[0004] In such an instruction handling a plurality of registers, a description such as a register list is used. Here, for example, if there is a microprocessor having 16 general-purpose registers, the register list is given as data consisting of a total of 16 bits corresponding to each of the registers r0 to r15, as shown in FIG. . That is, by setting a bit corresponding to a target register to “1”, the register can be designated. For example,
When specifying in the immediate mode, if the registers r0 to r7 are specified, "11111111100000"
000b "(in the case of binary description) or FF00h (16
R0, r2, r4, r6,
In order to specify the eight registers r8, r10, r12, and r14, 1010101010101010b (in the case of binary description) or A0A0h (in the case of hexadecimal description) is described.

【0005】従来、このようなレジスタリストを持つ命
令をマイクロプログラミングで処理する場合、レジスタ
リストの上位若しくは下位のいずれかからレジスタリス
トに記述されている“1”を検索し、“1”が検出され
たビットに対応するレジスタを指定している。検索は、
プライオリティエンコーダと呼ばれる回路からなるビッ
ト位置検出回路が用いられ、このときに検出されたビッ
ト番号の次のビット番号は回路上に保持され、次に検索
するときのオフセットとして利用される。即ち、次のビ
ットの検索は、オフセット値で示される番号のビットか
ら始められる。そして、全てのビットに対して検索をす
ると終了することになる。
Conventionally, when processing an instruction having such a register list by microprogramming, "1" described in the register list is searched from either the upper or lower register list, and "1" is detected. The register corresponding to the specified bit is specified. Search is
A bit position detection circuit composed of a circuit called a priority encoder is used. The bit number next to the bit number detected at this time is held on the circuit and used as an offset for the next search. That is, the search for the next bit is started from the bit having the number indicated by the offset value. When the search is performed for all the bits, the process ends.

【0006】[0006]

【発明が解決しようとする課題】しかしながら、上述の
ごとく、全てのビットに対して検索をするのでは、処理
時間が長くなってしまう。即ち、例えば第7番目のビッ
トが最後の“1”であるとしても、その後の第8番目以
降のビットについても検索を続けるために処理速度が長
くなるという欠点がある。
However, as described above, if all bits are searched, the processing time becomes long. That is, for example, even if the seventh bit is the last "1", there is a disadvantage that the processing speed is long because the search is continued for the eighth and subsequent bits.

【0007】そこで、検索の終了を検出することができ
るものとして、特開平4−260926号公報には、検
索ビットフィールド内の検索開始ビットを示すオフセッ
ト値指定回路と、検索されたビットの位置を検出するビ
ット位置検出回路と、ビットフィールド内の検索対象と
するビットの総数をカウントするビット数計数回路と、
ビット位置検出回路で複数回検索していくときに対象と
するビットが検出された場合に、計数結果から減算して
検索終了を検出する検索終了回路とを備えて成るビット
検索回路が開示されている。しかしながら、かかる回路
では、オフセット値を指定する回路、ビット数を計数す
るカウンタ回路、更に減算回路が必要になる。
[0007] In order to detect the end of a search, Japanese Patent Laid-Open Publication No. Hei 4-260926 discloses an offset value designating circuit indicating a search start bit in a search bit field and a position of the searched bit. A bit position detection circuit for detecting, a bit number counting circuit for counting the total number of bits to be searched in the bit field,
A bit search circuit comprising a search end circuit for detecting a search end by subtracting from a count result when a target bit is detected when the bit position detection circuit searches a plurality of times is disclosed. I have. However, such a circuit requires a circuit for designating an offset value, a counter circuit for counting the number of bits, and a subtraction circuit.

【0008】また、特開平5−134864号公報に
は、複数のレジスタを扱う命令のレジスタリスト処理
を、レジスタリストのデータをレジスタ間接指定用レジ
スタに保持させ、レジスタ間接指定用レジスタをシフト
することで対象となるビットの検索を行うようにしたマ
イクロ命令制御装置が開示されている。この装置におけ
るビット検索の終了は、計数カウンタに検索の対象とな
るレジスタの数を保持し、検索されるごとに計数カウン
タを減算し、“0”になることで判断する。かかる装置
においても計数カウンタや減算回路が必要になる。
Japanese Patent Application Laid-Open No. Hei 5-134864 discloses a register list process of an instruction for handling a plurality of registers, in which register list data is held in a register indirect register and the register indirect register is shifted. Discloses a micro-instruction control device in which a target bit is searched. The end of the bit search in this device is determined by holding the number of registers to be searched in the count counter, decrementing the count counter each time the search is performed, and setting the count to “0”. Such a device also requires a counter and a subtraction circuit.

【0009】また、特開平6−59885号公報には、
検索ビットフィールド内の単一のビットを検索するので
はなくて複数のビットを検索することを行うために、マ
イクロプログラミング制御を使わずに回路内で検索を行
うビットサーチ回路が開示されている。
[0009] Japanese Patent Application Laid-Open No. 6-59885 discloses that
A bit search circuit is disclosed that performs a search in a circuit without using microprogramming control to perform a search for multiple bits rather than a single bit in a search bit field.

【0010】この発明は、オフセット回路、カウンタ回
路、或いは減算回路といった回路を必要とせずにビット
検索やその終了を検出することができるビット検索回路
を提供することを目的とする。また、前記ビット検索回
路をマイクロプログラミング制御することで、ビット検
索を必要とする命令処理のマシンサイクルを好適に制御
するマイクロプロセッサを提供することを目的とする。
SUMMARY OF THE INVENTION It is an object of the present invention to provide a bit search circuit capable of detecting a bit and detecting the end thereof without requiring a circuit such as an offset circuit, a counter circuit, or a subtraction circuit. It is another object of the present invention to provide a microprocessor that suitably controls a machine cycle of an instruction processing requiring a bit search by performing microprogramming control of the bit search circuit.

【0011】[0011]

【課題を解決するための手段】この発明のビット検索回
路は、上記の課題を解決するために、検索対象ビット列
を保持するビット列保持回路と、このビット列保持回路
が保持する検索対象ビット列から最初の“0”または
“1”のビット位置を検出するビット位置検出回路と、
検出された位置のビットを書き換えて前記ビット列保持
回路に保持させるビットリジェクト回路とを備えている
ことを特徴とする。
In order to solve the above problems, a bit search circuit according to the present invention has a bit string holding circuit for holding a bit string to be searched and a first bit string from a bit string to be searched held by the bit string holding circuit. A bit position detection circuit for detecting a bit position of “0” or “1”;
A bit reject circuit for rewriting the bit at the detected position and holding the bit string in the bit string holding circuit.

【0012】上記の構成であれば、ビット位置検出回路
にて検索対象ビット列から最初の“0”または“1”の
ビット位置が検出されると、この検出された位置のビッ
トはビットリジェクト回路によって書き換えられて再び
ビット検索される。例えば、“1100b”という検索
対象ビット列に対して、最初の“1”のビット位置が0
番目のビットであることが検出されるとともに、ビット
リジェクト回路の書換えによって検索対象ビット列は
“0100b”となり、再度のビット検索では最初の
“1”のビット位置が1番目のビットであることが検出
される。そして、ビットリジェクト回路の書換えによっ
て検索対象ビット列は“0000b”となる。このよう
にビットリジェクト回路による書換えがなされるので、
再度のビット検索で同じ位置のビットを検索することは
ない。そして、このように、オフセット処理をすること
なく、前記ビット位置検出回路にて順次目的とするビッ
トの位置を検索していくことができる。
With the above arrangement, when the first bit position of "0" or "1" is detected from the bit string to be searched by the bit position detection circuit, the bit at the detected position is determined by the bit rejection circuit. It is rewritten and bit searched again. For example, for the search target bit string “1100b”, the first bit position of “1” is 0
At the same time as detecting the bit, the bit string to be searched becomes “0100b” by rewriting of the bit reject circuit, and it is detected that the first bit position of “1” is the first bit in the second bit search. Is done. Then, the bit string to be searched becomes “0000b” by rewriting of the bit reject circuit. Since rewriting is performed by the bit reject circuit in this way,
The bit at the same position is not searched by the bit search again. As described above, the target bit position can be sequentially searched by the bit position detection circuit without performing the offset processing.

【0013】前記ビット列保持回路が保持する検索対象
ビット列中の全てのビットが“0”または“1”となっ
た場合にそのことを示す信号を出力する出力部を備えて
いてもよい。例えば、前述の場合において、ビットリジ
ェクト回路の書換えによって検索対象ビット列が“00
00b”となると、そのことが前記出力部から出力され
るので、ビット検索の終了を検出し、マシンサイクル数
を少なくすることができる。
An output unit may be provided which outputs a signal indicating that all bits in the search target bit string held by the bit string holding circuit have become "0" or "1". For example, in the above case, the bit string to be searched becomes “00” by rewriting the bit reject circuit.
00b "is output from the output unit, so that the end of the bit search can be detected and the number of machine cycles can be reduced.

【0014】また、この発明のマイクロプロセッサは、
上記のいずれかのビット検索回路、及び検出されたビッ
トの位置に基づいてレジスタを指定するレジスタ指示回
路を実行部に備え、当該ビット検索回路及びレジスタ指
示回路がマイクロプログラミングに基づく制御信号によ
って制御されるように構成されていることを特徴とす
る。前記ビット検索回路及びレジスタ指示回路をマイク
ロプログラミング制御することで、複数の任意のレジス
タを扱う命令処理のマシンサイクルを好適に制御するこ
とができる。
Further, a microprocessor according to the present invention comprises:
The execution unit includes any one of the above-described bit search circuits and a register designating circuit that designates a register based on the position of the detected bit. It is characterized by being comprised so that. By microprogramming control of the bit search circuit and the register designating circuit, it is possible to appropriately control a machine cycle of an instruction processing that handles a plurality of arbitrary registers.

【0015】[0015]

【発明の実施の形態】以下、この発明の実施の形態を図
に基づいて説明する。
Embodiments of the present invention will be described below with reference to the drawings.

【0016】図1は、この実施の形態のマイクロプロセ
ッサを示したブロック図である。第1メモリ1に格納さ
れているプログラムコードは、定められたビット単位で
一時保持回路(QUE:プリフェッチ・キューと言い、
命令の先読みをするもので、FIFOで構成されてい
る)2に保持される。この保持されたプログラムコード
は、プリデコーダ3によって、命令部分、オペランド部
分、オペランドデータに分けられる。命令部分のコード
は、PLA(プログラマブル・ロジック・アレイ)4に
送られる。PLA4は、マシンサイクルごとに制御信号
を実行部5に送る。実行部5は、汎用レジスタ7と第2
メモリ6との間でのデータのストア処理やロード処理等
を実行する。なお、オペランドデータ(即値のデータ、
レジスタリストデータ)は、直接命令の識別にかかわら
ないので、一時保持回路(QUE)2からPLA4の制
御信号によって直接に実行部5(又は実行部5に設けら
れたビット検索回路8)に送られる。
FIG. 1 is a block diagram showing a microprocessor according to this embodiment. The program code stored in the first memory 1 is stored in a temporary holding circuit (QUE: called a prefetch queue;
The instruction is prefetched, and is configured by a FIFO). The stored program code is divided by the predecoder 3 into an instruction part, an operand part, and operand data. The code of the instruction portion is sent to a PLA (programmable logic array) 4. The PLA 4 sends a control signal to the execution unit 5 every machine cycle. The execution unit 5 includes the general-purpose register 7 and the second
The storage processing and the loading processing of data with the memory 6 are executed. Note that operand data (immediate data,
The register list data) is not directly involved in the identification of the instruction, and thus is sent directly from the temporary holding circuit (QUE) 2 to the execution unit 5 (or the bit search circuit 8 provided in the execution unit 5) by the control signal of the PLA 4. .

【0017】図2は、実行部5に設けられているビット
検索回路8の構成および実行部5のレジスタ指示回路1
4との関係を示したブロック図である。ビット検索回路
8は、検索対象ビット列であるレジスタリスト(前述の
汎用レジスタ7の任意の番号のレジスタを指定するため
のビット列である)を保持するレジスタリスト保持回路
(ビット列保持回路)11と、このレジスタリスト保持
回路11が保持するレジスタリストから最初の“0”ま
たは“1”のビット位置(この実施の形態では“1”の
ビット位置)を検出するビット位置検出回路12と、検
出された位置のビットを書き換えて前記レジスタリスト
保持回路11に保持させるビットリジェクト回路13と
を備えている。また、レジスタ指示回路14は、前記ビ
ット位置検出回路12にて検出されたレジスタ番号にて
前記汎用レジスタ7中の各レジスタを指定する。
FIG. 2 shows the configuration of the bit search circuit 8 provided in the execution unit 5 and the register designating circuit 1 of the execution unit 5.
FIG. 4 is a block diagram showing a relationship with the fourth embodiment. The bit search circuit 8 includes a register list holding circuit (bit string holding circuit) 11 for holding a register list as a search target bit string (a bit string for specifying a register of an arbitrary number of the general-purpose register 7). A bit position detecting circuit 12 for detecting the first bit position of “0” or “1” (in this embodiment, a bit position of “1”) from the register list held by the register list holding circuit 11; And a bit reject circuit 13 for rewriting the bits in the register list holding circuit 11. Further, the register designating circuit 14 designates each register in the general-purpose register 7 by the register number detected by the bit position detecting circuit 12.

【0018】図3は、ビット検索回路8の具体的構成を
示した回路図である。図のQ0〜Q7は、レジスタリス
ト(QUE2から送られてくる)を示している。なお、
このレジスタリストデータのビット数を8個としている
のは、汎用レジスタ7が8本以下のレジスタ(r0〜r
7:図5のレジスタの半分の構成)から成っている場合
を想定して説明することとしているためであり、汎用レ
ジスタ7が9〜16本であればビット数は16個とな
り、19〜32本等に拡張される場合にはビット数は3
2個等となることは言うまでもない。Q0〜Q7は、ビ
ットリジェクト回路13の第2回路部13bを経てレジ
スタリスト保持回路11に入力されるようになってい
る。レジスタリスト保持回路11は、FF0〜FF7の
合計8個のフリップフロップから成り、ラッチ信号とな
るIQ_LT信号が立ち上がったときに各FFにおいて
入力を保持し、SB0〜SB7として出力する。
FIG. 3 is a circuit diagram showing a specific configuration of the bit search circuit 8. As shown in FIG. Q0 to Q7 in the figure indicate register lists (sent from QUE2). In addition,
The number of bits of the register list data is set to eight because the general-purpose register 7 has eight or less registers (r0 to r).
7: half the configuration of the register in FIG. 5), the number of bits becomes 16 if the number of general-purpose registers 7 is 9 to 16, and 19 to 32 When extended to books, etc., the number of bits is 3
Needless to say, there will be two. Q0 to Q7 are input to the register list holding circuit 11 via the second circuit section 13b of the bit reject circuit 13. The register list holding circuit 11 is composed of a total of eight flip-flops FF0 to FF7, and holds an input in each FF when an IQ_LT signal serving as a latch signal rises, and outputs it as SB0 to SB7.

【0019】前記ビット位置検出回路12は、第1回路
部12aと第2回路部12bとから成る。第1回路部1
2aは、7個の論理回路を備えている。第1段(図の最
も上段)の論理回路はSB0とSB1をそれぞれ反転入
力しそのANDをN0として出力する。第2段の論理回
路はSB2を反転入力するとともに前記第1段の論理回
路の出力を入力してそのANDをN1として出力する。
以下、同様に、各論理回路はSB3〜SB7の各出力を
反転入力するとともに各々の上側の段の論理回路の出力
を入力してそのANDをN2〜N5、及びIQ_NUL
Lとして出力するようになっている。ここで、SB0〜
SB7の全てが“0”である場合(レジスタリストがN
ULLの場合)には、N0=N1=N2=N3=N4=
N5=IQ_NULL=“1”となる。第2回路部12
bは、複数個の各種の論理回路にて構成されており、N
0〜N5、SB0、SB3、SB5、及びSB7を入力
し、R0、R1、及びR2の3つの信号を出力する。R
2〜R0は、レジスタの番号を示す信号である。例え
ば、“R2R1R0”=“001b”であれば、1番目
のレジスタr1を示し、“R2R1R0”=“101
b”であれば、5番目のレジスタr5を示すことにな
る。
The bit position detecting circuit 12 comprises a first circuit section 12a and a second circuit section 12b. First circuit unit 1
2a has seven logic circuits. The logic circuit of the first stage (the uppermost stage in the drawing) inverts SB0 and SB1 respectively and outputs the AND as N0. The logic circuit of the second stage inverts the input of SB2, inputs the output of the logic circuit of the first stage, and outputs its AND as N1.
Hereinafter, similarly, each logic circuit inverts each output of SB3 to SB7, inputs the output of the logic circuit of each upper stage, and outputs its AND to N2 to N5 and IQ_NUL.
L is output. Here, SB0
When all of SB7 are “0” (register list is N
In the case of ULL), N0 = N1 = N2 = N3 = N4 =
N5 = IQ_NULL = "1". Second circuit unit 12
b is composed of a plurality of various logic circuits;
0 to N5, SB0, SB3, SB5, and SB7 are input, and three signals R0, R1, and R2 are output. R
2 to R0 are signals indicating register numbers. For example, if “R2R1R0” = “001b”, it indicates the first register r1, and “R2R1R0” = “101
If "b", it indicates the fifth register r5.

【0020】ビットリジェクト回路13は、第1回路部
13aと第2回路部13bとから成る。第1回路部13
aは8個のNAND論理回路から成り、各入力端子部に
N0〜N5およびSB0〜SB7を適宜入力するともに
入力部の一つにはSCAN信号を入力し、T0〜T7を
出力するように構成されている。前記SCAN信号は、
マイクロプログラムによりPLA4にて制御されるもの
である。そして、T0〜T7は、検出された位置のビッ
トの書換えを示す信号であり、検出されたビットが0番
目に位置するビットであったなら、T0は“0”とな
る。第2回路部13bは、8個の2入力AND論理回路
から成り、各論理回路の一方の入力部には前記T0〜T
7を入力し、他方の入力端子部には前記Q0〜Q7を入
力するようになっている。従って、例えば、T0が
“0”とされた場合、Q0が“1”であるとしても、そ
れは書き換えられてSB0は“0”とされる。
The bit reject circuit 13 comprises a first circuit section 13a and a second circuit section 13b. First circuit unit 13
"a" is composed of eight NAND logic circuits. N0 to N5 and SB0 to SB7 are appropriately input to each input terminal unit, and a SCAN signal is input to one of the input units and T0 to T7 is output. Have been. The SCAN signal is
It is controlled by the PLA 4 by a microprogram. T0 to T7 are signals indicating rewriting of the bit at the detected position. If the detected bit is the 0th bit, T0 becomes "0". The second circuit section 13b is composed of eight 2-input AND logic circuits, and one input section of each of the logic circuits has the T0 to T
7 and Q0 to Q7 are input to the other input terminal section. Therefore, for example, when T0 is set to “0”, even if Q0 is “1”, it is rewritten and SB0 is set to “0”.

【0021】図4は、8ビットのレジスタリストデータ
(Q0〜Q7)において、ビットが検出されて更にこの
検出された位置のビットが書き換えられてSB0〜SB
7として出力される様子を示した説明図である。同図
(a)に示すごとく、レジスタリストデータが“010
01100b”であるとする。ここで、レジスタリスト
データのビット番号“0,1,2,…,7”に対して、
レジスタ番号が“r0,r1,r2,…,r7”のごと
く対応するのであれば、同図(a)のレジスタリストデ
ータは、r1,r4,r5の3本の汎用レジスタを指定
していることになる(この場合を正転とし、以下におい
ては正転の場合を例に説明する)。一方、レジスタリス
トデータのビット番号が“0,1,2,…,7”に対し
てレジスタ番号が“r7,r6,r5,…,r0”のご
とく対応するのであれば、同図(a)のレジスタリスト
データは、r6,r3,r2の3本の汎用レジスタを指
定していることになる(この場合を逆転とする)。
FIG. 4 shows that, in the 8-bit register list data (Q0 to Q7), a bit is detected and the bit at the detected position is further rewritten to SB0 to SB7.
FIG. 7 is an explanatory diagram showing a state of being output as 7; As shown in FIG. 11A, the register list data is "010".
01100b ". Here, for the bit numbers" 0, 1, 2, ..., 7 "of the register list data,
If the register numbers correspond to “r0, r1, r2,..., R7”, the register list data in FIG. 9A specifies three general-purpose registers r1, r4, and r5. (This case is defined as normal rotation, and the case of normal rotation will be described below as an example). On the other hand, if the bit number of the register list data corresponds to “0, 1, 2,..., 7”, the register number corresponds to “r7, r6, r5,. Register list data designates three general-purpose registers r6, r3, and r2 (this case is assumed to be the reverse).

【0022】以下、上記の図4を例にビット検索処理お
よび検出された位置のビットの書き換え処理を説明して
いく。当初は、レジスタリストデータ(Q0〜Q7)=
SB0〜SB7=“01001100b”であり(r
1,r4,r5の3本のレジスタを指定)、このデータ
が入力されると、N0〜N5=“000000”とな
る。この場合、N0=“0”で且つSB0=“0”なの
で、R0=“1”となり、N0=“0”であるからR1
=“0”となり、N2=“0”であるからR2=“0”
となる。従って、“R2R1R0”=“001”とな
り、第1番目のビット(即ち、レジスタr1の指定)が
検出されることになる(同図(b)参照)。そして、第
1番目のビットに対する書換え信号となるT1を出力す
る論理回路へは、SB0=“0”の反転信号である
“1”と、SB1=“1”と、SCAN=“1”とが入
力されるので、T1=“0”となる。これにより、Q1
がマスクされてSB1=“0”となり、SB0〜SB7
=“00001100b”のごとく書換えがなされる
(同図(c)参照)。
Hereinafter, the bit search process and the rewriting process of the bit at the detected position will be described with reference to FIG. 4 as an example. Initially, register list data (Q0 to Q7) =
SB0 to SB7 = "01001100b" (r
When these data are inputted, N0 to N5 = "000000". In this case, since N0 = “0” and SB0 = “0”, R0 = “1”, and since N0 = “0”, R1
= "0" and N2 = "0", so R2 = "0"
Becomes Therefore, “R2R1R0” = “001”, and the first bit (that is, the designation of the register r1) is detected (see FIG. 13B). Then, to the logic circuit that outputs T1 as a rewrite signal for the first bit, “1” which is an inverted signal of SB0 = “0”, SB1 = “1”, and SCAN = “1” Since it is input, T1 = "0". As a result, Q1
Is masked, SB1 = "0", and SB0 to SB7
= “00001100b” (see FIG. 3C).

【0023】上記書換えの後、IQ_NULL=“1”
か否かが判断されるが、SB0〜SB7=“00001
100b”の状態では、IQ_NULL=“0”になる
ので、ビット検索が続行される。上記の書換えがなされ
た信号の入力によって、N0〜N5=“111000”
となる。N2=“1”なのでR2=“1”となり、N4
=“0”なのでR1=“0”となり、また、R0=
“0”となるので、“R2R1R0”=“100”とな
り、第4番目のビット(即ち、レジスタr4の指定)が
検出されることになる(同図(d)参照)。そして、第
4番目のビットに対する書換え信号となるT4を出力す
る論理回路へは、SB4=“1”と、N2=“1”と、
SCAN=“1”とが入力されるので、T4=“0”と
なる。これにより、Q4がマスクされてSB4=“0”
となり、SB0〜SB7=“00000100b”のご
とく書換えがなされる(同図(e)参照)。
After the above rewriting, IQ_NULL = "1"
It is determined whether or not SB0 to SB7 = “00001”.
In the state of "100b", IQ_NULL = "0", so that the bit search is continued. By the input of the rewritten signal, N0 to N5 = "111000".
Becomes Since N2 = “1”, R2 = “1” and N4
= "0", R1 = "0", and R0 =
Since it becomes "0", "R2R1R0" = "100", and the fourth bit (that is, the designation of the register r4) is detected (see FIG. 4D). Then, to the logic circuit that outputs T4 as a rewrite signal for the fourth bit, SB4 = “1”, N2 = “1”,
Since SCAN = "1" is input, T4 = "0". As a result, Q4 is masked and SB4 = "0"
And rewriting is performed as SB0 to SB7 = “00000100b” (see FIG. 9E).

【0024】上記書換えの後、IQ_NULL=“1”
か否かが判断されるが、SB0〜SB7=“00000
100b”の状態では、IQ_NULL=“0”になる
ので、ビット検索が続行される。上記の書換えがなされ
た信号の入力によって、N0〜N5=“111100”
となる。N2=“1”なのでR2=“1”となり、N4
=“0”なのでR1=“0”となり、また、N3=
“1”で且つSB5=“1”なのでR0=“1”とな
る。従って、“R2R1R0”=“101”となり、第
5番目のビット(即ち、レジスタr5の指定)が検出さ
れることになる(同図(f)参照)。そして、第5番目
のビットに対する書換え信号となるT5を出力する論理
回路へは、SB5=“1”と、N3=“1”と、SCA
N=“1”とが入力されるので、T5=“0”となる。
これにより、Q5がマスクされてSB5=“0”とな
り、SB0〜SB7=“00000000b”のごとく
書換えがなされる(同図(e)参照)。
After the above rewriting, IQ_NULL = "1"
It is determined whether or not SB0 to SB7 = “00000”.
In the state of "100b", IQ_NULL = "0", so that the bit search is continued. By the input of the rewritten signal, N0 to N5 = "111100".
Becomes Since N2 = “1”, R2 = “1” and N4
= "0", R1 = "0", and N3 =
Since it is “1” and SB5 = “1”, R0 = “1”. Therefore, “R2R1R0” = “101”, and the fifth bit (that is, the designation of the register r5) is detected (see FIG. 11F). Then, to the logic circuit that outputs T5 as a rewrite signal for the fifth bit, SB5 = “1”, N3 = “1”, and SCA
Since N = “1” is input, T5 = “0”.
As a result, Q5 is masked, SB5 = "0", and rewriting is performed as SB0-SB7 = "00000000b" (see FIG. 11E).

【0025】そして、このように、SB0〜SB7=
“00000000b”になると、IQ_NULL=
“1”になるので、ビット検索の終了が検出される。
Then, as described above, SB0-SB7 =
When “00000000b” is reached, IQ_NULL =
Since it becomes "1", the end of the bit search is detected.

【0026】次に、複数のレジスタを扱う命令セットに
おいて上述したビット検索処理を行うときのマイクロプ
ログラミング制御を、LDMという命令を例に説明す
る。まず、LDMのマイクロコードが第1メモリ1から
一時保持回路(QUE)2に転送され、プリデコーダ3
によって解読されて命令部分とオペランド部分とに分け
られる。また、レジスタリストは、QUE2に蓄えられ
る。そして、PLA4からは、マシンサイクルごとに実
行部5に制御信号が与えられるが、1マシンサイクル目
においては、レジスタリストをQUE2からレジスタリ
スト保持回路11にバスを経由して転送するための制御
信号を与える。また、LDMは、第2メモリ6から汎用
レジスタ7にデータを転送するため、第2メモリ6のア
ドレス情報が必要となり、このアドレス情報はオペラン
ド部分に存在するため、1マシンサイクル目に同時に別
のバスを経由して実行部5にアドレス情報を転送する。
Next, the microprogramming control for performing the above-described bit search processing in an instruction set that handles a plurality of registers will be described using an instruction called LDM as an example. First, the LDM microcode is transferred from the first memory 1 to the temporary holding circuit (QUE) 2 and the predecoder 3
To be divided into an instruction part and an operand part. The register list is stored in QUE2. Then, a control signal is provided from the PLA 4 to the execution unit 5 every machine cycle. give. Further, the LDM transfers data from the second memory 6 to the general-purpose register 7, so that address information of the second memory 6 is required. Since this address information exists in the operand portion, another address is simultaneously provided in the first machine cycle. The address information is transferred to the execution unit 5 via the bus.

【0027】1マシンサイクル後半には、PLA4は、
レジスタリストのNULL判定をするための制御信号を
実行部5に出力する。判定結果は、次の2マシンサイク
ル目に現れるため、もしNULLであればレジスタリス
トには転送すべきレジスタがないということなので、3
マシンサイクル目にLDMを終了する制御信号が出力さ
れる。NULL以外であれば、転送されるレジスタが存
在するため、3マシンサイクル以降でレジスタリストの
処理が行われる。
In the latter half of one machine cycle, PLA4
A control signal for making a NULL determination in the register list is output to the execution unit 5. Since the judgment result appears in the next second machine cycle, if NULL, it means that there is no register to be transferred in the register list.
A control signal for terminating LDM is output in the machine cycle. If it is other than NULL, there are registers to be transferred, so that the register list is processed after three machine cycles.

【0028】レジスタリストの処理は一つのレジスタに
対して3マシンサイクルで行われるようにしている。
The processing of the register list is performed for one register in three machine cycles.

【0029】(1マシンサイクル目)レジスタリスト中
の“1”の存在するビットをビット位置検出回路12に
より検出する。同時に実行部5は前述したアドレス情報
をADD(メモリへの入出力の際のメモリアドレスを保
持するレジスタである)に転送する。実行部5による第
2メモリ6とのやり取りの際、このADDがアドレスと
して参照される。また、ビットリジェクト回路13にて
レジスタリスト保持回路11のレジスタリストに対する
ビット書換え(検出された位置のビット“1”→
“0”)を行う。また、レジスタリストのNULL判定
(次のサイクルで行う)を行うための制御信号を出力す
る。
(First Machine Cycle) The bit position detection circuit 12 detects a bit having "1" in the register list. At the same time, the execution unit 5 transfers the above-mentioned address information to ADD (a register that holds a memory address when inputting / outputting to / from a memory). When the execution unit 5 exchanges data with the second memory 6, the ADD is referred to as an address. In addition, the bit reject circuit 13 rewrites bits in the register list of the register list holding circuit 11 (bit “1” at the detected position →
“0”). Also, it outputs a control signal for performing NULL determination (performed in the next cycle) of the register list.

【0030】(2マシンサイクル目)検索されたビット
の位置を示す番号(即ち、レジスタ番号)をレジスタ指
定回路14に転送する。また、書き換えられたレジスタ
リストがNULLとなったか否かの判定を行う。
(Second machine cycle) The number (ie, register number) indicating the position of the searched bit is transferred to the register specifying circuit 14. Further, it is determined whether or not the rewritten register list has become NULL.

【0031】(3マシンサイクル目)レジスタリストが
NULLとなったのであれば、この3マシンサイクル目
に命令の処理を終了する。一方、レジスタリストがNU
LLでなければ、前述した1マシンサイクル目における
処理と同処理を実行し、レジスタリストがNULLとな
るまで続けられる。
(Third Machine Cycle) If the register list becomes NULL, the instruction processing is completed in the third machine cycle. On the other hand, if the register list is NU
If it is not LL, the same processing as the processing in the first machine cycle described above is executed, and the processing is continued until the register list becomes NULL.

【0032】なお、以上の実施例では、検索対象ビット
列から最初の“1”のビット位置を検出するようにした
が、最初の“0”のビット位置を検出し、“1”に書き
換える構成としてもよいものであり、また、検索対象ビ
ット列中の全てのビットが“1”となったときにレジス
タリストがNULLとなったことを示す信号を出力する
構成としてもよいものである。
In the above embodiment, the first bit position of "1" is detected from the bit string to be searched, but the first bit position of "0" is detected and rewritten to "1". Alternatively, the configuration may be such that a signal indicating that the register list is NULL is output when all bits in the search target bit string become “1”.

【0033】また、レジスタリストデータのビット番号
が“0,1,2,…,7”に対してレジスタ番号が“r
7,r6,r5,…,r0”のごとく対応するのであれ
ば、出力端子R2R1R0に、図5のようにXOR回路
を接続し、入力端子REG_REVで制御する事によ
り、出力信号を反転し期待するレジスタ番号を得る。例
えば、レジスタリストデータが“00100000”で
あった場合、期待する転送レジスタはr5であるが、そ
の時の“R2R1R0”=“010”となるが、REG
_REVを“1”にする事で各ビットを反転し、“RR
2RR1RR0”=“101”となり、期待するレジス
タ番号が得られる。
When the bit number of the register list data is "0, 1, 2, ..., 7", the register number is "r".
7, r6, r5,..., R0 ", an output signal is inverted by connecting an XOR circuit to the output terminal R2R1R0 as shown in FIG. 5 and controlling the input terminal REG_REV. For example, if the register list data is “00100000”, the expected transfer register is r5, and “R2R1R0” = “010” at that time.
By setting _REV to “1”, each bit is inverted and “RR”
2RR1RR0 "=" 101 ", and the expected register number is obtained.

【0034】[0034]

【発明の効果】以上説明したように、この発明によれ
ば、オフセット回路、カウンタ回路、或いは減算回路と
いった回路を必要とせずにビット検索やその終了を検出
することができる。また、ビット検索回路及びレジスタ
指示回路をマイクロプログラミング制御するマイクロプ
ロセッサであれば、複数の任意のレジスタを扱う命令処
理のマシンサイクルを好適に制御できるという効果を奏
する。
As described above, according to the present invention, a bit search and its end can be detected without the need for a circuit such as an offset circuit, a counter circuit, or a subtraction circuit. In addition, a microprocessor that microprograms and controls a bit search circuit and a register designating circuit has an effect that a machine cycle of instruction processing that handles a plurality of arbitrary registers can be suitably controlled.

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

【図1】この発明の実施の形態のマイクロプロセッサを
示すブロック図である。
FIG. 1 is a block diagram showing a microprocessor according to an embodiment of the present invention.

【図2】この発明の実施の形態のビット検出装置を示す
ブロック図である。
FIG. 2 is a block diagram illustrating a bit detection device according to an embodiment of the present invention.

【図3】図2のビット検出装置の詳細を示す回路図であ
る。
FIG. 3 is a circuit diagram showing details of a bit detection device of FIG. 2;

【図4】この発明のレジスタリストにおいて、検出され
た位置のビットが書き換えられて出力される様子を示し
た説明図である。
FIG. 4 is an explanatory diagram showing a state in which a bit at a detected position is rewritten and output in a register list of the present invention.

【図5】レジスタ指示回路の一例を示す図である。FIG. 5 is a diagram illustrating an example of a register instruction circuit.

【図6】レジスタリストの説明図である。FIG. 6 is an explanatory diagram of a register list.

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

1 第1メモリ 2 一時保持回路(QUE) 3 プリデコーダ 4 PLA 5 実行部 6 第2メモリ 7 汎用レジスタ 8 ビット検索回路 11 レジスタリスト保持回路 12 ビット位置検出回路 13 ビットリジェクト回路 14 レジスタ指定回路 DESCRIPTION OF SYMBOLS 1 1st memory 2 Temporary holding circuit (QUE) 3 Predecoder 4 PLA 5 Execution part 6 2nd memory 7 General-purpose register 8 Bit search circuit 11 Register list holding circuit 12 Bit position detection circuit 13 Bit reject circuit 14 Register specification circuit

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 検索対象ビット列を保持するビット列保
持回路と、このビット列保持回路が保持する検索対象ビ
ット列から最初の“0”または“1”のビット位置を検
出するビット位置検出回路と、検出された位置のビット
を書き換えて前記ビット列保持回路に保持させるビット
リジェクト回路とを備えていることを特徴とするビット
検索回路。
A bit string holding circuit for holding a bit string to be searched, a bit position detecting circuit for detecting the first bit position of "0" or "1" from the bit string to be searched held by the bit string holding circuit, And a bit reject circuit for rewriting the bit at the set position and holding the bit string in the bit string holding circuit.
【請求項2】 前記ビット列保持回路が保持する検索対
象ビット列中の全てのビットが“0”または“1”とな
った場合にそのことを示す信号を出力する出力部を備え
ていることを特徴とする請求項1に記載のビット検索回
路。
2. An output unit for outputting a signal indicating that all bits in a search target bit string held by the bit string holding circuit have become “0” or “1”. 2. The bit search circuit according to claim 1, wherein:
【請求項3】 請求項1又は請求項2に記載のビット検
索回路、及び検出されたビットの位置に基づいてレジス
タを指定するレジスタ指示回路を実行部に備え、当該ビ
ット検索回路及びレジスタ指示回路がマイクロプログラ
ミングに基づく制御信号によって制御されるように構成
されていることを特徴とするマイクロプロセッサ。
3. An execution unit comprising: a bit search circuit according to claim 1; and a register designating circuit for designating a register based on a detected bit position. Is configured to be controlled by a control signal based on microprogramming.
JP9121149A 1997-05-12 1997-05-12 Bit retrieval circuit and method processor having the same Pending JPH10312279A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP9121149A JPH10312279A (en) 1997-05-12 1997-05-12 Bit retrieval circuit and method processor having the same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP9121149A JPH10312279A (en) 1997-05-12 1997-05-12 Bit retrieval circuit and method processor having the same

Publications (1)

Publication Number Publication Date
JPH10312279A true JPH10312279A (en) 1998-11-24

Family

ID=14804074

Family Applications (1)

Application Number Title Priority Date Filing Date
JP9121149A Pending JPH10312279A (en) 1997-05-12 1997-05-12 Bit retrieval circuit and method processor having the same

Country Status (1)

Country Link
JP (1) JPH10312279A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009020833A (en) * 2007-07-13 2009-01-29 Internatl Business Mach Corp <Ibm> Technology for caching data

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009020833A (en) * 2007-07-13 2009-01-29 Internatl Business Mach Corp <Ibm> Technology for caching data

Similar Documents

Publication Publication Date Title
US5742805A (en) Method and apparatus for a single history register based branch predictor in a superscalar microprocessor
JP2750311B2 (en) Apparatus and method for controlling execution of data operations in a data processing device
EP0180196B1 (en) Programmable counter/timer device
US5123108A (en) Improved cpu pipeline having register file bypass and working register bypass on update/access address compare
JPS635777B2 (en)
US5682531A (en) Central processing unit
JPS6150337B2 (en)
EP0062658A4 (en) Stack for a data processor.
US4631672A (en) Arithmetic control apparatus for a pipeline processing system
US5586337A (en) Programmable controller with timing control
JP2916605B2 (en) Computer processor
JPH10312279A (en) Bit retrieval circuit and method processor having the same
JPH0528431B2 (en)
JPH07219766A (en) Arithmetic processor
JP2525492B2 (en) Programmable controller
JPS59123934A (en) Programmable logic controller
US4511983A (en) Apparatus for controlling microinstructions stored in a data processing unit memory
JPS6242301B2 (en)
JP3033597B2 (en) Priority encoder and semiconductor integrated circuit using the same
JPH0447851B2 (en)
JPH04365170A (en) Digital signal processing semiconductor integrated circuit
JPH06162067A (en) Device and method for controlling vector instruction
US5822775A (en) Efficient data processing method for coefficient data in a digital dignal, processor
JPH01251233A (en) Processor
JPH033037A (en) Microprogram control system

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20040210