JP2784001B2 - Instruction processing circuit of programmable controller - Google Patents

Instruction processing circuit of programmable controller

Info

Publication number
JP2784001B2
JP2784001B2 JP62211773A JP21177387A JP2784001B2 JP 2784001 B2 JP2784001 B2 JP 2784001B2 JP 62211773 A JP62211773 A JP 62211773A JP 21177387 A JP21177387 A JP 21177387A JP 2784001 B2 JP2784001 B2 JP 2784001B2
Authority
JP
Japan
Prior art keywords
instruction
bit
clock
unit
flag
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.)
Expired - Lifetime
Application number
JP62211773A
Other languages
Japanese (ja)
Other versions
JPS6455602A (en
Inventor
丈治 武良
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.)
Panasonic Electric Works Co Ltd
Original Assignee
Matsushita Electric Works 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 Matsushita Electric Works Ltd filed Critical Matsushita Electric Works Ltd
Priority to JP62211773A priority Critical patent/JP2784001B2/en
Publication of JPS6455602A publication Critical patent/JPS6455602A/en
Application granted granted Critical
Publication of JP2784001B2 publication Critical patent/JP2784001B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Executing Machine-Instructions (AREA)
  • Programmable Controllers (AREA)

Description

【発明の詳細な説明】 [技術分野] 本発明はプログラマブルコントローラの命令処理回路
に関するものである。 [背景技術] プログラマブルコントローラの高速化が最近要求さ
れ、基本命令の実行速度が1.0μs以下の中型や大型機
種が実現されている。 しかしこれらの機種はビットスライスの組み合わせで
高速処理を図っているため、高速化ハードウェアのコス
トが高く、命令処理回路全体のコストが小型機種に比べ
て相当高くなり、コストと性能とのバランスがとれてい
ないという欠点があった。 又そしてI/O点数が128点以下の小型機種に対しても高
速化の要求が高まっているが、コストの面で問題があっ
た。 [発明の目的] 本発明は上述の問題点に鑑みて為されたもので、その
目的とするところは低コストで、高速化を図ったプログ
ラマブルコントローラの命令処理回路を提供するにあ
る。 [発明の開示] 本発明はユーザプログラムのアドレス及びデータメモ
リのアドレスを出力するアドレス発生部と、プログラム
メモリから読み出した命令を記憶して記憶した命令のデ
コードを行う命令フエッチ部と、データメモリから読み
出されたデータを格納するデータレジスタ、基本的なビ
ット操作の命令を演算するビットALU部、該ビットALU部
の演算結果を格納するフラグ部、タイマ命令、カウンタ
命令、シフトレジスタ命令を16ビット並列処理するため
のAcc部、減算、シフトを行うワードALU部、タイマ命令
専用のシフトと加算とを行うサブワードALU部から少な
くともなる演算実行部と、制御クロックを発生させる制
御クロック発生部とをゲートアレイで構成したプログラ
マブルコントローラの命令処理回路において、微分命令
の場合には、命令を格納したプログラムメモリに接続さ
れる16ビットデータバスとは別に、第1のクロックで前
スキャンの結果を、ビット専用バスにより1ビットRAM
からなるデータメモリよりロードし、第2のクロックに
より現スキャンの演算結果のフラグを上記1ビットRAM
からなるデータッモリに格納し、第2のクロックの立ち
下がりで演算結果をフラグ部にセットすることを特徴と
する。 以下本発明を実施例により説明する。 第1図は他の周辺回路を含めて2500ゲート程度でゲー
トアレイ化することができる本発明の実施例の回路構成
を示しており、本実施例の命令処理回路を大別すると、
アドレス発生部Aと、命令フエッチ部Bと、演算実行部
Cと、その他の部分を構成するCPUコマンドレジスタD
と、制御クロック発生部E等から構成されている。 アドレス発生部Aはプログラムカウンタ1と、データ
実アドレス部2とからなり、プログラムカウンタ1はバ
イナリカウンタで構成され、ユーザプログラムを格納し
たプログラムメモリ(図示せず)のアドレスを出力す
る。またデータ実アドレス部2は命令デコーダ信号とク
ロックステートの組合わせによりデータメモリ(図示せ
ず)のアドレスを出力する。 命令フエッチ部は、命令レジスタ3と、命令デコード
部4とからなり、命令レジスタ3はプログラムメモリか
らの命令を読み出して記憶するレジスタであり、命令デ
コード部4は命令レジスタ3に記憶された命令のデコー
ドを行い、上記アドレス発生部Aと、制御クロック発生
部Dと、演算実行部Cとに信号を出す。 演算実行部Cはデータレジスタ5と、ビットALU6と、
フラグ部7と、OUTL・A部8と、演算ステータスレジス
タ9と、Acc部10と、wALU部(ワードALU部)11と、swAL
U部(サブワードALU部)12と、Rレジスタ13と、タイム
ベースクロックカウンタ(BCNTと以下略す)14,15とか
らなり、データレジスタ5はデータメモリから読み出さ
れた接点データが16ビット単位で格納されるものであ
り、ビットALU部6は1ビット論理演算命令の演算部を
構成し、演算結果をフラグ部7に格納する。フラグ部7
は16ビットで構成された演算結果フラグレジスタで、上
記ビットALU部6との組み合わせで演算を行う。OUTL・
A部8はOUT命令、Keep命令等の出力命令を実行すると
き上記データレジスタ5とフラグ部7の値により接点デ
ータを操作するロジック部である。更に演算ステータス
レジスタ9はタイマ命令、カウンタ命令及びシフトレジ
スタ命令を実行するとき、前スキャンのフラグ部7の内
容をAcc部10に転送しておき、そのAcc部10と直前のフラ
グ部7の内容の組み合わせで、リセット、保持、演算の
動作モードを記憶するレジスタである。Acc部10はタイ
マ命令、カウンタ命令及びシフトレジスタ命令を実行す
るための16ビットアキュムレータであって、wALU部11と
の組み合わせで転送、シフト、減算等の機能を実現す
る。wALU部11は上記Acc部10との組み合わせで転送、シ
フト、減算等の機能を実現するロジック部である。swAL
U部12はタイマ命令専用の演算ロジック部で、Rレジス
タ13、BCNT14,15との組み合わせで、加算、シフト、転
送等の機能を実現するものである。Rレジスタ13はswAL
U部12との組合わせにより、BCNT14,15からの転送、BCNT
14,15との加算及びシフト機能を実現するためのもの
で、内容がwALU部11を介してAcc部10との減算機能にも
使用される。 BCNT14,15はタイマ命令を実行するときに、タイマ命
令、例えば10msec,100msecの基準クロックに該当する値
が夫々格納されるレジスタである。 CPUコマンドレジスタDは命令処理回路全体の動作モ
ードを指定するレジスタで、1ステップ動作、ブレーク
ポイント機能等を指定することができる。 制御クロック発生部Eは基本クロックCLKに基づいて
命令処理回路に必要な制御信号を作成するものであっ
て、制御クロック発生部Eには第2図に示す演算に必要
なクロックCK1,CK2,CK3を作成するための基準クロック
発生回路16を設けている。該基準クロック発生回路16は
3進カウンタ16aに基本クロックCLKを入力して上記クロ
ックCK1,CK2,CK3を作り出しており、クロックCK1は命令
のフェッチクロックとなり、クロックCK2はデータのロ
ード、又はフラグ(ステータス)の書き込みを行うクロ
ックとなり、該クロックCK2においてSTARTやANDの基本
命令の1ビット処理をビットALU部6とフラグ部7とを
用いて演算が為される。 そして微分命令の場合はクロックCK1で前スキャンの
結果を、命令を格納したプログラムメモリを構成するRA
Mを接続した16ビットデータバスD0〜D15とは別に、1ビ
ット専用バスSDにより1ビットRAMからなるデータメモ
リよりロードし、クロックCK2により現スキャンの演算
結果のフラグを1ビットRAMからなるデータメモリに格
納し、クロックCK2の立ち下がりで演算結果をフラグ部
7にセットするようになっている。 次に本発明命令処理回路の動作を第3図乃至第5図の
タイムチャートに基づいて説明する。 まず第3図はSTART、ANDの基本命令の実行タイムチャ
ートであって、同図(a)は基本クロックCLKを示し、
この基本クロックCLKに基づいて制御クロック発生部E
より同図(b)に示すAEN(アドレスイネーブル)信号
が発生し、本発明回路が能動状態に切替わる。つまりAE
N信号は本発明回路の能動、受動の各状態をハード的に
切り替える信号で、“H"のときに能動状態とする。 そして同図(i)(j)に示すチップセレクト信号で
ある▲▼信号、▲▼信号を制御クロツ
ク発生部Eより発生し、16ビットデータバスD0〜D15
接続されるRAM及び1ビット専用バスSDに接続された1
ビットRAMをチップセレクトし、同図(n)の▲
▼信号によりプログラムカウンタ1のアドレス出力a
を選択してアドレスバスA1〜A15に同図(p)に示すよ
うに出力させる。そして上記AEN信号と、同図(c)に
示すクロックCK1とを組み合わせて作成された同図
(g)に示すラッチクロック信号であるOPCK信号により
命令レジスタ3にプログラムメモリからの命令を同図
(q)に示すように読み込み、命令デコード部4で命令
のデコードを行いアドレス発生部A、制御クロック発生
部E及び演算実行部Cにデコードに基づいた信号を出力
する。そしてOPCK信号の立ち下がりで、同図(o)に示
す▲▼信号をデータ実アドレス部2に与え、デー
タメモリのアドレスbを選択しA1〜A15のアドレスバス
に出力させる。このアドレス出力によりデータメモリよ
り接点データ(DATA)をデータレジスタ5に取込ませ、
そしてビットALU部6及びフラグ部7により演算を行わ
せる。このタイミングが同図(h)に示す期間であり、
同図(d)に示すクロックCK2の立ち下がり時点で演算
結果をフラグ部7に格納する。またこの期間の途中で同
図(m)に示すPCiNC信号をプログラムカウンタ1に与
えて、その立ち上がり時点でプログラムカウンタ1の値
をインクリメントさせる。ここでアドレスとしてはA0
“L"に固定しているため、PC←PC+2の形になる。 そして同図(e)に示すクロックCK3の立ち下がり
で、リセットがかかり、この時点で、演算実行が終了す
る。 尚クロックCK3のパルス幅が短いのは基準クロック発
生回路16の3進カウンタ16aがリセット信号RESTにより
リセットされるためである。 ところで第3図(f)に示すsync信号はマシンサイク
ルの先頭を示すクロックで、このクロック発生期間Tが
命令実行時間Tとなり、例えば基準クロックCLKが5MHz
であれば命令実行時間Tは0.4μsとなり、4MHzであれ
ば0.5μsとなる。 又同図(k)(l)はメモリに対する読出信号▲
▼、書込信号▲▼を示す。 次に微分命令の処理に付いて第4図の実行タイムチャ
ートにより説明する。 第4図の(a)〜(g)及び(i)〜(q)は第3図
の(a)〜(g)及び(i)〜(q)に対応しており、
本命令の処理を行う場合には、▲▼信号により
プログラムカウンタ1のアドレス出力を選択してアドレ
スaをアドレスバスA1〜A15に出力し、クロックCK1にお
いて前スキャンの演算結果を1ビットRAMからロードし
て、クロックCK2では現スキャンの演算結果フラグの値
を1ビットRAMに格納させ(第4図(h)の期間)、ク
ロックCK2の立ち下がりで演算結果をフラグ部7にセッ
トするのである。 第5図はタイマ、カウンタ、シフトレジスタの各命令
処理を行う場合の実行タイムチャートを示しており、同
図(a)に示すようにsync信号の間隔、つまり命令実行
時間Tは同図(b)に示す基準クロックCLKの10個分に
対応しており、基準クロックCLKが5MHzなら2.0μsとな
る。 これらの命令に対しては第2図に示す基準発生クロッ
ク回路16では第5図(d),(e),(f)に示すクロ
ックCK1,CK2,CK3の他に、第5図(g)(h)示すφ
とφ相クロックを作成し、φのクロックをマシンス
テートカウンタ16bのクロック入力とし、クロックφ
と第5図(i)に示すマシンステートカウンタ16bの出
力とを組み合わせて制御クロックを作る。そしてAcc部1
0と、wALU部11を中心に減算、カウント、右シフトを行
い、特にタイマ命令の場合swALU部12とRレジスタ13と
によって補助的な演算を平行して行うのである。 而して第5図(c)に示すAEN信号と、同図(d)に
示すクロックCK1とを組み合わせて作成される同図
(j)に示すOPCK信号により命令フエッチを行い、次に
同図(k)に示すステータスフェツチの場合、同図
(n)に示すAcc▲▼信号により前スキャンの演算
結果フラグを演算ステータスレジス9からAcc部10に転
送し、同図(p)のR▲▼信号によりBCNT1415の値
をRレジスタ13に転送する。次に同図(l)に示すデー
タロードにより接点データをデータレジスタ5に格納さ
せ、次に演算結果フラグと、Acc部10とによって、同図
(m)のステータス演算クロツクに基づいて演算条件を
作り、その結果を演算ステータスレジスタ9に格納させ
る。この結果により以後のステートでの処理が異なるの
である。 シフト、減算、インクリメント等の処理は同図(t)
に示すAccCLK信号により16ビット一括で演算を行う。タ
イマ命令の場合は同図(r)のTMP1信号でBCNT14又は15
の値とRレジスタ13とを加算して、その結果をRレジス
タ13に格納して同図(q)に示すラッチ信号によりRレ
ジスタ13をラッチし、同図(s)の2SRP信号によりRレ
ジスタ13を2シフトさせる。この際、現在値又は設定値
をAcc部10に転送させる。そして同図(t)のAccCLK信
号によりRレジスタ13の値がAcc部10によって減算され
る。又同図(o)のAcc▲▼信号によりAcc部10を出
力エネーブルとする。 尚第5図(u)の▲▼信号は現スキャンの
演算結果フラグをタイマ、カウンタのステータスエリア
に出力させるクロックであり、同図(v)の▲
▼信号は接点データをビットALU部6によって操作し
て出力させるクロックである。また同図(w)は▲
▼信号を、同図(x)を▲▼信号を、同図
(y)は▲▼信号を、同図(z)を▲
▼信号を夫々示す。また同図(α)はPCiNC信号を夫々
示す。 また同図(β)に示すINTCLK信号は命令実行終了時に
割り込みとか拡張命令等を検出し、これらの信号が入っ
ていれば命令の実行完了後、AEN信号を“H"から“L"に
切換え、本発明回路を受動状態に設定するための信号で
ある。 [発明の効果] 本発明は上述のように構成しており、ビット操作命
令、微分命令、タイマ命令、カウンタ命令などの各命令
を実行する専用の演算回路を設けているので、最短のマ
シンサイクルで各命令を実行することができ、命令処理
を高速処理することが可能となる。また周辺回路を内蔵
してもゲート数を少なくすることができ、ゲートアレイ
とメモリの2つの部品で構成できるのでコストを低減す
ることができ、16ビットCPUとマルチプロセッサ構成が
容易に実現できるという効果を奏する。また微分命令の
場合には、命令を格納したプログラムメモリに接続され
る16ビートデータバスとは別に、第1のクロックで前ス
キャンの結果を、ビット専用バスにより1ビットRAMか
らなるデータメモリよりロードし、第2のクロックによ
り現スキャンの演算結果のフラグを上記1ビットRAMか
らなるデータメモリに格納し、第2のクロックの立ち下
がりで演算結果をフラグ部にセットするので、微分命令
の場合には、16ビットのデータではなく、それに1ビッ
トを加えた17ビット構成とすることにより、微分命令の
使用の制限を無くし、しかも最短の2サイクルにより高
速化処理が図れるという効果を奏する。
Description: TECHNICAL FIELD The present invention relates to an instruction processing circuit of a programmable controller. [Background Art] Recently, high-speed programmable controllers have been demanded, and medium-sized and large-sized models having an execution speed of basic instructions of 1.0 μs or less have been realized. However, because these models achieve high-speed processing by combining bit slices, the cost of high-speed hardware is high, the cost of the entire instruction processing circuit is considerably higher than that of small models, and a balance between cost and performance is achieved. There was a disadvantage that it was not taken. Also, there is an increasing demand for higher speeds for small models with 128 or less I / O points, but there is a problem in terms of cost. [Object of the Invention] The present invention has been made in view of the above problems, and has as its object to provide a low-cost, high-speed instruction processing circuit of a programmable controller. [Disclosure of the Invention] The present invention provides an address generation unit that outputs an address of a user program and an address of a data memory, an instruction fetch unit that stores an instruction read from a program memory and decodes the stored instruction, A data register that stores the read data, a bit ALU part that performs a basic bit operation instruction, a flag part that stores the operation result of the bit ALU part, a timer instruction, a counter instruction, and a 16-bit shift register instruction A gate for an arithmetic execution unit including at least an Acc unit for parallel processing, a word ALU unit for performing subtraction and shift, a subword ALU unit for performing shift and addition dedicated to a timer instruction, and a control clock generation unit for generating a control clock. In the case of a differential instruction in the instruction processing circuit of a programmable controller composed of an array, Apart from the 16-bit data bus connected instruction in a program memory storing the results of the previous scan in a first clock, 1 bit RAM by bit en
, And the flag of the operation result of the current scan is stored in the 1-bit RAM by the second clock.
And the operation result is set in the flag section at the falling edge of the second clock. Hereinafter, the present invention will be described with reference to examples. FIG. 1 shows a circuit configuration of an embodiment of the present invention which can be formed into a gate array with about 2500 gates including other peripheral circuits.
An address generation unit A, an instruction fetch unit B, an operation execution unit C, and a CPU command register D constituting other parts
And a control clock generator E and the like. The address generator A includes a program counter 1 and a data real address unit 2. The program counter 1 is constituted by a binary counter and outputs an address of a program memory (not shown) storing a user program. The data real address unit 2 outputs an address of a data memory (not shown) by a combination of an instruction decoder signal and a clock state. The instruction fetch unit includes an instruction register 3 and an instruction decoding unit 4. The instruction register 3 is a register for reading and storing an instruction from the program memory, and the instruction decoding unit 4 stores the instruction stored in the instruction register 3. The decoding is performed, and signals are output to the address generation unit A, the control clock generation unit D, and the operation execution unit C. The operation execution unit C includes a data register 5, a bit ALU6,
Flag section 7, OUTL / A section 8, operation status register 9, Acc section 10, wALU section (word ALU section) 11, swAL
The data register 5 includes a U section (subword ALU section) 12, an R register 13, and a time base clock counter (BCNT) 14, 15. The data register 5 stores contact data read from the data memory in 16-bit units. The bit ALU unit 6 constitutes an operation unit of a 1-bit logical operation instruction, and stores an operation result in the flag unit 7. Flag section 7
Is an operation result flag register composed of 16 bits, and performs an operation in combination with the bit ALU unit 6. OUTL ・
The A unit 8 is a logic unit that operates contact data according to the values of the data register 5 and the flag unit 7 when executing an output instruction such as an OUT instruction or a Keep instruction. Further, when executing the timer instruction, the counter instruction, and the shift register instruction, the arithmetic status register 9 transfers the contents of the flag unit 7 of the previous scan to the Acc unit 10, and stores the contents of the Acc unit 10 and the contents of the flag unit 7 immediately before. Is a register that stores operation modes of reset, hold, and operation in the combination of. The Acc unit 10 is a 16-bit accumulator for executing a timer instruction, a counter instruction, and a shift register instruction, and realizes functions such as transfer, shift, and subtraction in combination with the wALU unit 11. The wALU unit 11 is a logic unit that realizes functions such as transfer, shift, and subtraction in combination with the Acc unit 10. swAL
The U unit 12 is an arithmetic logic unit dedicated to a timer instruction, and realizes functions such as addition, shift, and transfer in combination with the R register 13 and the BCNTs 14 and 15. R register 13 is swAL
Transfer from BCNTs 14 and 15 and BCNT
The contents are also used for a subtraction function with the Acc unit 10 via the wALU unit 11 for realizing an addition and shift function with 14, 14. BCNTs 14 and 15 are registers for storing timer instructions, for example, values corresponding to reference clocks of 10 msec and 100 msec, respectively, when the timer instruction is executed. The CPU command register D specifies the operation mode of the entire instruction processing circuit, and can specify a one-step operation, a breakpoint function, and the like. The control clock generator E generates a control signal required for the instruction processing circuit based on the basic clock CLK. The control clock generator E includes clocks CK1, CK2, CK3 required for the operation shown in FIG. Is provided with a reference clock generation circuit 16 for generating the data. The reference clock generating circuit 16 generates the clocks CK1, CK2, and CK3 by inputting the basic clock CLK to the ternary counter 16a. The clock CK1 is a fetch clock of an instruction, and the clock CK2 is a data load or a flag ( The clock CK2 is used to perform a 1-bit process of a basic instruction such as START or AND using the bit ALU unit 6 and the flag unit 7. Then, in the case of a differential instruction, the result of the previous scan is clocked by the clock CK1, and the RA constituting the program memory storing the instruction is used.
Separate from the 16-bit data buses D 0 to D 15 connected to M, a 1-bit dedicated bus SD is used to load data from a 1-bit RAM, and the clock CK2 is used to set the flag of the current scan operation result from the 1-bit RAM. The result is stored in the data memory, and the operation result is set in the flag section 7 at the fall of the clock CK2. Next, the operation of the instruction processing circuit of the present invention will be described based on the time charts of FIGS. First, FIG. 3 is an execution time chart of a basic instruction of START and AND, and FIG. 3A shows a basic clock CLK,
Based on the basic clock CLK, the control clock generator E
As a result, an AEN (address enable) signal shown in FIG. 4B is generated, and the circuit of the present invention is switched to the active state. In other words, AE
The N signal is a signal for switching between the active state and the passive state of the circuit of the present invention in a hardware manner. And is a chip select signal shown in FIG. (I) (j) ▲ ▼ signals, ▲ ▼ signal generated from the control clock generating section E, RAM and 1 bit is connected to the 16-bit data bus D 0 to D 15 1 connected to dedicated bus SD
Bit RAM is chip-selected, and ▲ in FIG.
▼ Address output of program counter 1 by signal
Select is output as shown in FIG. (P) to the address bus A 1 to A 15 in. Then, an instruction from the program memory is stored in the instruction register 3 by an OPCK signal which is a latch clock signal shown in (g) of FIG. 7 (g) created by combining the AEN signal and the clock CK1 of FIG. q), the instruction is decoded by the instruction decoding unit 4, and a signal based on the decoding is output to the address generation unit A, the control clock generation unit E, and the operation execution unit C. Then, at the falling edge of the OPCK signal, the signal ▲ shown in FIG. 9 (o) is applied to the data real address section 2 to select the address b of the data memory and output it to the address buses A 1 to A 15 . With this address output, the contact data (DATA) is taken into the data register 5 from the data memory,
Then, the operation is performed by the bit ALU unit 6 and the flag unit 7. This timing is the period shown in FIG.
The calculation result is stored in the flag section 7 at the time of the falling edge of the clock CK2 shown in FIG. In the middle of this period, the PCiNC signal shown in FIG. 7 (m) is supplied to the program counter 1, and the value of the program counter 1 is incremented at the time of its rise. Here, the address is in the form of PC ← PC + 2 because A 0 is fixed at “L”. Then, the reset is applied at the falling edge of the clock CK3 shown in FIG. 9E, and the execution of the operation is terminated at this point. The pulse width of the clock CK3 is short because the ternary counter 16a of the reference clock generation circuit 16 is reset by the reset signal REST. By the way, the sync signal shown in FIG. 3 (f) is a clock indicating the beginning of a machine cycle, and this clock generation period T is the instruction execution time T. For example, when the reference clock CLK is 5 MHz
If so, the instruction execution time T is 0.4 μs, and if it is 4 MHz, it is 0.5 μs. Also, (k) and (l) in FIG.
▼, write signal ▲ ▼. Next, the processing of the differential instruction will be described with reference to the execution time chart of FIG. (A) to (g) and (i) to (q) in FIG. 4 correspond to (a) to (g) and (i) to (q) in FIG.
To perform the processing of this instruction, the address output of the program counter 1 is selected by the signal ▼, the address a is output to the address buses A 1 to A 15 , and the operation result of the previous scan is output to the 1-bit RAM at the clock CK 1. In the clock CK2, the value of the operation result flag of the current scan is stored in the 1-bit RAM (period in FIG. 4 (h)), and the operation result is set in the flag section 7 at the falling edge of the clock CK2. is there. FIG. 5 shows an execution time chart when each instruction processing of the timer, the counter, and the shift register is performed. As shown in FIG. 5A, the interval of the sync signal, that is, the instruction execution time T is shown in FIG. ) Corresponds to 10 reference clocks CLK, and 2.0 μs if the reference clock CLK is 5 MHz. For these instructions, the reference generation clock circuit 16 shown in FIG. 2 uses the clocks CK1, CK2 and CK3 shown in FIGS. 5 (d), (e) and (f) as well as FIG. (H) φ 1 shown
And a φ 2 phase clock, and the φ 1 clock is used as the clock input of the machine state counter 16b, and the clock φ 2
The control clock is generated by combining the output of the machine state counter 16b shown in FIG. And Acc part 1
Subtraction, counting, and right shift are performed centering on 0 and the wALU unit 11, and in the case of a timer instruction in particular, auxiliary calculations are performed in parallel by the swALU unit 12 and the R register 13. Thus, the instruction fetch is performed by the OPCK signal shown in FIG. 5J created by combining the AEN signal shown in FIG. 5C and the clock CK1 shown in FIG. In the case of the status fetch shown in (k), the operation result flag of the previous scan is transferred from the operation status register 9 to the Acc section 10 by the Acc ▼ signal shown in FIG. ▼ The value of BCNT 1415 is transferred to the R register 13 by the signal. Next, the contact data is stored in the data register 5 by the data load shown in FIG. 1 (l), and the operation condition is then set by the operation result flag and the Acc unit 10 based on the status operation clock of FIG. Then, the result is stored in the operation status register 9. The processing in the subsequent states differs depending on the result. Processing such as shift, subtraction, and increment is shown in FIG.
The 16-bit operation is performed by the AccCLK signal shown in (1). In the case of a timer instruction, the TMP1 signal shown in (r)
Is added to the R register 13, the result is stored in the R register 13, and the R register 13 is latched by the latch signal shown in FIG. Shift 13 by 2. At this time, the current value or the set value is transferred to the Acc unit 10. Then, the value of the R register 13 is subtracted by the Acc section 10 according to the AccCLK signal shown in FIG. In addition, the output of the Acc section 10 is enabled by the Acc ▼ signal of FIG. The signal ▲ in FIG. 5 (u) is a clock for outputting the operation result flag of the current scan to the status area of the timer and the counter.
The signal is a clock for operating and outputting the contact data by the bit ALU unit 6. In addition, FIG.
▼ signal, FIG. (X) shows ▲ ▼ signal, FIG. (Y) shows ▲ ▼ signal, and FIG.
▼ Each signal is shown. FIG. 2 (a) shows the PCiNC signals. In addition, the INTCLK signal shown in Fig. (Β) detects an interrupt or an extension instruction at the end of instruction execution, and if these signals are present, the AEN signal is switched from “H” to “L” after execution of the instruction is completed. , Signals for setting the circuit of the present invention to a passive state. [Effects of the Invention] The present invention is configured as described above, and is provided with a dedicated arithmetic circuit for executing each instruction such as a bit operation instruction, a differentiation instruction, a timer instruction, and a counter instruction. , Each instruction can be executed, and the instruction processing can be performed at high speed. Even with built-in peripheral circuits, the number of gates can be reduced, and since it can be configured with two components, a gate array and a memory, costs can be reduced and a 16-bit CPU and multiprocessor configuration can be easily realized. It works. In the case of a differential instruction, the result of the previous scan is loaded from the data memory consisting of 1-bit RAM by the first clock, separately from the 16-beat data bus connected to the program memory storing the instruction. Then, the flag of the operation result of the current scan is stored in the data memory consisting of the 1-bit RAM by the second clock, and the operation result is set in the flag section at the falling edge of the second clock. By using a 17-bit configuration in which 1 bit is added to 16-bit data instead of 16-bit data, there is an effect that the restriction on the use of the differential instruction is eliminated, and the high-speed processing can be achieved with the shortest 2 cycles.

