Related Concepts: 5.01 Arithmetic Circuits, Multipliers & Comparators | 5.03 Tree Networks (Cascading MUX, Decoders & DeMUX) | 5.04 Programmable Logic Devices (ROM & PLA)
5.02 Code Converters & Data Routing Implementations
MSI Component Architecture
Medium Scale Integration (MSI) components—such as Decoders, Multiplexers (MUX), and Demultiplexers (DeMUX)—drastically reduce hardware gate counts and wiring complexity by replacing custom SSI gate networks.
1. Core Data Routing Definitions
- Decoder: Converts binary information from input lines to a maximum of unique output lines {generates all minterms internally}.
- Multiplexer (MUX): Selects binary data from one of input lines and routes it to a single output controlled by select lines {Data Selector}.
- Demultiplexer (DeMUX): Takes data from a single input line and routes it to one of output lines controlled by select lines {Data Distributor}.
2. Master Code Converter: 2,4,2,1 to 8,4,-2,-1
The single most repeated design question in the course
Six appearances — 2017, 2019, 2020, 2023, 2024, 2025 — worth 8 to 13 marks, with word-for-word identical wording every time. If you prepare one design question for this exam, prepare this one.
Major PYQ Problem (PYQ 2017, 2019, 2020, 2023, 2024, 2025 — 8 to 13 marks)
Question (verbatim): Design a combinational circuit that converts a decimal digit from the 2, 4, 2, 1 code to the 8, 4, -2, -1 code.
Complete Conversion Truth Table:
| Decimal | Inputs (2,4,2,1) | Outputs (8,4,-2,-1) | Weight Check |
|---|---|---|---|
| 0 | 0 0 0 0 | 0 0 0 0 | |
| 1 | 0 0 0 1 | 0 1 1 1 | |
| 2 | 0 0 1 0 | 0 1 1 0 | |
| 3 | 0 0 1 1 | 0 1 0 1 | |
| 4 | 0 1 0 0 | 0 1 0 0 | |
| 5 | 1 0 1 1 | 1 0 1 1 | |
| 6 | 1 1 0 0 | 1 0 1 0 | |
| 7 | 1 1 0 1 | 1 0 0 1 | |
| 8 | 1 1 1 0 | 1 0 0 0 | |
| 9 | 1 1 1 1 | 1 1 1 1 |
- Don’t Care Conditions: the 2421 code never produces the binary patterns
0101–1010, so These six free cells are what make the equations collapse so dramatically — use them.
Minimised Output Equations
Plot one K-map per output over (from the table) plus :
| Output | (input binary values where output = 1) | Minimised equation |
|---|---|---|
How each one falls out:
- — the
1s occupy rows and ; with available as don’t cares, the whole half becomes a single octet. - — inspect the table: the output LSB is
1in exactly the five rows where the input LSB is1. No K-map needed. - — in the half the output follows ; in the half it follows . That inversion-on- pattern is an XOR with .
- — quads , and cover everything in the half except ; factoring gives . The lone remaining
1at pairs only with the don’t care , giving .
Two traps in this question
- Do not use to cover . It looks equivalent to but it also covers — which is decimal 5, where must be
0. Check every group against the real0cells, not just the1s.- Watch the row ordering. The 2421 input for decimal 5 is
1011, not0101. The code jumps from0100(4) straight to1011(5) — that discontinuity is exactly what creates the six don’t cares. Writing the inputs as plain binary 0–9 produces a completely different (and wrong) circuit.
Marks strategy
The truth table alone is typically worth about half the marks, so write it out fully and correctly before touching a K-map. Add the weight-check column () as shown above — it costs nothing and proves each row to the examiner. If time runs short, an accurate table plus and still banks a solid score.
3. Shannon’s Expansion Theorem & MUX Logic Design
Shannon’s Expansion Theorem is the mathematical foundation behind multiplexer-based logic design. It states that any Boolean function can be decomposed into smaller sub-functions by expanding it about one or more select variables.
3.1 Theorem Statement
For any -variable Boolean function , it can be expanded about an individual variable as:
Using cofactor notation, we write:
Where:
- is the cofactor of evaluated with variable .
- is the cofactor of evaluated with variable .
3.2 Direct Hardware Mapping to Multiplexers
A multiplexer is physically a hardware implementation of Shannon’s expansion equation:
- The Select Lines () act as the expansion variables ().
- The Data Inputs () of the MUX are hardwired to the resulting cofactors.
The Select Line Rule
Since each select line represents one expansion variable, an -variable Boolean function can always be implemented using a Multiplexer with:
- select lines (where the remaining variable feeds the data inputs as ).
- select lines (where the data inputs are tied to static constants
0or1).
3.3 Implementing an Arbitrary Function with a Multiplexer
Five appearances — the second-most repeated question in this chapter
2016, 2019, 2022, 2023 and 2024 all ask you to implement a 4-variable function with a multiplexer, for 10 marks each. Only the function changes.
The Three-Step Recipe
For a 4-variable function on an 8×1 MUX:
-
Connect to the three select lines (). The remaining variable feeds the data inputs.
-
Pair the minterms: rows and share select combination , differing only in .
-
For each pair, read off the data input:
at at Data input 0 0 0 1 1 0 1 1
Worked Exam Problem (PYQ 2016 — 10 marks; 2024 — 10 marks, specified as )
Question (verbatim, 2024): Implement the following function with a multiplexer: .
| Minterm at | Minterm at | Data input | ||||
|---|---|---|---|---|---|---|
| 000 | 1 | 1 | ||||
| 001 | 0 | 1 | ||||
| 010 | 1 | 0 | ||||
| 011 | 0 | 0 | ||||
| 100 | 1 | 1 | ||||
| 101 | 0 | 0 | ||||
| 110 | 0 | 0 | ||||
| 111 | 0 | 1 |
Verification: has , , so the MUX selects ✓; selects the same input, ✓.
The Other Examined Function
Worked Exam Problem (PYQ 2019, 2023 — 10 marks)
Question (verbatim, 2023): Implement the following function with a multiplexer. .
(The 2019 paper prefixes this with “Define multiplexer and demultiplexer” — those definitions are in §1.)
When the question says "4×1 multiplexer and external gates"
The 2022 paper asks for using a MUX. With only two select lines (), each data input must be a function of the remaining two variables and — so can be , , , , , , , and so on. Build a small four-row table of against for each combination and read off the sub-function. That sub-function is what the “external gates” implement.
4. Implementing Full-Adder using 4x1 Multiplexers
Major PYQ Problem (PYQ 2021 — 07 marks)
Question (verbatim): Implement a full-adder with two multiplexers.
Solution: A Full-Adder has three inputs: (which we choose as our select lines ) and (the carry-in, which will feed the data inputs).
- Sum Function (): Apply Shannon’s expansion about variables :
- For : (covers minterm 1)
- For : (covers minterm 2)
- For : (covers minterm 4)
- For : (covers minterm 7)
- Carry Function (): Apply Shannon’s expansion about variables :
- For :
- For : (covers minterm 3)
- For : (covers minterm 5)
- For : (covers minterms 6, 7)
graph TD subgraph 4x1 MUX Full-Adder Implementation S1[Select S1 = X] & S0[Select S0 = Y] --> MUX_Sum[MUX 1: Sum S] S1 & S0 --> MUX_Carry[MUX 2: Carry Out C] Z[Input Z] -->|I0=Z, I1=Z', I2=Z', I3=Z| MUX_Sum Z -->|I0=0, I1=Z, I2=Z, I3=1| MUX_Carry end
5. Implementing Full-Adder using 3-to-8 Decoder
Major PYQ Problem (PYQ 2019 — 11 marks)
Question (verbatim): Implement a full-adder circuit with a decoder and two OR gates.
Inputs: connected to 3-to-8 decoder select lines.
- Sum Output (): Connect decoder output pins 1, 2, 4, 7 to a 4-input OR gate .
- Carry Output (): Connect decoder output pins 3, 5, 6, 7 to a second 4-input OR gate .
5.1 The General Decoder Method
Why a decoder makes this trivial
An -to- decoder outputs every minterm of its inputs, one per pin. So implementing any SOP function is just “OR together the pins whose indices appear in the minterm list.” No K-map, no simplification — that is the entire technique.
Worked Exam Problem (PYQ 2018 — 08 marks)
Question (verbatim): What is a Decoder? Implement the following function using Decoder, .
Use a 4-to-16 decoder with on the select lines, then OR together output pins 0, 1, 3, 4, 8, 9, 10, 11. An 8-input OR gate completes the circuit.
Answer the “What is a Decoder?” half too — the definition is in §1 and is worth easy marks.
Worked Exam Problem (PYQ 2016, 2017 — 12 marks; 2020 — 10 marks)
Question (verbatim): A combinational circuit is defined by the following three equations: Design the circuit with a decoder and external gates.
Step 1 — expand each function to minterms over :
Function Working Minterms ; ; ; Step 2 — one 3-to-8 decoder feeds three OR gates:
- : OR of pins
- : OR of pins
- : OR of pins
Economy note: has six minterms out of eight. It is cheaper to build its complement — — with a 2-input NOR gate on pins 4 and 5. Mentioning this trade-off earns credit for design judgement.
6. BCD to Seven-Segment Decoder Design
Lab experiment, not a theory PYQ
This has not appeared in any theory paper from 2015 to 2025. It is ECE 2104 Lab Week 9 (“Design and Implementation of BCD to Seven Segment Decoder”), so learn it for the lab and the lab quiz. It also serves as the largest worked example of the multi-output K-map design flow used by the code converter in §2.
A BCD to Seven-Segment decoder takes a 4-bit binary coded decimal input (, where is MSB) and converts it to active-high control outputs () to drive a standard 7-segment LED display to render decimal numbers 0 through 9.
6.1 Display Segment Layout
a
+---+
f | | b
+---+ <- g
e | | c
+---+
d6.2 Truth Table (Active-High Display)
States (binary 1010 to 1111) are invalid BCD inputs and are treated as Don’t Care () states.
| Decimal | Inputs () | Segments () |
|---|---|---|
| 0 | 0 0 0 0 | 1 1 1 1 1 1 0 |
| 1 | 0 0 0 1 | 0 1 1 0 0 0 0 |
| 2 | 0 0 1 0 | 1 1 0 1 1 0 1 |
| 3 | 0 0 1 1 | 1 1 1 1 0 0 1 |
| 4 | 0 1 0 0 | 0 1 1 0 0 1 1 |
| 5 | 0 1 0 1 | 1 0 1 1 0 1 1 |
| 6 | 0 1 1 0 | 1 0 1 1 1 1 1 |
| 7 | 0 1 1 1 | 1 1 1 0 0 0 0 |
| 8 | 1 0 0 0 | 1 1 1 1 1 1 1 |
| 9 | 1 0 0 1 | 1 1 1 1 0 1 1 |
6.3 Minimized Logic Equations (using K-Maps)
- Segment a:
- Segment b:
- Segment c:
- Segment d:
- Segment e:
- Segment f:
- Segment g:
7. Basic 1-to-4 Demultiplexer (DeMUX) Design
A Demultiplexer (DeMUX) is a logic circuit that takes a single input line and routes it to one of outputs, based on the select variables.
7.1 Truth Table
- Inputs: Data , Selects (where is MSB).
- Outputs: .
| Selects () | Outputs () |
|---|---|
0 0 | 0 0 0 D |
0 1 | 0 0 D 0 |
1 0 | 0 D 0 0 |
1 1 | D 0 0 0 |
7.2 Logic Equations & Schematic Implementation
The hardware is implemented using four 3-input AND gates:
- The select lines are connected to the gate inputs through inverters to generate the addressing minterms.
- The data line is fed to one input of all four AND gates in parallel.
8. Past Year Questions (PYQs)
PYQ Index for this note
Question (as asked) Years Marks Solved in Design a combinational circuit that converts a decimal digit from 2,4,2,1 code to 8,4,-2,-1 code 2017, 2019, 2020, 2023, 2024, 2025 8–13 §2 Implement with a (8×1) multiplexer 2016, 2024 10 §3.3 Implement with a multiplexer 2019, 2023 10 §3.3 Implement with a 4×1 multiplexer and external gates 2022 10 §3.3 tip Define multiplexer and demultiplexer (prefix to the 2019 MUX question) 2019 part of 10 §1 Implement a full-adder with two 4×1 multiplexers 2021 7 §4 Implement a full-adder circuit with a decoder and two OR gates 2019 11 §5 What is a Decoder? Implement using a Decoder 2018 8 §5.1 Design the circuit for , , with a decoder and external gates 2016, 2017, 2020 10–12 §5.1 Pattern to notice: this note carries the two heaviest recurring questions in Chapter 5 — the code converter (six appearances) and MUX implementation (five) — plus the decoder implementations (four). Between them that is roughly 20 marks of every paper, and all three are mechanical once the technique is known.
The unifying insight: decoders and multiplexers both let you skip simplification entirely. A decoder hands you every minterm on a pin; a MUX lets you fold one variable into the data inputs. Neither needs a K-map. Reach for the truth table, not for grouping.
Not examined here: the BCD to seven-segment decoder (§6) is a lab experiment (ECE 2104 Week 9), not a theory question. The 1×16 demultiplexer built from 2-to-4 decoders (2023) is a tree-network question — see 5.03 Tree Networks (Cascading MUX, Decoders & DeMUX).