x*l
2 楼
e【 在 ccfantasia (cc-time killer) 的大作中提到: 】
首先,俺是菜鸟。赫赫:)
其次,
如果只是用在测试模块,VHDL不知道,verilog看样子该有。(在最后面)
但是要到fpga里面,呵呵:)
如果对随机性要求不高,建议用移位寄存器搭一个伪随机序列生成器。
如果要求高, 要么自己设计 true random number generator
要么去找 IP core.
3.8.7.系统任务 $random
这个系统函数提供了一个产生随机数的手段。当函数被调用时返回一个32bit的随机数。
它是一个带符号的整形数。
$random一般的用法是:$ramdom % b ,其中 b>0.它给出了一个范围在(-b+1):(b-1)中
的随机数。下面给出一个产生随机数的例子:
reg[23:0] rand;
rand = $random % 60;
上面的例子给出了一个范围在-59到59之间的随机数,下面的例子通过位并接操作产生
一个值在0到59之间的数。
reg[23:0] rand;
rand = {$random} % 60;
首先,俺是菜鸟。赫赫:)
其次,
如果只是用在测试模块,VHDL不知道,verilog看样子该有。(在最后面)
但是要到fpga里面,呵呵:)
如果对随机性要求不高,建议用移位寄存器搭一个伪随机序列生成器。
如果要求高, 要么自己设计 true random number generator
要么去找 IP core.
3.8.7.系统任务 $random
这个系统函数提供了一个产生随机数的手段。当函数被调用时返回一个32bit的随机数。
它是一个带符号的整形数。
$random一般的用法是:$ramdom % b ,其中 b>0.它给出了一个范围在(-b+1):(b-1)中
的随机数。下面给出一个产生随机数的例子:
reg[23:0] rand;
rand = $random % 60;
上面的例子给出了一个范围在-59到59之间的随机数,下面的例子通过位并接操作产生
一个值在0到59之间的数。
reg[23:0] rand;
rand = {$random} % 60;
j*h
3 楼
What you need is a google on "LFSR", linear feedback shift registers, such as
this one:
http://www-math.cudenver.edu/~wcherowi/courses/m5410/m5410fsr.html
This is how the "library functions" generate PN sequences anyway.
To form your own generator, you just need to look up a "primitive polynomial"
from the back of a math book. It is very easy to implement yet the theory
behind it is kind of fascinating.
数
b>0.它给出了一个范围在(-b+1):(b-1)中
生
this one:
http://www-math.cudenver.edu/~wcherowi/courses/m5410/m5410fsr.html
This is how the "library functions" generate PN sequences anyway.
To form your own generator, you just need to look up a "primitive polynomial"
from the back of a math book. It is very easy to implement yet the theory
behind it is kind of fascinating.
数
b>0.它给出了一个范围在(-b+1):(b-1)中
生
相关阅读
skyworks大量招人RF coil impedance matching求助[供求] Junior Quantitative Analyst,AVP (转载)重金求google 内推 硬件有人知道FAIRCHILD这家公司吗?avago买broadcom, 新公司还叫broadcom有同学想审稿吗?现有几篇国际通信联盟的会议稿ITU Kaleidoscope 2015河南郑州大学工业工程专业毕业后容易出国吗?NV要卖掉modem业务Apple HID group面经(Failed)有人知道SCI检索的过程吗?Pay grade of GlobalFoundries' MTS新浪财经:美国工作一两年就能攒20万美元 (转载)以后qcom是印度公司了吧特斯拉真是好天基光学正在起飞Avago & BroadcomCree spin-off Power和RFavago的title是怎么分布的?请推荐笔记本电脑