f********o 发帖数: 2181 | 1 硬件实现
uniform distribution就可以
用LSFR产生的好像都是[0,2^N-1]的数
如果我要在[0,10]里面随机产生数字
除了用LSFR出来的数字再乘个系数, 还有其他方法么?
谢谢~~~ |
D*******a 发帖数: 3688 | 2 mod
accept/reject
【在 f********o 的大作中提到】 : 硬件实现 : uniform distribution就可以 : 用LSFR产生的好像都是[0,2^N-1]的数 : 如果我要在[0,10]里面随机产生数字 : 除了用LSFR出来的数字再乘个系数, 还有其他方法么? : 谢谢~~~
|
f********o 发帖数: 2181 | 3 Thanks for the suggestion
but I need to get the digit every cycle....
【在 D*******a 的大作中提到】 : mod : accept/reject
|
z*****n 发帖数: 7639 | 4 You cannot get digit every cycle, every cycle produces
ONLY one bit.
Accept/reject is better if wordlength is short. Say if
you need digits 0-9(or 1-10), you can run 4 cycles and
get a 4-bit random number. Then accept only the ones
you are interested.
【在 f********o 的大作中提到】 : Thanks for the suggestion : but I need to get the digit every cycle....
|
f********o 发帖数: 2181 | 5 多谢
linear feedback shift register应该是可以每个cycle输出一个N-bit的数字的
不过这个数列会重复
另外不知道有没有其他方法能产生真正的随机数
这样的话多个clock cycle出一个数字也可以
【在 z*****n 的大作中提到】 : You cannot get digit every cycle, every cycle produces : ONLY one bit. : Accept/reject is better if wordlength is short. Say if : you need digits 0-9(or 1-10), you can run 4 cycles and : get a 4-bit random number. Then accept only the ones : you are interested.
|
z*****n 发帖数: 7639 | 6 all random-number generators are pseudo, unless
you have external random events.
【在 f********o 的大作中提到】 : 多谢 : linear feedback shift register应该是可以每个cycle输出一个N-bit的数字的 : 不过这个数列会重复 : 另外不知道有没有其他方法能产生真正的随机数 : 这样的话多个clock cycle出一个数字也可以
|
D*******a 发帖数: 3688 | 7 取mod可不可以做成固定cycle的运算?感觉是可以的
【在 z*****n 的大作中提到】 : You cannot get digit every cycle, every cycle produces : ONLY one bit. : Accept/reject is better if wordlength is short. Say if : you need digits 0-9(or 1-10), you can run 4 cycles and : get a 4-bit random number. Then accept only the ones : you are interested.
|
h*******o 发帖数: 778 | 8 in fact one colleague in my group is designing a hardware random generator
for generating Guassian noise. You can google there are some paper
describing
using a complicate square/cosine functions to generate random number which
has avery very large reapting cycle...
【在 f********o 的大作中提到】 : 硬件实现 : uniform distribution就可以 : 用LSFR产生的好像都是[0,2^N-1]的数 : 如果我要在[0,10]里面随机产生数字 : 除了用LSFR出来的数字再乘个系数, 还有其他方法么? : 谢谢~~~
|
f********o 发帖数: 2181 | 9 谢谢建议
也多谢楼上几位
最后我还是把其他电路部分改了, take random numbers between [0, 2^N-1]
因为用乘系数得到的数分布也不够均匀...
【在 h*******o 的大作中提到】 : in fact one colleague in my group is designing a hardware random generator : for generating Guassian noise. You can google there are some paper : describing : using a complicate square/cosine functions to generate random number which : has avery very large reapting cycle...
|