Gaussian random number generation circuit and Gaussian white noise generation circuit

CN121092116BActive Publication Date: 2026-10-23SHANGHAI LONGSYS DIGITAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410743165.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-07
Publication Date
2026-10-23
Estimated Expiration
2044-06-07

AI Technical Summary

Technical Problem

偏离理想高斯概率分布会极大影响测试结果的正确性,导致不正确的结论

Benefits of technology

[0015]本申请的有益效果是:区别于现有技术的情况,本申请提供的高斯随机数生成电路以及高斯白噪声生成电路,利用随机数发生器生成目标均匀分布随机数,并基于目标均匀分布随机数得到第一均匀分布随机数和第二均匀分布随机数,以此不需要通过多个随机数生成一个随机数种子,然后利用处理电路根据第一均匀分布随机数和第二均匀分布随机数生成高斯随机数,此时得到的高斯随机数的准确性较高,符合理论高斯曲线。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121092116B_ABST
    Figure CN121092116B_ABST
Patent Text Reader

Abstract

The application discloses a Gaussian random number generation circuit and a Gaussian white noise generation circuit. The Gaussian random number generation circuit comprises a random number generator and a processing circuit. The random number generator is configured to generate a target uniformly distributed random number, and obtain a first uniformly distributed random number and a second uniformly distributed random number based on the target uniformly distributed random number; wherein the bit of the second uniformly distributed random number is less than the bit of the first uniformly distributed random number; and the processing circuit is coupled to the random number generator and configured to generate a Gaussian random number according to the first uniformly distributed random number and the second uniformly distributed random number. In this way, the generation of the uniformly distributed random number can be simplified, and the accuracy of the finally obtained Gaussian random number can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of random number generation technology, and in particular to Gaussian random number generation circuits and Gaussian white noise generation circuits. Background Technology

[0002] Performance evaluation requires a large amount of data to test the bit error rate achievable by channel coding methods such as LDPC (Low-density Parity-check) codes. To reduce evaluation time, hardware-based noise generation is generally used to meet testing rate requirements. Most digital methods for generating AWGN (White Gaussian Noise) involve transforming random numbers to obtain Gaussian random numbers, and finally controlling the signal-to-noise ratio to obtain the corresponding noise.

[0003] For simulations with massive datasets, the quality of noise is a critical factor. Deviations from the ideal Gaussian probability distribution can significantly affect the accuracy of test results, leading to incorrect conclusions. Summary of the Invention

[0004] The Gaussian random number generation circuit and Gaussian white noise generation circuit provided in this application can simplify the generation of uniformly distributed random numbers and improve the accuracy of the final Gaussian random numbers.

[0005] In a first aspect, this application provides a Gaussian random number generation circuit, which includes: a random number generator for generating a target uniformly distributed random number and obtaining a first uniformly distributed random number and a second uniformly distributed random number based on the target uniformly distributed random number; wherein the bit number corresponding to the second uniformly distributed random number is less than the bit number of the first uniformly distributed random number; and a processing circuit coupled to the random number generator for generating Gaussian random numbers based on the first uniformly distributed random number and the second uniformly distributed random number.

[0006] The processing circuit includes: an interval judgment module, used to perform interval judgment on a second uniformly distributed random number and a fourth uniformly distributed random number, and output several parameter values ​​based on the second judgment result; wherein the fourth uniformly distributed random number is obtained by inverting the second uniformly distributed random number; a processing module, coupled to the interval judgment module, used to obtain a logical left-shifted random number, a first coefficient value and a first intercept value corresponding to a first function based on a first uniformly distributed random number or a third uniformly distributed random number; and to obtain a second coefficient value and a second intercept value corresponding to a second function based on a first target parameter value among several parameter values, and to obtain a third coefficient value and a third intercept value corresponding to a second function based on a second target parameter value among several parameter values; the third uniformly distributed random number is obtained by inverting the first uniformly distributed random number; a multiplier module, used to obtain a first target random number based on the first coefficient value and the logical left-shifted random number; and to obtain a second target random number based on the second coefficient value and several parameter values ​​among several parameter values. The third target parameter value is used to obtain the second target random number; and the third target random number is used to obtain the fourth target random number based on the third coefficient value and the fourth target parameter value among several parameter values; the adder module, coupled with the multiplier module, is used to obtain the fourth target random number based on the first target random number and the first intercept value; and the fifth target random number is used to obtain the sixth target random number based on the third target random number and the third intercept value; the multiplier module is also used to obtain the seventh target random number based on the fifth target random number and the fifth target parameter value among several parameter values; the eighth target random number is used to obtain the eighth target random number and the fourth target random number among several parameter values, and the ninth target random number and the tenth target random number are used as Gaussian random numbers respectively.

[0007] The interval judgment module is also used to obtain the highest bit of the first uniformly distributed random number. When the highest bit is 0, the first uniformly distributed random number is output, and when the highest bit is 1, the third uniformly distributed random number is output.

[0008] The interval judgment module is also used to output the first target parameter value, the second target parameter value, the third target parameter value, the fourth target parameter value, the fifth target parameter value, and the sixth target parameter value based on the Nth and N-1th bits of the second uniformly distributed random number, wherein the Nth bit is the highest bit of the second uniformly distributed random number.

[0009] The processing circuit further includes: a first processing unit, used to obtain a logical left-shifted random number, a first coefficient value and a first intercept value corresponding to a first function based on a first uniformly distributed random number or a third uniformly distributed random number; and a second processing unit, used to obtain a second coefficient value and a second intercept value corresponding to a second function based on a first target parameter value, and to obtain a third coefficient value and a third intercept value corresponding to a second function based on a second target parameter value.

[0010] The first processing unit includes: a leading zero sequence detector, used to determine a first position in the logarithmic segment based on a first uniformly distributed random number or a third uniformly distributed random number; a uniform segment position acquisition unit, used to determine a second position in the uniform segment based on the first uniformly distributed random number or the third uniformly distributed random number; a logical left shift unit, coupled to the leading zero sequence detector, used to logically shift the first uniformly distributed random number or the third uniformly distributed random number to the left based on the first position, to obtain a logically shifted random number; and a first function fitting coefficient unit, used to query the fitting coefficient based on the first position, the second position, and the highest bit of the first uniformly distributed random number, to obtain a first coefficient value and a first intercept value.

[0011] The multiplier module includes a first multiplier for obtaining a first target random number based on a first coefficient value and a logical left-shifted random number; the adder module includes a first adder for obtaining a fourth target random number based on the first target random number and a first intercept value.

[0012] The second processing unit includes: a second function fitting coefficient unit, used to query the fitting coefficients based on the first target parameter value to obtain the second coefficient value and the second intercept value corresponding to the second function; and a third function fitting coefficient unit, used to query the fitting coefficients based on the second target parameter value to obtain the third coefficient value and the third intercept value corresponding to the second function.

[0013] The multiplier module further includes: a second multiplier, coupled to a second function fitting coefficient unit, used to obtain a second target random number based on the second coefficient value and a third target parameter value; a third multiplier, coupled to a third function fitting coefficient unit, used to obtain a third target random number based on the third coefficient value and a fourth target parameter value; the adder module includes a second adder and a third adder, the second adder being used to obtain a fifth target random number based on the second target random number and a second intercept value; and the third adder being used to obtain a sixth target random number based on the third target random number and a third intercept value; the multiplier module further includes: a fourth multiplier, used to obtain a seventh target random number based on the fifth target random number and a fifth target parameter value; a fifth multiplier, used to obtain an eighth target random number based on the sixth target random number and a sixth target parameter value; a sixth multiplier, used to obtain a ninth target random number based on the seventh target random number and the fourth target random number; and a seventh multiplier, used to obtain a tenth target random number based on the eighth target random number and the fourth target random number.

