Skip to main content

Someone wanted to learn this too, so Grasp built them a personal learning path.

You can keep exploring this one or create your own

Implementing Boolean Functions with Multiplexers

Hello! In the previous lesson, you implemented a Boolean function with gates and checked that each circuit matched its truth table. A multiplexer offers another implementation: instead of building the expression term by term, you use some variables to select an input and wire that input to the value the function should produce.

We’ll start with the same three-variable function you already know, implement it with two different MUX sizes, and then use the supplied circuit image to see how the method extends to four variables.


A MUX selects one data input

A multiplexer, or MUX, has data inputs, select inputs, and one output. A 4-to-1 MUX has four data inputs through and two select inputs . Its output is whichever data input the binary select value names:

Output
00
01
10
11

For example, when , the output equals . If is connected to logic 1, the output is 1 for that selection; if it is connected to another signal, the output follows that signal. This is the key design question: for each select combination, what must the selected data input produce?

Watch the first portion of Multiplexer Explained | Implementation of Boolean function using Multiplexer from ALL ABOUT ELECTRONICS. It demonstrates the direct truth-table method with an 8-to-1 MUX. The video calls three select lines necessary for its direct three-variable construction; we’ll shortly see a construction using fewer select lines.

Multiplexer Explained | Implementation of Boolean function using Multiplexer

Watch Multiplexer Explained | Implementation of Boolean function using Multiplexer from ALL ABOUT ELECTRONICS to see how select combinations correspond to truth-table rows.

Watch direct mapping. Focus on which variable goes to each select pin and why data inputs corresponding to output-1 rows are tied to logic 1.


Implement a truth table directly

Our running function is

From the previous lesson, its output is 1 for , and 0 for the other four input combinations. An 8-to-1 MUX has three select lines, so assign , , and . The binary value of now names the selected data input: , for instance, selects .

Selected input Required Connect input to
000 1 1
001 1 1
010 0 0
011 1 1
100 0 0
101 0 0
110 0 0
111 1 1

Thus are tied to logic 1; the rest are tied to logic 0. The MUX output is . No K-map minimization is needed for this method: once the select order is fixed, the truth table specifies every data connection.

Pin order matters. If you instead put on , the table above would no longer describe which input each combination selects. Write down the select-to-variable assignment before assigning the data inputs.


Use fewer select lines by letting a data input vary

The direct implementation uses all three variables as selectors. But a data pin does not have to be tied to a constant: it can be connected to a function of an input variable. For a three-variable function, choose two variables as the select signals of a 4-to-1 MUX and determine what each data input must do as the third variable changes.

Continue the video for a worked example of this paired-row method. Its function differs from ours; concentrate on how two truth-table rows determine each data connection.

Multiplexer Explained | Implementation of Boolean function using Multiplexer

Continue the same video to see how a four-input MUX can implement a three-variable function.

Watch paired rows. For each fixed pair of select values, follow the two output values as the remaining variable changes. Notice the four possible data connections: 0, 1, the remaining variable, or its complement.

For our function, set and , leaving off the select pins. Hold fixed and inspect the two outputs obtained when and :

Output at Output at Data input
00 1 1
01 0 1
10 0 0
11 0 1

Why does the pair mean ? Because a wire carrying is 0 when and 1 when . In general, a pair of outputs calls for logic 0, for logic 1, for the remaining variable, and for its complement.

The complete circuit therefore connects to , connects to , respectively, and takes from the MUX output. For a quick check, makes , so the MUX selects . At , it selects the same pin, but , giving the required output 0.

This implementation needs a smaller MUX than the direct one because its data pins carry some of the function’s behavior rather than only constants.


Read a four-variable implementation

The supplied image applies exactly that paired-row idea to four variables with an 8-to-1 MUX. Here drive , while is the remaining variable. Each data input corresponds to a fixed value and must work for both and .

The left table pairs the function outputs for \(A=0\) and \(A=1\) at each fixed \(BCD\) value; the right circuit connects the resulting constants, \(A\), and \(\overline A\) to the eight MUX data inputs.

The circled entries in the image are the output-1 cases. Reading each column from its upper row () to its lower row () gives the wiring plan:

Output pair for MUX connection
000
001
010
011
100
101
110
111

For instance, selects . The required output is 1 when and 0 when , so must carry . The circuit generates that signal with an inverter and shares it among several data pins. By contrast, selects regardless of .

The rule scales: with select variables, a MUX has data inputs. If one variable remains, compare its two truth-table rows for each select combination and connect the corresponding data pin to , , that variable, or its complement.


Check the wiring, not just the plan

A MUX implementation is correct only if its select-pin order and every data-pin connection reproduce the original function. Check a circuit by taking an input combination, finding the selected pin, and evaluating the signal connected to it. In the image, gives , selecting ; the output is therefore 0. For , selects .

Two practical details prevent otherwise sound designs from failing. First, a data input specified as 0 or 1 must be driven to a defined logic level, not left unconnected. Second, if a particular MUX has an enable input, it must be held in its enabled state; the required level depends on that device’s interface.

A smaller MUX is not automatically a cheaper or faster implementation: supplying , for example, may require an inverter. At this stage, the priority is a complete, equivalent wiring plan. Later lessons will examine circuit delay and implementation trade-offs.


Key takeaways

A MUX realizes a Boolean function by selecting a data input whose value matches the required output. The direct method uses every function variable as a select signal and ties data pins to truth-table values. A smaller MUX uses fewer select signals; for each fixed select combination, compare the outputs as the remaining variable changes and connect the data pin to , , the variable, or its complement. Always verify the result using the actual select order and data connections.

Next, you’ll design an adder or subtractor from a bit-level specification, putting these combinational-logic skills to work on arithmetic.

Can't find a good explanation? Sign up and we'll make it for you

Sign up