JPH05241825A - Microprocessor - Google Patents

Microprocessor

Info

Publication number
JPH05241825A
JPH05241825A JP4012719A JP1271992A JPH05241825A JP H05241825 A JPH05241825 A JP H05241825A JP 4012719 A JP4012719 A JP 4012719A JP 1271992 A JP1271992 A JP 1271992A JP H05241825 A JPH05241825 A JP H05241825A
Authority
JP
Japan
Prior art keywords
flag
register
arithmetic
instruction
conditional
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
JP4012719A
Other languages
Japanese (ja)
Inventor
Hiroyasu Otomo
博康 大友
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP4012719A priority Critical patent/JPH05241825A/en
Publication of JPH05241825A publication Critical patent/JPH05241825A/en
Withdrawn legal-status Critical Current

Links

Abstract

PURPOSE:To decrease the using frequency of a branch instruction with a condition, and to shorten a processing time. CONSTITUTION:This device is equipped with an instruction memory 2 which stores an instruction for controlling a system, program counter l which designates the reading address, command decoder 3 which controls the operation of a processor by decoding the content of the instruction memory 2, P and Q registers 4 and 5 for an arithmetic input which store data to be computed, arithmetic circuit (EXU) 7 which inputs the data of the P and Q registers 4 and 5, R register 10 for an arithmetic output which stores the output data X, arithmetic flag register 11 which inputs and stores the flag of an arithmetic result from the arithmetic circuit 7 through a multiplexer (MUX) 12, and arithmetic control circuit 9 which controls the execution of a conditional arithmetic operation by using the value as a condition. The arithmetic flag register 11 independently stores the flag of the unconditional arithmetic result and the flag of the conditional arithmetic result.

Description

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

【0001】[0001]

【産業上の利用分野】本発明はマイクロプロセッサに関
し、特に演算フラグレジスタの値を条件として条件演算
の実行を制御する事が可能なマイクロプロセッサの、演
算フラグレジスタの構成に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a microprocessor, and more particularly to a structure of a computation flag register of a microprocessor capable of controlling execution of conditional computation on the condition of a value of a computation flag register.

【0002】[0002]

【従来の技術】従来より、1組〜2組の演算フラグレジ
スタを有するマイクロプロセッサや条件演算命令を有す
るマイクロプロセッサがあった。以下に、例を挙げその
動作について説明する。まず、1組の演算フラグレジス
タを有するマイクロプロセッサに、例えばμPD701
16(商品名)がある。その演算回路で演算を行う場合
は、演算フラグレジスタの複数のビットが演算結果の影
響を受ける。そこで演算フラグレジスタの値を条件とし
て実行できる命令は、条件付きブランチ命令のみであ
る。演算フラグレジスタの値を条件とした、演算の実行
/無視の選択は、条件付きブランチ命令で分岐させて行
う。
2. Description of the Related Art Conventionally, there have been microprocessors having one to two sets of operation flag registers and microprocessors having conditional operation instructions. The operation will be described below with an example. First, a microprocessor having a set of operation flag registers, for example, μPD701
There are 16 (trade names). When the operation circuit performs an operation, a plurality of bits of the operation flag register are affected by the operation result. Therefore, the conditional branch instruction is the only instruction that can be executed using the value of the operation flag register as a condition. Selection of execution / ignore of an operation based on the value of the operation flag register is performed by branching with a conditional branch instruction.

【0003】2組の演算フラグレジスタを有するマイク
ロプロセッサとしては、ネイティブ・モードで使用され
る演算フラグレジスタと、エミュレーション・モードで
使用される演算フラグレジスタを有するマイクロプロセ
ッサや、2組の演算フラグレジスタをエクスチェンジ命
令で切り換えることができるものがある。2組の演算フ
ラグレジスタとも、演算フラグレジスタの値を条件とし
て実行できる命令は、条件付きブランチ命令のみであ
る。
As a microprocessor having two sets of operation flag registers, a microprocessor having an operation flag register used in a native mode and an operation flag register used in an emulation mode, and two sets of operation flag registers There are some that can be switched with an exchange command. In both sets of operation flag registers, the conditional branch instruction is the only instruction that can be executed with the value of the operation flag register as a condition.

