JPH07182145A - Generating device for initial value of random number - Google Patents

Generating device for initial value of random number

Info

Publication number
JPH07182145A
JPH07182145A JP5324814A JP32481493A JPH07182145A JP H07182145 A JPH07182145 A JP H07182145A JP 5324814 A JP5324814 A JP 5324814A JP 32481493 A JP32481493 A JP 32481493A JP H07182145 A JPH07182145 A JP H07182145A
Authority
JP
Japan
Prior art keywords
initial value
random number
storage means
data
stored
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.)
Pending
Application number
JP5324814A
Other languages
Japanese (ja)
Inventor
Yoshiaki Irino
祥明 入野
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.)
Ricoh Co Ltd
Original Assignee
Ricoh Co 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 Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP5324814A priority Critical patent/JPH07182145A/en
Publication of JPH07182145A publication Critical patent/JPH07182145A/en
Pending legal-status Critical Current

Links

Landscapes

  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

PURPOSE:To generate the initial value of different random numbers every time a computer system is restarted by processing the data value stored in a storage means kept in an uninitialized state into the initial value and storing temporarily this initial value. CONSTITUTION:An initial value arithmetic control means 2 controls an initial value arithmetic means 4 so that it can start when a computer and an operating system are started. The means 4 divides the data which are stored in an entire part or a part of a storage means 3 into the basic units. When the initial value is calculated out of those data stored in the storage means 3, such a method is applied that the result of calculation can be satisfactorily scattered. The calculation result of the initial value obtained by the means 4 is stored in a temporary storage means 5. The initial value of a random number is calculated in such a way so that the random numbers of different time series are generated at each time without using any special hardware. Thus the uniformity of random numbers is improved.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、乱数の初期値生成装置
に関し、特に組み込み型の機器制御用小型コンピュータ
システム等において、乱数を発生させるときの初期値を
生成する装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a random number initial value generator, and more particularly to a device for generating an initial value when a random number is generated in a built-in small computer system for controlling equipment.

【0002】[0002]

【従来の技術】従来、乱数を発生する方法としては、物
理的乱数源や算術乱数等を用いる方法がある。物理的乱
数源は電子管などの雑音や放射性物質からの雑音として
検出できる物理現象、例えば放射性同位元素のガンマ崩
壊を利用する場合である。一方、算術乱数は、ある初期
値(X0,X1,X2, ... Xm)に演算操作 f Xn+1 = f(Xn-m, Xn-m+1, ... , Xn-1, Xn) を施すことによって次々と擬似乱数を作り出す方法であ
る。この演算操作 fは簡単な四則演算やあふれた桁を捨
てる程度のものである。本発明は、この演算操作に基づ
いた乱数作成に関するものである。
2. Description of the Related Art Conventionally, as a method for generating a random number, there is a method using a physical random number source or an arithmetic random number. The physical random number source is a case where a physical phenomenon that can be detected as noise from an electron tube or noise from a radioactive substance, for example, gamma decay of a radioisotope is used. On the other hand, the arithmetic random number is calculated as f Xn + 1 = f (Xn-m, Xn-m + 1, ..., Xn-1, Xn) to a certain initial value (X0, X1, X2, ... Xm). ) Is used to generate pseudo-random numbers one after another. This arithmetic operation f is a simple arithmetic operation and discards overflow digits. The present invention relates to random number generation based on this arithmetic operation.

