Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JPH0241765B2 - - Google Patents
[go: Go Back, main page]

JPH0241765B2 - - Google Patents

Info

Publication number
JPH0241765B2
JPH0241765B2 JP59167629A JP16762984A JPH0241765B2 JP H0241765 B2 JPH0241765 B2 JP H0241765B2 JP 59167629 A JP59167629 A JP 59167629A JP 16762984 A JP16762984 A JP 16762984A JP H0241765 B2 JPH0241765 B2 JP H0241765B2
Authority
JP
Japan
Prior art keywords
waveform
memory
circuit
data
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 - Lifetime
Application number
JP59167629A
Other languages
Japanese (ja)
Other versions
JPS6145331A (en
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 filed Critical
Priority to JP59167629A priority Critical patent/JPS6145331A/en
Publication of JPS6145331A publication Critical patent/JPS6145331A/en
Publication of JPH0241765B2 publication Critical patent/JPH0241765B2/ja
Granted legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/584Pseudo-random number generators using finite field arithmetic, e.g. using a linear feedback shift register
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2207/00Indexing scheme relating to methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F2207/58Indexing scheme relating to groups G06F7/58 - G06F7/588
    • G06F2207/581Generating an LFSR sequence, e.g. an m-sequence; sequence may be generated without LFSR, e.g. using Galois Field arithmetic
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2207/00Indexing scheme relating to methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F2207/58Indexing scheme relating to groups G06F7/58 - G06F7/588
    • G06F2207/583Serial finite field implementation, i.e. serial implementation of finite field arithmetic, generating one new bit or trit per step, e.g. using an LFSR or several independent LFSRs; also includes PRNGs with parallel operation between LFSR and outputs

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)
  • Electrophonic Musical Instruments (AREA)

Description

【発明の詳細な説明】[Detailed description of the invention]

