JP4471901B2 - Random number generator - Google Patents

Random number generator Download PDF

Info

Publication number
JP4471901B2
JP4471901B2 JP2005219246A JP2005219246A JP4471901B2 JP 4471901 B2 JP4471901 B2 JP 4471901B2 JP 2005219246 A JP2005219246 A JP 2005219246A JP 2005219246 A JP2005219246 A JP 2005219246A JP 4471901 B2 JP4471901 B2 JP 4471901B2
Authority
JP
Japan
Prior art keywords
random number
output
level
metastable
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2005219246A
Other languages
Japanese (ja)
Other versions
JP2007034836A (en
Inventor
和彦 福島
敦男 山口
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Renesas Technology Corp
Original Assignee
Renesas Technology Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Renesas Technology Corp filed Critical Renesas Technology Corp
Priority to JP2005219246A priority Critical patent/JP4471901B2/en
Publication of JP2007034836A publication Critical patent/JP2007034836A/en
Application granted granted Critical
Publication of JP4471901B2 publication Critical patent/JP4471901B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、乱数発生装置に関し、特に、回路の出力が不安定な状態における回路の出力に基づいて乱数を生成する乱数発生装置に関する。   The present invention relates to a random number generation device, and more particularly to a random number generation device that generates a random number based on the output of a circuit when the output of the circuit is unstable.

情報セキュリティ分野においては乱数の使用が不可欠であり、近年、一様性(乱数の確率値および出現率に差異が生じないこと)を有し、かつ乱数出現の規則性や前後の相関性、周期性などを有しない自然乱数(真正乱数)を発生する高性能な乱数発生装置の需要が高まっている。   In the information security field, the use of random numbers is indispensable, and in recent years, it has uniformity (there is no difference in the probability value and appearance rate of random numbers), and the regularity of random numbers appearance, the correlation before and after, and the period. There is an increasing demand for high-performance random number generators that generate natural random numbers (genuine random numbers) that do not have such characteristics.

たとえば、特許文献1には以下のような乱数発生装置が開示されている。すなわち、カスケード接続されたMuller(ミューラー)Cゲート1,2が第2の方形波Sの立ち上がり時点以降における第1の方形波Fの立ち下がり時点を検出し、カスケード接続されたMullerCゲート3,4が第2の方形波Sの立ち上がり時点以降における第1の方形波Fの立ち上がり時点を検出し、第2の方形波Sの立ち上がり時点で第1の方形波Fの値が1の場合にはNANDゲート5が0を乱数として出力し、第2の方形波Sの立ち上がり時点で第1の方形波Fの値が0の場合にはNANDゲート6が0を乱数として出力する。   For example, Patent Document 1 discloses the following random number generator. That is, the cascaded Muller C gates 1 and 2 detect the falling point of the first square wave F after the rising point of the second square wave S, and the cascaded Muller C gates 3 and 4 are connected. Detects the rising point of the first square wave F after the rising point of the second square wave S, and if the value of the first square wave F is 1 at the rising point of the second square wave S, NAND When the gate 5 outputs 0 as a random number and the value of the first square wave F is 0 at the time of rising of the second square wave S, the NAND gate 6 outputs 0 as a random number.

また、特許文献2には以下のような乱数発生装置が開示されている。すなわち、ループ状に接続された複数の遅延回路、複数の遅延回路で形成されたループ内に複数の遅延回路の総遅延時間よりも短いパルス幅のパルス信号を発生させるパルス発生回路、および複数の遅延回路のうちのある遅延回路の出力ノードに接続され、その出力ノードをパルス信号が通過した回数をカウントし、そのカウント値に基づいて真正乱数データを出力するカウンタを備える。
特開2003−150372号公報 特開2005−18251号公報
Patent Document 2 discloses the following random number generator. That is, a plurality of delay circuits connected in a loop, a pulse generation circuit that generates a pulse signal having a pulse width shorter than the total delay time of the plurality of delay circuits in a loop formed by the plurality of delay circuits, and a plurality of A counter is connected to an output node of a delay circuit in the delay circuit, counts the number of times the pulse signal has passed through the output node, and outputs genuine random number data based on the count value.
JP 2003-150372 A JP 2005-18251 A

ところで、特許文献1記載の乱数発生装置は2つの入力信号の関係に応じて乱数を発生する構成であるため、適切な入力信号を生成できない場合には乱数性が低下してしまうという問題点があった。   By the way, since the random number generation device described in Patent Document 1 is configured to generate a random number according to the relationship between two input signals, there is a problem in that randomness deteriorates when an appropriate input signal cannot be generated. there were.

また、特許文献2記載の乱数発生装置は、回路の不確定動作によって回路の出力が不安定となる状態、すなわちメタステーブルにおける回路の出力に基づいて乱数を発生する構成であるが、メタステーブルが消滅する前、すなわち出力ノードを通過するパルス信号が消滅する前のカウント値を真正乱数データとして出力すると、メタステーブルの寿命に依存しない乱数が生成されるために乱数性が低下してしまう場合があるという問題点があった。   In addition, the random number generation device described in Patent Document 2 is configured to generate a random number based on a circuit output in a metastable state in which the circuit output becomes unstable due to an indefinite operation of the circuit. If the count value before the extinction, that is, before the pulse signal passing through the output node disappears, is output as a genuine random number data, random numbers that do not depend on the life of the metastable are generated, so the randomness may deteriorate. There was a problem that there was.

それゆえに、本発明の目的は、乱数性を向上させることが可能な乱数発生装置を提供することである。   Therefore, an object of the present invention is to provide a random number generator capable of improving randomness.

上記課題を解決するために、本発明のある局面に係わる乱数発生装置は、回路の出力が不安定な状態であるメタステーブルにおける回路の出力に基づいて乱数データを生成する乱数生成部と、乱数データを格納する乱数格納部と、メタステーブルの消滅後に乱数生成部から出力される乱数データを乱数格納部に格納させる制御を行なう制御部とを備える。   In order to solve the above-described problem, a random number generation device according to an aspect of the present invention includes a random number generation unit that generates random number data based on an output of a circuit in a metastable in which the output of the circuit is unstable, and a random number A random number storage unit that stores data; and a control unit that controls the random number storage unit to store random number data output from the random number generation unit after the metastable disappears.

また本発明のさらに別の局面に係わる乱数発生装置は、回路の出力が不安定な状態であるメタステーブルにおける回路の出力に基づいて乱数データを生成する乱数生成部と、乱数データを格納する乱数格納部と、メタステーブルの消滅を検知する検知器と、検知器がメタステーブルの発生から所定時間内にメタステーブルの消滅を検知した場合にはメタステーブルの消滅後に、または所定時間が経過しても検知器がメタステーブルの消滅を検知しない場合には所定時間経過後に、乱数生成部から出力される乱数データを乱数格納部に格納させる制御を行なう制御部とを備える。   A random number generator according to still another aspect of the present invention includes a random number generation unit that generates random number data based on an output of a circuit in a metastable in which the output of the circuit is unstable, and a random number that stores the random number data A storage unit, a detector that detects the disappearance of the metastable, and if the detector detects the disappearance of the metastable within a predetermined time from the occurrence of the metastable, or after the predetermined time has elapsed When the detector does not detect the disappearance of the metastable, the detector includes a control unit that performs control to store the random number data output from the random number generation unit in the random number storage unit after a predetermined time has elapsed.

本発明によれば、乱数性を向上させることができる。   According to the present invention, randomness can be improved.

以下、本発明の実施の形態について図面を用いて説明する。なお、図中同一または相当部分には同一符号を付してその説明は繰り返さない。   Hereinafter, embodiments of the present invention will be described with reference to the drawings. In the drawings, the same or corresponding parts are denoted by the same reference numerals and description thereof will not be repeated.

<第1の実施の形態>
[構成および基本動作]
図1は、本発明の第1の実施の形態に係る乱数発生装置の構成を示す図である。同図を参照して、乱数発生装置は、乱数生成部1と、M系列生成部(擬似乱数生成部)2と、EXOR(イクスクルーシブオア)ゲート3と、乱数格納部4と、制御信号生成部5とを備える。乱数生成部1は、リング発振器11(乱数用発振器)と、2値化部12とを含む。
<First Embodiment>
[Configuration and basic operation]
FIG. 1 is a diagram showing a configuration of a random number generation device according to the first embodiment of the present invention. Referring to the figure, a random number generation device includes a random number generation unit 1, an M sequence generation unit (pseudo random number generation unit) 2, an EXOR (exclusive OR) gate 3, a random number storage unit 4, and a control signal. And a generation unit 5. The random number generation unit 1 includes a ring oscillator 11 (random number oscillator) and a binarization unit 12.

乱数生成部1は、リング発振器11においてメタステーブルが発生しているときのリング発振器11の出力に基づいて乱数データを生成する。   The random number generation unit 1 generates random number data based on the output of the ring oscillator 11 when the metastable is generated in the ring oscillator 11.

M系列生成部2は、公知のM系列(最長符号系列)を生成する。M系列は、一様性のある擬似乱数データ、すなわち“0”と“1”の発生確率がともに50%で、規則性のある擬似的な乱数データである。なお、乱数生成部1およびM系列生成部2は非同期で動作する。   The M sequence generation unit 2 generates a known M sequence (longest code sequence). The M-sequence is uniform pseudo-random data, that is, pseudo-random data having regularity with both occurrence probability of “0” and “1” being 50%. The random number generation unit 1 and the M sequence generation unit 2 operate asynchronously.

EXORゲート3は、乱数生成部1から受けた乱数データおよびM系列生成部2から受けた擬似乱数データの排他的論理和を出力する。乱数生成部1の生成する乱数データは一様性が保証されていないが、M系列生成部2の生成する擬似乱数データは一様性が保証されているため、EXORゲート3からは一様性のある乱数データが出力される。   The EXOR gate 3 outputs an exclusive OR of the random number data received from the random number generation unit 1 and the pseudo random number data received from the M sequence generation unit 2. The random number data generated by the random number generation unit 1 is not guaranteed to be uniform, but the pseudo-random number data generated by the M-sequence generation unit 2 is guaranteed to be uniform. Random number data with is output.

乱数格納部4は、EXORゲート3から受けた乱数データを格納し、乱数として出力する。より詳細には、乱数格納部4は、乱数データを複数ビット格納するための複数個のレジスタを含む。また、乱数格納部4は、CPU等の外部回路が出力する図示しないリード信号を受けて各レジスタに格納された乱数データを乱数としてCPUバスへ出力する。   The random number storage unit 4 stores the random number data received from the EXOR gate 3 and outputs it as a random number. More specifically, the random number storage unit 4 includes a plurality of registers for storing a plurality of bits of random number data. The random number storage unit 4 receives a read signal (not shown) output from an external circuit such as a CPU and outputs the random number data stored in each register as a random number to the CPU bus.

制御信号生成部5は、乱数生成部1と、M系列生成部2と、乱数格納部4とを制御して乱数を生成する。   The control signal generation unit 5 controls the random number generation unit 1, the M sequence generation unit 2, and the random number storage unit 4 to generate random numbers.

図2は、リング発振器11および2値化部12の構成を示す図である。同図を参照して、リング発振器11は、インバータ21a〜21eと、NANDゲート22a〜22cとを含む。2値化部12はレジスタ23a〜23cと、EXORゲート24とを含む。   FIG. 2 is a diagram illustrating the configuration of the ring oscillator 11 and the binarization unit 12. Referring to the figure, ring oscillator 11 includes inverters 21a-21e and NAND gates 22a-22c. The binarization unit 12 includes registers 23a to 23c and an EXOR gate 24.

リング発振器11は、制御信号生成部5から受けた発振制御信号に応じて発振状態または安定状態になる。2値化部12は、リング発振器11のループにおける各ノードをパルス信号が通過した回数をカウントし、このカウント値に基づいて乱数データを出力する。   The ring oscillator 11 enters an oscillation state or a stable state according to the oscillation control signal received from the control signal generation unit 5. The binarization unit 12 counts the number of times the pulse signal has passed through each node in the loop of the ring oscillator 11, and outputs random number data based on the count value.

より詳細には、NANDゲート22a〜22cおよびインバータ21aで構成される回路は、制御信号生成部5から受けた発振制御信号に応じて、奇数個のインバータからなるループを形成するか、または偶数個のインバータからなるループを形成するかを切り替える。   More specifically, the circuit formed of NAND gates 22a to 22c and inverter 21a forms a loop composed of an odd number of inverters or an even number according to the oscillation control signal received from control signal generation unit 5. The loop consisting of the inverters is switched.

リング発振器11において、インバータ21bの出力およびNANDゲート22bの入力の接続点がノードN21であり、NANDゲート22cの出力およびインバータ21cの入力の接続点がノードN22であり、インバータ21dの出力およびインバータ21eの入力の接続点がノードN23である。   In the ring oscillator 11, the connection point between the output of the inverter 21b and the input of the NAND gate 22b is a node N21, the connection point between the output of the NAND gate 22c and the input of the inverter 21c is a node N22, and the output of the inverter 21d and the inverter 21e. The connection point of the input is node N23.

ノードN21〜N23は、それぞれ2値化部12におけるレジスタ23a〜23cのクロック入力端子に接続される。   The nodes N21 to N23 are connected to clock input terminals of the registers 23a to 23c in the binarization unit 12, respectively.

このような構成により、発振制御信号がHレベルのときはNANDゲート22bの出力信号がHレベルとなるため、インバータ21c〜21eと、NANDゲート22aおよび22cとからなるループ、すなわち奇数個のインバータからなるループが形成される。発振制御信号がLレベルのときはNANDゲート22aの出力信号がHレベルとなるため、インバータ21b〜21eと、NANDゲート22bおよび22cとからなるループ、すなわち偶数個のインバータからなるループが形成される。したがって、発振制御信号がLレベルのときは各インバータおよび各NANDゲートの出力信号の論理レベルが確定するためループが安定状態になるが、発振制御信号がHレベルのときは各インバータおよび各NANDゲートの出力信号がHレベルおよびLレベルを繰り返すためにループが発振状態になる。   With such a configuration, when the oscillation control signal is at the H level, the output signal of the NAND gate 22b is at the H level. Therefore, from the loop composed of the inverters 21c to 21e and the NAND gates 22a and 22c, that is, from an odd number of inverters. A loop is formed. When the oscillation control signal is at the L level, the output signal of the NAND gate 22a is at the H level, so that a loop composed of the inverters 21b to 21e and the NAND gates 22b and 22c, that is, a loop composed of an even number of inverters is formed. . Therefore, when the oscillation control signal is at the L level, the logic level of the output signal of each inverter and each NAND gate is determined, so that the loop becomes stable, but when the oscillation control signal is at the H level, each inverter and each NAND gate. Since the output signal repeats H level and L level, the loop enters an oscillation state.

レジスタ23a〜23cは、反転出力端子とデータ入力端子とが接続された、1ビットのカウンタである。レジスタ23a〜23cは、クロック入力端子に入力される信号の立ち上がりエッジを検出するたびに正反転出力端子からの出力信号を反転させる。   The registers 23a to 23c are 1-bit counters to which an inverting output terminal and a data input terminal are connected. The registers 23a to 23c invert the output signal from the positive / inverted output terminal every time the rising edge of the signal input to the clock input terminal is detected.

図3は、リング発振器11および2値化部12の動作を説明するためのタイムチャートである。   FIG. 3 is a time chart for explaining operations of the ring oscillator 11 and the binarization unit 12.

同図を参照して、制御信号生成部5から出力される発振制御信号は、時刻t0にHレベルに立ち上げられ、時間T0経過後にLレベルに立ち下げられるパルス信号である。この時間T0(パルス幅)は、リング発振器11のループの遅延時間T1よりも短い時間である。   Referring to the figure, the oscillation control signal output from control signal generator 5 is a pulse signal that rises to H level at time t0 and falls to L level after time T0 has elapsed. This time T0 (pulse width) is shorter than the delay time T1 of the loop of the ring oscillator 11.

発振制御信号がLレベルからHレベルになると前述のようにループが安定状態から発振状態となる。発振状態においては各インバータおよび各NANDゲートの出力信号がHレベルおよびLレベルを繰り返すため、リング発振器11のループにおける各ノードをパルス信号が通過する。そして、発振制御信号がHレベルからLレベルになるとループが発振状態でなくなるため、発振状態において各ノードを通過していたパルス信号が徐々に細くなり、最終的にパルス信号が消滅して安定状態となる。このように発振状態におけるパルス信号よりも細いパルス信号がループを通過している状態、すなわちリング発振器12の出力が不安定な状態がメタステーブルである。ここで、パルス信号のレベルが小さくなり、レジスタ23a〜23cがパルス信号をクロックとして認識できなくなった状態、すなわちレジスタ23a〜23cがパルス信号の立ち上がりエッジまたは立ち下がりエッジを検出できなくなった状態がメタステーブルの消滅である。   When the oscillation control signal changes from the L level to the H level, the loop changes from the stable state to the oscillation state as described above. In the oscillation state, the output signal of each inverter and each NAND gate repeats H level and L level, so that the pulse signal passes through each node in the loop of the ring oscillator 11. When the oscillation control signal changes from the H level to the L level, the loop ceases to be in the oscillation state, so that the pulse signal that has passed through each node in the oscillation state gradually becomes thin and eventually the pulse signal disappears and is in a stable state. It becomes. In this way, a state where a pulse signal thinner than the pulse signal in the oscillation state passes through the loop, that is, a state where the output of the ring oscillator 12 is unstable is a metastable. Here, the state in which the level of the pulse signal becomes small and the registers 23a to 23c cannot recognize the pulse signal as a clock, that is, the state in which the registers 23a to 23c cannot detect the rising edge or the falling edge of the pulse signal. It is the disappearance of the table.

同図に示すタイムチャートにおいて、各レジスタは、それぞれパルス数を2回ずつカウントする。すなわち、初期状態において各レジスタの非反転出力がLレベルであった場合、各レジスタの非反転出力は1回目のカウントでHレベルになり、2回目のカウントでLレベルになる。そうすると、メタステーブル消滅後のEXORゲート24の出力信号はLレベルになる。   In the time chart shown in the figure, each register counts the number of pulses twice. That is, when the non-inverted output of each register is L level in the initial state, the non-inverted output of each register becomes H level at the first count and becomes L level at the second count. Then, the output signal of the EXOR gate 24 after the metastable disappears becomes L level.

メタステーブルの寿命は、リング発振器11のループにおける各回路の特性によって決まり、各回路の特性は製造ばらつきおよび周囲温度等によって変動するものであるため、メタステーブルの寿命は制御できるものではなく、メタステーブルが消滅するノード、すなわち最後のパルス信号が通過するノードは不確定である。   The life of the metastable is determined by the characteristics of each circuit in the loop of the ring oscillator 11, and the characteristics of each circuit vary depending on the manufacturing variation and the ambient temperature. Therefore, the life of the metastable cannot be controlled. The node where the table disappears, that is, the node through which the last pulse signal passes is indeterminate.

たとえば、メタステーブルがループを2周した後に出力ノードN22で消滅した場合、出力ノードN21に対応するレジスタはパルス数を3回カウントし、出力ノードN22〜N23に対応するレジスタはそれぞれパルス数を2回ずつカウントする。すなわち、初期状態において各レジスタの非反転出力がLレベルであった場合、メタステーブル消滅後の出力ノードN21に対応するレジスタの非反転出力はHレベルになり、出力ノードN22〜N23に対応するレジスタの非反転出力はそれぞれLレベルになる。そうすると、メタステーブル消滅後のEXORゲート24の出力信号はHレベルになる。したがって、時刻t0から所定時間経過後(メタステーブル消滅後)の時刻t1における2値化部12の出力信号はメタステーブルの寿命に依存するため、真正乱数データ、すなわち規則性がなく質の高い乱数データとなる。   For example, if the metastable disappears at the output node N22 after making two loops, the register corresponding to the output node N21 counts the number of pulses three times, and the registers corresponding to the output nodes N22 to N23 each have a pulse number of 2. Count once. That is, when the non-inverted output of each register is L level in the initial state, the non-inverted output of the register corresponding to the output node N21 after the metastable disappears becomes H level, and the registers corresponding to the output nodes N22 to N23 The non-inverted outputs of each become L level. Then, the output signal of the EXOR gate 24 after the metastable disappears becomes H level. Therefore, since the output signal of the binarization unit 12 at the time t1 after the elapse of a predetermined time from the time t0 (after the metastable disappears) depends on the life of the metastable, it is genuine random number data, that is, a random number having no regularity and high quality. It becomes data.

以上のように、本実施の形態に係る乱数発生装置における乱数生成部1は、リング発振器11の3個(奇数個)のインバータからなるループと4個(偶数個)のインバータからなるループとを切り替え、メタステーブルの寿命を“0”,“1”に2値化することによって真正乱数データを生成する。したがって、小型で消費電力が小さく、高性能な乱数発生装置が実現できる。   As described above, the random number generation unit 1 in the random number generation device according to the present embodiment includes a loop composed of three (odd number) inverters and a loop composed of four (even number) inverters of the ring oscillator 11. By switching and binarizing the life of the metastable to “0” and “1”, genuine random number data is generated. Therefore, a compact, low power consumption and high performance random number generator can be realized.

図4は、M系列生成部2の構成を示す図である。
同図を参照して、M系列生成部2は、n個(nは3以上の自然数)のレジスタ91と、複数個のEXORゲート92と、ANDゲート93と、ORゲート94とを含む。
FIG. 4 is a diagram illustrating a configuration of the M-sequence generation unit 2.
Referring to FIG. 2, M-sequence generation unit 2 includes n (n is a natural number of 3 or more) registers 91, a plurality of EXOR gates 92, an AND gate 93, and an OR gate 94.

各レジスタ91は、そのデータ入力端子が前段のレジスタ91の非反転出力端子に接続され、クロック入力端子に制御信号生成部5からのM系列シフト信号が入力され、反転出力端子がANDゲート93の入力端子に接続される。ただし、初段のレジスタ91は、データ入力端子がORゲート94の出力端子に接続される。   Each register 91 has its data input terminal connected to the non-inverted output terminal of the previous register 91, the M-sequence shift signal from the control signal generating unit 5 is input to the clock input terminal, and the inverted output terminal of the AND gate 93. Connected to input terminal. However, the first stage register 91 has a data input terminal connected to the output terminal of the OR gate 94.

各EXORゲート92は、入力端子の一方が対応のレジスタ91の非反転出力を受け、その入力端子の他方が前段のEXORゲート92の出力信号を受け、これらの排他的論理和を出力する。ただし、初段のEXORゲート92は、その入力端子の一方が(n−2)段目のレジスタ91の非反転出力を受け、入力端子の他方がn段目のEXORゲート92の出力信号を受ける。   In each EXOR gate 92, one of the input terminals receives the non-inverted output of the corresponding register 91, and the other input terminal receives the output signal of the previous EXOR gate 92, and outputs an exclusive OR of these signals. However, one of the input terminals of the first-stage EXOR gate 92 receives the non-inverted output of the (n−2) -th stage register 91, and the other input terminal receives the output signal of the n-th stage EXOR gate 92.

このように、複数段のレジスタ91を直列に接続し、最終出力をフィードバックする構成により、擬似乱数が生成されることは周知である。このM系列生成部2が出力する擬似乱数データの繰返し周期はEXORゲート92の数および位置に応じて異なり、擬似乱数データの繰返し周期が最も長くなるようにEXORゲート92の数および位置が定められる。この場合、繰返し周期が(2n−1)の擬似乱数データが生成される。   As described above, it is well known that pseudo-random numbers are generated by connecting a plurality of stages of registers 91 in series and feeding back the final output. The repetition period of the pseudo random number data output from the M-sequence generation unit 2 varies depending on the number and position of the EXOR gate 92, and the number and position of the EXOR gate 92 are determined so that the repetition period of the pseudo random number data is the longest. . In this case, pseudo random number data having a repetition period of (2n-1) is generated.

ANDゲート93は、n個のレジスタ91の反転出力の論理積を出力する。ORゲート94は、最終段のEXORゲート92の出力信号およびANDゲート93の出力信号の論理和を出力する。このような構成により、すべてのレジスタ91の非反転出力がLレベルになってM系列生成部2が出力する擬似乱数データがLレベルの安定状態になることが防止される。   The AND gate 93 outputs a logical product of the inverted outputs of the n registers 91. The OR gate 94 outputs a logical sum of the output signal of the final-stage EXOR gate 92 and the output signal of the AND gate 93. With such a configuration, it is possible to prevent the pseudo-random data output from the M-sequence generation unit 2 from being in the stable state at the L level because the non-inverted outputs of all the registers 91 are at the L level.

図5は、制御信号生成部5の構成を示す図である。
同図を参照して、制御信号生成部5は、リング発振器101(クロック用発振器)と、レジスタ31a〜31bと、ANDゲート32a〜32bとを含む。
FIG. 5 is a diagram illustrating a configuration of the control signal generation unit 5.
Referring to the figure, control signal generation unit 5 includes a ring oscillator 101 (clock oscillator), registers 31a to 31b, and AND gates 32a to 32b.

図6は、リング発振器101の構成を示す図である。
同図を参照して、リング発振器101は、ANDゲート33と、インバータ34a〜34cとを含む。
FIG. 6 is a diagram illustrating a configuration of the ring oscillator 101.
Referring to the figure, ring oscillator 101 includes an AND gate 33 and inverters 34a to 34c.

ANDゲート33と、インバータ34a〜34cとからなるループ、すなわち奇数個のインバータからなるループが形成される。発振制御信号がLレベルのときはANDゲート33の出力信号がLレベルとなるため、リング発振器101の出力信号はHレベルで安定する。一方、発振制御信号がHレベルのときはANDゲート33の出力信号がHレベルとなるため、ANDゲート33および各インバータの出力信号の論理レベルがHおよびLレベルを繰り返してループが発振状態となり、制御信号生成用クロックが出力される。   A loop composed of the AND gate 33 and the inverters 34a to 34c, that is, a loop composed of an odd number of inverters is formed. When the oscillation control signal is at L level, the output signal of the AND gate 33 is at L level, so that the output signal of the ring oscillator 101 is stabilized at H level. On the other hand, when the oscillation control signal is at the H level, the output signal of the AND gate 33 is at the H level. A control signal generation clock is output.

再び図5を参照して、レジスタ31a〜31bは、データ入力端子に入力されたデータをリング発振器101から受けた制御信号生成用クロックのタイミングでサンプリングして保持し、保持したデータを出力する。レジスタ31aの非反転出力端子がレジスタ31bのデータ入力端子に接続され、反転出力端子がANDゲート32aの入力端子の一方およびANDゲート32bの入力端子の一方に接続される。レジスタ31bの非反転出力端子がANDゲート32aの入力端子の他方に接続され、反転出力端子がANDゲート32bの入力端子の他方およびレジスタ31aのデータ入力端子に接続される。   Referring to FIG. 5 again, registers 31a to 31b sample and hold the data input to the data input terminal at the timing of the control signal generation clock received from ring oscillator 101, and output the held data. The non-inverting output terminal of the register 31a is connected to the data input terminal of the register 31b, and the inverting output terminal is connected to one of the input terminals of the AND gate 32a and one of the input terminals of the AND gate 32b. The non-inverting output terminal of the register 31b is connected to the other input terminal of the AND gate 32a, and the inverting output terminal is connected to the other input terminal of the AND gate 32b and the data input terminal of the register 31a.

ANDゲート32aの出力が乱数格納信号となり、また、ANDゲート32bの出力が発振制御信号およびM系列シフト信号となる。   The output of the AND gate 32a becomes a random number storage signal, and the output of the AND gate 32b becomes an oscillation control signal and an M-sequence shift signal.

次に、制御信号生成部5が各回路を制御して乱数を生成する際の動作について説明する。   Next, an operation when the control signal generation unit 5 controls each circuit to generate a random number will be described.

図7は、本発明の第1の実施の形態に係る乱数発生装置における各信号のタイムチャートである。   FIG. 7 is a time chart of each signal in the random number generation device according to the first embodiment of the present invention.

制御信号生成部5は、発振制御信号およびM系列シフト信号をLレベルからHレベルに変化させる。発振制御信号がLレベルからHレベルになると、乱数生成部1におけるリング発振器11が発振状態となる。また、M系列シフト信号がLレベルからHレベルになると、M系列生成部2における各レジスタがシフト動作を行ない、M系列生成部2の出力、すなわち擬似乱数データの論理レベルがたとえばLレベルからHレベルに変化する。   Control signal generator 5 changes the oscillation control signal and the M-sequence shift signal from L level to H level. When the oscillation control signal changes from the L level to the H level, the ring oscillator 11 in the random number generation unit 1 enters the oscillation state. When the M-sequence shift signal changes from the L level to the H level, each register in the M-sequence generation unit 2 performs a shift operation, and the output of the M-sequence generation unit 2, that is, the logic level of the pseudorandom data is, for example, from the L level to the H level. Change to level.

次に、制御信号生成部5は、発振制御信号およびM系列シフト信号をHレベルからLレベルに変化させる。発振制御信号がHレベルからLレベルになるとリング発振器11が発振状態でなくなり、リング発振器11においてメタステーブルが発生する。   Next, the control signal generation unit 5 changes the oscillation control signal and the M-sequence shift signal from the H level to the L level. When the oscillation control signal changes from the H level to the L level, the ring oscillator 11 is not oscillated and a metastable is generated in the ring oscillator 11.

そして、リング発振器11においてメタステーブルが消滅し、乱数生成部1から真正乱数データとしてたとえばHレベルのデータが出力される。EXORゲート3は、乱数生成部1からHレベルのデータおよびM系列生成部2からHレベルのデータを受けて、Lレベルのデータを乱数データとして出力する。   Then, the metastable disappears in the ring oscillator 11 and, for example, H level data is output from the random number generator 1 as the genuine random number data. The EXOR gate 3 receives H level data from the random number generation unit 1 and H level data from the M sequence generation unit 2 and outputs L level data as random number data.

次に、制御信号生成部5は、乱数格納部4を制御して、EXORゲート3から受けた乱数データをメタステーブル消滅後のタイミングで格納する。同図において、制御信号生成部5は、リング発振器11においてメタステーブルが消滅した後のタイミングである制御信号生成用クロックの4クロック目で乱数格納信号をLレベルからHレベルに変化させている。乱数格納信号がLレベルからHレベルになると、乱数格納部4は、EXORゲート3から出力されているLレベルの乱数データを格納する。   Next, the control signal generation unit 5 controls the random number storage unit 4 to store the random number data received from the EXOR gate 3 at the timing after the metastable disappears. In the figure, the control signal generator 5 changes the random number storage signal from the L level to the H level at the fourth clock of the control signal generation clock, which is the timing after the metastable disappears in the ring oscillator 11. When the random number storage signal changes from the L level to the H level, the random number storage unit 4 stores the L level random number data output from the EXOR gate 3.

ここで、メタステーブルが消滅した後に乱数格納信号をLレベルからHレベルに変化させるように構成するためには、制御信号生成用クロックの周期をある程度大きくする必要がある。制御信号生成用クロックの周期を大きくする方法としては、制御信号生成部5が含むリング発振器101における各インバータを入出力間の遅延量の大きい回路とするか、リング発振器101におけるループを構成するインバータの数を増やすか、またはインバータの出力に容量値の大きい素子を接続する等の方法が考えられる。   Here, in order to change the random number storage signal from the L level to the H level after the metastable disappears, it is necessary to increase the period of the control signal generation clock to some extent. As a method for increasing the period of the control signal generation clock, each inverter in the ring oscillator 101 included in the control signal generation unit 5 is a circuit having a large delay amount between input and output, or an inverter constituting a loop in the ring oscillator 101. It is conceivable to increase the number of terminals or connect an element having a large capacitance value to the output of the inverter.

ところで、特許文献1記載の乱数発生装置は2つの入力信号の関係に応じて乱数を発生する構成であるため、適切な入力信号を生成できない場合には乱数性が低下してしまうという問題点があった。   By the way, since the random number generation device described in Patent Document 1 is configured to generate a random number according to the relationship between two input signals, there is a problem in that randomness deteriorates when an appropriate input signal cannot be generated. there were.

また、特許文献2記載の乱数発生装置は、メタステーブルが消滅する前のカウント値を真正乱数データとして出力すると、メタステーブルの寿命に依存しない乱数が生成されるために乱数性が低下してしまう場合があるという問題点があった。   In addition, when the random number generation device described in Patent Document 2 outputs the count value before the metastable disappears as genuine random number data, random numbers that do not depend on the life of the metastable are generated, so that the randomness deteriorates. There was a problem that there was a case.

しかしながら、本発明の第1の実施の形態に係る乱数発生装置では、制御信号生成部5は、乱数格納部4を制御して、EXORゲート3から受けた乱数データをメタステーブル消滅後のタイミングで格納する。すなわち、メタステーブルの寿命に基づく乱数を生成する。   However, in the random number generation device according to the first embodiment of the present invention, the control signal generation unit 5 controls the random number storage unit 4 so that the random number data received from the EXOR gate 3 is at the timing after the metastable disappears. Store. That is, a random number based on the life of the metastable is generated.

したがって、本発明の第1の実施の形態に係る乱数発生装置では、乱数性を向上させることができる。   Therefore, the random number generator according to the first embodiment of the present invention can improve randomness.

また、本発明の第1の実施の形態に係る乱数発生装置では、リング発振器101が生成する制御信号生成用クロックの周波数は乱数発生装置の外部から制御することができない。したがって、耐タンパ性、すなわち機器の内部構造および記憶しているデータ等の解析の困難さを向上させることができる。   In the random number generation device according to the first embodiment of the present invention, the frequency of the control signal generation clock generated by the ring oscillator 101 cannot be controlled from the outside of the random number generation device. Therefore, tamper resistance, that is, difficulty in analyzing the internal structure of the device and stored data can be improved.

次に、本発明の他の実施の形態について図面を用いて説明する。なお、図中同一または相当部分には同一符号を付してその説明は繰り返さない。   Next, another embodiment of the present invention will be described with reference to the drawings. In the drawings, the same or corresponding parts are denoted by the same reference numerals and description thereof will not be repeated.

<第2の実施の形態>
本実施の形態は、第1の実施の形態に係る乱数発生装置におけるリング発振器11および制御信号生成部5の構成を変更した乱数発生装置に関する。すなわち、本実施の形態に係る乱数発生装置は、リング発振器11の代わりにリング発振器13(乱数用発振器)を備え、また、制御信号生成部5の代わりに制御信号生成部15を備える。
<Second Embodiment>
The present embodiment relates to a random number generation device in which the configurations of the ring oscillator 11 and the control signal generation unit 5 in the random number generation device according to the first embodiment are changed. That is, the random number generation device according to the present embodiment includes a ring oscillator 13 (random number oscillator) instead of the ring oscillator 11, and includes a control signal generation unit 15 instead of the control signal generation unit 5.

図8は、リング発振器13の構成を示す図である。
同図を参照して、リング発振器13は、NANDゲート41a〜41fを含む。NANDゲート41a〜41fはループを形成する。このループは偶数個のインバータからなるループと等価であり、発振制御信号がLレベルおよびHレベルのいずれの場合にも安定状態になる。
FIG. 8 is a diagram showing the configuration of the ring oscillator 13.
Referring to the figure, ring oscillator 13 includes NAND gates 41a to 41f. NAND gates 41a to 41f form a loop. This loop is equivalent to a loop composed of an even number of inverters, and is in a stable state regardless of whether the oscillation control signal is at L level or H level.

リング発振器21において、NANDゲート41fの出力およびNANDゲート41aの入力の接続点がノードN41であり、NANDゲート41bの出力およびNANDゲート41cの入力の接続点がノードN42であり、NANDゲート41dの出力およびNANDゲート41eの入力の接続点がノードN43である。   In the ring oscillator 21, the connection point between the output of the NAND gate 41f and the input of the NAND gate 41a is the node N41, the connection point of the output of the NAND gate 41b and the input of the NAND gate 41c is the node N42, and the output of the NAND gate 41d The connection point of the inputs of the NAND gate 41e is the node N43.

ノードN41〜N43は、それぞれ2値化部12におけるレジスタ23a〜23cのクロック入力端子に接続される。   Nodes N41 to N43 are connected to clock input terminals of registers 23a to 23c in binarization unit 12, respectively.

リング発振器13の構成および動作は、特許文献1の図19に示すリング発振器と同様である。すなわち、このループの初期状態は、ノードN41〜N43の電位がHレベルの安定状態である。発振制御信号がHレベルに立ち上げられたことに応じて、NANDゲート41a〜41eの出力がLレベルに立下げられた後、NANDゲート41a、41cおよび41eの電位がLレベル、NANDゲート41b、41dおよび41fの電位がHレベルの安定状態に遷移する。発振制御信号の変化時において、ノードN41〜N43に順次メタステーブルが発生する。メタステーブルの波形は時間が経つにつれて徐々に小さくなって消滅する。   The configuration and operation of the ring oscillator 13 are the same as those of the ring oscillator shown in FIG. That is, the initial state of this loop is a stable state in which the potentials of nodes N41 to N43 are at the H level. In response to the rise of the oscillation control signal to the H level, the outputs of the NAND gates 41a to 41e are lowered to the L level, and then the potentials of the NAND gates 41a, 41c and 41e are set to the L level, the NAND gate 41b, The potentials of 41d and 41f make a transition to a stable state of H level. When the oscillation control signal is changed, metastable is sequentially generated in the nodes N41 to N43. The metastable waveform gradually decreases with time and disappears.

したがって、リング発振器21のループの遅延時間よりも短いパルス幅の発振制御信号を生成しなくても、発振制御信号をLレベルからHレベルに立ち上げるだけで簡単にメタステーブルを発生することができるため、乱数発生装置の構成を簡易化することができる。   Therefore, even if an oscillation control signal having a pulse width shorter than the delay time of the loop of the ring oscillator 21 is not generated, a metastable can be generated simply by raising the oscillation control signal from the L level to the H level. Therefore, the configuration of the random number generator can be simplified.

図9は、制御信号生成部15の構成を示す図である。
同図を参照して、制御信号生成部15は、図5に示す制御信号生成部5に対して、さらにインバータ35を含む。インバータ35は、ANDゲート32bの出力を反転させ、発振制御信号として乱数生成部1へ出力する。その他の構成および動作は図5に示す制御信号生成部5と同様である。
FIG. 9 is a diagram illustrating a configuration of the control signal generation unit 15.
Referring to FIG. 5, control signal generation unit 15 further includes an inverter 35 with respect to control signal generation unit 5 shown in FIG. The inverter 35 inverts the output of the AND gate 32b and outputs the inverted signal to the random number generator 1 as an oscillation control signal. Other configurations and operations are the same as those of the control signal generator 5 shown in FIG.

次に、制御信号生成部15が各回路を制御して乱数を生成する際の動作について説明する。   Next, an operation when the control signal generation unit 15 controls each circuit to generate a random number will be described.

図10は、本発明の第2の実施の形態に係る乱数発生装置における各信号のタイムチャートである。   FIG. 10 is a time chart of each signal in the random number generation device according to the second embodiment of the present invention.

制御信号生成部15は、発振制御信号をHレベルからLレベルに変化させる。この場合、乱数生成部1におけるリング発振器11は安定状態であり、各ノードの電位がHレベルであるため、乱数生成部1の出力はLレベルとなる。また、制御信号生成部15は、M系列シフト信号をLレベルからHレベルに変化させる。M系列シフト信号がLレベルからHレベルになると、M系列生成部2における各レジスタがシフト動作を行ない、M系列生成部2の出力、すなわち擬似乱数データの論理レベルがたとえばLレベルからHレベルに変化する。   The control signal generation unit 15 changes the oscillation control signal from the H level to the L level. In this case, the ring oscillator 11 in the random number generation unit 1 is in a stable state, and the potential of each node is at the H level. Therefore, the output of the random number generation unit 1 is at the L level. Control signal generation unit 15 changes the M-sequence shift signal from the L level to the H level. When the M-sequence shift signal changes from the L level to the H level, each register in the M-sequence generation unit 2 performs a shift operation, and the output of the M-sequence generation unit 2, that is, the logical level of the pseudorandom data is changed from the L level to the H level, for example. Change.

次に、制御信号生成部5は、発振制御信号をLレベルからHレベルに変化させる。発振制御信号がLレベルからHレベルになると、リング発振器13においてメタステーブルが発生する。また、制御信号生成部5は、M系列シフト信号をHレベルからLレベルに変化させる。   Next, the control signal generator 5 changes the oscillation control signal from the L level to the H level. When the oscillation control signal changes from L level to H level, a metastable is generated in the ring oscillator 13. Control signal generation unit 5 changes the M-sequence shift signal from the H level to the L level.

そして、リング発振器13においてメタステーブルが消滅し、乱数生成部1から真正乱数データとしてたとえばHレベルのデータが出力される。EXORゲート3は、乱数生成部1からHレベルのデータおよびM系列生成部2からHレベルのデータを受けて、Lレベルのデータを乱数データとして出力する。   Then, the metastable disappears in the ring oscillator 13, and H level data, for example, is output from the random number generator 1 as genuine random number data. The EXOR gate 3 receives H level data from the random number generation unit 1 and H level data from the M sequence generation unit 2 and outputs L level data as random number data.

次に、制御信号生成部5は、乱数格納部4を制御して、EXORゲート3から受けた乱数データをメタステーブル消滅後のタイミングで格納する。同図において、制御信号生成部5は、リング発振器13においてメタステーブルが消滅した後のタイミングである制御信号生成用クロックの4クロック目で乱数格納信号をLレベルからHレベルに変化させている。乱数格納信号がLレベルからHレベルになると、乱数格納部4は、EXORゲート3から出力されているLレベルの乱数データを格納する。   Next, the control signal generation unit 5 controls the random number storage unit 4 to store the random number data received from the EXOR gate 3 at the timing after the metastable disappears. In the figure, the control signal generator 5 changes the random number storage signal from the L level to the H level at the fourth clock of the control signal generation clock, which is the timing after the metastable disappears in the ring oscillator 13. When the random number storage signal changes from the L level to the H level, the random number storage unit 4 stores the L level random number data output from the EXOR gate 3.

したがって、本発明の第2の実施の形態に係る乱数発生装置は、第1の実施の形態に係る乱数発生装置と同様にメタステーブルの寿命に基づく乱数を生成することができるため、乱数性を向上させることができる。また、第1の実施の形態に係る乱数発生装置と同様に、耐タンパ性を向上させることができる。   Therefore, since the random number generator according to the second embodiment of the present invention can generate a random number based on the lifetime of the metastable as in the random number generator according to the first embodiment, Can be improved. In addition, tamper resistance can be improved as in the random number generation device according to the first embodiment.

次に、本発明の他の実施の形態について図面を用いて説明する。なお、図中同一または相当部分には同一符号を付してその説明は繰り返さない。   Next, another embodiment of the present invention will be described with reference to the drawings. In the drawings, the same or corresponding parts are denoted by the same reference numerals and description thereof will not be repeated.

<第3の実施の形態>
本実施の形態は、第1の実施の形態に係る乱数発生装置における制御信号生成部5の構成を変更した乱数発生装置に関する。すなわち、本実施の形態に係る乱数発生装置は、制御信号生成部5の代わりに制御信号生成部25を備える。
<Third Embodiment>
The present embodiment relates to a random number generation device in which the configuration of the control signal generation unit 5 in the random number generation device according to the first embodiment is changed. That is, the random number generation device according to the present embodiment includes a control signal generation unit 25 instead of the control signal generation unit 5.

図11は、制御信号生成部25の構成を示す図である。
同図を参照して、制御信号生成部25は、図5に示す制御信号生成部5に対して、リング発振器101の代わりに分周器51を含む。分周器51は、外部から乱数発生装置に入力されるシステムクロックまたは内部発振によるクロックを分周し、分周したクロックを制御信号生成用クロックとしてレジスタ31a〜31bへ出力する。その他の構成および動作は図5に示す制御信号生成部5と同様である。
FIG. 11 is a diagram illustrating a configuration of the control signal generation unit 25.
Referring to FIG. 5, control signal generation unit 25 includes a frequency divider 51 instead of ring oscillator 101 with respect to control signal generation unit 5 shown in FIG. 5. The frequency divider 51 divides a system clock or an internal oscillation clock input to the random number generator from the outside, and outputs the divided clock to the registers 31a to 31b as a control signal generation clock. Other configurations and operations are the same as those of the control signal generator 5 shown in FIG.

したがって、本実施の形態に係る乱数発生装置は、第1の実施の形態に係る乱数発生装置と同様にメタステーブルの寿命に基づく乱数を生成することができるため、乱数性を向上させることができる。   Therefore, since the random number generation device according to the present embodiment can generate a random number based on the lifetime of the metastable as with the random number generation device according to the first embodiment, the randomness can be improved. .

ここで、第1の実施の形態に係る乱数発生装置では、前述のように制御信号生成用クロックの周期を大きくするためにリング発振器101におけるループを構成するインバータの数を増やす等の方法をとる必要があり、リング発振器101の回路規模が大きくなる。しかしながら、本実施の形態に係る乱数発生装置では、クロックを発生するリング発振器が不要となり、また、分周器はたとえば数個のレジスタで構成できることから、回路規模を小さくすることができる。   Here, in the random number generation device according to the first embodiment, as described above, in order to increase the cycle of the control signal generation clock, a method such as increasing the number of inverters constituting the loop in the ring oscillator 101 is employed. Therefore, the circuit scale of the ring oscillator 101 becomes large. However, in the random number generation device according to the present embodiment, a ring oscillator that generates a clock is not necessary, and the frequency divider can be composed of several registers, for example, so that the circuit scale can be reduced.

次に、本発明の他の実施の形態について図面を用いて説明する。なお、図中同一または相当部分には同一符号を付してその説明は繰り返さない。   Next, another embodiment of the present invention will be described with reference to the drawings. In the drawings, the same or corresponding parts are denoted by the same reference numerals and description thereof will not be repeated.

<第4の実施の形態>
本実施の形態は、第1の実施の形態に係る乱数発生装置における制御信号生成部5の構成を変更した乱数発生装置に関する。すなわち、本実施の形態に係る乱数発生装置は、制御信号生成部5の代わりに制御信号生成部35を備える。
<Fourth embodiment>
The present embodiment relates to a random number generation device in which the configuration of the control signal generation unit 5 in the random number generation device according to the first embodiment is changed. That is, the random number generation device according to the present embodiment includes a control signal generation unit 35 instead of the control signal generation unit 5.

図12は、制御信号生成部35の構成を示す図である。
同図を参照して、制御信号生成部25は、レジスタ52a〜52cを含む。レジスタ52a〜52cは、図示しないCPU(Central Processing Unit)からCPUバス経由で受けたデータを、同じくCPUから受けた書き込み信号のタイミングで保持し、保持したデータをそれぞれ発振制御信号、乱数格納信号およびM系列シフト信号として出力する。すなわち、CPUは、レジスタ52a〜52cを制御して、図7と同様の発振制御信号、乱数格納信号およびM系列シフト信号を生成する。ここで、CPUは、乱数発生装置の外部に存在する。
FIG. 12 is a diagram illustrating a configuration of the control signal generation unit 35.
Referring to FIG. 5, control signal generation unit 25 includes registers 52a to 52c. Registers 52a to 52c hold data received from a CPU (Central Processing Unit) (not shown) via a CPU bus at the timing of a write signal similarly received from the CPU, and hold the held data respectively as an oscillation control signal, random number storage signal, and Output as an M-sequence shift signal. That is, the CPU controls the registers 52a to 52c to generate the same oscillation control signal, random number storage signal, and M-sequence shift signal as in FIG. Here, the CPU exists outside the random number generator.

次に、制御信号生成部5が各回路を制御して乱数を生成する際の動作について説明する。   Next, an operation when the control signal generation unit 5 controls each circuit to generate a random number will be described.

図13は、本発明の第4の実施の形態に係る乱数発生装置における各信号のタイムチャートである。   FIG. 13 is a time chart of each signal in the random number generation device according to the fourth embodiment of the present invention.

同図において、CPUバスデータのMSB(Most Significant Bit)がレジスタ52aに対応し、MSBから2ビット目がレジスタ52bに対応し、LSB(Least Significant Bit)がレジスタ52cに対応する。   In the figure, the MSB (Most Significant Bit) of CPU bus data corresponds to the register 52a, the second bit from the MSB corresponds to the register 52b, and the LSB (Least Significant Bit) corresponds to the register 52c.

CPUは、発振制御信号、乱数格納信号およびM系列シフト信号の論理レベルを変更するタイミングに応じてCPUバスデータを変更し、かつ、書き込み信号を各レジスタへ出力することにより、同図に示すような発振制御信号、乱数格納信号およびM系列シフト信号を生成する。その他の動作は図7と同様であるため、ここでは説明を繰り返さない。   The CPU changes the CPU bus data in accordance with the timing of changing the logic levels of the oscillation control signal, random number storage signal, and M-sequence shift signal, and outputs a write signal to each register, as shown in FIG. Generating an oscillation control signal, a random number storage signal, and an M-sequence shift signal. Since other operations are the same as those in FIG. 7, the description will not be repeated here.

したがって、本実施の形態に係る乱数発生装置は、第1の実施の形態に係る乱数発生装置と同様にメタステーブルの寿命に基づく乱数を生成することができるため、乱数性を向上させることができる。   Therefore, since the random number generation device according to the present embodiment can generate a random number based on the lifetime of the metastable as with the random number generation device according to the first embodiment, the randomness can be improved. .

さらに、本実施の形態に係る乱数発生装置では、制御信号生成部35は3個のレジスタだけで構成されるため、第1〜第3の実施の形態に係る乱数発生装置よりも回路規模を小さくすることができる。   Furthermore, in the random number generation device according to the present embodiment, since the control signal generation unit 35 is configured by only three registers, the circuit scale is smaller than that of the random number generation device according to the first to third embodiments. can do.

なお、本実施の形態に係る乱数発生装置では、制御信号生成部25がレジスタ52a〜52cを含む構成としたが、これに限定するものではなく、制御信号生成部25がレジスタ52a〜52cのうちの少なくともいずれか一つを含み、CPUが、発振制御信号、乱数格納信号およびM系列シフト信号のうちの少なくともいずれか一つを制御する構成とすることができる。   In the random number generation device according to the present embodiment, the control signal generation unit 25 includes the registers 52a to 52c. However, the present invention is not limited to this, and the control signal generation unit 25 includes the registers 52a to 52c. The CPU controls at least one of the oscillation control signal, the random number storage signal, and the M-sequence shift signal.

次に、本発明の他の実施の形態について図面を用いて説明する。なお、図中同一または相当部分には同一符号を付してその説明は繰り返さない。   Next, another embodiment of the present invention will be described with reference to the drawings. In the drawings, the same or corresponding parts are denoted by the same reference numerals and description thereof will not be repeated.

<第5の実施の形態>
本実施の形態は、メタステーブルの消滅を検知し、かつ、第1の実施の形態に係る乱数発生装置における制御信号生成部5の構成を変更した乱数発生装置に関する。
<Fifth embodiment>
The present embodiment relates to a random number generation device that detects the disappearance of the metastable and changes the configuration of the control signal generation unit 5 in the random number generation device according to the first embodiment.

図14は、本発明の第5の実施の形態に係る乱数発生装置の構成を示す図である。
同図を参照して、乱数発生装置は、第1の実施の形態に係る乱数発生装置に対して、さらにメタステーブル消滅検知器6を備え、かつ、制御信号生成部5の代わりに制御信号生成部45を備える。メタステーブル消滅検知器6は、レジスタ61と、ANDゲート62とを含む。
FIG. 14 is a diagram showing a configuration of a random number generation device according to the fifth embodiment of the present invention.
Referring to the figure, the random number generator further includes a metastable disappearance detector 6 in addition to the random number generator according to the first embodiment, and generates a control signal instead of the control signal generator 5. The unit 45 is provided. The metastable disappearance detector 6 includes a register 61 and an AND gate 62.

レジスタ61のクロック入力端子にEXORゲート3の出力が接続され、データ入力端子にHレベルの固定電位が接続され、リセット端子に制御信号生成部45からの消滅検知リセットが入力される。ANDゲート62の入力端子の一方にレジスタ61の出力が接続され、他方に制御信号生成部45からのゲート制御信号が入力される。ANDゲート62は両入力端子の論理積を消滅検知結果として制御信号生成部45へ出力する。   The output of the EXOR gate 3 is connected to the clock input terminal of the register 61, the fixed potential of H level is connected to the data input terminal, and the extinction detection reset from the control signal generator 45 is input to the reset terminal. The output of the register 61 is connected to one input terminal of the AND gate 62, and the gate control signal from the control signal generation unit 45 is input to the other. The AND gate 62 outputs the logical product of both input terminals to the control signal generation unit 45 as the disappearance detection result.

次に、本実施の形態に係る乱数発生装置がメタステーブルの消滅を検知して乱数を生成する際の動作について説明する。   Next, an operation when the random number generation device according to the present embodiment detects the disappearance of the metastable and generates a random number will be described.

図15は、本発明の第5の実施の形態に係る乱数発生装置における各信号のタイムチャートである。   FIG. 15 is a time chart of each signal in the random number generation device according to the fifth embodiment of the present invention.

メタステーブルが発生するまでの動作は第1の実施の形態に係る乱数発生装置と同様であるため、ここでは説明を繰り返さない。   Since the operation until the metastable is generated is the same as that of the random number generation device according to the first embodiment, description thereof will not be repeated here.

リング発振器11においてメタステーブルが発生した後、制御信号生成部45は、消滅検知リセットをLレベルからHレベルに変化させる。消滅検知リセットがHレベルになると、レジスタ61はリセット状態となり、レジスタ61の出力はLレベルとなる。   After the metastable is generated in the ring oscillator 11, the control signal generation unit 45 changes the disappearance detection reset from the L level to the H level. When the extinction detection reset becomes H level, the register 61 is reset and the output of the register 61 becomes L level.

次に、制御信号生成部45は、消滅検知リセットをHレベルからLレベルに変化させてレジスタ61のリセット状態を解除する。そして、制御信号生成部45は、レジスタ61のリセット状態が解除された後にゲート制御信号をLレベルからHレベルに変化させ、ANDゲート62から出力される消滅検知結果を受ける。   Next, the control signal generation unit 45 changes the disappearance detection reset from the H level to the L level to release the reset state of the register 61. Then, the control signal generation unit 45 changes the gate control signal from the L level to the H level after the reset state of the register 61 is released, and receives the disappearance detection result output from the AND gate 62.

ここで、メタステーブルが消滅していない場合には、乱数生成部1からの乱数データはHレベルおよびLレベルを繰り返している。また、M系列生成部2からの出力はHレベルまたはLレベルで安定している。したがって、レジスタ61のクロック入力端子に入力されるEXORゲート3からの出力はHレベルおよびLレベルを繰り返しており、また、レジスタ61のデータ入力端子の電位がHレベルであることから、レジスタ61の出力はHレベルである。また、ゲート制御信号がHレベルであることから、ANDゲート62から出力される消滅検知結果はHレベルとなる。そして、制御信号生成部45は、ANDゲート62から受けた消滅検知結果がHレベルである場合にはメタステーブルは未だ消滅していないと判断する。   Here, when the metastable has not disappeared, the random number data from the random number generation unit 1 repeats the H level and the L level. Further, the output from the M sequence generation unit 2 is stable at the H level or the L level. Therefore, the output from the EXOR gate 3 input to the clock input terminal of the register 61 repeats the H level and the L level, and the potential of the data input terminal of the register 61 is the H level. The output is at H level. Since the gate control signal is at the H level, the disappearance detection result output from the AND gate 62 is at the H level. Then, when the disappearance detection result received from the AND gate 62 is at the H level, the control signal generation unit 45 determines that the metastable has not yet disappeared.

そして、制御信号生成部45は、消滅検知リセットをLレベルからHレベルに変化させてレジスタ61を再びリセット状態とする。また、制御信号生成部45は、ゲート制御信号をHレベルからLレベルに変化させる。このように、制御信号生成部45は、メタステーブルが消滅するまで以上の動作(以下、検出動作とも称する。)を繰り返す。   Then, the control signal generation unit 45 changes the extinction detection reset from the L level to the H level to reset the register 61 again. Further, the control signal generation unit 45 changes the gate control signal from the H level to the L level. As described above, the control signal generation unit 45 repeats the above operation (hereinafter also referred to as a detection operation) until the metastable disappears.

一方、メタステーブルが消滅した場合には、乱数生成部1からの乱数データはHレベルまたはLレベルで安定する。また、M系列生成部2からの出力はHレベルまたはLレベルで固定される。したがって、レジスタ61のクロック入力端子に入力されるEXORゲート3からの出力はHレベルまたはLレベルとなり、レジスタ61はデータ入力端子のHレベルをラッチしないため、レジスタ61の出力はリセット状態のLレベルが維持される。制御信号生成部45は、ANDゲート62から受けた消滅検知結果がLレベルである場合にはメタステーブルが消滅したと判断し、乱数格納部4を制御して、EXORゲート3から受けた乱数データを格納する。同図において、制御信号生成部45は、4回目の検知動作において、消滅検知結果がLレベルとなったことからメタステーブルが消滅したと判断し、乱数格納信号をLレベルからHレベルに変化させている。   On the other hand, when the metastable disappears, the random number data from the random number generator 1 is stabilized at the H level or the L level. Further, the output from the M sequence generation unit 2 is fixed at the H level or the L level. Therefore, the output from the EXOR gate 3 input to the clock input terminal of the register 61 becomes H level or L level, and the register 61 does not latch the H level of the data input terminal. Is maintained. The control signal generation unit 45 determines that the metastable has disappeared when the disappearance detection result received from the AND gate 62 is L level, and controls the random number storage unit 4 to control the random number data received from the EXOR gate 3. Is stored. In the figure, in the fourth detection operation, the control signal generation unit 45 determines that the metastable has disappeared because the disappearance detection result has become L level, and changes the random number storage signal from L level to H level. ing.

したがって、本実施の形態に係る乱数発生装置は、メタステーブル消滅検知器6がメタステーブルの消滅を検知し、制御信号生成部45が、メタステーブル消滅検知器6からメタステーブルが消滅したことを表わす消滅検知結果を受けた後に乱数格納部4を制御して、EXORゲート3から受けた乱数データを格納する。このような構成により、メタステーブルの寿命に基づく乱数をより確実に生成することができ、乱数性を向上させることができる。   Therefore, in the random number generation device according to the present embodiment, the metastable disappearance detector 6 detects the disappearance of the metastable, and the control signal generation unit 45 indicates that the metastable disappears from the metastable disappearance detector 6. After receiving the disappearance detection result, the random number storage unit 4 is controlled to store the random number data received from the EXOR gate 3. With such a configuration, a random number based on the life of the metastable can be generated more reliably, and the randomness can be improved.

次に、本発明の他の実施の形態について図面を用いて説明する。なお、図中同一または相当部分には同一符号を付してその説明は繰り返さない。   Next, another embodiment of the present invention will be described with reference to the drawings. In the drawings, the same or corresponding parts are denoted by the same reference numerals and description thereof will not be repeated.

<第6の実施の形態>
本実施の形態は、第5の実施の形態に係る乱数発生装置における制御信号生成部45の動作内容を追加した乱数発生装置に関する。
<Sixth Embodiment>
The present embodiment relates to a random number generator to which the operation content of the control signal generator 45 in the random number generator according to the fifth embodiment is added.

ここでは、本実施の形態に係る乱数発生装置がメタステーブルの消滅を検知して乱数を生成する際の動作について説明する。   Here, the operation when the random number generation device according to the present embodiment detects the disappearance of the metastable and generates a random number will be described.

図16は、本発明の第6の実施の形態に係る乱数発生装置における各信号のタイムチャートである。   FIG. 16 is a time chart of each signal in the random number generation device according to the sixth embodiment of the present invention.

制御信号生成部45は、メタステーブルが発生してから所定時間経過してもメタステーブルが消滅しない場合、すなわち検出動作を所定回数行なってもANDゲート62からの消滅検知結果がHレベルのままである場合には、乱数格納部4を制御して、EXORゲート3から受けた乱数データを格納する。同図において、制御信号生成部45は、x回目(xは1以上の自然数)の検知動作においても消滅検知結果がHレベルであることから乱数格納信号をLレベルからHレベルに変化させている。   If the metastable does not disappear even after a predetermined time has elapsed since the metastable is generated, that is, the control signal generation unit 45 maintains the H detection level from the AND gate 62 even if the detection operation is performed a predetermined number of times. In some cases, the random number storage unit 4 is controlled to store the random number data received from the EXOR gate 3. In the figure, the control signal generation unit 45 changes the random number storage signal from the L level to the H level since the disappearance detection result is also at the H level even in the x-th detection operation (x is a natural number of 1 or more). .

そして、制御信号生成部45は、発振制御信号およびM系列シフト信号をLレベルからHレベルに変化させて次の乱数生成を開始する。   Then, the control signal generation unit 45 changes the oscillation control signal and the M-sequence shift signal from the L level to the H level and starts generating the next random number.

したがって、本実施の形態に係る乱数発生装置では、乱数生成時間が長くなりすぎることを防ぐことができる。また、本実施の形態に係る乱数発生装置では、メタステーブルの寿命に基づく乱数が生成されないが、メタステーブルが発生してから、メタステーブル消滅前に乱数格納信号をLレベルからHレベルに変化させるまでの期間を適切に設定することにより、乱数性を十分に向上させることができる。   Therefore, the random number generation device according to the present embodiment can prevent the random number generation time from becoming too long. Further, in the random number generation device according to the present embodiment, a random number based on the life of the metastable is not generated. However, after the metastable is generated, the random number storage signal is changed from the L level to the H level before the metastable disappears. The randomness can be sufficiently improved by appropriately setting the period up to.

次に、本発明の他の実施の形態について図面を用いて説明する。なお、図中同一または相当部分には同一符号を付してその説明は繰り返さない。   Next, another embodiment of the present invention will be described with reference to the drawings. In the drawings, the same or corresponding parts are denoted by the same reference numerals and description thereof will not be repeated.

<第7の実施の形態>
本実施の形態は、第1の実施の形態に係る乱数発生装置における制御信号生成部5の構成を変更した乱数発生装置に関する。
<Seventh embodiment>
The present embodiment relates to a random number generation device in which the configuration of the control signal generation unit 5 in the random number generation device according to the first embodiment is changed.

図17は、本発明の第7の実施の形態に係る乱数発生装置の構成を示す図である。
同図を参照して、乱数発生装置は、第1の実施の形態に係る乱数発生装置に対して、制御信号生成部5の代わりに制御信号生成部55を備える。制御信号生成部55は、レジスタ71a〜レジスタ71eを含む。
FIG. 17 is a diagram showing a configuration of a random number generation device according to the seventh embodiment of the present invention.
With reference to the figure, the random number generation device includes a control signal generation unit 55 instead of the control signal generation unit 5 with respect to the random number generation device according to the first embodiment. The control signal generation unit 55 includes a register 71a to a register 71e.

レジスタ71a〜71eは、図示しないCPUからCPUバス経由で受けたデータを、同じくCPUから受けた書き込み信号のタイミングで保持し、保持したデータをそれぞれ発振制御信号、M系列シフト信号、乱数格納信号、消滅検知リセットおよびゲート制御信号として出力する。ここで、CPUは、乱数発生装置の外部に存在する。   Registers 71a to 71e hold data received from a CPU (not shown) via a CPU bus at the timing of a write signal also received from the CPU, and the held data are respectively an oscillation control signal, an M-sequence shift signal, a random number storage signal, Output as extinction detection reset and gate control signal. Here, the CPU exists outside the random number generator.

メタステーブル消滅検知器6におけるANDゲート62から出力される消滅検知結果は、CPUバス経由でCPUへ出力される。   The disappearance detection result output from the AND gate 62 in the metastable disappearance detector 6 is output to the CPU via the CPU bus.

図18は、CPUが本発明の第7の実施の形態に係る乱数発生装置を制御して乱数を生成する際の動作手順を定めたフローチャートである。   FIG. 18 is a flowchart defining an operation procedure when the CPU controls the random number generation device according to the seventh embodiment of the present invention to generate a random number.

まず、CPUは、レジスタ71aおよびレジスタ71bの出力をLレベルからHレベルに変化させる。すなわち、CPUは、発振制御信号およびM系列シフト信号をLレベルからHレベルに変化させる。発振制御信号がLレベルからHレベルになると、乱数生成部1におけるリング発振器11が発振状態となる。また、M系列シフト信号がLレベルからHレベルになると、M系列生成部2における各レジスタがシフト動作を行ない、M系列生成部2の出力、すなわち擬似乱数データの論理レベルがたとえばLレベルからHレベルに変化する(S1)。   First, the CPU changes the outputs of the registers 71a and 71b from the L level to the H level. That is, the CPU changes the oscillation control signal and the M-sequence shift signal from the L level to the H level. When the oscillation control signal changes from the L level to the H level, the ring oscillator 11 in the random number generation unit 1 enters the oscillation state. When the M-sequence shift signal changes from the L level to the H level, each register in the M-sequence generation unit 2 performs a shift operation, and the output of the M-sequence generation unit 2, that is, the logic level of the pseudorandom data is, for example, from the L level to the H level. The level changes (S1).

次に、CPUは、レジスタ71aおよびレジスタ71bの出力をHレベルからLレベルに変化させる。すなわち、CPUは、発振制御信号およびM系列シフト信号をHレベルからLレベルに変化させる。発振制御信号がHレベルからLレベルになるとリング発振器11が発振状態でなくなり、リング発振器11においてメタステーブルが発生する(S2)。   Next, the CPU changes the outputs of the register 71a and the register 71b from the H level to the L level. That is, the CPU changes the oscillation control signal and the M-sequence shift signal from the H level to the L level. When the oscillation control signal changes from the H level to the L level, the ring oscillator 11 stops oscillating and a metastable is generated in the ring oscillator 11 (S2).

リング発振器11においてメタステーブルが発生した後、CPUは、レジスタ71dの出力をLレベルからHレベルに変化させる。すなわち、CPUは、消滅検知リセットをLレベルからHレベルに変化させる。消滅検知リセットがHレベルになると、レジスタ61はリセット状態となり、レジスタ61の出力はLレベルとなる(S3)。   After the metastable is generated in the ring oscillator 11, the CPU changes the output of the register 71d from the L level to the H level. That is, the CPU changes the disappearance detection reset from the L level to the H level. When the extinction detection reset becomes H level, the register 61 is reset, and the output of the register 61 becomes L level (S3).

次に、CPUは、消滅検知リセットをHレベルからLレベルに変化させてレジスタ61のリセット状態を解除する。そして、CPUは、レジスタ61のリセット状態が解除された後にゲート制御信号をLレベルからHレベルに変化させて、ANDゲート62から出力される消滅検知結果をCPUバス経由で読み出す。   Next, the CPU changes the disappearance detection reset from the H level to the L level to release the reset state of the register 61. Then, after the reset state of the register 61 is released, the CPU changes the gate control signal from the L level to the H level, and reads the disappearance detection result output from the AND gate 62 via the CPU bus.

CPUは、ANDゲート62から受けた消滅検知結果がLレベルである場合にはメタステーブルが消滅したと判断し(S5でYES)、レジスタ71cの出力をLレベルからHレベルに変化させる。すなわち、CPUは、乱数格納信号をLレベルからHレベルに変化させることにより、乱数格納部4にEXORゲート3から受けた乱数データを格納させる制御を行なう。そして、乱数格納部4が格納した1bitの乱数データは乱数としてCPUバス経由でCPUへ出力される、すなわち、CPUは、乱数格納部4が格納した1bitの乱数データを乱数として読み出す(S6)。   When the disappearance detection result received from the AND gate 62 is L level, the CPU determines that the metastable has disappeared (YES in S5), and changes the output of the register 71c from L level to H level. That is, the CPU controls the random number storage unit 4 to store the random number data received from the EXOR gate 3 by changing the random number storage signal from the L level to the H level. The 1-bit random number data stored in the random number storage unit 4 is output as a random number to the CPU via the CPU bus, that is, the CPU reads out the 1-bit random number data stored in the random number storage unit 4 as a random number (S6).

一方、CPUは、ANDゲート62から受けた消滅検知結果がHレベルである場合にはメタステーブルは未だ消滅していないと判断し(S5でNO)、変数として保持している”消滅検知結果の読み出し回数”に1を加える(S7)。   On the other hand, when the disappearance detection result received from the AND gate 62 is at the H level, the CPU determines that the metastable has not yet disappeared (NO in S5), and holds it as a variable of the “annihilation detection result 1 is added to the “number of readings” (S7).

CPUは、消滅検知結果の読み出し回数が所定の読み出し限度回数以上である場合には(S8でYES)、乱数格納信号をLレベルからHレベルに変化させることにより、乱数格納部4にEXORゲート3から受けた乱数データを格納させる制御を行なう。そして、CPUは、乱数格納部4が格納した1bitの乱数データを乱数として読み出す(S6)。   When the number of readings of the disappearance detection result is equal to or greater than the predetermined number of readings (YES in S8), the CPU changes the random number storage signal from the L level to the H level, thereby causing the EXOR gate 3 to be stored in the random number storage unit 4. Control to store the random number data received from. Then, the CPU reads 1-bit random number data stored in the random number storage unit 4 as a random number (S6).

一方、CPUは、消滅検知結果の読み出し回数が所定の読み出し限度回数未満である場合には(S8でNO)、消滅検知リセットをLレベルからHレベルに変化させてレジスタ61を再びリセット状態とする(S3)。また、CPUは、ゲート制御信号をHレベルからLレベルに変化させる。   On the other hand, when the number of readings of the annihilation detection result is less than the predetermined number of readings (NO in S8), the CPU changes the annihilation detection reset from the L level to the H level to reset the register 61 again. (S3). Further, the CPU changes the gate control signal from the H level to the L level.

CPUは、乱数を所定ビット数分取得した場合には(S9でYES)、取得した乱数を図示しない暗号器、ハッシュ関数生成部およびM系列生成部へ出力する(S10)。なお、暗号器、ハッシュ関数生成部およびM系列生成部は、回路、またはCPU等に組み込まれたソフトウェアによって構成される。   When the CPU acquires random numbers for a predetermined number of bits (YES in S9), the CPU outputs the acquired random numbers to an encryptor, a hash function generator, and an M sequence generator (not shown) (S10). The encryptor, the hash function generation unit, and the M series generation unit are configured by a circuit or software incorporated in a CPU or the like.

一方、CPUは、乱数を所定ビット数分取得していない場合には(S9でNO)、レジスタ71aおよびレジスタ71bの出力をLレベルからHレベルに変化させて、次の乱数生成を開始する(S1)。   On the other hand, if the CPU has not acquired random numbers for a predetermined number of bits (NO in S9), the CPU changes the outputs of the register 71a and the register 71b from the L level to the H level and starts generating the next random number ( S1).

したがって、本実施の形態に係る乱数発生装置は、第1の実施の形態に係る乱数発生装置と同様にメタステーブルの寿命に基づく乱数を生成することができるため、乱数性を向上させることができる。   Therefore, since the random number generation device according to the present embodiment can generate a random number based on the lifetime of the metastable as with the random number generation device according to the first embodiment, the randomness can be improved. .

さらに、本実施の形態に係る乱数発生装置では、制御信号生成部55は5個のレジスタだけで構成されるため、第5〜第6の実施の形態に係る乱数発生装置よりも回路規模を小さくすることができる。   Furthermore, in the random number generation device according to the present embodiment, since the control signal generation unit 55 is configured by only five registers, the circuit scale is smaller than that of the random number generation devices according to the fifth to sixth embodiments. can do.

次に、本発明の他の実施の形態について図面を用いて説明する。なお、図中同一または相当部分には同一符号を付してその説明は繰り返さない。   Next, another embodiment of the present invention will be described with reference to the drawings. In the drawings, the same or corresponding parts are denoted by the same reference numerals and description thereof will not be repeated.

<第8の実施の形態>
本実施の形態は、リング発振器のテストを行なう乱数発生装置に関する。
<Eighth Embodiment>
The present embodiment relates to a random number generator for testing a ring oscillator.

図19は、本発明の第8の実施の形態に係る乱数発生装置におけるリング発振器のテスト方法を説明するための乱数発生装置の概略図である。   FIG. 19 is a schematic diagram of a random number generator for explaining a test method of the ring oscillator in the random number generator according to the eighth embodiment of the present invention.

同図を参照して、乱数発生装置は、セレクタ73と、カウンタ74と、複数個のリング発振器75とを備える。   Referring to the figure, the random number generator includes a selector 73, a counter 74, and a plurality of ring oscillators 75.

次に、リング発振器のテストを行なう際の乱数発生装置の動作について説明する。
まず、図示しない制御信号生成部は、発振制御信号をリング発振器75へ出力し、リング発振器75を発振状態とする。
Next, the operation of the random number generator when testing the ring oscillator will be described.
First, a control signal generation unit (not shown) outputs an oscillation control signal to the ring oscillator 75 so that the ring oscillator 75 is in an oscillation state.

また、セレクタ73は、複数個のリング発振器75から受けた信号のうち、テスト対象のリング発振器75から受けた信号を選択してカウンタ74へ出力する。   The selector 73 selects a signal received from the ring oscillator 75 to be tested among the signals received from the plurality of ring oscillators 75 and outputs the selected signal to the counter 74.

ここで、リング発振器75は、たとえばリング発振器11、リング発振器13およびリング発振器101である。リング発振器11では、インバータ21b〜21eおよびレジスタ23a〜23cのうちのいずれか一つの出力がセレクタ73に接続される。また、リング発振器13では、NANDゲート41a〜41fおよびレジスタ23a〜23cのうちのいずれか一つの出力がセレクタ73に接続される。また、リング発振器101では、ANDゲート33およびインバータ34a〜34cのうちのいずれか一つの出力がセレクタ73に接続される。   Here, the ring oscillator 75 is, for example, the ring oscillator 11, the ring oscillator 13, and the ring oscillator 101. In the ring oscillator 11, any one output of the inverters 21 b to 21 e and the registers 23 a to 23 c is connected to the selector 73. In the ring oscillator 13, the output of any one of the NAND gates 41 a to 41 f and the registers 23 a to 23 c is connected to the selector 73. In the ring oscillator 101, the output of any one of the AND gate 33 and the inverters 34 a to 34 c is connected to the selector 73.

カウンタ74は、セレクタ73経由で受けたテスト対象のリング発振器75の出力を所定時間カウントする。   The counter 74 counts the output of the test target ring oscillator 75 received via the selector 73 for a predetermined time.

そして、図示しないテスト制御部がカウンタ74のカウント値を読み出し、リング発振器75の発振周波数を算出する。発振周波数が所定の範囲内である場合にはテスト対象のリング発振器75は合格となり、また、発振周波数が所定の範囲外である場合にはテスト対象のリング発振器75は不合格となる。   A test control unit (not shown) reads the count value of the counter 74 and calculates the oscillation frequency of the ring oscillator 75. When the oscillation frequency is within the predetermined range, the ring oscillator 75 to be tested is acceptable, and when the oscillation frequency is outside the predetermined range, the ring oscillator 75 to be tested is unacceptable.

なお、カウンタ74がリング発振器11およびリング発振器13におけるレジスタの出力をカウントする場合には、インバータまたはNANDゲートの出力をカウントする場合と比べてカウント値が半分になるため、発振周波数はカウント値の2倍に基づいて算出される。その他の構成および動作は前述の第1の実施の形態に係る乱数発生装置等と同様である。   When the counter 74 counts the output of the register in the ring oscillator 11 and the ring oscillator 13, the count value is halved as compared with the case of counting the output of the inverter or the NAND gate. Calculated based on 2 times. Other configurations and operations are the same as those of the random number generator according to the first embodiment described above.

したがって、本実施の形態に係る乱数発生装置では、リング発振器75のテストを乱数発生装置内部で行なうことができるため、リング発振器75の出力またはカウント値を乱数発生装置外部へ出力する必要がなくなり、テスト時間の短縮を図ることができる。   Therefore, in the random number generation device according to the present embodiment, since the test of ring oscillator 75 can be performed inside the random number generation device, it is not necessary to output the output of ring oscillator 75 or the count value to the outside of the random number generation device. Test time can be shortened.

なお、乱数発生装置がカウンタ74を備えず、リング発振器75の出力がセレクタ73経由で乱数発生装置の外部へ出力される構成としてもよい。このような構成により、乱数発生装置の外部に存在するCPU等がリング発振器75からの出力と所定のテストパターンとを比較して、リング発振器75の合否を判定することができるため、カウンタ74およびテスト制御部等が不要となり、回路規模を小さくすることができる。   The random number generator may not include the counter 74, and the output of the ring oscillator 75 may be output to the outside of the random number generator via the selector 73. With such a configuration, since a CPU or the like existing outside the random number generator can compare the output from the ring oscillator 75 with a predetermined test pattern to determine whether the ring oscillator 75 is acceptable, the counter 74 and A test control unit or the like becomes unnecessary, and the circuit scale can be reduced.

次に、本発明の他の実施の形態について図面を用いて説明する。なお、図中同一または相当部分には同一符号を付してその説明は繰り返さない。   Next, another embodiment of the present invention will be described with reference to the drawings. In the drawings, the same or corresponding parts are denoted by the same reference numerals and description thereof will not be repeated.

<第9の実施の形態>
本実施の形態は、第8の実施の形態に係る乱数発生装置におけるカウンタ74の代わりにM系列生成部2を変形してカウンタ機能を追加した乱数発生装置に関する。
<Ninth embodiment>
The present embodiment relates to a random number generation device in which a counter function is added by modifying the M-sequence generation unit 2 instead of the counter 74 in the random number generation device according to the eighth embodiment.

図20は、本発明の第9の実施の形態に係る乱数発生装置におけるリング発振器のテスト方法を説明するための乱数発生装置の概略図である。   FIG. 20 is a schematic diagram of a random number generator for explaining a ring oscillator test method in the random number generator according to the ninth embodiment of the present invention.

同図を参照して、乱数発生装置は、第8の実施の形態に係る乱数発生装置に対して、カウンタ74を備えず、また、M系列生成部2の代わりにM系列生成部76を備える。セレクタ73は、図示しない制御信号生成部から受けたM系列シフト信号またはリング発振器75の出力を選択してM系列生成部76へ出力する。   Referring to the figure, the random number generation device is not provided with a counter 74 as compared with the random number generation device according to the eighth embodiment, and is provided with an M sequence generation unit 76 instead of M sequence generation unit 2. . Selector 73 selects an M-sequence shift signal received from a control signal generator (not shown) or an output of ring oscillator 75 and outputs the selected signal to M-sequence generator 76.

図21は、M系列生成部76の構成の概略図である。
同図を参照して、M系列生成部76は、セレクタ81と、M系列ロジック82と、カウンタロジック83と、セレクタ84と、レジスタ91とを含む。
FIG. 21 is a schematic diagram of the configuration of the M sequence generation unit 76.
Referring to FIG. 4, M series generation unit 76 includes a selector 81, an M series logic 82, a counter logic 83, a selector 84, and a register 91.

M系列ロジック82は、レジスタ91間に配置される、M系列生成用の論理回路である。M系列ロジック82は、EXORゲート92またはORゲート94を含む回路か、または配線のみの回路かのいずれかである。   The M series logic 82 is an M series generation logic circuit arranged between the registers 91. The M-series logic 82 is either a circuit including the EXOR gate 92 or the OR gate 94 or a circuit only of wiring.

カウンタロジック83は、レジスタ91間に配置される、リング発振器75の出力のカウント用の論理回路であり、レジスタ91との組み合わせでカウンタ機能を実現する。   The counter logic 83 is a logic circuit for counting the output of the ring oscillator 75 disposed between the registers 91, and realizes a counter function in combination with the register 91.

セレクタ81は、M系列カウンタ切り替え信号に基づいて、前段のM系列ロジック82の出力またはカウンタロジック83の出力を選択してレジスタ91へ出力する。   The selector 81 selects the output of the preceding M-sequence logic 82 or the output of the counter logic 83 based on the M-sequence counter switching signal and outputs it to the register 91.

セレクタ84は、M系列カウンタ切り替え信号に基づいて、M系列生成用のクロック、すなわちM系列シフト信号、またはリング発振器75の出力を選択して各レジスタ91のクロック入力端子へ出力する。   The selector 84 selects the M-sequence generation clock, that is, the M-sequence shift signal, or the output of the ring oscillator 75 based on the M-sequence counter switching signal, and outputs it to the clock input terminal of each register 91.

レジスタ91は、セレクタ84の選択したデータをクロックとして使用し、このクロックのタイミングでセレクタ81の選択したデータを保持して次段のM系列ロジック82およびカウンタロジック83へ出力する。   The register 91 uses the data selected by the selector 84 as a clock, holds the data selected by the selector 81 at the timing of this clock, and outputs it to the M-sequence logic 82 and the counter logic 83 in the next stage.

リング発振器のテストが行なわれる場合には、M系列カウンタ切り替え信号に基づいて、セレクタ81はカウンタロジック83の出力を選択し、また、セレクタ84はリング発振器75の出力を選択する。この場合、M系列生成部76は、リング発振器75の出力をカウントする。   When the ring oscillator test is performed, the selector 81 selects the output of the counter logic 83 and the selector 84 selects the output of the ring oscillator 75 based on the M-sequence counter switching signal. In this case, the M sequence generation unit 76 counts the output of the ring oscillator 75.

一方、乱数が生成される通常動作においては、M系列カウンタ切り替え信号に基づいて、セレクタ81はM系列ロジック82の出力を選択し、また、セレクタ84はM系列シフト信号を選択する。この場合、M系列生成部76はM系列を生成する。   On the other hand, in a normal operation in which random numbers are generated, the selector 81 selects the output of the M-sequence logic 82 and the selector 84 selects the M-sequence shift signal based on the M-sequence counter switching signal. In this case, the M sequence generation unit 76 generates an M sequence.

その他の構成および動作は前述の第1の実施の形態に係る乱数発生装置等と同様である。   Other configurations and operations are the same as those of the random number generator according to the first embodiment described above.

したがって、本実施の形態に係る乱数発生装置では、カウンタ74の代わりにM系列生成部76を変形してリング発振器75の出力をカウントすることができるため、第9の実施の形態に係る乱数発生装置と比べて回路規模を小さくすることができる。   Therefore, in the random number generation device according to the present embodiment, since the M-sequence generation unit 76 can be modified instead of the counter 74 and the output of the ring oscillator 75 can be counted, the random number generation according to the ninth embodiment The circuit scale can be reduced as compared with the device.

次に、本発明の他の実施の形態について図面を用いて説明する。なお、図中同一または相当部分には同一符号を付してその説明は繰り返さない。   Next, another embodiment of the present invention will be described with reference to the drawings. In the drawings, the same or corresponding parts are denoted by the same reference numerals and description thereof will not be repeated.

<第10の実施の形態>
本実施の形態は、図2に示すリング発振器11および2値化部12にリング発振器の縮退故障テスト機能を追加した乱数発生装置に関する。
<Tenth Embodiment>
The present embodiment relates to a random number generator in which a ring oscillator stuck-at fault test function is added to the ring oscillator 11 and the binarization unit 12 shown in FIG.

図22は、本発明の第10の実施の形態に係る乱数発生装置におけるリング発振器111および2値化部12の構成を示す図である。   FIG. 22 is a diagram illustrating a configuration of the ring oscillator 111 and the binarization unit 12 in the random number generation device according to the tenth embodiment of the present invention.

同図を参照して、リング発振器111は、リング発振器11に対して、さらに、セレクタ85〜86を含む。   Referring to FIG. 11, ring oscillator 111 further includes selectors 85 to 86 with respect to ring oscillator 11.

セレクタ85は、テストデータ1またはインバータ21eの出力を選択してインバータ21bへ出力する。セレクタ86は、テストデータ2またはインバータ21cの出力を選択してインバータ21dへ出力する。レジスタ23a〜23cは、乱数発生装置の外部から読み出し可能である。   The selector 85 selects the test data 1 or the output of the inverter 21e and outputs it to the inverter 21b. The selector 86 selects the test data 2 or the output of the inverter 21c and outputs it to the inverter 21d. The registers 23a to 23c can be read from the outside of the random number generator.

まず、図示しない制御信号生成部は、発振制御信号をHレベルにする。発振制御信号がHレベルになると、インバータ21c〜21eと、NANDゲート22aおよび22cとからなるループが形成される。   First, a control signal generation unit (not shown) sets the oscillation control signal to the H level. When the oscillation control signal becomes H level, a loop including inverters 21c to 21e and NAND gates 22a and 22c is formed.

次に、乱数発生装置の外部に存在するCPUがCPUバス経由でテストデータ2をセレクタ86へ出力する。そうすると、テストデータ2に応じたデータがレジスタ23a〜23cに保持される。   Next, the CPU existing outside the random number generator outputs the test data 2 to the selector 86 via the CPU bus. Then, data corresponding to the test data 2 is held in the registers 23a to 23c.

そして、CPUがレジスタ23a〜23cの保持するデータをCPUバス経由で読み出し、乱数発生装置に入力するテストデータに対応する検証用のテストパターンと比較して、リング発振器111の合否を判定する。   Then, the CPU reads the data held in the registers 23a to 23c via the CPU bus and compares the data with the test pattern for verification corresponding to the test data input to the random number generator, and determines whether the ring oscillator 111 is acceptable.

次に、制御信号生成部5は、発振制御信号をHレベルからLレベルに変化させる。発振制御信号がHレベルからLレベルになると、インバータ21b〜21eと、NANDゲート22bおよび22cとからなるループが形成される。   Next, the control signal generator 5 changes the oscillation control signal from the H level to the L level. When the oscillation control signal changes from the H level to the L level, a loop including inverters 21b to 21e and NAND gates 22b and 22c is formed.

そして、CPUがCPUバス経由でテストデータ1をセレクタ85へ出力する。そうすると、テストデータ1に応じたデータがレジスタ23a〜23cに保持される。   Then, the CPU outputs test data 1 to the selector 85 via the CPU bus. Then, data corresponding to the test data 1 is held in the registers 23a to 23c.

そして、CPUがレジスタ23a〜23cの保持するデータをCPUバス経由で読み出し、乱数発生装置に入力するテストデータに対応する検証用のテストパターンと比較して、リング発振器111の合否を判定する。なお、テストデータ1〜2は、シミュレーションで生成された、回路の故障を100%検出できるテストパターンであることが好ましい。   Then, the CPU reads the data held in the registers 23a to 23c via the CPU bus and compares the data with the test pattern for verification corresponding to the test data input to the random number generator, and determines whether the ring oscillator 111 is acceptable. The test data 1 and 2 are preferably test patterns generated by simulation and capable of detecting 100% of circuit failures.

また、レジスタ23a〜23cは、乱数発生装置の外部から書き込み可能である。EXORゲート24の出力は外部から読み出し可能である。   The registers 23a to 23c can be written from the outside of the random number generator. The output of the EXOR gate 24 can be read from the outside.

CPUがCPUバス経由でテストデータ3をレジスタ23a〜23cに書き込む。そして、CPUは、EXORゲート24の出力をCPUバス経由で読み出し、レジスタ23a〜23cに書き込んだテストデータ3に対応する検証用のテストパターンと比較して、リング発振器111の合否を判定する。   The CPU writes the test data 3 to the registers 23a to 23c via the CPU bus. Then, the CPU reads the output of the EXOR gate 24 via the CPU bus and compares the verification result with the test pattern for verification corresponding to the test data 3 written in the registers 23a to 23c, and determines the pass / fail of the ring oscillator 111.

その他の構成および動作は前述の第1の実施の形態に係る乱数発生装置等と同様である。   Other configurations and operations are the same as those of the random number generator according to the first embodiment described above.

したがって、本実施の形態に係る乱数発生装置では、セレクタ85およびセレクタ86にテストデータ1〜2を入力することにより、リング発振器111の縮退故障、すなわち各ゲートの入力または出力が一定の論理レベルに固定されてしまう故障を検出することができる。   Therefore, in the random number generation device according to the present embodiment, by inputting test data 1 and 2 to selector 85 and selector 86, the stuck-at fault of ring oscillator 111, that is, the input or output of each gate becomes a constant logic level. Faults that are fixed can be detected.

また、リング発振器111におけるセレクタ85およびセレクタ86の2箇所でテストデータの入力を行なうことにより、セレクタ85およびセレクタ86の入力部分についても縮退故障の検出を行なうことができる。   Further, by inputting test data at two locations of the selector 85 and the selector 86 in the ring oscillator 111, it is possible to detect stuck-at faults at the input portions of the selector 85 and the selector 86 as well.

また、レジスタ23a〜23cは、乱数発生装置の外部から読み出し可能である。このような構成により、乱数発生装置に入力するテストデータに対応する検証用のテストパターンを乱数発生装置内で保持し、かつ、これらを比較してリング発振器111の合否を判定する回路を乱数発生装置内で備える必要がなくなり、回路規模を小さくすることができる。   The registers 23a to 23c can be read from outside the random number generator. With such a configuration, the test pattern for verification corresponding to the test data input to the random number generator is held in the random number generator, and a circuit for determining whether the ring oscillator 111 is acceptable or not by comparing these is generated. It is not necessary to provide in the apparatus, and the circuit scale can be reduced.

また、レジスタ23a〜23cは、乱数発生装置の外部から書き込み可能であり、EXORゲート24の出力は外部から読み出し可能である。このような構成により、レジスタ23a〜23cおよびEXORゲート24の縮退故障の検出を行なうことができる。   The registers 23a to 23c can be written from the outside of the random number generator, and the output of the EXOR gate 24 can be read from the outside. With such a configuration, the stuck-at faults of the registers 23a to 23c and the EXOR gate 24 can be detected.

次に、本発明の他の実施の形態について図面を用いて説明する。なお、図中同一または相当部分には同一符号を付してその説明は繰り返さない。   Next, another embodiment of the present invention will be described with reference to the drawings. In the drawings, the same or corresponding parts are denoted by the same reference numerals and description thereof will not be repeated.

<第11の実施の形態>
本実施の形態は、図8に示すリング発振器13および2値化部12にリング発振器の縮退故障テスト機能を追加した乱数発生装置に関する。
<Eleventh embodiment>
The present embodiment relates to a random number generator in which a ring oscillator stuck-at fault test function is added to the ring oscillator 13 and the binarization unit 12 shown in FIG.

図23は、本発明の第11の実施の形態に係る乱数発生装置におけるリング発振器113および2値化部12の構成を示す図である。   FIG. 23 is a diagram showing a configuration of the ring oscillator 113 and the binarization unit 12 in the random number generation device according to the eleventh embodiment of the present invention.

同図を参照して、リング発振器113は、リング発振器13に対して、さらに、セレクタ42a〜42fを含む。   With reference to the figure, ring oscillator 113 further includes selectors 42 a to 42 f with respect to ring oscillator 13.

セレクタ42a〜42fは、テストデータa〜fまたは発振制御信号を選択してNANDゲート41a〜41fへ出力する。   The selectors 42a to 42f select the test data a to f or the oscillation control signal and output them to the NAND gates 41a to 41f.

乱数発生装置の外部に存在するCPUがCPUバス経由でテストデータa〜fをセレクタ42a〜42fへ出力する。CPUは、セレクタ42a〜42fへのテストデータa〜fを個別に制御することができる。なお、テストデータa〜fは、シミュレーションで生成された、回路の故障を100%検出できるテストパターンであることが好ましい。   A CPU existing outside the random number generator outputs test data a to f to the selectors 42 a to 42 f via the CPU bus. The CPU can individually control the test data a to f to the selectors 42 a to 42 f. The test data a to f are preferably test patterns generated by simulation and capable of detecting 100% of circuit faults.

この乱数発生装置がリング発振器の縮退故障テストを行なう際の動作としては、たとえば、図示しない制御信号生成部が、発振制御信号をLレベルからHレベルに変化させる際に、セレクタ42a〜42fのうちの少なくともいずれか一つがテストデータを選択し、CPUが発振制御信号と同様の信号をテストデータとしてセレクタに出力する。そして、リング発振器113においてメタステーブルが発生するか否かをレジスタ23a〜23cまたはEXORゲート24の出力をCPUバス経由でCPUが読み出すことによって確認する。   As an operation when the random number generator performs a stuck-at fault test of the ring oscillator, for example, when a control signal generator (not shown) changes the oscillation control signal from L level to H level, among the selectors 42a to 42f, At least one of them selects test data, and the CPU outputs a signal similar to the oscillation control signal to the selector as test data. Then, whether or not metastable is generated in the ring oscillator 113 is confirmed by the CPU reading the output of the registers 23a to 23c or the EXOR gate 24 via the CPU bus.

その他の構成および動作は前述の第1の実施の形態に係る乱数発生装置等と同様である。   Other configurations and operations are the same as those of the random number generator according to the first embodiment described above.

したがって、本実施の形態に係る乱数発生装置では、セレクタ42a〜42fにテストデータを入力することにより、リング発振器113の縮退故障を検出することができる。   Therefore, in the random number generation device according to the present embodiment, a stuck-at fault of ring oscillator 113 can be detected by inputting test data to selectors 42a to 42f.

また、リング発振器113の各NANDゲートにおいてテストデータを入力することにより、セレクタ42a〜42fの入力部分についても縮退故障の検出を行なうことができる。   Further, by inputting test data to each NAND gate of the ring oscillator 113, stuck-at faults can be detected in the input portions of the selectors 42a to 42f.

今回開示された実施の形態はすべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は上記した説明ではなくて特許請求の範囲によって示され、特許請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。   The embodiment disclosed this time should be considered as illustrative in all points and not restrictive. The scope of the present invention is defined by the terms of the claims, rather than the description above, and is intended to include any modifications within the scope and meaning equivalent to the terms of the claims.

本発明の第1の実施の形態に係る乱数発生装置の構成を示す図である。It is a figure which shows the structure of the random number generator which concerns on the 1st Embodiment of this invention. リング発振器11および2値化部12の構成を示す図である。FIG. 3 is a diagram illustrating a configuration of a ring oscillator 11 and a binarization unit 12. リング発振器11および2値化部12の動作を説明するためのタイムチャートである。3 is a time chart for explaining operations of a ring oscillator 11 and a binarization unit 12; M系列生成部2の構成を示す図である。3 is a diagram illustrating a configuration of an M sequence generation unit 2. FIG. 制御信号生成部5の構成を示す図である。3 is a diagram illustrating a configuration of a control signal generation unit 5. FIG. リング発振器101の構成を示す図である。2 is a diagram showing a configuration of a ring oscillator 101. FIG. 本発明の第1の実施の形態に係る乱数発生装置における各信号のタイムチャートである。It is a time chart of each signal in the random number generator which concerns on the 1st Embodiment of this invention. リング発振器13の構成を示す図である。2 is a diagram illustrating a configuration of a ring oscillator 13. FIG. 制御信号生成部15の構成を示す図である。2 is a diagram illustrating a configuration of a control signal generation unit 15. FIG. 本発明の第2の実施の形態に係る乱数発生装置における各信号のタイムチャートである。It is a time chart of each signal in the random number generator which concerns on the 2nd Embodiment of this invention. 制御信号生成部25の構成を示す図である。3 is a diagram illustrating a configuration of a control signal generation unit 25. FIG. 制御信号生成部35の構成を示す図である。3 is a diagram illustrating a configuration of a control signal generation unit 35. FIG. 本発明の第4の実施の形態に係る乱数発生装置における各信号のタイムチャートである。It is a time chart of each signal in the random number generator which concerns on the 4th Embodiment of this invention. 本発明の第5の実施の形態に係る乱数発生装置の構成を示す図である。It is a figure which shows the structure of the random number generator which concerns on the 5th Embodiment of this invention. 本発明の第5の実施の形態に係る乱数発生装置における各信号のタイムチャートである。It is a time chart of each signal in the random number generator which concerns on the 5th Embodiment of this invention. 本発明の第6の実施の形態に係る乱数発生装置における各信号のタイムチャートである。It is a time chart of each signal in the random number generator which concerns on the 6th Embodiment of this invention. 本発明の第7の実施の形態に係る乱数発生装置の構成を示す図である。It is a figure which shows the structure of the random number generator which concerns on the 7th Embodiment of this invention. CPUが本発明の第7の実施の形態に係る乱数発生装置を制御して乱数を生成する際の動作手順を定めたフローチャートである。It is the flowchart which defined the operation | movement procedure at the time of CPU generating the random number by controlling the random number generator which concerns on the 7th Embodiment of this invention. 本発明の第8の実施の形態に係る乱数発生装置におけるリング発振器のテスト方法を説明するための乱数発生装置の概略図である。It is the schematic of the random number generator for demonstrating the test method of the ring oscillator in the random number generator which concerns on the 8th Embodiment of this invention. 本発明の第9の実施の形態に係る乱数発生装置におけるリング発振器のテスト方法を説明するための乱数発生装置の概略図である。It is the schematic of the random number generator for demonstrating the test method of the ring oscillator in the random number generator which concerns on the 9th Embodiment of this invention. M系列生成部76の構成の概略図である。4 is a schematic diagram of a configuration of an M sequence generation unit 76. FIG. 本発明の第10の実施の形態に係る乱数発生装置におけるリング発振器111および2値化部12の構成を示す図である。It is a figure which shows the structure of the ring oscillator 111 and the binarization part 12 in the random number generator which concerns on the 10th Embodiment of this invention. 本発明の第11の実施の形態に係る乱数発生装置におけるリング発振器113および2値化部12の構成を示す図である。It is a figure which shows the structure of the ring oscillator 113 and the binarization part 12 in the random number generator which concerns on the 11th Embodiment of this invention.

符号の説明Explanation of symbols

1 乱数生成部、2,76 M系列生成部(擬似乱数生成部)、3,24,92 EXORゲート、4 乱数格納部、5,15,25,35,45,55 制御信号生成部、6 メタステーブル消滅検知器、11,13 リング発振器(乱数用発振器)、101 リング発振器(クロック用発振器)、12 2値化部、21a〜21e,34a〜34c,35 インバータ、22a〜22c,41a〜41e NANDゲート、23a〜23c,31a〜31b,52a〜52c,61,71a〜71e,91 レジスタ、32a〜32b,33,62,93 ANDゲート、94 ORゲート、51 分周器、42a〜42f,73,81,84〜86 セレクタ、74 カウンタ、75,111,113 リング発振器、82 M系列ロジック、83 カウンタロジック、N21〜N23,N41〜N43 ノード。   1 random number generation unit, 2,76 M sequence generation unit (pseudo random number generation unit), 3, 24, 92 EXOR gate, 4 random number storage unit, 5, 15, 25, 35, 45, 55 control signal generation unit, 6 metas Table extinction detector, 11, 13 ring oscillator (random number oscillator), 101 ring oscillator (clock oscillator), 12 binarization unit, 21a-21e, 34a-34c, 35 inverter, 22a-22c, 41a-41e NAND Gate, 23a-23c, 31a-31b, 52a-52c, 61, 71a-71e, 91 register, 32a-32b, 33, 62, 93 AND gate, 94 OR gate, 51 frequency divider, 42a-42f, 73, 81, 84 to 86 selector, 74 counter, 75, 111, 113 ring oscillator, 82 M series logic, 83 Counter logic, N21-N23, N41-N43 nodes.

Claims (20)

回路の出力が不安定な状態であるメタステーブルにおける前記回路の出力に基づいて乱数データを生成する乱数生成部と、
前記乱数データを格納する乱数格納部と、
前記メタステーブルの消滅後に前記乱数生成部から出力される前記乱数データを前記乱数格納部に格納させる制御を行なう制御部とを備える乱数発生装置。
A random number generator for generating random number data based on the output of the circuit in the metastable in which the output of the circuit is unstable;
A random number storage for storing the random number data;
A random number generator comprising: a control unit that performs control to store the random number data output from the random number generation unit after the metastable disappears in the random number storage unit.
前記乱数発生装置は、さらに、
前記メタステーブルの消滅を検知する検知器を備え、
前記制御部は、前記検知結果に基づいて前記制御を行なう請求項1記載の乱数発生装置。
The random number generator further includes:
A detector for detecting the disappearance of the metastable;
The random number generation device according to claim 1, wherein the control unit performs the control based on the detection result.
前記検知結果は外部から読み出し可能である請求項2記載の乱数発生装置。   The random number generator according to claim 2, wherein the detection result can be read from the outside. 前記制御部は、
所定の周期を有するクロックを分周する分周器を含み、前記分周されたクロックに基づいて前記制御を行なう請求項1記載の乱数発生装置。
The controller is
The random number generator according to claim 1, further comprising a frequency divider that divides a clock having a predetermined period, and performing the control based on the divided clock.
前記制御部は、1個以上のレジスタを含み、外部からの前記レジスタに対する書き込みに基づいて前記制御を行なう請求項1記載の乱数発生装置。   The random number generation device according to claim 1, wherein the control unit includes one or more registers, and performs the control based on an external write to the register. 前記乱数発生装置は、さらに、
M系列を生成するM系列生成部と、
前記M系列および前記乱数データの排他的論理和を出力するEXORゲートとを備え、
前記乱数格納部は、前記排他的論理和を前記乱数データとして格納する請求項1記載の乱数発生装置。
The random number generator further includes:
An M sequence generation unit for generating an M sequence;
An EXOR gate that outputs an exclusive OR of the M series and the random number data,
The random number generation device according to claim 1, wherein the random number storage unit stores the exclusive OR as the random number data.
前記M系列生成部は、
M系列生成用の論理回路である複数個のM系列ロジック部と、
前記乱数用発振器出力のカウント用の論理回路である複数個のカウントロジック部と、
M系列生成用のクロックまたは前記乱数用発振器出力を選択する複数個の第1のセレクタと、
前段の前記M系列ロジック部の出力または前段の前記カウントロジック部の出力を選択する複数個の第2のセレクタと、
前記第1のセレクタの選択したデータをクロックとして使用し、前記クロックのタイミングで前記第2のセレクタの選択したデータを保持して次段の前記M系列ロジック部および次段の前記カウンタロジック部へ出力するレジスタとを含む請求項6記載の乱数発生装置。
The M-sequence generation unit
A plurality of M-sequence logic units which are logic circuits for M-sequence generation;
A plurality of count logic units which are logic circuits for counting the output of the random number oscillator,
A plurality of first selectors for selecting an M-sequence generation clock or the random number oscillator output;
A plurality of second selectors for selecting the output of the preceding M-sequence logic unit or the output of the preceding count logic unit;
The data selected by the first selector is used as a clock, and the data selected by the second selector is held at the timing of the clock to the M-series logic unit and the counter logic unit of the next stage. The random number generator according to claim 6, further comprising a register for outputting.
前記乱数生成部は、
前記メタステーブルを発生する乱数用発振器と、
前記メタステーブルにおける前記乱数用発振器の出力に基づいて前記乱数データを生成する2値化部とを含む請求項1記載の乱数発生装置。
The random number generator
A random number oscillator for generating the metastable;
The random number generation device according to claim 1, further comprising: a binarization unit that generates the random number data based on an output of the random number oscillator in the metastable.
前記制御部は、さらに、1個以上のレジスタを含み、外部からの前記レジスタに対する書き込みに基づいて前記乱数用発振器において前記メタステーブルを発生させる制御を行なう請求項8記載の乱数発生装置。   The random number generation device according to claim 8, wherein the control unit further includes one or more registers, and performs control to generate the metastable in the random number oscillator based on external writing to the registers. 前記乱数発生装置は、さらに、
前記乱数用発振器の出力をカウントするカウンタを備える請求項8記載の乱数発生装置。
The random number generator further includes:
The random number generator according to claim 8, further comprising a counter that counts an output of the random number oscillator.
前記乱数用発振器の出力は外部へ出力可能である請求項8記載の乱数発生装置。   9. The random number generator according to claim 8, wherein the output of the random number oscillator can be output to the outside. 前記乱数用発振器は、
ループ状に接続された複数個の遅延回路と、
第1の入力テストデータまたは前記遅延回路の出力を選択する第3のセレクタと、
第2の入力テストデータ、または前記第3のセレクタに出力が接続される前記遅延回路とは異なる前記遅延回路の出力を選択する第4のセレクタとを含む請求項8記載の乱数発生装置。
The random number oscillator is
A plurality of delay circuits connected in a loop;
A third selector for selecting first input test data or an output of the delay circuit;
9. The random number generator according to claim 8, further comprising: second input test data; or a fourth selector that selects an output of the delay circuit different from the delay circuit whose output is connected to the third selector.
前記2値化部は、前記遅延回路の出力を保持し、前記保持したデータが外部から読み出し可能であるレジスタを含む請求項12記載の乱数発生装置。   13. The random number generation device according to claim 12, wherein the binarization unit includes a register that holds an output of the delay circuit and from which the held data can be read from the outside. 前記2値化部は、
前記メタステーブルにおけるパルス信号が前記乱数用発振器の前記各遅延回路を通過する回数をそれぞれカウントする複数個のレジスタと、
前記各カウント結果の排他的論理和を出力するEXORゲートとを含み、
前記レジスタは外部から書き込み可能であり、前記EXORゲートの出力は外部から読み出し可能である請求項8記載の乱数発生装置。
The binarization unit
A plurality of registers that respectively count the number of times the pulse signal in the metastable passes through each delay circuit of the random number oscillator;
An EXOR gate that outputs an exclusive OR of each count result,
9. The random number generator according to claim 8, wherein the register is writable from outside, and the output of the EXOR gate is readable from outside.
前記乱数用発振器は、
ループ状に接続された複数個の遅延回路と、
前記遅延回路に対応して配置される複数個の第5のセレクタとを含み、
前記遅延回路は前段の前記遅延回路の出力および前記第5のセレクタの出力を入力し、
前記第5のセレクタは、前記メタステーブルを発生するための制御信号または第3の入力テストデータを前記遅延回路へ出力する請求項8記載の乱数発生装置。
The random number oscillator is
A plurality of delay circuits connected in a loop;
A plurality of fifth selectors arranged corresponding to the delay circuit,
The delay circuit inputs the output of the delay circuit in the previous stage and the output of the fifth selector,
The random number generation device according to claim 8, wherein the fifth selector outputs a control signal for generating the metastable or third input test data to the delay circuit.
前記乱数発生装置は、さらに、クロックを生成するクロック用発振器を備え、
前記制御部は、前記クロック用発振器で生成されるクロックに基づいて前記制御を行なう請求項1記載の乱数発生装置。
The random number generator further includes a clock oscillator for generating a clock,
The random number generation device according to claim 1, wherein the control unit performs the control based on a clock generated by the clock oscillator.
前記乱数発生装置は、さらに、
M系列を生成するM系列生成部と、
前記M系列および前記乱数データの排他的論理和を出力するEXORゲートとを備え、
前記乱数格納部は、前記排他的論理和を前記乱数データとして格納し、
前記M系列生成部は、
M系列生成用の論理回路である複数個のM系列ロジック部と、
前記クロック用発振器出力のカウント用の論理回路である複数個のカウントロジック部と、
M系列生成用のクロックまたは前記クロック用発振器出力を選択する複数個の第1のセレクタと、
前段の前記M系列ロジック部の出力または前段の前記カウントロジック部の出力を選択する複数個の第2のセレクタと、
前記第1のセレクタの選択したデータをクロックとして使用し、前記クロックのタイミングで前記第2のセレクタの選択したデータを保持して次段の前記M系列ロジック部および次段の前記カウンタロジック部へ出力するレジスタとを含む請求項16記載の乱数発生装置。
The random number generator further includes:
An M sequence generation unit for generating an M sequence;
An EXOR gate that outputs an exclusive OR of the M series and the random number data,
The random number storage unit stores the exclusive OR as the random number data,
The M-sequence generation unit
A plurality of M-sequence logic units which are logic circuits for M-sequence generation;
A plurality of count logic units which are logic circuits for counting the clock oscillator output;
A plurality of first selectors for selecting an M-sequence generation clock or the clock oscillator output;
A plurality of second selectors for selecting the output of the preceding M-sequence logic unit or the output of the preceding count logic unit;
The data selected by the first selector is used as a clock, and the data selected by the second selector is held at the timing of the clock to the M-series logic unit and the counter logic unit of the next stage. 17. The random number generator according to claim 16, further comprising a register for outputting.
前記乱数発生装置は、さらに、
前記クロック用発振器の出力をカウントするカウンタを備える請求項16記載の乱数発生装置。
The random number generator further includes:
The random number generation device according to claim 16, further comprising a counter that counts an output of the clock oscillator.
前記クロック用発振器の出力は外部へ出力可能である請求項16記載の乱数発生装置。   17. The random number generator according to claim 16, wherein the output of the clock oscillator can be output to the outside. 回路の出力が不安定な状態であるメタステーブルにおける前記回路の出力に基づいて乱数データを生成する乱数生成部と、
前記乱数データを格納する乱数格納部と、
前記メタステーブルの消滅を検知する検知器と、
前記検知器が前記メタステーブルの発生から所定時間内に前記メタステーブルの消滅を検知した場合には前記メタステーブルの消滅後に、または前記所定時間が経過しても前記検知器が前記メタステーブルの消滅を検知しない場合には前記所定時間経過後に、前記乱数生成部から出力される前記乱数データを前記乱数格納部に格納させる制御を行なう制御部とを備える乱数発生装置。
A random number generator for generating random number data based on the output of the circuit in the metastable in which the output of the circuit is unstable;
A random number storage for storing the random number data;
A detector for detecting the disappearance of the metastable;
When the detector detects the disappearance of the metastable within a predetermined time from the occurrence of the metastable, the detector disappears the metastable after the disappearance of the metastable or even after the predetermined time elapses. A random number generator comprising: a control unit that performs control to store the random number data output from the random number generation unit in the random number storage unit after the predetermined time has elapsed.
JP2005219246A 2005-07-28 2005-07-28 Random number generator Expired - Fee Related JP4471901B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005219246A JP4471901B2 (en) 2005-07-28 2005-07-28 Random number generator

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005219246A JP4471901B2 (en) 2005-07-28 2005-07-28 Random number generator

Publications (2)

Publication Number Publication Date
JP2007034836A JP2007034836A (en) 2007-02-08
JP4471901B2 true JP4471901B2 (en) 2010-06-02

Family

ID=37794000

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005219246A Expired - Fee Related JP4471901B2 (en) 2005-07-28 2005-07-28 Random number generator

Country Status (1)

Country Link
JP (1) JP4471901B2 (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5074359B2 (en) * 2008-11-12 2012-11-14 日本電信電話株式会社 Random number generator
JP5175701B2 (en) * 2008-12-05 2013-04-03 ルネサスエレクトロニクス株式会社 Semiconductor integrated circuit, data encryption device, encryption key generation device, and encryption key generation method
KR20110060033A (en) 2009-11-30 2011-06-08 박옥희 Sea infrastructure coupling
WO2011086688A1 (en) * 2010-01-15 2011-07-21 三菱電機株式会社 Bit sequence generation device and bit sequence generation method
JP5356362B2 (en) * 2010-12-15 2013-12-04 日本電信電話株式会社 Random number generator
CN102735985B (en) * 2012-06-12 2016-05-25 福建睿矽微电子科技有限公司 The anti-sniffer of random current type and anti-detection method
CN102759680B (en) * 2012-06-12 2015-06-24 福建睿矽微电子科技有限公司 Random voltage type detection prevention device and random voltage type detection prevention method
JP6030050B2 (en) * 2013-12-27 2016-11-24 株式会社東芝 ID generating apparatus, ID generating method, and ID generating system
EP3195518A1 (en) * 2014-09-14 2017-07-26 Alexandre Durand Cryptographic system based on reproducible random sequences
JP6248886B2 (en) * 2014-10-02 2017-12-20 Nttエレクトロニクス株式会社 Random data generator and data communication terminal
JP6423277B2 (en) * 2015-01-09 2018-11-14 株式会社メガチップス Random number generation apparatus and random number generation method
CN115513145B (en) * 2022-11-17 2023-03-10 灿芯半导体(上海)股份有限公司 Peep-proof, tamper-proof and low-power-consumption shielding cover

Also Published As

Publication number Publication date
JP2007034836A (en) 2007-02-08

Similar Documents

Publication Publication Date Title
JP4471901B2 (en) Random number generator
US7424500B2 (en) Random number generator with ring oscillation circuit
US7376687B2 (en) Pseudo-random number generator
US7461312B2 (en) Digital signature generation for hardware functional test
US6065029A (en) Method and system for providing a random number generator
US20050204220A1 (en) Random number test circuit, random number generation circuit, semiconductor integrated circuit, IC card and information terminal device
JP4806631B2 (en) Timing generator and semiconductor test equipment
JP2007164434A (en) Random number test circuit
JP2005181333A (en) Circuit-testing method
CN109256172B (en) Memory device including a detection clock pattern generator
US9983262B1 (en) Built-in self test controller for a random number generator core
US9836280B2 (en) Arrangement and method for checking the entropy of a random number sequence
JP2010287860A (en) Semiconductor integrated circuit device
JP5381001B2 (en) Semiconductor integrated circuit and method for testing semiconductor integrated circuit
US7668893B2 (en) Data generator having linear feedback shift registers for generating data pattern in forward and reverse orders
US20150019606A1 (en) Method for evaluating an output of a random generator
US20080116937A1 (en) Semiconductor integrated circuit
JP4724774B2 (en) Semiconductor circuit device, memory test circuit, and test method for semiconductor circuit device
SU920718A1 (en) Pseudorandom code generator
JP2017173068A (en) Testing circuit
JP3543399B2 (en) Semiconductor device with inspection function and its self-inspection method
JP5126090B2 (en) Memory test equipment
JP2008003047A (en) Semiconductor circuit
JP2004040037A (en) Inspection device for semiconductor integrated circuit
JP2000092028A (en) Random error generating circuit

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20080520

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20100212

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

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

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

Free format text: PAYMENT UNTIL: 20130312

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

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

Free format text: PAYMENT UNTIL: 20130312

Year of fee payment: 3

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

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

Free format text: PAYMENT UNTIL: 20130312

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20140312

Year of fee payment: 4

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees