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 diagrams of two muxes: a 1-bit wide, 2-to-1 mux, and a 1-bit wide, 4-to-1 mux.