Module Code MA1032N: Logic Lecture for Week Autumn
Agenda Week 2 Lecture coverage: –Logical Equivalence, –Tautology, –Contradiction, –Boolean Algebra and –Logical Gates –Logical Circuits
Chapter 1 LOGICAL EQUIVALENCE Two compound propositions P(p, q, r, … ) and Q(p, q, r, … ) are said to be logically equivalent (or simply equivalent) if the last column of their truth tables are identical. We write P ≡ Q in this case.
Example p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r) For simplicity we construct their truth tables in a single diagram. pqr (q ∨ r)p ∧ (q ∨ r)(p ∧ q)(p ∧ r)(p ∧ q) ∨ (p ∧ r) TTTTTTTT TTFTTTFT TFTTTFTT TFFFFFFF FTTTFFFF FTFTFFFF FFTTFFFF FFFFFFFF
A proposition P(p, q, r, … ) is called a tautology if every entry in the last column of its truth table is T. We represent any tautology by TRUE. Tautology
Tautology (cont.) Consider the proposition (p ∨ q) ∨ ¬(p ∧ q). pq (p ∨ q)(p ∧ q)¬(p ∧ q)(p ∨ q) ∨ ¬(p ∧ q) TTTTFT TFTFTT FTTFTT FFFFTT Here, every entry in the last column is T. This means the proposition evaluates to true for all possible combinations of Truth values of its component propositions. Hence, the above proposition is Tautology.
Contradiction A proposition P(p, q, r, … ) is called a contradiction if every entry in the last column of its truth table is F. We represent any contradiction by FALSE.
Contradiction (cont.) Consider the proposition (p ∧ q) ∧ ¬(p ∧ q). pq (p ∧ q)¬(p ∧ q)(p ∧ q) ∧ ¬(p ∧ q) TTTFF TFFTF FTFTF FFFTF Here, every entry in the last column is F. This means the proposition evaluates to false for all possible combinations of Truth values of its component propositions. Hence, the above proposition is Contradiction.
Properties The following four properties of TRUE and FALSE will complete the link between the algebra of sets and the algebra of propositions. For any proposition p: (i) p ∨ FALSE ≡ p (ii) p ∧ TRUE ≡ p (iii) p ∨ ¬p ≡ TRUE (iv) p ∧ ¬p ≡ FALSE. These are easily proved using truth tables.
Five Basic Laws
Six more laws: For all propositions p and q
Example Prove Idempotent law, p ∨ p ≡p
Example
Example Q.Show that [( p → q) ᴧ ( q → r)] → ( p → r) is a tautology.
Logic Gates A logic gate is a simple digital circuit that corresponds to one of the logical connectives. Transistors are combined together to form logic gates
Logic Gates NOT gate AND gate OR gate NAND gate NOR gate
P TF FT NOT P NOT-GATE P NOT P INPUT NOT P OUTPUT Truth Table
OR-GATE OUTPUT INPUTS p q p v q Truth Table OR-GATE p q p v q 1 0 1
Truth Table AND-GATE OUTPUT p ᴧ q INPUTS p q pq p ᴧ q AND-GATE
p q A NAND B Symbol p q A NAND B AB NAND-GATE Truth Table
Truth Table A B A NOR B A B AB NOR-GATE
Logic Circuits Gates can be combined together in various ways to make circuits with output from one gate serving as input (or part of the input) to another. Such circuits are called logic circuits. Example: Labeling the circuit diagram Note: The labeling is always carried out from left to right (i.e. from input through to output).
Logic Circuits (Cont.) There are two input signals to the circuit. If these are labeled A and B they are initially inputs to the AND gate. This transforms them to the output A · B which is then input to the NOT gate. The final output from the circuit is therefore
Logic Circuits (Cont.) Example
Logic Circuits (Cont.) Example
Logic Circuits (Cont.) Example
Logic Circuits (Cont.) Questions…… A. Construct the logic circuit and write the truth table for the following Boolean expressions. 1.Z = A.B + B.C 2.Z = A.B + A’.B’ 3.Z = A.B’.C + A’.B.C + A.B.C’ B. Construct the logic circuit for the following expressions.