JP2019053385A - Random number generation circuit and control method of random number generation circuit - Google Patents

Random number generation circuit and control method of random number generation circuit Download PDF

Info

Publication number
JP2019053385A
JP2019053385A JP2017175543A JP2017175543A JP2019053385A JP 2019053385 A JP2019053385 A JP 2019053385A JP 2017175543 A JP2017175543 A JP 2017175543A JP 2017175543 A JP2017175543 A JP 2017175543A JP 2019053385 A JP2019053385 A JP 2019053385A
Authority
JP
Japan
Prior art keywords
value
output
circuit
random number
signal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2017175543A
Other languages
Japanese (ja)
Other versions
JP6867594B2 (en
Inventor
健治 井實
Kenji Isane
健治 井實
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

Abstract

To prevent deterioration of quality of random numbers.SOLUTION: When all of an odd number of latch circuits 12a1 to 12an output the same value, an output circuit 12b outputs the value, and when at least one of the plurality of latch circuits outputs a different value, the output circuit 12b outputs a value of which the number of output is smaller. A detection circuit 12c outputs a detection result indicating whether all of the latch circuits 12a1 to 12an output the same value or not. A control circuit 13 determines whether sampling timing is in a period where the latch circuits 12a1 to 12an are in a quasi-stable state on the basis of the detection result and an output value of the detection circuit 12b, and changes values of adjustment signals tsel1 and tsel2 used by an adjustment unit 11 for adjusting phases of a data signal dt and a clock signal clk supplied to the latch circuits 12a1 to 12an, so as to adjust the sampling timing becoming in the period.SELECTED DRAWING: Figure 1

Description

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

ラッチ回路を用いて乱数を生成する手法の1つとして、ラッチ回路のメタスタビリティ(準安定性)を利用する手法がある。メタスタビリティは、ラッチ回路に入力されるデータ信号の論理レベルがH(High)レベルとL(Low)レベルの中間にあるときにクロック信号によるサンプリングが生じる場合、出力値が不確定になる特性である。   One technique for generating random numbers using a latch circuit is to use metastability (metastability) of the latch circuit. Metastability is a characteristic in which the output value becomes indeterminate when sampling by the clock signal occurs when the logic level of the data signal input to the latch circuit is between the H (High) level and the L (Low) level. is there.

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

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

1つの側面では、本発明は、乱数の品質悪化を抑制することを目的とする。   In one aspect, the present invention aims to suppress deterioration in quality of random numbers.

1つの実施態様では、入力信号と調整信号とを受け、前記入力信号に基づいて、第1の信号と第2の信号とを出力するとともに、前記調整信号に基づいて、前記第1の信号または前記第2の信号の位相を調整する調整部と、前記第1の信号と前記第2の信号とを受け、前記第2の信号によるサンプリングタイミングにおける前記第1の信号の信号レベルに基づいて、第1の値または第2の値をそれぞれ出力する、3つ以上の奇数個のラッチ回路と、前記奇数個のラッチ回路のそれぞれが出力する前記第1の値または前記第2の値を受け、前記奇数個のラッチ回路の全てが同じ値を出力する場合、前記同じ値を出力し、前記奇数個のラッチ回路のうちの少なくとも1つが異なる値を出力する場合、前記第1の値と前記第2の値のうち、出力される数が少ない方の値を出力する出力回路と、前記奇数個のラッチ回路のそれぞれが出力する前記第1の値または前記第2の値を受け、前記奇数個のラッチ回路の全てが前記同じ値を出力するか否かを示す検出結果を出力する検出回路と、前記検出結果と前記出力回路の出力値とに基づいて、前記サンプリングタイミングが、前記奇数個のラッチ回路が準安定状態となる期間内であるか否かを判定し、前記サンプリングタイミングが前記期間内であるか否かの判定結果に基づいて、前記調整信号の値を変えて、前記サンプリングタイミングを前記期間内に調整する制御回路と、を有する乱数生成回路が提供される。   In one embodiment, the input signal and the adjustment signal are received, the first signal and the second signal are output based on the input signal, and the first signal or the adjustment signal is output based on the adjustment signal. An adjustment unit that adjusts the phase of the second signal, the first signal, and the second signal, and based on the signal level of the first signal at the sampling timing of the second signal, Receiving three or more odd number of latch circuits that respectively output the first value or the second value, and the first value or the second value output by each of the odd number of latch circuits; When all of the odd number of latch circuits output the same value, the same value is output, and when at least one of the odd number of latch circuits outputs a different value, the first value and the first value The value of 2 is output An output circuit that outputs the smaller value and the first value or the second value output from each of the odd number of latch circuits, and the odd number of latch circuits all receive the same value. A period for which the odd number of latch circuits are in a metastable state based on a detection circuit that outputs a detection result indicating whether or not to output the signal, and the detection result and an output value of the output circuit A control circuit that adjusts the sampling timing within the period by changing the value of the adjustment signal based on a determination result of whether the sampling timing is within the period or not A random number generation circuit is provided.

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

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

第1の実施の形態の乱数生成回路の一例を示す図である。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, detection result match, and output value RND. サンプリングタイミングの調整例を示す図である。It is a figure which shows the example of adjustment of a sampling timing. サンプリングタイミングの調整処理の一例の流れを示すフローチャートである。It is a flowchart which shows the flow of an example of the adjustment process of a sampling timing. 図5の各処理についての一例を示すフローチャートである。It is a flowchart which shows an example about each process of FIG. 乱数生成回路の乱数生成時の各信号の時間変化の一例を示すタイミングチャートである。It is a timing chart which shows an example of the 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 capacitive circuit. サンプリングタイミングの設定例と負荷容量可変回路による負荷容量の設定例とを示す図である。It is a figure which shows the setting example of a sampling timing, and the setting example of the load capacity | capacitance by a load capacity variable circuit. 負荷容量の追加開始タイミングを図13のように決定したときのメタステーブル期間を示す図である。It is a figure which shows a metastable period when the addition start timing of load capacity | capacitance is determined like FIG. サンプリングタイミングと負荷容量の追加開始タイミングの設定処理の一例の流れを示すフローチャートである。It is a flowchart which shows the flow of an example of a setting process of a sampling timing and the addition start timing of load capacity. 図15の各処理についての一例を示すフローチャートである(その1)。16 is a flowchart illustrating an example of each process in FIG. 15 (part 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 illustrating an example of a random number generation circuit according to the first embodiment.

乱数生成回路10は、調整回路11a,11bを有する調整部11と、3つ以上の奇数個のラッチ回路12a1,12a2,…,12an、出力回路12b、検出回路12cを有する乱数生成部12と、制御回路13と、を有する。   The random number generation circuit 10 includes an adjustment unit 11 including adjustment circuits 11a and 11b, a random number generation unit 12 including three or more odd number of latch circuits 12a1, 12a2, ..., 12an, an output circuit 12b, and a detection circuit 12c. And a control circuit 13.

調整部11は、入力信号と調整信号とを受ける。以下では、入力信号は、クロック信号CLKであるものとして説明するが、クロック信号CLKに限定されるものではない。ただし、乱数の発生レートを上げるため、状態遷移(HレベルとLレベルの間での遷移)が頻繁に発生する信号を用いることが望ましい。   The adjustment unit 11 receives an input signal and an adjustment signal. In the following description, the input signal is described as being the clock signal CLK, but 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 that frequently causes state transition (transition between H level and L level).

クロック信号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 adjustment 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 adjustment 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 adjustment unit 11 includes adjustment circuits 11a and 11b. The adjustment circuit 11a outputs a data signal dt in which the phase of the clock signal CLK is adjusted based on the adjustment signal tsel1. The adjustment circuit 11b outputs a clock signal clk in which the phase of the clock signal CLK is adjusted based on the adjustment signal tsel2. The adjustment circuits 11a and 11b are variable delay circuits that can change the delay amount based on the values of the adjustment signals tsel1 and tsel2, for example. For example, when 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)に相当する。   Each of the latch circuits 12a1 to 12an receives the data signal dt and the clock signal clk, and outputs an H level or L level value based on the signal level of the data signal dt at the sampling timing based on the clock signal clk. The H level corresponds to, for example, a power supply voltage, and the L level corresponds to a reference potential (for example, 0 V).

出力回路12bは、ラッチ回路12a1〜12anのそれぞれが出力するHレベルの値またはLレベルの値を受ける。そして、出力回路12bは、ラッチ回路12a1〜12anの全てが同じ値を出力する場合、その値を出力する。ラッチ回路12a1〜12anのうちの少なくとも1つが異なる値を出力する場合、出力回路12bは、ラッチ回路12a1〜12anが出力するHレベルの値とLレベルの値のうち、出力される数が少ない方の値を出力する。   The output circuit 12b receives an H level value or an L level value output from each of the latch circuits 12a1 to 12an. 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 has a smaller number of outputs among the H level value and the L level value output by the latch circuits 12a1 to 12an. The value of is output.

たとえば、ラッチ回路12a1〜12anにおいて、Lレベルの値よりもHレベルの値が多く出力されている場合には、出力回路12bは、Lレベルの出力値RNDを出力する。逆にHレベルの値よりもLレベルの値が多く出力されている場合には、出力回路12bは、Hレベルの出力値RNDを出力する。   For example, when the latch circuits 12a1 to 12an output more H level values than L level values, the output circuit 12b outputs an 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 output number is more likely to be a random number (or eligibility as a random number) than the value with the larger output number. There is a high possibility that the value with the larger number of outputs is not the effect of metastability but the value output due to the effect of skew. When a value output due to the influence of skew is adopted as a random number, the value is biased and the quality as a random number is low.

検出回路12cは、ラッチ回路12a1〜12anのそれぞれが出力するHレベルの値またはLレベルの値を受ける。そして、検出回路12cは、ラッチ回路12a1〜12anの全てが同じ値を出力するか否かを示す検出結果matchを出力する。以下の説明では、ラッチ回路12a1〜12anの全てが同じ値を出力する場合、Hレベルの検出結果matchが出力され、ラッチ回路12a1〜12anのうちの少なくとも1つが異なる値を出力する場合、Lレベルの検出結果matchが出力されるものとする。   The detection circuit 12c receives an H level value or an L level value output from 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 of the latch circuits 12a1 to 12an output the same value, an 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 It is assumed that the detection result match 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 application specific integrated circuit (ASIC) or a field programmable gate array (FPGA). The control circuit 13 may be a processor as an arithmetic processing unit such as a CPU (Central Processing Unit) or a DSP (Digital Signal Processor). The processor executes a program stored in a memory such as a 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の値を変えて、サンプリングタイミングをメタステーブル期間内に調整する。   Based on the detection result match and the output value RND, the control circuit 13 determines that the sampling timing by the clock signal clk is within a period in which the latch circuits 12a1 to 12n are in the metastability state (metastable state) (within the metastable period). It is determined whether or not. The control circuit 13 adjusts the sampling timing within the metastable period by changing the values of the adjustment signals tsel1 and tsel2 based on the determination result.

図1には、データ信号dtがLレベルからHレベルに遷移するときの、クロック信号clkによるサンプリングタイミングの調整の一例が示されている。
サンプリングタイミングがタイミングt1のとき、ラッチ回路12a1〜12anは、全てLレベルの値を出力するため、出力回路12bは、Lレベルの出力値RNDを出力し、検出回路12cは、Hレベルの検出結果matchを出力する。このとき、制御回路13は、サンプリングタイミングがメタステーブル期間内ではないと判定し、データ信号dtに対してクロック信号clkの位相を遅らせるように、調整信号tsel1,tsel2の値を変える。たとえば、制御回路13は、調整信号tsel1の値を固定し、調整信号tsel2の値を増やし、調整回路11bでのクロック信号clkの遅延量を増加させることでクロック信号clkの位相を遅らせる。
FIG. 1 shows an example of adjustment of sampling timing by the clock signal clk when the data signal dt transitions from L level to H level.
Since the latch circuits 12a1 to 12an all output L level values when the sampling timing is timing t1, the output circuit 12b outputs the L level output value RND, and the detection circuit 12c detects the H level detection result. Outputs 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 fixes the value of the adjustment signal tsel1, increases the value of the adjustment signal tsel2, and delays the phase of the clock signal clk by 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 is, for example, timing t2 by delaying the phase of the clock signal clk. At timing t2, it is assumed that the signal level of the data signal dt is higher than that at the L level, and at least one of the latch circuits 12a1 to 12an outputs an H level value. At this time, an L level detection result match is output from the detection circuit 12c. However, since the latch circuits 12a1 to 12an still output more L level values than 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 is, for example, timing t3 by further delaying the phase of the clock signal clk. At the timing t3, the signal level of the data signal dt is in the vicinity of the middle between the L level and the H level, and among the latch circuits 12a1 to 12an, the one that outputs the L level value and the one that outputs the H level value are almost. Divide evenly. Therefore, the output circuit 12b outputs the L-level output value RND and the H-level output value RND with substantially the same probability. 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 the timings t1, t2, and t3, when the output value RND and the detection result match are obtained at the timing t3, similar to the timing t2. 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 previous timing (that is, timing t3) It is determined 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 timing t5, the latch circuits 12a1 to 12an all output H level values, so the output circuit 12b outputs the H level output value RND, and the detection circuit 12c detects 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 that the phase of the clock signal clk is advanced 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 is, for example, timing t4 by advancing the phase of the clock signal clk. At timing t4, it is assumed that the signal level of the data signal dt is lower than that at the H level, and at least one of the latch circuits 12a1 to 12an outputs an L level value. At this time, the 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 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 that the phase of the clock signal clk is advanced 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 is, for example, timing t3 by advancing the phase of the clock signal clk. At timing t3, as described above, the output circuit 12b outputs the L-level output value RND and the H-level output value RND with substantially the same probability. 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, the output value RND and the detection result match may be obtained at the timing t3, similar to the timing t4. In that case, the control circuit 13 further advances the phase of the clock signal clk, for example, and when the output value RND changes from the L level to the H level (timing t2), the previous timing (that is, timing t3) is It is determined 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に、メタスタビリティによる乱数を生成させる。
サンプリングタイミングの他の調整方法の例については、後述する。
Thereafter, the control circuit 13 supplies the values of the fixed adjustment signals tsel1 and tsel2 to the adjustment unit 11, and causes the random number generation unit 12 to generate random numbers based on metastability.
Examples of other adjustment methods of the sampling timing will be described later.

以上のように、第1の実施の形態の乱数生成回路10及びその制御方法では、ラッチ回路12a1〜12anの出力から得られる出力値RND、検出結果matchに基づいて、サンプリングタイミングがメタステーブル期間内であるか否かを判定できる。つまり、制御回路13は、ラッチ回路12a1〜12anがメタスタビリティ状態であるか否かを判定できる。そして、制御回路13は、その判定結果に基づいて、データ信号dtまたはクロック信号clkの位相を調整して、サンプリングタイミングをメタステーブル期間に合わせることができる。   As described above, in the random number generation circuit 10 and the control method thereof according to 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. 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 to adjust the sampling timing to the metastable period.

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

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

(第2の実施の形態)
図2は、第2の実施の形態の乱数生成回路の一例を示す図である。
乱数生成回路20は、調整回路21a,21bと、乱数生成部22と、制御回路23とを有する。
(Second Embodiment)
FIG. 2 is a diagram illustrating an example of a random number generation circuit according to the second embodiment.
The random number generation circuit 20 includes adjustment circuits 21 a and 21 b, 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 generator 22 includes latch circuits 22a1, 22a2, 22a3, inverter circuits 22b1, 22b2, 22b3, AND (logical product) circuits 22c1, 22c2, 22c3, 22c4, 22c5, and OR (logical sum) circuits 22d1, 22d2.

ラッチ回路22a1〜22a3は、それぞれ、データ信号dtを受けるデータ端子(“D”と表記されている)、クロック信号clkを受けるクロック端子(“CK”と表記されている)、出力端子(“Q”と表記されている)を有する。ラッチ回路22a1〜22a3は、第1の実施の形態の乱数生成回路10におけるラッチ回路12a1〜12anと同様の機能を有する。   Each of the latch circuits 22a1 to 22a3 includes a data terminal (denoted as “D”) that receives the data signal dt, a clock terminal (denoted as “CK”) that receives the clock signal clk, and an output terminal (“Q”). ”). The latch circuits 22a1 to 22a3 have the same function as the latch circuits 12a1 to 12an in the random 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, an output circuit 12b and a detection circuit in the random number generation circuit 10 of the first embodiment are configured by inverter circuits 22b1 to 22b3, AND circuits 22c1 to 22c5, and OR circuits 22d1 and 22d2. The same function as 12c is realized.

