Course contentsShow
← Embedded Systems & Computer Architecture
Lesson 9 of 9361. Foundations of Digital Logic and Computer ArchitectureFree lesson

Multiplexers and Data Selection Logic

You will design circuits using multiplexers to act as universal combinational logic blocks capable of implementing any arbitrary Boolean function.

In this lesson, you will learn how to transform a multiplexer from a simple data selector into a versatile "universal" building block capable of implementing any Boolean function.

The Multiplexer as a Logic Engine

A multiplexer (MUX) acts like a digital railway switch. Given a set of data inputs and a "select" signal, it chooses exactly one input to route to the output. While this is great for routing data, we can leverage this selection logic to compute complex logic functions without needing a collection of discrete AND, OR, or NOT gates.

Implementing Logic with a MUX

To implement a Boolean function of nn variables using a MUX, we use n−1n-1 of those variables as the "select" signals. The remaining variable (or its inverse/constants) is then mapped to the data inputs.

Imagine you want to implement the function F = A XOR B. A 2-to-1 MUX has one select line (SS) and two data inputs (I0,I1I_0, I_1). If we set S=AS = A:

  • When A=0A=0, the output is I0I_0. Since we want F=0F=0 when A=0A=0 and B=0B=0, we set I0=BI_0 = B.
  • When A=1A=1, the output is I1I_1. Since we want F=0F=0 when A=1A=1 and B=1B=1, we set I1=B‾I_1 = \overline{B} (NOT B).

By wiring our variables this way, the MUX effectively "selects" the correct logic state for the output based on the input configuration.

Why use a MUX over gates?

Using universal gates (like NAND or NOR) often requires many physical chips and complex wiring. A MUX provides a structured, uniform approach. If you have a 4-to-1 MUX, you can implement any two-variable function simply by hardwiring the inputs to 0, 1, A, or $\overline{A}$. This is the fundamental building block of Look-Up Tables (LUTs), which are the core components inside modern FPGAs (Field Programmable Gate Arrays). Instead of drawing a custom gate schematic, you simply "program" the MUX inputs to define the function.

Key Takeaway: A multiplexer can implement any Boolean function by using the function's variables as control signals to select between appropriate constants or inverted inputs.