module 10counter(ce,cp,cr,q)
input ce,cp,cr
output [3:0]q
reg[3:0]q
always@( posedge cp or negedge cr)
if(~cr)q<态雀=4‘b0000
else if(ce)
begin if(q<=4‘中世b1001) q<=4‘0000
else q<=q 1’b1
and
else q<=q
endmoudule
分号没写,自己加帆培早
module CNT4_10(CLK,RESET,Q3,Q2,Q1,Q0,FULL);
input CLK,RESET;
output Q3,Q2,Q1,Q0,FULL;
wire FULL_0,FULL_1,FULL_2,FULL_3;
CNT10_tongbu u_D0(.CLK(CLK),
.ENABLE(1),
.RESET(RESET),
.FULL(FULL_0),
.Q(Q0)
);
CNT10_tongbu u_D1(.CLK(CLK),
.ENABLE(FULL_0),
.RESET(RESET),
.FULL(FULL_1),
.Q(Q1)
);
CNT10_tongbu u_D2(.CLK(CLK),
.ENABLE(FULL_0&FULL_1),
.RESET(RESET),
.FULL(FULL_2),
.Q(Q2)
);
CNT10_tongbu u_D3(.CLK(CLK),
.ENABLE(FULL_0&FULL_1&FULL_2),
.RESET(RESET),
.FULL(FULL_3),
.Q(Q3)
);
assign FULL=(FULL_0&FULL_1&FULL_2&FULL_3);
endmodule
有错腔念误凯圆岩,大神来看看嘛,求。谢盯御谢啦~
兄弟,把你有错的程序贴上来,我相信有很多人愿意来帮忙解答的。
module cnt4_10(clk,reset,enable,Q3,Q2,Q1,Q0,Full);
input clk,reset,enable;
output Full;
output [3:0]Q3,Q2,Q1,Q0;
wire FULL0,FULL1,FULL2,FULL3;
cnt10 U1(.clk(clk),.reset(reset),.enable(enable),.Q(Q0),.Full(Full0));
cnt10 U2(.clk(clk),.reset(reset),.enable(Full0),.Q(Q1),.Full(Full1));
cnt10 U3(.clk(clk),.reset(reset),.enable(Full0&Full1),.Q(Q2),.Full(Full2));
cnt10 U4(.clk(clk),.reset(reset),.enable(Full0&Full1&Full2),.Q(Q3),.Full(Full3));
assign Full=Full0&Full1&Full2&Full3;
endmodule