インバータ回路22b1は、ラッチ回路22a1の出力値の論理レベルを反転し、インバータ回路22b2は、ラッチ回路22a2の出力値の論理レベルを反転し、インバータ回路22b3は、ラッチ回路22a3の出力値の論理レベルを反転する。   Inverter circuit 22b1 inverts the logic level of the output value of latch circuit 22a1, inverter circuit 22b2 inverts the logic level of the output value of latch circuit 22a2, and inverter circuit 22b3 inverts the logic level of the output value of latch circuit 22a3. Invert.

AND回路22c1は、ラッチ回路22a1の出力値と、インバータ回路22b2の出力値と、インバータ回路22b3の出力値との論理積の演算結果を出力する。AND回路22c2は、ラッチ回路22a2の出力値と、インバータ回路22b1の出力値と、インバータ回路22b3の出力値との論理積の演算結果を出力する。AND回路22c3は、ラッチ回路22a3の出力値と、インバータ回路22b1の出力値と、インバータ回路22b2の出力値との論理積の演算結果を出力する。AND回路22c4は、ラッチ回路22a1〜22a3の出力値の論理積の演算結果を出力する。AND回路22c5は、インバータ回路22b1〜22b3の出力値の論理積の演算結果を出力する。   The AND circuit 22c1 outputs a logical product operation result of the output value of the latch circuit 22a1, the output value of the inverter circuit 22b2, and the output value of the inverter circuit 22b3. The AND circuit 22c2 outputs a logical product operation result of the output value of the latch circuit 22a2, the output value of the inverter circuit 22b1, and the output value of the inverter circuit 22b3. The AND circuit 22c3 outputs a logical product operation result of the output value of the latch circuit 22a3, the output value of the inverter circuit 22b1, and the output value of the inverter circuit 22b2. The AND circuit 22c4 outputs a logical product operation result of the output values of the latch circuits 22a1 to 22a3. The AND circuit 22c5 outputs a logical product operation result of the output values of the inverter circuits 22b1 to 22b3.

OR回路22d1は、AND回路22c1〜22c4の出力値の論理和の演算結果を出力する。OR回路22d2は、AND回路22c4,22c5の出力値の論理和の演算結果を出力する。   The OR circuit 22d1 outputs a logical sum operation result of the output values of the AND circuits 22c1 to 22c4. The OR circuit 22d2 outputs a logical sum operation result of the output values of the AND circuits 22c4 and 22c5.

OR回路22d1の出力値が乱数生成部22の出力値RNDであり、OR回路22d2の出力値が、ラッチ回路22a1〜22a3の全てが同じ値を出力するか否かを示す検出結果matchである。   The output value of the OR circuit 22d1 is the output value RND of the random number generator 22, and the output value of the OR circuit 22d2 is a detection result match indicating whether 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 according to 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. The control circuit 23 may output a signal ERR indicating an abnormal state when the output value RND is the same value for 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 illustrating an example relationship between the output value of each latch circuit, the detection result match, and the output value RND.
FIG. 3 shows the relationship between the output values of the latch circuits 22a1 to 22a3, the output value RND of the OR circuit 22d1, and the detection result match output from the OR circuit 22d2.

ラッチ回路22a1〜22a3の出力値が全てLレベルである場合、検出結果matchがHレベル、出力値RNDがLレベルになる。ラッチ回路22a1〜22a3の出力値のうち、2つがLレベル、1つがHレベルである場合、検出結果matchがLレベル、出力値RNDがHレベルになる。ラッチ回路22a1〜22a3の出力値のうち、2つがHレベル、1つがLレベルである場合、検出結果matchがLレベル、出力値RNDがLレベルになる。ラッチ回路22a1〜22a3の出力値が全てHレベルである場合、検出結果matchがHレベル、出力値RNDがHレベルになる。   When the output values of the latch circuits 22a1 to 22a3 are all at the L level, the detection result match is at the H level and the output value RND is at the L level. When two of the output values of the latch circuits 22a1 to 22a3 are L level and one is H level, the detection result match is L level and the output value RND is H level. When two of the output values of the latch circuits 22a1 to 22a3 are H level and one is L level, the detection result match is L level and the output value RND is L level. When the output values of the latch circuits 22a1 to 22a3 are all at the H level, the detection result match is at the H level and the output value RND is at the H level.

