A random number conversion system based on a self-calibration magnetic tunnel junction and a working method thereof

By using a self-calibrating magnetic tunnel junction random number conversion system, the flip current of the magnetic tunnel junction is monitored and dynamically adjusted in real time, solving the flip probability offset problem, improving the stability and randomness of the random bit stream, making it suitable for edge AI computing, and reducing power consumption and hardware overhead.

CN122173052APending Publication Date: 2026-06-09NANJING UNIV OF AERONAUTICS & ASTRONAUTICS

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NANJING UNIV OF AERONAUTICS & ASTRONAUTICS
Filing Date
2026-03-10
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Existing true random number generators based on magnetic tunnel junctions are prone to having a flip probability that deviates from the target value by 50% under process deviations and changes in ambient temperature. This leads to a deterioration in the statistical characteristics of the random bit stream, affecting the accuracy of deep neural networks. Furthermore, existing calibration methods have high hardware overhead and high power consumption, making them unable to adapt to dynamic environmental changes.

Method used

A random number conversion system employing a self-calibrating magnetic tunnel junction includes a magnetic tunnel junction, a random write module, a pre-charge sensing amplification module, and a real-time feedback calibration module. It maintains high-precision randomness by monitoring and dynamically adjusting the switching current in real time.

Benefits of technology

It improves the stability and randomness of the flip probability under process deviations and ambient temperature fluctuations, reduces power consumption and hardware footprint, and is suitable for high-precision, low-power edge AI computing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122173052A_ABST
    Figure CN122173052A_ABST
Patent Text Reader

Abstract

The application discloses a random number conversion system based on a self-calibration magnetic tunnel junction and a working method thereof, and the system comprises a magnetic tunnel junction, a magnetic tunnel junction random writing module, a pre-charge sensing amplification module and a real-time feedback calibration module; the magnetic tunnel junction is a source of physical randomness of the system, and the resistance state of the magnetic tunnel junction randomly flips based on thermal fluctuation; the output end of the magnetic tunnel junction random writing module is connected with the magnetic tunnel junction; the input end of the pre-charge sensing amplification module is connected with the magnetic tunnel junction; the real-time feedback calibration module comprises a period counter, a flip counter and a digital comparator; the input end of the flip counter is connected with the output end of the pre-charge sensing amplification module; the output end of the digital comparator is connected with the input end of the magnetic tunnel junction random writing module, and the flip current of the magnetic tunnel junction random writing module is dynamically adjusted. The application solves the problem of flip probability deviation of a traditional true random number generator caused by process deviation and environmental temperature fluctuation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of integrated circuit design technology, and specifically to a random number conversion system and its working method based on a self-calibrating magnetic tunnel junction. Background Technology

[0002] The hardware deployment of deep neural networks, especially in resource-constrained edge computing scenarios, faces enormous power consumption and area challenges due to massive arithmetic operations. Randomized computation, as an alternative computing paradigm with ultra-low hardware complexity and high energy efficiency, provides a solution for the low-power, high-efficiency implementation of deep neural networks. Traditional digital pseudo-random number generators struggle to meet the security requirements of physical unpredictability, making true random number generators based on physical entropy sources a preferred solution. Among them, magnetic tunnel junctions are considered promising physical entropy sources due to their nanoscale structure, compatibility with standard CMOS processes, and the physical mechanism of achieving intrinsic random flipping using thermal noise. However, in existing true random number generators based on magnetic tunnel junctions, the actual flipping probability of the magnetic tunnel junction easily deviates from the preset 50% target value, leading to a deterioration in the statistical characteristics of the generated random bitstream. In randomized computing systems, such biased random sequences directly introduce systematic computational errors, severely reducing the accuracy of neural network inference tasks. Furthermore, most existing technical solutions are "open-loop" systems; once manufactured, their flipping probability is fixed and cannot be compensated for in real time. While some studies have attempted to adjust the process using complex digital calibration circuits or pre-stored process corner compensation tables, these methods often involve high hardware overhead and power consumption, and cannot adapt to dynamic changes in ambient temperature, making it difficult to meet the actual needs of high-precision, low-power edge AI computing.

