JPH10207780A - Frequency counter - Google Patents

Frequency counter

Info

Publication number
JPH10207780A
JPH10207780A JP9006421A JP642197A JPH10207780A JP H10207780 A JPH10207780 A JP H10207780A JP 9006421 A JP9006421 A JP 9006421A JP 642197 A JP642197 A JP 642197A JP H10207780 A JPH10207780 A JP H10207780A
Authority
JP
Japan
Prior art keywords
frequency
level
value
storage area
bit
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
JP9006421A
Other languages
Japanese (ja)
Inventor
Toru Hino
亨 日野
Yoshihiro Masana
芳弘 正名
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.)
Oki Electric Industry Co Ltd
Original Assignee
Oki Electric Industry Co 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 Oki Electric Industry Co Ltd filed Critical Oki Electric Industry Co Ltd
Priority to JP9006421A priority Critical patent/JPH10207780A/en
Publication of JPH10207780A publication Critical patent/JPH10207780A/en
Withdrawn legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To extend the whole life of the frequency counter by reducing a difference between the rewriting frequency of a 1st storage area (level 1) and that of a 2nd storage area (level 2). SOLUTION: An IC card 10 has an EEP ROM 1 and a control circuit 2. The circuit 2 checks the value of a flag 7, and when the flag 7 is '0', controls the level 1 so as to store the value of the lower digit of frequency and controls the level 2 so as to store the value of the upper digit of the frequency. When the flag 7 is '1', the level 1 is controlled so as to store the value of the upper digit of the frequency and the level 2 is controlled so as to store the value of the lower digit of the frequency. The circuit 2 allows the EEP ROM 1 to execute frequency storing processing. In each addition of 400 points, the state of the flag 7 is inverted, so that the level 1 and the level 2 are set up so as to alternately store the value of the lower digit of the frequency.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】度数を加算する命令が与えら
れる毎に、与えられた度数を逐次加算し、加算すること
によって得られた度数を記憶する度数計数装置に関する
ものであって、特に、度数を記憶するEEPROM等の
記憶領域を効率よく使用することによって、長期間使用
できる度数計数装置に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a frequency counting device for sequentially adding given frequencies each time a command for adding frequencies is given and storing the frequencies obtained by the addition, and more particularly to a frequency counting device. The present invention relates to a frequency counting device that can be used for a long period of time by efficiently using a storage area such as an EEPROM for storing data.

【0002】[0002]

【従来の技術】従来、この種の度数計数装置は、EEP
ROM等の記憶回路を有するICカード等の携帯用モジ
ュールとして構成されている。度数計数装置は、カード
リーダから度数を加算する命令(度数加算命令)が与え
られると、度数加算命令によって与えられた度数をEE
PROMがその時、記憶している度数(これまでに、度
数計数装置に入力された度数加算命令によって与えられ
た度数を合計したもの)に加算して、加算することによ
って得られた度数を記憶するものである。
2. Description of the Related Art Conventionally, a frequency counting device of this type is known as an EEP.
It is configured as a portable module such as an IC card having a storage circuit such as a ROM. When an instruction to add a frequency (frequency addition command) is given from the card reader, the frequency counting device converts the frequency given by the frequency addition command into EE.
The PROM then adds to the stored frequency (the sum of the frequencies given by the frequency addition command input to the frequency counting device so far) and stores the frequency obtained by the addition. Things.