[産業上の利用分野] 本発明は乱数発生回路、特に簡単な構成で乱数
信号を得ることの可能な改良された乱数発生回路
に関する。 [背景技術] 電子回路を用いて打楽器の音やゲームの効果音
等を得るためには乱数を出力する雑音音源が必要
であり、このため従来より各種の乱数発生回路が
開発実用化されている。 第2図にはこのような従来の乱数発生回路が示
されており、この乱数発生回路は、第2図Aに示
すごとく、直列入力並列出力型のシフトレジスタ
10と、このシフトレジスタ10のメモリ内容を
演算し所定のシリアル信号を該シフトレジスタに
入力する帰還回路12と、を含む。そして、シフ
トパルス出力回路14からシフトパルスSPが入
力される度に帰還回路12からシフトレジスタ1
0に新たなシリアル信号を入力してメモリ内容を
図中右方向にシフトすることにより、該シフトレ
ジスタ内に所定周期の擬似乱数を発生させてい
る。 第2図Bにはこのような従来の乱数発生回路の
具体的な回路構成が示されており、実施例の乱数
発生回路は、n段のシフトレジスタ10と、該シ
フトレジスタ10から所望のパラレル出力が入力
される帰還回路12と、を含み、2n−1のクロツ
ク周期をもつた擬似乱数をシフトレジスタ10内
に発生させている。 従つて、該シフトレジスタ10の任意の段の内
容を出力して取り出すと、0と1の不規則な乱数
系列が得られる。その乱数系列は、前述したよう
に2n−1の周期をもつているため、擬似乱数と呼
ばれるが、nの値が充分大きな場合にはこの周期
も大きなものとなるため、実際の用途では真の乱
数と同等に見なしても差しつかえない。 従つて、このようにして得られた乱数をサンプ
リングアドレスとして用いることにより、所望の
雑音信号を出力することは可能となる。 [発明が解決しようとする問題点] しかし、従来の乱数発生回路は、シフトレジス
タ10と、該シフトレジスタ10にシフトパルス
を供給するシフトパルス出力回路14と、をそれ
ぞれ独立に設ける必要があるため、回路の部品点
数が多くなり、装置全体が複雑かつ高価なものと
なるという欠点があつた。 特に、電子回路を用いて所望の音を発生する音
発生回路においては、このような雑音波形発生用
の乱数発生回路の外に所望の擬音を発生させるた
めの周期波形発生回路が設けられており、従つ
て、このような従来の乱数発生回路を、周期波形
発生回路と別個独立して設けると、回路全体が極
めて複雑かつ高価となり、しかも回路全体が大型
化するという欠点があつた。 [発明の目的] 本発明はこのような従来の課題に鑑み成された
ものであり、その目的は回路全体の集積度を高め
小型でかつ低コストな乱数発生回路を提供するこ
とにある。 [問題点を解決するための手段及び作用] 前記目的を達成するため、本発明の回路は、累
算値を記憶する累算メモリと、前記累算値と外部
入力される周波数データとを加算しこの加算値を
新たな累算値として前記累算メモリに書込み記憶
させるための第1加算器と、を含み、前記第1加
算器の累算値がオーバーフローした際発生する桁
上げ信号に基づきシフトパルスを出力するシフト
パルス出力部と、 乱数値メモリ及び第2加算器から成り前記シフ
トパルスが入力される度に第2加算器を用いて乱
数値メモリ内容を倍数加算して更新しシフトレジ
スタとして機能するシフト回路と、前記乱数値メ
モリの出力に基づき前記第2加算器のキヤリー入
力端子に帰還信号をフイードバツク入力する帰還
回路と、を含み、前記乱数値メモリ内に所定の乱
数を発生させる乱数発生部と、 を有し、前記第1加算器及び第2加算器は、同一
の加算器を時分割して共用することを特徴とす
る。 以上の構成とすることにより、本発明の乱数発
生回路は、使用する部品点数を減少させ、回路全
体の集積度を高めることが可能となり、この結
果、小型でかつ低コストが乱数発生回路を提供す
ることができる。 ここにおいて、本発明の乱数発生回路は各種の
用途に幅広く用いることが可能であり、特に音発
生回路において雑音を発生する際に使用する乱数
発生源として好適である。 [実施例] 次に本発明の好適な実施例を図面に基づき説明
する。 (A) 乱数発生回路の原理 第1図には本発明に係る乱数発生回路の好適
な実施例が示されており、実施例の乱数発生回
路は、シフトパルスSPを出力するシフトパル
ス出力部20と、該シフトパルスSPが入力さ
れる度に所定の乱数を発生させる乱数発生部2
2と、を含む。 前記シフトパルス出力部20は、周波数デー
タメモリ24内に記憶された周波数データFと
累算メモリ26内に記憶された累算値Bとを加
算器28により加算し、その加算値を新たな累
算値Bとし累算メモリ26のメモリ内容を更新
する。 このような累算メモリ26の更新は、タイミ
ング発生回路30から一定の周期でライトパル
スa入力される度に行われる。 従つて、実施例のシフトパルス出力部20
は、加算器28の動作により累算メモリ26内
に記憶された累算値と周波数データメモリ24
から出力される周波数データFとを加算し、タ
イミング発生回路30からライトパルスaが出
力されていれば該加算値を新たな累算値として
累算メモリ26内へ書込み記憶していくことに
なる。 そして、加算器28は、このような累算値B
と周波数データFとの加算の結果この加算値が
オーバーフローした際、出力端子COから桁上
げ信号cを出力し、このようにして出力された
桁上げ信号cはタイミング発生回路30から出
力されるライトパルスaと同一周期をもつタイ
ミング信号bとともにアンドゲート31へ供給
され、アンドゲート31からシフトパルスSP
として出力される。 このように、実施例のシフトパルス出力部2
0は、加算器28がオーバーフローし桁上げ信
号cを出力する度に乱数発生部22へ向けシフ
トパルスSPを出力する。 このシフトパルスSPが出力される時間間隔
は、加算器28がオーバーフローする時間間隔
であり、従つて、該加算器28に入力される周
波数データFの値が大きければ該時間間隔を短
くすることができ、そのFの値を小さくするこ
とによりその時間間隔を長くすることができ
る。 従つて、該周波数データメモリ24内に書込
み記憶する周波数データFの値を大きく設定す
ることにより、実施例のシフトパルス出力部2
0からは短い時間間隔でシフトパルスSPが出
力され、また周波数データメモリ24内へ小さ
な周波数データFを設定することにより、出力
されるシフトパルスSPの時間間隔を長くする
ことが可能となる。 また、実施例の乱数発生部22は、シフトレ
ジスタとして機能するシフト回路32と、該シ
フト回路32の並列出力に基づきシリアル信号
をシフト回路32へ供給する帰還回路12と、
を含む。 前記シフト回路32は、乱数値メモリ34及
び第2加算器36からなり、シフトパルス出力
部20からシフトパルスSPが入力される度に
第2加算器36を用いて乱数値メモリ34のメ
モリ内容を倍数加算して新たなメモリ内容に更
新する。 なお、実施例においては、第2加算器36は
乱数値メモリ34のメモリ内容を2倍に加算す
る2倍器として機能している。 このようにすることにより、乱数値メモリ3
4に記憶されたメモリ内容は、シフトパルス
SPが入力される度に順次上位桁にシフトし、
シフトレジスタとして機能することになる。 すなわち、乱数値メモリ34のメモリ内容が
例えば「0011」で、帰還回路12の帰還値を
「0」とした場合に、そのメモリ内容が第2加
算器36により倍数加算すると、その内容は
「0110」となる。また、この新たなメモリ内容
「0110」が加算器36により更に倍数加算され
ると、そのメモリ内容は「1100」となる。 このように、シフト回路32はシフトレジス
タと同様に機能することが理解される。 そして、帰還回路12は、乱数値メモリ34
の並列出力に基づき帰還信号として所定のシリ
アル信号を出力し、該シリアル信号を第2加算
器36のキヤリー入力端子CIに入力している。 ここで、キヤリー入力端子CIは、シフトレ
ジスタに於けるシリアル入力と等価になる。 このようにすることにより、実施例の乱数発
生部22は、第2図に示す回路と全く同様に機
能し、シフトパルスSPが入力される度に乱数
値メモリ34内部に乱数を発生させることがで
きる。 この際、乱数の発生周期は、シフトパルス出
力部20から供給されるシフトパルスSPの出
力周期により定まり、従つて周波数データメモ
リ24内へ書込み記憶する周波数データFの値
を大きくすることにより乱数発生周期を短く設
定することができ、また設定する周波数データ
を小さくすることにより乱数発生周期を長く設
定することが可能となる。 以上説明したように、本発明に係る乱数発生
回路は、シフトパルス出力部20及び乱数発生
部22を近似した回路構成としており、その特
徴的事項は、時分割の手法を用いることによ
り、このようなシフトパルス発生部20及び乱
数発生部22に用いられる第1の加算器28及
び第2の加算器36として、同一の加算器を使
用可能としたことにある。 すなわち、時分割の手法によりシフトパルス
出力部20の動作時と、乱数発生部22の動作
時とを時間的に異なるタイミングで行うことに
より、第1の加算器28及び第2の加算器36
は同時に作動することがない。 従つて、1つの加算器を、シフトパルス出力
部20が動作している場合には第1の加算器2
8として用い、乱数発生部22が作動している
場合には第2の加算器36として用いることが
でき、このように同一の加算器を第1及び第2
の加算器28,36として用いることにより、
乱数発生回路の構成を簡単化しその集積度を高
めることができ、この結果回路全体の低コスト
化を図ることができる。 また、本発明の乱数発生回路においては、そ
のシフトパルス出力部20と乱数発生部22と
に用いるメモリ24,26,34として通常の
メモリを用いることができるため、これらメモ
リ24,26,34を同一のメモリ、例えば
RAM内の異なる番地内に形成することが可能
となり、このようにすることにより回路全体の
集積度を更に高めることが可能となる。 (B) 音発生回路の原理 次に本発明の乱数発生回路を音発生回路に適
用した場合を例にとり説明する。 実施例において、この音発生回路は、任意の
周波数及び形状の波形を出力し所望の擬音を発
生させる周期波形発生回路と、所望周期の雑音
波形を出力し例えば打楽器の音あるいはゲーム
の効果音等を発生させる雑音波形発生回路と、
を含む。ここにおいて、本発明の乱数発生回路
は雑音波形発生回路の一部として用いられてい
る。 以下に実施例の音発生回路を周期波形発生回
路と雑音波形発生回路とに分けて説明する。 (B‐1) 周期波形発生回路 第3図Aには周期波形発生回路の好適な実
施例が示されており、実施例の周期波形発生
回路は、波形メモリ40内に予め記憶された
複数の波形から任意の波形を所望周期で読み
出すことにより、任意の周波数及び形状の波
形を発生するものである。 周知のように、一般の波形は、波形(状)、
繰返し周波数(周期)及び振幅の3要素を有
し、これらいずれかが相違すれば異なる波形
となり、例えば擬音の場合、音色、音程及び
音圧が異なつて現出する。なお、前記周波数
には初期位相も含まれる。 以上の3要素に対応して、実施例の波形発
生回路においても各要素の任意指定が行わ
れ、波形メモリ40に記憶された波形の選択
によつて波形状が定まり、またこの選択され
た波形の読み出し分周比の設定によつて、周
波数(周期および初期位相)が定まる。そし
て、これら波形状と周波数とがデジタル的に
特定された後に、その振幅が設定される。 実施例の周期波形発生回路において、特徴
的なことは、波形の選択と読み出し分周比が
別個に処理されていることであり、特に読み
出し分周比は読み出し周波数(周期)を外部
より入力するのみで任意の周波数を設定可能
であり、波形メモリ40の記憶データが限ら
れた量であるにも関わらず多数の波形を発生
し得る利点がある。 以下、本実施例の周期波形発生回路の詳細
を説明する。 実施例において、波形メモリ40はROM
又はRAM等を用いて形成されており、その
内部には複数の波形が記憶されている。表1
には波形メモリ40に記憶された波形の一例
が示されている。 このようにして波形メモリ40内に記憶さ
れた波形は、波形選択メモリ42から供給さ
れ、かつ4ビツトの数値データをもつて構成
された波形ナンバーSにより選択され、選択
された波形は1波長分のデータとして出力さ
れる。 このような1波長分のデータの読み出し
は、周期アドレス出力回路43から供給され
るサンプリングアドレス信号に基づき波形デ
ータを順次所定のサンプリング周期で読み出
し出力することにより行われる。 実施例において、この周期アドレス出力回
路43は、周波数メモリ44、累算メモリ4
6及び加算器48により構成され、前述した
波形メモリ40から選択出力される波形の読
み出し周期は、周波数メモリ44から供給さ
れる周波数データFによつて定められる。 なお、この読み出し周波数の初期位相は、
累算メモリ46内に図示しない初期位相設定
回路により書込み記憶されている。 すなわち、実施例の回路は、累算メモリ4
6と加算器48とにより累算器を構成し、加
算器48により周波数メモリ44から供給さ
れる周波数データFと累算メモリ46内に累
算記憶されている累算値Bとを加算し、ライ
トパルスWPの入力があれば新たな累算値と
して累算メモリ46のメモリ内容を更新する
更新動作を行う。従つて、累算メモリ46内
の累算データBはライトパルスWPが供給さ
れる度に、周波数メモリ44から供給される
周波数データFだけ順次増加することにな
る。 そして、この周期波形発生回路は、前記更
新動作が行われる度に累算メモリ46内に書
込まれた新たな累算データBをサンプリング
アドレス信号として波形メモリ40に供給す
る。そして、波形ナンバーSにより選択され
た波形から、累算データBによつて特定され
る波形データを読み出すサンプリング動作を
行う。 なお、実施例の周期波形発生回路における
回路各部のビツト数を例示すれば、周波数精
度をもたせる意味から、周波数データFを20
ビツト、累算値Bを21ビツトに設定してい
る。しかし、累算値Bによつて選択される波
形データは、221ワードものビツト量は必要
でないので、Bの上位5ビツトのみ(Bを
221-5=65536で割つて小数点以下を切捨てた
値)をサンプリングアドレス情報、すなわち
位相角情報として用いている。従つて、波形
メモリ40から読出される波形データは25
32ワードとなる。そして、このようにして読
み出される各ワードが波形の振幅を示す。 波形データの1ワードは4ビツトであるか
ら1つの波形データは32×4=128ビツトで
ある。また波形ナンバーSは4ビツトであ
り、16種類の波形が登録できることから、波
形メモリ全体では128ビツト×16=2048ビツ
トである。 表2には、ある1種類の波形に対する1サ
ンプリングごとの累算データBのみと、波形
メモリ40から出力される波形データの1例
が示されている。Nn(n=0、1、2、3、
4、…)は「n」回めのサンプリングを表す
記号であり、波形データ欄のSD−0は波形
ナンバーS=0の場合の表1に基づいた出力
波形データを、SD−7は波形ナンバーS=
7の場合の表1に基づきた出力波形データを
表す。 ここにおいて、初期状態のときの周波数デ
ータFをF=010000Hとし、累算データBを
B=00Hと仮定する。ここにおいて、末尾の
Hは表された数字が16進数であることを示
す。 まず波形ナンバーSによりS=0Hの波形
が選択されたとする。サンプリングN0の場
合には、波形ナンバーはS=0Hであるから
波形メモリ40のアドレス上位4ビツトが
0000であり、累算データBはB=00Hである
から、波形メモリ40のアドレス下位5ビツ
トが00000となり、波形メモリ40からは
000000000すなわち000Hのアドレスにより指
定された波形データ「7」がサンプリング読
み出しされる。 同様に、サンプリングN1の場合には、S
=0H、累算データB5ビツトは01Hであるた
め、波形メモリ40のアドレス上位4ビツ
ト、下位5ビツトはそれぞれ0000と00001で
ある001Hのところの波形データ「9」がサ
ンプリング読み出しされる。 このようにして、累算データBには順次F
づつ累算されていき、その結果該累算データ
Bの上位5ビツトは各サンプリング動作が行
われるたびに表2に示すように順次変化し、
表1にて選択された波形データS=01Hを所
定の間隔で順次サンプリング読み出ししてい
く。 第13図には、波形ナンバーS=0Hによ
り選択された波形の出力波形図が示されてお
り、同図から明らかなようにS=0Hにより
波形を選択するとsin波形が得られることが
判る。なお、同図において横軸はサンプリン
グ回数を表し、縦軸はサンプリング出力され
る波形データのアナログ量を表す。 なお、前記説明は、波形ナンバーS=0H
によりsin波形を選択した場合を例にとり説
明したが、実施例の周期波形発生回路は、こ
れに限らず他の波形も選択可能であり、例え
ば波形ナンバーS=7Hにより波形を選択す
ると、表2のSD−7の欄に示すごとくS=
7Hにより選択された波形の波形データが順
次サンプリング読み出しされる。 第14図にはこのようにしてサンプリング
読み出しされた波形が示されており、同図か
らも明らかなようにS=7Hにより波形を選
択すると鋸波を出力することが判る。 このように、実施例の周期波形発生回路に
よれば、波形メモリ40内にあらかじめ設定
された複数の波形から波形ナンバーSにより
選択された波形を任意に選択出力することが
可能となり、従つて波形メモリ40に単に適
当な波形をあらかじめ設定しておくことによ
り、所望の波形を出力することができる。 次にこのようにしてサンプリグ読み出しさ
れる波形の読み出し周波数fについて検討す
る。表2の累算データBの値に着目すると、
初期状態N0の時のBの値とN20のときの値
とが等しくなつている。これはサンプリング
アドレスBの値がN=0から20Hサイクル後
に加算器48がオーバーフローし初期状態と
同じ値となり波形メモリ40のサンプリング
アドレスが初めの状態に戻つたことを意味
し、従つてこの20Hサイクル間に周期波形が
1波長出力されることになる。 この1波長に対応する期間を「1周期」と
定義する。本実施例で累算データB全体(21
ビツト)の値が200000Hだけ増加する間が1
周期となる。但しこの1周期分の波形を得る
のに必要なサイクル数は周波数データFの値
によつて変化する。 すなわち、累算データBの増加の間隔が短
ければ1周期分の波形を得るのに多くサンプ
リングサイクル数を必要とし、長ければ少し
のサンプリングサイクル数で1周期分の波形
が得られる。 ここで1周期する間に生ずるサンプリング
サイクル数をNsとし、累算データBのビツ
ト数をMとすれば、 Ns=2M/F ……(1) となる。また、1回のサンプリングに要する
時間、すなわち1サンプリングサイクルに要
する時間をts、1周期に係る時間をTsとす
ると、Ts=Ns・tsとなる。 従つて、出力波形の周波数fは f=1/Ts=1/Ns・ts=F/ts・2M ……(2) となり、ここにおいて、tsは定数であるか
ら、出力される周期波形の周波数fは周波数
データの値Fによつて決定される。 このことは、出力される周期波形の周波数
fが周波数データFの値にいかんによつて任
意に設定できることを意味する。 このように、波形メモリ40からの周期波
形の読み出し周期は周波数メモリ44に設定
される周波数データFの値が大きい場合には
短く、周波数データFが小さい場合には長く
することができる。 以上表2に示す波形の読み出しを行う場合
について検討してみると、表2においては、
1サンプリングサイクル毎に波形データが順
次読み出されている。もし周波数データFの
値010000Hがより小さく1サイクルのサンプ
リング動作終了時に累算データBの上位5ビ
ツトの内容に変化が生じない場合には、波形
メモリ40からサンプリング出力される波形
データの値も変化しない。このような場合に
は、累算データBの上位5ビツトの内容が変
化するまでサンプリング動作を数サイクル繰
り返し(多重読みされ)それだけ周期波形の
出力周波数が低くなる。 逆に周波数データFの値が010000Hよりも
大きく、累算データBの上位5ビツトの値が
1サンプリングサイクル中に、02H以上累算
されると波形データは、飛び越し読み出しさ
れる。 この場合、出力周波数が高くなるが、波形
の高調波成分が損われることになる。 以上説明したように、実施例の周期波形発
生回路においては、波形選択メモリ32及び
周波数メモリ44へ所望の波形ナンバーS及
び周波数データFを設定することが可能であ
り、従つて、このS及びFの設定により、波
形メモリ40から任意の波形を任意の周波数
で発生させることが可能となる。 以上が、周期波形発生回路により1つの周
期波形を出力する場合を説明したが、時分割
多重化の手法を用いることにより複数の波形
を合成した周期波形を得ることもできる。 この場合、多重化にともなうチヤンネル数
が増える程、各チヤンネルあたりのサンプリ
ング周波数が低くなつてしまうが、このサン
プリング周波数は、理論上、出力波形に要求
される周波数帯域の上限の少なくとも2倍以
上の周波数に設定することが要求される。 前記時分割サンプリングは各チヤンネルに
対して循環して行われ、DAコンバータを介
して出力される波形に対して所定のフイルタ
ーリングを行い必要な周波数帯域外を除去す
ることにより、本実施例の回路により、複数
チヤンネルの周期波形から完全な合成波形を
得ることが可能となる。 なお、実施例の周期波形発生回路におい
て、各メモリが、所定の記憶素子、例えば
RAM内の異なる番地内に形成されている。 (B‐2) 雑音波形発生回路 実施例の雑音波形発生回路は、前記第3図
Aに示す周期波形発生回路の周期アドレス出
力回路43に代え、前述した本発明の乱数発
生回路を乱数アドレス出力回路として用いる
ことにより、波形メモリ40内にあらかじめ
記憶された複数の波形から任意の波形を所定
周期でランダムに読み出すことにより、ラン
ダムな形状の雑音波形を任意の周期で発生さ
せるものである。 第3図Bにはこのような本実施例の雑音波
形発生回路が示されており、実施例の回路
は、波形選択メモリ42から供給される波形
ナンバーSにより波形メモリ40に記憶され
る任意波形が選択され、該選択波形が本発明
の乱数発生回路をもつて構成されるサンプリ
ングアドレス(乱数)アドレス出力回路45
から供給される乱数によりランダムに読み出
し出力される。 すなわち、乱数アドレス出力回路43を形
成する本発明の乱数発生回路からは、所定の
時間間隔で乱数が供給され、このようにして
供給される乱数をサンプリングアドレス信号
として波形メモリ40に供給することによ
り、波形メモリ40からは、波形ナンバーS
により選択された波形から、乱数によつて特
定される波形データがサンプリング読み出し
されることになる。 従つて、このようにしてサンプリング読み
出される波形データは、前記周期波形のサン
プリング読み出し時と異なり、このサンプリ
ングアドレスがランダムに変化するため全体
として波形がランダムに変化する雑音波形と
して出力されることになる。 本実施例おいては、このような乱数アドレ
ス出力回路45から出力される乱数を16ビツ
トに設定し、この16ビツトの乱数の所定の5
ビツトのみをサンプリングアドレスとして波
形メモリ40に供給している。 尚、以上の説明では実施例の雑音波形発生
回路により1つの雑音波形を出力する場合を
例にとり説明したが、実施例の雑音波形発生
回路は前記周期波形発生回路と同様に時分割
多重化の手法を用いることにより複数の波形
を合成した雑音波形を得ることもできる。 (B‐3) 本実施例の特徴的事項 本実施例の特徴的事項は、このような周期
波形発生回路の動作と、雑音波形発生回路の
動作とを異なるタイミングで任意に行うこと
により、同一の加算器を加算器28,36,
48として用い、しかも周期波形発生回路及
び雑音発生回路に同一の波形メモリ40を用
いて周期波形発生動作及び雑音波形発生動作
を行うことを可能としたことにある。 このように周期波形発生回路と雑音波形発
生回路とに用いる加算器及び波形メモリを共
用することにより、回路全体の構成を簡単化
しその集積度を高め、その結果装置全体の低
コスト化を計ることができる。 次に、第3図Aに示す周期波形発生回路
と、第3図Bに示す雑音波形発生回路とを組
合せ、その回路の1部、例えば加算器及び波
形メモリを共用して形成された回路の具体例
について説明する。 (C) 具体的な実施例 第4図には周期波形の発生と雑音波形の発生
との両機能を任意に切替え可能な回路が示され
ており、実施例の回路は16本のチヤンネルを有
し、各チヤンネルの1つ1つについて前記両機
能を自由に切替えて使用することができる。 なお、実施例の回路は、第3図Aに示す周期
波形発生と、第3図Bに示す乱数発生の各回路
を原理的に組合せて形成させたものであるが、
第1図、第3図A,Bの各回路はその原理図を
示したものにすぎず、従つて、本実施例の回路
とはその回路構成を幾分異にする。 実施例の回路は、RAM50を有し、該
RAM50の異なる番地内に前記第3図A及び
第3図Bに示す各メモリ24,26,34,4
2,44,46を形成している。このようにし
て形成されるメモリエリアはサウンドポートと
よばれ、実施例においては、周期波形発生時の
サウンドポート及び雑音波形発生時のサウンド
ポートとしてそれぞれのチヤンネルについて固
定的に8バイトのエリアを有している。 第5図にはこのようなサウンドポートのメモ
リ内容が示されており、第5図Aは周期波形発
生時に用いられるサウンドポート、第5図Bは
雑音波形発生時に用いられるサウンドポートの
メモリ内容を示している。 なお、これら各サウンドポートにおけるデー
タ記号は、前記第1図、第3図A及び第3図B
において用いたデータ記号と同一の符号を用い
ている。 第5図Aにおいて、周波数データF及び累算
データBはその下位側からそれぞれF0、F1、
F2及びB0、B1、B2とそれぞれ3分割してサウ
ンドポート記憶されている。これは、第3図A
において説明したように、実施例の周波数メモ
リ44及び累算メモリ46内に記憶されるデー
タF及びBがそれぞれ20ビツト、21ビツトのも
のであるのに対し、第4図に示す実施例の回路
において用いられる加算器52は8ビツトのも
のであるため、このように各データF、Bを8
ビツト単位で分割しなければその加算を行うこ
とができないからである。なお、第3図におい
て説明した周波数データF及び累算データBの
加算は、第5図Aに示された各データの下位側
からキヤリー信号(桁上げ信号)を加味して順
次行われる。 また、第5図Bに示す雑音波形発生用のサウ
ンドポートにおいて、乱数値メモリ34内に記
憶されるSRは下位側から順にSR0、SR1に分
割して記憶されている。これは、乱数値メモリ
34のメモリ容量が16ビツトであるのに対し、
加算器36は8ビツトの加算容量しかないこと
による。 また、第5図A,Bに示す両サウンドポート
に共通するデータG0、G1は、波形のゲイン
(利得)である。このゲインは、第4図に示す
波形メモリ40からの波形データの出力と同時
にRAM50のサウンドポートから出力されて
波形ラツチ54内にラツチされ、その後乗算機
能を有したDAコンバータ56にて読み出され
た波形データと乗算され、アナログ信号として
出力される。従つて、このゲインにより波形メ
モリ40から読み出される波形データの振幅が
制御される。 実施例において、このゲインとして通常は
G0を用いるが、例えばステレオ用の波形を出
力する場合には、このゲインG0と独立にゲイ
ンG1をも用いて波形の振幅調整を行うことも
できる。 また、第5図A,Bに示す両サウンドポート
において、Nは回路の周期波形発生動作と雑音
波形発生動作の機能の切替えを行うデータビツ
トであり、このNによつて機能切替えが行える
チヤンネルは、該Nの存在するサウンドポート
に対応したチヤンネルではなく、その次にサン
プリングが実行されるチヤンネルである。 これは、データNは1回のサンプリング過程
の最後に読み出されるためである。 実施例において、RAM50内には以上説明
したような第5図A,Bに示すサウンドポート
がそれぞれ形成されている。CPUは所定のプ
ログラムに従いこれら各サウンドポートからの
データのアクセスをCPUのバスサイクルに同
期して時分割で行つている。 すなわち、実施例における1つのチヤンネル
の1回のサンプリング過程は、RAM50の時
分割アクセス実行のために4つの過程に分割し
て行われており、従つて、実施例の回路におい
て、16チヤンネルのサンプリングを終了するた
めには4×16=64、すなわち64周期の時分割ア
クセスを実行することが必要となる。 次に第4図に示す回路の動作を、周期波形発
生動作と雑音波形発生動作とに分けてそのサン
プリング過程を説明する。なおこのような動作
を行うにあたり、実際にはCPUがRAM50を
占有する期間が間欠的に入るが、実施例におい
ては、RAMアドレスの時分割をつかさどるマ
ルチプレクサ58がチヤンネル及びポート選択
信号側にセツトされているものとしてCPUの
RAM占有期間の説明を省略する。 (C‐1) 周期波形発生動作 まず第4図に示す回路により周期波形を発
生するための動作を説明する。 その動作は、前記第3図Aに示す周期波形
発生回路の原理で示したように、第5図Aに
示すサウンドポートの周波数データFと、累
算値データBとが累算され、その後その累算
結果に基づき波形メモリ40から任意の波形
が読み出され、その後第5図Aに示すサウン
ドポートのゲインG0により波形振幅が定め
られ、DAコンバータ56からアナログ信号
波形として出力される。 以下、この波形発生動作を、周波数データ
Fと累算データBとの累算動作と、この累算
結果に基づき波形メモリ40から周期波形を
読み出す動作とに分けて説明する。 まず、この波形データFと累算値データB
との累算は、加算器52を第3図Aに示す加
算器48として用いて、この下位側のビツト
から第1にF0+B0、第2にF1+B1、第3に
F2+B2の3つのステツプに分けて行われる。 すなわち、実施例の回路は、乱数モードキ
ヤリフリツプフロツプ60がクリアされるこ
とにより、タイミング及び制御回路62が回
路全体を周期波形発生回路として動作させ
る。 (第1ステツプ) これにより、第6図に示すごとく、回路は
矢印で示すようにキヤリーフリツプフロツ
プ64がクリアされその記憶内容が0に設定
される。 これに続いてRAM50の第5図Aに示す
サウンドポートからは、矢印及びで示す
ごとく、まず下位側の周波数データF0及び
累算データB0がこれぞれ読み出されラツチ
回路66及び68にラツチされる。 ここにおいて、マルチプレクサ70は、波
形ナンバーマスク回路72側を選択してい
る。波形ナンバマスク回路72は、この時点
ではデータ素通しの状態である。従つて、加
算器52にはラツチ回路66及び68に記憶
されたデータF0及びB0が供給され、この累
算値Y=F0+B0+CYが演算される。なお、
この最下位データの演算では、CY=0であ
るため、加算器52の出力はY=F0+B0と
なる。 この演算の完了と同時に、タイミング及び
制御回路62からRAM50にライトパルス
が供給され、これと同時に3ステートバツフ
ア74が開き、矢印で示す如く、加算器5
2の演算データY=F0+B0がRAM内の第
5図Aに示すサウンドポートのB0書き込み
エリア、すなわち累算メモリ46内に記憶さ
れる。 このようにして、まず、最下位側の累算値
B0が新たな累算値に更新記憶される。 この際、F0+B0の演算により桁上りが発
生した場合には「1」が、発生しなかつた場
合には「0」が、矢印で示すごとく、桁上
げ信号CYとして加算器52のCo端子からキ
ヤリーフリツプフロツプ64に保持される。 (第2ステツプ) このような一連の演算が終了すると、次に
F1及びB1の演算、すなわち、第2ステツプ
の演算が開始される。 この演算は、前記第1ステツプにおける演
算と同様に、RAM50の第5図Aに示すサ
ウンドポートから、F1、B1を読み出しこれ
を加算器52の入力端子A,Bに入力し同時
にキヤリーフリツプフロツプがマルチプレク
サ76を介して加算器52のCI入力端子に
接続されているため、第1ステツプでキヤリ
ーフリツプフロツプに保持された桁上げ信号
CYを加味した演算を行い、演算データY=
F1+B1+CYをサウンドポートのデータB1
記憶エリア、すなわち累算メモリ46内に、
新たなデータとして書込み記憶する。また、
同時にキヤリーフリツプフロツプ64の内容
も更新される。 (第3ステツプ) 前記第2ステツプが終了すると、第7図に
示すごとく第3ステツプの演算が開始され
る。 この演算は、矢印及びで示すごとく、
RAM50内の第5図Aに示すサウンドポー
トからデータF2及びSを読み出しラツチ回
路66内にラツチし、続いてデータB2を読
み出しラツチ回路68内にラツチすることに
より開始される。 この際、波形ナンバーマスク回路72はラ
ツチ回路66に記憶されたF2に相当する下
位側の4ビツトにビツト5として「0」を加
えデータF2を5ビツトに拡張して加算器5
2へ供給する。 そして、加算器52は、このようにしてラ
ツチ回路66,68から供給されるデータ
F2及びB2を累算し、矢印で示すごとく、
その累算値Y=F2+B2+CYを前述と同様に
RAM50内の第5図Aに示すサウドポート
のB2記憶エリア、すなわち累算メモリ46
内に新たなデータとして書込み記憶する。 この際、第3ステツプの演算ではキヤリー
フリツプフロツプ64は更新されないが、キ
ヤリーフリツプフロツプ64は第2ステツプ
におけるCYを保持したままなので、任意の
値として、次回のサンプリング動作の最初に
クリアされる。 (第4ステツプ) このような第1〜3ステツプから成る累算
動作が終了すると、第8図に示すごとく次に
波形メモリ40に記憶された波形データの読
出しが行われる。 すなわち、前記第3ステツプの動作終了時
点において、加算器52からは加算後の出力
値データ(Y=F2+B2+CY)が出力されて
おり、これと同時に、矢印で示すごとく波
形ナンバーSがラツチ回路66から出力さ
れ、波形メモリ40にサンプリングアドレス
として供給される。 このように波形メモリに、出力データY及
び波形ナンバーSが供給されると、矢印で
示すごとく波形メモリ40に記憶された波形
データが波形ラツチ54に向け出力される。 また、このような一連の波形データのサン
プリング読み出し動作と連動して、RAM5
0の第5図Aに示すサウンドポートからは、
ゲインG0が読み出され、該読み出しデータ
が矢印で示すごとく波形ラツチ54に向け
供給される。このようにして波形ラツチ54
内にラツチされた波形データとゲインG0は
乗算機能を有したDAコンバータ56内にお
いて乗算され、同時にアナログ信号に変換さ
れ次サンプリング動作の波形読み出しが開始
される時点まで出力される。 そして、前記第1〜第4ステツプから成る
サンプリング動作を、前記第(1)式で与えられ
る回数だけ繰り返して行うことにより、波形
ナンバーSにより選択された任意の周期波形
が1周期分読み出し出力される。 このように、実施例の回路においては、前
述した第1〜第4ステツプの一連の動作を各
チヤンネル毎にくり返し行うことにより、波
形メモリ50内に記憶された周期波形を所望
の読み出し周期及びゲインG0をもつて読み
出し出力することができる。 なお、ステレオ効果を得る場合には、波形
ラツチ54及びDAコンバータ56をもう1
組用意し、前述と同様にRAM50内の第5
図Aに示すサウンドポートからゲインG1を
読み出すことにより、このゲインG1により
その振幅が定められた所定の周期波形を読み
出すことも可能である。 また、実施例の回路は、前述した第1〜第
4ステツプの一連のサンプリング動作が終了
する毎に、第5図Aに示すサウンドポートか
ら読み出されたデータNが矢印で示すごと
く乱数モード検出フリツプフロツプ60内に
読み込まれ、このようにして読み込まれたデ
ータNは次のチヤンネルの動作が周期波形発
生動作かあるいは以下に述べる雑音波形発生
動作を定める。 このようにして、実施例の回路は、例えば
第13図、第14図で示す任意の周期波形を
所望周期で出力することができる。 以上が、本実施例の回路における周期波形
発生動作であり、次に本実施例の回路を用い
て行われる雑音波形発生動作について説明す
る。 (C‐2) 雑音波形発生動作 実施例の回路において、雑音波形発生動作
は、乱数モード検出フリツプフロツプ60の
出力が1に設定されることにより開始され、
このようにフリツプフロツプ60の出力が、
1となると、タイミング及び制御回路62は
回路全体を雑音波形発生用の動作に制御す
る。 このようにして雑音波形発生動作を開始す
ると、実施例の回路は、まず第1ステツプと
してシフト許可信号Pを出力するためのシフ
トパルス発生部としての動作を行い、第2、
第3ステツプにおいて出力されたシフト許可
信号Pに基づき乱数を発生する乱数発生部と
しての動作を行い、第4ステツプとして発生
した乱数に基づき雑音信号を発生するための
動作を行う。 以下この各動作をステツプ順に説明する。 (第1ステツプ) まず雑音波形発生動作が開始すると同時
に、実施例の回路は、第9図に示すごとく、
シフトパルス発生部20として動作する。 すなわち、実施例の回路は動作開始と同時
に矢印で示すようにキヤリーフリツプフロ
ツプ64をクリアし、RAM50の第5図B
に示す乱数発生用サウンドポートからそのデ
ータの読み出しを開始する。 このデータの読み出しは矢印及びで示
すごとく、第5図Bに示すサウンドポートの
各メモリ24,26から、周波数データF及
び累算データBを読み出し、これら各データ
F及びBをそれぞれラツチ回路66及び68
内にラツチする。 このようにしてラツチ回路66,68内に
ラツチされたデータF及びBは加算器52に
おいて累算され、Y=F+Bの値として出力
される。そして、このようにして求められた
値Y=F+Bは、矢印で示すごとく、あら
たな累算値データBとしてサウンドポート第
5図Bに示す累算値データBの記憶エリア、
すなわち累算メモリ26内に書込み記憶され
る。 この書込み動作は以下のごとく行われる。 まず、データF、Bの演算動作を行つた結
果、加算器52の加算値がオーバーフローし
た場合、矢印で示すごとく加算器52の
COの端子からは桁上げ信号を乱数用キヤリ
ーフリツプフロツプ76に供給し、これによ
り乱数用キヤリーフリツプフロツプ76から
はタイミング及び制御回路62に向けてシフ
ト許可信号P(第3図Bにおいては加算器2
8からのキヤリーCに該当)が出力される。 次に、タイミング及び制御回路62は、
RAM50に書込みパルスWPを出力し、累
算値データの更新が行われる。 以下、シフト許可信号Pが出力されている
ものとして、第2ステツプ以後を説明する。 (第2ステツプ) このようにして乱数用キヤリーフリツプフ
ロツプ76からシフト許可信号Pが出力され
ると、タイミング及び制御回路62は、第1
0図に示すごとく回路全体を乱数発生部とし
て制御する。 このようにして、実施例の回路が、乱数発
生部として制御されと、図中矢印で示すご
とく、RAM50の第5図Bに示す乱数発生
用サウンドポートにおいて、乱数値メモリ3
4として機能するメモリエリアから下位側の
乱数SR0が読み出され、ラツチ回路68内に
ラツチされる。 この際、マルチプレクサ70は、ラツチ回
路68側を選択しており、従つて、矢印で
示すごとく、加算器52の両入力端子にはラ
ツチ回路68にラツチされたデータB0が供
給されることになる。 このような動作と同時に、マルチプレクサ
71は帰還値メモリ78側に切り代り、矢印
で示すごとく、帰還値メモリ78から読み
出された帰還値が加算器52のキヤリー入力
端子CIに入力される。 なお、この帰還値メモリ78は、チヤンネ
ル数に等しい容量をもつアドレスツサブルな
メモリであり、本実施例の場合(1ビツト)
×16のRAMにして構成している。またこの
帰還値メモリ78内に書込み記憶されるてい
る帰還値は、前回の乱数発生動作時に帰還回
路12を介して入力されたシリアルデータで
ある。 この結果、加算器52からは、Y=2×
SR0+(帰還値)の値が出力され、この値が
RAM50の第5図Bに示すSR0データエリ
ア(乱数値メモリ34)にあらたなデータと
して書込み記憶される。 そして、このようなデータの書込みと同時
に、8ビツト加算器52は、CO端子から桁
上げ信号CY=1を矢印で示すごとくキヤ
リーフリツプフロツプ64に供給する。 このようにして、下位側のデータSR0の更
新が終了すると、次に上位側のデータSR1の
更新が開始される。この動作は第11図に示
すごとく行われる。 (第3ステツプ) まず、すなわち、RAM50の第5図Bに
示す乱数発生用サウンドポートからは、矢印
で示すごとく上記側のデータSR1が読み出
されラツチ回路68にラツチされるととも
に、矢印で示すごとく該サウンドポートか
ら波形ナンバーを現わすデータSが読み出さ
れラツチ回路66にラツチされる。 このラツチ動作が終了すると、マルチプレ
クサ70がラツチ回路68側を選択している
ことから、次に矢印で示すごとくラツチ回
路68にラツチされたデータSR1が加算器5
2の両入力端子に供給され、これと同時に矢
印で示すごとくマルチプレクサ71を介し
てキヤリーフリツプフロツプ64に保持され
ていた桁上げ信号CYがキヤリー入力端子CI
に供給される。 この結果、加算器52からはこの桁上げ信
号CYを含んだY=2×SR1+CYの値が出力
され、矢印で示すように、RAM50内の
第5図Bで示すSR1データ記憶エリア(乱数
値メモリ34)に新たなデータとして書込み
記憶される。 このようにして、第5図Bに示すサウンド
ポート用の乱数記憶用のSR0及びSR1メモリ
エリア(乱数値メモリ34)にはあらたな乱
数が書込み記憶されることになる。 また、加算器52から加算データY=2×
SR1+CYが出力されると、帰還回路12は、
次回の乱数発生動作における帰還値を矢印
で示すごとく帰還値メモリ78内に書き込み
記憶する。 (第4ステツプ) このようにして第5図Bに示すサウンドポ
ート内にあらたな乱数が書込み記憶される
と、次に実施例の回路は第12図で示すごと
く雑音波形発生用の回路として機能する。 すなわち、前記第3ステツプ終了時におい
て、ラツチ回路66内には波形ナンバーを表
すSがラツチされており、該波形ナンバーS
が矢印で示すごとく波形メモリ40に供給
される。これと同時に、加算器52からは第
3ステツプの演算結果Y=2×SR1+CYが
出力されており、該出力の下位5ビツトが矢
印で示すごとく波形データのサンプリング
位置を定めるサンプリングアドレス信号とし
て波形メモリ40に供給される。 この結果、波形メモリ40からは、波形デ
ータが読み出され、矢印で示すごとく波形
ラツチ54内にラツチされる。 このような波形データの読み出しと同時
に、実施例の回路においては、矢印で示す
ごとくサウンドポートから、振幅を定めるデ
ータG0が読み出され波形ラツチ54内にラ
ツチされる。 そして、このようにして波形ラツチ内に波
形データとゲインとがラツチされると、その
値は矢印で示すごとくDAコンバータ56
に供給され、各データが乗算されると同時に
アナログ乱数波形信号として出力されること
になる。 このようにして、実施例の回路は、発生す
る乱数に基づき選択波形の波形データをラン
ダムにサンプリング読み出し雑音波形信号と
して出力する。 なお、実施例の回路において、波形ラツチ
54及びDAコンバータ56を更に一対設け
ることにより、第5図Bに示すごとくサウン
ドポートのゲインG1を読み出しこのゲイン
G1に基づく雑音波形を出力することも可能
である。 そして、このような雑音信号は波形を出力
した後、第5図Bに示すサウンドポートから
は、矢印で示すごとくデータNが読み出さ
れ、次のチヤンネルの動作を定める。 このような第1〜第4ステツプからなる所
定のランダム波形データのサンプリング読み
出しを、前記第(1)式で与えられる回数だけく
り返して行うことにより、波形ナンバーSに
より選択された周期波形の波形データが雑音
波形として一周期出力される。 次に、実施例の回路を用いて得られる任意
チヤンネルの雑音波形1例を説明する。 まず、任意チヤンネルの第5図Bに示すサ
ウンドポートがサンプリング動作開始時点に
おいて第5図Cの内容を有すると仮定する。
この場合、周波数データFは10進数でF=77
であるため、累算データBの桁上げはデータ
Bの更新回数(サイクル)256回のうち77回
発生する。この際、このサンプリング周波数
Fは後述する第(4)式によれば、 f=93.75 F=7218.75[Hz]となる。 表3にはこのような本実施例の雑音波形発
生動作時における各ステツプの演算データが
示され、以下この演算データに基づき実施例
のサンプリング過程を詳細に検討する。 ここにおいて、第5図Cから明らかなよう
に、波形ナンバーはS=0110(2進数)=6
(16進数)であり、該前記波形ナンバーS=
6(16進数)で選択される波形の各波形デー
タをその物理アドレス0C0〜0CFと対応して
表すと、このエリアの波形データは表4に示
すようになる。 まず前記第1ステツプにおいて詳述したよ
うに、実施例の回路がシフトパルス発生部2
0として動作すると、累算データBの値は次
に示すようにF=01001101(2進数)つづ更
新される。
[Industrial Application Field] The present invention relates to a random number generation circuit, and particularly to an improved random number generation circuit that can obtain a random number signal with a simple configuration. [Background Art] In order to obtain the sounds of percussion instruments, sound effects of games, etc. using electronic circuits, a noise sound source that outputs random numbers is required, and for this reason various random number generation circuits have been developed and put into practical use. . FIG. 2 shows such a conventional random number generation circuit, and as shown in FIG. 2A, this random number generation circuit includes a serial input parallel output type shift register 10 and a memory of this shift register 10 It includes a feedback circuit 12 that calculates the contents and inputs a predetermined serial signal to the shift register. Then, each time the shift pulse SP is input from the shift pulse output circuit 14, the feedback circuit 12 sends the shift register 1 to the shift register 1.
By inputting a new serial signal to 0 and shifting the memory contents rightward in the figure, pseudorandom numbers with a predetermined period are generated in the shift register. FIG. 2B shows a specific circuit configuration of such a conventional random number generation circuit, and the random number generation circuit of the embodiment includes an n-stage shift register 10 and a desired parallel and a feedback circuit 12 to which the output is input, and generates pseudo-random numbers in the shift register 10 with a clock cycle of 2 n -1. Therefore, when the contents of any stage of the shift register 10 are output and extracted, an irregular random number sequence of 0's and 1's is obtained. As mentioned above, the random number sequence has a period of 2 n -1, so it is called a pseudorandom number, but if the value of n is large enough, this period also becomes large, so it is not true in actual use. It is safe to regard it as the same as a random number. Therefore, by using the random number obtained in this way as a sampling address, it is possible to output a desired noise signal. [Problems to be Solved by the Invention] However, in the conventional random number generation circuit, it is necessary to independently provide the shift register 10 and the shift pulse output circuit 14 that supplies shift pulses to the shift register 10. However, the disadvantage is that the number of circuit parts increases, making the entire device complex and expensive. In particular, in sound generation circuits that generate desired sounds using electronic circuits, a periodic waveform generation circuit for generating desired onomatopoeic sounds is provided in addition to such a random number generation circuit for generating noise waveforms. Therefore, if such a conventional random number generation circuit is provided separately from a periodic waveform generation circuit, the entire circuit becomes extremely complicated and expensive, and the entire circuit becomes large. [Object of the Invention] The present invention has been made in view of the above-mentioned conventional problems, and its purpose is to provide a small-sized and low-cost random number generation circuit that increases the degree of integration of the entire circuit. [Means and effects for solving the problem] In order to achieve the above object, the circuit of the present invention includes an accumulation memory that stores an accumulated value, and a circuit that adds the accumulated value and externally input frequency data. a first adder for writing and storing the added value in the accumulation memory as a new accumulated value, and based on a carry signal generated when the accumulated value of the first adder overflows. It consists of a shift pulse output section that outputs a shift pulse, a random value memory, and a second adder, and each time the shift pulse is input, the second adder is used to add a multiple of the random value memory contents and update the shift register. and a feedback circuit that feeds back a feedback signal to the carry input terminal of the second adder based on the output of the random value memory, and generates a predetermined random number in the random value memory. A random number generating section, and the first adder and the second adder are characterized in that the same adder is shared in a time-sharing manner. With the above configuration, the random number generation circuit of the present invention can reduce the number of parts used and increase the degree of integration of the entire circuit. As a result, a small and low cost random number generation circuit can be provided. can do. Here, the random number generation circuit of the present invention can be widely used for various purposes, and is particularly suitable as a random number generation source used when generating noise in a sound generation circuit. [Example] Next, a preferred example of the present invention will be described based on the drawings. (A) Principle of random number generation circuit FIG. 1 shows a preferred embodiment of the random number generation circuit according to the present invention. and a random number generator 2 that generates a predetermined random number every time the shift pulse SP is input.
2. The shift pulse output section 20 adds the frequency data F stored in the frequency data memory 24 and the cumulative value B stored in the cumulative memory 26 using an adder 28, and uses the added value as a new cumulative value. The memory contents of the accumulation memory 26 are updated as the calculated value B. Such updating of the accumulation memory 26 is performed every time a write pulse a is input from the timing generation circuit 30 at a constant cycle. Therefore, the shift pulse output section 20 of the embodiment
is the cumulative value stored in the cumulative memory 26 and the frequency data memory 24 by the operation of the adder 28.
If a write pulse a is output from the timing generation circuit 30, the added value is written and stored in the accumulation memory 26 as a new accumulated value. . Then, the adder 28 adds such an accumulated value B
When this added value overflows as a result of addition of and frequency data F, a carry signal c is output from the output terminal CO, and the carry signal c thus output is a write signal output from the timing generation circuit 30. It is supplied to the AND gate 31 together with the timing signal b having the same period as the pulse a, and the shift pulse SP is supplied from the AND gate 31.
is output as In this way, the shift pulse output section 2 of the embodiment
0 outputs a shift pulse SP to the random number generator 22 every time the adder 28 overflows and outputs a carry signal c. The time interval at which this shift pulse SP is output is the time interval at which the adder 28 overflows. Therefore, if the value of the frequency data F input to the adder 28 is large, the time interval can be shortened. By decreasing the value of F, the time interval can be lengthened. Therefore, by setting a large value of the frequency data F to be written and stored in the frequency data memory 24, the shift pulse output section 2 of the embodiment
Shift pulses SP are output at short time intervals from 0, and by setting small frequency data F in the frequency data memory 24, it is possible to lengthen the time interval of output shift pulses SP. Further, the random number generation unit 22 of the embodiment includes a shift circuit 32 functioning as a shift register, a feedback circuit 12 that supplies a serial signal to the shift circuit 32 based on the parallel output of the shift circuit 32,
including. The shift circuit 32 includes a random value memory 34 and a second adder 36, and uses the second adder 36 to update the memory contents of the random value memory 34 every time a shift pulse SP is input from the shift pulse output section 20. Add multiples and update to new memory contents. In the embodiment, the second adder 36 functions as a doubler that doubles the memory contents of the random value memory 34. By doing this, the random value memory 3
The memory contents stored in 4 are the shift pulse
Each time SP is input, it shifts to the higher digits,
It will function as a shift register. That is, when the memory content of the random value memory 34 is, for example, "0011" and the feedback value of the feedback circuit 12 is "0", when the memory content is multiplied by the second adder 36, the content becomes "0110". ”. Furthermore, when this new memory content "0110" is further multiplied by the adder 36, the memory content becomes "1100". It is thus understood that shift circuit 32 functions similarly to a shift register. The feedback circuit 12 then operates the random value memory 34.
A predetermined serial signal is output as a feedback signal based on the parallel outputs of , and the serial signal is input to the carry input terminal CI of the second adder 36 . Here, the carry input terminal CI is equivalent to a serial input in a shift register. By doing so, the random number generator 22 of the embodiment functions in exactly the same way as the circuit shown in FIG. 2, and can generate random numbers inside the random value memory 34 every time the shift pulse SP is input. can. At this time, the random number generation cycle is determined by the output cycle of the shift pulse SP supplied from the shift pulse output section 20, and therefore, random numbers can be generated by increasing the value of the frequency data F written and stored in the frequency data memory 24. The cycle can be set short, and the random number generation cycle can be set long by reducing the set frequency data. As explained above, the random number generation circuit according to the present invention has a circuit configuration that approximates the shift pulse output section 20 and the random number generation section 22, and its characteristic feature is that by using a time division method, The advantage is that the same adder can be used as the first adder 28 and the second adder 36 used in the shift pulse generating section 20 and the random number generating section 22. That is, by performing the operation of the shift pulse output section 20 and the operation of the random number generation section 22 at different timings using a time-sharing method, the first adder 28 and the second adder 36
cannot operate at the same time. Therefore, one adder is replaced by the first adder 2 when the shift pulse output section 20 is operating.
8, and when the random number generator 22 is operating, it can be used as the second adder 36. In this way, the same adder can be used as the first and second adder 36.
By using it as adders 28 and 36,
The configuration of the random number generation circuit can be simplified and its degree of integration can be increased, and as a result, the cost of the entire circuit can be reduced. Further, in the random number generation circuit of the present invention, ordinary memories can be used as the memories 24, 26, and 34 used in the shift pulse output section 20 and the random number generation section 22. Same memory, e.g.
It becomes possible to form them at different addresses within the RAM, and by doing so, it becomes possible to further increase the degree of integration of the entire circuit. (B) Principle of sound generation circuit Next, a case where the random number generation circuit of the present invention is applied to a sound generation circuit will be explained as an example. In the embodiment, this sound generation circuit includes a periodic waveform generation circuit that outputs a waveform of an arbitrary frequency and shape to generate a desired onomatopoeia, and a periodic waveform generation circuit that outputs a noise waveform of a desired period and generates, for example, the sound of a percussion instrument or the sound effect of a game. a noise waveform generation circuit that generates
including. Here, the random number generation circuit of the present invention is used as a part of the noise waveform generation circuit. The sound generation circuit of the embodiment will be explained below by dividing it into a periodic waveform generation circuit and a noise waveform generation circuit. (B-1) Periodic waveform generation circuit FIG. 3A shows a preferred embodiment of the periodic waveform generation circuit. By reading an arbitrary waveform from the waveforms at a desired period, a waveform with an arbitrary frequency and shape is generated. As is well known, general waveforms are waveform (shape),
It has three elements: repetition frequency (period) and amplitude, and if any one of these is different, the waveform will be different. For example, in the case of onomatopoeia, the timbre, pitch, and sound pressure will be different. Note that the frequency also includes the initial phase. Corresponding to the above three elements, each element is also arbitrarily designated in the waveform generating circuit of the embodiment, and the waveform is determined by the selection of the waveform stored in the waveform memory 40, and the selected waveform The frequency (period and initial phase) is determined by setting the readout frequency division ratio. After these waveforms and frequencies are digitally specified, their amplitudes are set. The characteristic feature of the periodic waveform generation circuit of the embodiment is that the waveform selection and the readout frequency division ratio are processed separately, and in particular, the readout frequency division ratio is determined by inputting the readout frequency (period) from the outside. It has the advantage that any frequency can be set using only the waveform memory 40, and a large number of waveforms can be generated even though the amount of data stored in the waveform memory 40 is limited. The details of the periodic waveform generation circuit of this embodiment will be explained below. In the embodiment, the waveform memory 40 is a ROM.
Alternatively, it is formed using a RAM or the like, and a plurality of waveforms are stored therein. Table 1
An example of a waveform stored in the waveform memory 40 is shown in FIG. The waveforms stored in the waveform memory 40 in this manner are selected by the waveform number S supplied from the waveform selection memory 42 and configured with 4-bit numerical data, and the selected waveform consists of one wavelength. is output as data. Such reading of data for one wavelength is performed by sequentially reading and outputting waveform data at a predetermined sampling period based on a sampling address signal supplied from the periodic address output circuit 43. In the embodiment, this periodic address output circuit 43 includes a frequency memory 44 and an accumulation memory 4.
6 and an adder 48, and the reading cycle of the waveform selectively outputted from the waveform memory 40 described above is determined by the frequency data F supplied from the frequency memory 44. Note that the initial phase of this readout frequency is
It is written and stored in the accumulation memory 46 by an initial phase setting circuit (not shown). That is, the circuit of the embodiment has an accumulation memory 4
6 and an adder 48 constitute an accumulator, and the adder 48 adds the frequency data F supplied from the frequency memory 44 and the accumulated value B accumulated and stored in the accumulation memory 46, If a write pulse WP is input, an update operation is performed to update the memory contents of the accumulation memory 46 as a new accumulated value. Therefore, the accumulated data B in the accumulated memory 46 is sequentially increased by the frequency data F supplied from the frequency memory 44 every time the write pulse WP is supplied. The periodic waveform generation circuit supplies the new accumulated data B written in the accumulated memory 46 to the waveform memory 40 as a sampling address signal every time the update operation is performed. Then, a sampling operation is performed to read out the waveform data specified by the accumulated data B from the waveform selected by the waveform number S. In addition, to give an example of the number of bits of each circuit part in the periodic waveform generation circuit of the embodiment, the frequency data F is set to 20 to ensure frequency accuracy.
The bit and cumulative value B are set to 21 bits. However, the waveform data selected by the accumulated value B does not require as much as 221 words of bits, so only the upper 5 bits of B (B
2 21-5 = 65536 and rounded down to the decimal point) is used as sampling address information, that is, phase angle information. Therefore, the waveform data read from the waveform memory 40 is 2 5 =
It will be 32 words. Each word thus read indicates the amplitude of the waveform. Since one word of waveform data is 4 bits, one waveform data is 32×4=128 bits. Furthermore, since the waveform number S is 4 bits and 16 types of waveforms can be registered, the total waveform memory is 128 bits x 16 = 2048 bits. Table 2 shows only the accumulated data B for each sampling for one type of waveform and an example of the waveform data output from the waveform memory 40. Nn (n=0, 1, 2, 3,
4,...) is a symbol representing the "n" sampling, SD-0 in the waveform data column is the output waveform data based on Table 1 when the waveform number S = 0, and SD-7 is the waveform number. S=
7 represents output waveform data based on Table 1. Here, it is assumed that the frequency data F in the initial state is F=010000H, and the accumulated data B is B=00H. Here, the H at the end indicates that the number represented is a hexadecimal number. First, it is assumed that the waveform number S=0H is selected by the waveform number S. In the case of sampling N0, the waveform number is S=0H, so the upper 4 bits of the address of the waveform memory 40 are
0000, and the cumulative data B is B=00H, so the lower 5 bits of the address of the waveform memory 40 are 00000, and the data from the waveform memory 40 is
Waveform data "7" designated by the address 000000000, ie, 000H, is sampled and read out. Similarly, for sampling N1, S
=0H, and the accumulated data B5 bit is 01H, so the waveform data "9" at 001H, where the upper 4 bits and lower 5 bits of the address of the waveform memory 40 are 0000 and 00001, respectively, is sampled and read out. In this way, the accumulated data B is sequentially filled with F
As a result, the top five bits of the accumulated data B change sequentially as shown in Table 2 each time each sampling operation is performed.
The waveform data S=01H selected in Table 1 is sequentially sampled and read out at predetermined intervals. FIG. 13 shows an output waveform diagram of the waveform selected by the waveform number S=0H, and as is clear from the figure, it can be seen that when the waveform is selected by S=0H, a sin waveform is obtained. In the figure, the horizontal axis represents the number of samplings, and the vertical axis represents the analog amount of sampled waveform data. Note that the above explanation is based on the waveform number S=0H
Although the explanation has been given by taking as an example the case where the sine waveform is selected by As shown in the SD-7 column of
The waveform data of the waveform selected by 7H is sequentially sampled and read out. FIG. 14 shows the waveforms sampled and read out in this way, and as is clear from the figure, it can be seen that when the waveform is selected with S=7H, a sawtooth wave is output. As described above, according to the periodic waveform generation circuit of the embodiment, it is possible to arbitrarily select and output the waveform selected by the waveform number S from a plurality of waveforms preset in the waveform memory 40, and therefore the waveform By simply presetting an appropriate waveform in the memory 40, a desired waveform can be output. Next, the readout frequency f of the waveform sampled and read out in this manner will be considered. Focusing on the value of cumulative data B in Table 2,
The value of B at the initial state N0 is equal to the value at N20. This means that after 20H cycles from N=0, the adder 48 overflows and the value of sampling address B becomes the same value as the initial state, and the sampling address of the waveform memory 40 returns to its initial state. During this period, a periodic waveform of one wavelength is output. The period corresponding to this one wavelength is defined as "one period". In this example, the entire cumulative data B (21
1 while the value of bit) increases by 200000H
It becomes a cycle. However, the number of cycles required to obtain one cycle of the waveform changes depending on the value of the frequency data F. That is, if the interval between increases in the cumulative data B is short, a large number of sampling cycles are required to obtain one cycle of the waveform, and if it is long, one cycle of the waveform can be obtained with a small number of sampling cycles. Here, if the number of sampling cycles occurring during one period is Ns, and the number of bits of accumulated data B is M, then Ns=2 M /F (1). Further, if the time required for one sampling, that is, the time required for one sampling cycle is ts, and the time related to one cycle is Ts, then Ts=Ns·ts. Therefore, the frequency f of the output waveform is f=1/Ts=1/Ns・ts=F/ts・2 M ...(2) where ts is a constant, so the frequency f of the output periodic waveform is The frequency f is determined by the value F of frequency data. This means that the frequency f of the output periodic waveform can be set arbitrarily, regardless of the value of the frequency data F. In this way, the reading period of the periodic waveform from the waveform memory 40 can be shortened when the value of the frequency data F set in the frequency memory 44 is large, and can be made long when the frequency data F is small. When considering the case of reading out the waveforms shown in Table 2 above, in Table 2,
Waveform data is sequentially read out every sampling cycle. If the value 010000H of the frequency data F is smaller and there is no change in the contents of the upper 5 bits of the accumulated data B at the end of one cycle of sampling operation, the value of the waveform data sampled and output from the waveform memory 40 will also change. do not. In such a case, the sampling operation is repeated for several cycles (multiple readings are performed) until the contents of the upper five bits of the accumulated data B change, and the output frequency of the periodic waveform becomes lower accordingly. Conversely, if the value of the frequency data F is greater than 010000H and the value of the upper five bits of the accumulated data B is accumulated over 02H during one sampling cycle, the waveform data is read out in an interlaced manner. In this case, the output frequency will be higher, but the harmonic components of the waveform will be impaired. As explained above, in the periodic waveform generation circuit of the embodiment, it is possible to set the desired waveform number S and frequency data F in the waveform selection memory 32 and frequency memory 44, and therefore, the desired waveform number S and frequency data F can be set in the waveform selection memory 32 and the frequency memory 44. By setting , it is possible to generate an arbitrary waveform from the waveform memory 40 at an arbitrary frequency. Although the case where one periodic waveform is outputted by the periodic waveform generation circuit has been described above, it is also possible to obtain a periodic waveform by combining a plurality of waveforms by using a time division multiplexing technique. In this case, as the number of channels increases due to multiplexing, the sampling frequency for each channel becomes lower, but this sampling frequency should theoretically be at least twice the upper limit of the frequency band required for the output waveform. frequency. The time-division sampling is performed cyclically for each channel, and by performing predetermined filtering on the waveform output via the DA converter and removing frequencies outside the necessary frequency band, This makes it possible to obtain a complete composite waveform from periodic waveforms of multiple channels. Note that in the periodic waveform generation circuit of the embodiment, each memory has a predetermined storage element, e.g.
They are formed at different addresses in RAM. (B-2) Noise waveform generation circuit The noise waveform generation circuit of the embodiment replaces the periodic address output circuit 43 of the periodic waveform generation circuit shown in FIG. When used as a circuit, a random-shaped noise waveform is generated at an arbitrary cycle by randomly reading out an arbitrary waveform at a predetermined cycle from a plurality of waveforms stored in advance in the waveform memory 40. FIG. 3B shows such a noise waveform generation circuit according to the present embodiment, and the circuit according to the embodiment generates an arbitrary waveform stored in the waveform memory 40 according to the waveform number S supplied from the waveform selection memory 42. is selected, and the selected waveform is generated by the sampling address (random number) address output circuit 45 configured with the random number generation circuit of the present invention.
It is read out and output at random using random numbers supplied from . That is, the random number generation circuit of the present invention forming the random number address output circuit 43 supplies random numbers at predetermined time intervals, and by supplying the thus supplied random numbers to the waveform memory 40 as a sampling address signal. , from the waveform memory 40, the waveform number S
The waveform data specified by the random number is sampled and read out from the waveform selected by the random number. Therefore, the waveform data sampled and read out in this manner is different from the periodic waveform sampled readout, and because the sampling address changes randomly, the waveform data as a whole is output as a noise waveform whose waveform changes randomly. . In this embodiment, the random number output from the random number address output circuit 45 is set to 16 bits, and a predetermined 5 of this 16 bit random number is set to 16 bits.
Only the bits are supplied to the waveform memory 40 as sampling addresses. In the above explanation, the noise waveform generation circuit of the embodiment outputs one noise waveform as an example. However, the noise waveform generation circuit of the embodiment can perform time division multiplexing like the periodic waveform generation circuit described above. By using this method, it is also possible to obtain a noise waveform that is a composite of multiple waveforms. (B-3) Characteristics of this embodiment A characteristic feature of this embodiment is that the operation of the periodic waveform generation circuit and the operation of the noise waveform generation circuit can be performed at different timings to achieve the same operation. adders 28, 36,
48, and the same waveform memory 40 can be used for the periodic waveform generation circuit and the noise generation circuit to perform the periodic waveform generation operation and the noise waveform generation operation. By sharing the adder and waveform memory used in the periodic waveform generation circuit and the noise waveform generation circuit in this way, it is possible to simplify the overall circuit configuration and increase its degree of integration, thereby reducing the cost of the entire device. Can be done. Next, a circuit formed by combining the periodic waveform generation circuit shown in FIG. 3A and the noise waveform generation circuit shown in FIG. A specific example will be explained. (C) Specific Example Figure 4 shows a circuit that can arbitrarily switch between the functions of generating periodic waveforms and generating noise waveforms, and the circuit of the example has 16 channels. However, both functions can be freely switched and used for each channel. The circuit of the embodiment is formed by combining the periodic waveform generation circuit shown in FIG. 3A and the random number generation circuit shown in FIG. 3B in principle.
The circuits shown in FIG. 1 and FIGS. 3A and 3B only show their principle diagrams, and therefore have somewhat different circuit configurations from the circuit of this embodiment. The circuit of the embodiment has RAM50 and
Each memory 24, 26, 34, 4 shown in FIG. 3A and FIG. 3B is stored in different addresses of the RAM 50.
2, 44, and 46 are formed. The memory area formed in this way is called a sound port, and in this embodiment, it has a fixed 8-byte area for each channel as a sound port when periodic waveforms are generated and a sound port when noise waveforms are generated. are doing. Figure 5 shows the memory contents of such a sound port. Figure 5A shows the memory contents of the sound port used when generating periodic waveforms, and Figure 5B shows the memory contents of the sound port used when generating noise waveforms. It shows. The data symbols in each of these sound ports are as shown in Fig. 1, Fig. 3A, and Fig. 3B.
The same data symbols used in the above are used. In FIG. 5A, frequency data F and cumulative data B are F0, F1,
The sound ports are stored in three parts, F2, B0, B1, and B2. This is Figure 3A
As explained in , the data F and B stored in the frequency memory 44 and the accumulation memory 46 of the embodiment are of 20 bits and 21 bits, respectively, whereas the circuit of the embodiment shown in FIG. Since the adder 52 used in is of 8 bits, each data F and B is
This is because the addition cannot be performed unless it is divided into bits. Note that the addition of the frequency data F and the accumulated data B explained in FIG. 3 is performed sequentially from the lower order side of each data shown in FIG. 5A, taking into account a carry signal. Further, in the sound port for noise waveform generation shown in FIG. 5B, the SR stored in the random value memory 34 is divided into SR0 and SR1 and stored in order from the lower order. This is because the memory capacity of the random value memory 34 is 16 bits.
This is because the adder 36 has only an 8-bit addition capacity. Furthermore, data G0 and G1 common to both sound ports shown in FIGS. 5A and 5B are waveform gains. This gain is outputted from the sound port of the RAM 50 at the same time as the output of the waveform data from the waveform memory 40 shown in FIG. The signal is multiplied by the waveform data and output as an analog signal. Therefore, the amplitude of the waveform data read from the waveform memory 40 is controlled by this gain. In the example, this gain is typically
Although G0 is used, for example, when outputting a stereo waveform, the amplitude of the waveform can also be adjusted using gain G1 independently of this gain G0. Furthermore, in both sound ports shown in FIGS. 5A and 5B, N is a data bit that switches between the periodic waveform generation operation and the noise waveform generation operation of the circuit, and the channel whose function can be switched by this N is , is not the channel corresponding to the sound port where the N exists, but is the channel on which sampling will be performed next. This is because data N is read out at the end of one sampling process. In the embodiment, the sound ports shown in FIGS. 5A and 5B as described above are formed in the RAM 50, respectively. The CPU accesses data from each of these sound ports on a time-sharing basis in synchronization with the CPU bus cycle according to a predetermined program. That is, one sampling process of one channel in the embodiment is divided into four processes in order to perform time-division access to the RAM 50. Therefore, in the circuit of the embodiment, sampling of 16 channels is performed. In order to complete the process, it is necessary to execute time-division access of 4×16=64, that is, 64 cycles. Next, the operation of the circuit shown in FIG. 4 will be divided into periodic waveform generation operation and noise waveform generation operation, and the sampling process will be explained. Note that when performing such an operation, there are actually intermittent periods in which the CPU occupies the RAM 50, but in this embodiment, the multiplexer 58, which controls time division of RAM addresses, is set on the channel and port selection signal side. CPU as
The explanation of the RAM occupation period will be omitted. (C-1) Periodic waveform generation operation First, the operation for generating a periodic waveform using the circuit shown in FIG. 4 will be explained. As shown in the principle of the periodic waveform generation circuit shown in FIG. 3A, the operation is such that the sound port frequency data F and cumulative value data B shown in FIG. An arbitrary waveform is read out from the waveform memory 40 based on the accumulation result, and then the waveform amplitude is determined by the gain G0 of the sound port shown in FIG. 5A, and the waveform is outputted from the DA converter 56 as an analog signal waveform. Hereinafter, this waveform generation operation will be explained separately into an operation of accumulating frequency data F and accumulated data B, and an operation of reading a periodic waveform from the waveform memory 40 based on the accumulation result. First, this waveform data F and cumulative value data B
For the accumulation, the adder 52 is used as the adder 48 shown in FIG.
It is divided into three steps: F2 + B2. That is, in the circuit of the embodiment, when the random number mode flip-flop 60 is cleared, the timing and control circuit 62 causes the entire circuit to operate as a periodic waveform generating circuit. (First step) As a result, as shown in FIG. 6, the circuit clears the carry flip-flop 64 as indicated by the arrow, and its stored contents are set to 0. Subsequently, from the sound port of the RAM 50 shown in FIG. . Here, the multiplexer 70 selects the waveform number mask circuit 72 side. At this point, the waveform number mask circuit 72 is in a data transparent state. Therefore, the data F0 and B0 stored in the latch circuits 66 and 68 are supplied to the adder 52, and the accumulated value Y=F0+B0+CY is calculated. In addition,
In this calculation of the lowest data, since CY=0, the output of the adder 52 becomes Y=F0+B0. Simultaneously with the completion of this operation, a write pulse is supplied from the timing and control circuit 62 to the RAM 50, and at the same time, the 3-state buffer 74 opens and the adder 50
The calculation data Y=F0+B0 of 2 is stored in the B0 write area of the sound port shown in FIG. 5A in the RAM, that is, in the accumulation memory 46. In this way, first, the accumulated value of the lowest side
B0 is updated to the new cumulative value and stored. At this time, if a carry occurs due to the operation of F0 + B0, "1" is sent, and if no carry occurs, "0" is sent from the Co terminal of the adder 52 as a carry signal CY, as shown by the arrow. It is held in a leaf flip-flop 64. (Second step) After completing this series of operations, the next step is
The computation of F1 and B1, that is, the computation of the second step is started. This operation, similar to the operation in the first step, reads F1 and B1 from the sound port shown in FIG. Because the carry flip-flop is connected to the CI input terminal of adder 52 through multiplexer 76, the carry signal held in the carry flip-flop in the first step
Perform calculations that take CY into account, and calculate calculation data Y=
F1+B1+CY as sound port data B1
In the storage area, i.e. the cumulative memory 46,
Write and store as new data. Also,
At the same time, the contents of the carry flip-flop 64 are also updated. (Third Step) When the second step is completed, the calculation of the third step is started as shown in FIG. This calculation is as shown by the arrows and
The process begins by reading and latching data F2 and S into latch circuit 66 from the sound port shown in FIG. At this time, the waveform number mask circuit 72 adds "0" as bit 5 to the lower 4 bits corresponding to F2 stored in the latch circuit 66, expands the data F2 to 5 bits, and sends the data to the adder 5.
Supply to 2. In this way, the adder 52 receives the data supplied from the latch circuits 66 and 68.
Accumulate F2 and B2, and as shown by the arrow,
The cumulative value Y = F2 + B2 + CY is calculated in the same way as above.
B2 storage area of the sound port shown in FIG. 5A in the RAM 50, that is, the cumulative memory 46
It is written and stored as new data in the memory. At this time, the carry flip-flop 64 is not updated in the calculation of the third step, but since the carry flip-flop 64 still holds CY in the second step, it is used as an arbitrary value for the next sampling operation. Cleared first. (Fourth Step) When the accumulation operation consisting of the first to third steps is completed, the waveform data stored in the waveform memory 40 is next read out as shown in FIG. That is, at the end of the third step, the adder 52 outputs the output value data (Y=F2+B2+CY), and at the same time, the waveform number S is output from the latch circuit 66 as shown by the arrow. The signal is output and supplied to the waveform memory 40 as a sampling address. When the output data Y and the waveform number S are supplied to the waveform memory in this manner, the waveform data stored in the waveform memory 40 is outputted to the waveform latch 54 as shown by the arrow. In addition, in conjunction with the sampling read operation of a series of waveform data, RAM5
From the sound port shown in Figure 5A of 0,
Gain G0 is read out and the read data is supplied to waveform latch 54 as indicated by the arrow. In this way, the waveform latch 54
The latched waveform data and the gain G0 are multiplied in the DA converter 56 having a multiplication function, and are simultaneously converted into analog signals and output until the waveform reading of the next sampling operation is started. Then, by repeating the sampling operation consisting of the first to fourth steps a number of times given by the above equation (1), one cycle of the arbitrary periodic waveform selected by the waveform number S is read out and output. Ru. As described above, in the circuit of the embodiment, by repeating the series of operations of the first to fourth steps described above for each channel, the periodic waveform stored in the waveform memory 50 can be read out at a desired readout period and gain. It can be read and output using G0. In addition, when obtaining a stereo effect, the waveform latch 54 and the DA converter 56 are connected to one another.
Prepare the 5th set in RAM50 in the same way as above.
By reading out the gain G1 from the sound port shown in FIG. A, it is also possible to read out a predetermined periodic waveform whose amplitude is determined by this gain G1. Further, in the circuit of the embodiment, each time the series of sampling operations of the first to fourth steps described above are completed, the data N read out from the sound port shown in FIG. The data N thus read into the flip-flop 60 determines whether the operation of the next channel is a periodic waveform generation operation or a noise waveform generation operation as described below. In this way, the circuit of the embodiment can output any periodic waveform shown in FIGS. 13 and 14, for example, at a desired period. The above is the periodic waveform generation operation in the circuit of this embodiment.Next, the noise waveform generation operation performed using the circuit of this embodiment will be explained. (C-2) Noise waveform generation operation In the circuit of the embodiment, the noise waveform generation operation is started by setting the output of the random number mode detection flip-flop 60 to 1,
In this way, the output of flip-flop 60 is
1, the timing and control circuit 62 controls the entire circuit to operate for noise waveform generation. When the noise waveform generation operation is started in this way, the circuit of the embodiment first operates as a shift pulse generation section for outputting the shift permission signal P as a first step, and then as a second step.
In the third step, it operates as a random number generator that generates random numbers based on the output shift permission signal P, and in the fourth step, it operates to generate a noise signal based on the generated random numbers. Each of these operations will be explained in step order below. (First step) At the same time as the noise waveform generation operation starts, the circuit of the embodiment, as shown in FIG.
It operates as a shift pulse generator 20. That is, the circuit of the embodiment clears the carry flip-flop 64 as shown by the arrow at the same time as the start of operation, and clears the carry flip-flop 64 as shown in FIG. 5B of the RAM 50.
Start reading the data from the random number generation sound port shown in . To read this data, as shown by the arrows and, the frequency data F and accumulated data B are read out from the memories 24 and 26 of the sound port shown in FIG. 68
Latch inside. The data F and B thus latched in the latch circuits 66 and 68 are accumulated in the adder 52 and output as the value Y=F+B. The value Y=F+B obtained in this way is stored as new accumulated value data B in the storage area of accumulated value data B shown in Sound Port FIG. 5B, as shown by the arrow.
That is, it is written and stored in the accumulation memory 26. This write operation is performed as follows. First, if the added value of the adder 52 overflows as a result of performing the arithmetic operation on data F and B, the value added by the adder 52 overflows as shown by the arrow.
A carry signal is supplied from the terminal of CO to the random number carry flip-flop 76, and as a result, the random number carry flip-flop 76 sends a shift permission signal P (third In figure B, adder 2
8) is output. Next, the timing and control circuit 62
A write pulse WP is output to the RAM 50, and the cumulative value data is updated. Hereinafter, the second and subsequent steps will be explained assuming that the shift permission signal P has been output. (Second Step) When the shift permission signal P is output from the random number carry flip-flop 76 in this way, the timing and control circuit 62
As shown in Figure 0, the entire circuit is controlled as a random number generator. In this way, when the circuit of the embodiment is controlled as a random number generator, the random number memory 3 is used in the random number generation sound port shown in FIG.
The lower random number SR0 is read out from the memory area functioning as 4 and latched into the latch circuit 68. At this time, the multiplexer 70 selects the latch circuit 68 side, and therefore, the data B0 latched in the latch circuit 68 is supplied to both input terminals of the adder 52, as shown by the arrow. . At the same time as this operation, the multiplexer 71 switches to the feedback value memory 78 side, and the feedback value read from the feedback value memory 78 is input to the carry input terminal CI of the adder 52, as shown by the arrow. The feedback value memory 78 is an addressable memory with a capacity equal to the number of channels, and in this embodiment (1 bit).
It is configured with ×16 RAM. The feedback value written and stored in the feedback value memory 78 is serial data input via the feedback circuit 12 during the previous random number generation operation. As a result, from the adder 52, Y=2×
The value of SR0+ (feedback value) is output, and this value
The data is written and stored as new data in the SR0 data area (random value memory 34) shown in FIG. 5B of the RAM 50. Simultaneously with writing such data, the 8-bit adder 52 supplies a carry signal CY=1 from the CO terminal to the carry flip-flop 64 as indicated by the arrow. In this way, when the update of the lower data SR0 is completed, the update of the upper data SR1 is started next. This operation is performed as shown in FIG. (Third Step) First, from the random number generation sound port shown in FIG. Data S representing the waveform number is read out from the sound port and latched into the latch circuit 66. When this latch operation is completed, since the multiplexer 70 has selected the latch circuit 68 side, the data SR1 latched in the latch circuit 68 is transferred to the adder 5 as shown by the arrow.
At the same time, the carry signal CY, which was supplied to both input terminals of 2 and held in the carry flip-flop 64 via the multiplexer 71 as shown by the arrow, is applied to the carry input terminal CI.
is supplied to As a result, the adder 52 outputs the value Y=2×SR1+CY including this carry signal CY, and as shown by the arrow, the SR1 data storage area (random value memory 34) as new data. In this way, new random numbers are written and stored in the sound port random number storage SR0 and SR1 memory areas (random value memory 34) shown in FIG. 5B. Further, addition data Y=2× from the adder 52
When SR1+CY is output, the feedback circuit 12
The feedback value for the next random number generation operation is written and stored in the feedback value memory 78 as shown by the arrow. (Fourth step) When a new random number is written and stored in the sound port shown in FIG. 5B in this way, the circuit of the embodiment then functions as a circuit for generating noise waveforms as shown in FIG. do. That is, at the end of the third step, S representing the waveform number is latched in the latch circuit 66, and the waveform number S is latched in the latch circuit 66.
is supplied to the waveform memory 40 as indicated by the arrow. At the same time, the adder 52 outputs the calculation result Y=2×SR1+CY of the third step, and the lower 5 bits of this output are used as a sampling address signal to determine the sampling position of the waveform data as shown by the arrow in the waveform memory. 40. As a result, waveform data is read from the waveform memory 40 and latched into the waveform latch 54 as indicated by the arrow. Simultaneously with reading out such waveform data, in the circuit of the embodiment, data G0 defining the amplitude is read out from the sound port as indicated by the arrow and latched into the waveform latch 54. When the waveform data and gain are latched in the waveform latch in this way, the value is transferred to the DA converter 56 as shown by the arrow.
The data are multiplied by each data and simultaneously output as an analog random number waveform signal. In this manner, the circuit of the embodiment outputs the waveform data of the selected waveform as a randomly sampled read noise waveform signal based on the generated random number. In addition, in the circuit of the embodiment, by further providing a pair of waveform latch 54 and DA converter 56, the gain G1 of the sound port can be read out as shown in FIG. 5B.
It is also possible to output a noise waveform based on G1. After the noise signal outputs a waveform, data N is read out from the sound port shown in FIG. 5B as indicated by the arrow, and determines the operation of the next channel. By repeating the sampling readout of the predetermined random waveform data consisting of the first to fourth steps as many times as given by the above equation (1), the waveform data of the periodic waveform selected by the waveform number S is obtained. is output for one period as a noise waveform. Next, an example of a noise waveform of an arbitrary channel obtained using the circuit of the embodiment will be explained. First, it is assumed that the sound port shown in FIG. 5B of an arbitrary channel has the contents shown in FIG. 5C at the start of the sampling operation.
In this case, the frequency data F is decimal number F=77
Therefore, the carry of accumulated data B occurs 77 times out of 256 times (cycles) of updating data B. At this time, the sampling frequency F is f=93.75 F=7218.75 [Hz] according to equation (4) described later. Table 3 shows calculation data for each step during the noise waveform generation operation of this embodiment, and the sampling process of this embodiment will be discussed in detail based on this calculation data. Here, as is clear from Fig. 5C, the waveform number is S = 0110 (binary number) = 6
(hexadecimal number), and the waveform number S=
If each waveform data of the waveform selected by 6 (hexadecimal number) is expressed in correspondence with its physical address 0C0 to 0CF, the waveform data of this area will be as shown in Table 4. First, as described in detail in the first step, the circuit of the embodiment is connected to the shift pulse generator 2.
When operating as 0, the value of accumulated data B is updated by F=01001101 (binary number) as shown below.

