LFSR counter value calculation