在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 11686|回复: 7

[求助] Verilog-A中rdist_normal(seed,0,1) 函数中Seed值如何确定!!!

[复制链接]
发表于 2012-3-27 10:28:15 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
//
// Fixed frequency oscillator with white accumulating jitter.
//
// Accumulating jitter is the jitter associated with a free-running oscillator.
//

module osc2 (out);

output out; voltage out;                        // output signal
parameter real freq=1 from (0:inf);                // output frequency
parameter real vl=-1;                                // high output voltage
parameter real vh=1;                                // low output voltage
parameter real tt=0.01/freq from (0:inf);        // transition time of output
parameter real jitter=0 from [0:0.1/freq);        // white period jitter
integer n, seed;
real next, dT;

analog begin
    @(initial_step) begin
        seed = 286;
        next = 0.5/freq + $abstime;
    end
    @(timer(next)) begin
        n = !n;
        dT = jitter*$rdist_normal(seed,0,1);
        next = next + 0.5/freq + `M_SQRT1_2*dT;
    end
    V(out) <+ transition(n ? vh : vl, 0, tt);
end
endmodule

这段代码为http://www.designers-guide.org/VerilogAMS/functional-blocks/osc/osc.va中的实例,用来建模VCO抖动的,请问rdist——normal函数中Seed值是如何确定的,为什么这里面是286?
发表于 2012-12-17 16:31:16 | 显示全部楼层
回复 1# weiyanlong


    求指教
谢谢
发表于 2013-1-16 10:01:47 | 显示全部楼层
我是初学者 在尝试写veriloga 但是每次加入随机数 总是报错 请问是什么问题
"module idc_1.2<<--? 2(rand);"
发表于 2016-4-28 11:53:03 | 显示全部楼层
谁有Verilog a 教程,给大家分享一下。谢谢
发表于 2017-3-3 15:16:58 | 显示全部楼层
也想问一下
发表于 2017-3-3 15:47:27 | 显示全部楼层
Normal (Gaussian) Distribution
Use the $rdist_normal function to generate random real numbers (or the $dist_normal
function to generate integer numbers) that are normally distributed. The $rdist_normal
function is not supported in digital contexts.
$rdist_normal ( seed , mean , standard_deviation ) ;
$dist_normal ( seed , mean , standard_deviation ) ;
seed is a scalar integer variable used to initialize the sequence of generated numbers. seed
must be a variable because the function updates the value of seed at each iteration. To
ensure generation of a normal distribution, change the value of seed only when you initialize
the sequence.
mean is an integer or real expression that specifies the value to be approached by the mean
value of the generated numbers.
standard_deviation is an integer or real expression that determines the width of
spread of the generated values around mean. Using a larger standard_deviation
spreads the generated values over a wider range.
To generate a gaussian distribution, use a mean of 0 and a standard_deviation of 1.
For example, the following module returns a series of real numbers that together form a
gaussian distribution.
module distcheck (pinout) ;
electrical pinout ;
integer seed ;
real rrandnum ;
analog begin
@ (initial_step) begin
seed = 23 ;
end
rrandnum = $rdist_normal( seed, 0, 1 ) ;
$display ("Random number is %g", rrandnum ) ;
V(pinout) <+ rrandnum ;
end // of analog block
endmodule
发表于 2018-1-4 14:28:55 | 显示全部楼层
回复 6# 胭脂盗


  nice guy,Mark!
发表于 2020-6-10 20:18:24 | 显示全部楼层


胭脂盗 发表于 2017-3-3 15:47
Normal (Gaussian) Distribution
Use the $rdist_normal function to generate random real numbers (or th ...


Q请问你这个是在哪里看到的啊?是某个软件的帮助文档吗?求教.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /1 下一条

小黑屋| 手机版| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-11-15 19:20 , Processed in 0.063094 second(s), 9 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表