制御回路23は、これらの検出結果matchと出力値RNDとの組み合わせに基づいて、出力値RNDによる乱数の生成要因を判別できる。以下では、データ信号dtがLレベルからHレベルに遷移する際のメタステーブル期間内にサンプリングタイミングを調整する場合について説明する。   Based on the combination of the detection result match and the output value RND, the control circuit 23 can determine a random number generation factor based on the output value RND. Hereinafter, 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 indicates that the phase of the clock signal clk is advanced with respect to the data signal dt due to skew, and the sampling timing is not within the metastable period. Therefore, the random number generation factor is not a metastability but a skew. Skew is variation in delay time caused by noise due to voltage change or temperature change. When the output value RND as described above is obtained at each sampling timing, the output value RND is biased to an L level value, and a poor quality random number is obtained. For this reason, the control circuit 23 changes the values of the adjustment signals tsel1 and tsel2 (which may be either) 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 indicates that the phase of the clock signal clk is delayed with respect to the data signal dt due to skew, and the sampling timing is not within the metastable period. Therefore, the random number generation factor is not a metastability but a skew. When the output value RND as described above is obtained at each sampling timing, the output value RND is biased to an H level value, and a poor quality random number is obtained. Therefore, the control circuit 23 changes the values of the adjustment signals tsel1 and tsel2 (whichever is acceptable) 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 illustrating an example of adjusting the sampling timing.

図4には、データ信号dtがLレベルからHレベルに遷移するときの、サンプリングタイミングの調整例が4つ示されている。また、図4の例では、データ信号dtの信号レベルが電圧V1以下となる期間ta、データ信号dtの信号レベルが電圧V1より大きく、電圧V2未満となる期間tb、データ信号dtの信号レベルが電圧V2以上、電圧V3以下となる期間tcが示されている。さらに、データ信号dtの信号レベルが電圧V3より大きく、電圧V4未満となる期間td、データ信号dtの信号レベルが電圧V4以上となる期間teが示されている。電圧V1〜V4は、たとえば、ラッチ回路22a1〜22a3の特性に応じて決まる。期間ta〜teは、たとえば、電圧V1〜V4と、ラッチ回路22a1〜22a3のデータ端子の負荷容量に応じて決まる。   FIG. 4 shows four examples of adjusting the sampling timing when the data signal dt transitions from the L level to the H level. In the example of FIG. 4, the period ta in which the signal level of the data signal dt is equal to or lower than the voltage V1, the period tb in which the signal level of the data signal dt is higher than the voltage V1 and lower than the voltage V2, and the signal level of the data signal dt is A period tc in which the voltage is not less than V2 and not more than voltage V3 is shown. Further, a period td in which the signal level of the data signal dt is higher than the voltage V3 and lower than the voltage V4, and a period te in which the signal level of the data signal dt is equal to or higher than the voltage V4 are shown. The voltages V1 to V4 are determined according to the characteristics of the latch circuits 22a1 to 22a3, for example. The periods ta to te are determined according to, for example, the voltages V1 to V4 and the load capacitance of the data terminals of the latch circuits 22a1 to 22a3.

期間ta内にサンプリングタイミングが位置する場合、ラッチ回路22a1〜22a3の出力値は、全てLレベルとなる。期間tb内にサンプリングタイミングが位置する場合、ラッチ回路22a1〜22a3の出力値は、Lレベルになる可能性が高いが、メタスタビリティによって、ラッチ回路22a1〜22a3の少なくとも1つの出力値がHレベルになる場合がある。期間tc内にサンプリングタイミングが位置する場合、ラッチ回路22a1〜22a3は、メタスタビリティによって、Hレベルの出力値とLレベルの出力値をほぼ同じ確率で出力する。期間td内にサンプリングタイミングが位置する場合、ラッチ回路22a1〜22a3の出力値は、Hレベルになる可能性が高いが、メタスタビリティによって、ラッチ回路22a1〜22a3の少なくとも1つの出力値がLレベルになる場合がある。期間te内にサンプリングタイミングが位置する場合、ラッチ回路22a1〜22a3の出力値は、全てHレベルとなる。   When the sampling timing is located within the period ta, the output values of the latch circuits 22a1 to 22a3 are all at the L level. When the sampling timing is located within the period tb, the output values of the latch circuits 22a1 to 22a3 are likely to be at the L level, but at least one output value of the latch circuits 22a1 to 22a3 is at the H level due to metastability. There is a case. When the sampling timing is located within the period tc, the latch circuits 22a1 to 22a3 output the H level output value and the L level output value with substantially the same probability due to metastability. When the sampling timing is located within the period td, the output values of the latch circuits 22a1 to 22a3 are likely to be at the H level, but at least one output value of the latch circuits 22a1 to 22a3 is at the L level due to metastability. There is a case. When the sampling timing is located within the period te, the output values of the latch circuits 22a1 to 22a3 are all at the H level.

期間ta〜tcのうち、品質のよい乱数生成に適している期間は、ラッチ回路22a1〜22a3がメタスタビリティ状態となる期間tcである。そのため、制御回路23は、期間tcを、サンプリングタイミングを設定する目標の期間(設定目標期間)とし、たとえば、以下に示すような4つのタイミング設定方法でサンプリングタイミングを調整する。   Of the periods ta to tc, the period suitable for generating a high-quality random number is the period tc in which the latch circuits 22a1 to 22a3 are in the metastability state. For this reason, the control circuit 23 sets the period tc as a 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 this case, the control circuit 23 changes the values of the adjustment signals tsel1 and tsel2, and performs timing setting for delaying the phase of the clock signal clk with respect to the data signal dt.

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

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

クロック信号clkの位相を遅らせていくことで、検出結果matchがLレベル、出力値RNDがHレベルに変わると、制御回路23は、さらに、調整信号tsel1,tsel2の値を変え、データ信号dtに対してクロック信号clkの位相を遅らせる。検出結果matchがLレベル、出力値RNDがHレベルの場合、サンプリングタイミングは設定目標期間である期間tc内である可能性もあるが、期間tb内である可能性もあるためである。   By delaying the phase of the clock signal clk, when the detection result match is changed to the L level and the output value RND is changed to the H level, the control circuit 23 further changes the values of the adjustment signals tsel1 and tsel2 to the data signal dt. In contrast, the phase of the clock signal clk is delayed. This is because when the detection result match is L level and the output value RND is 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 L level and the output value RND changes to L level, it means that the sampling timing is within the period tc or the period td. For this reason, the control circuit 23 uses the values of the adjustment signals tsel1 and tsel2 that were used in the timing setting performed immediately before the timing setting performed this time, so that each subsequent sampling timing can be accurately set. 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, by delaying the phase of the clock signal clk in Method 1, the detection result match does not change to the L level and the detection result match does not change to the L level. This is performed when the output value RND changes to 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 the values of the adjustment signals tsel1 and tsel2 when the detection result match is H level and the output value RND is H level in the storage unit. 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 H level and the output value RND changes to L level. The control circuit 23 stores the values of the adjustment signals tsel1 and tsel2 when the detection result match is changed to the H level and the output value RND is changed to the L level in the storage unit.

制御回路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 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 values of the adjustment signals tsel1 and tsel2 that adjust the sampling timing to an intermediate timing between both timings based on the acquired value. For example, the control circuit 23 calculates the average of the values of the adjustment signals tsel1 and tsel2 at both timings, thereby determining the values of the adjustment signals tsel1 and tsel2 that match the sampling timing to the intermediate timing between the two timings.

そして、制御回路23は、求めた調整信号tsel1,tsel2の値を、以後、調整回路21a,21bに供給することで、以後の各サンプリングタイミングは期間tb〜tdのほぼ中央のタイミングとなる。つまり、サンプリングタイミングを、メタステーブル期間である設定目標期間内に合わせることができる。   Then, the control circuit 23 supplies the calculated values of the adjustment signals tsel1 and tsel2 to the adjustment circuits 21a and 21b thereafter, so that the subsequent sampling timings are substantially at the center of the periods tb to td. That is, the sampling timing can be adjusted within the set target period that 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 performs timing setting 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内である可能性もあるためである。   When the detection result match is changed to the L level and the output value RND is changed to the L level by advancing the phase of the clock signal clk, the control circuit 23 further changes the values of the adjustment signals tsel1, tsel2, and the data signal dt. Advances the phase of the clock signal clk. This is because when the detection result match is L level and the output value RND is L level, the sampling timing may be within the period tc, which is the set target period, or may 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 L level and the output value RND changes to H level, it means that the sampling timing is within the period tc or the period tb. For this reason, the control circuit 23 uses the values of the adjustment signals tsel1 and tsel2 that were used in the timing setting performed immediately before the timing setting performed this time, so that each subsequent sampling timing can be accurately set. It can be adjusted to the target period.

(方法4)方法4は、たとえば、方法3において、クロック信号clkの位相を進めていくことで、検出結果matchがLレベル、出力値RNDがHレベルに変わらずに、検出結果matchがHレベル、出力値RNDがLレベルに変わった場合に行われる。   (Method 4) In Method 4, for example, the phase of the clock signal clk is advanced in Method 3, so that the detection result match does not change to L level and the output value RND does not change to H level, and the detection result match is H level. This is performed when the output value RND changes to 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 the values of the adjustment signals tsel1 and tsel2 when the detection result match is changed to H level and the output value RND is changed to L level in the storage unit. 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 is changed to H level and the output value RND is changed to H level. The control circuit 23 stores the values of the adjustment signals tsel1 and tsel2 when the detection result match is changed to H level and the output value RND is changed to H level in the storage unit.

制御回路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 the H level and the output value RND becomes the H level and the timing when the detection result match becomes the H level and the output value RND becomes the L level. Obtained from the storage unit. Then, the control circuit 23 obtains values of the adjustment signals tsel1 and tsel2 that adjust the sampling timing to an intermediate timing between both timings based on the acquired value. For example, the control circuit 23 calculates the average of the values of the adjustment signals tsel1 and tsel2 at both timings, thereby determining the values of the adjustment signals tsel1 and tsel2 that match the sampling timing to the intermediate timing between the two timings.

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

