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

Slides:



Advertisements
Similar presentations
(CSC 102) Discrete Structures Lecture 5.
Advertisements

CSE 311: Foundations of Computing Fall 2013 Lecture 3: Logic and Boolean algebra.
Combinational Circuits ENEL 111. Common Combinationals Circuits NAND gates and Duality Adders Multiplexers.
Boolean Algebra and Logic Gate
Syllabus Every Week: 2 Hourly Exams +Final - as noted on Syllabus
Contemporary Logic Design Two-Level Logic © R.H. Katz Transparency No. 3-1 Chapter #2: Two-Level Combinational Logic Section 2.1, Logic Functions.
1 Boolean Algebra & Logic Design. 2 Developed by George Boole in the 1850s Mathematical theory of logic. Shannon was the first to use Boolean Algebra.
Lecture 3. Boolean Algebra, Logic Gates
Propositional Calculus Math Foundations of Computer Science.
Part 2: DESIGN CIRCUIT. LOGIC CIRCUIT DESIGN x y z F F = x + y’z x y z F Truth Table Boolean Function.
Chapter 2: Boolean Algebra and Logic Functions
Lecture 3. Boolean Algebra, Logic Gates Prof. Sin-Min Lee Department of Computer Science 2x.
CS1Q Computer Systems Lecture 5 Simon Gay. Lecture 5CS1Q Computer Systems - Simon Gay2 Where we are Global computing: the Internet Networks and distributed.
Binary Numbers.
Systems Architecture I1 Propositional Calculus Objective: To provide students with the concepts and techniques from propositional calculus so that they.
XOR and XNOR Logic Gates. XOR Function Output Y is TRUE if input A OR input B are TRUE Exclusively, else it is FALSE. Logic Symbol  Description  Truth.
BOOLEAN ALGEBRA Saras M. Srivastava PGT (Computer Science)
Hardware Logic Diagrams - The Basics - Marshall Thomas CIS 21JA – Fall Quarter 2012.
Combinational Logic 1.
Logic Gates Shashidhara H S Dept. of ISE MSRIT. Basic Logic Design and Boolean Algebra GATES = basic digital building blocks which correspond to and perform.
Lecture 22: 11/19/2002CS170 Fall CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University.
IT253: Computer Organization Lecture 7: Logic and Gates: Digital Design Tonga Institute of Higher Education.
Logic Design CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
1 EG 32 Digital Electronics Thought for the day You learn from your mistakes..... So make as many as you can and you will eventually know everything.
Universal college of engineering & technology. .By Harsh Patel)
CS1Q Computer Systems Lecture 6 Simon Gay. Lecture 6CS1Q Computer Systems - Simon Gay2 Algebraic Notation Writing AND, OR, NOT etc. is long-winded and.
CMPUT Computer Organization and Architecture II1 CMPUT329 - Fall 2002 Topic2: DeMorgan Laws José Nelson Amaral.
Logic Gates. A logic gate is an elementary building block of a digital circuit. Most logic gates have two inputs and one output. At any given moment,
R. Johnsonbaugh Discrete Mathematics 5 th edition, 2001 Chapter 9 Boolean Algebras and Combinatorial Circuits.
Chapter 3 Digital Logic Structures
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Yaohang Li.
1 Ethics of Computing MONT 113G, Spring 2012 Session 4 Binary Addition.
CSE 461. Binary Logic Binary logic consists of binary variables and logical operations. Variables are designated by letters such as A, B, C, x, y, z etc.
LOGIC CIRCUITLOGIC CIRCUIT. Goal To understand how digital a computer can work, at the lowest level. To understand what is possible and the limitations.
L OGIC G ATES Computer Organization – week 3. W HAT ’ S ALU? 1. ALU stands for: Arithmetic Logic Unit 2. ALU is a digital circuit that performs Arithmetic.
Logic Gates Learning Objectives Learn that there is a one-to-one relationship between logic gates and Boolean expressions Learn how logic gates are combined.
Computer Architecture & Operations I
Computer Architecture & Operations I
Combinational Circuits and Boolean
Dr.Ahmed Bayoumi Dr.Shady Elmashad
Morgan Kaufmann Publishers
Department of Preparatory Year, Umm Al Qura University
Discrete Mathematics Logic of Compound Statements
Circuits Logic in Hardware.
Fundamentals & Ethics of Information Systems IS 201
CS105 Introduction to Computer Concepts GATES and CIRCUITS
CSE 311 Foundations of Computing I
Propositional Calculus: Boolean Algebra and Simplification
EEL 3705 / 3705L Digital Logic Design
Propositional Equivalences
Information Technology Department
Agenda – 2/12/18 Questions? Readings: CSI 4, P
CSE 370 – Winter Combinational Logic - 1
Number Systems Decimal (base 10) { }
Logic Gates.
Boolean Algebra.
Week 7: Gates and Circuits: PART II
February 7, 2002 John Wawrzynek
Logic Gates.
13 Digital Logic Circuits.
COMS 361 Computer Organization
Digital Logic.
DIGITAL ELECTRONICS B.SC FY
Logic Gates.
Logic Circuits I Lecture 3.
Chapter 4 Gates and Circuits.
Special Gates Combinational Logic Gates
XOR Function Logic Symbol  Description  Truth Table 
DIGITAL ELECTRONICS AND LOGIC GATES. ANALOG SIGNAL:- Analog signal is continuous time varying current or voltage signal.
Presentation transcript:

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