【表】【table】

【表】 このように実施例の回路がシフトパルス発
生部20として累算データBの更新動作を行
うと、加算器32(第1図においては加算器
28)が2サイクル目、6サイクル目、12サ
イクル目…にオーバーフローしてシフト許可
信号P=1を出力し、3サイクルまたは4サ
イクルに1回の割合で回路を乱数発生部22
として機能させる。 表3において、SH欄は回路が乱数発生部
22として機能するサイクルを表している。
この表3からも明らかなように、実施例の回
路はN2、N6、N9、NC…サイクルにおいて
乱数発生部として機能する。 このようにして回路は乱数発生部22とし
て機能すると、前記第2ステツプにおいて詳
述したように、帰還値メモリ78から帰還値
が読み出され、加算器52(第1図に示す回
路においては加算器36)のキヤリー入力端
子CIに入力される。この帰還値は前回の乱
数発生時にておいて次の論理式に基づき設定
されており、 [帰還値]=([ビツト15][ビツト13])([ビ
ツト12][ビツト10]) (但しABはAとBとのエクスクルーシブ
オアを表す。) 実施例において、例えば1回目の乱数発生
時にその帰還値は(01)(01)=
1となり、2回目の乱数発生時にその帰還値
は (10)(00)=0となる。 表3の帰還値の欄にはこのようにして得ら
れる帰還値の値が示されている。 実施例の回路は、前記第2ステツプ、第3
ステツプにおいて詳述したように、乱数発生
部22として機能するたびに前記帰還値を用
いて次に示すような乱数を出力し、乱数値メ
モリ34、すなわち第5図Bに示すサウンド
ポートのSR1、SR2メモリエリア内の乱数を
順次更新していく。
[Table] When the circuit of the embodiment performs the update operation of accumulated data B as the shift pulse generator 20, the adder 32 (adder 28 in FIG. 1) is activated in the second cycle, sixth cycle, In the 12th cycle, it overflows and outputs the shift permission signal P=1, and the random number generator 22 outputs the shift permission signal P=1, and the circuit is activated once every 3 or 4 cycles.
function as In Table 3, the SH column represents the cycle in which the circuit functions as the random number generator 22.
As is clear from Table 3, the circuit of the embodiment functions as a random number generator in cycles N2, N6, N9, NC... When the circuit functions as the random number generator 22 in this way, the feedback value is read out from the feedback value memory 78 as described in detail in the second step, and the adder 52 (in the circuit shown in FIG. It is input to the carry input terminal CI of the device 36). This feedback value was set based on the following logical formula when the random number was generated last time, and [Feedback value] = ([Bit 15] [Bit 13]) ([Bit 12] [Bit 10]) (However, AB represents the exclusive OR of A and B.) In the embodiment, for example, when a random number is generated for the first time, the feedback value is (01) (01) =
1, and when the second random number is generated, its feedback value becomes (10)(00)=0. The feedback value column of Table 3 shows the feedback values obtained in this way. The circuit of the embodiment includes the second step and the third step.
As described in detail in the step, each time it functions as the random number generator 22, the feedback value is used to output a random number as shown below, and the random number memory 34, that is, the SR1 of the sound port shown in FIG. 5B, The random numbers in the SR2 memory area are updated sequentially.

