CN109558111B - True random number generating device based on metastable state characteristic of D trigger - Google Patents
True random number generating device based on metastable state characteristic of D trigger Download PDFInfo
- Publication number
- CN109558111B CN109558111B CN201811203996.0A CN201811203996A CN109558111B CN 109558111 B CN109558111 B CN 109558111B CN 201811203996 A CN201811203996 A CN 201811203996A CN 109558111 B CN109558111 B CN 109558111B
- Authority
- CN
- China
- Prior art keywords
- output
- input
- metastable state
- selector
- exclusive
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F7/00—Methods or arrangements for processing data by operating upon the order or content of the data handled
- G06F7/58—Random or pseudo-random number generators
- G06F7/588—Random number generators, i.e. based on natural stochastic processes
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computational Mathematics (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Pure & Applied Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Logic Circuits (AREA)
- Manipulation Of Pulses (AREA)
Abstract
The invention provides a device and a method for generating true random numbers based on metastable state characteristics of a D trigger, which can generate the true random numbers in an FPGA or a chip by only relying on a digital circuit. The invention relates to a true random number generating device based on metastable state characteristics of a D trigger, which comprises a data input module, a combination logic module and a synchronous output module, wherein the data input module comprises two groups of data selectors and four groups of registers, and each two groups of registers are correspondingly connected with one group of data selectors; the combinational logic module comprises a shifter, a selector, an adder and an exclusive-OR gate, wherein the shifter, the selector, the adder and the exclusive-OR gate are sequentially connected.
Description
Technical Field
The invention belongs to the technical field of digital circuits, and relates to a true random number generating device based on metastable state characteristics of a D trigger.
Background
The random sequence properties are as follows: (1) Appears to be random, i.e. it can pass all the correct randomness checks that can be found; (2) This sequence is unpredictable, that is, even given the algorithm or hardware design that produced the sequence and all knowledge of the sequence that has been produced before, it is not possible to predict by calculation what the next random bit is; (3) This sequence cannot be repeated even if you operate twice with exactly the same input sequence generating means under exactly the same operating conditions (same place, same temperature, etc.), two completely different, non-correlated random sequences will be obtained.
Metastable is defined as the output of a register may enter metastable when a change in data does not meet the set-up or hold time requirements of the clock. Metastable means that the output signal cannot enter a known state within a predetermined time, that is, the propagation delay of the device exceeds a nominal value. In the metastable state, the output of the register remains between a high level and a low level for a period of time, that is, after a propagation delay time, the register output signal is at an intermediate level. Once the circuit enters a metastable state, the time to stay in the metastable state will be unpredictable. After the occurrence of the metastable state, even if the final output is stabilized, the designer cannot be sure that the logic value of the output is necessarily correct. During the change of the output signal from metastable to steady state, the output signal may be free from illegal logic level values for a long period of time, and oscillations may also occur.
The D flip-flop is a sequential circuit composed of level devices like D latches. A typical rising edge valid D flip-flop model consisting of D latches is analyzed. When the clock input port is maintained at a high level, the input terminal inputs a value D0 at a certain time. This value enters from the input nand gate, there is a delay in the device, and there may be an inconsistency between the signal fed back to one input of the nand gate and the signal at the other input, so that during the entire set-up of the D latch, there is an "unstable phase" of the voltage output from the output of the first stage, called the set-up time, the "length" of this unstable phase being related to the device propagation delay, and the input level, the initial level of the output of the first stage (assuming that the clock level is always unchanged). Note that the start position of this period is at the point where the input starts to be valid. Since a time period has elapsed after the input of the input terminal, the output terminal of the first stage starts to "oscillate". Starting from the rising edge of the clock port, and ending at the point before the window time when the input must be valid, this time is the setup time of the D flip-flop. Starting from the rising edge of the clock port, and ending at a point after the window time when the input must be valid, this time is the hold time of the D flip-flop. The time from the rising edge of the clock port to the stable end of the output end is the propagation delay time of the D trigger.
The D flip-flop produces metastability analysis as follows: any level anomaly during the sampling window time may cause sampling anomalies, which is the most fundamental cause of metastability. It is assumed that when the clock of the first stage of the D flip-flop is turned off, the different input levels at the input end are "frozen" to an initial value, and if this initial value is exactly the intermediate level, the output end of the first stage latch will take a longer time to reach the due level height, and the combined effect of the mutual feedback inputs will eventually lengthen the set-up time of the whole latch. In addition, since the system is subject to various noise at any time, adding noise results in the final level being independent of the input.
Metastability analysis of D flip-flops within the same clock domain: it is assumed that there is a very long and complex chain of combinational logic devices between two adjacent D flip-flops. Therefore, the data from the previous stage D flip-flop needs to be stabilized at the input end of the next stage D flip-flop after a long time. This time is even close to the clock period and the signal is stable after the start of the sampling window, so that the D flip-flop first stage does not have enough time to correctly set the level, resulting in the occurrence of metastable states. This situation is called a setup time violation. Alternatively, if the rising edge of the first cycle, the data D0 from the previous stage flip-flop reaches the next stage. There is a rising edge in the second cycle, and the data D1 from the previous stage flip-flop passes through a very short path to the next stage. If this transmission time is less than the hold time, D1 will in turn destroy the sample when the last D0 has not completely ended the sample. Thus creating a hold time violation.
Disclosure of Invention
The invention aims to provide a device and a method for generating a true random number based on metastable state characteristics of a D trigger, which can generate the true random number in an FPGA or a chip by only relying on a digital circuit.
The invention is realized by the following technical scheme:
the true random number generating device based on the metastable state characteristic of the D trigger comprises a data input module, a combinational logic module and a synchronous output module, wherein the data input module comprises two groups of data selectors and four groups of registers, and each two groups of registers are correspondingly connected with one group of data selectors; the combinational logic module comprises a shifter, a selector, an adder and an exclusive-OR gate, wherein the shifter, the selector, the adder and the exclusive-OR gate are sequentially connected in sequence;
the register is used for storing a register value conforming to a metastable state generating condition;
the data selector is used for selecting different registers as output values, one output is connected with the input of the shifter in the combinational logic module, and the other output is connected with the control input of the signal selector in the combinational logic module;
the shifter is used for multiplying the input value by 2 to the power of n and outputting the result to the signal selector;
the signal selector is used for selecting the output result of the shifter or selecting all 0 outputs, and the output of the signal selector is connected with the input of the adder;
the adder is used for adding the outputs of the signal selectors, and the output of the adder is connected with the input of the exclusive-OR gate;
the exclusive-or gate is used for converting the multi-bit signal output by the adder into a single-bit signal meeting the metastable state generation condition and outputting the single-bit signal to the synchronous output module;
the synchronous output module is used for locking the signal which is output by the exclusive-OR gate and meets the metastable state generation condition to stable 0 or 1, and finally obtaining the random number.
The invention has the beneficial effects that:
the invention realizes the generation of the true random number by utilizing the metastable state characteristic of the D trigger, and designs a circuit which can ensure that each clock period can enter the metastable state. Multiplication functions are implemented using combinational logic (shifters and adders) that is relatively complex and long-path; meanwhile, the output result is exclusive-ored according to the bits, so that the length of a combined logic path is increased, and the condition that the output exclusive-ored result enters the D trigger A to generate metastable state can be met as long as at least one path time sequence violation exists in exclusive-ored input. After entering the metastable state, the state is restored to the steady state 1 or 0 randomly according to the characteristic of the metastable state, so that the true random number is realized by the full digital logic, and the true random number can be realized on a chip which cannot integrate an analog device, such as an FPGA.
Drawings
Fig. 1 is a schematic diagram of a true random number generating device based on metastable state characteristics of a D flip-flop.
Detailed Description
As shown in fig. 1, the true random number generating device based on metastable state characteristics of the D flip-flop of the present invention includes a data input module, a combinational logic module and a synchronous output module, wherein the data input module includes two sets of data selectors (selector 0, selector 1) and four sets of registers (register 0, register 1, register 2, register 3), each two sets of registers corresponds to one set of data selectors, and the two-stage synchronous circuit is composed of a 32-bit two-input multiplier implemented by shift addition, a 64-bit bitwise exclusive-or circuit, a D flip-flop a, a D flip-flop B and a D flip-flop C. The specific implementation process of random number generation is as follows:
1. by checking a time sequence analysis report generated after circuit synthesis, the input of the 32-bit multiplier consists of two groups of register outputs, and the condition that the setup time violation is generated on the path of a D trigger (D trigger A) of which register output reaches the exclusive OR result input is confirmed;
2. the circuit of the true random number generating device starts to work, the register value obtained in the step 1 is used as the input value of the data input module, and the output value selected by the data selector is used as the input of the combinational logic circuit. Since the result after 64'H AAAA_AAAA_AAAA_AAAA is 0 after bitwise exclusive or, the result after 64' h1555_5555_5555_5555 is 1 after bitwise exclusive or, the length of 64 combinational logic paths is not consistent, and there is a setup time violation path, it can be ensured that the input port D of the D flip-flop a continuously turns 0 and 1 and may be at a level between 0 and 1, i.e., in the clock rising edge window (within the setup time and the hold time) of the D flip-flop a, the input port D is not stable, the condition of generating metastable state is satisfied, the output of the D flip-flop a enters metastable state, i.e., the combinational logic module outputs a metastable state signal. The output of the combination logic module enters the next-stage synchronous output module, after two-stage synchronous processing of the D trigger B and the D trigger C, the final output enters a steady state, and signals entering the steady state are interfered by thermal noise and electric noise in a circuit, and the signals can be 0 or 1, so that the output of the D trigger C, namely the output of the synchronous output module, is a true random number.
Assuming that there is a setup time violation for bit 10 of multiplier X to D flip-flop a, register 0X register 2=64' haaaa aaaa; register 1 x register 3=64' h1555_5555_5555_5555; bit 10 of register 0 is 0; bit 10 of register 1 is 1. Since 64'H AAAA_AAAA_AAAA_AAAA is 0 after bit exclusive or, 64' h1555_5555_5555_5555 is 1 after bit exclusive or, 64 combinational logic paths are not long and short, and there is a setup time violation path, that is, the input port D of the D flip-flop a is enabled to continuously flip between 0 and 1 and may be at a level between 0 and 1, in the clock rising edge window of the D flip-flop a, the input port D is not stable, and the condition of generating metastable state is satisfied. Therefore, the output port Q of the D trigger A cannot reach a steady state in a decision time, but enters a metastable state;
3. the output of the D trigger A is acquired through the D trigger B and the D trigger C, no combinational logic exists between three stages of registers, the metastable state propagation is blocked, the metastable state signal is changed into a steady state signal, the steady state signal is interfered by thermal noise and electric noise in a circuit, the steady state signal can be 0 or 1, and the output of the D trigger C is ensured to be a true random number.
Claims (1)
1. The true random number generating device based on the metastable state characteristic of the D trigger is characterized by comprising a data input module, a combination logic module and a synchronous output module, wherein the data input module comprises two groups of data selectors and four groups of registers, and each two groups of registers are correspondingly connected with one group of data selectors; the combinational logic module comprises a shifter, a selector, an adder and an exclusive-OR gate, wherein the shifter, the selector, the adder and the exclusive-OR gate are sequentially connected in sequence;
the register is used for storing a register value conforming to a metastable state generating condition;
the data selector is used for selecting different registers as output values, one output is connected with the input of the shifter in the combinational logic module, and the other output is connected with the control input of the signal selector in the combinational logic module;
the shifter is used for multiplying the input value by 2 to the power of n and outputting the result to the signal selector;
the signal selector is used for selecting the output result of the shifter or selecting all 0 outputs, and the output of the signal selector is connected with the input of the adder;
the adder is used for adding the outputs of the signal selectors, and the output of the adder is connected with the input of the exclusive-OR gate;
the exclusive-or gate is used for converting the multi-bit signal output by the adder into a single-bit signal meeting the metastable state generation condition and outputting the single-bit signal to the synchronous output module;
the synchronous output module is used for locking the signal which is output by the exclusive-OR gate and meets the metastable state generation condition to stable 0 or 1, and finally obtaining the random number.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811203996.0A CN109558111B (en) | 2018-10-16 | 2018-10-16 | True random number generating device based on metastable state characteristic of D trigger |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811203996.0A CN109558111B (en) | 2018-10-16 | 2018-10-16 | True random number generating device based on metastable state characteristic of D trigger |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109558111A CN109558111A (en) | 2019-04-02 |
CN109558111B true CN109558111B (en) | 2023-09-29 |
Family
ID=65865116
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811203996.0A Active CN109558111B (en) | 2018-10-16 | 2018-10-16 | True random number generating device based on metastable state characteristic of D trigger |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109558111B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116860206B (en) * | 2023-07-24 | 2024-03-22 | 山西工程科技职业大学 | True random number generator based on autonomous metastable state circuit |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101957741A (en) * | 2010-10-18 | 2011-01-26 | 东南大学 | Sub-threshold value characteristic-based true random number generator |
CN102736890A (en) * | 2011-04-15 | 2012-10-17 | 深圳市证通电子股份有限公司 | High-speed random number generator based on open-loop structure |
CN103066956A (en) * | 2012-12-28 | 2013-04-24 | 深圳市航天新源科技有限公司 | True random number random triangular wave generating method and device |
CN104182203A (en) * | 2014-08-27 | 2014-12-03 | 曙光信息产业(北京)有限公司 | True random number generating method and device |
CN104714774A (en) * | 2013-12-14 | 2015-06-17 | 中国航空工业集团公司第六三一研究所 | True random number generation method based on digital circuit |
CN204681338U (en) * | 2015-07-15 | 2015-09-30 | 成都远望科技有限责任公司 | A kind of clock generation circuit of digital signal processor |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101579837B1 (en) * | 2009-02-09 | 2015-12-24 | 삼성전자주식회사 | Apparatus and method for generating random number |
EP2551837B1 (en) * | 2010-03-26 | 2015-12-16 | Fujitsu Limited | Random number generator, encryption device and recognition device |
-
2018
- 2018-10-16 CN CN201811203996.0A patent/CN109558111B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101957741A (en) * | 2010-10-18 | 2011-01-26 | 东南大学 | Sub-threshold value characteristic-based true random number generator |
CN102736890A (en) * | 2011-04-15 | 2012-10-17 | 深圳市证通电子股份有限公司 | High-speed random number generator based on open-loop structure |
CN103066956A (en) * | 2012-12-28 | 2013-04-24 | 深圳市航天新源科技有限公司 | True random number random triangular wave generating method and device |
CN104714774A (en) * | 2013-12-14 | 2015-06-17 | 中国航空工业集团公司第六三一研究所 | True random number generation method based on digital circuit |
CN104182203A (en) * | 2014-08-27 | 2014-12-03 | 曙光信息产业(北京)有限公司 | True random number generating method and device |
CN204681338U (en) * | 2015-07-15 | 2015-09-30 | 成都远望科技有限责任公司 | A kind of clock generation circuit of digital signal processor |
Non-Patent Citations (1)
Title |
---|
一种基于FPGA的真随机数发生器设计与实现;张聪等;《电子设计工程》;20110530(第10期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN109558111A (en) | 2019-04-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5377667B2 (en) | Bit string generation device and bit string generation method | |
CN109460681B (en) | Configurable physical unclonable function circuit based on delay chain | |
CN110071803B (en) | True random number generator of pure digital circuit | |
CN114968179A (en) | True random number generating circuit based on clock jitter and metastable state | |
Mei et al. | A highly flexible lightweight and high speed true random number generator on FPGA | |
Fujieda | On the feasibility of TERO-based true random number generator on Xilinx FPGAs | |
Tao et al. | FPGA based true random number generators using non-linear feedback ring oscillators | |
US20220100475A1 (en) | System, method and apparatus for race-condition true random number generator | |
CN109558111B (en) | True random number generating device based on metastable state characteristic of D trigger | |
Sreekumar et al. | Selection of an optimum entropy source design for a true random number generator | |
CN111124363B (en) | True random number generation method and true random number generator | |
Justin et al. | FPGA implementation of high quality random number generator using LUT based shift registers | |
Zhou et al. | Reliable SoC design and implementation of SHA-3-HMAC algorithm with attack protection | |
CN115758951A (en) | Digital entropy source integrated circuit based on multi-loop Boolean oscillation ring | |
Doshi et al. | Lfsr counter implementation in cmos vlsi | |
Sunandha et al. | Implementation of modified Dual-CLCG method for pseudorandom bit generation | |
JP2016126518A (en) | Device and method for generating random numbers | |
Ma et al. | A low-cost high-efficiency true random number generator on FPGAs | |
Oliveira et al. | True random number generator prototype implemented in an fpga | |
US6938172B2 (en) | Data transformation for the reduction of power and noise in CMOS structures | |
Kumar et al. | A 138 Mbps jitter based power efficient true random number generator | |
US20230315960A1 (en) | Spuf based on combinational logic and scan chain | |
Antoniadis et al. | An efficient implementation of a delay-based PUF construction | |
Agnihotri et al. | A NOVEL APPROACH OF TRUE RANDOM NUMBER GENERATION USING VEDIC MULTIPLIER | |
Likhithashree et al. | Design of Power-Efficient Ring Oscillator based Physically Unclonable Functions for FPGA |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information |
Address after: Room 409, Unit 1, 4th Floor, Building 11, Yard 3, Kangze Road, Fangshan District, Beijing 102488 Applicant after: Beijing Institute of Technology Leike Aerospace Information Technology Co.,Ltd. Address before: 100081 5th floor, building 5, courtyard A2, Xisanhuan North Road, Haidian District, Beijing Applicant before: BEIJING RACO RADAR TECHNOLOGY RESEARCH INSTITUTE Co.,Ltd. |
|
CB02 | Change of applicant information | ||
GR01 | Patent grant | ||
GR01 | Patent grant |