What is Boolean Algebra? Two values –True and False - Logic + Set Theory –1 and 0 - Computers + Probability –High and Low – Digital Electronics

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

AND - Representations

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

OR - Representations

NOT - Basic Notation NOT ¬ ~ ! Unary - only takes one argument –Others are called binary Returns the opposite of its argument Analogous to negative sign

NOT - Representations

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: A+B (mod 2) –Also A+B – 2*(A*B) – Same formula in probability A XOR 1 = NOT(A) A XOR 0 = A

XOR - Representations

Equivalence - Derived Notation ≡ == Returns true iff A=B

Material Implication - Derived Notation x–>y 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->y true when x is false??? –This means that “If two is odd, then two is even” is a true statement!

Tautologies: The 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~XX^~XX^~X==

De Morgan’s Laws: Distributing a NOT ¬(xVy)=(¬x)^(¬y) ¬(x^y)=(¬x)V(¬y) Proofs? XY(¬x)^(¬y)¬(xvy) XY(¬x)v(¬y)¬(x^y)

Important Laws AND and OR are: –Distributive over each other –Associative –Commutative ~~X = X X^~X==0 Xv~X==1 De Morgan’s Laws

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?

Applications: Logic + Deduction Propositional Calculus – gives valid forms of arguments –Arguments are valid iff they are laws of boolean algebra –Tends to use “->” a lot Examples –(P ^ (P->Q)) -> Q – Modus Ponens –(~Q ^ (P->Q)) -> ~P – Modus Tollens –((P->Q) ^ (Q->R)) -> (P->R) – Hypothetical Syllogism

Modus Ponens Proof PQP->Q(P ^ (P->Q))(P ^ (P->Q)) -> Q

Modus Tollens Proof PQP->Q(~Q ^ (P->Q))(~Q ^ (P->Q)) -> ~P

Hypothetical Syllogism Proof PQRP->QQ->RP->Q ^ Q->RP->R

Applications: Computer 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?

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?

Adding ABSumCarry Make a truth table and translate it into a circuit diagram

Adding Sum = A XOR B Carry = A AND B

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

Take Two ABCinSCout How do we make this circuit diagram?

Full 1-bit Adder

How about more bits?

How many basic gates? We use AND, OR, and NOT as basic gates –Wouldn’t it be nice to have ONE basic gate? –Can mass-produce a single circuit; don’t have to worry about which (tiny and impossible to see) circuit is which

NAND – Sheffer Stroke Notation NAND | ↑ A NAND B = NOT (A AND B) Can be used to make AND, OR, and NOT gates –How?

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 Demorgan’s Law = (A NAND A) NAND (B NAND B) A -> B = NOT(A) OR B = A NAND NOT(B) = A NAND (B NAND B)

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

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 Demorgan’s Law = (A NOR A) NOR (B NOR B) A->B = NOT(A) OR B = (NOT(A) NOR B) NOR (NOT(A) NOR B) = ((A NOR A) NOR B) NOR ((A NOR A) NOR B)

An Everyday Example: Search Engines Google uses boolean algebra on your search terms –Automatically uses AND (i.e. whitespace = AND) boolean algebra -> Pages with BOTH ‘boolean’ and ‘algebra’ in them –Use OR for logical OR Boolean OR algebra -> Pages with EITHER ‘boolean’ or ‘algebra’ in them –Use - for NOT Boolean –Algebra ->Pages WITH ‘boolean’ but WITHOUT ‘algebra’

END==1