以下、上記4つの方法を用いてサンプリングタイミングを調整する処理の流れをフローチャートで説明する。
図5は、サンプリングタイミングの調整処理の一例の流れを示すフローチャートである。
Hereinafter, the flow of processing for adjusting the sampling timing using the above four methods will be described with reference to flowcharts.
FIG. 5 is a flowchart showing an example of the flow of sampling timing adjustment processing.

制御回路23は、調整信号tsel1,tsel2の初期値を調整回路21a,21bに供給して調整回路21a,21bを初期化する(ステップS1)。
その後、制御回路23は、初期状態における調整回路21a,21bから出力されるデータ信号dt及びクロック信号clkを用いて乱数生成部22から出力される検出結果match及び出力値RNDを検出する。そして制御回路23は、検出結果match及び出力値RNDからサンプリングタイミングを含む期間を判定する(ステップS2)。
The control circuit 23 supplies 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).
Thereafter, the control circuit 23 detects the detection result match and the output value RND output from the random number generator 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 a 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 performs timing setting by the method 1 or the method 3 shown in FIG. 4 according to the determined period (step S3).
The control circuit 23 determines whether the sampling timing can be set within the metastable period by the timing setting by the method 1 or the method 3 (step S4). When the control circuit 23 determines that the above setting is possible, the control process ends.

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

図5のステップS1の初期化処理の例として、制御回路23は、調整信号tsel1,tsel2の初期値を調整回路21a,21bに供給して調整回路21a,21bにオフセット遅延を設定する(ステップS10)。これにより、データ信号dt及びクロック信号clkは、クロック信号CLKに対してオフセット遅延分、遅延した信号になる。   As an example of the initialization process in step S1 of FIG. 5, the control circuit 23 supplies initial values of the adjustment signals tsel1 and tsel2 to the adjustment circuits 21a and 21b to set an 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)。
The following process is performed as an example of the process of step S2 of FIG.
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 from the adjustment circuit 21a at the sampling timing based on the clock signal clk output from 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 from the random number generator 22 and the output value RND (step S12). When the detection result match is at the H level and the output value RND is at the 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では図示が省略されている。   If 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 this case, timing setting is performed 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)。
The following processing is performed as an example of the processing of steps S3 and S4 in FIG.
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 capture the data signal dt output from the adjustment circuit 21a at the sampling timing based on the clock signal clk output from 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 L level and the output value RND is L level (step S16).
When the detection result match is L level and the output value RND is L level, the sampling timing can be set within the metastable period by the timing setting of the method 1 in 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, tsel2 set in step S17 are stored in, for example, the storage unit, and thereafter the stored values are continuously set in the adjustment circuits 21a, 21b.

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

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

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

その後、制御回路23は、データ信号dtに対してクロック信号clkの位相を進ませるように調整信号tsel1,tsel2の値を変える(ステップS20)。
そして、調整回路21a,21bはクロック信号CLKを受け、ラッチ回路22a1〜22a3は、調整回路21aが出力するデータ信号dtを、調整回路21bが出力するクロック信号clkによるサンプリングタイミングで取り込む(ステップS21)。
Thereafter, the control circuit 23 changes the values of the adjustment signals tsel1 and tsel2 so that the phase of the clock signal clk is advanced 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 from the adjustment circuit 21a at the sampling timing based on the clock signal clk output from 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 H level and the output value RND is L level (step S22). If 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, 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に設定され続ける。   And the control circuit 23 acquires the value of adjustment signal tsel1, tsel2 memorize | stored by the process of step S19, S23 from a memory | storage part. Based on the acquired values, the values of the adjustment signals tsel1 and tsel2 for adjusting the sampling timing to the middle of the timings at which the determination processing in 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, tsel2 set in the process of step S24 are stored in, for example, the storage unit, and thereafter the stored values are continuously set in the adjustment circuits 21a, 21b.

図6では図示が省略されているが、ステップS12の処理で、サンプリングタイミングを含む期間が期間teと判定された場合、ステップS14〜S24のうち、ステップS14,S16,S18,S20,S22を以下のように変更した処理が行われる。   Although not shown in FIG. 6, when the period including the sampling timing is determined to be the period te in the process of step S <b> 12, steps S <b> 14, S <b> 16, S <b> 18, S <b> 20, and S <b> 22 will be described below from among steps S <b> 14 to S < The process changed as follows is performed.

まず、制御回路23は、ステップS14の処理の代わりに、データ信号dtに対してクロック信号clkの位相を進ませるように調整信号tsel1,tsel2を変更する処理を行う。   First, the control circuit 23 performs a process of changing the adjustment signals tsel1 and tsel2 so that the phase of the clock signal clk is advanced 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の処理を行う。   In addition, the control circuit 23 performs a process of determining whether or not the detection result match is L level and the output value RND is H level instead of the process of step S16. When the detection result match is L level and the output value RND is 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 process of step S18. Processing to determine whether or not. If the detection result match is at the H level and the output value RND is at the 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 that the phase of the clock signal clk is advanced with respect to the data signal dt. repeat.

また、制御回路23は、ステップS20の処理の代わりに、データ信号dtに対してクロック信号clkの位相を遅らせるように調整信号tsel1,tsel2を変更する処理を行う。   Further, 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 instead of the process of step S20.

また、制御回路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 process of step S22. When both the detection result match and the output value RND are at the 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 a time change of each signal when the random number generation circuit generates a random number.
FIG. 7 shows clock signals CLK and clk, data signal dt, output values of latch circuits 22a1 to 22a3, detection result match, output value RND, random number generation factor, control signal CTRL, adjustment signals tsel1, tsel2, and time of signal ERR. An example of the change is shown. In FIG. 7, the output values of the latch circuits 22a1 to 22a3 are schematically shown collectively.

クロック信号CLKの位相が調整回路21a,21bにて調整されることで、クロック信号clkとデータ信号dtが生成される。そして、図4〜図6に示した方法でクロック信号clkによるサンプリングタイミングが、メタステーブル期間内に調整されることで、ラッチ回路22a1〜22a3の出力値は、不定となる期間を経た後、HレベルまたはLレベルの値となる。   The clock signal clk and the data signal dt are generated by adjusting the phase of the clock signal CLK by the adjusting circuits 21a and 21b. 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 22 a 1 to 22 a 3 are changed to H after passing through an indefinite period. 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 according to changes in the output values of the latch circuits 22a1 to 22a3. As described above, the random number generation factor becomes metastability by adjusting the sampling timing by the clock signal clk within the metastable period.

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

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

上記のように制御回路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 tc which is a metastable period based on the detection result match and the output value RND. For this reason, the output value RND shown in FIG. 7 is a high-quality random number with reduced value deviation and the like.

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

第3の実施の形態の乱数生成回路30は、乱数生成部30a0,30a1,…,30ai,…,30anと、乱数生成部30a0〜30anのそれぞれに供給されるクロック信号clkの遅延量を異ならせる遅延回路30b1,30b2,…,30bnを有する。   The random number generation circuit 30 according to the third embodiment varies the delay amount of the clock signal clk supplied to each of the random number generation units 30a0, 30a1, ..., 30ai, ..., 30an and the random number generation units 30a0 to 30an. Delay circuits 30b1, 30b2,..., 30bn are included.

乱数生成部30a0は、第2の実施の形態の乱数生成回路20の乱数生成部22に含まれる要素の他に、ExOR(排他的論理和)回路31a0を有する。ExOR回路31a0は、OR回路22d1の出力値と、制御回路30cから供給される入力値R0との排他的論理和の演算結果を出力する。ExOR回路31a0の出力値は、後段の乱数生成部30a1のExOR回路31a1に入力値R0の代わりに供給される。   The random number generation unit 30a0 includes an ExOR (exclusive OR) circuit 31a0 in addition to the elements included in the random number generation unit 22 of the random number generation circuit 20 of the second embodiment. The ExOR circuit 31a0 outputs an exclusive OR operation result 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 at 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 one of the H level and the L level. When the random number generation circuit 30 is tested, the input value R0 may be changed.
The other random number generation units 30a1 to 30an are circuits similar to the random number generation unit 30a0.

このような乱数生成回路30では、最後段の乱数生成部30anのExOR回路31anの出力値が、出力値RNDとなる。また、乱数生成部30a0〜30anのそれぞれは、第2の実施の形態の乱数生成回路20の乱数生成部22が出力する検出結果match、出力値RNDに対応する検出結果及び出力値を制御回路30cに供給する。たとえば、乱数生成部30a0は、検出結果match0と出力値RND0を制御回路30cに供給する。   In such a random number generation circuit 30, the output value of the ExOR circuit 31an of the last-stage random number generation unit 30an becomes the output value RND. Each of the random number generation units 30a0 to 30an outputs the detection result match output from the random 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 to the control circuit 30c. To supply. 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, for example, adjusts the adjustment signal tsel1, based on the detection result matchi and the output value RNDi supplied from the random number generation unit 30ai whose delay with respect to the clock signal clk is an intermediate value among the random number generation units 30a0 to 30an. Determine the value of tsel2. The values of the adjustment signals tsel1 and tsel2 are determined by the method 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, the sampling timing in any of the random number generation units 30a0 to 30an is set to the metastable period even if a skew occurs due to a change in operating conditions or the like. The possibility of becoming inside increases. That is, the probability of random numbers generated by metastability can be increased.

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

第4の実施の形態の乱数生成回路40は、入力端子inとクロック端子ckと出力端子outとを備えたLFSR(Linear Feedback Shift Register)41を有する。
クロック端子ckには、クロック信号CLKが供給され、入力端子inには乱数生成部30anのExOR回路31anの出力値が供給される。出力端子outから乱数または擬似乱数である出力値RNDが出力される。
The random number generation circuit 40 according to the fourth embodiment includes an LFSR (Linear Feedback Shift Register) 41 having an input terminal in, a clock terminal ck, and an output terminal out.
The clock signal CLK is supplied to the clock terminal ck, and the output value of the ExOR circuit 31an of the random number generation unit 30an is supplied to the input terminal in. An output value RND that is a random number or a pseudo-random number is output from the output terminal out.

図10は、LFSRの一例を示す図である。
LFSR41は、16ビットシフトレジスタ41a、ExOR回路41b,41c,41d,41eを有する。
FIG. 10 is a diagram illustrating an example of the LFSR.
The LFSR 41 includes a 16-bit shift register 41a and ExOR circuits 41b, 41c, 41d, and 41e.

