Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

1Learning Outcomes

Last time we saw how to represent and design combinational logic blocks. In this section we will study a few special logic blocks; data multiplexors, a adder/subtractor circuit, and an arithmetic/logic unit.

2The Mux

A data multiplexor, commonly called a mux or a selector, is a circuit that selects its output value from a set of input values. Below are two mux circuits.

"TODO"

Figure 1:A 1-bit wide, 2-to-1 MUX.

"TODO"

Figure 2:An n-bit wide, 2-to-1 MUX.

Both of these muxes have two data inputs and one output. Additionally, each mux has a special control signal labeled s, for select. The s signal is also input, but it is used to control which of the two input values is directed to the output.

Figure 1 shows a 1-bit wide, 2-to-1 mux circuit:

Figure 2 shows an n-bit wide, 2-to-1 mux circuit:

The function of, say, the 1-bit wide 2-to-1 mux can be described with two rules:

y={awhen s=0bwhen s=1\texttt{y} = \begin{cases} \texttt{a} & \text{when } \texttt{s} = 0 \\ \texttt{b} & \text{when } \texttt{s} = 1 \\ \end{cases}

To remind us of which value of s corresponds to which input, within the mux symbol we commonly label each input with its corresponding s value.

Muxes find common use within the design of microprocessors, e.g., those that implement RISC-V.

3MUX: Implementation

In most applications, you will have access to a mux; you will not need to build your own from scratch. Nevertheless, it is good to remember that like all combinational logic blocks, the function of muxes can be described using a truth table and thereby implemented as a logic gate circuit.

Click to show the gate diagram, truth table, and boolean algebra explanation for a 1-bit wide, 2-to-1 mux.

3.11-bit wide 4-to-1 mux

Often times we find the need to extend the number of data inputs of a multiplexor. For instance consider a 4-to-1 multiplexor in Figure 6:

"TODO"

Figure 6:A 1-bit wide 4-to-1 MUX.

Figure 7 shows how this larger mux can be formed by wiring together smaller MUXes.

"TODO"

Figure 7:4-to-1 multiplexor (MUX) circuit diagram.

This circuit design leverages the hierarchical nature of multiplexing. The first layer of muxes uses the s0s_0 input to narrow the four inputs down to two, then the second layer uses s1s_1 to choose the final output.