JPS5840769B2 - random number generator - Google Patents

random number generator

Info

Publication number
JPS5840769B2
JPS5840769B2 JP52159480A JP15948077A JPS5840769B2 JP S5840769 B2 JPS5840769 B2 JP S5840769B2 JP 52159480 A JP52159480 A JP 52159480A JP 15948077 A JP15948077 A JP 15948077A JP S5840769 B2 JPS5840769 B2 JP S5840769B2
Authority
JP
Japan
Prior art keywords
random number
circuit
contents
time information
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired
Application number
JP52159480A
Other languages
Japanese (ja)
Other versions
JPS5492144A (en
Inventor
真 山下
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP52159480A priority Critical patent/JPS5840769B2/en
Publication of JPS5492144A publication Critical patent/JPS5492144A/en
Publication of JPS5840769B2 publication Critical patent/JPS5840769B2/en
Expired legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/58Random or pseudo-random number generators
    • G06F7/582Pseudo-random number generators
    • G06F7/586Pseudo-random number generators using an integer algorithm, e.g. using linear congruential method
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/58Random or pseudo-random number generators
    • G06F7/582Pseudo-random number generators

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • General Engineering & Computer Science (AREA)

Description

【発明の詳細な説明】 本発明は乱数発生装置、特に乱数を発生させるためのデ
ータを保持していて、乱数が必要な時に該データに基き
所定の演算を行ない乱数を発生させ、該演算結果のデー
タを次の乱数発生のためのデータとして保持しておくよ
うな乱数発生装置に関するものである。
DETAILED DESCRIPTION OF THE INVENTION The present invention relates to a random number generator, which stores data for generating random numbers, performs a predetermined operation based on the data when a random number is required, generates a random number, and calculates the result of the operation. The present invention relates to a random number generator that holds data for the next random number generation.

以下に、本発明の最適実施例である、保持したデータを
2乗して、その結果の中央を再びデータとして保持して
おくような乱数発生装置について本発明を説明するが、
本発明がこのような2乗演算を施すものだけに限られず
、一般に所定演算を、保持したデータに対し行なうもの
にも適用可能なのは勿論である。
The present invention will be described below with respect to a random number generation device that squares held data and holds the center of the result as data again, which is an optimal embodiment of the present invention.
It goes without saying that the present invention is not limited to those that perform such squaring operations, but is also generally applicable to those that perform predetermined operations on held data.

近年の情報処理装置の発達に伴ない、種々の目的、保守
、性能試験などのために、乱数が必要とされている。
With the recent development of information processing devices, random numbers have become necessary for various purposes, maintenance, performance tests, and the like.

乱数を得るためには、水晶の発振や、円周率の計算など
を用いる方法もあるが、それらは構5或が困難であった
り、極めて多数の乱数を得るには計算が複雑となるとい
う欠点があった。
There are methods to obtain random numbers, such as using crystal oscillation or calculating pi, but these methods are difficult to construct, and the calculations are complicated to obtain an extremely large number of random numbers. There were drawbacks.

最も手軽に用いられる乱数は第1図のようにして得られ
る。
The most easily used random number is obtained as shown in FIG.

第1図は、従来の乱数発生を示す概念図である。FIG. 1 is a conceptual diagram showing conventional random number generation.

図において、1は乱数発生装置、2は乱数、3は乱数発
生装置1内に格納されている初期値X(乱数を作り出す
ためのデータ)、4はデータXから乱数を取出す回路で
ある。
In the figure, 1 is a random number generator, 2 is a random number, 3 is an initial value X (data for generating random numbers) stored in the random number generator 1, and 4 is a circuit for extracting a random number from the data X.

動作とじ駄、乱数を得る時には、データXに対して伺ら
かの演算(多くは2乗して、その中央を取り出す)を行
なってあらたなXとし、この数Xから乱数2を回路4を
用いて取り出し、かつ該数Xを次の乱数を得るための初
期値Xとするようにしている。
When obtaining a random number, a new X is obtained by performing some calculation on the data The number X is used as the initial value X for obtaining the next random number.

しかしながら、このような初期値を用いるものは、簡単
に乱数を得れるという利点は有するが、非常に多くの乱
数を用いた場合、下に示すごとく同じXが出現してし1
う。
However, using such initial values has the advantage of being able to easily obtain random numbers, but if a large number of random numbers are used, the same X will appear as shown below.
cormorant.

一度同じXが現れると、以後は全く同じ計算を繰り返し
てしまうので、それは最早乱数とは呼べない。
Once the same X appears, the exact same calculation will be repeated, so it can no longer be called a random number.

今、乱数を作り出すためのデータをXとし、それがnビ
ットで構成されているものとする゛。
Let us now assume that the data used to generate random numbers is X, and that it consists of n bits.

乱数をつくるためのデータXは、有限個の状態しかとり
えない。
Data X for generating random numbers can only take a finite number of states.

したがって十分回数を多く乱数発生をくり返せば、Xの
状態に同じものが現われる。
Therefore, if random number generation is repeated sufficiently many times, the same state of X will appear.

Xの状態を更新する演算が一定なので、以前に現われた
Xの状態が一度再現されると、それ以後Xの状態の列は
くり返しになる。
Since the operation for updating the state of X is constant, once a previously appearing state of X is reproduced once, the sequence of states of X repeats thereafter.

これからつくられる乱数の列もくり返しになる。The sequence of random numbers that will be created will also be repeated.

第2図は従来例を説明するための図である。FIG. 2 is a diagram for explaining a conventional example.

図において、連続して発生させた乱数の列をR1。In the figure, R1 represents a sequence of consecutively generated random numbers.

R2・・・・・・Rk、・・・・・・と表わし、乱数を
作るためのデータXの列をXl、X2.・・・・・・X
k、・・・・・・と表わし、Xk+lXkに演算gをほ
どこした結果であり、RkはXkに演算fをほどこした
結果である。
Represented as R2...Rk,..., the strings of data X for generating random numbers are Xl, X2... ......X
k, . . . is the result of applying operation g to Xk+lXk, and Rk is the result of applying operation f to Xk.

即ち、データXは有限個のビットの状態で表現されてい
る。
That is, data X is expressed in a finite number of bits.

そのビット数をnとすると、データXのとりうる状態は
2n個しかない。
If the number of bits is n, there are only 2n possible states of data X.

したがって連続して2n個より多い乱数を発生させたと
き、Xの状態の列 の中には同一のものが2つ以上前まれている。
Therefore, when more than 2n random numbers are successively generated, the same state occurs two or more times in the sequence of X states.

いま、たとえば の4個が同一とすると、 となり、Xの状態はX11.X、、+i・・・・・・X
12−1のくり返しになる。
Now, if the four items are the same, then the state of X is X11. X,,+i...X
The score was 12-1 all over again.

したがって乱数もR11゜R11+1・・・・・・R1
2−1のくり返しになる。
Therefore, the random number is also R11゜R11+1...R1
It becomes a repeat of 2-1.

よって、本願発明の目的は、多数の乱数を発生させても
、上記の如く繰り返しが生じない、かつ・それを簡単な
回路で実現し得る乱数発生装置を提供することである。
Therefore, an object of the present invention is to provide a random number generator that does not cause repetition as described above even when a large number of random numbers are generated, and that can be realized with a simple circuit.

この目的は乱数を作成するためのデータを格納する格納
部、該格納部に接続され、該格納部の内容に対して演算
を行なう演算回路部、該演算回路部の出力の一部又は全
部を上記格納部へ格納するような乱数発生装置において
、時刻情報が格納される時刻情報手段を少なくとも備え
、上記格納部の内容に対して演算を行ない、その結果を
再び該格納部へ格納する処理の一部に刻時列情報手段の
内容との演算処理を含ませたことによって達成される。
This purpose consists of a storage unit that stores data for creating random numbers, an arithmetic circuit unit that is connected to the storage unit and performs operations on the contents of the storage unit, and a part or all of the output of the arithmetic circuit unit. A random number generation device that stores in the storage section includes at least a time information means in which time information is stored, and performs a calculation on the contents of the storage section and stores the result in the storage section again. This is achieved by partially including arithmetic processing with the contents of the time series information means.

第3図は、本発明の実施例である。FIG. 3 is an embodiment of the present invention.

図において、5は一語長の乱数を得るためのデータを格
納する格納部である。
In the figure, 5 is a storage unit that stores data for obtaining random numbers of one word length.

データレジスタ、6はデータレジスタ5の内容を2乗す
る演算回路である2乗回路、7は2乗回路の出力のうち
の中央の一語長を抽出する抽出回路、8は時刻情報と抽
出回路の出力の排他的論理和演算を行なう排他的オア回
路、9は時刻情報の格納されている時刻情報手段である
時刻レジスタ、1(Hz2乗回路6の出力を保持する
出力レジスタ、11は乱数を作る基となるデータXから
10進数を作り出し、その10の位を乱数Rとして出力
する変換回路1・2は演算回路部である。
A data register, 6 is a squaring circuit which is an arithmetic circuit that squares the contents of data register 5, 7 is an extraction circuit that extracts the central word length from the output of the squaring circuit, 8 is a time information and extraction circuit 9 is a time information means in which time information is stored; 9 is a time information means storing time information; 1 is an output register that holds the output of the Hz square circuit 6; 11 is a random number; Conversion circuits 1 and 2, which create a decimal number from the data X that is the basis of creation and output the 10's digit as a random number R, are arithmetic circuit units.

次に動作を説明する。Next, the operation will be explained.

乱数が必要なときには、レジスタ5の内容Xを2乗回路
6で2乗し、その結果は出力レジスタ10に格納される
When a random number is required, the content X of the register 5 is squared by a squaring circuit 6, and the result is stored in an output register 10.

そのうちの中央の一語長が抽出回路7により出力され、
その出力は時刻レジスタ9の内容と共に排他的オア回路
8に与えられる。
The central word length among them is outputted by the extraction circuit 7,
The output is given to exclusive OR circuit 8 together with the contents of time register 9.

排他的オア回路8の出力はデータレジスタ5に格納され
、このデータレジスタ5の内容は変換回路11により、
10進数に変換され、その10の位が10進数で表現さ
れた乱数として出力される。
The output of the exclusive OR circuit 8 is stored in the data register 5, and the contents of this data register 5 are converted by the conversion circuit 11.
It is converted into a decimal number, and the 10th place is output as a random number expressed in decimal number.

本願発明では、時刻情報を用いて、乱数を作り出すため
のデータを作るようにしているので、従来の如く該デー
タが繰り返されることによる乱数の繰り返しは無くなる
In the present invention, since time information is used to create data for generating random numbers, the repetition of random numbers due to repetition of the data as in the past is eliminated.

更に、上記時刻情報は、通常の情報処理システムには存
在しており、新たに設ける必要もない。
Furthermore, the above-mentioned time information exists in a normal information processing system, and there is no need to newly provide it.

例え、新たにこの時刻情報を得るためのハードウェアを
追加したとしても、時刻的には正確さは全く必要ないか
ら、クロックで歩進するカウンタを用いればよく、ごく
わずかのハードウェア付加で済む。
Even if you add new hardware to obtain this time information, there is no need for accuracy in terms of time, so you can just use a counter that advances with a clock, and only a small amount of hardware is needed. .

尚、本願発明の実施例は乱数を発生させるためデータを
レジスタに格納しておく例を用いて説明したが、格納部
として主記憶装置の格納〕場所の1つを用い、2乗回路
として通常の計算機の演算回路を用い、抽出回路として
論理的に(プログラムによる制御などで)行ない、時刻
情報も主記憶装置の1格納場所にあるものを用いたり、
外部に設置された時計等を用いてもよいのは勿論である
Although the embodiment of the present invention has been explained using an example in which data is stored in a register to generate random numbers, one of the storage locations in the main memory device is used as the storage section, and the square circuit is normally used as a squaring circuit. Using the arithmetic circuit of the computer, it is performed logically (by control by a program, etc.) as an extraction circuit, and the time information is also stored in one storage location of the main memory.
Of course, a clock or the like installed outside may also be used.

【図面の簡単な説明】 第1図は従来の乱数発生の概要を示す図、第2図は従来
の乱数発生の過程を示す図、第3図は本発明の実施例で
ある。 図において、5は格納部であるレジスタ、6は2乗回路
、7は抽出回路、8は排他的オア回路、9は時刻情報を
格納する時刻レジスタ、 演算回、路部である。 12は
BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 shows an overview of conventional random number generation, FIG. 2 shows a process of conventional random number generation, and FIG. 3 shows an embodiment of the present invention. In the figure, 5 is a register which is a storage section, 6 is a square circuit, 7 is an extraction circuit, 8 is an exclusive OR circuit, 9 is a time register for storing time information, an arithmetic circuit, and a circuit section. 12 is

Claims (1)

【特許請求の範囲】 1 乱数を作成するためのデータを格納する格納部、該
格納部に接続され、該格納部の内容に対して演算を行な
う演算回路部、該演算回路部の出力の一部又は全部を上
記格納部へ格納するような乱数発生装置において、時刻
情報が格能される時刻情報手段を少なくとも備え、上記
格納部の内容に対して演算を行ない、その結果を再び該
格納部へ格納する処理の一部に該時刻情報手段の内容と
の演算処理を含ませたことを特徴とする乱数発生装置0 2 上記格納部の内容に対し、上記時刻情報手段の内容
の排他的論理和演算を行なう排他的オア回路を設けたこ
とを特徴とする特許請求の範囲第1項記載の乱数発生装
置。 3 上記格納部に接続された演算回路部に、該格納部の
内容を2乗する2乗回路、該2乗回路の出力のうち中央
の所定長を抽出する抽出回路、該抽出回路の出力と時刻
情報手段の内容との排他的論理和演算を行なう排他的オ
ア回路とを備えたことを特徴とする特許請求の範囲第2
項記載の乱数発生装置。
[Scope of Claims] 1. A storage section that stores data for creating random numbers, an arithmetic circuit section that is connected to the storage section and performs an operation on the contents of the storage section, and one of the outputs of the arithmetic circuit section. A random number generating device that stores part or all of the data in the storage unit is provided with at least time information means for displaying time information, performs an operation on the contents of the storage unit, and stores the result again in the storage unit. Random number generator 0 characterized in that a part of the process of storing the time information means includes arithmetic processing with the contents of the time information means 2 Exclusive logic of the contents of the time information means with respect to the contents of the storage section 2. The random number generation device according to claim 1, further comprising an exclusive OR circuit for performing a sum operation. 3 The arithmetic circuit section connected to the storage section includes a squaring circuit that squares the contents of the storage section, an extraction circuit that extracts a predetermined central length of the output of the squaring circuit, and an output of the extraction circuit. Claim 2, characterized by comprising an exclusive OR circuit that performs an exclusive OR operation with the contents of the time information means.
Random number generator as described in section.
JP52159480A 1977-12-29 1977-12-29 random number generator Expired JPS5840769B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP52159480A JPS5840769B2 (en) 1977-12-29 1977-12-29 random number generator

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP52159480A JPS5840769B2 (en) 1977-12-29 1977-12-29 random number generator

Publications (2)

Publication Number Publication Date
JPS5492144A JPS5492144A (en) 1979-07-21
JPS5840769B2 true JPS5840769B2 (en) 1983-09-07

Family

ID=15694684

Family Applications (1)

Application Number Title Priority Date Filing Date
JP52159480A Expired JPS5840769B2 (en) 1977-12-29 1977-12-29 random number generator

Country Status (1)

Country Link
JP (1) JPS5840769B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS56162564A (en) * 1980-05-20 1981-12-14 Nec Corp Multivalued code generator
JPS58114134A (en) * 1981-12-28 1983-07-07 Hitachi Electronics Eng Co Ltd Random number generator
JPH0759974B2 (en) * 1991-03-27 1995-06-28 リンナイ株式会社 Water heater controller

Also Published As

Publication number Publication date
JPS5492144A (en) 1979-07-21

Similar Documents

Publication Publication Date Title
JPH0357500B2 (en)
US3855459A (en) Apparatus for converting data into the same units
JPS5840769B2 (en) random number generator
JPS6057593B2 (en) Character pattern processing method
JP3847836B2 (en) Character string search method and apparatus
JPH03240144A (en) Variable length data memory interface circuit
JP2806459B2 (en) A logic simulation device that can evaluate flip-flops
JP2835366B2 (en) Address information generator for fast Fourier transform
SU1405056A1 (en) Random number generator
JP2624738B2 (en) Rounding method
JPS5922587Y2 (en) random number generator
JPS6188334A (en) Divider circuit
SU590750A1 (en) Device for effecting rapid fourier transformation
SU1164724A1 (en) Device for implementing logic functions
SU926650A1 (en) Device for simultaneous computation of two polynomials
SU744564A1 (en) Dividing device
SU758163A1 (en) Device for spectral conversion
SU732934A1 (en) Data display on the screen of cathode ray tube
JPH05241795A (en) M-series random number generation system
JPS63251825A (en) Control system for real time timer
JPS6376062A (en) Digital differential analyzing device
JPS6039239A (en) Serial parallel converting circuit
JPS6175940A (en) Address generating system
JPS61275974A (en) Integrating device
JPH03139741A (en) History information storing system