The Laws of Logic: Boolean Algebra A State High Math Club Presentation START==TRUE - PowerPoint PPT Presentation

About This Presentation
Title:

The Laws of Logic: Boolean Algebra A State High Math Club Presentation START==TRUE

Description:

The Laws of Logic: Boolean Algebra A State High Math Club Presentation START==TRUE – PowerPoint PPT presentation

Number of Views:166
Avg rating:3.0/5.0
Slides: 36
Provided by: Compute310
Learn more at: https://www.scasd.org
Category:

less

Transcript and Presenter's Notes

Title: The Laws of Logic: Boolean Algebra A State High Math Club Presentation START==TRUE


1
The Laws of LogicBoolean AlgebraA State High
Math Club PresentationSTARTTRUE
2
What is Boolean Algebra?
  • Two values
  • True and False - Logic Set Theory
  • 1 and 0 - Computers Probability
  • High and Low Digital Electronics

3
AND - Basic
  • Notation - AND
  • (A AND B) returns true iff A and B are both true
  • Numerically A B
  • Identity - 1
  • 0 AND 1 0
  • 1 AND 1 1
  • Annihilator - 0
  • 0 AND 0 0
  • 1 AND 0 0

4
AND - Representations
5
OR (Inclusive or) - Basic
  • Notation - OR v
  • (A OR B) returns true if either (or both) of A
    and B are true
  • Numerically A B - A B
  • Probability P(A or B) P(A)P(B)-P(A AND B)
  • And/Or Construction
  • Identity - 0
  • Annihilator - 1

6
OR - Representations
7
NOT - Basic
  • Notation NOT !
  • Unary - only takes one argument
  • Others are called binary
  • Returns the opposite of its argument
  • Analogous to negative sign

8
NOT - Representations
9
XOR (Exclusive or) - Derived
  • Notation XOR
  • (A XOR B) returns true iff exactly one of A and B
    is true
  • Can also be considered not equals
  • Either/or construction
  • A XOR B (A B) v (A B)
  • Numerically AB (mod 2)
  • Also AB 2(AB) Same formula in probability
  • A XOR 1 NOT(A)
  • A XOR 0 A

10
XOR - Representations
11
Equivalence - Derived
  • Notation
  • Returns true iff AB

12
Material Implication - Derived
  • Notation xgty
  • Linguistically If X, then Y
  • X is called the antecedent y is called the
    consequent
  • False ONLY when x is true and y is false
  • NOT(X) OR Y
  • More intuitively NOT(X AND NOT(Y))
  • Why is x-gty true when x is false???
  • This means that If two is odd, then two is even
    is a true statement!

13
TautologiesThe Theorems of Boolean Algebra
  • Called laws
  • Proven with either truth tables or derivations
  • Truth table true iff last column is all 1s
    (i.e. true for all input values)
  • Example Proof of X X 0

X X XX XX 0
1 0 0 1
0 1 0 1
14
De Morgans LawsDistributing a NOT
  • (xVy)(x)(y)
  • (xy)(x)V(y)
  • Proofs?

X Y (x)(y) (xvy)
1 1 0 0
1 0 0 0
0 1 0 0
0 0 1 1
X Y (x)v(y) (xy)
1 1 0 0
1 0 1 1
0 1 1 1
0 0 1 1
15
Important Laws
  • AND and OR are
  • Distributive over each other
  • Associative
  • Commutative
  • X X
  • XX0
  • XvX1
  • De Morgans Laws

16
A Derivation
  • (w V x) V (y V z) ((w V x) V y) V z (w V (x
    V y)) V z (w V (y V x)) V z ((w V y) V x) V
    z (w V y) V (x V z)
  • Why is this valid?

17
ApplicationsLogic Deduction
  • Propositional Calculus gives valid forms of
    arguments
  • Arguments are valid iff they are laws of boolean
    algebra
  • Tends to use -gt a lot
  • Examples
  • (P (P-gtQ)) -gt Q Modus Ponens
  • (Q (P-gtQ)) -gt P Modus Tollens
  • ((P-gtQ) (Q-gtR)) -gt (P-gtR) Hypothetical
    Syllogism

