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

verilog 基础语法-端口

[复制链接]

该用户从未签到

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

EDA365欢迎您登录!

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

x
verilog 基础语法-端口

/ x+ W+ o0 @# A
) ~$ e8 j# D- x' W
1 模块结构. X8 Y2 v9 d  d" m! E: C
    端口: module 模块名(端口1, 端口2, 端口3)+ @  u4 h) y& [& ]/ O/ J6 J+ p
    内容:
* }. @  V# \/ ^7 E* V        I/O说明:' V. |; [% A8 j
            input 端口名;! @8 o- p6 ]! W0 Q5 @$ ?9 k
            output 端口名;5 E; H; U1 ]* Q/ U) s
        内部信号:; B# X+ q7 V5 i; x& v
            reg [width-1:0]  r变量1,r变量2;) G$ i' n: G" |
            wire [width-1:0] w变量1,w变量2;. x+ W: S' J! \+ F0 |
        功能定义:* K  Q* k* R# k' g9 H, @
            a. assign 连线  g2 e0 F1 [7 v( k; y0 K7 M. Z( ~# B; n) L
                assign a = b&c;, r2 \. O' v6 Z0 w3 _8 V
            b. 实例化其他元件
3 n. h9 l! L7 v- D# z                and and_inst(q, a, b);# U" w, n3 o4 b1 F
            c. always模块
  Y' \- R* y" I( R                always @(posedge clk or posedge clr)% @/ d1 ^* \9 q7 ^! n  J( O7 l
                begin
( ~* V0 e( }5 k: d- Z                    if(clr) 7 b3 t; z! v% `3 C* S
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; q <= 0;+ }+ B! U' K2 L# U" U% W8 ]8 E$ C( I
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else8 y, k7 Y* F8 u+ H, I8 d3 X- r. ]
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(en)4 l( g$ h4 Z! R  i3 _
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; q <= d;
0 I2 l3 n% u3 N8 ^; n# V/ T&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end
. ~9 `8 H9 T2 M0 W$ I' F
$ f: ~! ?$ R% J7 T. k2 }---------------------
5 d& |1 s0 ~+ Z& k

该用户从未签到

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

本版积分规则

关闭

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

EDA365公众号

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

GMT+8, 2025-7-28 08:05 , Processed in 0.125000 second(s), 23 queries , Gzip On.

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

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

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