[0003] Therefore, there is an urgent need for an adaptive true random number generation system that can sense the quality of output randomness in real time and automatically adjust driving parameters to maintain high-precision statistical characteristics, so as to fundamentally ensure the reliable and efficient application of random computing in advanced artificial intelligence hardware. Summary of the Invention

[0004] The purpose of this invention is to provide a random number conversion system and working method based on a self-calibrating magnetic tunnel junction, so as to solve the problem of flip probability shift caused by process deviation and environmental temperature fluctuation in traditional true random number generators.

[0005] To achieve the above objectives, the present invention adopts the following technical solution: A random number conversion system based on a self-calibrating magnetic tunnel junction includes: a magnetic tunnel junction, a magnetic tunnel junction random writing module, a pre-charge sensing amplification module, and a real-time feedback calibration module; The magnetic tunnel junction is the source of physical randomness in the system, and its resistance state is randomly flipped based on thermal fluctuations. The output of the magnetic tunnel junction random writing module is connected to the magnetic tunnel junction and is used to inject a controllable switching current into the magnetic tunnel junction to control the random switching of the magnetic tunnel junction. The input terminal of the pre-charge sensing amplification module is connected to the magnetic tunnel junction, and is used to read the resistance state of the magnetic tunnel junction and convert it into a binary random bit stream output. The real-time feedback calibration module includes a cycle counter, a toggle counter, and a digital comparator. The cycle counter records the total number of clock cycles of the system clock. The input of the toggle counter is connected to the output of the precharge sensing amplifier module, and the toggle counter is used to count the number of specified logics in the binary random bit stream output by the precharge sensing amplifier module in real time. The output of the digital comparator is connected to the input of the magnetic tunnel junction random write module, and the digital comparator compares the value of the toggle counter with the target toggle expectation value calculated based on the total number of clock cycles, and generates a feedback signal based on the comparison result to dynamically adjust the toggle current of the magnetic tunnel junction random write module.

[0006] To optimize the above technical solution, the specific limitations also include: The magnetic tunnel junction random writing module includes an adjustment transistor array, which is composed of multiple control transistors connected in parallel. The on / off state of the control transistors is controlled by a feedback signal generated by a real-time feedback calibration module to dynamically adjust the magnitude of the flip-flop current.

[0007] Furthermore, the operating timing of the pre-charge sensing amplification module is synchronized with the system clock. The pre-charge sensing amplification module has three stages: pre-charge, sensing, and latching. In the pre-charge stage, the sensing node is initialized. In the sensing stage, the resistance state difference of the magnetic tunnel junction is detected. In the latching stage, the resistance state is amplified and latched into a binary random bit stream so that it can be fed back to the calibration module for statistics in real time.

[0008] Furthermore, the binary random bit stream output by the pre-charge sensing amplification module is configured to output logic 1 when the magnetic tunnel junction is in a high-resistance state and logic 0 when the magnetic tunnel junction is in a low-resistance state.

[0009] Preferably, the number of specified logic bits in the binary random bit stream counted by the toggle counter is the number of logic 1s.

[0010] Preferably, the execution strategy of the real-time feedback calibration module is as follows: When the value of the flip counter is greater than the target flip expected value, the real-time feedback calibration module generates a feedback signal to control the magnetic tunnel junction random writing module to reduce the flip current. When the value of the flip counter equals the target flip expected value, the real-time feedback calibration module generates a feedback signal to control the magnetic tunnel junction random writing module to maintain the flip current; When the value of the flip counter is less than the target flip value, the real-time feedback calibration module generates a feedback signal to control the magnetic tunnel junction random writing module to increase the flip current.

[0011] Preferably, the magnetic tunnel junction is a spin-transfer torque magnetic tunnel junction, which uses its inherent random flipping physical property as a source of physical entropy.

