JP6867594B2 - 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 PDF

Info

Publication number
JP6867594B2
JP6867594B2 JP2017175543A JP2017175543A JP6867594B2 JP 6867594 B2 JP6867594 B2 JP 6867594B2 JP 2017175543 A JP2017175543 A JP 2017175543A JP 2017175543 A JP2017175543 A JP 2017175543A JP 6867594 B2 JP6867594 B2 JP 6867594B2
Authority
JP
Japan
Prior art keywords
value
output
circuit
signal
random number
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2017175543A
Other languages
Japanese (ja)
Other versions
JP2019053385A (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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2017175543A priority Critical patent/JP6867594B2/en
Publication of JP2019053385A publication Critical patent/JP2019053385A/en
Application granted granted Critical
Publication of JP6867594B2 publication Critical patent/JP6867594B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、乱数生成回路及び乱数生成回路の制御方法に関する。 The present invention relates to a random number generation circuit and a method for controlling the random number generation circuit.

ラッチ回路を用いて乱数を生成する手法の1つとして、ラッチ回路のメタスタビリティ(準安定性)を利用する手法がある。メタスタビリティは、ラッチ回路に入力されるデータ信号の論理レベルがH(High)レベルとL(Low)レベルの中間にあるときにクロック信号によるサンプリングが生じる場合、出力値が不確定になる特性である。 As one of the methods for generating random numbers using a latch circuit, there is a method for utilizing the metastability (metastability) of the latch circuit. Metastability is a characteristic in which the output value becomes uncertain when sampling by a 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.

国際公開第2011/117929号パンフレットInternational Publication No. 2011/117929 Pamphlet 特表2005−510923号公報Special Table 2005-510923 特開2012−129784号公報Japanese Unexamined Patent Publication No. 2012-129784

しかし、ラッチ回路のメタスタビリティを利用する手法では、サンプリングタイミングを、メタスタビリティが生じる期間(以下メタステーブル期間という)に合わせることが難しく、サンプリングタイミングがメタステーブル期間から外れる場合がある。サンプリングタイミングがメタステーブル期間から外れた場合、ラッチ回路の出力がHレベルまたはLレベルに偏り、生成される乱数の品質が悪化する可能性があった。 However, in the method using the metastability of the latch circuit, it is difficult to match the sampling timing with the period during which the metastability occurs (hereinafter referred to as the metastable period), and the sampling timing may deviate from the metastable period. If the sampling timing deviates from the metastable period, the output of the latch circuit may be biased to the H level or the L level, and the quality of the generated random numbers may deteriorate.

1つの側面では、本発明は、乱数の品質悪化を抑制することを目的とする。 In one aspect, the present invention aims to suppress deterioration in the 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, it receives an input signal and an adjustment signal, outputs a first signal and a second signal based on the input signal, and outputs the first signal or the adjustment signal based on the adjustment signal. The adjusting unit for adjusting the phase of the second signal, the first signal, and the second signal are received, and based on the signal level of the first signal at the sampling timing by the second signal, Upon receiving three or more odd latch circuits that output the first value or the second value, respectively, and the first value or the second value output by each of the odd latch circuits, the first value or the second value is received. 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 are output. Of the two values, the output circuit that outputs the smaller number of outputs and the odd number of the first value or the second value output by each of the odd number latch circuits are received. Based on a detection circuit that outputs a detection result indicating whether or not all of the latch circuits of the above output the same value, and the detection result and the output value of the output circuit, the sampling timing is an odd number. The sampling timing is determined by determining whether or not the latch circuit is within the semi-stable state, and changing the value of the adjustment signal based on the determination result of whether or not the sampling timing is within the period. A control circuit for adjusting the above period and a random number generation circuit having the above-mentioned period are provided.

また、1つの実施態様では、乱数生成回路の制御方法が提供される。 Also, in one embodiment, a method of controlling a random number generation circuit is provided.

1つの側面では、乱数の品質悪化を抑制でき、生成された乱数の生成要因も知ることができる。 On one aspect, deterioration of the quality of random numbers can be suppressed, and the factors that generate the generated random numbers can also be known.

第1の実施の形態の乱数生成回路の一例を示す図である。It is a figure which shows an example of the random number generation circuit of 1st Embodiment. 第2の実施の形態の乱数生成回路の一例を示す図である。It is a figure which shows an example of the random number generation circuit of 2nd Embodiment. 各ラッチ回路の出力値と検出結果matchと出力値RNDとの一例の関係を示す図である。It is a figure which shows the relationship of an example of the output value of each latch circuit, the detection result match, and the output value RND. サンプリングタイミングの調整例を示す図である。It is a figure which shows the adjustment example of a sampling timing. サンプリングタイミングの調整処理の一例の流れを示すフローチャートである。It is a flowchart which shows the flow of an example of a sampling timing adjustment process. 図5の各処理についての一例を示すフローチャートである。It is a flowchart which shows an example about each process of FIG. 乱数生成回路の乱数生成時の各信号の時間変化の一例を示すタイミングチャートである。It is a timing chart which shows an example of time change of each signal at the time of random number generation of a random number generation circuit. 第3の実施の形態の乱数生成回路の一例を示す図である。It is a figure which shows an example of the random number generation circuit of 3rd Embodiment. 第4の実施の形態の乱数生成回路の一例を示す図である。It is a figure which shows an example of the random number generation circuit of 4th Embodiment. LFSRの一例を示す図である。It is a figure which shows an example of LFSR. 第5の実施の形態の乱数生成回路の一例を示す図である。It is a figure which shows an example of the random number generation circuit of 5th Embodiment. 遅延選択回路と容量回路の一例を示す図である。It is a figure which shows an example of a delay selection circuit and a capacitance circuit. サンプリングタイミングの設定例と負荷容量可変回路による負荷容量の設定例とを示す図である。It is a figure which shows the setting example of a sampling timing and the setting example of a load capacity by a load capacity variable circuit. 負荷容量の追加開始タイミングを図13のように決定したときのメタステーブル期間を示す図である。It is a figure which shows the metastable period when the addition start timing of a load capacity is determined as shown in FIG. サンプリングタイミングと負荷容量の追加開始タイミングの設定処理の一例の流れを示すフローチャートである。It is a flowchart which shows the flow of an example of the setting process of the sampling timing and the addition start timing of a load capacity. 図15の各処理についての一例を示すフローチャートである(その1)。It is a flowchart which shows an example about each process of FIG. 15 (the 1). 図15の各処理についての一例を示すフローチャートである(その2)。It is a flowchart which shows an example about each process of FIG. 15 (the 2). 第6の実施の形態の乱数生成回路の一例を示す図である。It is a figure which shows an example of the random number generation circuit of 6th Embodiment. 第7の実施の形態の乱数生成回路の一例を示す図である。It is a figure which shows an example of the random number generation circuit of 7th Embodiment. 第8の実施の形態の乱数生成回路の一例を示す図である。It is a figure which shows an example of the random number generation circuit of 8th Embodiment. 第9の実施の形態の乱数生成回路の一例を示す図である。It is a figure which shows an example of the random number generation circuit of 9th Embodiment.

以下、発明を実施するための形態を、図面を参照しつつ説明する。
(第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 showing 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 number generation circuit 10 includes an adjustment unit 11 having adjustment circuits 11a and 11b, an odd number generation unit 12 having three or more odd number latch circuits 12a1, 12a2, ..., 12an, an output circuit 12b, and a detection circuit 12c. It has a control circuit 13.

調整部11は、入力信号と調整信号とを受ける。以下では、入力信号は、クロック信号CLKであるものとして説明するが、クロック信号CLKに限定されるものではない。ただし、乱数の発生レートを上げるため、状態遷移(HレベルとLレベルの間での遷移)が頻繁に発生する信号を用いることが望ましい。 The adjusting unit 11 receives an input signal and an adjusting signal. Hereinafter, the input signal will be described as being the clock signal CLK, but the input signal is not limited to the clock signal CLK. However, in order to increase the generation rate of random numbers, it is desirable to use a signal in which state transitions (transitions between H level and L level) frequently occur.

クロック信号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 number generation circuit 10.
The adjusting unit 11 outputs two signals (hereinafter referred to as a data signal dt and a clock signal clk) based on the clock signal CLK, and adjusts the phase of the data signal dt or the clock signal clk based on the adjusting signal.

図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 adjusting unit 11 has adjustment circuits 11a and 11b. The adjustment circuit 11a outputs a data signal dt whose phase of the clock signal CLK is adjusted based on the adjustment signal tsel1. The adjustment circuit 11b outputs a clock signal clk whose phase of the clock signal CLK is adjusted based on the adjustment signal tsel2. The adjustment circuits 11a and 11b are, for example, variable delay circuits capable of changing the delay amount based on the values of the adjustment signals tsel1 and tsel2. For example, as the values of the adjustment signals tsel1 and tsel2 increase, the delay amount increases.

ラッチ回路12a1〜12anは、それぞれ、データ信号dtとクロック信号clkとを受け、クロック信号clkによるサンプリングタイミングにおけるデータ信号dtの信号レベルに基づいて、HレベルまたはLレベルの値を出力する。Hレベルは、たとえば、電源電圧に相当し、Lレベルは、基準電位(たとえば、0V)に相当する。 The latch circuits 12a1 to 12an receive the data signal dt and the clock signal clk, respectively, and output H level or L level values based on the signal level of the data signal dt at the sampling timing by the clock signal clk. The H level corresponds to, for example, the power supply voltage, and the L level corresponds to the reference potential (for example, 0V).

出力回路12bは、ラッチ回路12a1〜12anのそれぞれが出力するHレベルの値またはLレベルの値を受ける。そして、出力回路12bは、ラッチ回路12a1〜12anの全てが同じ値を出力する場合、その値を出力する。ラッチ回路12a1〜12anのうちの少なくとも1つが異なる値を出力する場合、出力回路12bは、ラッチ回路12a1〜12anが出力するHレベルの値とLレベルの値のうち、出力される数が少ない方の値を出力する。 The output circuit 12b receives the H level value or the L level value output by each of the latch circuits 12a1 to 12an. Then, when all of the latch circuits 12a1 to 12an output the same value, the output circuit 12b outputs the value. When at least one of the latch circuits 12a1 to 12an outputs a different value, the output circuit 12b outputs the smaller number of the H level value and the L level value output by the latch circuits 12a1 to 12an. Outputs the value of.

たとえば、ラッチ回路12a1〜12anにおいて、Lレベルの値よりもHレベルの値が多く出力されている場合には、出力回路12bは、Lレベルの出力値RNDを出力する。逆にHレベルの値よりもLレベルの値が多く出力されている場合には、出力回路12bは、Hレベルの出力値RNDを出力する。 For example, in the latch circuits 12a1 to 12an, when the H level value is output more than the L level value, the output circuit 12b outputs the L level output value RND. On the contrary, when the L level value is output more than the H level value, the output circuit 12b outputs the H level output value RND.

出力される数が少ない方の値は、出力される数が多い方の値よりも、乱数である可能性(または乱数としての適格性)が高いためである。出力される数が多い方の値は、メタスタビリティの影響ではなく、スキューの影響により出力された値である可能性が高い。スキューの影響により出力された値を乱数として採用する場合、値に偏りが生じ、乱数としての品質が低い。 This is because the value with the smaller number of outputs is more likely to be a random number (or the eligibility as a random number) than the value with the larger number of outputs. The value with the larger number of outputs is likely to be the value output due to the effect of skew, not the effect of metastability. When the 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 detection circuit 12c receives an H level value or an L level value output by each of the latch circuits 12a1 to 12an. Then, the detection circuit 12c outputs a detection result match indicating whether or not all of the latch circuits 12a1 to 12an output the same value. In the following description, when all the latch circuits 12a1 to 12an output the same value, the H level detection result match is output, and when at least one of the latch circuits 12a1 to 12an outputs a different value, the L level is output. It is assumed that the detection result match of is output.

出力回路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 output circuit 12b and the detection circuit 12c will be described later.
The control circuit 13 is, for example, an electronic circuit for a specific purpose such as an ASIC (Application Specific Integrated Circuit) or an FPGA (Field Programmable Gate Array). Further, the control circuit 13 may be a processor as an arithmetic processing device such as a CPU (Central Processing Unit) or a DSP (Digital Signal Processor). The processor executes a program stored in memory such as RAM (Random Access Memory). The control circuit 13 may be a set of a plurality of processors.

制御回路13は、検出結果matchと、出力値RNDとに基づいて、クロック信号clkによるサンプリングタイミングが、ラッチ回路12a1〜12nがメタスタビリティ状態(準安定状態)となる期間内(メタステーブル期間内)であるか否かを判定する。そして、制御回路13は、その判定結果に基づいて、調整信号tsel1,tsel2の値を変えて、サンプリングタイミングをメタステーブル期間内に調整する。 In the control circuit 13, based on the detection result match and the output value RND, the sampling timing by the clock signal clk is within the period during which the latch circuits 12a1 to 12n are in the metastability state (semi-stable state) (within the metastable period). It is determined whether or not it is. Then, the control circuit 13 changes the values of the adjustment signals tsel1 and tsel2 based on the determination result, and adjusts the sampling timing within the metastable period.

図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 adjusting the sampling timing by the clock signal clk when the data signal dt transitions from the L level to the H level.
When the sampling timing is timing t1, the latch circuits 12a1 to 12an all output L level values, so that the output circuit 12b outputs the L level output value RND and the detection circuit 12c outputs the H level detection result. Output the match. At this time, the control circuit 13 determines that the sampling timing is not within the metastable period, and changes the values of the adjustment signals tsel1 and tsel2 so as to delay the phase of the clock signal clk with respect to the data signal dt. For example, the control circuit 13 delays the phase of the clock signal clk by fixing the value of the adjustment signal tsel1, increasing the value of the adjustment signal tsel2, and increasing the delay amount of the clock signal clk in the adjustment circuit 11b.

クロック信号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 becomes, for example, timing t2 by delaying the phase of the clock signal clk. At the 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 the H level value. At this time, the L level detection result match is output from the detection circuit 12c. However, since the latch circuits 12a1 to 12an still output more L-level values than the H-level values, the output circuit 12b outputs the H-level output value RND. Also at this time, the control circuit 13 determines that the sampling timing is not within the metastable period, and changes the adjustment signals tsel1 and tsel2 so as to delay the phase of the clock signal clk with respect to the data signal dt.

クロック信号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 becomes, for example, the 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 near 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 the same. Divide evenly. Therefore, the output circuit 12b outputs the L level output value RND and the H level output value RND with almost the same probability. Further, the detection circuit 12c outputs an L-level detection result match.

上記のように、制御回路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 control circuit 13 changes the sampling timing in the order of timing t1, t2, t3, at timing t3, the same output value RND and detection result match as timing t2 can be obtained. There is. In that case, the control circuit 13 further delays the phase of the clock signal clk, and when the output value RND changes from the H level to the L level (for example, timing t4), the timing immediately before that (that is, timing t3) is changed. Judge that it is within the metastable period. Then, the control circuit 13 fixes the values of the adjustment signals tsel1 and tsel2 at the timing t3.

一方、サンプリングタイミングがタイミング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 the timing t5, the latch circuits 12a1 to 12an all output the H level value. Therefore, the output circuit 12b is the H level output value RND, and the detection circuit 12c is the H level detection result match. Is output. At this time, the control circuit 13 determines that the sampling timing is not within the metastable period, and changes the adjustment signals tsel1 and tsel2 so as to advance the phase of the clock signal clk with respect to the data signal dt. For example, the control circuit 13 advances the phase of the clock signal clk by fixing the value of the adjustment signal tsel1, reducing the value of the adjustment signal tsel2, and reducing the delay amount of the clock signal clk in the adjustment circuit 11b.

クロック信号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 becomes, for example, the timing t4 by advancing the phase of the clock signal clk. At the timing t4, the signal level of the data signal dt is lower than that at the H level, and it is assumed that at least one of the latch circuits 12a1 to 12an outputs the L level value. At this time, the detection circuit 12c outputs an L-level detection result match. However, since the latch circuits 12a1 to 12an still output more H-level values than the L-level values, the output circuit 12b outputs the L-level output value RND. Also at this time, the control circuit 13 determines that the sampling timing is not within the metastable period, and changes the adjustment signals tsel1 and tsel2 so as to advance the phase of the clock signal clk with respect to the data signal dt.

クロック信号clkの位相を進めたことでサンプリングタイミングが、たとえば、タイミングt3となったとする。タイミングt3では前述のように、出力回路12bは、Lレベルの出力値RNDとHレベルの出力値RNDとを、ほぼ同じ確率で出力する。また、検出回路12cは、Lレベルの検出結果matchを出力する。 It is assumed that the sampling timing becomes, for example, the timing t3 by advancing the phase of the clock signal clk. At the timing t3, as described above, the output circuit 12b outputs the L level output value RND and the H level output value RND with almost the same probability. Further, the detection circuit 12c outputs an L-level detection result match.

制御回路13がタイミングt5,t4,t3の順で、サンプリングタイミングを変化させていったとき、タイミングt3では、タイミングt4と同様の、出力値RNDと検出結果matchが得られる場合がある。その場合、制御回路13は、たとえば、さらにクロック信号clkの位相を進ませ、出力値RNDがLレベルからHレベルに変化したとき(タイミングt2)、その1つ前のタイミング(すなわちタイミングt3)が、メタステーブル期間内であると判定する。そして、制御回路13は、タイミングt3における調整信号tsel1,tsel2の値を固定する。 When the control circuit 13 changes the sampling timing in the order of timings t5, t4, and t3, at timing t3, the same output value RND and detection result match as at timing t4 may be obtained. In that case, for example, when the phase of the clock signal clk is further advanced and the output value RND changes from the L level to the H level (timing t2), the timing immediately before that (that is, timing t3) is set. , Judge that it is within the metastable period. Then, the control circuit 13 fixes the values of the adjustment signals tsel1 and tsel2 at the timing t3.

そして、制御回路13は、以後は、固定した調整信号tsel1,tsel2の値を、調整部11に供給して、乱数生成部12に、メタスタビリティによる乱数を生成させる。
サンプリングタイミングの他の調整方法の例については、後述する。
Then, after that, the control circuit 13 supplies the fixed values of the adjustment signals tsel1 and tsel2 to the adjustment unit 11, and causes the random number generation unit 12 to generate a random number by metastability.
Examples of other adjustment methods for sampling timing will be described later.

以上のように、第1の実施の形態の乱数生成回路10及びその制御方法では、ラッチ回路12a1〜12anの出力から得られる出力値RND、検出結果matchに基づいて、サンプリングタイミングがメタステーブル期間内であるか否かを判定できる。つまり、制御回路13は、ラッチ回路12a1〜12anがメタスタビリティ状態であるか否かを判定できる。そして、制御回路13は、その判定結果に基づいて、データ信号dtまたはクロック信号clkの位相を調整して、サンプリングタイミングをメタステーブル期間に合わせることができる。 As described above, in the random number generation circuit 10 and its control method of the first embodiment, the sampling timing is within the metastable period based on the output value RND obtained from the outputs of the latch circuits 12a1 to 12an and the detection result match. It can be determined whether or not it is. That is, the control circuit 13 can determine whether or not the latch circuits 12a1 to 12an are in the metastability state. Then, the control circuit 13 can adjust the phase of the data signal dt or the clock signal clk based on the determination result, and adjust the sampling timing to the metastable period.

メタステーブル期間では上記のように、Hレベルの出力値RNDとLレベルの出力値RNDとがほぼ同じ確率で出力され、出力値RNDは、品質のよい乱数となる。つまり、出力値RNDの値の偏りが低減され、乱数の品質悪化を抑制できる。 In the metastable period, as described above, the H level output value RND and the L level output value RND are output with almost the same probability, and the output value RND becomes a high-quality random number. That is, the bias of the output value RND value is reduced, and the deterioration of the quality of the random number can be suppressed.

なお、ラッチ回路を用いて乱数を生成する方法として、リングオシレータの出力パルスをラッチ回路のデータ端子に入力し、クロック信号をクロック端子に入力し、出力パルスのジッタから乱数を生成する手法がある。しかしこの手法では、サンプリング時の乱数が、直前のサンプリング値に対して依存関係をもつため、生成される乱数に周期性が含まれてしまう。メタスタビリティを利用した本実施の形態の乱数生成回路10では、乱数に周期性が含まれることもない。 As a method of generating a random number using a latch circuit, there is a method of inputting an output pulse of a ring oscillator to a data terminal of a latch circuit, inputting a clock signal to a clock terminal, and generating a random number from the jitter of the output pulse. .. 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 number generation circuit 10 of the present embodiment utilizing metastability, the random numbers do not include periodicity.

(第2の実施の形態)
図2は、第2の実施の形態の乱数生成回路の一例を示す図である。
乱数生成回路20は、調整回路21a,21bと、乱数生成部22と、制御回路23とを有する。
(Second Embodiment)
FIG. 2 is a diagram showing an example of a random number generation circuit according to the second embodiment.
The random number generation circuit 20 includes adjustment circuits 21a and 21b, a random number generation unit 22, and a control circuit 23.

調整回路21a,21bは、第1の実施の形態の乱数生成回路10における調整回路11a,11bと同様の機能を有する。
乱数生成部22は、ラッチ回路22a1,22a2,22a3、インバータ回路22b1,22b2,22b3、AND(論理積)回路22c1,22c2,22c3,22c4,22c5、OR(論理和)回路22d1,22d2を有する。
The adjustment circuits 21a and 21b have the same functions as the adjustment circuits 11a and 11b in the random number generation circuit 10 of the first embodiment.
The random number generation unit 22 includes a latch circuit 22a1,22a2, 22a3, an inverter circuit 22b1,22b2,22b3, an AND (logical product) circuit 22c1,22c2, 22c3, 22c4,22c5, and an OR (logical sum) circuit 22d1,22d2.

ラッチ回路22a1〜22a3は、それぞれ、データ信号dtを受けるデータ端子(“D”と表記されている)、クロック信号clkを受けるクロック端子(“CK”と表記されている)、出力端子(“Q”と表記されている)を有する。ラッチ回路22a1〜22a3は、第1の実施の形態の乱数生成回路10におけるラッチ回路12a1〜12anと同様の機能を有する。 The latch circuits 22a1 to 22a3 are a data terminal (denoted as "D") that receives a data signal dt, a clock terminal (denoted as "CK") that receives a clock signal clk, and an output terminal ("Q", respectively. ”). The latch circuits 22a1 to 22a3 have the same functions as the latch circuits 12a1 to 12an in the random number generation circuit 10 of the first embodiment.

第2の実施の形態の乱数生成回路20では、インバータ回路22b1〜22b3、AND回路22c1〜22c5、OR回路22d1,22d2により、第1の実施の形態の乱数生成回路10における出力回路12b及び検出回路12cと同様の機能が実現される。 In the random number generation circuit 20 of the second embodiment, the output circuit 12b and the detection circuit in the random number generation circuit 10 of the first embodiment are provided by the inverter circuits 22b1 to 22b3, the AND circuits 22c1 to 22c5, and the OR circuits 22d1,22d2. The same function as 12c is realized.

インバータ回路22b1は、ラッチ回路22a1の出力値の論理レベルを反転し、インバータ回路22b2は、ラッチ回路22a2の出力値の論理レベルを反転し、インバータ回路22b3は、ラッチ回路22a3の出力値の論理レベルを反転する。 The inverter circuit 22b1 inverts the logic level of the output value of the latch circuit 22a1, the inverter circuit 22b2 inverts the logic level of the output value of the latch circuit 22a2, and the inverter circuit 22b3 inverts the logic level of the output value of the 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 the operation result of the logical product 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 the operation result of the logical product 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 the operation result of the logical product 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 the calculation result of the logical product of the output values of the latch circuits 22a1 to 22a3. The AND circuit 22c5 outputs the calculation result of the logical product 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 the calculation result of the logical sum of the output values of the AND circuits 22c1 to 22c4. The OR circuit 22d2 outputs the calculation result of the logical sum 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 random number generation unit 22, and the output value of the OR circuit 22d2 is a detection result match indicating whether or not all of the latch circuits 22a1 to 22a3 output the same value.

制御回路23は、第1の実施の形態の乱数生成回路10における制御回路13と同様の機能を有する。なお、制御回路23は、制御信号CTRLによって乱数生成回路20の外部から制御されてもよい。また、制御回路23は、出力値RNDがクロック信号CLKの所定サイクル数、同じ値である場合には、異常状態であることを示す信号ERRを出力してもよい。 The control circuit 23 has the same function as the control circuit 13 in the random number generation circuit 10 of the first embodiment. The control circuit 23 may be controlled from the outside of the random number generation circuit 20 by the control signal CTRL. Further, the control circuit 23 may output a signal ERR indicating an abnormal state when the output value RND is the same value as the predetermined number of cycles of the clock signal CLK.

図3は、各ラッチ回路の出力値と検出結果matchと出力値RNDとの一例の関係を示す図である。
図3には、ラッチ回路22a1〜22a3の出力値と、OR回路22d1の出力値RNDと、OR回路22d2が出力する検出結果matchとの関係が示されている。
FIG. 3 is a diagram showing 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 by 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 all the output values of the latch circuits 22a1 to 22a3 are L level, the detection result match becomes H level and the output value RND becomes 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 becomes L level and the output value RND becomes L level. When all the output values of the latch circuits 22a1 to 22a3 are H level, the detection result match becomes H level and the output value RND becomes H level.

制御回路23は、これらの検出結果matchと出力値RNDとの組み合わせに基づいて、出力値RNDによる乱数の生成要因を判別できる。以下では、データ信号dtがLレベルからHレベルに遷移する際のメタステーブル期間内にサンプリングタイミングを調整する場合について説明する。 The control circuit 23 can determine a random number generation factor based on the output value RND based on the combination of these detection result matches and the output value RND. In the following, a case where the sampling timing is adjusted within the metastable period when the data signal dt transitions from the L level to the H level will be described.

検出結果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 means 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 metastability but skew. Skew is a variation in delay time caused by noise due to voltage change or temperature change. When the output value RND as described above is obtained for each sampling timing, the output value RND is biased toward the L level value, and a random number having poor quality is obtained. Therefore, the control circuit 23 changes the values of the adjustment signals tsel1 and tsel2 (either of them may be used) so as to delay the phase of the clock signal clk with respect to the data signal dt.

検出結果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 means 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 metastability but skew. When the output value RND as described above is obtained for each sampling timing, the output value RND is biased toward the H level value, and a random number having poor quality is obtained. Therefore, the control circuit 23 changes the values of the adjustment signals tsel1 and tsel2 (either of them may be used) so as to advance the phase of the clock signal clk.

検出結果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 control circuit 23 adjusts the sampling timing as follows, for example.
FIG. 4 is a diagram showing 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. Further, in the example of FIG. 4, the period ta when the signal level of the data signal dt is equal to or less than the voltage V1, the period tb when the signal level of the data signal dt is larger than the voltage V1 and less than the voltage V2, and the signal level of the data signal dt are The period tc during which the voltage is V2 or more and the voltage V3 or less is shown. Further, a period dt in which the signal level of the data signal dt is larger than the voltage V3 and less 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, for example, the characteristics of the latch circuits 22a1 to 22a3. 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 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 due to metastability, at least one output value of the latch circuits 22a1 to 22a3 is at the H level. May become. When the sampling timing is located within the period ct, the latch circuits 22a1 to 22a3 output the H level output value and the L level output value with almost the same probability due to the metastability. When the sampling timing is located within the period dt, the output value of the latch circuits 22a1 to 22a3 is likely to be H level, but due to metastability, at least one output value of the latch circuits 22a1 to 22a3 is set to L level. May become. When the sampling timing is located within the period te, the output values of the latch circuits 22a1 to 22a3 are all H level.

期間ta〜tcのうち、品質のよい乱数生成に適している期間は、ラッチ回路22a1〜22a3がメタスタビリティ状態となる期間tcである。そのため、制御回路23は、期間tcを、サンプリングタイミングを設定する目標の期間(設定目標期間)とし、たとえば、以下に示すような4つのタイミング設定方法でサンプリングタイミングを調整する。 Of the periods ta to ct, the period suitable for generating high-quality random numbers is the period ct in which the latch circuits 22a1 to 22a3 are in the metastability state. Therefore, the control circuit 23 sets the period ct as the target period (setting target period) for setting the sampling timing, and adjusts the sampling timing by, for example, the following four timing setting methods.

(方法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 that case, the control circuit 23 changes the values of the adjustment signals tsel1 and tsel2, and sets the timing for delaying the phase of the clock signal clk with respect to the data signal dt.

一度のタイミング設定で変える位相の量は、より小さくすることが、設定目標期間にサンプリングタイミングを適切に合わせる上で望ましいが、あまり小さくし過ぎると、調整時間が長くなる。 It is desirable to make the amount of phase changed by one timing setting smaller in order to properly adjust the sampling timing to the set target period, but if it is made too small, the adjustment time becomes long.

なお、制御回路23は、少なくとも1つ前のタイミング設定で用いた調整信号tsel1,tsel2の値を、図示しない記憶部(たとえば、レジスタなど)に記憶させておく。 The control circuit 23 stores the values of the adjustment signals tsel1 and tsel2 used in at least one previous timing setting in a storage unit (for example, a register) (not shown).

クロック信号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 changes to the L level and the output value RND changes to the H level, the control circuit 23 further changes the values of the adjustment signals tsel1 and tsel2 to the data signal dt. On the other hand, the phase of the clock signal clk is delayed. This is because when the detection result match is the L level and the output value RND is the H level, the sampling timing may be within the period tc, which is the set target period, but may also be within the period tb.

クロック信号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 the L level and the output value RND changes to the L level, it means that the sampling timing is within the period tk or the period td. Therefore, the control circuit 23 accurately sets each subsequent sampling timing by using the values of the adjustment signals tsel1 and tsel2 used in the timing setting immediately before the timing setting performed this time. It can be adjusted to the target period.

(方法2)方法2は、たとえば、方法1において、クロック信号clkの位相を遅らせていくことで、検出結果matchがLレベル、出力値RNDがLレベルに変わらずに、検出結果matchがHレベル、出力値RNDがHレベルに変わった場合に行われる。 (Method 2) In method 2, for example, in method 1, by delaying the phase of the clock signal clk, the detection result match does not change to the L level and the output value RND does not change to the L level, and the detection result match becomes the H level. , It is performed when the output value RND changes to the H level.

制御回路23は、検出結果matchがHレベル、出力値RNDがHレベルに変わったときの調整信号tsel1,tsel2の値を記憶部に記憶させておく。そして、制御回路23は、調整信号tsel1,tsel2の値を変え、検出結果matchがHレベル、出力値RNDがLレベルに変わるまで、データ信号dtに対してクロック信号clkの位相を進ませる。制御回路23は、検出結果matchがHレベル、出力値RNDがLレベルに変わったときの、調整信号tsel1,tsel2の値を記憶部に記憶させる。 The control circuit 23 stores in the storage unit the values of the adjustment signals tsel1 and tsel2 when the detection result match changes to the H level and the output value RND changes to the H level. Then, the control circuit 23 changes the values of the adjustment signals tsel1 and tsel2, and advances the phase of the clock signal clk with respect to the data signal dt until the detection result match changes to the H level and the output value RND changes to the L level. The control circuit 23 stores the values of the adjustment signals tsel1 and tsel2 in the storage unit when the detection result match changes to the H level and the output value RND changes to the L level.

制御回路23は、検出結果matchがHレベル、出力値RNDがLレベルとなったタイミングと、検出結果matchがHレベル、出力値RNDがHレベルとなったタイミングの調整信号tsel1,tsel2の値を記憶部から取得する。そして制御回路23は、取得した値に基づいて、サンプリングタイミングを両タイミングの中間のタイミングに調整する調整信号tsel1,tsel2の値を求める。たとえば、制御回路23は、両タイミングでの調整信号tsel1,tsel2の値の平均を求めることで、両タイミングの中間のタイミングにサンプリングタイミングを合わせる調整信号tsel1,tsel2の値を求める。 The control circuit 23 sets the values of the adjustment signals tsel1 and tsel2 at the timing when the detection result match becomes H level and the output value RND becomes L level and the timing when the detection result match becomes H level and the output value RND becomes H level. Obtained from the storage unit. Then, the control circuit 23 obtains the values of the adjustment signals tsel1 and tsel2 for adjusting the sampling timing to an intermediate timing between the two timings based on the acquired values. For example, the control circuit 23 obtains the values of the adjustment signals tsel1 and tsel2 that adjust the sampling timing to the intermediate timing of both timings by obtaining the average of the values of the adjustment signals tsel1 and tsel2 at both timings.

そして、制御回路23は、求めた調整信号tsel1,tsel2の値を、以後、調整回路21a,21bに供給することで、以後の各サンプリングタイミングは期間tb〜tdのほぼ中央のタイミングとなる。つまり、サンプリングタイミングを、メタステーブル期間である設定目標期間内に合わせることができる。 Then, the control circuit 23 supplies the obtained values of the adjustment signals tsel1 and tsel2 to the adjustment circuits 21a and 21b thereafter, so that each subsequent sampling timing becomes a timing substantially at the center of the periods tb to td. That is, the sampling timing can be adjusted within the set target period, which is the metastable period.

(方法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 control circuit 23 changes the values of the adjustment signals tsel1 and tsel2, and sets the timing for advancing the phase of the clock signal clk with respect to the data signal dt.

クロック信号clkの位相を進ませていくことで、検出結果matchがLレベル、出力値RNDがLレベルに変わると、制御回路23は、さらに、調整信号tsel1,tsel2の値を変え、データ信号dtに対してクロック信号clkの位相を進ませる。検出結果matchがLレベル、出力値RNDがLレベルの場合、サンプリングタイミングは設定目標期間である期間tc内である可能性もあるが、期間td内である可能性もあるためである。 By advancing the phase of the clock signal clk, when the detection result match changes to the L level and the output value RND changes to the L level, the control circuit 23 further changes the values of the adjustment signals tsel1 and tsel2, and the data signal dt The phase of the clock signal clk is advanced with respect to. This is because when the detection result match is the L level and the output value RND is the L level, the sampling timing may be within the period tk, which is the set target period, but may also be within the period td.

クロック信号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 the L level and the output value RND changes to the H level, it means that the sampling timing is within the period tk or the period tb. Therefore, the control circuit 23 accurately sets each subsequent sampling timing by using the values of the adjustment signals tsel1 and tsel2 used in the timing setting immediately before the timing setting performed this time. It can be adjusted to the target period.

(方法4)方法4は、たとえば、方法3において、クロック信号clkの位相を進めていくことで、検出結果matchがLレベル、出力値RNDがHレベルに変わらずに、検出結果matchがHレベル、出力値RNDがLレベルに変わった場合に行われる。 (Method 4) In the method 4, for example, in the method 3, by advancing the phase of the clock signal clk, the detection result match does not change to the L level and the output value RND does not change to the H level, and the detection result match becomes the H level. , This is performed when the output value RND changes to the L level.

制御回路23は、検出結果matchがHレベル、出力値RNDがLレベルに変わったときの調整信号tsel1,tsel2の値を記憶部に記憶させておく。そして、制御回路23は、調整信号tsel1,tsel2の値を変え、検出結果matchがHレベル、出力値RNDがHレベルに変わるまで、データ信号dtに対してクロック信号clkの位相を遅らせる。制御回路23は、検出結果matchがHレベル、出力値RNDがHレベルに変わったときの、調整信号tsel1,tsel2の値を記憶部に記憶させる。 The control circuit 23 stores in the storage unit the values of the adjustment signals tsel1 and tsel2 when the detection result match changes to the H level and the output value RND changes to the L level. Then, the control circuit 23 changes the values of the adjustment signals tsel1 and tsel2, and delays the phase of the clock signal clk with respect to the data signal dt until the detection result match changes to the H level and the output value RND changes to the H level. The control circuit 23 stores the values of the adjustment signals tsel1 and tsel2 in the storage unit when the detection result match changes to the H level and the output value RND changes to the H level.

制御回路23は、検出結果matchがHレベル、出力値RNDがHレベルとなったタイミングと、検出結果matchがHレベル、出力値RNDがLレベルとなったタイミングの調整信号tsel1,tsel2の値を記憶部から取得する。そして制御回路23は、取得した値に基づいて、サンプリングタイミングを両タイミングの中間のタイミングに調整する調整信号tsel1,tsel2の値を求める。たとえば、制御回路23は、両タイミングでの調整信号tsel1,tsel2の値の平均を求めることで、両タイミングの中間のタイミングにサンプリングタイミングを合わせる調整信号tsel1,tsel2の値を求める。 The control circuit 23 sets the values of the adjustment signals tsel1 and tsel2 at the timing when the detection result match becomes H level and the output value RND becomes H level and the timing when the detection result match becomes H level and the output value RND becomes L level. Obtained from the storage unit. Then, the control circuit 23 obtains the values of the adjustment signals tsel1 and tsel2 for adjusting the sampling timing to an intermediate timing between the two timings based on the acquired values. For example, the control circuit 23 obtains the values of the adjustment signals tsel1 and tsel2 that adjust the sampling timing to the intermediate timing of both timings by obtaining the average of the values of the adjustment signals tsel1 and tsel2 at both timings.

そして、制御回路23は、求めた調整信号tsel1,tsel2の値を、以後、調整回路21a,21bに供給することで、以後の各サンプリングタイミングは期間tb〜tdのほぼ中央のタイミングとなる。つまり、サンプリングタイミングを、メタステーブル期間である設定目標期間内に合わせることができる。 Then, the control circuit 23 supplies the obtained values of the adjustment signals tsel1 and tsel2 to the adjustment circuits 21a and 21b thereafter, so that each subsequent sampling timing becomes a timing substantially at the center of the periods tb to td. That is, the sampling timing can be adjusted within the set target period, which is the metastable period.

以下、上記4つの方法を用いてサンプリングタイミングを調整する処理の流れをフローチャートで説明する。
図5は、サンプリングタイミングの調整処理の一例の流れを示すフローチャートである。
Hereinafter, the flow of the process of adjusting the sampling timing using the above four methods will be described with a flowchart.
FIG. 5 is a flowchart showing a flow of an example 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 control circuit 23 supplies the initial values of the adjustment signals tsel1 and tsel2 to the adjustment circuits 21a and 21b to initialize the adjustment circuits 21a and 21b (step S1).
After that, the control circuit 23 detects the detection result match and the output value RND output from the random number generation unit 22 using the data signal dt and the clock signal clk output from the adjustment circuits 21a and 21b in the initial state. Then, the control circuit 23 determines the period including the sampling timing from the detection result match and the output value RND (step S2).

そして、制御回路23は、判定した期間に応じて、図4に示した方法1または方法3によるタイミング設定を行う(ステップS3)。
制御回路23は、方法1または方法3によるタイミング設定により、サンプリングタイミングをメタステーブル期間内に設定が可能であるか否かを判定する(ステップS4)。制御回路23は、上記設定が可能であると判定した場合、調整処理を終了する。
Then, the control circuit 23 sets the timing according to the method 1 or the method 3 shown in FIG. 4 according to the determined period (step S3).
The control circuit 23 determines whether or not the sampling timing can be set within the metastable period by the timing setting according to the method 1 or the method 3 (step S4). When the control circuit 23 determines that the above setting is possible, the control circuit 23 ends the adjustment process.

制御回路23は、上記設定が可能ではないと判定した場合、図4に示した方法2または方法4によるタイミング設定を行い(ステップS5)、調整処理を終了する。
図6は、図5の各処理についての一例を示すフローチャートである。
When the control circuit 23 determines that the above setting is not possible, the control circuit 23 sets the timing according to the method 2 or the method 4 shown in FIG. 4 (step S5), and ends the adjustment process.
FIG. 6 is a flowchart showing an example of each process of FIG.

図5のステップS1の初期化処理の例として、制御回路23は、調整信号tsel1,tsel2の初期値を調整回路21a,21bに供給して調整回路21a,21bにオフセット遅延を設定する(ステップS10)。これにより、データ信号dt及びクロック信号clkは、クロック信号CLKに対してオフセット遅延分、遅延した信号になる。 As an example of the initialization process of step S1 of FIG. 5, the control circuit 23 supplies the initial values of the adjustment signals tsel1 and tsel2 to the adjustment circuits 21a and 21b, and sets the offset delay in the adjustment circuits 21a and 21b (step S10). ). As a result, the data signal dt and the clock signal clk become signals delayed by the offset delay with respect to the clock signal CLK.

図5のステップS2の処理の例として、以下の処理が行われる。
調整回路21a,21bはクロック信号CLKを受け、ラッチ回路22a1〜22a3は、調整回路21aが出力するデータ信号dtを、調整回路21bが出力するクロック信号clkによるサンプリングタイミングで取り込む(ステップS11)。
As an example of the process of step S2 in FIG. 5, the following process is performed.
The adjustment circuits 21a and 21b receive the clock signal CLK, and the latch circuits 22a1 to 22a3 take in the data signal dt output by the adjustment circuit 21a at the sampling timing by the clock signal clk output by the adjustment circuit 21b (step S11).

制御回路23は、乱数生成部22が出力する検出結果matchと出力値RNDとから、サンプリングタイミングを含む期間を判定する(ステップS12)。検出結果matchがHレベル、且つ、出力値RNDがLレベルである場合、制御回路23は、サンプリングタイミングが図4に示した期間ta内であると判定し、ステップS14の処理を行う。 The control circuit 23 determines a period including the sampling timing from the detection result match output by the random number generation unit 22 and the output value RND (step S12). When the detection result match is H level and the output value RND is L level, the control circuit 23 determines that the sampling timing is within the period ta shown in FIG. 4, and performs the process of step S14.

検出結果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 control circuit 23 determines that the sampling timing is within the period tb to td shown in FIG. In that case, the control circuit 23 adjusts the sampling timing by changing the values of the adjustment signals tsel1 and tsel2 so that the sampling timing moves within the period ta (step S13).

検出結果matchがHレベル、且つ、出力値RNDがHレベルである場合、制御回路23は、サンプリングタイミングが図4に示した期間te内であると判定する。その場合、図4に示した方法3または方法4によるタイミング設定が行われるが、図6では図示が省略されている。 When the detection result match is H level and the output value RND is H level, the control circuit 23 determines that the sampling timing is within the period te shown in FIG. In that case, the timing is set by the method 3 or the method 4 shown in FIG. 4, but the illustration is omitted in FIG.

図5のステップS3,S4の処理の例として、以下の処理が行われる。
制御回路23は、データ信号dtに対してクロック信号clkの位相を遅らせるように調整信号tsel1,tsel2の値を変える(ステップS14)。
As an example of the processing of steps S3 and S4 of FIG. 5, the following processing is performed.
The control circuit 23 changes the values of the adjustment signals tsel1 and tsel2 so as to delay the phase of the clock signal clk with respect to the data signal dt (step S14).

そして、調整回路21a,21bはクロック信号CLKを受け、ラッチ回路22a1〜22a3は、調整回路21aが出力するデータ信号dtを、調整回路21bが出力するクロック信号clkによるサンプリングタイミングで取り込む(ステップS15)。 Then, the adjustment circuits 21a and 21b receive the clock signal CLK, and the latch circuits 22a1 to 22a3 take in the data signal dt output by the adjustment circuit 21a at the sampling timing by the clock signal clk output by the adjustment circuit 21b (step S15). ..

そして、制御回路23は、検出結果matchがLレベルで、且つ、出力値RNDがLレベルであるか否かを判定する(ステップS16)。
検出結果matchがLレベルで、且つ、出力値RNDがLレベルである場合、図4の方法1のタイミング設定でサンプリングタイミングをメタステーブル期間内に設定可能である。この場合、制御回路23は、前回のタイミング設定で用いた調整信号tsel1,tsel2の値を設定し(ステップS17)、調整処理を終了する。ステップS17の処理で設定される調整信号tsel1,tsel2の値は、たとえば、記憶部に記憶され、以後は記憶された値が調整回路21a,21bに設定され続ける。
Then, the control circuit 23 determines whether or not the detection result match is at the L level and the output value RND is at the L level (step S16).
When the detection result match is the L level and the output value RND is the L level, the sampling timing can be set within the metastable period by the timing setting of the method 1 of FIG. In this case, the control circuit 23 sets the values of the adjustment signals tsel1 and tsel2 used in the previous timing setting (step S17), and ends the adjustment process. The values of the adjustment signals tsel1 and tsel2 set in the process of step S17 are stored in the storage unit, for example, and the stored values are continuously set in the adjustment circuits 21a and 21b thereafter.

ステップS16の処理で、検出結果matchと出力値RNDの少なくとも一方がHレベルであると判定した場合、制御回路23は、検出結果matchがHレベルで、且つ、出力値RNDがHレベルであるか否かを判定する(ステップS18)。検出結果matchと出力値RNDの少なくとも一方がLレベルである場合、ステップS14からの処理が繰り返される。 When it is determined in the process of step S16 that at least one of the detection result match and the output value RND is H level, the control circuit 23 determines whether the detection result match is H level and the output value RND is H level. Whether or not it is determined (step S18). When at least one of the detection result match and the output value RND is at the L level, the process from step S14 is repeated.

ステップS18の処理で、検出結果matchと出力値RNDの両方がHレベルであると判定された場合、図4の方法1のタイミング設定でサンプリングタイミングをメタステーブル期間内に設定不可能である。その場合、図5のステップS5の処理の例として、以下の処理が行われる。 When it is determined in the process of step S18 that both the detection result match and the output value RND are H level, the sampling timing cannot be set within the metastable period by the timing setting of the method 1 of FIG. In that case, the following processing is performed as an example of the processing in step S5 of FIG.

制御回路23は、検出結果matchと出力値RNDの両方がHレベルとなったときのタイミング設定に用いた調整信号tsel1,tsel2の値を、記憶部に記憶させる(ステップS19)。 The control circuit 23 stores the values of the adjustment signals tsel1 and tsel2 used for timing setting when both the detection result match and the output value RND reach the H level in the storage unit (step S19).

その後、制御回路23は、データ信号dtに対してクロック信号clkの位相を進ませるように調整信号tsel1,tsel2の値を変える(ステップS20)。
そして、調整回路21a,21bはクロック信号CLKを受け、ラッチ回路22a1〜22a3は、調整回路21aが出力するデータ信号dtを、調整回路21bが出力するクロック信号clkによるサンプリングタイミングで取り込む(ステップS21)。
After that, the control circuit 23 changes the values of the adjustment signals tsel1 and tsel2 so as to advance the phase of the clock signal clk with respect to the data signal dt (step S20).
Then, the adjustment circuits 21a and 21b receive the clock signal CLK, and the latch circuits 22a1 to 22a3 take in the data signal dt output by the adjustment circuit 21a at the sampling timing by the clock signal clk output by the adjustment circuit 21b (step S21). ..

そして、制御回路23は、検出結果matchがHレベルで、且つ、出力値RNDがLレベルであるか否かを判定する(ステップS22)。検出結果matchがLレベルか、出力値RNDがHレベルである場合、ステップS20からの処理が繰り返される。 Then, the control circuit 23 determines whether or not the detection result match is at the H level and the output value RND is at the L level (step S22). When the detection result match is L level or the output value RND is H level, the processing from step S20 is repeated.

検出結果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 control circuit 23 stores the values of the adjustment signals tsel1 and tsel2 used for the timing setting at that time in the storage unit (step S23). ).

そして、制御回路23は、ステップS19,S23の処理で記憶した調整信号tsel1,tsel2の値を記憶部から取得する。そして取得した値に基づいて、ステップS18,S22の判定処理が“YES”となる各タイミングの中間にサンプリングタイミングを合わせる調整信号tsel1,tsel2の値を求める。そして、制御回路23は、求めた調整信号tsel1,tsel2の値を調整回路21a,21bに設定する(ステップS24)。そして、制御回路23は、調整処理を終了する。ステップS24の処理で設定される調整信号tsel1,tsel2の値は、たとえば、記憶部に記憶され、以後は記憶された値が調整回路21a,21bに設定され続ける。 Then, the control circuit 23 acquires the values of the adjustment signals tsel1 and tsel2 stored in the processes of steps S19 and S23 from the storage unit. Then, based on the acquired values, the values of the adjustment signals tsel1 and tsel2 that adjust the sampling timing to the middle of each timing in which the determination process of steps S18 and S22 is “YES” are obtained. Then, the control circuit 23 sets the values of the obtained adjustment signals tsel1 and tsel2 in the adjustment circuits 21a and 21b (step S24). Then, the control circuit 23 ends the adjustment process. The values of the adjustment signals tsel1 and tsel2 set in the process of step S24 are stored in the storage unit, for example, and the stored values are continuously set in the adjustment circuits 21a and 21b thereafter.

図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 S12, steps S14, S16, S18, S20, and S22 of steps S14 to S24 are described below. The changed process is performed as follows.

まず、制御回路23は、ステップS14の処理の代わりに、データ信号dtに対してクロック信号clkの位相を進ませるように調整信号tsel1,tsel2を変更する処理を行う。 First, the control circuit 23 performs a process of changing the adjustment signals tsel1 and tsel2 so as to advance the phase of the clock signal clk with respect to the data signal dt, instead of the process of step S14.

また、制御回路23は、ステップS16の処理の代わりに、検出結果matchがLレベルで、且つ、出力値RNDがHレベルであるか否かを判定する処理を行う。制御回路23は、検出結果matchがLレベルで、且つ、出力値RNDがHレベルである場合にはステップS17の処理を行う。 Further, the control circuit 23 performs a process of determining whether or not the detection result match is the L level and the output value RND is the H level, instead of the process of step S16. When the detection result match is the L level and the output value RND is the H level, the control circuit 23 performs the process of step S17.

制御回路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 control circuit 23 determines whether the detection result match is H level and the output value RND is L level instead of the processing in step S18. Performs a process of determining whether or not. When the detection result match is H level and the output value RND is L level, the control circuit 23 performs the process of step S19.

制御回路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 control circuit 23 changes the adjustment signals tsel1 and tsel2 so as to advance the phase of the clock signal clk with respect to the above data signal dt. repeat.

また、制御回路23は、ステップS20の処理の代わりに、データ信号dtに対してクロック信号clkの位相を遅らせるように調整信号tsel1,tsel2を変更する処理を行う。 Further, instead of the process of step S20, the control circuit 23 performs a process of changing the adjustment signals tsel1 and tsel2 so as to delay the phase of the clock signal clk with respect to the data signal dt.

また、制御回路23は、ステップS22の処理の代わりに、検出結果match及び出力値RNDが両方Hレベルであるか否かを判定する。制御回路23は、検出結果match及び出力値RNDが両方Hレベルである場合、ステップS23の処理を行う。制御回路23は、検出結果match及び出力値RNDの少なくとも一方がLレベルである場合、上記のクロック信号clkの位相を遅らせるように調整信号tsel1,tsel2を変更する処理を繰り返す。 Further, the control circuit 23 determines whether or not both the detection result match and the output value RND are at the H level, instead of the processing in step S22. When both the detection result match and the output value RND are H level, the control circuit 23 performs the process of step S23. When at least one of the detection result match and the output value RND is at the L level, the control circuit 23 repeats the process of changing the adjustment signals tsel1 and tsel2 so as to delay the phase of the clock signal clk.

図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 time change of each signal at the time of random number generation of the random number generation circuit.
In FIG. 7, clock signals CLK, 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 signal ERR times are shown. An example of 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レベルの値となる。 By adjusting the phase of the clock signal CLK by the adjustment circuits 21a and 21b, the clock signal clk and the data signal dt are generated. Then, the sampling timing by the clock signal clk is adjusted within the metastable period by the method shown in FIGS. 4 to 6, so that the output values of the latch circuits 22a1 to 22a3 become H after a period of indefiniteness. It is a level or L level value.

検出結果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 depending on the change in the output value of the latch circuits 22a1 to 22a3. The random number generation factor becomes metastability by adjusting the sampling timing by the clock signal clk within the metastable period as described above.

制御信号CTRLは、乱数生成時には変化しない。また、図7では、サンプリングタイミングの調整中の調整信号tsel1,tsel2の変化は図示が省略されているが、制御回路23は、サンプリングタイミングの調整後は、調整信号tsel1,tsel2を変化しない。また、制御回路23は、乱数生成要因がメタスタビリティである場合には、信号ERRをLレベルにし、乱数生成要因がスキューである場合には、信号ERRをHレベルにする。 The control signal CTRL does not change when the random number is generated. Further, in FIG. 7, changes in the adjustment signals tsel1 and tsel2 during the adjustment of the sampling timing are not shown, but the control circuit 23 does not change the adjustment signals tsel1 and tsel2 after the adjustment of the sampling timing. Further, the control circuit 23 sets the signal ERR to the L level when the random number generation factor is metastability, and sets the signal ERR to the H level when the random number generation factor is skew.

なお、制御回路23は、出力値RNDがクロック信号CLKの所定サイクル数、同じ値である場合には、信号ERRをHレベルとして、異常状態であることを外部に通知するようにしてもよい。 The control circuit 23 may set the signal ERR to the H level and notify the outside that it is in an abnormal state when the output value RND is the same value as the predetermined number of cycles of the clock signal CLK.

上記のように制御回路23は、検出結果match及び出力値RNDに基づいて、サンプリングタイミングをメタステーブル期間である期間tc内に調整することで、乱数生成要因をメタスタビリティとすることができる。このため、図7に示されている出力値RNDは、値の偏りなどが低減された品質のよい乱数となる。 As described above, the control circuit 23 can make the random number generation factor metastability by adjusting the sampling timing within the period ct, which is the metastable period, based on the detection result match and the output value RND. Therefore, the output value RND shown in FIG. 7 is a high-quality random number with reduced value bias and the like.

(第3の実施の形態)
図8は、第3の実施の形態の乱数生成回路の一例を示す図である。図8において、図2に示した第2の実施の形態の乱数生成回路20と同じ要素については同一符号が付されている。
(Third Embodiment)
FIG. 8 is a diagram showing an example of a random number generation circuit according to the third embodiment. In FIG. 8, the same elements as those of the random number generation circuit 20 of the second embodiment shown in FIG. 2 are designated by the same reference numerals.

第3の実施の形態の乱数生成回路30は、乱数生成部30a0,30a1,…,30ai,…,30anと、乱数生成部30a0〜30anのそれぞれに供給されるクロック信号clkの遅延量を異ならせる遅延回路30b1,30b2,…,30bnを有する。 The random number generation circuit 30 of the third embodiment makes 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 30a to 30an different. It has delay circuits 30b1, 30b2, ..., 30bn.

乱数生成部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 number generation unit 22 of the random number generation circuit 20 of the second embodiment. The ExOR circuit 31a0 outputs the calculation result of the exclusive OR of the output value of the OR circuit 22d1 and the input value R0 supplied from the control circuit 30c. The output value of the ExOR circuit 31a0 is supplied to the ExOR circuit 31a1 of the random number generation unit 30a1 in the subsequent stage instead of the input value R0.

なお、乱数生成時には、入力値R0は、HレベルまたはLレベルの一方に固定される。乱数生成回路30の試験時には、入力値R0は変更されてもよい。
他の乱数生成部30a1〜30anも乱数生成部30a0と同様の回路である。
At the time of random number generation, the input value R0 is fixed to either the H level or the L level. At the time of testing the random number generation circuit 30, the input value R0 may be changed.
The other random number generation units 30a1 to 30an have the same circuit as the random number generation units 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 random number generation unit 30an at the final stage becomes the output value RND. Further, each of the random number generation units 30a to 30an controls the detection result match output by the random number generation unit 22 of the random number generation circuit 20 of the second embodiment, the detection result corresponding to the output value RND, and the output value in the control circuit 30c. Supply to. For example, the random number generation unit 30a0 supplies the detection result match0 and the output value RND0 to the control circuit 30c.

制御回路30cは、たとえば、クロック信号clkに対する遅延が乱数生成部30a0〜30anのうちで中間の値となる乱数生成部30aiから供給される検出結果matchiと出力値RNDiに基づいて、調整信号tsel1,tsel2の値を決定する。調整信号tsel1,tsel2の値は、図4〜図6に示した方法により、乱数生成部30aiに到達するクロック信号clkによるサンプリングタイミングがメタステーブル期間内になるように決定される。 The control circuit 30c is, for example, based on the detection result matchi and 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 30a to 30an. Determine the value of tsel2. The values of the adjustment signals tsel1 and tsel2 are determined by the methods shown in FIGS. 4 to 6 so that the sampling timing by the clock signal clk reaching the random number generation unit 30ai is within the metastable period.

乱数生成回路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, even if skew occurs due to a change in operating conditions or the like, the sampling timing in any of the random number generation units 30a to 30an is the metastable period. Increased chances of being inside. That is, the probability of random number generation due to metastability can be increased.

(第4の実施の形態)
図9は、第4の実施の形態の乱数生成回路の一例を示す図である。図9において、図8に示した第3の実施の形態の乱数生成回路30と同じ要素については同一符号が付されている。
(Fourth Embodiment)
FIG. 9 is a diagram showing 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. 8 are designated by the same reference numerals.

第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 of the fourth embodiment has 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 generator 30an is supplied to the input terminal in. An output value RND which 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 showing an example of LFSR.
The LFSR41 has a 16-bit shift register 41a and an ExOR circuit 41b, 41c, 41d, 41e.

16ビットシフトレジスタ41aは、ExOR回路41bの出力値を、クロック端子ckに供給されるクロック信号CLKに同期したタイミングで取り込む。そして、16ビットシフトレジスタ41aは、“bit0”から“bit15”方向に、クロック信号CLKに同期したタイミングで1ビットずつシフトしていく。“bit0”〜“bit15”のそれぞれはレジスタを表している。 The 16-bit shift register 41a captures the output value of the ExOR circuit 41b at a timing synchronized with the clock signal CLK supplied to the clock terminal ck. Then, the 16-bit shift register 41a shifts from "bit0" to "bit15" one bit at a time in synchronization with the clock signal CLK. Each of "bit0" to "bit15" represents a register.

ExOR回路41bは、入力端子inに供給される出力値RNDnとExOR回路41eの出力値(フィードバック信号)との排他的論理和の演算結果を出力する。ExOR回路41cは、“bit13”で表されるレジスタの出力値と、“bit15”で表されるレジスタの出力値との排他的論理和の演算結果を出力する。ExOR回路41dは、“bit12”で表されるレジスタの出力値と、ExOR回路41cの出力値との排他的論理和の演算結果を出力する。ExOR回路41eは、“bit10”で表されるレジスタの出力値と、ExOR回路41dの出力値との排他的論理和の演算結果をフィードバック信号としてExOR回路41bに供給する。 The ExOR circuit 41b outputs the calculation result of the exclusive OR of the output value RNDn supplied to the input terminal in and the output value (feedback signal) of the ExOR circuit 41e. The ExOR circuit 41c outputs the operation result of the exclusive OR of the output value of the register represented by "bit13" and the output value of the register represented by "bit15". The ExOR circuit 41d outputs the calculation result of the exclusive OR of the output value of the register represented by "bit12" and the output value of the ExOR circuit 41c. The ExOR circuit 41e supplies the calculation result of the exclusive OR of the output value of the register represented by "bit10" and the output value of the ExOR circuit 41d to the ExOR circuit 41b as a feedback signal.

ところで、ExOR回路41bを有さずに、ExOR回路41eの出力値を16ビットシフトレジスタ41aに入力するLFSRは、周期性をもつ擬似乱数を出力する。
これに対して、図10に示したLFSR41では、ExOR回路41bの一方の入力端子には、乱数生成部30anのExOR回路31anの出力値が供給される。擬似乱数の周期の間に、その出力値がメタスタビリティによる乱数となることで、LFSR41が出力する出力値RNDは、周期性をもたない乱数となる。つまり、出力値RNDが擬似乱数となることを回避できる。このため、品質のよい乱数を出力できる。
By the way, the LFSR that inputs the output value of the ExOR circuit 41e to the 16-bit shift register 41a without having the ExOR circuit 41b outputs a pseudo-random number having periodicity.
On the other hand, in the LFSR41 shown in FIG. 10, the output value of the ExOR circuit 31an of the random number generation unit 30an is supplied to one input terminal of the ExOR circuit 41b. During the period of the pseudo-random number, the output value becomes a random number due to metastability, so that the output value RND output by the LFSR41 becomes a random number having no periodicity. That is, it is possible to prevent the output value RND from becoming a pseudo-random number. Therefore, a high quality random number can be output.

また、第3の実施の形態の乱数生成回路30では、クロック信号CLKの各周期でメタスタビリティによる乱数が出力しない可能性があるが、上記のようなLFSR41を有する乱数生成回路40は、クロック信号CLKの各周期で乱数を出力できる。つまり、乱数の発生レートを向上できる。 Further, in the random number generation circuit 30 of the third embodiment, there is a possibility that a random number due to metastability is not output in each cycle of the clock signal CLK, but the random number generation circuit 40 having the LFSR41 as described above is a clock signal. Random numbers can be output in each cycle of CLK. That is, the random number generation rate can be improved.

なお、制御回路30cは、LFSR41が出力する出力値RNDがクロック信号CLKの所定サイクル数、同じ値である場合には、信号ERRをHレベルとして、異常状態であることを外部に通知してもよい。また、制御回路30cは、LFSR41の入力端子inに供給される乱数生成部30anの出力値が変化するか否かを検出し、その出力値がクロック信号CLKの所定サイクル数、同じ値である場合には、信号ERRをHレベルとしてもよい。 If the output value RND output by the LFSR41 is the same as the predetermined number of cycles of the clock signal CLK, the control circuit 30c sets the signal ERR to the H level and notifies the outside that it is in an abnormal state. Good. Further, the control circuit 30c detects whether or not the output value of the random number generation unit 30an supplied to the input terminal in of the LFSR41 changes, and when the output value is the same value as the predetermined number of cycles of the clock signal CLK. The signal ERR may be set to H level.

また、第2の実施の形態の乱数生成回路20とLFSR41を組み合わせて、乱数生成部22の出力値をLFSR41の入力端子inに供給するようにしてもよい。
また、上記のLFSR41は一例であり、図10の回路構成に限定されない。たとえば、16ビットシフトレジスタ41aの代わりに、32ビットシフトレジスタを用いるなど、種々の変形が可能である。
Further, the random number generation circuit 20 of the second embodiment and the LFSR41 may be combined to supply the output value of the random number generation unit 22 to the input terminal in of the LFSR41.
Further, the above-mentioned LFSR41 is an example, and is not limited to the circuit configuration of FIG. For example, various modifications are possible, such as using a 32-bit shift register instead of the 16-bit shift register 41a.

(第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 increases.

以下では、メタステーブル期間を拡大可能な乱数生成回路を説明する。なお、以下に示す第5の実施の形態の乱数生成回路は、前述の第1乃至第4の実施の形態の乱数生成回路10,20,30,40とも組み合わせることができるが、組み合わせる例については後述する。 In the following, a random number generation circuit capable of expanding the metastable period will be described. The random number generation circuit of the fifth embodiment shown below can also be combined with the random number generation circuits 10, 20, 30, and 40 of the first to fourth embodiments described above. It will be described later.

図11は、第5の実施の形態の乱数生成回路の一例を示す図である。
乱数生成回路50は、調整回路51a,51bを有する調整部51と、負荷容量可変回路52、ラッチ回路53、制御回路54を有する。
FIG. 11 is a diagram showing an example of a random number generation circuit according to the fifth embodiment.
The random number generation circuit 50 includes an adjustment unit 51 having adjustment circuits 51a and 51b, a load capacitance variable circuit 52, a latch circuit 53, and a control circuit 54.

調整部51は、第1の実施の形態の乱数生成回路10における調整部11と同様の機能をする。なお、以下でも、入力信号は、クロック信号CLKであるものとして説明するが、クロック信号CLKに限定されるものではない。 The adjusting unit 51 has the same function as the adjusting unit 11 in the random number generation circuit 10 of the first embodiment. In the following, the input signal will be described as being the clock signal CLK, but the input signal is not limited to the clock signal CLK.

調整部51は、クロック信号CLKに基づいて、データ信号dtとクロック信号clkとを出力するとともに、調整信号tsel1,tsel2に基づいて、データ信号dtとクロック信号clkの少なくとも一方の位相を調整する。 The adjusting unit 51 outputs the data signal dt and the clock signal clk based on the clock signal CLK, and adjusts the phase of at least one of the data signal dt and the clock signal clk based on the adjusting signals tsel1 and tsel2.

負荷容量可変回路52は、制御回路54から供給される選択信号cselに基づいて決定される開始タイミングから、ラッチ回路53においてデータ信号dtoが供給される端子の負荷容量を段階的に増加させる。負荷容量可変回路52は、バッファ52a、遅延選択回路52b、容量回路52c1〜52cnを有する。 The load capacitance variable circuit 52 gradually increases the load capacitance of the terminal to which the data signal dto is supplied in the latch circuit 53 from the start timing determined based on the selection signal csel supplied from the control circuit 54. The load capacitance variable circuit 52 includes a buffer 52a, a delay selection circuit 52b, and a capacitance circuit 52c1 to 52cn.

バッファ52aは、データ信号dtの波形を鈍らせ、データ信号dtを遅延させたデータ信号dtoを出力する。
遅延選択回路52bは、データ信号dtと選択信号cselとに基づいたタイミングで、容量回路52c1〜52cnを有効にして負荷容量を追加する。
The buffer 52a blunts the waveform of the data signal dt and outputs the data signal dt with the data signal dt delayed.
The delay selection circuit 52b enables the capacitance circuits 52c1 to 52cn and adds a load capacitance at a timing based on the data signal dt and the selection signal csel.

容量回路52c1〜52cnは、データ信号dtoが伝搬する配線に接続されており、遅延選択回路52bによって、有効化または無効化される。
ラッチ回路53は、データ信号dtoとクロック信号clkとを受け、クロック信号clkによるサンプリングタイミングにおけるデータ信号dtoの信号レベルに基づいて、HレベルまたはLレベルの出力値RNDを出力する。
The capacitive circuits 52c1 to 52cn are connected to the wiring through which the data signal dto propagates and are enabled or disabled by the delay selection circuit 52b.
The latch circuit 53 receives the data signal dto and the clock signal clk, and outputs an H level or L level output value RND based on the signal level of the data signal dto at the sampling timing by the clock signal clk.

制御回路54は、たとえば、ASICやFPGAなどの特定用途の電子回路である。また、制御回路54は、CPUやDSPなどの演算処理装置としてのプロセッサであってもよい。プロセッサは、RAMなどのメモリに記憶されたプログラムを実行する。なお、制御回路54は、複数のプロセッサの集合であってもよい。 The control circuit 54 is, for example, an electronic circuit for a specific purpose such as an ASIC or FPGA. Further, the control circuit 54 may be a processor as an arithmetic processing device such as a CPU or DSP. The processor executes a program stored in a memory such as RAM. The control circuit 54 may be a set of a plurality of processors.

制御回路54は、出力値RNDに基づいて、調整信号tsel1,tsel2や、選択信号cselを出力する。また、制御回路54は、制御信号CTRLによって乱数生成回路50の外部から制御されてもよい。また、制御回路54は、出力値RNDがクロック信号CLKの所定サイクル数、同じ値である場合には、異常状態であることを示す信号ERRを出力してもよい。 The control circuit 54 outputs the adjustment signals tsel1 and tsel2 and the selection signal csel based on the output value RND. Further, the control circuit 54 may be controlled from the outside of the random number generation circuit 50 by the control signal CTRL. Further, the control circuit 54 may output a signal ERR indicating an abnormal state when the output value RND is the same value as the predetermined number of cycles of the clock signal CLK.

図12は、遅延選択回路と容量回路の一例を示す図である。
遅延選択回路52bは、遅延回路60a1,60a2,…,60am、選択回路60b、遅延回路60c1〜60c(n−1)、OR回路60d1,60d2,…,60dn、AND回路60e1,60e2,…,60enを有する。
FIG. 12 is a diagram showing an example of a delay selection circuit and a capacitance circuit.
The delay selection circuit 52b includes delay circuits 60a1, 60a2, ..., 60am, selection circuits 60b, delay circuits 60c1 to 60c (n-1), OR circuits 60d1, 60d2, ..., 60dn, AND circuits 60e1, 60e2, ..., 60en. Has.

遅延回路60a1〜60amは、直列に接続されており、先頭の遅延回路60a1には、データ信号dtが供給される。遅延回路60a1〜60amのそれぞれで遅延されたデータ信号dtが、データ信号dt1〜dtmとして選択回路60bに供給される。 The delay circuits 60a1 to 60am are connected in series, and a 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 selection circuit 60b as the data signals dt1 to dtm.

選択回路60bは、データ信号dt,dt1〜dtmの何れかを、信号ct0,ct1,…,ctmに基づいて選択して、データ信号dtsとして出力する。信号ct0〜ctmは、選択信号cselに含まれる信号である。 The selection circuit 60b selects any one of the data signals dt, dt1 to dtm based on the signals ct0, ct1, ..., Ctm and outputs the data signals dts. The signals ct0 to ctm are signals included in the selection signal csel.

遅延回路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 a data signal dts is supplied to the head delay circuit 60c1. The data signals dts delayed in each of the delay circuits 60c1 to 60c (n-1) are 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の一方の入力端子に供給される。 A data signal dts is supplied to one input terminal of the OR circuit 60d1. A signal cton is supplied to the other input terminal 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 terminal of the AND circuits 60e1 to 60en. The output signals of the AND circuits 60e1 to 60en are supplied to the capacitance 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 capacitance circuit 52c1 includes an inverter circuit 61, transistors 62, 63, 64, and a capacitor 65. The transistors 62 and 63 are n-channel MOSFETs (Metal-Oxide-Semiconductor Field-Effect Transistors), and the transistors 64 are p-channel MOSFETs.

インバータ回路61の入力端子は、AND回路60e1の出力端子に接続されており、インバータ回路61の出力端子は、トランジスタ62,64のゲート端子に接続されている。トランジスタ62のソース端子は接地されており、トランジスタ62のドレイン端子は、トランジスタ63のソース端子、トランジスタ64のドレイン端子及びキャパシタ65の一方の端子に接続されている。トランジスタ63のドレイン端子及びトランジスタ64のソース端子は、データ信号dtoが伝搬する配線に接続されている。キャパシタ65の他方の端子は接地されている。 The input terminal of the inverter circuit 61 is connected to the output terminal of the AND circuit 60e1, and the output terminal of the inverter circuit 61 is connected to the gate terminal of the transistors 62 and 64. The source terminal of the transistor 62 is grounded, and the drain terminal of the transistor 62 is connected to one of the source terminal of the transistor 63, the drain terminal of the transistor 64, and the capacitor 65. The drain terminal of the transistor 63 and the source terminal of the transistor 64 are connected to the wiring through which the data signal dto propagates. The other terminal of the capacitor 65 is grounded.

容量回路52c2〜52cnも、容量回路52c1と同様の回路である。
信号cton,ctoffが共にHレベルの場合、AND回路60e1〜60enの出力値もHレベルとなる。AND回路60e1〜60enの出力値がHレベルとなるとき、トランジスタ62がオフ状態、トランジスタ63,64がオン状態となるため、キャパシタ65は、データ信号dtoが伝搬する配線に電気的に接続される。つまり、容量回路52c1〜52cnは有効になる。
The capacitance circuits 52c2 to 52cn are also circuits similar to the capacitance circuits 52c1.
When both the signals cton and ctoff are at H level, the output values of the AND circuits 60e1 to 60en are also at H level. When the output values of the AND circuits 60e1 to 60en reach the H level, the transistors 62 are in the off state and the transistors 63 and 64 are in the on state, so that the capacitor 65 is electrically connected to the wiring through which the data signal dto propagates. .. That is, the capacitive circuits 52c1 to 52cn are valid.

信号ctoffがLレベルの場合、信号ctonの値にかかわらず、AND回路60e1〜60enの出力値もLレベルとなる。AND回路60e1〜60enの出力値がLレベルとなるとき、トランジスタ62がオン状態、トランジスタ63,64がオフ状態となるため、キャパシタ65は、データ信号dtoが伝搬する配線から電気的に切断される。つまり、容量回路52c1〜52cnは無効になる。 When the signal ctoff is L level, the output values of the AND circuits 60e1 to 60en are also L level regardless of the value of the signal cton. When the output values of the AND circuits 60e1 to 60en reach the L level, the transistors 62 are turned on and the transistors 63 and 64 are turned off, so that the capacitor 65 is electrically disconnected from the wiring through which the data signal dto propagates. .. That is, the capacitive circuits 52c1 to 52cn are invalid.

信号ctonがLレベルで、信号ctoffがHレベルの場合、データ信号dtsがHレベルに遷移するときに、AND回路60e1〜60enの出力値が順番にHレベルとなる。これにより、容量回路52c1〜52cnは容量回路52c1から順番に有効になる。 When the signal cton is the L level and the signal ctoff is the H level, the output values of the AND circuits 60e1 to 60en are sequentially set to 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 showing a sampling timing setting example and a load capacitance setting example by the load capacitance variable circuit. The voltage range Vmet is the voltage range of the data signal dto in which the latch circuit 53 is in the metastability state.

まず、制御回路54は、図12に示した信号ctoffをLレベルにして、容量回路52c1〜52cnを無効にして、負荷容量の追加をしない状態にする。そして、制御回路54は、たとえば、調整信号tsel1,tsel2を変えて、クロック信号clkの位相をデータ信号dtoよりも進ませた状態から、クロック信号clkの位相を遅らせていく。制御回路54は、出力値RNDを検出し、出力値RNDがLレベルから、Hレベルに変化するタイミングt10における調整信号tsel1,tsel2の値を、図示しない記憶部に記憶させる。 First, the control circuit 54 sets the signal ctoff shown in FIG. 12 to the L level, invalidates the capacitance circuits 52c1 to 52cn, and makes the load capacitance not added. Then, for example, the control circuit 54 changes the adjustment signals tsel1 and tsel2 to delay the phase of the clock signal clk from the state where the phase of the clock signal clk is advanced from the data signal dto. The control circuit 54 detects the output value RND, and stores the values of the adjustment signals tsel1 and tsel2 at the timing t10 when the output value RND changes from the L level to the H level in a storage unit (not shown).

その後、制御回路54は、図12に示した信号ctoff,ctonを共にHレベルにして、容量回路52c1〜52cnを有効にして、負荷容量を追加する。そして、制御回路54は、上記と同様に、たとえば、調整信号tsel1,tsel2を変えて、クロック信号clkの位相をデータ信号dtoよりも進ませた状態から、クロック信号clkの位相を遅らせていく。制御回路54は、出力値RNDを検出し、出力値RNDがLレベルから、Hレベルに変化するタイミングt12における調整信号tsel1,tsel2の値を、図示しない記憶部に記憶させる。 After that, the control circuit 54 adds the load capacitance by setting both the signals ctoff and cton shown in FIG. 12 to the H level and enabling the capacitance circuits 52c1 to 52cn. Then, in the same manner as described above, the control circuit 54 delays the phase of the clock signal clk from the state in which the adjustment signals tsel1 and tsel2 are changed so that the phase of the clock signal clk is advanced from the data signal dto, for example. The control circuit 54 detects the output value RND, and stores the values of the adjustment signals tsel1 and tsel2 at the timing t12 when the output value RND changes from the L level to the H level in a storage unit (not shown).

そして、制御回路54は、記憶された調整信号tsel1,tsel2の値に基づいて、タイミングt10,t12の中間(タイミングt11)にサンプリングタイミングを合わせるための調整信号tsel1,tsel2の値を算出する。たとえば、制御回路54は、タイミングt10,t12での調整信号tsel1,tsel2の値の平均を求めることで、タイミングt11にサンプリングタイミングを合わせる調整信号tsel1,tsel2の値を求める。求めた値は、たとえば、記憶部に記憶される。 Then, the control circuit 54 calculates the values of the adjustment signals tsel1 and tsel2 for adjusting the sampling timing to the middle of the timings t10 and t12 (timing t11) based on the stored values of the adjustment signals tsel1 and tsel2. For example, the control circuit 54 obtains the values of the adjustment signals tsel1 and tsel2 that match the sampling timing with the timing t11 by obtaining the average of the values of the adjustment signals tsel1 and tsel2 at the timings t10 and t12. The obtained value is stored in, for example, a storage unit.

なお、クロック信号clkの位相をデータ信号dtoよりも遅らせた状態から、クロック信号clkの位相を進めていき、出力値RNDが変化するタイミングの調整信号tsel1,tsel2を用いて、サンプリングタイミングt11を決定してもよい。 The phase of the clock signal clk is advanced from the state where the phase of the clock signal clk is delayed from 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. You may.

次に、制御回路54は、調整信号tsel1,tsel2の値を変えて、再びサンプリングタイミングをタイミングt10に合わせる。そして、制御回路54は、図13に示すように、信号ctoffをHレベルにし、信号ctonをLレベルにした状態で、信号ct0〜ctmを変化させて、負荷容量の追加を開始するタイミングを、早めていく。波形66aは、負荷容量の追加開始タイミングを最も遅らせた場合のデータ信号dtoの変化を示し、波形66bは、負荷容量の追加開始タイミングを最も早くした場合のデータ信号dtoの変化を示す。負荷容量は、遅延回路60c1〜60c(n−1)によって、段階的に増加する。 Next, the control circuit 54 changes the values of the adjustment signals tsel1 and tsel2, and adjusts the sampling timing to the timing t10 again. Then, as shown in FIG. 13, the control circuit 54 changes the signals ct0 to ctm in a state where the signal ctoff is set to H level and the signal cton is set to L level, and the timing to start adding the load capacitance is set. I will accelerate. The waveform 66a shows the change in the data signal dto when the load capacitance addition start timing is delayed the most, and the waveform 66b shows the change in the data signal dto when the load capacitance addition start timing is the earliest. The load capacitance is gradually increased by the delay circuits 60c1 to 60c (n-1).

制御回路54は、出力値RNDを検出し、出力値RNDがHレベルから、Lレベルに変化するときの信号ct0〜ctmの値により、追加開始タイミングを決定する。制御回路54は、このときの信号ct0〜ctmの値を、記憶部に記憶させる。たとえば、波形66cは、記憶部に記憶された信号ct0〜ctmの値による追加開始タイミングで負荷容量が追加されたときの、データ信号dtoの変化を示している。 The control circuit 54 detects the output value RND, and determines the addition start timing based on the values of the signals ct0 to ctm when the output value RND changes from the H level to the L level. The control circuit 54 stores the values of the signals ct0 to ctm at this time in the storage unit. For example, the waveform 66c shows a change in the data signal dto when the load capacitance is added at the addition start timing according to the values of the signals ct0 to ctm stored in the storage unit.

以後の乱数生成時には、制御回路54は、上記の方法で求めた、タイミングt11にサンプリングタイミングを合わせるための調整信号tsel1,tsel2の値と、決定した追加開始タイミングにおける信号ct0〜ctmの値を用いる。 At the time of subsequent random number generation, the control circuit 54 uses the values of the adjustment signals tsel1 and tsel2 for adjusting the sampling timing to the timing t11 and the values of the signals ct0 to ctm at the determined addition start timing, which are obtained by the above method. ..

図14は、負荷容量の追加開始タイミングを図13のように決定したときのメタステーブル期間を示す図である。なお、図14には、図13に示した波形66cのメタステーブル期間tm1の他に、図13に示した負荷容量の追加がない場合のメタステーブル期間tm2と、常に負荷容量を追加した場合のメタステーブル期間tm3についても図示されている。 FIG. 14 is a diagram showing a metastable period when the addition start timing of the load capacity is determined as shown in FIG. In addition, in FIG. 14, in addition to the metastable period tm1 of the waveform 66c shown in FIG. 13, the metastable period tm2 when the load capacitance shown in FIG. 13 is not added, and the case where the load capacitance is always added. The metastable period tm3 is also illustrated.

常に容量回路52c1〜52cnによる負荷容量が追加されている場合、データ信号dtoの立ち上がりが緩やかになり、負荷容量の追加がない場合と比べて、電圧範囲Vmetとなるメタステーブル期間tm3が長くなる。しかしながら、データ信号dtoの立ち上がりが開始してから電圧範囲Vmetに入るまでの期間が比較的長くなる。 When the load capacitance by the capacitance circuits 52c1 to 52cn is always added, the rise of the data signal dto becomes gentle, and the metastable period tm3 which 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 to the entry into the voltage range Vmet becomes relatively long.

これに対して、負荷容量の追加開始タイミングを図13のように決定して得られる波形66cでは、データ信号dtoの立ち上がりが開始してから電圧範囲Vmetに入るまでの期間が常に負荷容量を追加している場合と比べて短くなる。この結果、メタステーブル期間tm1を、同じ負荷容量を常に追加する場合のメタステーブル期間tm3よりも長くすることができる。 On the other hand, in the waveform 66c obtained by determining the load capacitance addition start timing as shown in FIG. 13, the load capacitance is always added during the period from the start of the rise of the data signal dto to the entry into the voltage range Vmet. It will be shorter than when it is done. As a result, the metastable period tm1 can be made longer than the metastable period tm3 when the same load capacity is always added.

なお、図12に示した遅延回路60a1〜60am,60c1〜60c(n−1)の数や遅延時間、容量回路52c1〜52cnの数や容量値などのパラメータは、たとえば、回路シミュレーションなどで計算された結果に基づいて決定される。たとえば、回路シミュレーションの際には、調整精度や設定するメタステーブル期間をどれだけ長くするかに応じて上記のパラメータが決定される。 Parameters such as the number and delay time of the delay circuits 60a1 to 60am and 60c1 to 60c (n-1) shown in FIG. 12, the number of capacitance circuits 52c1 to 52cn, and the capacitance value are calculated by, for example, a circuit simulation. It is decided based on the result. For example, in a circuit simulation, the above parameters are determined according to the adjustment accuracy and how long the metastable period to be set is to be set.

以下、サンプリングタイミングと負荷容量の追加開始タイミングの設定処理の流れをフローチャートで説明する。
図15は、サンプリングタイミングと負荷容量の追加開始タイミングの設定処理の一例の流れを示すフローチャートである。
Hereinafter, the flow of the setting process of the sampling timing and the addition start timing of the load capacity will be described with a flowchart.
FIG. 15 is a flowchart showing a flow of an example of the setting process of the sampling timing and the addition start timing of the load capacitance.

制御回路54は、負荷容量を追加しない状態で、クロック信号clkの位相をデータ信号dtoよりも進んだ状態にする調整信号tsel1,tsel2の初期値を出力し、調整回路51a,51bを初期化する(ステップS30)。 The control circuit 54 outputs the initial values of the adjustment signals tsel1 and tsel2 that bring the phase of the clock signal clk ahead of the data signal dto without adding the load capacitance, and initializes the adjustment circuits 51a and 51b. (Step S30).

その後、制御回路54は、調整信号tsel1,tsel2を変えて、クロック信号clkの位相を遅らせていく(サンプリングタイミングを変える)。そして、制御回路54は、出力値RNDを検出し、出力値RNDがLレベルからHレベルに変化するタイミングに設定した調整信号tsel1,tsel2の値を、記憶部に記憶させる(ステップS31)。 After that, the control circuit 54 changes the adjustment signals tsel1 and tsel2 to delay the phase of the clock signal clk (change the sampling timing). Then, the control circuit 54 detects the output value RND and stores the values of the adjustment signals tsel1 and tsel2 set at the timing when the output value RND changes from the L level to the H level in the storage unit (step S31).

また、制御回路54は、負荷容量の追加がある状態で、クロック信号clkの位相をデータ信号dtoよりも進んだ状態にする調整信号tsel1,tsel2の初期値を出力し、調整回路51a,51bを初期化する(ステップS32)。 Further, the control circuit 54 outputs the initial values of the adjustment signals tsel1 and tsel2 that bring the phase of the clock signal clk ahead of the data signal dto in a state where the load capacitance is added, and outputs the adjustment circuits 51a and 51b. Initialize (step S32).

その後、再び、制御回路54は、ステップS31と同じ処理を行う(ステップS33)。
次に、制御回路54は、ステップS31,S33の処理で記憶された調整信号tsel1,tsel2の値に基づいて、サンプリングタイミングを、両タイミングの中間のタイミングとする調整信号の値を決定する(ステップS34)。
After that, the control circuit 54 again performs the same processing as in step S31 (step S33).
Next, the control circuit 54 determines the value of the adjustment signal whose sampling timing is intermediate between the two timings based on the values of the adjustment signals tsel1 and tsel2 stored in the processes of steps S31 and S33 (step). S34).

その後、制御回路54は、入力負荷の追加開始タイミングを設定する(ステップS35)。
図16及び図17は、図15の各処理についての一例を示すフローチャートである。
After that, the control circuit 54 sets the timing for starting the addition of the input load (step S35).
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 of step S30 of FIG. 15, as shown in FIG. 16, the control circuit 54 first has a signal ct0 to ctm = “X”, a signal cton = “X”, and a signal ctoff = “L” ( Set to (L level) (step S40). “X” indicates that it may be H level or L level. Further, the control circuit 54 sets the initial values of the adjustment signals tsel1 and tsel2 that advance the phase of the clock signal clk from the data signal dto in the adjustment circuits 51a and 51b (step S41).

次に、図15のステップS31の処理の例として、図16のステップS42〜S45の処理が行われる。
調整回路51a,51bはクロック信号CLKを受け、データ信号dtとクロック信号clkを出力する。データ信号dtは、負荷容量可変回路52に供給される。ラッチ回路53は、負荷容量可変回路52が出力するデータ信号dtoを、クロック信号clkによるサンプリングタイミングで取り込む(ステップS42)。
Next, as an example of the process of step S31 of FIG. 15, the process of steps S42 to S45 of FIG. 16 is performed.
The adjustment circuits 51a and 51b receive the clock signal CLK and output the data signal dt and the clock signal clk. The data signal dt is supplied to the load capacitance variable circuit 52. The latch circuit 53 takes in the data signal dto output by the load capacitance variable circuit 52 at the sampling timing by the clock signal clk (step S42).

そして、制御回路54は、出力値RNDがHレベルであるか否かを判定する(ステップS43)。
出力値RNDがHレベルではない場合、制御回路54は、データ信号dtoに対してクロック信号clkの位相を遅らせるように調整信号tsel1,tsel2を変える(ステップS44)。ステップS44の処理後は、ステップS42の処理が再び行われる。
Then, the control circuit 54 determines whether or not the output value RND is at the H level (step S43).
When the output value RND is not H level, the control circuit 54 changes the adjustment signals tsel1 and tsel2 so as to delay the phase of the clock signal clk with respect to the data signal dto (step S44). After the process of step S44, the process of step S42 is performed again.

出力値RNDがHレベルである場合、制御回路54は、現在のサンプリングタイミング(たとえば、図13のタイミングt10)に設定した調整信号tsel1,tsel2の値を、記憶部に記憶させる(ステップS45)。 When the output value RND is H level, the control circuit 54 stores the values of the adjustment signals tsel1 and tsel2 set at the current sampling timing (for example, the timing t10 in FIG. 13) in the storage unit (step S45).

次に、図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 of step S32 of FIG. 15, as shown in FIG. 16, the control circuit 54 has signals ct0 to ctm = “X”, signal cton = “H” (H level), and signal ctoff. = Set to "H" (step S46). Further, the control circuit 54 sets the initial values of the adjustment signals tsel1 and tsel2 that advance the phase of the clock signal clk from the data signal dto in the adjustment circuits 51a and 51b (step S47).

そして、図15のステップS33の処理の例として、図16のステップS48〜S51の処理が行われる。ステップS48〜S51の処理は、ステップS42〜S45の処理と同じである。ただ、出力値RNDがHレベルになるサンプリングタイミング(たとえば、図13のタイミングt12)が、負荷容量を追加しない場合と異なる。 Then, as an example of the process of step S33 of FIG. 15, the process of steps S48 to S51 of FIG. 16 is performed. The processing of steps S48 to S51 is the same as the processing of steps S42 to S45. However, the sampling timing at which the output value RND becomes the H level (for example, the timing t12 in FIG. 13) is different from the case where the load capacitance is not added.

その後、図15のステップS34の処理の例として、以下の処理が行われる。
制御回路54は、サンプリングタイミングを、ステップS43,S49の処理で出力値RNDがHレベルになる各サンプリングタイミングの中間とする調整信号tsel1,tsel2の値を決定し、記憶部に記憶させる(ステップS52)。ステップS52の処理では、制御回路54は、ステップS45,S51の処理で記憶された調整信号tsel1,tsel2の値に基づいて、サンプリングタイミングを、たとえば、図13の、タイミングt11とする調整信号tsel1,tsel2を決定する。そして、制御回路54は、決定した調整信号tsel1,tsel2を記憶部に記憶させる。
After that, as an example of the process of step S34 in FIG. 15, the following process is performed.
The control circuit 54 determines the values of the adjustment signals tsel1 and tsel2 in which the sampling timing is in the middle of each sampling timing at which the output value RND becomes H level in the processing of steps S43 and S49, and stores them in the storage unit (step S52). ). In the process of step S52, the control circuit 54 sets the sampling timing to, for example, the timing t11 in FIG. 13, based on the values of the adjustment signals tsel1 and tsel2 stored in the processes of steps S45 and S51. Determine tsel2. Then, the control circuit 54 stores the determined adjustment signals tsel1 and tsel2 in the storage unit.

次に、図15のステップS35の処理の例として、図17のステップS53〜S58の処理が行われる。
制御回路54は、信号ct0〜ctm=“L”、信号cton=“L”、信号ctoff=“H”に設定する(ステップS53)。さらに、制御回路54は、ステップS45の処理で記憶した調整信号tsel1,tsel2の値を用いて、サンプリングタイミングを、タイミングt10に設定する(ステップS54)。
Next, as an example of the process of step S35 of FIG. 15, the process of steps S53 to S58 of FIG. 17 is performed.
The control circuit 54 sets the signal ct0 to ctm = “L”, the signal cton = “L”, and the signal ctoff = “H” (step S53). Further, the control circuit 54 sets the sampling timing to the timing t10 by using the values of the adjustment signals tsel1 and tsel2 stored in the process of step S45 (step S54).

その後、調整回路51a,51bはクロック信号CLKを受け、データ信号dtとクロック信号clkを出力する。データ信号dtは、負荷容量可変回路52に供給される。ラッチ回路53は、負荷容量可変回路52が出力するデータ信号dtoを、クロック信号clkによるサンプリングタイミングで取り込む(ステップS55)。 After that, the adjustment circuits 51a and 51b receive the clock signal CLK and output the data signal dt and the clock signal clk. The data signal dt is supplied to the load capacitance variable circuit 52. The latch circuit 53 takes in the data signal dto output by the load capacitance variable circuit 52 at the sampling timing by the clock signal clk (step S55).

そして、制御回路54は、出力値RNDがLレベルであるか否かを判定する(ステップS56)。出力値RNDがLレベルではない場合、制御回路54は、信号ct0〜ctmを、信号ctmから順にHレベルに設定する(ステップS57)。ステップS57の処理後は、ステップS56の処理が再び行われる。 Then, the control circuit 54 determines whether or not the output value RND is at the L level (step S56). When the output value RND is not the L level, the control circuit 54 sets the signals ct0 to ctm to the H level in order from the signal ctm (step S57). After the process of step S57, the process of step S56 is performed again.

たとえば、信号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 all the values of the signals ct0 to ctm are L level, the selection circuit 60b in FIG. 12 selects the data signal dtm having the largest delay time from the data signals dt to dtm and outputs it as the data signal dts. .. If the output value RND remains at H level, the control circuit 54 changes the value of the signal ctm to H level. As a result, the selection circuit 60b selects the data signal having the second largest delay time among the data signals dt to dtm and outputs it as the data signal dts. If the output value RND still remains at the H level, the control circuit 54 further changes the value of the signal ct (m-1) (not shown in FIG. 12) to the H level. As a result, the selection circuit 60b selects the data signal having the third largest delay time among the data signals dt to dtm and outputs it as the data signal dts. The control circuit 54 repeats such a process until the output value RND changes to the L level.

これによって、負荷容量の追加開始タイミングが早まっていく。出力値RNDがLレベルである場合、制御回路54は、現在の信号ct0〜ctmの値を、記憶部に記憶させ(ステップS58)、設定処理を終了する。 As a result, the timing for starting the addition of the load capacity is advanced. When the output value RND is the L level, the control circuit 54 stores the current values of the signals ct0 to ctm in the storage unit (step S58), and ends the setting process.

なお、上記の図15〜図17の処理の順序は一例であり、処理の順序を適宜変更してもよい。たとえば、ステップS31の処理後に、ステップS35の負荷容量の追加開始タイミングを設定してもよい。 The order of the processes shown in FIGS. 15 to 17 is an example, and the order of the processes may be changed as appropriate. For example, after the processing of step S31, the addition start timing of the load capacity in step S35 may be set.

上記のような第5の実施の形態の乱数生成回路50及びその制御方法によれば、メタステーブル期間を拡大できるため、サンプリングタイミングを合わせることが容易になり、メタスタビリティによる品質のよい乱数を生成できる。 According to the random number generation circuit 50 and its control method of the fifth embodiment as described above, since the metastable period can be extended, it becomes easy to match the sampling timing, and a high-quality random number is generated by metastability. it can.

(第6の実施の形態)
図18は、第6の実施の形態の乱数生成回路の一例を示す図である。図18において、図11に示した第5の実施の形態の乱数生成回路50と同じ要素については同一符号が付されている。
(Sixth Embodiment)
FIG. 18 is a diagram showing an example of a random number generation circuit according to the sixth embodiment. In FIG. 18, the same elements as those of the random number generation circuit 50 of the fifth embodiment shown in FIG. 11 are designated by the same reference numerals.

第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 a latch circuit 71a0, 71a1, 71a2 ..., 71an, a delay circuit 71b1, 71b2 ..., 71bn, an ExOR circuit 71c0, 71c1, 71c2, ..., 71cn, and a control circuit 71d. Has.

ラッチ回路71a0〜71anのデータ端子には、負荷容量可変回路52が出力したデータ信号dtoが供給される。また、ラッチ回路71a1〜71anのそれぞれのクロック端子には、直列に接続された遅延回路71b1〜71bnによって異なる遅延時間分、遅延されたクロック信号clkが供給される。 The data signal dto output by the load capacitance variable circuit 52 is supplied to the data terminals of the latch circuits 71a to 71an. Further, clock signals clk delayed by different delay times are supplied to the respective clock terminals of the latch circuits 71a1 to 71an by the delay circuits 71b1 to 71bn connected in series.

また、ExOR回路71c0〜71cnは直列に接続されており、ExOR回路71c0〜71cnのそれぞれの一方の入力端子には、ラッチ回路71a0〜71anのうち対応するラッチ回路の出力値が供給される。ExOR回路71c1〜71cnのそれぞれの他方の入力端子には、前段のExOR回路の出力値が供給される。初段のExOR回路71c0の他方の入力端子には、入力値R0が供給される。 Further, the ExOR circuits 71c to 71cn are connected in series, and the output value of the corresponding latch circuit of the latch circuits 71a to 71an is supplied to one input terminal of each of the ExOR circuits 71c to 71cn. The output value of the ExOR circuit in the previous stage is supplied to the other input terminals 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 either the H level or the L level. At the time of testing the random number generation circuit 70, the input value R0 may be changed. The output value of the last-stage ExOR circuit 71cn becomes the output value RND. Further, the output values of the latch circuits 71a to 71an are supplied to the control circuit 71d.

制御回路71dは、たとえば、クロック信号clkに対する遅延がラッチ回路71a0〜71anのうちで中間の値となるラッチ回路から供給される出力値に基づいて、図15に示した処理で、調整信号tsel1,tsel2や選択信号cselの値を決定する。 The control circuit 71d is, for example, a process shown in FIG. 15 based on the output value supplied from the latch circuit in which the delay with respect to the clock signal clk is an intermediate value among the latch circuits 71a to 71an. The value of tsel2 and the selection signal csel is determined.

乱数生成回路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, even if skew occurs due to a change in operating conditions or the like, the sampling timing in any of the latch circuits 71a to 71an is within the metastable period. The possibility of becoming is increased. That is, the probability of random number generation due to metastability can be increased.

(第7の実施の形態)
図19は、第7の実施の形態の乱数生成回路の一例を示す図である。図19において、図18に示した第6の実施の形態の乱数生成回路70と同じ要素については同一符号が付されている。
(7th Embodiment)
FIG. 19 is a diagram showing an example of a random number generation circuit according to the seventh embodiment. In FIG. 19, the same elements as those of the random number generation circuit 70 of the sixth embodiment shown in FIG. 18 are designated by the same reference numerals.

第7の実施の形態の乱数生成回路80は、入力端子inとクロック端子ckと出力端子outとを備えたLFSR81を有する。
クロック端子ckには、クロック信号CLKが供給され、入力端子inには最後段のExOR回路71cnの出力値が供給される。出力端子outから乱数または擬似乱数である出力値RNDが出力される。
The random number generation circuit 80 of the seventh embodiment has an LFSR81 including 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 last-stage ExOR circuit 71cn is supplied to the input terminal in. An output value RND which 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 LFSR81 can be realized by, for example, the same circuit as the LFSR41 shown in FIG. During the period of the pseudo-random number, the output value of the ExOR circuit 71cn becomes a random number due to metastability, so that the output value RND output by the LFSR81 becomes a random number having no periodicity. That is, it is possible to prevent the output value RND from becoming a pseudo-random number. Therefore, a high quality random number can be output.

また、第6の実施の形態の乱数生成回路70では、クロック信号CLKの各周期でメタスタビリティによる乱数が出力しない可能性があるが、上記のようなLFSR81を有する乱数生成回路80は、クロック信号CLKの各周期で乱数を出力できる。つまり、乱数の発生レートを向上できる。 Further, in the random number generation circuit 70 of the sixth embodiment, there is a possibility that a random number due to metastability is not output in each cycle of the clock signal CLK, but the random number generation circuit 80 having the LFSR81 as described above is a clock signal. Random numbers can be output in each cycle of CLK. That is, the random number generation rate can be improved.

なお、制御回路71dは、LFSR81が出力する出力値RNDがクロック信号CLKの所定サイクル数、同じ値である場合には、信号ERRをHレベルとして、異常状態であることを外部に通知してもよい。また、制御回路71dは、LFSR81の入力端子inに供給されるExOR回路71cnの出力値が変化するか否かを検出し、その出力値がクロック信号CLKの所定サイクル数、同じ値である場合には、信号ERRをHレベルとしてもよい。 If the output value RND output by the LFSR81 is the same as the predetermined number of cycles of the clock signal CLK, the control circuit 71d sets the signal ERR to the H level and notifies the outside that it is in an abnormal state. Good. Further, the control circuit 71d detects whether or not the output value of the ExOR circuit 71cn supplied to the input terminal in of the LFSR81 changes, and when the output value is the same value as the predetermined number of cycles of the clock signal CLK. May set the signal ERR to H level.

また、第5の実施の形態の乱数生成回路50とLFSR81を組み合わせて、ラッチ回路53の出力値をLFSR81の入力端子inに供給するようにしてもよい。
(第8の実施の形態)
図20は、第8の実施の形態の乱数生成回路の一例を示す図である。図20において、図8に示した第3の実施の形態の乱数生成回路30及び、図11に示した第5の実施の形態の乱数生成回路50と同じ要素については同一符号が付されている。
Further, the random number generation circuit 50 and the LFSR81 of the fifth embodiment may be combined to supply the output value of the latch circuit 53 to the input terminal in of the LFSR81.
(8th Embodiment)
FIG. 20 is a diagram showing an example of a random number generation circuit according to the eighth embodiment. In FIG. 20, the same elements as those of the random number generation circuit 30 of the third embodiment shown in FIG. 8 and the random number generation circuit 50 of the fifth embodiment shown in FIG. 11 are designated by the same reference numerals. ..

第8の実施の形態の乱数生成回路90は、第3の実施の形態の乱数生成回路30に、負荷容量可変回路52を適用した回路である。
乱数生成部30a0〜30anには、データ信号dtではなく、負荷容量可変回路52が出力するデータ信号dtoが供給されることが、乱数生成回路30と異なっている。
The random number generation circuit 90 of the eighth embodiment is a circuit in which the load capacitance variable circuit 52 is applied to the random number generation circuit 30 of the third embodiment.
It is different from the random number generation circuit 30 in that the data signal dto output by the load capacitance variable circuit 52 is supplied to the random number generation units 30a to 30an instead of the data signal dt.

制御回路91は、たとえば、クロック信号clkに対する遅延が乱数生成部30a0〜30anのうちで中間の値となる乱数生成部30aiから供給される出力値RNDiに基づいて、まず、負荷容量の追加開始タイミングを決定する。たとえば、制御回路91は、選択信号cselにより、まず、負荷容量を追加しない状態に、負荷容量可変回路52を設定し、調整信号tsel1,tsel2の値を変更して、出力値RNDiがLレベルからHレベルに変化するタイミングを検出する。そして、制御回路91は、そのタイミングにおける調整信号tsel1,tsel2の値を用いて、選択信号cselにより、負荷容量の追加開始タイミングを早めていき、出力値RNDiがLレベルに変化したときの選択信号cselの値を記憶する。 The control circuit 91 first starts adding the load capacitance 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 30a to 30an. To determine. For example, in the control circuit 91, the load capacitance variable circuit 52 is first set in a state where the load capacitance is not added by the selection signal csel, the values of the adjustment signals tsel1 and tsel2 are changed, and the output value RNDi is changed from the L level. The timing of changing to the H level is detected. Then, the control circuit 91 uses the values of the adjustment signals tsel1 and tsel2 at that timing to advance the start timing of adding the load capacitance by the selection signal csel, and the selection signal when the output value RNDi changes to the L level. Store the value of csel.

その後、制御回路91は、記憶した選択信号cselの値を負荷容量可変回路52に供給し、その値によって決まる追加開始タイミングで負荷容量を段階的に増加させる。そして、制御回路91は、検出結果matchiと出力値RNDiに基づいて、調整信号tsel1,tsel2の値を決定する。調整信号tsel1,tsel2の値は、図4〜図6に示した方法により、乱数生成部30aiに到達するクロック信号clkによるサンプリングタイミングがメタステーブル期間内になるように決定される。 After that, the control circuit 91 supplies the stored selection signal csel value to the load capacitance variable circuit 52, and gradually increases the load capacitance at an additional start timing determined by the value. Then, the control circuit 91 determines the values of the adjustment signals tsel1 and tsel2 based on the detection result matchi and the output value RNDi. The values of the adjustment signals tsel1 and tsel2 are determined by the methods shown in FIGS. 4 to 6 so that the sampling timing by the clock signal clk reaching the random number generation unit 30ai is within the metastable period.

第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. Further, since the random number generation circuit 90 has the load capacitance variable circuit 52, the metastable period can be extended, so that the possibility that the sampling timing can be maintained within the metastable period increases. This makes it possible to generate higher quality random numbers.

なお、乱数生成回路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 capacitance variable circuit 52 of FIG. 12, the OR circuits 60d1 to 60dn provided to enable the capacitance circuits 52c1 to 52cn at the same time when determining the sampling timing may not be provided.

(第9の実施の形態)
図21は、第9の実施の形態の乱数生成回路の一例を示す図である。図21において、図9に示した第4の実施の形態の乱数生成回路40及び、図20に示した第8の実施の形態の乱数生成回路90と同じ要素については同一符号が付されている。
(9th embodiment)
FIG. 21 is a diagram showing 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. 20 are designated by the same reference numerals. ..

第9の実施の形態の乱数生成回路100は、第8の実施の形態の乱数生成回路90に、LFSR41を適用した回路である。
第9の実施の形態の乱数生成回路100は、第8の実施の形態の乱数生成回路90と同様の効果が得られるとともに、第4の実施の形態の乱数生成回路40と同様の効果も得られる。
The random number generation circuit 100 of the ninth embodiment is a circuit in which the LFSR 41 is applied to the random number generation circuit 90 of the eighth embodiment.
The random number generation circuit 100 of the ninth embodiment has the same effect as the random number generation circuit 90 of the eighth embodiment, and also has the same effect as the random number generation circuit 40 of the fourth embodiment. To be done.

なお、説明を省略するが、負荷容量可変回路52は、第1の実施の形態の乱数生成回路10や、第2の実施の形態の乱数生成回路20に適用できることは、いうまでもない。
以上説明した第1乃至第9の実施の形態の乱数生成回路10,20,30,40,50,70,80,90,100は、乱数を用いる様々な集積回路、システム及び機器などに適用可能である。たとえば、セキュリティ分野における乱数を用いた暗号キーの生成、AI(Artificial Intelligence)分野における乱数を用いたディープラーニングでの過学習を防ぐドロップアウト処理などに利用可能である。さらに、乱数が利用されるビッグデータ解析にも利用可能である。
Although description is omitted, it goes without saying that the load capacitance variable circuit 52 can be applied to the random number generation circuit 10 of the first embodiment and the random number generation circuit 20 of the second embodiment.
The random number generation circuits 10, 20, 30, 40, 50, 70, 80, 90, 100 of the first to ninth embodiments described above can be applied to various integrated circuits, systems, devices, and the like using random numbers. Is. For example, it can be used for generation of an encryption key using random numbers in the security field, dropout processing for preventing over-learning in deep learning using random numbers in the AI (Artificial Intelligence) field, and the like. Furthermore, it can also be used for big data analysis in which random numbers are used.

以上、実施の形態に基づき、本発明の乱数生成回路及びその制御方法の一観点について説明してきたが、これらは一例にすぎず、上記の記載に限定されるものではない。 Although the random number generation circuit of the present invention and one aspect of the control method thereof have been described above based on the embodiments, these are merely 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 出力値
10 Random generator 11 Adjustment circuit 11a, 11b Adjustment circuit 12 Random generator 12a1-12an Latch circuit 12b Output circuit 12c Detection circuit 13 Control circuit CLK, clk Clock signal dt Data signal match Detection result tsel1, tsel2 Adjustment signal RND Output value

Claims (8)

入力信号と調整信号とを受け、前記入力信号に基づいて、第1の信号と第2の信号とを出力するとともに、前記調整信号に基づいて、前記第1の信号または前記第2の信号の位相を調整する調整部と、
前記第1の信号と前記第2の信号とを受け、前記第2の信号によるサンプリングタイミングにおける前記第1の信号の信号レベルに基づいて、第1の値または第2の値をそれぞれ出力する、3つ以上の奇数個のラッチ回路と、
前記奇数個のラッチ回路のそれぞれが出力する前記第1の値または前記第2の値を受け、前記奇数個のラッチ回路の全てが同じ値を出力する場合、前記同じ値を出力し、前記奇数個のラッチ回路のうちの少なくとも1つが異なる値を出力する場合、前記第1の値と前記第2の値のうち、出力される数が少ない方の値を出力する出力回路と、
前記奇数個のラッチ回路のそれぞれが出力する前記第1の値または前記第2の値を受け、前記奇数個のラッチ回路の全てが前記同じ値を出力するか否かを示す検出結果を出力する検出回路と、
前記検出結果と前記出力回路の出力値とに基づいて、前記サンプリングタイミングが、前記奇数個のラッチ回路が準安定状態となる期間内であるか否かを判定し、前記サンプリングタイミングが前記期間内であるか否かの判定結果に基づいて、前記調整信号の値を変えて、前記サンプリングタイミングを前記期間内に調整する制御回路と、
を有する乱数生成回路。
It receives an input signal and an adjustment signal, outputs a first signal and a second signal based on the input signal, and outputs the first signal or the second signal based on the adjustment signal. The adjustment part that adjusts the phase and
The first signal and the second signal are received, and the first value or the second value is output, respectively, based on the signal level of the first signal at the sampling timing by the second signal. With 3 or more odd numbered latch circuits,
When each of the odd numbered latch circuits receives the first value or the second value and all of the odd numbered latch circuits output the same value, the same value is output and the odd number is output. When at least one of the latch circuits outputs a different value, the output circuit that outputs the smaller number of the first value and the second value is output.
The first value or the second value output by each of the odd-numbered latch circuits is received, and a detection result indicating whether or not all of the odd-numbered latch circuits output the same value is output. With the detection circuit
Based on the detection result and the output value of the output circuit, it is determined whether or not the sampling timing is within the period in which the odd number of latch circuits are in the 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
Random number generation circuit with.
前記制御回路は、前記奇数個のラッチ回路の全てが前記同じ値を出力する状態において、前記調整信号の値を変えることで、前記第1の信号に対して前記第2の信号の位相を遅らせるか早めたときの、前記検出結果と前記出力回路の前記出力値の変化に基づいて、前記サンプリングタイミングが前記期間内であるか否かを判定する、
請求項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. Based on the detection result and the change in the output value of the output circuit when the speed is advanced, it is determined whether or not the sampling timing is within the period.
The random number generation circuit according to claim 1.
前記制御回路は、前記奇数個のラッチ回路の全てが前記第2の値を出力する状態になるまで、前記調整信号の値を変えた後、前記奇数個のラッチ回路の全てが前記第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-numbered latch circuits output the second value, and then all of the odd-numbered latch circuits have the first value. Change the value of the adjustment signal until the value is output.
In the control circuit, the value of the adjustment signal at the first timing when all of the odd-numbered latch circuits are in a state of outputting the second value, and all of the odd-numbered latch circuits are said to be the first. Based on the value of the adjustment signal at the second timing in which the value of is output, the sampling is performed at the third timing within the period, which is intermediate between the first timing and the second timing. Adjust the timing,
The random number generation circuit according to claim 1 or 2.
前記奇数個のラッチ回路と、前記出力回路と、前記検出回路と、前記出力回路の前記出力値と第1の入力値との排他的論理和の演算結果を出力する第1の排他的論理和回路と、をそれぞれが有する複数段直列に接続された複数の乱数生成部と、
前記複数の乱数生成部のそれぞれに供給される前記第2の信号の遅延量を異ならせる遅延回路と、を有し、
前記複数の乱数生成部のうちの初段の乱数生成部の、前記第1の排他的論理和回路に供給される前記第1の入力値は、前記制御回路が出力する前記第1の値または前記第2の値の一方であり、
前記複数の乱数生成部のうちの2段目以降の乱数生成部の、前記第1の排他的論理和回路に供給される前記第1の入力値は、前段の乱数生成部の前記第1の排他的論理和回路が出力する前記演算結果である、
請求項1乃至3の何れか一項に記載の乱数生成回路。
A first exclusive OR that outputs the calculation result of the exclusive OR of the odd number of latch circuits, the output circuit, the detection circuit, and the output value and the first input value of the output circuit. A circuit, a plurality of random number generators connected in series in multiple stages each having a circuit, and
It has a delay circuit that makes the delay amount of the second signal supplied to each of the plurality of random number generators different.
The first input value supplied to the first exclusive OR circuit of the first-stage random number generation unit among the plurality of random number generation units is the first value output by 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 stages of the plurality of random number generation units is the first input value of the previous stage random number generation unit. This is the calculation result output by the exclusive OR circuit.
The random number generation circuit according to any one of claims 1 to 3.
前記入力信号に同期して第2の入力値を取り込む複数ビットのシフトレジスタを含む線形帰還シフトレジスタを、さらに有し、
前記線形帰還シフトレジスタは、前記出力回路の前記出力値または前記出力値に基づいた値と、前記複数ビットのうちの一部のビットの排他的論理和により生成されるフィードバック信号との排他的論理和である前記第2の入力値を出力する第2の排他的論理和回路を有する、
請求項1乃至4の何れか一項に記載の乱数生成回路。
Further having 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 is 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 the exclusive OR of some of the plurality of bits. It has a second exclusive OR circuit that outputs the second input value that is the sum.
The random number generation circuit according to any one of claims 1 to 4.
前記制御回路が出力する選択信号を受け、前記選択信号に基づいて決定される開始タイミングから、前記奇数個のラッチ回路において前記第1の信号が供給される端子の負荷容量を段階的に増加させる負荷容量可変回路を、さらに有する請求項1乃至5の何れか一項に記載の乱数生成回路。 The load capacitance of the terminal to which the first signal is supplied in the odd-numbered latch circuits is gradually increased from the start timing determined based on the selection signal in response to the selection signal output by the control circuit. The random number generation circuit according to any one of claims 1 to 5, further comprising a load capacitance variable circuit. 前記制御回路は、前記調整信号を、前記出力回路の前記出力値が前記第1の値から前記第2の値に変化したときの第5の値に固定した状態で、前記選択信号の値を変えて、前記開始タイミングを早めていき、前記出力値が前記第2の値から前記第1の値に変化したときの前記選択信号の第6の値により、前記開始タイミングを決定する、
請求項6に記載の乱数生成回路。
The control circuit sets the value of the selection signal in a state where the adjustment signal is fixed to the fifth value when the output value of the output circuit changes from the first value to the second value. By changing, the start timing is advanced, and the start timing is determined by 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 of the random number generation circuit receives an input signal and an adjustment signal, outputs a first signal and a second signal based on the input signal, and outputs the first signal and the second signal based on the input signal, and based on the adjustment signal, the first signal. Adjust the phase of the 1st signal or the 2nd signal,
Three or more odd-numbered 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 by the second signal. Based on, the first value or the second value is output respectively,
When the output circuit of the random number generation circuit receives the first value or the second value output by each of the odd-numbered latch circuits, and all of the odd-numbered latch circuits output the same value. , When the same value is output and at least one of the odd-numbered latch circuits outputs a different value, the smaller number of the first value and the second value is output. Output,
The detection circuit included in the random number generation circuit receives the first value or the second value output by each of the odd-numbered latch circuits, and all of the odd-numbered latch circuits output the same value. Outputs the detection result indicating whether or not
Based on the detection result and the output value of the output circuit, the control circuit of the random number generation circuit determines whether or not the sampling timing is within the period in which the odd number of latch circuits are in the metastable state. Judgment is made, and the sampling timing is adjusted within the period by changing the value of the adjustment signal based on the determination result of whether or not the sampling timing is within the period.
How to control the random number generation circuit.
JP2017175543A 2017-09-13 2017-09-13 Random number generation circuit and control method of random number generation circuit Active JP6867594B2 (en)

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 JP2019053385A (en) 2019-04-04
JP6867594B2 true 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)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3487299B2 (en) * 2001-06-06 2004-01-13 いわき電子株式会社 Random number generator and probability generator
JP4248950B2 (en) * 2003-06-24 2009-04-02 株式会社ルネサステクノロジ Random number generator
JP2008066536A (en) * 2006-09-07 2008-03-21 Toshiba Corp Semiconductor integrated circuit
JP5558167B2 (en) * 2010-03-30 2014-07-23 ルネサスエレクトロニクス株式会社 Failure detection system and failure detection method for semiconductor device and data holding circuit
JP6093207B2 (en) * 2013-03-08 2017-03-08 株式会社メガチップス Linear feedback shift register

Also Published As

Publication number Publication date
JP2019053385A (en) 2019-04-04

Similar Documents

Publication Publication Date Title
KR102001691B1 (en) Delay Locked Loop
JP6361433B2 (en) Frequency detection circuit and reception circuit
JP4376081B2 (en) Frequency multiplier and method capable of adjusting clock duty cycle
US9219628B2 (en) Equalizer and operating method thereof
JP5989239B2 (en) Signal processing device
US10108211B2 (en) Digital low drop-out regulator
JP6209978B2 (en) Memory controller, information processing apparatus and reference voltage adjusting method
JP2010117846A (en) Random number generation circuit
US7870414B2 (en) Clock tree circuit and semiconductor memory device using the same, and duty cycle correction method
JP2006041818A (en) Semiconductor device having digital interface, memory element and memory module
JP6700566B2 (en) Equalization circuit, reception circuit, and semiconductor integrated circuit
JP6867594B2 (en) Random number generation circuit and control method of random number generation circuit
JP4760052B2 (en) Transmission control device and sampling frequency conversion device
JP2001177510A (en) Digital synchronous circuit
US9379716B2 (en) Electronic circuit, method of controlling electronic circuit, and electronic apparatus
JP2006261812A (en) Transmission controller and device for converting sampling frequency
JP6697776B2 (en) Unique information generator
TWI638521B (en) Clock filter circuit and filtering method
JP6823268B2 (en) Frequency divider circuit, demultiplexer circuit, and semiconductor integrated circuit
JP6871509B2 (en) Transmission circuit and integrated circuit
JP3660595B2 (en) Variable frequency pulse generator
JP4945616B2 (en) Semiconductor device having digital interface
KR20130129782A (en) Input buffer
KR20050115703A (en) Clock generating circuit and methode of semiconductor memory device
JP2008283539A (en) Clock reproducing device for multivalued signal

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