The 74151 is a 8 input channel multiplexer. It is exceptionally useful when you need to expand your inputs. This allows you to convert 3 outputs and 1 input into 8 addressable inputs.
You would have to write software that would cycle through all the inputs to for them to be consistently valid. You would need know what the memory locations of the specific data lines are to take advantage of the multiplexer. An example might be:
data = inp(&h379) IF (data and 32) = 32 then print "Out of paper / pin 12 high"
The 74238 is a 8 output channel demultiplexer, Now we can also go in the opposite direction. That is we can choose the ouput line using just one data line in with three select inputs and eight data out lines. A demultiplexer (or demux) is a device taking a single input signal and selecting one of many data-output-lines, which is connected to the single input. A multiplexer is often used with a complementary demultiplexer on the receiving end