The Exam Problem: Implementing a 3-Variable Function
Given the Boolean function $F(A,B,C) = \Sigma m(1, 3, 5, 6)$, design the circuit using an 8-to-1 multiplexer. Then, optimize the design using a 4-to-1 multiplexer. Identify the correct ICs, map the pins, and avoid common enable-pin traps.
When you are asked to provide an example of mux circuit diagrams for a university digital logic exam or a practical breadboard build, the core challenge is never just the Boolean algebra. The real test is translating that algebra into physical pinouts while avoiding the hardware traps that leave your output stuck at logic LOW. Below is the complete, step-by-step walkthrough to solve this exact problem, moving from an 8-to-1 implementation down to an optimized 4-to-1 design.
Method Selection: MUX Mapping vs. Shannon's Expansion
Which method applies and why? For the 8-to-1 implementation, we use Direct MUX Truth Table Mapping. An $n$-variable function has $2^n$ minterms. An 8-to-1 MUX has 8 data inputs ($D_0$ to $D_7$) and 3 select lines ($2^3 = 8$). By tying the select lines directly to variables A, B, and C, each data input corresponds exactly to one minterm. We simply tie $D_i$ to VCC (Logic 1) if the minterm is in our function, or GND (Logic 0) if it is not.
For the 4-to-1 optimization, we must use Shannon's Expansion Theorem. A 4-to-1 MUX only has 2 select lines, leaving one variable (C) 'left over'. Shannon's Expansion allows us to factor the function with respect to C, feeding C and its complement ($\overline{C}$) directly into the data inputs rather than just hard 1s and 0s.
Step-by-Step Solution: 8-to-1 MUX (74HC151) Wiring
We will use the Texas Instruments SN74HC151N (PDIP-16 package). This is the industry-standard 8-to-1 digital multiplexer for 5V logic.
- Assign Select Lines: Connect the most significant variable to the most significant select pin.
- $S_2$ (Pin 11) = A
- $S_1$ (Pin 10) = B
- $S_0$ (Pin 9) = C
- Map the Data Inputs (Pins 3, 2, 1, 15, 14, 13, 12, 11): Our function is $\Sigma m(1, 3, 5, 6)$.
- $D_0$ (m0) = 0 (GND)
- $D_1$ (m1) = 1 (VCC)
- $D_2$ (m2) = 0 (GND)
- $D_3$ (m3) = 1 (VCC)
- $D_4$ (m4) = 0 (GND)
- $D_5$ (m5) = 1 (VCC)
- $D_6$ (m6) = 1 (VCC)
- $D_7$ (m7) = 0 (GND)
- Handle the Enable Pin (The Trap): Pin 7 is $\overline{E}$ (Strobe/Enable). It is active LOW. You must tie Pin 7 to GND. If you leave it floating or tie it to VCC, the internal AND gates block the signal, and the output will stubbornly read 0V regardless of your inputs.
- Select the Output: Pin 5 is $Y$ (normal output). Pin 6 is $W$ (complement output). Route Pin 5 to your load.
Optimization: Reducing to a 4-to-1 MUX (74HC153)
Now we reduce the hardware. We will use one half of a SN74HC153N (Dual 4-to-1 MUX). We assign $S_1$ (Pin 14) = A, and $S_0$ (Pin 13) = B. Variable C is left over.
The Algebra (Shannon's Expansion on C):
We group the minterms by the select line states (AB):
- When AB = 00 ($D_0$): Minterms are $m_0 (000)$ and $m_1 (001)$. Our function includes $m_1$ but not $m_0$. Therefore, $F = C$. Wiring: Tie $D_0$ (Pin 12) to variable C.
- When AB = 01 ($D_1$): Minterms are $m_2 (010)$ and $m_3 (011)$. Function includes $m_3$ but not $m_2$. Therefore, $F = C$. Wiring: Tie $D_1$ (Pin 11) to variable C.
- When AB = 10 ($D_2$): Minterms are $m_4 (100)$ and $m_5 (101)$. Function includes $m_5$ but not $m_4$. Therefore, $F = C$. Wiring: Tie $D_2$ (Pin 10) to variable C.
- When AB = 11 ($D_3$): Minterms are $m_6 (110)$ and $m_7 (111)$. Function includes $m_6$ but not $m_7$. Therefore, $F = \overline{C}$. Wiring: Pass C through a 74HC04 NOT gate, and tie the output to $D_3$ (Pin 9).
Sanity Check (Units & Thresholds): In digital logic, our 'units' are voltage thresholds. For the 74HC series at 5V, a valid Logic HIGH ($V_{IH}$) must be $\ge 3.15V$, and a Logic LOW ($V_{IL}$) must be $\le 1.35V$. If you probe Pin 5 ($Y$) with a multimeter and read 2.4V, your circuit is failing. This intermediate voltage indicates a floating input, a short between two data lines, or a failing IC.
Decision Path: Choosing the Right MUX IC for Your Breadboard
Do not just buy 'a multiplexer'. The specific IC family dictates your voltage tolerance, propagation delay, and whether you can pass analog signals. Use this decision table to terminate your part selection.
| Scenario / Requirement | Recommended IC | Why This Part? |
|---|---|---|
| Standard 5V digital logic exams & breadboarding (8:1) | TI SN74HC151N (PDIP-16) | High noise margins, ~$0.50/unit, fits standard 0.1" breadboards perfectly. |
| Need to implement two 4-variable functions or optimize 3-variable (4:1) | TI SN74HC153N (PDIP-16) | Contains two independent 4:1 MUXes in one package. Shares select lines. |
| Routing analog audio, sensor voltages, or AC signals | CD4051B (PDIP-16) | CMOS transmission gates pass analog voltages (up to 15V peak-to-peak), unlike the HC series which clamps to VCC/GND. |
| Interfacing directly with 3.3V microcontrollers (ESP32/RPi) | NXP 74LVC1G3157 (SOT-23-6) | 2:1 analog/digital switch, native 3.3V logic, requires breakout board for breadboarding. |
FAQ: Independent Verification and Common Traps
How do I verify the answer independently without a logic analyzer?
Write a quick sweep script on an Arduino Uno. Connect Arduino pins D2, D3, D4 to the MUX select lines (A, B, C). Connect Arduino D5 to the MUX output (Y). Write a for loop from 0 to 7, use digitalWrite to set the select lines based on the bitwise AND of the loop counter, and read D5. Print the result to the Serial Monitor. If the printed array matches [0, 1, 0, 1, 0, 1, 1, 0], your physical wiring is mathematically verified.
Why is my output always HIGH, even when the select lines point to a GND input?
You are likely reading the $W$ pin (Pin 6 on the 74HC151) instead of the $Y$ pin (Pin 5). The $W$ pin is the inverted output. If your selected data input is 0 (GND), the $W$ pin will output a 1 (VCC). Always verify your physical pinout against the TI SN74HC151 datasheet rather than relying on generic textbook diagrams.
Can I use a 74LS151 instead of a 74HC151?
Yes, but with caveats. The 74LS (Low-power Schottky) family is older, draws more static current, and has different voltage thresholds ($V_{IH}$ is 2.0V instead of 3.15V). While it will work on a 5V breadboard, the HC family is the modern standard for CMOS digital logic due to its rail-to-rail output swing and lower power consumption. Avoid mixing LS and HC families on the same data bus without checking logic level compatibility.






