2 Boolean Algebra And Logic Gates

Digital Logic · Unit 2

Boolean Algebra and Logic Gates

Exam-focused notes for Boolean Algebra and Logic Gates (Digital Logic, BIT103): what the TU syllabus asks and how it has actually been tested, with 5 solved past questions from this unit.

Boolean Algebra and Logic Gates in short

Boolean algebra is the mathematics of digital circuits. Every logic circuit can be written as a Boolean expression, and simplifying the expression gives a cheaper circuit with fewer gates.

Boolean Algebra and Logic Gates: notes

Boolean theorems and De Morgan's laws

A Boolean variable takes only the values 0 or 1. The three basic operations are AND (written $A \cdot B$), OR (written $A + B$) and NOT (written $A'$ or $\bar{A}$).

LawAND formOR form
Identity$A \cdot 1 = A$$A + 0 = A$
Null$A \cdot 0 = 0$$A + 1 = 1$
Idempotent$A \cdot A = A$$A + A = A$
Complement$A \cdot A' = 0$$A + A' = 1$
Commutative$AB = BA$$A + B = B + A$
Associative$(AB)C = A(BC)$$(A+B)+C = A+(B+C)$
Distributive$A(B+C) = AB + AC$$A + BC = (A+B)(A+C)$
Absorption$A(A+B) = A$$A + AB = A$

Double negation says $(A')' = A$. The duality principle says that if you swap AND with OR and 0 with 1 in a true identity, you get another true identity.

De Morgan's laws:

$$(A + B)' = A' \cdot B' \qquad (AB)' = A' + B'$$

In words: the complement of a sum is the product of the complements. The complement of a product is the sum of the complements. The laws extend to any number of variables. They are proved with a truth table. For $A=0, B=1$: $(A+B)' = 0$ and $A'B' = 1 \cdot 0 = 0$, which match. Checking all four rows gives the same result.

Two more useful results are $A + A'B = A + B$ and the consensus theorem: $AB + A'C + BC = AB + A'C$.

What this unit covers

  • Boolean theorems and De Morgan's laws
  • Logic gates and universal gates
  • NAND and NOR gate realization
  • Exclusive-OR and exclusive-NOR gates
  • Boolean function simplification

NAND and NOR gate realization

2080 · 5 marks

Why NAND and NOR gates are called Universal logic gates? Realize NOR as Universal logic gates. [5]

NAND and NOR gates are called universal logic gates because any Boolean function or logic circuit can be implemented using only NAND gates or only NOR gates, without needing any other type of gate (AND, OR, NOT). In other words, the three basic gates (NOT, AND, and OR) can all be realized using o...

Open this answer on its own page →

Boolean theorems and De Morgan's laws

2078 · 5 marks

State and prove De-Morgan's Theorems. [5]

De-Morgan's Theorems are two fundamental theorems in Boolean algebra: Theorem 1: $$\overline{A + B} = \overline{A} \cdot \overline{B}$$ "The complement of a sum equals the product of the complements." Theorem 2: $$\overline{A \cdot B} = \overline{A} + \overline{B}$$ "The complement of a product e...

Open this answer on its own page →

Exclusive-OR and exclusive-NOR gates

2081.2 · 5 marks

Show that the dual of the exclusive-OR is equal to its complement. [5]

  • Function: Exclusive-OR, $F = A \oplus B = A\bar{B} + \bar{A}B$ - To prove: $F^D = \bar{F}$ (dual equals complement) --- Dual of a Boolean expression: Interchange AND (·) with OR (+), and interchange 0 with 1. Variables (and their complements) remain unchanged. Complement of a Boolean expression...
Open this answer on its own page →

0 · 5 marks

Show that the dual of the exclusive-OR is equal to its complement. [5]

Exclusive-OR (XOR): $$A \oplus B = A'B + AB'$$ Dual of a Boolean function: Replace every AND (·) with OR (+), every OR (+) with AND (·), every 1 with 0, and every 0 with 1. (Variables and their complements are left unchanged.) Complement of a function: Apply De Morgan's theorem (or truth table ne...

Open this answer on its own page →

Logic gates and universal gates

2081.2 · 5 marks

Write short notes on (a) Universal gate. (b) Status register. [2.5+2.5]

Show solved answer

Short Notes


(a) Universal Gate

A universal gate is a logic gate that can be used to implement any Boolean function or any other logic gate (AND, OR, NOT, etc.) without needing any other type of gate.

The two universal gates are:

  • NAND Gate
  • NOR Gate

Why are they called Universal?

Because all basic gates can be realized using only NAND (or only NOR) gates:

Implementing Basic Gates using NAND:

GateNAND Implementation
NOT AA NAND A = $\overline{A}$
A AND B(A NAND B) NAND (A NAND B)
A OR B(A NAND A) NAND (B NAND B)

Implementing Basic Gates using NOR:

GateNOR Implementation
NOT AA NOR A = $\overline{A}$
A OR B(A NOR B) NOR (A NOR B)
A AND B(A NOR A) NOR (B NOR B)

Significance:

  • Reduces the number of different gate types needed in circuit design.
  • Simplifies manufacturing and reduces cost.
  • NAND gates are widely used in digital IC design (e.g., TTL and CMOS families).

(b) Status Register (Flag Register)

A status register (also called a flag register or condition code register) is a special-purpose register in the CPU that holds individual flag bits reflecting the outcome of the most recently executed arithmetic or logical operation.

Common Flag Bits:

FlagNameDescription
ZZero FlagSet to 1 if the result of an operation is zero
CCarry FlagSet to 1 if there is a carry out from the MSB (unsigned overflow)
S / NSign / Negative FlagSet to 1 if the result is negative (MSB = 1)
V / OVOverflow FlagSet to 1 if signed arithmetic overflow occurs
PParity FlagSet to 1 if the result has even parity
AC / HAuxiliary CarrySet if carry occurs from lower nibble to upper nibble (used in BCD)

Importance:

  • Used by conditional branch/jump instructions to make decisions (e.g., JZ, JC, JNZ).
  • Enables the CPU to perform conditional execution and loop control.
  • It is automatically updated after arithmetic and logical operations.

Example:

If we compute 5 - 5 = 0:

  • Zero flag Z = 1 (result is zero)
  • Sign flag S = 0 (result is not negative)

The status register is a key component in program flow control within the CPU.

Open this answer on its own page →