Boolean Logic.

Slides:



Advertisements
Similar presentations
TRUTH TABLES Section 1.3.
Advertisements

TRUTH TABLES The general truth tables for each of the connectives tell you the value of any possible statement for each of the connectives. Negation.
Constructing a Truth Table
Chapter 3 section 2. Please form your groups The 1 st column represents all possibilities for the statement that can be either True or False. The 2 nd.
Software Testing Logic Coverage. Introduction to Software Testing (Ch 3) © Ammann & Offutt 2 Logic Coverage Four Structures for Modeling Software Graphs.
Tutorial 1: Logic Peter Poon. Self Introduction You can call me Peter Office: SHB117 Office hour:
Logic ChAPTER 3 1. Truth Tables and Validity of Arguments
Propositional Equivalences. L32 Agenda Tautologies Logical Equivalences.
Gates and Circuits. Three Main Gates  AND  OR  NOT.
2/17/2008Sultan Almuhammadi1 ICS Logic & Sets (An Overview) Week 1.
Boolean Algebra Computer Science AND (today is Monday) AND (it is raining) (today is Monday) AND (it is not raining) (today is Friday) AND (it is.
1 Section 1.2 Propositional Equivalences. 2 Equivalent Propositions Have the same truth table Can be used interchangeably For example, exclusive or and.
1 Math 306 Foundations of Mathematics I Math 306 Foundations of Mathematics I Goals of this class Introduction to important mathematical concepts Development.
Discussion #10 1/16 Discussion #10 Logical Equivalences.
CSE 311 Foundations of Computing I Autumn 2011 Lecture 2 More Propositional Logic Application: Circuits Propositional Equivalence.
Propositional Logic 7/16/ Propositional Logic A proposition is a statement that is either true or false. We give propositions names such as p, q,
The Logic of Compound Statements
Homework 3.
Truth Tables for Negation, Conjunction, and Disjunction.
3.2 – Truth Tables and Equivalent Statements
TRUTH TABLES. Introduction Statements have truth values They are either true or false but not both Statements may be simple or compound Compound statements.
Logic ChAPTER 3.
Chapter 1 Section 1.4 More on Conditionals. There are three statements that are related to a conditional statement. They are called the converse, inverse.
Course Outline Book: Discrete Mathematics by K. P. Bogart Topics:
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
BUILDING COMPUTER CIRCUITS prepared by Burak Galip ASLAN September, 2006 BOOLEAN LOGIC AND GATES CONTROL CIRCUITS.
Chapter 1 The Logic of Compound Statements. Section 1.1 Logical Form and Logical Equivalence.
Normal Forms, Tautology and Satisfiability 2/3/121.
Logical Form and Logical Equivalence Lecture 2 Section 1.1 Fri, Jan 19, 2007.
CSNB143 – Discrete Structure LOGIC. Learning Outcomes Student should be able to know what is it means by statement. Students should be able to identify.
3.3: Truth Tables. Types of Statements Negation: ~p Conjunction: p ˄ q (p and q) Disjunction: p V q (p or q, or both) Conditional: p → q (if p, then q)
Boolean Algebra. Logical Statements A proposition that may or may not be true:  Today is Monday  Today is Sunday  It is raining.
Boolean Logic. Boolean Operators (T/F) xyx AND y FFF FTF TFF TTT xyx OR y FFF FTT TFT TTT xNOT x FT TF.
4. Computer Maths and Logic 4.2 Boolean Logic Simplifying Boolean Expressions.
Chapter 7 Logic, Sets, and Counting
Conditional Statements
Chapter 8 – Symbolic Logic Professor D’Ascoli. Symbolic Logic Because the appraisal of arguments is made difficult by the peculiarities of natural language,
Propositional Logic. Propositions Any statement that is either True (T) or False (F) is a proposition Propositional variables: a variable that can assume.
Warmup Answer the following True/False questions in your head: I have brown hair AND I am wearing glasses I am male OR I am wearing sneakers I am NOT male.
How do I show that two compound propositions are logically equivalent?
Chapter 7 Logic, Sets, and Counting Section 1 Logic.
Logical Form and Logical Equivalence Lecture 1 Section 1.1 Wed, Jan 12, 2005.
Logical Form and Logical Equivalence M Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.
Boolean Algebra Monday/Wednesday 7th Week. Logical Statements Today is Friday AND it is sunny. Today is Friday AND it is rainy. Today is Monday OR it.
CS203 Discrete Mathematical Structures
1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships. 
Simplifying Boolean Expressions. Boolean Operators (T/F) xyx AND y FFF FTF TFF TTT xyx OR y FFF FTT TFT TTT xyx XOR y FFF FTT TFT TTF xNOT x FT TF.
Computer Systems 1 Fundamentals of Computing Simplifying Boolean Expressions.
TRUTH TABLES. Introduction The truth value of a statement is the classification as true or false which denoted by T or F. A truth table is a listing of.
Notes - Truth Tables fun, fun, and more fun!!!!. A compound statement is created by combining two or more statements, p and q.
Logic and Boolean Algebra. Logic statements  Real life statements  “I use public transportation when the car is broken and I have to go to work”  “All.
CEC 220 Digital Circuit Design Boolean Algebra I Wed, Sept 2 CEC 220 Digital Circuit Design Slide 1 of 13.
BOOLEAN ALGEBRA Kamrul Ahsan Teacher of
CEC 220 Digital Circuit Design Boolean Algebra Friday, January 17 CEC 220 Digital Circuit Design Slide 1 of 22.
BOOLEAN ALGEBRA – Digital Circuit 1 Choopan Rattanapoka.
Joan Ridgway. If a proposition is not indeterminate then it is either true (T) or false (F). True and False are complementary events. For two propositions,
Fundamental Logic Gates And, Or, Not. Logic Gates: The Basics Regulate the flow of electricity within circuits to perform desired functionalities Each.
Conditional Statements Lecture 2 Section 1.2 Fri, Jan 20, 2006.
Mathematics for Computing Lecture 2: Computer Logic and Truth Tables Dr Andrew Purkiss-Trew Cancer Research UK
TRUTH TABLES Edited from the original by: Mimi Opkins CECS 100 Fall 2011 Thanks for the ppt.
Spring 2003CMSC Discrete Structures1 Let’s get started with... Logic !
Aspatial Selection. Table Queries Table queries are a very common GIS aspatial operation Selects a subset of records based on values of specific attributes.
Chapter 1 Logic and proofs
Test #2 Practice MGF 1106 Summer 2011.
Hoda Roodaki Boolean Algebra Hoda Roodaki
CHAPTER 2 Boolean Algebra
Boolean logic Taken from notes by Dr. Neil Moore
De Morgan’s laws presentation
Boolean logic Taken from notes by Dr. Neil Moore
LOGICAL EQUIVALENCES - DISCRETE MATHEMATICS.
Presentation transcript:

Boolean Logic

Boolean Operators (T/F) x y x AND y F T x NOT x F T x y x OR y F T x y x XOR y F T

Boolean Operators (1/0) x y x AND y 1 x NOT x 1 x y x OR y 1 x y 1 x NOT x 1 x y x OR y 1 x y x XOR y 1

Boolean Operators Symbols NOT ā (overbar), a’, ~a AND · (mult. dot) OR + XOR  (plus sign with circle around it)

Boolean Expressions Follows a logical order of operations Example: NOT operators Parentheses AND OR Example: x + y·z

Truth Tables Write out table of all possible combinations of truth values Evaluate the boolean expression for all combinations Example x + y·z x y z x + y·z F T

Example What is the truth table for: ~x + y? x y ~x + y F T

Another Example What is the truth table for: x·(~y)? x y x·(~y) F T

Your Turn What is the truth table for the boolean expression: x + ~y + z?

Simplifying Boolean Expressions Commutative laws A + B = B + A A · B = B · A Associative laws A + (B + C) = (A + B) + C A · (B · C) = (A · B) · C Distributive laws A · (B + C) = A · B + A · C A + (B · C) = (A + B) · (A + C)

Simplifying Boolean Expressions Tautology laws A · A = A A + A = A A + ~A = 1 A · ~A = 0 Absorption Law A + (A · B) = A A · (A + B) = A

Simplifying Boolean Expressions Identities 0 · A = 0 0 + A = A A + 1 = 1 1 · A = A A = A Complement A + ~A · B = A + B

Examples A + A + A + A = A Using the Tautology law

A Bigger Example Simplify ~A · B + A · ~B + ~A · ~B ~A · B + (A · ~B + ~A · ~B)  Associative ~A · B + (~B · (A + ~A))  Distributive ~A · B + ~B & Tautology ~A + ~B  Complement Verify with a truth table!

Practice Show that A + B · C = (A + B) · (A + C) is true using a truth table.

Practice Show that A + ~A · B = A + B

Practice Simplification Simplify A + AB + ~B and verify with a truth table

De Morgan’s Laws ~(A · B) = ~A + ~B ~A · ~B = ~(A+B) Take a term NOT the individual members of the term A · B Change the operator i.e. · to +, or + to · A + B NOT the entire term ~(A+B)

De Morgan’s Law Example f = ~A · ~B + (~A + ~B) = ~~( ~A · ~B + (~A + ~B) )  NOT NOT = ~( (A + B) · ~(~A + ~B) )  De Morgan’s = ~( (A + B) · (A·B) )  De Morgan’s = ~( A·(A·B) + B·(A·B) )  Distributive = ~( A·B + A·B )  Tautology = ~(A·B)  Tautology