3.3.5 · D4Combinational Circuits

Exercises — Multiplexers (2 - 1, 4 - 1, n - 1)

2,997 words14 min readBack to topic
Figure — Multiplexers (2 - 1, 4 - 1, n - 1)

Level 1 — Recognition

L1.1

How many select lines does a 32:1 MUX have? How many data inputs does a 3-select MUX have?

Recall Solution

Selects for 32 inputs: we need the smallest with . Since , . Inputs for 3 selects: bits address rows, so data inputs. Answers: select lines; data inputs.

L1.2

A MUX has select value . Which data input reaches the output?

Recall Solution

Read the bits as a binary number, high bit first: . In spotlight terms: the only minterm that lights is , so its lamp forwards . So the output is .

L1.3 (edge case)

A design needs a MUX for exactly 6 data sources. Which MUX chip do you buy, how many select lines, and what happens to the leftover inputs?

Recall Solution

is not a power of two. The address fact forces (since ). A 3-select MUX physically has input slots, so you buy an 8:1 MUX and use only of them. What happens to the extra minterms ? They still exist in , but you either (a) tie the unused inputs to a safe constant () so those minterms contribute nothing, or (b) guarantee by design that the select combinations and never occur. Never leave them floating — a floating input can drift to an unknown level and, when its minterm lights, garbage reaches .


Level 2 — Application

L2.1

Write the full Boolean output of a 4:1 MUX, then evaluate when , .

Recall Solution

With : only the minterm is (it needs and ✓). All other minterms contain a factor that is — exactly the "one lamp lit" picture from the spotlight figure, here the lamp. So .

L2.2

Implement on an 8:1 MUX with selects . List all eight data-input values.

Recall Solution

Why the truth-table method is guaranteed correct (not a recipe — a proof). Put the variables on the selects, so the address is the assignment . The anchor formula then reads , and for any input only , giving . So if we simply set each equal to the value should have at row , then for every row — the MUX reproduces line by line. That is why "read off the truth table" cannot fail: it is the spotlight collapsing to the one row you are testing.

0 0 0 0
0 0 1 1
0 1 0 2
0 1 1 3
1 0 0 4
1 0 1 5
1 1 0 6
1 1 1 7

Data inputs: . Every input is a constant or — the MUX is a straight lookup table.


Level 3 — Analysis

L3.1

Reverse the black box. A 2:1 MUX has on its select line. Its data inputs are wired , . What single Boolean function of does the output compute?

Recall Solution

The 2:1 equation is . Substitute the wiring: It is XOR. Check corners: , , , . This is exactly the Shannon-expansion trick from the parent note read backwards.

L3.2

Trace a cascade. Two 4:1 MUXes (call them M0 taking , M1 taking ), both driven by , feed a 2:1 MUX driven by . Inputs are (treat these as data values). What appears at the final output when ?

Recall Solution

Follow the trace figure below (each hop is a coloured arrow). Split the address: (pick the group), (pick within a group, ).

  • M0 (low group) lights its index-1 lamp and outputs — the red arrow in the figure.
  • M1 (high group) lights its index-1 lamp and outputs — the green arrow.
  • The 2:1 selector has , so its yellow "S2=1 → pick M1" gate forwards M1's green wire to . Answer: . Sanity check the direct way: , and indeed . ✅
Figure — Multiplexers (2 - 1, 4 - 1, n - 1)

Level 4 — Synthesis

L4.1

Shrink the MUX. Implement (the parity/XOR-3 function) on a 4:1 MUX using , with the leftover variable allowed as a data input. Give in terms of .

Recall Solution

means for rows . Group rows by (that's the address), then read off what does as varies:

(row) (row) at at
00 row 0 row 1 0 1
01 row 2 row 3 1 0
10 row 4 row 5 1 0
11 row 6 row 7 0 1

Why the residue trick is correct. With only on the selects, the anchor formula gives where is now a minterm of . For a fixed , exactly one , so — but here is allowed to be a wire carrying rather than a constant. So equals whatever function of we placed in that slot. We just need each slot's function of to match the two truth-table rows it covers: pattern is "", is "", constant halves are or . Answer: . (This is , as expected for 3-input odd parity.)

L4.2

Scale up. Build a 16:1 MUX using only 4:1 MUXes. How many do you need and how are the select bits distributed?

Recall Solution

A 16:1 needs select lines . Split the address into two halves of two bits:

  • Lower level: four 4:1 MUXes, each holding a group of four inputs (, , , ), all driven by (chooses within each group).
  • Upper level: one 4:1 MUX taking the four lower outputs, driven by (chooses which group).

Total: four-to-one MUXes. Why it works: names the group of four, names the member — together they name any of inputs, matching .


Level 5 — Mastery

L5.1

Prove the selection is clean. Show algebraically that for any fixed select value, the 4:1 MUX output equals exactly one and nothing leaks from the others.

Recall Solution

The four coefficients of the inputs are the four minterms of two variables: Claim 1 (exhaustive): their sum is for every input. ; ; total . So some minterm is always on — some lamp always lights. Claim 2 (exclusive): any two differ in at least one literal (e.g. contains ). So at most one minterm is on. Together: for each select value exactly one , the rest are . Hence . No leakage. ∎

L5.2

Design with enable + cascade. You must route (an 8:1 job) using two enable-controlled 4:1 MUX chips whose outputs are tied to a shared bus. Give the enable equations, name the hardware mechanism that makes tying two outputs together legal, and prove no bus conflict occurs.

Recall Solution

Let chip L hold (address ) and chip H hold (address ). Use as the group bit and drive enables:

How is "tying two outputs together" even allowed? Two ordinary (push-pull) logic outputs must never be wired together — if one drives and the other they short the supply to ground and fight (bus contention). Real MUX chips avoid this in one of two ways, and both work here:

  • Tri-state outputs: when a chip is disabled its output goes to high-Z (a third state that is neither nor — electrically disconnected, like an open switch). A disabled chip therefore contributes nothing to the bus; only the enabled chip drives it.
  • Wired-OR (open-drain): each chip can only pull the bus low (or release it, with a pull-up resistor holding it high). Releases never fight, so the shared node is the OR of the active drivers.

Either way, contention is impossible iff at most one chip is ever enabled at a time. Check: With the tri-state picture, the bus therefore equals whichever chip is enabled: When you get (inputs ); when you get (inputs ). That is precisely an 8:1 MUX with address , built with no extra gate — the enables did the final selection. ∎


Recall Rapid self-quiz (cover answers)

Selects for 32:1? ::: Input chosen by ? ::: MUX for 6 sources — which chip and dead inputs? ::: 8:1 (3 selects); tie to on 8:1 — value of ? ::: XOR wiring on 2:1 gives which function? ::: 4:1 MUXes needed for a 16:1? ::: Enable equations for the two-chip 8:1? ::: What state must a disabled tri-state output take to share a bus? ::: high-Z

Connections