always@(posedge clk_temp1) //脉冲控制端的上升沿触发
begin
if(count==1'b0) //判断count是否为0,是的话执行以下操作
begin
count<=1'b1; //count置1
clk_temp3<=1'b1; //clk_temp3置1
div<=1'b1; //div置1
end
else //否的话执行以下操作
begin
count<=count-1'b1; //count自减1
clk_temp3<=1'b0; //clk_temp3置0
div<=1'b0; //div置0
end
end
always@(posedge clk_temp3) //clk_temp3的上升沿触发
begin
clk_temp2<=~clk_temp2; //clk_temp2取反
end
endmodule