always @(negedge clocks or posedge c_clr) if (c_clr == 1) count_i <= 0; else if (direction == 1) count_i <= count_i + 1'b1; else count_i <= count_i - 1'b1;