[0012] This invention also proposes a working method for a random number conversion system based on a self-calibrating magnetic tunnel junction, characterized by the following steps: S1: At the beginning of each clock cycle of the system, a reset current is injected into the magnetic tunnel junction random write module to set the magnetic tunnel junction to the initial low resistance state; S2: The magnetic tunnel junction random writing module receives the feedback signal from the real-time feedback calibration module and adjusts to obtain the flip current, injecting the flip current into the magnetic tunnel junction, so that the magnetic tunnel junction undergoes a nondeterministic state flip based on thermal fluctuations. S3: Read the resistance state of the magnetic tunnel junction through the pre-charge sensing amplification module and output the random binary bit stream of the current period; S4: The real-time feedback calibration module's flip counter counts the number of logic 1s in the binary random bit stream output by the pre-charge sensing amplification module, the cycle counter counts the total number of clock cycles of the system clock, the digital comparator compares the value of the flip counter with the target flip expectation value calculated based on the total number of clock cycles, and generates a feedback signal based on the comparison result to dynamically adjust the flip current of the magnetic tunnel junction random write module in the next cycle.

[0013] Furthermore, the relationship between the reset current and the switching current is as follows:

[0014] in, For reset current, This is the switching current.

[0015] Furthermore, the operation of the real-time feedback calibration module is executed in parallel with the process of the pre-charge sensing amplification module generating a binary random bit stream, and the calibration process does not introduce additional computation time delay.

[0016] Compared with the prior art, the beneficial effects of the present invention are: This invention provides a random number conversion system and working method based on a self-calibrating magnetic tunnel junction. Through a real-time feedback calibration module, the system automatically monitors and dynamically adjusts the flip probability of the magnetic tunnel junction, effectively resisting the influence of process deviations and temperature fluctuations in the working environment on the flip probability of traditional true random number generators, improving the stability and randomness quality of the random bit stream, and possessing high robustness and high calibration accuracy.

[0017] Furthermore, by utilizing the inherent physical randomness of the magnetic tunnel junction as an entropy source, this invention avoids the energy consumption of the random system by complex digital logic components such as linear feedback shift registers and comparator arrays in traditional digital random number generation circuits, thereby reducing the static and dynamic power consumption of the entire random system.

[0018] Finally, the present invention adopts an integrated design of a pre-charge sensing amplification module and a real-time feedback calibration module, which has a simple overall architecture. Compared with traditional solutions that require a large number of digital units, it reduces the chip area occupied, which is conducive to deployment in large-scale parallel integration applications. It is also suitable for the design of neuron arrays in deep neural networks. Attached Figure Description

[0019] Figure 1 : A schematic diagram of the structure of a random number conversion system based on a self-calibrating magnetic tunnel junction according to the present invention.

[0020] Figure 2 The architecture diagram of the true random number generation system with feedback calibration function of the present invention.

[0021] Figure 3 The present invention relates to a random number conversion system based on a self-calibrating magnetic tunnel junction, showing the change in flip probability with current under different process angles. Detailed Implementation

[0022] The present invention will be further described in detail below through specific embodiments, but it should not be construed as limiting the scope of the subject matter of the present invention to the following embodiments. All technologies implemented based on the above content of the present invention fall within the scope of the present invention.

[0023] The technical solution of the present invention will be further described in detail below with reference to specific embodiments: In one embodiment of the present invention, a random number conversion system based on a self-calibrating magnetic tunnel junction is proposed, the structural schematic diagram of which is shown below. Figure 1 As shown, it includes: a magnetic tunnel junction, a magnetic tunnel junction random write module, a precharge sensing amplification module, and a real-time feedback calibration module.

[0024] Magnetic tunnel junctions are a source of physical randomness in a system, with their resistance states randomly flipping based on thermal fluctuations. Magnetic tunnel junctions are spin-torque magnetic tunnel junctions that utilize their inherent random flipping physical properties as a source of physical entropy.

[0025] The output of the magnetic tunnel junction random write module is connected to the magnetic tunnel junction (MTJ) to inject a controllable switching current into the MTJ, thereby controlling the random switching of the MTJ. The MTJ random write module includes an array of regulating transistors, which is composed of multiple control transistors connected in parallel. The on / off state of these control transistors is controlled by a feedback signal generated by a real-time feedback calibration module to dynamically adjust the magnitude of the switching current.

[0026] The input of the precharge sensing amplifier module is connected to the magnetic tunnel junction to read the resistance state of the magnetic tunnel junction and convert it into a binary random bit stream output.

[0027] The working timing of the precharge sensing amplification module is synchronized with the system clock. The precharge sensing amplification module has three stages: precharge, sensing, and latching. In the precharge stage, the sensing node is initialized. In the sensing stage, the resistance state difference of the magnetic tunnel junction is detected. In the latching stage, the resistance state is amplified and latched into a binary random bit stream so that it can be fed back to the calibration module for statistics in real time.

