Compare using a counter to a shift register.