31 bit counter with 1 cycle reset