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 ¬\negx′x'

Truth Tables for Basic Operations

AND (x⋅yx \cdot y)

xxyyx⋅yx \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 x⋅1=xx \cdot 1 = x

Null Laws

x+1=1x + 1 = 1 x⋅0=0x \cdot 0 = 0

Idempotent Laws

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

Complement Laws

x+x‾=1x + \overline{x} = 1 x⋅x‾=0x \cdot \overline{x} = 0

Involution Law

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

Commutative Laws

x+y=y+xx + y = y + x x⋅y=y⋅xx \cdot y = y \cdot x

Associative Laws

(x+y)+z=x+(y+z)(x + y) + z = x + (y + z) (x⋅y)⋅z=x⋅(y⋅z)(x \cdot y) \cdot z = x \cdot (y \cdot z)

Distributive Laws

x⋅(y+z)=(x⋅y)+(x⋅z)x \cdot (y + z) = (x \cdot y) + (x \cdot z) x+(y⋅z)=(x+y)⋅(x+z)x + (y \cdot z) = (x + y) \cdot (x + z)

De Morgan's Laws

x+y‾=x‾⋅y‾\overline{x + y} = \overline{x} \cdot \overline{y} x⋅y‾=x‾+y‾\overline{x \cdot y} = \overline{x} + \overline{y}

Absorption Laws

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

Logic Gates

Basic Gates

GateSymbolBoolean Expression
AND∧\landF=A⋅BF = A \cdot B
OR∨\lorF=A+BF = A + B
NOT—F=A‾F = \overline{A}
NAND—F=A⋅B‾F = \overline{A \cdot B}
NOR—F=A+B‾F = \overline{A + B}
XOR⊕\oplusF=A⊕BF = A \oplus B
XNOR—F=A⊕B‾F = \overline{A \oplus B}

XOR Properties

A⊕B=(A⋅B‾)+(A‾⋅B)A \oplus B = (A \cdot \overline{B}) + (\overline{A} \cdot B) A⊕B=(A+B)⋅(A⋅B)‾A \oplus B = (A + B) \cdot \overline{(A \cdot B)} A⊕0=AA \oplus 0 = A A⊕1=A‾A \oplus 1 = \overline{A} A⊕A=0A \oplus A = 0 A⊕A‾=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
00x‾y‾\overline{x}\overline{y} (m0m_0)x+yx + y (M0M_0)
01x‾y\overline{x}y (m1m_1)x+y‾x + \overline{y} (M1M_1)
10xy‾x\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+x‾yF(x,y) = xy + \overline{x}y:

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

Simplification Techniques

Algebraic Simplification

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

F=x(y+y‾)+x‾yF = x(y + \overline{y}) + \overline{x}y =x⋅1+x‾y= x \cdot 1 + \overline{x}y =x+x‾y= 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 x⋅y=(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)