【0003】このような算術演算による乱数は、演算操
作が同じである限り周期性を持った乱数列が発生されて
しまう。初期値を変えたとしても演算操作が同一なら
ば、乱数列の開始がずれるだけでまったく同じ順序の乱
数列が繰り返えされることになるだけである。しかしな
がら、この周期が十分長ければ十分に実用になる乱数列
であるといえる。従って、このように乱数発生を開始さ
せる場合、周期性を持った乱数列の中の異なる時点から
乱数の発生を始めたい時には、初期値をその都度異なる
ものとして設定しなければならい。このような方法に
は、乱数発生時点での時刻を初期値として使用したり、
あるいは前回最後に発生させた乱数の値を書き換え可能
な不揮発性メモリへ格納しておき、それを次回の初期値
設定時に使用するという方法が利用されている。
As for the random numbers by such arithmetic operation, a random number sequence having periodicity is generated as long as the operation operation is the same. Even if the initial value is changed, if the arithmetic operations are the same, the start of the random number sequence will be shifted and the random number sequence in exactly the same order will be repeated. However, if this cycle is sufficiently long, it can be said that the random number sequence is sufficiently practical. Therefore, when the random number generation is started in this way, when it is desired to start the random number generation at different points in the random number sequence having periodicity, the initial value must be set to be different each time. For such a method, use the time at the time of random number generation as an initial value,
Alternatively, a method is used in which the last-generated random number value is stored in a rewritable non-volatile memory and is used when the initial value is set next time.

【0004】一方、書き換え可能な不揮発性メモリや時
刻発生装置というような特別なハードウェアを持たない
コンピュータシステム、例えば小型の機器組み込み用の
コンピュータシステムにおいては、乱数発生用の初期値
として、常に同じ値を使用せざるをえず、時系列的には
常に一定の順番の乱数列が生成されてしまうという欠点
があった。
On the other hand, in a computer system that does not have special hardware such as a rewritable non-volatile memory or a time generator, for example, a computer system in which a small device is incorporated, the same initial value for random number generation is always used. There is a drawback that the values must be used and a random number sequence in a fixed order is always generated in time series.

【0005】[0005]

【発明が解決しようとする課題】本発明は、上述のよう
な問題点を解決し、組み込み型の機器制御用小型コンピ
ュータシステムにおいて、特別なハードウェアを使用す
ることなしに、乱数発生用の初期値を作成し、かつ計算
機システムを再起動するたびに、毎回異なる初期値を生
成する装置を提案することを目的とする。
SUMMARY OF THE INVENTION The present invention solves the problems described above, and in an embedded type small computer system for device control, an initial stage for random number generation without using special hardware. It is an object of the present invention to propose an apparatus that creates a different value and creates a different initial value each time the computer system is restarted.

【0006】[0006]

【課題を解決するための手段】かかる課題を解決するた
めに請求項1の発明の乱数の初期値生成装置は、少なく
とも記憶装置と中央演算装置とを有するコンピュータで
動作する乱数発生装置において、コンピュータを立ちあ
げた時に未初期化状態を有する記憶手段と、その記憶手
段内の未初期化状態のデータ値から乱数の初期値を計算
する初期値演算手段と、初期値演算手段で得られた初期
値を一時的に保存しておくための一時記憶手段と、コン
ピュータが立ちあげられた時に初期値演算手段を起動さ
せるように制御するための初期値演算制御手段とを有す
ることを特徴としている。
In order to solve the above problems, a random number initial value generating device according to a first aspect of the present invention is a random number generating device that operates in a computer having at least a storage device and a central processing unit. Storage means having an uninitialized state at the time of starting up, an initial value calculation means for calculating an initial value of a random number from the data value of the uninitialized state in the storage means, and an initial value obtained by the initial value calculation means. It is characterized by having a temporary storage means for temporarily storing a value and an initial value calculation control means for controlling the initial value calculation means to be activated when the computer is started up.

【0007】[0007]

