module count4(clk,reset,out);
input clk,reset;
output [3:0]out;
reg [3:0]out;
wire clk,reset;
always @(posedge clk)
begin
if(reset) out<=4'b0000;
else out<=out+4'b0001;
end
endmodule
//'include "count4.v";
module count4_tp;
reg clk,reset;
wire out;
parameter DELY=200;
initial #DELY clk=0;
initial #DELY reset=0;
count4 mycount(.clk(clk),.reset(reset),.out(out));
always #DELY clk=~clk;
endmodule
为什么out没有输出啊???
还有就是 为什么'include 这个不能用?用的时候有这样的错误提示:* Error: E:/Wordspace/work/count4/count4_tp.v(1): near "'i": Illegal base specifier in numeric constant.
** Error: E:/Wordspace/work/count4/count4_tp.v(1): near "'i": syntax error, unexpected "BASE", expecting "class"
求高手指教!!!
此帖出自
小平头技术问答
一周热门 更多>