【図面の簡単な説明】 第1図は本発明の実施例の回路構成図、第2図は同上使
用の基本クロック発生回路の具体回路図、第3図、第4
図、第5図は同上の動作説明用のタイムチャートであ
る。 A……アドレス発生部、B……命令フエッチ部、C……
演算実行部、E……制御クロック発生部、1……プログ
ラムカウンタ、2……データ実アドレス部、3……命令
レジスタ、4……命令デコード部、6……ビットALU
部、7……フラグ部、10……Acc部、11……wALU部、12
……swALU部である。
BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a circuit configuration diagram of an embodiment of the present invention, FIG. 2 is a specific circuit diagram of a basic clock generation circuit used in the embodiment, and FIGS.
FIG. 5 and FIG. 5 are time charts for explaining the operation of the above. A: Address generation unit, B: Instruction fetch unit, C:
Arithmetic execution unit, E: control clock generation unit, 1: program counter, 2: data actual address unit, 3: instruction register, 4: instruction decode unit, 6: bit ALU
Section, 7 ... Flag section, 10 ... Acc section, 11 ... wALU section, 12
...... This is the swALU part.

───────────────────────────────────────────────────── フロントページの続き (58)調査した分野(Int.Cl.6,DB名) G05B 19/00 - 19/05──────────────────────────────────────────────────続 き Continued on front page (58) Field surveyed (Int. Cl. 6 , DB name) G05B 19/00-19/05

