JPS5953580B2 - Random number generation method - Google Patents
Random number generation methodInfo
- Publication number
- JPS5953580B2 JPS5953580B2 JP53076154A JP7615478A JPS5953580B2 JP S5953580 B2 JPS5953580 B2 JP S5953580B2 JP 53076154 A JP53076154 A JP 53076154A JP 7615478 A JP7615478 A JP 7615478A JP S5953580 B2 JPS5953580 B2 JP S5953580B2
- Authority
- JP
- Japan
- Prior art keywords
- circuit
- shift register
- arithmetic
- key
- random number
- 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
Links
Landscapes
- Calculators And Similar Devices (AREA)
Description
【発明の詳細な説明】
本発明は、例えば小型電子式計算機に於ける乱数発生方
式に関する。DETAILED DESCRIPTION OF THE INVENTION The present invention relates to a random number generation method in, for example, a small electronic calculator.
一般に、等確率性と無規則性を有する数列を乱数と称し
ているが、この様な乱数を発生させる方法として、演算
によるものと、カウンタを用いるものとがある。Generally, a sequence of numbers having equal probability and irregularity is called a random number, and methods for generating such random numbers include those using calculations and those using counters.
前者では、所定の初期値を例えば平方採中法、集算合同
法、及び混合型合同法等の方法により、順次演算して乱
数を得る様にし、また後者では、例えばカウンタを比較
的速いクロックにより常時計数駆動させ、必要に応じて
上記カウンタの内容を取り出し、これを乱数としている
。しかしながら、前者の方法では、初期値が同じであれ
ば同じ乱数が発生するため初期値の設定に困難があり、
また複雑な計算のため制御命令等が複雑となる欠点があ
つた。更に後者の方法では、カウンタの駆動のためのク
ロックを比較的速くすれば、容易に精度の高い乱数が得
られるが、反面乱数発生のための専用のカウンタが必要
となり、回路構成が複雑となるといつた欠点があつた。
一方、小型電子式計算機では、種々の演算処理が、演算
回路を介して行われるものであるが、特に非演算処理中
には、上記演算回路は使用されず、非効率的であつた。In the former, random numbers are obtained by sequentially calculating predetermined initial values using methods such as the square counting method, aggregation congruence method, and mixed congruence method, and in the latter method, for example, the counter is set to a relatively fast clock. The counter is constantly driven by a constant count, and the contents of the counter are taken out as necessary and used as random numbers. However, in the former method, it is difficult to set the initial value because the same random number will be generated if the initial value is the same.
Another disadvantage is that the control commands and the like are complicated due to the complicated calculations. Furthermore, in the latter method, highly accurate random numbers can be easily obtained by making the clock for driving the counter relatively fast, but on the other hand, a dedicated counter for random number generation is required, and the circuit configuration becomes complicated. I had a lot of flaws.
On the other hand, in small electronic calculators, various arithmetic processes are performed through arithmetic circuits, but the arithmetic circuits are not used particularly during non-arithmetic processing, which is inefficient.
本発明は上記の事情に鑑みて成されたもので、少なくと
も非演算中に使用されていない演算回路を有効に利用し
て乱数を発生させ、必要に応じてこれを取出せるように
した乱数発生方式を提供するものである。The present invention has been made in view of the above-mentioned circumstances, and is a random number generator that generates random numbers by effectively utilizing arithmetic circuits that are not used during at least non-arithmetic operations, and that makes it possible to retrieve the random numbers as needed. It provides a method.
以下図面を参照しながら本発明の一実施例を説明する。An embodiment of the present invention will be described below with reference to the drawings.
第1図はその構成を示したもので、図中1は乱数キー「
正に禧、置数キー、及び各種ファンクションキー等を備
えたキー入力部であり、上記各キーに対応したキー入力
信号をエンコーダ部2へ送出する。このエンコーダ部2
は上記キー入力部1からのキー入力信号をエンコードす
るもので、置数キーに対してはキー有り信号を制御部3
に、置数データをゲート回路群4のアンド回路41の一
端に送出し、また乱数キー丁ズ丁rlに・対してはキー
有り信号を上記制御部3に供給すると共にフリップフロ
ップ回路5のセット入力端子S及びオア回路6に供給し
、更に各ファンクションキーに対するファンクションデ
ータを上記制御部3に供給する。制御部3は上記エンコ
ーダ部2の出力信号に従つて置数命令、演算命令あるい
は後述するゲート回路群7、8、9への制御信号等を出
力し、上記置数、演算命令、及び乱数転送の動作が終了
した際に命令終了信号を出力すると共に、コード「1」
等のコード信号を出力するコード発生部1]の制御をも
行なう。そし上記置数命令、演算命令はオア回路6を介
しフリツプフロツプ回路12のりセツト入力端子Rに印
加され、命令終了信号はセツト入力端子Sに印加される
。このフリツプフロツプ回路12のセツト側出力端子Q
の出力信号は、ゲート回路群7のオア回路71の一端及
びゲート回路群8のオア回路81の一端に供給されると
共にゲート回路群9のアンド回路91及びインバータ9
2を介してアンド回路93の一端に夫々供給され、更に
フリツプフロツプ回路5のりセツト入力端子Rに供給さ
れる。このフリツプフロツプ回路5のセツト側出力端子
Qの出力信号はワンシヨツト回路13に供給される。こ
のワンシヨツト回路]3は、図示しないタイミング信号
発生部から1ワードタイム(本願では8デジツトタイム
)毎に出力されるクロツク信号φWに従つて上記フリツ
プフロツプ回路5がセツト状態になつた時1ワードタイ
ム間出力するもので、その出力信号はゲート回路群4の
アンド回路42及びソア回路43の一端に供給されると
共に、ゲート回路群7のアンド回路72、及びゲート回
路8のアンド回路82に供給される。なお、図示しない
タイミング信号発生部からD1〜D8のデジツ,卜信号
が1ワードタイム毎に順次出力されており、上記アンド
回路72はD1+D2のタイミングで、またアンド回路
82はD1+D2のタイミングで閉成されることになる
。そして上記アンド回路72の出力信号はオア回路71
を介してコード発、生部11からコード信号の供給され
ているアンド回路73に印加され、その開閉制御を行な
う。このアンド回路73出力信号は演算回路10の入力
端子aに供給される。一方]4は乱数の計数及び演算デ
ータの記憶等を行う8桁(8デジツト)構こ成のシフト
レジスタで、7桁(7デジツト)のレジスタ14aと1
桁(1デジツト)のレジスタ14bで構成され、レジス
タ14aの出力は、ゲート回路群8のアンド回路83に
供給され、その出力信号は演算回路10の入力端子bに
供給されて4入力端子aに供給されているデータとの演
算が行われる。そしてその演算結果はゲート回路群9の
アンド回路91.オア回路94を介してシフトレジスタ
14に書き込まれる。また演算が行われない時はこのシ
フトレジスタ14の内容はアンド回路93、オア回路9
4を介してリサキユレートしながら記憶保持される。一
方シフトレジスタ15には、上記演算回路10の演算結
果がゲート回路群4のアンド回路42、オア回路44を
介して書き込まれると共に、エンコーダ部2から出力さ
れる置数データが、上記制御部3から出力される置数命
令により開閉制御されるゲート回路群4のアンド回路4
1.及びオア回路44を介して書き込″まれる。このシ
フトレジスタ15は、上記シフトレジスタ14と同様に
7桁のレジスタ15a、1桁のレジスタ15bから構成
されている。そしてこのシフトレジスタに書き込まれた
内容はゲート回路群4のノア回路43の出力信号により
開閉制御されるアンド回路45、オア回路44を介して
リサキユレートし、その出力は表示部(図示せず)及び
ゲート回路群8を介して演算回路10に送出される。次
に上記の如く構成された本発明の動作について目卜T汗
村K.K蔓!司というキー操作を例にとつて説明する。Figure 1 shows its configuration. In the figure, 1 is the random number key "
It is truly a key input unit equipped with numeric keys, numeric keys, various function keys, etc., and sends key input signals corresponding to each of the keys to the encoder unit 2. This encoder section 2
is to encode the key input signal from the key input section 1, and for the numeric key, the key presence signal is encoded by the control section 3.
Then, the set number data is sent to one end of the AND circuit 41 of the gate circuit group 4, and a key presence signal is supplied to the control section 3 for the random number key digit rl, and the flip-flop circuit 5 is set. It is supplied to the input terminal S and the OR circuit 6, and further, the function data for each function key is supplied to the control section 3. The control section 3 outputs a numeric instruction, an arithmetic instruction, or a control signal to gate circuit groups 7, 8, and 9, which will be described later, according to the output signal of the encoder section 2, and transfers the numeric value, arithmetic instruction, and random number. When the operation of
It also controls the code generator 1 which outputs code signals such as . The above-mentioned numeric instruction and arithmetic instruction are applied to the set input terminal R of the flip-flop circuit 12 via the OR circuit 6, and the instruction end signal is applied to the set input terminal S. The set side output terminal Q of this flip-flop circuit 12
The output signal is supplied to one end of the OR circuit 71 of the gate circuit group 7 and one end of the OR circuit 81 of the gate circuit group 8, and is also supplied to the AND circuit 91 of the gate circuit group 9 and the inverter 9.
2 to one end of the AND circuit 93, and further supplied to the reset input terminal R of the flip-flop circuit 5. The output signal of the set side output terminal Q of the flip-flop circuit 5 is supplied to the one-shot circuit 13. This one-shot circuit] 3 outputs an output for one word time when the flip-flop circuit 5 enters the set state in accordance with a clock signal φW outputted every one word time (eight digital times in the present application) from a timing signal generator (not shown). The output signal is supplied to one end of the AND circuit 42 and the Soar circuit 43 of the gate circuit group 4, and is also supplied to the AND circuit 72 of the gate circuit group 7 and the AND circuit 82 of the gate circuit 8. Incidentally, the digital signals D1 to D8 are sequentially output from a timing signal generating section (not shown) every word time, and the AND circuit 72 is closed at the timing of D1+D2, and the AND circuit 82 is closed at the timing of D1+D2. will be done. The output signal of the AND circuit 72 is output from the OR circuit 71.
The code signal is applied to the AND circuit 73 to which the code signal is supplied from the code generating section 11 via the code generating section 11, and controls the opening and closing of the AND circuit 73. This AND circuit 73 output signal is supplied to the input terminal a of the arithmetic circuit 10. On the other hand, 4 is an 8-digit (8-digit) shift register for counting random numbers and storing calculation data, and 7-digit (7-digit) registers 14a and 1
The output of the register 14a is supplied to the AND circuit 83 of the gate circuit group 8, and its output signal is supplied to the input terminal b of the arithmetic circuit 10 and then to the 4-input terminal a. An operation is performed on the supplied data. The calculation result is then output to the AND circuit 91 of the gate circuit group 9. It is written into the shift register 14 via the OR circuit 94. Furthermore, when no calculation is performed, the contents of this shift register 14 are the AND circuit 93 and the OR circuit 9.
The memory is retained while being recirculated via 4. On the other hand, the operation result of the arithmetic circuit 10 is written into the shift register 15 via the AND circuit 42 and the OR circuit 44 of the gate circuit group 4, and the numeric data output from the encoder section 2 is written to the control section 3. AND circuit 4 of gate circuit group 4 whose opening/closing is controlled by a numeric command output from
1. This shift register 15 is composed of a 7-digit register 15a and a 1-digit register 15b, similar to the shift register 14 described above. The contents are recirculated via an AND circuit 45 and an OR circuit 44 whose opening and closing are controlled by the output signal of the NOR circuit 43 of the gate circuit group 4, and the output is sent via a display section (not shown) and the gate circuit group 8. The signal is sent to the arithmetic circuit 10.Next, the operation of the present invention configured as described above will be explained using the key operation ``METO T KAMURA KK KARU! Tsukasa'' as an example.
第2図はキー操作に対応したシフトレジスタ14,15
の状態を示すものである。まず、キー入力部1のキーが
何ら操作されていない時、即ち非演算中には第3図のタ
イミングチヤートに示す様にフリツプフロツプ回路12
はセツト状態にあるためセツト側出力端子Qの出力信号
“゜1゛がゲート回路群7のオア回路71を介してアン
ド回路73、及びゲート回路群8のオア回路81を介し
アンド回路83の各々一端に印加されるため、制御部3
の命令に従つてコード発生部]1からコード信号「1」
(2進数で「0001)がD1のタイミングで上記ア
ンド回路73を介して演算回路10の入力端子aに供給
されると共に、シフトレジスタ14の内容が上記アンド
回路83を介して上記演算回路10の入力端子bに供給
され、演算回路10で「+1」の加算が行われる。一方
上記セツト状態のフリツプフロツプ回路12の出力端子
Qの出力信号“1゛はゲート回路群9のアンド回路91
の一端に印加され、またインバータ92により反転され
て“0゛となつてアンド回路93に印加されるため、上
記演算回路10の演算結果はアンド回路91.オア回路
94を介して再びシフトレジスタ14に書き込まれる。
以下同様の動作でシフトレジスタ14の内容は1ワ一ド
タイム毎順次「+1」され、カウンタの如く計数される
ことになる。次に第2図に示す如く置数キー2が操作さ
れるとエンコーダ部2から置数キー操作に対するキー有
り信号が制御部3に供給されてこの制御部3から置数命
令が出力され、この置数命令はオア回路6を介してフリ
ツプフロツプ回路12を第3図に示す如くりセツトする
。そしてこのフリツプフロツプ回路12の出力信号は“
0゛となり、上記アンド回路73,83は閉略され、シ
フトレジスタ14の内容及びコード発生部1]からのコ
ード信号「l」は演算回路10へ供給されなくなる。ま
た上記フリツプフロツプ回路12の出力信号“O゛はゲ
ート回路群9のインバータ92を介しで゜1゛となり、
アンド回路93の一端に印加されるため、第3図に示す
様にシフトレジスタ17の内容は置数キー2が操作され
る前の内容のまま上記アンド回路93、オア回路94を
介してリサキユレートして保持されると共に、上記制御
部3から出力される置数命令がゲート回路群4のアンド
回路41に供給されるため、置数キー2の操作に伴なつ
てエンコーダ部2から出力される置数データ「2」は上
記アンド回路4]、オア回路44を介して第2図に示す
如くシフトレジスタ15に書き込まれる。しかして、こ
の置数処理動作が終了すると制御部3から置数命令・は
出力されなくなり、ワンシヨツト回路13の出力信号も
“0”であるためゲート回路群4のノア回路43の出力
ま“1゛となつてアンド回路45は開成し、上記シフト
レジスタ15の内容はアンド回路45、オア回路44を
介してリサキユレートしながら保持されると共に、制御
部3から置数命令が終了したことを示す命令終了信号が
フリツプフロツプ回路12のセツト入力端子Sに印加さ
れ、フリツプフロツプ回路12は再びセツト状態になる
。従つてこのフリツプフロツプ回路12の出力端子Qの
出力信号は“1゛となり、前述した如く、シフトレジス
タ14の内容は演算回路10にコード発生部11からの
コード「1」と順次加算され、第2図に示す様にカウン
トアツプしてゆく。次に凶キーが操作されると、エンコ
ーダ部2から区キーに対応ししフアンクシヨンデータが
制御部3へ供給される。この制御部3から演算命令が出
力され、第2図に示すようにオア回路6を介してフリツ
プフロツプ回路12はりセツトされ、またシフトレジス
タ15の内容「2」は図示しない他のシフトレジスタへ
転送される(シフトレジスタ15にも内容は保持されて
いる)。しかして凶キーに対する演算命令が終了すると
制御部3から命令終了信号が出力され、フリツプフロツ
プ回路12は第3図に示す如くりセツトされて次のキー
操作が成されるまで第2図に示す様にシフトレジスタ1
4の内容は順次「+1」される。そこで3キーが操作さ
れると前述の2キーの操作時と同様に制御部3から置数
命令が出力されてシフトレジスタ15には「3」が書き
込まれ、置数処理動作が終了すると次のキーが操作され
るまでの非演算中シフトレジスタ14の内容は順次「+
1」される。次に口キーが操作されると、エンコーダ部
2から口キーに対応したフアンクシヨンデータが制御部
3へ送出され、この制御部3から各種制御信号が出力さ
れて上記図示しないシフトレジスタに記憶されているデ
ータ「2」とシフトレジスタ15に記憶されているデー
タ「3」との演算が演算回路10にて行なわれて演算結
果「6」は第2図に示すようにシフトレジスタ15に書
き込まれる。しかして演算処理動作が終了すると前述し
た如く制御部3から命令終了信号が出力されてシフトレ
ジスタ14の内容に対する「+1」の加算が順次行なわ
れる。そこで匪Kmlキーが操作されると第3図に示す
様にエンコーダ部2から乱数キーに対するキー有り信号
が制御部3、オア回路6に供給されてフリツプフロツプ
回路]2はりセツトされるためシフトレジスタ]4の内
容に対する「+1」加算動作は停止され、又キー有り信
号はフリツプフロツプ回路5のセツト入力端子Sに供給
されてフリツプフロツプ回路5は第3図に示す様にセツ
トされる。しかしてワンシヨツト回路13から1ワード
タイム幅の1発パルスが出力されてゲート回路群4のア
ンド回路42は開成され、またこのワンシヨツト回路1
3の出力信号はゲート回路群7の一端にデジツト信号D
1+D2の供給されているアンド回路72及びゲート回
路群8の一端にデジツト信号D1+D2の供給されてい
るアンド回路82の各々の他端に供給されるため、シフ
トレジスタ14の内容はD1+D2のタイミングでアン
ド回路83、演算回路10、ゲート回路群4のアンド回
路42、オア回路44を介してシフトレジスタ]5に書
き込まれ、D1+D2のタイミングでは制御部3により
制御されてコード発生部11から出力されるブランキン
グコードがゲート回路群7のアンド回路73、演算回路
42、オア回路44を介してシフトレジスタ15に書き
込まれる。従つてそのシフトレジスタ15には2桁の乱
数が書き込まれることになる。更に、第3図に示すよう
にシフトレジスタ14からシフトレジスタ15への乱数
転送動作は1ワードタイムで終了するため、制御部3か
ら命令終了信号が出力されてフリツプフロツプ回路12
はセツトされ、シフトレジスタ14の内容に対する「+
1」加算が再び行われる。なお、上記実施例では非演算
中には常にシフトレジスタ14に対する「+1」動作を
実行している場合について述べたが、このシフトレジス
タ14は上記した如く演算データの記憶にも用いられる
ものであり、このように演算データが記憶された後の非
演算中には記憶されているデータから「+1」加算を始
めることも可能である。Figure 2 shows shift registers 14 and 15 that correspond to key operations.
This indicates the state of First, when no key of the key input section 1 is operated, that is, during non-operation, the flip-flop circuit 12 is activated as shown in the timing chart of FIG.
is in the set state, so the output signal "゜1" of the set side output terminal Q is sent to the AND circuit 73 via the OR circuit 71 of the gate circuit group 7, and to the AND circuit 83 via the OR circuit 81 of the gate circuit group 8. Since the voltage is applied to one end, the control unit 3
According to the command of the code generator] 1, the code signal “1” is generated.
(0001 in binary) is supplied to the input terminal a of the arithmetic circuit 10 via the AND circuit 73 at the timing D1, and the contents of the shift register 14 are supplied to the input terminal a of the arithmetic circuit 10 via the AND circuit 83. It is supplied to input terminal b, and addition of "+1" is performed in arithmetic circuit 10. On the other hand, the output signal "1" at the output terminal Q of the flip-flop circuit 12 in the set state is the AND circuit 91 of the gate circuit group 9.
The signal is applied to one end of the signal, and is inverted by the inverter 92 and applied to the AND circuit 93 as "0". will be written to.
Thereafter, in the same manner, the contents of the shift register 14 are sequentially incremented by "+1" every word time, and counted like a counter. Next, as shown in FIG. 2, when the numeric key 2 is operated, the encoder section 2 supplies a key presence signal in response to the numeric key operation to the control section 3, which outputs a numeric command. The numeric instruction sets the flip-flop circuit 12 through the OR circuit 6 as shown in FIG. The output signal of this flip-flop circuit 12 is “
0'', the AND circuits 73 and 83 are closed, and the contents of the shift register 14 and the code signal "l" from the code generator 1 are no longer supplied to the arithmetic circuit 10. Further, the output signal "O" of the flip-flop circuit 12 becomes "1" through the inverter 92 of the gate circuit group 9,
Since the voltage is applied to one end of the AND circuit 93, the contents of the shift register 17 are recirculated via the AND circuit 93 and the OR circuit 94 as shown in FIG. At the same time, the numeric command output from the control section 3 is supplied to the AND circuit 41 of the gate circuit group 4. The numerical data "2" is written to the shift register 15 via the AND circuit 4] and the OR circuit 44 as shown in FIG. When this numeric processing operation is completed, the numeric command is no longer output from the control section 3, and since the output signal of the one-shot circuit 13 is also "0", the output of the NOR circuit 43 of the gate circuit group 4 is "1". Then, the AND circuit 45 is opened, and the contents of the shift register 15 are held while being recirculated via the AND circuit 45 and the OR circuit 44, and an instruction is issued from the control unit 3 indicating that the arranging instruction has ended. The end signal is applied to the set input terminal S of the flip-flop circuit 12, and the flip-flop circuit 12 is put into the set state again.Therefore, the output signal at the output terminal Q of this flip-flop circuit 12 becomes "1", and as described above, the shift register The contents of 14 are sequentially added to the code "1" from the code generator 11 in the arithmetic circuit 10, and the count is increased as shown in FIG. Next, when the key is operated, the encoder section 2 supplies function data corresponding to the key to the control section 3. An arithmetic instruction is output from the control section 3, and the flip-flop circuit 12 is reset via the OR circuit 6 as shown in FIG. 2, and the content "2" of the shift register 15 is transferred to another shift register (not shown). (The contents are also held in the shift register 15). When the arithmetic instruction for the wrong key is completed, the control section 3 outputs an instruction end signal, and the flip-flop circuit 12 is set as shown in FIG. 3, and the flip-flop circuit 12 is set as shown in FIG. 2 until the next key operation. shift register 1 to
The contents of 4 are sequentially incremented by "+1". Then, when the 3 key is operated, a numeric command is output from the control unit 3 and "3" is written in the shift register 15 in the same way as when the 2 key was operated, and when the numeric processing operation is completed, the next The contents of the shift register 14 during non-operation until the key is operated are sequentially "+".
1” is done. Next, when a mouth key is operated, function data corresponding to the mouth key is sent from the encoder section 2 to the control section 3, and various control signals are outputted from the control section 3 and stored in the shift register (not shown). The arithmetic circuit 10 performs an arithmetic operation on the data "2" stored in the data "2" and the data "3" stored in the shift register 15, and the arithmetic result "6" is written into the shift register 15 as shown in FIG. It will be done. When the arithmetic processing operation is completed, the control section 3 outputs an instruction end signal as described above, and the addition of "+1" to the contents of the shift register 14 is performed sequentially. When the Kml key is operated, as shown in FIG. 3, a key presence signal for the random number key is supplied from the encoder section 2 to the control section 3 and the OR circuit 6, and the flip-flop circuit [2] is reset to the shift register]. The "+1" addition operation for the contents of 4 is stopped, and the keyed signal is supplied to the set input terminal S of the flip-flop circuit 5, so that the flip-flop circuit 5 is set as shown in FIG. As a result, a single pulse with a one-word time width is output from the one-shot circuit 13, and the AND circuit 42 of the gate circuit group 4 is opened.
The output signal of No. 3 is connected to one end of the gate circuit group 7 as a digital signal D.
1+D2 is supplied to one end of the AND circuit 72, and one end of the gate circuit group 8 is supplied to the other end of each of the AND circuit 82, which is supplied with the digital signal D1+D2. Therefore, the contents of the shift register 14 are ANDed at the timing of D1+D2. The block is written to the shift register] 5 via the circuit 83, the arithmetic circuit 10, the AND circuit 42 of the gate circuit group 4, and the OR circuit 44, and is output from the code generator 11 under the control of the control unit 3 at the timing of D1+D2. The ranking code is written into the shift register 15 via the AND circuit 73, the arithmetic circuit 42, and the OR circuit 44 of the gate circuit group 7. Therefore, a two-digit random number will be written into the shift register 15. Furthermore, as shown in FIG. 3, since the random number transfer operation from the shift register 14 to the shift register 15 is completed in one word time, an instruction end signal is output from the control section 3 and the flip-flop circuit 12
is set, and “+” is set for the contents of the shift register 14.
1'' addition is performed again. In the above embodiment, a case has been described in which the "+1" operation is always performed on the shift register 14 during non-operation, but this shift register 14 is also used to store operation data as described above. It is also possible to start adding "+1" from the stored data during non-operation after the calculation data is stored in this way.
また、上記シフトレジスタ14は乱数発生用に固定化さ
れているものではなく、他の未使用レジスタを適宜乱数
発生用のレジスタとして使用し得るものである。Furthermore, the shift register 14 is not fixed for random number generation, and other unused registers can be used as appropriate random number generation registers.
更に、上記実施例では、2桁の乱数を取出す場合につい
て述べたが、本発明は2桁の乱数に限られずその桁数は
任意に設定し得るものである。Further, in the above embodiment, a case has been described in which a two-digit random number is extracted, but the present invention is not limited to a two-digit random number, and the number of digits can be set arbitrarily.
以上詳細に説明した如く、本発明によれば乱数発生の為
の専用のカウンタ及び速いカウント用クロツクを必要と
せず、演算終了から次の演算開始までの非演算中のラン
ダムな時間を利用し、且つこの非演算中に実質的に動作
停止しているレジスタ及び演算回路を有効に利用するこ
とにより乱数を発生させている為、極めて精度の高い乱
数を得ることが出来ると共に、その回路構成も簡略化し
得る等種々の利点を有する。As explained in detail above, according to the present invention, there is no need for a dedicated counter or a fast counting clock for generating random numbers, and the random time during non-operation from the end of an operation to the start of the next operation is used. In addition, random numbers are generated by effectively utilizing registers and arithmetic circuits that are virtually inactive during non-operation periods, making it possible to obtain extremely high-precision random numbers and simplifying the circuit configuration. It has various advantages such as being able to be
第1図は本発明の一実施例の回路構成図、第2図は同キ
ー操作に対応したシフトレジスタの状態図、第3図は同
キー操作に対応したタイミングチヤートである。
1・・・キー入力部、2・・・エンコーダ部、3・・・
制御部、10・・・演算回路、11・・・コード発生部
、14,15・・・シフトレジスタ。FIG. 1 is a circuit configuration diagram of an embodiment of the present invention, FIG. 2 is a state diagram of a shift register corresponding to the same key operation, and FIG. 3 is a timing chart corresponding to the same key operation. 1...Key input section, 2...Encoder section, 3...
Control unit, 10... Arithmetic circuit, 11... Code generation unit, 14, 15... Shift register.
Claims (1)
記憶部に記憶されたデータに基づいて四則演算等の演算
を行なう演算部を有する演算装置に於て、上記演算部が
非演算中か否かを検出する検出手段と、この検出手段の
出力に基づきコードデータを発生するコードデータ発生
手段とを設け、上記検出手段によつて非演算中であるこ
とが検知されている際、上記演算部にて上記コードデー
タ発生手段によるコードデータを上記記憶部内所定領域
の記憶データに順次加算し、この加算結果を乱数として
出力せしめることを特徴とする乱数発生方式。1. In an arithmetic device having a storage unit that stores at least a plurality of data and an arithmetic unit that performs operations such as four arithmetic operations based on the data stored in this storage unit, it is possible to determine whether or not the arithmetic unit is not in operation. A detection means for detecting the data and a code data generation means for generating code data based on the output of the detection means are provided, and when the detection means detects that the calculation is not in progress, the calculation section A random number generation method characterized in that code data generated by the code data generation means is sequentially added to data stored in a predetermined area within the storage section, and the addition result is output as a random number.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP53076154A JPS5953580B2 (en) | 1978-06-23 | 1978-06-23 | Random number generation method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP53076154A JPS5953580B2 (en) | 1978-06-23 | 1978-06-23 | Random number generation method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS553081A JPS553081A (en) | 1980-01-10 |
| JPS5953580B2 true JPS5953580B2 (en) | 1984-12-26 |
Family
ID=13597104
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP53076154A Expired JPS5953580B2 (en) | 1978-06-23 | 1978-06-23 | Random number generation method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPS5953580B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS6326757A (en) * | 1986-07-19 | 1988-02-04 | Sharp Corp | Data processor |
-
1978
- 1978-06-23 JP JP53076154A patent/JPS5953580B2/en not_active Expired
Also Published As
| Publication number | Publication date |
|---|---|
| JPS553081A (en) | 1980-01-10 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US3824378A (en) | Electronic counter | |
| US4302816A (en) | Key input control apparatus | |
| US4254460A (en) | Programmable controller | |
| US3588841A (en) | Programmable electronic calculator | |
| US3996562A (en) | Programmable electronic calculator for evaluating mathematical problems | |
| US3678466A (en) | Electronic calculator | |
| JPS5953580B2 (en) | Random number generation method | |
| US3237171A (en) | Timing device | |
| US4352161A (en) | Electronic calculator capable of dealing with variables | |
| US4381554A (en) | Calculator for storing source data and evaluating numerical answers to problems | |
| US3854124A (en) | Electronic calculator | |
| US4309761A (en) | Calculator for evaluating numerical answers to problems | |
| JPS6025612Y2 (en) | random number generator | |
| JPH0245831A (en) | Knowledge inference processor | |
| JPS6236560B2 (en) | ||
| SU622202A1 (en) | Code-converting arrangement | |
| SU458814A1 (en) | Centralized program management system | |
| US4611307A (en) | Function analyzing | |
| SU633029A1 (en) | Centralized monitoring and on-line control apparatus | |
| SU758162A1 (en) | DEVICE MANAGEMENT COMPLEX SYSTEM 1 | |
| SU940165A1 (en) | Device for functional conversion of ordered number file | |
| SU369561A1 (en) | DEVICE FOR INPUT AND OUTPUT INFORMATION | |
| JPS6227930Y2 (en) | ||
| SU1718210A1 (en) | Device for input information in calculator | |
| JPS5834520Y2 (en) | electronic cash register |