JPH07191866A - Arithmetic execution error detecting system - Google Patents

Arithmetic execution error detecting system

Info

Publication number
JPH07191866A
JPH07191866A JP4029778A JP2977892A JPH07191866A JP H07191866 A JPH07191866 A JP H07191866A JP 4029778 A JP4029778 A JP 4029778A JP 2977892 A JP2977892 A JP 2977892A JP H07191866 A JPH07191866 A JP H07191866A
Authority
JP
Japan
Prior art keywords
instruction
operand
storage means
result
arithmetic
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
JP4029778A
Other languages
Japanese (ja)
Inventor
Masashi Yamada
正志 山田
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.)
Fuji Electric Co Ltd
Fuji Facom Corp
Original Assignee
Fuji Electric Co Ltd
Fuji Facom 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 Fuji Electric Co Ltd, Fuji Facom Corp filed Critical Fuji Electric Co Ltd
Priority to JP4029778A priority Critical patent/JPH07191866A/en
Publication of JPH07191866A publication Critical patent/JPH07191866A/en
Withdrawn legal-status Critical Current

Links

Abstract

PURPOSE:To perform error deciding processing at high speed and to secure the safety of the outputted result concerning the arithmetic execution error detecting system for a program. CONSTITUTION:Concerning an instruction processing means for successively storing input data in a storage means corresponding to bits, performing arithmetic while using the data of correspondent bits in this storage means, transferring the arithmetic result to the prescribed bit of the storage means and storing the result, this means is provided with a flag memory 10 corresponding to the respective bits of an executing example storage means, and a store instruction 14 is provided with plural operands OP 1 and OP 2 as the instruction words of arithmetic. At the time of any arithmetic execution error, a reading instruction performs error detection by checking two operands of the store instruction 14.

Description

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

【0001】[0001]

【産業上の利用分野】本発明はプログラムの演算実行エ
ラー検出方式に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a program execution error detecting method.

【0002】[0002]

【従来の技術】プログマブルコントローラ用の言語表現
としてブロック図表現があり、たとえば図3のように表
現される。同図において、Z0〜Z3は入力データ、f
0,f1,f2は演算を示している。また、図4(a)
はこの言語表現における命令処理に用いられるワークメ
モリを示し、同図(b)は上記各演算の内容を示してい
る。この各演算f0,f1,f2は第1オペランドを読
み出すロード命令(LD)12、第2オペランドを読み
出して上記第1オペランドと演算を行う演算命令(f
0,f1,f2)13、及び演算結果のストア先を示す
ストア命令(ST)14の3命令語により構成される。
なお同図(b)は演算f2の内容を例にとって示してい
る。
2. Description of the Related Art As a language expression for a programmable controller, there is a block diagram expression, for example, as shown in FIG. In the figure, Z0 to Z3 are input data, f
0, f1, and f2 indicate calculation. In addition, FIG.
Indicates a work memory used for instruction processing in this language expression, and FIG. Each of the operations f0, f1, and f2 is a load instruction (LD) 12 that reads the first operand, and an operation instruction (f that reads the second operand and performs an operation on the first operand.
0, f1, f2) 13 and a store instruction (ST) 14 indicating the storage destination of the operation result.
Note that FIG. 9B shows the content of the calculation f2 as an example.

【0003】このようなブロック図表現による従来の命
令処理方法は次のように行われる。まず、入力データZ
0〜Z3が、縦方向順に図4(a)に示したビット単位
で構成されるワークメモリ11のT0〜T3の各ビット
に代入される。次に演算f0がその入力に対応したワー
クメモリ11のT0,T1を使って行われ、その演算結
果がワークメモリ11のT0に代入される。
A conventional instruction processing method using such a block diagram representation is performed as follows. First, input data Z
0 to Z3 are substituted into the respective bits of T0 to T3 of the work memory 11 configured in the vertical direction in the vertical direction in the bit unit shown in FIG. Next, the calculation f0 is performed using T0 and T1 of the work memory 11 corresponding to the input, and the calculation result is substituted into T0 of the work memory 11.

