Logic formula sheet
Every rule and formula of the trainer on one page, for revision before the exam or to print.
Logic formula sheet · CleverSphere
Truth table
Topic page →- ·n variables give 2ⁿ rows, from 00…0 to 11…1
- ·A ∧ B is true only for 1, 1
- ·A ∨ B is false only for 0, 0
- ·A → B is false only for A = 1, B = 0
- ·A ⊕ B is true when the values differ
Evaluate a formula
Topic page →- ·Brackets first, from the inside out
- ·Precedence: ¬ before ∧ before ∨ before → before ↔
- ·¬ applies only to what directly follows it
- ·Writing down each sub-formula avoids mistakes
Logical laws
Topic page →- ·De Morgan: ¬(A ∧ B) ≡ ¬A ∨ ¬B and ¬(A ∨ B) ≡ ¬A ∧ ¬B
- ·Distributive: A ∧ (B ∨ C) ≡ (A ∧ B) ∨ (A ∧ C)
- ·Absorption: A ∨ (A ∧ B) ≡ A
- ·Implication: A → B ≡ ¬A ∨ B
- ·Contraposition: A → B ≡ ¬B → ¬A
Tautology & contradiction
Topic page →- ·Tautology: true in every row
- ·Contradiction: true in no row
- ·Satisfiable: true in at least one row
- ·F is a tautology exactly when ¬F is a contradiction
DNF & CNF
Topic page →- ·DNF: one minterm per row with F = 1
- ·In a minterm: 1 → variable, 0 → negated variable
- ·CNF: one maxterm per row with F = 0
- ·In a maxterm: 0 → variable, 1 → negated variable
- ·Canonical: every term contains all variables
Simplify a formula
Topic page →- ·A ∨ (A ∧ B) ≡ A
- ·A ∨ (¬A ∧ B) ≡ A ∨ B
- ·(A ∧ B) ∨ (A ∧ ¬B) ≡ A
- ·A ∧ ¬A ≡ 0, A ∨ ¬A ≡ 1
- ·Literal = every occurrence of a variable
Karnaugh map
Topic page →- ·Group sizes: 1, 2, 4, 8 or 16 cells, always rectangular
- ·Rows and columns run in Gray code: 00, 01, 11, 10
- ·The edges are neighbours too
- ·Groups as large as possible, as few as possible
- ·A term keeps only the variables that stay constant in the group
Find a counterexample
Topic page →- ·Equivalent: same column in every row
- ·One differing row disproves equivalence
- ·Common fallacy: confusing A → B with B → A
- ·Common fallacy: De Morgan without flipping the operator
Logic circuit
Topic page →- ·NAND = negated AND, NOR = negated OR
- ·XOR: 1 when the inputs differ
- ·XNOR: 1 when the inputs are equal
- ·Work out intermediate signals one by one
- ·NAND alone can build any function
Don’t-cares
Topic page →- ·An x may join a group but need not
- ·Use x only when it makes a group larger
- ·Every real 1 must be covered
- ·A group made only of x cells is pointless
Adders & overflow
Topic page →- ·Sum: s = a ⊕ b ⊕ c
- ·Carry: c′ = (a ∧ b) ∨ (c ∧ (a ⊕ b))
- ·Start on the right, pass the carry along
- ·Two’s complement overflow: c3 ⊕ c4
- ·Carry c4 and overflow are not the same
www.cleversphere.ch/tools/logic-trainer