【0004】条件演算命令を有するマイクロプロセッサ
には、条件付きブランチ命令に加え、演算フラグレジス
タの値を条件として演算の実行/無視の選択も可能であ
る。条件が偽の場合、演算は無視され演算フラグレジス
タの値は保持され、条件が真の場合、演算が実行され演
算フラグレジスタの値は更新される。演算フラグレジス
タの値を条件とする処理内容が、1命令の場合は条件演
算命令を使用できるが、複数の演算を含む場合は条件付
きブランチ命令で分岐させて処理する。
For a microprocessor having a conditional operation instruction, in addition to a conditional branch instruction, it is possible to select whether to execute or ignore the operation on the condition of the value of the operation flag register. When the condition is false, the operation is ignored and the value of the operation flag register is held, and when the condition is true, the operation is executed and the value of the operation flag register is updated. A conditional operation instruction can be used when the content of processing that is conditional on the value of the operation flag register is one instruction. However, when a plurality of operations are included, a conditional branch instruction is used for branching.

【0005】マイクロプロセッサで条件演算命令を有す
ることは、演算の実行/無視の選択のための条件付きブ
ランチ命令の実行を削減でき、命令メモリの削減と処理
時間の短縮に有効である。命令のフェッチ、デコード、
オペランド・フェッチ、演算、ライト・バックをパイプ
ラインで処理する、高速なマイクロプロセッサでは、特
に有効である。なお、図4は従来のマイクロプロセッサ
の一例を用いて除算の処理をする手順を示すフローチャ
ートである。
Having the conditional operation instruction in the microprocessor can reduce the execution of conditional branch instruction for selecting execution / ignore of the operation, which is effective in reducing the instruction memory and the processing time. Instruction fetch, decode,
It is especially effective in high-speed microprocessors that pipeline operand fetch, operation, and write back. Note that FIG. 4 is a flow chart showing a procedure of a division process using an example of a conventional microprocessor.

【0006】[0006]

【発明が解決しようとする課題】上述した従来のマイク
ロプロセッサは、条件演算命令を有するマイクロプロセ
ッサでさえ、演算フラグレジスタの値を条件とする処理
内容が、複数の演算を含む場合は、条件付きブランチ命
令で分岐させて処理する必要が有り、条件演算命令の効
果を十分に利用できなかった。
The conventional microprocessor described above, even if it has a conditional operation instruction, is conditional if the processing contents conditional on the value of the operation flag register include a plurality of operations. It was necessary to branch and process with a branch instruction, and the effect of the conditional operation instruction could not be fully utilized.

【0007】本発明の目的は、無条件演算フラグレジス
タの値を条件とする複数の条件演算命令を含む処理で
も、条件付きブランチ命令で分岐させること無く、条件
演算命令のみで処理できるマイクロプロセッサを提供す
ることにある。
An object of the present invention is to provide a microprocessor capable of processing only a conditional operation instruction without branching by a conditional branch instruction even in a processing including a plurality of conditional operation instructions whose condition is the value of an unconditional operation flag register. To provide.

【0008】[0008]

【課題を解決するための手段】本発明のマイクロプロセ
ッサは、システムを制御するための命令を格納する命令
メモリと、該命令メモリの読出アドレスを指定するプロ
グラム・カウンタと、前記命令メモリの内容を解読しプ
ロセッサの動作を制御する命令デコーダと、被演算デー
タを記憶する演算入力レジスタと、該演算入力レジスタ
のデータを入力とする演算回路と、該演算回路の出力デ
ータを記憶する演算出力レジスタと、前記演算回路での
演算結果のフラグを記憶する演算フラグレジスタと、該
演算フラグレジスタの値を条件として条件演算の実行を
制御する演算制御回路とを有するマイクロプロセッサに
おいて、前記演算フラグレジスタが、無条件演算結果の
フラグと条件演算結果のフラグとを独立に記憶するレジ
スタを有して構成される。
SUMMARY OF THE INVENTION A microprocessor of the present invention stores an instruction memory for storing instructions for controlling a system, a program counter for designating a read address of the instruction memory, and contents of the instruction memory. An instruction decoder that decodes and controls the operation of the processor, an operation input register that stores the operation target data, an operation circuit that receives the data of the operation input register as an input, and an operation output register that stores the output data of the operation circuit. In a microprocessor having an operation flag register for storing a flag of an operation result in the operation circuit and an operation control circuit for controlling execution of conditional operation on the condition of the value of the operation flag register, the operation flag register is: Consists of a register that stores the unconditional operation result flag and the conditional operation result flag independently It is.

【0009】[0009]