Claims (1)

(57)【特許請求の範囲】 1.ユーザプログラムのアドレス及びデータメモリのア
ドレスを出力するアドレス発生部と、プログラムメモリ
から読み出した命令を記憶して記憶した命令のデコード
を行う命令フェッチ部と、データメモリから読み出され
たデータを格納するデータレジスタ、基本的なビット操
作の命令を演算するビットALU部、該ビットALU部の演算
結果を格納するフラグ部、タイマ命令、カウンタ命令、
シフトレジスタ命令を16ビット並列処理するためのAcc
部、減算、シフトを行うワードALU部、タイマ命令専用
のシフトと加算とを行うサブワードALU部から少なくと
もなる演算実行部と、制御クロックを発生させる制御ク
ロック発生部とをゲートアレイで構成したプログラマブ
ルコントローラの命令処理回路において、微分命令の場
合には、命令を格納したプログラムメモリに接続される
16ビットデータバスとは別に、第1のクロックで前スキ
ャンの結果を、ビット専用バスにより1ビットRAMから
なるデータメモリよりロードし、第2のクロックにより
現スキャンの演算結果のフラグを上記1ビットRAMから
なるデータメモリに格納し、第2のクロックの立ち下が
りで演算結果をフラグ部にセットすることを特徴とする
プログラマブルコントローラの命令処理回路。
(57) [Claims] An address generation unit that outputs an address of a user program and an address of a data memory; an instruction fetch unit that stores an instruction read from the program memory and decodes the stored instruction; and stores data read from the data memory. A data register, a bit ALU part for calculating a basic bit operation instruction, a flag part for storing the operation result of the bit ALU part, a timer instruction, a counter instruction,
Acc for 16-bit parallel processing of shift register instructions
Programmable controller configured with a gate array including at least an arithmetic execution unit including a unit, a word ALU unit that performs subtraction and shift, a subword ALU unit that performs shift and addition dedicated to a timer instruction, and a control clock generation unit that generates a control clock In the case of a differential instruction, the instruction processing circuit is connected to a program memory storing the instruction.
Separately from the 16-bit data bus, the result of the previous scan is loaded from the data memory consisting of a 1-bit RAM by the first clock using the first clock, and the flag of the operation result of the current scan is loaded by the second clock using the 1-bit flag. An instruction processing circuit for a programmable controller, wherein the instruction processing circuit is stored in a data memory composed of a RAM and sets an operation result in a flag section at a falling edge of a second clock.
JP62211773A 1987-08-26 1987-08-26 Instruction processing circuit of programmable controller Expired - Lifetime JP2784001B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62211773A JP2784001B2 (en) 1987-08-26 1987-08-26 Instruction processing circuit of programmable controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62211773A JP2784001B2 (en) 1987-08-26 1987-08-26 Instruction processing circuit of programmable controller

