This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: CPSC 121 Lecture 3 January 9, 2009 Menu January 9, 2009 Topics: Conditional Statement Implication Biconditional Logical Equivalence Reading: Today: Epp 1.2 January 12: Epp 1.5 Next: Epp 1.3 Reminders: Labs and tutorials begin week of January 12 Online Quiz 3 deadline 9:00pm January 13 Online Quiz 2 deadline was 9:00pm January 8 Online/static Quiz 1 (mark has been waived) WebCT Vista: http://www.vista.ubc.ca www: http://www.ugrad.cs.ubc.ca/~cs121/ The first three slides for today carry forward from Lecture 2. The first summarizes the role that truth tables play in propositional logic. Why Truth Tables? We use truth tables to: 1. Define the meaning of logical connectives 2. Construct (simple) proofs in propositional logic 3. Design (simple) combinational circuits The second exhaustively lists the sixteen (16) different truth tables involving two propositional variables, p and q. It also gives the name of the associated logic gate (in hardware), when there is one. All 16 Logical Operators (with Gate Names) B * B X N N N U * U N A A X O O N O F * F O N N O T T O p q R p * q R D D R q p R T T T T T T T T T T F F F F F F F F T F T T T T F F F F T T T T F F F F F T T T F F T T F F T T F F T T F F F F T F T F T F T F T F T F T F T F * The operator whose truth values are given in this column is called implication. Implication is very important in formal logic (and well return to it shortly). Note, however, that implication is not a named gate (in hardware) Finally, it is important to realize that using truth tables as a proof method in propositional logic does not scale up as the number of propositional variables increases. (Harder) Question How many distinct Boolean operators are there of n Boolean variables? Answer: There are 2 (2 n ) The truth table has 2 n rows since there are that number of distinct combinations of truth values for the n variables. For each row, we have an entry that can be either true or false. Thus, there are 2 (2 n ) distinct truth tables for n Boolean variables We use truth tables as a proof method for propositional logic. But, this is feasible only when the number of variables is small. There are other proof methods for propositional logic that we will need to consider Recall from Last Lecture Proposition: a statement that is true or false (but not both) Compound Proposition: formed by combining existing propositions with logical connectives ( ) defined, via a truth table , as follows: p q p q p q p p q T T T T F F T F F T F T F T F T T T F F F F T F Digital circuit design uses logic gates (NOT AND OR XOR NAND NOR XNOR) to describe a circuit Digital circuits produce the correct binary output for each combination of binary inputs Question Follow Up There is no required correct ordering to rows in a truth table. For example, the two truth tables p q p q p q p p q T T T T F F T F F T F T F T F T T T F F F F T F p q AND OR NOT p XOR 1 1 1 1 1 1 1 1 1 1 1 1 are equivalent (when we associate T with 1 and F with 0)...
View Full
Document
 Spring '08
 BELLEVILLE

Click to edit the document details