18
Modus Ponens Proof
P Q P-gtQ (P (P-gtQ)) (P (P-gtQ)) -gt Q
1 1 1 1 1
1 0 0 0 1
0 1 1 0 1
0 0 1 0 1
19
Modus Tollens Proof
P Q P-gtQ (Q (P-gtQ)) (Q (P-gtQ)) -gt P
1 1 1 0 1
1 0 0 0 1
0 1 1 0 1
0 0 1 1 1
20
Hypothetical Syllogism Proof
P Q R P-gtQ Q-gtR P-gtQ Q-gtR P-gtR
1 1 1 1 1 1 1
1 1 0 1 0 0 0
1 0 1 0 1 0 1
1 0 0 0 1 0 0
0 1 1 1 1 1 1
0 1 0 1 0 0 1
0 0 1 1 1 1 1
0 0 0 1 1 1 1
21
ApplicationsComputer Curcuits
  • Everything in a computer is either a 1 or 0
    (called a bit, or binary unit)
  • 1 is high voltage 0 is low voltage
  • Why?
  • Calculations are done with AND, OR, and NOT logic
    gates
  • Sound familiar?

22
How Do Computers Add?
  • We want to add two numbers, which are sequences
    of bits
  • We add one place value (two bits) at a time
  • Input The two bits, A and B
  • Output sum bit (the actual place value) and
    carry bit (if we need to carry a 2)
  • How can we make this circuit?

23
Adding
  • Make a truth table and translate it into a
    circuit diagram

A B Sum Carry
1 1 0 1
1 0 1 0
0 1 1 0
0 0 0 0
24
Adding
  • Sum A XOR B
  • Carry A AND B

25
What about the carry bit?
  • We forgot we might need to add a carry bit as
    well
  • So we really have three inputs A,B, and Cin
    (carry in)
  • Still two outputs
  • Cout (carry out)
  • Sum

26
Take Two
A B Cin S Cout
1 1 1 1 1
1 1 0 0 1
1 0 1 0 1
1 0 0 1 0
0 1 1 0 1
0 1 0 1 0
0 0 1 1 0
0 0 0 0 0
  • How do we make this circuit diagram?

27
Full 1-bit Adder
28
How about more bits?
29
How many basic gates?
  • We use AND, OR, and NOT as basic gates
  • Wouldnt it be nice to have ONE basic gate?
  • Can mass-produce a single circuit dont have to
    worry about which (tiny and impossible to see)
    circuit is which

30
NAND Sheffer Stroke
  • Notation NAND ?
  • A NAND B NOT (A AND B)
  • Can be used to make AND, OR, and NOT gates
  • How?

31
NAND as a Universal Gate
  • NOT(A) A NAND A
  • A AND B NOT(A NAND B) (A NAND B) NAND (A NAND
    B)
  • A OR B NOT(A) NAND NOT(B) by Demorgans Law
    (A NAND A) NAND (B NAND B)
  • A -gt B NOT(A) OR B A NAND NOT(B) A NAND (B
    NAND B)

32
NOR Pierce Arrow
  • Notation NOR ?
  • A NOR B NOT(A OR B)
  • Can be used to make AND,OR, and NOT gates
  • How?

33
NOR as a Universal Gate
  • NOT(A) A NOR A
  • A OR B NOT(A OR B) (A NOR B) NOR (A NOR B)
  • A AND B NOT(A) NOR NOT(B) by Demorgans Law
    (A NOR A) NOR (B NOR B)
  • A-gtB NOT(A) OR B (NOT(A) NOR B) NOR (NOT(A)
    NOR B)
  • ((A NOR A) NOR B) NOR ((A NOR A) NOR B)

34
An Everyday ExampleSearch Engines
  • Google uses boolean algebra on your search terms
  • Automatically uses AND (i.e. whitespace AND)
  • boolean algebra -gt Pages with BOTH boolean and
    algebra in them
  • Use OR for logical OR
  • Boolean OR algebra -gt Pages with EITHER boolean
    or algebra in them
  • Use - for NOT
  • Boolean Algebra -gtPages WITH boolean but
    WITHOUT algebra

35
END1
Write a Comment
User Comments (0)
About PowerShow.com