找回密码
 注册
关于网站域名变更的通知
查看: 385|回复: 1
打印 上一主题 下一主题

verilog 基础语法-端口

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2019-3-8 11:42 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

EDA365欢迎您登录!

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

x
verilog 基础语法-端口
( y3 B. F' d' M
. I. L- P* Q. T1 p' Z* n
1 模块结构
( A- d& ^3 v( h  G/ @3 k# n    端口: module 模块名(端口1, 端口2, 端口3)
5 [  V: \, J. ^$ l! t    内容:
! q+ Y( J& `5 |; E2 e  E1 W* b        I/O说明:8 {0 V. |1 l# Q" U. N: `1 {) S) d
            input 端口名;
0 m$ k# A3 h+ B- \( F            output 端口名;
$ U- ~% G2 i! _% t: I3 E        内部信号:
$ U3 K8 j: h; M4 u. W( c$ n            reg [width-1:0]  r变量1,r变量2;
1 v4 K) ^. h7 W, a5 x2 ]0 [. L7 s            wire [width-1:0] w变量1,w变量2;% e( n( }* m; e2 A
        功能定义:: ^) g' Y% i9 l* F
            a. assign 连线
" ^) h9 a+ c8 }6 d                assign a = b&c;' \$ E- O# a2 a% c6 s6 Y! t0 J9 m
            b. 实例化其他元件# h& m2 t% R& m" _2 j
                and and_inst(q, a, b);
4 J7 J$ E, |- Q& u, @* F6 ~) f            c. always模块, k9 B; L4 F1 t& ?* G" Z
                always @(posedge clk or posedge clr)$ h+ r1 T4 P; Q% F( W  ~
                begin5 E* b, y4 }; X  O) M
                    if(clr) 
$ I2 d8 {# e  x3 V5 A&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; q <= 0;
) @& u, J: ?- X, C: c9 M&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else6 m2 p$ f1 P6 ~. \4 i  s* @
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(en)
2 a; @+ {5 A8 Y6 z) u1 b9 h( m0 I) V8 u&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; q <= d;. z# R2 I  T! z0 ]2 r8 u. |  e5 V) D
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end
4 \- x: K# X' V& |, Q8 R6 f& R3 U" p8 s- T% R/ y+ Y
---------------------

) X- V( y$ ^% l" B/ T

该用户从未签到

2#
发表于 2019-3-8 13:29 | 只看该作者
谢谢楼主的分享
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

推荐内容上一条 /1 下一条

EDA365公众号

关于我们|手机版|EDA365电子论坛网 ( 粤ICP备18020198号-1 )

GMT+8, 2025-7-28 19:52 , Processed in 0.109375 second(s), 23 queries , Gzip On.

深圳市墨知创新科技有限公司

地址:深圳市南山区科技生态园2栋A座805 电话:19926409050

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