[0014] In a second aspect, this application provides a Gaussian white noise generation circuit, including the Gaussian random number generation circuit as provided in the first aspect.

[0015] The beneficial effects of this application are as follows: Unlike the prior art, the Gaussian random number generation circuit and Gaussian white noise generation circuit provided in this application use a random number generator to generate a target uniformly distributed random number, and obtain a first uniformly distributed random number and a second uniformly distributed random number based on the target uniformly distributed random number. In this way, it is not necessary to generate a random number seed from multiple random numbers, and then use a processing circuit to generate Gaussian random numbers based on the first uniformly distributed random number and the second uniformly distributed random number. The Gaussian random numbers obtained at this time have higher accuracy and conform to the theoretical Gaussian curve. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein:

[0017] Figure 1 This is a schematic diagram of an embodiment of the Gaussian random number generation circuit provided in this application;

[0018] Figure 2 This is a schematic diagram of another embodiment of the Gaussian random number generation circuit provided in this application;

[0019] Figure 3 This is a schematic diagram of another embodiment of the Gaussian random number generation circuit provided in this application;

[0020] Figure 4 This is a schematic diagram of another embodiment of the Gaussian random number generation circuit provided in this application;

[0021] Figure 5 This is a schematic diagram of the structure of a portion of the modules in the Gaussian random number generation circuit provided in this application;

[0022] Figure 6 This is a schematic diagram of the structure of a portion of the modules in the Gaussian random number generation circuit provided in this application;

[0023] Figure 7 This is a schematic diagram of another embodiment of the Gaussian random number generation circuit provided in this application;

[0024] Figure 8 This is a schematic diagram comparing the Gaussian curve of the Gaussian random number provided in this application with the theoretical Gaussian curve;

[0025] Figure 9 This is a schematic diagram of an embodiment of the Gaussian white noise generation circuit provided in this application. Detailed Implementation

[0026] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It is understood that the specific embodiments described herein are only for explaining this application and not for limiting it. Furthermore, it should be noted that, for ease of description, only the parts related to this application are shown in the accompanying drawings, not all structures. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0027] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0028] Performance evaluation requires a large amount of data as a foundation to test the bit error rate achievable by channel coding methods such as LDPC codes. To reduce evaluation time, hardware-based noise generation is generally used to meet the test rate requirements. Most digital methods for generating AWGN (White Gaussian Noise) involve transforming random numbers to obtain Gaussian random numbers, and finally obtaining the corresponding noise through signal-to-noise ratio control.

[0029] For simulations with massive datasets, the quality of noise is a critical factor. Deviations from the ideal Gaussian probability distribution can significantly affect the accuracy of test results, leading to incorrect conclusions.

[0030] Based on this, this application proposes using a random number generator to generate a target uniformly distributed random number, and obtaining a first uniformly distributed random number and a second uniformly distributed random number based on the target uniformly distributed random number. This eliminates the need to generate a random number seed from multiple random numbers. Then, a processing circuit generates Gaussian random numbers based on the first and second uniformly distributed random numbers. The resulting Gaussian random numbers have higher accuracy and conform to the theoretical Gaussian curve. See any of the following embodiments for details.

[0031] See Figure 1 , Figure 1 This is a schematic diagram of an embodiment of the Gaussian random number generation circuit provided in this application. The Gaussian random number generation circuit 100 includes: a random number generator 10 and a processing circuit 20.

[0032] The random number generator 10 is used to generate a target uniformly distributed random number u (not shown in the figure), and obtains a first uniformly distributed random number u1 (not shown in the figure) and a second uniformly distributed random number u2 (not shown in the figure) based on the target uniformly distributed random number u.

[0033] The number of bits corresponding to the second uniformly distributed random number u2 is less than the number of bits corresponding to the first uniformly distributed random number u1.

[0034] In some embodiments, for example, the first uniformly distributed random number u1 is a 32-bit random number. The first uniformly distributed random number u1 can be a target uniformly distributed random number u. The second uniformly distributed random number u2 can be a random number composed of a portion of the bits in the target uniformly distributed random number u. For example, the second uniformly distributed random number u2 can be a random number composed of bits 0-17 in the target uniformly distributed random number u. In other embodiments, the second uniformly distributed random number u2 can be a random number composed of bits 0-15, bits 0-13, or bits 0-11 in the target uniformly distributed random number u.

[0035] In some embodiments, the first uniformly distributed random number u1 and the second uniformly distributed random number u2 are random numbers independently distributed from 0 to 1.

[0036] In some embodiments, CRC32 is used as the characteristic polynomial of the LFSR (Linear Feedback Shift Register) to construct a random number generator, which uses the state of the 32-level LFSR as a random number each time.

[0037] The processing circuit 20 is coupled to a random number generator for generating Gaussian random numbers based on a first uniformly distributed random number and a second uniformly distributed random number.

[0038] In this application, a random number generator 10 is used to generate a target uniformly distributed random number, and a first uniformly distributed random number and a second uniformly distributed random number are obtained based on the target uniformly distributed random number. This eliminates the need to generate a random number seed from multiple random numbers. Then, the processing circuit 20 generates Gaussian random numbers based on the first uniformly distributed random number and the second uniformly distributed random number. The Gaussian random numbers obtained at this time have high accuracy and conform to the theoretical Gaussian curve.

[0039] See Figure 2 , Figure 2 This is a schematic diagram of an embodiment of the Gaussian random number generation circuit provided in this application. The Gaussian random number generation circuit 100 includes a random number generator 10 and a processing circuit 20. The processing circuit 20 includes an interval judgment module 21, a processing module 22, a multiplier module 23, and an adder module 24.

[0040] The random number generator 10 is used to generate a target uniformly distributed random number u (not shown in the figure), and obtains a first uniformly distributed random number u1 (not shown in the figure) and a second uniformly distributed random number u2 (not shown in the figure) based on the target uniformly distributed random number u.

[0041] The number of bits corresponding to the second uniformly distributed random number u2 is less than the number of bits corresponding to the first uniformly distributed random number u1.

[0042] In some embodiments, for example, the first uniformly distributed random number u1 is a 32-bit random number. The first uniformly distributed random number u1 can be a target uniformly distributed random number u. The second uniformly distributed random number u2 can be a random number composed of a portion of the bits in the target uniformly distributed random number u. For example, the second uniformly distributed random number u2 can be a random number composed of bits 0-17 in the target uniformly distributed random number u. In other embodiments, the second uniformly distributed random number u2 can be a random number composed of bits 0-15, bits 0-13, or bits 0-11 in the target uniformly distributed random number u.

[0043] In some embodiments, the first uniformly distributed random number u1 and the second uniformly distributed random number u2 are random numbers independently distributed from 0 to 1.

[0044] In some embodiments, CRC32 is used as the characteristic polynomial of the LFSR (Linear Feedback Shift Register) to construct a random number generator, which uses the state of the 32-level LFSR as a random number each time.

[0045] The interval judgment module 21 is used to perform interval judgment on the second uniformly distributed random number and the fourth uniformly distributed random number, and output several parameter values ​​according to the second judgment result; wherein, the fourth uniformly distributed random number is obtained by inverting the second uniformly distributed random number. For example, the inversion module can be used to invert the first uniformly distributed random number u1 to obtain the third uniformly distributed random number u3 (not shown in the figure), and to invert the second uniformly distributed random number u2 to obtain the fourth uniformly distributed random number u4 (not shown in the figure). Since the first uniformly distributed random number u1 and the second uniformly distributed random number u2 are both represented in binary form, the inversion process is essentially to change the bits that were originally 0 to 1 and the bits that were originally 1 to 0.

