A mux generally has one of its inputs selected to go to an output pin that the Arduino can read.
Or, in a demux, one of the outputs is selected to follow the input pin, which is an Output from the Arduino.
So, some the input to output channel must be selected, typically with 3 or 4 channel select, or address pins. The Output pins from the Arduino set that address.
There are chips where the inputs are monitored, and an interrupt generated to a microcontroller (uC) to let it know something has happened. The uC can then read a register to see which input changed and go from there.
Which situation are referring to? Which hardware product?
It is an Arduino Leonardo, and I believe a HP4067.
I am just trying to understand the logic regarding how it knows which port its reading. I understand that there are all the channels, [0,0,0,0] [1,0,0,0], etc, but in which direction is this information being read? Is the arduino polling every channel continuously and reading its state, or is the multiplexer sending channel info when it registers a change. It appears to be the former, I am just making sure I am understanding it correctly because the latter made sense to me first, but I am also a noob