16ビットシフトレジスタ41aは、ExOR回路41bの出力値を、クロック端子ckに供給されるクロック信号CLKに同期したタイミングで取り込む。そして、16ビットシフトレジスタ41aは、“bit0”から“bit15”方向に、クロック信号CLKに同期したタイミングで1ビットずつシフトしていく。“bit0”〜“bit15”のそれぞれはレジスタを表している。   The 16-bit shift register 41a takes in the output value of the ExOR circuit 41b at a timing synchronized with the clock signal CLK supplied to the clock terminal ck. The 16-bit shift register 41a shifts bit by bit from “bit0” to “bit15” at a timing synchronized 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 an exclusive OR operation result 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 an exclusive OR operation result 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 an exclusive OR operation result of the output value of the register represented by “bit12” and the output value of the ExOR circuit 41c. The ExOR circuit 41e supplies an exclusive OR operation result of the output value of the register represented by “bit10” and the output value of the ExOR circuit 41d as a feedback signal to the ExOR circuit 41b.

ところで、ExOR回路41bを有さずに、ExOR回路41eの出力値を16ビットシフトレジスタ41aに入力するLFSRは、周期性をもつ擬似乱数を出力する。
これに対して、図10に示したLFSR41では、ExOR回路41bの一方の入力端子には、乱数生成部30anのExOR回路31anの出力値が供給される。擬似乱数の周期の間に、その出力値がメタスタビリティによる乱数となることで、LFSR41が出力する出力値RNDは、周期性をもたない乱数となる。つまり、出力値RNDが擬似乱数となることを回避できる。このため、品質のよい乱数を出力できる。
By the way, the LFSR that does not have the ExOR circuit 41b and inputs the output value of the ExOR circuit 41e to the 16-bit shift register 41a outputs a pseudo-random number having periodicity.
On the other hand, in the LFSR 41 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. Since the output value becomes a random number due to metastability during the period of the pseudo random number, the output value RND output from the LFSR 41 becomes a random number having no periodicity. That is, it can be avoided that the output value RND becomes a pseudo-random number. For this reason, random numbers with good quality can be output.

また、第3の実施の形態の乱数生成回路30では、クロック信号CLKの各周期でメタスタビリティによる乱数が出力しない可能性があるが、上記のようなLFSR41を有する乱数生成回路40は、クロック信号CLKの各周期で乱数を出力できる。つまり、乱数の発生レートを向上できる。   In the random number generation circuit 30 according to the third embodiment, random numbers due to metastability may not be output in each cycle of the clock signal CLK. However, the random number generation circuit 40 having the LFSR 41 as described above may Random numbers can be output at 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レベルとしてもよい。   When the output value RND output from the LFSR 41 is the same value as the predetermined number of cycles of the clock signal CLK, the control circuit 30c sets the signal ERR to the H level to notify the outside that it is in an abnormal state. Good. In addition, 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 LFSR 41 changes, and the output value is the same number of cycles of the clock signal CLK. Alternatively, 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 LFSR 41 may be combined so that the output value of the random number generation unit 22 is supplied to the input terminal in of the LFSR 41.
Further, the above LFSR 41 is an example and is not limited to the circuit configuration of FIG. For example, various modifications such as using a 32-bit shift register instead of the 16-bit shift register 41a are possible.

(第5の実施の形態)
ところで、メタステーブル期間は、長いほど、サンプリングタイミングを合わせることが容易になる。また、温度や、電圧ノイズなどによって、クロック信号clkとデータ信号dtにスキューが生じたとしても、メタステーブル期間が長ければ、サンプリングタイミングをメタステーブル期間内に維持できる可能性が高まる。
(Fifth embodiment)
By the way, the longer the metastable period, the easier it is to match the sampling timing. Further, even if the clock signal clk and the data signal dt are skewed due to temperature, voltage noise, or the like, if the metastable period is long, the possibility that the sampling timing can be maintained within the metastable period is increased.

以下では、メタステーブル期間を拡大可能な乱数生成回路を説明する。なお、以下に示す第5の実施の形態の乱数生成回路は、前述の第1乃至第4の実施の形態の乱数生成回路10,20,30,40とも組み合わせることができるが、組み合わせる例については後述する。   Hereinafter, a random number generation circuit capable of extending the metastable period will be described. The random number generation circuit of the fifth embodiment shown below can be combined with the random 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 illustrating an example of a random number generation circuit according to the fifth embodiment.
The random number generation circuit 50 includes an adjustment unit 51 including adjustment circuits 51 a and 51 b, a load capacitance variable circuit 52, a latch circuit 53, and a control circuit 54.

調整部51は、第1の実施の形態の乱数生成回路10における調整部11と同様の機能をする。なお、以下でも、入力信号は、クロック信号CLKであるものとして説明するが、クロック信号CLKに限定されるものではない。   The adjustment unit 51 has the same function as the adjustment unit 11 in the random number generation circuit 10 of the first embodiment. In the following description, it is assumed that the input signal is 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 adjustment 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 adjustment 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 capacitance circuits 52c1 to 52cn.

バッファ52aは、データ信号dtの波形を鈍らせ、データ信号dtを遅延させたデータ信号dtoを出力する。
遅延選択回路52bは、データ信号dtと選択信号cselとに基づいたタイミングで、容量回路52c1〜52cnを有効にして負荷容量を追加する。
The buffer 52a outputs a data signal dto obtained by blunting the waveform of the data signal dt and delaying the data signal dt.
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 capacitor circuits 52c1 to 52cn are connected to a 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 based on the clock signal clk.

制御回路54は、たとえば、ASICやFPGAなどの特定用途の電子回路である。また、制御回路54は、CPUやDSPなどの演算処理装置としてのプロセッサであってもよい。プロセッサは、RAMなどのメモリに記憶されたプログラムを実行する。なお、制御回路54は、複数のプロセッサの集合であってもよい。   The control circuit 54 is a specific purpose electronic circuit such as an ASIC or FPGA. The control circuit 54 may be a processor as an arithmetic processing unit such as a CPU or a DSP. The processor executes a program stored in a memory such as a 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, tsel2 and the selection signal csel based on the output value RND. The control circuit 54 may be controlled from the outside of the random number generation circuit 50 by the control signal CTRL. 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 illustrating an example of the delay selection circuit and the capacitor circuit.
The delay selection circuit 52b includes delay circuits 60a1, 60a2, ..., 60am, a selection circuit 60b, delay circuits 60c1 to 60c (n-1), OR circuits 60d1, 60d2, ..., 60dn, AND circuits 60e1, 60e2, ..., 60en. Have

遅延回路60a1〜60amは、直列に接続されており、先頭の遅延回路60a1には、データ信号dtが供給される。遅延回路60a1〜60amのそれぞれで遅延されたデータ信号dtが、データ信号dt1〜dtmとして選択回路60bに供給される。   The delay circuits 60a1 to 60am are connected in series, and the data signal dt is supplied to the head delay circuit 60a1. The data signal dt delayed by each of the delay circuits 60a1 to 60am is supplied to the 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 signal 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 the data signal dts is supplied to the head delay circuit 60c1. The data signal dts delayed by each of the delay circuits 60c1 to 60c (n-1) is supplied to one input terminal of the OR circuits 60d2 to 60dn.

OR回路60d1の一方の入力端子にはデータ信号dtsが供給される。OR回路60d1〜60dnの他方の入力端子には、信号ctonが供給される。OR回路60d1〜60dnの出力信号は、AND回路60e1〜60enの一方の入力端子に供給される。   The data signal dts is supplied to one input terminal of the OR circuit 60d1. The signal cton is supplied to the other input terminals of the OR circuits 60d1 to 60dn. The output signals of the OR circuits 60d1 to 60dn are supplied to one input terminal of the AND circuits 60e1 to 60en.

AND回路60e1〜60enの他方の入力端子には、信号ctoffが供給される。AND回路60e1〜60enの出力信号は、容量回路52c1〜52cnに供給される。信号cton,ctoffは、選択信号cselに含まれる信号である。   A signal ctoff is supplied to the other input terminals of the AND circuits 60e1 to 60en. Output signals of the AND circuits 60e1 to 60en are supplied to the capacitor circuits 52c1 to 52cn. The signals cton and ctoff are signals included in the selection signal csel.

容量回路52c1は、インバータ回路61、トランジスタ62,63,64、キャパシタ65を有する。トランジスタ62,63は、nチャネル型MOSFET(Metal-Oxide-Semiconductor Field-Effect Transistor)であり、トランジスタ64は、pチャネル型MOSFETである。   The capacitor circuit 52c1 includes an inverter circuit 61, transistors 62, 63, and 64, and a capacitor 65. The transistors 62 and 63 are n-channel MOSFETs (Metal-Oxide-Semiconductor Field-Effect Transistors), and the transistor 64 is a p-channel MOSFET.

インバータ回路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 terminals 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 the source terminal of the transistor 63, the drain terminal of the transistor 64, and one terminal of the capacitor 65. The drain terminal of the transistor 63 and the source terminal of the transistor 64 are connected to a 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 capacitor circuits 52c2 to 52cn are similar to the capacitor circuit 52c1.
When the signals cton and ctoff are both at the H level, the output values of the AND circuits 60e1 to 60en are also at the H level. When the output values of the AND circuits 60e1 to 60en are at the H level, the transistor 62 is turned off and the transistors 63 and 64 are turned on, so that the capacitor 65 is electrically connected to the wiring through which the data signal dto propagates. . That is, the capacitance circuits 52c1 to 52cn are effective.

信号ctoffがLレベルの場合、信号ctonの値にかかわらず、AND回路60e1〜60enの出力値もLレベルとなる。AND回路60e1〜60enの出力値がLレベルとなるとき、トランジスタ62がオン状態、トランジスタ63,64がオフ状態となるため、キャパシタ65は、データ信号dtoが伝搬する配線から電気的に切断される。つまり、容量回路52c1〜52cnは無効になる。   When the signal ctoff is at the L level, the output values of the AND circuits 60e1 to 60en are also at the L level regardless of the value of the signal cton. When the output values of the AND circuits 60e1 to 60en are at the L level, the transistor 62 is 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 capacitance circuits 52c1 to 52cn are disabled.

信号ctonがLレベルで、信号ctoffがHレベルの場合、データ信号dtsがHレベルに遷移するときに、AND回路60e1〜60enの出力値が順番にHレベルとなる。これにより、容量回路52c1〜52cnは容量回路52c1から順番に有効になる。   When the signal cton is at the L level and the signal ctoff is at the H level, the output values of the AND circuits 60e1 to 60en sequentially become the H level when the data signal dts transitions to the H level. As a result, the capacitance circuits 52c1 to 52cn become effective in order from the capacitance circuit 52c1.