Publications (2)

Publication Number Publication Date
JPS6455602A JPS6455602A (en) 1989-03-02
JP2784001B2 true JP2784001B2 (en) 1998-08-06

Family

ID=16611353

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62211773A Expired - Lifetime JP2784001B2 (en) 1987-08-26 1987-08-26 Instruction processing circuit of programmable controller

Country Status (1)

Country Link
JP (1) JP2784001B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2522563B2 (en) * 1989-11-15 1996-08-07 松下電工株式会社 Programmable controller
JP2529429B2 (en) * 1989-12-26 1996-08-28 株式会社日立製作所 Programmable controller
JP4569812B2 (en) * 2004-11-30 2010-10-27 ソニー株式会社 Optical disc apparatus, focal position control method for optical disc apparatus, and focal position control apparatus

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5856102A (en) * 1981-09-30 1983-04-02 Toyoda Mach Works Ltd Sequence controller
JPS59134804U (en) * 1983-02-23 1984-09-08 三菱電機株式会社 Sequence calculation circuit in sequence control device
JPS60237503A (en) * 1984-05-09 1985-11-26 Sharp Corp High-speed processing system of sequence controller

Also Published As

Publication number Publication date
JPS6455602A (en) 1989-03-02

Similar Documents

Publication Publication Date Title
JPS6361691B2 (en)
JPH0769791B2 (en) Microprocessor
JP2661222B2 (en) Pulse output device
JP2784001B2 (en) Instruction processing circuit of programmable controller
US4641278A (en) Memory device with a register interchange function
JP2752076B2 (en) Programmable controller
EP0462622B1 (en) Microprocessor capable of ensuring flexible recovery time for I/O device
EP0503498A2 (en) Single-chip microcomputer with program/data memory flag
JP2581080B2 (en) Microprocessor for debugging
JPS59123934A (en) Programmable logic controller
US5109516A (en) Sequence controller for controlling next operating state with a short sequence
JP3511691B2 (en) Arithmetic processing unit
JPH05298088A (en) Microcomputer
JP2758624B2 (en) Speed control method of micro program
JPS62221061A (en) Microcomputer
KR940009427B1 (en) Method and device for changing address space
JPS6133721Y2 (en)
JPS6235142B2 (en)
JPH04255028A (en) Microprocessor
JPS5838437Y2 (en) Program computer display control device
JPH03217988A (en) One-chip microcomputer
JP2693598B2 (en) Program execution controller for digital signal processor
JPH0683986A (en) Single chip microcomputer
JPS6015969B2 (en) Microinstruction address generation method
JPS5985546A (en) Data transfer control system

Legal Events

Date Code Title Description
EXPY Cancellation because of completion of term
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080522

Year of fee payment: 10