A multiplexer can be used to implement combinatorial logic circuits in a straight-forward and efficient manner (see the figure, a). This technique comes in handy when building a breadboard. Another logic function is needed, but you'd rather not add extra logic packages to the board.
In addition, the technique allows for easy modification of the logic function. Instead of changing the entire logic circuit, a simple reconnection of the multiplexer inputs is all that's needed.
For example, a 4:1 multiplexer can implement any arbitrary logic function of three input variables, and an 8:1 multiplexer handles four input variables. Larger multiplexers should be used to deal with larger numbers of input variables.
To implement the desired logic function, the following technique is used: Consider a 4:1 multiplexer to be used to implement the truth table shown, for the logic function (see the figure, b):
f = AC + AB + CB
Examine the truth table for the desired function. Use the LSBs (A and B) as the multiplexer select bits (see the figure, c). Compare the MSB (C) to the function output for both occurrences of the LSB pattern. If the output should be a "1" for both combinations, simply tie that input of the multiplexer high. If it's "0," tie the input low. If the output is the same as the MSB, tie that input to the MSB. Finally, if the output should be the inverse of the MSB, add an inverter and tie the inverted MSB to that multiplexer input. For instance, look at the two cases of A = B = 0. For C = 0, function out = 0; for C = 1, function out = 1. Thus, the "00" input of the multiplexer should be tied to C.
It's also easy to modify the logic function. Suppose the entry for CBA = 110 = 0 is changed to CBA = 110 = 1. The logic equation takes on an extra term, CA:
f’ = AC + AB + CB + CA
This technique is extended to larger multiplexers by always using the LSBs of the inputs as the multiplexer selects, and using the MSB to determine how to connect the selected input via the aforementioned algorithm. Note that for a function of n input variables, a mux with 2(n-1) inputs is required.