Logic & ProofsTopic #7 of 40

Boolean Algebra

Boolean functions, logic gates, canonical forms (DNF and CNF), and minimization techniques.

Boolean Values and Operations

Boolean algebra works with two values:

  • 0 (false)
  • 1 (true)

Basic Operations

OperationSymbolAlternative
AND\cdot or \landxyxy
OR++ or \lorx+yx + y
NOTx\overline{x} or ¬\negxx'

Truth Tables for Basic Operations

AND (xyx \cdot y)

xxyyxyx \cdot y
000
010
100
111

OR (x+yx + y)

xxyyx+yx + y
000
011
101
111

NOT (x\overline{x})

xxx\overline{x}
01
10

Boolean Algebra Laws

Identity Laws

x+0=xx + 0 = x x1=xx \cdot 1 = x

Null Laws

x+1=1x + 1 = 1 x0=0x \cdot 0 = 0

Idempotent Laws

x+x=xx + x = x xx=xx \cdot x = x

Complement Laws

x+x=1x + \overline{x} = 1 xx=0x \cdot \overline{x} = 0

Involution Law

x=x\overline{\overline{x}} = x

Commutative Laws

x+y=y+xx + y = y + x xy=yxx \cdot y = y \cdot x

Associative Laws

(x+y)+z=x+(y+z)(x + y) + z = x + (y + z) (xy)z=x(yz)(x \cdot y) \cdot z = x \cdot (y \cdot z)

Distributive Laws

x(y+z)=(xy)+(xz)x \cdot (y + z) = (x \cdot y) + (x \cdot z) x+(yz)=(x+y)(x+z)x + (y \cdot z) = (x + y) \cdot (x + z)

De Morgan's Laws

x+y=xy\overline{x + y} = \overline{x} \cdot \overline{y} xy=x+y\overline{x \cdot y} = \overline{x} + \overline{y}

Absorption Laws

x+(xy)=xx + (x \cdot y) = x x(x+y)=xx \cdot (x + y) = x

Logic Gates

Basic Gates

GateSymbolBoolean Expression
AND\landF=ABF = A \cdot B
OR\lorF=A+BF = A + B
NOTF=AF = \overline{A}
NANDF=ABF = \overline{A \cdot B}
NORF=A+BF = \overline{A + B}
XOR\oplusF=ABF = A \oplus B
XNORF=ABF = \overline{A \oplus B}

XOR Properties

AB=(AB)+(AB)A \oplus B = (A \cdot \overline{B}) + (\overline{A} \cdot B) AB=(A+B)(AB)A \oplus B = (A + B) \cdot \overline{(A \cdot B)} A0=AA \oplus 0 = A A1=AA \oplus 1 = \overline{A} AA=0A \oplus A = 0 AA=1A \oplus \overline{A} = 1

Canonical Forms

Minterm and Maxterm

For nn variables, a minterm is an AND of all variables (each complemented or not). A maxterm is an OR of all variables.

For n=2n = 2 with variables x,yx, y:

xxyyMintermMaxterm
00xy\overline{x}\overline{y} (m0m_0)x+yx + y (M0M_0)
01xy\overline{x}y (m1m_1)x+yx + \overline{y} (M1M_1)
10xyx\overline{y} (m2m_2)x+y\overline{x} + y (M2M_2)
11xyxy (m3m_3)x+y\overline{x} + \overline{y} (M3M_3)

Disjunctive Normal Form (DNF)

Sum of Products (SOP): OR of minterms where function is 1

F=m(i1,i2,)F = \sum m(i_1, i_2, \ldots)

Conjunctive Normal Form (CNF)

Product of Sums (POS): AND of maxterms where function is 0

F=M(j1,j2,)F = \prod M(j_1, j_2, \ldots)

Example

For F(x,y)=xy+xyF(x,y) = xy + \overline{x}y:

  • DNF: F=m1+m3=m(1,3)F = m_1 + m_3 = \sum m(1, 3)
  • CNF: F=M0M2=M(0,2)F = M_0 \cdot M_2 = \prod M(0, 2)

Simplification Techniques

Algebraic Simplification

Example: Simplify F=xy+xy+xyF = xy + x\overline{y} + \overline{x}y

F=x(y+y)+xyF = x(y + \overline{y}) + \overline{x}y =x1+xy= x \cdot 1 + \overline{x}y =x+xy= x + \overline{x}y =(x+x)(x+y) (distributive)= (x + \overline{x})(x + y) \text{ (distributive)} =1(x+y)= 1 \cdot (x + y) =x+y= x + y

Karnaugh Maps (K-maps)

For 2 variables:

y\overline{y}yy
x\overline{x}m0m_0m1m_1
xxm2m_2m3m_3

Group adjacent 1s in powers of 2 to find simplified expression.

Functional Completeness

A set of operations is functionally complete if any Boolean function can be expressed using only those operations.

Complete Sets

  • {AND,OR,NOT}\{AND, OR, NOT\}
  • {AND,NOT}\{AND, NOT\}
  • {OR,NOT}\{OR, NOT\}
  • {NAND}\{NAND\} alone!
  • {NOR}\{NOR\} alone!

Expressing with NAND

x=x NAND x\overline{x} = x \text{ NAND } x xy=(x NAND y) NAND (x NAND y)x \cdot y = (x \text{ NAND } y) \text{ NAND } (x \text{ NAND } y) x+y=(x NAND x) NAND (y NAND y)x + y = (x \text{ NAND } x) \text{ NAND } (y \text{ NAND } y)