JP2004118669A - Control device, control method, and control software - Google Patents
Control device, control method, and control software Download PDFInfo
- Publication number
- JP2004118669A JP2004118669A JP2002283208A JP2002283208A JP2004118669A JP 2004118669 A JP2004118669 A JP 2004118669A JP 2002283208 A JP2002283208 A JP 2002283208A JP 2002283208 A JP2002283208 A JP 2002283208A JP 2004118669 A JP2004118669 A JP 2004118669A
- Authority
- JP
- Japan
- Prior art keywords
- branch
- instruction
- condition
- branch destination
- instruction code
- 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.)
- Abandoned
Links
Images
Landscapes
- Executing Machine-Instructions (AREA)
Abstract
Description
【0001】
【発明の属する技術分野】
本発明は、制御装置及び制御方法並びに制御ソフトウェアに関するものである。
【0002】
【従来の技術】
近年の電子機器は、汎用CPU(central processing unit:中央処理装置)や専用信号処理装置などの種々の制御装置を用いて複雑な情報や信号の処理を行えるように構成している。
【0003】
かかる制御装置は、複数の命令コードからなるプログラムを実行するように構成されており、特に複雑な処理を円滑に行うために、所定の条件を満足した場合には所定の分岐先アドレスに格納された命令コードを実行するといった分岐命令を多用している。
【0004】
従来の制御装置では、実行する命令コードが分岐命令である場合、特定の1個の分岐条件を満足するか否かを判断し、分岐条件を満足する場合には、特定の1個の分岐先アドレスに格納された命令コードを実行するようにしていた。
【0005】
【発明が解決しようとする課題】
ところが、上記従来の制御装置にあっては、分岐命令の実行時に1個の分岐条件について条件を満足するか否かを判断し、特定の1個の分岐先アドレスに格納された命令コードを実行するようにしていたため、複数の分岐条件の中から条件を満足する1個の分岐条件に対応する分岐先アドレスに格納された命令コードを実行したい場合には、複数の分岐命令を順に実行していき、分岐条件を満足する場合にはじめて分岐先アドレスに格納された命令コードを実行するようになっていた。
【0006】
このように、従来の制御装置にあっては、複数の分岐条件がある場合には、1回の分岐命令の実行だけでは処理しきれずに、複数回の分岐命令を実行しなければならず、分岐処理に時間を要するとともに、それに伴って消費電力も増大してしまい、制御装置の高速化や低消費電力化の要求に対応することができなかった。
【0007】
【課題を解決するための手段】
そこで、請求項1に係る本発明では、複数の命令コードからなるプログラムを実行し、命令コードによる命令が分岐命令の場合に所定の分岐先アドレスに格納された命令コードを実行する制御装置において、命令コードによる命令が分岐命令か否かを判断する分岐命令判断手段と、複数の分岐先アドレスを格納する分岐先格納手段と、複数の分岐条件の全てについて分岐条件を満足するか否かを判断する分岐条件判断手段と、前記分岐命令判断手段によって分岐命令であると判断した場合に、前記分岐条件判断手段で分岐条件を満足すると判断した分岐条件に対応する1個の分岐先アドレスを前記分岐先格納手段に格納された複数の分岐先アドレスの中から選択する分岐先選択手段とを具備することを特徴とする制御装置を提供するものである。
【0008】
また、請求項2に係る本発明では、前記分岐先選択手段は、複数の分岐条件に予め優先順位を設定しておき、前記分岐条件判断手段によって複数の分岐条件が同時に条件を満足する場合に、優先順位が高い分岐条件に対応する分岐先アドレスを選択することにしたものである。
【0009】
また、請求項3に係る本発明では、前記分岐命令の命令コードは、分岐命令を示す分岐命令部と、分岐先アドレスを示す複数の分岐先アドレス部とからなることにしたものである。
【0010】
また、請求項4に係る本発明では、複数の命令コードからなるプログラムを実行し、命令コードによる命令が分岐命令の場合に所定の分岐先アドレスに格納された命令コードを実行する制御方法において、命令コードによる命令が分岐命令か否かを判断し、複数の分岐条件の全てについて分岐条件を満足するか否かを判断し、分岐命令であると判断した場合に条件を満足する分岐条件に対応する1個の分岐先アドレスを複数の分岐先アドレスの中から選択し、同分岐先アドレスに格納された命令コードを実行することを特徴とする制御方法を提供するものである。
【0011】
また、請求項5に係る本発明では、命令コードによる命令が分岐命令か否かを判断するステップと、複数の分岐条件の全てについて分岐条件を満足するか否かを判断するステップと、分岐命令であると判断した場合に条件を満足する分岐条件に対応する1個の分岐先アドレスを複数の分岐先アドレスの中から選択するステップと、同分岐先アドレスに格納された命令コードを実行するステップとを具備することを特徴とする制御ソフトウェアを提供するものである。
【0012】
【発明の実施の形態】
以下に、本発明の実施の形態について図面を参照しながら具体的に説明する。
【0013】
(第1の実施の形態)
第1の実施の形態に係る制御装置1は、図1に示すように、プログラム格納手段2と、NOP置換手段3と、命令コード格納手段4と、分岐命令判断手段5と、分岐先格納手段6と、分岐条件判断手段7と、分岐先選択手段8と、分岐先指示手段9とから構成している。
【0014】
各手段の機能を説明すると、まず、プログラム格納手段2は、複数の命令コード10からなるプログラムを格納するメモリである。
【0015】
NOP置換手段3は、プログラム格納手段2から読み出した命令コード10を必要に応じてNo−Operationコード(nop)に置き換える回路である。
【0016】
命令コード格納手段4は、プログラム格納手段2から読み出した命令コード10を一時的に格納しておくインストラクションレジスタ(Instruction Register(IR))である。
【0017】
分岐命令判断手段5は、命令コード格納手段4に格納された命令コード10による命令が分岐命令か否かを判断するデコーダであり、命令コード10が分岐命令であると判断した場合には、分岐先選択手段8に分岐制御信号brを出力する。
【0018】
分岐先格納手段6は、複数の分岐先アドレスAdrsを格納するアドレスレジスタ(Address Register)である。ここでは、4個の分岐先アドレスAdrs(1)〜Adrs(4)が格納されることとする。また、分岐先アドレスAdrsとしては、相対的なアドレスとしている。
【0019】
分岐条件判断手段7は、複数の分岐条件の全てについて分岐条件を満足するか否かを判断する回路であり、判断結果として分岐信号Cを分岐先選択手段8に出力する。ここでは、複数の分岐条件として、特定のレジスタに格納されたデータについて、オーバーフローが発生しているか否か(以下、これを「分岐条件1」と呼ぶ。)、キャリーが発生しているか否か(以下、これを「分岐条件2」と呼ぶ。)、負のデータであるか否か(以下、これを「分岐条件3」と呼ぶ。)、0であるか否か(以下、これを「分岐条件4」と呼ぶ。)とし、分岐信号Cとして4個の分岐信号C(1)〜C(4)を出力することとする。なお、分岐条件判断手段7は、特定のレジスタに格納されるデータが更新されるたびに分岐信号C(1)〜C(4)を分岐先選択手段8に出力するようにしている。
【0020】
分岐先選択手段8は、分岐命令判断手段5によって命令コード10が分岐命令であると判断した場合に、分岐条件判断手段7で分岐条件を満足すると判断したいずれかの分岐条件に対応する1個の分岐先アドレスAdrsを分岐先格納手段6に格納された複数の分岐先アドレスAdrsの中から選択する回路であり、分岐先を示すアドレスデータADDを分岐先指示手段9に出力する。
【0021】
また、分岐先選択手段8は、分岐先アドレスAdrsを選択するとともに、必要に応じてNOP置換手段3に置換制御信号XNOPを出力し、さらには、ロード制御信号LDを生成する。
【0022】
分岐先指示手段9は、プログラムカウンタ11に保持されたアドレスPAと分岐先選択手段8から出力されたアドレスデータADDとを加算器12で加算してアドレスPAを更新する回路である。
【0023】
次に、分岐先選択手段8の回路構成について説明すると、図2に示すように、分岐先選択手段8は、クロック信号CKに同期して置換制御信号XNOPとロード制御信号LDとを生成する制御信号生成回路13と、クロック信号CKに同期してアドレスデータADDを生成するアドレスデータ生成回路14とから構成している。
【0024】
そして、制御信号生成回路13は、分岐制御信号brと分岐信号C(1)〜C(4)とに基づいて、置換制御信号XNOPとロード制御信号LDとを生成する。すなわち、制御信号生成回路13は、分岐制御信号brがアクティブ(命令コード10が分岐命令)の場合で、かつ、全ての分岐信号C(1)〜C(4)がノンアクティブ(いずれの分岐条件も満足しない)の場合には、クロック信号CKの2サイクル分にわたって置換制御信号XNOPを出力し、一方、分岐制御信号brがアクティブ(命令コード10が分岐命令)の場合で、かつ、いずれかの分岐信号C(1)〜C(4)がアクティブ(いずれかの分岐条件を満足する)の場合には、ロード制御信号LDを生成する。
【0025】
また、アドレスデータ生成回路14は、分岐制御信号brと分岐信号C(1)〜C(4)と分岐先アドレスAdrs(1)〜Adrs(4)とに基づいて、アドレスデータADDを生成する。すなわち、アドレスデータ生成回路14は、分岐命令判断手段5での分岐制御信号brの発生と分岐先選択手段8でのアドレスデータADDの発生とのタイミングを合わせるためにクロック信号CKの2サイクル分にわたって分岐制御信号brを保持する分岐制御信号br2を生成し、分岐制御信号br2と分岐信号C(1)〜C(4)と分岐先アドレスAdrs(1)〜Adrs(4)とに基づいて、アドレス選択回路15でいずれかの分岐先アドレスAdrs(1)〜Adrs(4)を選択し、アドレスデータADDを出力する。
【0026】
ここで、アドレス選択回路15は、図3の真理値表に示すように、分岐制御信号br2(分岐制御信号br)がノンアクティブ(命令コード10が分岐命令でない)の場合、及び、分岐制御信号br2(分岐制御信号br)がアクティブ(命令コード10が分岐命令)であって、かつ、全ての分岐信号C(1)〜C(4)がノンアクティブ(いずれの分岐条件も満足しない)の場合には、アドレスデータADDとして「1」を出力し、一方、分岐制御信号br2(分岐制御信号br)がアクティブ(命令コード10が分岐命令)であって、かつ、いずれかの分岐信号C(1)〜C(4)がアクティブ(いずれかの分岐条件を満足する)の場合には、分岐信号C(1)〜C(4)のうちのアクティブとなっているものに対応する分岐先アドレスAdrs(1)〜Adrs(4)の値をアドレスデータADDとして出力する。
【0027】
しかも、分岐条件1〜4には、予め優先順位が設定されており、分岐条件1が最も優先順位が高く、次に、分岐条件2、分岐条件3の順で優先順位が低くなり、分岐条件4が最も優先順位が低くなるようにしている。
【0028】
すなわち、分岐信号C(1)がアクティブ(分岐条件1が条件を満足する)の場合には、分岐信号C(2)〜C(4)の状態にかかわらず分岐先アドレスAdrs(1)の値をアドレスデータADDとして出力する。
【0029】
次に、分岐信号C(2)がアクティブ(分岐条件1が条件を満足する)の場合には、分岐信号C(3),C(4)の状態にかかわらず分岐先アドレスAdrs(2)の値をアドレスデータADDとして出力する。
【0030】
次に、分岐信号C(3)がアクティブ(分岐条件1が条件を満足する)の場合には、分岐信号C(4)の状態にかかわらず分岐先アドレスAdrs(3)の値をアドレスデータADDとして出力する。
【0031】
最後に、分岐信号C(4)がアクティブ(分岐条件1が条件を満足する)の場合には、分岐先アドレスAdrs(4)の値をアドレスデータADDとして出力する。
【0032】
制御装置1は、以上のように構成しており、その動作について図4を参酌しながら以下に説明する。ここで、分岐命令を示す命令コード10は、図5に示すように、分岐命令であることを示す分岐命令部16と、複数の分岐先アドレスAdrs(1)〜Adrs(4)を示す分岐先アドレス部17とから構成しているものとする。
【0033】
まず、制御装置1は、プログラム格納手段2に格納されたプログラムのうちからアドレスPAに格納されている命令コード10を読出す(ステップS1)。
【0034】
次に、プログラム格納手段2から読み出した命令コード10を命令コード格納手段4に格納する(ステップS2)。
【0035】
次に、命令コード格納手段4に格納されている命令コード10のうちの分岐命令部16に相当する部分によって命令コード10が分岐命令か否かを分岐命令判断手段5で判断する(ステップS3)。
【0036】
次に、分岐命令判断手段5で命令コード10が分岐命令であると判断した場合には、分岐命令判断手段5から分岐先選択手段8に分岐制御信号brを出力する(ステップS4)。
【0037】
次に、分岐先選択手段8の制御信号生成回路13から置換制御信号XNOPをNOP置換手段3に出力する(ステップS5)。
【0038】
次に、分岐先選択手段8の制御信号生成回路13において生成された制御信号LDに基づいて、命令コード格納手段4に格納されている命令コード10のうちの分岐先アドレス部17に相当する部分、すなわち分岐先アドレスAdrs(1)〜Adrs(4)を分岐先選択手段8に分岐先格納手段6を介して入力する(ステップS6)。
【0039】
そして、分岐先選択手段8のアドレスデータ生成回路14によって分岐条件を満足するいずれかの分岐条件1〜4に対応する分岐先アドレスAdrs(1)〜Adrs(4)の値をアドレスデータADDとして分岐先支持手段9に出力する(ステップS7)。
【0040】
次に、アドレスデータADDに基づいて分岐先指示手段9でアドレスPAを更新する(ステップS8)。
【0041】
次に、プログラム格納手段2に格納されたプログラムのうちから分岐先指示手段9で指示されたアドレスPAに格納されている命令コード10を読出し、実行する(ステップS9)。
【0042】
このように、制御装置1では、複数の命令コード10からなるプログラムを実行し、命令コード10による命令が分岐命令の場合に所定の分岐先アドレスAdrsに格納された命令コード10を実行する制御方法を行っており、しかも、命令コード10による命令が分岐命令か否かを判断し、複数の分岐条件の全てについて分岐条件を満足するか否かを判断し、分岐命令であると判断した場合には、条件を満足する分岐条件に対応する1個の分岐先アドレスAdrsを複数の分岐先アドレスAdrsの中から選択し、同分岐先アドレスAdrsに格納された命令コード10を実行する制御方法を行っている。
【0043】
換言すれば、制御装置1では、命令コード10による命令が分岐命令か否かを判断するステップ(図4中、ステップS3に相当。)と、複数の分岐条件の全てについて分岐条件を満足するか否かを判断するステップ(本実施例では、特定のレジスタに格納されるデータが更新されるたびに分岐条件判断手段7にて行っている。)と、分岐命令であると判断した場合には、条件を満足する分岐条件に対応する1個の分岐先アドレスAdrsを複数の分岐先アドレスAdrsの中から選択するステップ(図4中、ステップS7に相当。)と、同分岐先アドレスAdrsに格納された命令コード10を実行するステップ(図4中、ステップS9に相当。)とを具備する制御ソフトウェアを実行している。
【0044】
そして、本実施の形態では、1回の分岐命令によって複数の分岐先アドレスAdrsのうちのいずれかに分岐する制御を行えるようにしている。
【0045】
このように、本実施の形態では、1回の分岐命令を実行するだけで、複数の分岐条件の中から条件を満足する1個の分岐条件に対応する分岐先アドレスAdrsに格納された命令コード10を直ちに実行することができ、これにより、分岐処理に要する時間を大幅に短縮することができ、それに伴って消費電力を削減することができて、制御装置1の高速化や低消費電力化を図ることができる。
【0046】
特に、本実施の形態では、複数の分岐条件に予め優先順位を設定しておけるようにしているため、分岐命令の汎用性を向上させることができる。
【0047】
また、分岐命令を示す分岐命令部16と分岐先アドレスAdrsを示す複数の分岐先アドレス部17とから分岐命令の命令コード10を構成しているため、使用者が分岐先アドレスAdrsを任意に指定することができ、これによっても分岐命令の汎用性を向上させることができる。
【0048】
(第2の実施の形態)
図6は、第2の実施の形態に係る制御装置21を示した図であり、本実施の形態においても第1の実施の形態と同様に、制御装置21は、プログラム格納手段2と、NOP置換手段3と、命令コード格納手段4と、分岐命令判断手段5と、分岐先格納手段6と、分岐条件判断手段7と、分岐先選択手段8と、分岐先指示手段9とから構成している。なお、前記第1の実施の形態と同様の機能を有するものには同じ符号を付している。
【0049】
本実施の形態では、図7に示すように、分岐命令を示す命令コード22が2ワード分のデータからなり、1ワード目の先頭部分に分岐命令であることを示す分岐命令部23を設けるとともに、1ワード目の分岐命令部23の後部に複数の分岐先アドレスAdrs(1)〜Adrs(m)を示す分岐先アドレス部24を設け、2ワード目にも複数の分岐先アドレスAdrs(m+1)〜Adrs(n)を示す分岐先アドレス部24を設けている。
【0050】
そして、制御装置21は、命令コード22の1ワード目を命令コード格納手段4に格納するとともに、命令コード22の1ワード目の分岐先アドレス部24と命令コード22の2ワード目の分岐先アドレス部24とを分岐先格納手段6に格納するようにしている。
【0051】
このように、本実施の形態では、分岐命令を示す命令コード22を複数ワードのデータで構成することによって、分岐先アドレスAdrsの個数や相対アドレス値を増大させることができ、より一層分岐命令の汎用性を向上させることができる。
【0052】
(第3の実施の形態)
図8は、第3の実施の形態に係る制御装置31を示した図であり、本実施の形態においても第1の実施の形態と同様に、制御装置31は、プログラム格納手段2と、NOP置換手段3と、命令コード格納手段4と、分岐命令判断手段5と、分岐先格納手段32と、分岐条件判断手段7と、分岐先選択手段8と、分岐先指示手段9とから構成している。なお、前述した実施の形態と同様の機能を有するものには同じ符号を付している。
【0053】
本実施の形態では、分岐命令を示す命令コードが分岐命令であることを示す分岐命令部だけからなり、分岐先アドレスAdrs(1)〜Adrs(n)は所定のメモリに格納されている。
【0054】
そして、分岐先アドレスAdrs(1)〜Adrs(n)は、所定のメモリ34から分岐先格納手段32にバス33を介して格納され、分岐先選択手段8に入力するようにしている。
【0055】
このように、分岐先アドレスAdrs(1)〜Adrs(n)を命令コードに含ませるのではなく所定のメモリに格納しておくことによって、命令コードを短縮化することができ、これにより、命令コード格納手段4の記憶容量を削減することができる。
【0056】
(第4の実施の形態)
図9は、第4の実施の形態に係る制御装置41を示した図であり、本実施の形態においても第1の実施の形態と同様に、制御装置41は、プログラム格納手段2と、NOP置換手段3と、命令コード格納手段4と、分岐命令判断手段5と、分岐先格納手段32と、分岐条件判断手段7と、分岐先選択手段42と、分岐先指示手段43とから構成している。なお、前述した実施の形態と同様の機能を有するものには同じ符号を付している。
【0057】
本実施の形態では、分岐命令を示す命令コードが分岐命令であることを示す分岐命令部だけからなり、分岐先アドレスAdrs(1)〜Adrs(n)は所定のメモリに格納され、しかも、絶対的なアドレス値としている。
【0058】
そして、分岐先アドレスAdrs(1)〜Adrs(n)は、所定のメモリから分岐先格納手段32にバス33を介して格納され、分岐先選択手段42に入力するようにしている。
【0059】
また、本実施の形態における分岐先選択手段42は、分岐先指示手段43から仮のアドレスPA’が入力され、真のアドレスPAを出力するように構成しており、一方、分岐先指示手段43は、プログラムカウンタ11に保持されたアドレスPAに加算器12で常に「1」を加算した仮のアドレスPA(分岐処理がない場合のアドレス)を出力するようにしている。
【0060】
ここで、分岐先選択手段42の回路構成について説明すると、図10に示すように、分岐先選択手段42は、置換制御信号XNOPを生成する制御信号生成回路44と、アドレスPAを生成するアドレスデータ生成回路45とから構成している。
【0061】
そして、制御信号生成回路44は、分岐制御信号brがアクティブ(命令コード10が分岐命令)の場合で、かつ、全ての分岐信号C(1)〜C(4)がノンアクティブ(いずれの分岐条件も満足しない)の場合には、クロック信号CKの2サイクル分にわたって置換制御信号XNOPを出力する。
【0062】
また、アドレスデータ生成回路45は、分岐命令判断手段5での分岐制御信号brの発生と分岐先選択手段8でのアドレスデータADDの発生とのタイミングを合わせるためにクロック信号CKの2サイクル分にわたって分岐制御信号brを保持する分岐制御信号br2を生成し、分岐制御信号br2と分岐信号C(1)〜C(4)と分岐先アドレスAdrs(1)〜Adrs(4)とに基づいて、アドレス選択回路46でいずれかの分岐先アドレスAdrs(1)〜Adrs(4)を選択し、その値をアドレスPAとして出力する。
【0063】
ここで、アドレス選択回路46は、図11の真理値表に示すように、分岐制御信号br2(分岐制御信号br)がノンアクティブ(命令コードが分岐命令でない)の場合、及び、分岐制御信号br2(分岐制御信号br)がアクティブ(命令コードが分岐命令)であって、かつ、全ての分岐信号C(1)〜C(4)がノンアクティブ(いずれの分岐条件も満足しない)の場合には、アドレスPAとして仮のアドレスPA’をそのまま出力し、一方、分岐制御信号br2(分岐制御信号br)がアクティブ(命令コードが分岐命令)であって、かつ、いずれかの分岐信号C(1)〜C(4)がアクティブ(いずれかの分岐条件を満足する)の場合には、分岐信号C(1)〜C(4)のうちのアクティブとなっているものに対応する分岐先アドレスAdrs(1)〜Adrs(4)の値をアドレスPAとして出力する。
【0064】
このように、本実施の形態では、分岐先アドレスAdrs(1)〜Adrs(4)として絶対的なアドレスを指定することができ、これによっても分岐命令の汎用性を向上させることができる。
【0065】
【発明の効果】
本発明は、以上に説明したような形態で実施され、以下に記載されるような効果を奏する。
【0066】
すなわち、本発明では、1回の分岐命令を実行するだけで、複数の分岐条件の中から条件を満足する1個の分岐条件に対応する分岐先アドレスに格納された命令コードを直ちに実行することができ、これにより、分岐処理に要する時間を大幅に短縮することができ、それに伴って消費電力を削減することができて、制御装置の高速化や低消費電力化を図ることができる。
【図面の簡単な説明】
【図1】本発明に係る制御装置を示す説明図。
【図2】分岐先選択手段を示す説明図。
【図3】アドレス選択回路の真理値表。
【図4】本発明に係る制御方法を示すフローチャート。
【図5】命令コードを示す説明図。
【図6】第2実施例としての制御装置を示す説明図。
【図7】命令コードを示す説明図。
【図8】第3実施例としての制御装置を示す説明図。
【図9】第4実施例としての制御装置を示す説明図。
【図10】分岐先選択手段を示す説明図。
【図11】アドレス選択回路の真理値表。
【符号の説明】
1 制御装置
2 プログラム格納手段
3 NOP置換手段
4 命令コード格納手段
5 分岐命令判断手段
6 分岐先格納手段
7 分岐条件判断手段
8 分岐先選択手段
9 分岐先指示手段
10 命令コード
11 プログラムカウンタ
12 加算器
13 制御信号生成回路
14 アドレスデータ生成回路
15 アドレス選択回路
br,br2 分岐制御信号
Adrs 分岐先アドレス
C 分岐信号
XNOP 置換制御信号
PA アドレス
ADD アドレスデータ
CK クロック信号[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a control device, a control method, and control software.
[0002]
[Prior art]
2. Description of the Related Art In recent years, electronic devices are configured to perform complicated information and signal processing using various control devices such as a general-purpose CPU (central processing unit) and a dedicated signal processing device.
[0003]
Such a control device is configured to execute a program consisting of a plurality of instruction codes, and in particular, in order to smoothly perform complicated processing, when a predetermined condition is satisfied, the control device is stored at a predetermined branch destination address. Branch instructions, such as executing an instruction code, are frequently used.
[0004]
In a conventional control device, when an instruction code to be executed is a branch instruction, it is determined whether or not a specific one branch condition is satisfied, and when the branch condition is satisfied, a specific one branch destination is determined. The instruction code stored at the address was executed.
[0005]
[Problems to be solved by the invention]
However, in the above-described conventional control device, it is determined whether or not one branch condition is satisfied at the time of execution of a branch instruction, and an instruction code stored at a specific one branch destination address is executed. Therefore, when it is desired to execute an instruction code stored in a branch destination address corresponding to one branch condition that satisfies a condition among a plurality of branch conditions, a plurality of branch instructions are sequentially executed. When the branch condition is satisfied, the instruction code stored at the branch destination address is executed for the first time.
[0006]
As described above, in the conventional control device, when there are a plurality of branch conditions, execution of a single branch instruction is not enough to execute the processing, and a plurality of branch instructions must be executed. In addition to the time required for the branching process, the power consumption also increases, and it has not been possible to respond to the demands for higher speed and lower power consumption of the control device.
[0007]
[Means for Solving the Problems]
Therefore, in the present invention according to
[0008]
Further, in the present invention according to
[0009]
In the present invention according to
[0010]
According to a fourth aspect of the present invention, in the control method for executing a program consisting of a plurality of instruction codes and executing an instruction code stored at a predetermined branch destination address when the instruction according to the instruction code is a branch instruction, Judge whether the instruction by the instruction code is a branch instruction, judge whether all of the multiple branch conditions satisfy the branch condition, and if it is determined that the instruction is a branch instruction, respond to the branch condition that satisfies the condition The present invention provides a control method characterized by selecting one branch destination address to be executed from a plurality of branch destination addresses and executing an instruction code stored in the same branch destination address.
[0011]
Further, in the present invention according to
[0012]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, embodiments of the present invention will be specifically described with reference to the drawings.
[0013]
(First Embodiment)
As shown in FIG. 1, the
[0014]
Explaining the function of each means, first, the program storage means 2 is a memory for storing a program including a plurality of
[0015]
The NOP replacement means 3 is a circuit for replacing the
[0016]
The instruction code storage means 4 is an instruction register (Instruction Register (IR)) for temporarily storing the
[0017]
The branch instruction judging means 5 is a decoder for judging whether or not the instruction based on the
[0018]
The branch destination storing means 6 is an address register (Address Register) for storing a plurality of branch destination addresses Adrs. Here, it is assumed that four branch destination addresses Adrs (1) to Adrs (4) are stored. The branch destination address Adrs is a relative address.
[0019]
The branch condition judging means 7 is a circuit for judging whether or not all of the plurality of branch conditions satisfy the branch condition, and outputs a branch signal C to the branch destination selecting means 8 as a judgment result. Here, as a plurality of branch conditions, for data stored in a specific register, whether an overflow has occurred (hereinafter referred to as “
[0020]
When the branch instruction determining means 5 determines that the
[0021]
The branch
[0022]
The branch destination instructing means 9 is a circuit for adding the address PA held in the
[0023]
Next, the circuit configuration of the branch
[0024]
Then, the control
[0025]
The address
[0026]
Here, as shown in the truth table of FIG. 3, the
[0027]
In addition, priorities are set in advance for the
[0028]
That is, when the branch signal C (1) is active (the
[0029]
Next, when the branch signal C (2) is active (the
[0030]
Next, when the branch signal C (3) is active (the
[0031]
Finally, when the branch signal C (4) is active (the
[0032]
The
[0033]
First, the
[0034]
Next, the
[0035]
Next, the branch
[0036]
Next, when the branch
[0037]
Next, a replacement control signal XNOP is output from the control
[0038]
Next, based on the control signal LD generated in the control
[0039]
Then, the address
[0040]
Next, the address PA is updated by the branch destination instructing means 9 based on the address data ADD (step S8).
[0041]
Next, the
[0042]
As described above, the
[0043]
In other words, the
[0044]
In the present embodiment, the control for branching to any one of the plurality of branch destination addresses Adrs can be performed by one branch instruction.
[0045]
As described above, in the present embodiment, the instruction code stored in the branch destination address Adrs corresponding to one branch condition that satisfies the condition out of the plurality of branch conditions only by executing one branch instruction. 10 can be executed immediately, whereby the time required for the branch processing can be significantly reduced, the power consumption can be reduced accordingly, and the speeding up and lower power consumption of the
[0046]
In particular, in the present embodiment, priorities can be set in advance for a plurality of branch conditions, so that the versatility of branch instructions can be improved.
[0047]
Further, since the
[0048]
(Second embodiment)
FIG. 6 is a diagram showing a
[0049]
In the present embodiment, as shown in FIG. 7, an
[0050]
Then, the
[0051]
As described above, in the present embodiment, the
[0052]
(Third embodiment)
FIG. 8 is a diagram showing a
[0053]
In the present embodiment, the instruction code indicating the branch instruction includes only a branch instruction portion indicating that the instruction is a branch instruction, and the branch destination addresses Adrs (1) to Adrs (n) are stored in a predetermined memory.
[0054]
The branch destination addresses Adrs (1) to Adrs (n) are stored from a
[0055]
As described above, by storing the branch destination addresses Adrs (1) to Adrs (n) in a predetermined memory instead of including them in the instruction code, the instruction code can be shortened. The storage capacity of the code storage means 4 can be reduced.
[0056]
(Fourth embodiment)
FIG. 9 is a diagram showing a
[0057]
In the present embodiment, the instruction code indicating a branch instruction is composed of only a branch instruction portion indicating that the instruction is a branch instruction. The branch destination addresses Adrs (1) to Adrs (n) are stored in a predetermined memory. Address value.
[0058]
Then, the branch destination addresses Adrs (1) to Adrs (n) are stored from a predetermined memory in the branch
[0059]
Further, the branch
[0060]
Here, the circuit configuration of the branch destination selecting means 42 will be described. As shown in FIG. 10, the branch destination selecting means 42 includes a control
[0061]
The control
[0062]
Further, the address
[0063]
Here, as shown in the truth table of FIG. 11, the
[0064]
As described above, in the present embodiment, an absolute address can be specified as the branch destination addresses Adrs (1) to Adrs (4), thereby also improving the versatility of the branch instruction.
[0065]
【The invention's effect】
The present invention is implemented in the form described above, and has the following effects.
[0066]
That is, in the present invention, the execution of the instruction code stored in the branch destination address corresponding to one branch condition that satisfies the condition out of the plurality of branch conditions is performed immediately by executing only one branch instruction. As a result, the time required for the branching process can be significantly reduced, the power consumption can be reduced accordingly, and the control device can be speeded up and the power consumption can be reduced.
[Brief description of the drawings]
FIG. 1 is an explanatory diagram showing a control device according to the present invention.
FIG. 2 is an explanatory diagram showing branch destination selection means.
FIG. 3 is a truth table of the address selection circuit.
FIG. 4 is a flowchart showing a control method according to the present invention.
FIG. 5 is an explanatory diagram showing an instruction code.
FIG. 6 is an explanatory diagram showing a control device as a second embodiment.
FIG. 7 is an explanatory diagram showing an instruction code.
FIG. 8 is an explanatory diagram showing a control device as a third embodiment.
FIG. 9 is an explanatory diagram showing a control device as a fourth embodiment.
FIG. 10 is an explanatory diagram showing branch destination selection means.
FIG. 11 is a truth table of the address selection circuit.
[Explanation of symbols]
REFERENCE SIGNS
Claims (5)
前記命令コードによる命令が分岐命令か否かを判断する分岐命令判断手段と、複数の分岐先アドレスを格納する分岐先格納手段と、複数の分岐条件の全てについて分岐条件を満足するか否かを判断する分岐条件判断手段と、前記分岐命令判断手段によって分岐命令であると判断した場合に、前記分岐条件判断手段で分岐条件を満足すると判断した分岐条件に対応する1個の分岐先アドレスを前記分岐先格納手段に格納された複数の分岐先アドレスの中から選択する分岐先選択手段とを具備することを特徴とする制御装置。A control device that executes a program composed of a plurality of instruction codes and executes an instruction code stored at a predetermined branch destination address when the instruction according to the instruction code is a branch instruction,
Branch instruction determining means for determining whether or not the instruction according to the instruction code is a branch instruction; branch destination storing means for storing a plurality of branch destination addresses; and determining whether all of the plurality of branch conditions satisfy the branch condition. Branch condition determining means for determining, and, when the branch instruction determining means determines that the instruction is a branch instruction, one branch destination address corresponding to the branch condition determined to satisfy the branch condition by the branch condition determining means. A control device comprising: a branch destination selection unit that selects from a plurality of branch destination addresses stored in a branch destination storage unit.
命令コードによる命令が分岐命令か否かを判断し、複数の分岐条件の全てについて分岐条件を満足するか否かを判断し、分岐命令であると判断した場合に条件を満足する分岐条件に対応する1個の分岐先アドレスを複数の分岐先アドレスの中から選択し、同分岐先アドレスに格納された命令コードを実行することを特徴とする制御方法。A control method for executing a program consisting of a plurality of instruction codes and executing an instruction code stored at a predetermined branch destination address when the instruction according to the instruction code is a branch instruction,
Judge whether the instruction by the instruction code is a branch instruction, judge whether all of the multiple branch conditions satisfy the branch condition, and if it is determined that the instruction is a branch instruction, respond to the branch condition that satisfies the condition A control method characterized by selecting one branch destination address to be executed from a plurality of branch destination addresses and executing an instruction code stored in the same branch destination address.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2002283208A JP2004118669A (en) | 2002-09-27 | 2002-09-27 | Control device, control method, and control software |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2002283208A JP2004118669A (en) | 2002-09-27 | 2002-09-27 | Control device, control method, and control software |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2004118669A true JP2004118669A (en) | 2004-04-15 |
Family
ID=32277135
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2002283208A Abandoned JP2004118669A (en) | 2002-09-27 | 2002-09-27 | Control device, control method, and control software |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2004118669A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008102574A (en) * | 2006-10-17 | 2008-05-01 | Nomura Research Institute Ltd | Program execution system |
CN101482812A (en) * | 2008-01-09 | 2009-07-15 | 恩益禧电子股份有限公司 | Processor apparatus and conditional branch processing method |
-
2002
- 2002-09-27 JP JP2002283208A patent/JP2004118669A/en not_active Abandoned
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008102574A (en) * | 2006-10-17 | 2008-05-01 | Nomura Research Institute Ltd | Program execution system |
CN101482812A (en) * | 2008-01-09 | 2009-07-15 | 恩益禧电子股份有限公司 | Processor apparatus and conditional branch processing method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JPH09231070A (en) | Information processing circuit, semiconductor integrated circuit device, microcomputer and electronic equipment | |
JP2006146953A (en) | Processor, system lsi, design method of system lsi, and recording medium with the same recorded thereon | |
JP4996654B2 (en) | Processor | |
US20130036426A1 (en) | Information processing device and task switching method | |
JP2008305185A (en) | Processor device and compound condition processing method | |
US20060004994A1 (en) | Processor | |
JP5108690B2 (en) | DMA apparatus and DMA transfer method | |
JPH0418635A (en) | Digital signal processor | |
JP2004118669A (en) | Control device, control method, and control software | |
US6981130B2 (en) | Forwarding the results of operations to dependent instructions more quickly via multiplexers working in parallel | |
JP2003058381A (en) | Processor realizing exception processing setting by program | |
JP2011028543A (en) | Information processing system, and information processing method for the same | |
JP2005234968A (en) | Arithmetic processing unit | |
JP2006053830A (en) | Branch estimation apparatus and branch estimation method | |
JP3837386B2 (en) | Information processing device | |
JPH05143447A (en) | Digital processor and control method for the processor | |
JP2008262399A (en) | Microprocessor, microcomputer and electronic apparatus | |
JP2009059187A (en) | Microprocessor and data processing method | |
JP2006268152A (en) | Integrated circuit device | |
JP6141073B2 (en) | Information processing apparatus and information processing apparatus control method | |
JP5263497B2 (en) | Signal processor and semiconductor device | |
JP5263498B2 (en) | Signal processor and semiconductor device | |
JP2011186710A (en) | Processor and control method thereof | |
JPH1063503A (en) | Arithmetic processor and its method | |
JP2007156557A (en) | Parallel processor |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
RD04 | Notification of resignation of power of attorney |
Effective date: 20040818 Free format text: JAPANESE INTERMEDIATE CODE: A7424 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20050922 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20060523 |
|
A762 | Written abandonment of application |
Effective date: 20060718 Free format text: JAPANESE INTERMEDIATE CODE: A762 |