【0004】演算f1も同様に、その入力に対応したワ
ークメモリ11のT2,T3を使って行われ、その演算
結果がワークメモリ11のT2に代入される。この演算
結果は、演算f2においても使われるので、ワークメモ
リ11のT1へ転送される(これは図3において縦接続
15によって表現されている)。
Similarly, the calculation f1 is performed using T2 and T3 of the work memory 11 corresponding to the input, and the calculation result is substituted into T2 of the work memory 11. Since this calculation result is also used in the calculation f2, it is transferred to T1 of the work memory 11 (this is represented by the vertical connection 15 in FIG. 3).

【0005】また、演算f2も上記同様、その入力に対
応したワークメモリ11のT0,T1を使って行われ、
その演算結果はワークメモリ11のT0に代入される。
このようにして、最終結果がワークメモリのT0からメ
モリZ4へ出力される。
Further, the calculation f2 is also performed by using T0 and T1 of the work memory 11 corresponding to the input, as in the above.
The calculation result is substituted into T0 of the work memory 11.
In this way, the final result is output from the work memory T0 to the memory Z4.

【0006】ところで、上記演算f0〜f2での命令処
理過程において、演算実行エラー(0除算やBCDコー
ドエラーなど)が発生した場合には、その命令はストア
命令14に通知されて、ストア命令がNOP(no opera
tion) となる。このとき警告フラグをオンしてユーザに
対して警告する。プログラマブルコントローラにおいて
NOP処理は、何も処理を行わず次段の命令実行へ移行
するものである。
By the way, when an operation execution error (division by 0, BCD code error, etc.) occurs in the instruction processing process in the operations f0 to f2, the instruction is notified to the store instruction 14, and the store instruction is notified. NOP (no opera
tion). At this time, the warning flag is turned on to warn the user. In the programmable controller, the NOP process does not perform any process and shifts to the next instruction execution.

【0007】[0007]

【発明が解決しようとする課題】上記したような従来の
命令処理方法であると演算実行エラーとなっても次段の
演算に通知する手段が無いので、同じワークメモリを使
用する次段の命令が正常に終了する場合には、エラーに
なったデータを使ったにもかかわらず、あたかも正常結
果のように出力されてしまうという問題があった。した
がって、ユーザが警告を見逃してしまった場合には、実
際の運用に入ってから制御に異常をきたす危険性があっ
た。
In the conventional instruction processing method as described above, there is no means for notifying the operation of the next stage even if an operation execution error occurs. Therefore, the instruction of the next stage using the same work memory is used. If the command ends normally, there was a problem that it would be output as if it were a normal result, even though the data in error was used. Therefore, if the user misses the warning, there is a risk that the control may be abnormal after the actual operation.

【0008】この問題点を解決するために、各ワークメ
モリに、ビット対応したフラグメモリを追加し、読み出
し動作が行われる命令語で判定し、ストア命令に通知す
るという方式もあるが、処理速度が遅くなる問題があり
実用性に欠けていた。
In order to solve this problem, there is also a system in which a bit memory corresponding to a bit is added to each work memory, judgment is made by an instruction word in which a read operation is performed, and a store instruction is notified. There was a problem that it became slow and it was lacking in practicality.

【0009】本発明は演算実行エラーとなった演算だけ
でなく、その演算結果を使う演算命令もNOPとするこ
とにより、出力結果の安全性を保証し、またストア命令
だけで判定を行うことにより、高速にエラー判定処理を
行うことを可能とした演算実行エラー検出方式を実現す
ることを目的としている。
According to the present invention, not only the operation resulting in the operation execution error, but also the operation instruction using the operation result is NOP, so that the safety of the output result is guaranteed and the determination is made only by the store instruction. The purpose of the present invention is to realize an operation execution error detection method that enables high-speed error determination processing.

【0010】[0010]

