Digital Circuits Cheatsheet

Boolean Algebra

Use this Digital Circuits reference while you build software engineering projects, review code for technical interview prep, or polish examples for a software engineer resume.

Overview

Boolean algebra is the mathematical foundation of digital logic. Variables take only two values — 0 (false/LOW) and 1 (true/HIGH) — and operations follow a small, closed set of laws.

Basic Operations

OperationSymbolExpressionMeaning
AND· or ∧A · B1 only if both are 1
OR+ or ∨A + B1 if at least one is 1
NOT¬ or ′ or overlineA′Inverts the value
NAND(A · B)′NOT AND
NOR(A + B)′NOT OR
XORA ⊕ B1 if inputs differ
XNOR(A ⊕ B)′1 if inputs are equal

Axioms (Postulates)

These are assumed true without proof; all other rules derive from them.

NameAND formOR form
IdentityA · 1 = AA + 0 = A
NullA · 0 = 0A + 1 = 1
IdempotentA · A = AA + A = A
ComplementA · A′ = 0A + A′ = 1
Involution(A′)′ = A

Fundamental Theorems

TheoremAND formOR form
CommutativeA · B = B · AA + B = B + A
Associative(A·B)·C = A·(B·C)(A+B)+C = A+(B+C)
DistributiveA·(B+C) = A·B + A·CA+(B·C) = (A+B)·(A+C)
AbsorptionA · (A + B) = AA + A·B = A
ConsensusA·B + A′·C + B·C = A·B + A′·C(A+B)·(A′+C)·(B+C) = (A+B)·(A′+C)

The distributive law in OR form is non-intuitive — it has no direct analogue in ordinary algebra.

De Morgan's Theorems

The most-used identities for simplification and gate conversion:

Theorem 1: (A · B)′ = A′ + B′

Theorem 2: (A + B)′ = A′ · B′

Generalized form: - (A · B · C · …)′ = A′ + B′ + C′ + … - (A + B + C + …)′ = A′ · B′ · C′ · …

Mnemonic: "Break the bar, change the operation."

NAND:   (A · B)′ = A′ + B′   (NOR with inverted inputs)
NOR:    (A + B)′ = A′ · B′   (NAND with inverted inputs)

Canonical Forms

Minterm (Sum of Products, SOP)

Each minterm covers exactly one row of the truth table where output = 1.

  • mᵢ: product term where each variable appears true if that bit is 1, complemented if 0.
  • F = Σm(…) — sum of minterms

Maxterm (Product of Sums, POS)

Each maxterm covers exactly one row where output = 0.

  • Mᵢ: sum term where each variable appears complemented if that bit is 1, true if 0.
  • F = ΠM(…) — product of maxterms

Example: F(A, B, C) = Σm(1, 3, 5, 7)

RowABCFMinterm
00000
10011A′B′C
20100
30111A′BC
41000
51011AB′C
61100
71111ABC

F = A′B′C + A′BC + AB′C + ABC = C (after simplification)

Algebraic Simplification

Work towards fewer literals and fewer terms.

StepExpressionRule applied
StartA′B′C + A′BC + AB′C + ABC
Group pairsA′C(B′+B) + AC(B′+B)Distributive
SimplifyA′C·1 + AC·1Complement
Group againC(A′+A)Distributive
ResultCComplement

Duality Principle

Every Boolean identity has a dual obtained by: 1. Swapping AND (·) and OR (+) 2. Swapping 0 and 1 3. Leaving variables and their complements unchanged

If a statement is true, its dual is also true.

XOR Properties

PropertyExpression
CommutativeA ⊕ B = B ⊕ A
Associative(A ⊕ B) ⊕ C = A ⊕ (B ⊕ C)
IdentityA ⊕ 0 = A
Self-inverseA ⊕ A = 0
ComplementA ⊕ 1 = A′
Useful identityA ⊕ B = A′B + AB′

XOR is used extensively in parity generation, adders, and encryption (XOR cipher).

Standard Forms Comparison

SOP (Sum of Products)POS (Product of Sums)
Built fromMinterms (AND terms)Maxterms (OR terms)
Output 1 whenAny minterm is 1All maxterms are 1
Implemented withAND-OR networkOR-AND network
Two-level NANDNAND-NAND equivalent
Two-level NORNOR-NOR equivalent