Random number generator and random number generation method
By introducing magnetic tunnel junctions and corresponding circuit designs into the random number generator, the problems of complexity and poor quality of random number generation in the prior art are solved, and high-quality and high-reliability random number generation is achieved.
Patent Information
- Application Number
- CN202411051495.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2024-12-06
AI Technical Summary
The operation process of generating random numbers by existing random number generators is complicated, the random number quality is poor, and the probability of generated random number lacks uncertainty.
Design a random number generator, including write drive, magnetic tunnel junction, read circuit and counter circuit. The magnetic tunnel junction is a device that switches between steady state and non-stable state, and is excited by non-stable after writing pulses. The state enters the steady state after the relaxation time, and the reading circuit generates a preset signal for reading voltage output, and the counter circuit calculates a random number based on the signal count.
The structure of the random number generator is simplified, the quality of random numbers and Shannon entropy are improved, and the generated random numbers have high reliability and anti-interference ability. They are suitable for big data edge computing and other application scenarios that require high random number quality. .
Smart Images

Figure CN119088344A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of integrated circuit design, and in particular to a random number generator and a method for generating random numbers. Background Art
[0002] A random number generator (SNG) is a device or algorithm used for unpredictable numbers. It can be used in the field of random computing. Depending on the principle, it can be divided into a pseudo-random number generator (PRNG) or a true random number generator (TRNG).
[0003] In the prior art, a low-cost random number generator is disclosed, which includes a random source, a reset module, a write module, a current dynamic regulation module, a read module and a clock control module, wherein each cycle starts from a reset phase, and the clock control module can provide a clock signal (Clock, CLK) to the reset module and the write module to control the conduction of the reset module and the write module. After the reset module is turned on, the current for restoring the initial state can be provided to the random source; further, the current dynamic regulation module receives binary data information of random calculations, and passes the binary data information to the write module. After the write module is turned on, a random current can be generated and provided to the random source, so that the random source provides an original random signal, and passes it to the read module for amplification and reading to generate a random number.
[0004] However, the operation process of generating random numbers by the above random number generator is complicated, the quality of the generated random numbers is poor, and the probability of the generated random numbers lacks uncertainty. Summary of the invention
[0005] The present application provides a random number generator and a method for generating random numbers, which are used to solve the problems that the operation process of generating random numbers by the existing random number generator is complicated, the quality of the generated random numbers is poor, and the probability of the generated random numbers lacks uncertainty.
[0006] In a first aspect, the present application provides a random number generator, the random number generator comprising: a write driver, a magnetic tunnel junction, a read circuit and a counter circuit connected in sequence; the magnetic tunnel junction is a device that switches between a stable state and an unstable state;
[0007] The write driver is used to provide a write pulse for the magnetic tunnel junction;
[0008] The magnetic tunnel junction is used to enter a steady state after a relaxation time from an unstable state after the excitation of the write pulse ends;
[0009] The read circuit is used to generate a read voltage based on the resistance value of the magnetic tunnel junction and output a preset signal within a relaxation time;
[0010] The counter circuit is used to count the clock signal based on the preset signal to obtain a random number matching the relaxation time.
[0011] Optionally, the read circuit includes a read current generating structure, a comparator structure and a signal gating structure, wherein the read current generating structure is used to provide a read current for the magnetic tunnel junction;
[0012] The comparator structure is used to receive the read voltage, and compare the read voltage with a reference voltage to determine a comparison result;
[0013] The signal gating structure is used to output a preset signal after caching based on the comparison result.
[0014] Optionally, the read current generating structure includes a clamp transistor, and the clamp transistor is used to regulate the magnitude of the read current based on a clamp voltage.
[0015] Optionally, the reference voltage is greater than a read voltage when the magnetic tunnel junction is in a low resistance state, and is less than a read voltage when the magnetic tunnel junction is in a high resistance state.
[0016] Optionally, the comparator structure includes a charging structure, a latching structure and a voltage receiving structure;
[0017] One end of the charging structure is connected to a power source for controlling charging based on a clock signal; the other end of the charging structure is connected to one end of the latch structure, and the latch structure is used to regulate the voltage of the target end according to the read voltage and the reference voltage; the other end of the latch structure is connected to the voltage receiving structure, and the voltage receiving structure is used to receive the read voltage and the reference voltage and determine the magnitude of the read voltage and the reference voltage.
[0018] Optionally, the other end of the voltage receiving structure is grounded, and the voltage receiving structure is further used to control the conduction of a circuit corresponding to the comparator structure based on a clock signal.
[0019] Optionally, the counter circuit includes a plurality of D flip-flops and switch devices;
[0020] The switch device is connected to the reading circuit and the external module respectively, and is used to control the access of the clock signal based on the preset signal;
[0021] The clock input terminal of the first D flip-flop receives the clock signal, and then the clock input terminal of each D flip-flop is connected to the inverting output terminal of the previous D flip-flop; the data terminal of each D flip-flop is connected to its own inverting output terminal.
[0022] Optionally, a reset terminal of each D flip-flop is connected to an external module for receiving a write signal and controlling its own reset based on the size of the write signal.
[0023] Optionally, the magnetic tunnel junction is a spin-orbit moment magnetic tunnel junction;
[0024] The spin-orbit moment magnetic tunnel junction comprises a magnetic functional layer; the magnetic functional layer is located at any position of the inner layer of the spin-orbit moment magnetic tunnel junction or the outer layer of the spin-orbit moment magnetic tunnel junction; the magnetic functional layer is used to change the length of the relaxation time.
[0025] In a second aspect, the present application provides a method for generating random numbers, the method being applied to the random number generator; the random number generator comprising: a write driver, a magnetic tunnel junction, a read circuit and a counter circuit connected in sequence; the magnetic tunnel junction is a device that switches between a stable state and an unstable state; the method comprising:
[0026] Providing a write pulse to the magnetic tunnel junction by the write driver;
[0027] After the excitation of the write pulse ends, the magnetic tunnel junction enters a steady state after a relaxation time from an unstable state;
[0028] Outputting a preset signal within a relaxation time by generating a read voltage through the read circuit according to the resistance value of the magnetic tunnel junction;
[0029] The clock signal is counted by the counter circuit based on the preset signal to obtain a random number matching the relaxation time.
[0030] In summary, the present application provides a random number generator and a method for generating random numbers. The random number generator includes: a write driver, a magnetic tunnel junction, a read circuit and a counter circuit connected in sequence. The magnetic tunnel junction is a device that switches between a steady state and an unstable state. Therefore, in the present application, the magnetic tunnel junction is a random entropy source with relaxation characteristics. Specifically, the write driver is used to provide a write pulse for the magnetic tunnel junction. After the write pulse ends, the magnetic tunnel junction enters a steady state after a relaxation time from an unstable state. Since the resistance of the magnetic tunnel junction in the steady state and the unstable state is different, the read circuit can generate a read voltage after connecting to the top of the magnetic tunnel junction after generating a read current, and based on the read current, the read voltage is generated. The voltage is taken to output a preset signal within the relaxation time. When the preset signal is a conduction signal, the counter circuit controls the switch to be turned on based on the conduction signal, and the counter circuit is connected to the clock signal to start counting. In the first clock cycle after the relaxation time ends, the preset signal output by the reading circuit becomes a disconnection signal. The counter circuit controls the switch to be disconnected based on the disconnection signal, and the clock signal is no longer connected to the counter circuit. At this time, the output of the counter circuit is a random number. In this way, due to the addition of a magnetic tunnel junction design to the random number generator, the random number generator has a higher random number quality and Shannon entropy, and at the same time, the structure of the random number generator is simplified, so that the circuit operation of the random number generator is simple. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0032] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;
[0033] Figure 2 A structural block diagram of a random number generator is provided for this application;
[0034] Figure 3 An operation flow chart of a random number generator provided in an embodiment of the present application;
[0035] Figure 4 A schematic diagram of the structure of a write driver provided in an embodiment of the present application;
[0036] Figure 5A A schematic diagram of the structure of a reading circuit provided in an embodiment of the present application;
[0037] Figure 5B A schematic diagram of a comparator structure provided in an embodiment of the present application;
[0038] Figure 6 A schematic diagram of the structure of a counter circuit provided in an embodiment of the present application;
[0039] Figure 7 A waveform diagram of the signal output provided by the embodiment of the present application;
[0040] Figure 8 A schematic diagram of the structure of an optimized magnetic tunnel junction provided in an embodiment of the present application;
[0041] Fig. 9 A flowchart of a method for generating random numbers is provided for this application.
[0042] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0043] In order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first", "second" and the like are used to distinguish the same items or similar items with substantially the same functions and effects. For example, the first device and the second device are only used to distinguish different devices, and their order is not limited. Those skilled in the art can understand that the words "first", "second" and the like do not limit the quantity and execution order, and the words "first", "second" and the like do not necessarily limit them to be different.
[0044] It should be noted that, in this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in this application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0045] In the present application, "at least one" means one or more, and "plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0046] PRNG is generally generated by an algorithm and has predictable regularity, so it cannot be called a true random number generator; while TRNG comes from unpredictable physical phenomena and uses the randomness brought by physical properties to generate true random numbers, which has unpredictable characteristics.
[0047] Since the random number probability generated by a conventional random number generator is often not completely accurate, in a possible implementation method, a low-cost random number generator is used, and the random number generator includes a random source, a reset module, a write module, a current dynamic regulation module, a read module and a clock control module. The current dynamic regulation module, the write module, the random source and the read module are connected in sequence; the current dynamic regulation module is used to receive binary data information of random calculations and pass the binary data information to the write module, and the write module is used to generate a random current and provide it to the random source, so that the random source provides an original random signal, which is passed to the read module for amplification and reading; the reset module is connected to the random source to provide the random source with a current to restore the initial state; the clock control module is respectively connected to the reset module, the write module, the current dynamic regulation module and the read module to provide a clock signal to the reset module, the write module, the current dynamic regulation module and the read module.
[0048] Among them, each cycle starts from the reset stage, and the clock control module can provide a clock signal to the reset module and the write module to control the reset module and the write module to be turned on. After the reset module is turned on, the current to restore the initial state can be provided to the random source; further, the current dynamic adjustment module receives the binary data information of the random calculation, and passes the binary data information to the write module. After the write module is turned on, a random current can be generated and provided to the random source, so that the random source provides the original random signal, and passes it to the reading module for amplification and reading to generate a random number.
[0049] However, the operation process of generating random numbers by the above random number generator is complicated, the quality of the generated random numbers is poor, and the probability of generating random numbers is not completely certain.
[0050] In view of the above problems, the present application provides a random number generator for solving the problem of poor randomness of current random number generators. The random number generator includes: a write driver, a magnetic tunnel junction (MTJ), a read circuit and a counter circuit connected in sequence. The magnetic tunnel junction is a device that switches between a steady state and an unstable state. Therefore, in the present application, the magnetic tunnel junction is a random entropy source with relaxation characteristics. Specifically, the write driver is used to provide a write pulse for the magnetic tunnel junction. After the write pulse ends, the magnetic tunnel junction enters a steady state after a relaxation time from an unstable state. Since the resistance of the magnetic tunnel junction in the steady state and the unstable state is different, the read circuit can generate a read voltage after connecting to the top of the magnetic tunnel junction after generating a read current, and output a preset signal based on the read voltage within the relaxation time. When After the preset signal becomes a conduction signal, the counter circuit controls the switch to be turned on based on the conduction signal, the counter circuit receives the clock signal and starts counting, and in the first clock cycle after the relaxation time ends, the preset signal output by the reading circuit becomes a disconnection signal, the counter circuit controls the switch to be disconnected based on the disconnection signal, and the clock signal is no longer connected to the counter circuit. At this time, the output of the counter circuit is a random number. In this way, due to the addition of a magnetic tunnel junction design to the random number generator, the random number generator has a higher random number quality and Shannon entropy, and at the same time, the structure of the random number generator is simplified, so that the circuit operation of the random number generator is simple.
[0051] Since the random number generator has very strict requirements on probability-controlled pulses, insufficient design accuracy, process deviations, and even slight external influences may cause the output probability to deviate from 50%. In some application scenarios where the Shannon entropy is required to be close to 1, such as large-scale promotion of large models and edge computing of big data, the random number generator provided in this application can be used. Alternatively, in some applications of random event matching in cryptography, games, and entertainment, the random number generator provided in this application can also be used. The embodiments of this application do not limit the specific application scenarios.
[0052] For example, Figure 1 A schematic diagram of an application scenario provided in an embodiment of the present application, such as Figure 1 As shown, taking the application scenario of edge computing of big data as an example, the application scenario includes: an edge computing platform 101, a first edge cloud 102, a second edge cloud 103 and a third edge cloud 104; when the edge computing platform 101 needs to distribute a large number of tasks to be processed among multiple edge cloud nodes, a random number can be generated based on a random number generator to randomly assign tasks to different computing nodes. For example, based on the random number generated by the random number generator, a large number of tasks to be processed can be randomly assigned to the first edge cloud 102, the second edge cloud 103 and the third edge cloud 104 for processing to optimize resource utilization and performance and avoid single point overload.
[0053] Among them, since the random number generator provided by this application has very high reliability and anti-interference ability, and has high random number quality and Shannon entropy, it can adapt well to the application scenarios of edge computing of big data, reasonably allocate tasks to be processed, and achieve load balancing while ensuring random allocation.
[0054] It should be noted that the embodiments of the present application do not specifically limit the number of nodes allocated to different computing nodes or edge clouds, which can be determined based on the actual application scenario. The above is only an example.
[0055] For example, Figure 2 A random number generator is provided for this application. Figure 2 As shown, the random number generator includes: a write driver, a magnetic tunnel junction, a read circuit and a counter circuit connected in sequence; the magnetic tunnel junction is a device that switches between a stable state and an unstable state;
[0056] The write driver is used to provide a write pulse for the magnetic tunnel junction;
[0057] The magnetic tunnel junction is used to enter a steady state after a relaxation time from an unstable state after the excitation of the write pulse ends;
[0058] The read circuit is used to generate a read voltage according to the resistance value of the magnetic tunnel junction and output a preset signal within a relaxation time;
[0059] The counter circuit is used to count the clock signal based on the preset signal to obtain a random number matching the relaxation time.
[0060] In the embodiment of the present application, the magnetic tunnel junction has the characteristics of low power consumption and high durability. The magnetic tunnel junction is a three-terminal device and a device that has been specially optimized in structure, that is, it can switch between a steady state and an unstable state; specifically, its state after writing will flip back to a steady state after a random relaxation time, and the time for the state to flip back to the steady state is output as a random number, and the steady state can also be called a ground state.
[0061] Among them, the relaxation time can be understood as the time corresponding to the transition from the unstable state to the stable state, and the stable state may include a high resistance state or a low resistance state; the unstable state may also include a high resistance state or a low resistance state; the transition from the unstable state to the stable state may be from a high resistance state to a low resistance state, or from a low resistance state to a high resistance state. The embodiment of the present application does not make specific limitations on this, and it can be determined based on the actual application scenario.
[0062] It should be noted that the magnetic tunnel junction, as a random entropy source with relaxation characteristics, has a single steady state when there is no write current, changes from the steady state to the unstable state in a relatively short time when there is current writing, and returns to the steady state after a random relaxation time after the write current is removed; the transition between the unstable state and the steady state of the magnetic tunnel junction has inherent randomness, and the probability of random numbers generated by this randomness is deterministic.
[0063] Since the state transition and relaxation time of a magnetic tunnel junction is usually very short, the random number generator can quickly generate random numbers. For application scenarios that require high-throughput random numbers, such as encryption and secure communications, the random number generator provided in this application can be well applied. In addition, the power consumption of a magnetic tunnel junction is usually low, especially during the transition between an unstable state and a steady state. Therefore, the random number generator provided in this application can also be suitable for power-sensitive applications.
[0064] In the present application, the write pulse is usually a short high-level or low-level signal; the preset signal is a switching signal that always exists, including an on-signal and an off-signal. For example, during the relaxation time, when the preset signal is 1, it corresponds to the on-signal, controlling the switch of the counter circuit to be on; when the preset signal is 0, it corresponds to the off-signal, controlling the switch of the counter circuit to be off.
[0065] For example, Figure 3 The operation flow chart of the random number generator provided in the embodiment of the present application is as follows: Figure 3 As shown, after the random number generator starts working, the write signal (WRITE) is set high, the write driver generates a write pulse, and outputs the write pulse to the magnetic tunnel junction, so that the magnetic tunnel junction is placed in a non-stable state with a low resistance state. At this time, the counter circuit is reset. Further, after the write signal ends, the write signal is set low, which is equivalent to the end of the write pulse. At this time, the magnetic tunnel junction enters a stable state after a relaxation time from the non-stable state. The read circuit generates a read voltage based on the resistance value of the magnetic tunnel junction, and outputs a preset signal within the relaxation time. When the preset signal output by the read circuit is 1, the switch of the counter circuit is turned on, and the counter circuit is connected to the clock signal to start counting.
[0066] Furthermore, in the first clock cycle after the relaxation time ends, the preset signal output by the reading circuit becomes 0, the counter circuit switch is disconnected, and the clock signal is no longer connected to the counter circuit. At this time, the counter circuit outputs a random number; wherein, the random number can be represented in the form of an array. The embodiment of the present application does not specifically limit the number of random numbers contained in the array, which can be artificially regulated or determined based on the number of counters in the counter circuit.
[0067] It should be noted that the embodiments of the present application do not limit the specific structures corresponding to the write drive, magnetic tunnel junction, read circuit and counter circuit. They can perform corresponding functions respectively. For example, the read circuit can output a preset signal within the relaxation time.
[0068] Therefore, the embodiment of the present application utilizes the physical properties of the magnetic tunnel junction in the random number generator to generate random numbers, and high-quality random numbers can be obtained. Moreover, the present application can be implemented through a simple circuit, including a write drive, a magnetic tunnel junction, a read circuit, and a counter circuit. Compared with complex algorithms or circuit implementations, this implementation method is simpler and more efficient.
[0069] Optional, Figure 4 A schematic diagram of the structure of the write driver provided in the embodiment of the present application is shown in FIG. Figure 4 As shown, the write driver includes a first transistor 401 , and the first transistor 401 is configured to be in a conducting state after receiving a write signal to provide a write pulse for the magnetic tunnel junction 402 .
[0070] like Figure 4 As shown, the write drive module includes a transistor structure, such as a first transistor 401, which is used to control the write pulse of the magnetic tunnel junction 402. Taking the steady state as a high-resistance state and the unstable state as a low-resistance state as an example, in the write stage, the first transistor 401 is turned on, and the magnetic tunnel junction 402 changes from a steady-state high-resistance state to an unstable low-resistance state under the stimulation of the write drive, and after the stimulation ends, the unstable state changes from the low-resistance state back to the high-resistance state after maintaining the relaxation time.
[0071] Among them, taking the transistor as a bipolar junction transistor as an example, the collector (Collector, C) end of the first transistor 401 is connected to the power supply voltage VDD for obtaining current from the power supply; the base (Base, B) end of the first transistor 401 is connected to the external module for receiving a write signal, and the emitter (Emitter, E) end of the first transistor 401 is connected to the A end of the magnetic tunnel junction 402; the magnetic tunnel junction 402 is a three-terminal device, corresponding to the A end, the B end and the C end, and the C end of the magnetic tunnel junction 402 is grounded.
[0072] Optionally, the first transistor 401 is a P-type transistor.
[0073] It should be noted that the relaxation time of the non-steady-state maintenance is not related to the width and amplitude of the write pulse, but is related to the characteristics of the magnetic tunnel junction. The embodiment of the present application does not specifically limit the number of transistors included in the write driver. The write driver can only serve to provide a write pulse for the magnetic tunnel junction.
[0074] Therefore, the embodiment of the present application can achieve precise control of the write pulse based on a single transistor, and using a transistor as a switching element to control the write pulse can simplify circuit design.
[0075] Optional, exemplary, Figure 5A A schematic diagram of the structure of the reading circuit provided in the embodiment of the present application is shown in FIG. Figure 5A As shown, the read circuit includes a read current generating structure 501, a comparator structure 502 and a signal gating structure 503; wherein the read current generating structure 501 is used to provide a read current for the magnetic tunnel junction 504;
[0076] The comparator structure 502 is used to receive the read voltage, and compare the read voltage with a reference voltage to determine a comparison result;
[0077] The signal gating structure 503 is used to output a preset signal after caching the comparison result.
[0078] Optional, such as Figure 5A As shown, the first end of the magnetic tunnel junction 504 is connected to the write driver; the second end of the magnetic tunnel junction 504 is connected to the read current generating structure 501; and the third end of the magnetic tunnel junction 504 is connected to the ground.
[0079] The comparator structure 502 is connected to the connection end of the read current generating structure 501 and the magnetic tunnel junction 504, and is used to receive the clock signal and the read voltage, and when the clock signal is in a high level state, compares the read voltage with the reference voltage to determine the comparison result; the comparator structure 502 is also connected to the signal selection structure 503.
[0080] Among them, the comparator structure 502 can adopt a dynamic comparator structure or a static comparator structure. For example, the comparator structure 502 can be a sensitive amplifier structure, and the sensitive amplifier is a dynamic comparator. The embodiment of the present application does not limit the specific structures corresponding to the read current generating structure 501, the comparator structure 502 and the signal selection structure 503, which can be structures composed of any devices respectively. The read current generating structure 501 only needs to provide a read current for the magnetic tunnel junction, the comparator structure 502 only needs to receive the read voltage, compare the read voltage with the reference voltage, and determine the comparison result. The signal selection structure 503 only needs to output a preset signal based on the comparison result cache.
[0081] Optionally, the reference voltage is greater than a read voltage when the magnetic tunnel junction 504 is in a low resistance state, and is less than a read voltage when the magnetic tunnel junction 504 is in a high resistance state.
[0082] Among them, the reference voltage selected should be greater than the read voltage when the magnetic tunnel junction 504 is in a low-resistance state, that is, greater than the product of the read current and the low-resistance resistance of the magnetic tunnel junction 504, and less than the read voltage when the magnetic tunnel junction 504 is in a high-resistance state, that is, less than the product of the read current and the high-resistance resistance of the magnetic tunnel junction 504. The reference voltage is a pre-set value that meets the above requirements, and can be set based on application scenario requirements or users. The specific value corresponding to the reference voltage is not limited in the embodiments of the present application.
[0083] For example, Figure 5A As shown, the A end of the magnetic tunnel junction 504 is connected to the read current generating structure 501; the B end of the magnetic tunnel junction 504 is connected to the write driver, and the C end of the magnetic tunnel junction 504 is grounded.
[0084] In an embodiment of the present application, a clock signal is provided by an external module. The clock signal is a periodic square wave signal and is used for various operations in the synchronization circuit, such as generating timing signals at specific time intervals, synchronizing counters, and other operations. The embodiment of the present application does not limit the period size of the clock signal, but the user can manually adjust the clock period so that the counter circuit outputs random arrays of different lengths.
[0085] like Figure 5A As shown, the read current generating structure 502 can be connected to the write signal and the clamping voltage; the clamping voltage is used to regulate the magnitude of the read current of the magnetic tunnel junction 504. After the magnetic tunnel junction 504 is connected to the read current, a read voltage can be generated at the top thereof. When the read voltage is too large, the tunnel magnetoresistance (TMR) of the magnetic tunnel junction 504 will decrease. Therefore, by artificially adjusting the clamping voltage, the read voltage can be made within a reasonable threshold range.
[0086] Further, when it is determined based on the comparator structure 502 whether the reference voltage is greater than the read voltage, and when it is determined based on the comparison result that the reference voltage is greater than the read voltage, the comparison result is that the signal corresponding to point Q1 is logic 1, and the signal corresponding to point Q2 is logic 0; when it is determined that the reference voltage is less than the read voltage, the comparison result is that the signal corresponding to point Q1 is logic 0, and the signal corresponding to point Q2 is logic 1.
[0087] It should be noted that the comparator structure performs comparison operations when the clock signal is in a high-level state, which can achieve fast signal processing and response. By comparing the read voltage with the reference voltage through the comparator structure, the high-resistance state and the low-resistance state of the magnetic tunnel junction can be accurately distinguished, thereby achieving high-precision reading operations.
[0088] Therefore, the embodiment of the present application uses a comparator structure to accurately compare the read voltage with the reference voltage, thereby determining the state of the magnetic tunnel junction, that is, whether it is a high-resistance state or a low-resistance state. This high-precision comparison helps to improve the accuracy of data reading, and the comparator structure performs voltage comparison when the clock signal is in a high-level state, which can achieve high-speed data reading operations. The synchronous control of the clock signal also ensures a rapid response of the reading process. Furthermore, the signal selection structure can also output a preset signal based on the comparison result, ensuring the accuracy and stability of data transmission. In addition, the present application simplifies the circuit design by integrating the read current generation, comparator and signal selection structure, which helps to reduce circuit board space and manufacturing costs while improving integration.
[0089] Optionally, the read current generating structure includes a clamp transistor, and the clamp transistor is used to regulate the magnitude of the read current based on a clamp voltage.
[0090] For example, Figure 5A As shown, the read current generating structure 501 includes a second transistor 5011 and a third transistor 5012; the first end of the second transistor 5011 is connected to a power supply, the second end of the second transistor 5011 is connected to an external module for receiving a write signal and controlling the second transistor 5011 to be turned on, and the third end of the second transistor 5011 is connected to the first end of the third transistor 5012; the second end of the third transistor 5012 is connected to an external module for receiving a clamping voltage and regulating the magnitude of the read current based on the clamping voltage; the third end of the third transistor 5012 is connected to the second end of the magnetic tunnel junction 504 so that the magnetic tunnel junction 504 generates a read voltage based on the read current.
[0091] The second transistor and the third transistor can also be designed to be turned off when reading current is not needed, thereby reducing unnecessary power consumption.
[0092] Exemplarily, taking the transistor as a bipolar junction transistor as an example, the C terminal of the second transistor 5011 is connected to the power supply voltage VDD for obtaining current from the power supply; the B terminal of the second transistor 5011 is connected to the external module for receiving a write signal, the E terminal of the second transistor 5011 is connected to the C terminal of the third transistor 5012, the B terminal of the third transistor 5012 is connected to the external module for receiving a clamping voltage, and the E terminal of the third transistor 5012 is connected to the A terminal of the magnetic tunnel junction 504; wherein, after the write signal ends, since the clamping voltage is applied to the B terminal, the third transistor 5012 is turned on, and then the size of the read current is regulated based on the clamping voltage, so that the magnetic tunnel junction 504 generates a read voltage after the read current is connected.
[0093] The second transistor may be a P-type transistor, and the third transistor may be an N-type transistor.
[0094] Therefore, the embodiment of the present application can accurately control the read current flowing through the magnetic tunnel junction through the design of the clamping transistor, and the design of integrating the clamping transistor in the read current generating structure can improve the reliability of the circuit while simplifying the circuit design structure; wherein, the third transistor regulates the magnitude of the read current based on the clamping voltage, so that the magnitude of the read current can be adjusted according to specific needs, so that it can adapt to different application needs; the second transistor is used to receive the write signal and control its conduction state, and the third transistor is used to regulate the magnitude of the read current. This design reduces the possibility of current fluctuations and voltage instability, thereby improving the reliability and stability of the circuit.
[0095] Optionally, the comparator structure 502 includes a charging structure 5021, a latch structure 5022 and a voltage receiving structure 505; one end of the charging structure 5021 is connected to a power supply for controlling charging based on a clock signal; the other end of the charging structure 5021 is connected to one end of the latch structure 5022, and the latch structure 5022 is used to regulate the voltage of the target end according to the read voltage and the reference voltage; the other end of the latch structure 5022 is connected to the voltage receiving structure 505, and the voltage receiving structure 505 is used to receive the read voltage and the reference voltage, and determine the magnitude of the read voltage and the reference voltage.
[0096] Among them, the target end is the output end preset in the comparator structure for determining the comparison result, such as Figure 5A As shown, it may be the first target point Q1 or the second target point Q2.
[0097] It should be noted that the embodiment of the present application does not limit the specific structures corresponding to the charging structure 5021, the latch structure 5022 and the voltage receiving structure 505, and they can play corresponding functions respectively, such as the charging structure 5021 can play the function of controlling charging.
[0098] Optionally, the other end of the voltage receiving structure 505 is grounded, and the voltage receiving structure 505 is further used to control the conduction of a circuit corresponding to the comparator structure 502 based on a clock signal.
[0099] For example, Figure 5A As shown, the voltage receiving structure 505 includes a fourth transistor 5023, a fifth transistor 5024 and a sixth transistor 5025; the first end of the fourth transistor 5023 is connected to the latch structure 5022; the second end of the fourth transistor 5023 is connected to the connection end of the third transistor 5012 and the magnetic tunnel junction 504, for receiving a read voltage; the third end of the fourth transistor 5023 is connected to the first end of the sixth transistor 5025;
[0100] A first end of the fifth transistor 5024 is connected to the latch structure 5022; a second end of the fifth transistor 5024 is connected to an external module for receiving a reference voltage; a third end of the fifth transistor 5024 is connected to a first end of the sixth transistor 5025;
[0101] The second end of the sixth transistor 5025 is connected to the external module for receiving the clock signal; the third end of the sixth transistor 5025 is grounded, and the sixth transistor 5025 is used to control the circuit corresponding to the comparator structure 502 to be turned on based on the clock signal, that is, when the clock signal is in a high level state, the sixth transistor 5025 is turned on and performs a leakage operation, and at this time, the read voltage and the reference voltage are compared; when the clock signal is in a low level state, the sixth transistor 5025 is turned off and does not perform a leakage operation;
[0102] The latch structure 5022 is connected to the first target point Q1 and the second target point Q2, respectively, and is used to control the first target point Q1 or the second target point Q2 to be at the power supply voltage; the first end of the charging structure 5021 is connected to the first target point Q1 and the second target point Q2, respectively; the second end of the charging structure 5021 is connected to an external module, and is used to receive a clock signal; the third end of the charging structure 5021 is connected to a power supply, and the charging structure is used to charge the first target point Q1 and the second target point Q2, respectively, when the clock signal is in a low level state.
[0103] Optionally, the fourth transistor 5023, the fifth transistor 5024 and the sixth transistor 5025 may all be N-type transistors.
[0104] Among them, the embodiment of the present application does not limit the specific circuit structures corresponding to the latch structure 5022 and the charging structure 5021, as long as they can play the corresponding charging and locking functions, such as they can respectively include multiple transistors.
[0105] In an embodiment of the present application, when the clock signal is in a low level state, the comparator structure 502 charges the Q1 point and the Q2 point based on the charging structure 5021, and when the clock signal is in a high level state, compares the read voltage with the reference voltage; wherein, when the reference voltage is greater than the read voltage, the comparison result is that the Q point is logic 1 and the Q2 point is logic 0; when the reference voltage is less than the read voltage, the comparison result is that the Q point is logic 0 and the Q2 point is logic 1.
[0106] It should be noted that when there is a difference between the reference voltage and the read voltage, the discharge speeds of the first target point Q1 and the second target point Q2 will be different. The voltage drops faster at the end with faster discharge. At this time, for the end with slower discharge, it is necessary to control the end with slower discharge to be in the power supply voltage state based on the latch structure.
[0107] It can be understood that the charging structure 5021 charges when the clock signal is in a low level state, and stops charging when it is in a high level state. This design can effectively reduce power consumption, and the combination of the latch structure 5022 and the charging structure 5021 can accurately control the voltage states of the first target point Q1 and the second target point Q2, ensuring the accuracy and consistency of signal processing.
[0108] Exemplarily, taking the transistor as a bipolar junction transistor as an example, the C terminal of the fourth transistor 5023 is connected to the latch structure 5022; the B terminal of the fourth transistor 5023 is connected to the connection terminal of the third transistor 5012 and the magnetic tunnel junction 504, for receiving the read voltage; the E terminal of the fourth transistor 5023 is connected to the C terminal of the sixth transistor 5025;
[0109] The C terminal of the fifth transistor 5024 is connected to the latch structure 5022; the B terminal of the fifth transistor 5024 is connected to the external module for receiving the reference voltage; the E terminal of the fifth transistor 5024 is connected to the C terminal of the sixth transistor 5025;
[0110] The B terminal of the sixth transistor 5025 is connected to the external module for receiving the clock signal; the E terminal of the sixth transistor 5025 is grounded, and the sixth transistor 5025 is used to control the conduction of the circuit corresponding to the comparator structure 502 based on the clock signal.
[0111] Among them, the fast switching characteristics of the transistor enable the comparator structure to quickly respond to changes in the input signal. The embodiment of the present application does not specifically limit the type of transistor.
[0112] In this way, in the embodiment of the present application, the comparator structure improves the reliability of the circuit through the combined design of the charging structure and the latch structure, wherein the charging structure is charged when the clock signal is in a low level state, and the latch structure controls the target end to be at the power supply voltage. This design reduces the possibility of current fluctuations and voltage instability, thereby improving the reliability and stability of the circuit; the fifth transistor is used to receive the reference voltage, so that the comparison of the read voltage can be adjusted according to specific needs, thereby improving the flexibility of the circuit design, and by integrating the charging structure, latch structure and voltage receiving structure in the comparator structure, the circuit design can be simplified.
[0113] Optional, such as Figure 5A As shown, the charging structure 5021 includes a seventh transistor 521, an eighth transistor 522 and a ninth transistor 523;
[0114] A first end of the seventh transistor 521 is connected to a power source; a second end of the seventh transistor 521 is connected to an external module for receiving a clock signal; a third end of the seventh transistor 521 is connected to a first target point Q1, and the seventh transistor 521 is used to charge the first target point Q1 after receiving the clock signal;
[0115] A first end of the eighth transistor 522 is connected to a power source; a second end of the eighth transistor 522 is connected to an external module for receiving a clock signal; a third end of the eighth transistor 522 is connected to a second target point Q2, and the eighth transistor 522 is used to charge the second target point Q2 after receiving the clock signal;
[0116] The first end of the ninth transistor 523 is connected to the seventh transistor 521; the second end 523 of the ninth transistor is connected to the external module for receiving a clock signal; the third end of the ninth transistor 523 is connected to the eighth transistor 522, and the ninth transistor 523 is used to balance the charges corresponding to the first target point Q1 and the second target point Q2 after receiving the clock signal.
[0117] For example, taking the transistor as a bipolar junction transistor, the C terminal of each transistor corresponds to the first terminal, the B terminal corresponds to the second terminal, and the E terminal corresponds to the third terminal. Based on the corresponding logic, the connection relationship between each transistor and each module or structure can be obtained. For details, please refer to the description of the above embodiment, which will not be repeated here.
[0118] In the present application, the seventh transistor and the eighth transistor are used to charge the first target point and the second target point, respectively. By receiving the clock signal, the target end can be quickly charged when needed, thereby improving the charging efficiency and realizing a high-speed charging process. By controlling the conduction state of the seventh transistor and the eighth transistor through the clock signal, precise control of the charging process can be achieved, ensuring the accuracy and consistency of the charging process.
[0119] The ninth transistor is used to balance the charges flowing through the first target point Q1 and the second target point Q2 after receiving the clock signal, which helps to prevent charge imbalance, ensure uniform charge distribution at the two target points, and avoid circuit performance problems caused by charge imbalance.
[0120] Optionally, the seventh transistor, the eighth transistor and the ninth transistor may all be P-type transistors.
[0121] Therefore, the present application can achieve the above functions by integrating the seventh transistor, the eighth transistor and the ninth transistor into the charging structure, thereby simplifying the circuit design.
[0122] Optional, such as Figure 5AAs shown, the latch structure 5022 includes a tenth transistor 525, an eleventh transistor 526, a twelfth transistor 527 and a thirteenth transistor 528;
[0123] A first terminal of the tenth transistor 525 is connected to a power source; a second terminal of the tenth transistor 525 is connected to a second target point Q2; a third terminal of the tenth transistor 525 is connected to a first target point Q1;
[0124] A first terminal of the eleventh transistor 526 is connected to a power source; a second terminal of the eleventh transistor 526 is connected to a first target point Q1; a third terminal of the eleventh transistor 526 is connected to a second target point Q2;
[0125] A first terminal of the twelfth transistor 527 is connected to the first target point Q1; a second terminal of the twelfth transistor 527 is connected to the second terminal of the tenth transistor 525; a third terminal of the twelfth transistor 527 is connected to the first terminal of the fourth transistor 5023;
[0126] A first terminal of the thirteenth transistor 528 is connected to the second target point Q2; a second terminal of the thirteenth transistor 528 is connected to the second terminal of the eleventh transistor 526; a third terminal of the thirteenth transistor 528 is connected to a first terminal of the fifth transistor 5024;
[0127] When the tenth transistor 525 is in the on state, the twelfth transistor 527 is in the off state; when the eleventh transistor 526 is in the on state, the thirteenth transistor 528 is in the off state.
[0128] In the present application, if the voltage of the first target point Q1 drops faster, the eleventh transistor 526 corresponding to the second target point Q2 can be turned on, so that the second target point Q2 is at a high voltage equal to the power supply. At this time, the thirteenth transistor 528 is in a closed state, and then the voltage at the second target point Q2 is locked at a high voltage. At this time, the first target point Q1 can drop to 0 quickly; correspondingly, if the voltage of the second target point Q2 drops faster, the tenth transistor 525 corresponding to the first target point Q1 can be turned on, so that the first target point Q1 is at a high voltage equal to the power supply. At this time, the twelfth transistor 527 is in a closed state, and then the voltage at the first target point Q1 is locked at a high voltage. At this time, the second target point Q2 can drop to 0 quickly, so that the discharge rate can be accelerated.
[0129] Optionally, the tenth transistor 525 and the eleventh transistor 526 may both be P-type transistors; the twelfth transistor 527 and the thirteenth transistor 528 may both be N-type transistors.
[0130] Therefore, the embodiment of the present application can achieve high-reliability data latching by using the tenth transistor and the eleventh transistor to control the voltage states of the first target point and the second target point respectively. The interlocking design of the twelfth transistor and the thirteenth transistor ensures that when one transistor is turned on, the other transistor is in the off state, thereby avoiding data conflicts and misoperations, and a stable latching function can be achieved. This design ensures the stability of the latch structure in different states and avoids unnecessary state reversals. In addition, the latch structure improves the stability of the circuit through the combined design of the tenth transistor, the eleventh transistor, the twelfth transistor and the thirteenth transistor.
[0131] Optional, such as Figure 5A As shown, the signal gating structure 503 includes a multiplexer 5031 and a buffer device 5032;
[0132] The first input terminal of the multiplexer 5031 is connected to the first target point Q1; the second input terminal of the multiplexer 5031 is connected to the second target point Q2; the output terminal of the multiplexer 5031 is connected to the cache device 5032; the multiplexer 5031 is used to determine the preset signal based on the requirements of the counter circuit; the cache device 5032 is used to cache the preset signal and output it to the counter circuit.
[0133] Among them, the multiplexer (MUX) 5031 is an important digital circuit element, which is used to select a signal from multiple input signals and transmit it to the cache device 5032.
[0134] Exemplarily, the multiplexer 5031 can select one of the signals at points Q1 and Q2 according to the needs of the counter circuit and output it based on the cache of the cache device 5032. For example, the signal at point Q1 can be selected as the output; wherein the cache device 5032 can be a buffer device. The embodiment of the present application does not specifically limit the type of the cache device. The cache device 5032 plays a buffering role in the signal transmission process, reduces the delay and jitter in the signal transmission, and improves the stability and reliability of the signal selection structure.
[0135] Therefore, the embodiment of the present application can flexibly select the signals of the first target point and the second target point by using a multiplexer. The multiplexer determines the preset signal according to the requirements of the counter circuit, thereby realizing dynamic selection and switching of different signal sources, meeting the requirements of different application scenarios, and improving the flexibility of application. The multiplexer transmits the selected signal to the cache device, and the cache device outputs the cached preset signal to the counter circuit. In this way, the efficiency of data transmission can be improved, ensuring that the signal will not be lost or interfered with during the transmission process, thereby improving the stability of data transmission.
[0136] For example, Figure 5B A schematic diagram of a comparator structure provided in an embodiment of the present application is shown in FIG. Figure 5B As shown, the comparator structure 502 is connected to the connection end of the read current generating structure 501 and the magnetic tunnel junction 504, and the comparator structure 502 includes a fourteenth transistor 531, a fifteenth transistor 532, a sixteenth transistor 533, a seventeenth transistor 534, an eighteenth transistor 535, a nineteenth transistor 536, a twentieth transistor 537, a twenty-first transistor 538, a twenty-second transistor 539, an inverter 540 and a capacitor 541.
[0137] The first end of the fourteenth transistor 531 is connected to the power supply; the second end of the fourteenth transistor 531 is connected to the connection end of the eighteenth transistor 535 and the twentieth transistor 537; the third end of the fourteenth transistor 531 is connected to the first end and the second end of the sixteenth transistor 533 respectively;
[0138] A first terminal of the fifteenth transistor 532 is connected to a power supply; a second terminal of the fifteenth transistor 532 is connected to a connection terminal of the nineteenth transistor 536 and the twenty-first transistor 538; a third terminal of the fifteenth transistor 532 is connected to a first terminal of the seventeenth transistor 534, an input terminal of the inverter 540, and one terminal of the capacitor 541, respectively;
[0139] The second terminal of the sixteenth transistor 533 is also connected to the second terminal of the seventeenth transistor 534; the third terminal of the sixteenth transistor 533 is grounded;
[0140] The third terminal of the seventeenth transistor 534 is grounded; the third terminal of the seventeenth transistor 534 is also connected to the other end of the capacitor 541, so that the other end of the capacitor 541 is grounded;
[0141] A first terminal of the eighteenth transistor 535 is connected to a power supply; a second terminal of the eighteenth transistor 535 is connected to a second terminal of the nineteenth transistor 536, and a second terminal of the eighteenth transistor 535 is also connected to a connection terminal of the eighteenth transistor 535 and the twentieth transistor 537; a third terminal of the eighteenth transistor 535 is connected to a first terminal of the twentieth transistor 537;
[0142] A first terminal of the nineteenth transistor 536 is connected to a power source; a third terminal of the nineteenth transistor 536 is connected to a first terminal of the twenty-first transistor 538;
[0143] The second end of the twentieth transistor 537 is connected to the connection end of the read current generating structure 501 and the magnetic tunnel junction 504 for receiving the read voltage; the third end of the twentieth transistor 537 is connected to the first end of the twenty-second transistor 539;
[0144] The second end of the 21st transistor 538 is connected to the external module for receiving the reference voltage; the third end of the 21st transistor 538 is connected to the first end of the 22nd transistor 539;
[0145] The second terminal of the twenty-second transistor 539 is connected to the external module; the third terminal of the twenty-second transistor 539 is grounded and is used to act as a current source to enable the comparator structure 502 to maintain a constant current.
[0146] It should be noted that the five transistors inside the comparator structure 502 are first-stage transistors, including an eighteenth transistor 535, a nineteenth transistor 536, a twentieth transistor 537, a twenty-first transistor 538 and a twenty-second transistor 539, which are used to perform a first-stage amplification of the voltage value; the four transistors outside the comparator structure 502 are second-stage transistors, including a fourteenth transistor 531, a fifteenth transistor 532, a sixteenth transistor 533 and a seventeenth transistor 534, which are used to perform a second-stage amplification of the voltage value; the capacitor 541 buffers the output of the second-stage transistor, wherein when the read voltage is greater than the reference voltage, the output end of the inverter 540 outputs a high level.
[0147] Optionally, the fourteenth transistor 531, the fifteenth transistor 532, the eighteenth transistor 535 and the nineteenth transistor 536 may be P-type transistors, and the sixteenth transistor 533, the seventeenth transistor 534, the twentieth transistor 537, the twenty-first transistor 538 and the twenty-second transistor 539 may be N-type transistors.
[0148] It should be noted that Figure 5B The illustrated comparator structure 502 is a static comparator structure that does not need to receive a clock signal.
[0149] Optional, Figure 6 A schematic diagram of a counter circuit provided in an embodiment of the present application is shown in FIG. Figure 6 As shown, the counter circuit includes a plurality of D flip-flops 601 and a switch device 602; the switch device 602 is respectively connected to the reading circuit and the external module, and is used to control the access of the clock signal based on the preset signal.
[0150] In an embodiment of the present application, a plurality of D flip-flops 601 can form a binary counter, and a switch device 602 is connected to an external module for accessing a clock signal. The switch device 602 is also connected to a reading circuit for receiving a preset signal. When the preset signal is a conduction signal, the counter circuit controls the switch device 602 to open, thereby accessing the clock signal.
[0151] It should be noted that the counter circuit is easy to expand and modularize, and the number of D flip-flops can be increased or decreased as needed to adapt to different application requirements. For example, the scale of the counter circuit, that is, the number of D flip-flops, can be adjusted to output random arrays of different lengths.
[0152] Therefore, the embodiment of the present application can accurately control the access of the clock signal by using a switching device, ensuring that the clock signal triggers the D flip-flop at the correct time point, thereby improving the accuracy and reliability of the counter circuit.
[0153] Optional, such as Figure 6 As shown, multiple D flip-flops 601 are used to output random numbers through the output terminals Q of multiple D flip-flops based on the clock signal after a relaxation time; wherein the clock input terminal CP of the first D flip-flop receives the clock signal, and then the clock input terminal CP of each D flip-flop is connected to the inverting output terminal QN of the previous D flip-flop; the data terminal D of each D flip-flop is connected to its own inverting output terminal QN; the reset terminal R of each D flip-flop is connected to an external module, for receiving a write signal, and controlling its own reset based on the size of the write signal.
[0154] Among them, the Q terminal and QN are complementary output terminals. The output terminal of the D flip-flop flips in each clock cycle, thereby generating an output signal with higher randomness. The D flip-flop controls its own reset, which means clearing the random number recorded last time to avoid interference from the previous random number.
[0155] Exemplarily, after the clock signal is connected to the switch device 602, the CP terminal of the D flip-flop connected to the switch device 602 receives the clock signal. When the CP terminal rises Q=D, QN=1-Q, the CP terminal of the first D flip-flop 601 in the counter circuit receives the clock signal. Thereafter, the CP terminal of each D flip-flop is connected to the QN terminal of the previous flip-flop, so that the D terminals of all D flip-flops are connected to their own QN terminals, and the R terminals of all flip-flops receive write signals. Then, in the first clock cycle after the relaxation time ends, the preset signal output by the reading circuit becomes 0, the counter circuit switch is disconnected, and the clock signal is no longer connected to the timing circuit. At this time, the output terminals Q of all D flip-flops output the binary array corresponding to Qn-2...Q1Q0, and Qn-2...Q1Q0 is a random array.
[0156] The Q terminal of the first D flip-flop outputs Q0, which is the least significant bit (LSB) of the counter, and the Q terminal of the last D flip-flop outputs Qn-2, which is the most significant bit (MSB) of the counter.
[0157] Optionally, in response to user operations, the number of D flip-flops in the counter circuit can be adjusted so that the counter circuit outputs random arrays of different lengths. Optionally, in response to user operations, the length of the clock cycle can also be adjusted so that the counter circuit outputs random arrays of different lengths. The embodiment of the present application does not specifically limit the number of D flip-flops in the counter circuit and the length of the clock cycle. It can be set based on user or application scenario requirements, and then the length of the random array can be adjusted based on the random number generator provided by the present application.
[0158] Therefore, the embodiment of the present application can efficiently generate random numbers under the drive of a clock signal through a cascade structure of multiple D flip-flops. This structure makes the random number generation speed faster and is suitable for application scenarios that require high-frequency random numbers. Since the clock input end of each D flip-flop is connected to the inverting output end of the previous D flip-flop, this cascade structure can increase the unpredictability of random numbers and enhance the randomness and security of random numbers. The data end of each D flip-flop is connected to its own inverting output end. This self-feedback structure simplifies the circuit design, reduces the complexity of external connections, and improves the stability and reliability of the circuit.
[0159] Optionally, the magnetic tunnel junction is further configured to change from a steady state to an unstable state based on stimulation of the write pulse after receiving the write pulse.
[0160] It should be noted that after the random number generator starts working, the write signal is set high, so that the write driver can generate a write pulse, and the magnetic tunnel junction is placed in an unstable state with low resistance. At this time, the counter circuit is reset and the output result of the read circuit is invalid.
[0161] Therefore, the magnetic tunnel junction can quickly change from a steady state to an unstable state after receiving a write pulse, and recover to a steady state in a relatively short time. This fast response characteristic enables the random number generator to operate at a high frequency, meeting the needs of high-speed random number generation.
[0162] Optionally, the magnetic tunnel junction is specifically used for:
[0163] A write signal is acquired through the write driver, a write pulse is generated based on the write signal, and a write pulse is provided for the magnetic tunnel junction; the voltage of the write signal is equal to the power supply voltage.
[0164] In the embodiment of the present application, by using a write signal equal to the power supply voltage, the circuit design can be simplified without the need for additional voltage conversion or regulation circuits, thereby reducing the complexity of the circuit and the number of components, thereby reducing design and manufacturing costs.
[0165] Therefore, the embodiment of the present application can ensure the stability and consistency of the write pulse by using a write signal equal to the power supply voltage.
[0166] In combination with the above embodiments, Figure 7 The waveform diagram of the signal output provided by the embodiment of the present application is as follows: Figure 7 As shown, after the random number generator starts working, the clock signal is continuously input at a certain period, the write signal is set high, and after the write signal ends, the write signal is set low. At this time, the magnetic tunnel junction enters a non-stable state at the position corresponding to the dotted line A, and enters a steady state at the position corresponding to the dotted line C after a relaxation time; wherein, the read voltage is a solid line, and the reference voltage is a dotted line. During the relaxation time, the reference voltage is greater than the read voltage; after the write signal ends, in the next clock signal cycle, that is, at the position corresponding to the dotted line B, the read circuit starts to output a preset signal. At this time, the preset signal output by the read circuit is a conduction signal, and then the D flip-flop starts counting until the D flip-flop outputs a random number after the relaxation time ends. At this time, the preset signal output by the read circuit is a shutdown signal.
[0167] Optionally, the magnetic tunnel junction is a spin-orbit torque magnetic tunnel junction (Spin-Orbit Torque Magnetic Tunnel Junction, SOT-MTJ), which can combine the characteristics of the spin-orbit torque effect and the magnetic tunnel junction, and has the advantages of high-speed writing, low power consumption, high reliability, non-volatility and high integration; the spin-orbit torque magnetic tunnel junction includes a magnetic functional layer; the magnetic functional layer is located at any position of the inner layer of the spin-orbit torque magnetic tunnel junction or the outer layer of the spin-orbit torque magnetic tunnel junction; the magnetic functional layer is used to change the length of the relaxation time.
[0168] In the embodiments of the present application, in order to improve the relaxation performance of the magnetic tunnel junction, a magnetic functional layer may be added to the structure of the MTJ. The magnetic functional layer may contain magnetic materials, or an electric current may be passed to generate an Oersted field.
[0169] For example, taking the magnetic tunnel junction SOT-MTJ as an example, the SOT-MTJ can be made to have a single steady state by adding a magnetic field control layer on one side of the reference layer, or by adding a wire layer outside the MTJ structure, or by adding an exchange bias layer near the free layer, thereby improving the relaxation performance of the SOT-MTJ.
[0170] Among them, SOT-MTJ can include a reference layer, a tunnel barrier layer and a free layer, a top electrode is on the reference layer, and a bottom electrode is under the free layer. Figure 8 The schematic diagram of the structure of the optimized magnetic tunnel junction provided in the embodiment of the present application is as follows: Figure 8As shown, the magnetic functional layer can be deployed in the lower layer of the bottom electrode, the upper layer of the top electrode, between the free layer and the bottom electrode, between the reference layer and the top electrode, between the reference layer and the tunneling barrier layer, etc. The embodiment of the present application does not specifically limit the position of the magnetic functional layer in the inner layer of the magnetic tunnel junction or the outer layer of the magnetic tunnel junction.
[0171] It should be noted that a magnetic tunnel junction with an added magnetic functional layer can optimize the performance of the magnetic tunnel junction, but a magnetic tunnel junction without an added magnetic functional layer can also realize the random number generator provided in the present application. The embodiment of the present application does not specifically limit whether a magnetic functional layer is added to the magnetic tunnel junction, which can be set based on application scenario requirements or users.
[0172] Therefore, the embodiments of the present application can optimize the structure of the magnetic tunnel junction by adding a magnetic functional layer in the structure of the magnetic tunnel junction, thereby achieving the purpose of improving the relaxation performance of the magnetic tunnel junction, and then flexibly controlling the relaxation time of the random number generator and optimizing the random number generation process. In addition, the introduction of the magnetic functional layer can optimize the dynamic behavior of the magnetic tunnel junction, thereby improving the quality of random numbers.
[0173] For example, Fig. 9 The present application provides a flow chart of a method for generating random numbers, wherein the method is applied to the random number generator; the random number generator comprises: a write driver, a magnetic tunnel junction, a read circuit and a counter circuit connected in sequence; the magnetic tunnel junction is a device that switches between a stable state and an unstable state; Fig. 9 As shown, the method includes:
[0174] S901, providing a write pulse to the magnetic tunnel junction through the write driver.
[0175] S902 , after the excitation of the write pulse ends, the magnetic tunnel junction enters a steady state after a relaxation time from a non-stable state.
[0176] S903 , generating a read voltage through the read circuit according to the resistance of the magnetic tunnel junction, and outputting a preset signal within a relaxation time.
[0177] S904: Count the clock signal based on the preset signal through the counter circuit to obtain a random number matching the relaxation time.
[0178] It should be noted that the specific implementation principle and effect of the random number generation method provided in the embodiment of the present application can be found in the relevant description and effects corresponding to the above embodiment, and will not be elaborated here.
[0179] In the several embodiments provided in the present application, it should be understood that the disclosed modules, structures and methods can be implemented in other ways. For example, the division of modules and structures is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules, structures or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of modules can be electrical, mechanical or other forms.
[0180] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to implement the solution of this embodiment.
[0181] In addition, each functional module in each embodiment of the present application can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The above-mentioned module-composed unit can be implemented in the form of hardware or in the form of hardware plus software functional units.
[0182] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.
[0183] It should be further noted that, although the various steps in the flowchart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0184] In the above embodiments, the description of each embodiment has its own emphasis. For the part not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0185] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the claims.
[0186] The above is only a specific implementation of the embodiment of the present application, but the protection scope of the embodiment of the present application is not limited thereto, and any changes or replacements within the technical scope disclosed in the embodiment of the present application should be included in the protection scope of the embodiment of the present application. Therefore, the protection scope of the embodiment of the present application should be based on the protection scope of the claims.
Claims
1. A random number generator, characterized in that: The random number generator comprises: a write driver, a magnetic tunnel junction, a read circuit and a counter circuit connected in sequence; the magnetic tunnel junction is a device that switches between a stable state and an unstable state; The write driver is used to provide a write pulse for the magnetic tunnel junction; The magnetic tunnel junction is used to enter a steady state after a relaxation time from an unstable state after the excitation of the write pulse ends; The read circuit is used to generate a read voltage based on the resistance value of the magnetic tunnel junction and output a preset signal within a relaxation time; The counter circuit is used to count the clock signal based on the preset signal to obtain a random number matching the relaxation time.
2. The random number generator according to claim 1, characterized in that The read circuit includes a read current generating structure, a comparator structure and a signal gating structure, wherein the read current generating structure is used to provide a read current for the magnetic tunnel junction; The comparator structure is used to receive the read voltage, and compare the read voltage with a reference voltage to determine a comparison result; The signal gating structure is used to output a preset signal after caching based on the comparison result.
3. The random number generator according to claim 2, characterized in that The read current generating structure includes a clamp transistor, and the clamp transistor is used to adjust the magnitude of the read current based on a clamp voltage.
4. The random number generator according to claim 2, characterized in that: The reference voltage is greater than a read voltage when the magnetic tunnel junction is in a low resistance state, and is less than a read voltage when the magnetic tunnel junction is in a high resistance state.
5. The random number generator according to claim 2, characterized in that: The comparator structure includes a charging structure, a latching structure and a voltage receiving structure; One end of the charging structure is connected to a power source for controlling charging based on a clock signal; the other end of the charging structure is connected to one end of the latch structure, and the latch structure is used to regulate the voltage of the target end according to the read voltage and the reference voltage; the other end of the latch structure is connected to the voltage receiving structure, and the voltage receiving structure is used to receive the read voltage and the reference voltage and determine the magnitude of the read voltage and the reference voltage.
6. The random number generator according to claim 5, characterized in that: The other end of the voltage receiving structure is grounded, and the voltage receiving structure is further used to control the conduction of the circuit corresponding to the comparator structure based on the clock signal.
7. The random number generator according to claim 1, characterized in that: The counter circuit includes a plurality of D flip-flops and switch devices; The switch device is connected to the reading circuit and the external module respectively, and is used to control the access of the clock signal based on the preset signal; The clock input terminal of the first D flip-flop receives the clock signal, and the clock input terminal of each subsequent D flip-flop is connected to the inverting output terminal of the previous D flip-flop; The data terminal of each D flip-flop is connected to its own inverting output terminal.
8. The random number generator according to claim 7, characterized in that The reset terminal of each D flip-flop is connected to an external module, and is used to receive a write signal and control its own reset based on the size of the write signal.
9. The random number generator according to any one of claims 1 to 8, characterized in that: The magnetic tunnel junction is a spin-orbit moment magnetic tunnel junction; The spin-orbit moment magnetic tunnel junction comprises a magnetic functional layer; the magnetic functional layer is located at any position of the inner layer of the spin-orbit moment magnetic tunnel junction or the outer layer of the spin-orbit moment magnetic tunnel junction; the magnetic functional layer is used to change the length of the relaxation time.
10. A method for generating random numbers, characterized in that: The method is applied to the random number generator; the random number generator comprises: a write driver, a magnetic tunnel junction, a read circuit and a counter circuit connected in sequence; the magnetic tunnel junction is a device that switches between a stable state and an unstable state; the method comprises: Providing a write pulse to the magnetic tunnel junction by the write driver; After the excitation of the write pulse ends, the magnetic tunnel junction enters a steady state after a relaxation time from an unstable state; Outputting a preset signal within a relaxation time by generating a read voltage through the read circuit according to the resistance value of the magnetic tunnel junction; The clock signal is counted by the counter circuit based on the preset signal to obtain a random number matching the relaxation time.
Citation Information
Cited By
Random number generator and random number generation method
CN119718256A