【作用】本発明の乱数の初期値生成装置は、コンピュー
タを立ちあげた時に初期値演算制御手段が初期値演算手
段を起動させ、そこで未初期化状態となっている記憶手
段内のデータ値を初期値用に加工し、その値を一時記憶
手段へ一時的に保存しておく。以後、必要に応じてその
値を乱数発生の初期値として用いる。従って、特別なハ
ードウェアを使用しなくても毎回異なる時系列の乱数を
生成でき、乱数の一様性を向上させることが可能とな
る。又、特別なハードウェアを一切必要としないため、
小型の組み込み型コンピュータを応用した機器におい
て、乱数を使用するのに適している。
In the random number initial value generating device of the present invention, the initial value operation control means activates the initial value operation means when the computer is started up, and the data values in the storage means which are in the uninitialized state are stored in the initial value operation control means. The value is processed for the initial value, and the value is temporarily stored in the temporary storage means. After that, the value is used as an initial value for random number generation as needed. Therefore, different time series random numbers can be generated each time without using special hardware, and the uniformity of the random numbers can be improved. Also, because no special hardware is required,
It is suitable for using random numbers in equipment that applies a small embedded computer.

【0008】[0008]

【実施例】以下図面を参照して本発明を詳細に説明す
る。図1は本発明の乱数の初期値生成装置の1実施例を
示すブロック図である。乱数の初期値生成装置1は、オ
ペレーティングシステムの一部を構成し、乱数の初期値
計算のトリガーを引く初期値演算制御手段2と、コンピ
ュータを立ちあげた時に未初期化状態となっている記憶
手段3と、その未初期化状態の記憶手段3の内容を初期
値計算のための演算をする初期値演算手段4と、計算さ
れた初期値を一時的に保存しておく一時記憶手段5(例
えば、レジスタ)とから構成されている。
DESCRIPTION OF THE PREFERRED EMBODIMENTS The present invention will be described in detail below with reference to the drawings. FIG. 1 is a block diagram showing an embodiment of a random number initial value generation device of the present invention. The random number initial value generation device 1 constitutes a part of the operating system, and has an initial value calculation control means 2 for triggering the calculation of the initial value of the random number, and a memory which is in an uninitialized state when the computer is started up. Means 3, an initial value calculation means 4 for calculating the contents of the storage means 3 in the uninitialized state for calculating an initial value, and a temporary storage means 5 for temporarily storing the calculated initial value ( Register).

【0009】ここで一般に、電源投入直後の記憶装置中
のデータは、0または1のいずれかになるが、記憶装置
中のすべてのデータが0または1のどちらかに揃うわけ
ではなく、通常は0と1とが不規則なパターンを示す状
態になっている。従って、中央処理装置で計算処理を開
始する前に特定の状態(例えばすべて0)へ初期化する
ことが必要となってくる。この初期化作業は、例えばコ
ンピュータのオペレーティングシステムが動き始めた直
後に、オペレーティングシステム自身が記憶装置に全て
0のデータを書き込む等の方法によって実行されてい
る。初期値演算制御手段2は、コンピュータが立ち上が
る時にオペレーティングシステムの開始時点で、初期値
演算手段4を起動できるように制御する。
Generally, the data in the storage device immediately after the power is turned on is either 0 or 1, but not all the data in the storage device is either 0 or 1, and normally it is not. 0 and 1 are in a state of showing an irregular pattern. Therefore, it becomes necessary to initialize to a specific state (for example, all 0s) before starting calculation processing in the central processing unit. This initialization work is executed, for example, by a method in which the operating system itself writes data of all 0s to the storage device immediately after the operating system of the computer starts to operate. The initial value calculation control means 2 controls so that the initial value calculation means 4 can be activated at the start of the operating system when the computer starts up.

