Digital Electronics : Comprehensive Solved Problems for Electrical Sciences

Overview

  1. Number Systems - Binary, decimal, octal, hexadecimal with conversion examples

  2. Binary Arithmetic - Addition and subtraction with detailed examples

  3. Complements - 1’s and 2’s complement methods with subtraction examples

  4. Logic Gates - All 7 gates (AND, OR, NOT, NAND, NOR, XOR, XNOR) with truth tables

  5. Boolean Algebra - All laws, theorems, and simplification techniques

  6. Standard Forms - SOP/POS, minterms/maxterms with conversion methods

  7. NAND/NOR Realization - Universal gate implementations

Number Systems

Number Systems - Overview

Common Number Systems

Why Study Number Systems?

Digital systems work exclusively with binary numbers. Understanding conversions between different bases is essential for digital design, computer programming, and hardware interfacing.

Key Concept

Any number in base \(r\) can be represented as: \[N = d_n \times r^n + d_{n-1} \times r^{n-1} + \ldots + d_1 \times r^1 + d_0 \times r^0\]

Decimal to Other Bases

Problem 1: Decimal to Binary Conversion

Problem Convert the decimal number \((156)_{10}\) to binary.

Solution

Method: Repeated division by 2
Division Quotient Remainder
\(156 \div 2\) 78 0 (LSB)
\(78 \div 2\) 39 0
\(39 \div 2\) 19 1
\(19 \div 2\) 9 1
\(9 \div 2\) 4 1
\(4 \div 2\) 2 0
\(2 \div 2\) 1 0
\(1 \div 2\) 0 1 (MSB)

Answer: \((156)_{10} = (10011100)_2\)

Verification: \[\begin{aligned} &128 + 16 + 8 + 4 \\ &= 156 \checkmark \end{aligned}\]

Problem 2: Decimal to Octal Conversion

Problem Convert \((237)_{10}\) to octal.

Solution

Method: Repeated division by 8
Division Quotient Remainder
\(237 \div 8\) 29 5 (LSD)
\(29 \div 8\) 3 5
\(3 \div 8\) 0 3 (MSD)

Reading remainders from bottom to top

Answer: \((237)_{10} = (355)_8\)

Verification: \[\begin{aligned} &3 \times 8^2 + 5 \times 8^1 + 5 \times 8^0 \\ &= 192 + 40 + 5 \\ &= 237 \checkmark \end{aligned}\]

Problem 3: Decimal to Hexadecimal Conversion

Problem Convert \((2890)_{10}\) to hexadecimal.

Solution

Method: Repeated division by 16
Division Quotient Remainder
\(2890 \div 16\) 180 10 = A
\(180 \div 16\) 11 4
\(11 \div 16\) 0 11 = B

Answer: \((2890)_{10} = (B4A)_{16}\)

Verification: \[\begin{aligned} &11 \times 256 + 4 \times 16 + 10 \\ &= 2816 + 64 + 10 \\ &= 2890 \checkmark \end{aligned}\]

Other Bases to Decimal

Problem 4: Binary to Decimal Conversion

Problem Convert the binary number \((11010110)_2\) to decimal.

Solution

Method: Multiply each bit by its positional weight and sum

\[\begin{aligned} (11010110)_2 &= 1 \times 2^7 + 1 \times 2^6 + 0 \times 2^5 + 1 \times 2^4 \\ &\quad + 0 \times 2^3 + 1 \times 2^2 + 1 \times 2^1 + 0 \times 2^0 \\ &= 128 + 64 + 0 + 16 + 0 + 4 + 2 + 0 \\ &= 214 \end{aligned}\]

Answer: \((11010110)_2 = (214)_{10}\)

Problem 5: Octal to Decimal Conversion

Problem Convert \((742)_8\) to decimal.

Solution

Method: Multiply each digit by its positional weight

\[\begin{aligned} (742)_8 &= 7 \times 8^2 + 4 \times 8^1 + 2 \times 8^0 \\ &= 7 \times 64 + 4 \times 8 + 2 \times 1 \\ &= 448 + 32 + 2 \\ &= 482 \end{aligned}\]

Answer: \((742)_8 = (482)_{10}\)

Problem 6: Hexadecimal to Decimal Conversion

Problem Convert \((2A5F)_{16}\) to decimal.

Solution

Remember: A=10, B=11, C=12, D=13, E=14, F=15

\[\begin{aligned} (2A5F)_{16} &= 2 \times 16^3 + 10 \times 16^2 + 5 \times 16^1 + 15 \times 16^0 \\ &= 2 \times 4096 + 10 \times 256 + 5 \times 16 + 15 \times 1 \\ &= 8192 + 2560 + 80 + 15 \\ &= 10847 \end{aligned}\]

Answer: \((2A5F)_{16} = (10847)_{10}\)

Direct Conversions Between Bases

Problem 7: Binary to Hexadecimal Conversion

Problem Convert \((10110111001101)_2\) to hexadecimal.

Solution

