集成电路技术分享

 找回密码
 我要注册

QQ登录

只需一步,快速开始

搜索
查看: 969|回复: 1

verilog 基础语法-端口

[复制链接]
fpga_feixiang 发表于 2019-3-1 15:15:17 | 显示全部楼层 |阅读模式
1 模块结构
    端口: module 模块名(端口1, 端口2, 端口3)
    内容:
        I/O说明:
            input 端口名;
            output 端口名;
        内部信号:
            reg [width-1:0]  r变量1,r变量2;
            wire [width-1:0] w变量1,w变量2;
        功能定义:
            a. assign 连线
                assign a = b&c;
            b. 实例化其他元件
                and and_inst(q, a, b);
            c. always模块
                always @(posedge clk or posedge clr)
                begin
                    if(clr) 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; q <= 0;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(en)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; q <= d;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end

---------------------
大鹏 发表于 2019-3-9 14:11:38 | 显示全部楼层
verilog 基础语法-端口
您需要登录后才可以回帖 登录 | 我要注册

本版积分规则

关闭

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

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

GMT+8, 2025-5-1 00:56 , Processed in 0.058549 second(s), 19 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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