Boolean Algebra Lecture 7: Supporting Material Dr Kathryn Merrick Tuesday 24 th March, 2009.

Slides:



Advertisements
Similar presentations
Min terms and logic expression
Advertisements

Lecture 2: Systems Engineering
Listening: Riddle Goal, Wolf & Cabbage. Riddle – River Crossing GOAT, WOLF & CABBAGE A farmer is going home from the market. He bought a goat, a cabbage.
Chapter 2: Java Fundamentals Operators. Introduction to OOP Dr. S. GANNOUNI & Dr. A. TOUIR Page 2 Content Group of Operators Arithmetic Operators Assignment.
Operator. Assignation (=). The assignation operator serves to assign a value to a variable. a = 5; It is necessary to emphasize that the assignation operation.
CS 3850 Lecture 5 Operators. 5.1 Binary Arithmetic Operators Binary arithmetic operators operate on two operands. Register and net (wire) operands are.
Fall 2006AE6382 Design Computing1 Relational and Logical Operators Use relational operators to test two values Work with values of true and false Compare.
The Distributive Property
Computer Science 101 Boolean Algebra. What’s next? A new type of algebra – Helps us A new type of algebra – Helps us With logical reasoningWith logical.
2015/8/221 Data Types & Operators Lecture from (Chapter 3,4)
Chapter 4: Operators Department of Computer Science Foundation Year Program Umm Alqura University, Makkah Computer Programming Skills /1436.
CSci 125 Lecture 10 Martin van Bommel. Simple Statements Expression followed by semicolon Assignments total = n1 + n2; Function calls printf(”Hello.\n”);
Exercises A-Declare a variable of double type with initial value=0.0; B- Declare a constant of String type with initial value=“Good” C- Declare a variable.
1.2 – Evaluate and Simplify Algebraic Expressions A numerical expression consists of numbers, operations, and grouping symbols. An expression formed by.
Flow of Control: Loops Lecture 9: Supporting Material Dr Kathryn Merrick Tuesday 31 st March, 2009.
1 Week 2: Variables and Assignment Statements READING: 1.4 – 1.6 EECS Introduction to Computing for the Physical Sciences.
CPS120: Introduction to Computer Science Operations Lecture 9.
Lesson - 7. Operators There are three types of operators: Arithmetic Operators Relational and Equality Operators Logical Operators.
Operators Precedence - Operators with the highest precedence will be executed first. Page 54 of the book and Appendix B list C's operator precedence. Parenthesis.
Liang, Introduction to C++ Programming, (c) 2007 Pearson Education, Inc. All rights reserved X1 Chapter 3 Control Statements.
Lecture #6 OPERATORS AND ITS TYPES By Shahid Naseem (Lecturer)
Graphical Programming Languages Lecture 19: Supporting Material Dr Kathryn Merrick Thursday 21 st May, 2009.
Vectors Lecture 11: Supporting Material Dr Kathryn Merrick Tuesday 7 th April, 2009.
1-2 Order of Operations and Evaluating Expressions.
Programming with Spread Sheets Lecture 18: Supporting Material Dr Kathryn Merrick Tuesday 19 th May, 2009.
Evaluating Integer Expressions Friday, December 25, 2015.
By: Mr. Baha Hanene Chapter 6. LEARNING OUTCOMES This chapter will cover the learning outcome 02 i.e. 2.Use basic data-types and input / output in C programs.
Doing math In java.
Operators.
Logical Thinking CS 104 9/12/11. Agenda Today  College Board survey reminder  Note: Simple “how to” guide on Scratch posted on eLearning  Review HW.
CS305j Introduction to Computing More Conditional Execution 1 Topic 13 More Conditional Execution " Great dancers are not great because of their technique;
Operators A binary operator combines two values to get one result: x OP y where OP is any binary operators such as +, -, *, /, ==, !=, >, &&, or even =.
Opener: Find three consecutive odd integers whose sum is -63 Integer #1 = n Integer #2 = n + 2 Integer #3 = n + 4 (n) + (n + 2) + (n + 4) = -63 3n + 6.
Notes Over 1.2.
Subtracting Integers #41.
Section 7.1 Logical Operators
Addition/ Subtraction
A mechanism for deciding whether an action should be taken
1 Introduction to Algebra: Integers.
Expressions An expression is a portion of a C++ statement that performs an evaluation of some kind Generally requires that a computation or data manipulation.
Bellwork (this is done on loose leaf paper)
Basic Rules Of ALGEBRA.
Boolean Expressions Lecture No. 10.
Introduction to Variables, Algebraic Expressions, and Equations
Dr. Clincy Professor of CS
Lecture 5 from (Chapter 4, pages 73 to 96)
Dr. Clincy Professor of CS
Computers & Programming Languages
Winter 2018 CISC101 11/22/2018 CISC101 Reminders
Dr. Clincy Professor of CS
Relational Operators Operator Meaning < Less than > Greater than
Dr. Clincy Professor of CS
CS Chapter 3 (3A and ) Part 3 of 8
Dr. Clincy Professor of CS
One step equation with Multiplication and Division
Equations and Inequalities
CS Chapter 3 (3A and ) – Part 2 of 5
Expressions.
Chapter 2: Java Fundamentals
Lecture 5 Binary Operation Boolean Logic. Binary Operations Addition Subtraction Multiplication Division.
Dr. Clincy Professor of CS
Relational Operators.
Dr. Clincy Professor of CS
Chap 7. Advanced Control Statements in Java
Algebra 1 Section 2.4.
5.03 Apply operators and Boolean expressions
Primitive Data Types and Operators
boolean Expressions Relational, Equality, and Logical Operators
Dr. Clincy Professor of CS
Dr. Clincy Professor of CS
Presentation transcript:

Boolean Algebra Lecture 7: Supporting Material Dr Kathryn Merrick Tuesday 24 th March, 2009

Overview Revision of numerical types and operators Introduction to the Boolean type and operators Boolean logic

Revision: Numerical Types integer floating point number Examples: >> num_motors = 2; >> speed = 5.6; …

Revision: Numerical Operators +addition – subtraction /division *multiplication ^power =assignment Examples: >> result = 2 + 3; >> num_legs = 4; >> my_var = 4^2; …

Another Puzzle… You have a goat a wolf and a cabbage with you and you need to cross a river in a small boat to get back home. If left alone together, the goat will eat the cabbage and the wolf will eat the goat. With room for only two in the boat, how do you get to the other side of the river? How do we express things like ‘the goat will eat the cabbage’ in a programming language?

Demo 1: Boolean Types in MATLAB

The Boolean Type Can have two values: true false In MATLAB these are equivalent to 1 and 0 respectively Can be combined using logical operators &, | and ~ Behaviour of logical operators can be represented in truth tables

Demo 2: Boolean Operators in MATLAB

Summary: Boolean Operators &logical AND |logical OR ~logical NOT <less than <=less than or equal to >greater than >=greater than or equal to ==equal to ~=not equal to

Summary After today’s lecture you should be able to: Identify numerical operators Identify Boolean operators Use Boolean logic to create and evaluate Boolean expressions