Method: Group bits in sets of 4 from right to left
Binary Group: 10 1101 1100 1101
Pad with 0s: 0010 1101 1100 1101
Hex Digit: 2 D C D

Answer: \((10110111001101)_2 = (2DCD)_{16}\)

Quick Reference

Each hexadecimal digit represents exactly 4 binary digits.

Problem 8: Binary to Octal Conversion

Problem Convert \((101110111)_2\) to octal.

Solution

Method: Group bits in sets of 3 from right to left
Binary Group: 101 110 111
Octal Digit: 5 6 7

Answer: \((101110111)_2 = (567)_8\)

Verification: Convert both to decimal

Problem 9: Hexadecimal to Binary Conversion

Problem Convert \((3AF)_{16}\) to binary.

Solution

Method: Replace each hex digit with 4 binary digits
Hex Digit: 3 A F
Binary: 0011 1010 1111

Answer: \((3AF)_{16} = (001110101111)_2 = (1110101111)_2\)

Verification:

Problem 10: Octal to Hexadecimal Conversion

Problem Convert \((725)_8\) to hexadecimal.

Solution

Method: Convert through binary as intermediate step

Step 1: Octal to Binary
(each octal digit \(\to\) 3 bits)

Octal: 7 2 5
Binary: 111 010 101

Result: \((111010101)_2\)

Step 2: Binary to Hexadecimal
(group 4 bits from right)

Binary: 0001 1101 0101
Hex: 1 D 5

Answer: \((725)_8 = (1D5)_{16}\)

Binary Arithmetic

Binary Addition

Binary Addition Rules

Basic Rules

A B Sum Carry
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1

With Carry When adding three bits (including carry):

Problem 11: Simple Binary Addition

Problem Add the binary numbers \((1011)_2\) and \((1110)_2\).

Solution

1 1 0 (Carry)
1 0 1 1
+ 1 1 1 0
1 1 0 0 1

Step-by-step:

  • Position 0: \(1 + 0 = 0\) (no carry)

  • Position 1: \(1 + 1 = 10\) (write 0, carry 1)

  • Position 2: \(0 + 1 + 1_{\text{carry}} = 10\) (write 0, carry 1)

  • Position 3: \(1 + 1 + 1_{\text{carry}} = 11\) (write 1, carry 1)


Answer: \((1011)_2 + (1110)_2 = (11001)_2\)

Verification: \(11 + 14 = 25~\checkmark\)

Problem 12: Multi-bit Binary Addition

Problem Add \((10110101)_2 + (11011011)_2\)

Solution

1 1 1 1 1 0 1 (Carry)
1 0 1 1 0 1 0 1
+ 1 1 0 1 1 0 1 1
1 1 0 0 1 0 0 0 0

Answer:

\((10110101)_2 + (11011011)_2 = (110010000)_2\)

Verification:

  • \((10110101)_2 = 181_{10}\)

  • \((11011011)_2 = 219_{10}\)

  • Sum = \(400_{10} = (110010000)_2~\checkmark\)

Binary Multiplication

Binary Multiplication Rules

Basic Rules Binary multiplication is simpler than decimal:

A B A \(\times\) B
0 0 0
0 1 0
1 0 0
1 1 1

Process

  1. Multiply each bit of multiplicand by each bit of multiplier

  2. Shift partial products appropriately

  3. Add all partial products

Problem 13: Binary Multiplication

Problem Multiply \((1101)_2 \times (101)_2\)

Solution

1 1 0 1
\(\times\) 1 0 1
1 1 0 1 (multiply by 1)
0 0 0 0 (multiply by 0, shift)
+ 1 1 0 1 (multiply by 1, shift)
1 0 0 0 0 0 1

Answer: \((1101)_2 \times (101)_2 = (1000001)_2\)

Verification: \(13 \times 5 = 65~\checkmark\)

Problem 14: Larger Binary Multiplication

Problem Multiply \((1110)_2 \times (1011)_2\)

Solution

1 1 1 0
\(\times\) 1 0 1 1
1 1 1 0
1 1 1 0
0 0 0 0
+ 1 1 1 0
1 0 0 1 1 0 1 0

Answer: \((1110)_2 \times (1011)_2 = (10011010)_2\)

Verification: \(14 \times 11 = 154 = (10011010)_2~\checkmark\)

Complements and Binary Subtraction

Complements - Overview

Why Complements?

Two Types of Complements For base \(r\), there are two types:

  1. \((r-1)\)’s Complement: For binary: 1’s complement

  2. \(r\)’s Complement: For binary: 2’s complement

Key Concepts

Finding Complements

Example: Complements of \((1010)_2\)


1’s Complement:

  • Original: 1010

  • Flip all bits: 0101

  • Answer: \((0101)_2\)

2’s Complement:

  • 1’s complement: 0101

  • Add 1: \(0101 + 1 = 0110\)

  • Answer: \((0110)_2\)