【表】 表3の乱数欄にはこのようにして更新され
た乱数が示されている。 実施例の回路は、このようにして乱数が出
力される度に、前記第4ステツプにおいて詳
述したように、更新された乱数のビツト8〜
ビツト12の5ビツトを波形メモリ40の波形
データサンプリングアドレスとし用いる。 このようにして出力されるサンプリングア
ドレスを16進数で乱数更新回数1回目から列
記すると次のようになる。 0B、16、0D、1B、16、0D、1A、14 09、12、04、04、12、05、0B、17 ここにおいて、第5図Cに示すサウンドポ
ートによつて指定される波形ナンバーはS=
0110(2進数)=6(16進数)であり、従つて、
波形メモリ40に入力されるアドレスは該波
形ナンバーSを考慮すると前記数列に対応し
て次に示す9ビツトの値となる。 0CB、0D6、0CD、0DB、0D6、0CD、
0DA、0D4 0C9、0D2、0C4、0D9、0D2、0C5、0CB、
0D7 このようにして示されたアドレスは、図示
した周期波形発生時のアドレスと異なりラン
ダムなアドレスであるため、表4に示す波形
ナンバーS=6により選択される波形データ
は、該アドレスによりランダムに読み出され
る。 表5には実施例においてこのようにランダ
ムに読み出される波形データが示されてお
り、この値をゲインG0=1010Aと乗算する
ことにより、表5の波形ラツチ出力の欄に示
す雑音波形データをサンプリング出力するこ
とができる。 第15図にはこのようにしてサンプリング
出力された雑音波形が示されており、同図か
らも明らかなように、実施例の回路によれ
ば、波形ナンバーSにより選択された波形の
波形データをランダムにサンプリング読み出
しすることにより、所望の雑音波形を出力す
ることが可能となる。 なお、本実施例においては、回路を乱数発
生部として動作させる際に帰還値メモリ78
を用いた場合を例にとり説明したが、本発明
はこれに限らず、このような帰還値メモリ7
8を用いることなく帰還回路12の出力をそ
のまま加算器12に入力することも可能とな
る。 以上説明したように、本実施例の回路によ
れば、周期波形発生回路と雑音波形発生回路
とを組合せた場合に、その回路主要部、例え
ば加算器52、波形メモリ40を共用するこ
とができ、その結果回路全体の集積度を高め
低コスト化を図ることが可能となる。 (C‐3) データの検討 次に実施例の回路を周期波形発生回路及び
雑音波形発生回路として用いた場合の具体的
なデータについて検討する。 (a) 周期波形の周波数 まず、実施例の回路により得られる周期
波形の具体的な読み出し周波数fを検討す
る。 (チヤンネルのサンプリング周期) 実施例の回路は、RAM50内のデータ
をCPUバスサイクルfBCに同期して時分割
アクセスしており、前述したように1つの
チヤンネルの1回当りのサンプリング期間
はCPUバスサイクルの4周期分に当るた
め、チヤンネル1個当りのサンプリング期
間は4/fBCとなる。 実施例において、前述したようにチヤン
ネルは16個あるため、各チヤンネルのサン
プリング周期は16×(4/fBC)となる。 (1波形当りのサンプリング回数) また、1波形を読み出すために行われる
サンプリング動作の回数を検討すると、累
算メモリ46は21ビツトであり、その累算
データBはサンプリングが行われる度にF
ずつ増加するため、波形メモリ46内の累
算値Bがオーバーフローを生じてから次の
オーバーフローを生ずるまでの間、すなわ
ち、一波形の読みだしが行われる間に行わ
れるサンプリング回数Nは221/Fとなる。 (出力波形の周期) 従つて、前記サンプリング周期とサンプ
リングの累算回数とを乗算することによ
り、出力波形の周期1/fが次のように求
まり、 1/f=16×4/fBC×221/F 該出力波形の周波数fは f=fBC・F/16×4×221 ……(3) となる。 本実施例において、CPUバスサイクル
周波数fBCはfBC=1.536MHzであるため出力
波形の周波数は f≒0.011444・F(Hz) となる。 従つて、f=440(Hz)の出力波形を得た
い場合には、第5図Aに示すサウンドポー
ト内にF=38448の周波数データを設定す
ればよい。 (b) 雑音波形のサンプリング周波数 次に、前記周期波形の周波数の場合と同
一の条件で行なわれる雑音波形のサンプリ
ング周波数fについて検討する。 乱数のサンプリング出力は、8ビツトの
累算メモリ26がオーバーフローする度に
行われるため、そのサンプリング周波数は
前記第(3)式と同様にして次式で求められ
る。 f=fBC・F/16×4×28=2-14・fBC・F
=93.75・F[Hz]……(4) 従つて、3[KHz]のサンプリング周波
数を得るためには、第5図Bに示すサウン
ドポート内にF=32の周波数データを設定
すればよい。 次に、各チヤンネルの乱数発生周期
TRNDについて検討すると、TRNDは、サン
プリング周期1/fの216−1=65535倍と
なり、次式で与えられる。 TRND=216−1/f=214×(216−1)/f
BC・F=699.04/F[秒]……(5) 従つて、F=32とすると、TRND=21.845
[秒]となることが理解される。 [発明の効果] 以上説明したように、本発明によれば、時分割
の手法を用いることにより、回路の部品点数を減
少させ、この結果回路全体の集積度を高めかつ低
コストの乱数発生回路を提供することが可能とな
る。
[Table] The random number column of Table 3 shows the random numbers updated in this way. Each time a random number is output in this way, the circuit of the embodiment updates bits 8 to 8 of the updated random number as detailed in the fourth step.
The 5 bits of bit 12 are used as the waveform data sampling address of the waveform memory 40. The sampling addresses output in this way are listed in hexadecimal numbers starting from the first random number update count as follows. 0B, 16, 0D, 1B, 16, 0D, 1A, 14 09, 12, 04, 04, 12, 05, 0B, 17 Here, the waveform number specified by the sound port shown in Figure 5C is S=
0110 (binary) = 6 (hexadecimal), therefore,
Considering the waveform number S, the address input to the waveform memory 40 will be the following 9-bit value corresponding to the above numerical sequence. 0CB, 0D6, 0CD, 0DB, 0D6, 0CD,
0DA, 0D4 0C9, 0D2, 0C4, 0D9, 0D2, 0C5, 0CB,
0D7 The address shown in this way is a random address, unlike the address at the time of generation of the periodic waveform shown in the figure, so the waveform data selected by the waveform number S=6 shown in Table 4 is randomly selected by the address. Read out. Table 5 shows the waveform data that is randomly read in this example, and by multiplying this value by the gain G0 = 1010A, the noise waveform data shown in the waveform latch output column of Table 5 is sampled. It can be output. FIG. 15 shows the noise waveform sampled and output in this way, and as is clear from the figure, according to the circuit of the embodiment, the waveform data of the waveform selected by the waveform number S is By randomly sampling and reading, it becomes possible to output a desired noise waveform. In this embodiment, the feedback value memory 78 is used when operating the circuit as a random number generator.
Although the present invention is not limited to this example, the present invention is not limited to this, and the present invention is not limited to this.
It is also possible to directly input the output of the feedback circuit 12 to the adder 12 without using the adder 8. As explained above, according to the circuit of this embodiment, when the periodic waveform generation circuit and the noise waveform generation circuit are combined, the main parts of the circuit, such as the adder 52 and the waveform memory 40, can be shared. As a result, it is possible to increase the degree of integration of the entire circuit and reduce costs. (C-3) Examination of data Next, we will examine specific data when the circuit of the embodiment is used as a periodic waveform generation circuit and a noise waveform generation circuit. (a) Frequency of periodic waveform First, the specific readout frequency f of the periodic waveform obtained by the circuit of the embodiment will be considered. (Sampling period of channel) The circuit of the embodiment performs time-division access to the data in the RAM 50 in synchronization with the CPU bus cycle f BC , and as mentioned above, the sampling period of one channel is equal to the CPU bus cycle. Since this corresponds to four periods of the cycle, the sampling period per channel is 4/f BC . In the embodiment, as described above, there are 16 channels, so the sampling period of each channel is 16×(4/f BC ). (Number of samplings per waveform) Also, considering the number of sampling operations performed to read out one waveform, the cumulative memory 46 is 21 bits, and the cumulative data B is stored in F every time sampling is performed.
Since the accumulated value B in the waveform memory 46 overflows until the next overflow occurs, that is, the number of samplings N performed while reading one waveform is 2 21 / It becomes F. (Period of output waveform) Therefore, by multiplying the sampling period by the cumulative number of samplings, the period 1/f of the output waveform can be found as follows: 1/f=16×4/f BC × 2 21 /F The frequency f of the output waveform is f=f BC・F/16×4×2 21 ……(3). In this embodiment, since the CPU bus cycle frequency f BC is f BC =1.536MHz, the frequency of the output waveform is f≒0.011444·F (Hz). Therefore, if it is desired to obtain an output waveform of f=440 (Hz), frequency data of F=38448 may be set in the sound port shown in FIG. 5A. (b) Sampling frequency of noise waveform Next, the sampling frequency f of the noise waveform performed under the same conditions as the frequency of the periodic waveform will be considered. Since the random number sampling is performed every time the 8-bit accumulation memory 26 overflows, the sampling frequency is determined by the following equation in the same way as equation (3) above. f=f BC・F/16×4×2 8 =2 -14・f BC・F
=93.75·F [Hz] (4) Therefore, in order to obtain a sampling frequency of 3 [KHz], it is sufficient to set frequency data of F=32 in the sound port shown in FIG. 5B. Next, the random number generation period for each channel
Considering T RND , T RND is 2 16 −1=65535 times the sampling period 1/f, and is given by the following equation. T RND = 2 16 -1/f = 2 14 × (2 16 -1)/f
BC・F=699.04/F [seconds]……(5) Therefore, if F=32, T RND =21.845
It is understood that this is [seconds]. [Effects of the Invention] As explained above, according to the present invention, by using a time-sharing method, the number of parts in the circuit is reduced, and as a result, the degree of integration of the entire circuit is increased, and a low-cost random number generation circuit is provided. It becomes possible to provide

