4 Combinational Logic

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.

Combinational Logic: notes

Design Procedure

A combinational circuit is a logic circuit whose output at any instant depends only on the input present at that instant, with no memory of past inputs. Because it needs no storage element, a combinational circuit is comparatively simple to design, though it may need more gates than an equivalent circuit with memory, since it cannot reuse a stored result.

The standard design procedure has the following stages:

  1. State the problem in words.
  2. Determine the number of input variables and output variables required.
  3. Assign a letter symbol to each input and output variable.
  4. Derive the truth table that defines the required relationship between inputs and outputs.
  5. Obtain the simplified Boolean expression for each output, using Boolean algebra or a K-map.
  6. Draw the logic diagram from the simplified expressions.

Throughout the design, the aim is to use the fewest gates, the fewest input connections, and the least propagation delay, since these determine the final circuit's cost and speed.

Adders

A half adder is a combinational circuit that adds two single bits, $x$ and $y$, producing a sum bit and a carry bit:

$x$$y$SumCarry
0000
0110
1010
1101

Reading the table directly gives $\text{Sum} = x \oplus y$ and $\text{Carry} = xy$, so a half adder needs only one XOR gate and one AND gate; since NAND and NOR are universal, it can equally be built from five NAND gates or five NOR gates.

A full adder extends this to three inputs, $x$, $y$ and a carry-in $z$, so that a carry generated by one bit position can be brought into the addition of the next:

$x$$y$$z$SumCarry
00000
00110
01010
01101
10010
10101
11001
11111

Simplifying the two output columns with a K-map gives

$$ \text{Sum} = x \oplus y \oplus z, \qquad \text{Carry} = xy + yz + xz $$

so the sum bit is the three-input XOR of $x$, $y$ and $z$, while the carry-out is 1 whenever at least two of the three inputs are 1.

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]

  1. Problem statement: Understand and state the requirement clearly. 2. Determine input/output variables: Assign symbols and decide the number of input/output lines. 3. Derive the truth table: List all $2^n$ input combinations with corresponding outputs. 4. Obtain simplified Boolean expressions: U...
Open this answer on its own page โ†’

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 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$).

DecABCDWXYZ
000001111
100011110
200101101
300111100
401001011
501011010
601101001
701111000
810000111
910010110
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.

Open this answer on its own page โ†’

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]

  • Number of inputs: 3 (let them be $A$ = MSB, $B$, $C$ = LSB) - Number of outputs: 1 (call it $F$) - Condition: $F = 1$ when the binary value of inputs is an even number No missing data. The problem is fully specified. --- Three input bits represent decimal values $0$ to $7$. Even numbers in rang...
Open this answer on its own page โ†’

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]

  • Number of inputs: 3 (call them $A, B, C$) - Number of outputs: 1 (call it $F$) - Condition: $F = 1$ when the binary value of $ABC$ is an odd number All required data is present. --- Let: - $A$ = MSB (weight 4) - $B$ = middle bit (weight 2) - $C$ = LSB (weight 1) The 3 bits represent decimal val...
Open this answer on its own page โ†’

2077 ยท 10 marks

Design a combinatorial circuit that generates 9's complement of a BCD number.[10]

The 9's complement of a BCD digit N is defined as: 9's complement = 9 - N Since BCD uses 4 bits to represent digits 0 through 9, we need a combinational circuit with 4 inputs (A, B, C, D) and 4 outputs (W, X, Y, Z). --- The BCD input represents digits 0-9. States 1010 to 1111 are invalid (don't c...

Open this answer on its own page โ†’

2077 ยท 5 marks

Design 4-bit even parity generator. [5]

A parity generator is a combinational circuit that generates a parity bit to be appended to a message before transmission. For even parity: the parity bit P is chosen such that the total number of 1s in all bits (message + parity bit) is even. --- Let the 4-bit message be: A, B, C, D The even par...

Open this answer on its own page โ†’

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]

  • Inputs: $x, y, z$ (3-bit, $x$ = MSB), range 0 to 7 - Outputs: $A, B, C$ ($A$ = MSB) - Rule: - Input in ${0,1,2,3}$ โ†’ output = input + 1 - Input in ${4,5,6,7}$ โ†’ output = input โˆ’ 1 Dec x y z Out(dec) A B C --------------------------------- 0 0 0 0 1 0 0 1 1 0 0 1 2 0 1 0 2 0 1 0 3 0 1 1 3 0 ...
Open this answer on its own page โ†’

Subtractors

2080 ยท 5 marks

Design a full subtractor with necessary tables and logic diagram. [5]

A full subtractor is a combinational circuit that performs subtraction of three bits: the minuend (A), the subtrahend (B), and the borrow-in (Bin) from the previous stage. It produces two outputs: the difference (D) and the borrow-out (Bout). --- Symbol Meaning ----------------- A Minuend B Subtr...

Open this answer on its own page โ†’

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]

A full subtractor is a combinational circuit that performs subtraction of three bits: minuend (x), subtrahend (y), and input borrow (Bin). It produces two outputs: Diff (difference) and Bout (output borrow). The operation performed is: x - y - Bin --- x y Bin Diff Bout ------------------------- 0...

Open this answer on its own page โ†’

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 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

ABSum (S)Carry (C)
0000
0110
1010
1101

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:

GateInputsOutput
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$
G4G2 NOR G3$\overline{\bar A B + A\bar B} = \overline{A\oplus B}$
G5G4 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

OutputExpressionNOR 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$.

Open this answer on its own page โ†’

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 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

ABSum (S)Carry (C)
0000
0110
1010
1101

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:

GateOperationOutput
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

OutputExpressionNAND 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.

Open this answer on its own page โ†’

Exclusive-OR Circuits

2075 ยท 5 marks

Write short notes on (any two): a. SIMM b.RTL c.Parity Checker [5]

--- SIMM stands for Single Inline Memory Module. It is a type of memory module used to add RAM (Random Access Memory) to a computer system. Key Points: - A SIMM is a small circuit board that holds several RAM chips and connects to the motherboard through an edge connector. - It is called "single ...

Open this answer on its own page โ†’