【課題を解決するための手段】図1は、本発明の原理を
説明する図であり、同図(a)の如く、記憶手段として
の上記ワークメモリ11の各ビットT0,T1,・・・
に対応したビットt0,t1,・・・を有するフラグメ
モリ10を設けるとともに、さらに上記各演算f0〜f
2におけるストア命令14に、同図(b)の如く、複数
のオペランド情報、すなわち、ストア先を示す第1オペ
ランドOP1だけでなく、第2オペランドOP2を追加
した構成としている。
FIG. 1 is a diagram for explaining the principle of the present invention. As shown in FIG. 1 (a), each bit T0, T1, ... Of the work memory 11 as a storage means.
Is provided with a bit memory 10 having bits t0, t1, ... Corresponding to
2B, a plurality of operand information, that is, not only the first operand OP1 indicating the store destination but also the second operand OP2 is added to the store instruction 14 in FIG.

【0011】[0011]

【作用】このような構成において、演算実行エラーが発
生すると、まず、その演算実行エラーの発生した演算の
ストア命令により、対応するフラグメモリ10のフラグ
がオンにされる。次に、縦接続15(図3)に対する処
理では、エラーデータとオンとなったフラグの転送が行
われる。
In such a structure, when an operation execution error occurs, first, the flag of the corresponding flag memory 10 is turned on by the store instruction of the operation in which the operation execution error occurred. Next, in the process for the vertical connection 15 (FIG. 3), the error data and the flag that has been turned on are transferred.

【0012】読み出し動作を行う命令は、前段における
演算実行エラーの有無にかかわらず命令を実行する。そ
して、ストア命令14は、第1、第2の2つのオペラン
ドに対応するフラグのオン/オフを判別して演算実行エ
ラーとなったデータを使用したか否かを判定する。これ
により演算実行エラーを検出し次段に演算実行エラーが
あったことを高速に伝えることができる。
The instruction that performs the read operation executes the instruction regardless of whether or not there is an operation execution error in the preceding stage. Then, the store instruction 14 determines on / off of the flags corresponding to the first and second operands and determines whether the data in which the operation execution error has occurred is used. As a result, it is possible to detect an operation execution error and quickly notify that there is an operation execution error in the next stage.

【0013】[0013]

【実施例】上記本発明原理に基づいて実施例を説明す
る。この実施例では図3にブロック図で示した命令処理
において、演算f1で実行エラーが発生した場合の処理
について説明する。なお、この処理は、図1に示すワー
クメモリ11、フラグメモリ10が用いられ、プログラ
ムメモリ9に格納された命令に基づいて実行される。
EXAMPLES Examples will be described based on the principle of the present invention. In this embodiment, in the instruction processing shown in the block diagram of FIG. 3, processing when an execution error occurs in the operation f1 will be described. Note that this processing is executed based on the instruction stored in the program memory 9 using the work memory 11 and the flag memory 10 shown in FIG.

【0014】まず、図3の演算f1で実行エラーが発生
すると、そのストア命令によってワークメモリ11のビ
ットT2に対応するフラグメモリ10のフラグt2がオ
ンするとともに、ユーザに対する警告フラグもオンす
る。このとき縦接続15が示す処理ではデータをワーク
メモリ11のT2からT1にコピーするとともに、フラ
グメモリ10のt2をt1にコピーする。これによっ
て、エラー情報(オンとなったフラグ)が次段の演算に
対応するフラグにコピーされる。
First, when an execution error occurs in the operation f1 of FIG. 3, the store instruction turns on the flag t2 of the flag memory 10 corresponding to the bit T2 of the work memory 11 and also turns on the warning flag for the user. At this time, in the process indicated by the vertical connection 15, the data is copied from T2 of the work memory 11 to T1, and t2 of the flag memory 10 is copied to t1. As a result, the error information (flag turned on) is copied to the flag corresponding to the operation of the next stage.

【0015】ここで演算f2は図2で示すように、「命
令12でロード命令LDによってワークレジスタに読み
出されたT0に対して、命令13ではT1を用いて演算
2を実行し、命令14でストア命令STにより第1オ
ペランドOP1と、第2オペランドOP2とに結果を格
納せよ」という構成となっている。そして、ロード命令
12と演算命令13ではエラーフラグのオン/オフのチ
ェックは行われず、ストア命令14でチェックとセット
とを行う。
[0015] Here, operation f2, as shown in Figure 2, relative to T0 read out to the work register by the load instruction LD by "instruction 12, executes the arithmetic f 2 with instruction 13 in T1, the instruction 14 stores the result in the first operand OP1 and the second operand OP2 by the store instruction ST ". Then, the load instruction 12 and the operation instruction 13 do not check on / off of the error flag, but the store instruction 14 checks and sets the error flag.