【表】【table】

【表】【table】

【表】【table】

【表】【table】

【表】【table】

【表】【table】

【表】【table】

【表】【table】

【表】【table】

【表】【table】 【図面の簡単な説明】[Brief explanation of drawings]

第1図は本発明に用いられる乱数発生回路の原
理説明図、第2図は従来の乱数発生回路の説明
図、第3図Aは周期波形発生回路の原理図、第3
図Bは雑音波形発生回路の原理図、第4図は本発
明の好適な実施例を示すブロツク図、第5図は第
4図に示すRAM内に記憶された周期波形発生用
サウンドポート及び乱数発生用サウンドポートの
説明図、第6図〜第8図は第4図に示す回路を周
期波形発生回路として動作する場合の説明図、第
9図〜第12図は第4図に示す回路を雑音波形発
生回路として動作する場合の説明図、第13図、
第14図は周期波形発生回路を用いて形成された
周期波形図、第15図は雑音波形発生回路を用い
て形成された雑音波形図である。 12……帰還回路、20……シフトパルス出力
部、22……乱数発生部、32……シフト回路、
40……波形メモリ。
FIG. 1 is an explanatory diagram of the principle of a random number generation circuit used in the present invention, FIG. 2 is an explanatory diagram of a conventional random number generation circuit, FIG. 3A is a diagram of the principle of a periodic waveform generation circuit,
Figure B is a principle diagram of a noise waveform generation circuit, Figure 4 is a block diagram showing a preferred embodiment of the present invention, and Figure 5 is a periodic waveform generation sound port and random numbers stored in the RAM shown in Figure 4. 6 to 8 are explanatory diagrams of the circuit shown in FIG. 4 operating as a periodic waveform generation circuit, and FIGS. 9 to 12 are diagrams showing the circuit shown in FIG. 4. An explanatory diagram when operating as a noise waveform generation circuit, Fig. 13,
FIG. 14 is a periodic waveform diagram formed using a periodic waveform generation circuit, and FIG. 15 is a noise waveform diagram formed using a noise waveform generation circuit. 12... Feedback circuit, 20... Shift pulse output section, 22... Random number generation section, 32... Shift circuit,
40...Waveform memory.

