Multiplexers and demultiplexers allow digital information from multiple sources to be routed through a single line. A multiplexer has multiple data inputs, select lines to choose an input, and a single output. A demultiplexer does the reverse, taking a single input and distributing it to multiple outputs based on select lines. Multiplexers and demultiplexers can be combined in trees to increase the number of inputs and outputs. They are used to implement logic functions where a select line acts as the value of a variable in a Boolean expression.