Notes@HKU by Jax

Digital logic

Boolean algebra

Basics

ABNOTANDORXORNANDNORXNOR
A\overline{A}ABABA+BA+BABA \oplus BAB\overline{AB}A+B\overline{A+B}AB\overline{A \oplus B}
001000111
011011100
100011100
110110001
DotPointRound

Laws

LawExpression
Identity LawA+0=AA + 0 = A
A1=AA \cdot 1 = A
Null LawA+1=1A + 1 = 1
A0=0A \cdot 0 = 0
Idempotent LawA+A=AA + A = A
AA=AA \cdot A = A
Complement LawA+A=1A + \overline{A} = 1
AA=0A \cdot \overline{A} = 0
Commutative LawA+B=B+AA + B = B + A
AB=BAA \cdot B = B \cdot A
Associative LawA+(B+C)=(A+B)+CA + (B + C) = (A + B) + C
A(BC)=(AB)CA \cdot (B \cdot C) = (A \cdot B) \cdot C
Distributive LawA(B+C)=(AB)+(AC)A \cdot (B + C) = (A \cdot B) + (A \cdot C)
A+(BC)=(A+B)(A+C)A + (B \cdot C) = (A + B) \cdot (A + C)
Absorption LawA+(AB)=AA + (A \cdot B) = A
A(A+B)=AA \cdot (A + B) = A
De Morgan's TheoremA+B=AB\overline{A + B} = \overline{A} \cdot \overline{B}
AB=A+B\overline{A \cdot B} = \overline{A} + \overline{B}

Implementation of boolean function

We can implement any boolean function using either SOP or POS form.

We should use the SOP form if the function is mostly 1s, and POS form if the function is mostly 0s.

Sum of Products (SOP)

Express boolean function as OR of AND terms.

Convert truth table to boolean expression
abcP
0000
0011
0101
0110
1001
1011
1100
1111
P(a,b,c)=abc+abc+abc+abc+abc=abc+abc+ab(c+c)+abc=abc+abc+ab+abc\begin{align*} P(a, b, c) &= \overline{a}\overline{b}c + \overline{a}b\overline{c} + a\overline{b}\overline{c} + a\overline{b}c + abc\\ & = \overline{a}\overline{b}c + \overline{a}b\overline{c} + a\overline{b}(\overline{c}+c) + abc\\ & = \overline{a}\overline{b}c + \overline{a}b\overline{c} + a\overline{b} + abc\\ \end{align*}

Product of Sums (POS)

Express boolean function as AND of OR terms.

Convert truth table to boolean expression
abcP
0000
0011
0101
0110
1001
1011
1100
1111
P(a,b,c)=(a+b+c)(a+b+c)(a+b+c)(a+b+c)\begin{align*} P(a, b, c) &= (a + b + c)(a + \overline{b} + \overline{c})(\overline{a} + \overline{b} + c)(\overline{a} + \overline{b} + \overline{c})\\ \end{align*}

Karmaugh Map

Half adder

Circuit that adds two bits and produces a sum and carry output.

ABSum (ABA \oplus B)Carry (ABAB)
0000
0110
1010
1101

On this page