always @(posedge rst or posedge clk_50M) begin
if(rst) begin
shift_total <= 960;
end
else begin
if(gap_Hor) begin
shift_total <= 2000;
end
else begin
shift_total <= 1000;
end
end
end
always @(posedge clk_50M or posedge rst) begin
if(rst) begin
......
end
else begin
shift_num <= shift_num +1;
if(shift_num == shift_total) begin
flag_shift_ready <= 1;
shift_num <= 0;
end
end
end