【実施例】次に、本発明について図面を用いて説明す
る。図1は本発明の第1の実施例のブロック図である。
本実施例のマイクロプロセッサは、システムを制御する
ための命令を格納する命令メモリ2と、その読出アドレ
スを指定するプログラム・カウンタ1と、命令メモリ2
の内容を解読しプロセッサの動作を制御する命令デコー
ダ3と、被演算データを記憶する演算入力用のP,Qレ
ジスタ4,5と、P,Qレジスタ4,5のデータを入力
とする演算回路(EXU)7と、その出力データXを記
憶する演算出力用のRレジスタ10と、演算回路7での
演算結果Yのフラグをマルチプレクッサ(MUX)12
を通して入力して記憶する演算フラグレジスタ11と、
その値を条件として条件演算の実行を制御する演算制御
回路9とを有し、この演算フラグレジスタ11は、無条
件演算結果のフラグと条件演算結果のフラグの二つを内
部で独立に記憶する構成になっている。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Next, the present invention will be described with reference to the drawings. FIG. 1 is a block diagram of the first embodiment of the present invention.
The microprocessor of this embodiment includes an instruction memory 2 for storing instructions for controlling the system, a program counter 1 for designating a read address of the instruction memory 2, and an instruction memory 2.
An instruction decoder 3 for decoding the contents of the above and controlling the operation of the processor, P and Q registers 4 and 5 for operation input for storing data to be operated, and an operation circuit for receiving the data of P and Q registers 4 and 5 (EXU) 7, an R register 10 for operation output that stores the output data X thereof, and a flag of the operation result Y in the operation circuit 7 to a multiplexer (MUX) 12
An operation flag register 11 which is input and stored through
The operation flag register 11 has an operation control circuit 9 for controlling the execution of conditional operation using the value as a condition. The operation flag register 11 internally stores two flags, an unconditional operation result flag and a conditional operation result flag. It is configured.

【0010】レジスタプログラム・カウンタ1は命令メ
モリ2のアドレスを示すレジスタであり、インクリメン
ト動作と命令による書換えができる。命令メモリ2はシ
ステムを制御するための命令を格納するメモリで、プロ
グラム・カウンタ1で指定されたアドレスS1の内容S
2を命令デコーダ3に対して出力する。命令デコーダ3
は命令メモリ2から選択的に出力される命令S2を解読
しプロセッサの動作を制御するマイクロプロセッサ内の
各ユニットに対する制御信号S3を出力する。Pレジス
タ4およびQレジスタ5は、被演算データを記憶する演
算入力レジスタで、メインバス6からデータを入力でき
る。演算回路7は、Pレジスタ4およびQレジスタ5の
データを入力とする演算回路である。
The register program counter 1 is a register indicating the address of the instruction memory 2, and can be incremented and rewritten by an instruction. The instruction memory 2 is a memory for storing instructions for controlling the system, and the content S of the address S1 designated by the program counter 1
2 is output to the instruction decoder 3. Instruction decoder 3
Outputs the control signal S3 for each unit in the microprocessor which decodes the instruction S2 selectively output from the instruction memory 2 and controls the operation of the processor. The P register 4 and the Q register 5 are operation input registers that store data to be operated, and can input data from the main bus 6. The arithmetic circuit 7 is an arithmetic circuit to which the data of the P register 4 and the Q register 5 are input.

【0011】マルチプレクサ8は、演算制御回路9の出
力する制御信号S9によりPレジスタまたは演算回路7
の出力信号YまたはXを選択して、Rレジスタ10に対
して信号S8を出力する。Rレジスタ10のデータS1
0はメインバス6に対して出力する。演算制御回路9
は、命令デコーダ3でデコードした演算の種類に対応し
て、マルチプレクサ8,マルチプレクサ12およびマル
チプレクサ13へ制御信号S9を出力する。
The multiplexer 8 is a P register or an arithmetic circuit 7 according to a control signal S9 output from the arithmetic control circuit 9.
The output signal Y or X is selected and the signal S8 is output to the R register 10. Data S1 of R register 10
0 is output to the main bus 6. Arithmetic control circuit 9
Outputs a control signal S9 to the multiplexers 8, 12, and 13 in accordance with the type of operation decoded by the instruction decoder 3.

【0012】演算の種類と各マルチプレクサの選択信号
の関係を表1に示す。演算フラグレジスタ11は、上位
に無条件演算結果のフラグを、下位に条件演算結果のフ
ラグを複合したデータを記憶するレジスタである。
Table 1 shows the relationship between the type of operation and the selection signal of each multiplexer. The operation flag register 11 is a register that stores data in which a flag of an unconditional operation result is in the upper part and a flag of the condition operation result is in a lower part.

【0013】[0013]

【表1】 [Table 1]

