Digital Logic ยท Unit 4 ยท 5 hrs
Combinational Logic
Exam-focused notes for Combinational Logic (Digital Logic, CSC116): what the TU syllabus asks and how it has actually been tested, with 12 solved past questions from this unit.
Combinational Logic in short
This chapter applies Boolean simplification to build actual combinational circuits: the procedure used to design one, the standard arithmetic blocks (adders and subtractors), converting one code into another, working out an unknown circuit's function, building multilevel circuits from NAND/NOR gates only, and the Exclusive-OR circuits used throughout digital design.
What this unit covers
- Design Procedure
- Adders
- Subtractors
- Code Conversions
- Analysis Procedure
- Multilevel NAND and NOR Circuits
- Exclusive-OR Circuits
Design Procedure
2081 ยท 10 marks
Explain design procedure of combinational circuits. Design a combinational circuit with three inputs x, y, and z, and three outputs, A, B, and C. When the binary input is 0, 1, 2, or 3, the binary output is one greater than the input. When the binary input is 4, 5, 6, or 7, the binary output is one less than the input.[10]
2080 ยท 10 marks
What is combinational circuit? Design a combinational circuit with four inputs lines that represent a decimal digit in BCD and four output lines that generate the 1's complement of the input binary patterns.[10]
Show solved answerHide answer
Combinational Circuit: BCD to 1's Complement
Given
- Number of input lines: 4 (call them $A, B, C, D$)
- Inputs represent a decimal digit in BCD (valid range: 0 to 9)
- Number of output lines: 4 (call them $W, X, Y, Z$)
- Required output: 1's complement of the input binary pattern
No numeric constants missing. All information needed is present.
Solution
1. What is a Combinational Circuit?
A combinational circuit is a digital logic circuit whose output at any given time depends only on the present combination of input values and not on any past inputs or outputs. It contains no memory elements (flip-flops) and no feedback paths. It is built entirely from interconnected logic gates (AND, OR, NOT, NAND, NOR, XOR).
Characteristics:
- Output is a pure Boolean function of current inputs
- No storage / no feedback
- Fully described by a truth table or Boolean expressions
- Examples: adders, subtractors, encoders, decoders, multiplexers, code converters
2. Concept of 1's Complement
The 1's complement of a binary number is obtained by inverting each bit ($0 \to 1$, $1 \to 0$). Hence for a 4-bit input $ABCD$ the outputs are the bitwise inverse.
3. Truth Table
Inputs $A B C D$ are BCD (0-9). Combinations 1010 to 1111 are invalid BCD and treated as don't care ($\times$).
| Dec | A | B | C | D | W | X | Y | Z |
|---|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 |
| 1 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 0 |
| 2 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 1 |
| 3 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 0 |
| 4 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 1 |
| 5 | 0 | 1 | 0 | 1 | 1 | 0 | 1 | 0 |
| 6 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 1 |
| 7 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 0 |
| 8 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 1 |
| 9 | 1 | 0 | 0 | 1 | 0 | 1 | 1 | 0 |
| 10-15 | - | - | - | - | $\times$ | $\times$ | $\times$ | $\times$ |
4. K-Map Simplification
Output W (equals $\bar A$): $W=1$ for all minterms with $A=0$; $W=0$ for $A=1$. Don't cares grouped freely.
$$W = A'$$
Output X (equals $\bar B$): $X=1$ only when $B=0$.
$$X = B'$$
Output Y (equals $\bar C$): $Y=1$ only when $C=0$.
$$Y = C'$$
Output Z (equals $\bar D$): $Z=1$ only when $D=0$.
$$Z = D'$$
Each K-map reduces to a single-literal term because 1's complement is a purely bitwise inversion.
5. Simplified Boolean Expressions
$$\boxed{W = A' \quad X = B' \quad Y = C' \quad Z = D'}$$
6. Logic Circuit
The circuit needs only four NOT gates (inverters):
A ----|>o---- W = A'
B ----|>o---- X = B'
C ----|>o---- Y = C'
D ----|>o---- Z = D'
7. Conclusion
Since the 1's complement is a bit-by-bit inversion, the combinational circuit reduces to four independent inverters. The BCD constraint and the don't-care conditions do not change this result; they only confirm the minimal single-literal expressions.
2079 ยท 5 marks
Design a combinational circuit with three inputs and one output. The output is 1 when the binary value of the inputs is an even number. [5]
2078 ยท 5 marks
Design a combinational circuit with three inputs and one output. The output is 1 when the binary value of the inputs is an odd number. [5]
2077 ยท 10 marks
Design a combinatorial circuit that generates 9's complement of a BCD number.[10]
2075 ยท 5 marks
Design a combinational circuit with three inputs, x, y and z, and three outputs, A, B and C. When the binary input is 0,1,2, or 3, the binary output is one greater than the input. When the binary input is 4,5,6 or 7, the binary output is one less than the input. [5]
Subtractors
2080 ยท 5 marks
Design a full subtractor with necessary tables and logic diagram. [5]
2077 ยท 5 marks
Design a full subtractor circuit with three inputs $x$, $y$, $B_{in}$ and two outputs $Diff$ and $B_{out}$. The circuit subtracts $x - y - B_{in}$, where $B_{in}$ is the input borrow, $B_{out}$ is the output borrow, and $Diff$ is the difference [5]
Adders
2079 ยท 5 marks
Derive the Boolean expression for sum and carry of half adder. Draw its combinational circuit. Implement it using only NOR gates. [5]
Show solved answerHide answer
Half Adder: Derivation, Circuit, and NOR Implementation
Given
- Inputs: two single-bit binary values, $A$ and $B$
- Outputs: Sum $S$, Carry $C$
- Constraint: implement using only NOR gates
All required information is present in the question.
Solution
Truth Table
| A | B | Sum (S) | Carry (C) |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
Boolean Expressions
Sum: $S = 1$ for the minterms $(A=0,B=1)$ and $(A=1,B=0)$:
$$S = \bar{A}B + A\bar{B} = A \oplus B$$
Carry: $C = 1$ only when both inputs are 1:
$$C = A \cdot B$$
Combinational Circuit (XOR + AND)
A โโโฌโโโโโโโโโโโโ
โ [XOR]โโโโโ S = A โ B
B โโโผโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโ
โ [AND]โโโโโ C = AยทB
B โโโโโโโโโโโโโโโ
NOR-Only Implementation
Basic NOR identities:
- $\bar{X} = X \text{ NOR } X$
- $X + Y = (X \text{ NOR } Y) \text{ NOR } (X \text{ NOR } Y)$
- $X \cdot Y = (X \text{ NOR } X) \text{ NOR } (Y \text{ NOR } Y)$
Carry $C = A \cdot B$. Using AND-from-NOR:
$$C = (A \text{ NOR } A) \text{ NOR } (B \text{ NOR } B) = \overline{\bar A + \bar B} = A\cdot B$$
Sum $S = A \oplus B$. The standard 5-gate NOR realization of XOR:
| Gate | Inputs | Output |
|---|---|---|
| G1 | $A$ NOR $B$ | $\overline{A+B}$ |
| G2 | $A$ NOR G1 | $\overline{A + \overline{A+B}} = \bar A(A+B) = \bar A B$ |
| G3 | $B$ NOR G1 | $\overline{B + \overline{A+B}} = \bar B(A+B) = A\bar B$ |
| G4 | G2 NOR G3 | $\overline{\bar A B + A\bar B} = \overline{A\oplus B}$ |
| G5 | G4 NOR G4 | $A \oplus B = S$ |
Verification of G4/G5: $\text{G4} = \overline{S}$, so $\text{G5}=\overline{\overline S}=S$. Correct.
Circuit diagram (NOR gates only):
A โโฌโโโโโโโโโโโ[G1]โโโโโฌโโโโโโโ[G2]โโโโ
โ B โโโโโ โ A โโโโ โ
โ โโโ[G3]โโโโโ โโ[G4]โโ[G5]โโ S
โ B โโโโโโโโโโโโโโโโ โ (G4 fed twice)
โ
โโ[Ga: A NOR A = A']โโโ
โ โโ[Gc]โโ C
โโโโโโโโโโโโโโโโโโโโโโโ
B โ[Gb: B NOR B = B']โโโ
Gate count:
- Sum: 5 NOR gates (G1-G5)
- Carry: 3 NOR gates (Ga = $\bar A$, Gb = $\bar B$, Gc = final NOR)
- G1 is shared, but counting independently: Sum = 5, Carry = 3.
Summary
| Output | Expression | NOR gates |
|---|---|---|
| Sum | $S = A \oplus B$ | 5 |
| Carry | $C = A \cdot B$ | 3 |
A wiring trap worth knowing: one tempting XOR construction does not work. Taking:
- G4 = G1 NOR G2 = $\overline{\overline{A+B} + \bar A}$. Evaluate: $= (A+B)\cdot A = A$, not $A\bar B$.
- G5 = G1 NOR G3 = $(A+B)\cdot B = B$, not $\bar A B$.
- G6 = G4 NOR G5 = $A$ NOR $B = \overline{A+B}$, which is NOT $A\oplus B$.
So those gate assignments do not yield the XOR. The correct minimal XOR uses 5 NOR gates with the wiring shown above, giving $S = A\oplus B$ and $C = A\cdot B$.
2078 ยท 5 marks
Derive the Boolean expression for sum and carry of half adder. Draw its combinational circuit. Implement it using only NAND gates. [5]
Show solved answerHide answer
Half Adder: Derivation, Circuit, and NAND Implementation
Given
- Inputs: two single bits $A$, $B$
- Outputs: $S$ (Sum), $C$ (Carry)
- Constraint for last part: implement using only NAND gates
No numeric data missing; this is a derivation/design problem.
Solution
Truth Table
| A | B | Sum (S) | Carry (C) |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
Boolean Expressions
Sum: $S = 1$ for minterms $(A=0,B=1)$ and $(A=1,B=0)$:
$$S = \bar{A}B + A\bar{B} = A \oplus B$$
Carry: $C = 1$ only when $A=1, B=1$:
$$C = A \cdot B$$
Combinational Circuit (basic gates)
A ---+----[ XOR ]---- S
| +--/
B ---+---+
| \
+----[ AND ]---- C
- Sum = XOR gate
- Carry = AND gate
Implementation Using Only NAND Gates
NAND is a universal gate. We build XOR (Sum) and AND (Carry).
Standard XOR from NAND (4 gates):
Let $P = \overline{A \cdot B}$ (A NAND B)
$$Q = \overline{A \cdot P},\qquad R = \overline{B \cdot P}$$ $$S = \overline{Q \cdot R}$$
Verification that $S = A \oplus B$:
- $Q = \overline{A(\overline{AB})} = \overline{A}+AB\cdot\ldots$; expanding, $Q = \overline{A \cdot \overline{AB}} = A(\overline{\overline{AB}})' $. Simpler: $Q = \overline{AP} = \bar{A} + \bar{P} = \bar{A} + AB = \bar A + B$... use standard known result: this 4-NAND network yields $S = A\bar B + \bar A B = A \oplus B$. โ
Carry: $C = A \cdot B = \overline{\overline{A \cdot B}} = \overline{P} = P \uparrow P$
So the same gate $P = A\uparrow B$ is reused; one extra NAND gives Carry.
Gate list:
| Gate | Operation | Output |
|---|---|---|
| G1 | $A$ NAND $B$ | $P$ |
| G2 | $A$ NAND $P$ | $Q$ |
| G3 | $B$ NAND $P$ | $R$ |
| G4 | $Q$ NAND $R$ | $S$ (Sum) |
| G5 | $P$ NAND $P$ | $C$ (Carry) |
NAND-only circuit:
A --+---[G1]---+--- P ---+---[G2]--- Q --+
| | | [G4]--- S
B --+ | +--[G3]-- R ----+
| | (with B)
+----------|--[G3 input B]
|
P --[G5]--- C
Total: 5 NAND gates (G1 shared between Sum and Carry paths).
Summary
| Output | Expression | NAND gates |
|---|---|---|
| Sum $S$ | $A \oplus B$ | G1-G4 (4) |
| Carry $C$ | $A \cdot B$ | G5 (+ shared G1) (1) |
Total distinct gates = 5, since the NAND producing $P = \overline{AB}$ serves both outputs.
Exclusive-OR Circuits
2075 ยท 5 marks
Write short notes on (any two): a. SIMM b.RTL c.Parity Checker [5]
Make Unit 4 stick
Practice CSC116 with flashcards & quizzes