[0028] The binary random bit stream output by the precharge sensing amplifier module is configured to output logic 1 when the magnetic tunnel junction is in a high-resistance state and logic 0 when the magnetic tunnel junction is in a low-resistance state.

[0029] The real-time feedback calibration module includes a cycle counter, a toggle counter, and a digital comparator. The cycle counter records the total number of clock cycles of the system clock. The input of the toggle counter is connected to the output of the precharge sensing amplifier module, and the toggle counter is used to count the number of specified logics in the binary random bit stream output by the precharge sensing amplifier module in real time. The output of the digital comparator is connected to the input of the magnetic tunnel junction random write module, and the digital comparator compares the value of the toggle counter with the target toggle expectation value calculated based on the total number of clock cycles. Based on the comparison result, a feedback signal is generated to dynamically adjust the toggle current of the magnetic tunnel junction random write module and compensate for probability offsets caused by process deviations and environmental temperature disturbances.

[0030] The number of specified logic bits in the binary random bit stream counted by the toggle counter is the number of logic 1s.

[0031] The execution strategy of the real-time feedback calibration module is as follows: When the value of the flip counter is greater than the target flip expected value, it is determined that the current flip probability is too high. The real-time feedback calibration module generates a feedback signal to control the magnetic tunnel junction random writing module to reduce the flip current. When the value of the flip counter equals the target flip expected value, the real-time feedback calibration module generates a feedback signal to control the magnetic tunnel junction random write module to maintain the flip current; When the value of the flip counter is less than the target flip expected value, it is determined that the current flip probability is too low. The real-time feedback calibration module generates a feedback signal to control the magnetic tunnel junction random writing module to increase the flip current.

[0032] This invention also proposes a working method for a random number conversion system based on a self-calibrating magnetic tunnel junction, comprising the following steps: S1: At the beginning of each clock cycle of the system, a reset current is injected into the magnetic tunnel junction random write module to set the magnetic tunnel junction to the initial low resistance state; S2: The magnetic tunnel junction random writing module receives the feedback signal from the real-time feedback calibration module and adjusts to obtain the flip current, injecting the flip current into the magnetic tunnel junction, so that the magnetic tunnel junction undergoes a nondeterministic state flip based on thermal fluctuations. S3: Read the resistance state of the magnetic tunnel junction through the pre-charge sensing amplification module and output the random binary bit stream of the current period; S4: The real-time feedback calibration module's flip counter counts the number of logic 1s in the binary random bit stream output by the pre-charge sensing amplification module, the cycle counter counts the total number of clock cycles of the system clock, the digital comparator compares the value of the flip counter with the target flip expectation value calculated based on the total number of clock cycles, and generates a feedback signal based on the comparison result to dynamically adjust the flip current of the magnetic tunnel junction random write module in the next cycle.

[0033] The relationship between reset current and reversal current is as follows:

[0034] in, For reset current, This is the switching current.

[0035] The operation of the real-time feedback calibration module and the process of generating a binary random bit stream by the pre-charge sensing amplification module are executed in parallel, and the calibration process does not introduce additional computation time delay.

[0036] The invention will be further described below in conjunction with its application in random computing architectures, as shown in the specific structural diagram below. Figure 2 As shown: The binary-to-random unit serves as the system's data input, using a comparator to convert three-bit binary values... and The random bit sequence generated by the true random number generator in the co-magnetic tunnel junction is compared bit by bit. The system needs to process a binary value. ( =0.010 (corresponding to decimal 2 / 8), the logic control circuit reads the binary number after the decimal point of this value, i.e., decimal 2, and drives three MTJ true random number generators to work in parallel within the same clock cycle. Each generator independently generates one bit of binary random number. If the output combination of the three parallel generators is the binary sequence "100", corresponding to decimal 4, then this value is combined with... The corresponding value 2 is compared; because The comparator outputs logic 0 as a random bit stream of the current bit. By repeating the above comparison steps, the characterization can be obtained. Eight-bit random bit stream ( =10001000, where 1 accounts for approximately 2 / 8); if the input value is... The binary representation of 0.100 (corresponding to decimal 4 / 8) is used by the logic control circuit to read the binary number after the decimal point, i.e., decimal 4. Simultaneously, within the same clock cycle, three MTJ true random number generators operate in parallel. If the output combination of the three parallel generators is the binary sequence "101", corresponding to decimal 5, then this value is compared with... Compare with the corresponding value 4, because Then the output bit stream The current bit is logic 0. By repeating the above comparison steps, the representation can be obtained. Eight-bit random bit stream ( =11110000, where 1 accounts for approximately 4 / 8). To ensure computational accuracy, the system employs independent random number generation paths or time-division sampling strategies in its hardware implementation to guarantee the bitstream accuracy. and They are highly uncorrelated with each other.