[0046] The interval judgment module 21 is used to perform interval judgment on the first uniformly distributed random number u1 and the third uniformly distributed random number u3, and output the first uniformly distributed random number u1 or the third uniformly distributed random number u3 according to the first judgment result. It also performs interval judgment on the second uniformly distributed random number u2 and the fourth uniformly distributed random number u4, and outputs several parameter values ​​according to the second judgment result. These include the fifth target parameter value sign_sin (not shown in the figure), the third target parameter value u_sin (not shown in the figure), the first target parameter value addr_sin (not shown in the figure), the sixth target parameter value sign_cos (not shown in the figure), the fourth target parameter value u_cos (not shown in the figure), and the second target parameter value addr_cos (not shown in the figure).

[0047] In some embodiments, the interval determination module 21 can determine the interval based on the highest bit of either the first uniformly distributed random number u1 or the third uniformly distributed random number u3. For example, when the highest bit of the first uniformly distributed random number u1 is 0, the first uniformly distributed random number u1 is output. When the highest bit of the first uniformly distributed random number u1 is 1, the third uniformly distributed random number u3 is output. In other embodiments, when the highest bit of the first uniformly distributed random number u1 is 1, the first uniformly distributed random number u1 is output. When the highest bit of the first uniformly distributed random number u1 is 0, the third uniformly distributed random number u3 is output.

[0048] In some embodiments, the interval judgment module 21 is used to obtain any adjacent bits in the second uniformly distributed random number u2, and output the fifth target parameter value sign_sin, the third target parameter value u_sin, the first target parameter value addr_sin, the sixth target parameter value sign_cos, the fourth target parameter value u_cos, and the second target parameter value addr_cos based on the value of the bit. Correspondingly, since the value of the bit is 0 or 1, there will be four cases, with adjacent bits being 00, 01, 11, and 10. That is, each case corresponds to the corresponding fifth target parameter value sign_sin, the third target parameter value u_sin, the first target parameter value addr_sin, the sixth target parameter value sign_cos, the fourth target parameter value u_cos, and the second target parameter value addr_cos.

[0049] The processing module 22 is coupled to the interval judgment module 21, and is used to obtain a logical left-shifted random number Z (not shown in the figure), a first coefficient value a1 (not shown in the figure), and a first intercept value b1 (not shown in the figure) corresponding to the first function based on a first uniformly distributed random number u1 or a third uniformly distributed random number u3; and to obtain a second coefficient value a_sin (not shown in the figure) and a second intercept value b_sin (not shown in the figure) corresponding to the second function based on a first target parameter value addr_sin; and to obtain a third coefficient value a_cos (not shown in the figure) and a third intercept value b_cos (not shown in the figure) corresponding to the second function based on a second target parameter value addr_cos.

[0050] In some embodiments, the processing module 22 is used to obtain the first position w of the logarithmic segment based on the first uniformly distributed random number u1 or the third uniformly distributed random number u3, and then obtain the logical left-shifted random number Z based on the first position w of the logarithmic segment. The processing module 22 is used to query the coefficient and intercept value of the first function based on the first position w of the logarithmic segment to obtain the first coefficient value a1 and the first intercept value b1 corresponding to the first function. The coefficient and intercept value can be stored in a table in the corresponding storage space.

[0051] The processing module 22 is used to obtain the second coefficient value a_sin and the second intercept value b_sin corresponding to the second function based on the first target parameter value addr_sin, and to obtain the third coefficient value a_cos and the third intercept value b_cos corresponding to the second function based on the second target parameter value addr_cos.

[0052] The multiplier module 23 is used to multiply the first coefficient value a1 and the logical left-shifted random number Z to obtain the first target random number X1 (not shown in the figure).

[0053] Multiplier module 23 is also used to multiply the second coefficient value a_sin and the third target parameter value u_sin to obtain the second target random number X2 (not shown in the figure).

[0054] Multiplier module 23 is also used to multiply the third coefficient value a_cos and the fourth target parameter value u_cos to obtain the third target random number X3 (not shown in the figure).

[0055] Adder module 24 is coupled to multiplier module 23 and is used to add the first target random number and the first intercept value b1 to obtain the fourth target random number X4 (not shown in the figure).

[0056] Adder module 24 is also used to add the second target random number X2 and the second intercept value b_sin to obtain the fifth target random number X5 (not shown); and to add the third target random number X3 and the third intercept value b_cos to obtain the sixth target random number X6 (not shown).

[0057] The multiplier module 23 is also used to multiply the fifth target random number X5 and the fifth target parameter value sign_sin to obtain the seventh target random number X7 (not shown in the figure); the multiplier module 23 is also used to multiply the sixth target random number X6 and the sixth target parameter value sign_cos to obtain the eighth target random number X8 (not shown in the figure).

[0058] The multiplier module 23 is also used to multiply the seventh target random number X7 and the fourth target random number X4 to obtain the ninth target random number X9 (not shown in the figure), multiply the eighth target random number X8 and the fourth target random number X4 to obtain the tenth target random number X10 (not shown in the figure), and use the ninth target random number X9 and the tenth target random number X10 as Gaussian random numbers respectively.

[0059] In this embodiment, a target uniformly distributed random number u is generated using a random number generator 10, and a first uniformly distributed random number u1 and a second uniformly distributed random number u2 are obtained based on the target uniformly distributed random number u. This eliminates the need to generate a random number seed from multiple random numbers and then obtain more uniformly distributed random numbers, such as the first uniformly distributed random number u2, the second uniformly distributed random number u2, the third uniformly distributed random number u3, and the fourth uniformly distributed random number u4, by inverting the random numbers. Then, region judgment is performed on the first uniformly distributed random number, the second uniformly distributed random number u2, the third uniformly distributed random number u3, and the fourth uniformly distributed random number u4 to obtain the corresponding parameter values. Based on these parameter values, the first coefficient value a1 and the first intercept value b1 corresponding to the first function are obtained; as well as the second coefficient value a_sin and the second intercept value b_sin, the third coefficient value a_cos, and the third intercept value b_cos corresponding to the second function. Using a combination of multipliers and adders, the first coefficient value a1 is multiplied by the logical left-shifted random number Z to obtain the first target random number; the second coefficient value a_sin is multiplied by the third target parameter value u_sin to obtain the second target random number X2; the third coefficient value a_cos is multiplied by the fourth target parameter value u_cos to obtain the third target random number X3; and the first target random number is added to the first intercept value b1 to obtain the fourth target random number. The multiplier module 23 is used to multiply the target random number X4 by the second target random number X2 and the second intercept value b_sin to obtain the fifth target random number X5; the third target random number X3 and the third intercept value b_cos are added to obtain the sixth target random number X6; the fifth target random number X5 and the fifth target parameter value sign_sin are multiplied to obtain the seventh target random number X7; the sixth target random number X6 and the sixth target parameter value sign_cos are multiplied to obtain the eighth target random number X8; the multiplier module 23 is also used to multiply the seventh target random number X7 and the fourth target random number X4 to obtain the ninth target random number X9, and multiply the eighth target random number X8 and the fourth target random number X4 to obtain the tenth target random number X10. Finally, the ninth target random number X9 and the tenth target random number X10 are used as Gaussian random numbers. The Gaussian random numbers obtained at this time have high accuracy and conform to the theoretical Gaussian curve.

[0060] See Figure 3 , Figure 3 This is a schematic diagram of another embodiment of the Gaussian random number generation circuit provided in this application. The Gaussian random number generation circuit 100 includes a random number generator 10 and a processing circuit 20. The processing circuit 20 includes an interval judgment module 21, a processing module 22, a multiplier module 23, an adder module 24, and an inverting module 25.

