JPH03103948A - Memory protective circuit for microcomputer - Google Patents

Memory protective circuit for microcomputer

Info

Publication number
JPH03103948A
JPH03103948A JP1242839A JP24283989A JPH03103948A JP H03103948 A JPH03103948 A JP H03103948A JP 1242839 A JP1242839 A JP 1242839A JP 24283989 A JP24283989 A JP 24283989A JP H03103948 A JPH03103948 A JP H03103948A
Authority
JP
Japan
Prior art keywords
address
write
signal
cpu
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP1242839A
Other languages
Japanese (ja)
Inventor
Norio Aizawa
相沢 宣男
Naoki Sukai
須貝 直樹
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.)
Anritsu Corp
Original Assignee
Anritsu 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 Anritsu Corp filed Critical Anritsu Corp
Priority to JP1242839A priority Critical patent/JPH03103948A/en
Publication of JPH03103948A publication Critical patent/JPH03103948A/en
Pending legal-status Critical Current

Links

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

PURPOSE:To prevent write of erroneous data in a RAM due to program execution on an erroneous address by providing an address comparing circuit which confirms coincidence between a preliminarily determined address and the address where the write instruction read out by a CPU is written. CONSTITUTION:The address of a program memory 13 where the write instruction in a program is written is stored in an address comparing circuit 19. When a CPU 11 reads the write instruction from the program memory 13, coincidence between the address of the program memory 13 and the address in the address comparing circuit 19 is compared. The OR signal between the coincidence signal and the write signal outputted from the CPU 11 is sent to a RAM 15 as the new write signal. Thus, erroneous data write is prevented because the coincidence signal is not outputted from the address comparing circuit 19 in the case of runaway of the CPU 11.

Description

