A true random number generator based on memristor and method for generating random numbers thereof
Through a true random number generator based on memristor, the randomness characteristics of memristor and capacitor are used to generate high-quality random numbers, which solves the problems of unstable entropy value and high power consumption in the existing technology, and achieves low-power High-quality random number generation with high consumption and low area, suitable for systems with high security requirements.
Patent Information
- Application Number
- CN202210539377.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-17
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2042-05-17
AI Technical Summary
Existing true random number generators cannot generate high-quality true random number sequences with low power consumption and small area, and the entropy value is not stable enough to meet the needs of low-cost security systems.
A true random number generator based on memristor is designed. Memristor, series resistor, parallel capacitor and non-phase hysteresis comparator are used to form an entropy source circuit. Randomness is generated through the reset process of memristor and the charge and discharge process of capacitor. voltage pulses, combined with a counting module to generate high-quality random numbers.
It achieves the generation of stable, unbiased and high-quality true random number sequences with low power consumption and small area, ensuring the unpredictability and non-replicability of random numbers. It is suitable for high-demand encryption security systems and has good device data. Maintains properties and cycle tolerance.
Smart Images

Figure CN114995787B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of information security technology, and more specifically, relates to a true random number generator based on a memristor and a method for generating random numbers thereof. Background Art
[0002] In modern society, with the rapid development of new generation information and communication technologies represented by 5G, cloud, IoT and other technologies, information security is facing great challenges due to the easy intrusion of traditional data encryption methods. In these encryption algorithms and cryptographic protocols, random numbers are an indispensable and important part, and incorrect use of random numbers can easily be cracked and expose the system to security risks. The quality of random number performance directly affects the performance of the cryptographic system, so encryption technology requires more unpredictable, secure and reliable random sequences.
[0003] A random number generator is a device that generates random numbers. It corresponds to "true" and "pseudo" random number sequences and is divided into "true" and "pseudo" random number generators. A pseudo-random number generator is composed of a certain algorithm and an initial key seed, and generates a sequence whose statistical properties are similar to those of random numbers. Since pseudo-random numbers are generated by a deterministic algorithm, random sequences cannot meet the requirement of unpredictability of random numbers. A true random number generator extracts randomness from the physical environment and generates a random sequence that is non-repeatable and unpredictable. It is independent in time and space, solving the problem of pseudo-random numbers.
[0004] Traditional true random number generator designs are based on random noise in CMOS digital and analog circuits. In addition to being complex to implement and having large area overhead, the entropy value is not stable enough in actual use, and post-processing technology is needed to improve the entropy value in order to generate high-quality true random number sequences. At the same time, more and more low-cost security systems require true random number generators to be integrated into a dedicated integrated circuit. Therefore, designing a true random number generator with stable entropy source, low power consumption, and small area has important research value and significance. Summary of the invention
[0005] In view of the above defects or improvement needs of the prior art, the present invention provides a true random number generator based on a memristor and a method for generating random numbers, so as to solve the technical problem that the existing true random number generator cannot generate high-quality true random number sequences with lower power consumption and smaller area.
[0006] In order to achieve the above-mentioned object, the present invention provides a true random number generator based on a memristor, comprising: a memristor, a series resistor, a parallel capacitor, an in-phase hysteresis comparator and a counting module; wherein the initial state of the memristor is a low resistance state;
[0007] The bottom electrode of the memristor is connected to one end of the series resistor, and the top electrode is grounded; the parallel capacitor is connected in parallel to both ends of the memristor; the in-phase input end of the in-phase hysteresis comparator is connected to the bottom electrode of the memristor; the in-phase input end of the in-phase hysteresis comparator is connected to the reference voltage; the first input end of the counting module is connected to the output end of the in-phase hysteresis comparator, and the second input end is connected to the digital clock signal;
[0008] The memristor, the series resistor and the shunt capacitor together constitute an entropy source circuit, which is used to obtain a random voltage pulse of the bottom electrode of the memristor based on the randomness of the timing of the memristor reset, the randomness of the resistance value when the memristor is reset to a high resistance state, and the coupling effect of the charging and discharging process of the shunt capacitor on the randomness;
[0009] The in-phase hysteresis comparator is used to generate a high threshold voltage vref+ and a low threshold voltage vref- based on the reference voltage; and compare the voltage between the bottom electrode of the memristor and the high threshold voltage vref+ during the charging process of the parallel capacitor; and compare the voltage between the bottom electrode of the memristor and the low threshold voltage vref- during the discharging process of the parallel capacitor; and output the comparison result to the counting module;
[0010] The counting module is used to start counting the digital clock signal based on the counter when the voltage of the bottom electrode of the memristor is higher than the high threshold voltage vref+; when the voltage of the bottom electrode of the memristor is lower than the low threshold voltage vref-, the counting is stopped; the mth bit output by the counting module is the random number generated by the true random number generator; 1≤m≤M; M is the number of bits of the counter.
[0011] Further preferably, the random number generated by the true random number generator is the lowest bit output by the counting module.
[0012] Further preferably, the counting module comprises: an AND gate and a counter; the first input end of the AND gate is connected to the output end of the in-phase hysteresis comparator, and the second input end is connected to the digital clock signal; the output end of the AND gate is connected to the input end of the counter;
[0013] The AND gate is used to output the digital clock signal to the counter when the comparison result is a high level; when the comparison result is a low level, the low level is output to the counter;
[0014] Counters are used to count digital clock signals.
[0015] In a second aspect, the present invention provides a method for generating random numbers based on the true random number generator, comprising the following steps:
[0016] S1. Apply a voltage pulse to the other end of the series resistor to charge the parallel capacitor; during the charging process, the memristor is reset from a low resistance state to a high resistance state, and the reset occurs at a random time; in this process, the voltage between the bottom electrode of the memristor and the high threshold voltage vref+ is continuously compared based on the in-phase hysteresis comparator; when the voltage between the bottom electrode of the memristor is higher than the high threshold voltage vref+, the counter starts counting the digital clock signal; wherein, the initial state of the memristor is a low resistance state;
[0017] S2, after the preset pulse width, the voltage pulse is removed, and the parallel capacitor starts to discharge the memristor; during the discharge process, the voltage at the bottom electrode of the memristor is compared with the low threshold voltage vref- based on the in-phase hysteresis comparator; when the voltage at the bottom electrode of the memristor is lower than the low threshold voltage vref-, the counting stops;
[0018] S3. Output the m-th level signal of the counter as a random number; 1≤m≤M; M is the number of bits of the counter.
[0019] Further preferably, the lowest bit level signal of the counter is output as a random number.
[0020] Further preferably, each time a rising edge of the digital clock signal arrives, the lowest bit level of the counter flips.
[0021] In a third aspect, the present invention provides a method for generating a random sequence, comprising the following steps:
[0022] a. Execute steps S1-S3 of the method for generating a random number provided in the second aspect of the present invention to generate a random number;
[0023] b. Perform a set operation on the memristor to set it to a low resistance state;
[0024] c. Repeat steps ab and output a random sequence.
[0025] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects:
[0026] 1. The true random number generator based on memristor provided by the present invention comprises an entropy source circuit composed of a memristor, a series resistor and a parallel capacitor, the entropy source circuit uses the delay and uncertainty of the resistance value of the memristor during the reset process to obtain a random source output, and couples two random sources through the charging and discharging process of the capacitor, amplifies the random difference, and then combines the output voltage pulse of the in-phase hysteresis comparator, and uses the counting module to count to obtain a true random number. The present invention uses the two physical intrinsic randomness of the whole process of memristor reset as the physical random source, and the two temporal random sources generated from the whole process of reset as the two entropy sources of the random number generator, so that the output random number has the characteristics of stability and unbiasedness, and the circuit structure of the present invention is simple, and can generate high-quality true random number sequences with low power consumption and small area, which provides a high-quality choice for encryption security systems with high requirements.
[0027] 2. In the true random number generator based on memristor provided by the present invention, the state of the memristor device is different in each cycle, which is specifically manifested as follows: there is a large difference in the reset of the memristor between different cycles, so that the reset process of the memristor occurs randomly during the capacitor charging process, so that the rising speed of the bottom electrode voltage of the memristor during the application of the reset voltage pulse is random, and the time when the counter starts counting is an uncertain random value; and in the capacitor discharging process, there is also a large difference in the high resistance value of the memristor, so that the time constant of the capacitor discharge is also very different, and the time when the counter ends counting is also an uncertain random value; because the time when the counter starts counting and the time when the counter stops counting are different in each cycle, the total counting time of the counter is also different and random, so as to ensure that the probability of "0" and "1" appearing in the generated random number sequence is equal, and the true random number generator provided by the present invention is unpredictable and non-replicable, and is not affected by physical attacks.
[0028] 3. The memristor used in the true random number generator based on memristor provided by the present invention has good device data retention characteristics and cycle tolerance, and can continuously and stably provide a physical random signal source for the system, so that the true random number generator can stably output random signals and has a long service life.
[0029] 4. The memristor-based true random number generator provided by the present invention has high entropy value, simple circuit structure, low power consumption and smaller unit size advantages, and is compatible with mainstream CMOS technology, facilitating IC integrated chip implementation. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 A schematic diagram of the structure of a true random number generator based on a memristor provided in Example 1 of the present invention;
[0031] Figure 2 A diagram showing the current variation process of the memristor provided in Example 1 of the present invention under a reset pulse;
[0032] Figure 3 A flow chart of a method for generating random numbers based on a true random number generator provided in Embodiment 2 of the present invention;
[0033] Figure 4 Schematic diagram of pulse waveforms at each stage of the true random number generator provided in Example 2 of the present invention; wherein (a) is a schematic diagram of the waveform of the reset voltage pulse in the whole process; (b) is a schematic diagram of the waveform change of the voltage signal v at the bottom electrode of the memristor in the whole process; (c) is a schematic diagram of the waveform change of the output signal of the in-phase hysteresis comparator in the whole process; (d) is a schematic diagram of the waveform change of the lowest bit output signal of the counter;
[0034] Figure 5 The IV characteristic curve of the memristor provided in Example 2 of the present invention;
[0035] Figure 6 A voltage diagram of the entropy source circuit sampled under a reset pulse provided in Embodiment 2 of the present invention;
[0036] Figure 7 A correlation diagram of the memristor entropy sources T1 and T2 provided in Example 2 of the present invention;
[0037] Figure 8 The entropy value comparison simulation result diagram provided in Example 2 of the present invention; wherein, (a) is a schematic diagram of the change of the entropy value corresponding to the memristor entropy source T1 with the length of the output random sequence; (b) is a schematic diagram of the change of the entropy value corresponding to the memristor entropy source T2 with the length of the output random sequence; (c) is a schematic diagram of the change of the entropy value obtained by combining the memristor entropy sources T1 and T2 with the length of the output random sequence. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0039] Embodiment 1,
[0040] A true random number generator based on a memristor, such as Figure 1 As shown, it includes: a memristor 1, a series resistor 2, a parallel capacitor 3, an in-phase hysteresis comparator 4 and a counting module; wherein the initial state of the memristor is a low resistance state;
[0041] The bottom electrode of the memristor 1 is connected to one end of the series resistor 2, and the top electrode is grounded; the parallel capacitor 3 is connected in parallel to both ends of the memristor 1; the in-phase input end of the in-phase hysteresis comparator 4 is connected to the bottom electrode of the memristor 1; the in-phase input end of the in-phase hysteresis comparator 4 is connected to the reference voltage; the first input end of the counting module is connected to the output end of the in-phase hysteresis comparator 4, and the second input end is connected to the digital clock signal;
[0042] The memristor 1, the series resistor 2 and the parallel capacitor 3 together constitute an entropy source circuit, which is used to obtain a random memristor bottom electrode voltage pulse based on the randomness of the timing of the memristor reset, the randomness of the resistance value when the memristor is reset to a high-resistance state, and the coupling effect of the charging and discharging process of the parallel capacitor on the randomness; in this embodiment, a pulse signal generator and a closed entropy source circuit switch are connected to the entropy source circuit; the closed entropy source circuit switch is used to control the timing of the pulse signal generator applying a voltage pulse at the other end of the series resistor.
[0043] The in-phase hysteresis comparator 4 is used to generate a high threshold voltage vref+ and a low threshold voltage vref- based on a reference voltage; and compare the voltage at the bottom electrode of the memristor with the high threshold voltage vref+ during the charging process of the parallel capacitor; and compare the voltage at the bottom electrode of the memristor with the low threshold voltage vref- during the discharging process of the parallel capacitor; and output the comparison result to the counting module; specifically, during the charging process of the parallel capacitor, the inverting input terminal of the in-phase hysteresis comparator is connected to the high threshold voltage vref+; during the discharging process of the parallel capacitor, the inverting input terminal of the in-phase hysteresis comparator is connected to the low threshold voltage vref-.
[0044] The counting module is used to start counting the digital clock signal based on the counter when the voltage of the bottom electrode of the memristor is higher than the high threshold voltage vref+; when the voltage of the bottom electrode of the memristor is lower than the low threshold voltage vref-, the counting stops; the mth bit output by the counting module is the random number generated by the true random number generator; 1≤m≤M; M is the number of bits of the counter. The lowest bit output by the counting module has a faster frequency of change and the strongest randomness; preferably, the random number generated by the true random number generator is the lowest bit output by the counting module.
[0045] It should be noted that the true random number generator in the present invention obtains random output based on the delay and uncertainty of resistance value of the memristor during the reset process, and amplifies the random difference through the process of capacitor charging and capacitor discharging to obtain non-reproducible and unpredictable random numbers. The memristor has good device data retention characteristics and cycle tolerance, and can continuously and stably provide a physical random signal source for the system, ensuring the random number signal generator has stable random signal output characteristics and long service life. Specifically, Figure 2The figure shows the current change process of the memristor under the reset pulse; it can be seen from the figure that the breakage of the conductive filaments in the reset process of the memristor under different cycles is highly random, and the difference in current after the reset occurs shows that the high resistance of the memristor is highly random. These random characteristics can be used to generate true random sequences.
[0046] In an optional implementation, the counting module includes: an AND gate 5 and a counter 6; the first input end of the AND gate 5 is connected to the output end of the in-phase hysteresis comparator 4, and the second input end is connected to the digital clock signal; the output end of the AND gate 5 is connected to the input end of the counter 6;
[0047] AND gate 5 is used to output the digital clock signal to counter 6 when the comparison result is a high level; and output the low level to counter 6 when the comparison result is a low level;
[0048] The counter 6 is used to count the digital clock signal.
[0049] In summary, the multiple intrinsic randomness of the memristor's resistive switching process is used as a random source, and the randomness of multiple entropy sources is combined to make the output result close to the unbiased ideal random source output. Different from the traditional true random number generator, the multi-entropy source randomness of the true random number generator based on the memristor of the present invention comes from the physical characteristics of the memristor's resistive switching process. The circuit system has a simple structure, can generate a large number of high-quality true random number sequences, and has the advantages of full on-chip integration with high entropy source, low power consumption and small area.
[0050] Embodiment 2,
[0051] The present invention provides a method for generating random numbers based on the true random number generator provided in Example 1, comprising the following steps:
[0052] S1. Apply a voltage pulse to the other end of the series resistor to charge the parallel capacitor. During the charging process, the parallel capacitor is gradually charged, and the voltage across the memristor gradually increases. At a random moment, the memristor is reset from a low resistance state to a high resistance state. During this process, the voltage between the bottom electrode of the memristor and the high threshold voltage vref+ is continuously compared based on the in-phase hysteresis comparator. When the voltage at the bottom electrode of the memristor is higher than the high threshold voltage vref+, the counter starts counting the digital clock signal. The initial state of the memristor is a low resistance state.
[0053] S2. After the preset pulse width, the voltage pulse is removed, the capacitor and the memristor form a discharge loop, and the parallel capacitor starts to discharge the memristor; during the discharge process, the voltage across the memristor gradually decreases, and the discharge voltage will continue to operate the memristor, causing the conductive filaments of the memristor to continue to break, resulting in randomness in the resistance state change; based on the in-phase hysteresis comparator, the voltage at the bottom electrode of the memristor is compared with the low threshold voltage vref-; when the voltage at the bottom electrode of the memristor is lower than the low threshold voltage vref-, the counting is stopped;
[0054] S3, output the m-th bit level signal of the counter as a random number; 1≤m≤M; M is the number of bits of the counter. Specifically, each time the rising edge of the digital clock signal arrives, the lowest bit level of the counter flips. Preferably, the lowest bit level signal of the counter is output as a random number.
[0055] It should be noted that for the in-phase hysteresis comparator, the input signal increases the high threshold voltage for comparison, and the input signal decreases the low threshold voltage for comparison. By selecting appropriate high threshold voltage and low threshold voltage values, the time value with the strongest randomness is obtained.
[0056] Furthermore, based on the above method for generating random numbers, a method for generating a random sequence is proposed, comprising the following steps:
[0057] a. Execute steps S1-S3 in the above method for generating a random number to generate a random number;
[0058] b. Perform a set operation on the memristor to set it to a low resistance state;
[0059] c. Repeat steps ab and output a random sequence.
[0060] In order to further illustrate the method for generating random numbers and random sequences provided by the present invention, it is described in detail as follows in conjunction with specific implementation methods:
[0061] like Figure 3 As shown, the method for generating random numbers based on the true random number generator provided in Example 1 includes the following steps:
[0062] Step 1: Close the entropy source circuit switch and perform a set operation on the memristor;
[0063] Step 2: applying a reset voltage pulse to the entropy source circuit; in this embodiment, the reset voltage pulse applied is 1.5V;
[0064] Step 3: The capacitor is gradually charged, the voltage across the memristor gradually increases, the reset process of the memristor occurs randomly, the conductive filaments break randomly, and the resistance increases accordingly;
[0065] Step 4: Sample the voltage signal v of the bottom electrode of the memristor as the input of the in-phase hysteresis comparator and compare it with the high threshold voltage vref+;
[0066] Step 5: If the voltage signal v of the bottom electrode of the memristor is higher than the high threshold voltage vref+, the counter starts to work and counts the fixed digital clock signal. If it is lower than the high threshold voltage vref+, it returns to step 4.
[0067] Step 6: After a preset pulse width (1 μs in this embodiment), the reset voltage pulse is removed, the switch between the control power supply and the memristor is disconnected, the capacitor and the memristor form a discharge loop, the capacitor begins to discharge the memristor, and the voltage across the memristor gradually decreases. The discharge voltage will continue to operate the memristor, causing the conductive filaments of the memristor to continue to break, resulting in randomness in the resistance state change;
[0068] Step 7: Sample the voltage signal v of the bottom electrode of the memristor as the input of the in-phase hysteresis comparator and compare it with the low threshold voltage vref-;
[0069] Step 8: If the voltage signal v of the bottom electrode of the memristor is lower than the low threshold voltage vref-, the counter stops working and the count no longer changes; if it is higher than the low threshold voltage vref-, the process returns to step 7;
[0070] Step 9: Output the lowest level signal of the counter as a random number output.
[0071] Specifically, Figure 4The figure shows the pulse waveform of each stage of the true random number generator, where Figure (a) is a schematic diagram of the waveform of the reset voltage pulse in the whole process; the corresponding process is: close the entropy source circuit switch, apply the reset voltage pulse to the entropy source circuit, remove the voltage pulse after a fixed pulse width and open the entropy source circuit switch. Figure (b) is a schematic diagram of the waveform change of the voltage signal v at the bottom electrode of the memristor in the whole process; the corresponding process is: during the application of the reset voltage pulse, the voltage pulse charges the parallel capacitor, the voltage at the bottom electrode of the memristor gradually increases, and the conductive filaments of the memristor randomly break during this period; after the reset voltage pulse is removed, the capacitor and the memristor form a discharge circuit, the capacitor discharges the memristor, and the voltage at the bottom electrode of the memristor gradually decreases. Figure (c) is a schematic diagram of the waveform change of the output signal of the in-phase hysteresis comparator during the whole process; the corresponding process is: during the application of the reset voltage pulse, the voltage of the bottom electrode of the sampled memristor is compared with the high threshold voltage vref+. If the voltage of the bottom electrode of the memristor is higher than the high threshold voltage vref+, the in-phase hysteresis comparator starts to output a high level; after the voltage pulse is removed, the voltage of the bottom electrode of the memristor gradually decreases; if the voltage of the bottom electrode of the memristor is lower than the high threshold voltage vref+, the in-phase hysteresis comparator outputs a low level. Figure (d) is a schematic diagram of the waveform change of the output signal of the lowest bit of the counter; the corresponding process is: when the in-phase hysteresis comparator outputs a high level, the counter starts counting the digital clock signal; specifically, each time the digital clock rises, the lowest bit of the counter flips to count, each time the digital clock rises, the lowest bit of the counter flips, and the counter stops counting when the in-phase hysteresis comparator outputs a low level, and finally the lowest bit of the counter is output as a random number.
[0072] Repeating steps 1 to 9 continuously can generate a large number of high-quality random sequence outputs. In the process of random number generation, since the reset of the memristor varies greatly between different cycles, the reset process of the memristor occurs randomly during the capacitor charging process, and the high resistance value of the memristor varies greatly during the capacitor discharging process, resulting in a large difference in the time constant of the capacitor discharging. The time when the counter starts counting and the time when the counter stops counting are different, so the total counting time of the counter is also different and random, which ensures that the probability of "0" and "1" appearing in the generated random number sequence is equal, and the unpredictability and non-replicability of the entire system are achieved, that is, the random number generated by the true random number generator based on the memristor proposed in the present invention has the unpredictability of true random numbers and the non-repeatability in the random physical process.
[0073] According to the circuit structure of the true random number generator, the physical object is built and welded; among them, the IV characteristic curve of the memristor is as follows Figure 5 As shown. Figure 6The figure shows the sampling voltage diagram of the entropy source circuit of the present invention under the reset pulse. It can be seen from the figure that the breakage of the conductive filament of the memristor is random, so the rising speed of the bottom electrode voltage of the memristor during the reset voltage pulse is random, and the time to reach the high threshold voltage vref+ is also an uncertain random value T1. The difference in the high resistance of the memristor causes the bottom electrode voltage of the memristor to drop to the low threshold voltage vref-. The time is also an uncertain random value T2; among them, the reference voltage connected to the in-phase hysteresis comparator is 1.025V, the generated vref+ is 1.35V, and the vref- is 0.7V. Figure 7 The figure shows the correlation diagram of the memristor entropy sources T1 and T2. It can be seen that T1 and T2 are weakly correlated and can be regarded as two independent random entropy sources. Combining the random characteristics of the two can obtain an independent and unbiased random source that is closer to the ideal. By fine-tuning the parameters of each device in the circuit, the circuit simulation and actual test obtain similar effect diagrams.
[0074] The output of the memristor-based true random number generator is stored in FIFO and transmitted to the computer via UART. The random number generated by the random number output step is tested using the NIST randomness test suite, which contains 15 test items. The NIST randomness test suite outputs the P value of each test item based on the input random number. If the P value of all test items is greater than 0.0001, it is considered that the randomness of the random number meets the requirements. The test results of the simulated true random number sequence are shown in Table 1:
[0075] Table 1
[0076]
[0077]
[0078] As can be seen from Table 1, all the output data passed the 15 NIST randomness tests and had a high P value and high entropy (Proportion is the probability of passing the test).
[0079] Furthermore, if Figure 8 The entropy value comparison simulation result diagram provided by Example 2 of the present invention is shown; wherein, (a) is a schematic diagram of the entropy value corresponding to the memristor entropy source T1 changing with the length of the output random sequence; (b) is a schematic diagram of the entropy value corresponding to the memristor entropy source T2 changing with the length of the output random sequence; (c) is a schematic diagram of the entropy value obtained after combining the memristor entropy sources T1 and T2 changing with the length of the output random sequence. It can be seen from the figure that the random number entropy value generated by the true random number generator of the present invention is higher, and has the characteristics of more stability and higher quality.
[0080] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A true random number generator based on a memristor, characterized in that: include: A memristor, a series resistor, a parallel capacitor, an in-phase hysteresis comparator and a counting module; wherein the initial state of the memristor is a low resistance state; The bottom electrode of the memristor is connected to one end of the series resistor, and the top electrode is grounded; the parallel capacitor is connected in parallel to both ends of the memristor; the in-phase input end of the in-phase hysteresis comparator is connected to the bottom electrode of the memristor; the in-phase input end of the in-phase hysteresis comparator is connected to the reference voltage; the first input end of the counting module is connected to the output end of the in-phase hysteresis comparator, and the second input end is connected to the digital clock signal; The memristor, the series resistor and the parallel capacitor together constitute an entropy source circuit, which is used to obtain a random memristor bottom electrode voltage pulse based on the randomness of the timing of the memristor reset, the randomness of the resistance value when the memristor is reset to a high resistance state, and the coupling effect of the charging and discharging process of the parallel capacitor on the randomness; The in-phase hysteresis comparator is used to generate a high threshold voltage vref+ and a low threshold voltage vref- based on the reference voltage; and compare the voltage between the bottom electrode of the memristor and the high threshold voltage vref+ during the charging process of the parallel capacitor; and compare the voltage between the bottom electrode of the memristor and the low threshold voltage vref- during the discharging process of the parallel capacitor; and output the comparison result to the counting module; The counting module is used to start counting the digital clock signal based on the counter when the voltage at the bottom electrode of the memristor is higher than the high threshold voltage vref+; stop counting when the voltage at the bottom electrode of the memristor is lower than the low threshold voltage vref-; the mth bit output by the counting module is the random number generated by the true random number generator; 1≤m≤M; M is the number of bits of the counter.
2. The true random number generator according to claim 1, characterized in that: The random number generated by the true random number generator is the lowest bit output by the counting module.
3. The true random number generator according to claim 1 or 2, characterized in that: The counting module comprises: an AND gate and the counter; the first input end of the AND gate is connected to the output end of the in-phase hysteresis comparator, and the second input end is connected to the digital clock signal; the output end of the AND gate is connected to the input end of the counter; The AND gate is used to output the digital clock signal to the counter when the comparison result is a high level; and output the low level to the counter when the comparison result is a low level; The counter is used to count the digital clock signal.
4. A method for generating random numbers based on a true random number generator according to any one of claims 1 to 3, characterized in that: The following steps are involved: S1. Apply a voltage pulse to the other end of the series resistor to charge the parallel capacitor. During the charging process, the memristor is reset from a low-resistance state to a high-resistance state, and the reset occurs at a random time. In this process, the voltage at the bottom electrode of the memristor is continuously compared with the high threshold voltage vref+ based on the in-phase hysteresis comparator; when the voltage at the bottom electrode of the memristor is higher than the high threshold voltage vref+, the counter starts counting the digital clock signal; wherein the initial state of the memristor is a low resistance state; S2, after the preset pulse width, the voltage pulse is removed, and the parallel capacitor starts to discharge the memristor; during the discharge process, the voltage at the bottom electrode of the memristor is compared with the low threshold voltage vref- based on the in-phase hysteresis comparator; When the voltage of the bottom electrode of the memristor is lower than the low threshold voltage vref-, the counting is stopped; S3. Output the m-th level signal of the counter as a random number; 1≤m≤M; M is the number of bits of the counter.
5. The method for generating random numbers according to claim 4, characterized in that: The lowest bit level signal of the counter is output as a random number.
6. The method for generating random numbers according to claim 5, characterized in that: Each time the rising edge of the digital clock signal arrives, the lowest bit level of the counter flips.
7. A method for generating a random sequence, characterized in that: The following steps are involved: a. Execute steps S1-S3 in the method for generating a random number according to any one of claims 4-6 to generate a random number; b. Perform a set operation on the memristor to set it to a low resistance state; c. Repeat steps ab and output a random sequence.
Citation Information
Patent Citations
Bit stream generator and bit stream generation method for random computation
CN111338602A
Random number generator and random number generation method
CN111562901A
