集成电路技术分享

 找回密码
 我要注册

QQ登录

只需一步,快速开始

搜索
123
返回列表 发新帖
楼主: longtime

verilog问题,什麽是过程语句先导的过程块?怎摸改?

[复制链接]
UFO 发表于 2010-6-28 20:10:06 | 显示全部楼层
要放到alwyas块里。呵呵
CTT 发表于 2010-6-28 21:02:35 | 显示全部楼层
设计的同时把实际电路想好了<br>
不但写的代码思路清晰,资源也节俭
usb 发表于 2010-6-28 21:25:31 | 显示全部楼层
推荐写法:<br>
module mux(<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;out,&nbsp; &nbsp;//一项一项分开写<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;a, <br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;b, <br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;select<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; );<br>
<br>
output&nbsp; &nbsp; out; //也分开写,要对齐<br>
input&nbsp; &nbsp;&nbsp; &nbsp; a;<br>
input&nbsp; &nbsp;&nbsp; &nbsp; b;<br>
input&nbsp; &nbsp;&nbsp; &nbsp; select;<br>
<br>
assign out = select ? b : a;<br>
<br>
endmodule <br>
<br>
如果写成always模式,不要加上begin...end,无效代码尽量不要加。不过这也是仁者见仁,智者见智
CHAN 发表于 2010-6-28 21:47:42 | 显示全部楼层
多谢高手的指点!又学习了。
       
CHAN 发表于 2010-6-28 21:56:48 | 显示全部楼层
最好还是用20楼,看起来比较简洁!而且有效1!
CHANG 发表于 2010-6-28 22:37:20 | 显示全部楼层
呵呵&nbsp;&nbsp;大家多帮助 呵呵
lybuct 发表于 2011-10-13 16:30:05 | 显示全部楼层
受教…学习中!!
您需要登录后才可以回帖 登录 | 我要注册

本版积分规则

关闭

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

QQ|小黑屋|手机版|Archiver|集成电路技术分享 ( 京ICP备20003123号-1 )

GMT+8, 2024-4-29 15:56 , Processed in 0.074004 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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