図13は、サンプリングタイミングの設定例と負荷容量可変回路による負荷容量の設定例とを示す図である。電圧範囲Vmetは、ラッチ回路53がメタスタビリティ状態となるデータ信号dtoの電圧範囲である。   FIG. 13 is a diagram illustrating an example of setting the sampling timing and an example of setting the load capacitance by the load capacitance variable circuit. The voltage range Vmet is a voltage range of the data signal dto in which the latch circuit 53 is in a 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 does not add a load capacitance. 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の値を、図示しない記憶部に記憶させる。   Thereafter, the control circuit 54 sets both the signals ctoff and cton shown in FIG. 12 to the H level, enables the capacitance circuits 52c1 to 52cn, and adds the load capacitance. Then, similarly to the above, the control circuit 54 changes the adjustment signals tsel1 and tsel2, for example, and delays 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 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, based on the stored values of the adjustment signals tsel1 and tsel2, 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). 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 the storage unit, for example.

なお、クロック信号clkの位相をデータ信号dtoよりも遅らせた状態から、クロック信号clkの位相を進めていき、出力値RNDが変化するタイミングの調整信号tsel1,tsel2を用いて、サンプリングタイミングt11を決定してもよい。   The phase of the clock signal clk is advanced from the state in which the phase of the clock signal clk is delayed from that of the data signal dto, and the sampling timing t11 is determined using the adjustment signals tsel1 and tsel2 of the timing at which the output value RND changes. May be.

次に、制御回路54は、調整信号tsel1,tsel2の値を変えて、再びサンプリングタイミングをタイミングt10に合わせる。そして、制御回路54は、図13に示すように、信号ctoffをHレベルにし、信号ctonをLレベルにした状態で、信号ct0〜ctmを変化させて、負荷容量の追加を開始するタイミングを、早めていく。波形66aは、負荷容量の追加開始タイミングを最も遅らせた場合のデータ信号dtoの変化を示し、波形66bは、負荷容量の追加開始タイミングを最も早くした場合のデータ信号dtoの変化を示す。負荷容量は、遅延回路60c1〜60c(n−1)によって、段階的に増加する。   Next, the 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 and changes the signal ct0 to ctm in a state where the signal ctoff is set to the H level and the signal cton is set to the L level. I'll speed up. A waveform 66a shows a change in the data signal dto when the load capacitor addition start timing is most delayed, and a waveform 66b shows a change in the data signal dto when the load capacitor addition start timing is earliest. The load capacity is increased stepwise 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 based on 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 additional start timing 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 load capacity addition start timing is determined as shown in FIG. In addition to the metastable period tm1 of the waveform 66c shown in FIG. 13, FIG. 14 shows the metastable period tm2 when there is no load capacity addition shown in FIG. 13 and the case where the load capacity is always added. The metastable period tm3 is also illustrated.

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

これに対して、負荷容量の追加開始タイミングを図13のように決定して得られる波形66cでは、データ信号dtoの立ち上がりが開始してから電圧範囲Vmetに入るまでの期間が常に負荷容量を追加している場合と比べて短くなる。この結果、メタステーブル期間tm1を、同じ負荷容量を常に追加する場合のメタステーブル期間tm3よりも長くすることができる。   On the other hand, in the waveform 66c obtained by determining the load capacitor 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 voltage range Vmet. It becomes shorter than the case where it is doing. 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の数や容量値などのパラメータは、たとえば、回路シミュレーションなどで計算された結果に基づいて決定される。たとえば、回路シミュレーションの際には、調整精度や設定するメタステーブル期間をどれだけ長くするかに応じて上記のパラメータが決定される。   The parameters such as the number and delay time of the delay circuits 60a1 to 60am and 60c1 to 60c (n-1) and the number and capacitance value of the capacitor circuits 52c1 to 52cn shown in FIG. 12 are calculated by circuit simulation, for example. It is determined based on the result. For example, in the circuit simulation, the above parameters are determined depending on how long the adjustment accuracy and the metastable period to be set are increased.

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

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

その後、制御回路54は、調整信号tsel1,tsel2を変えて、クロック信号clkの位相を遅らせていく(サンプリングタイミングを変える)。そして、制御回路54は、出力値RNDを検出し、出力値RNDがLレベルからHレベルに変化するタイミングに設定した調整信号tsel1,tsel2の値を、記憶部に記憶させる(ステップS31)。   Thereafter, 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 initial values of the adjustment signals tsel1 and tsel2 for setting the phase of the clock signal clk ahead of the data signal dto in the state where the load capacitance is added, and the adjustment circuits 51a and 51b are output. Initialization is performed (step S32).

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

その後、制御回路54は、入力負荷の追加開始タイミングを設定する(ステップS35)。
図16及び図17は、図15の各処理についての一例を示すフローチャートである。
Thereafter, the control circuit 54 sets the input load addition start timing (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 in step S30 of FIG. 15, as shown in FIG. 16, the control circuit 54 firstly has a signal ct0 to ctm = “X”, a signal cton = “X”, and a signal ctoff = “L” ( L level) (step S40). “X” represents that it may be at the H level or the L level. Further, the control circuit 54 sets initial values of the adjustment signals tsel1 and tsel2 that advance the phase of the clock signal clk relative to 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 in step S31 in FIG. 15, the processes in steps S42 to S45 in FIG. 16 are performed.
The adjustment circuits 51a and 51b receive the clock signal CLK and output a data signal dt and a 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 from the variable load capacitance circuit 52 at the sampling timing based on 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 at the 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 at the H level, the control circuit 54 stores the values of the adjustment signals tsel1, tsel2 set at the current sampling timing (for example, 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 in step S32 of FIG. 15, as shown in FIG. 16, the control circuit 54 performs signals ct0 to ctm = “X”, signal cton = “H” (H level), signal ctoff. = "H" is set (step S46). Further, the control circuit 54 sets initial values of the adjustment signals tsel1 and tsel2 that advance the phase of the clock signal clk relative to 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)が、負荷容量を追加しない場合と異なる。   And the process of FIG.16 S48-S51 is performed as an example of the process of FIG.15 S33. The process of steps S48 to S51 is the same as the process of steps S42 to S45. However, the sampling timing at which the output value RND becomes H level (for example, timing t12 in FIG. 13) is different from the case where no load capacitance is added.

その後、図15のステップS34の処理の例として、以下の処理が行われる。
制御回路54は、サンプリングタイミングを、ステップS43,S49の処理で出力値RNDがHレベルになる各サンプリングタイミングの中間とする調整信号tsel1,tsel2の値を決定し、記憶部に記憶させる(ステップS52)。ステップS52の処理では、制御回路54は、ステップS45,S51の処理で記憶された調整信号tsel1,tsel2の値に基づいて、サンプリングタイミングを、たとえば、図13の、タイミングt11とする調整信号tsel1,tsel2を決定する。そして、制御回路54は、決定した調整信号tsel1,tsel2を記憶部に記憶させる。
Thereafter, the following processing is performed as an example of the processing in step S34 in FIG.
The control circuit 54 determines the values of the adjustment signals tsel1 and tsel2 that make the sampling timing intermediate between the sampling timings 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 adjusts the sampling timing to the timing t11 in FIG. 13, for example, 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, steps S53 to S58 in FIG. 17 are performed as an example of step S35 in FIG.
The control circuit 54 sets the signals 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 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)。   Thereafter, 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 from the load capacitance variable circuit 52 at the sampling timing based on 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). If the output value RND is not at the L level, the control circuit 54 sets the signals ct0 to ctm to the H level sequentially 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 the values of the signals ct0 to ctm are all at the L level, the selection circuit 60b in FIG. 12 selects the data signal dtm having the longest delay time from the data signals dt to dtm and outputs it as the data signal dts. . When output value RND remains at the H level, control circuit 54 changes the value of signal ctm to the H level. Thereby, the selection circuit 60b selects the data signal having the second largest delay time from the data signals dt to dtm and outputs the data signal 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. Thereby, the selection circuit 60b selects the data signal with the third largest delay time from the data signals dt to dtm and outputs the data signal as the data signal dts. The control circuit 54 repeats such processing until the output value RND changes to the L level.

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

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

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

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

第6の実施の形態の乱数生成回路70は、ラッチ回路71a0,71a1,71a2,…,71an、遅延回路71b1,71b2,…,71bn、ExOR回路71c0,71c1,71c2,…,71cn、制御回路71dを有する。   The random number generation circuit 70 of the sixth embodiment includes latch circuits 71a0, 71a1, 71a2, ..., 71an, delay circuits 71b1, 71b2, ..., 71bn, ExOR circuits 71c0, 71c1, 71c2,. Have

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

また、ExOR回路71c0〜71cnは直列に接続されており、ExOR回路71c0〜71cnのそれぞれの一方の入力端子には、ラッチ回路71a0〜71anのうち対応するラッチ回路の出力値が供給される。ExOR回路71c1〜71cnのそれぞれの他方の入力端子には、前段のExOR回路の出力値が供給される。初段のExOR回路71c0の他方の入力端子には、入力値R0が供給される。   Further, the ExOR circuits 71c0 to 71cn are connected in series, and the output value of the corresponding latch circuit among the latch circuits 71a0 to 71an is supplied to one input terminal of each of the ExOR circuits 71c0 to 71cn. The output value of the previous ExOR circuit is supplied to the other input terminal of each of the ExOR circuits 71c1 to 71cn. The input value R0 is supplied to the other input terminal of the first-stage ExOR circuit 71c0.

なお、乱数生成時には、入力値R0は、HレベルまたはLレベルの一方に固定される。乱数生成回路70の試験時には、入力値R0は変更されてもよい。最後段のExOR回路71cnの出力値が、出力値RNDとなる。また、ラッチ回路71a0〜71anの出力値は、制御回路71dに供給される。   At the time of random number generation, the input value R0 is fixed to one of the H level and the L level. When the random number generation circuit 70 is tested, the input value R0 may be changed. The output value of the final-stage ExOR circuit 71cn becomes the output value RND. The output values of the latch circuits 71a0 to 71an are supplied to the control circuit 71d.