Claims (1)

【特許請求の範囲】 1 累算値を記憶する累算メモリと、前記累算値
と外部入力される周波数データとを加算しこの加
算値を新たな累算値として前記累算メモリに書込
み記憶させるための第1加算器と、を含み、前記
第1加算器の累算値がオーバーフローした際発生
する桁上げ信号に基づきシフトパルスを出力する
シフトパルス出力部と、 乱数値メモリ及び第2加算器から成り前記シフ
トパルスが入力される度に第2加算器を用いて乱
数値メモリ内容を倍数加算して更新しシフトレジ
スタとして機能するシフト回路と、前記乱数値メ
モリの出力に基づき前記第2加算器のキヤリー入
力端子に帰還信号をフイードバツク入力する帰還
回路と、を含み、前記乱数値メモリ内に所定の乱
数を発生させる乱数発生部と、 を有し、前記第1加算器及び第2加算器は、同一
の加算器を時分割して共用することを特徴とする
乱数発生回路。 2 特許請求の範囲1記載の回路において、 累算メモリ及び乱数値メモリは同一メモリの異
なる番地内に形成されることを特徴とする乱数発
生回路。 3 特許請求の範囲1、2のいずれかに記載の回
路において、 シフトパルス出力部は、所定のタイミング信号
を発生するタイミング発生回路を含み、そのタイ
ミング信号と、前記第1加算器の出力する桁上げ
信号とのアンド出力をシフトパルスとして出力す
ることを特徴とする乱数発生回路。
[Scope of Claims] 1. An accumulation memory that stores an accumulated value; the accumulated value and externally inputted frequency data are added together, and this added value is written and stored in the accumulated value as a new accumulated value. a shift pulse output section that outputs a shift pulse based on a carry signal generated when the cumulative value of the first adder overflows; a random value memory and a second addition; a shift circuit which functions as a shift register by adding a multiple of the contents of the random value memory using a second adder to update the contents of the random value memory every time the shift pulse is input; a feedback circuit that feeds back a feedback signal to a carry input terminal of the adder, and a random number generating section that generates a predetermined random number in the random number memory, the first adder and the second adder. The random number generation circuit is characterized in that the same adder is shared in time division. 2. The random number generation circuit according to claim 1, wherein the accumulation memory and the random number memory are formed in different addresses of the same memory. 3. In the circuit according to claim 1 or 2, the shift pulse output section includes a timing generation circuit that generates a predetermined timing signal, and the timing signal and the digit output from the first adder. A random number generation circuit characterized by outputting an AND output with a rising signal as a shift pulse.
JP59167629A 1984-08-09 1984-08-09 Random number generating circuit Granted JPS6145331A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP59167629A JPS6145331A (en) 1984-08-09 1984-08-09 Random number generating circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP59167629A JPS6145331A (en) 1984-08-09 1984-08-09 Random number generating circuit