【0014】図2は本実施例のマイクロプロセッサを使
用して除算の処理をする場合の手順を示すフローチャー
トである。本実施例の効果は、工程Bの条件演算S4お
よび条件演算S5に表れている。例えば無条件演算,条
件演算を1サイクル命令、条件分岐命令を2サイクル命
令とすると、ループ回数Nを16とした場合、本実施例
のマイクロプロセッサでは113サイクルで処理でき、
従来のマイクロプロセッサでは最大145サイクルを要
する。本実施例により命令数の削減と、20%以上処理
時間の短縮でがきることになる。
FIG. 2 is a flow chart showing a procedure for a division process using the microprocessor of this embodiment. The effects of this embodiment are shown in the conditional operation S4 and the conditional operation S5 in the process B. For example, if the unconditional operation and the conditional operation are 1 cycle instruction and the conditional branch instruction is 2 cycle instruction, and the number of loops N is 16, the microprocessor of this embodiment can process in 113 cycles,
A conventional microprocessor requires up to 145 cycles. According to this embodiment, the number of instructions can be reduced and the processing time can be shortened by 20% or more.

【0015】図3は本発明の第2の実施例のブロック図
である。演算フラグエンコーダ14は、演算回路7での
演算結果のフラグを条件フラグにコンバートする論理回
路である。例として、ゼロ・フラグとサイン・フラグを
演算フラグエンコーダの入力とした場合の出力データを
表2に示す。
FIG. 3 is a block diagram of the second embodiment of the present invention. The operation flag encoder 14 is a logic circuit that converts the flag of the operation result of the operation circuit 7 into a condition flag. As an example, Table 2 shows output data when the zero flag and the sine flag are input to the operation flag encoder.

【0016】[0016]

【表2】 [Table 2]

【0017】無条件演算フラグレジスタ11aは、無条
件演算結果の条件フラグを記憶するレジスタで、条件演
算フラグレジスタ11bは、条件演算結果の条件フラグ
を記憶するレジスタである。無条件演算フラグレジスタ
11aおよび条件演算フラグレジスタ11bのデータは
メインバス6に出力することができる。本実施例の効果
は第1の実施例の効果と同様である。
The unconditional operation flag register 11a is a register for storing the condition flag of the unconditional operation result, and the conditional operation flag register 11b is a register for storing the condition flag of the condition operation result. The data of the unconditional operation flag register 11a and the conditional operation flag register 11b can be output to the main bus 6. The effect of this embodiment is similar to that of the first embodiment.

【0018】[0018]

【発明の効果】以上説明したように本発明のマイクロプ
ロセッサは、無条件演算結果のフラグと条件演算結果の
フラグとを記憶する演算フラグレジスタと、演算フラグ
レジスタの値を条件として条件演算の実行を制御する演
算制御回路とを有するので、無条件演算フラグレジスタ
の値と条件演算フラグレジスタの値とを独立に評価で
き、複数の条件演算命令を一つの無条件演算の結果で制
御できる。従って、演算の実行/無視の選択のための条
件付きブランチ命令の実行を削減でき、命令メモリの削
減と処理時間の短縮ができるという利点がある。
As described above, the microprocessor of the present invention executes an operation flag register that stores a flag of an unconditional operation result and a flag of a condition operation result, and executes a conditional operation on the condition of the value of the operation flag register. Since it has an operation control circuit for controlling, the value of the unconditional operation flag register and the value of the conditional operation flag register can be evaluated independently, and a plurality of conditional operation instructions can be controlled by the result of one unconditional operation. Therefore, it is possible to reduce the execution of conditional branch instructions for selecting whether to execute or ignore the operation, and it is possible to reduce the instruction memory and the processing time.

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

【図1】本発明の第1の実施例のブロック図である。FIG. 1 is a block diagram of a first embodiment of the present invention.

【図2】図1のマイクロプロセッサを使用して除算の処
理をする場合の手順を示すフローチャートである。
FIG. 2 is a flow chart showing a procedure when a division process is performed using the microprocessor of FIG.

【図3】本発明の第2の実施例のブロック図である。FIG. 3 is a block diagram of a second embodiment of the present invention.

【図4】従来のマイクロプロセッサの一例を使用して除
算の処理をする場合の手順を示すフローチャートであ
る。
FIG. 4 is a flowchart showing a procedure when a division process is performed using an example of a conventional microprocessor.