制御回路71dは、たとえば、クロック信号clkに対する遅延がラッチ回路71a0〜71anのうちで中間の値となるラッチ回路から供給される出力値に基づいて、図15に示した処理で、調整信号tsel1,tsel2や選択信号cselの値を決定する。   For example, the control circuit 71d performs the adjustment signal tsel1, in the 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 71a0 to 71an. The values of tsel2 and selection signal csel are 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, the sampling timing in any of the latch circuits 71a0 to 71an is within the metastable period even if a skew occurs due to a change in operating conditions or the like. The possibility that becomes. That is, the probability of random numbers generated by metastability can be increased.

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

第7の実施の形態の乱数生成回路80は、入力端子inとクロック端子ckと出力端子outとを備えたLFSR81を有する。
クロック端子ckには、クロック信号CLKが供給され、入力端子inには最後段のExOR回路71cnの出力値が供給される。出力端子outから乱数または擬似乱数である出力値RNDが出力される。
The random number generation circuit 80 according to the seventh embodiment includes an LFSR 81 having an input terminal in, a clock terminal ck, and an output terminal out.
A clock signal CLK is supplied to the clock terminal ck, and an output value of the ExOR circuit 71cn at the last stage is supplied to the input terminal in. An output value RND that is a random number or a pseudo-random number is output from the output terminal out.

LFSR81は、たとえば、図10に示したLFSR41と同じ回路で実現できる。擬似乱数の周期の間に、ExOR回路71cnの出力値がメタスタビリティによる乱数となることで、LFSR81が出力する出力値RNDは、周期性をもたない乱数となる。つまり、出力値RNDが擬似乱数となることを回避できる。このため、品質のよい乱数を出力できる。   The LFSR 81 can be realized by the same circuit as the LFSR 41 shown in FIG. 10, for example. The output value RND output from the LFSR 81 becomes a random number having no periodicity because the output value of the ExOR circuit 71cn becomes a random number due to metastability during the period of the pseudo random number. That is, it can be avoided that the output value RND becomes a pseudo-random number. For this reason, random numbers with good quality can be output.

また、第6の実施の形態の乱数生成回路70では、クロック信号CLKの各周期でメタスタビリティによる乱数が出力しない可能性があるが、上記のようなLFSR81を有する乱数生成回路80は、クロック信号CLKの各周期で乱数を出力できる。つまり、乱数の発生レートを向上できる。   In the random number generation circuit 70 of the sixth embodiment, random numbers due to metastability may not be output in each cycle of the clock signal CLK. However, the random number generation circuit 80 having the LFSR 81 as described above may Random numbers can be output at 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レベルとしてもよい。   When the output value RND output from the LFSR 81 is the same value as the predetermined number of cycles of the clock signal CLK, the control circuit 71d sets the signal ERR to the H level to notify the outside that the state is abnormal. Good. Also, the control circuit 71d detects whether or not the output value of the ExOR circuit 71cn supplied to the input terminal in of the LFSR 81 changes, and when the output value is the same number of cycles of the clock signal CLK, May set the signal ERR to the 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 of the fifth embodiment and the LFSR 81 may be combined to supply the output value of the latch circuit 53 to the input terminal in of the LFSR 81.
(Eighth embodiment)
FIG. 20 is a diagram illustrating an example of a random number generation circuit according to the eighth embodiment. 20, the same reference numerals are given to the same elements as those of the random number generation circuit 30 of the third embodiment shown in FIG. 8 and the random number generation circuit 50 of the fifth embodiment shown in FIG. .

第8の実施の形態の乱数生成回路90は、第3の実施の形態の乱数生成回路30に、負荷容量可変回路52を適用した回路である。
乱数生成部30a0〜30anには、データ信号dtではなく、負荷容量可変回路52が出力するデータ信号dtoが供給されることが、乱数生成回路30と異なっている。
A random number generation circuit 90 according to the eighth embodiment is a circuit in which a load capacitance variable circuit 52 is applied to the random number generation circuit 30 according to the third embodiment.
Unlike the random number generation circuit 30, the random number generation units 30a0 to 30an are supplied with the data signal dto output from the load capacitance variable circuit 52 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の値を記憶する。   For example, based on the output value RNDi supplied from the random number generation unit 30ai in which the delay with respect to the clock signal clk is an intermediate value among the random number generation units 30a0 to 30an, the control circuit 91 first adds the load capacitor addition start timing. To decide. For example, the control circuit 91 first sets the load capacitance variable circuit 52 in a state in which no load capacitance is added according to the selection signal csel, changes the values of the adjustment signals tsel1, tsel2, and the output value RNDi changes from the L level. The timing to change to the H level is detected. Then, the control circuit 91 uses the values of the adjustment signals tsel1, tsel2 at that timing to advance the load capacitor addition start timing 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によるサンプリングタイミングがメタステーブル期間内になるように決定される。   Thereafter, the control circuit 91 supplies the stored value of the selection signal csel to the load capacitance variable circuit 52, and increases the load capacitance stepwise 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 method 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. Furthermore, since the random number generation circuit 90 includes the load capacitance variable circuit 52, the metastable period can be expanded, so that the possibility that the sampling timing can be maintained within the metastable period is increased. As a result, a random number with higher quality can be generated.

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

(第9の実施の形態)
図21は、第9の実施の形態の乱数生成回路の一例を示す図である。図21において、図9に示した第4の実施の形態の乱数生成回路40及び、図20に示した第8の実施の形態の乱数生成回路90と同じ要素については同一符号が付されている。
(Ninth embodiment)
FIG. 21 is a diagram illustrating an example of a random number generation circuit according to the ninth embodiment. In FIG. 21, the same elements as those of the random number generation circuit 40 of the fourth embodiment shown in FIG. 9 and the random number generation circuit 90 of the eighth embodiment shown in FIG. .

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

なお、説明を省略するが、負荷容量可変回路52は、第1の実施の形態の乱数生成回路10や、第2の実施の形態の乱数生成回路20に適用できることは、いうまでもない。
以上説明した第1乃至第9の実施の形態の乱数生成回路10,20,30,40,50,70,80,90,100は、乱数を用いる様々な集積回路、システム及び機器などに適用可能である。たとえば、セキュリティ分野における乱数を用いた暗号キーの生成、AI(Artificial Intelligence)分野における乱数を用いたディープラーニングでの過学習を防ぐドロップアウト処理などに利用可能である。さらに、乱数が利用されるビッグデータ解析にも利用可能である。
Needless to say, the load 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, although the description is omitted.
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 that use random numbers. It is. For example, it can be used for generating a cryptographic key using random numbers in the security field, dropout processing for preventing overlearning in deep learning using random numbers in the AI (Artificial Intelligence) field, and the like. Furthermore, it can be used for big data analysis in which random numbers are used.

以上、実施の形態に基づき、本発明の乱数生成回路及びその制御方法の一観点について説明してきたが、これらは一例にすぎず、上記の記載に限定されるものではない。   As described above, one aspect of the random number generation circuit and the control method thereof according to the present invention has been described based on the embodiment, but these are only examples and are not limited to the above description.