【発明の詳細な説明】 [産業上の利用分野コ 本発明はマイクロコンピュータに係わり、特に、CPU
が暴走した場合にRAMに誤ったデータか書込まれるこ
とを未然に防止するマイクロコンピュータのメモリ保護
回路に関する。
[Detailed Description of the Invention] [Industrial Field of Application] The present invention relates to microcomputers, particularly CPUs.
The present invention relates to a memory protection circuit for a microcomputer that prevents erroneous data from being written to a RAM in the event of runaway.

[従来の技術] 一般に、マイクロコンピュータにおいては、ROM (
リードφオンリ・メモリ)にプログラムを記憶し、RA
M (ランダム・アクセス・メモリ)に各種可変データ
を記憶するようにしている。第3図は一般的なマイクロ
コンピュータの要部を取出して示すブロック図である。
[Prior Art] Generally, in a microcomputer, ROM (
Store the program in the read φ only memory) and
Various variable data are stored in M (random access memory). FIG. 3 is a block diagram showing the main parts of a general microcomputer.

CPU (中央処理装置)1にバスライン2を介してプ
ログラム等の固定データを記憶するROM3とデータや
テーブル等の各種可変データを記憶するRAM4とが接
続され、さらに、CPUIがアクセスするROM3又は
RAM4を選択する選択信号CSO,?SIを出力する
アドレスデコーダ5が設けられている。
A ROM 3 that stores fixed data such as programs and a RAM 4 that stores various variable data such as data and tables are connected to a CPU (central processing unit) 1 via a bus line 2, and a ROM 3 or RAM 4 that is accessed by the CPU Selection signal CSO, ? An address decoder 5 that outputs SI is provided.

そして、CPUIからROMBへ続出信号RDが送出さ
れ、RAM4へは読出信号RDの他に書込信号WRが出
力される。また、このCPUIは、16ビットのアドレ
ス空間を指定でき、8ビットデータを出力できる。すな
わち、バスライン2は16本の線で構成され、ADO−
AD7までがアドレスとデータとを時分割で出力され、
A8〜A15までがアドレスのみがが出力される。また
、ROM3は[00001 u〜[ 7FPP] oの
アドレスが割付けられ、RAM4は[ 8000コ■〜
[ 9PPP] oが割付られている。
Then, a continuation signal RD is sent from the CPUI to the ROMB, and a write signal WR is output to the RAM 4 in addition to the read signal RD. Additionally, this CPU can specify a 16-bit address space and output 8-bit data. That is, bus line 2 is composed of 16 lines, and ADO-
Up to AD7 outputs addresses and data in a time-sharing manner,
Only addresses from A8 to A15 are output. Also, ROM3 is assigned addresses [00001u~[7FPP]o, and RAM4 is assigned addresses [8000~~
[9PPP] o is assigned.

また、アドレスデコーダ5は16ビットのアドレスのう
ち例えば最上位の1桁又は2桁のビ・ソトデータが人力
され、そのビットデータによってROM3およびRAM
4のいずれか一方の選択信号csO,CSIをLレベル
へ変化させてアクセス可能状態に制御する。
Further, the address decoder 5 is manually inputted with bi-soto data of the most significant one or two digits of the 16-bit address, and the bit data is used to control the ROM 3 and RAM.
The selection signals csO and CSI of either one of the four terminals are changed to the L level to control the access enabled state.

そして、例えばCPUIが、ROM3から、RAM4の
[ 8500] HのアドレスにC P U 1−内の
Aレジスタの記憶内容を書込む書込命令MOV  (8
500).A      −(1)を読出すと、第4図
に示すタイムチャートに従って、Aレジスタに記憶され
ているデータ[55]oをRAM4に書込む書込処理を
実行する。
Then, for example, the CPU issues a write instruction MOV (8
500). When A-(1) is read, a write process is executed to write data [55]o stored in the A register to the RAM 4 according to the time chart shown in FIG.

まず、バスライン2のアドレスバスに対してアドレス[
 85001 oおよびデータ[55] oを出力する
。同時に、アドレスデコーダ5を介して選択信号CSI
をLレベルへ変化させる。そして、書込信号WRを出力
すると、RAM4の書込可能端子WEがLレベルとなり
、バスライン2のデータパスに出力されているデータ[
55]}1が、RAM4内のアドレスバスに指定されて
いるアドレス[ 8500] Hに書込まれる。
First, address [
85001 o and data [55] o are output. At the same time, the selection signal CSI is sent via the address decoder 5.
change to L level. Then, when the write signal WR is output, the write enable terminal WE of the RAM 4 goes to L level, and the data [[
55]}1 is written to address [8500]H specified on the address bus in RAM4.

[発明が解決しようとする課題] しかしながら上記のようなマイクロコンピュータにおい
てもまだ解消すべき次のような問題があった。
[Problems to be Solved by the Invention] However, even in the above-mentioned microcomputer, there are the following problems that still need to be solved.

すなわち、例えば何等かの要因にてCPUIが制御不能
になった場合、すなわちCPUIが暴走し、RAMJ上
でプログラムが実行された場合、RAM4上のデータが
たまたま(1)式の書込命令と同一の命令としてCPU
Iが読込み、それを実行してしまうと、本来のプログラ
ムの流れの中でのデータ書込みと異なる為に、正規デー
タが他のデータ[55] Hに書き替えられてしまう問
題がある。
In other words, for example, if the CPU becomes uncontrollable for some reason, that is, if the CPU goes out of control and a program is executed on RAMJ, the data on RAM4 happens to be the same as the write command in equation (1). CPU as instructions
If I reads and executes it, there is a problem that the normal data will be rewritten to other data [55]H because this is different from data writing in the original program flow.

本発明はこのような事情に鑑みてなされたものであり、
CPUが読出した書込命令の書込まれているプログラム
メモリのアドレスが予め定められたアドレスと一致する
ことを確認するアドレス比較回路を設けることによって
、アドレス一致したときのみRAMに対する書込動作を
可能とでき、誤ってデータが書込まれるのを未然に防止
でき、RAMの重要なデータが消滅することを防止でき
、システム全体の信頼性を向上できるマイクロコンピュ
ータのメモリ保護回路を提供することを目的とする。
The present invention was made in view of these circumstances, and
By providing an address comparison circuit that confirms that the program memory address to which the write command read by the CPU is written matches a predetermined address, it is possible to perform a write operation to the RAM only when the address matches. The purpose of the present invention is to provide a memory protection circuit for a microcomputer that can prevent data from being written erroneously, prevent important data from disappearing in RAM, and improve the reliability of the entire system. shall be.

5 [課題を解決するための手段] 上記課題を解消するために本発明のマイクロコンピュー
タのメモリ保護回路は、データを一時記憶するRAMと
、少なくとも書込データおよびRAM内のアドレスを指
定した書込命令を含む複数の命令からなるプログラムを
記憶するプログラムメモリと、これらのメモリを制御す
るCPUとを有し、このCPUがプログラムメモリから
書込命令を読出して、RAM内のこの書込命令が指定す
るアドレスへ同じく書込命令が指定するデータを書込む
マイクロコンピュータにおいて、CPUが読出した書込
命令の書込まれているプログラムメモリのアドレスが予
め定められたアドレスに一致するか否かを比較するアド
レス比較回路と、このアドレス比較回路から出力される
一致信号とCPUから出力される書込信号との論理積信
号をRAMへ新たな書込信号として送出するゲート回路
とを備えたものである。
5 [Means for Solving the Problems] In order to solve the above problems, the memory protection circuit of the microcomputer of the present invention includes a RAM for temporarily storing data, and a write function that specifies at least write data and an address in the RAM. It has a program memory that stores a program consisting of a plurality of instructions including instructions, and a CPU that controls these memories.The CPU reads a write instruction from the program memory, and this write instruction in the RAM In a microcomputer that also writes data specified by a write command to an address specified by the write command, the CPU compares whether the address of the program memory to which the write command read by the CPU is written matches a predetermined address. This device includes an address comparison circuit and a gate circuit that sends an AND signal of a match signal output from the address comparison circuit and a write signal output from the CPU to the RAM as a new write signal.

[作用] このように構威されたマイクロコンピュータの6 メモリ保護回路であれば、アドレス比較回路内には、プ
ログラムにおける書込命令の書込まれているプログラム
メモリのアドレスが記憶されている。
[Operation] In the memory protection circuit of the microcomputer configured in this manner, the address of the program memory to which the write command in the program is written is stored in the address comparison circuit.

そして、CPUが例えばROM等で形成されたプログラ
ムメモリから書込命令を読取った場合には、その書込命
令の書込まれているプログラムメモリのアドレスと前記
アドレス比較回路内のアドレスに一致するか否かが比較
される。そして、その一致信号とCPUから出力される
書込信号との論理積信号が新たな書込信号としてRAM
へ送出される。
When the CPU reads a write command from a program memory formed of, for example, a ROM, the address of the program memory where the write command is written matches the address in the address comparison circuit. It is compared whether or not. Then, the AND signal of the match signal and the write signal output from the CPU is stored in the RAM as a new write signal.
sent to.

よって、CPUが暴走して本来の命令語が書込まれてい
る以外のアドレスから書込命令を読込んだ場合には、ア
ドレス比較回路から一致信号が出力されないので、たと
えCPUが書込信号を出力したとしてもゲート回路でそ
の書込信号は遮断される。その結果、誤ってデータが書
込まれることが防止される。
Therefore, if the CPU goes out of control and reads a write command from an address other than the address where the original command word is written, the address comparison circuit will not output a match signal, so even if the CPU Even if it is output, the write signal is blocked by the gate circuit. As a result, data is prevented from being written erroneously.

[実施例] 以下本発明の一実施例を図面を用いて説明する。[Example] An embodiment of the present invention will be described below with reference to the drawings.

?1図は実施例のメモリ保護回路を組込んだマイクロコ
ンピュータの要部を取出して示すブロック図である。図
中11は各柾情報処理を実行するCPUであり、このC
PUI 1は、バスライン12を介してプログラムや各
種固定データを記憶するプログラムメモリとしてのRO
M13,さほど重要でない一般データを一時記憶するR
AM14,比較的重要なデータを記憶するRAM15の
各メモリに対するアクセス処理を実行する。さらに、C
PUIは、各メモリ13,14.15の出力許可端子O
Eへ読出信号RDを送出し、RAM14の書込許可端子
WEおよびゲート回路16のナンドゲート17へ書込信
号RDを送出する。また、第3図のCPUIと同様に、
16ビットのアドレス空間を指定でき、8ビットデータ
を出力できる。すなわち、バスライン12は16本の線
で構或され、ADO〜AD7までかアドレスとデータと
が時分割で出力され、A8〜A15までがアドレスのみ
がか出力される。
? FIG. 1 is a block diagram showing the main parts of a microcomputer incorporating a memory protection circuit according to an embodiment. 11 in the figure is a CPU that executes each section information processing, and this C
PUI 1 is connected to RO as a program memory that stores programs and various fixed data via bus line 12.
M13, R that temporarily stores general data that is not very important
Access processing is executed for each memory of the AM 14 and the RAM 15 that stores relatively important data. Furthermore, C
PUI is the output permission terminal O of each memory 13, 14.15.
The read signal RD is sent to the write enable terminal WE of the RAM 14 and the NAND gate 17 of the gate circuit 16. Also, similar to the CPUI in Figure 3,
A 16-bit address space can be specified and 8-bit data can be output. That is, the bus line 12 is composed of 16 lines, and addresses and data from ADO to AD7 are outputted in a time-division manner, and only addresses from A8 to A15 are outputted.

また、ROM1Bは[ 0000] H〜[7PPPコ
■のア?レスが割付けられ、RAM14は[AOOO]
 H〜[PPPP] uが割付られ、さらに、RAM1
5は[ 8000]■〜[9PPP] +{が割付られ
ている。
Also, ROM1B is [0000]H~[7PPPko ■A? response is allocated and RAM14 is [AOOO]
H ~ [PPPP] u is allocated, and RAM1
5 is assigned [8000]■~[9PPP]+{.

また、アドレスデコーダ18は16ビットのアドレスの
うち例えば最上位の1桁又は2桁のビットデータが入力
され、そのビットデータによってROM].3,RAM
14およびRAM15の各選択端子CSへ入力される選
択信号CSO,CSI,CS2のうちのうちの一つの選
択信号をLレベルへ変化させて該当メモリをアクセス可
能状態に制御する。
Further, the address decoder 18 receives bit data of, for example, the most significant one or two digits of the 16-bit address, and the bit data allows the ROM]. 3.RAM
One of the selection signals CSO, CSI, and CS2 inputted to each selection terminal CS of 14 and RAM 15 is changed to L level to control the corresponding memory to be accessible.

また、アドレス比較回路19にはバスライン12のデー
タパスに出力された8ビットのデータが入力される。そ
して、アドレスラッチ信号によりADO−AD7のデー
タをAO〜A7のアドレスデータとして取込み、A8〜
A15のアドレスと組わ合せて、1個の16ビットのア
ドレスデータAO〜A15として処理する。そして、こ
のアドレス比較回路19には前記ROM13に記憶され
たプログラム命令が書込まれている各アドレス9 ADSが記憶されている。そして、”バスライン12か
ら読取ったアドレスADが予め記憶されている各アドレ
スAD8のうちの一つのアドレスに一致すれば、H(ハ
イ)レベルの一致信号aを出力する。
Furthermore, the 8-bit data output to the data path of the bus line 12 is input to the address comparison circuit 19. Then, the data of ADO-AD7 is taken in as address data of AO-A7 by the address latch signal, and
It is combined with the address of A15 and processed as one 16-bit address data AO to A15. The address comparison circuit 19 stores each address 9 ADS in which the program instructions stored in the ROM 13 are written. Then, if the address AD read from the bus line 12 matches one of the pre-stored addresses AD8, an H (high) level match signal a is output.

アドレス比較回路1つから出力された一致信号aはゲー
ト回路6のD型のフリップフロップ20の入力端子Dへ
入力される。また、フリップフロップ20のクロック端
子CPには、CPU11から出力される読出信号RDが
ナンドゲート21を介して入力される。さらに、ナンド
ゲート21の他方端にはCPUI 1から、・このCP
UIIが各メモリ13,14.15からデータを読取る
ときに出力されるフエツチ信号MIが入力される。ゲー
ト回路16において、フリップフロップ20の出力端子
0の出力信号bは前記ナンドゲート17の他方の入力端
子へ印加される。
The match signal a output from one address comparison circuit is input to the input terminal D of the D-type flip-flop 20 of the gate circuit 6. Further, the read signal RD output from the CPU 11 is input to the clock terminal CP of the flip-flop 20 via the NAND gate 21 . Furthermore, at the other end of the NAND gate 21, from CPU 1, this CP
A fetch signal MI output when the UII reads data from each memory 13, 14, 15 is input. In the gate circuit 16, the output signal b of the output terminal 0 of the flip-flop 20 is applied to the other input terminal of the NAND gate 17.

よって、アドレス比較回路1つからHレベルの一致信号
aがフリップフロップ20の入力端子Dへ印加された状
態で、ナンドゲート21の出力信1 0 号CがLレベルからHレベルへ立ち上がると、出力端子
0の出力信号bがHレベルからLレベルへ立下がる。フ
リップフロップ20の出力信号bがLレベルへ立下がる
と、ナンドゲート17の他方の入力端子へ人力されてい
るCPUI 1からの書込信号WRがLレベルに変化し
た時点で、このナンドゲート17が成立して、RAM1
5の書込許可端子WEへLレベルの論理積信号としての
新たな書込信号dが印加される。
Therefore, when the output signal 10C of the NAND gate 21 rises from the L level to the H level while the H level match signal a from one address comparison circuit is applied to the input terminal D of the flip-flop 20, the output terminal Output signal b of 0 falls from H level to L level. When the output signal b of the flip-flop 20 falls to the L level, the NAND gate 17 is established when the write signal WR from the CPU 1 inputted to the other input terminal of the NAND gate 17 changes to the L level. te, RAM1
A new write signal d as an L-level AND signal is applied to the write enable terminal WE of No. 5.

このように構成されたメモリ保護回路の動作を第2図の
タイムチャートを用いて説明する。
The operation of the memory protection circuit configured as described above will be explained using the time chart shown in FIG.

なお、説明を簡略するために、例えばROM13のアド
レス[ 10001 s〜[1002] sに前述した
書込命令が記憶されており、CPU11がこの書込命令
を読出て実行する場合を示す。
In order to simplify the explanation, a case is shown in which, for example, the write command described above is stored at addresses [10001s to [1002]s of the ROM 13, and the CPU 11 reads and executes this write command.

MOV  (8500).A      −(2)した
がって、アドレス比較回路19内にROM13の中で、
書込命令の書込まれているアドレスのうち[1002]
 oも記憶されている。
MOV (8500). A-(2) Therefore, in the address comparison circuit 19 and in the ROM 13,
[1002] of the addresses where the write command is written
o is also memorized.

先ず、CPU11は、フエツチ信号Mlに同期11 ?て、アドレスバスに前記書込命令が記憶されたROM
13内の各アドレス[10001 H ,[ 1001
コo ,  [1002] }Iを出力する。すると、
アドレスデコーダ18がそのアドレスの最上位の1ビッ
ト又は2ビットを判断して、ROMI 3の選択信号C
SOをLレベルとする。また、フェッチ信号Mlに同期
して読出信号RDを送出する。
First, the CPU 11 synchronizes with the fetch signal M1? and a ROM in which the write command is stored in the address bus.
Each address in 13 [10001H, [1001
Outputs ko , [1002] }I. Then,
The address decoder 18 determines the most significant 1 or 2 bits of the address and selects the ROMI 3 selection signal C.
Set SO to L level. Further, a read signal RD is sent out in synchronization with the fetch signal Ml.

その結果、ROM13の各アドレスに [ 1000] H ,  [ 1001コ■,  [
1002] Hに記憶されている(2)式の書込命令に
対応する各データ[3A] o ,  [00コ}l,
[85]Hがデータパスへ出力される。CPUI 1は
データパスに出力された各データを読取る。
As a result, [1000] H, [1001 Ko■, [
1002] Each data corresponding to the write command of formula (2) stored in H [3A] o, [00}l,
[85] H is output to the data path. CPUI 1 reads each data output to the data path.

この場合、アドレス比較回路1つは、3回目のフエツチ
周期で読取った16ビットのアドレス[1002] o
として読取る。そして、このアドレス[1002] H
は予め記憶されたアドレスと一致するので、Hレベルの
一致信号aが出力される。
In this case, one address comparison circuit reads the 16-bit address [1002] o read in the third fetch cycle.
Read as. And this address [1002] H
Since the address matches the pre-stored address, an H level match signal a is output.

そして、このフエツチ周期における読出信号RDが元の
Hレベルへ復帰すると、ナンドゲート12 21が成立しなくなり、ナンドゲート21の出力信号C
がHレベルへ立上がる。その結果、フリップフロップ2
0の出力端子0がHレベルからLレベルへ立下がる。な
お、この時点では、まだ、CPUIIから書込信号WR
は出力されていないので、ナンドゲート17は成立しな
い。
Then, when the read signal RD in this fetch period returns to the original H level, the NAND gate 1221 is no longer established, and the output signal C of the NAND gate 21 is
rises to H level. As a result, flip-flop 2
Output terminal 0 of 0 falls from H level to L level. Note that at this point, the write signal WR is still being sent from the CPU II.
is not output, so the NAND gate 17 is not established.

次に、ROMI 3からの(2)式で示される書込命令
を読込んだCPUI 1は、今度はRAMI 5に対す
る書込処理を開始する。先ず、アドレスバスに先に読取
ったアドレス[ 8500] Hを出力するとともに、
データパスにAレジスタに記憶されているデータ[55
] }1を出力する。
Next, the CPU 1 which has read the write command shown by equation (2) from the ROMI 3 starts writing processing to the RAMI 5. First, output the previously read address [8500]H to the address bus, and
The data stored in the A register in the data path [55
] }Outputs 1.

データパスにデータ[55] Hが出力されるとアドレ
ス比較回路1つのアドレス一致が解除され、一致信号a
はLレベルへ戻るが′、フリップフロップ20の出力信
号bは次のフエツチ周期が開始されない限り、Lレベル
を維持する。
When data [55]H is output to the data path, the address match of one address comparison circuit is canceled and the match signal a
returns to the L level, but the output signal b of the flip-flop 20 remains at the L level until the next fetch period is started.

また、アドレスバスにアドレス[8500] Hが出力
されると、アドレスデコーダ18がデータを書込むべき
RAM15へLレベルの選択/g号CSI13 を送出する。さらにCPUI1は、書込信号WRをHレ
ベルからLレベルへ立下げる。すると、ナンドゲート1
7が成立して、RAMI 5の書込許可端子WEにLレ
ベルの書込信号dが入力される。
Further, when the address [8500] H is output to the address bus, the address decoder 18 sends an L level selection/g CSI 13 to the RAM 15 into which data is to be written. Further, the CPUI1 lowers the write signal WR from the H level to the L level. Then, Nand Gate 1
7 is established, and the write signal d at L level is input to the write enable terminal WE of RAMI 5.

よって、RAM15のアドレス[85001 oにデー
タ[55] Hが書込まれる。
Therefore, data [55] H is written to address [85001 o of the RAM 15.

このように構成されたマイクロコンピュータのメモリ保
護回路であれば、アドレス比較回路19内にROM13
に記憶されたプログラムの各書込命令が書込まれている
各アドレスADSが記憶されている。そして、バスライ
ン12から読取ったアドレスADが予め記憶されている
各アドレスA D sのうちの一つのアドレスに一致す
れば、H(ハイ)レベルの一致信号aを出力する。した
がって、何等かの要因にてCPUI 1が暴走して、R
AM上でプログラムの実行を開始したまま(2〉式の書
込命令を読取り、アドレス[ 8500] Hにデータ
を書込もうとしても、アドレス比較回路19から一致信
号aが出力されない。
In the memory protection circuit of a microcomputer configured in this way, the ROM 13 is stored in the address comparison circuit 19.
Each address ADS to which each write command of the program stored in is written is stored. If the address AD read from the bus line 12 matches one of the addresses A D s stored in advance, a match signal a of H (high) level is output. Therefore, for some reason, CPUI 1 goes out of control and R
Even if an attempt is made to read the write command (formula 2) and write data to address [8500]H while the program execution has started on the AM, the address comparison circuit 19 does not output the match signal a.

よって、たとえCPUI 1がアドレスおよびデ14 夕をを送出して、書込信号WRをLレベルへ変化させた
としても、該当RAM15の書込許可端子WEにLレベ
ルの書込信号dが印加されることはない。その結果、た
とえ間違ったアドレス上でプログラムが実行されたとし
ても、重要なデータが他のデータに書替えられて、消滅
することはない。
Therefore, even if the CPU 1 sends out the address and data 14 and changes the write signal WR to the L level, the write signal d at the L level will not be applied to the write enable terminal WE of the corresponding RAM 15. It never happens. As a result, even if a program is executed at the wrong address, important data will not be rewritten and lost.

したがって、RAM15に記憶された重要なデータをC
PUI 1の暴走から確実に保護することができる。
Therefore, important data stored in the RAM 15 can be
It is possible to reliably protect PUI 1 from running out of control.

[発明の効果コ 以上説明したように本発明のメモリ保護回路によれば、
CPUが読出した書込命令の書込まれているアドレスが
予め定められたアドレスと一致することを確認するアド
レス比較回路を設けることによって、アドレス一致した
ときのみRAMに対する書込動作を可能とできる。した
がって、たとえCPUか暴走したとしても、間違ったア
ドレス上でプログラムが実行されRAMにデータが書込
まれるのを未然に防止できるので、RAMの重要15 なデータが消滅することを防止でき、マイクロコンピュ
ータ全体の信頼性を向上できる。
[Effects of the Invention] As explained above, according to the memory protection circuit of the present invention,
By providing an address comparison circuit that confirms that the address written in the write command read by the CPU matches a predetermined address, a write operation to the RAM can be performed only when the addresses match. Therefore, even if the CPU goes out of control, it is possible to prevent a program from being executed at the wrong address and writing data to the RAM, which prevents important data in the RAM from being erased. Overall reliability can be improved.

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

第1図は実施例のメモリ保護回路を組込んたマイクロコ
ンピュータの要部を示すブロック図、第2図は同実施例
回路の動作を示すタイムチャ−1・、第3図は一般的な
マイクロコンピュータの要部を示すブロック図、第4図
は同マイクロコンピュータの書込動作を示すタイムチャ
ートである。 11・・・CPU,12・・・バスライン、13・・・
ROM,14.15・・・RAM,16・・・ゲート回
路、17.21・・・ナンドゲート、18・・・アドレ
スデコーダ、19・・・アドレス比較回路、20・・・
フリップフロップ。
Fig. 1 is a block diagram showing the main parts of a microcomputer incorporating the memory protection circuit of the embodiment, Fig. 2 is a time chart 1 showing the operation of the circuit of the embodiment, and Fig. 3 is a general microcomputer. FIG. 4 is a block diagram showing the main parts of the microcomputer, and FIG. 4 is a time chart showing the write operation of the microcomputer. 11...CPU, 12...Bus line, 13...
ROM, 14.15...RAM, 16...Gate circuit, 17.21...NAND gate, 18...Address decoder, 19...Address comparison circuit, 20...
flip flop.

Claims (1)

【特許請求の範囲】 データを一時記憶するRAM(ランダム・アクセス・メ
モリ15)と、少なくとも書込データおよび前記RAM
内のアドレスを指定した書込命令を含む複数の命令から
なるプログラムを記憶するプログラムメモリ(13)と
、これらのメモリを制御するCPU(中央処理装置11
)とを有し、このCPUが前記プログラムメモリから前
記書込命令を読出して、前記RAM内のこの書込命令が
指定するアドレスへ該書込命令が指定するデータを書込
むマイクロコンピュータにおいて、 前記CPUが読出した書込命令の書込まれているプログ
ラムメモリ(13)のアドレスが予め定められたアドレ
スに一致するか否かを比較するアドレス比較回路(19
)と、このアドレス比較回路から出力される一致信号と
前記CPUから出力される書込信号との論理積信号(d
)を前記RAMへ新たな書込信号として送出するゲート
回路(16)とを備えたマイクロコンピュータのメモリ
保護回路。
[Claims] A RAM (random access memory 15) that temporarily stores data, and at least write data and the RAM.
A program memory (13) that stores a program consisting of a plurality of instructions including a write instruction specifying an address in the memory, and a CPU (central processing unit 11) that controls these memories.
), the CPU reads the write instruction from the program memory and writes data specified by the write instruction to an address specified by the write instruction in the RAM, An address comparison circuit (19) that compares whether the address of the program memory (13) in which the write command read by the CPU is written matches a predetermined address.
), the AND signal (d
) to the RAM as a new write signal.
JP1242839A 1989-09-19 1989-09-19 Memory protective circuit for microcomputer Pending JPH03103948A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1242839A JPH03103948A (en) 1989-09-19 1989-09-19 Memory protective circuit for microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1242839A JPH03103948A (en) 1989-09-19 1989-09-19 Memory protective circuit for microcomputer

Publications (1)

Publication Number Publication Date
JPH03103948A true JPH03103948A (en) 1991-04-30

Family

ID=17095062

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1242839A Pending JPH03103948A (en) 1989-09-19 1989-09-19 Memory protective circuit for microcomputer

Country Status (1)

Country Link
JP (1) JPH03103948A (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS57100539A (en) * 1980-12-16 1982-06-22 Fujitsu Ltd Control circuit for writing of control storage

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS57100539A (en) * 1980-12-16 1982-06-22 Fujitsu Ltd Control circuit for writing of control storage

Similar Documents

Publication Publication Date Title
JPH10228421A (en) Memory access control circuit
US5127096A (en) Information processor operative both in direct mapping and in bank mapping, and the method of switching the mapping schemes
JPH03103948A (en) Memory protective circuit for microcomputer
EP0461631B1 (en) Data storing device having a plurality of registers allotted for one address
US5513353A (en) Cache control system which permanently inhibits local but not global parameter data writes to main memory
JPS61500992A (en) Improvements in or relating to computer systems
JPH09114743A (en) Single chip microcomputer
US4511983A (en) Apparatus for controlling microinstructions stored in a data processing unit memory
JPH02128266A (en) Register with protective function
JP2540959B2 (en) Information processing device
JP3152595B2 (en) Microcomputer interrupt handling device
JPH0398119A (en) Storage device
KR870002194B1 (en) Memory mapping circuit of video ram
JPH01100799A (en) Read-only memory control circuit
JP3039479B2 (en) Extended BIOS protection system
JP2581057B2 (en) Evaluation microcomputer
JPS63279323A (en) Address designating system for central processing unit
JPS6112579B2 (en)
JPH03242744A (en) Instruction processing method
JPH0744463A (en) One-chip microcomputer incorporating eeprom
JPH0154729B2 (en)
JPH0512071A (en) Trace circuit
JPS6385831A (en) Control circuit for microprocessor
JPS61110245A (en) Operation history device
JPH04134786A (en) Memory address circuit