天伤星 发表于 2022-12-11 19:25

关于Verilog波形的一个疑问

<p></p>

<p>请问波形是上面那样的还是下面那样的,怎么才能实现上面那样的</p>

fxyc87 发表于 2022-12-12 08:39

再弄个标志,标志=1后再开始计数,或者复位后初始值为-1

Fred_1977 发表于 2022-12-12 09:12

<p>应该是要从复位之后开始,复位前视认为处于高阻态.</p>

<p> &nbsp;</p>

yungsun 发表于 2022-12-17 17:20

本帖最后由 yungsun 于 2022-12-17 17:26 编辑

<p>assign&nbsp;&nbsp;k=&nbsp; &nbsp;vld ? (i+1) : `d0;</p>

<p>always @(posedge clk or negedge rst_n) begin</p>

<p>&nbsp; &nbsp; if (rst_n == 1&#39;d0) begin</p>

<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i&nbsp;&lt;= &#39;d0;</p>

<p>&nbsp; &nbsp; end</p>

<p>&nbsp; &nbsp; else begin</p>

<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (vld) begin</p>

<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i&nbsp;&lt;= k;</p>

<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end</p>

<p>&nbsp; &nbsp; end</p>

<p>end</p>

<p>&nbsp;</p>

<p>always @(posedge clk or negedge rst_n) begin</p>

<p>&nbsp; &nbsp; if (rst_n == 1&#39;d0) begin</p>

<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; j&nbsp;&lt;= &#39;d0;</p>

<p>&nbsp; &nbsp; end</p>

<p>&nbsp; &nbsp; else begin</p>

<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ( !vld) begin&nbsp; &nbsp; //或者直接打一拍</p>

<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; j&nbsp;&lt;= i;</p>

<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end</p>

<p>&nbsp; &nbsp; end</p>

<p>end</p>

天伤星 发表于 2023-3-16 17:31

fxyc87 发表于 2022-12-12 08:39
再弄个标志,标志=1后再开始计数,或者复位后初始值为-1

<p>明白了,谢谢</p>

fxyc87 发表于 2023-3-17 13:16

天伤星 发表于 2023-3-16 17:31
明白了,谢谢

<p>你这反射弧太长了点吧?</p>

<p>过去一年多了。</p>

天伤星 发表于 2023-3-22 17:50

<div class='shownolgin' data-isdigest='no'>fxyc87 发表于 2023-3-17 13:16
你这反射弧太长了点吧?

过去一年多了。

<p>没这么久,才4个月啊,我不经常登陆,抱歉</p>
</div><script>showreplylogin();</script><script type="text/javascript">(function(d,c){var a=d.createElement("script"),m=d.getElementsByTagName("script"),eewurl="//counter.eeworld.com.cn/pv/count/";a.src=eewurl+c;m.parentNode.insertBefore(a,m)})(document,523)</script>
页: [1]
查看完整版本: 关于Verilog波形的一个疑问