您当前的位置:五五电子网电子知识单片机-工控设备DSP/FPGA技术Verilog HDL 程序设计实例元件例化与层次设计 正文
Verilog HDL 程序设计实例元件例化与层次设计

Verilog HDL 程序设计实例元件例化与层次设计

点击数:7132 次   录入时间:03-04 11:58:09   整理:http://www.55dianzi.com   DSP/FPGA技术
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



本文关键字:程序设计  DSP/FPGA技术单片机-工控设备 - DSP/FPGA技术