DeMorgan's & related Laws

Slides:



Advertisements
Similar presentations
The Important Thing About By. The Important Thing About ******** The important thing about ***** is *****. It is true s/he can *****, *****, and *****.
Advertisements

Relational and Equality Operators Table 4-1. Sample Conditions Table 4-2.
IF statement (i) Single statement. IF ( logical expression ) statement Example: read(*,*) a if (a. lt. 0) a = -a write(*,*) a Or read(*,*) a if (a < 0)
PHYS707: Special Topics C++ Lectures Lecture 2. Summary of Today’s lecture: 1.More data types 2.Flow control (if-else, while, do-while, for) 3.Brief introduction.
The "if structure" is used to execute statement(s) only if the given condition is satisfied.
ECE 2110: Introduction to Digital Systems Combinational Logic Design Principles.
Slide 1 Summary Two basic concepts: variables and assignments Some C++ practical issues: division rule, operator precedence  Sequential structure of a.
Hand Evals in DrRacket Hand evaluation helps you learn how Racket reduces programs to values.
General Computer Science for Engineers CISC 106 Lecture 33 Dr. John Cavazos Computer and Information Sciences 05/11/2009.
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.
Selection. Computer Programming 2 Objectives Examine if statement in more detail Study use of switch statement to implement multialternative selections.
Administrative MUST GO TO CORRECT LAB SECTION! Homework due 11:59pm on Tuesday. 25 points off if late (up to 24 hours) Cannot submit after 11:59pm on Wednesday.
Logical functions and - Logical AND function. Example: (and (> 5 4) (< 5 4)) or - Logical OR function. Example: (and (> 5 4) (< 5 4)) not - Logical negation.
Lecture 7 Topics –Boolean Algebra 1. Logic and Bits Operation Computers represent information by bit A bit has two possible values, namely zero and one.
COS 150 Discrete Structures Assoc. Prof. Svetla Boytcheva Fall semester 2014.
Thinking Mathematically Logic 3.6 Negations of Conditional Statements and De Morgan’s Laws.
1 CS 1430: Programming in C++. 2 IF Statement if (cond) statement //Next statement if (cond) { statement1 statement2 … } //Next statement.
ㅎㅎ logical operator if if else switch while do while for Third step for Learning C++ Programming Repetition Control Structures.
Boolean Values The true story ;=P. Expressions.
Module 7.  In Module 3 we have learned about NAND gate – it is a combination of AND operation followed by NOT operation  Symbol A. B = Y  Logic Gate.
Boolean Algebra ELEC 311 Digital Logic and Circuits Dr. Ron Hayne Images Courtesy of Cengage Learning.
Conditional statements and boolean expressions Arithmetic, relational and logical operators.
CS Class 04 Topics  Selection statement – IF  Expressions  More practice writing simple C++ programs Announcements  Read pages for next.
$100 $200 $300 $400 $100 $200 $300 $400 $300 $200 $100 Subtraction sentence with pictures Subtract to get zero Subtract & balance equations Ways to.
Chapter five exercises. a. false; b. true; c. false; d. true; e. true; f. true; g. true; h. false.
Exponents and Monomials. Monomial is an expression that is a number, a variable, or a product of a number and variables. Constant is a monomial containing.
Chapter 3 Selection Statements
Do Now: Evaluate each expression.
Digital Technology.
Section 3 Review Mr. Crone.
Sequence, Selection, Iteration The IF Statement
Exponents and Monomials
Classwork/Homework Classwork – Page 90 (11 – 49 odd)
Chapter 4: Control Structures
Boolean Algebra.
Warm-up.
Exponents: Negative & Zero
Dividing Monomials: The Quotient Rule and Integer Exponents
לולאות קרן כליף.
4 Laws of Integral Indices
Scientific Notation.
Executes a block of statements only if a test is true
Conditional Construct
ELL100: INTRODUCTION TO ELECTRICAL ENGG.
How wide is our universe?
Scientific Notation.
Section 1-6: Multiplying Integers
Expanded Form = 3, (3 x 1,000) + (5 x 100)
Exponents and Monomials
Patterns to KNOW.
Divisibility Rules.
ZERO AND NEGATIVE EXPONENT Unit 8 Lesson 3
Scientific Notation Objective: Students will read and write numbers in
Summary Two basic concepts: variables and assignments Basic types:
Zero and Negative Exponents
Division Properties of Exponents
More Multiplication Properties of Exponents
Disjunctive Normal Form
Divisibility Rules.
Slope Determine whether the slope is positive, negative, Zero, or undefined.
If Statements.
Elec 2607 Digital Switching Circuits
Multiplying Powers with the Same Base
Solving Absolute Value Equations
Exponents and Monomials
Absolute Value The absolute value of a number is the distance from zero on a number line.
Zero and Negative Integral Indices
CSCE 206 Lab Structured Programming in C
Exponents and Monomials
Zero and negative exponents
Presentation transcript:

DeMorgan's & related Laws

Given a Conditional Expression, When its NOT true Given a Conditional Expression, apply the NOT operator !(cond)

How are these laws useful? if (cond) // do this when cond is true else // do this when !cond is true

if (cond) { } else // !cond Useful else comment if (cond) { } else // !cond

Useful else comment if (a < 0) cout << "negative"; else // a >= 0 cout << "zero or positive";

< >= > <= == != Relational Operators Operator "Not of" the Operator < >= > <= == !=

|| && ! Logical Operators Operator "Not of" the Operator ! ! cond is cond

if ((a <= 3) ||(b != 0)) { } else { // ((a > 3) && (b == 0)) Example 1 if ((a <= 3) ||(b != 0)) { } else { // ((a > 3) && (b == 0))

if ((a > 3) &&(b == 0)) { } else { // ((a <= 3) || (b != 0)) Example 2 if ((a > 3) &&(b == 0)) { } else { // ((a <= 3) || (b != 0))

Example 3 if ((a >=0) && (a<=9)) cout << "single digit number"; else // (a < 0) || (a > 9) cout << "notsingle digit num";

if (!(a > 3)) { } else { // (a > 3) is !!(a>3) Example 4 if (!(a > 3)) { } else { // (a > 3) is !!(a>3)