【0010】初期値演算手段4は、次のようにして乱数
の初期値を求める。まず、記憶手段3全体あるいは記憶
手段3の一部分に格納されているデータをある基本単位
に分割する。この基本単位の大きさは、1バイトのよう
に記憶装置のアクセス単位や複数バイトであっても良い
し、10ビットというようなアクセス単位ではない任意
の長さであっても良い。又、分割の仕方もこの基本単位
の長さで記憶手段3を区切っても良いし、ある間隔をお
いて区切ってもよい(図2参照)。そのように分割され
た記憶手段3の中から初期値を計算する方法としては、 ・基本単位ごとの値を合計する、 ・基本単位ごとの値の排他的論理和を計算する 等 が考えられる。例えば、次のような種々の方法が考えら
れる。 ・記憶装置中のデータ全てを1バイトごとに加算し、合
計値の下位4バイトを初期値として使用する。 ・記憶装置中のデータ全てを2バイトごとに排他的論理
和を計算し、最終結果の2バイトの値を初期値として使
用する。 ・記憶装置中のデータを3ビットおきに3ビット単位で
加算し、合計値の下位8ビットを初期値として使用す
る。 初期値の計算方法は、ここで述べたような方法に限った
ものではなく、要は、計算結果の分散(数値の取り得る
範囲)が充分に大きくなるような方法であればよい。更
に、この実施例では記憶手段3を分割して初期値の計算
をしたが、分割はせずに任意のアドレスから必要な長さ
のデータを取り出して、それを初期値としても良い。
The initial value calculating means 4 determines the initial value of the random number as follows. First, the data stored in the entire storage means 3 or a part of the storage means 3 is divided into certain basic units. The size of the basic unit may be an access unit of the storage device or a plurality of bytes such as 1 byte, or may be an arbitrary length such as 10 bits which is not an access unit. As for the way of division, the storage means 3 may be divided by the length of this basic unit, or may be divided at a certain interval (see FIG. 2). Possible methods for calculating the initial value from the storage means 3 thus divided are: -summing the values for each basic unit; -calculating the exclusive OR of the values for each basic unit. For example, the following various methods are possible. -Add all the data in the storage device byte by byte and use the lower 4 bytes of the total value as the initial value. -The exclusive OR of all the data in the storage device is calculated every 2 bytes, and the value of 2 bytes of the final result is used as the initial value. The data in the storage device is added every 3 bits in 3-bit units, and the lower 8 bits of the total value are used as the initial value. The method of calculating the initial value is not limited to the method described here, and any method may be used as long as the dispersion of calculation results (the range of numerical values) is sufficiently large. Further, in this embodiment, the storage means 3 is divided and the initial value is calculated, but data having a required length may be taken out from an arbitrary address and used as the initial value without being divided.

【0011】初期値演算手段4によって得られた初期値
は、その計算結果を一時記憶手段5へ記憶しておく。こ
の一時記憶手段5は、初期化しない領域、例えば、中央
処理装置内部のレジスタ等を用いることができる。初期
値演算制御手段2は、このようにして得た初期値をレジ
スタに一時的に退避させたあと、記憶装置中のデータの
初期化を行なうように制御する。その後、必要に応じて
レジスタに退避しておいた初期値を使って乱数列を生成
させる。
The calculation result of the initial value obtained by the initial value calculation means 4 is stored in the temporary storage means 5. The temporary storage means 5 can use an area that is not initialized, for example, a register inside the central processing unit. The initial value calculation control means 2 controls so that the initial value thus obtained is temporarily saved in the register and then the data in the storage device is initialized. After that, a random number sequence is generated using the initial value saved in the register as needed.

【0012】このようにして、記憶装置中のデータの初
期化および乱数の初期値の設定が終了し、中央処理装置
が計算処理を実行し始めると、記憶装置中には、中央処
理装置での計算の途中結果や状態の保存データ、各種の
計数結果など、常に更新され続けていくデータが格納さ
れている。従って、一旦中央処理装置が計算処理の実行
を始めると、記憶装置中のデータは常に変化しているこ
とになるので、計算処理を途中で中断して乱数数式の初
期値の計算から再実行した場合でも、前回と同一の初期
値を使用する可能性は低い。
In this way, when the initialization of the data in the storage device and the setting of the initial value of the random number are completed, and the central processing unit starts executing the calculation processing, the central processing unit in the storage device stores Data that is constantly updated is stored, such as intermediate calculation results, saved data of states, and various counting results. Therefore, once the central processing unit starts execution of the calculation process, the data in the storage device is always changing, so the calculation process was interrupted and re-executed from the calculation of the initial value of the random number formula. Even in this case, it is unlikely to use the same initial value as last time.

