Pseudo-random number generation circuit device
11836465 · 2023-12-05
Assignee
Inventors
Cpc classification
G06F2207/581
PHYSICS
International classification
Abstract
A pseudo-random number generation circuit device includes a pseudo-random number generation circuit including a logic circuit configured based on rule data that generates a next random number value from a current random number value, a cycle detection circuit that detects, based on a seed, an end of a cycle of random numbers, which are generated by the pseudo-random number generation circuit, and a rule data generation circuit that generates new rule data at a first trigger, at which the cycle detection circuit detects the end of the cycle of random numbers, to output the new rule data to the pseudo-random number generation circuit, wherein the cycle detection circuit stores a random number value, which is generated by a new logic circuit configured based on the new rule data, as the seed.
Claims
1. A pseudo-random number generation circuit device comprising: a pseudo-random number generation circuit including a latch circuit which holds a next random number value in synchronization with a clock and output the next random number value as a current random number value, and a logic circuit configured based on rule data that generates the next random number value from the current random number value; a cycle detection circuit that detects, based on a seed, an end of a cycle of random numbers which are generated by the pseudo-random number generation circuit, random numbers in the cycle of random numbers comprising next random number values generated by the logic circuit; and a rule data generation circuit that generates new rule data at a first trigger, at which the cycle detection circuit detects the end of the cycle of random numbers, to output the new rule data to the pseudo-random number generation circuit, the cycle detection circuit stores as the seed the current random number value output by the latch circuit holding the next random number value which is generated by a new logic circuit configured based on the new rule data, and the pseudo-random number generation circuit generates random numbers in a new cycle of random numbers based on the seed and the new logic circuit.
2. The pseudo-random number generation circuit device according to claim 1, wherein the cycle detection circuit stores as the seed the current random number value output by the latch circuit holding the next random number value which the new logic circuit configured based on the new rule data generates for a first time, and then detects the end of the new cycle of the random numbers when the next random number value generated by the new logic circuit of the pseudo-random number generation circuit matches with the seed that is stored.
3. The pseudo-random number generation circuit device according to claim 1, wherein the pseudo-random number generation circuit further includes: an inversion circuit which inverts, based on an inversion signal, the next random number value which is generated by the logic circuit; and the latch circuit latches the next random number value which is generated by the logic circuit, or an inverted random number value to which the inversion circuit inverts the next random number value, the cycle detection circuit includes an all zero checking circuit which detects whether all bits of the next random number value are 0, the rule data generation circuit generates the new rule data at a second trigger, at which the all zero checking circuit detects that all bits of the next random number value are zero, to output the new rule data to the pseudo-random number generation circuit, and the cycle detection circuit outputs the inversion signal in an active state to the pseudo-random number generation circuit at the second trigger.
4. The pseudo-random number generation circuit device according to claim 3, wherein the pseudo-random number generation circuit includes N number of cells (N is a plural number) each of which includes the logic circuit and the latch circuit, a part of the N number of cells having the inversion circuit, the logic circuit in each of the N number of cells generates 1-bit of the next random number value, and the inversion circuit of the part of the N number of cells is either an exclusive OR circuit to which the inversion signal and the next random number value are inputted, or an OR circuit to which the inversion signal and the next random number value are inputted, and at least one of the inversion circuits is the OR circuit.
5. The pseudo-random number generation circuit device according to claim 1, wherein the pseudo-random number generation circuit further includes: an inversion circuit which inverts, based on an inversion signal, the next random number value which is generated by the logic circuit; and the latch circuit latches the next random number value which is generated by the logic circuit, or an inverted random number value to which the inversion circuit inverts the next random number value, the cycle detection circuit includes a convergence checking circuit which detects whether the next random number value is converged to a same value, the rule data generation circuit generates the new rule data at a third trigger, at which the convergence checking circuit detects that the next random number value is converged to the same value, to output the new rule data to the pseudo-random number generation circuit, and the cycle detection circuit outputs the inversion signal in an active state to the pseudo-random number generation circuit at the third trigger.
6. The pseudo-random number generation circuit device according to claim 5, wherein the pseudo-random number generation circuit includes N number of cells (N is a plural number) each of which includes the logic circuit and the latch circuit, a part of the N number of cells having the inversion circuit, the logic circuit in each of the N number of cells generates 1-bit of the next random number value, and the inversion circuit of the part of the N number of cells is either an exclusive OR circuit to which the inversion signal and the next random number value are inputted, or an OR circuit to which the inversion signal and the next random number value are inputted, and at least one of the inversion circuits is the OR circuit.
7. The pseudo-random number generation circuit device according to claim 1, wherein the pseudo-random number generation circuit further includes: an inversion circuit which inverts, based on an inversion signal, the next random number value which is generated by the logic circuit; and the latch circuit latches the next random number value which is generated by the logic circuit, or an inverted random number value to which the inversion circuit inverts the next random number value, the cycle detection circuit outputs the inversion signal in an active state to the pseudo-random number generation circuit at the first trigger.
8. The pseudo-random number generation circuit device according to claim 1, wherein the rule data generation circuit includes: a ring oscillator of which oscillation frequency is changed each time of the first trigger; and a rule data storage device which stores a time series bit, which is outputted by the ring oscillator, as the rule data.
9. The pseudo-random number generation circuit device according to claim 1, wherein the pseudo-random number generation circuit includes N number of cells (N is a plural number) each of which includes the logic circuit and the latch circuit, and the logic circuit in each of the N number of cells generates 1-bit of the next random number value.
Description
BRIEF DESCRIPTION OF DRAWINGS
(1)
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10)
(11)
(12)
(13)
(14)
(15)
(16)
DESCRIPTION OF EMBODIMENTS
(17)
(18) The pseudo-random number generation circuit illustrated in
(19) When the pseudo-random generation circuit includes four cells, and the four cells are combined in the sequence: the rule 90, the rule 150, the rule 90 and the rule 150, the following random number sequence, corresponding to a primitive polynomial f(x) of degree 4, is generated.
f(x)=x.sup.4+x+1 (Expression 1)
(20) In the case of the pseudo-random number generation circuit in
(21)
(22) The example of a case of a cycle shorter than the longest cycle indicated in
f(x)=x4+x3+x1+1 [Math. 1]
(23) The example of a case where random number values converge indicated in
f(x)=x.sup.4+1 [Math. 2]
(24) The example of a case where random number values converge to “0” indicated in
f(x)=x.sup.4 [Math. 3]
(25) Issues that become clear in
EMBODIMENT 1
(26)
(27)
(28) The operation of the pseudo-random number generation circuit device will be described in detail. First the rule data generation unit RLD_GEN generates rule data at random, and outputs the generated rule data RLD to the pseudo-random number generation unit P_RDM_GEN (S2, S5). In the pseudo-random number generation unit, the configuration of the logic circuit in each cell is changed based on the inputted rule data RLD. Then in the pseudo-random number generation unit P_RDM_GEN, each logic circuit configured based on the rule data generates a next random number value N_RDM from the current random number value C_RDM, as mentioned above (S3). Further, the cycle detection unit CYC_DET monitors the next random number value N_RDM generated by the pseudo-random number generation unit, detects the end of the cycle of the random numbers, and outputs the rule data control signal CNT_RLD to the rule data generation unit RLD_GEN using the above detection as a trigger (S4). Then responding to the rule data control signal CNT_RLD, the rule data generation unit RLD_GEN generates new rule data RLD, and outputs the new rule data RLD to the pseudo-random number generation unit P_RDM_GEN, so as to change the configuration of the logic circuit of each cell based on the new rule data (S5). In the pseudo-random number generation unit, the configuration of each logic circuit is changed based on the new rule data, a new next random number value N_RDM is generated, and the newly generated next random number value N_RDM is stored in the cycle detection unit CYC_DET as a new seed (S6). Then the cycle detection unit CYC_DET checks the matching between the stored seed and the next random number value to be generated, and detects the end of the cycle when a match is determined (S4).
(29) One reason why random numbers generated by the pseudo-random number generation circuit device are predictable is because the primitive polynomial of the pseudo-random number generation unit is fixed to one type, and the random number generation sequence is therefore generated cyclically. To prevent this, in Embodiment 1, the setting of the rule data RLD of the pseudo-random number generation unit is changeable, so that the random number generation sequence or the generation cycle thereof are changeable among a plurality of different polynomials. Further, the rule data RLD is not externally set, but is suitably switched by the pseudo-random number generation circuit device autonomously and non-deterministically. This makes random number prediction difficult. In Embodiment 1, when the end of the random number generation cycle is detected, a new random number generation rule is generated and the configuration of the logic circuit of the pseudo-random number generation unit is switched based on the generated rule, and at the same time, a new random number sequence is continuously generated using the new random number value (next random number value) generated from the random number value at this time (current random number value), as a new seed.
(30)
(31) Each of the n number of logic circuits HB_R is a hybrid rule logic circuit, to which rule data d.sub.1 to d.sub.n generated by the rule data generation unit RLD_GEN is inputted respectively and of which configuration changes to either one of the logical circuit having the rule 90 and the logic circuit having the rule 150 in accordance with the value of the inputted rule data d.sub.1 to d.sub.n.
(32) The hybrid rule logic circuit HB_R illustrated in the lower portion of
(33) In the case where the rule data d.sub.k is “1”, the AND gate AG inputs the current random number value q.sub.k(t) of this cell directly to the exclusive OR circuit XOR. Thereby the logic circuit HB_R becomes a three-input exclusive OR circuit, and is configured to be the logic circuit having the rule 150. In the case where the rule data d.sub.k is “0”, the output of the AND gate AG becomes “0”. Thereby the logic circuit HB_R becomes a two-input exclusive OR circuit to which the current random number values q.sub.k−1(t), q.sub.k+1(t) of both adjacent cells are inputted, and is configured to be the logic circuit having the rule 90. The logic circuit HB_R inputs the current random number values and outputs the next random number value h.sub.k(t). In this way, the pseudo-random number generation unit changes the configuration of the logic circuit HB_R, which generates random numbers by changing the rule data d.sub.1 to d.sub.n.
(34)
(35) While the pseudo-random number generation unit sequentially generates the current random number value q.sub.1 to q.sub.n and the next random number value h.sub.1 to h.sub.n synchronously with the clock CK, the cycle checking unit CYC_CH detects the match between the next random number value h.sub.1 to h.sub.n and the initial seed s.sub.1 to s.sub.n, and outputs the cycle end trigger signal TRG_C “1”. Then at a half clock thereafter, the flip-flop FFa latches the cycle end trigger signal TRG_C and changes the rule data control signal CNT_RLD to “1”. Further, at a half clock after the next clock CK, the flip-flop FFb latches the rule data control signal CNT_RLD and changes the seed control signal CNT_SD to “1”. Responding to this change, the AND gate A2 outputs the clock CK as a seed latch clock A2-out, and the initial seed storage device SEED_MEM stores the current random number value q.sub.1 to q.sub.n, which is the next random number value generated one clock after the matched next random number value h.sub.1 to h.sub.n and is latched by the pseudo-random number generation unit, as the initial seed s.sub.1 to s.sub.n.
(36)
(37)
(38) It is assumed that in the pseudo-random number generation unit P_RDM_GEN, the flip-flop FF.sub.1 to FF.sub.n stores the next random number value h.sub.1 to h.sub.n outputted by the logic circuit HB_R synchronously with the clock CK, and during this clock cycle, the logic circuit outputs the next random number value h.sub.1 to h.sub.n based on the current random number value q.sub.1 to q.sub.n outputted by the flip-flop FF.sub.1 to FF.sub.n. The operation in the clock cycles CK1 to CK3 will be sequentially described.
(39) Clock CK1 (Cycle Detection)
(40) Synchronizing with clock CK1, the pseudo-random number generation unit stores the next random number value h.sub.1 to h.sub.n, in the flip-flop FF.sub.1 to FF.sub.n to change the current random number value q.sub.1 to q.sub.n, and during the first half cycle of the clock CK1, the logic circuit HB_R newly generates the next random number value h.sub.1 to h.sub.n, based on the current random number value q.sub.1 to q.sub.n. In
(41) Clock CK2 (Rule Data Switching and Next Random Value Generation Based on New Rule Data)
(42) Synchronizing with clock CK2, in the rule data generation unit RLD_GEN, the rule data storage device 12 copies the rule data, which is generated by the rule data generation circuit 10, to the flip-flop synchronously with the clock A4_out outputted by the AND gate A4 at CNT_RLD=1, and outputs the new rule data d.sub.1 to d.sub.n (0x1). Then in the pseudo-random number generation unit P_RDM_GEN, the logic circuit, of which configuration was changed based on the new rule data d.sub.1 to d.sub.n (0x1), outputs the next random number value h.sub.1 to h.sub.n (0xB) based on the current random number value q.sub.1 to q.sub.n, (0xE). Further, synchronizing with the inverted clock/CK2 of the clock CK2, the flip-flop FFb of the cycle detection unit CYC_DET latches “1” of the rule data control signal CNT_RLD, and sets the seed control signal CNT_SD to “1”.
(43) Clock CK3 (update of seed based on next random number value h.sub.1 to h.sub.n generated by logic circuit configured with new rule data at CK2)
(44) Synchronizing with clock CK3, the pseudo-random number generation unit outputs the next random number value h.sub.1 to h.sub.n (0xB), which the logic circuit configured with the new rule data at clock CK2, as the current random number value q.sub.1 to q.sub.n (0xB). In the cycle detection unit CYC_DET, on the other hand, the AND gate A2 outputs the clock CK as a seed latch clock A2_out at the timing when the seed control signal CNT_SD becomes “1”, and the initial seed storage device SEED_MEM stores the current random number value q.sub.1 to q.sub.n (0xB) as a new seed s.sub.1 to s.sub.n synchronously with the seed latch clock A2_out. In other word, the new seed s.sub.1 to s.sub.n that is stored is the next random number value h.sub.1, to h.sub.n which the logic circuit generated at clock CK2.
(45) Clock CK4 and Later (Random Number Generation Based on New Rule Data and Seed)
(46) At each clock CK1 to CK3, the end of the cycle is sequentially detected, the rule data is switched and the seed is updated. Then at clock CK4 and later, the pseudo-random number generation circuit continues to generate random numbers based on the new rule data and seed.
(47) According to Embodiment 1 described above, when the end of the cycle of the random numbers is detected by matching between the next random number value and the initial seed at clock CK1, the rule data is updated to a new rule data at the next clock CK2, and the next random number value which the logical circuit, configured with the new rule data at CK2, generated the first time, is stored as a new seed at the next clock CK3.
(48) Therefore (1) a repeat of a cycle of the same random number is prevented, (2) random number values that are not generated by the pseudo-random number generation unit are not stored as seeds, since the next random number value generated by the logic circuit based on the updated rule data is stored as a seed. This prevents storing a random value not generated within the cycle of random numbers (as in the case of
EMBODIMENT 2
(49)
(50) In the case of the pseudo-random number generation unit P_RDM_GEN of
(51)
(52) The convergence checking unit CNV_CH is a matching circuit, just like the cycle checking unit CYC_CH, and checks the match between the next random number value h.sub.1 to h.sub.n, and the current random number value q.sub.J to q.sub.t, and sets a convergence trigger signal TRG_CNV to “1” when match is detected. Matching of the next random number value h.sub.1 to h.sub.n, and the current random number value q.sub.1 to q.sub.n means that the random values outputted by the pseudo-random number generation unit became the same continuously. This means that the random number values converged.
(53) The all zero checking unit ALZ_CH is constituted of an NOR circuit, and sets an all zero trigger signal TRG_Z to “1” when all the bits of the next random number value h.sub.1 to h.sub.n become “0”.
(54) In the cycle detection circuit CYC_DET in
(55) The rule data generation unit RLD_GEN according to Embodiment 2 is as described above with reference to
(56)
(57) When the system clock CK is started after initialization (S13), the rule data generation unit outputs the rule data, then this rule data is set in the pseudo-random number generation unit, and the pseudo-random number generation unit starts generation of random numbers (S14). Thereafter the pseudo-random number generation circuit device performs the following operation until the enable signal becomes OFF (EN=0) (YES in S15).
(58) The cycle checking unit CYC_CH checks the random number value (S16). The cycle checking unit CYC_CH of the cycle detection unit CYC_DET checks matching between the next random number value h.sub.1 to h.sub.n and the initial seed s.sub.1 to s.sub.n in each clock cycle (S17). Thereby the cycle checking unit detects the end of the cycle of random numbers. The cycle checking unit checks the end of the cycle in each clock cycle since the random number generation cycle changes if the rule data to be set changes.
(59) Further, the convergence checking unit CNV_CH of the cycle detection unit checks matching between the next random number value h.sub.1 to h.sub.n and the current random number value q.sub.1 to qa in each clock cycle (S18). In the case where the random number values converge to an arbitrary value, as indicated in
(60) Furthermore, the all zero checking unit ALZ_CH of the cycle detection unit checks whether or not all the bits of the next random number value h.sub.1 to h.sub.n are zero for each clock cycle (S19). In the case where the random number values all become zero, as indicated in
(61) In a case of not corresponding to any of the detection of the end of the cycle of the random numbers (S17), the detection of convergence (S18) and the detection of all zero (S19), the pseudo-random number generation unit continues generating the random numbers.
(62) Clock CK1
(63) When any one of the end of cycle, convergence and all zero is generated at clock CK1, the cycle detection unit sets both the rule data control signal CNT_RLD and the inversion signal INV to ON (“1”) (S20) at a half clock later. When the inversion signal INV is set to ON, the pseudo-random number generation unit inverts a part of the bits of the next random number value h.sub.1 to h.sub.n, or forcibly sets a part of the bits thereof to “1” in this clock cycle (S21).
(64) Clock CK2
(65) The rule data control signal CNT_RLD is set to ON, the rule data generation unit changes the rule data d.sub.1 to d.sub.n, and sets the updated rule data in the pseudo-random number generation unit in the next clock cycle CK2 (S22). Thereby in this clock cycle CK2, the logic circuit HB_R, of which configuration was changed based on the new rule data, generates the next random number value h.sub.1 to h.sub.n from the current random number value q.sub.1 to q.sub.n in the flip-flop, which holds the next random number value h.sub.1 to h.sub.n of which a part of the bits are inverted by the inversion signal.
(66) Clock CK3
(67) Furthermore, in the next clock cycle CK3, the cycle detection unit stores the next random number value h.sub.1 to h.sub.n, generated in the previous clock cycle CK2, as a new seed (S23).
(68)
(69)
(70)
(71) According to Embodiment 2, in the case where the random number values generated by the pseudo-random number generation unit converge, the rule data d.sub.1 to d.sub.n is updated, and the seed s.sub.1 to s.sub.n is updated to a random number value generated by the logic circuit that is configured with the updated rule data. Thereby prediction of the pseudo-random numbers in future is prevented. A first random value generated by the logic circuit configured with the updated rule data is used as a new seed, then a random number value the same as the seed is generated when the cycle of the random numbers ends, hence the end of the cycle of the random numbers becomes detectable with certainty. Further, generation of the random numbers continues seamlessly without stopping the operation of the pseudo-random number generation unit.
(72) According to Embodiment 2, in the case where all the bits of a random number value generated by the pseudo-random number generation unit become “0”, the rule data is updated, and a part of the bits of the next random number value is inverted or forcibly set to “1” and is latched as the current random number value. Thereby the logic circuit configured with the updated rule data generates the next random number value based on the current random value of which bits are not all zero, and as a consequence, generation of random number values of which bits are all zero is prevented.
EMBODIMENT 3
(73) In Embodiment 3, the configuration of the rule data generation unit RLD_GEN is partially changed so that the oscillation frequency of a ring oscillator R_OSC is changed when the rule data control signal CNT_RLD becomes “1”. The configuration of the pseudo-random number generation unit and that of the cycle detection unit are the same as Embodiment 1 or Embodiment 2.
(74)
(75) As illustrated in the lower portion of
(76)
(77) In this timing chart, the cycle checking unit CYC_CH of the cycle detection unit detects the end of the cycle of the random numbers, and sets the cycle end trigger signal TRG_C to “1” at clock CK1, then at /CK1, that is half a clock later, the rule data control signal CNT_RLD becomes “1”. Then in the rule data generation unit RLD_GEN, the selection signal SEL changes from “0” to “1” synchronously with the clock A4_out outputted by the AND gate A4 at clock CK2, so that the ring oscillator of the rule data generation circuit 10 is switched to a higher frequency. The rest of the operation is the same as that described with reference to
(78) According to Embodiment 3, the configuration of the ring oscillator of the rule data generation unit is changed when any one of the end of the cycle of the random numbers, convergence of the random number values and the random number values becoming all zeros is detected, and the configuration of the ring oscillator of the rule data generation unit is changed. Therefore the randomness of the rule data is increased, and the randomness of the configuration of the logic circuit, which is configured based on the rule data, also increases. As a result, random numbers to be generated become more unpredictable.
(79) As described above, according to the above embodiments, the random numbers generated by the pseudo-random number generation circuit device become less predictable.
(80) According to the first aspect, random numbers generated by the pseudo-random number generation circuit device become less predictable.
(81) All examples and conditional language provided herein are intended for the pedagogical purposes of aiding the reader in understanding the invention and the concepts contributed by the inventor to further the art, and are not to be construed as limitations to such specifically recited examples and conditions, nor does the organization of such examples in the specification relate to a showing of the superiority and inferiority of the invention. Although one or more embodiments of the present invention have been described in detail, it should be understood that the various changes, substitutions, and alterations could be made hereto without departing from the spirit and scope of the invention.