[0061] The interval judgment module 21 includes: a first interval judgment unit 211 and a second interval judgment unit 212.

[0062] The first interval judgment unit 211 is coupled to the inverting module 25, and is used to perform interval judgment on the first uniformly distributed random number u1 (not shown in the figure) and the third uniformly distributed random number u3 (not shown in the figure), and output the first uniformly distributed random number u1 or the third uniformly distributed random number u3 according to the first judgment result.

[0063] In some embodiments, the first interval judgment unit 211 is used to obtain the highest bit of the first uniformly distributed random number u1, output the first uniformly distributed random number u1 when the highest bit is 0, and output the third uniformly distributed random number u3 when the highest bit is 1.

[0064] The second interval judgment unit 212 is coupled to the inversion module 25, performs interval judgment on the second uniformly distributed random number u2 (not shown in the figure) and the fourth uniformly distributed random number u4 (not shown in the figure), and outputs the fifth target parameter value sign_sin (not shown in the figure), the third target parameter value u_sin (not shown in the figure), the first target parameter value addr_sin (not shown in the figure), the sixth target parameter value sign_cos (not shown in the figure), the fourth target parameter value u_cos (not shown in the figure), and the second target parameter value addr_cos (not shown in the figure) based on the second judgment result.

[0065] In some embodiments, the second interval judgment unit 212 is used to output the fifth target parameter value sign_sin, the third target parameter value u_sin, the first target parameter value addr_sin, the sixth target parameter value sign_cos, the fourth target parameter value u_cos, and the second target parameter value addr_cos based on the Nth and N-1th bits of the second uniformly distributed random number u2, wherein the Nth bit is the highest bit of the second uniformly distributed random number u2.

[0066] In some embodiments, the second interval determination unit 212 is further configured to:

[0067] In response to the Nth and N-1th bits being 00, the fifth objective parameter value sign_sin is 1, the third objective parameter value u_sin is the 1st to N-2nd bits of the second uniformly distributed random number u2, the first objective parameter value addr_sin is the N-5th to N-2nd bits of the second uniformly distributed random number u2, the sixth objective parameter value sign_cos is 1, the fourth objective parameter value u_cos is the 1st to N-2nd bits of the fourth uniformly distributed random number u4, and the second objective parameter value addr_cos is the N-5th to N-2nd bits of the fourth uniformly distributed random number u4.

[0068] In response to the Nth and N-1th bits being 0 and 1, the fifth target parameter value sign_sin is 1, the third target parameter value u_sin is the 1st to N-2nd bits of the fourth uniformly distributed random number u4, the first target parameter value addr_sin is the N-5th to N-2nd bits of the fourth uniformly distributed random number u4, the sixth target parameter value sign_cos is -1, the fourth target parameter value u_cos is the 1st to N-2nd bits of the second uniformly distributed random number u2, and the second target parameter value addr_cos is the N-5th to N-2nd bits of the second uniformly distributed random number u2.

