集成电路技术分享

 找回密码
 我要注册

QQ登录

只需一步,快速开始

搜索
12
返回列表 发新帖
楼主: VVC

在verilog的变量定义的时候是否就可以直接赋初值?

[复制链接]
longtim 发表于 2010-6-26 12:10:43 | 显示全部楼层
output 有可能是reg型的,也不能用assign赋值<br>
应该放always里
CHANG 发表于 2010-6-26 12:52:30 | 显示全部楼层
原帖由 &lt;i&gt;guoerhui&lt;/i&gt; 于 2007-6-28 19:56 发表 &lt;a href="http://www.edacn.net/bbs/redirect.php?goto=findpost&amp;pid=780896&amp;ptid=88242" target="_blank"&gt;&lt;img src="http://www.edacn.net/bbs/images/common/back.gif" border="0" onload="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www.edacn.net/bbs/images/common/back.gif');}" onmousewheel="return imgzoom(this);" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;<br>
<br>
&lt;br /&gt;<br>
Verilog-2000是可以这样写的 &lt;br /&gt;<br>
是么?<br>
就算是,最好也别这么写。为什么强调代码风格,就是为了方便阅读,方便维护,方便交接。定义了reg类型的信号统一在always里面赋值。
VVIC 发表于 2010-6-26 13:32:01 | 显示全部楼层
好東西<br>
直得推薦
Sunlife 发表于 2015-6-25 09:51:12 | 显示全部楼层
Verilog-2000是可以这样写的
您需要登录后才可以回帖 登录 | 我要注册

本版积分规则

关闭

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

QQ|小黑屋|手机版|Archiver|fpga论坛|fpga设计论坛 ( 京ICP备20003123号-1 )

GMT+8, 2025-5-6 17:43 , Processed in 0.056444 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表