【0003】具体的に、EEPROMはそれぞれが複数
ビットからなる複数のレベルに分割されている。このE
EPROMに於て、例えば、1度数を加算する命令(1
度数加算命令と称する)が与えられる毎に、最下位レベ
ルのビットが、1ビットづつ”1”に設定される。そし
て最下位レベルの全ビットが”1”になると、つぎに1
度数加算命令が与えられることに応答して、1つ上位の
レベルのの1つのビットが”1”になり、かつ最下位レ
ベルの全ビットが”0”に設定される。
[0003] Specifically, an EEPROM is divided into a plurality of levels each consisting of a plurality of bits. This E
In the EPROM, for example, an instruction (1
Each time a frequency addition instruction is given, the least significant bit is set to "1" one bit at a time. Then, when all the bits at the lowest level become “1”, 1
In response to the frequency addition instruction being applied, one bit of the next higher level is set to "1", and all bits of the lowest level are set to "0".

【0004】このように、従来の度数カウント装置は、
最下位レベルの全ビットが”0”の状態から”1”の状
態になることによって、下位レベルから上位レベルへの
桁上げ(桁上げ処理)を行なう。
As described above, the conventional frequency counting device is
When all the bits at the lowest level change from “0” to “1”, carry from the lower level to the upper level (carry processing) is performed.

【0005】[0005]

【発明が解決しようとする課題】前記、度数計数装置で
は、上位レベルは常に上位の桁の値を記憶し、下位レベ
ルは常に下位の桁を記憶する。よって下位の桁の値を記
憶する下位レベルのビットの書き換え(書き込みと消去
とからなる)回数が、上位の桁の値を記憶する上位レベ
ルのビットの書き換え回数より必然的に多くなる。
In the frequency counting apparatus, the upper level always stores the value of the upper digit, and the lower level always stores the lower digit. Therefore, the number of times of rewriting (composed of writing and erasing) of the lower-level bits storing the value of the lower digit is necessarily larger than the number of rewriting of the upper-level bits storing the value of the upper digit.

【0006】よって上位レベルのビットの寿命がくる以
前に、下位レベルの寿命が来てしまう。従って、度数計
数装置全体としての寿命は、上位レベルに係わらず下位
レベルのビットの寿命に依存し、短いという問題があっ
た。
Therefore, the life of the lower level bit comes before the life of the bit of the upper level comes. Therefore, there is a problem that the life of the frequency counting device as a whole depends on the life of the lower-level bits irrespective of the upper level and is short.

【0007】[0007]

【課題を解決するための手段】本発明の度数計数装置
は、第1の状態と第2の状態とを有するフラグと、複数
ビットからなる第1の記憶領域と複数ビットからなる第
2の記憶領域とを有し、前記第1記憶領域と前記第2の
記憶領域とで度数を記憶し、前記フラグが第1の状態の
時、前記第1の記憶領域は前記度数の下位の桁の値を記
憶し、かつ前記第2の記憶領域は前記度数の上位の桁の
値を記憶し、前記フラグが第2の状態の時、前記第1の
記憶領域は前記度数の上位の桁の値を記憶し、かつ前記
第2の記憶領域は前記度数の下位の桁の値を記憶する記
憶回路と、前記記憶回路が記憶する前記度数が所定の値
を越えた場合又は前記第1又は第2の記憶領域の書き換
え回数が所定の値を越えた場合、前記フラグの状態を反
転させる制御回路とを有することを特徴とする。
A frequency counting apparatus according to the present invention comprises a flag having a first state and a second state, a first storage area having a plurality of bits, and a second storage having a plurality of bits. A frequency in the first storage area and the second storage area, and when the flag is in the first state, the first storage area stores a value of a lower digit of the frequency. And the second storage area stores the value of the upper digit of the frequency, and when the flag is in the second state, the first storage area stores the value of the upper digit of the frequency. A second storage area for storing a value of a lower digit of the frequency, and a memory when the frequency stored by the storage circuit exceeds a predetermined value, or the first or second storage area. A control circuit for inverting the state of the flag when the number of rewrites of the storage area exceeds a predetermined value; Characterized in that it has.

【0008】[0008]

【発明の実施の形態】図1は本発明の度数計数装置の第
1の実施の形態を示すICカードの概略構成図である。
図1に示す携帯用モジュールであるICカード10は、
EEPROM1と制御回路2とを有する。ICカード1
0は、カードリーダ20に挿入されると起動し、度数加
算命令によって与えられた度数を、それまで記憶してい
た度数(それまでに、ICカード10に入力された度数
加算命令によって与えられた度数を合計したもの)に加
算して、加算することによって得られた度数をEEPR
OMに記憶し、外されると動作停止して、その度数を記
憶保持するものである。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS FIG. 1 is a schematic configuration diagram of an IC card showing a first embodiment of a frequency counting device according to the present invention.
The IC card 10 which is a portable module shown in FIG.
It has an EEPROM 1 and a control circuit 2. IC card 1
0 is activated when the card is inserted into the card reader 20, and the frequency given by the frequency addition command is stored in the frequency (the frequency given by the frequency addition command input to the IC card 10 until then). To the EEPR.
It is stored in the OM, the operation is stopped when it is removed, and the frequency is stored and held.

【0009】ICカード10とカードリーダ20は、I
Cカードに電源を供給する電源線VCCと、グランド線
GNDと、ICカードに動作クロックを供給するクロッ
ク線CLKと、ICカードの制御回路2をリセットする
ためのリセット線RSTと、カードリーダ20からの度
数加算命令を制御回路2に送信すると共に、EEPRO
M1から読みだされた度数データをカードリーダ20に
転送するシリアルデータ線SIOにより接続される。
The IC card 10 and the card reader 20
A power supply line VCC for supplying power to the C card, a ground line GND, a clock line CLK for supplying an operation clock to the IC card, a reset line RST for resetting the control circuit 2 of the IC card, and a card reader 20 Is transmitted to the control circuit 2 and the EEPRO
It is connected by a serial data line SIO that transfers the frequency data read from M1 to the card reader 20.

【0010】EEPROM1はYアドレスデコーダ3と
Xアドレスデコーダ4と制御/データインターフェイス
(I/O)5とユニットセル領域6とを有する。EEP
ROM1は、ビット指定による消去/書き込が可能であ
る。
The EEPROM 1 has a Y address decoder 3, an X address decoder 4, a control / data interface (I / O) 5, and a unit cell area 6. EEP
The ROM 1 can be erased / written by specifying a bit.

【0011】ユニットセル領域6は、度数を記憶する、
10ビット(10個のセル)のレベル1,10ビットの
レベル2及び5ビットのレベル3と、1ビットのフラグ
7とを有する。
The unit cell area 6 stores frequencies.
It has a level of 10 bits (10 cells), a level 2 of 10 bits, a level 3 of 5 bits, and a flag 7 of 1 bit.

【0012】ユニットセルは消去により、浮遊ゲートに
電荷が注入され、書き込みにより浮遊ゲートから電荷が
引き抜かれる。以下の説明では、ビットの初期値と書き
込み状態とが対応づけられ”0”と表記される。またビ
ットの反転値と消去状態とが対応づけられ”1”と表記
される。尚、初期値と消去状態とが対応づけられ、反転
値と書き込み状態が対応づけられてもよい。
In the unit cell, charge is injected into the floating gate by erasing, and charge is extracted from the floating gate by writing. In the following description, the initial value of the bit and the write state are associated with each other and are expressed as “0”. In addition, the inverted value of the bit and the erased state are associated with each other and are expressed as “1”. Note that the initial value and the erased state may be associated with each other, and the inverted value and the write state may be associated with each other.

【0013】Yアドレスデコーダ3及びXアドレスデコ
ーダ4は、制御回路2からのアドレスデータに従って、
消去、書き込み、或いは読みだしを行なうビットを指定
する。I/O5は、制御回路2からの書き込み命令
(W)、消去命令(E)、読みだし命令(R)に応じ
て、Yアドレスデコーダ3及びXアドレスデコーダ4に
より指定されたビットに対して書き込み、消去、或いは
データの読みだしを行ない、読みだした度数データ及び
フラグ7に関するデータを制御回路2に送る。
The Y address decoder 3 and the X address decoder 4 operate according to address data from the control circuit 2.
Specifies a bit for erasing, writing, or reading. The I / O 5 writes data to bits designated by the Y address decoder 3 and the X address decoder 4 in response to a write command (W), an erase command (E), and a read command (R) from the control circuit 2. , Erase, or read data, and sends the read frequency data and the data relating to the flag 7 to the control circuit 2.

【0014】制御回路2は、フラグ7の値を調べ、フラ
グ7が”0”の時、レベル1が度数の下位の桁の値を記
憶するように制御し、かつレベル2が度数の上位の桁の
値を記憶するように制御し、フラグ7が”1”の時、レ
ベル1が度数の上位の桁の値を記憶するように制御し、
かつレベル2が度数の下位の桁の値を記憶するように制
御する。制御回路2は、400度数を加算する毎に、フ
ラグ7の値を反転させる。また制御回路2は、カードリ
ーダ20から度数加算命令が入力されると、EEPRO
M1にアドレスデータ及び消去/書き込み命令を送り、
EEPROMに度数記憶処理を実行させる。これによ
り、EEPROM1に記憶される度数が書き換わる。
尚、制御回路2はハード手段で実現しても良いし、マイ
クロプロセッサによるソフト処理によって実現してもよ
い。
The control circuit 2 checks the value of the flag 7, and when the flag 7 is "0", controls so that the level 1 stores the value of the lower digit of the frequency and the level 2 controls the upper digit of the frequency. When the flag 7 is "1", the level 1 is controlled to store the value of the upper digit of the frequency.
In addition, control is performed so that level 2 stores the value of the lower digit of the frequency. The control circuit 2 inverts the value of the flag 7 each time 400 degrees are added. When a frequency addition command is input from the card reader 20, the control circuit 2
Sends address data and an erase / write command to M1,
The EEPROM is made to execute a frequency storage process. As a result, the frequency stored in the EEPROM 1 is rewritten.
The control circuit 2 may be realized by hardware means, or may be realized by software processing by a microprocessor.

【0015】図2、図3は図1のICカードに於ける度
数計数記憶処理を説明するための図である。最初に1〜
400度数を記憶するまでの期間の度数計数装置の動作
を説明する。この期間では、フラグ7の値が”0”であ
るので、制御回路2によってレベル1が度数の下位の桁
の値を記憶するように制御され、かつレベル2が度数の
上位の桁の値を記憶するように制御される。
FIG. 2 and FIG. 3 are diagrams for explaining the frequency count storage processing in the IC card of FIG. First 1
The operation of the frequency counting device until 400 frequencies are stored will be described. In this period, since the value of the flag 7 is “0”, the control circuit 2 controls the level 1 to store the value of the lower digit of the frequency, and the level 2 controls the value of the upper digit of the frequency. It is controlled to memorize.

【0016】まず、1度数加算命令が与えられる毎に、
レベル1のビットが、(a)に示すようにビットb0か
ら1ビットづつ”1”に設定される。これにより1〜1
0度数が記憶される。レベル1の全ビットが”1”にな
った((b)、10度数)後、1度数加算命令が与えら
れると、レベル1のビットb0が”0”に設定される。
((c)、11度数)その後、1度数加算命令が与えら
れる毎にレベル1の”1”であるビットが、1ビットづ
つ”0”に設定される。
First, every time a one-time addition instruction is given,
The bit of level 1 is set to "1" one bit at a time from bit b0 as shown in FIG. This allows 1-1
Zero frequency is stored. After all the bits of level 1 have become "1" ((b), 10 times), when a 1-time addition instruction is given, the level 1 bit b0 is set to "0".
((C), 11 frequency) Thereafter, every time a frequency addition instruction is given, the bit which is "1" at level 1 is set to "0" bit by bit.

【0017】次に、レベル1のビットb9を除く全ビッ
トが”0”となった((d)、19度数)後、1度数加
算命令が与えられると、レベル2のビットb0が”1”
に設定され(e)、レベル1のビットb9が”0”に設
定される((f)、20度数)。これによって、レベル
1からレベル2への桁上げがなされる。
Next, after all the bits except for the bit b9 of level 1 become "0" ((d), 19 times), when a one-time addition instruction is given, the bit b0 of level 2 becomes "1".
(E), and the level 1 bit b9 is set to “0” ((f), 20 degrees). As a result, carry from level 1 to level 2 is performed.

【0018】レベル1のビットb0〜b9は、1度数加
算命令が20回与えられることによって、1回書き換え
られる。(この場合、書き換えとは消去及び書き込みと
からなるもの) 次に、21〜219度数を記憶するまでの間、レベル1
では前記同様、全ビットが”0”であるビットが、1度
数加算命令が与えられる毎に、1ビットずつ”1”に設
定され、全ビットが”1”になった後、全ビットが”
1”であるビットが、1度数加算命令が与えられる毎
に、1ビットずつ”0”に設定される処理が繰り返され
る。つまりレベル1では、1度数加算命令が20回与え
られる毎に全ビットが”0”に設定される処理が繰り返
される。レベル2では1度数加算命令が20回与えられ
る毎に、レベル2の”0”であるビットが1ビットず
つ”1”に設定される。
The bits b0 to b9 of level 1 are rewritten once by giving the one-time addition instruction 20 times. (In this case, rewriting consists of erasing and writing.) Next, until the frequency of 21 to 219 is stored, level 1
In the same manner as described above, the bits in which all bits are "0" are set to "1" one bit at a time each time the one-time addition instruction is given, and after all bits become "1", all bits are set to "1".
The process of setting the bit of "1" to "0" by one bit each time the one-time addition instruction is given is repeated. Is repeatedly set to “0.” At level 2, every time the frequency addition instruction is given 20 times, the bit that is “0” of level 2 is set to “1” one by one.

【0019】次に、レベル2の全ビットが”1”かつレ
ベル1のビットb9を除く全ビットが”0”となった後
((g)、219度数)、次に1度数加算命令が与えら
れることによって、レベル2のビットb0が”0”に設
定され、かつレベル1のビットb9が”0”に設定され
る。((h)、220度数) 次に221〜399の度数を記憶するまでの間、レベル
1では前記同様に、全ビットが”0”であるビットが、
1度数加算命令が与えられる毎に、1ビットずつ”1”
に設定され、全ビットが”1”になった後、全ビット
が”1”であるビットが、1度数加算命令が与えられる
毎に、1ビットずつ”0”に設定される処理が繰り返さ
れる。レベル2では1度数加算命令が20回与えられる
毎に、レベル2の”1”であるビットが1ビットずつ”
0”に設定される。
Next, after all the bits of the level 2 become "1" and all the bits except the bit b9 of the level 1 become "0" ((g), 219 frequencies), a 1-time addition instruction is given. As a result, the level 2 bit b0 is set to "0" and the level 1 bit b9 is set to "0". ((H), 220 frequencies) Next, until the frequencies of 221 to 399 are stored, at level 1, as described above, all bits are “0”.
Each time a one-time addition instruction is given, one bit is set to "1".
After all the bits are set to "1", the process of setting the bits whose all bits are "1" to "0" one by one each time the one-time addition instruction is given is repeated. . At level 2, every time the 1-time addition instruction is given 20 times, the bit that is “1” of level 2 is changed by 1 bit.
It is set to 0 ".

【0020】次に、レベル1及びレベル2のビットb9
を除く全ビットが”0”となった後(399度数)、次
に1度数加算命令が与えられることによって、レベル3
のビットb0が”1”に設定され、レベル1及びレベル
2の全ビットが”0”に設定される。((i)、400
度数)ここでフラグ7の値が”1”に設定される。
Next, bit b9 of level 1 and level 2
After all the bits except for have become “0” (399 counts), a one-time addition instruction is given, and the level 3
Is set to "1", and all bits of level 1 and level 2 are set to "0". ((I), 400
Here, the value of the flag 7 is set to “1”.

【0021】次に、度数401〜800を記憶するまで
の期間の度数計数装置の動作を説明する。 この期間で
は、フラグ7の値が”1”であるので、制御回路2によ
ってレベル1が度数の上位の桁の値を記憶するように制
御され、かつレベル2が度数の下位の桁の値を記憶する
ように制御される。
Next, the operation of the frequency counting device during the period until the frequencies 401 to 800 are stored will be described. In this period, since the value of the flag 7 is "1", the control circuit 2 controls the level 1 to store the value of the upper digit of the frequency, and the level 2 controls the value of the lower digit of the frequency. It is controlled to memorize.

【0022】まず、401〜410度数を記憶するまで
の間、1度数加算命令が与えられる毎に、レベル2のビ
ットが、(j)に示すようにビットb0から1ビットづ
つ”1”に設定される。レベル2の全ビットが”1”に
なった((k)、410度数)後、1度数加算命令が与
えられると、レベル2のビットb0が”0”に設定され
る。((l)、411度数)その後、1度数加算命令が
与えられる毎にレベル2の”1”であるビットが、1ビ
ットづつ”0”に設定される。
First, every time a one-time addition instruction is given until 401 to 410 frequencies are stored, the bit of level 2 is set to "1" one by one from bit b0 as shown in (j). Is done. After all the bits of level 2 have become "1" ((k), 410 frequencies), when a one-time addition instruction is given, the bit b0 of level 2 is set to "0". ((L), 411 counts) Thereafter, each time a one-time count addition instruction is given, the level 2 "1" bit is set to "0" bit by bit.

【0023】次に、レベル2のビットb9を除く全ビッ
トが”0”となった((m)、419度数)後、1度数
加算命令が与えられると、レベル1のビットb0が”
1”に設定され(n)、レベル2のビットb9が”0”
に設定される((o)、度数420)。これによって、
レベル2からレベル1への桁上げがなされる。
Next, after all bits except for the bit b9 of level 2 become "0" ((m), 419 counts), when a one-time addition instruction is given, the bit b0 of level 1 becomes "0".
1 (n), and bit b9 of level 2 is set to "0"
((O), frequency 420). by this,
Carry from level 2 to level 1 is performed.

【0024】このときレベル2のビットb0〜b9は、
1度数加算命令が20回与えられることによって、1回
書き換えられる。(この場合、書き換えとは消去及び書
き込みとからなるもの) 次に、421〜619度数を記憶するまでの間、レベル
2では前記同様、全ビットが”0”であるビットが、1
度数加算命令が与えられる毎に、1ビットずつ”1”に
設定され、全ビットが”1”になった後、全ビットが”
1”であるビットが、1度数加算命令が与えられる毎
に、1ビットずつ”0”に設定される処理が繰り返され
る。つまりレベル2では、1度数加算命令が20回与え
られる毎に全ビットが”0”に設定される処理が繰り返
される。レベル1では1度数加算命令が20回与えられ
る毎に、レベル1の”0”であるビットが1ビットず
つ”1”に設定される。
At this time, the bits b0 to b9 of level 2 are
When the one-time addition instruction is given 20 times, it is rewritten once. (In this case, rewriting consists of erasing and writing.) Next, until 421 to 619 frequencies are stored, at level 2, as in the above, all bits are “1”.
Each time a frequency addition instruction is given, one bit is set to “1”, and after all bits become “1”, all bits are set to “1”.
The process of setting the bit of "1" to "0" one bit at a time each time the one-time addition instruction is given is repeated. Is repeatedly set to “0.” At level 1, every time the frequency addition instruction is given 20 times, the bit that is “0” of level 1 is set to “1” one by one.

【0025】次に、レベル1の全ビットが”1”かつレ
ベル2のビットb9を除く全ビットが”0”となった後
((p)、619度数)、次に1度数加算命令が与えら
れることによって、レベル1のビットb0が”0”に設
定され、かつレベル2のビットb9が”0”に設定され
る。((q)、620度数) 次に621〜799度数を記憶するまでの間、レベル2
では前記同様に、全ビットが”0”であるビットが、1
度数加算命令が与えられる毎に、1ビットずつ”1”に
設定され、全ビットが”1”になった後、全ビットが”
1”であるビットが、1度数加算命令が与えられる毎
に、1ビットずつ”0”に設定される処理が繰り返され
る。レベル1では1度数加算命令が20回与えられる毎
に、”1”であるビットが1ビットずつ”0”に設定さ
れる。
Next, after all the bits of level 1 become "1" and all the bits except the bit b9 of level 2 become "0" ((p), 619 frequency), a 1 frequency addition instruction is given. As a result, the level 1 bit b0 is set to "0" and the level 2 bit b9 is set to "0". ((Q), 620 frequency) Level 2 until 621-799 frequency is stored next
In the same manner as described above, the bit in which all bits are “0” is 1
Each time a frequency addition instruction is given, one bit is set to “1”, and after all bits become “1”, all bits are set to “1”.
The process of setting the bit of "1" to "0" by one bit each time the one-time addition instruction is given is repeated. Are set to “0” bit by bit.

【0026】レベル1及びレベル2のビットb9を除く
全ビットが”0”となった後(799度数)、次に1度
数加算命令が与えられることによって、レベル3のビッ
トb1が”1”に設定され、レベル1及びレベル2のビ
ットb9が”0”に設定される。(800度数)これに
よってレベル1からレベル3への桁上がりがなされる。
レベル1は、1度数加算命令が400回与えられると、
全ビットが”0”に設定される。ここでフラグ7の値
が”0”に設定される。
After all the bits except for the bit b9 of the level 1 and the level 2 become "0" (799 frequency), a 1-time addition instruction is given, and the bit b1 of the level 3 becomes "1". The bit b9 of the level 1 and the level 2 is set to “0”. (800 degrees) Thereby, the carry from level 1 to level 3 is performed.
Level 1 is that if a one-time addition instruction is given 400 times,
All bits are set to "0". Here, the value of the flag 7 is set to “0”.

【0027】これより以後は、400度数を加算する毎
に、フラグ7の値が反転され、レベル1及びレベル2が
交互に度数の下位の桁の値を記憶するように制御され
る。
Thereafter, each time 400 frequencies are added, the value of the flag 7 is inverted, and level 1 and level 2 are controlled so that the lower digit of the frequency is stored alternately.

【0028】第1の実施の形態によれば、400度数を
加算する毎に、フラグ7の状態が反転することによっ
て、レベル1及びレベル2を交互に度数の下位の値を記
憶するように設定するので、レベル1とレベル2の書き
換え回数の隔たりがなくなる。よって度数計数装置全体
としての寿命が延びる。
According to the first embodiment, each time 400 frequencies are added, the state of the flag 7 is inverted, so that level 1 and level 2 are set alternately to store the lower value of the frequency. Therefore, there is no gap between the number of rewrites of level 1 and level 2. Therefore, the life of the entire frequency counting device is extended.

【0029】尚、レベル1〜3の消去順序及び書き込み
順序は下位ビットから上位ビットに限定されるものでは
ない。また、レベル1、2の構成ビット数は10ビット
に限定されるものではない。レベル3の構成ビット数は
5ビットに限定されるものではない。
Incidentally, the erasing order and the writing order of the levels 1 to 3 are not limited to the lower bits to the upper bits. Also, the number of configuration bits for levels 1 and 2 is not limited to 10 bits. The number of constituent bits of level 3 is not limited to 5 bits.

【0030】また、携帯用モジュールは、カード形態に
限定されるものではない。
The portable module is not limited to a card.

【0031】図4は本発明の度数計数装置の第2の実施
の形態を示すICカードの概略構成図である。図4に示
すICカード30は、EEPROM31と制御回路32
とを有する。
FIG. 4 is a schematic configuration diagram of an IC card showing a second embodiment of the frequency counting device of the present invention. The IC card 30 shown in FIG.
And

【0032】ICカード30は、カードリーダ20に挿
入されると起動し、度数加算命令によって与えられた度
数を、それまで記憶していた度数(それまでに、ICカ
ード20に入力された度数加算命令によって与えられた
度数を合計したもの)に加算して、加算することによっ
て得られた度数をEEPROMに記憶し、外されると動
作停止して、その度数を記憶保持するものである。
The IC card 30 is activated when it is inserted into the card reader 20, and stores the frequency given by the frequency addition command into the previously stored frequency (the frequency addition input to the IC card 20 until then). (The sum of the frequencies given by the instruction), the frequency obtained by the addition is stored in the EEPROM, the operation is stopped when the frequency is removed, and the frequency is stored and held.

【0033】EEPROM31は、図1のEEPROM
1のユニットセル領域6を、10ビットのレベル1,レ
ベル2と5ビットのレベル3と1ビットのフラグ7とを
有するユニットセル領域33に置き換えたものである。
The EEPROM 31 is the EEPROM of FIG.
One unit cell area 6 is replaced by a unit cell area 33 having a 10-bit level 1, a level 2 and a 5-bit level 3 and a 1-bit flag 7.

【0034】制御回路32は、度数加算命令に応じて、
EEPROM31に度数記憶処理を実行させる。制御回
路32は、フラグ7の値を調べ、フラグ7が”0”の
時、レベル1が度数の下位の桁の値を記憶するように制
御し、フラグ7が”1”の時、レベル2が度数の下位の
桁の値を記憶するように制御する。制御回路32は、2
0度数を加算する毎に、フラグ7の値を反転させる。ま
た制御回路32は、カードリーダ20から度数加算命令
が入力されると、EEPROM31にアドレスデータ及
び消去/書き込み命令を送り、EEPROMに度数記憶
処理を実行させる。これにより、EEPROM1に記憶
される度数が書き換わる。尚、制御回路32はハード手
段で実現してもよいし、マイクロプロセッサによるソフ
ト処理によって実現してもよい。
The control circuit 32 responds to the frequency addition command by
The EEPROM 31 executes a frequency storage process. The control circuit 32 checks the value of the flag 7 and controls the level 1 to store the value of the lower digit of the frequency when the flag 7 is “0”, and to control the level 2 when the flag 7 is “1”. Is controlled to store the value of the lower digit of the frequency. The control circuit 32
Each time 0 is added, the value of the flag 7 is inverted. Further, when a frequency addition command is input from the card reader 20, the control circuit 32 sends address data and an erase / write command to the EEPROM 31, and causes the EEPROM to execute a frequency storage process. As a result, the frequency stored in the EEPROM 1 is rewritten. The control circuit 32 may be realized by hardware means, or may be realized by software processing by a microprocessor.

【0035】図5は本発明の第2の実施の形態に於ける
度数計数記憶処理を説明する為の図である。最初に1〜
20度数を記憶するまでの期間の度数計数装置の動作を
説明する。この期間では、フラグ7の値が”0”である
ので、制御回路2によってレベル1が度数の下位の桁の
値を記憶するように制御される。
FIG. 5 is a diagram for explaining a frequency count storage process according to the second embodiment of the present invention. First 1
The operation of the frequency counting device during the period until 20 frequencies are stored will be described. In this period, since the value of the flag 7 is “0”, the control circuit 2 controls the level 1 to store the value of the lower digit of the frequency.

【0036】1度数加算命令が与えられるごとに、レベ
ル1のビットが、(a)に示すようにビットb0から1
ビットづつ”1”に設定される。これにより1〜10度
数が記憶される。レベル1の全ビットが”1”になった
後((b)、10度数)、1度数加算命令が与えられる
ことによって、レベル1のビットb0が”0”に設定さ
れる。((c)、11度数)次に、1度数加算命令が与
えられる毎にレベル1の”1”であるビットが、1ビッ
トづつ”0”に設定される。
Each time the one-time addition instruction is given, the level 1 bit is changed from bit b0 to bit 1 as shown in FIG.
It is set to "1" bit by bit. Thereby, 1 to 10 degrees are stored. After all the bits of level 1 have become "1" ((b), 10 times), a 1-time addition instruction is given, so that level 1 bit b0 is set to "0". ((C), 11 frequency) Next, every time a frequency addition instruction is given, the bit of level 1 "1" is set to "0" bit by bit.

【0037】次に、レベル1のビットb9を除く全ビッ
トが”0”となった後((d)、19度数)、1度数加
算命令が与えられることによって、レベル3の記憶値
が、それまでそこに記憶されていた2進数値(”0000
0”)に+1した2進数値(”00001”)に書き換わる。
すなわちレベル3のビットb0が”1”に設定され、レ
ベル1のビットb9が”0”に設定される((e)、20
度数)。ここでフラグ7の値が”1”に設定される。
Next, after all bits except for the bit b9 of level 1 become "0" ((d), 19 times), a 1-time addition instruction is given, so that the stored value of level 3 is changed to "1". The binary value stored there until ("0000
It is rewritten to a binary value (“00001”) obtained by adding +1 to “0”).
That is, the level 3 bit b0 is set to "1" and the level 1 bit b9 is set to "0" ((e), 20)
frequency). Here, the value of the flag 7 is set to “1”.

【0038】次に度数21〜40を記憶するまでの期間
の度数計数装置の動作を説明する。この期間では、フラ
グ7の値が”1”であるので、制御回路2によってレベ
ル2が度数の下位の桁の値を記憶するように制御され
る。
Next, the operation of the frequency counting device in the period until the frequencies 21 to 40 are stored will be described. In this period, since the value of the flag 7 is "1", the control circuit 2 controls the level 2 to store the value of the lower digit of the frequency.

【0039】21〜30度数を記憶するまでの間、1度
数加算命令が与えられるごとに、レベル2のビットが、
(f)に示すようにビットb0から1ビットづつ”1”
に設定される。レベル2の全ビットが”1”になった後
((g)、30度数)、1度数加算命令が与えられるこ
とによって、レベル2のビットb0が”0”に設定され
る。((h)、31度数)次に、1度数加算命令が与え
られる毎にレベル2の”1”であるビットが、1ビット
づつ”0”に設定される。
Until the frequency of 21 to 30 is stored, every time the frequency addition instruction is given, the level 2 bit is
As shown in (f), "1" is set bit by bit from bit b0.
Is set to After all the bits of level 2 become “1” ((g), 30 degrees), a 1-time addition instruction is given, so that the bit b0 of level 2 is set to “0”. ((H), 31 frequency) Next, every time a frequency addition instruction is given, the bit of level 2 "1" is set to "0" bit by bit.

【0040】次に、レベル2のビットb9を除く全ビッ
トが”0”となった後((i)、39度数)、1度数加
算命令が与えられることによって、レベル3の記憶値
が、それまでそこに記憶されていた2進数値(”0000
1”)に+1した2進数値(”00010”)に書き換わる。
すなわちレベル3のビットb0が”0”、ビットb1
が”1”に設定され、レベル2のビットb9が”0”に
設定される((j)、40度数)。ここでフラグ7の値
が”0”に設定される。
Next, after all bits except for the bit b9 of level 2 become "0" ((i), 39 times), a 1-time addition instruction is given, so that the stored value of level 3 is changed to "0". The binary value stored there until ("0000
1 ”) is rewritten to the binary value (“ 00010 ”) which is +1.
That is, bit b0 of level 3 is “0” and bit b1
Is set to "1", and the bit b9 of level 2 is set to "0" ((j), 40 degrees). Here, the value of the flag 7 is set to “0”.

【0041】これより以後は、20度数を加算する毎
に、フラグ7の値が反転され、レベル1及びレベル2が
交互に度数の下位の桁の値を記憶するように制御され
る。
Thereafter, every time 20 degrees are added, the value of the flag 7 is inverted, and level 1 and level 2 are controlled so that the lower digit of the frequency is stored alternately.

【0042】第2の実施の形態によれば、20度数毎
に、フラグ7の状態が反転することによって、レベル1
及びレベル2を交互に度数の下位の値を記憶するように
設定するので、レベル1とレベル2の書き換え回数の隔
たりがなくなる。よって度数計数装置全体としての寿命
が延びる。
According to the second embodiment, the state of the flag 7 is inverted every 20 degrees, so that the level 1
And level 2 are set alternately to store the lower value of the frequency, so that there is no gap between the number of rewrites of level 1 and level 2. Therefore, the life of the entire frequency counting device is extended.

【0043】尚、レベル1の消去順序及び書き込み順序
は下位ビットから上位ビットに限定されるものではな
い。またレベル1、2の構成ビット数は10ビットに限
定されるものではない。
Note that the order of erasing and writing at level 1 is not limited to lower bits to upper bits. Also, the number of configuration bits for levels 1 and 2 is not limited to 10 bits.

【0044】また形態用モジュールはカードに限定され
るものではない。さらに制御回路32は固定モジュール
に設けた構成としてもよい。
The form module is not limited to a card. Further, the control circuit 32 may be provided in a fixed module.

【0045】また第1の実施例及び第2の実施例に於
て、レベル1及びレベル2に2進数で表された値を記憶
させてもよい。
In the first and second embodiments, a value represented by a binary number may be stored in level 1 and level 2.

【0046】[0046]

【発明の効果】第1の記憶領域と第2の記憶領域の書き
換え回数の隔たりを少なくすることにより、度数計数装
置全体の寿命を延ばすことができる。
The life of the entire frequency counting device can be extended by reducing the difference in the number of rewrites between the first storage area and the second storage area.

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

【図1】本発明の第1の実施の形態の概略構成図。FIG. 1 is a schematic configuration diagram of a first embodiment of the present invention.

【図2】本発明の第1の実施の形態の度数計数記憶処理
を説明する為の図。
FIG. 2 is an exemplary view for explaining frequency count storage processing according to the first embodiment of the present invention;

【図3】本発明の第1の実施の形態の度数計数記憶処理
を説明する為の図。
FIG. 3 is an exemplary view for explaining frequency count storage processing according to the first embodiment of the present invention;

【図4】本発明の第2の実施の形態の概略構成図。FIG. 4 is a schematic configuration diagram of a second embodiment of the present invention.

【図5】本発明の第2の実施の形態の度数計数記憶処理
を説明する為の図。
FIG. 5 is a view for explaining frequency count storage processing according to the second embodiment of the present invention;

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

1…EEPROM 2,32…制御回路 3…Yアドレスデコーダ 4…Xアドレスデコーダ 5…I/O 6…ユニットセル領域 7…フラグ 10,30…ICカード 20…カードリーダ DESCRIPTION OF SYMBOLS 1 ... EEPROM 2, 32 ... Control circuit 3 ... Y address decoder 4 ... X address decoder 5 ... I / O 6 ... Unit cell area 7 ... Flag 10, 30 ... IC card 20 ... Card reader

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】 度数を加算する命令が与えられる毎に、
その度数を逐次加算し、加算することによって得られた
度数を記憶する度数計数装置に於て、 第1の状態と第2の状態とを有するフラグと、 度数を記憶するものであって、複数ビットからなる第1
の記憶領域と複数ビットからなる第2の記憶領域とを有
し、前記フラグが第1の状態の時、前記第1の記憶領域
は前記度数の下位の桁の値を記憶し、かつ前記第2の記
憶領域は前記度数の上位の桁の値を記憶し、前記フラグ
が第2の状態の時、前記第1の記憶領域は前記度数の上
位の桁の値を記憶し、かつ前記第2の記憶領域は前記度
数の下位の桁の値を記憶する記憶回路と、 前記記憶回路が記憶する前記度数が所定の値を越えた場
合又は前記第1又は第2の記憶領域の書き換え回数が所
定の値を越えた場合、前記フラグの状態を反転させる制
御回路とを有することを特徴とする度数計数装置。
Each time an instruction to add a frequency is given,
In a frequency counting device that sequentially adds the frequencies and stores the frequency obtained by the addition, a flag having a first state and a second state and a frequency are stored. First consisting of bits
And a second storage area composed of a plurality of bits, and when the flag is in the first state, the first storage area stores a value of a lower digit of the frequency, and The second storage area stores the value of the upper digit of the frequency, and when the flag is in the second state, the first storage area stores the value of the upper digit of the frequency; A storage area for storing a value of a lower digit of the frequency; and a case where the frequency stored in the storage circuit exceeds a predetermined value or the number of rewrites of the first or second storage area is predetermined. And a control circuit for inverting the state of the flag when the value of the flag is exceeded.
【請求項2】前記記憶回路は、前記度数の最上位の桁の
値を2進数で表された値で記憶する第3の記憶領域を有
することを特徴とする請求項1又は2記載の度数計数装
置。
2. The frequency according to claim 1, wherein said storage circuit has a third storage area for storing a value of the most significant digit of said frequency as a value represented by a binary number. Counting device.
【請求項3】度数を加算する命令が与えられる毎に、そ
の度数を逐次加算し、加算することによって得られた度
数を記憶する度数計数装置に於て、 第1の状態と第2の状態とを有するフラグと、 度数を記憶するものであって、第1の記憶領域、第2の
記憶領域及び第3の記憶領域を有し、前記第3の記憶領
域は前記度数の上位の桁の値を記憶し、前記フラグの状
態に応じて、前記第1又は第2の記憶領域が前記度数の
下位の桁の値を記憶する記憶回路と、 前記記憶回路が記憶する前記度数が所定の値を越えた場
合又は前記第1又は第2の記憶領域の書き換え回数が所
定の値を越えた場合、前記フラグの状態を反転させる制
御回路とを有することを特徴とする度数計数装置。
3. A frequency counting device for sequentially adding a frequency each time a command for adding a frequency is given and storing a frequency obtained by the addition, wherein a first state and a second state are provided. And a flag having a first storage area, a second storage area, and a third storage area, wherein the third storage area has an upper digit of the frequency. A storage circuit for storing a value, wherein the first or second storage area stores a value of a lower digit of the frequency in accordance with a state of the flag; and the frequency stored in the storage circuit is a predetermined value. And a control circuit for inverting the state of the flag when the number of times of rewriting of the first or second storage area exceeds a predetermined value.
【請求項4】前記上位の桁を記憶する記憶領域は2進数
で表された値であることを特徴とする請求項1又は2記
載の度数計数装置。
4. The frequency counting device according to claim 1, wherein the storage area for storing the upper digit is a value represented by a binary number.
【請求項5】全ビットが初期値である前記第1の記憶領
域又は第2の記憶領域のビットが、1度数を加算する命
令が与えられる毎に、1ビットづつ反転値に換えられ、
全ビットが反転値となった前記第1の記憶領域又は第2
の記憶領域のビットが、1度数を加算する命令が与えら
れる毎に、1ビットづつ初期値に戻されることを特徴と
する請求項1又は3記載の度数計数装置。
5. A bit of the first storage area or the second storage area, in which all bits are initial values, is changed to an inverted value one bit at a time every time an instruction to add a frequency is given,
The first storage area or the second storage area in which all bits have inverted values;
4. The frequency counting device according to claim 1, wherein the bits of the storage area are returned to the initial value one bit at a time each time a command for adding one frequency is given.
JP9006421A 1997-01-17 1997-01-17 Frequency counter Withdrawn JPH10207780A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP9006421A JPH10207780A (en) 1997-01-17 1997-01-17 Frequency counter

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP9006421A JPH10207780A (en) 1997-01-17 1997-01-17 Frequency counter

Publications (1)

Publication Number Publication Date
JPH10207780A true JPH10207780A (en) 1998-08-07

Family

ID=11637916

Family Applications (1)

Application Number Title Priority Date Filing Date
JP9006421A Withdrawn JPH10207780A (en) 1997-01-17 1997-01-17 Frequency counter

Country Status (1)

Country Link
JP (1) JPH10207780A (en)

Similar Documents

Publication Publication Date Title
US6154808A (en) Method and apparatus for controlling data erase operations of a non-volatile memory device
EP0283238B1 (en) Non-volatile memory
JP4280739B2 (en) How to access memory
CN103247341A (en) Non-volatile semiconductor memory device
KR20010070149A (en) Microcontroller incorporating an electrically rewritable non-volatile memory
JPS6196598A (en) Count data memory method of electric erasable p-rom
JPH10326493A (en) Compounded flash memory device
JPH06124175A (en) Semiconductor disk device
US5517460A (en) Semiconductor integrated circuit and IC card using the same
EP0438050B1 (en) Nonvolatile semiconductor memory system
JP2004103197A (en) Chip provided with on-system programmable non-volatile memory and off-system programmable non-volatile memory, and its forming method and programming method
JPH0613890A (en) Safe counting method for binary electronic counter
JPH07141478A (en) Passive unit counting integrated circuit
KR950010304B1 (en) Semiconductor integrated circuit device with non-volatile memory device
JP2002222084A (en) Semiconductor storage device, sector address conversion circuit, address conversion method, and method for using semiconductor storage device
JP2001109666A (en) Non-volatile semiconductor storage device
JPH10207780A (en) Frequency counter
JPH0435780B2 (en)
JPH1021146A (en) Frequency counter
US6212105B1 (en) Method for recording a binary word by means of electrically erasable and programmable type memory cells
JPS62184696A (en) Nonvolatile semiconductor memory device
US6314155B1 (en) Counting circuit with rewritable non-volatile memory, and counting method
JP3378681B2 (en) Memory data read / write circuit
KR100283908B1 (en) Data scaling circuit
JP2008171565A (en) Nonvolatile semiconductor memory device

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