[0037] Obtain high-quality random bit streams and Then, the system enters the random domain computation phase, configured to perform parallel logic operations directly at the random bitstream level. During multiplication, AND gates are used to operate on the random bitstream. and Perform a bitwise AND operation and output the bit stream of the multiplication result. When performing addition, a controlled multiplexer (MUX) is used to implement scaled addition, controlled by a bit stream with a probability of 0.5. ( =10010110, where 1 accounts for approximately 4 / 8) controls the logic following the formula. Output the bit stream of the addition result. Scaling addition can effectively limit the result of the operation to the range of [0,1] to avoid the risk of overflow.

[0038] After the calculation is completed, the calculated result is a bit stream. and The process proceeds to the random number to binary conversion unit, where an internally integrated high-speed counter counts the number of logic 1s appearing in the bitstream, thus restoring the calculation result to a binary value. The final calculation result is then obtained. 3 / 8, This is highly consistent with the results of normal addition and multiplication calculations.

[0039] The magnetic tunnel junction true random number generator utilizes the spin-torque effect to generate random flips under the drive of the system clock CLK. The generated raw signal is captured by a pre-charge sensing amplification module and converted into a digital random bit stream. Output. The real-time feedback calibration module tracks the output distribution in real time, and the internal period counter records the total sampling period. The toggle counter records the random bit stream. Number of occurrences of logic 1 .

[0040] The digital comparator will calculate the statistical value. Compared with the target expected value Real-time comparison is performed. Based on the offset of the flip-current threshold caused by manufacturing deviations, the system executes the following adaptive strategy: if a... The feedback module activates the step-down regulator to increase the write current. From standard reference value Lower the current to the low level If detected Then the enhanced regulating tube is activated, increasing the injected current to a high level. ,like Figure 3 As shown.

[0041] Through this real-time feedback calibration, the system can stably maintain the flipping probability of the magnetic tunnel junction at around 50%, ensuring the accuracy of random computation. Since the feedback calibration loop is completely synchronized with the clock signal CLK of the random computation system, its calibration process is executed in parallel with the bit stream generation process, ensuring the high randomness of the physical entropy source without introducing additional computational delay.

[0042] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Any simple modifications, equivalent substitutions, and improvements made by those skilled in the art to the above embodiments without departing from the scope of the technical solution of the present invention, based on the technical essence of the present invention, shall still fall within the protection scope of the technical solution of the present invention.

Claims

1. A random number conversion system based on a self-calibrating magnetic tunnel junction, characterized in that, include: Magnetic tunnel junction, magnetic tunnel junction random write module, precharge sensing amplification module and real-time feedback calibration module; The magnetic tunnel junction is the source of physical randomness in the system, and its resistance state is randomly flipped based on thermal fluctuations. The output of the magnetic tunnel junction random writing module is connected to the magnetic tunnel junction and is used to inject a controllable switching current into the magnetic tunnel junction to control the random switching of the magnetic tunnel junction. The input terminal of the pre-charge sensing amplification module is connected to the magnetic tunnel junction, and is used to read the resistance state of the magnetic tunnel junction and convert it into a binary random bit stream output. The real-time feedback calibration module includes a cycle counter, a toggle counter, and a digital comparator. The cycle counter records the total number of clock cycles of the system clock. The input of the toggle counter is connected to the output of the precharge sensing amplifier module, and the toggle counter is used to count the number of specified logics in the binary random bit stream output by the precharge sensing amplifier module in real time. The output of the digital comparator is connected to the input of the magnetic tunnel junction random write module, and the digital comparator compares the value of the toggle counter with the target toggle expectation value calculated based on the total number of clock cycles, and generates a feedback signal based on the comparison result to dynamically adjust the toggle current of the magnetic tunnel junction random write module.

