JPS61201363A - Single-chip microcomputer - Google Patents
Single-chip microcomputerInfo
- Publication number
- JPS61201363A JPS61201363A JP60043059A JP4305985A JPS61201363A JP S61201363 A JPS61201363 A JP S61201363A JP 60043059 A JP60043059 A JP 60043059A JP 4305985 A JP4305985 A JP 4305985A JP S61201363 A JPS61201363 A JP S61201363A
- Authority
- JP
- Japan
- Prior art keywords
- data
- bit
- code
- error
- program
- 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.)
- Granted
Links
- 230000015654 memory Effects 0.000 claims abstract description 22
- 238000013500 data storage Methods 0.000 claims abstract description 7
- 238000000034 method Methods 0.000 claims description 22
- 239000004065 semiconductor Substances 0.000 claims description 3
- 230000000717 retained effect Effects 0.000 claims description 2
- 239000000758 substrate Substances 0.000 claims description 2
- 230000006870 function Effects 0.000 abstract description 6
- 238000001514 detection method Methods 0.000 description 7
- 239000011159 matrix material Substances 0.000 description 6
- 239000013598 vector Substances 0.000 description 4
- 238000010586 diagram Methods 0.000 description 3
- 101100385358 Alicyclobacillus acidoterrestris (strain ATCC 49025 / DSM 3922 / CIP 106132 / NCIMB 13137 / GD3B) cas12b gene Proteins 0.000 description 1
- 101100268668 Caenorhabditis elegans acc-2 gene Proteins 0.000 description 1
- 101100207507 Streptomyces coelicolor (strain ATCC BAA-471 / A3(2) / M145) tri2 gene Proteins 0.000 description 1
- 235000015278 beef Nutrition 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- QQODLKZGRKWIFG-UHFFFAOYSA-N cyfluthrin Chemical compound CC1(C)C(C=C(Cl)Cl)C1C(=O)OC(C#N)C1=CC=C(F)C(OC=2C=CC=CC=2)=C1 QQODLKZGRKWIFG-UHFFFAOYSA-N 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000009294 enhanced biological phosphorus removal Methods 0.000 description 1
- 230000014759 maintenance of location Effects 0.000 description 1
Landscapes
- Detection And Correction Of Errors (AREA)
- Microcomputers (AREA)
Abstract
Description
【発明の詳細な説明】
(産業上の利用分野)
本発明はシングルチップマイクロコンビエータに関する
。特に、プログラムを記憶するプログラム記憶部と、デ
ータを記憶するデータ記憶部と、データの入出力部と、
データの処理を行う中央処理装置(以下CPUと記す)
に加え、各種情報を保持・記憶する不揮発生メモリ部を
有するシングルチップマイクロコンビエータに係る。DETAILED DESCRIPTION OF THE INVENTION Field of the Invention The present invention relates to a single-chip microcombinator. In particular, a program storage unit that stores programs, a data storage unit that stores data, and a data input/output unit,
Central processing unit (hereinafter referred to as CPU) that processes data
In addition, the present invention relates to a single-chip micro combinator having a non-volatile memory section that holds and stores various information.
近年の急速なLSI技術の進歩により、不揮発性メモリ
を塔載したシングルチップマイクロコンビ瓢−夕を実現
することが可能となってきている。With the rapid progress of LSI technology in recent years, it has become possible to realize single-chip microcombinations equipped with non-volatile memory.
不揮発性メモリは非動作時にもデータを保持するという
特性を持つものであシ、中でもエレクトリカル・イラザ
プル・アンド・エレクトリカル・プログラマブル・リー
ドオンリー・メモリ(ElectricalElasa
ble & Electrical PIograma
ble Read OnlyMemory ) EEP
ROMは、メモリトランジスタのコントロールゲートに
印加する電圧を制御することにより、データの書込みと
消去が可能であるために、マイクロコンビエータを用い
た自動車のエンジン制御や、テレビの電子チャンネル制
御、サーボモータの制御等多くの産業分野に利用できる
。Non-volatile memory has the characteristic of retaining data even when it is not in operation.
ble & Electrical PIograma
ble Read OnlyMemory) EEP
ROM can write and erase data by controlling the voltage applied to the control gate of the memory transistor, so it is used for controlling automobile engines using micro combinators, electronic channel control for televisions, and servo motors. It can be used in many industrial fields such as control.
(従来の技術とその問題点)
上述の如く、多くの産業分野で実用化促進されている不
揮発性メモリーではあるが、EEPR?)Mに代表され
る各種不揮発性メモリーはその最大の特徴である不揮発
性を実現するべく、複雑なプロセスにより製造されてい
る為に、通常の揮発性半導体メモリーに比較して大変高
価である。従って、CPUに加え各111110機能や
プログラム記憶部、データ記憶部を集積したシングルチ
ップマイクロコンピュータに不揮発性メモリーを経済的
に塔載することはきわめて困難な状況にある。(Conventional technology and its problems) As mentioned above, non-volatile memory is being put into practical use in many industrial fields, but EEPR? ) Various types of non-volatile memory represented by M are manufactured using complicated processes in order to achieve non-volatility, which is their greatest feature, so they are much more expensive than ordinary volatile semiconductor memories. Therefore, it is extremely difficult to economically incorporate nonvolatile memory into a single-chip microcomputer that integrates a CPU, 111,110 functions, a program storage section, and a data storage section.
さらに、不揮発性メモリーのデータ保持特性が向上して
いる現状下においても、高エネルギーを印加しての変型
なるデータの消去や書l込み、外来ノイズ、その他の原
因により、データに誤シが発生するという可能性は依然
として残っている。Furthermore, even under the current situation where the data retention characteristics of non-volatile memory have improved, data errors still occur due to data deformation caused by the application of high energy, erasure or writing, external noise, and other causes. There is still a possibility that it will.
したがって、本発明の第1の目的は、エラー検出・訂正
機能により、経済性に不揮発性メモリー内蔵シングルチ
ップマイクロコンビエータを実現することであり、エラ
ー検出訂正機能はECC(Error Correct
ing Code)回路のような特別なものを付加せず
に、シングルチップマイクロコンビ二一夕が元来有する
資源の有効利用によ〃実現される。Therefore, the first object of the present invention is to economically realize a single-chip microcombiator with a built-in nonvolatile memory by using error detection and correction functions.
This can be achieved by effectively utilizing the resources originally present in a single-chip microcombiner, without adding special components such as ing code circuits.
また、本発明の第2の目的は不揮発性メモリー内蔵シン
グルチップマイクロコンビエータの応用システム上で動
作中に不揮発性メモリーのデータを誤りから保護するこ
とである。A second object of the present invention is to protect data in non-volatile memory from errors during operation on an application system of a single-chip microcomviator with built-in non-volatile memory.
(問題点を解決するための手段)
本発明のマイクロコンピュータは、単一半導体基盤上に
データの入出力部と、プログラムを記憶するプログラム
記憶部と、データを記憶するデータ記憶部と、プログラ
ムに従い各種データの処理を実行するCPUと、非動作
中もデータを記憶・保持する不揮発性メモリー部とを備
えたシングルチップマイクロコンビ為−夕において、
プログラム記憶部のプログラムに従いCPUKよシ所定
のデータを符号データとする符号化手段と、符号データ
をプログラム記憶部のプログラムに従いCPUによ〕復
号化し所定のデータを生成する復号化手段とを設け、
符号データを不揮発性メモリー部に記憶・保持させるよ
うにしたことを特徴とする。(Means for Solving the Problems) The microcomputer of the present invention has a data input/output section, a program storage section for storing a program, a data storage section for storing data, and a data input/output section for storing data on a single semiconductor substrate. In a single-chip microcombination system equipped with a CPU that processes various data and a non-volatile memory section that stores and retains data even when it is not operating, the CPU stores predetermined data according to the program in the program storage section. An encoding means for converting the encoded data into encoded data, and a decoding means for decoding the encoded data by a CPU according to a program in a program storage section to generate predetermined data, and the encoded data is stored and retained in a non-volatile memory section. It is characterized by the following.
(実施例)
第1図は、不揮発性メモリーを内蔵しエラー検出・訂正
機能を備えた本発明の一実施例を示す。(Embodiment) FIG. 1 shows an embodiment of the present invention which includes a built-in non-volatile memory and has an error detection and correction function.
本実施例においては、不揮発性メモリーとしてEBPR
?>Mを用い、取シ扱うデータは8ビツトで、エラー検
出・訂正方法としては、2ビツト誤〕検出、1ビット誤
り訂正の4ビツトのチェックビットを伴うハミング符号
及び1ビツトの偶数パリティ−ビットを用いる。In this embodiment, EBPR is used as the nonvolatile memory.
? >M, the data handled is 8 bits, and the error detection/correction method is a Hamming code with 4 check bits for 2-bit error detection and 1-bit error correction, and 1 even parity bit. Use.
シングルチップマイクロコンビエータ100は、外部入
力線101、入出力部102、データの演算・処理を行
うCPU103、各種情報を記憶するRAM104、プ
ログラム及びシステム定数を記憶しているROM1os
、情報を保持・記憶するEBPROMl 06および内
部バス107から構成されている。CPUI 03は、
Bビットデータを符号データに変換する符号化手段と、
符号データを8ビツトデータに変換、すなわち、符号デ
ータを用いてエラー検出・訂正を行う復号化手段とを有
しているが、図面の繁雑化を回避するため図示は省略す
る。The single-chip microcombiator 100 includes an external input line 101, an input/output unit 102, a CPU 103 that performs data calculation and processing, a RAM 104 that stores various information, and a ROM 1os that stores programs and system constants.
, an EBPROM 106 that holds and stores information, and an internal bus 107. CPUI 03 is
encoding means for converting B-bit data into code data;
Although it has decoding means for converting code data into 8-bit data, that is, detecting and correcting errors using the code data, illustration thereof is omitted to avoid complication of the drawing.
以下、第1図を参照しながらエラー検出・訂正機能の動
作について述べる。The operation of the error detection/correction function will be described below with reference to FIG.
8ビツトデータは、CPU103において符号化手段が
機能させられることにより、13ビツトの符号データ(
8ビツトデータ+4チエツクピツト+1パリテイ−ビッ
ト)に変換され、EEPROM106の符号データ格納
領域106−1に書き込まれる。すなわち、EEPRO
M106は、符号データの形でデータを記憶する。した
がってEEFROM106が記憶しているデータを処理
に用いる場合は、そのデータの符号データを読み出し、
復号化手段を用いてチェックを行い、その結果として得
られる8ビツトデータを用いる。The 8-bit data is converted into 13-bit encoded data (
The data is converted into 8 bit data + 4 check pits + 1 parity bit) and written into the code data storage area 106-1 of the EEPROM 106. That is, EEPRO
M106 stores data in the form of encoded data. Therefore, when using data stored in the EEFROM 106 for processing, read the code data of the data,
A check is performed using a decoding means, and the resulting 8-bit data is used.
しかし、アクセスの高速性を必要とするようなデータの
場合には、ROM105内の初期設定プログラムを実行
する。初期設定プログラムは、EEFROMI06に保
持・記憶されている高速アクセスを必要とする全ての符
号データに対し、順次に復号化手段を用いて、8ビツト
データに訂正・果、新たに生成された8ビツトデータを
所定のアドレスに書き込む必要が生じた場合はまず、
RAM104のデータエリアの8ビツトデータを書きか
え、新しい8ビツトデータに対し、符号化手段を実行し
て符号化データをEEPROMIO6に書き込む。書き
かえたデータが正しく EEPROM106に格納され
たかどうか確かめるために、再びそのデータを読み出し
その符号データに対し、復号化手段を実行する。その結
果、訂正可能範囲を越えるエラーが発生している場合に
は、そのことを知らせる信号を発信する。However, in the case of data that requires high-speed access, an initial setting program in the ROM 105 is executed. The initial setting program sequentially uses a decoding means to correct all the coded data that is held and stored in the EEFROMI06 and requires high-speed access to 8-bit data, and then converts the newly generated 8-bit data into 8-bit data. When you need to write data to a given address, first
The 8-bit data in the data area of the RAM 104 is rewritten, the encoding means is executed for the new 8-bit data, and the encoded data is written into the EEPROMIO 6. In order to confirm whether the rewritten data has been correctly stored in the EEPROM 106, the data is read out again and the decoding means is executed on the encoded data. As a result, if an error exceeding the correctable range has occurred, a signal is sent to notify this fact.
次に、前記符号化手段及び復号化手段の具体例を第2図
、第3図、第4図、第5図および第6図を用いて詳細に
説明する。Next, specific examples of the encoding means and decoding means will be explained in detail using FIGS. 2, 3, 4, 5, and 6.
第2図は、第1図のCPUI 03を詳細化し、入出力
部102.RAMI 04.ROMIO3およびEEP
ROM106と共に示したブロック図である。第2図を
参照すると、CPU103は、インストラクションレジ
スタ(以下IRと記す)2o1と、制御回路部202と
、アキエムレータ(以下Accと記す)203と、第1
テンポラリレジスタ(以下TR1と記す)204と、第
2テンポラリレジスタ(以下TR2と記す)205と算
術論理演算ユニット(以下ALUと記す)206と、キ
ャリーフラグを含むプログラムステータスワード(以下
PSWと記す)207とアドレスポイントレジスタ20
8とループカウンタ209と、シフター210を有して
いる。FIG. 2 details the CPU 03 of FIG. 1, and shows the input/output unit 102. RAMI 04. ROMIO3 and EEP
3 is a block diagram shown together with a ROM 106. FIG. Referring to FIG. 2, the CPU 103 includes an instruction register (hereinafter referred to as IR) 2o1, a control circuit section 202, an achi emulator (hereinafter referred to as Acc) 203, and a first
A temporary register (hereinafter referred to as TR1) 204, a second temporary register (hereinafter referred to as TR2) 205, an arithmetic logic unit (hereinafter referred to as ALU) 206, and a program status word (hereinafter referred to as PSW) 207 including a carry flag. and address point register 20
8, a loop counter 209, and a shifter 210.
本実施例のエラー検出・訂正方法では、チェックビット
はデータの各ビットの一次結合で与えられる。すなわち
、モード(MODE)2の加法により、データの各ビッ
トの和が偶数だと01奇数だと1を与える演算が適用さ
れる。In the error detection/correction method of this embodiment, the check bits are provided by a linear combination of each bit of data. That is, by addition in mode (MODE) 2, an operation is applied that gives 0 if the sum of each bit of data is an even number and 1 if it is an odd number.
符号生成行列Bは(1)式で示されるような(4×8)
行列で与えられ、各行ベクトルJ1〜I!4の8ビツト
データとして、ROM105上に予め設定されている。The code generation matrix B is (4×8) as shown in equation (1)
Given as a matrix, each row vector J1~I! This is preset on the ROM 105 as 8-bit data of 4.
8ビツトデータをA諺(a7a、 a、 a、 as
a2a、 io )とすると、チェックビットCi(’
−1s 4)は、ct−B、 −J (mod 2
) (但し演算・はベクトルの内積を示す)
となる。こうして、ノ寵ング符号H−(a、 a。8-bit data is converted into A proverb (a7a, a, a, as
a2a, io ), check bit Ci('
-1s 4) is ct-B, -J (mod 2
) (where the operation ・indicates the inner product of vectors). Thus, the popular code H-(a, a.
a、 a、 a3a2a、 aoc4c、 c2c1)
を生成し、この12ビツトデータの偶数パリティ−Pを
計算してハミング符号Hの最終要素としてっけ加え、1
3ビツトの符号データとする。a, a, a3a2a, aoc4c, c2c1)
The even parity -P of this 12-bit data is calculated and added as the final element of the Hamming code H, and 1
It is assumed to be 3-bit code data.
第3図は符号化の概要フローチャートを示し、第一4図
は符号化処理中におけるAcc203.TRI204お
よびTR2205の保持内容を示す。FIG. 3 shows a general flowchart of encoding, and FIG. 14 shows Acc203. The contents held in TRI204 and TR2205 are shown.
以下、第2図、第3図および第4図を参照しながら、符
号化動作について詳細に説明する。The encoding operation will be described in detail below with reference to FIGS. 2, 3, and 4.
先ず、Acc203に変換すべき8ビツトデータを格納
しく第4図における状態(1))符号化命令がlR2O
1にラッチされると制御回路部202は、符号化命令コ
ードを解読し、制御信号を所定のタイミングで発生して
以下の動作を行う。First, the 8-bit data to be converted is stored in Acc203.The encoding command (state (1) in FIG. 4) is lR2O.
When latched to 1, the control circuit section 202 decodes the encoded instruction code, generates a control signal at a predetermined timing, and performs the following operations.
Acc 203のデータを’rR1204に転送しく第
3図−(1)、第4図−(2))、次に第3図−(2)
の処理を行う。すなわち、先ず、TR2205に、RO
M105のテーブルに設定されている行ベクトルB4の
データを読み出しく第4図−(3))、TRI 20
4のデータとビット単位のアンド演算をALU206で
行い、その結果をTR2205に入れる(第4図−(4
))。次に、kcc 203をシフター210によって
左へ1ビツトシフトし、ループカウンタ209に18“
をセットする(第4図−(5))。Transfer the data of Acc 203 to 'rR1204 (Fig. 3-(1), Fig. 4-(2)), then Fig. 3-(2))
Process. That is, first, RO is applied to TR2205.
Read the data of row vector B4 set in the table of M105 (Figure 4-(3)), TRI 20
The ALU 206 performs a bitwise AND operation on the data of 4 and puts the result in the TR 2205 (Figure 4-(4)
)). Next, kcc 203 is shifted to the left by 1 bit by shifter 210, and 18" is stored in loop counter 209.
(Fig. 4-(5)).
ループカウンタ209の内容を1デクリメントしながら
、その値が0になるまでTR2205の内容をキャリー
を含めて右に1ビツトシフトし、キャリーが°1゛であ
ればAcc203のビット0を反転する(第4図−(6
)−3)。キャリーが10′であればそのtま(第4図
−(6) −2) 、という処理を繰シ返す(第4図−
(1)から第4図−(6)まで)。このような処理の結
果として、Acc203の最下位ビットにはチェックビ
ットC4が生成されることになる(第4図−(6) −
5)。While decrementing the contents of the loop counter 209 by 1, shift the contents of the TR2205 including the carry by 1 bit to the right until the value becomes 0, and if the carry is 1°, invert bit 0 of the Acc 203 (4th Figure-(6
)-3). If the carry is 10', repeat the process (Fig. 4-(6)-2) until that time (Fig. 4-(6)-2).
(1) to Figure 4-(6)). As a result of such processing, check bit C4 is generated in the least significant bit of Acc203 (Fig. 4-(6)-
5).
第3図−(3)、第3図−(4)、第3図−(5)の処
理も前述の第3図−(2)の処理と同様に実行しく第4
図(7)〜(11))、Acc 203のビット4〜ビ
ツト11には符号化すべきデータ情報が、ビット4〜ビ
ツト3にはチェックビットC1〜C4がそれぞれセット
されることになる(第4図−(12))。The processes in FIG. 3-(3), FIG. 3-(4), and FIG. 3-(5) are executed in the same way as the process in FIG. 3-(2) described above.
(7) to (11)), data information to be encoded is set in bits 4 to 11 of Acc 203, and check bits C1 to C4 are set in bits 4 to 3 (the fourth Figure-(12)).
第3図−(6)のパリティ−ビットセットは、Acc2
03の内容をTR2205にセットしく第4図−(13
))、Acc203の内容を右に1ビツトシフト、ルー
プカウンタ209に1121をセットして(第4図−(
14))、ループカウンタ209の内容を1デクリメン
トしながら、その値がOになるまで、TR2205の内
容をキャリーを含めて右に1ビツトシフトし、キャリー
が111であればAcc203のピッ)Oを反転101
であればそのままという処理を第4図−(6)と同様に
ループ処理することによって生成される。(第4図−(
15))。The parity bit set in Figure 3-(6) is Acc2
Please set the contents of 03 to TR2205.
)), shift the contents of Acc203 to the right by 1 bit, and set 1121 in the loop counter 209 (Fig. 4-(
14)), While decrementing the contents of the loop counter 209 by 1, shift the contents of TR2205 including the carry by 1 bit to the right until the value becomes O, and if the carry is 111, invert the p)O of Acc203. 101
If so, it is generated by performing loop processing similar to FIG. 4-(6). (Figure 4-(
15)).
このような一連の処理によって、8ビツトデータにハミ
ング符号のチェックビット4ビツトと、ノくリティーピ
ットを付加した符号データが生成される。Through this series of processing, code data is generated by adding 4 check bits of a Hamming code and a quality pit to 8-bit data.
次に復号化処理について説明する。先ず、パリティ−ビ
ットを除いたハミング符号12ビツトからチェック行列
Mを用いて、エラー情報(エラーフラグ)を得る。チェ
ック行列Mは(4X16)行列でその各行ベクトルは、
ワード(WORD)型の行データM1〜M4としてRO
M105上に予め設定lされている。Next, the decoding process will be explained. First, error information (error flag) is obtained from a 12-bit Hamming code excluding parity bits using a check matrix M. The check matrix M is a (4x16) matrix, and each row vector of it is
RO as word type row data M1 to M4
It is preset on M105.
であυ、パリティ−ビットを除いた符号データをA”
(0000ay R6aB R4113a2a1ao
C4Cs Cx Ct)とすると、エラービットe、(
txl、4)はe1=#B A (mod 2)
で与えられる。さらに符号データAをパリティ−ビット
Pを用いてパリティ−チェックを行い、結果としてりを
出す。(oo・・・Oe4e3e、 el)をエラーフ
ラグと呼ぶ。エラーフラグ=0.e。So, the code data excluding the parity bit is A”
(0000ay R6aB R4113a2a1ao
C4Cs Cx Ct), error bit e, (
txl, 4) is given by e1=#B A (mod 2). Further, code data A is parity-checked using parity bit P, and a value is obtained as a result. (oo...Oe4e3e, el) is called an error flag. Error flag = 0. e.
−〇の場合は、エラーが生じていないため、復号化の処
理を正常に終了する。− If 〇, no error has occurred, and the decryption process ends normally.
エラーフラグが0でなく、epが“11である場合は、
12ビツトのデータ中に1ビツトの誤シが発生している
。この誤シは訂正可能で、エラーフラグの値は誤シの生
じたビット情報となっており、訂正は、テーブルに設定
しである誤りビット反転のためのパターンデータを用い
て行う。If the error flag is not 0 and ep is "11",
A 1-bit error occurs in 12-bit data. This error can be corrected, and the value of the error flag is information on the bit where the error occurred, and the correction is performed using pattern data for inverting the error bit, which is set in the table.
上述以外の場合、すなわち、エラーフラグがOでepが
+1+1あるいは、エラーフラグがOでな(epが”0
°の場合は、本方法の誤シ訂正可能範囲を越える誤シ(
2誤シ以上)が発生しているため、所定の制御信号を発
生する。In cases other than the above, that is, the error flag is O and ep is +1+1, or the error flag is not O (ep is “0”).
° If the error exceeds the error correction range of this method (
2 or more errors have occurred, a predetermined control signal is generated.
以下に1第2図、復号化の概略フローチャートである第
5図および復号化処理中におけるAcc203とTRI
204とTR2205の各保持内容を示す第6図を
用いて、復号化命令の動作について具体的に説明する。Below are Figure 1, Figure 2, Figure 5, which is a schematic flowchart of decoding, and Acc203 and TRI during the decoding process.
The operation of the decoding command will be specifically explained using FIG. 6 showing the contents held in TR 204 and TR 2205.
復号化命令がlR201にラッチされると、制御回路部
202はこの復号化命令コードを解読し、制御信号を所
定のタイミングで発生し、以下の動作を行う。まず、T
RI 204を% 01にクリアし、アドレスポイン
トレジスタ208でアドレスされるEEPROMI06
に保持されている符号データをAcc203へ読み出し
く第5図(1)、第6図−(1))、続いて、Acc2
03の内容を右へ1ビツト回転する(第6図−(2))
。When the decoding command is latched into the IR 201, the control circuit unit 202 decodes the decoding command code, generates a control signal at a predetermined timing, and performs the following operations. First, T
Clear RI 204 to %01 and EEPROMI06 addressed by address point register 208
5 (1), FIG. 6-(1)), and then read out the code data held in Acc203.
Rotate the contents of 03 to the right by 1 bit (Figure 6-(2))
.
次に、第5図(2)の処理を行う。TR2205に、R
OMI O5のテーブルに設定しである復号化行列デー
タM4を読み出しく第6図−(3) ) 、その内容と
Acc203とのアンド演算を行い結果をTR2205
に入れ(第6図−(4))、TRI 204を左へ1
ビツトシフトし、(この場合はTRI 204がクリ
アされているため変化はない)ループカウンタ209に
112′を設定する(第6図−(5))。ループカウン
タ209の内容を1デクリメントしながらその値が0に
なるまで、TR2205の内容をキャリーを含めて右に
1ビツトシフトしく第6図−(6) −1)、キャリー
が111であれば、TRI204のビット0を反転しく
第6図−(6) −2)、l g lであればそのまま
という処理を繰り返す。Next, the process shown in FIG. 5(2) is performed. TR2205, R
Read the decoding matrix data M4 set in the table of OMI O5 (Figure 6-(3)), perform an AND operation between its contents and Acc203, and send the result to TR2205.
(Figure 6-(4)) and turn the TRI 204 to the left 1
The bit is shifted and 112' is set in the loop counter 209 (in this case, there is no change since the TRI 204 is cleared) (FIG. 6-(5)). While decrementing the contents of the loop counter 209 by 1, the contents of the TR2205 including the carry are shifted to the right by 1 bit until the value becomes 0. If the carry is 111, the TRI204 is The process of inverting bit 0 of (FIG. 6-(6)-2) and leaving it as is if it is l g l is repeated.
このようにして、TRI 204のビット0にはエラ
ービットe4がセットされる(第6図(6)−4)。In this way, error bit e4 is set in bit 0 of TRI 204 ((6)-4 in FIG. 6).
第5図(3)、第5図(4)および第5図(5)の処理
も上述第5図(2)の処理と同様に実行し、TRI20
4のビットO〜ビット3にはエラービットe1〜e4が
セットされる(第6図−(12) )。The processes in FIG. 5(3), FIG. 5(4), and FIG. 5(5) are also executed in the same manner as the process in FIG.
Error bits e1 to e4 are set in bits 0 to 3 of 4 (FIG. 6-(12)).
次に、第5図−(6)のパリティ−チェックを行う。A
cc203の内容を左に1ビット回転しく第6図(13
))、その内容をTR2205にセットする(第6図−
(14))。TR2205の内容をキャリーを含めて右
に1ビツトシフトしく第6図(15))、TRI 2
04の内容をキャリーを含めて左に1ビツトシフトして
TRI 204のピッ)OICパリティ−ビットをセ
ットする(第6図−(16))。ループカウンタ209
に1121をセットしく第6図−(16))、ループカ
ウンタ209の内容を1デクリメントしながら、その値
が0になるまで、TR2205の内容をキャリーを含め
て右に1ビツトシフトし、キャリーが111であれば、
TRI 204のビットOを反転し、′0°でなけれ
ばそのままという処理を繰シ返す(第6図−(18))
。この結果TR1204のビットOKはパリティ−チェ
ックビットepがセットされる(第6図−(20))。Next, the parity check shown in FIG. 5-(6) is performed. A
Rotate the contents of cc203 one bit to the left in Figure 6 (13
)) and set its contents to TR2205 (Fig. 6-
(14)). Shift the contents of TR2205 including the carry one bit to the right (Figure 6 (15)), TRI2
The contents of 04 including the carry are shifted to the left by 1 bit and the OIC parity bit of TRI 204 is set ((16) in FIG. 6). Loop counter 209
(Fig. 6-(16))), while decrementing the contents of the loop counter 209 by 1, shift the contents of TR2205 including the carry by 1 bit to the right until the value becomes 0. If,
Repeat the process of inverting bit O of TRI 204 and leaving it as is if it is not '0° (Figure 6-(18))
. As a result, the parity check bit ep is set in the OK bit of TR1204 ((20) in FIG. 6).
TR,1204の内容が0であれば、エラー7ラグ、e
pともに’0’なので、エラー無しの状態であシ、復号
化を終了する。TRI≧2.e、m’l“である場合は
、1ビツト誤シが発生しているため第5図−(7)のエ
ラー訂正処理を次のように行う。If the content of TR, 1204 is 0, error 7 lag, e
Since both p are '0', there is no error and the decoding ends. TRI≧2. e, m'l'', a 1-bit error has occurred, so the error correction process shown in FIG. 5-(7) is performed as follows.
TRI 204のエラーフラグの値をもとに、R,0
M105に設定しであるテーブルから符号データの誤シ
ビットを反転させる九めのパターンデータを読み出し、
TR2205にセットしく第6図−(21)例として、
asが誤っていた場合)、TR2205とAcc 20
3との排他的論理和をと〕、結果をAcc203に格納
する(第6図−(22))。Based on the value of the error flag of TRI 204, R,0
Read the ninth pattern data that inverts the erroneous bit of the code data from the table set in M105,
Figure 6-(21) As an example, it should be set in TR2205.
(if as is incorrect), TR2205 and Acc 20
3] and stores the result in Acc 203 (FIG. 6-(22)).
TRI 204の内容が上述以外の場合には、訂正可
能範囲外のエラーが発生しているため、第5図−(8)
のように、そのためのフラグをセットする、さらに割込
み信号を発生するなど、所定の信号を出力する。以上の
動作でAcc203には正しい符号データが格納され、
復号化処理を終了する。If the contents of TRI 204 are other than the above, an error outside the correctable range has occurred, so see Figure 5-(8).
It outputs a predetermined signal, such as setting a flag for that purpose and generating an interrupt signal. With the above operations, correct code data is stored in Acc203,
End the decryption process.
主プログラムにおいて、正しい8ビツトデータとして使
用する場合はAcc203を右へ5ビツトシフトし、3
0〜a、を用いる。又、再書き込みを実行する場合は、
Acc203の内容をアドレスポインタ208でアドレ
スされるEEPROMIO6に書き込む。In the main program, if you want to use it as correct 8-bit data, shift Acc203 to the right by 5 bits.
0 to a are used. Also, when rewriting,
The contents of Acc203 are written to EEPROMIO6 addressed by address pointer 208.
本実施例は、8ビツト1データに対しハミング符号とパ
リティ−を用いた1誤シ訂正・2誤シ検出方法を用いた
が、1データに対する付加ビットの割合いを小さくする
ために、複数データを1ブロツクデータとして扱うよう
な符号化・復号化手段により、誤シ検出・訂正を実現す
ることも可能である。In this embodiment, a method for correcting one error and detecting two errors using a Hamming code and parity is used for one 8-bit data.However, in order to reduce the ratio of additional bits to one data, multiple data It is also possible to realize false detection and correction using an encoding/decoding means that treats the data as one block of data.
(発明の効果)
以上述べてきたように、本発明ではマイクロコンピュー
タが本来有している資源を有効に利用して、不揮発性メ
モリーの保持データの信頼性を大きく向上させることが
できるはかシか、製品としての歩留シ向上にも貢献し、
不揮発性メモリ塔載シングルチップマイクロコンビエー
タを経済的に実現することが可能となシ、その実用性は
極めて高いものである。(Effects of the Invention) As described above, the present invention is a system that can effectively utilize the inherent resources of a microcomputer and greatly improve the reliability of data held in nonvolatile memory. In addition, it also contributes to improving the yield of the product.
It is possible to economically realize a single-chip microcombinator with non-volatile memory, and its practicality is extremely high.
第10は本発明の一実施例を示すシングルチップマイク
ロコンピュータの簡単なブロック図であシ、第2図は第
1図のさらに詳細なブロック図、第3図は符号化の概要
フローチャート、第4図は符号化手段実行時のレジスタ
内容、第5図は復号化の概要フローチャートおよび第6
図は復号化手段実行時のレジスタ内容をそれぞれ示して
いる。
100・・・・・・シングルチップマイクロコンヒ二一
タ、101・・・・・・外部入力線、102・・・・・
・入出力部、103・・・・・・中央処理装置(CPU
)、104・・・・・・RAM、lQ5・・・・・・R
OM、 105−1・・・・・・リセットグログ2ム
、106・・・・・・EEPROM、106−1・・・
・・・符号データ格納領域、107・・・・・・内部パ
ス、201・・・・・・インストラクシ冒ンレジスタ(
IR)、202・・・・・・制御回路部、203・・・
・・・アキエムレータ(Acc) 、204・・・・・
・第1テンポ2リレジスタ(TR1)、205・・・・
・・第2テンポラリレジスタ(TR2)、206・・・
・・・演算ユニット(ALU)、207・・・・・・プ
ログラムステータスワード(psw)、208・・・・
・・アドレスポイントレジスタ、209・・・・・・ル
ープカウンタ、210・・・・・・シフター。
橘4回
(1)Accθ0071 l2(Ira、1l−ttp
tz口牛す回10 is a simple block diagram of a single-chip microcomputer showing an embodiment of the present invention, FIG. 2 is a more detailed block diagram of FIG. 1, FIG. 3 is a general flowchart of encoding, and FIG. The figure shows the register contents when the encoding means is executed, Figure 5 is a general flowchart of decoding, and Figure 6
The figures each show the contents of the registers when the decoding means is executed. 100...Single chip microconverter, 101...External input line, 102...
・Input/output unit, 103...Central processing unit (CPU
), 104...RAM, lQ5...R
OM, 105-1...Reset log 2M, 106...EEPROM, 106-1...
... code data storage area, 107 ... internal path, 201 ... instruction access register (
IR), 202... Control circuit section, 203...
...Akyemureta (Acc), 204...
・1st tempo 2 reregister (TR1), 205...
...Second temporary register (TR2), 206...
...Arithmetic unit (ALU), 207...Program status word (psw), 208...
... Address point register, 209 ... Loop counter, 210 ... Shifter. Tachibana 4 times (1) Accθ0071 l2 (Ira, 1l-ttp
tz mouth beef times
Claims (1)
記憶するプログラム記憶部と、データを記憶するデータ
記憶部と、プログラムに従い各種データの処理を実行す
る中央処理装置と、非動作中もデータを記憶保持する不
揮発性メモリー部とを備えたシングルチップマイクロコ
ンピュータにおいて、 前記プログラム記憶部のプログラムに従い前記中央処理
装置により所定のデータを符号データとする符号化手段
と、該符号データを前記プログラム記憶部のプログラム
に従い前記中央処理装置により復号化し所定のデータを
生成する復号化手段とを設け、 前記符号データを前記不揮発性メモリー部に記憶・保持
させるようにしたことを特徴とするシングルチップマイ
クロコンピュータ。[Scope of Claims] A data input/output unit, a program storage unit that stores programs, a data storage unit that stores data, and a central processing unit that processes various data according to the program on a single semiconductor substrate. , a single-chip microcomputer equipped with a nonvolatile memory unit that stores and retains data even when the computer is not in operation, comprising: encoding means for converting predetermined data into encoded data by the central processing unit according to a program in the program storage unit; a decoding means for decoding encoded data by the central processing unit according to a program in the program storage unit to generate predetermined data, and the encoded data is stored and retained in the nonvolatile memory unit. A single-chip microcomputer.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP60043059A JPH0616305B2 (en) | 1985-03-05 | 1985-03-05 | Single-chip micro computer |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP60043059A JPH0616305B2 (en) | 1985-03-05 | 1985-03-05 | Single-chip micro computer |
Publications (2)
Publication Number | Publication Date |
---|---|
JPS61201363A true JPS61201363A (en) | 1986-09-06 |
JPH0616305B2 JPH0616305B2 (en) | 1994-03-02 |
Family
ID=12653298
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP60043059A Expired - Lifetime JPH0616305B2 (en) | 1985-03-05 | 1985-03-05 | Single-chip micro computer |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH0616305B2 (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP0579274A2 (en) * | 1987-03-16 | 1994-01-19 | Hitachi, Ltd. | Non-volatile memory |
JP2013162424A (en) * | 2012-02-07 | 2013-08-19 | Jvc Kenwood Corp | Decoder of product code, decoding method and program of product code |
JP2013165408A (en) * | 2012-02-10 | 2013-08-22 | Jvc Kenwood Corp | Decoder of product code, decoding method and program of product code |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS5998395A (en) * | 1982-11-29 | 1984-06-06 | Dainippon Printing Co Ltd | Ic card |
JPS59178693A (en) * | 1983-03-30 | 1984-10-09 | Hitachi Ltd | Memory reading system |
JPS59229799A (en) * | 1983-06-10 | 1984-12-24 | Fujitsu Ltd | Memory device |
-
1985
- 1985-03-05 JP JP60043059A patent/JPH0616305B2/en not_active Expired - Lifetime
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS5998395A (en) * | 1982-11-29 | 1984-06-06 | Dainippon Printing Co Ltd | Ic card |
JPS59178693A (en) * | 1983-03-30 | 1984-10-09 | Hitachi Ltd | Memory reading system |
JPS59229799A (en) * | 1983-06-10 | 1984-12-24 | Fujitsu Ltd | Memory device |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP0579274A2 (en) * | 1987-03-16 | 1994-01-19 | Hitachi, Ltd. | Non-volatile memory |
EP0579274A3 (en) * | 1987-03-16 | 1995-09-20 | Hitachi Ltd | Non-volatile memory |
JP2013162424A (en) * | 2012-02-07 | 2013-08-19 | Jvc Kenwood Corp | Decoder of product code, decoding method and program of product code |
JP2013165408A (en) * | 2012-02-10 | 2013-08-22 | Jvc Kenwood Corp | Decoder of product code, decoding method and program of product code |
Also Published As
Publication number | Publication date |
---|---|
JPH0616305B2 (en) | 1994-03-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US5996108A (en) | Memory system | |
US3789204A (en) | Self-checking digital storage system | |
US5623506A (en) | Method and structure for providing error correction code within a system having SIMMs | |
KR100266748B1 (en) | Semiconductor memory device and error correction method thereof | |
US4296494A (en) | Error correction and detection systems | |
US5379304A (en) | Method and structure for providing error correction code and parity for each byte on SIMM's | |
US9454427B2 (en) | Shifting read data | |
US11791009B2 (en) | Error correction system | |
US5465262A (en) | Method and structure for providing error correction code and automatic parity sensing | |
KR20220107007A (en) | comparison system | |
US20140040699A1 (en) | Error check and correction circuit, method, and memory device | |
US5450422A (en) | Method and structure for providing error correction code for each byte on SIMM'S | |
US7949933B2 (en) | Semiconductor integrated circuit device | |
JPS6246347A (en) | Error processing system for information processor | |
US4918695A (en) | Failure detection for partial write operations for memories | |
US4521872A (en) | Instruction storage | |
CN115705265A (en) | Memory device and operating method thereof | |
JPS61201363A (en) | Single-chip microcomputer | |
CN114765056A (en) | Storage system | |
US5541941A (en) | Method and structure for providing automatic parity sensing | |
CN114765054B (en) | Error correction system | |
US5603023A (en) | Processor circuit for heapsorting | |
RU204275U1 (en) | FAIL-SAFE PROCESSOR WITH ERROR CORRECTION IN THE DATA BYTE | |
JP2871168B2 (en) | Error correction code coding circuit | |
JP4159896B2 (en) | Associative memory |