A multiplexer (often just called mux), is a chip that allows you to route one of several inputs to the output. Say you have some christmas lights that flash. They have several different flashing modes that change how quickly they flash. One way to accomplish this could be to have each of those flashing pulses on a different mux input and the output connected to the lights. This way the mux just routes whichever mode is active to its output and that's how the lights flash.
The multiplexer's symbol is:
The multiplexer has several data inputs, some chip select inputs, and a single output. The chip select inputs are a binary number that selects which of the data inputs will appear at the output.
\(s_1\) \(s_0\)Output
0 0\(D_0\)
0 1\(D_1\)
1 0\(D_2\)
1 1\(D_3\)
You can think of the multiplexer as a big switch, the control bits \(s_0\) and \(s_1\) control which of the inputs gets connected to the output. You can also use the multiplexer to create logic functions. When you use a MUX to create a logic function it can often require fewer logic gates making it simpler and cheaper to implement.
To use a MUX to generate a logic function the logic inputs will be the data select lines, the data input lines will be set to either 1 or 0 to give the correct output. To design a MUX logic generator:
  1. Write out the logic function's truth table or Karnaugh map
  2. For each entry in the table or map set the corresponding data input line to that value (0 or 1)

Use a MUX to generate the logic function for the truth table:

\(A_0\) \(A_1\) \(A_2\)Output
0 0 00
0 0 11
0 1 01
0 1 11
1 0 00
1 0 10
1 1 00
1 1 11

So when \(A_0A_1A_2 = 000\) we want the output to be \(0\), but this corresponds to input 0 = 0. Likewise when \(A_0A_1A_2 = 010\) we want the output to be \(1\), and this corresponds to input 2 = 1. So we set the data inputs from 0 to 7 equal to their corresponding value in the output column of the table: Now we apply our signals \(A_0\), \(A_1\), and \(A_2\) to the chip select and the output will be the output of our arbitrary logic function!
practice problems