|
发表于 2007-11-16 18:04:48
|
显示全部楼层
module plus(rst,clkin,clkout);[52RD.com]
input clkin,rst;[52RD.com]
output clkout;[52RD.com]
reg clkout;[52RD.com]
reg [8:0]count;[52RD.com]
always@(posedge clkin)[52RD.com]
begin[52RD.com]
count<=count+1;[52RD.com]//这行删掉
if(rst)begin[52RD.com]
clkout<=1'b1;[52RD.com]
count<=1'b0;[52RD.com]
end[52RD.com]
else if(count==8)begin[52RD.com]
clkout<=1'b0;[52RD.com]
count<=count+1'b1;[52RD.com]
end[52RD.com]
else if(count==28)begin[52RD.com]
clkout<=1'b1;[52RD.com]
count<=count+1;[52RD.com]
end[52RD.com]
else if(count==37) begin[52RD.com]
clkout<=1'b0;[52RD.com]
count<=count+1;[52RD.com]
end[52RD.com]
else if(count==428) begin //µÚ¶þ¸öÖÜÆÚΪ20΢Ãë[52RD.com]
clkout<=1'b1;[52RD.com]
count<=0;[52RD.com]
end[52RD.com]
else count<=count+1;[52RD.com]
end[52RD.com]
endmodule |
|