JP2019053385A - Random number generation circuit and control method of random number generation circuit - Google Patents
Random number generation circuit and control method of random number generation circuit Download PDFInfo
- Publication number
- JP2019053385A JP2019053385A JP2017175543A JP2017175543A JP2019053385A JP 2019053385 A JP2019053385 A JP 2019053385A JP 2017175543 A JP2017175543 A JP 2017175543A JP 2017175543 A JP2017175543 A JP 2017175543A JP 2019053385 A JP2019053385 A JP 2019053385A
- Authority
- JP
- Japan
- Prior art keywords
- value
- output
- circuit
- random number
- signal
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Abstract
Description
本発明は、乱数生成回路及び乱数生成回路の制御方法に関する。 The present invention relates to a random number generation circuit and a control method for the random number generation circuit.
ラッチ回路を用いて乱数を生成する手法の1つとして、ラッチ回路のメタスタビリティ(準安定性)を利用する手法がある。メタスタビリティは、ラッチ回路に入力されるデータ信号の論理レベルがH(High)レベルとL(Low)レベルの中間にあるときにクロック信号によるサンプリングが生じる場合、出力値が不確定になる特性である。 One technique for generating random numbers using a latch circuit is to use metastability (metastability) of the latch circuit. Metastability is a characteristic in which the output value becomes indeterminate when sampling by the clock signal occurs when the logic level of the data signal input to the latch circuit is between the H (High) level and the L (Low) level. is there.
しかし、ラッチ回路のメタスタビリティを利用する手法では、サンプリングタイミングを、メタスタビリティが生じる期間(以下メタステーブル期間という)に合わせることが難しく、サンプリングタイミングがメタステーブル期間から外れる場合がある。サンプリングタイミングがメタステーブル期間から外れた場合、ラッチ回路の出力がHレベルまたはLレベルに偏り、生成される乱数の品質が悪化する可能性があった。 However, in the method using the metastability of the latch circuit, it is difficult to match the sampling timing to a period in which metastability occurs (hereinafter referred to as a metastable period), and the sampling timing may deviate from the metastable period. When the sampling timing deviates from the metastable period, the output of the latch circuit is biased to H level or L level, and the quality of the generated random number may be deteriorated.
1つの側面では、本発明は、乱数の品質悪化を抑制することを目的とする。 In one aspect, the present invention aims to suppress deterioration in quality of random numbers.
1つの実施態様では、入力信号と調整信号とを受け、前記入力信号に基づいて、第1の信号と第2の信号とを出力するとともに、前記調整信号に基づいて、前記第1の信号または前記第2の信号の位相を調整する調整部と、前記第1の信号と前記第2の信号とを受け、前記第2の信号によるサンプリングタイミングにおける前記第1の信号の信号レベルに基づいて、第1の値または第2の値をそれぞれ出力する、3つ以上の奇数個のラッチ回路と、前記奇数個のラッチ回路のそれぞれが出力する前記第1の値または前記第2の値を受け、前記奇数個のラッチ回路の全てが同じ値を出力する場合、前記同じ値を出力し、前記奇数個のラッチ回路のうちの少なくとも1つが異なる値を出力する場合、前記第1の値と前記第2の値のうち、出力される数が少ない方の値を出力する出力回路と、前記奇数個のラッチ回路のそれぞれが出力する前記第1の値または前記第2の値を受け、前記奇数個のラッチ回路の全てが前記同じ値を出力するか否かを示す検出結果を出力する検出回路と、前記検出結果と前記出力回路の出力値とに基づいて、前記サンプリングタイミングが、前記奇数個のラッチ回路が準安定状態となる期間内であるか否かを判定し、前記サンプリングタイミングが前記期間内であるか否かの判定結果に基づいて、前記調整信号の値を変えて、前記サンプリングタイミングを前記期間内に調整する制御回路と、を有する乱数生成回路が提供される。 In one embodiment, the input signal and the adjustment signal are received, the first signal and the second signal are output based on the input signal, and the first signal or the adjustment signal is output based on the adjustment signal. An adjustment unit that adjusts the phase of the second signal, the first signal, and the second signal, and based on the signal level of the first signal at the sampling timing of the second signal, Receiving three or more odd number of latch circuits that respectively output the first value or the second value, and the first value or the second value output by each of the odd number of latch circuits; When all of the odd number of latch circuits output the same value, the same value is output, and when at least one of the odd number of latch circuits outputs a different value, the first value and the first value The value of 2 is output An output circuit that outputs the smaller value and the first value or the second value output from each of the odd number of latch circuits, and the odd number of latch circuits all receive the same value. A period for which the odd number of latch circuits are in a metastable state based on a detection circuit that outputs a detection result indicating whether or not to output the signal, and the detection result and an output value of the output circuit A control circuit that adjusts the sampling timing within the period by changing the value of the adjustment signal based on a determination result of whether the sampling timing is within the period or not A random number generation circuit is provided.
また、1つの実施態様では、乱数生成回路の制御方法が提供される。 In one embodiment, a method for controlling a random number generation circuit is provided.
1つの側面では、乱数の品質悪化を抑制でき、生成された乱数の生成要因も知ることができる。 In one aspect, deterioration of random number quality can be suppressed, and the generation factor of the generated random number can be known.
以下、発明を実施するための形態を、図面を参照しつつ説明する。
(第1の実施の形態)
図1は、第1の実施の形態の乱数生成回路の一例を示す図である。
Hereinafter, embodiments for carrying out the invention will be described with reference to the drawings.
(First embodiment)
FIG. 1 is a diagram illustrating an example of a random number generation circuit according to the first embodiment.
乱数生成回路10は、調整回路11a,11bを有する調整部11と、3つ以上の奇数個のラッチ回路12a1,12a2,…,12an、出力回路12b、検出回路12cを有する乱数生成部12と、制御回路13と、を有する。
The random
調整部11は、入力信号と調整信号とを受ける。以下では、入力信号は、クロック信号CLKであるものとして説明するが、クロック信号CLKに限定されるものではない。ただし、乱数の発生レートを上げるため、状態遷移(HレベルとLレベルの間での遷移)が頻繁に発生する信号を用いることが望ましい。
The
クロック信号CLKは、たとえば、乱数生成回路10の外部の図示しないクロック信号発生回路から供給される。
調整部11は、クロック信号CLKに基づいて、2つの信号(以下データ信号dtとクロック信号clkという)を出力するとともに、調整信号に基づいて、データ信号dtまたはクロック信号clkの位相を調整する。
The clock signal CLK is supplied from, for example, a clock signal generation circuit (not shown) outside the random
The
図1の例では、調整部11は、調整回路11a,11bを有する。調整回路11aは、調整信号tsel1に基づいてクロック信号CLKの位相を調整したデータ信号dtを出力する。調整回路11bは、調整信号tsel2に基づいてクロック信号CLKの位相を調整したクロック信号clkを出力する。調整回路11a,11bは、たとえば、調整信号tsel1,tsel2の値に基づいて遅延量を変えることができる可変遅延回路である。たとえば、調整信号tsel1,tsel2の値が増加すると、遅延量が増加する。
In the example of FIG. 1, the
ラッチ回路12a1〜12anは、それぞれ、データ信号dtとクロック信号clkとを受け、クロック信号clkによるサンプリングタイミングにおけるデータ信号dtの信号レベルに基づいて、HレベルまたはLレベルの値を出力する。Hレベルは、たとえば、電源電圧に相当し、Lレベルは、基準電位(たとえば、0V)に相当する。 Each of the latch circuits 12a1 to 12an receives the data signal dt and the clock signal clk, and outputs an H level or L level value based on the signal level of the data signal dt at the sampling timing based on the clock signal clk. The H level corresponds to, for example, a power supply voltage, and the L level corresponds to a reference potential (for example, 0 V).
出力回路12bは、ラッチ回路12a1〜12anのそれぞれが出力するHレベルの値またはLレベルの値を受ける。そして、出力回路12bは、ラッチ回路12a1〜12anの全てが同じ値を出力する場合、その値を出力する。ラッチ回路12a1〜12anのうちの少なくとも1つが異なる値を出力する場合、出力回路12bは、ラッチ回路12a1〜12anが出力するHレベルの値とLレベルの値のうち、出力される数が少ない方の値を出力する。
The
たとえば、ラッチ回路12a1〜12anにおいて、Lレベルの値よりもHレベルの値が多く出力されている場合には、出力回路12bは、Lレベルの出力値RNDを出力する。逆にHレベルの値よりもLレベルの値が多く出力されている場合には、出力回路12bは、Hレベルの出力値RNDを出力する。
For example, when the latch circuits 12a1 to 12an output more H level values than L level values, the
出力される数が少ない方の値は、出力される数が多い方の値よりも、乱数である可能性(または乱数としての適格性)が高いためである。出力される数が多い方の値は、メタスタビリティの影響ではなく、スキューの影響により出力された値である可能性が高い。スキューの影響により出力された値を乱数として採用する場合、値に偏りが生じ、乱数としての品質が低い。 This is because the value with the smaller output number is more likely to be a random number (or eligibility as a random number) than the value with the larger output number. There is a high possibility that the value with the larger number of outputs is not the effect of metastability but the value output due to the effect of skew. When a value output due to the influence of skew is adopted as a random number, the value is biased and the quality as a random number is low.
検出回路12cは、ラッチ回路12a1〜12anのそれぞれが出力するHレベルの値またはLレベルの値を受ける。そして、検出回路12cは、ラッチ回路12a1〜12anの全てが同じ値を出力するか否かを示す検出結果matchを出力する。以下の説明では、ラッチ回路12a1〜12anの全てが同じ値を出力する場合、Hレベルの検出結果matchが出力され、ラッチ回路12a1〜12anのうちの少なくとも1つが異なる値を出力する場合、Lレベルの検出結果matchが出力されるものとする。
The
出力回路12bや、検出回路12cの回路例については後述する。
制御回路13は、たとえば、ASIC(Application Specific Integrated Circuit)やFPGA(Field Programmable Gate Array)などの特定用途の電子回路である。また、制御回路13は、CPU(Central Processing Unit)やDSP(Digital Signal Processor)などの演算処理装置としてのプロセッサであってもよい。プロセッサは、RAM(Random Access Memory)などのメモリに記憶されたプログラムを実行する。なお、制御回路13は、複数のプロセッサの集合であってもよい。
Circuit examples of the
The
制御回路13は、検出結果matchと、出力値RNDとに基づいて、クロック信号clkによるサンプリングタイミングが、ラッチ回路12a1〜12nがメタスタビリティ状態(準安定状態)となる期間内(メタステーブル期間内)であるか否かを判定する。そして、制御回路13は、その判定結果に基づいて、調整信号tsel1,tsel2の値を変えて、サンプリングタイミングをメタステーブル期間内に調整する。
Based on the detection result match and the output value RND, the
図1には、データ信号dtがLレベルからHレベルに遷移するときの、クロック信号clkによるサンプリングタイミングの調整の一例が示されている。
サンプリングタイミングがタイミングt1のとき、ラッチ回路12a1〜12anは、全てLレベルの値を出力するため、出力回路12bは、Lレベルの出力値RNDを出力し、検出回路12cは、Hレベルの検出結果matchを出力する。このとき、制御回路13は、サンプリングタイミングがメタステーブル期間内ではないと判定し、データ信号dtに対してクロック信号clkの位相を遅らせるように、調整信号tsel1,tsel2の値を変える。たとえば、制御回路13は、調整信号tsel1の値を固定し、調整信号tsel2の値を増やし、調整回路11bでのクロック信号clkの遅延量を増加させることでクロック信号clkの位相を遅らせる。
FIG. 1 shows an example of adjustment of sampling timing by the clock signal clk when the data signal dt transitions from L level to H level.
Since the latch circuits 12a1 to 12an all output L level values when the sampling timing is timing t1, the
クロック信号clkの位相を遅らせたことで、サンプリングタイミングが、たとえば、タイミングt2になったとする。タイミングt2では、データ信号dtの信号レベルがLレベルの場合より上がっており、ラッチ回路12a1〜12anのうち少なくとも1つがHレベルの値を出力したとする。このとき、検出回路12cから、Lレベルの検出結果matchが出力される。ただ、まだラッチ回路12a1〜12anは、Hレベルの値よりもLレベルの値を多く出力するため、出力回路12bは、Hレベルの出力値RNDを出力する。このときも、制御回路13は、サンプリングタイミングがメタステーブル期間内ではないと判定し、データ信号dtに対してクロック信号clkの位相を遅らせるように、調整信号tsel1,tsel2を変える。
It is assumed that the sampling timing is, for example, timing t2 by delaying the phase of the clock signal clk. At timing t2, it is assumed that the signal level of the data signal dt is higher than that at the L level, and at least one of the latch circuits 12a1 to 12an outputs an H level value. At this time, an L level detection result match is output from the
クロック信号clkの位相をさらに遅らせたことで、サンプリングタイミングが、たとえば、タイミングt3になったとする。タイミングt3では、データ信号dtの信号レベルがLレベルとHレベルの中間付近となり、ラッチ回路12a1〜12anのうち、Lレベルの値を出力するものと、Hレベルの値を出力するものとがほぼ均等に分かれる。このため、出力回路12bは、Lレベルの出力値RNDとHレベルの出力値RNDとを、ほぼ同じ確率で出力する。また、検出回路12cは、Lレベルの検出結果matchを出力する。
It is assumed that the sampling timing is, for example, timing t3 by further delaying the phase of the clock signal clk. At the timing t3, the signal level of the data signal dt is in the vicinity of the middle between the L level and the H level, and among the latch circuits 12a1 to 12an, the one that outputs the L level value and the one that outputs the H level value are almost. Divide evenly. Therefore, the
上記のように、制御回路13がタイミングt1,t2,t3の順で、サンプリングタイミングを変化させていったとき、タイミングt3では、タイミングt2と同様の、出力値RNDと検出結果matchが得られる場合がある。その場合、制御回路13は、さらにクロック信号clkの位相を遅らせ、出力値RNDがHレベルからLレベルに変化したとき(たとえば、タイミングt4)、その1つ前のタイミング(すなわちタイミングt3)が、メタステーブル期間内であると判定する。そして、制御回路13は、タイミングt3における調整信号tsel1,tsel2の値を固定する。
As described above, when the
一方、サンプリングタイミングがタイミングt5のとき、ラッチ回路12a1〜12anは、全てHレベルの値を出力するため、出力回路12bは、Hレベルの出力値RND、検出回路12cは、Hレベルの検出結果matchを出力する。このとき、制御回路13は、サンプリングタイミングがメタステーブル期間内ではないと判定し、データ信号dtに対してクロック信号clkの位相を進ませるように、調整信号tsel1,tsel2を変える。たとえば、制御回路13は、調整信号tsel1の値を固定し、調整信号tsel2の値を減らし、調整回路11bでのクロック信号clkの遅延量を減少させることでクロック信号clkの位相を進める。
On the other hand, when the sampling timing is timing t5, the latch circuits 12a1 to 12an all output H level values, so the
クロック信号clkの位相を進めたことでサンプリングタイミングが、たとえば、タイミングt4となったとする。タイミングt4ではデータ信号dtの信号レベルがHレベルの場合よりも下がっており、ラッチ回路12a1〜12anのうち少なくとも1つがLレベルの値を出力したとする。このとき、検出回路12cは、Lレベルの検出結果matchを出力する。ただ、まだラッチ回路12a1〜12anは、Lレベルの値よりもHレベルの値を多く出力するため、出力回路12bは、Lレベルの出力値RNDを出力する。このときも、制御回路13は、サンプリングタイミングがメタステーブル期間内ではないと判定し、データ信号dtに対してクロック信号clkの位相を進ませるように、調整信号tsel1,tsel2を変える。
It is assumed that the sampling timing is, for example, timing t4 by advancing the phase of the clock signal clk. At timing t4, it is assumed that the signal level of the data signal dt is lower than that at the H level, and at least one of the latch circuits 12a1 to 12an outputs an L level value. At this time, the
クロック信号clkの位相を進めたことでサンプリングタイミングが、たとえば、タイミングt3となったとする。タイミングt3では前述のように、出力回路12bは、Lレベルの出力値RNDとHレベルの出力値RNDとを、ほぼ同じ確率で出力する。また、検出回路12cは、Lレベルの検出結果matchを出力する。
It is assumed that the sampling timing is, for example, timing t3 by advancing the phase of the clock signal clk. At timing t3, as described above, the
制御回路13がタイミングt5,t4,t3の順で、サンプリングタイミングを変化させていったとき、タイミングt3では、タイミングt4と同様の、出力値RNDと検出結果matchが得られる場合がある。その場合、制御回路13は、たとえば、さらにクロック信号clkの位相を進ませ、出力値RNDがLレベルからHレベルに変化したとき(タイミングt2)、その1つ前のタイミング(すなわちタイミングt3)が、メタステーブル期間内であると判定する。そして、制御回路13は、タイミングt3における調整信号tsel1,tsel2の値を固定する。
When the
そして、制御回路13は、以後は、固定した調整信号tsel1,tsel2の値を、調整部11に供給して、乱数生成部12に、メタスタビリティによる乱数を生成させる。
サンプリングタイミングの他の調整方法の例については、後述する。
Thereafter, the
Examples of other adjustment methods of the sampling timing will be described later.
以上のように、第1の実施の形態の乱数生成回路10及びその制御方法では、ラッチ回路12a1〜12anの出力から得られる出力値RND、検出結果matchに基づいて、サンプリングタイミングがメタステーブル期間内であるか否かを判定できる。つまり、制御回路13は、ラッチ回路12a1〜12anがメタスタビリティ状態であるか否かを判定できる。そして、制御回路13は、その判定結果に基づいて、データ信号dtまたはクロック信号clkの位相を調整して、サンプリングタイミングをメタステーブル期間に合わせることができる。
As described above, in the random
メタステーブル期間では上記のように、Hレベルの出力値RNDとLレベルの出力値RNDとがほぼ同じ確率で出力され、出力値RNDは、品質のよい乱数となる。つまり、出力値RNDの値の偏りが低減され、乱数の品質悪化を抑制できる。 In the metastable period, as described above, the output value RND at the H level and the output value RND at the L level are output with almost the same probability, and the output value RND is a random number with good quality. That is, the deviation of the output value RND is reduced, and the deterioration of the random number quality can be suppressed.
なお、ラッチ回路を用いて乱数を生成する方法として、リングオシレータの出力パルスをラッチ回路のデータ端子に入力し、クロック信号をクロック端子に入力し、出力パルスのジッタから乱数を生成する手法がある。しかしこの手法では、サンプリング時の乱数が、直前のサンプリング値に対して依存関係をもつため、生成される乱数に周期性が含まれてしまう。メタスタビリティを利用した本実施の形態の乱数生成回路10では、乱数に周期性が含まれることもない。
As a method of generating a random number using a latch circuit, there is a method of generating a random number from jitter of an output pulse by inputting an output pulse of a ring oscillator to a data terminal of the latch circuit and inputting a clock signal to the clock terminal. . However, in this method, since the random number at the time of sampling has a dependency relationship with the immediately preceding sampling value, the generated random number includes periodicity. In the random
(第2の実施の形態)
図2は、第2の実施の形態の乱数生成回路の一例を示す図である。
乱数生成回路20は、調整回路21a,21bと、乱数生成部22と、制御回路23とを有する。
(Second Embodiment)
FIG. 2 is a diagram illustrating an example of a random number generation circuit according to the second embodiment.
The random
調整回路21a,21bは、第1の実施の形態の乱数生成回路10における調整回路11a,11bと同様の機能を有する。
乱数生成部22は、ラッチ回路22a1,22a2,22a3、インバータ回路22b1,22b2,22b3、AND(論理積)回路22c1,22c2,22c3,22c4,22c5、OR(論理和)回路22d1,22d2を有する。
The
The
ラッチ回路22a1〜22a3は、それぞれ、データ信号dtを受けるデータ端子(“D”と表記されている)、クロック信号clkを受けるクロック端子(“CK”と表記されている)、出力端子(“Q”と表記されている)を有する。ラッチ回路22a1〜22a3は、第1の実施の形態の乱数生成回路10におけるラッチ回路12a1〜12anと同様の機能を有する。
Each of the latch circuits 22a1 to 22a3 includes a data terminal (denoted as “D”) that receives the data signal dt, a clock terminal (denoted as “CK”) that receives the clock signal clk, and an output terminal (“Q”). ”). The latch circuits 22a1 to 22a3 have the same function as the latch circuits 12a1 to 12an in the random
第2の実施の形態の乱数生成回路20では、インバータ回路22b1〜22b3、AND回路22c1〜22c5、OR回路22d1,22d2により、第1の実施の形態の乱数生成回路10における出力回路12b及び検出回路12cと同様の機能が実現される。
In the random
インバータ回路22b1は、ラッチ回路22a1の出力値の論理レベルを反転し、インバータ回路22b2は、ラッチ回路22a2の出力値の論理レベルを反転し、インバータ回路22b3は、ラッチ回路22a3の出力値の論理レベルを反転する。 Inverter circuit 22b1 inverts the logic level of the output value of latch circuit 22a1, inverter circuit 22b2 inverts the logic level of the output value of latch circuit 22a2, and inverter circuit 22b3 inverts the logic level of the output value of latch circuit 22a3. Invert.
AND回路22c1は、ラッチ回路22a1の出力値と、インバータ回路22b2の出力値と、インバータ回路22b3の出力値との論理積の演算結果を出力する。AND回路22c2は、ラッチ回路22a2の出力値と、インバータ回路22b1の出力値と、インバータ回路22b3の出力値との論理積の演算結果を出力する。AND回路22c3は、ラッチ回路22a3の出力値と、インバータ回路22b1の出力値と、インバータ回路22b2の出力値との論理積の演算結果を出力する。AND回路22c4は、ラッチ回路22a1〜22a3の出力値の論理積の演算結果を出力する。AND回路22c5は、インバータ回路22b1〜22b3の出力値の論理積の演算結果を出力する。 The AND circuit 22c1 outputs a logical product operation result of the output value of the latch circuit 22a1, the output value of the inverter circuit 22b2, and the output value of the inverter circuit 22b3. The AND circuit 22c2 outputs a logical product operation result of the output value of the latch circuit 22a2, the output value of the inverter circuit 22b1, and the output value of the inverter circuit 22b3. The AND circuit 22c3 outputs a logical product operation result of the output value of the latch circuit 22a3, the output value of the inverter circuit 22b1, and the output value of the inverter circuit 22b2. The AND circuit 22c4 outputs a logical product operation result of the output values of the latch circuits 22a1 to 22a3. The AND circuit 22c5 outputs a logical product operation result of the output values of the inverter circuits 22b1 to 22b3.
OR回路22d1は、AND回路22c1〜22c4の出力値の論理和の演算結果を出力する。OR回路22d2は、AND回路22c4,22c5の出力値の論理和の演算結果を出力する。 The OR circuit 22d1 outputs a logical sum operation result of the output values of the AND circuits 22c1 to 22c4. The OR circuit 22d2 outputs a logical sum operation result of the output values of the AND circuits 22c4 and 22c5.
OR回路22d1の出力値が乱数生成部22の出力値RNDであり、OR回路22d2の出力値が、ラッチ回路22a1〜22a3の全てが同じ値を出力するか否かを示す検出結果matchである。
The output value of the OR circuit 22d1 is the output value RND of the
制御回路23は、第1の実施の形態の乱数生成回路10における制御回路13と同様の機能を有する。なお、制御回路23は、制御信号CTRLによって乱数生成回路20の外部から制御されてもよい。また、制御回路23は、出力値RNDがクロック信号CLKの所定サイクル数、同じ値である場合には、異常状態であることを示す信号ERRを出力してもよい。
The
図3は、各ラッチ回路の出力値と検出結果matchと出力値RNDとの一例の関係を示す図である。
図3には、ラッチ回路22a1〜22a3の出力値と、OR回路22d1の出力値RNDと、OR回路22d2が出力する検出結果matchとの関係が示されている。
FIG. 3 is a diagram illustrating an example relationship between the output value of each latch circuit, the detection result match, and the output value RND.
FIG. 3 shows the relationship between the output values of the latch circuits 22a1 to 22a3, the output value RND of the OR circuit 22d1, and the detection result match output from the OR circuit 22d2.
ラッチ回路22a1〜22a3の出力値が全てLレベルである場合、検出結果matchがHレベル、出力値RNDがLレベルになる。ラッチ回路22a1〜22a3の出力値のうち、2つがLレベル、1つがHレベルである場合、検出結果matchがLレベル、出力値RNDがHレベルになる。ラッチ回路22a1〜22a3の出力値のうち、2つがHレベル、1つがLレベルである場合、検出結果matchがLレベル、出力値RNDがLレベルになる。ラッチ回路22a1〜22a3の出力値が全てHレベルである場合、検出結果matchがHレベル、出力値RNDがHレベルになる。 When the output values of the latch circuits 22a1 to 22a3 are all at the L level, the detection result match is at the H level and the output value RND is at the L level. When two of the output values of the latch circuits 22a1 to 22a3 are L level and one is H level, the detection result match is L level and the output value RND is H level. When two of the output values of the latch circuits 22a1 to 22a3 are H level and one is L level, the detection result match is L level and the output value RND is L level. When the output values of the latch circuits 22a1 to 22a3 are all at the H level, the detection result match is at the H level and the output value RND is at the H level.
制御回路23は、これらの検出結果matchと出力値RNDとの組み合わせに基づいて、出力値RNDによる乱数の生成要因を判別できる。以下では、データ信号dtがLレベルからHレベルに遷移する際のメタステーブル期間内にサンプリングタイミングを調整する場合について説明する。
Based on the combination of the detection result match and the output value RND, the
検出結果matchがHレベル、出力値RNDがLレベルである場合、スキューによりデータ信号dtに対してクロック信号clkの位相が進んでおり、サンプリングタイミングがメタステーブル期間内ではないことを示す。そのため、乱数生成要因は、メタスタビリティではなくスキューである。スキューは、電圧変化や温度変化によるノイズなどによって生じる遅延時間のばらつきである。サンプリングタイミングごとに、上記のような出力値RNDが得られる場合、出力値RNDは、Lレベルの値に偏り、品質の悪い乱数が得られる。そのため、制御回路23は、データ信号dtに対してクロック信号clkの位相を遅らせるように調整信号tsel1,tsel2(どちらか一方でもよい)の値を変える。
When the detection result match is H level and the output value RND is L level, it indicates that the phase of the clock signal clk is advanced with respect to the data signal dt due to skew, and the sampling timing is not within the metastable period. Therefore, the random number generation factor is not a metastability but a skew. Skew is variation in delay time caused by noise due to voltage change or temperature change. When the output value RND as described above is obtained at each sampling timing, the output value RND is biased to an L level value, and a poor quality random number is obtained. For this reason, the
検出結果matchがHレベル、出力値RNDがHレベルである場合、スキューによりデータ信号dtに対してクロック信号clkの位相が遅れており、サンプリングタイミングがメタステーブル期間内ではないことを示す。そのため、乱数生成要因は、メタスタビリティではなくスキューである。サンプリングタイミングごとに、上記のような出力値RNDが得られる場合、出力値RNDは、Hレベルの値に偏り、品質の悪い乱数が得られる。そのため、制御回路23は、クロック信号clkの位相を進めるように調整信号tsel1,tsel2(どちらか一方でもよい)の値を変える。
When the detection result match is H level and the output value RND is H level, it indicates that the phase of the clock signal clk is delayed with respect to the data signal dt due to skew, and the sampling timing is not within the metastable period. Therefore, the random number generation factor is not a metastability but a skew. When the output value RND as described above is obtained at each sampling timing, the output value RND is biased to an H level value, and a poor quality random number is obtained. Therefore, the
検出結果matchがLレベル、出力値RNDがLレベルまたはHレベルである場合、出力値RNDは、スキューの影響またはメタスタビリティの影響を受けている。つまり、乱数生成要因は、スキューまたはメタスタビリティとなる。 When the detection result match is L level and the output value RND is L level or H level, the output value RND is affected by skew or metastability. That is, the random number generation factor is skew or metastability.
乱数生成要因をメタスタビリティとするために、制御回路23は、たとえば、以下のようにサンプリングタイミングの調整を行う。
図4は、サンプリングタイミングの調整例を示す図である。
In order to make the random number generation factor metastability, the
FIG. 4 is a diagram illustrating an example of adjusting the sampling timing.
図4には、データ信号dtがLレベルからHレベルに遷移するときの、サンプリングタイミングの調整例が4つ示されている。また、図4の例では、データ信号dtの信号レベルが電圧V1以下となる期間ta、データ信号dtの信号レベルが電圧V1より大きく、電圧V2未満となる期間tb、データ信号dtの信号レベルが電圧V2以上、電圧V3以下となる期間tcが示されている。さらに、データ信号dtの信号レベルが電圧V3より大きく、電圧V4未満となる期間td、データ信号dtの信号レベルが電圧V4以上となる期間teが示されている。電圧V1〜V4は、たとえば、ラッチ回路22a1〜22a3の特性に応じて決まる。期間ta〜teは、たとえば、電圧V1〜V4と、ラッチ回路22a1〜22a3のデータ端子の負荷容量に応じて決まる。 FIG. 4 shows four examples of adjusting the sampling timing when the data signal dt transitions from the L level to the H level. In the example of FIG. 4, the period ta in which the signal level of the data signal dt is equal to or lower than the voltage V1, the period tb in which the signal level of the data signal dt is higher than the voltage V1 and lower than the voltage V2, and the signal level of the data signal dt is A period tc in which the voltage is not less than V2 and not more than voltage V3 is shown. Further, a period td in which the signal level of the data signal dt is higher than the voltage V3 and lower than the voltage V4, and a period te in which the signal level of the data signal dt is equal to or higher than the voltage V4 are shown. The voltages V1 to V4 are determined according to the characteristics of the latch circuits 22a1 to 22a3, for example. The periods ta to te are determined according to, for example, the voltages V1 to V4 and the load capacitance of the data terminals of the latch circuits 22a1 to 22a3.
期間ta内にサンプリングタイミングが位置する場合、ラッチ回路22a1〜22a3の出力値は、全てLレベルとなる。期間tb内にサンプリングタイミングが位置する場合、ラッチ回路22a1〜22a3の出力値は、Lレベルになる可能性が高いが、メタスタビリティによって、ラッチ回路22a1〜22a3の少なくとも1つの出力値がHレベルになる場合がある。期間tc内にサンプリングタイミングが位置する場合、ラッチ回路22a1〜22a3は、メタスタビリティによって、Hレベルの出力値とLレベルの出力値をほぼ同じ確率で出力する。期間td内にサンプリングタイミングが位置する場合、ラッチ回路22a1〜22a3の出力値は、Hレベルになる可能性が高いが、メタスタビリティによって、ラッチ回路22a1〜22a3の少なくとも1つの出力値がLレベルになる場合がある。期間te内にサンプリングタイミングが位置する場合、ラッチ回路22a1〜22a3の出力値は、全てHレベルとなる。 When the sampling timing is located within the period ta, the output values of the latch circuits 22a1 to 22a3 are all at the L level. When the sampling timing is located within the period tb, the output values of the latch circuits 22a1 to 22a3 are likely to be at the L level, but at least one output value of the latch circuits 22a1 to 22a3 is at the H level due to metastability. There is a case. When the sampling timing is located within the period tc, the latch circuits 22a1 to 22a3 output the H level output value and the L level output value with substantially the same probability due to metastability. When the sampling timing is located within the period td, the output values of the latch circuits 22a1 to 22a3 are likely to be at the H level, but at least one output value of the latch circuits 22a1 to 22a3 is at the L level due to metastability. There is a case. When the sampling timing is located within the period te, the output values of the latch circuits 22a1 to 22a3 are all at the H level.
期間ta〜tcのうち、品質のよい乱数生成に適している期間は、ラッチ回路22a1〜22a3がメタスタビリティ状態となる期間tcである。そのため、制御回路23は、期間tcを、サンプリングタイミングを設定する目標の期間(設定目標期間)とし、たとえば、以下に示すような4つのタイミング設定方法でサンプリングタイミングを調整する。
Of the periods ta to tc, the period suitable for generating a high-quality random number is the period tc in which the latch circuits 22a1 to 22a3 are in the metastability state. For this reason, the
(方法1)サンプリングタイミングが期間ta内である場合、検出結果matchはHレベル、出力値RNDはLレベルとなる。その場合、制御回路23は、調整信号tsel1,tsel2の値を変え、データ信号dtに対してクロック信号clkの位相を遅らせていくタイミング設定を行う。
(Method 1) When the sampling timing is within the period ta, the detection result match is H level and the output value RND is L level. In this case, the
一度のタイミング設定で変える位相の量は、より小さくすることが、設定目標期間にサンプリングタイミングを適切に合わせる上で望ましいが、あまり小さくし過ぎると、調整時間が長くなる。 Although it is desirable to make the amount of phase changed by one timing setting smaller in order to appropriately match the sampling timing with the set target period, if it is made too small, the adjustment time becomes longer.
なお、制御回路23は、少なくとも1つ前のタイミング設定で用いた調整信号tsel1,tsel2の値を、図示しない記憶部(たとえば、レジスタなど)に記憶させておく。
Note that the
クロック信号clkの位相を遅らせていくことで、検出結果matchがLレベル、出力値RNDがHレベルに変わると、制御回路23は、さらに、調整信号tsel1,tsel2の値を変え、データ信号dtに対してクロック信号clkの位相を遅らせる。検出結果matchがLレベル、出力値RNDがHレベルの場合、サンプリングタイミングは設定目標期間である期間tc内である可能性もあるが、期間tb内である可能性もあるためである。
By delaying the phase of the clock signal clk, when the detection result match is changed to the L level and the output value RND is changed to the H level, the
クロック信号clkの位相を遅らせていくことで、検出結果matchがLレベル、出力値RNDがLレベルに変わると、サンプリングタイミングが期間tc内または期間td内であることを意味する。このため、制御回路23は、今回行ったタイミング設定に対して1つ前に行ったタイミング設定で用いた、調整信号tsel1,tsel2の値を以後用いることで、以後の各サンプリングタイミングを精度よく設定目標期間に合わせることができる。
By delaying the phase of the clock signal clk, when the detection result match changes to L level and the output value RND changes to L level, it means that the sampling timing is within the period tc or the period td. For this reason, the
(方法2)方法2は、たとえば、方法1において、クロック信号clkの位相を遅らせていくことで、検出結果matchがLレベル、出力値RNDがLレベルに変わらずに、検出結果matchがHレベル、出力値RNDがHレベルに変わった場合に行われる。
(Method 2) In
制御回路23は、検出結果matchがHレベル、出力値RNDがHレベルに変わったときの調整信号tsel1,tsel2の値を記憶部に記憶させておく。そして、制御回路23は、調整信号tsel1,tsel2の値を変え、検出結果matchがHレベル、出力値RNDがLレベルに変わるまで、データ信号dtに対してクロック信号clkの位相を進ませる。制御回路23は、検出結果matchがHレベル、出力値RNDがLレベルに変わったときの、調整信号tsel1,tsel2の値を記憶部に記憶させる。
The
制御回路23は、検出結果matchがHレベル、出力値RNDがLレベルとなったタイミングと、検出結果matchがHレベル、出力値RNDがHレベルとなったタイミングの調整信号tsel1,tsel2の値を記憶部から取得する。そして制御回路23は、取得した値に基づいて、サンプリングタイミングを両タイミングの中間のタイミングに調整する調整信号tsel1,tsel2の値を求める。たとえば、制御回路23は、両タイミングでの調整信号tsel1,tsel2の値の平均を求めることで、両タイミングの中間のタイミングにサンプリングタイミングを合わせる調整信号tsel1,tsel2の値を求める。
The
そして、制御回路23は、求めた調整信号tsel1,tsel2の値を、以後、調整回路21a,21bに供給することで、以後の各サンプリングタイミングは期間tb〜tdのほぼ中央のタイミングとなる。つまり、サンプリングタイミングを、メタステーブル期間である設定目標期間内に合わせることができる。
Then, the
(方法3)初期状態におけるサンプリングタイミングが期間te内である場合、検出結果matchはHレベル、出力値RNDはHレベルとなる。その場合、制御回路23は、調整信号tsel1,tsel2の値を変え、データ信号dtに対してクロック信号clkの位相を進ませていくタイミング設定を行う。
(Method 3) When the sampling timing in the initial state is within the period te, the detection result match is H level and the output value RND is H level. In that case, the
クロック信号clkの位相を進ませていくことで、検出結果matchがLレベル、出力値RNDがLレベルに変わると、制御回路23は、さらに、調整信号tsel1,tsel2の値を変え、データ信号dtに対してクロック信号clkの位相を進ませる。検出結果matchがLレベル、出力値RNDがLレベルの場合、サンプリングタイミングは設定目標期間である期間tc内である可能性もあるが、期間td内である可能性もあるためである。
When the detection result match is changed to the L level and the output value RND is changed to the L level by advancing the phase of the clock signal clk, the
クロック信号clkの位相を進ませていくことで、検出結果matchがLレベル、出力値RNDがHレベルに変わると、サンプリングタイミングが期間tc内または期間tb内であることを意味する。このため、制御回路23は、今回行ったタイミング設定に対して1つ前に行ったタイミング設定で用いた、調整信号tsel1,tsel2の値を以後用いることで、以後の各サンプリングタイミングを精度よく設定目標期間に合わせることができる。
By advancing the phase of the clock signal clk, when the detection result match changes to L level and the output value RND changes to H level, it means that the sampling timing is within the period tc or the period tb. For this reason, the
(方法4)方法4は、たとえば、方法3において、クロック信号clkの位相を進めていくことで、検出結果matchがLレベル、出力値RNDがHレベルに変わらずに、検出結果matchがHレベル、出力値RNDがLレベルに変わった場合に行われる。
(Method 4) In
制御回路23は、検出結果matchがHレベル、出力値RNDがLレベルに変わったときの調整信号tsel1,tsel2の値を記憶部に記憶させておく。そして、制御回路23は、調整信号tsel1,tsel2の値を変え、検出結果matchがHレベル、出力値RNDがHレベルに変わるまで、データ信号dtに対してクロック信号clkの位相を遅らせる。制御回路23は、検出結果matchがHレベル、出力値RNDがHレベルに変わったときの、調整信号tsel1,tsel2の値を記憶部に記憶させる。
The
制御回路23は、検出結果matchがHレベル、出力値RNDがHレベルとなったタイミングと、検出結果matchがHレベル、出力値RNDがLレベルとなったタイミングの調整信号tsel1,tsel2の値を記憶部から取得する。そして制御回路23は、取得した値に基づいて、サンプリングタイミングを両タイミングの中間のタイミングに調整する調整信号tsel1,tsel2の値を求める。たとえば、制御回路23は、両タイミングでの調整信号tsel1,tsel2の値の平均を求めることで、両タイミングの中間のタイミングにサンプリングタイミングを合わせる調整信号tsel1,tsel2の値を求める。
The
そして、制御回路23は、求めた調整信号tsel1,tsel2の値を、以後、調整回路21a,21bに供給することで、以後の各サンプリングタイミングは期間tb〜tdのほぼ中央のタイミングとなる。つまり、サンプリングタイミングを、メタステーブル期間である設定目標期間内に合わせることができる。
Then, the
以下、上記4つの方法を用いてサンプリングタイミングを調整する処理の流れをフローチャートで説明する。
図5は、サンプリングタイミングの調整処理の一例の流れを示すフローチャートである。
Hereinafter, the flow of processing for adjusting the sampling timing using the above four methods will be described with reference to flowcharts.
FIG. 5 is a flowchart showing an example of the flow of sampling timing adjustment processing.
制御回路23は、調整信号tsel1,tsel2の初期値を調整回路21a,21bに供給して調整回路21a,21bを初期化する(ステップS1)。
その後、制御回路23は、初期状態における調整回路21a,21bから出力されるデータ信号dt及びクロック信号clkを用いて乱数生成部22から出力される検出結果match及び出力値RNDを検出する。そして制御回路23は、検出結果match及び出力値RNDからサンプリングタイミングを含む期間を判定する(ステップS2)。
The
Thereafter, the
そして、制御回路23は、判定した期間に応じて、図4に示した方法1または方法3によるタイミング設定を行う(ステップS3)。
制御回路23は、方法1または方法3によるタイミング設定により、サンプリングタイミングをメタステーブル期間内に設定が可能であるか否かを判定する(ステップS4)。制御回路23は、上記設定が可能であると判定した場合、調整処理を終了する。
Then, the
The
制御回路23は、上記設定が可能ではないと判定した場合、図4に示した方法2または方法4によるタイミング設定を行い(ステップS5)、調整処理を終了する。
図6は、図5の各処理についての一例を示すフローチャートである。
If the
FIG. 6 is a flowchart illustrating an example of each process in FIG.
図5のステップS1の初期化処理の例として、制御回路23は、調整信号tsel1,tsel2の初期値を調整回路21a,21bに供給して調整回路21a,21bにオフセット遅延を設定する(ステップS10)。これにより、データ信号dt及びクロック信号clkは、クロック信号CLKに対してオフセット遅延分、遅延した信号になる。
As an example of the initialization process in step S1 of FIG. 5, the
図5のステップS2の処理の例として、以下の処理が行われる。
調整回路21a,21bはクロック信号CLKを受け、ラッチ回路22a1〜22a3は、調整回路21aが出力するデータ信号dtを、調整回路21bが出力するクロック信号clkによるサンプリングタイミングで取り込む(ステップS11)。
The following process is performed as an example of the process of step S2 of FIG.
The
制御回路23は、乱数生成部22が出力する検出結果matchと出力値RNDとから、サンプリングタイミングを含む期間を判定する(ステップS12)。検出結果matchがHレベル、且つ、出力値RNDがLレベルである場合、制御回路23は、サンプリングタイミングが図4に示した期間ta内であると判定し、ステップS14の処理を行う。
The
検出結果matchがLレベル、且つ、出力値RNDがLレベルまたはHレベルである場合、制御回路23は、サンプリングタイミングが図4に示した期間tb〜td内であると判定する。その場合、制御回路23は、サンプリングタイミングが期間ta内に移動するように、調整信号tsel1,tsel2の値を変えてサンプリングタイミングを調整する(ステップS13)。
When the detection result match is L level and the output value RND is L level or H level, the
検出結果matchがHレベル、且つ、出力値RNDがHレベルである場合、制御回路23は、サンプリングタイミングが図4に示した期間te内であると判定する。その場合、図4に示した方法3または方法4によるタイミング設定が行われるが、図6では図示が省略されている。
If the detection result match is H level and the output value RND is H level, the
図5のステップS3,S4の処理の例として、以下の処理が行われる。
制御回路23は、データ信号dtに対してクロック信号clkの位相を遅らせるように調整信号tsel1,tsel2の値を変える(ステップS14)。
The following processing is performed as an example of the processing of steps S3 and S4 in FIG.
The
そして、調整回路21a,21bはクロック信号CLKを受け、ラッチ回路22a1〜22a3は、調整回路21aが出力するデータ信号dtを、調整回路21bが出力するクロック信号clkによるサンプリングタイミングで取り込む(ステップS15)。
Then, the
そして、制御回路23は、検出結果matchがLレベルで、且つ、出力値RNDがLレベルであるか否かを判定する(ステップS16)。
検出結果matchがLレベルで、且つ、出力値RNDがLレベルである場合、図4の方法1のタイミング設定でサンプリングタイミングをメタステーブル期間内に設定可能である。この場合、制御回路23は、前回のタイミング設定で用いた調整信号tsel1,tsel2の値を設定し(ステップS17)、調整処理を終了する。ステップS17の処理で設定される調整信号tsel1,tsel2の値は、たとえば、記憶部に記憶され、以後は記憶された値が調整回路21a,21bに設定され続ける。
Then, the
When the detection result match is L level and the output value RND is L level, the sampling timing can be set within the metastable period by the timing setting of the
ステップS16の処理で、検出結果matchと出力値RNDの少なくとも一方がHレベルであると判定した場合、制御回路23は、検出結果matchがHレベルで、且つ、出力値RNDがHレベルであるか否かを判定する(ステップS18)。検出結果matchと出力値RNDの少なくとも一方がLレベルである場合、ステップS14からの処理が繰り返される。
If it is determined in step S16 that at least one of the detection result match and the output value RND is at the H level, the
ステップS18の処理で、検出結果matchと出力値RNDの両方がHレベルであると判定された場合、図4の方法1のタイミング設定でサンプリングタイミングをメタステーブル期間内に設定不可能である。その場合、図5のステップS5の処理の例として、以下の処理が行われる。
If it is determined in step S18 that both the detection result match and the output value RND are at the H level, the sampling timing cannot be set within the metastable period by the timing setting of the
制御回路23は、検出結果matchと出力値RNDの両方がHレベルとなったときのタイミング設定に用いた調整信号tsel1,tsel2の値を、記憶部に記憶させる(ステップS19)。
The
その後、制御回路23は、データ信号dtに対してクロック信号clkの位相を進ませるように調整信号tsel1,tsel2の値を変える(ステップS20)。
そして、調整回路21a,21bはクロック信号CLKを受け、ラッチ回路22a1〜22a3は、調整回路21aが出力するデータ信号dtを、調整回路21bが出力するクロック信号clkによるサンプリングタイミングで取り込む(ステップS21)。
Thereafter, the
Then, the
そして、制御回路23は、検出結果matchがHレベルで、且つ、出力値RNDがLレベルであるか否かを判定する(ステップS22)。検出結果matchがLレベルか、出力値RNDがHレベルである場合、ステップS20からの処理が繰り返される。
Then, the
検出結果matchがHレベルで、且つ、出力値RNDがLレベルである場合、制御回路23は、そのときのタイミング設定に用いた調整信号tsel1,tsel2の値を、記憶部に記憶させる(ステップS23)。
When the detection result match is H level and the output value RND is L level, the
そして、制御回路23は、ステップS19,S23の処理で記憶した調整信号tsel1,tsel2の値を記憶部から取得する。そして取得した値に基づいて、ステップS18,S22の判定処理が“YES”となる各タイミングの中間にサンプリングタイミングを合わせる調整信号tsel1,tsel2の値を求める。そして、制御回路23は、求めた調整信号tsel1,tsel2の値を調整回路21a,21bに設定する(ステップS24)。そして、制御回路23は、調整処理を終了する。ステップS24の処理で設定される調整信号tsel1,tsel2の値は、たとえば、記憶部に記憶され、以後は記憶された値が調整回路21a,21bに設定され続ける。
And the
図6では図示が省略されているが、ステップS12の処理で、サンプリングタイミングを含む期間が期間teと判定された場合、ステップS14〜S24のうち、ステップS14,S16,S18,S20,S22を以下のように変更した処理が行われる。 Although not shown in FIG. 6, when the period including the sampling timing is determined to be the period te in the process of step S <b> 12, steps S <b> 14, S <b> 16, S <b> 18, S <b> 20, and S <b> 22 will be described below from among steps S <b> 14 to S < The process changed as follows is performed.
まず、制御回路23は、ステップS14の処理の代わりに、データ信号dtに対してクロック信号clkの位相を進ませるように調整信号tsel1,tsel2を変更する処理を行う。
First, the
また、制御回路23は、ステップS16の処理の代わりに、検出結果matchがLレベルで、且つ、出力値RNDがHレベルであるか否かを判定する処理を行う。制御回路23は、検出結果matchがLレベルで、且つ、出力値RNDがHレベルである場合にはステップS17の処理を行う。
In addition, the
制御回路23は、検出結果matchがHレベルまたは、出力値RNDがLレベルである場合、ステップS18の処理の代わりに、検出結果matchがHレベルで、且つ、出力値RNDがLレベルであるか否かを判定する処理を行う。制御回路23は、検出結果matchがHレベルで、且つ、出力値RNDがLレベルである場合、ステップS19の処理を行う。
When the detection result match is H level or the output value RND is L level, the
制御回路23は、検出結果matchがLレベルまたは、出力値RNDがHレベルである場合、上記のデータ信号dtに対してクロック信号clkの位相を進ませるように調整信号tsel1,tsel2を変更する処理を繰り返す。
When the detection result match is L level or the output value RND is H level, the
また、制御回路23は、ステップS20の処理の代わりに、データ信号dtに対してクロック信号clkの位相を遅らせるように調整信号tsel1,tsel2を変更する処理を行う。
Further, the
また、制御回路23は、ステップS22の処理の代わりに、検出結果match及び出力値RNDが両方Hレベルであるか否かを判定する。制御回路23は、検出結果match及び出力値RNDが両方Hレベルである場合、ステップS23の処理を行う。制御回路23は、検出結果match及び出力値RNDの少なくとも一方がLレベルである場合、上記のクロック信号clkの位相を遅らせるように調整信号tsel1,tsel2を変更する処理を繰り返す。
Further, the
図7は、乱数生成回路の乱数生成時の各信号の時間変化の一例を示すタイミングチャートである。
図7には、クロック信号CLK,clk、データ信号dt、ラッチ回路22a1〜22a3の出力値、検出結果match、出力値RND、乱数生成要因、制御信号CTRL、調整信号tsel1,tsel2、信号ERRの時間変化の例が示されている。なお、図7では、ラッチ回路22a1〜22a3の出力値は、まとめて模式的に示されている。
FIG. 7 is a timing chart showing an example of a time change of each signal when the random number generation circuit generates a random number.
FIG. 7 shows clock signals CLK and clk, data signal dt, output values of latch circuits 22a1 to 22a3, detection result match, output value RND, random number generation factor, control signal CTRL, adjustment signals tsel1, tsel2, and time of signal ERR. An example of the change is shown. In FIG. 7, the output values of the latch circuits 22a1 to 22a3 are schematically shown collectively.
クロック信号CLKの位相が調整回路21a,21bにて調整されることで、クロック信号clkとデータ信号dtが生成される。そして、図4〜図6に示した方法でクロック信号clkによるサンプリングタイミングが、メタステーブル期間内に調整されることで、ラッチ回路22a1〜22a3の出力値は、不定となる期間を経た後、HレベルまたはLレベルの値となる。
The clock signal clk and the data signal dt are generated by adjusting the phase of the clock signal CLK by the adjusting
検出結果match、出力値RNDも、ラッチ回路22a1〜22a3の出力値の変化に応じて、不定となる期間を経た後、HレベルまたはLレベルの値となる。乱数生成要因は、前述したようにクロック信号clkによるサンプリングタイミングが、メタステーブル期間内に調整されることで、メタスタビリティとなる。 The detection result match and the output value RND also become H level or L level values after an indefinite period according to changes in the output values of the latch circuits 22a1 to 22a3. As described above, the random number generation factor becomes metastability by adjusting the sampling timing by the clock signal clk within the metastable period.
制御信号CTRLは、乱数生成時には変化しない。また、図7では、サンプリングタイミングの調整中の調整信号tsel1,tsel2の変化は図示が省略されているが、制御回路23は、サンプリングタイミングの調整後は、調整信号tsel1,tsel2を変化しない。また、制御回路23は、乱数生成要因がメタスタビリティである場合には、信号ERRをLレベルにし、乱数生成要因がスキューである場合には、信号ERRをHレベルにする。
The control signal CTRL does not change during random number generation. In FIG. 7, the change of the adjustment signals tsel1 and tsel2 during the adjustment of the sampling timing is not shown, but the
なお、制御回路23は、出力値RNDがクロック信号CLKの所定サイクル数、同じ値である場合には、信号ERRをHレベルとして、異常状態であることを外部に通知するようにしてもよい。
Note that when the output value RND is the same value for a predetermined number of cycles of the clock signal CLK, the
上記のように制御回路23は、検出結果match及び出力値RNDに基づいて、サンプリングタイミングをメタステーブル期間である期間tc内に調整することで、乱数生成要因をメタスタビリティとすることができる。このため、図7に示されている出力値RNDは、値の偏りなどが低減された品質のよい乱数となる。
As described above, the
(第3の実施の形態)
図8は、第3の実施の形態の乱数生成回路の一例を示す図である。図8において、図2に示した第2の実施の形態の乱数生成回路20と同じ要素については同一符号が付されている。
(Third embodiment)
FIG. 8 is a diagram illustrating an example of a random number generation circuit according to the third embodiment. In FIG. 8, the same elements as those in the random
第3の実施の形態の乱数生成回路30は、乱数生成部30a0,30a1,…,30ai,…,30anと、乱数生成部30a0〜30anのそれぞれに供給されるクロック信号clkの遅延量を異ならせる遅延回路30b1,30b2,…,30bnを有する。 The random number generation circuit 30 according to the third embodiment varies the delay amount of the clock signal clk supplied to each of the random number generation units 30a0, 30a1, ..., 30ai, ..., 30an and the random number generation units 30a0 to 30an. Delay circuits 30b1, 30b2,..., 30bn are included.
乱数生成部30a0は、第2の実施の形態の乱数生成回路20の乱数生成部22に含まれる要素の他に、ExOR(排他的論理和)回路31a0を有する。ExOR回路31a0は、OR回路22d1の出力値と、制御回路30cから供給される入力値R0との排他的論理和の演算結果を出力する。ExOR回路31a0の出力値は、後段の乱数生成部30a1のExOR回路31a1に入力値R0の代わりに供給される。
The random number generation unit 30a0 includes an ExOR (exclusive OR) circuit 31a0 in addition to the elements included in the random
なお、乱数生成時には、入力値R0は、HレベルまたはLレベルの一方に固定される。乱数生成回路30の試験時には、入力値R0は変更されてもよい。
他の乱数生成部30a1〜30anも乱数生成部30a0と同様の回路である。
At the time of random number generation, the input value R0 is fixed to one of the H level and the L level. When the random number generation circuit 30 is tested, the input value R0 may be changed.
The other random number generation units 30a1 to 30an are circuits similar to the random number generation unit 30a0.
このような乱数生成回路30では、最後段の乱数生成部30anのExOR回路31anの出力値が、出力値RNDとなる。また、乱数生成部30a0〜30anのそれぞれは、第2の実施の形態の乱数生成回路20の乱数生成部22が出力する検出結果match、出力値RNDに対応する検出結果及び出力値を制御回路30cに供給する。たとえば、乱数生成部30a0は、検出結果match0と出力値RND0を制御回路30cに供給する。
In such a random number generation circuit 30, the output value of the ExOR circuit 31an of the last-stage random number generation unit 30an becomes the output value RND. Each of the random number generation units 30a0 to 30an outputs the detection result match output from the random
制御回路30cは、たとえば、クロック信号clkに対する遅延が乱数生成部30a0〜30anのうちで中間の値となる乱数生成部30aiから供給される検出結果matchiと出力値RNDiに基づいて、調整信号tsel1,tsel2の値を決定する。調整信号tsel1,tsel2の値は、図4〜図6に示した方法により、乱数生成部30aiに到達するクロック信号clkによるサンプリングタイミングがメタステーブル期間内になるように決定される。
The
乱数生成回路30では、遅延回路30b1〜30bnによる遅延時間を適宜設定することで、動作条件の変化などでスキューが発生しても、乱数生成部30a0〜30anの何れかにおけるサンプリングタイミングがメタステーブル期間内になる可能性が高まる。つまり、メタスタビリティによる乱数の発生確率を上げることができる。 In the random number generation circuit 30, by appropriately setting the delay time by the delay circuits 30b1 to 30bn, the sampling timing in any of the random number generation units 30a0 to 30an is set to the metastable period even if a skew occurs due to a change in operating conditions or the like. The possibility of becoming inside increases. That is, the probability of random numbers generated by metastability can be increased.
(第4の実施の形態)
図9は、第4の実施の形態の乱数生成回路の一例を示す図である。図9において、図8に示した第3の実施の形態の乱数生成回路30と同じ要素については同一符号が付されている。
(Fourth embodiment)
FIG. 9 is a diagram illustrating an example of a random number generation circuit according to the fourth embodiment. In FIG. 9, the same elements as those of the random number generation circuit 30 of the third embodiment shown in FIG.
第4の実施の形態の乱数生成回路40は、入力端子inとクロック端子ckと出力端子outとを備えたLFSR(Linear Feedback Shift Register)41を有する。
クロック端子ckには、クロック信号CLKが供給され、入力端子inには乱数生成部30anのExOR回路31anの出力値が供給される。出力端子outから乱数または擬似乱数である出力値RNDが出力される。
The random number generation circuit 40 according to the fourth embodiment includes an LFSR (Linear Feedback Shift Register) 41 having an input terminal in, a clock terminal ck, and an output terminal out.
The clock signal CLK is supplied to the clock terminal ck, and the output value of the ExOR circuit 31an of the random number generation unit 30an is supplied to the input terminal in. An output value RND that is a random number or a pseudo-random number is output from the output terminal out.
図10は、LFSRの一例を示す図である。
LFSR41は、16ビットシフトレジスタ41a、ExOR回路41b,41c,41d,41eを有する。
FIG. 10 is a diagram illustrating an example of the LFSR.
The
16ビットシフトレジスタ41aは、ExOR回路41bの出力値を、クロック端子ckに供給されるクロック信号CLKに同期したタイミングで取り込む。そして、16ビットシフトレジスタ41aは、“bit0”から“bit15”方向に、クロック信号CLKに同期したタイミングで1ビットずつシフトしていく。“bit0”〜“bit15”のそれぞれはレジスタを表している。
The 16-
ExOR回路41bは、入力端子inに供給される出力値RNDnとExOR回路41eの出力値(フィードバック信号)との排他的論理和の演算結果を出力する。ExOR回路41cは、“bit13”で表されるレジスタの出力値と、“bit15”で表されるレジスタの出力値との排他的論理和の演算結果を出力する。ExOR回路41dは、“bit12”で表されるレジスタの出力値と、ExOR回路41cの出力値との排他的論理和の演算結果を出力する。ExOR回路41eは、“bit10”で表されるレジスタの出力値と、ExOR回路41dの出力値との排他的論理和の演算結果をフィードバック信号としてExOR回路41bに供給する。
The
ところで、ExOR回路41bを有さずに、ExOR回路41eの出力値を16ビットシフトレジスタ41aに入力するLFSRは、周期性をもつ擬似乱数を出力する。
これに対して、図10に示したLFSR41では、ExOR回路41bの一方の入力端子には、乱数生成部30anのExOR回路31anの出力値が供給される。擬似乱数の周期の間に、その出力値がメタスタビリティによる乱数となることで、LFSR41が出力する出力値RNDは、周期性をもたない乱数となる。つまり、出力値RNDが擬似乱数となることを回避できる。このため、品質のよい乱数を出力できる。
By the way, the LFSR that does not have the
On the other hand, in the
また、第3の実施の形態の乱数生成回路30では、クロック信号CLKの各周期でメタスタビリティによる乱数が出力しない可能性があるが、上記のようなLFSR41を有する乱数生成回路40は、クロック信号CLKの各周期で乱数を出力できる。つまり、乱数の発生レートを向上できる。
In the random number generation circuit 30 according to the third embodiment, random numbers due to metastability may not be output in each cycle of the clock signal CLK. However, the random number generation circuit 40 having the
なお、制御回路30cは、LFSR41が出力する出力値RNDがクロック信号CLKの所定サイクル数、同じ値である場合には、信号ERRをHレベルとして、異常状態であることを外部に通知してもよい。また、制御回路30cは、LFSR41の入力端子inに供給される乱数生成部30anの出力値が変化するか否かを検出し、その出力値がクロック信号CLKの所定サイクル数、同じ値である場合には、信号ERRをHレベルとしてもよい。
When the output value RND output from the
また、第2の実施の形態の乱数生成回路20とLFSR41を組み合わせて、乱数生成部22の出力値をLFSR41の入力端子inに供給するようにしてもよい。
また、上記のLFSR41は一例であり、図10の回路構成に限定されない。たとえば、16ビットシフトレジスタ41aの代わりに、32ビットシフトレジスタを用いるなど、種々の変形が可能である。
Further, the random
Further, the
(第5の実施の形態)
ところで、メタステーブル期間は、長いほど、サンプリングタイミングを合わせることが容易になる。また、温度や、電圧ノイズなどによって、クロック信号clkとデータ信号dtにスキューが生じたとしても、メタステーブル期間が長ければ、サンプリングタイミングをメタステーブル期間内に維持できる可能性が高まる。
(Fifth embodiment)
By the way, the longer the metastable period, the easier it is to match the sampling timing. Further, even if the clock signal clk and the data signal dt are skewed due to temperature, voltage noise, or the like, if the metastable period is long, the possibility that the sampling timing can be maintained within the metastable period is increased.
以下では、メタステーブル期間を拡大可能な乱数生成回路を説明する。なお、以下に示す第5の実施の形態の乱数生成回路は、前述の第1乃至第4の実施の形態の乱数生成回路10,20,30,40とも組み合わせることができるが、組み合わせる例については後述する。
Hereinafter, a random number generation circuit capable of extending the metastable period will be described. The random number generation circuit of the fifth embodiment shown below can be combined with the random
図11は、第5の実施の形態の乱数生成回路の一例を示す図である。
乱数生成回路50は、調整回路51a,51bを有する調整部51と、負荷容量可変回路52、ラッチ回路53、制御回路54を有する。
FIG. 11 is a diagram illustrating an example of a random number generation circuit according to the fifth embodiment.
The random
調整部51は、第1の実施の形態の乱数生成回路10における調整部11と同様の機能をする。なお、以下でも、入力信号は、クロック信号CLKであるものとして説明するが、クロック信号CLKに限定されるものではない。
The
調整部51は、クロック信号CLKに基づいて、データ信号dtとクロック信号clkとを出力するとともに、調整信号tsel1,tsel2に基づいて、データ信号dtとクロック信号clkの少なくとも一方の位相を調整する。
The
負荷容量可変回路52は、制御回路54から供給される選択信号cselに基づいて決定される開始タイミングから、ラッチ回路53においてデータ信号dtoが供給される端子の負荷容量を段階的に増加させる。負荷容量可変回路52は、バッファ52a、遅延選択回路52b、容量回路52c1〜52cnを有する。
The load
バッファ52aは、データ信号dtの波形を鈍らせ、データ信号dtを遅延させたデータ信号dtoを出力する。
遅延選択回路52bは、データ信号dtと選択信号cselとに基づいたタイミングで、容量回路52c1〜52cnを有効にして負荷容量を追加する。
The
The
容量回路52c1〜52cnは、データ信号dtoが伝搬する配線に接続されており、遅延選択回路52bによって、有効化または無効化される。
ラッチ回路53は、データ信号dtoとクロック信号clkとを受け、クロック信号clkによるサンプリングタイミングにおけるデータ信号dtoの信号レベルに基づいて、HレベルまたはLレベルの出力値RNDを出力する。
The capacitor circuits 52c1 to 52cn are connected to a wiring through which the data signal dto propagates, and are enabled or disabled by the
The
制御回路54は、たとえば、ASICやFPGAなどの特定用途の電子回路である。また、制御回路54は、CPUやDSPなどの演算処理装置としてのプロセッサであってもよい。プロセッサは、RAMなどのメモリに記憶されたプログラムを実行する。なお、制御回路54は、複数のプロセッサの集合であってもよい。
The
制御回路54は、出力値RNDに基づいて、調整信号tsel1,tsel2や、選択信号cselを出力する。また、制御回路54は、制御信号CTRLによって乱数生成回路50の外部から制御されてもよい。また、制御回路54は、出力値RNDがクロック信号CLKの所定サイクル数、同じ値である場合には、異常状態であることを示す信号ERRを出力してもよい。
The
図12は、遅延選択回路と容量回路の一例を示す図である。
遅延選択回路52bは、遅延回路60a1,60a2,…,60am、選択回路60b、遅延回路60c1〜60c(n−1)、OR回路60d1,60d2,…,60dn、AND回路60e1,60e2,…,60enを有する。
FIG. 12 is a diagram illustrating an example of the delay selection circuit and the capacitor circuit.
The
遅延回路60a1〜60amは、直列に接続されており、先頭の遅延回路60a1には、データ信号dtが供給される。遅延回路60a1〜60amのそれぞれで遅延されたデータ信号dtが、データ信号dt1〜dtmとして選択回路60bに供給される。
The delay circuits 60a1 to 60am are connected in series, and the data signal dt is supplied to the head delay circuit 60a1. The data signal dt delayed by each of the delay circuits 60a1 to 60am is supplied to the
選択回路60bは、データ信号dt,dt1〜dtmの何れかを、信号ct0,ct1,…,ctmに基づいて選択して、データ信号dtsとして出力する。信号ct0〜ctmは、選択信号cselに含まれる信号である。
The
遅延回路60c1〜60c(n−1)は、直列に接続されており、先頭の遅延回路60c1には、データ信号dtsが供給される。遅延回路60c1〜60c(n−1)のそれぞれで遅延されたデータ信号dtsが、OR回路60d2〜60dnの一方の入力端子に供給される。 The delay circuits 60c1 to 60c (n-1) are connected in series, and the data signal dts is supplied to the head delay circuit 60c1. The data signal dts delayed by each of the delay circuits 60c1 to 60c (n-1) is supplied to one input terminal of the OR circuits 60d2 to 60dn.
OR回路60d1の一方の入力端子にはデータ信号dtsが供給される。OR回路60d1〜60dnの他方の入力端子には、信号ctonが供給される。OR回路60d1〜60dnの出力信号は、AND回路60e1〜60enの一方の入力端子に供給される。 The data signal dts is supplied to one input terminal of the OR circuit 60d1. The signal cton is supplied to the other input terminals of the OR circuits 60d1 to 60dn. The output signals of the OR circuits 60d1 to 60dn are supplied to one input terminal of the AND circuits 60e1 to 60en.
AND回路60e1〜60enの他方の入力端子には、信号ctoffが供給される。AND回路60e1〜60enの出力信号は、容量回路52c1〜52cnに供給される。信号cton,ctoffは、選択信号cselに含まれる信号である。 A signal ctoff is supplied to the other input terminals of the AND circuits 60e1 to 60en. Output signals of the AND circuits 60e1 to 60en are supplied to the capacitor circuits 52c1 to 52cn. The signals cton and ctoff are signals included in the selection signal csel.
容量回路52c1は、インバータ回路61、トランジスタ62,63,64、キャパシタ65を有する。トランジスタ62,63は、nチャネル型MOSFET(Metal-Oxide-Semiconductor Field-Effect Transistor)であり、トランジスタ64は、pチャネル型MOSFETである。
The capacitor circuit 52c1 includes an
インバータ回路61の入力端子は、AND回路60e1の出力端子に接続されており、インバータ回路61の出力端子は、トランジスタ62,64のゲート端子に接続されている。トランジスタ62のソース端子は接地されており、トランジスタ62のドレイン端子は、トランジスタ63のソース端子、トランジスタ64のドレイン端子及びキャパシタ65の一方の端子に接続されている。トランジスタ63のドレイン端子及びトランジスタ64のソース端子は、データ信号dtoが伝搬する配線に接続されている。キャパシタ65の他方の端子は接地されている。
The input terminal of the
容量回路52c2〜52cnも、容量回路52c1と同様の回路である。
信号cton,ctoffが共にHレベルの場合、AND回路60e1〜60enの出力値もHレベルとなる。AND回路60e1〜60enの出力値がHレベルとなるとき、トランジスタ62がオフ状態、トランジスタ63,64がオン状態となるため、キャパシタ65は、データ信号dtoが伝搬する配線に電気的に接続される。つまり、容量回路52c1〜52cnは有効になる。
The capacitor circuits 52c2 to 52cn are similar to the capacitor circuit 52c1.
When the signals cton and ctoff are both at the H level, the output values of the AND circuits 60e1 to 60en are also at the H level. When the output values of the AND circuits 60e1 to 60en are at the H level, the
信号ctoffがLレベルの場合、信号ctonの値にかかわらず、AND回路60e1〜60enの出力値もLレベルとなる。AND回路60e1〜60enの出力値がLレベルとなるとき、トランジスタ62がオン状態、トランジスタ63,64がオフ状態となるため、キャパシタ65は、データ信号dtoが伝搬する配線から電気的に切断される。つまり、容量回路52c1〜52cnは無効になる。
When the signal ctoff is at the L level, the output values of the AND circuits 60e1 to 60en are also at the L level regardless of the value of the signal cton. When the output values of the AND circuits 60e1 to 60en are at the L level, the
信号ctonがLレベルで、信号ctoffがHレベルの場合、データ信号dtsがHレベルに遷移するときに、AND回路60e1〜60enの出力値が順番にHレベルとなる。これにより、容量回路52c1〜52cnは容量回路52c1から順番に有効になる。 When the signal cton is at the L level and the signal ctoff is at the H level, the output values of the AND circuits 60e1 to 60en sequentially become the H level when the data signal dts transitions to the H level. As a result, the capacitance circuits 52c1 to 52cn become effective in order from the capacitance circuit 52c1.
図13は、サンプリングタイミングの設定例と負荷容量可変回路による負荷容量の設定例とを示す図である。電圧範囲Vmetは、ラッチ回路53がメタスタビリティ状態となるデータ信号dtoの電圧範囲である。
FIG. 13 is a diagram illustrating an example of setting the sampling timing and an example of setting the load capacitance by the load capacitance variable circuit. The voltage range Vmet is a voltage range of the data signal dto in which the
まず、制御回路54は、図12に示した信号ctoffをLレベルにして、容量回路52c1〜52cnを無効にして、負荷容量の追加をしない状態にする。そして、制御回路54は、たとえば、調整信号tsel1,tsel2を変えて、クロック信号clkの位相をデータ信号dtoよりも進ませた状態から、クロック信号clkの位相を遅らせていく。制御回路54は、出力値RNDを検出し、出力値RNDがLレベルから、Hレベルに変化するタイミングt10における調整信号tsel1,tsel2の値を、図示しない記憶部に記憶させる。
First, the
その後、制御回路54は、図12に示した信号ctoff,ctonを共にHレベルにして、容量回路52c1〜52cnを有効にして、負荷容量を追加する。そして、制御回路54は、上記と同様に、たとえば、調整信号tsel1,tsel2を変えて、クロック信号clkの位相をデータ信号dtoよりも進ませた状態から、クロック信号clkの位相を遅らせていく。制御回路54は、出力値RNDを検出し、出力値RNDがLレベルから、Hレベルに変化するタイミングt12における調整信号tsel1,tsel2の値を、図示しない記憶部に記憶させる。
Thereafter, the
そして、制御回路54は、記憶された調整信号tsel1,tsel2の値に基づいて、タイミングt10,t12の中間(タイミングt11)にサンプリングタイミングを合わせるための調整信号tsel1,tsel2の値を算出する。たとえば、制御回路54は、タイミングt10,t12での調整信号tsel1,tsel2の値の平均を求めることで、タイミングt11にサンプリングタイミングを合わせる調整信号tsel1,tsel2の値を求める。求めた値は、たとえば、記憶部に記憶される。
Then, based on the stored values of the adjustment signals tsel1 and tsel2, the
なお、クロック信号clkの位相をデータ信号dtoよりも遅らせた状態から、クロック信号clkの位相を進めていき、出力値RNDが変化するタイミングの調整信号tsel1,tsel2を用いて、サンプリングタイミングt11を決定してもよい。 The phase of the clock signal clk is advanced from the state in which the phase of the clock signal clk is delayed from that of the data signal dto, and the sampling timing t11 is determined using the adjustment signals tsel1 and tsel2 of the timing at which the output value RND changes. May be.
次に、制御回路54は、調整信号tsel1,tsel2の値を変えて、再びサンプリングタイミングをタイミングt10に合わせる。そして、制御回路54は、図13に示すように、信号ctoffをHレベルにし、信号ctonをLレベルにした状態で、信号ct0〜ctmを変化させて、負荷容量の追加を開始するタイミングを、早めていく。波形66aは、負荷容量の追加開始タイミングを最も遅らせた場合のデータ信号dtoの変化を示し、波形66bは、負荷容量の追加開始タイミングを最も早くした場合のデータ信号dtoの変化を示す。負荷容量は、遅延回路60c1〜60c(n−1)によって、段階的に増加する。
Next, the
制御回路54は、出力値RNDを検出し、出力値RNDがHレベルから、Lレベルに変化するときの信号ct0〜ctmの値により、追加開始タイミングを決定する。制御回路54は、このときの信号ct0〜ctmの値を、記憶部に記憶させる。たとえば、波形66cは、記憶部に記憶された信号ct0〜ctmの値による追加開始タイミングで負荷容量が追加されたときの、データ信号dtoの変化を示している。
The
以後の乱数生成時には、制御回路54は、上記の方法で求めた、タイミングt11にサンプリングタイミングを合わせるための調整信号tsel1,tsel2の値と、決定した追加開始タイミングにおける信号ct0〜ctmの値を用いる。
At the time of subsequent random number generation, the
図14は、負荷容量の追加開始タイミングを図13のように決定したときのメタステーブル期間を示す図である。なお、図14には、図13に示した波形66cのメタステーブル期間tm1の他に、図13に示した負荷容量の追加がない場合のメタステーブル期間tm2と、常に負荷容量を追加した場合のメタステーブル期間tm3についても図示されている。
FIG. 14 is a diagram showing a metastable period when the load capacity addition start timing is determined as shown in FIG. In addition to the metastable period tm1 of the
常に容量回路52c1〜52cnによる負荷容量が追加されている場合、データ信号dtoの立ち上がりが緩やかになり、負荷容量の追加がない場合と比べて、電圧範囲Vmetとなるメタステーブル期間tm3が長くなる。しかしながら、データ信号dtoの立ち上がりが開始してから電圧範囲Vmetに入るまでの期間が比較的長くなる。 When the load capacitances are always added by the capacitance circuits 52c1 to 52cn, the rise of the data signal dto becomes gentle, and the metastable period tm3 that is the voltage range Vmet becomes longer than when the load capacitance is not added. However, the period from the start of the rise of the data signal dto until the voltage range Vmet is entered is relatively long.
これに対して、負荷容量の追加開始タイミングを図13のように決定して得られる波形66cでは、データ信号dtoの立ち上がりが開始してから電圧範囲Vmetに入るまでの期間が常に負荷容量を追加している場合と比べて短くなる。この結果、メタステーブル期間tm1を、同じ負荷容量を常に追加する場合のメタステーブル期間tm3よりも長くすることができる。
On the other hand, in the
なお、図12に示した遅延回路60a1〜60am,60c1〜60c(n−1)の数や遅延時間、容量回路52c1〜52cnの数や容量値などのパラメータは、たとえば、回路シミュレーションなどで計算された結果に基づいて決定される。たとえば、回路シミュレーションの際には、調整精度や設定するメタステーブル期間をどれだけ長くするかに応じて上記のパラメータが決定される。 The parameters such as the number and delay time of the delay circuits 60a1 to 60am and 60c1 to 60c (n-1) and the number and capacitance value of the capacitor circuits 52c1 to 52cn shown in FIG. 12 are calculated by circuit simulation, for example. It is determined based on the result. For example, in the circuit simulation, the above parameters are determined depending on how long the adjustment accuracy and the metastable period to be set are increased.
以下、サンプリングタイミングと負荷容量の追加開始タイミングの設定処理の流れをフローチャートで説明する。
図15は、サンプリングタイミングと負荷容量の追加開始タイミングの設定処理の一例の流れを示すフローチャートである。
A flow of setting processing of sampling timing and load capacity addition start timing will be described below with reference to flowcharts.
FIG. 15 is a flowchart illustrating an exemplary flow of setting processing of sampling timing and load capacity addition start timing.
制御回路54は、負荷容量を追加しない状態で、クロック信号clkの位相をデータ信号dtoよりも進んだ状態にする調整信号tsel1,tsel2の初期値を出力し、調整回路51a,51bを初期化する(ステップS30)。
The
その後、制御回路54は、調整信号tsel1,tsel2を変えて、クロック信号clkの位相を遅らせていく(サンプリングタイミングを変える)。そして、制御回路54は、出力値RNDを検出し、出力値RNDがLレベルからHレベルに変化するタイミングに設定した調整信号tsel1,tsel2の値を、記憶部に記憶させる(ステップS31)。
Thereafter, the
また、制御回路54は、負荷容量の追加がある状態で、クロック信号clkの位相をデータ信号dtoよりも進んだ状態にする調整信号tsel1,tsel2の初期値を出力し、調整回路51a,51bを初期化する(ステップS32)。
Further, the
その後、再び、制御回路54は、ステップS31と同じ処理を行う(ステップS33)。
次に、制御回路54は、ステップS31,S33の処理で記憶された調整信号tsel1,tsel2の値に基づいて、サンプリングタイミングを、両タイミングの中間のタイミングとする調整信号の値を決定する(ステップS34)。
Thereafter, again, the
Next, based on the values of the adjustment signals tsel1 and tsel2 stored in the processes of steps S31 and S33, the
その後、制御回路54は、入力負荷の追加開始タイミングを設定する(ステップS35)。
図16及び図17は、図15の各処理についての一例を示すフローチャートである。
Thereafter, the
16 and 17 are flowcharts showing an example of each process of FIG.
図15のステップS30の初期化処理の例として、図16に示すように、制御回路54は、まず、信号ct0〜ctm=“X”、信号cton=“X”、信号ctoff=“L”(Lレベル)に設定する(ステップS40)。“X”は、HレベルでもLレベルでもよいことを表す。また、制御回路54は、クロック信号clkの位相をデータ信号dtoよりも進ませる調整信号tsel1,tsel2の初期値を調整回路51a,51bに設定する(ステップS41)。
As an example of the initialization process in step S30 of FIG. 15, as shown in FIG. 16, the
次に、図15のステップS31の処理の例として、図16のステップS42〜S45の処理が行われる。
調整回路51a,51bはクロック信号CLKを受け、データ信号dtとクロック信号clkを出力する。データ信号dtは、負荷容量可変回路52に供給される。ラッチ回路53は、負荷容量可変回路52が出力するデータ信号dtoを、クロック信号clkによるサンプリングタイミングで取り込む(ステップS42)。
Next, as an example of the process in step S31 in FIG. 15, the processes in steps S42 to S45 in FIG. 16 are performed.
The
そして、制御回路54は、出力値RNDがHレベルであるか否かを判定する(ステップS43)。
出力値RNDがHレベルではない場合、制御回路54は、データ信号dtoに対してクロック信号clkの位相を遅らせるように調整信号tsel1,tsel2を変える(ステップS44)。ステップS44の処理後は、ステップS42の処理が再び行われる。
Then, the
When the output value RND is not at the H level, the
出力値RNDがHレベルである場合、制御回路54は、現在のサンプリングタイミング(たとえば、図13のタイミングt10)に設定した調整信号tsel1,tsel2の値を、記憶部に記憶させる(ステップS45)。
When the output value RND is at the H level, the
次に、図15のステップS32の初期化処理の例として、図16に示すように、制御回路54は、信号ct0〜ctm=“X”、信号cton=“H”(Hレベル)、信号ctoff=“H”に設定する(ステップS46)。また、制御回路54は、クロック信号clkの位相をデータ信号dtoよりも進ませる調整信号tsel1,tsel2の初期値を調整回路51a,51bに設定する(ステップS47)。
Next, as an example of the initialization process in step S32 of FIG. 15, as shown in FIG. 16, the
そして、図15のステップS33の処理の例として、図16のステップS48〜S51の処理が行われる。ステップS48〜S51の処理は、ステップS42〜S45の処理と同じである。ただ、出力値RNDがHレベルになるサンプリングタイミング(たとえば、図13のタイミングt12)が、負荷容量を追加しない場合と異なる。 And the process of FIG.16 S48-S51 is performed as an example of the process of FIG.15 S33. The process of steps S48 to S51 is the same as the process of steps S42 to S45. However, the sampling timing at which the output value RND becomes H level (for example, timing t12 in FIG. 13) is different from the case where no load capacitance is added.
その後、図15のステップS34の処理の例として、以下の処理が行われる。
制御回路54は、サンプリングタイミングを、ステップS43,S49の処理で出力値RNDがHレベルになる各サンプリングタイミングの中間とする調整信号tsel1,tsel2の値を決定し、記憶部に記憶させる(ステップS52)。ステップS52の処理では、制御回路54は、ステップS45,S51の処理で記憶された調整信号tsel1,tsel2の値に基づいて、サンプリングタイミングを、たとえば、図13の、タイミングt11とする調整信号tsel1,tsel2を決定する。そして、制御回路54は、決定した調整信号tsel1,tsel2を記憶部に記憶させる。
Thereafter, the following processing is performed as an example of the processing in step S34 in FIG.
The
次に、図15のステップS35の処理の例として、図17のステップS53〜S58の処理が行われる。
制御回路54は、信号ct0〜ctm=“L”、信号cton=“L”、信号ctoff=“H”に設定する(ステップS53)。さらに、制御回路54は、ステップS45の処理で記憶した調整信号tsel1,tsel2の値を用いて、サンプリングタイミングを、タイミングt10に設定する(ステップS54)。
Next, steps S53 to S58 in FIG. 17 are performed as an example of step S35 in FIG.
The
その後、調整回路51a,51bはクロック信号CLKを受け、データ信号dtとクロック信号clkを出力する。データ信号dtは、負荷容量可変回路52に供給される。ラッチ回路53は、負荷容量可変回路52が出力するデータ信号dtoを、クロック信号clkによるサンプリングタイミングで取り込む(ステップS55)。
Thereafter, the
そして、制御回路54は、出力値RNDがLレベルであるか否かを判定する(ステップS56)。出力値RNDがLレベルではない場合、制御回路54は、信号ct0〜ctmを、信号ctmから順にHレベルに設定する(ステップS57)。ステップS57の処理後は、ステップS56の処理が再び行われる。
Then, the
たとえば、信号ct0〜ctmの値が全てLレベルの場合、図12の選択回路60bは、データ信号dt〜dtmのうち、一番遅延時間が大きいデータ信号dtmを選択してデータ信号dtsとして出力する。出力値RNDがHレベルのままである場合、制御回路54は、信号ctmの値をHレベルに変える。これにより、選択回路60bは、データ信号dt〜dtmのうち、遅延時間が2番目に大きいデータ信号を選択してデータ信号dtsとして出力する。これでも出力値RNDがHレベルのままである場合、制御回路54は、信号ct(m−1)(図12では図示を省略している)の値をさらにHレベルに変える。これにより、選択回路60bは、データ信号dt〜dtmのうち、遅延時間が3番目に大きいデータ信号を選択してデータ信号dtsとして出力する。制御回路54は、このような処理を、出力値RNDがLレベルに変わるまで繰り返す。
For example, when the values of the signals ct0 to ctm are all at the L level, the
これによって、負荷容量の追加開始タイミングが早まっていく。出力値RNDがLレベルである場合、制御回路54は、現在の信号ct0〜ctmの値を、記憶部に記憶させ(ステップS58)、設定処理を終了する。
As a result, the load capacity addition start timing is advanced. When the output value RND is at the L level, the
なお、上記の図15〜図17の処理の順序は一例であり、処理の順序を適宜変更してもよい。たとえば、ステップS31の処理後に、ステップS35の負荷容量の追加開始タイミングを設定してもよい。 Note that the order of the processes in FIGS. 15 to 17 is an example, and the order of the processes may be changed as appropriate. For example, the load capacity addition start timing in step S35 may be set after the process in step S31.
上記のような第5の実施の形態の乱数生成回路50及びその制御方法によれば、メタステーブル期間を拡大できるため、サンプリングタイミングを合わせることが容易になり、メタスタビリティによる品質のよい乱数を生成できる。
According to the random
(第6の実施の形態)
図18は、第6の実施の形態の乱数生成回路の一例を示す図である。図18において、図11に示した第5の実施の形態の乱数生成回路50と同じ要素については同一符号が付されている。
(Sixth embodiment)
FIG. 18 is a diagram illustrating an example of a random number generation circuit according to the sixth embodiment. In FIG. 18, the same elements as those in the random
第6の実施の形態の乱数生成回路70は、ラッチ回路71a0,71a1,71a2,…,71an、遅延回路71b1,71b2,…,71bn、ExOR回路71c0,71c1,71c2,…,71cn、制御回路71dを有する。 The random number generation circuit 70 of the sixth embodiment includes latch circuits 71a0, 71a1, 71a2, ..., 71an, delay circuits 71b1, 71b2, ..., 71bn, ExOR circuits 71c0, 71c1, 71c2,. Have
ラッチ回路71a0〜71anのデータ端子には、負荷容量可変回路52が出力したデータ信号dtoが供給される。また、ラッチ回路71a1〜71anのそれぞれのクロック端子には、直列に接続された遅延回路71b1〜71bnによって異なる遅延時間分、遅延されたクロック信号clkが供給される。
The data signal dto output from the load
また、ExOR回路71c0〜71cnは直列に接続されており、ExOR回路71c0〜71cnのそれぞれの一方の入力端子には、ラッチ回路71a0〜71anのうち対応するラッチ回路の出力値が供給される。ExOR回路71c1〜71cnのそれぞれの他方の入力端子には、前段のExOR回路の出力値が供給される。初段のExOR回路71c0の他方の入力端子には、入力値R0が供給される。 Further, the ExOR circuits 71c0 to 71cn are connected in series, and the output value of the corresponding latch circuit among the latch circuits 71a0 to 71an is supplied to one input terminal of each of the ExOR circuits 71c0 to 71cn. The output value of the previous ExOR circuit is supplied to the other input terminal of each of the ExOR circuits 71c1 to 71cn. The input value R0 is supplied to the other input terminal of the first-stage ExOR circuit 71c0.
なお、乱数生成時には、入力値R0は、HレベルまたはLレベルの一方に固定される。乱数生成回路70の試験時には、入力値R0は変更されてもよい。最後段のExOR回路71cnの出力値が、出力値RNDとなる。また、ラッチ回路71a0〜71anの出力値は、制御回路71dに供給される。
At the time of random number generation, the input value R0 is fixed to one of the H level and the L level. When the random number generation circuit 70 is tested, the input value R0 may be changed. The output value of the final-stage ExOR circuit 71cn becomes the output value RND. The output values of the latch circuits 71a0 to 71an are supplied to the
制御回路71dは、たとえば、クロック信号clkに対する遅延がラッチ回路71a0〜71anのうちで中間の値となるラッチ回路から供給される出力値に基づいて、図15に示した処理で、調整信号tsel1,tsel2や選択信号cselの値を決定する。
For example, the
乱数生成回路70では、遅延回路71b1〜71bnによる遅延時間を適宜設定することで、動作条件の変化などでスキューが発生してもラッチ回路71a0〜71anの何れかにおけるサンプリングタイミングがメタステーブル期間内になる可能性を高められる。つまり、メタスタビリティによる乱数の発生確率を上げることができる。 In the random number generation circuit 70, by appropriately setting the delay time by the delay circuits 71b1 to 71bn, the sampling timing in any of the latch circuits 71a0 to 71an is within the metastable period even if a skew occurs due to a change in operating conditions or the like. The possibility that becomes. That is, the probability of random numbers generated by metastability can be increased.
(第7の実施の形態)
図19は、第7の実施の形態の乱数生成回路の一例を示す図である。図19において、図18に示した第6の実施の形態の乱数生成回路70と同じ要素については同一符号が付されている。
(Seventh embodiment)
FIG. 19 is a diagram illustrating an example of a random number generation circuit according to the seventh embodiment. 19, the same elements as those in the random number generation circuit 70 according to the sixth embodiment shown in FIG.
第7の実施の形態の乱数生成回路80は、入力端子inとクロック端子ckと出力端子outとを備えたLFSR81を有する。
クロック端子ckには、クロック信号CLKが供給され、入力端子inには最後段のExOR回路71cnの出力値が供給される。出力端子outから乱数または擬似乱数である出力値RNDが出力される。
The random number generation circuit 80 according to the seventh embodiment includes an
A clock signal CLK is supplied to the clock terminal ck, and an output value of the ExOR circuit 71cn at the last stage is supplied to the input terminal in. An output value RND that is a random number or a pseudo-random number is output from the output terminal out.
LFSR81は、たとえば、図10に示したLFSR41と同じ回路で実現できる。擬似乱数の周期の間に、ExOR回路71cnの出力値がメタスタビリティによる乱数となることで、LFSR81が出力する出力値RNDは、周期性をもたない乱数となる。つまり、出力値RNDが擬似乱数となることを回避できる。このため、品質のよい乱数を出力できる。
The
また、第6の実施の形態の乱数生成回路70では、クロック信号CLKの各周期でメタスタビリティによる乱数が出力しない可能性があるが、上記のようなLFSR81を有する乱数生成回路80は、クロック信号CLKの各周期で乱数を出力できる。つまり、乱数の発生レートを向上できる。
In the random number generation circuit 70 of the sixth embodiment, random numbers due to metastability may not be output in each cycle of the clock signal CLK. However, the random number generation circuit 80 having the
なお、制御回路71dは、LFSR81が出力する出力値RNDがクロック信号CLKの所定サイクル数、同じ値である場合には、信号ERRをHレベルとして、異常状態であることを外部に通知してもよい。また、制御回路71dは、LFSR81の入力端子inに供給されるExOR回路71cnの出力値が変化するか否かを検出し、その出力値がクロック信号CLKの所定サイクル数、同じ値である場合には、信号ERRをHレベルとしてもよい。
When the output value RND output from the
また、第5の実施の形態の乱数生成回路50とLFSR81を組み合わせて、ラッチ回路53の出力値をLFSR81の入力端子inに供給するようにしてもよい。
(第8の実施の形態)
図20は、第8の実施の形態の乱数生成回路の一例を示す図である。図20において、図8に示した第3の実施の形態の乱数生成回路30及び、図11に示した第5の実施の形態の乱数生成回路50と同じ要素については同一符号が付されている。
Further, the random
(Eighth embodiment)
FIG. 20 is a diagram illustrating an example of a random number generation circuit according to the eighth embodiment. 20, the same reference numerals are given to the same elements as those of the random number generation circuit 30 of the third embodiment shown in FIG. 8 and the random
第8の実施の形態の乱数生成回路90は、第3の実施の形態の乱数生成回路30に、負荷容量可変回路52を適用した回路である。
乱数生成部30a0〜30anには、データ信号dtではなく、負荷容量可変回路52が出力するデータ信号dtoが供給されることが、乱数生成回路30と異なっている。
A random number generation circuit 90 according to the eighth embodiment is a circuit in which a load
Unlike the random number generation circuit 30, the random number generation units 30a0 to 30an are supplied with the data signal dto output from the load
制御回路91は、たとえば、クロック信号clkに対する遅延が乱数生成部30a0〜30anのうちで中間の値となる乱数生成部30aiから供給される出力値RNDiに基づいて、まず、負荷容量の追加開始タイミングを決定する。たとえば、制御回路91は、選択信号cselにより、まず、負荷容量を追加しない状態に、負荷容量可変回路52を設定し、調整信号tsel1,tsel2の値を変更して、出力値RNDiがLレベルからHレベルに変化するタイミングを検出する。そして、制御回路91は、そのタイミングにおける調整信号tsel1,tsel2の値を用いて、選択信号cselにより、負荷容量の追加開始タイミングを早めていき、出力値RNDiがLレベルに変化したときの選択信号cselの値を記憶する。
For example, based on the output value RNDi supplied from the random number generation unit 30ai in which the delay with respect to the clock signal clk is an intermediate value among the random number generation units 30a0 to 30an, the
その後、制御回路91は、記憶した選択信号cselの値を負荷容量可変回路52に供給し、その値によって決まる追加開始タイミングで負荷容量を段階的に増加させる。そして、制御回路91は、検出結果matchiと出力値RNDiに基づいて、調整信号tsel1,tsel2の値を決定する。調整信号tsel1,tsel2の値は、図4〜図6に示した方法により、乱数生成部30aiに到達するクロック信号clkによるサンプリングタイミングがメタステーブル期間内になるように決定される。
Thereafter, the
第8の実施の形態の乱数生成回路90は、第3の実施の形態の乱数生成回路30によって得られる効果を有する。さらに、乱数生成回路90は、負荷容量可変回路52を有することで、メタステーブル期間を拡大できるため、サンプリングタイミングをメタステーブル期間内に維持できる可能性が高まる。これによって、より品質のよい乱数を生成できる。
The random number generation circuit 90 of the eighth embodiment has the effect obtained by the random number generation circuit 30 of the third embodiment. Furthermore, since the random number generation circuit 90 includes the load
なお、乱数生成回路90は、サンプリングタイミングを、たとえば、検出結果matchiと出力値RNDiに基づいて決定する。そのため、図12の負荷容量可変回路52において、サンプリングタイミングを決める際に、容量回路52c1〜52cnを同時に有効にするために設けられている、OR回路60d1〜60dnはなくてもよい。
The random number generation circuit 90 determines the sampling timing based on, for example, the detection result matchi and the output value RNDi. Therefore, in the load
(第9の実施の形態)
図21は、第9の実施の形態の乱数生成回路の一例を示す図である。図21において、図9に示した第4の実施の形態の乱数生成回路40及び、図20に示した第8の実施の形態の乱数生成回路90と同じ要素については同一符号が付されている。
(Ninth embodiment)
FIG. 21 is a diagram illustrating an example of a random number generation circuit according to the ninth embodiment. In FIG. 21, the same elements as those of the random number generation circuit 40 of the fourth embodiment shown in FIG. 9 and the random number generation circuit 90 of the eighth embodiment shown in FIG. .
第9の実施の形態の乱数生成回路100は、第8の実施の形態の乱数生成回路90に、LFSR41を適用した回路である。
第9の実施の形態の乱数生成回路100は、第8の実施の形態の乱数生成回路90と同様の効果が得られるとともに、第4の実施の形態の乱数生成回路40と同様の効果も得られる。
The random number generation circuit 100 according to the ninth embodiment is a circuit in which the
The random number generation circuit 100 according to the ninth embodiment can obtain the same effect as the random number generation circuit 90 according to the eighth embodiment and the same effect as the random number generation circuit 40 according to the fourth embodiment. It is done.
なお、説明を省略するが、負荷容量可変回路52は、第1の実施の形態の乱数生成回路10や、第2の実施の形態の乱数生成回路20に適用できることは、いうまでもない。
以上説明した第1乃至第9の実施の形態の乱数生成回路10,20,30,40,50,70,80,90,100は、乱数を用いる様々な集積回路、システム及び機器などに適用可能である。たとえば、セキュリティ分野における乱数を用いた暗号キーの生成、AI(Artificial Intelligence)分野における乱数を用いたディープラーニングでの過学習を防ぐドロップアウト処理などに利用可能である。さらに、乱数が利用されるビッグデータ解析にも利用可能である。
Needless to say, the load
The random
以上、実施の形態に基づき、本発明の乱数生成回路及びその制御方法の一観点について説明してきたが、これらは一例にすぎず、上記の記載に限定されるものではない。 As described above, one aspect of the random number generation circuit and the control method thereof according to the present invention has been described based on the embodiment, but these are only examples and are not limited to the above description.
10 乱数生成回路
11 調整部
11a,11b 調整回路
12 乱数生成部
12a1〜12an ラッチ回路
12b 出力回路
12c 検出回路
13 制御回路
CLK,clk クロック信号
dt データ信号
match 検出結果
tsel1,tsel2 調整信号
RND 出力値
DESCRIPTION OF
Claims (8)
前記第1の信号と前記第2の信号とを受け、前記第2の信号によるサンプリングタイミングにおける前記第1の信号の信号レベルに基づいて、第1の値または第2の値をそれぞれ出力する、3つ以上の奇数個のラッチ回路と、
前記奇数個のラッチ回路のそれぞれが出力する前記第1の値または前記第2の値を受け、前記奇数個のラッチ回路の全てが同じ値を出力する場合、前記同じ値を出力し、前記奇数個のラッチ回路のうちの少なくとも1つが異なる値を出力する場合、前記第1の値と前記第2の値のうち、出力される数が少ない方の値を出力する出力回路と、
前記奇数個のラッチ回路のそれぞれが出力する前記第1の値または前記第2の値を受け、前記奇数個のラッチ回路の全てが前記同じ値を出力するか否かを示す検出結果を出力する検出回路と、
前記検出結果と前記出力回路の出力値とに基づいて、前記サンプリングタイミングが、前記奇数個のラッチ回路が準安定状態となる期間内であるか否かを判定し、前記サンプリングタイミングが前記期間内であるか否かの判定結果に基づいて、前記調整信号の値を変えて、前記サンプリングタイミングを前記期間内に調整する制御回路と、
を有する乱数生成回路。 The input signal and the adjustment signal are received, and the first signal and the second signal are output based on the input signal, and the first signal or the second signal is output based on the adjustment signal. An adjustment unit for adjusting the phase;
Receiving the first signal and the second signal, respectively outputting a first value or a second value based on a signal level of the first signal at a sampling timing by the second signal; Three or more odd number of latch circuits;
When each of the odd number of latch circuits receives the first value or the second value output, and all the odd number of latch circuits output the same value, the same value is output, and the odd number An output circuit that outputs a smaller value of the first value and the second value when at least one of the plurality of latch circuits outputs a different value;
Each of the odd number of latch circuits receives the first value or the second value, and outputs a detection result indicating whether all of the odd number of latch circuits output the same value. A detection circuit;
Based on the detection result and the output value of the output circuit, it is determined whether the sampling timing is within a period in which the odd number of latch circuits are in a metastable state, and the sampling timing is within the period. A control circuit that adjusts the sampling timing within the period by changing the value of the adjustment signal based on the determination result of whether or not
A random number generating circuit.
請求項1に記載の乱数生成回路。 The control circuit delays the phase of the second signal with respect to the first signal by changing the value of the adjustment signal in a state where all of the odd number of latch circuits output the same value. Determining whether or not the sampling timing is within the period based on the detection result and the change in the output value of the output circuit at an earlier stage;
The random number generation circuit according to claim 1.
前記制御回路は、前記奇数個のラッチ回路の全てが前記第2の値を出力する状態になった第1のタイミングにおける前記調整信号の値と、前記奇数個のラッチ回路の全てが前記第1の値を出力する状態になった第2のタイミングにおける前記調整信号の値とに基づいて、前記第1のタイミングと前記第2のタイミングの中間である前記期間内の第3のタイミングに前記サンプリングタイミングを調整する、
請求項1または2に記載の乱数生成回路。 The control circuit changes the value of the adjustment signal until all of the odd number of latch circuits output the second value, and then all of the odd number of latch circuits have the first value. Change the value of the adjustment signal until the value is output.
The control circuit includes a value of the adjustment signal at a first timing when all of the odd number of latch circuits are in a state of outputting the second value, and all of the odd number of latch circuits are the first value. Based on the value of the adjustment signal at the second timing at which the value is output, the sampling is performed at a third timing within the period that is intermediate between the first timing and the second timing. Adjust the timing,
The random number generation circuit according to claim 1 or 2.
前記複数の乱数生成部のそれぞれに供給される前記第2の信号の遅延量を異ならせる遅延回路と、を有し、
前記複数の乱数生成部のうちの初段の乱数生成部の、前記第1の排他的論理和回路に供給される前記第1の入力値は、前記制御回路が出力する前記第1の値または前記第2の値の一方であり、
前記複数の乱数生成部のうちの2段目以降の乱数生成部の、前記第1の排他的論理和回路に供給される前記第1の入力値は、前段の乱数生成部の前記第1の排他的論理和回路が出力する前記演算結果である、
請求項1乃至3の何れか一項に記載の乱数生成回路。 A first exclusive OR that outputs an operation result of an exclusive OR of the output value of the output circuit and the first input value of the odd number of latch circuits, the output circuit, the detection circuit, and the output circuit. A plurality of random number generators connected in series in a plurality of stages each having a circuit;
A delay circuit that varies a delay amount of the second signal supplied to each of the plurality of random number generation units,
The first input value supplied to the first exclusive OR circuit of the first stage random number generation unit of the plurality of random number generation units is the first value output from the control circuit or the first value One of the second values,
The first input value supplied to the first exclusive OR circuit of the second and subsequent random number generation units of the plurality of random number generation units is the first input value of the random number generation unit of the previous stage. The operation result output by the exclusive OR circuit;
The random number generation circuit according to claim 1.
前記線形帰還シフトレジスタは、前記出力回路の前記出力値または前記出力値に基づいた値と、前記複数ビットのうちの一部のビットの排他的論理和により生成されるフィードバック信号との排他的論理和である前記第2の入力値を出力する第2の排他的論理和回路を有する、
請求項1乃至4の何れか一項に記載の乱数生成回路。 A linear feedback shift register including a multi-bit shift register that captures a second input value in synchronization with the input signal;
The linear feedback shift register includes an exclusive logic of the output value of the output circuit or a value based on the output value and a feedback signal generated by exclusive OR of some bits of the plurality of bits. A second exclusive OR circuit that outputs the second input value that is a sum;
The random number generation circuit according to any one of claims 1 to 4.
請求項6に記載の乱数生成回路。 The control circuit fixes the value of the selection signal in a state where the adjustment signal is fixed to a fifth value when the output value of the output circuit changes from the first value to the second value. The start timing is changed, and the start timing is determined based on the sixth value of the selection signal when the output value changes from the second value to the first value.
The random number generation circuit according to claim 6.
前記乱数生成回路が有する調整部が、入力信号と調整信号とを受け、前記入力信号に基づいて、第1の信号と第2の信号とを出力するとともに、前記調整信号に基づいて、前記第1の信号または前記第2の信号の位相を調整し、
前記乱数生成回路が有する3つ以上の奇数個のラッチ回路が、前記第1の信号と前記第2の信号とを受け、前記第2の信号によるサンプリングタイミングにおける前記第1の信号の信号レベルに基づいて、第1の値または第2の値をそれぞれ出力し、
前記乱数生成回路が有する出力回路が、前記奇数個のラッチ回路のそれぞれが出力する前記第1の値または前記第2の値を受け、前記奇数個のラッチ回路の全てが同じ値を出力する場合、前記同じ値を出力し、前記奇数個のラッチ回路のうちの少なくとも1つが異なる値を出力する場合、前記第1の値と前記第2の値のうち、出力される数が少ない方の値を出力し、
前記乱数生成回路が有する検出回路が、前記奇数個のラッチ回路のそれぞれが出力する前記第1の値または前記第2の値を受け、前記奇数個のラッチ回路の全てが前記同じ値を出力するか否かを示す検出結果を出力し、
前記乱数生成回路が有する制御回路が、前記検出結果と前記出力回路の出力値とに基づいて、前記サンプリングタイミングが、前記奇数個のラッチ回路が準安定状態となる期間内であるか否かを判定し、前記サンプリングタイミングが前記期間内であるか否かの判定結果に基づいて、前記調整信号の値を変えて、前記サンプリングタイミングを前記期間内に調整する、
乱数生成回路の制御方法。 In the control method of the random number generation circuit,
The adjustment unit included in the random number generation circuit receives the input signal and the adjustment signal, outputs the first signal and the second signal based on the input signal, and outputs the first signal and the second signal based on the adjustment signal. Adjusting the phase of the first signal or the second signal;
An odd number of three or more latch circuits included in the random number generation circuit receive the first signal and the second signal, and set the signal level of the first signal at the sampling timing of the second signal. Based on the first value or the second value, respectively,
The output circuit included in the random number generation circuit receives the first value or the second value output from each of the odd number of latch circuits, and all the odd number of latch circuits output the same value. When the same value is output and at least one of the odd number of latch circuits outputs a different value, the value that is output with the smaller number of the first value and the second value. Output
The detection circuit included in the random number generation circuit receives the first value or the second value output from each of the odd number of latch circuits, and all the odd number of latch circuits output the same value. Output a detection result indicating whether or not
The control circuit included in the random number generation circuit determines whether the sampling timing is within a period in which the odd number of latch circuits are in a metastable state based on the detection result and the output value of the output circuit. Determining and changing the value of the adjustment signal based on the determination result of whether or not the sampling timing is within the period, and adjusting the sampling timing within the period;
Control method of random number generation circuit.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2017175543A JP6867594B2 (en) | 2017-09-13 | 2017-09-13 | Random number generation circuit and control method of random number generation circuit |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2017175543A JP6867594B2 (en) | 2017-09-13 | 2017-09-13 | Random number generation circuit and control method of random number generation circuit |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2019053385A true JP2019053385A (en) | 2019-04-04 |
JP6867594B2 JP6867594B2 (en) | 2021-04-28 |
Family
ID=66015035
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2017175543A Active JP6867594B2 (en) | 2017-09-13 | 2017-09-13 | Random number generation circuit and control method of random number generation circuit |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6867594B2 (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2002366347A (en) * | 2001-06-06 | 2002-12-20 | Iwaki Electronics Corp | Random number generator and probability generator |
JP2005018251A (en) * | 2003-06-24 | 2005-01-20 | Renesas Technology Corp | Random number generator |
JP2008066536A (en) * | 2006-09-07 | 2008-03-21 | Toshiba Corp | Semiconductor integrated circuit |
JP2011211607A (en) * | 2010-03-30 | 2011-10-20 | Renesas Electronics Corp | Semiconductor device, and failure detection system and failure detection method of data holding circuit |
JP2014175834A (en) * | 2013-03-08 | 2014-09-22 | Mega Chips Corp | Linear feedback shift register and data processing device |
-
2017
- 2017-09-13 JP JP2017175543A patent/JP6867594B2/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2002366347A (en) * | 2001-06-06 | 2002-12-20 | Iwaki Electronics Corp | Random number generator and probability generator |
JP2005018251A (en) * | 2003-06-24 | 2005-01-20 | Renesas Technology Corp | Random number generator |
JP2008066536A (en) * | 2006-09-07 | 2008-03-21 | Toshiba Corp | Semiconductor integrated circuit |
JP2011211607A (en) * | 2010-03-30 | 2011-10-20 | Renesas Electronics Corp | Semiconductor device, and failure detection system and failure detection method of data holding circuit |
JP2014175834A (en) * | 2013-03-08 | 2014-09-22 | Mega Chips Corp | Linear feedback shift register and data processing device |
Also Published As
Publication number | Publication date |
---|---|
JP6867594B2 (en) | 2021-04-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6361433B2 (en) | Frequency detection circuit and reception circuit | |
KR102001691B1 (en) | Delay Locked Loop | |
JP6032081B2 (en) | Reception circuit and semiconductor integrated circuit | |
US7526390B2 (en) | Signal measuring circuit and signal measuring method | |
JP4376081B2 (en) | Frequency multiplier and method capable of adjusting clock duty cycle | |
JP2018125791A (en) | CDR circuit and receiving circuit | |
JP5989239B2 (en) | Signal processing device | |
US9219628B2 (en) | Equalizer and operating method thereof | |
JP4192228B2 (en) | Data generator | |
JP4760052B2 (en) | Transmission control device and sampling frequency conversion device | |
JPWO2007116697A1 (en) | Waveform shaping device and error measuring device | |
JP6867594B2 (en) | Random number generation circuit and control method of random number generation circuit | |
JPWO2018003057A1 (en) | Equalization circuit, reception circuit, and semiconductor integrated circuit | |
US6751745B1 (en) | Digital synchronization circuit provided with circuit for generating polyphase clock signal | |
CN112910445A (en) | Semiconductor device for adjusting phases of multi-phase signals | |
US9379716B2 (en) | Electronic circuit, method of controlling electronic circuit, and electronic apparatus | |
JPWO2010016301A1 (en) | Phase comparator, PLL circuit and DLL circuit | |
JP6871509B2 (en) | Transmission circuit and integrated circuit | |
JP6823268B2 (en) | Frequency divider circuit, demultiplexer circuit, and semiconductor integrated circuit | |
JP3864583B2 (en) | Variable delay circuit | |
JPH11214987A (en) | Pll device | |
KR20050115703A (en) | Clock generating circuit and methode of semiconductor memory device | |
JP3391305B2 (en) | Data clock synchronization circuit | |
KR20140082339A (en) | Semiconductor apparatus | |
CN115735333A (en) | Phase frequency detector based frequency multiplier using rising edge delay |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20200611 |
|
RD02 | Notification of acceptance of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7422 Effective date: 20200625 |
|
RD04 | Notification of resignation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7424 Effective date: 20200625 |
|
TRDD | Decision of grant or rejection written | ||
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20210303 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20210309 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20210322 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6867594 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |