Skip to content

Lec 02-04-2025: Creating a MUX from a Boolean Function

Implementing a Boolean Function with a MUX

Section titled “Implementing a Boolean Function with a MUX”

To see how this works, we’ll implement f(x,y,z)=xy+yzf(x, y, z) = x'y + y'z' using a 4×14 \times 1 MUX with yzyz as the select lines.

A 4×14 \times 1 MUX has four inputs and two select lines — we’ll label our inputs I0,I1,I2,I3I_0, I_1, I_2, I_3. The select lines determine which input gets routed to the output — when they read yz=00yz = 00, I0I_0 comes through; when yz=10yz = 10, I2I_2 comes through; and so on.

4×1 MUX with inputs I0, I1, I2, I3, select lines y and z, and output on right

Since yy and zz are the select lines, the task essentially becomes: what should each of I0,I1,I2,I3I_0, I_1, I_2, I_3 be so that whenever the MUX selects it, the output matches f(x,y,z)f(x, y, z)?

Start by drawing the truth table for xyzxyz, then identify which entries make f=1f = 1. These are the minterms: the cases the MUX needs to produce a 11 for.

Entryxxyyzz
0000
1001
2010
3011
4100
5101
6110
7111

Since ff is a sum (OR) of product terms, then f=1f = 1 whenever at least one product term equals 1.

Since each term directly encodes the variable values that make it 1, we can just read off the variable values that make each term 1:

xy=1    xy=11    x=0,  y=1x'y = 1 \quad \implies \quad x'y = 1 \cdot 1 \quad \implies \quad x = 0,\; y = 1 yz=1    yz=11    y=0,  z=0y'z' = 1 \quad \implies \quad y'z' = 1 \cdot 1 \quad \implies \quad y = 0,\; z = 0

Note that variables that don’t appear in a term are unconstrained — xyx'y says nothing about zz, so zz can be either 00 or 11. Similarly, yzy'z' says nothing about xx.

So for xyx'y, then we can just look for entries where x=0x = 0 and y=1y = 1, likewise for yzy'z' we can just look for the entries where y=0y = 0 and z=0z = 0, and those entries will be the minterms.

Entryxxyyzz
0000
1001
2010
3011
4100
5101
6110
7111

Every entry in the truth table belongs to exactly one input of I0,,I3I_0, \ldots, I_3. Since yy and zz are the select lines, they determine which input gets routed through — so within any of I0,,I3I_0, \ldots, I_3, the only remaining variable is xx.

We notice from the truth table that there exist four pairs of entries that share the same yzyz value but differ in xx — this means each of I0,,I3I_0, \dots, I_3 can only be a constant (00 or 11) or a function of xx alone. Entries 00 and 44 both have yz=00yz = 00, so they both belong to I0I_0; entries 22 and 66 both have yz=10yz = 10, so they both belong to I2I_2; and so on. We’ll line up these entries in a column in the table below:

A convenient way to organize this is a grid where the columns are I0I3I_0 \ldots I_3 and the entries split by whether x=0x = 0 or x=1x = 1. Each cell holds the corresponding truth table entry number, and the minterms from above are circled:

I0I_0I1I_1I2I_2I3I_3
xx'0123
xx4567

Reading off I0,,I3I_0, \dots, I_3 from each column:

  • Both cells circled: f=1f = 1 regardless of xx, so I0=1I_0 = 1.
  • No cells circled: f=0f = 0 regardless of xx, so I1=0I_1 = 0.
  • Only the xx' cell circled: f=1f = 1 when x=0x = 0 and 00 when x=1x = 1, so I2=xI_2 = x'. The same logic applies to I3I_3, so I3=xI_3 = x' as well.

To generalize this: each column tells you what IkI_k must be.

  • None of the rows circled: f=0f = 0 for both values, so Ik=0I_k = 0.
  • Otherwise, we take the union of all the circled rows. In our example, where we have a case that has all rows circled, we get x+x=1x' + x = 1 (by the complementarity law), so for this reason we can just say Ik=1I_k = 1 when all rows are circled.
I0=1I1=0I2=xI3=xI_0 = 1 \qquad I_1 = 0 \qquad I_2 = x' \qquad I_3 = x'

Internally, a MUX AND-gates each input with the select-line combination that activates it, then OR-s all of those together. For yz=00yz = 00, the activating combination is yzy'z', so I0I_0 contributes I0yzI_0 \cdot y'z'; for yz=01yz = 01 it’s yzy'z, contributing I1yzI_1 \cdot y'z; and so on. Summing all four gives the general output expression:

I0yz+I1yz+I2yz+I3yzI_0 y'z' + I_1 y'z + I_2 yz' + I_3 yz

Substituting the values found above:

(1)yz+(0)yz+xyz+xyz=yz+xyz+xyz(1)y'z' + \cancel{(0)y'z} + x'yz' + x'yz = \boxed{y'z' + x'yz' + x'yz}

As a quick sanity check, this simplifies back to ff:   yz+xy(z+z)=yz+xy=f  \; y'z' + x'y(z' + z) = y'z' + x'y = f \;\color{green}{\checkmark}

4×1 MUX with inputs I0=1, I1=0, I2=x', I3=x', select lines y and z, and output on right

Using a MUX of size 22×12^2 \times 1, implement f(x,y,z)=xy+yzf(x,y,z) = x'y + y'z' using as control lines: xyxy

Based on your solution, provide the completed MUX and give the expression of the MUX’s output.

Solution
xxyyzz
0000
1001
2010
3011
4100
5101
6110
7111

I0I_0I1I_1I2I_2I3I_3
zz'0246
zz1357

Inputs:

I0=zI1=1I2=zI3=0I_0 = z' \qquad I_1 = 1 \qquad I_2 = z' \qquad I_3 = 0

Output Expression:

I0xy+I1xy+I2xy+I3xy=  zxy+(1)xy+zxy+(0)xy=  xyz+xy+xyz\begin{align*} & I_0 x'y' + I_1 x'y + I_2 xy' + I_3 xy \\ =\; & z'x'y' + (1)x'y + z'xy' + \cancel{(0)xy} \\ =\; & x'y'z' + x'y + xy'z' \end{align*}

The MUX

4×1 MUX with inputs I0=z', I1=1, I2=z', I3=0, select lines x and y, and output x'y'z' + x'y + xy'z'

Implement f(x,y,z)=xy+yzf(x, y, z) = x'y + y'z' using a 2×12 \times 1 MUX with yy as the select line.

Draw the completed MUX and give the expression of the MUX’s output.

Solution
xxyyzz
0000
1001
2010
3011
4100
5101
6110
7111

I0I_0I1I_1
xzx'z'02
xzx'z13
xzxz'46
xzxz57

Inputs:

I0=xz+xz=z(x+x)=z(1)=zI_0 = x'z' + xz' = z'(x' + x) = z'(1) = z' I1=xz+xz=x(z+z)=x(1)=xI_1 = x'z' + x'z = x'(z' + z) = x'(1) = x'

Output Expression:

I0y+I1y=  zy+xy\begin{align*} & I_0 y' + I_1 y \\ =\; & z'y' + x'y \end{align*}

The MUX

2×1 MUX with inputs I0=z' and I1=x', select line y, and output y'z' + x'y