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

verilog 基础语法-端口

[复制链接]

该用户从未签到

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

EDA365欢迎您登录!

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

x
verilog 基础语法-端口

% h1 I. e% E5 t$ Q) v7 ]1 w% F( @3 ^8 ]
1 模块结构: |; D5 z! V/ \9 ~2 q: X4 O
    端口: module 模块名(端口1, 端口2, 端口3)
/ b+ j/ f: b* o1 l* }- q: F7 i5 `/ I    内容:
6 O+ ~' Q+ u( f( N3 e) Z3 B        I/O说明:
0 |  W- x% D& u; x" x# w, K/ v' h, r            input 端口名;9 r  r# b' x3 k0 ~0 I: [6 i
            output 端口名;- E# W) W. ^. Y( n. q. e; N/ W7 Z
        内部信号:4 J- K' }$ g0 A, F+ d) s
            reg [width-1:0]  r变量1,r变量2;- R$ O0 b4 H- }
            wire [width-1:0] w变量1,w变量2;
- f) i: S( y  O        功能定义:( E' k3 e# {( C
            a. assign 连线# a# }9 H4 P1 C1 k
                assign a = b&c;" L5 B- a/ @4 S9 }, R
            b. 实例化其他元件2 X4 v2 _' H, ~5 T6 {
                and and_inst(q, a, b);1 e1 [. o8 s6 D* R+ s5 G; \- i- [9 M
            c. always模块4 u2 |- W8 e& A! ]  r; L
                always @(posedge clk or posedge clr)3 ~: G+ {+ b6 _" M- h0 u
                begin
" D1 h! W2 `) i1 J! A! }  X2 T                    if(clr) 
  u# V5 ~% k4 M&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; q <= 0;3 S2 _3 i$ [8 h& z7 I
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else' l. _* W" `9 v! w7 F+ _/ p" a
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(en), |, W, B. Z, {2 b5 x5 `
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; q <= d;- b! A; E* A& K) n: G" Y& P
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end
# `5 H. R0 `; w% k$ V% p8 Z
" @2 k9 l9 z. |4 Y( v0 j6 }- G---------------------
% n/ X/ u7 H7 x: i+ ?$ x8 J. C4 v

该用户从未签到

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

本版积分规则

关闭

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

EDA365公众号

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

GMT+8, 2025-10-8 11:47 , Processed in 0.156250 second(s), 24 queries , Gzip On.

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

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

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