Presentation is loading. Please wait.

Presentation is loading. Please wait.

Www.company.com Module Code MA1032N: Logic Lecture for Week 2 2012-2013 Autumn.

Similar presentations


Presentation on theme: "Www.company.com Module Code MA1032N: Logic Lecture for Week 2 2012-2013 Autumn."— Presentation transcript:

1 www.company.com Module Code MA1032N: Logic Lecture for Week 2 2012-2013 Autumn

2 www.company.com Agenda Week 2 Lecture coverage: –Logical Equivalence, –Tautology, –Contradiction, –Boolean Algebra and –Logical Gates –Logical Circuits

3 www.company.com 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.

4 www.company.com 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

5 www.company.com 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

6 www.company.com 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.

7 www.company.com 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.

8 www.company.com 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.

9 www.company.com 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.

10 www.company.com Five Basic Laws

11 www.company.com Six more laws: For all propositions p and q

12 www.company.com Example Prove Idempotent law, p ∨ p ≡p

13 www.company.com Example

14 www.company.com Example Q.Show that [( p → q) ᴧ ( q → r)] → ( p → r) is a tautology.

15 www.company.com 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

16 www.company.com Logic Gates NOT gate AND gate OR gate NAND gate NOR gate

17 www.company.com P TF FT NOT P NOT-GATE P 10 01 NOT P INPUT NOT P OUTPUT Truth Table

18 www.company.com OR-GATE OUTPUT INPUTS p q p v q Truth Table OR-GATE p 00 01 q 10 11 1 p v q 1 0 1

19 www.company.com Truth Table AND-GATE OUTPUT p ᴧ q INPUTS p q pq p ᴧ q 000 010 100 111 AND-GATE

20 www.company.com p q A NAND B Symbol p q A NAND B AB 001 011 101 110 NAND-GATE Truth Table

21 www.company.com Truth Table A B A NOR B A B AB 001 010 100 110 NOR-GATE

22 www.company.com 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).

23 www.company.com 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

24 www.company.com Logic Circuits (Cont.) Example

25 www.company.com Logic Circuits (Cont.) Example

26 www.company.com Logic Circuits (Cont.) Example

27 www.company.com 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.


Download ppt "Www.company.com Module Code MA1032N: Logic Lecture for Week 2 2012-2013 Autumn."

Similar presentations


Ads by Google