2. The random number conversion system based on a self-calibrating magnetic tunnel junction according to claim 1, characterized in that: The magnetic tunnel junction random writing module includes an adjustment transistor array, which is composed of multiple control transistors connected in parallel. The on / off state of the control transistors is controlled by a feedback signal generated by a real-time feedback calibration module to dynamically adjust the magnitude of the flip-flop current.

3. The random number conversion system based on a self-calibrating magnetic tunnel junction according to claim 1, characterized in that: The working timing of the pre-charge sensing amplification module is synchronized with the system clock. The pre-charge sensing amplification module has three stages: pre-charge, sensing, and latching. In the pre-charge stage, the sensing node is initialized. In the sensing stage, the resistance state difference of the magnetic tunnel junction is detected. In the latching stage, the resistance state is amplified and latched into a binary random bit stream so that it can be fed back to the calibration module for statistics in real time.

4. The random number conversion system based on a self-calibrating magnetic tunnel junction according to claim 1, characterized in that: The binary random bit stream output by the precharge sensing amplification module is configured to output logic 1 when the magnetic tunnel junction is in a high-resistance state and logic 0 when the magnetic tunnel junction is in a low-resistance state.

5. The random number conversion system based on a self-calibrating magnetic tunnel junction according to claim 1, characterized in that: The number of specified logic bits in the binary random bit stream counted by the toggle counter is the number of logic 1s.

6. The random number conversion system based on a self-calibrating magnetic tunnel junction according to claim 1, characterized in that: The execution strategy of the real-time feedback calibration module is as follows: When the value of the flip counter is greater than the target flip expected value, the real-time feedback calibration module generates a feedback signal to control the magnetic tunnel junction random writing module to reduce the flip current. When the value of the flip counter equals the target flip expected value, the real-time feedback calibration module generates a feedback signal to control the magnetic tunnel junction random writing module to maintain the flip current; When the value of the flip counter is less than the target flip value, the real-time feedback calibration module generates a feedback signal to control the magnetic tunnel junction random writing module to increase the flip current.

7. The random number conversion system based on a self-calibrating magnetic tunnel junction according to claim 1, characterized in that: The magnetic tunnel junction is a spin-transfer torque magnetic tunnel junction, which uses its inherent random flipping physical property as a source of physical entropy.

8. The operating method of a random number conversion system based on a self-calibrating magnetic tunnel junction as described in any one of claims 1 to 7, characterized in that, Includes the following steps: S1: At the beginning of each clock cycle of the system, a reset current is injected into the magnetic tunnel junction random write module to set the magnetic tunnel junction to the initial low resistance state; S2: The magnetic tunnel junction random writing module receives the feedback signal from the real-time feedback calibration module and adjusts to obtain the flip current, injecting the flip current into the magnetic tunnel junction, so that the magnetic tunnel junction undergoes a nondeterministic state flip based on thermal fluctuations. S3: Read the resistance state of the magnetic tunnel junction through the pre-charge sensing amplification module and output the random binary bit stream of the current period; S4: The real-time feedback calibration module's flip counter counts the number of logic 1s in the binary random bit stream output by the pre-charge sensing amplification module, the cycle counter counts the total number of clock cycles of the system clock, the digital comparator compares the value of the flip counter with the target flip expectation value calculated based on the total number of clock cycles, and generates a feedback signal based on the comparison result to dynamically adjust the flip current of the magnetic tunnel junction random write module in the next cycle.

9. The working method of a random number conversion system based on a self-calibrating magnetic tunnel junction according to claim 8, characterized in that: The relationship between the reset current and the reversal current is as follows: in, For reset current, This is the switching current.

10. The working method of a random number conversion system based on a self-calibrating magnetic tunnel junction according to claim 8, characterized in that: The operation of the real-time feedback calibration module is performed in parallel with the process of the pre-charge sensing amplification module generating a binary random bit stream, and the calibration process does not introduce additional computation time delay.