Publications (2)

Publication Number Publication Date
JPS6145331A JPS6145331A (en) 1986-03-05
JPH0241765B2 true JPH0241765B2 (en) 1990-09-19

Family

ID=15853326

Family Applications (1)

Application Number Title Priority Date Filing Date
JP59167629A Granted JPS6145331A (en) 1984-08-09 1984-08-09 Random number generating circuit

Country Status (1)

Country Link
JP (1) JPS6145331A (en)

Also Published As

Publication number Publication date
JPS6145331A (en) 1986-03-05

Similar Documents

Publication Publication Date Title
US4246823A (en) Waveshape generator for electronic musical instruments
JPS6223319B2 (en)
JPS5919352B2 (en) electronic musical instruments
JPS634197B2 (en)
GB2102613A (en) Reverberation tone generating apparatus
US5254805A (en) Electronic musical instrument capable of adding musical effect to musical tones
JPH0241765B2 (en)
JP2643553B2 (en) Music signal processor
JPH0546959B2 (en)
JPS5858678B2 (en) electronic musical instruments
KR100236786B1 (en) Sound source
JPH0210556Y2 (en)
JPS5834840B2 (en) Volume envelope setting method for electronic musical instruments
JPH0121515B2 (en)
JPS61196297A (en) Musical sound generator
JPH026073B2 (en)
JP2591160B2 (en) Waveform selection and synthesis device
JP2972926B2 (en) Modulation circuit and sound generator
JPH0431112B2 (en)
JPH0157359B2 (en)
JP2510090Y2 (en) Music signal generator
JPS6037480B2 (en) performance control system
JP2595998B2 (en) Electronic musical instrument
JPS6238715B2 (en)
JP2970372B2 (en) Sound source parameter supply device

Legal Events

Date Code Title Description
EXPY Cancellation because of completion of term