[0069] In response to the Nth and (N-1)th bits being 10, the fifth objective parameter value sign_sin is -1, the third objective parameter value u_sin is the 1st to (N-2nd)th bits of the second uniformly distributed random number u2, the first objective parameter value addr_sin is the (N-5th to (N-2nd)th bits of the second uniformly distributed random number u2, the sixth objective parameter value sign_cos is -1, the fourth objective parameter value u_cos is the 1st to (N-2nd)th bits of the fourth uniformly distributed random number u4, and the second objective parameter value addr_cos is the (N-5th to (N-2nd)th bits of the fourth uniformly distributed random number u4.

[0070] In response to the Nth and N-1th bits being 11, the fifth objective parameter value sign_sin is -1, the third objective parameter value u_sin is the 1st to N-2nd bits of the fourth uniformly distributed random number u4, the first objective parameter value addr_sin is the N-5th to N-2nd bits of the fourth uniformly distributed random number u4, the sixth objective parameter value sign_cos is 1, the fourth objective parameter value u_cos is the 1st to N-2nd bits of the fourth uniformly distributed random number u4, and the second objective parameter value addr_cos is the N-5th to N-2nd bits of the second uniformly distributed random number u2.

[0071] The connection relationships of the remaining modules are the same as or similar to those in other embodiments, and will not be described in detail here.

[0072] In this embodiment, a target uniformly distributed random number u is generated using a random number generator 10, and a first uniformly distributed random number u1 and a second uniformly distributed random number u2 are obtained based on the target uniformly distributed random number u. This eliminates the need to generate a random number seed from multiple random numbers and then obtain more uniformly distributed random numbers, such as the first uniformly distributed random number u2, the second uniformly distributed random number u2, the third uniformly distributed random number u3, and the fourth uniformly distributed random number u4, by inverting the random numbers. Then, region judgment is performed on the first uniformly distributed random number, the second uniformly distributed random number u2, the third uniformly distributed random number u3, and the fourth uniformly distributed random number u4 to obtain the corresponding parameter values. Based on these parameter values, the first coefficient value a1 and the first intercept value b1 corresponding to the first function are obtained; as well as the second coefficient value a_sin and the second intercept value b_sin, the third coefficient value a_cos, and the third intercept value b_cos corresponding to the second function. Using a combination of multipliers and adders, the first coefficient value a1 is multiplied by the logical left-shifted random number Z to obtain the first target random number; the second coefficient value a_sin is multiplied by the third target parameter value u_sin to obtain the second target random number X2; the third coefficient value a_cos is multiplied by the fourth target parameter value u_cos to obtain the third target random number X3; and the first target random number is added to the first intercept value b1 to obtain the fourth target random number. The multiplier module 23 is used to multiply the target random number X4 by the second target random number X2 and the second intercept value b_sin to obtain the fifth target random number X5; the third target random number X3 and the third intercept value b_cos are added to obtain the sixth target random number X6; the fifth target random number X5 and the fifth target parameter value sign_sin are multiplied to obtain the seventh target random number X7; the sixth target random number X6 and the sixth target parameter value sign_cos are multiplied to obtain the eighth target random number X8; the multiplier module 23 is also used to multiply the seventh target random number X7 and the fourth target random number X4 to obtain the ninth target random number X9, and multiply the eighth target random number X8 and the fourth target random number X4 to obtain the tenth target random number X10. Finally, the ninth target random number X9 and the tenth target random number X10 are used as Gaussian random numbers. The Gaussian random numbers obtained at this time have high accuracy and conform to the theoretical Gaussian curve.

[0073] See Figure 4 , Figure 4 This is a schematic diagram of another embodiment of the Gaussian random number generation circuit provided in this application. The Gaussian random number generation circuit 100 includes a random number generator 10 and a processing circuit 20. The processing circuit 20 includes an interval judgment module 21, a processing module 22, a multiplier module 23, an adder module 24, and an inverting module 25.

[0074] The processing module 22 includes a first processing unit 221 and a second processing unit 222.

[0075] The first processing unit 221 is used to obtain a logical left-shift random number Z, a first coefficient value a1 and a first intercept value b1 corresponding to the first function based on a first uniformly distributed random number u1 or a third uniformly distributed random number u3.

[0076] The second processing unit 222 is used to obtain the second coefficient value a_sin and the second intercept value b_sin corresponding to the second function based on the first target parameter value addr_sin, and to obtain the third coefficient value a_cos and the third intercept value b_cos corresponding to the second function based on the second target parameter value addr_cos.

[0077] The connection relationships of the remaining modules are the same as or similar to those in other embodiments, and will not be described in detail here.

[0078] In this embodiment, a target uniformly distributed random number u is generated using a random number generator 10, and a first uniformly distributed random number u1 and a second uniformly distributed random number u2 are obtained based on the target uniformly distributed random number u. This eliminates the need to generate a random number seed from multiple random numbers and then obtain more uniformly distributed random numbers, such as the first uniformly distributed random number u2, the second uniformly distributed random number u2, the third uniformly distributed random number u3, and the fourth uniformly distributed random number u4, by inverting the random numbers. Then, region judgment is performed on the first uniformly distributed random number, the second uniformly distributed random number u2, the third uniformly distributed random number u3, and the fourth uniformly distributed random number u4 to obtain the corresponding parameter values. Based on these parameter values, the first coefficient value a1 and the first intercept value b1 corresponding to the first function are obtained; as well as the second coefficient value a_sin and the second intercept value b_sin, the third coefficient value a_cos, and the third intercept value b_cos corresponding to the second function. Using a combination of multipliers and adders, the first coefficient value a1 is multiplied by the logical left-shifted random number Z to obtain the first target random number; the second coefficient value a_sin is multiplied by the third target parameter value u_sin to obtain the second target random number X2; the third coefficient value a_cos is multiplied by the fourth target parameter value u_cos to obtain the third target random number X3; and the first target random number is added to the first intercept value b1 to obtain the fourth target random number. The multiplier module 23 is used to multiply the target random number X4 by the second target random number X2 and the second intercept value b_sin to obtain the fifth target random number X5; the third target random number X3 and the third intercept value b_cos are added to obtain the sixth target random number X6; the fifth target random number X5 and the fifth target parameter value sign_sin are multiplied to obtain the seventh target random number X7; the sixth target random number X6 and the sixth target parameter value sign_cos are multiplied to obtain the eighth target random number X8; the multiplier module 23 is also used to multiply the seventh target random number X7 and the fourth target random number X4 to obtain the ninth target random number X9, and multiply the eighth target random number X8 and the fourth target random number X4 to obtain the tenth target random number X10. Finally, the ninth target random number X9 and the tenth target random number X10 are used as Gaussian random numbers. The Gaussian random numbers obtained at this time have high accuracy and conform to the theoretical Gaussian curve.

[0079] See Figure 5 , Figure 5 This is a schematic diagram of the structure of an embodiment of the first processing unit provided in this application. The first processing unit 221 includes: a leader zero sequence detector 2211, a uniform segmentation position acquisition unit 2212, a logical left shift unit 2213, and a first function fitting coefficient unit 2214.

[0080] Among them, the leader zero sequence detector 2211 is used to determine the first position w in the logarithmic segment based on the first uniformly distributed random number u1 or the third uniformly distributed random number u3.

[0081] The uniform segment position acquisition unit 2212 is used to determine the second position l in the uniform segment based on the first uniformly distributed random number u1 or the third uniformly distributed random number u3.

[0082] The logical left shift unit 2213 is coupled to the leader zero sequence detector 2211 and is used to logically shift the first uniformly distributed random number or the third uniformly distributed random number u3 according to the first position w to obtain the logical left shift random number Z.

[0083] The first function fitting coefficient unit 2214 is used to query the fitting coefficients based on the first position w, the second position l and the highest bit of the first uniformly distributed random number u1, to obtain the first coefficient value a1 and the first intercept value b1.

[0084] The first coefficient value a1 and the first intercept value b1 are stored with a 16-bit width, which includes 12 bits for the fractional part, 3 bits for the integer part, and 1 bit for the sign bit; the second coefficient value a_sin, the third coefficient value a_cos, the second intercept value b_sin, and the third intercept value b_cos are stored with a 16-bit width, which includes 14 bits for the fractional part, 1 bit for the integer part, and 1 bit for the sign bit.

[0085] The multiplier module 23 mentioned above includes: a first multiplier 231, which is used to multiply the first coefficient value a1 and the logical left-shifted random number Z to obtain the first target random number X1.

[0086] The adder module 24 described above includes a first adder 241, which adds a first target random number X1 and a first intercept value b1 to obtain a fourth target random number X4. When the first adder performs the addition operation, the addend and augend need to be aligned in decimal places.

[0087] The connection relationships of the remaining modules are the same as or similar to those in other embodiments, and will not be described in detail here.

[0088] In this embodiment, a target uniformly distributed random number u is generated using a random number generator 10, and a first uniformly distributed random number u1 and a second uniformly distributed random number u2 are obtained based on the target uniformly distributed random number u. This eliminates the need to generate a random number seed from multiple random numbers and then obtain more uniformly distributed random numbers, such as the first uniformly distributed random number u2, the second uniformly distributed random number u2, the third uniformly distributed random number u3, and the fourth uniformly distributed random number u4, by inverting the random numbers. Then, region judgment is performed on the first uniformly distributed random number, the second uniformly distributed random number u2, the third uniformly distributed random number u3, and the fourth uniformly distributed random number u4 to obtain the corresponding parameter values. Based on these parameter values, the first coefficient value a1 and the first intercept value b1 corresponding to the first function are obtained; as well as the second coefficient value a_sin and the second intercept value b_sin, the third coefficient value a_cos, and the third intercept value b_cos corresponding to the second function. Using a combination of multipliers and adders, the first coefficient value a1 is multiplied by the logical left-shifted random number Z to obtain the first target random number; the second coefficient value a_sin is multiplied by the third target parameter value u_sin to obtain the second target random number X2; the third coefficient value a_cos is multiplied by the fourth target parameter value u_cos to obtain the third target random number X3; and the first target random number is added to the first intercept value b1 to obtain the fourth target random number. The multiplier module 23 is used to multiply the target random number X4 by the second target random number X2 and the second intercept value b_sin to obtain the fifth target random number X5; the third target random number X3 and the third intercept value b_cos are added to obtain the sixth target random number X6; the fifth target random number X5 and the fifth target parameter value sign_sin are multiplied to obtain the seventh target random number X7; the sixth target random number X6 and the sixth target parameter value sign_cos are multiplied to obtain the eighth target random number X8; the multiplier module 23 is also used to multiply the seventh target random number X7 and the fourth target random number X4 to obtain the ninth target random number X9, and multiply the eighth target random number X8 and the fourth target random number X4 to obtain the tenth target random number X10. Finally, the ninth target random number X9 and the tenth target random number X10 are used as Gaussian random numbers. The Gaussian random numbers obtained at this time have high accuracy and conform to the theoretical Gaussian curve.

[0089] See Figure 6 , Figure 6 This is a schematic diagram of an embodiment of the second processing unit 222 provided in this application.

[0090] The second processing unit 222 includes a second function fitting coefficient unit 2221 and a third function fitting coefficient unit 2222.

[0091] The second function fitting coefficient unit 2221 is used to query the fitting coefficients based on the first target parameter value addr_sin, and obtain the second coefficient value a_sin and the second intercept value b_sin corresponding to the second function.

[0092] The third function fitting coefficient unit 2222 is used to query the fitting coefficients based on the second target parameter value addr_cos, and obtain the third coefficient value a_cos and the third intercept value b_cos corresponding to the second function.

[0093] The multiplier module 23 further includes: a second multiplier 232, a third multiplier 233, a fourth multiplier 234, a fifth multiplier 235, a sixth multiplier 236, and a seventh multiplier 237. The adder module 24 includes a second adder 242 and a third adder 243.

[0094] The second multiplier 232 is coupled to the second function fitting coefficient unit 2221 and is used to multiply the second coefficient value a_sin and the third target parameter value u_sin to obtain the second target random number X2.

[0095] The third multiplier 233 is coupled to the third function fitting coefficient unit 2222, and is used to multiply the third coefficient value a_cos and the fourth target parameter value u_cos to obtain the third target random number X3.

[0096] The second adder 242 is used to add the second target random number X2 and the second intercept value b_sin to obtain the fifth target random number X5.

[0097] The third adder 243 is used to add the third target random number X3 and the third intercept value b_cos to obtain the sixth target random number X6.

[0098] The fourth multiplier 234 is used to multiply the fifth target random number X5 and the fifth target parameter value sign_sin to obtain the seventh target random number X7.

[0099] The fifth multiplier 235 is used to multiply the sixth target random number X6 and the sixth target parameter value sign_cos to obtain the eighth target random number X8.

[0100] The sixth multiplier 236 is used to multiply the seventh target random number X7 and the fourth target random number X4 to obtain the ninth target random number X9.

[0101] The seventh multiplier 237 is used to multiply the eighth target random number X8 and the fourth target random number X4 to obtain the tenth target random number X10.

[0102] The connection relationships of the remaining modules are the same as or similar to those in other embodiments, and will not be described in detail here.

[0103] In this embodiment, a target uniformly distributed random number u is generated using a random number generator 10, and a first uniformly distributed random number u1 and a second uniformly distributed random number u2 are obtained based on the target uniformly distributed random number u. This eliminates the need to generate a random number seed from multiple random numbers and then obtain more uniformly distributed random numbers, such as the first uniformly distributed random number u2, the second uniformly distributed random number u2, the third uniformly distributed random number u3, and the fourth uniformly distributed random number u4, by inverting the random numbers. Then, region judgment is performed on the first uniformly distributed random number, the second uniformly distributed random number u2, the third uniformly distributed random number u3, and the fourth uniformly distributed random number u4 to obtain the corresponding parameter values. Based on these parameter values, the first coefficient value a1 and the first intercept value b1 corresponding to the first function are obtained; as well as the second coefficient value a_sin and the second intercept value b_sin, the third coefficient value a_cos, and the third intercept value b_cos corresponding to the second function. Using a combination of multipliers and adders, the first coefficient value a1 is multiplied by the logical left-shifted random number Z to obtain the first target random number; the second coefficient value a_sin is multiplied by the third target parameter value u_sin to obtain the second target random number X2; the third coefficient value a_cos is multiplied by the fourth target parameter value u_cos to obtain the third target random number X3; and the first target random number is added to the first intercept value b1 to obtain the fourth target random number. The multiplier module 23 is used to multiply the target random number X4 by the second target random number X2 and the second intercept value b_sin to obtain the fifth target random number X5; the third target random number X3 and the third intercept value b_cos are added to obtain the sixth target random number X6; the fifth target random number X5 and the fifth target parameter value sign_sin are multiplied to obtain the seventh target random number X7; the sixth target random number X6 and the sixth target parameter value sign_cos are multiplied to obtain the eighth target random number X8; the multiplier module 23 is also used to multiply the seventh target random number X7 and the fourth target random number X4 to obtain the ninth target random number X9; the eighth target random number X8 and the fourth target random number X4 are multiplied to obtain the tenth target random number X10; finally, the ninth target random number X9 and the tenth target random number X10 are used as Gaussian random numbers respectively. The Gaussian random numbers obtained at this time have high accuracy and conform to the theoretical Gaussian curve.

[0104] In one application scenario, combined Figure 7 Explanation:

[0105] like Figure 7As shown, the Gaussian random number generation circuit 100 includes a random number generator 10, a first inversion unit 251, a second inversion unit 252, a first interval judgment unit 211, a second interval judgment unit 212, a leading zero sequence detector 2211, a uniform segment position acquisition unit 2212, a logic left shift unit 2213, a first function fitting coefficient unit 2214, a second function fitting coefficient unit 2221, a third function fitting coefficient unit 2222, a first multiplier 231, a second multiplier 232, a third multiplier 233, a fourth multiplier 234, a fifth multiplier 235, a sixth multiplier 236, a seventh multiplier 237, a first adder 241, a second adder 242, and a third adder 243.

[0106] For two independent, uniformly distributed random numbers u1 and u2 input to random number generator 10, the following transformation can be used to obtain two independent Gaussian random numbers G1 and G2 ~ N(0,1) that follow a standard normal distribution:

[0107]

[0108] g1(u2) = sin(2πu2);

[0109] g2(u2) = cos(2πu2);

[0110] G1 = f(u1)·g1(u2);

[0111] G2 = f(u1)·g2(u2);

[0112] Random number generator 10 can be constructed using CRC32 LFSR, with the characteristic polynomial being: f(x) = x 32 +x 26 +x 23 +x 22 +x 16 +x 12 +x 11 +x 10 +x 8 +x 7 +x 5 +x 4 +x 2 +x+1.

[0113] The outputs G1 and G2 are two independent Gaussian random numbers that follow a standard normal distribution. After obtaining G1 and G2, the generated Gaussian random numbers can be multiplied by a constant σ to obtain a set of random numbers with a mean of 0 and a variance of σ. 2Additive Gaussian white noise. To obtain additive Gaussian white noise with a non-zero mean, multiply by σ and add a constant μ. This will give you additive Gaussian white noise with a mean of μ and a variance of σ. 2 Additive Gaussian white noise with a Gaussian distribution.

[0114] (1) The first interval judgment unit 211 can determine the output based on the highest bit of u1. If the highest bit of u1 u1

[31] = 0, then output u1[31:0]; if the highest bit of u1 u1

[31] = 1, then output u3[31:0].

[0115] (2) The leader zero sequence detector 2211 can detect the number of consecutive "0" bits starting from the most significant bit, which is used to determine the first position w of the logarithmic segment where the independent variable u1 is located (equal to the number of consecutive "0" bits minus 1).

[0116] (3) The uniform segment position acquisition unit 2212 is used to determine the second position l of the uniform segment where the independent variable u1 is located.

[0117]

[0118] (4) The first function fitting coefficient unit 2214 stores the coefficients a (the first coefficient value mentioned above) and intercept b (the first intercept value mentioned above) of each uniform segment fitting. They can be obtained by looking up the table through r, w, l. The storage table format is shown in Table I (r=0) and Table II (r=1). The row index of the coefficient value a and the intercept value b in the storage tables I and II can be obtained according to the following rules. r represents u1

[31] .

[0119]

[0120] The coefficient value a1 (signed number) is multiplied by the output value of the logical left shift unit 2213 (unsigned number, represented by a 32-bit width, including 32 decimal places). (A truncation operation is required; the product is represented by a 16-bit width, including 1 sign bit, 3 integer bits, and 12 decimal places). The result of this multiplication (signed number) is then added to the intercept value b1 (signed number), finally yielding f(u1) (signed number, represented by a 16-bit width, including 1 sign bit, 3 integer bits, and 12 decimal places). f(u1) is equivalent to the fourth target random number X4 mentioned above.

[0121] Table I shows an example of the storage format for the coefficients and intercepts corresponding to r = 0.

[0122]

[0123]

[0124] Among them, in Table I, a r,w,l and b r,w,l The coefficients and intercepts of a first-order polynomial (a·u1+b) fit are obtained by fitting using the MATLAB platform. The storage format is Q(16, 12), which means that each value is stored with a 16-bit width, including 12 bits for the decimal part, 3 bits for the integer part, and 1 bit for the sign bit.

[0125] In Table I, f(u1) represents the function value corresponding to r, w, and l. These 16 points are the points closest to the "0" part. Piecewise fitting is no longer performed; their corresponding function values ​​are directly calculated and stored.

[0126] The data stored in Table I are all in two's complement form.

[0127] Table I has a size (rows × columns) of 232 × 2 and occupies 928 bytes of resources.

[0128] Table II: Example of storage format for coefficients and intercepts corresponding to r=1.

[0129]

[0130]

[0131] Among them, a in Table II r,w,l and b r,w,l The coefficients and intercepts of a first-order polynomial (a·u1+b) fit are obtained by fitting using the MATLAB platform. The storage format is Q(16, 12), which means that each value is stored with a 16-bit width, including 12 bits for the decimal part, 3 bits for the integer part, and 1 bit for the sign bit.

[0132] In Table II, f(u1) represents the function value corresponding to the values ​​of r, w, and l. These 16 points are the points closest to the "1" part. Piecewise fitting is no longer performed; their corresponding function values ​​are directly calculated and stored.

[0133] The data stored in Table II are all in two's complement form.

[0134] Table II has a size (rows × columns) of 232 × 2 and occupies 928 bytes of resources.

[0135] (5) The second interval judgment unit 212 makes the following judgment based on u2 and u4.

[0136]

[0137] (6) The second function fitting coefficient unit 2221 and the third function fitting coefficient unit 2222 store the second coefficient value a_sin (not shown in the figure), the second intercept value b_sin, the third coefficient value a_cos (not shown in the figure), and the third intercept value b_cos (not shown in the figure) of each uniform segment fitting. The corresponding storage location can be determined by addr_sin (or addr_cos) and obtained by looking up the table according to Table III.

[0138] Table III: Example of storage format for piecewise coefficients and intercepts of the second function

[0139]

[0140] Among them, in Table III, a i , i∈{0,1,…,15} and b i , i∈{0,1,…,15} are the coefficients and intercepts of a first-order polynomial (a·u2+b) fitting for each uniform segment, which are obtained by fitting using the MATLAB platform. The storage format is Q(16,14), which means that each value is stored with a 16-bit width, including 14 bits for the decimal part, 1 bit for the integer part, and 1 bit for the sign bit.

[0141] The data stored in Table III are all in two's complement form.

[0142] Table III has a size (rows × columns) of 16 × 2 and occupies 64 bytes of resources.

[0143] The process involves multiplying a_sin (or a_cos, a signed number) with u_sin (or u_cos, an unsigned number, represented by a 16-bit width, including 16 decimal places) (a truncation operation is required; the product is represented by a 16-bit width, including 1 sign bit, 1 integer bit, and 14 decimal places). The result of this multiplication (a signed number) is then added to b_sin (or b_cos, a signed number). Finally, this addition is multiplied by sign_sin(sign_cos) to obtain the function value g1(u2) (or g2(u2), a signed number, represented by a 16-bit width, including 1 sign bit, 1 integer bit, and 14 decimal places). g1(u2) is equivalent to the seventh target random number X7 mentioned above, or g2(u2) is equivalent to the eighth target random number X8 mentioned above.

[0144] The second multiplier 232 is coupled to the second function fitting coefficient unit 2221 and is used to multiply the second coefficient value a_sin and the third target parameter value u_sin to obtain the second target random number X2.

[0145] The third multiplier 233 is coupled to the third function fitting coefficient unit 2222, and is used to multiply the third coefficient value a_cos and the fourth target parameter value u_cos to obtain the third target random number X3.

[0146] The second adder 242 is used to add the second target random number X2 and the second intercept value b_sin to obtain the fifth target random number X5.

[0147] The third adder 243 is used to add the third target random number X3 and the third intercept value b_cos to obtain the sixth target random number X6.

[0148] The fourth multiplier 234 is used to multiply the fifth target random number X5 and the fifth target parameter value sign_sin to obtain the seventh target random number X7.

[0149] The fifth multiplier 235 is used to multiply the sixth target random number X6 and the sixth target parameter value sign_cos to obtain the eighth target random number X8.

[0150] The sixth multiplier 236 is used to multiply the seventh target random number X7 and the fourth target random number X4 to obtain the ninth target random number X9.

[0151] The seventh multiplier 237 is used to multiply the eighth target random number X8 and the fourth target random number X4 to obtain the tenth target random number X10.

[0152] The ninth target random number X9 and the tenth target random number X10 are used as Gaussian random numbers G1 and G2, respectively.

[0153] In summary, storing these tables requires 1920 bytes of resources. Compared to the 12416 bytes required to store tables in related technologies, this significantly reduces the storage resource consumption.

[0154] In this embodiment, a target uniformly distributed random number u is generated using a random number generator 10, and a first uniformly distributed random number u1 and a second uniformly distributed random number u2 are obtained based on the target uniformly distributed random number u. This eliminates the need to generate a random number seed from multiple random numbers and then obtain more uniformly distributed random numbers, such as the first uniformly distributed random number u2, the second uniformly distributed random number u2, the third uniformly distributed random number u3, and the fourth uniformly distributed random number u4, by inverting the random numbers. Then, region judgment is performed on the first uniformly distributed random number, the second uniformly distributed random number u2, the third uniformly distributed random number u3, and the fourth uniformly distributed random number u4 to obtain the corresponding parameter values. Based on these parameter values, the first coefficient value a1 and the first intercept value b1 corresponding to the first function are obtained; as well as the second coefficient value a_sin and the second intercept value b_sin, the third coefficient value a_cos, and the third intercept value b_cos corresponding to the second function. Using a combination of multipliers and adders, the first coefficient value a1 is multiplied by the logical left-shifted random number Z to obtain the first target random number; the second coefficient value a_sin is multiplied by the third target parameter value u_sin to obtain the second target random number X2; the third coefficient value a_cos is multiplied by the fourth target parameter value u_cos to obtain the third target random number X3; and the first target random number is added to the first intercept value b1 to obtain the fourth target random number. The multiplier module 23 is used to multiply the target random number X4 by the second target random number X2 and the second intercept value b_sin to obtain the fifth target random number X5; the third target random number X3 and the third intercept value b_cos are added to obtain the sixth target random number X6; the fifth target random number X5 and the fifth target parameter value sign_sin are multiplied to obtain the seventh target random number X7; the sixth target random number X6 and the sixth target parameter value sign_cos are multiplied to obtain the eighth target random number X8; the multiplier module 23 is also used to multiply the seventh target random number X7 and the fourth target random number X4 to obtain the ninth target random number X9, and multiply the eighth target random number X8 and the fourth target random number X4 to obtain the tenth target random number X10. Finally, the ninth target random number X9 and the tenth target random number X10 are used as Gaussian random numbers. The Gaussian random numbers obtained at this time have high accuracy and conform to the theoretical Gaussian curve.

[0155] See Figure 8 The Gaussian curve of the Gaussian random number provided in this application almost overlaps with the theoretical Gaussian curve, except for a slight deviation at the highest point.

[0156] See Figure 9 , Figure 9 This application provides a Gaussian white noise generation circuit 2000, including a Gaussian random number generation circuit 100. The Gaussian random number generation circuit 100 is as described in any of the above embodiments.

[0157] In summary, the Gaussian random number generation circuit 100 and the Gaussian white noise generation circuit provided in this application utilize the random number generator 10 to generate a target uniformly distributed random number u, and obtain a first uniformly distributed random number and a second uniformly distributed random number u2 based on the target uniformly distributed random number u. In this way, it is not necessary to generate a random number seed from multiple random numbers and then obtain more uniformly distributed random numbers, such as the first uniformly distributed random number, the second uniformly distributed random number u2, the third uniformly distributed random number u3, and the fourth uniformly distributed random number u4, by inverting the random numbers. Then, region judgment is performed on the first uniformly distributed random number, the second uniformly distributed random number u2, the third uniformly distributed random number u3, and the fourth uniformly distributed random number u4 to obtain the corresponding parameter values. Based on these parameter values, the first coefficient value a1 and the first intercept value b1 corresponding to the first function are obtained; as well as the second coefficient value a_sin and the second intercept value b_sin, the third coefficient value a_cos, and the third intercept value b_cos corresponding to the second function. Using a combination of multipliers and adders, the first coefficient value a1 is multiplied by the logical left-shifted random number Z to obtain the first target random number; the second coefficient value a_sin is multiplied by the third target parameter value u_sin to obtain the second target random number X2; the third coefficient value a_cos is multiplied by the fourth target parameter value u_cos to obtain the third target random number X3; and the first target random number is added to the first intercept value b1 to obtain the fourth target random number. The multiplier module 23 is used to multiply the target random number X4 by the second target random number X2 and the second intercept value b_sin to obtain the fifth target random number X5; the third target random number X3 and the third intercept value b_cos are added to obtain the sixth target random number X6; the fifth target random number X5 and the fifth target parameter value sign_sin are multiplied to obtain the seventh target random number X7; the sixth target random number X6 and the sixth target parameter value sign_cos are multiplied to obtain the eighth target random number X8; the multiplier module 23 is also used to multiply the seventh target random number X7 and the fourth target random number X4 to obtain the ninth target random number X9, and multiply the eighth target random number X8 and the fourth target random number X4 to obtain the tenth target random number X10. Finally, the ninth target random number X9 and the tenth target random number X10 are used as Gaussian random numbers. The Gaussian random numbers obtained at this time have high accuracy and conform to the theoretical Gaussian curve.

[0158] Furthermore, a random number generator is constructed using LFSR, and standard CRC32 is selected as the feedback function (or characteristic polynomial) of LFSR, so that the register can traverse all non-zero states and reach the longest period. A series of fitting coefficients for the corresponding generation function are segmented and the storage bit width is designed to save storage resources as much as possible while ensuring fitting accuracy.

[0159] In the several embodiments provided in this application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.

[0160] If the integrated units in the other embodiments described above are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0161] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A Gaussian random number generation circuit, characterized in that, The Gaussian random number generation circuit includes: A random number generator is used to generate a target uniformly distributed random number, and to obtain a first uniformly distributed random number and a second uniformly distributed random number based on the target uniformly distributed random number; wherein the number of bits corresponding to the second uniformly distributed random number is less than the number of bits of the first uniformly distributed random number; The processing circuit, coupled to the random number generator, is used to generate Gaussian random numbers based on the first uniformly distributed random number and the second uniformly distributed random number. The processing circuit includes: The interval judgment module is used to perform interval judgment on the second uniformly distributed random number and the fourth uniformly distributed random number, and output several parameter values ​​according to the second judgment result; wherein, the fourth uniformly distributed random number is obtained by inverting the second uniformly distributed random number; The processing module, coupled to the interval judgment module, is used to obtain a logical left-shifted random number, a first coefficient value, and a first intercept value corresponding to a first function based on the first uniformly distributed random number or the third uniformly distributed random number; and to obtain a second coefficient value and a second intercept value corresponding to a second function based on a first target parameter value among the plurality of parameter values; and to obtain a third coefficient value and a third intercept value corresponding to a second function based on a second target parameter value among the plurality of parameter values; wherein the third uniformly distributed random number is obtained by inverting the first uniformly distributed random number; The multiplier module is configured to obtain a first target random number based on the first coefficient value and the logical left-shift random number; and to obtain a second target random number based on the second coefficient value and a third target parameter value among the plurality of parameter values; and to obtain a third target random number based on the third coefficient value and a fourth target parameter value among the plurality of parameter values. An adder module, coupled to the multiplier module, is configured to obtain a fourth target random number based on the first target random number and the first intercept value; and to obtain a fifth target random number based on the second target random number and the second intercept value; and to obtain a sixth target random number based on the third target random number and the third intercept value. The multiplier module is further configured to obtain a seventh target random number based on the fifth target random number and the fifth target parameter value among the plurality of parameter values; and to obtain an eighth target random number based on the sixth target random number and the sixth target parameter value among the plurality of parameter values; The multiplier module is further configured to obtain a ninth target random number based on the seventh target random number and the fourth target random number, and to obtain a tenth target random number based on the eighth target random number and the fourth target random number, and to use the ninth target random number and the tenth target random number as the Gaussian random number respectively.

2. The Gaussian random number generation circuit according to claim 1, characterized in that, The interval judgment module is also used to obtain the highest bit of the first uniformly distributed random number, output the first uniformly distributed random number when the highest bit is 0, and output the third uniformly distributed random number when the highest bit is 1.

3. The Gaussian random number generation circuit according to claim 1, characterized in that, The interval judgment module is further configured to output the first target parameter value, the second target parameter value, the third target parameter value, the fourth target parameter value, the fifth target parameter value, and the sixth target parameter value based on the Nth and (N-1)th bits of the second uniformly distributed random number, wherein the Nth bit is the highest bit of the second uniformly distributed random number.

4. The Gaussian random number generation circuit according to claim 1, characterized in that, The processing circuit further includes: The first processing unit is configured to obtain a logical left-shifted random number, a first coefficient value corresponding to the first function, and a first intercept value based on the first uniformly distributed random number or the third uniformly distributed random number. The second processing unit is configured to obtain the second coefficient value and the second intercept value corresponding to the second function based on the first target parameter value, and to obtain the third coefficient value and the third intercept value corresponding to the second function based on the second target parameter value.

5. The Gaussian random number generation circuit according to claim 4, characterized in that, The first processing unit includes: A leading zero sequence detector is used to determine the first position in the logarithmic segment based on the first uniformly distributed random number or the third uniformly distributed random number. The uniform segmentation position acquisition unit is used to determine the second position in the uniform segmentation based on the first uniformly distributed random number or the third uniformly distributed random number. A logical left shift unit, coupled to the leader zero sequence detector, is used to logically shift the first uniformly distributed random number or the third uniformly distributed random number according to the first position to obtain a logically left-shifted random number. The first function fitting coefficient unit is used to query the fitting coefficient based on the first position, the second position, and the highest bit of the first uniformly distributed random number, so as to obtain the first coefficient value and the first intercept value.

6. The Gaussian random number generation circuit according to claim 4, characterized in that, The multiplier module includes: A first multiplier is used to obtain a first target random number based on the first coefficient value and the logical left-shifted random number; The adder module includes a first adder for obtaining a fourth target random number based on the first target random number and the first intercept value.

7. The Gaussian random number generation circuit according to claim 4, characterized in that, The second processing unit includes: The second function fitting coefficient unit is used to query the fitting coefficient based on the first target parameter value to obtain the second coefficient value and the second intercept value corresponding to the second function. The third function fitting coefficient unit is used to query the fitting coefficients based on the second target parameter value to obtain the third coefficient value and the third intercept value corresponding to the second function.

8. The Gaussian random number generation circuit according to claim 7, characterized in that, The multiplier module also includes: The second multiplier, coupled to the second function fitting coefficient unit, is used to obtain a second target random number based on the second coefficient value and the third target parameter value; The third multiplier, coupled to the third function fitting coefficient unit, is used to obtain a third target random number based on the third coefficient value and the fourth target parameter value; The adder module includes a second adder and a third adder. The second adder is used to obtain a fifth target random number based on the second target random number and the second intercept value. The third adder is used to obtain a sixth target random number based on the third target random number and the third intercept value. The multiplier module also includes: The fourth multiplier is used to obtain the seventh target random number based on the fifth target random number and the fifth target parameter value; The fifth multiplier is used to obtain the eighth target random number based on the sixth target random number and the sixth target parameter value; The sixth multiplier is used to obtain the ninth target random number based on the seventh target random number and the fourth target random number; The seventh multiplier is used to obtain the tenth target random number based on the eighth target random number and the fourth target random number.

9. A Gaussian white noise generation circuit, characterized in that, Includes the Gaussian random number generation circuit as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Method and device for generating a Gaussian white noise signal source

    CN105958945A

  • Device and method for generating white Gaussian noise by true random number

    CN110764734A