集成电路技术分享

 找回密码
 我要注册

QQ登录

只需一步,快速开始

搜索
查看: 2069|回复: 1

元件例化与层次设计Verilog代码

[复制链接]
老怪甲 该用户已被删除
老怪甲 发表于 2010-5-28 10:47:43 | 显示全部楼层 |阅读模式
基本语法-Verilog HDL 程序举例

元件例化与层次设计

Verilog HDL: Creating a Hierarchical Design

This example describes how to create a hierarchical design using Verilog HDL.
The file top_ver.v is the top level, which calls the two lower level files bottom1.v and bottom2.v.



vprim.v



top_ver.v

module top_ver (q, p, r, out);

input   q, p, r;
output   out;
reg   out, intsig;

bottom1 u1(.a(q), .b(p), .c(intsig));
bottom2 u2(.l(intsig), .m(r), .n(out));

endmodule


--------------------------------------------------------------------------------

bottom1.v

module bottom1(a, b, c);

input   a, b;
output   c;
reg   c;

always
begin
   c<=a & b;
end

endmodule


--------------------------------------------------------------------------------

bottom2.v

module bottom2(l, m, n);

input   l, m;
output  n;
reg    n;

always
begin
   n<=l | m;
end
endmodule
您需要登录后才可以回帖 登录 | 我要注册

本版积分规则

关闭

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

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

GMT+8, 2025-5-8 02:26 , Processed in 0.058173 second(s), 20 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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