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.
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:
- Write out the logic function's truth table or Karnaugh map
- 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 0||0|
|0 0 1||1|
|0 1 0||1|
|0 1 1||1|
|1 0 0||0|
|1 0 1||0|
|1 1 0||0|
|1 1 1||1|