【0013】又、複数の乱数系列にそれぞれ異なる初期
値を必要とする場合には、記憶手段3を複数の部分に分
割し、各部分毎に計算して複数の初期値を得る方法や、
ひとつの初期値から乱数列を生成し、そのうちの所定個
数を取り出して、それぞれの乱数系列の初期値とする方
法等が考えられる。
When a plurality of random number sequences require different initial values, the storage means 3 is divided into a plurality of parts and each part is calculated to obtain a plurality of initial values.
A method is conceivable in which a random number sequence is generated from one initial value, a predetermined number of them are taken out, and used as the initial value of each random number sequence.

【0014】以上本実施例に説明したように、電源投入
直後や計算処理中断後の再実行時等の未初期化状態にお
いて、データ記憶装置中のデータが未初期化状態のデー
タのみから乱数の初期値を作成するので、特別なハード
ウェアを使用しなくても毎回異なる時系列の乱数を生成
でき、乱数の一様性を向上させることが可能となる。
又、特別なハードウェアを一切必要としないため、小型
の組み込み型コンピュータを応用した機器において、乱
数を使用するのに適している。
As described above in the present embodiment, in the uninitialized state immediately after power-on or at the time of re-execution after the interruption of the calculation process, the data in the data storage device is randomized only from the uninitialized data. Since the initial value is created, different time series random numbers can be generated each time without using special hardware, and the uniformity of the random numbers can be improved.
Further, since it requires no special hardware at all, it is suitable for using a random number in a device to which a small embedded computer is applied.

【0015】[0015]

【発明の効果】以上説明したように、請求項1の発明
は、電源投入直後や計算処理中断後の再実行時などの未
初期化状態において、データ記憶装置中のデータが不規
則であることを利用し、その不規則なデータから乱数の
初期値を作成するので、特別なハードウェアを使用しな
くても毎回異なる時系列の乱数を生成でき、乱数の一様
性を向上させることが可能となる。又、特別なハードウ
ェアを一切必要としないため、小型の組み込み型コンピ
ュータを応用した機器において、乱数を使用するのに適
している。
As described above, according to the first aspect of the present invention, the data in the data storage device is irregular in the uninitialized state immediately after the power is turned on or at the time of re-execution after the interruption of the calculation process. Since the random number initial value is created from the irregular data by using, it is possible to generate different time series random numbers each time without using special hardware, and it is possible to improve the uniformity of random numbers. Becomes Further, since it requires no special hardware at all, it is suitable for using a random number in a device to which a small embedded computer is applied.

【図面の簡単な説明】[Brief description of drawings]

【図1】 本発明になる乱数の初期値形成装置の1実施
例のブロック図である。
FIG. 1 is a block diagram of an embodiment of a random number initial value forming device according to the present invention.

【図2】 本発明の記憶手段の分割の仕方を説明するた
めの図である。
FIG. 2 is a diagram for explaining how to divide the storage means of the present invention.

【符号の説明】[Explanation of symbols]

1 …… 乱数の初期値形成装置 2 …… 初期値演算制御手段 3 …… 記憶手段 4 …… 初期値演算手段 5 …… 一時記憶手段。 1 ... initial value generator for random number 2 ... initial value calculation control means 3 ... storage means 4 ... initial value calculation means 5 ... temporary storage means.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 少なくとも記憶装置と中央演算装置とを
有するコンピュータで動作する乱数発生装置において、
コンピュータを立ちあげた時に未初期化状態を有する記
憶手段と、前記記憶手段内の未初期化状態のデータ値か
ら乱数の初期値を計算する初期値演算手段と、前記初期
値演算手段で得られた初期値を一時的に保存しておくた
めの一時記憶手段と、コンピュータが立ちあげられた時
に前記初期値演算手段を起動させるように制御するため
の初期値演算制御手段とを備えたことを特徴とする乱数
の初期値生成装置。
1. A random number generator operating on a computer having at least a storage device and a central processing unit,
Storage means having an uninitialized state when the computer is started up, initial value calculation means for calculating an initial value of a random number from the data value of the uninitialized state in the storage means, and the initial value calculation means And a temporary storage means for temporarily storing the initial value, and an initial value calculation control means for controlling the initial value calculation means to start when the computer is started up. Characteristic random number initial value generation device.
JP5324814A 1993-12-22 1993-12-22 Generating device for initial value of random number Pending JPH07182145A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5324814A JPH07182145A (en) 1993-12-22 1993-12-22 Generating device for initial value of random number

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5324814A JPH07182145A (en) 1993-12-22 1993-12-22 Generating device for initial value of random number

