我这样写是不是不好呢?谢谢
always @ (posedge clk or negedge rst_n)
begin
if(!rst_n)begin
counter <= 8'b0;
div_clk <= 1'b0;
end
else begin
counter <= counter + 1'b1;
if(counter == 8'b1111_1111)begin
div_clk <= ~div_clk;
end
end
end
always @ (posedge div_clk)
begin
.................
..................
end