Alternative Method for 2’s Complement

  • Scan from right to left

  • Copy bits until first 1 (including it)

  • Then flip remaining bits

  • Example: \(1010 \rightarrow 0110\)

  • (copy 10, flip 10)

Problem 15: Subtraction using 1’s Complement

Problem Subtract \((1010)_2 - (0110)_2\) using 1’s complement.

Solution

Step 1: Find 1’s complement of subtrahend (0110) \[\text{1's complement of } 0110 = 1001\]

Step 2: Add minuend and 1’s complement

1 0 1 0
+ 1 0 0 1
1 0 0 1 1

Step 3: Add end-around carry to result \[0011 + 1_{\text{carry}} = 0100\] Answer: \((1010)_2 - (0110)_2 = (0100)_2 = 4_{10}\)

Verification: \(10 - 6 = 4~ \checkmark\)

Problem 16: Subtraction using 2’s Complement (Positive Result)

Problem Subtract \((10110)_2 - (01101)_2\) using 2’s complement.

Solution

Step 1: Find 2’s complement of subtrahend (01101)

Step 2: Add minuend and 2’s complement

1 0 1 1 0
+ 1 0 0 1 1
1 0 1 0 0 1

Step 3: Discard the carry (indicates positive result) Answer: \[\begin{aligned} (10110)_2 - (01101)_2 & = (01001)_2 \\ &= 9_{10} \end{aligned}\]

Verification: \(22 - 13 = 9~\checkmark\)

Problem 17: Subtraction using 2’s Complement (Negative Result)

Problem Subtract \((0110)_2 - (1010)_2\) using 2’s complement.

Solution

Step 1:
Find 2’s complement of subtrahend (1010)

  • 1’s complement: 0101

  • 2’s complement: \(0101 + 1 = 0110\)

Step 2: Add minuend and 2’s complement

0 1 1 0
+ 0 1 1 0
1 1 0 0

Step 3: No carry! Result is negative. Find 2’s complement of result:

  • 1’s complement of 1100: 0011

  • 2’s complement: \(0011 + 1 = 0100\)

Answer: \[\begin{aligned} (0110)_2 - (1010)_2 & = -(0100)_2 \\ &= -4_{10} \end{aligned}\]

Verification: \(6 - 10 = -4\) \(\checkmark\)

Problem 18: Subtraction using 1’s Complement (Negative Result)

Problem Subtract \((0011)_2 - (1001)_2\) using 1’s complement.

Solution

Step 1: Find 1’s complement of 1001 \[\text{1's complement: } 0110\]

Step 2: Add

0 0 1 1
+ 0 1 1 0
1 0 0 1

Step 3: No end-around carry! Result is negative.


Take 1’s complement of result: \(\overline{1001} = 0110\)

Answer: \[\begin{aligned} (0011)_2 - (1001)_2 &= -(0110)_2 \\ &= -6_{10} \end{aligned}\]

Verification: \(3 - 9 = -6\) \(\checkmark\)

Logic Gates

Logic Gates - Overview

What are Logic Gates?

Logic gates are the basic building blocks of digital circuits that perform logical operations on one or more binary inputs to produce a single binary output.

Classification

Why Universal Gates?

NAND and NOR gates are called universal because any Boolean function can be implemented using only NAND gates or only NOR gates.

Basic Logic Gates

Problem 19: AND Gate

Definition

AND gate produces output 1 only when ALL inputs are 1.

Boolean Expression:

\(Y = A \cdot B\) or \(Y = AB\)

Truth Table

A B Y = A·B
0 0 0
0 1 0
1 0 0
1 1 1
and gate

Applications

  • Enable/Disable circuits

  • Masking operations

  • Multiplication in arithmetic circuits

Problem 20: OR Gate

Definition OR gate produces output 1 when ANY input is 1.

Boolean Expression: \(Y = A + B\)

Truth Table

A B Y = A+B
0 0 0
0 1 1
1 0 1
1 1 1
and gate

Applications

  • Multiple input selection

  • Addition in arithmetic circuits

  • Alarm systems

Problem 21: NOT Gate (Inverter)

Definition NOT gate inverts the input signal.

Boolean Expression: \(Y = \overline{A}\) or \(Y = A'\)

Truth Table

A Y = \(\overline{A}\)
0 1
1 0
and gate

Key Properties

  • Single input gate

  • Also called inverter

  • Double inversion: \(\overline{\overline{A}} = A\)

Universal Gates

Problem 22: NAND Gate

Definition

  • NAND = NOT-AND (inverted AND)

  • Output is 0 only when ALL inputs are 1.

  • Boolean: \(Y = \overline{A \cdot B}\)

Truth Table

A B Y = \(\overline{AB}\)
0 0 1
0 1 1
1 0 1
1 1 0
and gate

Universal Gate Can implement:

  • NOT: Connect inputs together

  • AND: NAND + NOT

  • OR: NOT inputs + NAND

Problem 23: NOR Gate

Definition

  • NOR = NOT-OR (inverted OR)

  • Output is 1 only when ALL inputs are 0.

  • Boolean: \(Y = \overline{A + B}\)

Truth Table

A B Y = \(\overline{A+B}\)
0 0 1
0 1 0
1 0 0
1 1 0
and gate

Universal Gate Can implement:

  • NOT: Connect inputs together

  • OR: NOR + NOT

  • AND: NOT inputs + NOR

Special Purpose Gates

Problem 24: XOR Gate (Exclusive-OR)

Definition

  • XOR outputs 1 when inputs are DIFFERENT.

  • Boolean: \(Y = A \oplus B = A\overline{B} + \overline{A}B\)

Truth Table

A B \(Y = A \oplus B\)
0 0 0
0 1 1
1 0 1
1 1 0
and gate

Applications

  • Adder circuits (sum bit)

  • Parity checkers

  • Comparators

  • Encryption circuits

Problem 25: XNOR Gate (Exclusive-NOR)

Definition

  • XNOR outputs 1 when inputs are SAME.

  • Boolean: \(Y = \overline{A \oplus B} = AB + \overline{A}\,\overline{B}\)

Truth Table

A B Y = \(\overline{A \oplus B}\)
0 0 1
0 1 0
1 0 0
1 1 1
and gate

Applications

  • Equality detector

  • Parity generators

  • Coincidence detector

  • Controlled inverter

Boolean Algebra

Boolean Algebra - Fundamental Laws

Identity Laws \[\begin{aligned} A + 0 &= A \\ A \cdot 1 &= A \end{aligned}\]

Null (Dominance) Laws \[\begin{aligned} A + 1 &= 1 \\ A \cdot 0 &= 0 \end{aligned}\]

Idempotent Laws \[\begin{aligned} A + A &= A \\ A \cdot A &= A \end{aligned}\]

Complement Laws \[\begin{aligned} A + \overline{A} &= 1 \\ A \cdot \overline{A} &= 0 \\ \overline{\overline{A}} &= A \end{aligned}\]

Commutative Laws \[\begin{aligned} A + B &= B + A \\ A \cdot B &= B \cdot A \end{aligned}\]

Boolean Algebra - More Laws

Associative Laws \[\begin{aligned} A + (B + C) &= (A + B) + C \\ A \cdot (B \cdot C) &= (A \cdot B) \cdot C \end{aligned}\]

Distributive Laws \[\begin{aligned} A(B + C) &= AB + AC \\ A + BC &= (A + B)(A + C) \end{aligned}\]

Absorption Laws \[\begin{aligned} A + AB &= A \\ A(A + B) &= A \\ A + \overline{A}B &= A + B \\ A(\overline{A} + B) &= AB \end{aligned}\]

De Morgan’s Theorems

First Theorem \(\overline{A + B} = \overline{A} \cdot \overline{B}\)

The complement of a sum equals the product of complements.

Second Theorem \(\overline{A \cdot B} = \overline{A} + \overline{B}\)

The complement of a product equals the sum of complements.

Extended Forms For multiple variables: \[\begin{aligned} \overline{A + B + C} &= \overline{A} \cdot \overline{B} \cdot \overline{C} \\ \overline{ABC} &= \overline{A} + \overline{B} + \overline{C} \end{aligned}\]

Key Point Break the bar, change the operation (AND \(\longleftrightarrow\) OR)

Problem 26: Truth Table Construction

Problem Construct the truth table for \(F = AB + \overline{A}C\)

Solution

A B C \(AB\) \(\overline{A}C\) \(F = AB + \overline{A}C\)
0 0 0 0 0 0
0 0 1 0 1 1
0 1 0 0 0 0
0 1 1 0 1 1
1 0 0 0 0 0
1 0 1 0 0 0
1 1 0 1 0 1
1 1 1 1 0 1
  • Answer: Function outputs 1 for rows 1, 3, 6, and 7

  • In minterm notation: \(F(A,B,C) = \sum m(1, 3, 6, 7)\)

Problem 27: Boolean Simplification Using Laws

Problem Simplify: \(F = A\overline{B}C + ABC + A\overline{B}\,\overline{C}\)

Solution

\[\begin{aligned} F &= A\overline{B}C + ABC + A\overline{B}\,\overline{C} \\ &= A\overline{B}(C + \overline{C}) + ABC \quad \text{(Factor } A\overline{B}\text{)} \\ &= A\overline{B}(1) + ABC \quad \text{(Complement law)} \\ &= A\overline{B} + ABC \\ &= A(\overline{B} + BC) \quad \text{(Factor } A\text{)} \\ &= A(\overline{B} + C) \quad \text{(Absorption: } \overline{B} + BC = \overline{B} + C\text{)} \end{aligned}\]

  • Answer:

    \[F = A(\overline{B} + C) = A\overline{B} + AC\]

  • Gate Reduction: Original requires 7 gates, simplified requires 4 gates!

Problem 28: Simplification Using Consensus Theorem

Problem Simplify: \(F = AB + \overline{A}C + BC\)

Solution

  • Consensus Theorem:

    \[XY + \overline{X}Z + YZ = XY + \overline{X}Z\]

  • The term \(BC\) is the consensus term and can be eliminated.

    \[\begin{aligned} F &= AB + \overline{A}C + BC \\ &= AB + \overline{A}C \quad \text{(Apply consensus theorem)} \end{aligned}\]

  • Verification by expansion: \[\begin{aligned} BC &= BC(A + \overline{A}) \\ &= ABC + \overline{A}BC \\ &= ABC + \overline{A}BC \subseteq AB + \overline{A}C \end{aligned}\]

  • Answer: \(F = AB + \overline{A}C\)

Problem 29: De Morgan’s Theorem Application

Problem Apply De Morgan’s theorem: \(\overline{(A + B)(C + D)}\)

Solution

Verification Can verify by constructing truth tables for both expressions.

Problem 30: Complex Simplification

Problem Simplify: \(F = \overline{A}BC + A\overline{B}C + AB\overline{C} + ABC\)

Solution

\[\begin{aligned} F &= \overline{A}BC + A\overline{B}C + AB\overline{C} + ABC \\ &= \overline{A}BC + ABC + A\overline{B}C + AB\overline{C} \quad \text{(Rearrange)} \\ &= BC(\overline{A} + A) + A\overline{B}C + AB\overline{C} \quad \text{(Factor)} \\ &= BC + A\overline{B}C + AB\overline{C} \quad \text{(Complement law)} \\ &= BC + AC(\overline{B} + B) \quad \text{(Factor } AC\text{, note: } AB\overline{C} = A\overline{C}B\text{)} \\ &= BC + AC \end{aligned}\]

  • Alternative approach: \[\begin{aligned} F & = C(\overline{A}B + A\overline{B} + AB) + AB\overline{C}\\ & = C(A + B) + AB\overline{C}\\ &= AC + BC + AB\overline{C} \\ &= AC + BC \end{aligned}\]

  • Answer:

    \(F = BC + AC = C(A + B)\)

Standard Forms of Boolean Functions

Standard Forms - Overview

Two Standard Forms

  1. Sum of Products (SOP): Sum of minterms

    • Example: \(F = AB + \overline{A}C + BC\)

    • Two-level AND-OR implementation

  2. Product of Sums (POS): Product of maxterms

    • Example: \(F = (A + B)(A + C)(\overline{B} + C)\)

    • Two-level OR-AND implementation

Canonical Forms

Minterms and Maxterms for 3 Variables

Minterms

Index Minterm
\(m_0\) \(\overline{A}\,\overline{B}\,\overline{C}\)
\(m_1\) \(\overline{A}\,\overline{B}C\)
\(m_2\) \(\overline{A}B\overline{C}\)
\(m_3\) \(\overline{A}BC\)
\(m_4\) \(A\overline{B}\,\overline{C}\)
\(m_5\) \(A\overline{B}C\)
\(m_6\) \(AB\overline{C}\)
\(m_7\) \(ABC\)

Maxterms

Index Maxterm
\(M_0\) \(A + B + C\)
\(M_1\) \(A + B + \overline{C}\)
\(M_2\) \(A + \overline{B} + C\)
\(M_3\) \(A + \overline{B} + \overline{C}\)
\(M_4\) \(\overline{A} + B + C\)
\(M_5\) \(\overline{A} + B + \overline{C}\)
\(M_6\) \(\overline{A} + \overline{B} + C\)
\(M_7\) \(\overline{A} + \overline{B} + \overline{C}\)

Important Relationships

Problem 31: Convert to Canonical SOP

Problem Convert \(F = A + BC\) to canonical Sum of Products form.

Solution

Step 1: Expand term A (missing B and C) \[\begin{aligned} A &= A(B + \overline{B}) = AB + A\overline{B} \\ AB &= AB(C + \overline{C}) = ABC + AB\overline{C} \\ A\overline{B} &= A\overline{B}(C + \overline{C}) = A\overline{B}C + A\overline{B}\,\overline{C} \end{aligned}\]

Step 2: Expand term BC (missing A) \(BC = BC(A + \overline{A}) = ABC + \overline{A}BC\)

Step 3: Combine and remove duplicates \(F = ABC + AB\overline{C} + A\overline{B}C + A\overline{B}\,\overline{C} + \overline{A}BC\) \(= m_3 + m_4 + m_5 + m_6 + m_7\)

Answer: \(F = \sum m(3, 4, 5, 6, 7)\)

Problem 32: SOP from Truth Table

Problem Write SOP expression from the truth table:

A B C F
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 1
1 0 0 1
1 0 1 0
1 1 0 1
1 1 1 1

Solution

  • Method: Write minterm for each row where F = 1 \[\begin{aligned} F &= m_1 + m_3 + m_4 + m_6 + m_7 \\ &= \overline{A}\,\overline{B}C + \overline{A}BC + A\overline{B}\,\overline{C} + AB\overline{C} + ABC \end{aligned}\]

  • Answer: \(F(A,B,C) = \sum m(1, 3, 4, 6, 7)\)

  • Simplified form can be obtained using Boolean algebra

Problem 33: SOP to POS Conversion

Problem Given

\[F(A,B,C) = \sum m(1,3,5,7),\]

express in POS form.

  • Answer: \(F = \prod M(0, 2, 4, 6)\)

  • Observation: After simplification, \(F = C\)

Solution

Step 1: Identify missing minterms (where F = 0) \[F = 0 \text{ for } m_0, m_2, m_4, m_6\]

Step 2: Convert to maxterms using relationship \[F = \prod M(0, 2, 4, 6)\]

Step 3: Write out maxterms \[\begin{aligned} F &= M_0 \cdot M_2 \cdot M_4 \cdot M_6 \\ &= (A + B + C)(A + \overline{B} + C)(\overline{A} + B + C)(\overline{A} + \overline{B} + C) \end{aligned}\]

Problem 34: POS from Truth Table

Problem Write POS expression for the function with F = 0 at rows 0, 2, 5:

Solution

  • Method: Write maxterm for each row where F = 0

  • For row 0 (A=0, B=0, C=0): \(M_0 = A + B + C\)

  • For row 2 (A=0, B=1, C=0): \(M_2 = A + \overline{B} + C\)

  • For row 5 (A=1, B=0, C=1): \(M_5 = \overline{A} + B + \overline{C}\)

\[\begin{aligned} F &= M_0 \cdot M_2 \cdot M_5 \\ &= (A + B + C)(A + \overline{B} + C)(\overline{A} + B + \overline{C}) \end{aligned}\]

Answer: \[F(A,B,C) = \prod M(0, 2, 5)\]

Alternative notation: \[F = \sum m(1, 3, 4, 6, 7)\]

Problem 35: Convert Non-Standard to Standard SOP

Problem Convert \(F = A(B + C)\) to standard SOP form.

Solution

Step 1: Distribute to get SOP \(F = AB + AC\)

Step 2: Expand AB (missing C) \[AB = AB(C + \overline{C}) = ABC + AB\overline{C}\]

Step 3: Expand AC (missing B) \[AC = AC(B + \overline{B}) = ABC + A\overline{B}C\]

Step 4: Combine (ABC appears twice, write once) \[F = ABC + AB\overline{C} + A\overline{B}C\]

Answer:

\(F = \sum m(5, 6, 7)\)

where:

  • \(m_5 = A\overline{B}C\) (binary: 101)

  • \(m_6 = AB\overline{C}\) (binary: 110)

  • \(m_7 = ABC\) (binary: 111)

Problem 36: Conversion Between SOP and POS

Problem Given \(F(A,B,C) = \sum m(0,2,5,7)\), find:

  1. Canonical SOP

  2. Canonical POS

Solution

Canonical SOP \[\begin{aligned} F &= m_0 + m_2 + m_5 + m_7 \\ &= \overline{A}\,\overline{B}\,\overline{C} + \overline{A}B\overline{C} + A\overline{B}C + ABC \end{aligned}\]

Answer: Both forms represent the same function! Canonical POS

Missing minterms: 1, 3, 4, 6 \(\to\) Use maxterms: \(M_1, M_3, M_4, M_6\) \[\begin{aligned} F &= \prod M(1, 3, 4, 6) \\ &= (A+B+\overline{C})(A+\overline{B}+\overline{C})\\ &(\overline{A}+B+C)(\overline{A}+\overline{B}+C) \end{aligned}\]

NAND and NOR Gate Realization

Universal Gates - Why NAND and NOR?

Advantages of Universal Gates

Implementation Strategy

For NAND realization:

  1. Express function in SOP form

  2. Apply two-level NAND-NAND logic

For NOR realization:

  1. Express function in POS form

  2. Apply two-level NOR-NOR logic

Basic Gates Using NAND

NOT Using NAND Connect both inputs together: \[Y = \overline{A \cdot A} = \overline{A}\]

AND Using NAND NAND followed by NOT: \[Y = \overline{\overline{A \cdot B}} = A \cdot B\]

OR Using NAND NOT inputs, then NAND: \[Y = \overline{\overline{A} \cdot \overline{B}} = A + B\] (By De Morgan’s theorem)

Key Insight NAND with inverted inputs = OR gate

Basic Gates Using NOR

NOT Using NOR Connect both inputs together: \[Y = \overline{A + A} = \overline{A}\]

OR Using NOR NOR followed by NOT: \[Y = \overline{\overline{A + B}} = A + B\]

AND Using NOR NOT inputs, then NOR: \[Y = \overline{\overline{A} + \overline{B}} = A \cdot B\] (By De Morgan’s theorem)

Key Insight NOR with inverted inputs = AND gate

Problem 37: NAND Gate Realization - Simple

Problem Implement \(F = AB + CD\) using only NAND gates.

Solution

Step 1: Function is already in SOP form

Step 2: Apply double negation (De Morgan’s) \[F = AB + CD = \overline{\overline{AB + CD}} = \overline{\overline{AB} \cdot \overline{CD}}\]

Step 3: NAND implementation structure

  • Level 1:

    • NAND gate 1: Inputs A, B \(\to\) Output \(\overline{AB}\)

    • NAND gate 2: Inputs C, D \(\to\) Output \(\overline{CD}\)

  • Level 2:

    • NAND gate 3: Inputs \(\overline{AB}\), \(\overline{CD}\) \(\to\) Output F

Answer

  • Total gates required = 3 NAND gates

  • Circuit: Two-level NAND-NAND implementation

Problem 38: NAND Realization - Three Terms

Problem Implement \(F = AB + \overline{A}C + BC\)

using only NAND gates.

Answer

Total = 1 NOT + 4 NAND

= 5 gates

Solution

Step 1: Apply double negation \[F = AB + \overline{A}C + BC = \overline{\overline{AB + \overline{A}C + BC}}\]

Step 2: Apply De Morgan’s theorem \[F = \overline{\overline{AB} \cdot \overline{\overline{A}C} \cdot \overline{BC}}\]

Step 3: NAND implementation

  • Level 1: Generate product terms

    • NAND(A, B) \(\to\) \(\overline{AB}\)

    • NAND(\(\overline{A}\), C) \(\to\) \(\overline{\overline{A}C}\) (need NOT for A first)

    • NAND(B, C) \(\to\) \(\overline{BC}\)

  • Level 2: NAND of all outputs \(\to\) F

Problem 39: NOR Gate Realization - Simple

Problem Implement

\(F = (A + B)(C + D)\)

using only NOR gates.

Answer

  • Total gates required = 3 NOR gates

  • Circuit: Two-level NOR-NOR implementation

Solution

Step 1: Function is already in POS form

Step 2: Apply double negation (De Morgan’s) \[F = (A + B)(C + D) = \overline{\overline{(A + B)(C + D)}}\] \[= \overline{\overline{(A + B)} + \overline{(C + D)}}\]

Step 3: NOR implementation structure

  • Level 1:

    • NOR gate 1: Inputs A, B \(\to\) Output \(\overline{(A + B)}\)

    • NOR gate 2: Inputs C, D \(\to\) Output \(\overline{(C + D)}\)

  • Level 2:

    • NOR gate 3: Inputs from gates 1 and 2 \(\to\) Output F

Problem 40: NOR Realization - Multiple Terms

Problem Implement \(F = (A + B)(A + C)(\overline{B} + C)\)

using only NOR gates.

Answer Total = 1 NOT + 4 NOR = 5 gates

Solution

Step 1: Apply double negation \[F = (A + B)(A + C)(\overline{B} + C) = \overline{\overline{(A+B)(A+C)(\overline{B}+C)}}\]

Step 2: Apply De Morgan’s \[F = \overline{\overline{(A+B)} + \overline{(A+C)} + \overline{(\overline{B}+C)}}\]

Step 3: NOR implementation

  • Level 1: Generate sum terms

    • NOR(A, B) \(\to\) \(\overline{(A + B)}\)

    • NOR(A, C) \(\to\) \(\overline{(A + C)}\)

    • NOR(\(\overline{B}\), C) \(\to\) \(\overline{(\overline{B} + C)}\) (need NOT for B)

  • Level 2: 3-input NOR of outputs \(\to\) F

Problem 41: NAND Implementation of XOR

Problem Implement XOR function \(F = A \oplus B = A\overline{B} + \overline{A}B\) using NAND gates only.

Solution

Method 1: Direct from SOP \[\begin{aligned} F &= A\overline{B} + \overline{A}B \\ &= \overline{\overline{A\overline{B}} \cdot \overline{\overline{A}B}} \end{aligned}\] Implementation:

  • NOT gates: \(\overline{A}\), \(\overline{B}\) (2 NAND gates with tied inputs)

  • Term 1: NAND(A, \(\overline{B}\)) \(\to\) \(\overline{A\overline{B}}\)

  • Term 2: NAND(\(\overline{A}\), B) \(\to\) \(\overline{\overline{A}B}\)

  • Final: NAND of above two outputs \(\to\) F

Method 2: Efficient 4-NAND implementation

  • Gate 1: NAND(A, B) \(\to\) \(X = \overline{AB}\)

  • Gate 2: NAND(A, X) \(\to\) \(Y = \overline{A\overline{AB}} = \overline{A} + B\)

  • Gate 3: NAND(B, X) \(\to\) \(Z = \overline{B\overline{AB}} = A + \overline{B}\)

  • Gate 4: NAND(Y, Z) \(\to\) \(F = A \oplus B\)

Answer Minimum = 4 NAND gates

Problem 42: Converting AND-OR to NAND-NAND

Problem Convert the following AND-OR circuit to NAND-NAND: \(F = ABC + \overline{A}BC + A\overline{B}C\)

Solution

Step 1: Simplify first if possible \[\begin{aligned} F &= ABC + \overline{A}BC + A\overline{B}C \\ &= BC(A + \overline{A}) + A\overline{B}C \\ &= BC + A\overline{B}C \\ &= C(B + A\overline{B}) \\ &= C(A + B) \end{aligned}\] Step 2: Express in NAND form \[F = C(A + B) = \overline{\overline{C(A+B)}} = \overline{\overline{C} + \overline{(A+B)}}\]

Step 3: NAND implementation

  • Gate 1: NAND(A, B) with both inverted = OR

  • Gate 2: NAND(C, output of gate 1) = Final output

Answer: 3 NAND gates (2 for OR, 1 for AND)

Problem 43: Multilevel NAND Implementation

Problem Implement \(F = ((AB)C + D)E\) using only NAND gates.

Solution

Analysis: This is a multilevel function

Step 1: Identify levels

  • Level 1: \(AB\)

  • Level 2: \((AB)C\)

  • Level 3: \((AB)C + D\)

  • Level 4: \(((AB)C + D)E\)

Step 2: Convert each level to NAND

  • \(AB\) \(\to\) NAND(A,B) followed by NOT \(\to\) 2 NAND gates

  • \((AB)C\) \(\to\) NAND of previous with C, then NOT \(\to\) 2 NAND gates

  • \((AB)C + D\) \(\to\) Requires OR, implement with NAND

  • Final AND with E \(\to\) NAND then NOT

Answer: Requires 7 NAND gates

Note: Direct NAND-NAND conversion works best for 2-level circuits

Problem 44: NOR Implementation from Truth Table

Problem Implement using NOR gates: \(F(A,B,C) = \prod M(0,2,4,6)\)

Solution

Step 1: Write maxterms \[\begin{aligned} M_0 &= A + B + C \\ M_2 &= A + \overline{B} + C \\ M_4 &= \overline{A} + B + C \\ M_6 &= \overline{A} + \overline{B} + C \end{aligned}\]

Step 2: Product of sums \[\begin{aligned} F &= (A+B+C)(A+\overline{B}+C)\\ &~~(\overline{A}+B+C)(\overline{A}+\overline{B}+C) \end{aligned}\] Step 3: Apply De Morgan’s for NOR-NOR \[F = \overline{\overline{(A+B+C)} + \overline{(A+\overline{B}+C)} + \overline{(\overline{A}+B+C)} + \overline{(\overline{A}+\overline{B}+C)}}\]

Step 4: Implementation

  • Level 1: 4 NOR gates (one for each maxterm)

  • Level 2: 1 four-input NOR gate for final output

Answer: Total = 2 NOT + 5 NOR = 7 gates

After simplification, \(F = C\), needs only inverters!

Summary and Key Points

Summary - Number Systems

Key Concepts Covered

Quick Conversion Tips

Summary - Binary Arithmetic & Complements

Binary Arithmetic

Complements

Summary - Logic Gates

Seven Basic Gates

Gate Operation Symbol
AND \(Y = AB\) All 1 \(\to\) 1
OR \(Y = A + B\) Any 1 \(\to\) 1
NOT \(Y = \overline{A}\) Invert
NAND \(Y = \overline{AB}\) All 1 \(\to\) 0
NOR \(Y = \overline{A+B}\) All 0 \(\to\) 1
XOR \(Y = A \oplus B\) Different \(\to\) 1
XNOR \(Y = \overline{A \oplus B}\) Same \(\to\) 1

Remember NAND and NOR are universal gates!

Summary - Boolean Algebra

Essential Laws

  • Identity Laws

  • Null Laws

  • Idempotent Laws

  • Complement Laws

  • Commutative Laws

  • Associative Laws

  • Distributive Laws

  • Absorption Laws

  • De Morgan’s Theorems

  • Consensus Theorem

De Morgan’s - Most Important \[\overline{A + B} = \overline{A} \cdot \overline{B}\] \[\overline{A \cdot B} = \overline{A} + \overline{B}\] Break the bar, change the operation!

Summary - Standard Forms

SOP and POS

Relationship \(F = \sum m(a,b,c,...)\) and \(F = \prod M(\text{remaining indices})\)

Summary - Universal Gate Implementation

NAND Realization

  • Best for SOP expressions

  • Two-level NAND-NAND structure

  • Apply: \(F = \overline{\overline{AB} \cdot \overline{CD} \cdot ...}\)

NOR Realization

  • Best for POS expressions

  • Two-level NOR-NOR structure

  • Apply: \(F = \overline{\overline{(A+B)} + \overline{(C+D)} + ...}\)

Strategy

  1. Simplify Boolean expression first

  2. Choose appropriate form (SOP for NAND, POS for NOR)

  3. Apply double negation and De Morgan’s

Practice Tips

For Better Understanding

  1. Always verify conversions by converting back

  2. Draw truth tables for complex Boolean functions

  3. Practice simplification using multiple methods

  4. Verify gate implementations with truth tables

  5. Master De Morgan’s theorems - they’re everywhere!

Common Mistakes to Avoid