10 乱数生成回路
11 調整部
11a,11b 調整回路
12 乱数生成部
12a1〜12an ラッチ回路
12b 出力回路
12c 検出回路
13 制御回路
CLK,clk クロック信号
dt データ信号
match 検出結果
tsel1,tsel2 調整信号
RND 出力値
DESCRIPTION OF SYMBOLS 10 Random number generation circuit 11 Adjustment part 11a, 11b Adjustment circuit 12 Random number generation part 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の値を受け、前記奇数個のラッチ回路の全てが前記同じ値を出力するか否かを示す検出結果を出力する検出回路と、
前記検出結果と前記出力回路の出力値とに基づいて、前記サンプリングタイミングが、前記奇数個のラッチ回路が準安定状態となる期間内であるか否かを判定し、前記サンプリングタイミングが前記期間内であるか否かの判定結果に基づいて、前記調整信号の値を変えて、前記サンプリングタイミングを前記期間内に調整する制御回路と、
を有する乱数生成回路。
The input signal and the adjustment signal are received, and the first signal and the second signal are output based on the input signal, and the first signal or the second signal is output based on the adjustment signal. An adjustment unit for adjusting the phase;
Receiving the first signal and the second signal, respectively outputting a first value or a second value based on a signal level of the first signal at a sampling timing by the second signal; Three or more odd number of latch circuits;
When each of the odd number of latch circuits receives the first value or the second value output, and all the odd number of latch circuits output the same value, the same value is output, and the odd number An output circuit that outputs a smaller value of the first value and the second value when at least one of the plurality of latch circuits outputs a different value;
Each of the odd number of latch circuits receives the first value or the second value, and outputs a detection result indicating whether all of the odd number of latch circuits output the same value. A detection circuit;
Based on the detection result and the output value of the output circuit, it is determined whether the sampling timing is within a period in which the odd number of latch circuits are in a metastable state, and the sampling timing is within the period. A control circuit that adjusts the sampling timing within the period by changing the value of the adjustment signal based on the determination result of whether or not
A random number generating circuit.
前記制御回路は、前記奇数個のラッチ回路の全てが前記同じ値を出力する状態において、前記調整信号の値を変えることで、前記第1の信号に対して前記第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. Determining whether or not the sampling timing is within the period based on the detection result and the change in the output value of the output circuit at an earlier stage;
The random number generation circuit according to claim 1.
前記制御回路は、前記奇数個のラッチ回路の全てが前記第2の値を出力する状態になるまで、前記調整信号の値を変えた後、前記奇数個のラッチ回路の全てが前記第1の値を出力する状態になるまで、前記調整信号の値を変え、
前記制御回路は、前記奇数個のラッチ回路の全てが前記第2の値を出力する状態になった第1のタイミングにおける前記調整信号の値と、前記奇数個のラッチ回路の全てが前記第1の値を出力する状態になった第2のタイミングにおける前記調整信号の値とに基づいて、前記第1のタイミングと前記第2のタイミングの中間である前記期間内の第3のタイミングに前記サンプリングタイミングを調整する、
請求項1または2に記載の乱数生成回路。
The control circuit changes the value of the adjustment signal until all of the odd number of latch circuits output the second value, and then all of the odd number of latch circuits have the first value. Change the value of the adjustment signal until the value is output.
The control circuit includes a value of the adjustment signal at a first timing when all of the odd number of latch circuits are in a state of outputting the second value, and all of the odd number of latch circuits are the first value. Based on the value of the adjustment signal at the second timing at which the value is output, the sampling is performed at a third timing within the period that is intermediate between the first timing and the second timing. Adjust the timing,
The random number generation circuit according to claim 1 or 2.
前記奇数個のラッチ回路と、前記出力回路と、前記検出回路と、前記出力回路の前記出力値と第1の入力値との排他的論理和の演算結果を出力する第1の排他的論理和回路と、をそれぞれが有する複数段直列に接続された複数の乱数生成部と、
前記複数の乱数生成部のそれぞれに供給される前記第2の信号の遅延量を異ならせる遅延回路と、を有し、
前記複数の乱数生成部のうちの初段の乱数生成部の、前記第1の排他的論理和回路に供給される前記第1の入力値は、前記制御回路が出力する前記第1の値または前記第2の値の一方であり、
前記複数の乱数生成部のうちの2段目以降の乱数生成部の、前記第1の排他的論理和回路に供給される前記第1の入力値は、前段の乱数生成部の前記第1の排他的論理和回路が出力する前記演算結果である、
請求項1乃至3の何れか一項に記載の乱数生成回路。
A first exclusive OR that outputs an operation result of an exclusive OR of the output value of the output circuit and the first input value of the odd number of latch circuits, the output circuit, the detection circuit, and the output circuit. A plurality of random number generators connected in series in a plurality of stages each having a circuit;
A delay circuit that varies a delay amount of the second signal supplied to each of the plurality of random number generation units,
The first input value supplied to the first exclusive OR circuit of the first stage random number generation unit of the plurality of random number generation units is the first value output from the control circuit or the first value One of the second values,
The first input value supplied to the first exclusive OR circuit of the second and subsequent random number generation units of the plurality of random number generation units is the first input value of the random number generation unit of the previous stage. The operation result output by the exclusive OR circuit;
The random number generation circuit according to claim 1.
前記入力信号に同期して第2の入力値を取り込む複数ビットのシフトレジスタを含む線形帰還シフトレジスタを、さらに有し、
前記線形帰還シフトレジスタは、前記出力回路の前記出力値または前記出力値に基づいた値と、前記複数ビットのうちの一部のビットの排他的論理和により生成されるフィードバック信号との排他的論理和である前記第2の入力値を出力する第2の排他的論理和回路を有する、
請求項1乃至4の何れか一項に記載の乱数生成回路。
A linear feedback shift register including a multi-bit shift register that captures a second input value in synchronization with the input signal;
The linear feedback shift register includes an exclusive logic of the output value of the output circuit or a value based on the output value and a feedback signal generated by exclusive OR of some bits of the plurality of bits. A second exclusive OR circuit that outputs the second input value that is a sum;
The random number generation circuit according to any one of claims 1 to 4.
前記制御回路が出力する選択信号を受け、前記選択信号に基づいて決定される開始タイミングから、前記奇数個のラッチ回路において前記第1の信号が供給される端子の負荷容量を段階的に増加させる負荷容量可変回路を、さらに有する請求項1乃至5の何れか一項に記載の乱数生成回路。   The selection signal output from the control circuit is received, and the load capacitance of the terminal to which the first signal is supplied in the odd number of latch circuits is increased stepwise from the start timing determined based on the selection signal. The random number generation circuit according to claim 1, further comprising a load capacitance variable circuit. 前記制御回路は、前記調整信号を、前記出力回路の前記出力値が前記第1の値から前記第2の値に変化したときの第5の値に固定した状態で、前記選択信号の値を変えて、前記開始タイミングを早めていき、前記出力値が前記第2の値から前記第1の値に変化したときの前記選択信号の第6の値により、前記開始タイミングを決定する、
請求項6に記載の乱数生成回路。
The control circuit fixes the value of the selection signal in a state where the adjustment signal is fixed to a fifth value when the output value of the output circuit changes from the first value to the second value. The start timing is changed, and the start timing is determined based on the sixth value of the selection signal when the output value changes from the second value to the first value.
The random number generation circuit according to claim 6.
乱数生成回路の制御方法において、
前記乱数生成回路が有する調整部が、入力信号と調整信号とを受け、前記入力信号に基づいて、第1の信号と第2の信号とを出力するとともに、前記調整信号に基づいて、前記第1の信号または前記第2の信号の位相を調整し、
前記乱数生成回路が有する3つ以上の奇数個のラッチ回路が、前記第1の信号と前記第2の信号とを受け、前記第2の信号によるサンプリングタイミングにおける前記第1の信号の信号レベルに基づいて、第1の値または第2の値をそれぞれ出力し、
前記乱数生成回路が有する出力回路が、前記奇数個のラッチ回路のそれぞれが出力する前記第1の値または前記第2の値を受け、前記奇数個のラッチ回路の全てが同じ値を出力する場合、前記同じ値を出力し、前記奇数個のラッチ回路のうちの少なくとも1つが異なる値を出力する場合、前記第1の値と前記第2の値のうち、出力される数が少ない方の値を出力し、
前記乱数生成回路が有する検出回路が、前記奇数個のラッチ回路のそれぞれが出力する前記第1の値または前記第2の値を受け、前記奇数個のラッチ回路の全てが前記同じ値を出力するか否かを示す検出結果を出力し、
前記乱数生成回路が有する制御回路が、前記検出結果と前記出力回路の出力値とに基づいて、前記サンプリングタイミングが、前記奇数個のラッチ回路が準安定状態となる期間内であるか否かを判定し、前記サンプリングタイミングが前記期間内であるか否かの判定結果に基づいて、前記調整信号の値を変えて、前記サンプリングタイミングを前記期間内に調整する、
乱数生成回路の制御方法。
In the control method of the random number generation circuit,
The adjustment unit included in the random number generation circuit receives the input signal and the adjustment signal, outputs the first signal and the second signal based on the input signal, and outputs the first signal and the second signal based on the adjustment signal. Adjusting the phase of the first signal or the second signal;
An odd number of three or more latch circuits included in the random number generation circuit receive the first signal and the second signal, and set the signal level of the first signal at the sampling timing of the second signal. Based on the first value or the second value, respectively,
The output circuit included in the random number generation circuit receives the first value or the second value output from each of the odd number of latch circuits, and all the odd number of latch circuits output the same value. When the same value is output and at least one of the odd number of latch circuits outputs a different value, the value that is output with the smaller number of the first value and the second value. Output
The detection circuit included in the random number generation circuit receives the first value or the second value output from each of the odd number of latch circuits, and all the odd number of latch circuits output the same value. Output a detection result indicating whether or not
The control circuit included in the random number generation circuit determines whether the sampling timing is within a period in which the odd number of latch circuits are in a metastable state based on the detection result and the output value of the output circuit. Determining and changing the value of the adjustment signal based on the determination result of whether or not the sampling timing is within the period, and adjusting the sampling timing within the period;
Control method of random number generation circuit.
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 true JP2019053385A (en) 2019-04-04
JP6867594B2 JP6867594B2 (en) 2021-04-28

Family

ID=66015035

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017175543A Active JP6867594B2 (en) 2017-09-13 2017-09-13 Random number generation circuit and control method of random number generation circuit

Country Status (1)

Country Link
JP (1) JP6867594B2 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002366347A (en) * 2001-06-06 2002-12-20 Iwaki Electronics Corp Random number generator and probability generator
JP2005018251A (en) * 2003-06-24 2005-01-20 Renesas Technology Corp Random number generator
JP2008066536A (en) * 2006-09-07 2008-03-21 Toshiba Corp Semiconductor integrated circuit
JP2011211607A (en) * 2010-03-30 2011-10-20 Renesas Electronics Corp Semiconductor device, and failure detection system and failure detection method of data holding circuit
JP2014175834A (en) * 2013-03-08 2014-09-22 Mega Chips Corp Linear feedback shift register and data processing device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002366347A (en) * 2001-06-06 2002-12-20 Iwaki Electronics Corp Random number generator and probability generator
JP2005018251A (en) * 2003-06-24 2005-01-20 Renesas Technology Corp Random number generator
JP2008066536A (en) * 2006-09-07 2008-03-21 Toshiba Corp Semiconductor integrated circuit
JP2011211607A (en) * 2010-03-30 2011-10-20 Renesas Electronics Corp Semiconductor device, and failure detection system and failure detection method of data holding circuit
JP2014175834A (en) * 2013-03-08 2014-09-22 Mega Chips Corp Linear feedback shift register and data processing device

Also Published As

Publication number Publication date
JP6867594B2 (en) 2021-04-28

Similar Documents

Publication Publication Date Title
JP6361433B2 (en) Frequency detection circuit and reception circuit
KR102001691B1 (en) Delay Locked Loop
JP6032081B2 (en) Reception circuit and semiconductor integrated circuit
US7526390B2 (en) Signal measuring circuit and signal measuring method
JP4376081B2 (en) Frequency multiplier and method capable of adjusting clock duty cycle
JP2018125791A (en) CDR circuit and receiving circuit
JP5989239B2 (en) Signal processing device
US9219628B2 (en) Equalizer and operating method thereof
JP4192228B2 (en) Data generator
JP4760052B2 (en) Transmission control device and sampling frequency conversion device
JPWO2007116697A1 (en) Waveform shaping device and error measuring device
JP6867594B2 (en) Random number generation circuit and control method of random number generation circuit
JPWO2018003057A1 (en) Equalization circuit, reception circuit, and semiconductor integrated circuit
US6751745B1 (en) Digital synchronization circuit provided with circuit for generating polyphase clock signal
CN112910445A (en) Semiconductor device for adjusting phases of multi-phase signals
US9379716B2 (en) Electronic circuit, method of controlling electronic circuit, and electronic apparatus
JPWO2010016301A1 (en) Phase comparator, PLL circuit and DLL circuit
JP6871509B2 (en) Transmission circuit and integrated circuit
JP6823268B2 (en) Frequency divider circuit, demultiplexer circuit, and semiconductor integrated circuit
JP3864583B2 (en) Variable delay circuit
JPH11214987A (en) Pll device
KR20050115703A (en) Clock generating circuit and methode of semiconductor memory device
JP3391305B2 (en) Data clock synchronization circuit
KR20140082339A (en) Semiconductor apparatus
CN115735333A (en) Phase frequency detector based frequency multiplier using rising edge delay

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20200611

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20200625

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20200625

TRDD Decision of grant or rejection written
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20210303

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20210309

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20210322

R150 Certificate of patent or registration of utility model

Ref document number: 6867594

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150