【0016】すなわち、ストア命令14では第1オペラ
ンドT0と第2オペランドT1によって、演算で使用さ
れたメモリがわかるので、対応するフラグメモリ10の
t0とt1のビットをチェックする。今ここではt1の
ビットがオンしていることから、実行エラーとして処理
する。即ちストア処理を行わず、フラグt1 の転送を行
うことによって、フラグメモリ10のt0のフラグをオ
ンにする。
That is, in the store instruction 14, since the memory used in the operation is known from the first operand T0 and the second operand T1, the bits t0 and t1 of the corresponding flag memory 10 are checked. Since the bit t1 is turned on here, it is processed as an execution error. That is, the flag t 1 of the flag memory 10 is turned on by transferring the flag t 1 without performing the store process.

【0017】これにより、一旦エラーとなったワークメ
モリ11のT2ビットを使用する演算命令はすべてNO
Pとなる。また、ユーザが上記フラグメモリ10をモニ
タやアクセスできるようにすれば、より詳細なエラー情
報(エラー発生箇所の特定など)を提供するとができ
る。
As a result, all operation instructions that use the T2 bit of the work memory 11 that has once become an error are NO.
P. If the user can monitor and access the flag memory 10, it is possible to provide more detailed error information (identification of error occurrence location, etc.).

【0018】[0018]

【発明の効果】本発明によれば、ストア命令にストア先
を示す第1のオペランドの他に、第2のオペランドを追
加し、ストア命令実行時において、演算実行エラー発生
時にオンに設定された第1、第2のオペランドに対応す
るフラグのチェックを行うだけでエラーを検出して、次
段に実行演算エラーがあったことを高速に伝えることが
可能となり、また、演算実行エラーとなった演算だけで
なく、その演算結果を使う演算命令もNOPとすること
により、出力結果の安全性を確保できるなど優れた効果
が得られる。
According to the present invention, the second operand is added to the store instruction in addition to the first operand indicating the store destination, and it is set to ON when an operation execution error occurs during execution of the store instruction. Only by checking the flags corresponding to the first and second operands, it is possible to detect an error and inform at a high speed that there is an execution operation error in the next stage, and an operation execution error has occurred. By setting not only the operation but also the operation instruction using the operation result to NOP, an excellent effect such as ensuring the safety of the output result can be obtained.

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

【図1】本発明原理を説明する図である。FIG. 1 is a diagram illustrating the principle of the present invention.

【図2】実施例における演算f2の内容を示す図であ
る。
FIG. 2 is a diagram showing the contents of a calculation f2 in the embodiment.

【図3】プログラマブルコントローラ用言語表現として
のブロック図表現の一例を示す図である。
FIG. 3 is a diagram showing an example of a block diagram expression as a language expression for a programmable controller.

【図4】図3において使用するワークメモリ及び演算の
内容を示す図である。
FIG. 4 is a diagram showing a work memory used in FIG. 3 and contents of calculation.

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

10 フラグメモリ 11 ワークメモリ 12 ロード命令 13 演算命令 14 ストア命令 10 flag memory 11 work memory 12 load instruction 13 operation instruction 14 store instruction

