Comparing 8 digital inputs to control multiplexer analog inputs

swoshie:
I am sorry to say that I don't completely understand your explanation about "count state transitions directly". How should I do this?

I assume the input frequency is much higher than 100 Hz.

In loop(), read the current state of each input. Compare it with the previous state of that input. If it's different, then the signal has just transitioned from high to low or low to high. Decide which of these you're going to use to denote a pulse, and increment a counter when it occurs.

Every 10 ms, compare the counters to see which input has the highest count and take that as your source, then zero the counters ready to start counting the next 10 ms.