【符号の説明】 1 プログラム・カウンタ 2 命令メモリ 3 命令デコーダ 4 Pレジスタ 5 Qレジスタ 6 メイン・バス 7 演算回路 8,12,13 マルチプレクサ 9 演算制御回路 10 Rレジスタ 11 演算フラグレジスタ 11a 無条件演算フラグレジスタ 11b 条件演算フラグレジスタ 14 演算フラグエンコーダ[Explanation of Codes] 1 Program Counter 2 Instruction Memory 3 Instruction Decoder 4 P Register 5 Q Register 6 Main Bus 7 Operation Circuit 8, 12, 13 Multiplexer 9 Operation Control Circuit 10 R Register 11 Operation Flag Register 11a Unconditional Operation Flag Register 11b Conditional operation flag register 14 Operation flag encoder

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 システムを制御するための命令を格納す
る命令メモリと、該命令メモリの読出アドレスを指定す
るプログラム・カウンタと、前記命令メモリの内容を解
読しプロセッサの動作を制御する命令デコーダと、被演
算データを記憶する演算入力レジスタと、該演算入力レ
ジスタのデータを入力とする演算回路と、該演算回路の
出力データを記憶する演算出力レジスタと、前記演算回
路での演算結果のフラグを記憶する演算フラグレジスタ
と、該演算フラグレジスタの値を条件として条件演算の
実行を制御する演算制御回路とを有するマイクロプロセ
ッサにおいて、前記演算フラグレジスタが、無条件演算
結果のフラグと条件演算結果のフラグとを独立に記憶す
るレジスタを有することを特徴とするマイクロプロセッ
サ。
1. An instruction memory for storing an instruction for controlling a system, a program counter for designating a read address of the instruction memory, and an instruction decoder for decoding the content of the instruction memory and controlling the operation of a processor. , An operation input register for storing data to be operated, an operation circuit for receiving data of the operation input register, an operation output register for storing output data of the operation circuit, and a flag of an operation result in the operation circuit. In a microprocessor having an operation flag register to be stored and an operation control circuit for controlling execution of conditional operation on the condition of the value of the operation flag register, the operation flag register includes a flag of an unconditional operation result and a condition operation result. A microprocessor having a register that stores a flag independently.
JP4012719A 1992-01-28 1992-01-28 Microprocessor Withdrawn JPH05241825A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4012719A JPH05241825A (en) 1992-01-28 1992-01-28 Microprocessor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4012719A JPH05241825A (en) 1992-01-28 1992-01-28 Microprocessor

Publications (1)

Publication Number Publication Date
JPH05241825A true JPH05241825A (en) 1993-09-21

Family

ID=11813239

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4012719A Withdrawn JPH05241825A (en) 1992-01-28 1992-01-28 Microprocessor

Country Status (1)

Country Link
JP (1) JPH05241825A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100829788B1 (en) * 2006-07-07 2008-05-16 삼성전자주식회사 Command decoding system, flash memory command decoding system and methods using the same

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100829788B1 (en) * 2006-07-07 2008-05-16 삼성전자주식회사 Command decoding system, flash memory command decoding system and methods using the same

Similar Documents

Publication Publication Date Title
US5222244A (en) Method of modifying a microinstruction with operands specified by an instruction held in an alias register
US6327650B1 (en) Pipelined multiprocessing with upstream processor concurrently writing to local register and to register of downstream processor
US6405302B1 (en) Microcomputer
US4954943A (en) Data processing system
JP2001515635A (en) VLIW processor commands of different widths
US5479622A (en) Single cycle dispatch delay in a multiple instruction dispatch mechanism of a data processing system
US6145075A (en) Apparatus and method for executing a single-cycle exchange instruction to exchange contents of two locations in a register file
JPH081602B2 (en) Data processing device
JP3781519B2 (en) Instruction control mechanism of processor
JPH0673105B2 (en) Instruction pipeline type microprocessor
JP4160705B2 (en) Processor and processor system
JPH05241825A (en) Microprocessor
WO2003093978A2 (en) Method and apparatus for swapping the contents of address registers
US5187782A (en) Data processing system
JPH0218729B2 (en)
JP2581565B2 (en) Data processing device that executes guarded instructions
JPH06103064A (en) Device and method for processing data
KR880000817B1 (en) Data processing apparatus and method
JP3019818B2 (en) Data processing method
JPH0793151A (en) Instruction supplying device
JP2856784B2 (en) Electronic computer
JP2924735B2 (en) Pipeline operation device and decoder device
JPS63293638A (en) Data processing system
JP2825315B2 (en) Information processing device
JP3651099B2 (en) Programmable controller

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: 19990408