───────────────────────────────────────────────────── フロントページの続き (51)Int.Cl.6 識別記号 庁内整理番号 FI 技術表示箇所 B32B 27/04 A 8413−4F G05B 19/048 G06F 11/30 320 C 9290−5B // B29K 105:08 B29L 9:00 ─────────────────────────────────────────────────── ─── Continuation of the front page (51) Int.Cl. 6 Identification code Office reference number FI technical display location B32B 27/04 A 8413-4F G05B 19/048 G06F 11/30 320 C 9290-5B // B29K 105 : 08 B29L 9:00

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 入力データをビット対応に順次記憶手段
に格納し、この記憶手段のビットデータを使って演算を
行い、その演算結果を上記記憶手段の所定ビットに転送
して格納する命令処理手段において、 上記記憶手段の各ビットに対応してフラグメモリ(1
0)を設けるとともに、上記演算の命令語としてストア
命令(14)に複数のオペランド(OP1,OP2)を
設け、このストア命令のオペランドをチェックすること
によりエラー検出を行うことを特徴とする演算実行エラ
ー検出方式。
1. An instruction processing means for sequentially storing input data corresponding to bits in a storage means, performing an operation using the bit data of the storage means, and transferring the operation result to a predetermined bit of the storage means for storage. In the flag memory (1
0) is provided, and a plurality of operands (OP1, OP2) are provided in the store instruction (14) as the instruction word of the above operation, and error detection is performed by checking the operands of the store instruction. Error detection method.
【請求項2】 上記演算の命令語は、第1のオペランド
(OP1)を読み出すロード命令(12)、第2のオペ
ランド(OP2)を読み出して上記第1のオペランド
(OP1)と演算を行う演算命令(13)、及び上記演
算結果のストア先を示すストア命令(14)から成り、
上記ストア命令(14)のオペランドとして、ストア先
を示す第1のオペランド(OP1)の他に第2のオペラ
ンド(OP2)を設けたことを特徴とする請求項1記載
の演算実行エラー検出方式。
2. The operation instruction word is a load instruction (12) for reading a first operand (OP1), and an operation for reading a second operand (OP2) and performing an operation with the first operand (OP1). An instruction (13) and a store instruction (14) indicating a storage destination of the operation result,
The operation execution error detection system according to claim 1, wherein a second operand (OP2) is provided as an operand of the store instruction (14) in addition to the first operand (OP1) indicating a store destination.
JP4029778A 1992-02-17 1992-02-17 Arithmetic execution error detecting system Withdrawn JPH07191866A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4029778A JPH07191866A (en) 1992-02-17 1992-02-17 Arithmetic execution error detecting system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4029778A JPH07191866A (en) 1992-02-17 1992-02-17 Arithmetic execution error detecting system

Publications (1)

Publication Number Publication Date
JPH07191866A true JPH07191866A (en) 1995-07-28

Family

ID=12285479

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4029778A Withdrawn JPH07191866A (en) 1992-02-17 1992-02-17 Arithmetic execution error detecting system

Country Status (1)

Country Link
JP (1) JPH07191866A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010238232A (en) * 2009-03-12 2010-10-21 Omron Corp Industrial controller

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010238232A (en) * 2009-03-12 2010-10-21 Omron Corp Industrial controller

Similar Documents

Publication Publication Date Title
JPH07219774A (en) Data processor and exception processing method
EP0098172B1 (en) Register control processing system
JPH07191866A (en) Arithmetic execution error detecting system
KR960011669A (en) Central Processing Unit
JP2562838B2 (en) Processor and store buffer control method
JP3171615B2 (en) Data transfer retry control method
JPH04106652A (en) Exceptional treatment system
JPS61177558A (en) Checking method of function of random access memory
JPS62175834A (en) Detecting circuit for runaway of central processing unit
US5644745A (en) Apparatus for replacing data availability information for an instruction subsequent to a branch with previous availability information upon branch prediction failure
JPS6020769B2 (en) Microprogram control method
JP3441262B2 (en) Data processing device
JPS595356A (en) General-purpose register controlling system
JPH01231126A (en) Information processor
JPH02127731A (en) Bypass check system for arithmetic register
JPS58115559A (en) Program overrun detecting circuit
JPS63120336A (en) Switching system for memory access mode
JPS63103330A (en) Detecting system for misuse of address stack
JPH04128961A (en) Multi-processor control system
JPH05346801A (en) Program operation control device
JPS6061832A (en) Arithmetic controller
JPH05165874A (en) Vector arithmetic processor
JPS61182137A (en) Data processing with tag
JPH0371236A (en) Error detecting system
JPH01246638A (en) Area error decision system for write instruction

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