JP4804815B2 - Random pulse generation source, method for generating random number and / or probability using the same, program, and semiconductor device - Google Patents

Random pulse generation source, method for generating random number and / or probability using the same, program, and semiconductor device Download PDF

Info

Publication number
JP4804815B2
JP4804815B2 JP2005187750A JP2005187750A JP4804815B2 JP 4804815 B2 JP4804815 B2 JP 4804815B2 JP 2005187750 A JP2005187750 A JP 2005187750A JP 2005187750 A JP2005187750 A JP 2005187750A JP 4804815 B2 JP4804815 B2 JP 4804815B2
Authority
JP
Japan
Prior art keywords
random
probability
pulse
generating
random number
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.)
Active
Application number
JP2005187750A
Other languages
Japanese (ja)
Other versions
JP2006050577A (en
Inventor
典平 露崎
Original Assignee
典平 露崎
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 典平 露崎 filed Critical 典平 露崎
Priority to JP2005187750A priority Critical patent/JP4804815B2/en
Publication of JP2006050577A publication Critical patent/JP2006050577A/en
Application granted granted Critical
Publication of JP4804815B2 publication Critical patent/JP4804815B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H01ELECTRIC ELEMENTS
    • H01LSEMICONDUCTOR DEVICES NOT COVERED BY CLASS H10
    • H01L23/00Details of semiconductor or other solid state devices
    • H01L23/58Structural electrical arrangements for semiconductor devices not otherwise provided for, e.g. in combination with batteries
    • H01L23/585Structural electrical arrangements for semiconductor devices not otherwise provided for, e.g. in combination with batteries comprising conductive layers or plates or strips or rods or rings
    • HELECTRICITY
    • H01ELECTRIC ELEMENTS
    • H01LSEMICONDUCTOR DEVICES NOT COVERED BY CLASS H10
    • H01L2223/00Details relating to semiconductor or other solid state devices covered by the group H01L23/00
    • H01L2223/58Structural electrical arrangements for semiconductor devices not otherwise provided for
    • H01L2223/64Impedance arrangements
    • H01L2223/66High-frequency adaptations
    • H01L2223/6661High-frequency adaptations for passive devices
    • H01L2223/6677High-frequency adaptations for passive devices for antenna, e.g. antenna included within housing of semiconductor device
    • HELECTRICITY
    • H01ELECTRIC ELEMENTS
    • H01LSEMICONDUCTOR DEVICES NOT COVERED BY CLASS H10
    • H01L2224/00Indexing scheme for arrangements for connecting or disconnecting semiconductor or solid-state bodies and methods related thereto as covered by H01L24/00
    • H01L2224/01Means for bonding being attached to, or being formed on, the surface to be connected, e.g. chip-to-package, die-attach, "first-level" interconnects; Manufacturing methods related thereto
    • H01L2224/42Wire connectors; Manufacturing methods related thereto
    • H01L2224/47Structure, shape, material or disposition of the wire connectors after the connecting process
    • H01L2224/48Structure, shape, material or disposition of the wire connectors after the connecting process of an individual wire connector
    • H01L2224/4805Shape
    • H01L2224/4809Loop shape
    • H01L2224/48091Arched
    • HELECTRICITY
    • H01ELECTRIC ELEMENTS
    • H01LSEMICONDUCTOR DEVICES NOT COVERED BY CLASS H10
    • H01L2924/00Indexing scheme for arrangements or methods for connecting or disconnecting semiconductor or solid-state bodies as covered by H01L24/00
    • H01L2924/0001Technical content checked by a classifier
    • H01L2924/0002Not covered by any one of groups H01L24/00, H01L24/00 and H01L2224/00
    • HELECTRICITY
    • H01ELECTRIC ELEMENTS
    • H01LSEMICONDUCTOR DEVICES NOT COVERED BY CLASS H10
    • H01L2924/00Indexing scheme for arrangements or methods for connecting or disconnecting semiconductor or solid-state bodies as covered by H01L24/00
    • H01L2924/30Technical effects
    • H01L2924/301Electrical effects
    • H01L2924/3025Electromagnetic shielding

Landscapes

  • Physics & Mathematics (AREA)
  • Condensed Matter Physics & Semiconductors (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Microelectronics & Electronic Packaging (AREA)
  • Power Engineering (AREA)

Description

本発明は完全なランダムパルスを自発的に発生するα粒子放射体等を設けたランダムパルス発生源に関し、またこのようなランダムパルス発生源を内部に一体に取り付け、完全にランダムな信号を生成し認証信号や乱数及び確率を作成することのできる、IC等半導体デバイスに関し、またランダムパルスから乱数及び/又は確率を発生するための方法、プログラムに関する。   The present invention relates to a random pulse generation source provided with an α particle emitter that spontaneously generates a complete random pulse, and such a random pulse generation source is integrally mounted inside to generate a completely random signal. The present invention relates to a semiconductor device such as an IC that can generate an authentication signal, a random number, and a probability, and also relates to a method and program for generating a random number and / or probability from a random pulse.

セキュリティを向上させたICタグとしては、例えば特許公開2003−337928、特許公開2003−16396に開示されたものがある。前者は、端末装置との接続により電力を蓄電し、この電力によりIC内部のCPUによってワンタイム・パスワードを作成し、これをメモリに保持し、蓄電された電力が放電されると保持されたパスワードが消去する構成となっており、後者は、タグから2回以上認証データを読み取るとともに、認証データとして擬似ランダムな値を用いる構成となっている。   Examples of IC tags with improved security include those disclosed in Japanese Patent Publication Nos. 2003-337928 and 2003-16396. The former stores electric power by connecting to the terminal device, creates a one-time password by the CPU inside the IC with this electric power, holds this in the memory, and holds the password when the stored electric power is discharged In the latter, the authentication data is read twice or more from the tag, and a pseudo-random value is used as the authentication data.

特許公開2003−337928Patent Publication 2003-337928 特許公開2003−16396Patent Publication 2003-16396

しかしながら、これらのICタグは、その認証用に使用されるICに、完全にランダムな信号の発生器、またはそのような信号を生成する機能を内蔵していない。この種の認証用ICでは記憶回路が組み込まれており、認証データは無線通信や赤外線通信で外部から送信された信号を受信し、あるいはICチップ内で作成し、その記憶回路に書き込んでいる。そして、受信側のICチップに記憶していたデータは外部から読み出すことが可能であって、機密性が弱くセキュリティ上問題があった。また、ICの区別のため乱数データを使用する場合は、送信側でプログラムにより作成する擬似乱数であることが多く、送信側の機密の保持が不可欠であり、また乱数データから規則性を推測できる脆弱性があり、更に組み合わせ数も限界があって、複数の同じ識別番号が混在することが懸念されていた。また、このようなICタグを追跡用に使用する場合、個人情報が追跡側に蓄積する等の問題が生じ、普及の阻害要因となっていた。   However, these IC tags do not include a completely random signal generator or a function for generating such a signal in an IC used for authentication. In this type of authentication IC, a storage circuit is incorporated, and authentication data is received from a signal transmitted from the outside by wireless communication or infrared communication, or created in an IC chip and written in the storage circuit. The data stored in the IC chip on the receiving side can be read from the outside, and the confidentiality is weak and there is a security problem. In addition, when using random number data for IC distinction, it is often a pseudo-random number created by a program on the transmission side, and confidentiality on the transmission side is indispensable, and regularity can be inferred from the random number data There were vulnerabilities, and the number of combinations was also limited, and there was concern that multiple identical identification numbers would be mixed. In addition, when such an IC tag is used for tracking, problems such as the accumulation of personal information on the tracking side occur, which has been an impeding factor for popularization.

また、電子錠のような認証装置において、相手を認証するために使用される従来のICは、チップ自身に認証信号生成機能が組み込まれていなかった。アンチクローン(偽造防止)のために、無線や赤外通信で外部から認証信号を送り、この認証データをチップ内の記憶素子に記憶させ、送信元の記憶したデータと一致した時に正式な相手側として認識していた。従って、記憶したデータをそっくりコピーした場合は、送信元では真偽の判定が出来ない。そこで、前述のICタグの場合と同様に、セキュリティ上問題があった。   Further, in an authentication device such as an electronic lock, a conventional IC used for authenticating a partner does not have an authentication signal generation function built into the chip itself. For anti-clone (anti-counterfeiting), send an authentication signal from outside by wireless or infrared communication, store this authentication data in the memory element in the chip, and when it matches the stored data of the sender, the other party Was recognized as. Therefore, if the stored data is copied exactly, the sender cannot make a true / false decision. Therefore, as in the case of the IC tag described above, there is a security problem.

また熱雑音やノイズを使用した乱数発生器が組み込まれたICもあるが、熱雑音やノイズは熱や電磁波などの環境変化に影響される為、完全にランダムな信号ではなく、擬似乱数の取扱いをしなければならず、信頼性に限界があった。また雑音を使用する方式では、それを元に作成された乱数は現象論的に乱雑であるが、乱数自身の性能に関しては各種評価方法に基づくもの以外、理論的な裏付けもない。   Some ICs have built-in random number generators that use thermal noise or noise. However, thermal noise and noise are affected by environmental changes such as heat and electromagnetic waves, so pseudorandom numbers are handled instead of completely random signals. There was a limit to reliability. In addition, in the method using noise, the random number created on the basis of it is phenomenologically random, but the performance of the random number itself is not theoretically supported except based on various evaluation methods.

本発明は、上述した従来の問題点を解消するために開発されたものである。
本発明に係るランダムパルス発生器(発生源)(以下RPGという)は、原子核の崩壊に伴って放出されるα粒子、ベータ線あるいはα粒子と及びベータ線を放出する放出体と、放出されるα粒子等を検出する検出器とを含み、前記放出体を溶液とし、この溶液を前記検出器の検出面に滴下するように構成する。
The present invention has been developed to solve the above-described conventional problems.
The random pulse generator (generation source) (hereinafter referred to as RPG) according to the present invention emits alpha particles, beta rays or alpha particles that are emitted along with nuclear decay, and an emitter that emits beta rays. a detector that detects α particles and the like, and the emitter is used as a solution, and the solution is dropped onto a detection surface of the detector.

本発明に係るRPGは、また、原子核の崩壊に伴って放出されるα粒子、ベータ線あるいはα粒子と及びベータ線を放出する放出体と、放出されるα粒子等を検出する検出器とを含み、前記放出体を溶液とし、この溶液を蒸着しまたはロール法などで盤状に加工された部材を、前記検出器と所定の距離を介して対向させるよう構成する。   The RPG according to the present invention also includes an α particle, a beta ray or an α particle emitted along with the decay of the nucleus, an emitter that emits the beta ray, and a detector that detects the emitted α particle and the like. A member formed by depositing the solution or processing into a disk shape by a roll method or the like is configured to face the detector through a predetermined distance.

また、本発明にかかる、ICを含む半導体デバイスは、自発的にランダムパルスを発生するランダムパルス発生源を設けるとともに、該RPGから発生したランダムパルスの時間間隔を計時しもしくは電圧値を測定し、ディジタル値に変換することで、乱数を発生し及び/又は確率を生成するように構成する。   Further, a semiconductor device including an IC according to the present invention is provided with a random pulse generation source that spontaneously generates a random pulse, and measures a time interval of a random pulse generated from the RPG or measures a voltage value, By converting to a digital value, a random number is generated and / or a probability is generated.

例えば、本発明を認証装置に適用する場合、自然崩壊で無限に放出されるα粒子放出源をもつランダムパルス発生器(RPG)をIC本体内部に組み込み、RPGからの完全ランダムな信号を得て、この信号を認証信号として利用する。即ち、ICチップ自身が常時認証信号を発生して、認証の度に新しい認証データに書き換え、コピーが意味をなさないようにする。このとき、ほぼ無限の認証信号の組み合わせが、プログラムを使用せずに可能となり、ICチップ製造側での認証データの管理を不要とし、ICチップを有する使用者側では、完全なセキュリティを確立することができる。
更に、詳細は後述するが、本発明では、ICチップ内で、RPGの信号から完全な乱数及び確率を容易に作成することができるから、そのようなICを提供することにより、乱数及び確率の利用を容易にさせる。
For example, when the present invention is applied to an authentication device, a random pulse generator (RPG) having an alpha particle emission source that is emitted infinitely by natural decay is incorporated in the IC body, and a completely random signal is obtained from the RPG. This signal is used as an authentication signal. That is, the IC chip itself always generates an authentication signal and rewrites it with new authentication data every time authentication is performed, so that copying does not make sense. At this time, almost infinite combinations of authentication signals are possible without using a program, management of authentication data on the IC chip manufacturing side is unnecessary, and complete security is established on the user side having the IC chip. be able to.
Further, as will be described in detail later, in the present invention, a complete random number and probability can be easily generated from an RPG signal in an IC chip. Make it easy to use.

本発明に係る乱数及び/又は確率を生成する方法/プログラムは、RPGを設けるステップと、該RPGから発生したランダムパルスの時間間隔を計時しもしくは電圧値を測定し、ディジタル値に変換するステップと、ディジタル値に変換したランダムパルスから、所定のビット長の指数分布の乱数、一様乱数を発生し、及び/又は確率を生成するステップとから成る。   A method / program for generating random numbers and / or probabilities according to the present invention comprises: providing an RPG; measuring a time interval of a random pulse generated from the RPG; or measuring a voltage value and converting it to a digital value; Generating random numbers of an exponential distribution having a predetermined bit length, uniform random numbers, and / or generating probabilities from random pulses converted into digital values.

上記方法において、ランダムパルスから、所定のビット長の指数分布の乱数、一様乱数を発生し、及び/又は確率を生成するステップは、ランダムパルスについて同じパルス間隔が発生する確率を示す指数分布から必要数の確率を求め、この確率を基に一様乱数を作成する。   In the above method, the step of generating a random number of an exponential distribution having a predetermined bit length, a uniform random number, and / or generating a probability from a random pulse is generated from an exponential distribution indicating a probability that the same pulse interval occurs for the random pulse. Find the required number of probabilities and create a uniform random number based on this probability.

また、ランダムパルスから、所定のビット長の指数分布の乱数、一様乱数を発生し、及び/又は確率を生成するステップは、前記指数分布を使用してt1とt2の時間間隔から確率を求めるとき、t2時間を無限時間と仮定してt1時間を越えたときに所定の確率のパルスと認定する。   The step of generating a random number of an exponential distribution having a predetermined bit length, a uniform random number, and / or generating a probability from a random pulse obtains the probability from the time interval between t1 and t2 using the exponential distribution. When t2 time is assumed to be infinite time and t1 time is exceeded, it is recognized as a pulse having a predetermined probability.

また、ランダムパルスから、所定のビット長の指数分布の乱数、一様乱数を発生し、及び/又は確率を生成するステップは、指数分布から乱数を作成するときに、計測の基本周期を変動させることにより、パルスの平均放出率が変動しても同じ演算処理を行って、指数分布乱数、一様分布乱数の安定した出現確率密度分布を実現する。   The step of generating a random number of an exponential distribution having a predetermined bit length, a uniform random number, and / or generating a probability from a random pulse varies a basic period of measurement when generating the random number from the exponential distribution. Thus, even if the average emission rate of the pulse fluctuates, the same calculation process is performed to realize a stable appearance probability density distribution of exponential distribution random numbers and uniform distribution random numbers.

また、ランダムパルスから、所定のビット長の指数分布の乱数、一様乱数を発生し、及び/又は確率を生成するステップは、指数分布から乱数を作成するときに、計測の基本周期を変動させることにより、指数分布乱数の分布を安定させると共に、一様分布乱数の生成と確率の生成を同時に処理する。 The step of generating a random number of an exponential distribution having a predetermined bit length, a uniform random number, and / or generating a probability from a random pulse varies a basic period of measurement when generating the random number from the exponential distribution. As a result, the distribution of the exponential distribution random numbers is stabilized, and the generation of uniform distribution random numbers and the generation of probabilities are processed simultaneously.

ランダムパルスから、所定のビット長の指数分布の乱数、一様乱数を発生し、及び/又は確率を生成するステップは、指数分布から乱数を作成するときに、計測の基本周期を変動させることにより、計時を行うマイコン等のハードウェアの発振周波数などの動作クロックの変動を自動補正する。 The step of generating an exponential distribution random number, a uniform random number of a predetermined bit length from random pulses, and / or generating a probability is performed by changing a basic period of measurement when generating a random number from an exponential distribution. It automatically corrects fluctuations in the operating clock, such as the oscillation frequency of hardware such as a microcomputer that counts time.

本発明は環境条件に全く作用されず、かつ人的コントロールが一切出来ないオリジナルな信号発生源をIC本体に組み込み、IC自身が発生するランダム信号を認証信号や乱数及び確率作成の源信号として使用する。これにより、人為的操作が不可能で安全性が確立した認証システムが構築できる。   The present invention incorporates an original signal source that is not affected by environmental conditions and cannot be controlled by humans into the IC body, and uses a random signal generated by the IC itself as an authentication signal, a random number, and a source signal for probability generation. To do. Thereby, it is possible to construct an authentication system in which human operation is impossible and safety is established.

また認証システムの供給側でデータの保存が必要なく、コスト面の大幅な削減が出来る。本発明で生成される一様乱数は完全な乱数の取扱いが出来、また人的な不正が不可能な確率発生器として使用できる。   In addition, there is no need to store data on the supply side of the authentication system, and the cost can be greatly reduced. The uniform random number generated in the present invention can be used as a probability generator that can handle a complete random number and cannot be illegal.

具体的な説明には、無線タグの機能を付加したRPG−RFID(Radio Frequency Identification)チップを例に取り説明する。ただし、本発明はこれに限定されず、他の認証信号や、乱数、確率を生成するIC等の半導体デバイスに適用できることは勿論である   In the specific description, an RPG-RFID (Radio Frequency Identification) chip to which a function of a wireless tag is added will be described as an example. However, the present invention is not limited to this, and can of course be applied to other authentication signals, semiconductor devices such as ICs for generating random numbers and probabilities.

また、本発明は、以下に説明するランダムパルス発生源(RPG)を組込んだICカード、ICタグ、PC接続可能な機器、機器組み込み型モジュール等に適用することも、またこのようなRPGを設けるとともに、該RPGから発生したランダムパルスの時間間隔を計時しもしくは電圧値を測定し、ディジタル値に変換することで、乱数を発生し及び/又は確率を生成するように構成した半導体デバイスを組込んだICカード、ICタグ、PC接続可能な機器、機器組み込み型モジュール等に適用することも可能である。   In addition, the present invention can be applied to an IC card, IC tag, PC-connectable device, device-embedded module, etc. incorporating a random pulse generation source (RPG) described below. A semiconductor device configured to generate a random number and / or generate a probability by measuring a time interval of a random pulse generated from the RPG or measuring a voltage value and converting it into a digital value. The present invention can also be applied to embedded IC cards, IC tags, PC-connectable devices, device-embedded modules, and the like.

本発明に係るICタグは以下の構造から成る。完全なランダムなパルスを発生させるRPG(ランダムパルス発生器)は、本発明者の取得した特許第2926539号に記載されているα粒子を利用したパルス発生装置を改良して使用する。α粒子放出体は自然崩壊する241Am、244Cm、210Pb-210Po、210Po等を使用する。より具体的には、ウラン系列の全ての核種、トリウム系列の全ての核種、これらの核種間の放射平衡を形成する210Pb-210Po等の全ての核種、244Cmあるいは241Amを使用することができる。なお、ICタグの使用先に遮蔽設置スペースがある部位に使用するICタグであればベータ線やガンマ線を使用しランダムパルスを発生するRPGでも良い。 The IC tag according to the present invention has the following structure. An RPG (random pulse generator) that generates completely random pulses is an improved version of the pulse generator using α particles described in Japanese Patent No. 2926539, which was acquired by the present inventor. As the alpha particle emitter, 241 Am, 244 Cm, 210 Pb- 210 Po, 210 Po, etc. which spontaneously collapses are used. More specifically, use all nuclides of the uranium series, all nuclides of the thorium series, all nuclides such as 210 Pb- 210 Po that form a radiation equilibrium between these nuclides, 244 Cm or 241 Am Can do. Note that an RPG that uses a beta ray or a gamma ray to generate a random pulse may be used as long as the IC tag is used in a site where there is a shielded installation space at the use destination of the IC tag.

α粒子やベータ線、ガンマ線は、温度、圧力、湿度や電磁波など環境に影響されないため、人為的な操作が出来ない。この特質ICは他の方法では実現出来ず安全が確保する上で重要な要素である。完全な安全性が要求されない部位に使用するICタグであれば熱雑音や半導体のジッターなどをランダムパルスの発生源とするRPGを使用することができるであろう。   Since alpha particles, beta rays, and gamma rays are not affected by the environment such as temperature, pressure, humidity, and electromagnetic waves, they cannot be manually manipulated. This characteristic IC cannot be realized by other methods and is an important factor in ensuring safety. If the IC tag is used in a site where complete safety is not required, an RPG using thermal noise, semiconductor jitter, or the like as a source of random pulses could be used.

ICタグのRPG−RFIDチップは、RPGとRPGから送出されるランダムパルスを認証信号として使用できるようにするための電子回路、認証信号を記憶するための回路、記憶素子、通信の形態に応じた認証信号を相手側に送出するための回路、アンテナ及び通信素子などが組み込まれる。電源は、RPG−RFIDチップの場合はアンテナからRFエネルギーを供給されるが、設置スペースがある場合は端子を設けて供給しても良い。   The RPG-RFID chip of the IC tag depends on the RPG and the electronic circuit for enabling the random pulse sent from the RPG to be used as the authentication signal, the circuit for storing the authentication signal, the storage element, and the communication form A circuit for transmitting the authentication signal to the other party, an antenna, a communication element, and the like are incorporated. In the case of an RPG-RFID chip, the power is supplied with RF energy from an antenna. However, if there is an installation space, a terminal may be provided for supply.

RPG−RFIDチップの認証手順は、まずRPG−RFIDチップの自身の認証信号として内蔵されたRPGからのランダム信号(発生時間とパルスの時間間隔)を内部の記憶素子に書き込む。またこの記憶する信号を外部からRPG−RFIDチップとの通信手段を使用して、または直接接触による接続によって取り出して確認し、同一ロットに同じ認証信号の組み合わせが無いことを確認する。   In the authentication procedure of the RPG-RFID chip, first, a random signal (generation time and pulse time interval) from the built-in RPG is written in an internal storage element as an authentication signal of the RPG-RFID chip itself. Further, the stored signal is taken out from the outside using a communication means with the RPG-RFID chip or connected by direct contact and confirmed, and it is confirmed that there is no combination of the same authentication signals in the same lot.

出荷するRPG−RFIDチップを特定の物品管理に使用する場合で、出荷時から移動情報などの管理において配布範囲が比較的限定されている場合には、出荷時にRPG−RFIDチップ個々の認証信号を通信により読みだして保存して利用する。
この認証手順と認証データ保存を通信のたびに行い、認証データをRPG−RFIDチップ自身で発生するランダム信号で置き換える。
When the RPG-RFID chip to be shipped is used for specific article management and the distribution range is relatively limited in the management of movement information from the time of shipment, the authentication signal for each RPG-RFID chip is sent at the time of shipment. Read through communication, save and use.
This authentication procedure and authentication data storage are performed for each communication, and the authentication data is replaced with a random signal generated by the RPG-RFID chip itself.

以下、図面を参照して本発明のランダムパルス発生器(RPG)付RPG−RFIDチップの実施形態に付いて詳細に説明する。   Hereinafter, embodiments of an RPG-RFID chip with a random pulse generator (RPG) according to the present invention will be described in detail with reference to the drawings.

まず自発的にランダムパルスを発生するランダムパルス発生器(RPG)について説明する。
RPGは、図1に示すようなRPG-RFIDチップの中央部位に、α粒子放射体と、PN型半導体、PNP型半導体、PINホトダイオード、ホトトランジスタあるいはホトダイオード等によって構成されている。このパルス発生器の素子は、RPG−RFIDチップが要求される安全度に応じて選択される。なお、図1において、10はα粒子放射体及び検出器の取り付け部位を示し、100は基体(シリコン・ベース)を示す。
First, a random pulse generator (RPG) that spontaneously generates random pulses will be described.
The RPG is composed of an α-particle emitter, a PN-type semiconductor, a PNP-type semiconductor, a PIN photodiode, a phototransistor, a photodiode, or the like at the central portion of the RPG-RFID chip as shown in FIG. The elements of this pulse generator are selected according to the degree of safety required for the RPG-RFID chip. In FIG. 1, reference numeral 10 denotes an attachment portion of the α particle radiator and the detector, and 100 denotes a base (silicon base).

α粒子放射体が取り付けられたRPG−RFIDチップのα粒子検出器周辺の構造を図2に示す。α粒子放射体から放出されるα粒子(He原子)の放出は温度、圧力、電磁波など環境に全く影響されず、電源も不要で自発的に半減期に応じて半永久的に放出される。つまりこの方式では認証に使用する原信号は人為的操作が全く出来ない信号源を使用することが出来ることが特徴である。よって外部からは一切変更が出来ない信号発生源となる。なお、このICにおける取付け部位が完全な安全性を要求されない場合は、パルス発生器にノイズを発生させるためのダイオード等を使用しても良い。図2において、11は、蒸着され、あるいは滴下されるなどしたα粒子放射体、12は検出器を示す。   The structure around the α particle detector of the RPG-RFID chip to which the α particle emitter is attached is shown in FIG. The release of α particles (He atoms) emitted from the α particle emitter is not affected at all by the environment such as temperature, pressure, electromagnetic waves, etc., and no power source is required and spontaneously released semipermanently according to the half-life. In other words, this system is characterized in that the source signal used for authentication can be a signal source that cannot be manually manipulated. Therefore, it becomes a signal generation source that cannot be changed from the outside. If the mounting part of the IC does not require complete safety, a diode or the like for generating noise in the pulse generator may be used. In FIG. 2, 11 is an α-particle emitter that is deposited or dropped, and 12 is a detector.

α粒子放射体をIC内部に組み込む方法は、α粒子放射体が蒸着された或はロール法で製造され円盤状に加工された製品を使用する方法と、α粒子放射体の溶液を滴下する(インクジェット方式による噴射も含む)方法とがある。   As for the method of incorporating the α particle radiator into the IC, a method of using a product in which the α particle radiator is deposited or manufactured by the roll method and processed into a disk shape, and a solution of the α particle radiator are dropped. (Including injection by an ink jet method).

円盤状に加工されたα粒子放射体を組み込む方法は、α粒子検出ダイオードの直上に取り付ける。取付け方法としては、検出ダイオードとα粒子放射体との距離が所定の距離となるようスペーサを取付けその上に載せる方法と、封止板に接着して取り付ける方法とがある。取付けた構造を図3に示す。この図において、11はα粒子放射体、12は検出器、13は封止材、14は、放射体と検出器との距離を設定するためのスペーサである。   The method of incorporating a disk-shaped α particle emitter is mounted directly above the α particle detection diode. As an attachment method, there are a method in which a spacer is attached so that the distance between the detection diode and the α-particle emitter is a predetermined distance, and a method in which the spacer is attached to the sealing plate. The attached structure is shown in FIG. In this figure, 11 is an alpha particle radiator, 12 is a detector, 13 is a sealing material, and 14 is a spacer for setting the distance between the radiator and the detector.

α粒子放射体の溶液を滴下して検出器を構成する場合は次のようにする。(図4A乃至4C参照)   When a detector is constructed by dropping a solution of an α-particle emitter, the following is performed. (See FIGS. 4A to 4C)

まずは滴下する検出器の周囲を含めた容積を計算し、外部へ流失しない体積を求める。滴下する溶液量はこの容積と同じ体積とする。α粒子放射体の濃度は、所定のパルス数となるように滴下量に含まれるα粒子放射体の原子数を求め、その濃度となるよう滴下前に濃度の調整をする。   First, the volume including the circumference of the dropping detector is calculated, and the volume that does not flow out to the outside is obtained. The amount of the solution to be dropped is the same volume as this volume. The concentration of the α-particle emitter is obtained by calculating the number of atoms of the α-particle emitter included in the dropping amount so as to be a predetermined number of pulses, and adjusting the concentration before dropping so as to be the concentration.

マイクロシリンジ20等の滴下ジグに必要量を吸引し、前もって決定しておいた滴下量のα粒子放射体の溶液11‘を押し出して検出器12の表面に滴下する(図4A参照)。滴下した後は、エポキシの封止材15で密封し(図4B参照)、あるいは封止用のディスク16等で密封となるように封止する(図4C参照)。インクジェット方式を使用して溶液の噴射により滴下する場合も同様な手順となる。   A required amount is sucked into a dropping jig such as the microsyringe 20, and a dropping amount of α-particle emitter solution 11 ′ determined in advance is pushed out and dropped onto the surface of the detector 12 (see FIG. 4A). After dripping, it seals with the epoxy sealing material 15 (refer FIG. 4B), or it seals so that it may seal with the disk 16 for sealing, etc. (refer FIG. 4C). A similar procedure is used when the ink jet method is used to drop the solution by jetting the solution.

α粒子放射体と回路部との距離(図1及び図2の距離d)は、α粒子による誤作動を防止するため以下に示す式で求められるα粒子の飛程より大きく取る。α粒子の空気中での飛程は一般に図7に示すようになる。横軸はα粒子放射体と検出器間の距離、縦軸は計数値(任意単位)である。α粒子放出体に210Pb-210Poを使用した時の計算を以下に示す。 The distance between the α-particle radiator and the circuit portion (distance d in FIGS. 1 and 2) is set larger than the range of the α-particle determined by the following formula in order to prevent malfunction due to the α-particles. The range of α particles in air is generally as shown in FIG. The horizontal axis is the distance between the alpha particle emitter and the detector, and the vertical axis is the count value (arbitrary unit). The calculation when 210 Pb- 210 Po is used for the α particle emitter is shown below.

α粒子のエネルギーE(MeV)と空気中の飛程R(cm)の関係はよく調べらており、ガイガーの式で表される。
E=2.12R2/3 (4<E<7)
R=0.323E3/2 (3<R<7)
よって、空気中でのPoα粒子の飛程は

Figure 0004804815
The relationship between the energy E (MeV) of the α particles and the range R (cm) in the air has been well investigated and is expressed by the Geiger equation.
E = 2.12R 2/3 (4 <E <7)
R = 0.323E 3/2 (3 <R <7)
Therefore, the range of Poα particles in the air is
Figure 0004804815

固体物質中のα粒子の飛程Rs(cm)は、空気中の飛程が既知であれば次のブラッグ・クレーマンの式で求められる。

Figure 0004804815
A:固体物質の原子量
ρ:密度
Si中におけるα粒子の飛程は、
Figure 0004804815
よって、回路と分離する為にSiの遮蔽材(遮蔽壁)を用いる場合は29μm以上とすれば良いことになる。 If the range in air is known, the range Rs (cm) of the α particles in the solid substance can be obtained by the following Bragg-Kreman equation.
Figure 0004804815
A: Atomic weight of solid substance ρ: Range of α particles in density Si
Figure 0004804815
Therefore, in the case where a Si shielding material (shielding wall) is used for separation from the circuit, it may be 29 μm or more.

また210Pb-210Poは、極微弱のベータ線を放出する。ベータ線は、α粒子と違い図8に示すように指数関数的に距離と共に到達電子数が減少する。ベータ線は電子そのものであり内部IC回路には全く影響を及ぼさないが、不要な誤解を招かない為にも外部へ漏れない構造とする。必要な遮蔽材の厚さは下記式で求められる。なお、図8において、横軸はAlの厚さを、また縦軸は電子数を示す。
Pb-210ベータ線の最大エネルギーEmは0.061MeVであるからWillsonの式より最大飛程Rmを計算する。
Rm=2400(Em)2=2400×(0.061)2=2400×0.003721=8.9304mg/cm2
210 Pb- 210 Po emits extremely weak beta rays. Unlike alpha particles, beta rays exponentially decrease the number of electrons reached with distance as shown in FIG. The beta ray is an electron itself and does not affect the internal IC circuit at all, but the structure does not leak to the outside so as not to cause unnecessary misunderstanding. The necessary thickness of the shielding material is obtained by the following formula. In FIG. 8, the horizontal axis indicates the thickness of Al, and the vertical axis indicates the number of electrons.
Since the maximum energy Em of the Pb-210 beta ray is 0.061 MeV, the maximum range Rm is calculated from the Willson equation.
Rm = 2400 (Em) 2 = 2400 × (0.061) 2 = 2400 × 0.003721 = 8.9304 mg / cm 2

また、アイソトープ便覧(改訂3版、丸善、1985年4月)図から60KeVでは、Al中の飛程は6mg/cm2である。Alの密度は2.7g/cm3であるから、

Figure 0004804815
よって、RPG−RFIDチップに必要な図1に示す封止材は33μm以上あれば良いことになる。 In addition, from the figure of the isotope handbook (revised 3rd edition, Maruzen, April 1985), at 60 KeV, the range in Al is 6 mg / cm 2 . Since the density of Al is 2.7 g / cm 3 ,
Figure 0004804815
Therefore, the sealing material shown in FIG. 1 required for the RPG-RFID chip may be 33 μm or more.

ところで、本発明はRPG−RFIDチップばかりでなく一般のICにも容易に組み込むことが出来る。図5A及び5BにDIP型のICに組み込む場合の配置図を示す。α粒子放射体を組み込む位置は同図のように中央にする必要も無く、IC回路の設計に応じて変更可能である。(MMチップにおいても同様である)図示において、30はα放射体の取り付け部を、31は封止用キャップまたはピッチを、また32はα放射体を滴下したダイオードチップを示す。   By the way, the present invention can be easily incorporated in not only an RPG-RFID chip but also a general IC. FIGS. 5A and 5B are layout diagrams for incorporation in a DIP type IC. The position where the alpha particle emitter is incorporated does not need to be in the center as shown in the figure, and can be changed according to the design of the IC circuit. (The same applies to the MM chip) In the figure, reference numeral 30 denotes an attachment portion of the α emitter, 31 denotes a sealing cap or pitch, and 32 denotes a diode chip to which the α emitter is dropped.

本発明に係るRPG−RFIDチップの一例について、その全体のブロック回路を図6に示す。RPG−RFIDチップはRPG40、波形整形増幅回路41、ロジック回路(制御演算)42、記憶回路43、RF回路44及びアンテナ45から構成される。
波形整形増幅回路41は、RPG40から出力される尖頭波形を、ディジタル処理が可能な整形された矩形波とするためのものである。ロジック回路42は、ランダムパルス信号を目的とする信号として取り扱うための処理回路である。記憶回路43は信号処理後のデータを記憶する回路である。RF回路44は外部とのアンテナ45を介して通信を行うための回路である。
FIG. 6 shows an entire block circuit of an example of the RPG-RFID chip according to the present invention. The RPG-RFID chip includes an RPG 40, a waveform shaping amplifier circuit 41, a logic circuit (control calculation) 42, a storage circuit 43, an RF circuit 44, and an antenna 45.
The waveform shaping amplifier circuit 41 is for making the peak waveform output from the RPG 40 a shaped rectangular wave that can be digitally processed. The logic circuit 42 is a processing circuit for handling a random pulse signal as a target signal. The storage circuit 43 is a circuit for storing data after signal processing. The RF circuit 44 is a circuit for performing communication via an antenna 45 with the outside.

RPGからの信号を数値化して記憶する方法としては、図9に示したように、RPGのランダムパルスは、波高値とパルス間隔がランダムであるので、パルス間隔を計測し又は波高値の電圧をサンプル&ホールドしてディジタル変換し、その測定値又は変換値を乱数値とすることもできる。また電圧、クロックパルス数の組み合わせを用いる事も出来る。   As a method of digitizing and storing the signal from the RPG, as shown in FIG. 9, since the RPG random pulse has a random crest value and pulse interval, the pulse interval is measured or the crest value voltage is measured. It is also possible to perform digital conversion by sample-and-hold and use the measured value or converted value as a random value. A combination of voltage and number of clock pulses can also be used.

次に、RPGで生成されるパルスを認証信号として使用した場合、全く同じパルス間隔が発生する確率を求める。   Next, when a pulse generated by RPG is used as an authentication signal, the probability of occurrence of exactly the same pulse interval is obtained.

計算例として通常使用されるパルスの平均放出率n=10個の場合で求めてみる。
パルス間隔の確率は次の式で求められる。

Figure 0004804815
As an example of calculation, the calculation is made in the case where the average emission rate n = 10 pulses normally used.
The probability of the pulse interval is obtained by the following formula.
Figure 0004804815

RPGの平均放出率n=10の時、認証信号として1sec間の平均個数10個のパルスを使用するとする。

Figure 0004804815
10個のパルス間隔が平均のパルス間隔0.1secで出現したとすると、同じ時間間隔で10個のパルスが次に出現する確率としては、次の表の計算結果となる。 When the average RPG release rate n = 10, it is assumed that an average number of 10 pulses per second is used as the authentication signal.
Figure 0004804815
Assuming that 10 pulse intervals appear at an average pulse interval of 0.1 sec, the probability of the next occurrence of 10 pulses at the same time interval is the calculation result in the following table.

Figure 0004804815
上記表の計算結果から同じパルス間隔のパルス列10個が出現する確率は、1/2.97E+21となる。
Figure 0004804815
From the calculation results in the above table, the probability that 10 pulse trains having the same pulse interval will appear is 1 / 2.97E + 21.

よって、本方式を用いる方法では、高々10個のパルスで同じ組み合わせとなる確率は1/2.97E+21以下が実現できる。この確率は、同一のパルス発生器での確率であり、個々のパルス発生器はそれぞれn値が異なっている。よって、別々のパルス発生器同士が同じパルス列となる確率は(1/3E+21)2以下となる。 Therefore, in the method using this method, the probability of the same combination with at most 10 pulses can be realized as 1 / 2.97E + 21 or less. This probability is the probability of the same pulse generator, and each pulse generator has a different n value. Therefore, the probability that different pulse generators have the same pulse train is (1 / 3E + 21) 2 or less.

認証用に本方式を使用するICの使用目的に応じて、使用するパルス数を選択し安全性を向上させる事ができる。   The number of pulses to be used can be selected according to the purpose of use of an IC that uses this method for authentication, and safety can be improved.

次に一様乱数の作成方法について記載する。
時間間隔t1からt2に出現するパルスの確率は前記(1)式で求められる。
この式を変形し、
t2=−1/n*log(e-nt1−p) -----------(2)
Next, a method for generating uniform random numbers will be described.
The probability of the pulse appearing in the time interval t1 to t2 is obtained by the above equation (1).
Transform this equation,
t 2 = -1 / n * log (e -nt1 -p) ----------- (2)

ここで、t2>t1であるので、上記式をtk=t2、tk-1=t1と置き換え、t0=0から順次t1、t2、・・・・を求めることにより、1/p通りの一様な出現確率を持つ時間幅(Δt)の閾値を求めることができる。 Here, since it is t2> t1, the equation replaced by t k = t 2, t k -1 = t 1, successively t 1 from t 0 = 0, t 2, by determining the ...., A threshold of time width (Δt) having a uniform appearance probability of 1 / p can be obtained.

tk+1=−1/n*log ( e-ntk−p)-----------(3) 但し t0=0
この(3)式においては、nとpを固定することにより、各tk値は一義的に決定できる。パルス間隔時間測定を16ビット長(0-65535)で行う場合、変換後の有効桁数を考えると、上記閾値により置き換えるデータ長は8ビット長程度にしないと、短い時間間隔において誤差の影響を無視できなくなる。従って、上記pを256に設定し、0-65535(16ビット長)の区間を上記閾値により0-255(8ビット長)区間に変換することにする。ビット長として16ビットが求められる場合、2個の8ビット長データを繋ぎ合わせることで生成できる。
t k + 1 = −1 / n * log (e -ntk −p) ----------- (3) where t 0 = 0
In this equation (3), each t k value can be uniquely determined by fixing n and p. When the pulse interval time measurement is performed with a 16-bit length (0-65535), considering the number of significant digits after conversion, the data length to be replaced by the above threshold value must be about 8 bits long, and the effect of errors will be affected at short time intervals It cannot be ignored. Accordingly, p is set to 256, and the 0-65535 (16-bit length) section is converted to the 0-255 (8-bit length) section by the threshold value. When 16 bits are required as the bit length, it can be generated by connecting two pieces of 8-bit data.

この方法においてはn値が大きくなれば、出現時間間隔は相対的に小さくなり、時間間隔測定分解能を一定とした場合誤差が問題になる。逆にn値が小さくなると相対的に時間間隔は大きくなり、時間間隔測定分解能を一定とした場合上位数値において丸め誤差(オーバーフロー)が発生する。   In this method, when the n value increases, the appearance time interval becomes relatively small, and an error becomes a problem when the time interval measurement resolution is constant. Conversely, when the n value decreases, the time interval becomes relatively large, and when the time interval measurement resolution is constant, a rounding error (overflow) occurs in the upper numerical value.

そこで、n値の変動に関しては、時間計測の基本周期を変動させることで対応することにする。つまり計測されたn値が小さい場合には計測の基本周期を大きく、一方n値が大きい場合、計測の基本周期を小さくすることで、計測結果としての数値データの分布は常に一定になり、その後の演算処理回路の簡略化を行うことが出来る。また、時間計測の基本周期の変動は単位時間当たりの平均放出数にのみ依存するので、処理能力の観点で演算回路の動作スピードが間に合う範囲内で演算回路の基準動作周波数の変動も補正される。従って、演算回路のクロックを生成する発振回路の周波数の精度も要求されない。具体的には、
tk+1=−1/n *log(e-ntk−p) ---------(4) 但し t0=0
の式で、nの変動成分をmとし、n=n×mとすると、
tk+1=−1/nm*log(e-nmtk−p)----------(5) 但し t0=0
となる。ここで、計測時間の基本周期をmに応じて変動させる(tk=tl/m)ことで
tl+1=−1/n *log(e-ntl−p) ---------(6) 但し t0=0
となり、基本演算式がそのまま適用できる。
Therefore, the fluctuation of the n value is dealt with by changing the basic period of time measurement. In other words, when the measured n value is small, the basic period of measurement is increased. On the other hand, when the n value is large, by decreasing the basic period of measurement, the distribution of numerical data as a measurement result is always constant. The arithmetic processing circuit can be simplified. In addition, since fluctuations in the basic period of time measurement depend only on the average number of releases per unit time, fluctuations in the reference operating frequency of the arithmetic circuit are also corrected within a range where the operation speed of the arithmetic circuit is in time from the viewpoint of processing capability . Therefore, the accuracy of the frequency of the oscillation circuit that generates the clock of the arithmetic circuit is not required. In particular,
t k + 1 = −1 / n * log (e -ntk −p) --------- (4) where t 0 = 0
In the equation, when the fluctuation component of n is m and n = n × m,
t k + 1 = −1 / nm * log (e -nmtk −p) ---------- (5) where t 0 = 0
It becomes. Here, by changing the basic period of measurement time according to m (tk = tl / m)
t l + 1 = −1 / n * log (e -ntl −p) --------- (6) where t 0 = 0
Thus, the basic arithmetic expression can be applied as it is.

演算回路で使用する動作周波数を25MHz程度とすると、基本サイクルクロックは40nSであり、仮にn値を10とすると平均のパルス間隔は100mS、それを計測基本周期を100μSとして計測すると考えると、計測基本周期を作り出す分周数は100μS/40nS=2500カウントとなる。従って上記変動値mの最小値(分解能)は、0.4/100=0.004(0.4%)となり、n値の変動に対する計測基準時間の変動の分解能は問題ない。   If the operating frequency used in the arithmetic circuit is about 25 MHz, the basic cycle clock is 40 nS. If the n value is 10, the average pulse interval is 100 mS, and the measurement basic period is 100 μS. The frequency dividing number for generating the period is 100 μS / 40 nS = 2500 counts. Therefore, the minimum value (resolution) of the fluctuation value m is 0.4 / 100 = 0.004 (0.4%), and there is no problem with the resolution of the fluctuation of the measurement reference time with respect to the fluctuation of the n value.

この方式で256値を得るために必要な測定時間はnが小さいほど大きくなる、たとえば、n=4の場合の255番目の閾値は1.386秒、n=3のときは1.848秒、n=2のときは2.773秒となり、最大この時間まではカウントしなければならない。それ以上の時間幅は時間計測データの最大値(65535)に丸め込むことができる。(丸め込んでも最大データ255の出現頻度は変わらない)従って、計測のmax値はn値により変動することになる。
次に確率の作成方法を記載する。
In this method, the measurement time required to obtain 256 values increases as n decreases. For example, the 255th threshold value is 1.386 seconds when n = 4, 1.848 seconds when n = 3, and n = 2. Sometimes it becomes 2.773 seconds and you have to count up to this time. The time width longer than that can be rounded to the maximum value (65535) of the time measurement data. (The appearance frequency of the maximum data 255 does not change even when rounding is performed.) Therefore, the max value of the measurement varies depending on the n value.
Next, a method for creating a probability is described.

自然崩壊を使用した確率は、(1)式で求めることが出来る。(1)式は
p = e-nt1−e-nt2 ---------------(7)
であるから、発生すべき確率値を満たすt1とt2を定め、その間にパルスが入っているか否かを判定すれば良い。ここでt2を無限大とすると、2項目のe-nt2は0となり無視でき、計測された時間幅をt1と比較することで当りの判定が出来る。t2を無限大とすることで、e-ntの出現頻度が小さい領域を使用することになるため、分解能は広く取ることが出来る。従って、確率計算時の丸め誤差も最小にすることが出来る。
The probability of using natural decay can be calculated by equation (1). (1)
p = e -nt1 -e -nt2 --------------- (7)
Therefore, it is only necessary to determine t 1 and t 2 that satisfy the probability value to be generated and determine whether or not there is a pulse between them. Here, when the t 2 and infinity, two items of e -NT2 is negligible 0, measured time width can determined per by comparing t 1. By setting t 2 to infinity, a region where the frequency of occurrence of e -nt is small is used, so that the resolution can be widened. Therefore, the rounding error during probability calculation can be minimized.

t2を無限大としたときの式
p = e-nt1 ------------------------(8)
の両辺に対し対数をとり、t1を求めると
t1=−log(p)/n --------------------(9)
となり、t1の値は設定確率値(p)と一秒あたりのパルス数(n)から求めることが出来る。
Formula when t 2 is infinite
p = e -nt1 ------------------------ (8)
Taking the logarithm of respect to both sides, and seek t 1
t 1 = -log (p) / n -------------------- (9)
Thus, the value of t 1 can be obtained from the set probability value (p) and the number of pulses per second (n).

この場合でもn値の変動により、必要とされる計測時間が変動し、特に確率値が小さい場合、長時間の計測を有効にしておく必要がある。そこで、前記一様乱数の演算と同様に測定の基本周期を変動させることにより、カウンタのオーバーフローや精度不足の問題を解決できる。但し、この方法においては、非常に微小な確率値まで対応できるが、確率値が小さい場合、計測のmax値は大きくなり計測時間が長くなる場合が発生する。しかし、演算回路部に過去の計測値を記憶しておく機構を設けることにより、レスポンス時間の問題は回避できる。   Even in this case, the required measurement time varies due to the fluctuation of the n value, and particularly when the probability value is small, it is necessary to enable long-time measurement. Therefore, the problem of counter overflow and insufficient accuracy can be solved by changing the measurement basic period in the same manner as the calculation of the uniform random number. However, this method can handle very small probability values, but if the probability value is small, the maximum value of measurement may increase and the measurement time may increase. However, the problem of response time can be avoided by providing a mechanism for storing past measurement values in the arithmetic circuit unit.

上記の(9)式、t1=−log(p)/nは、外部より確率値の設定が行われたときに演算しておけば良く、計測時には演算は発生しない。従って、演算時間が多少かかっても実動作に及ぼす影響は非常に小さい。設定確率値に柔軟に対処し、さまざまな確率値を外部からの入力により選定できるようにするために、上記の対数演算は計算を省略する為のテーブルを使用せず、マイコンで計算させることが出来る。 The above equation (9), t 1 = −log (p) / n, may be calculated when a probability value is set from the outside, and no calculation occurs during measurement. Therefore, even if the calculation time takes some time, the influence on the actual operation is very small. In order to flexibly deal with the set probability value and select various probability values by external input, the above logarithmic calculation can be calculated by a microcomputer without using a table for omitting the calculation. I can do it.

次に、基本周期を変動させる為のn値に対する基準計測時間の設定について記載する。
p=e-nt1−e-nt2 ---------------------(7)
において、t0を0とし、閾値の最大値(255)の時間間隔は
p=255/256=1−e-nt255
より、
t255=−(1/n)*log(1/256)=5.545177/n ------------(10)
で求めることが出来る。
Next, the setting of the reference measurement time for the n value for changing the basic period will be described.
p = e −nt1 −e −nt2 --------------------- (7)
T 0 is 0, and the time interval of the maximum threshold value (255) is p = 255/256 = 1−e −nt255
Than,
t 255 =-(1 / n) * log (1/256) = 5.545177 / n ------------ (10)
Can be obtained.

多少余裕をみて、上記255番目の閾値+5%を16ビットタイマがオーバーフローする時間と設定することにすると16ビットタイマでカウントできる最大時間間隔は
tmax=5.545177*1.05/n=5.822436/n ---------------(11)
となり、これよりタイマのカウント基準クロックの周期は
tclk=(5.822436/65536)/n=88.84333μS/n となる。
演算回路の基本動作周波数を25MHzとすると、システムクロックの周期は
tsys=40 nS
であり、上記タイマの基準クロックtclkを作り出すためのプリスケーラの値は、
tpres=(88843.33/40.816)/n=2176.7/n となる。
If we set the 255th threshold + 5% as the time when the 16-bit timer overflows, with some margin, the maximum time interval that can be counted by the 16-bit timer is
t max = 5.545177 * 1.05 / n = 5.822436 / n --------------- (11)
From this, the cycle of the timer count reference clock is
t clk = (5.822436 / 65536) /n=88.84333 μS / n.
If the basic operating frequency of the arithmetic circuit is 25 MHz, the system clock cycle is
t sys = 40 nS
And the value of the prescaler for generating the reference clock t clk of the timer is
t pres = (88843.33 / 40.816) /n=2176.7/n.

上記のように、nの値に応じてタイマのカウント基準周期を変動させることにより、一様乱数生成のための閾値を求めるには(4)式を使用すればよく
tk+1=−1/n*log(e-ntk−p) 但し t0=0
上式において、n=5.822436の場合の各tkを計算すると、1から255までの閾値が算出でき、下記の表のようになる。
As described above, equation (4) can be used to obtain a threshold value for uniform random number generation by varying the timer count reference period in accordance with the value of n.
t k + 1 = −1 / n * log (e -ntk −p) where t 0 = 0
In the above equation, when each t k is calculated when n = 5.822436, threshold values from 1 to 255 can be calculated, as shown in the following table.

Figure 0004804815
Figure 0004804815

Figure 0004804815
この表のデータを閾値として、計測データがどの閾値間に入るかを求めれば、その結果が8ビット長の一様乱数となる。
Figure 0004804815
If the data in this table is used as a threshold value to determine which threshold value the measurement data falls between, the result is a uniform random number with a length of 8 bits.

計測データがどの閾値間にはいるかを求める方法としては2通りの方法がある。ひとつは計測完了後に二分探索により大小比較を行う方法。もうひとつは計測の過程で、現在の計測値がどのエリアに入っているかをチェックする方法である。それぞれについて以下に示す。   There are two methods for determining which threshold value the measurement data is between. One is a method of comparing magnitudes by binary search after measurement is completed. The other is a method of checking which area the current measurement value is in during the measurement process. Each is shown below.

二分探索法
今回の変換は計測データ16ビット、変換後のデータが8ビット長となるので二分探索には絶好の条件であり、プログラムは非常に簡略化できる。以下に本案件に特化したアルゴリズムの例を示す。
BitIndicator=10000000b;
Result=BitIndicator;
Repeat
If MeasuredValue<DataTable(Result) then Result=Result xor BitIndicator;
BitIndicator=RightLotate(BitIndicator, 1bit);
Result=Result xor BitIndicator;
Until BitIndicator. bit7=“1”;
この変換では、16ビット長の比較とビット処理(xor)、及びデータテーブルの参照を8回行う。
Binary search method This conversion is 16-bit measurement data, and the converted data is 8 bits long, which is a perfect condition for binary search, and the program can be greatly simplified. The following are examples of algorithms specialized for this project.
BitIndicator = 10000000b;
Result = BitIndicator;
Repeat
If MeasuredValue <DataTable (Result) then Result = Result xor BitIndicator;
BitIndicator = RightLotate (BitIndicator, 1bit);
Result = Result xor BitIndicator;
Until BitIndicator. Bit7 = "1";
In this conversion, 16-bit comparison, bit processing (xor), and data table reference are performed eight times.

計測過程での判定
上記の閾値テーブルは、0から255の順番で数値が大きくなっている。そのため、パルス間隔を計測するごとに、データテーブルとの比較を行うことにより、処理は非常に単純化され、また、計測完了時(次パルス)が来た時点で一様乱数化の変換は完了していることになり、レスポンスも非常に良くなる。上述の二分探索を用いる方法のように、ある一定時間を演算処理に拘束されることもない。演算処理にマイコンなどを使用する場合には有効に働く可能性がある。具体的なアルゴリズムは以下のようになる。
この方式の場合、上記テーブルの1-255のデータは0-254に格納されている事とする。
<初期処理>
Result=0; テーブルの先頭
<プリスケーラオーバーフロー毎に>
if MeasuredValue=DataTable(Result) then Result=Result+1;
このように極めて、単純なやり方であり、閾値の検索処理が分散して行われるため、演算処理部の処理能力に対する負荷も非常に小さい。
Judgment in the measurement process The threshold value table has a numerical value increasing in the order of 0 to 255. Therefore, each time the pulse interval is measured, comparison with the data table makes the process very simple, and the conversion to uniform randomization is completed when the measurement is completed (next pulse). The response will be very good. Unlike the method using the binary search described above, a certain period of time is not restricted by the arithmetic processing. When a microcomputer is used for arithmetic processing, it may work effectively. The specific algorithm is as follows.
In this method, it is assumed that data 1-255 of the above table is stored in 0-254.
<Initial processing>
Result = 0; top of table <every prescaler overflow>
if MeasuredValue = DataTable (Result) then Result = Result + 1;
In this way, the processing is extremely simple and the threshold value search processing is performed in a distributed manner, so the load on the processing capability of the arithmetic processing unit is also very small.

次に、本発明に係る一様乱数及び確率を発生するデバイス/方法における処理手順の一例を、より詳細に説明する。   Next, an example of a processing procedure in the device / method for generating uniform random numbers and probabilities according to the present invention will be described in more detail.

ここで説明する方法は、通常(スタンドアロン)・モード、デモ・モード及びマルチモジュール・モードの3つのモードを有し、以下の特徴を持つ。   The method described here has three modes, a normal (stand-alone) mode, a demo mode, and a multi-module mode, and has the following features.

通常モードは、ホストと1対1で接続するモードで、パルスの計測ごとに指数分布乱数列及び一様乱数列を出力し、確率判例読み出しコマンドの入力に応じ確率判定結果を出力する。デモ・モードは、デモ用に用意されたモードで、パルスの計測ごとに指数分布乱数列、一様分布乱数列、確率判定結果を出力する。マルチ・モードは複数個のモジュールの接続が可能で、乱数の生成速度を早くすることができ、指数分布乱数列、一様分布乱数列、確率判定結果は、それぞれコマンド入力に応じて出力される。   The normal mode is a one-to-one connection mode with the host, and outputs an exponential distributed random number sequence and a uniform random number sequence for each pulse measurement, and outputs a probability determination result in response to an input of a probability case read command. The demo mode is a mode prepared for demonstration, and outputs an exponential distribution random number sequence, a uniform distribution random number sequence, and a probability determination result for each pulse measurement. Multi-mode allows multiple modules to be connected, increasing the speed of random number generation, and exponential distribution random number sequence, uniform distribution random number sequence, and probability judgment result are output according to command input, respectively .

図10A乃至10Cは、本発明のデバイス/方法を、マイコンを使用して処理する場合の動作(アルゴリズム)の一例を示すフロー・チャートである。   10A to 10C are flowcharts showing an example of an operation (algorithm) when the device / method of the present invention is processed using a microcomputer.

まず、図10Aに示すように、RAMのクリア、各種レジスタの初期設定、フラッシュ・メモリのデフォルト値の呼び出し等の初期化作業を行い、メイン・ルーチンに飛ぶ。 First, as shown in FIG. 10A, initialization operations such as clearing of RAM, initial setting of various registers, and calling of default values of the flash memory are performed, and the process jumps to the main routine.

メイン・ルーチンでは、まず、処理されていない新規計測時間データが在るか否か調べる(ステップS110)、在れば、マルチ・モードでないことを条件に(ステップS120)、そのデータを呼び出す(S130)。次いで、パルス間時間(パルス時間間隔、パルス・インターバル)計測用タイマのプリスケーラ値を設定し(ステップS140)、タイマをクリアする(ステップS150)。RPGパルスを検知すると(ステップS160)そのタイマをスタートさせ(ステップS170)、RPGパルスを検知する毎に(ステップS180)、タイマから計測値を出力し(ステップS190)、指数分布乱数値として格納する(ステップS200)。次いで、一様分布乱数に変換し(ステップS210)、確率(あたり・はずれ)の判断を行う(ステップS220)。次いで動作モードがデモ・モードか否か判断し(ステップS230)、デモ・モードであれば、無条件で(乱数出力の選択の有無にかわわらず)指数分布乱数をホストに送信し(ステップS260)、かつ一様分布乱数を送信し(ステップS270)、また確率判定値を送信する(ステップ280)。   In the main routine, first, it is checked whether or not there is new measurement time data that has not been processed (step S110). If there is, the data is called on the condition that it is not the multi mode (step S120) (S130). ). Next, the prescaler value of the timer for measuring the time between pulses (pulse time interval, pulse interval) is set (step S140), and the timer is cleared (step S150). When an RPG pulse is detected (step S160), the timer is started (step S170), and each time an RPG pulse is detected (step S180), a measured value is output from the timer (step S190) and stored as an exponential distribution random value. (Step S200). Next, it is converted into a uniformly distributed random number (step S210), and the probability (hit and miss) is determined (step S220). Next, it is determined whether or not the operation mode is the demo mode (step S230). If the operation mode is the demo mode, the exponential distribution random number is transmitted unconditionally (regardless of whether or not the random number output is selected) to the host (step S260). Then, a uniformly distributed random number is transmitted (step S270), and a probability determination value is transmitted (step 280).

デモ・モードでないとき(即ち、通常モードのとき)、指数分布乱数の出力が選択されているとき(ステップS240)に送信し、また一様分布乱数の出力が選択されているとき(ステップS250)に送信する。   When not in the demo mode (that is, in the normal mode), transmission is performed when the output of the exponential distribution random number is selected (step S240), and when the output of the uniform distribution random number is selected (step S250) Send to.

一方CPS値(パルス数)の計測は、図10Bに示すように、まず、デフォルト値が設定され(ステップS310)、RPGパルスを検知すると(ステップS320)、CPS計測時間設定用タイマを初期化し(ステップS330)、計測時間を設定する(ステップS340)。次いで、パルス数カウンタをクリアし(ステップS350)、RPGを検知する毎に(ステップS360)、その計測値を積算する(ステップS370)。これは設定計測時間(例えば64秒、1時間等)になるまで繰り返される。計測設定時間になると(ステップS380)、設定計測時間のCPS値を計算し(ステップS390)、またパルス時間間隔(パルス・インターバル)計測用基準時間を算出する(ステップS400)。次いで新CPSデータをフラッシュ・メモリに書き込み(ステップS410)、計測を再開始する(ステップS420)。   On the other hand, in the measurement of the CPS value (number of pulses), as shown in FIG. 10B, first, a default value is set (step S310), and when an RPG pulse is detected (step S320), a CPS measurement time setting timer is initialized ( Step S330) and a measurement time are set (Step S340). Next, the pulse number counter is cleared (step S350), and each time RPG is detected (step S360), the measured values are integrated (step S370). This is repeated until the set measurement time (for example, 64 seconds, 1 hour, etc.) is reached. When the measurement set time is reached (step S380), the CPS value of the set measurement time is calculated (step S390), and the pulse time interval (pulse interval) measurement reference time is calculated (step S400). Next, new CPS data is written to the flash memory (step S410), and measurement is restarted (step S420).

なお、図10A及び図10Bに示した計測処理は、同時並行で行われ、またパルス間時間(パルス・インターバル)の計測は、全パルス間で行われる。   Note that the measurement processes shown in FIGS. 10A and 10B are performed simultaneously in parallel, and the time between pulses (pulse interval) is measured between all pulses.

本発明の実施例では、図10Cに示す如く、シリアルデータ(コマンド)を受信すると(ステップS500)、新データがあるときのみ、コマンド処理ルーチンを起動させている(ステップS510)。   In the embodiment of the present invention, as shown in FIG. 10C, when serial data (command) is received (step S500), the command processing routine is started only when there is new data (step S510).

コマンド処理ルーチンは、後述する処理手順(アルゴリズム)の詳細を記載したプログラムに記載するように、動作条件設定コマンドの処理、内部ステータス読み出しコマンドの処理、確率設定コマンドの処理、動作モードコマンドの処理、モジュールアドレスと指定アドレスの比較処理等が行われる。   The command processing routine includes an operation condition setting command process, an internal status read command process, a probability setting command process, an operation mode command process, as described in a program that describes details of a process procedure (algorithm) described later. The module address and designated address are compared.

以下に示すプログラムは、本発明に係る一様乱数及び確率を発生する方法をマイコンを使用して処理する場合の、マイコン内部の処理アルゴリズムを記載したものである。
The program shown below describes the processing algorithm inside the microcomputer when the method for generating uniform random numbers and probabilities according to the present invention is processed using the microcomputer.

<マイコン内部の処理アルゴリズム>
マイクロコンピュータ: C8051F330
動作周波数: 24.5MHz
システム・クロック: 1/1

1.ポート割当て、割込み機能

P0.0 : パルス入力
P0.4 : シリアル出力
P0.5 : シリアル入力
P1.3 : LED出力

外部割込み0 : パルスの入力検知
タイマ1 : UARTの転送レート生成
タイマ2 : パルス間時間計測に使用
: CPSによってプリスケーラ値を変更
タイマ3 : 一定時間(CPS計測時間)作成用
シリアル割込み: データ受信で使用
<Processing algorithm inside microcomputer>
Microcomputer: C8051F330
Operating frequency: 24.5MHz
System clock: 1/1

1. Port assignment, interrupt function

P0.0: Pulse input
P0.4: Serial output
P0.5: Serial input
P1.3: LED output

External interrupt 0: Pulse input detection Timer 1: UART transfer rate generation Timer 2: Used to measure time between pulses
: Change the prescaler value by CPS Timer 3: For creating a fixed time (CPS measurement time) Serial interrupt: Used for data reception

2.タイマ

タイマ0: Not used
タイマ1: RS232Cの Baud Rate Generator
Timer1 Condition {
pre-scale = 1/1
8 bit Reload Mode
Reload Value = 96h

タイマ2: パルスカウント用プリスケーラ
Timer2 Condition {
16 bit Reload Mode
pre-scale = 1/1
Reload Value = tpres

タイマ3: CPSカウント用タイマ
Timer3 Condition {
16 bit Reload mode
Pre-scale = 1/12
Reload Value = 40833 ; Overflow = 20 mS

PCA: (1)Watch Dog Timer
2. Timer

Timer 0: Not used
Timer 1: RS232C Baud Rate Generator
Timer1 Condition {
pre-scale = 1/1
8 bit Reload Mode
Reload Value = 96h
}
Timer 2: Prescaler for pulse count
Timer2 Condition {
16 bit Reload Mode
pre-scale = 1/1
Reload Value = t pres
}
Timer 3: Timer for CPS count
Timer3 Condition {
16 bit Reload mode
Pre-scale = 1/12
Reload Value = 40833; Overflow = 20 mS
}
PCA: (1) Watch Dog Timer

3.メモリ

SerialBuffer(0..15) as M[8]; シリアル受信バッファ
IntervalTime(0..3) as M[17]; パルス計測時間内部格納バッファ
SerialWPointer as M[8]; 割込み処理ルーチンでシリアル受信データを受信バッ
ファに書き込む際に、書き込み位置を示すポインタ。
SerialRPointer as M[8]; メインルーチンでシリアル受信バッファ内の次に処理
すべきシリアルデータの位置を示すポインタ。
IntervalWPointer as M[8];割込み処理ルーチンでパルス計測時間を次に書き込
む位置を示すポインタ。
IntervalRPointer as M[8];メインルーチンで次に処理すべきパルス計測時間の
バッファ内の位置を示すポインタ。

IntervalCounter as M[17]; 割込み処理ルーチン内でパルス時間間隔をカウント
するカウンタ。
CPSSecCounter as M[8]; 1秒カウント (25回×20mS)
CPSTimeCounter as M[8]; 64秒カウント
CPSCounter as M[16]; CPS値カウンタ
CPS as M[16]; CPS値
Prob(0..7) as M[16]; 確率設定値
PValue(0..7) as M[16]; 確率対数演算後の閾値
PSetting as M[16]; 確率設定入力値
PArg as M[8]; 確率設定引数
BEXP as M[8]; 対数計算時の被演算値の指数部
CycleCounter as M[8]; 演算部で使用、繰り返し回数のカウンタ
BitIndicator as M[8]; 除算演算で使用
NOPTimeCount as M[8]; 1時間当たりのパルス数計測カウンタ
RandomEXP as M[24]; 指数分布乱数値の最終結果
UniformedData as M[8]; 一様分布乱数地の最終結果
CPSForceData as M[16]; CPS強制設定値
CPSMeasureTime as M[8]; CPS計測時間の設定値
NumberOfPulse as M[24]; 1時間当りのパルス数
CPSReadOut as M[16]; CPS計測値を割込みからメインに渡す領域
CPSACTimeCount as M[8]; CPS積算回数のカウント
CPSAccumulation as M[24]; CPS計測時間読出し積算バッファ
; 64秒間の計測値を設定計測時間になるまで積算
LastCPSAccumulation as M[24]; CPS計測時間の過去メモリ
NOPCountBuffer as M[24]; 1時間パルス数計測バッファ
NumberOfNewData as M[8]; シリアル受信未処理データ数

; ビットエリア

InternalFlag as M[8] ={
CPSDetected as M[1] ;CPS カウント終了フラグ
LogASignMinus as M[1] ;Log(A)の符号
CountRestartF as M[1] ;カウント再開
DataFlip as M[1] ;一様乱数折り返し
NOPCaptureF as M[1] ;一時間計測完了
SerialReceived as M[1] ;シリアル受信フラグ
CPSForceF as M[1] ;bit7 : CPS強制設定


OperationMode as M[8] ={ ; 動作モード
UniformDataOutF as M[1] ;一様分布乱数出力
EXPDataOutF as M[1] ;指数分布乱数出力
DemoModeF as M[1] ;デモモード
MultiModeF as M[1] ;マルチモード


StatusFlag as M[8] ={ ; エラーステータス
CPSTooLittleF as M[1] ;CPS無検出
CPSTooManyF as M[1] ;CPS過多検出
IntervalTimeOF as M[1] ;計測値バッファオーバーフロー
SerialBufferOF as M[1] ;シリアルバッファオーバーフロー


ProbFlag as M[8] ={ ; 確率判定(当り/はずれ)
PJudge0 as M[1] ;確率番号0の判定
PJudge1 as M[1] ;確率番号1の判定
PJudge2 as M[1] ;確率番号2の判定
PJudge3 as M[1] ;確率番号3の判定
PJudge4 as M[1] ;確率番号4の判定
PJudge5 as M[1] ;確率番号5の判定
PJudge6 as M[1] ;確率番号6の判定
PJudge7 as M[1] ;確率番号7の判定


InternalFlag1 as M[8] ={ ;内部フラッグ

AddressExist as M[1] ;マルチモードでアドレス有り
AddressSelected as M[1];マルチモードでアドレス選択されたとき


; 定数

CPSMAX as #100*64 / 1秒間に100パルス以上
CPSMIN as #1*64 / 1秒間に1パルス以下
ConstEXPData as #01h
ConstUniformedData as #02h
ConstSecCount as #50
ConstTimeCount as #64
ConstNOPCount as #56
SAck as #05h
SNak as #50h
ConstSPFilter as #10101111b
ConstITFilter as #11001111b
3. memory

SerialBuffer (0..15) as M [8]; Serial receive buffer
IntervalTime (0..3) as M [17]; Buffer for storing pulse measurement time
SerialWPointer as M [8]; Pointer that indicates the write position when serial receive data is written to the receive buffer in the interrupt processing routine.
SerialRPointer as M [8]; Pointer to the position of the next serial data to be processed in the serial receive buffer in the main routine.
IntervalWPointer as M [8]; Pointer to the position where the pulse measurement time is written next in the interrupt processing routine.
IntervalRPointer as M [8]; Pointer to the position in the buffer of the pulse measurement time to be processed next in the main routine.

IntervalCounter as M [17]; Counter that counts the pulse time interval in the interrupt processing routine.
CPSSecCounter as M [8]; 1 second count (25 times x 20mS)
CPSTimeCounter as M [8]; 64 seconds count
CPSCounter as M [16]; CPS counter
CPS as M [16]; CPS value
Prob (0..7) as M [16]; Probability setting
PValue (0..7) as M [16]; Threshold after probability logarithm operation
PSetting as M [16]; Probability setting input value
PArg as M [8]; Probability setting argument
BEXP as M [8]; Exponent part of operand in logarithmic calculation
CycleCounter as M [8]; Used in the arithmetic unit, counter for the number of repetitions
BitIndicator as M [8]; Used in division operation
NOPTimeCount as M [8]; Counter for measuring the number of pulses per hour
RandomEXP as M [24]; Final result of exponential random numbers
UniformedData as M [8]; Final result for uniformly distributed random numbers
CPSForceData as M [16]; CPS forced setting value
CPSMeasureTime as M [8]; Set value of CPS measurement time
NumberOfPulse as M [24]; Number of pulses per hour
CPSReadOut as M [16]; Area for passing CPS measurement value from interrupt to main
CPSACTimeCount as M [8]; Count of CPS integration count
CPSAccumulation as M [24]; CPS measurement time readout integration buffer
; Accumulate the measured value for 64 seconds until the set measurement time is reached
LastCPSAccumulation as M [24]; Past memory of CPS measurement time
NOPCountBuffer as M [24]; 1 hour pulse count buffer
NumberOfNewData as M [8]; Number of serial received raw data

; Bit area

InternalFlag as M [8] = {
CPSDetected as M [1]; CPS count end flag
LogASignMinus as M [1]; Sign of Log (A)
CountRestartF as M [1]; Count restart
DataFlip as M [1]; Uniform random number wrapping
NOPCaptureF as M [1]; 1 hour measurement completed
SerialReceived as M [1]; Serial reception flag
CPSForceF as M [1]; bit7: CPS forced setting}

OperationMode as M [8] = {; Operation mode
UniformDataOutF as M [1]; Uniformly distributed random number output
EXPDataOutF as M [1]; Exponential distribution random number output
DemoModeF as M [1]; Demo mode
MultiModeF as M [1]; Multi mode
}

StatusFlag as M [8] = {; Error status
CPSTooLittleF as M [1]; No CPS detected
CPSTooManyF as M [1]; CPS excess detection
IntervalTimeOF as M [1]; Measurement value buffer overflow
SerialBufferOF as M [1]; Serial buffer overflow}

ProbFlag as M [8] = {; Probability judgment (win / fail)
PJudge0 as M [1]; Judgment of probability number 0
PJudge1 as M [1]; Judgment of probability number 1
PJudge2 as M [1]; Judgment of probability number 2
PJudge3 as M [1]; Judgment of probability number 3
PJudge4 as M [1]; Judgment of probability number 4
PJudge5 as M [1]; Judgment of probability number 5
PJudge6 as M [1]; Judgment of probability number 6
PJudge7 as M [1]; Judgment of probability number 7}

InternalFlag1 as M [8] = {; Internal flag

AddressExist as M [1]; Multi mode with address
AddressSelected as M [1]; When address is selected in multi-mode}

; Constant

CPSMAX as # 100 * 64/100 pulses or more per second
CPSMIN as # 1 * 64/1 pulse or less per second
ConstEXPData as # 01h
ConstUniformedData as # 02h
ConstSecCount as # 50
ConstTimeCount as # 64
ConstNOPCount as # 56
SAck as # 05h
SNak as # 50h
ConstSPFilter as # 10101111b
ConstITFilter as # 11001111b

4.Initial処理

/ Initial 処理 /
R0 = 00h; RAM クリア
Repeat
RAM(R0) = 00h
R0 += 1
until R0=0;
SerialWPointer = #SerialBuffer; バッファの先頭アドレスを設定
SerialRPointer = #SerialBuffer;
IntervalWPointer = #IntervalTime; バッファの先頭アドレスを設定
IntervalRPointer = #IntervalTime;
NOPTimeCount = #ConstNOPCount;
InitializeSFR; 8051SFRの設定
LoadFlashData; フラッシュ部のデータ読出し。初回はデフォルト値が読み出される
CalcTPreScaler; Timer2のプルスケール値の演算、および設定
CountRestart; 計測再開のためのメモリ初期化、割込み許可
jump to Main;

/ InitializeSFR /
p0.4 = OutputMode;
P1.3 = OutputMode;
Timer1 = Timer1Condition;
Timer2 = Timer2Condition;
Timer3 = Timer3Condition;
PCA = PCACondition;
Timer2INTEnable = true;
Timer3INTEnable = true;

/ LoadFlashData / ; フラッシュメモリに書き込まれたデータの読出し
; デフォルト値はあらかじめフラッシュデータ部に
; 書き込んで置く。
CPS = FlashCPS;
CPSMeasureTime = FlashCPSMT;
NumberOfPulse = FlashNofP;
StatusFlag = FlashStatus;
OperationMode = FlashOPMode;
LastCPSAccumulation = FlashLastCPSAccumulation;
PROB(o..7) = FlashPROB(0..7);
Pvalue(0..7) = FlashPT(0..7);
4). Initial processing

/ Initial processing /
R0 = 00h; Clear RAM
Repeat
RAM (R0) = 00h
R0 + = 1
until R0 = 0;
SerialWPointer = #SerialBuffer; Set the buffer start address
SerialRPointer = #SerialBuffer;
IntervalWPointer = #IntervalTime; Set the buffer start address
IntervalRPointer = #IntervalTime;
NOPTimeCount = #ConstNOPCount;
InitializeSFR; 8051SFR setting
LoadFlashData; Reads data from the flash unit. The default value is read for the first time
CalcTPreScaler; Calculation and setting of pull scale value of Timer2
CountRestart; Memory initialization and interrupt enable for measurement restart
jump to Main;

/ InitializeSFR /
p0.4 = OutputMode;
P1.3 = OutputMode;
Timer1 = Timer1Condition;
Timer2 = Timer2Condition;
Timer3 = Timer3Condition;
PCA = PCACondition;
Timer2INTEnable = true;
Timer3INTEnable = true;

/ LoadFlashData /; Read data written to flash memory
; The default value is stored in the flash data section
; Write and put.
CPS = FlashCPS;
CPSMeasureTime = FlashCPSMT;
NumberOfPulse = FlashNofP;
StatusFlag = FlashStatus;
OperationMode = FlashOPMode;
LastCPSAccumulation = FlashLastCPSAccumulation;
PROB (o..7) = FlashPROB (0..7);
Pvalue (0..7) = FlashPT (0..7);

5.メインルーチン

ConstEXPData as “01h”;
ConstUniformedData as “02h”;

Repeat
if IntervalWPointer<>IntervalRPointer then /処理されていない新規計測
/時間データはあるか?
if not(MultiModeF) then /マルチモードでは処理しない
ReadIntervalTime; /新計測時間の読出し
ConvertToUniform; /一様分布乱数への変換
CalcProb; /確率(あたり/はずれ)のジャッジ
if DemoMode
then /デモモード中は無条件に送信
SendRandomEXP; /指数分布乱数の送信
SendRandomUniform; /一様分布乱数の送信
SendPJudge; /確率判定値の送信
else /通常モードでは乱数出力が選択されている時のみ送信
if EXPDataOutF then SendRAndomEXP;
if UniformDataOutF then SendRAndomUniform;
endif
endif
endif
if CPSDetected then
CPSDetected = false; /CPS値の計測(64秒)が終わった時の処理
AccumulateCPS; /計測時間の設定値になるまで
/64秒間のCPS値を積算していく
CPSACTimeCount -= 1;
if CPSACTimeCount=0 then /計測設定時間になった場合
CalcCPS; /CPS値を16秒間の平均値に変換
if not(CPSForceF) then CalcTPeScaler; /プリスケーラ値の計算
WriteToFlash; /新CPSデータをフラッシュに書き込み
CountRestart; /計測の再開始
endif;
endif
if NumberOfNewData<>0 then CommandHandling; /シリアルデータの受信
/ 新データがある時のみ、コマンド処理ルーチンを起動
endif
until forever;
5. Main routine

ConstEXPData as “01h”;
ConstUniformedData as “02h”;

Repeat
if IntervalWPointer <> IntervalRPointer then / New unprocessed measurement
Is there time data?
if not (MultiModeF) then / Do not process in multimode
ReadIntervalTime; / Read new measurement time
ConvertToUniform; / Conversion to uniformly distributed random numbers
CalcProb; / Probability (per / out) judge
if DemoMode
then / Unconditionally send in demo mode
SendRandomEXP; / Send exponential random numbers
SendRandomUniform; / Send uniformly distributed random numbers
SendPJudge; / Send probability judgment value
else / In normal mode, send only when random number output is selected
if EXPDataOutF then SendRAndomEXP;
if UniformDataOutF then SendRAndomUniform;
endif
endif
endif
if CPSDetected then
CPSDetected = false; Processing when measurement of CPS value (64 seconds) ends
AccumulateCPS; / until the measurement time is set
/ Accumulating CPS values for 64 seconds
CPSACTimeCount-= 1;
if CPSACTimeCount = 0 then / When the measurement set time is reached
CalcCPS; / CPS value converted to average value for 16 seconds
if not (CPSForceF) then CalcTPeScaler; / Calculate prescaler value
WriteToFlash; / Write new CPS data to flash
CountRestart; / Restart measurement
endif;
endif
if NumberOfNewData <> 0 then CommandHandling; / Receive serial data
/ Start command processing routine only when there is new data
endif
until forever;

6.割込み処理ルーチン

/ 外部割込み(INT0): パルス入力割込み(p0)、立上りEdge検出 /

if CountRestartF
then
CountRestartF = false; /計測再開時には計測タイマを開始するのみ
Start Timer2;
else
IntervalTime(IntervalWPointer) = IntervalCounter;
/計測結果を計測データバッファに書き込み
IntervalWPointer = (IntervalWPointer+1) and #ConstITFiler;
/ ポインタの更新
if IntervalWPointer=IntervalRPointer then IntervalTimeOF=true;
/ バッファオーバーフローチェック
IntervalCounter = 0;
CPSCounter +=1; /CPSカウンタのカウントアップ
endif
Return from Int;

/ Serial割込み /
if SerialReceiveINTF then /受信割込みの時のみ処理を行う。送信割込みは無視
SerialReceiveINTF = false;
SerialBuffer(SerialInputPointer) = SerialReceivedData;
/ シリアル受信データを受信バッファに書き込み
SerialWPointer = (SerialWPointer+1) and #ConstSPFilter;
/ シリアル書き込みポインタの更新
NumberOfNewData += 1;
if NumberOfNewData>=32 then SerialBufferOF=true;
/ バッファオーバーフローチェック
endif
Return from Int;

/ Timer2割込み /

IntervalCounter +=1; /パルス間時間計測カウンタのカウントアップ
Return from Int;

/ Timer3 割込み /
CPSSecCounter -= 1; /1秒のカウント
if CPSSecCounter = 0
then
CPSSecCounter = #ConstSecCount;
CPSTimeCounter -= 1; /64秒のカウント
if CPSTimeCounter=0
then
CPSTimeCounter = #ConstTimeCount;
CPSReadOut = CPSCounter;
/64秒経過したのでCPSカウント値の読出し
CPSCounter=0;
CPSDetected = true;
/ CPS検出フラグセット
end if
endif
Return form Int
6). Interrupt handling routine

/ External interrupt (INT0): Pulse input interrupt (p0), rising edge detection /

if CountRestartF
then
CountRestartF = false; / Only start the measurement timer when measurement restarts
Start Timer2;
else
IntervalTime (IntervalWPointer) = IntervalCounter;
/ Write measurement results to measurement data buffer
IntervalWPointer = (IntervalWPointer + 1) and #ConstITFiler;
/ Update pointer
if IntervalWPointer = IntervalRPointer then IntervalTimeOF = true;
/ Buffer overflow check
IntervalCounter = 0;
CPSCounter + = 1; / CPS counter count up
endif
Return from Int;

/ Serial interrupt /
if SerialReceiveINTF then / Process only at receive interrupt. Ignore transmission interrupts
SerialReceiveINTF = false;
SerialBuffer (SerialInputPointer) = SerialReceivedData;
/ Write serial receive data to receive buffer
SerialWPointer = (SerialWPointer + 1) and #ConstSPFilter;
/ Update serial write pointer
NumberOfNewData + = 1;
if NumberOfNewData> = 32 then SerialBufferOF = true;
/ Buffer overflow check
endif
Return from Int;

/ Timer2 interrupt /

IntervalCounter + = 1; / Count up the time measurement counter between pulses
Return from Int;

/ Timer3 interrupt /
CPSSecCounter-= 1; / 1 second count
if CPSSecCounter = 0
then
CPSSecCounter = #ConstSecCount;
CPSTimeCounter-= 1; / 64 seconds count
if CPSTimeCounter = 0
then
CPSTimeCounter = #ConstTimeCount;
CPSReadOut = CPSCounter;
/ CPS count value read out after 64 seconds
CPSCounter = 0;
CPSDetected = true;
/ CPS detection flag set
end if
endif
Return form Int

7.サブルーチン

/ CountRestart / パルス間時間計測を再開する。
/ CPSが更新されたとき、フラッシュへの書き込みが行われたとき、初期状態
CPSSecCounter = #ConstSecCounter;
CPSTimeCounter = #ConstTimeCount;
CPSACTimeCount = CPSMeasureTime;
CPSCounter = 0;
CPSAccumulation = 0;
IntervalCounter = 0;
CountRestartF = true;
CPSDetected = false;

/ ReadIntervalTime / 時間計測値のバッファから計測時間を読み出す
RandomEXP = IntervalTime(IntervalRPointer);
IntervalReadPointer = (IntervalReadPointer+4) and #ConstITFilter;

/ AccumulateCPS / CPS計測値の積算
/ 64秒毎の計測値を積算してゆき設定計測時間のCSP値を求める
/ 1時間毎のCSP計測値もここで求める
/ 1時間毎の計測値は64秒毎の計測値を56回積算し3584秒の積算値を求めた後
/ 次の64秒の計測値を1/4し、加える。(3584+64*0.25)=3600
CPSAccumulation = CPSAccumulation + CPSReadOut;
/ CPS値の積算 ここから1時間のパルス数の積算
if NOPCaptureF then CPSReadOut = CPSReadOut/4;
NOPCountBuffer = NOPCountBuffer + CPSReadOut;
if NOPCaptureF
then / 1時間の計測完了
NumberOfPulse = NOPCountBuffer;
NOPCaptureF = false;
if DemoModeF then SendNOP;
WriteToFlash;
CountRestart;
else
NOPTimeCount -= 1;
if NOPTimeCount=0 then
NOPCaptureF = true;
NOPTimeCount = #ConstNOPCount;
endif
endif

/ CalcCPS / 64秒間のCPS値の算出
CPSAccumulation = (CPSAccumulation + LastCPSAccumulation) / 2;
LastCPSAccumulation = CPSAccumulation;
Breg = CPSMeasureTime;
if Breg.bit0<>“1” then
repeat
CPSAccumulation = CPSAccumulation/2;
RightShift(b, 1bit);
until Breg.bit0=“1”;
endif;
CheckCPSMAXMIN; CPS値の最大、最小のチェック
if not(CPSTooLittleF or CPSTooManyF) then CPS = CPSAccumulation;
if DemoModeF then SendCPS;
WriteToFlash:
CountRestart;

/ CheckCPSMAXMIN /
/ CPS値が規定の範囲を超えていないかチェック
/ CPS値が大きすぎる場合、Timer2の割込み周期が非常に短くなり、
/ 常に割込みがかかった状態となって処理が廻らなくなるので注意必要。
Breg = #0;
If CPSAccumulation >= #CPSMAX then Breg.bit1 =“1”;
If CPSAccumulation < #CPSMIN then Breg.bit0 =“1”;
if StatusFlag<>Breg then
StatusFlag = Breg;
SendStatus;
endif;

/ SendRandomEXP / 指数分布乱数のシリアル出力
SerialOutput = #ConstEXPData;
if RandomEXP[23..16]=“0”
then
SerialOutput = RandonEXP;
Else
SerialOutput = #FFFFh;
endif

/ SendRandomUniform / 一様分布乱数のシリアル出力
SerialOutput = #ConstUniformData;
SerialOutput = UniformedData;

/ SendCPS / CPS値のシリアル出力
/ 内部ステータスの読出し時とデモモードでCPS値が変化した時
SerialOutput = #11h;
SerialOutput = CPS;

/ SendCPSMT / CPS計測時間のシリアル出力
/ 内部ステータスの読出し時
SerialOutput = #12h;
SerialOutput = CPSMeasureTime;

/ SendNOP / 1時間あたりのパルス数のシリアル出力
/ 内部ステータスの読出し時とデモモードで1時間当たりCPS値が変化した時
SerialOutput = #13h;
SerialOutput = NumberOfPulse;

/ SendStatus / ステータス情報のシリアル出力
/ 内部ステータス(CPSエラー)状態が変化した時と内部ステータスの読出し時
SerialOutput = #14h;
SerialOutput = StatusFlag;

/ SendVersion / バージョン情報のシリアル出力
/ 内部ステータスの読出し時
SerialOutput = #15h;
i = 0;
repeat
SerialOutput = FlashVer(i);
i += 1;
until FlashVer(i)=“FFh”;

/ SendProbSetting / 確率設定値のシリアル出力
/ 内部ステータスの読出し時
SerialOutput = SerialCommand;
SerialOutput = PROB(Command and “FFh”);

/ SendPJudge / 確率判定値のシリアル出力
/ 確率読出しコマンドを受信した時、デモモードではパルス入力毎に、内部ステータス
/ の読出しコマンドを受信したとき
SerialOutput = #28h;
SerialOutput = ProbFlag;

/ CalcProb / 指数分布乱数値からあたり/はずれの判定を行う
i = 0;
ProbFlag =“0”;
Repeat
if PValue(i)<=RandomEXP then ProbFlag[bit i] =“1”;
i += 1;
until i=“8”;

/ CommandHandling /. シリアルコマンドの処理
if (SerialBuffer(SerialRPointer) and“F0h”) =“00h”then /動作条件設定コマンド
if SerialBuffer(SerialRPointer) =“00h” then
/ アサインされていないコードを受信した場合NAKを返す
SendNAK;
exit;
endif
if SerialBuffer(SerialRPointer) =“01h” then /CPS値の強制設定?
if NumberOfNewData<3 then exit;
/ オペランド(設定データ)未受信の場合、何もしない。
RenewSRP;
if (MultiModeF and AddressExist and not(AddressSelected)
then
/ マルチモードでアドレスが一致しない場合コマンドを無視
RenewSRP;
SendNal;
Exit
else
RenewSRP;
CPSForceData = SerialBuffer(SerialRPointer);
/ CPS強制値の読出し
CPSForceF = true;
/ CPS強制フラグのセット
CalcTPrescaler;
/ プリスケーラ値の計算(強制データで)
RenewSRP;
SendAck;
endif
if SerialBuffer(SerialRPointer) =“02h” then /CPS強制設定解除
if (MultiModeF and AddressExist and not(AddressSelected)
then
/ マルチモードでアドレスが一致しない場合コマンドを無視
SendAck;
exit
else
CPSForceF = false;
/ CPS強制フラグのリセット
SendAck;
Exit
endif
if SerialBuffer(SerialRPointer) =“03h” then / CPS計測時間設定
if NumberOfNewData<2 then exit;
/ オペランド(設定データ)未受信の場合、何もしない。
RenewSRP;
if (MultiModeF and AddressExist and not(AddressSelected)
then
/ マルチモードでアドレスが一致しない場合コマンドを無視
SendAck;
Exit
else
/ CSP計測時間を読出し、設定
CPSMeasureTime = SerialBuffer(SerialRPointer);
WriteToFlash;
CountRestart;
SendAck;
Exit
endif
if SerialBuffer(SerialRPointer) =“0Fh” / 自己破壊
then
if NumberOfNewData<5 then exit;
/ オペランド(設定データ)未受信の場合、何もしない。
if (MultiModeF and AddressExist and not(AddressSelected)
then
/ マルチモードでアドレスが一致しない場合コマンドを無視
SerialRPointer += 4;
NumberOfNewData -=4;
RenewSRP;
exit
else
RenewSRP;
If SerialBuffer(SerialRPointer)=“86h,51h,29h,78h”
then
/ 正規データ列が受信された場合、フラッシュデータの消去
Destroy;
exit;
else
/ そうでない場合、コマンドを無視しNakを返送
SerialRPointer += 3;
NumberOfNewData -=3;
SendNAk;
exit
endif;
endif
else
SendNAK;
exit;
endif
endif
if (SerialBuffer(SerialRPointer) and“F0h”) =“10h”then /内部ステータス読出し
if SerialBuffer(SerialRPointer)=(“10h” or “16h” or “17h”) then
/ 無効データの場合Nakを返送
SendNak;
exit;
endif;
ACC = SerialBuffer(SerialRPointer
Sirent;
if (not(MultiModeF) or (AddressExist and AddressSelected))
then
/ スタンドアロンモードの時、およびマルチモードでアドレスが一致した場合
if ACC=“11h” then /CPS返送
SendCPS;
exit;
endif;
if ACC=“12h” then /CSP計測時間返送
SendCPSMT;
exit;
endif;
if ACC=“13h” then /1時間CPS値返送
SendNOP;
exit;
endif;
if ACC=“14h” then /ステータスデータ返送
SendStatus;
exit;
endif;
if ACC=“15h” then /バージョン返送
SendVersion;
exit;
endif;
SendProbSetting; /確率設定値返送
exit;
else
exit;
endif
endif
if (SerialBuffer(SerialRPointer) and “F0h”) =“20h” then /確率設定コマンド
if SerialBuffer(SerialRPointer)=“28h” then
/ 確率判定値の読出し
if (not(MultiModeF) or (AddressExist and AddressSelected))
/ then SendPJudge;
/スタンドアロンモード、およびマルチモードでアドレス一致した場合
/のみ確率判定値を返送
Sirent;
exit;
endif
if SerialBuffer(SerialRPointer)<“28h” then
if NumberOfNewData<3 then exit;
/ オペランド(設定データ)未受信の場合、何もしない。
if (MultiModeF and AddressExist and not(AddressSelected)
then
/ マルチモードでアドレスが一致しない場合コマンドを無視
SerialRPointer += 2;
NumberOfNewData -=2;
Sirent;
exit;
else
/ 確率設定値を設定する
PArg = SerialBuffer(SerialRPointer) and “00000111b”;
/ 確率番号の算出
RenewSRP;
PROB(PArg) = SerialBuffer(SerialRPointer);
/ 確率設定値の書き込み
RenewSRP;
CalcPThreshold;
/ 確率判定スレショルドの算出
WriteToFlash;
SendAck;
CountRestart;
exit;
endif;
endif
SendNak;
exit;
endif
if (SerialBuffer(SerialRPointer) and“F0h”) =“40h”then / 動作モードコマンド
if SerialBuffer(SerialRPointer)<“45h”
then
if (MultiModeF and AddressExist and not(AddressSelected))
then
/ マルチモードでアドレスが一致しない場合コマンドを無視
RenewSRP;;
AddressSelected = false;
AddressExist = false;
exit;
else
Breg = OperationMode;
OperationMode = SerialBuffer(SerialRPointer)and“00000111b”;
if Breg<>OperationMode then
/ 動作モード設定に変化があったとき
WriteToFlash;
CountRestart;
endif;
SendAck;
exit;
endif
else
SendNak;
exit;
endif
endif
if SerialBuffer(SerialRPointer) =“7Fh” then MultiModeF = true;
if SerialBuffer(SerialRPointer) =“7Eh” then MultiModeF = false;
if SerialBuffer(SerialRPointer) = (“7Eh” or “7Fh”) then
/ マルチモードコマンド受信処理
WriteToFlash;
CountRestart;
Sirent;
exit;
endif
if SerialBuffer(SerialRPointer) < “80h” then
SendNak;
exit;
endif;
if not(MultiModeF) then
SendNak;
exit;
endif;
AddressExist = true;
if (SerialBuffer(SerialRPointer) and “00111111b”) = #ModuleAddress
then AddressSelected = true;
else AddressSelected = false;
/ モジュールアドレスと指定アドレスの比較
endif;
if SerialBuffer(SerialRPointer) >= “C0h”
then
/ マルチモードで、コマンド入力用アドレス選択
RenewSRP;;
exit;
else
/ マルチモードで乱数データの読出し
if IntervalWPointer=IntervalRPointer
then
/ 乱数データがない場合
SendNakWhenNoData;
exit;
else
/ 乱数データが有る場合
if AddressSelected then
/ アドレスが選択されている場合
ReadIntervalTime;
/ 時間計測値の読み出し
ConvertToUniform;
/ 一様分布乱数へ変換
CalcProb;
/ 確率判定
if EXPDataOutF then SendRandomEXP;
if UniformDataOutF then SendRandomUniform;
/ 乱数出力
endif;
Sirent;
endif;
endif;

/ SendNak / NAKコードの送出
if (not(MultiModeF) or (AddressExist and AddressSelected) then SerialOutput
/= #SNAK;/ マルチモードでアドレスが一致しない場合はNAK送信せず
AddressSelected = false;
AddressExist = false;
SerialRPointer += 1;
SerialRPointer = SerialRPointer and #ConstSPFilter;
/ シリアル読出しポインタの更新
NumberOFNewData -= 1;

/ SendNakWhenNoData / マルチモード乱数読出し時、乱数がない場合
SerialOutput = #SNAK;
AddressSelected = false;
AddressExist = false;
NumberOFNewData -= 1;

/ SendAck / ACKコードの送出
if (not(MultiModeF) or (AddressExist and AddressSelected) then SerialOutput
/= #SACK;/ マルチモードでアドレスが一致しない場合はACK送信せず
AddressSelected = false;
AddressExist = false;
SerialRPointer += 1;
SerialRPointer = SerialRPointer and #ConstSPFilter;
/ シリアル読出しポインタの更新
NumberOFNewData -= 1;

/ RenewSRP / シリアルポインタの更新
SerialRPointer += 1;
SerialRPointer = SerialRPointer and #ConstSPFilter;
NumberOFNewData -= 1;

/ Sirent / 無効データで何もせず
AddressSelected = false;
AddressExist = false;
SerialRPointer += 1;
SerialRPointer = SerialRPointer and #ConstSPFilter;
NumberOFNewData -= 1;

/ WriteToFlash / フラッシュメモリへのデータ書き込み
FlashCPS = CPS;
FlashCPSMT = CPSMeasureTime;
FlashNofP = NumberOfPulse;
StatusFlag = FlashStatus;
FlashOPMode = OperationMode;
FlashLastCPSAccumulation = LastCPSAccumulation;
FlashPROB(0..7) = PROB(o..7);
FlashPT(0..7) = Pvalue(0..7);

/ ConvertToUniform / 一様分布乱数への変換
if RandomEXP[23..16]<>“0”
then
/ 指数分布乱数が“FFh”を超えた場合には“FFh”とする
UniformedData = “FFh”;
else
/ 2分探索にて一様分布へ変換
BitIndicator = 10000000b;
UniformedData = “0”;
repeat
UniformedData = UniformedData xor BitIndicator;
if RandomEXP < DataTable(UniformedData)
then UniformedData = UniformedData xor BitIndicator;
endif;
Carry = “0”;
RightLotateWithCarry(BitIndicator, 1bit);
until Carry=“1”;
endif;

/ CalcTPreScaler / CPSからTimer2のプリスケーラ値を算出
/ この演算では、64秒間のパルス数(CPS値)が0−3の場合、正確なプリスケーラ値
/ は求まらない。事前に確認が必要 > CPSMAXとCPSMINで切り出す
a as M32 {
aH as M[16];
aL as M[16];
}
CycleCounter as M[8];

a = 2246Dh;
CycleCounter=16;
LeftShiftWithCarry(a,1bit);
repeat
if CPSForceF
then
/ CPS値が強制設定されている場合、強制設定データを使用
if (aH-CPSForceData)>=0
then
Carry = 1;
aH = aH CPSForceData;
else Carry = 0;
else
if (aH-CPS)>=0
then
Carry = 1;
aH = aH CPS;
else Carry = 0;
endif;
LeftShiftWithCarry(a,1bit);
CycleCounter = CycleCounter 1;
until CycleCounter=0;
Timer2ReloadREG = aL;

/ CalcPThreshold /確率設定値から内部で使用する確率判定用の時間カウント閾値を計算
/ 対数演算を行う。処理内容については設計仕様書を参照。
W as M[32] {
W0 as M[8];
W1 as M[8];
W2 as M[8];
W3 as M[8]; /演算バッファX
}
X as M[32] {
X0 as M[8];
X1 as M[8];
X2 as M[8];
X3 as M[8]; /演算バッファX
}
Y as M[32] {
Y0 as M[8];
Y1 as M[8];
Y2 as M[8];
Y3 as M[8]; /演算バッファY
}
LogA as M[32] {
LogA0 as M[8];
LogA1 as M[8];
LogA2 as M[8];
LogA3 as M[8]; /演算バッファW
}
Z as M[32] {
Z0 as M[8];
Z1 as M[8];
Z2 as M[8];
Z3 as M[8]; /演算バッファZ
}
ZZ as M[32] {
ZZ0 as M[8];
ZZ1 as M[8];
ZZ2 as M[8];
ZZ3 as M[8]; /演算バッファZZ
}
Result as M[32] {
Result0 as M[8];
Result1 as M[8];
Result2 as M[8];
Result3 as M[8]; /演算バッファZZ
}
LogASign as M[1]; /Log(A)の符号

CalcAB;
CalcZ;
CalcZZ;
CalcLogA;
CalcLogB;
CalcResult;

/ CalcAB /
B as M[8];

X1&X2=P(PArg);
X0=X3=0;
B=“0Fh”;
repeat
LeftShift(X, 1 bit);
B -= 1;
until X0.bit0=“1”; /結果: XにAが残る。

/ CalcZ /
Root2 as “01.6A09E6”;
CycleCounter as M[8]

Y=X; /X,Y両バッファにAをセット
X=X - Root2; /X = (a-√2)の計算、もし結果が負なら補数をとる。
if X<0 then
X= 0 X;
LogASign = true;
else
LogASign = false;
end if
Y=Y + Root2; /Y = (a+√2)の計算

CycleCounter = 22; /除数yのビット長
z = 0; /ここから、Z = X/Yの計算
ShiftLeft(X, 2bit)
Repeat
if (X-Y) > 0
then
Carry = “1”; /結果zの最下位ビットを“1”にセット
X =X - Y;
else
Carry = “0”; /結果zの最下位ビットを“0”にリセット
end if
ShiftLeftWithC(Z, 1bit);
ShiftLeft(X, 1bit);
CycleCounter = CycleCounter 1;
until CycleCounter=0 ; /Zに演算結果が残る

/ CalcZZ /
CycleCounter as M[8];

X = Z;
X = Z;
WeqXmulY;
ZZ = W;

/ CalcLogA /
Const10 as “01.000000h”; /1
Const03 as “00.555555h”; /0.3333333
Const02 as “00.333333h”; /0.2
Const07 as “00.249248h”; /“.0010 0100 1001 0010 0100 1000” = 0.1428571
CycleCounter as M[8];

/ ZZ/7の演算、変数×定数の演算なので、定数が“0”のビット位置は単純シフト
/ 定数が“1”のビット位置は加算を行い、処理時間を短縮する
Y = ZZ;
X = 0;
CycleCounter = 7
repeat
ShiftRight(Y(1..3), 3bit);
X(1..3) = X(1..3)+Y(1..3);
CycleCounter -= 1;
until CycleCounter = 0; /結果はXに残る

X = X + Const02;

Y = ZZ ; /zz*(0.2 + zz*0.1428571)の演算
WeqXmulY;

W =W + Const03;

Y = ZZ ; /zz*(0.3333333 + zz*(0.2 + zz*0.1428571)の演算
X = 0;
WeqXmulY;

W = W + Const10;

Y = Z ; /2*z*(1 + zz*(0.3333333 + zz*(0.2 + zz*0.1428571)))
X = W;
WeqXmulY4;
LogA = 2 * W;

/ CalcLogB /
Const05 as “00.800000h”;
ConstLog2 as “0B17217Fh”; /演算簡素化のため、Log(2)*16を入れておく

X = B + 0.5
W = 0;
Y = ConstLog2;

CycleCounter = 5; /X=(B+0.5)*Log(2)
repeat
if W0.bit3=“1” then W =W + Y;
ShiftRight(Y,1bit);
ShiftLeft(W(0..1),1bit)
until CycleCounter = 0; /Xに結果が残る

/ CalcResult /
ConstN as (“00.2BF7C4h” shl 2) =“0.1010 1111 1101 1111 0001 0000”;
/ 0.1717494 *4 = 4/5.822436

if LogASign
then W = W + LogA
else W = W LogA;

Result = 0;
Y = ConstN;
CycleCounter=22;
repeat
ShiftLeft(Y(1..3),1bit)
if Carry=“1” then Result = Result + X;
ShiftRight(X,1bit);
until CycleCounter = 0; /Resultに結果が残る

/ WeqXmulY /
/ W = X * Y の演算(小数点以下のみの計算)
W = 0;
CycleCounter=24;
repeat
ShiftRight(X(1..3),1bit);
ShiftLeft(Y(1..3),1bit)
if Carry=“1” then W = W + X;
until CycleCounter = 0; /Wに結果が残る

/ WeqXmulY4 /
/ W = X * Y の演算(4桁の計算、Xは4桁、Yは1未満の場合のみ)
W = 0;
CycleCounter=24;
repeat
ShiftRight(X,1bit);
ShiftLeft(Y,1bit)
if Carry=“1” then W = W + X;
until CycleCounter = 0; / Wに結果が残る

/ FlashROMDataArea / フラッシュメモリ内のデータ領域。
/ 初期値として各データのデフォールト値を入れておく

FlashCPS as M[16] =“00C0h”;
FlashCPSMT as M[8] =“01h”;
FlashNofP as M[24] =“FFFFFFh”;
FlashStatus as M[8] =“00h”;
FlashOPMode as M[8] =“00010011b”;
; bit2 : デモモード
; bit1 : 指数分布乱数出力
; bit0 : 一様分布乱数出力
FlashLastCPSAccumulation as M[24] =“0000C0h”;
FlashPROB(8) as M[16] = (“0002h”,“0003h”,“0005h”,“0010h”,“0080h”,
/“0100h”,“1000h”,“8000h”);
FlashPT(8) as M[17] = (“001D8Dh”,“002ED7h”,“00449Eh”,“00CEDEh”,
/“00EC6Ch”,“0162A2h”,“01BB4Ah”);
ModuleAddress as M[8] =“FFh”;
FlashVer as String =“RGZ-1 Ver 1.00”,“0Dh”,“0Ah”,“2004-05-10”,“0Dh”,
“0Ah”,“CopyRight 2004, RPG Technics & Zixsys Inc.”,
“FFh”;
7). subroutine

/ CountRestart / Restart pulse time measurement.
/ When CPS is updated, when flash is written, initial state
CPSSecCounter = #ConstSecCounter;
CPSTimeCounter = #ConstTimeCount;
CPSACTimeCount = CPSMeasureTime;
CPSCounter = 0;
CPSAccumulation = 0;
IntervalCounter = 0;
CountRestartF = true;
CPSDetected = false;

/ ReadIntervalTime / Reads the measurement time from the time measurement value buffer
RandomEXP = IntervalTime (IntervalRPointer);
IntervalReadPointer = (IntervalReadPointer + 4) and #ConstITFilter;

/ AccumulateCPS / Accumulate CPS measurement value
/ Integrate the measured values every 64 seconds to obtain the CSP value for the set measurement time
/ CSP measurement value every hour is also obtained here
/ The measured value every hour is obtained by integrating the measured value every 64 seconds 56 times and obtaining the accumulated value of 3584 seconds.
/ The next 64 seconds measurement is ¼ and added. (3584 + 64 * 0.25) = 3600
CPSAccumulation = CPSAccumulation + CPSReadOut;
/ Accumulation of CPS value Accumulation of number of pulses for 1 hour from here
if NOPCaptureF then CPSReadOut = CPSReadOut / 4;
NOPCountBuffer = NOPCountBuffer + CPSReadOut;
if NOPCaptureF
then / 1 hour measurement completed
NumberOfPulse = NOPCountBuffer;
NOPCaptureF = false;
if DemoModeF then SendNOP;
WriteToFlash;
CountRestart;
else
NOPTimeCount-= 1;
if NOPTimeCount = 0 then
NOPCaptureF = true;
NOPTimeCount = #ConstNOPCount;
endif
endif

/ CalcCPS / Calculation of CPS value for 64 seconds
CPSAccumulation = (CPSAccumulation + LastCPSAccumulation) / 2;
LastCPSAccumulation = CPSAccumulation;
Breg = CPSMeasureTime;
if Breg.bit0 <> “1” then
repeat
CPSAccumulation = CPSAccumulation / 2;
RightShift (b, 1bit);
until Breg.bit0 = “1”;
endif;
CheckCPSMAXMIN; Check the maximum and minimum CPS values
if not (CPSTooLittleF or CPSTooManyF) then CPS = CPSAccumulation;
if DemoModeF then SendCPS;
WriteToFlash:
CountRestart;

/ CheckCPSMAXMIN /
/ Check whether the CPS value exceeds the specified range
/ If the CPS value is too large, the Timer2 interrupt cycle will be very short,
/ Be careful as the interrupt will always be applied and processing will not be performed.
Breg = # 0;
If CPSAccumulation> = #CPSMAX then Breg.bit1 = “1”;
If CPSAccumulation <#CPSMIN then Breg.bit0 = “1”;
if StatusFlag <> Breg then
StatusFlag = Breg;
SendStatus;
endif;

/ SendRandomEXP / Serial output of exponential random numbers
SerialOutput = #ConstEXPData;
if RandomEXP [23..16] = “0”
then
SerialOutput = RandonEXP;
Else
SerialOutput = #FFFFh;
endif

/ SendRandomUniform / Uniformly distributed random number serial output
SerialOutput = #ConstUniformData;
SerialOutput = UniformedData;

/ SendCPS / CPS value serial output
/ When reading internal status and CPS value changes in demo mode
SerialOutput = # 11h;
SerialOutput = CPS;

/ SendCPSMT / CPS measurement time serial output
/ When reading internal status
SerialOutput = # 12h;
SerialOutput = CPSMeasureTime;

/ SendNOP / Serial output of the number of pulses per hour
/ When the internal status is read and the CPS value changes per hour in demo mode
SerialOutput = # 13h;
SerialOutput = NumberOfPulse;

/ SendStatus / Serial output of status information
/ When internal status (CPS error) changes and when reading internal status
SerialOutput = # 14h;
SerialOutput = StatusFlag;

/ SendVersion / Serial output of version information
/ When reading internal status
SerialOutput = # 15h;
i = 0;
repeat
SerialOutput = FlashVer (i);
i + = 1;
until FlashVer (i) = “FFh”;

/ SendProbSetting / Serial output of probability setting value
/ When reading internal status
SerialOutput = SerialCommand;
SerialOutput = PROB (Command and “FFh”);

/ SendPJudge / Probability judgment value serial output
/ When a probabilistic read command is received, the internal status is displayed for each pulse input in the demo mode.
When a read command for / is received
SerialOutput = # 28h;
SerialOutput = ProbFlag;

/ CalcProb / Judges / declines from exponential random number
i = 0;
ProbFlag = “0”;
Repeat
if PValue (i) <= RandomEXP then ProbFlag [bit i] = “1”;
i + = 1;
until i = “8”;

/ CommandHandling /. Serial command processing
if (SerialBuffer (SerialRPointer) and “F0h”) = “00h” then / Operating condition setting command
if SerialBuffer (SerialRPointer) = “00h” then
/ NAK is returned when an unassigned code is received
SendNAK;
exit;
endif
if SerialBuffer (SerialRPointer) = “01h” then / CPS value forced setting?
if NumberOfNewData <3 then exit;
/ If no operand (setting data) has been received, do nothing.
RenewSRP;
if (MultiModeF and AddressExist and not (AddressSelected)
then
/ Ignore command if address does not match in multi mode
RenewSRP;
SendNal;
Exit
else
RenewSRP;
CPSForceData = SerialBuffer (SerialRPointer);
/ Read CPS compulsory value
CPSForceF = true;
/ Set CPS forced flag
CalcTPrescaler;
/ Prescaler value calculation (with forced data)
RenewSRP;
SendAck;
endif
if SerialBuffer (SerialRPointer) = “02h” then / CPS forced release
if (MultiModeF and AddressExist and not (AddressSelected)
then
/ Ignore command if address does not match in multi mode
SendAck;
exit
else
CPSForceF = false;
/ Reset CPS forced flag
SendAck;
Exit
endif
if SerialBuffer (SerialRPointer) = “03h” then / CPS measurement time setting
if NumberOfNewData <2 then exit;
/ If no operand (setting data) has been received, do nothing.
RenewSRP;
if (MultiModeF and AddressExist and not (AddressSelected)
then
/ Ignore command if address does not match in multi mode
SendAck;
Exit
else
/ Read and set CSP measurement time
CPSMeasureTime = SerialBuffer (SerialRPointer);
WriteToFlash;
CountRestart;
SendAck;
Exit
endif
if SerialBuffer (SerialRPointer) = “0Fh” / self-destruct
then
if NumberOfNewData <5 then exit;
/ If no operand (setting data) has been received, do nothing.
if (MultiModeF and AddressExist and not (AddressSelected)
then
/ Ignore command if address does not match in multi mode
SerialRPointer + = 4;
NumberOfNewData-= 4;
RenewSRP;
exit
else
RenewSRP;
If SerialBuffer (SerialRPointer) = “86h, 51h, 29h, 78h”
then
/ If regular data string is received, erase flash data
Destroy;
exit;
else
/ Otherwise, ignore the command and return Nak
SerialRPointer + = 3;
NumberOfNewData-= 3;
SendNAk;
exit
endif;
endif
else
SendNAK;
exit;
endif
endif
if (SerialBuffer (SerialRPointer) and “F0h”) = “10h” then / read internal status
if SerialBuffer (SerialRPointer) = (“10h” or “16h” or “17h”) then
/ Returns Nak for invalid data
SendNak;
exit;
endif;
ACC = SerialBuffer (SerialRPointer
Sirent;
if (not (MultiModeF) or (AddressExist and AddressSelected))
then
/ In stand-alone mode and when the addresses match in multi-mode
if ACC = “11h” then / CPS return
SendCPS;
exit;
endif;
if ACC = “12h” then / CSP measurement time return
SendCPSMT;
exit;
endif;
if ACC = “13h” then / 1 hour CPS value return
SendNOP;
exit;
endif;
if ACC = “14h” then / Return status data
SendStatus;
exit;
endif;
if ACC = “15h” then / version return
SendVersion;
exit;
endif;
SendProbSetting; / Return probability setting value
exit;
else
exit;
endif
endif
if (SerialBuffer (SerialRPointer) and “F0h”) = “20h” then / probability setting command
if SerialBuffer (SerialRPointer) = “28h” then
/ Reading probability judgment value
if (not (MultiModeF) or (AddressExist and AddressSelected))
/ then SendPJudge;
/ Address match in stand-alone mode and multi-mode
/ Only return probability judgment value
Sirent;
exit;
endif
if SerialBuffer (SerialRPointer) <“28h” then
if NumberOfNewData <3 then exit;
/ If no operand (setting data) has been received, do nothing.
if (MultiModeF and AddressExist and not (AddressSelected)
then
/ Ignore command if address does not match in multi mode
SerialRPointer + = 2;
NumberOfNewData-= 2;
Sirent;
exit;
else
/ Set probability set value
PArg = SerialBuffer (SerialRPointer) and “00000111b”;
/ Calculation of probability number
RenewSRP;
PROB (PArg) = SerialBuffer (SerialRPointer);
/ Write probability set value
RenewSRP;
CalcPThreshold;
/ Probability threshold calculation
WriteToFlash;
SendAck;
CountRestart;
exit;
endif;
endif
SendNak;
exit;
endif
if (SerialBuffer (SerialRPointer) and “F0h”) = “40h” then / operation mode command
if SerialBuffer (SerialRPointer) <“45h”
then
if (MultiModeF and AddressExist and not (AddressSelected))
then
/ Ignore command if address does not match in multi mode
RenewSRP ;;
AddressSelected = false;
AddressExist = false;
exit;
else
Breg = OperationMode;
OperationMode = SerialBuffer (SerialRPointer) and “00000111b”;
if Breg <> OperationMode then
/ When there is a change in the operation mode setting
WriteToFlash;
CountRestart;
endif;
SendAck;
exit;
endif
else
SendNak;
exit;
endif
endif
if SerialBuffer (SerialRPointer) = “7Fh” then MultiModeF = true;
if SerialBuffer (SerialRPointer) = “7Eh” then MultiModeF = false;
if SerialBuffer (SerialRPointer) = (“7Eh” or “7Fh”) then
/ Multi-mode command reception processing
WriteToFlash;
CountRestart;
Sirent;
exit;
endif
if SerialBuffer (SerialRPointer) <“80h” then
SendNak;
exit;
endif;
if not (MultiModeF) then
SendNak;
exit;
endif;
AddressExist = true;
if (SerialBuffer (SerialRPointer) and “00111111b”) = #ModuleAddress
then AddressSelected = true;
else AddressSelected = false;
/ Comparison of module address and specified address
endif;
if SerialBuffer (SerialRPointer)> = “C0h”
then
/ Address selection for command input in multi mode
RenewSRP ;;
exit;
else
/ Reading random number data in multi mode
if IntervalWPointer = IntervalRPointer
then
/ When there is no random number data
SendNakWhenNoData;
exit;
else
/ When there is random data
if AddressSelected then
/ If an address is selected
ReadIntervalTime;
/ Reading time measurement value
ConvertToUniform;
/ Convert to uniformly distributed random numbers
CalcProb;
/ Probability judgment
if EXPDataOutF then SendRandomEXP;
if UniformDataOutF then SendRandomUniform;
/ Random number output
endif;
Sirent;
endif;
endif;

/ SendNak / Send NAK code
if (not (MultiModeF) or (AddressExist and AddressSelected) then SerialOutput
/ = #SNAK; / Do not send NAK if address does not match in multi mode
AddressSelected = false;
AddressExist = false;
SerialRPointer + = 1;
SerialRPointer = SerialRPointer and #ConstSPFilter;
/ Update serial read pointer
NumberOFNewData-= 1;

/ SendNakWhenNoData / When reading the multi-mode random number, there is no random number
SerialOutput = #SNAK;
AddressSelected = false;
AddressExist = false;
NumberOFNewData-= 1;

/ SendAck / Send ACK code
if (not (MultiModeF) or (AddressExist and AddressSelected) then SerialOutput
/ = #SACK; / If the address does not match in multi mode, do not send ACK
AddressSelected = false;
AddressExist = false;
SerialRPointer + = 1;
SerialRPointer = SerialRPointer and #ConstSPFilter;
/ Update serial read pointer
NumberOFNewData-= 1;

/ RenewSRP / Serial pointer update
SerialRPointer + = 1;
SerialRPointer = SerialRPointer and #ConstSPFilter;
NumberOFNewData-= 1;

/ Sirent / do nothing with invalid data
AddressSelected = false;
AddressExist = false;
SerialRPointer + = 1;
SerialRPointer = SerialRPointer and #ConstSPFilter;
NumberOFNewData-= 1;

/ WriteToFlash / Write data to flash memory
FlashCPS = CPS;
FlashCPSMT = CPSMeasureTime;
FlashNofP = NumberOfPulse;
StatusFlag = FlashStatus;
FlashOPMode = OperationMode;
FlashLastCPSAccumulation = LastCPSAccumulation;
FlashPROB (0..7) = PROB (o..7);
FlashPT (0..7) = Pvalue (0..7);

/ ConvertToUniform / Conversion to uniformly distributed random numbers
if RandomEXP [23..16] <> “0”
then
/ When the exponential distribution random number exceeds “FFh”, it is set to “FFh”
UniformedData = “FFh”;
else
/ Convert to uniform distribution by binary search
BitIndicator = 10000000b;
UniformedData = “0”;
repeat
UniformedData = UniformedData xor BitIndicator;
if RandomEXP <DataTable (UniformedData)
then UniformedData = UniformedData xor BitIndicator;
endif;
Carry = “0”;
RightLotateWithCarry (BitIndicator, 1bit);
until Carry = “1”;
endif;

/ CalcTPreScaler / Calculate Timer2 prescaler value from CPS
/ In this calculation, if the number of pulses for 64 seconds (CPS value) is 0-3, the exact prescaler value
/ Is not required. Need to confirm in advance> Cut out with CPSMAX and CPSMIN
a as M32 {
aH as M [16];
aL as M [16];
}
CycleCounter as M [8];

a = 2246Dh;
CycleCounter = 16;
LeftShiftWithCarry (a, 1bit);
repeat
if CPSForceF
then
/ If CPS value is forcibly set, use forcibly set data
if (aH-CPSForceData)> = 0
then
Carry = 1;
aH = aH CPSForceData;
else Carry = 0;
else
if (aH-CPS)> = 0
then
Carry = 1;
aH = aH CPS;
else Carry = 0;
endif;
LeftShiftWithCarry (a, 1bit);
CycleCounter = CycleCounter 1;
until CycleCounter = 0;
Timer2ReloadREG = aL;

/ CalcPThreshold / Calculates the time count threshold for probability determination used internally from the probability setting value
/ Perform logarithmic operation Refer to the design specifications for processing details.
W as M [32] {
W0 as M [8];
W1 as M [8];
W2 as M [8];
W3 as M [8]; / Operation buffer X
}
X as M [32] {
X0 as M [8];
X1 as M [8];
X2 as M [8];
X3 as M [8]; / Operation buffer X
}
Y as M [32] {
Y0 as M [8];
Y1 as M [8];
Y2 as M [8];
Y3 as M [8]; / Operation buffer Y
}
LogA as M [32] {
LogA0 as M [8];
LogA1 as M [8];
LogA2 as M [8];
LogA3 as M [8]; / Operation buffer W
}
Z as M [32] {
Z0 as M [8];
Z1 as M [8];
Z2 as M [8];
Z3 as M [8]; / Operation buffer Z
}
ZZ as M [32] {
ZZ0 as M [8];
ZZ1 as M [8];
ZZ2 as M [8];
ZZ3 as M [8]; / Operation buffer ZZ
}
Result as M [32] {
Result0 as M [8];
Result1 as M [8];
Result2 as M [8];
Result3 as M [8]; / Operation buffer ZZ
}
LogASign as M [1]; / Log (A) sign

CalcAB;
CalcZ;
CalcZZ;
CalcLogA;
CalcLogB;
CalcResult;

/ CalcAB /
B as M [8];

X1 & X2 = P (PArg);
X0 = X3 = 0;
B = “0Fh”;
repeat
LeftShift (X, 1 bit);
B-= 1;
until X0.bit0 = "1"; / Result: A remains in X.

/ CalcZ /
Root2 as “01.6A09E6”;
CycleCounter as M [8]

Y = X; Set A in both / X and Y buffers
X = X-Root2; / X = (a-√2). If the result is negative, take the complement.
if X <0 then
X = 0 X;
LogASign = true;
else
LogASign = false;
end if
Y = Y + Root2; / Y = (a + √2)

CycleCounter = 22; / bit length of divisor y
z = 0; / From here, Z = X / Y calculation
ShiftLeft (X, 2bit)
Repeat
if (XY)> 0
then
Carry = “1”; / Set the least significant bit of the result z to “1”
X = X-Y;
else
Carry = “0”; / Reset the least significant bit of the result z to “0”
end if
ShiftLeftWithC (Z, 1bit);
ShiftLeft (X, 1bit);
CycleCounter = CycleCounter 1;
until CycleCounter = 0; The operation result remains in / Z

/ CalcZZ /
CycleCounter as M [8];

X = Z;
X = Z;
WeqXmulY;
ZZ = W;

/ CalcLogA /
Const10 as “01.000000h”; / 1
Const03 as “00.555555h”; /0.3333333
Const02 as “00.333333h”; /0.2
Const07 as “00.249248h”; /“.0010 0100 1001 0010 0100 1000 ”= 0.1428571
CycleCounter as M [8];

/ ZZ / 7 operation, variable × constant operation, so the bit position where the constant is “0” is a simple shift
/ Adds bit positions where the constant is “1” to reduce processing time
Y = ZZ;
X = 0;
CycleCounter = 7
repeat
ShiftRight (Y (1..3), 3bit);
X (1..3) = X (1..3) + Y (1..3);
CycleCounter-= 1;
until CycleCounter = 0; / result remains in X

X = X + Const02;

Y = ZZ; /zz*(0.2 + zz * 0.1428571)
WeqXmulY;

W = W + Const03;

Y = ZZ; /zz*(0.3333333 + zz * (0.2 + zz * 0.1428571)
X = 0;
WeqXmulY;

W = W + Const10;

Y = Z; / 2 * z * (1 + zz * (0.3333333 + zz * (0.2 + zz * 0.1428571)))
X = W;
WeqXmulY4;
LogA = 2 * W;

/ CalcLogB /
Const05 as “00.800000h”;
ConstLog2 as “0B17217Fh”; / Log (2) * 16 is inserted to simplify the calculation

X = B + 0.5
W = 0;
Y = ConstLog2;

CycleCounter = 5; /X=(B+0.5)*Log(2)
repeat
if W0.bit3 = “1” then W = W + Y;
ShiftRight (Y, 1bit);
ShiftLeft (W (0..1), 1bit)
until CycleCounter = 0; results remain in / X

/ CalcResult /
ConstN as (“00.2BF7C4h” shl 2) = “0.1010 1111 1101 1111 0001 0000”;
/ 0.1717494 * 4 = 4 / 5.822436

if LogASign
then W = W + LogA
else W = W LogA;

Result = 0;
Y = ConstN;
CycleCounter = 22;
repeat
ShiftLeft (Y (1..3), 1bit)
if Carry = “1” then Result = Result + X;
ShiftRight (X, 1bit);
until CycleCounter = 0; results remain in / Result

/ WeqXmulY /
/ W = X * Y operation (calculations only after the decimal point)
W = 0;
CycleCounter = 24;
repeat
ShiftRight (X (1..3), 1bit);
ShiftLeft (Y (1..3), 1bit)
if Carry = “1” then W = W + X;
until CycleCounter = 0; results remain in / W

/ WeqXmulY4 /
/ W = X * Y (4 digits calculation, X is 4 digits, Y is less than 1)
W = 0;
CycleCounter = 24;
repeat
ShiftRight (X, 1bit);
ShiftLeft (Y, 1bit)
if Carry = “1” then W = W + X;
until CycleCounter = 0; / W results in W

/ FlashROMDataArea / Data area in flash memory.
/ Enter the default value of each data as the initial value

FlashCPS as M [16] = “00C0h”;
FlashCPSMT as M [8] = “01h”;
FlashNofP as M [24] = “FFFFFFh”;
FlashStatus as M [8] = “00h”;
FlashOPMode as M [8] = “00010011b”;
; bit2: Demo mode
; bit1: Exponential distribution random number output
; bit0: Uniformly distributed random number output
FlashLastCPSAccumulation as M [24] = “0000C0h”;
FlashPROB (8) as M [16] = (“0002h”, “0003h”, “0005h”, “0010h”, “0080h”,
/ “0100h”, “1000h”, “8000h”);
FlashPT (8) as M [17] = (“001D8Dh”, “002ED7h”, “00449Eh”, “00CEDEh”,
/ "00EC6Ch", "0162A2h", "01BB4Ah");
ModuleAddress as M [8] = “FFh”;
FlashVer as String = “RGZ-1 Ver 1.00”, “0Dh”, “0Ah”, “2004-05-10”, “0Dh”,
“0Ah”, “CopyRight 2004, RPG Technics & Zixsys Inc.”,
“FFh”;

α粒子放射体のICタグへの取付け例を示す図である。It is a figure which shows the example of attachment to the IC tag of alpha particle | grain radiator. α粒子放射体の取付け部拡大図である。It is an attachment part enlarged view of alpha particle radiator. α粒子放射体取付け部拡大図(α粒子放射体が円盤状の場合の取付け例)である。It is an enlarged view of the α particle radiator attachment portion (attachment example when the α particle radiator is disc-shaped). α粒子放射体の滴下と封止例を示す図である。It is a figure which shows dripping and sealing example of alpha particle | grain radiator. α粒子放射体の滴下と封止例を示す図である。It is a figure which shows dripping and sealing example of alpha particle | grain radiator. α粒子放射体の滴下と封止例を示す図である。It is a figure which shows dripping and sealing example of alpha particle | grain radiator. 図5A及び5Bは、DIP型ICにパルス発生源を取付けた場合を示す図である。5A and 5B are diagrams showing a case where a pulse generation source is attached to a DIP type IC. 本発明に係るRPG−RFIDの一例を示すブロック図である。It is a block diagram which shows an example of RPG-RFID which concerns on this invention. α粒子放射体−検出器間距離とα粒子の計数率の関係を示すグラフである。It is a graph which shows the relationship between the alpha particle emitter-detector distance, and the alpha particle count rate. アルミニウムの厚さの増加に伴う電子数の減少を示すグラフである。It is a graph which shows the reduction | decrease in the number of electrons with the increase in the thickness of aluminum. RPG出力パルスの一例を示す図である。It is a figure which shows an example of an RPG output pulse. 本発明の一実施例の動作の一部を示すフロー・チャートである。It is a flowchart which shows a part of operation | movement of one Example of this invention. 本発明の一実施例の動作の一部を示すフロー・チャートである。It is a flowchart which shows a part of operation | movement of one Example of this invention. 本発明の一実施例の動作の一部を示すフロー・チャートである。It is a flowchart which shows a part of operation | movement of one Example of this invention.

Claims (27)

自発的にランダムパルスを発生するランダムパルス発生源(以下RPGという)を設けるとともに、該RPGから発生したランダムパルスの時間間隔を計時しもしくは電圧値を測定し、ディジタル値に変換することで、乱数を発生し及び/又は確率を生成するように構成した半導体デバイスであって、
前記RPGが、原子核の崩壊に伴って放出されるα粒子、ベータ線(粒子)、あるいはα粒子とベータ線を放出する放出体を含み、
前記RPGが、更に、放出されるα粒子、ベータ線(粒子)、あるいはα粒子とベータ線を検出する検出器を含み、前記放出体を溶液とし、この溶液を前記検出器の検出面に滴下し、あるいはこの溶液を蒸着しまたはロール法等で盤状に加工された部材を、前記検出器と所定の距離を介して対向させたことを特徴とする、
半導体デバイス。
By providing a random pulse generation source (hereinafter referred to as RPG) that spontaneously generates a random pulse, measuring the time interval of the random pulse generated from the RPG or measuring a voltage value and converting it into a digital value, a random number A semiconductor device configured to generate and / or generate a probability, comprising:
The RPG includes alpha particles, beta rays (particles) released as a result of nuclear decay, or emitters that emit alpha particles and beta rays,
The RPG further includes a detector for detecting emitted α particles, beta rays (particles), or α particles and beta rays, and the emitter is used as a solution, and this solution is dropped onto the detection surface of the detector. Or a member formed by vapor deposition of this solution or processed into a disk shape by a roll method or the like, facing the detector through a predetermined distance,
Semiconductor device.
α粒子、ベータ線(粒子)、あるいはα粒子とベータ線を放出する前記放出体として、ウラン系列の全ての核種、トリウム系列の全ての核種、これらの核種間の放射平衡を形成する210Pb-210Po等の全ての核種、244Cmあるいは241Amを使用することを特徴とする請求項1に記載の半導体デバイス。 As the emitter that emits alpha particles, beta rays (particles), or alpha particles and beta rays, all uranium series nuclides, thorium series nuclides, 210 Pb- The semiconductor device according to claim 1, wherein all nuclides such as 210 Po, 244 Cm or 241 Am are used. 前記検出器がPN型半導体、PNP型半導体、PINホトダイオード、ホトトランジスタまたはホトダイオードを含むことを特徴とする請求項1又は2に記載の半導体デバイス。   3. The semiconductor device according to claim 1, wherein the detector includes a PN-type semiconductor, a PNP-type semiconductor, a PIN photodiode, a phototransistor, or a photodiode. 前記RPGが、更に前記放出体を遮蔽する遮蔽壁を有し、該遮蔽壁は、少なくとも、使用するα粒子、ベータ線(粒子)、あるいはα粒子とベータ線の飛程の距離を遮蔽することを特徴とする請求項1乃至3のいずれかに記載の半導体デバイス。   The RPG further has a shielding wall that shields the emitter, and the shielding wall shields at least the α particle, the beta ray (particle) to be used, or the range of the α particle and the beta ray. The semiconductor device according to claim 1, wherein: 前記RPGから発生するランダムパルスから、所定のビット長の指数分布の乱数、一様乱数を発生し、及び/又は確率を生成することを特徴とする請求項1乃至のいずれかに記載の半導体デバイス。 Random pulses generated from the RPG, random exponential distribution of predetermined bit length, a semiconductor according to uniform random numbers were generated, and / or any one of claims 1 to 4, characterized in that to generate a probability device. 前記RPGから発生されるパルスについて同じパルス間隔が発生する確率を示す指数分布から必要数の確率を求め、この確率を基に一様乱数を作成することを特徴とする請求項に記載の半導体デバイス。 6. The semiconductor according to claim 5 , wherein a required number of probabilities are obtained from an exponential distribution indicating a probability that the same pulse interval occurs for pulses generated from the RPG, and uniform random numbers are created based on the probabilities. device. 前記指数分布を使用してt1とt2の時間間隔から確率を求めるとき、t2時間を無限時間と仮定してt1時間を越えたときに所定の確率のパルスと認定することを特徴とする請求項に記載の半導体デバイス。 2. When the probability is obtained from the time interval between t1 and t2 using the exponential distribution, the pulse is identified as a pulse with a predetermined probability when t2 is exceeded assuming that t2 is an infinite time. 7. The semiconductor device according to 6 . 指数分布から乱数を作成するときに、計測の基本周期を変動させることにより、パルスの平均放出率が変動しても同じ演算処理を行って、指数分布乱数、一様分布乱数の安定した出現確率密度分布を実現することを特徴とする請求項乃至のいずれかに記載の半導体デバイス。 When creating random numbers from the exponential distribution, the same calculation process is performed even if the average emission rate of the pulse fluctuates by changing the basic period of measurement, and the stable appearance probability of the exponential random number and uniform distribution random number the semiconductor device according to any one of claims 5 to 7, characterized in that to achieve a density distribution. 前記RPGから発生した乱数を認証信号またはアンチクローン信号として記憶し、外部から入力された信号を前記記憶された信号と比較認証することを特徴とする請求項1乃至のいずれかに記載の半導体デバイス。 Storing the random number generated from the RPG as an authentication signal or anti clone signal, a semiconductor according the signal inputted from the outside to any one of claims 1 to 8, characterized in that comparing the authentication with the stored signal device. 更に、前記比較認証の度に、新たな乱数を認証データとして書き換えることを特徴とする請求項に記載の半導体デバイス。 The semiconductor device according to claim 9 , wherein a new random number is rewritten as authentication data at each comparison authentication. 更に、認証データの送受を行うことを特徴とする請求項または10に記載の半導体バイス。 The semiconductor device according to claim 9 or 10, characterized in that transmitting and receiving authentication data. 前記認証データの送受は、無線通信、赤外線通信、または接触による回路接続方式による通信で行うことを特徴とする請求項11に記載の半導体デバイス。 12. The semiconductor device according to claim 11 , wherein the authentication data is transmitted / received by wireless communication, infrared communication, or communication by a circuit connection method using contact. 請求項1乃至12のいずれかに記載の半導体デバイスを組込んだICカード、ICタグ、PC接続可能な機器、又は機器組み込み型モジュール。 Claims 1 to 12 IC card incorporating a semiconductor device according to any one of, IC tag, PC connectable device or devices embedded module. 指数分布から乱数を作成するときに、計測の基本周期を変動させることにより、指数分布乱数の分布を安定させると共に、一様分布乱数の生成と確率の生成を同時に処理することを特徴とする請求項に記載の半導体デバイス。 When generating random numbers from an exponential distribution, the distribution of the exponential random numbers is stabilized by changing the basic period of measurement, and the generation of uniformly distributed random numbers and the generation of probabilities are simultaneously processed. Item 9. The semiconductor device according to Item 8 . 指数分布から乱数を作成するときに、計測の基本周期を変動させることにより、計時を行うマイコン等のハードウェアの発振周波数などの動作クロックの変動を自動補正することを特徴とする請求項に記載の半導体デバイス。 9. The method according to claim 8 , wherein when the random number is generated from the exponential distribution, fluctuations in an operation clock such as an oscillation frequency of hardware such as a microcomputer for measuring time are automatically corrected by changing a basic period of measurement. The semiconductor device described. 自発的にランダムパルスを発生するランダムパルス発生源(以下RPGという)から発生したランダムパルスの時間間隔を計時しもしくは電圧値を測定し、ディジタル値に変換するステップと、
ディジタル値に変換したランダムパルスから、所定のビット長の指数分布の乱数、一様乱数を発生し、及び/又は確率を生成するステップとから成る方法であって、
前記RPGは、原子核の崩壊に伴って放出されるα粒子、ベータ線(粒子)、あるいはα粒子とベータ線を放出する放出体と、放出されるα粒子、ベータ線(粒子)、あるいはα粒子とベータ線を検出する検出器とを含み、前記放出体を溶液とし、この溶液を前記検出器の検出面に滴下し、あるいはこの溶液を蒸着しまたはロール法等で盤状に加工された部材を、前記検出器と所定の距離を介して対向させた、
乱数及び/又は確率を生成する方法。
Measuring the time interval of a random pulse generated from a random pulse generation source (hereinafter referred to as RPG) that spontaneously generates a random pulse or measuring a voltage value and converting it to a digital value;
A random pulse converted to a digital value, generating exponentially distributed random numbers of a predetermined bit length, uniform random numbers, and / or generating probability,
The RPG is an α particle, a beta ray (particle), or an emitter that emits an α particle and a beta ray, and an emitted α particle, a beta ray (particle), or an α particle. And a detector that detects beta rays, the emitter is used as a solution, and the solution is dropped on the detection surface of the detector, or the solution is deposited or processed into a disk shape by a roll method or the like Facing the detector through a predetermined distance,
A method of generating random numbers and / or probabilities.
ランダムパルスから、所定のビット長の指数分布の乱数、一様乱数を発生し、及び/又は確率を生成するステップは、ランダムパルスについて同じパルス間隔が発生する確率を示す指数分布から必要数の確率を求め、この確率を基に一様乱数を作成することを特徴とする請求項16に記載の方法。 Generating random numbers, uniform random numbers of a predetermined bit length from random pulses, and / or generating probabilities, the required number of probabilities from the exponential distribution indicating the probability that the same pulse interval will occur for random pulses The method according to claim 16 , wherein a uniform random number is generated based on the probability. ランダムパルスから、所定のビット長の指数分布の乱数、一様乱数を発生し、及び/又は確率を生成するステップは、前記指数分布を使用してt1とt2の時間間隔から確率を求めるとき、t2時間を無限時間と仮定してt1時間を越えたときに所定の確率のパルスと認定することを特徴とする請求項17に記載の方法。 The step of generating a random number of an exponential distribution having a predetermined bit length, a uniform random number, and / or generating a probability from a random pulse uses the exponential distribution to obtain a probability from a time interval between t1 and t2. 18. The method according to claim 17 , wherein a pulse having a predetermined probability is recognized when t2 time is exceeded assuming that t2 time is infinite time. ランダムパルスから、所定のビット長の指数分布の乱数、一様乱数を発生し、及び/又は確率を生成するステップは、指数分布から乱数を作成するときに、計測の基本周期を変動させることにより、パルスの平均放出率が変動しても同じ演算処理を行って、指数分布乱数、一様分布乱数の安定した出現確率密度分布を実現することを特徴とする請求項16乃至18のいずれかに記載の方法。 The step of generating an exponential distribution random number, a uniform random number of a predetermined bit length from random pulses, and / or generating a probability is performed by changing a basic period of measurement when generating a random number from an exponential distribution. , even if the same calculation processing average release rate of the pulse is varied, exponential distribution random number, characterized in that to realize stable appearance probability density distribution of uniformly distributed random numbers to any of claims 16 to 18 The method described. ランダムパルスから、所定のビット長の指数分布の乱数、一様乱数を発生し、及び/又は確率を生成するステップは、指数分布から乱数を作成するときに、計測の基本周期を変動させることにより、指数分布乱数の分布を安定させると共に、一様分布乱数の生成と確率の生成を同時に処理することを特徴とする請求項16乃至19のいずれかに記載の方法。 The step of generating an exponential distribution random number, a uniform random number of a predetermined bit length from random pulses, and / or generating a probability is performed by changing a basic period of measurement when generating a random number from an exponential distribution. The method according to any one of claims 16 to 19 , wherein the distribution of exponential distribution random numbers is stabilized, and the generation of uniform distribution random numbers and the generation of probability are processed simultaneously. ランダムパルスから、所定のビット長の指数分布の乱数、一様乱数を発生し、及び/又は確率を生成するステップは、指数分布から乱数を作成するときに、計測の基本周期を変動させることにより、計時を行うマイコン等のハードウェアの発振周波数などの動作クロックの変動を自動補正することを特徴とする請求項20に記載の方法。 The step of generating an exponential distribution random number, a uniform random number of a predetermined bit length from random pulses, and / or generating a probability is performed by changing a basic period of measurement when generating a random number from an exponential distribution. 21. The method according to claim 20 , wherein fluctuations in an operation clock such as an oscillation frequency of hardware such as a microcomputer for measuring time are automatically corrected. 乱数及び/又は確率を生成する方法をコンピュータを使用して実施するためのプログラムであって、
当該方法は、自発的にランダムパルスを発生するランダムパルス発生源(以下RPGという)から発生したランダムパルスの時間間隔を計時しもしくは電圧値を測定し、ディジタル値に変換するステップと、ディジタル値に変換したランダムパルスから、所定のビット長の指数分布の乱数、一様乱数を発生し、及び/又は確率を生成するステップとから成り、
前記RPGは、原子核の崩壊に伴って放出されるα粒子、ベータ線(粒子)、あるいはα粒子とベータ線を放出する放出体と、放出されるα粒子、ベータ線(粒子)、あるいはα粒子とベータ線を検出する検出器とを含み、前記放出体を溶液とし、この溶液を前記検出器の検出面に滴下し、あるいはこの溶液を蒸着しまたはロール法等で盤状に加工された部材を、前記検出器と所定の距離を介して対向させた、
プログラム。
A program for implementing a method of generating random numbers and / or probabilities using a computer,
The method includes a step of measuring a time interval of a random pulse generated from a random pulse generation source (hereinafter referred to as RPG) that spontaneously generates a random pulse or measuring a voltage value and converting it to a digital value; Generating random numbers of an exponential distribution having a predetermined bit length, uniform random numbers, and / or generating probabilities from the converted random pulses,
The RPG is an α particle, a beta ray (particle), or an emitter that emits an α particle and a beta ray, and an emitted α particle, a beta ray (particle), or an α particle. And a detector that detects beta rays, the emitter is used as a solution, and the solution is dropped on the detection surface of the detector, or the solution is deposited or processed into a disk shape by a roll method or the like Facing the detector through a predetermined distance,
program.
ランダムパルスから、所定のビット長の指数分布の乱数、一様乱数を発生し、及び/又は確率を生成するステップは、ランダムパルスについて同じパルス間隔が発生する確率を示す指数分布から必要数の確率を求め、この確率を基に一様乱数を作成することを特徴とする請求項22に記載のプログラム。 Generating random numbers, uniform random numbers of a predetermined bit length from random pulses, and / or generating probabilities, the required number of probabilities from the exponential distribution indicating the probability that the same pulse interval will occur for random pulses 23. The program according to claim 22 , wherein a uniform random number is generated based on the probability. 前記指数分布を使用してt1とt2の時間間隔から確率を求めるとき、t2時間を無限時間と仮定してt1時間を越えたときに所定の確率のパルスと認定することを特徴とする請求項23に記載のプログラム。 2. When the probability is obtained from the time interval between t1 and t2 using the exponential distribution, the pulse is identified as a pulse with a predetermined probability when t2 is exceeded assuming that t2 is an infinite time. The program according to 23 . 指数分布から乱数を作成するときに、計測の基本周期を変動させることにより、パルスの平均放出率が変動しても同じ演算処理を行って、指数分布乱数、一様分布乱数の安定した出現確率密度分布を実現することを特徴とする請求項22乃至24のいずれかに記載のプラグラム。 When creating random numbers from the exponential distribution, the same calculation process is performed even if the average emission rate of the pulse fluctuates by changing the basic period of measurement, and the stable appearance probability of the exponential random number and uniform distribution random number The program according to any one of claims 22 to 24, wherein a density distribution is realized. 指数分布から乱数を作成するときに、計測の基本周期を変動させることにより、指数分布乱数の分布を安定させると共に、一様分布乱数の生成と確率の生成を同時に処理することを特徴とする請求項22乃至25のいずれかに記載のプログラム。 When generating random numbers from an exponential distribution, the distribution of the exponential random numbers is stabilized by changing the basic period of measurement, and the generation of uniformly distributed random numbers and the generation of probabilities are simultaneously processed. Item 26. The program according to any one of Items 22 to 25 . 指数分布から乱数を作成するときに、計測の基本周期を変動させることにより、計時を行うマイコン等のハードウェアの発振周波数などの動作クロックの変動を自動補正することを特徴とする請求項26に記載のプログラム。 27. The method according to claim 26 , wherein when generating a random number from an exponential distribution, fluctuations in an operation clock such as an oscillation frequency of hardware such as a microcomputer for measuring time are automatically corrected by changing a basic period of measurement. The program described.
JP2005187750A 2004-06-30 2005-06-28 Random pulse generation source, method for generating random number and / or probability using the same, program, and semiconductor device Active JP4804815B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005187750A JP4804815B2 (en) 2004-06-30 2005-06-28 Random pulse generation source, method for generating random number and / or probability using the same, program, and semiconductor device

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP2004193456 2004-06-30
JP2004193456 2004-06-30
JP2005187750A JP4804815B2 (en) 2004-06-30 2005-06-28 Random pulse generation source, method for generating random number and / or probability using the same, program, and semiconductor device

Publications (2)

Publication Number Publication Date
JP2006050577A JP2006050577A (en) 2006-02-16
JP4804815B2 true JP4804815B2 (en) 2011-11-02

Family

ID=36028539

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005187750A Active JP4804815B2 (en) 2004-06-30 2005-06-28 Random pulse generation source, method for generating random number and / or probability using the same, program, and semiconductor device

Country Status (1)

Country Link
JP (1) JP4804815B2 (en)

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS58166448A (en) * 1982-03-26 1983-10-01 Nec Corp Generation system for pseudo-random number
JP3367730B2 (en) * 1993-12-09 2003-01-20 奥村遊機株式會社 Adjustment mechanism of random pulse generator
JP3364365B2 (en) * 1995-07-27 2003-01-08 池上通信機株式会社 Probability setting device for random pulse generator
EP0828349A1 (en) * 1996-08-06 1998-03-11 AMERSHAM INTERNATIONAL plc Method of and apparatus for generating random numbers
JPH11296348A (en) * 1998-04-07 1999-10-29 Takeshi Saito Natural random number and hybrid random number generating device
JP2000305753A (en) * 1999-04-16 2000-11-02 Takeshi Saito Physical random number generating device
JP3534064B2 (en) * 2000-11-10 2004-06-07 いわき電子株式会社 Random number generation method
JP4575186B2 (en) * 2004-03-02 2010-11-04 典平 露崎 Authentication apparatus and authentication method using random pulse generator

Also Published As

Publication number Publication date
JP2006050577A (en) 2006-02-16

Similar Documents

Publication Publication Date Title
KR101234929B1 (en) Random pulse generation source, and semiconductor device, method and computer-readable storage medium for generating random number and/or probability using the source
ES2691624T3 (en) Wireless temperature sensor
JP6059722B2 (en) Position sensitive readout mode for digital silicon photomultiplier tube arrays
US6745217B2 (en) Random number generator based on the spontaneous alpha-decay
US6415309B1 (en) Method of and apparatus for generating random numbers
JP4215950B2 (en) Random number generation method and apparatus
US7266575B2 (en) Random number generator which can generate a random number based on an uniform distribution
EP3306854B1 (en) Uniqueness-attaining apparatus that utilizes spontaneous decay of radioisotope
US20190293771A1 (en) Optical sensor and electronic device
JP4804815B2 (en) Random pulse generation source, method for generating random number and / or probability using the same, program, and semiconductor device
Alkassar et al. Obtaining true-random binary numbers from a weak radioactive source
Rohe RANDy-A true-random generator based on radioactive decay
Park et al. Efficient hardware implementation and analysis of true random‐number generator based on beta source
JP2926539B2 (en) Numerical identification device using weak radioactive material and pulse generator with variable probability
CN113126473A (en) Method and apparatus for time-to-digital converter
CN113419231A (en) Method and apparatus for selective histogramming
US10084437B1 (en) Power supply noise sensor
JPH11296348A (en) Natural random number and hybrid random number generating device
US11080020B2 (en) Information processing device and random number generating method
JP2021099680A (en) Random number generator
TH76191A (en) Random pulse generation source And semiconductor devices, methods and programs for generating random numbers and / or probabilities using that source.

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20080311

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100802

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100929

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110330

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110525

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110613

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110715

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20110803

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110810

R150 Certificate of patent or registration of utility model

Ref document number: 4804815

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140819

Year of fee payment: 3

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313113

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250