这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界 » 论坛首页 » 嵌入式开发 » FPGA » Verilog HDL 程序举例--基本语法:

共2条 1/1 1 跳转至

Verilog HDL 程序举例--基本语法:

菜鸟
2007-03-29 20:29:48     打赏

元件例化与层次设计

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.
download from: http://www.fpga.com.cn 


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



关键词: Verilog     程序     举例     基本     语法    

菜鸟
2007-03-29 20:37:00     打赏
2楼


共2条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册 ]