Publications (1)

Publication Number Publication Date
JPH07182145A true JPH07182145A (en) 1995-07-21

Family

ID=18169977

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5324814A Pending JPH07182145A (en) 1993-12-22 1993-12-22 Generating device for initial value of random number

Country Status (1)

Country Link
JP (1) JPH07182145A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2003096181A1 (en) * 2002-05-09 2003-11-20 Niigata Seimitsu Co., Ltd. Random number initial value generation device and method, random number initial value generation program
WO2005124537A1 (en) * 2004-06-18 2005-12-29 Fujitsu Limited Random number generation device, generation method, generator evaluation method, and random number use method
KR100659610B1 (en) * 2004-09-27 2006-12-21 삼성전자주식회사 Method for Making Seed Value Used in Pseudo Random Number Generator and Device Therof
JP2009025695A (en) * 2007-07-23 2009-02-05 Osamu Kameda Method and device for generating pseudo random number, method and device for encryption using pseudo random number

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2003096181A1 (en) * 2002-05-09 2003-11-20 Niigata Seimitsu Co., Ltd. Random number initial value generation device and method, random number initial value generation program
WO2005124537A1 (en) * 2004-06-18 2005-12-29 Fujitsu Limited Random number generation device, generation method, generator evaluation method, and random number use method
KR100659610B1 (en) * 2004-09-27 2006-12-21 삼성전자주식회사 Method for Making Seed Value Used in Pseudo Random Number Generator and Device Therof
JP2009025695A (en) * 2007-07-23 2009-02-05 Osamu Kameda Method and device for generating pseudo random number, method and device for encryption using pseudo random number

Similar Documents

Publication Publication Date Title
US4720812A (en) High speed program store with bootstrap
US4365311A (en) Control of instruction pipeline in data processing system
US3331056A (en) Variable width addressing arrangement
KR950012256A (en) Computer system for processing vector data and method thereof
US3302183A (en) Micro-program digital computer
JPH053032B2 (en)
EP0377976B1 (en) Microcode control apparatus utilizing programmable logic array circuits
JPH07182145A (en) Generating device for initial value of random number
JP6246239B2 (en) Method and device for prime number generation
EP1050819A1 (en) Computer memory access
JP3032340B2 (en) Address generator for processor data memory
JP2003263309A (en) Random number generating apparatus and method
US20030097618A1 (en) Microcontroller capable of correcting program codes and method for driving the same
JPH05197626A (en) Register-index-table logic device for virtual memory system
US20040172497A1 (en) Address decoding method and related apparatus by comparing mutually exclusive bit-patterns of addresses
EP0888586A1 (en) Array indexing
US3513446A (en) Data processing system wherein the instruction word contains plural data word addresses
JP2015097072A (en) Embedded system
SU443388A1 (en) Control device
JP2002278774A (en) Method and device for generating instruction word in controlling function unit in processor
US20220318131A1 (en) Device and method for ascertaining address values
JPH06231038A (en) Memory address space extending device
JPS6148174B2 (en)
US7054894B2 (en) Generator circuit for generating large numbers
JP2985965B2 (en) Factorization device