Logic You will learn three common logical operations that will be applied in much of the course (spreadsheets, databases, web searches and both programming.

Slides:



Advertisements
Similar presentations
Computer Science 210 Computer Organization Introduction to Logic Circuits.
Advertisements

Logic You will learn three common logical operations that will be applied in much of the course (spreadsheets, databases, web searches and both programming.
This presentation includes custom animations. To view the animations, you must view the presentation in Slide Show mode and activeX controls must be allowed.
Basic Logical Operations (Fascinating)
1 9/24/07CS150 Introduction to Computer Science 1 Relational Operators and the If Statement.
James Tam Basic Logical Operations (Fascinating) In this section you will learn some basic logical operations and how to evaluate expressions Image from.
1 CS150 Introduction to Computer Science 1 Relational Operators and the If Statement 9/22/08.
James Tam Basic Logical Operations (Fascinating) In this section you will learn some basic logical operations and how to evaluate expressions Image from.
Making Decisions In Python
Chapter 4 Logic Gates and Boolean Algebra. Introduction Logic gates are the actual physical implementations of the logical operators. These gates form.
Logic You will learn three common logical operations that will be applied in much of the course (spreadsheets, databases, web searches and both programming.
Digital Logic Circuits – Chapter 1 Section 1-3, 1-2.
Copyright © Curt Hill Truth Tables A way to show Boolean Operations.
Activity 1 Revise / remember what the term ‘binary logic’ means. What do each of the following look like: NOT gate? AND gate? OR gate? 5 minutes.
© Jalal Kawash 2010 Logic Peeking into Computer Science.
1 10/13/2015 MATH 224 – Discrete Mathematics Why Study Discrete Math  Determination of the efficiency of algorithms, e.g., insertion sort versus selection.
1 Boolean Algebra & Logic Gates. 2 Objectives Understand the relationship between Boolean logic and digital computer circuits. Learn how to design simple.
 In studying digital integrated circuits, one must start with the simplest group of circuit, the SSIs or Small Scale Integrated Circuits. Since these.
Dale Roberts Program Control using Java - Boolean Expressions Dale Roberts, Lecturer Computer Science, IUPUI Department of.
Computer Science 210 Computer Organization Introduction to Boolean Algebra.
© Jalal Kawash Logic Peeking into Computer Science.
Combination of logic gates  Logic gates can be combined to produce more complex functions.  They can also be combined to substitute one type of gate.
MATH 224 – Discrete Mathematics
4. Computer Maths and Logic 4.2 Boolean Logic Simplifying Boolean Expressions.
Thinking Mathematically
IB Computer Science – Logic
James Tam Making Decisions In Python In this section of notes you will learn how to have your programs choose between alternative courses of action.
Dr. ClincyLecture Slide 1 CS6020- Chapter 3 (3A and ) Dr. Clincy Professor of CS First Exam - Tuesday, September 6th Coverage: All subjects up to.
Principles of Programming - NI July Chapter 4: Basic C Operators In this chapter, you will learn about: Assignment operators Arithmetic operators.
Control Structures I Chapter 3
Relational Operator and Operations
CPS120 Introduction to Computer Science
GCSE OCR Computing A451 Binary logic Computing hardware 6.
Activity 1 5 minutes Grab a whiteboard and pen, come to the front and work out the Truth Table for the following circuit: R A B C Q.
Logic You will learn three common logical operations that will be applied in much of the course (spreadsheets, databases, web searches and both programming.
Computer Science 210 Computer Organization
CSIS-110 Introduction to Computer Science
CS Chapter 3 (3A and ) Part 1 of 8
AND.
Sequence, Selection, Iteration The IF Statement
Section 7.1 Logical Operators
Logic You will learn three common logical operations that will be applied in much of the course (spreadsheets, databases, web searches and both programming.
Classwork/Homework Classwork – Page 90 (11 – 49 odd)
Chapter 2.3 Binary Logic.
CS Chapter 3 (3A and ) Part 1 of 8
Basic Logical Operations (Fascinating)
Teaching KS3 Computing Session 4 Theory: Boolean logic AND/OR/NOT
Computer Science 210 Computer Organization
Dr. Clincy Professor of CS
Teaching Computing to GCSE
Logic You will learn three common logical operations that will be applied in much of the course (spreadsheets, databases, web searches and both programming.
Dr. Clincy Professor of CS
3.4 Computer systems Boolean logic Lesson 2.
Teaching KS3 Computing Session 4 Theory: Boolean logic AND/OR/NOT
For OCR GCSE Computing Unit 1 - Theory
DESICION TABLE Decision tables are precise and compact way to model complicated logic. Decision table is useful when input and output data can be.
Computer Science 210 Computer Organization
Dr. Clincy Professor of CS
CS Chapter 3 (3A and ) Part 3 of 8
Boolean Logic Boolean Logic is considered to be the basic of digital electronics. We know that a computer’s most basic operation is based on digital electronics.
Gates Type AND denoted by X.Y OR denoted by X + Y NOR denoted by X + Y
GCSE Computer Science – Logic Gates & Boolean Expressions
ECB2212-Digital Electronics Boolean algebra
Expressions.
Binary Logic.
Lab Instructors will overview the MSP430
Truth tables Mrs. Palmer.
Topics discussed in this section:
Boolean Logic.
Programming Techniques :: Logic & Truth Tables
Presentation transcript:

Logic You will learn three common logical operations that will be applied in much of the course (spreadsheets, databases, web searches and both programming sections)

Logic: Not Just Theory ( ) Fascinating Example (an actual question from an computer science student): “Why is when I type your full name [JT: “James Tam”] that I get fewer search results than just with your last name?” This is an example of how you actually apply a logical operation in your day-to-day activities! Logic: not just ‘geeks’ who use it Image of James Tam courtesy of James Tam

Boolean Numeric values (that you are familiar with) have digits that can only take on values from 0 – 9. Booleans can only take on either a true or false value. Certain types of questions only produce a Boolean result E.g. 1: Did you pass the exam? E.g. 2: Is it below freezing today? E.g. 3: Is my suit black?

Logical Operators Similar to mathematical operators they take one or two inputs and product an output. Mathematical operators: Take numbers as input, produce a number as output Two input 3 * 2 One input (negation) -(2) Logical operators (in this section AND, OR, NOT): Can only take Boolean (true or false) values as input Can only produce a Boolean (true or false) value as output

Truth Tables Examples (input columns specifying all possible combinations of TRUE, FALSE) Column 1 Column 2 FALSE TRUE Column 1 Column 2 Column 3 FALSE TRUE

Truth Tables (2) Can be used for evaluating logical operations Column 1 Column 2 Result of (Column 1) OPERATION (COLUMN 2) FALSE TRUE OR FALSE TRUE

Logical AND The popular usage of the logical AND applies when ALL conditions must be met. Example: Pick up your son AND pick up your daughter after school today. Logical AND can be specified more formally in the form of a true table. Condition I Condition II Truth table (AND) C1 C2 C1 AND C2 False True

Logical AND: Three Input Truth Table C1 AND C2 AND C3 False True

Logical AND: An Example T F AND

Evaluating Logical AND Expressions For ‘AND’, ‘OR’ the order of operation is left to right True AND True AND True False AND True AND True True AND True AND True AND True True AND True AND True AND False 10

Logical OR The correct everyday usage of the logical OR applies when ATLEAST one condition must be met. Example: You are using additional recommended resources for this course: the online textbook OR the paper textbook available in the bookstore. Similar to AND, logical OR can be specified more formally in the form of a truth table. Condition I Condition II Truth table C1 C2 C1 OR C2 False True

Logical OR: Three Input Truth Table C1 OR C2 OR C3 False True

Logical OR: An Example T F OR T F AND

Evaluating Logical OR Expressions True OR True OR True False OR True OR True False OR False OR False OR True False OR False OR False OR False 14

Logical NOT The everyday usage of logical NOT negates (or reverses) a statement. Example: I am finding this class quite stimulating and exciting The truth table for logical NOT is quite simple: .....NOT!!! Statement (logical condition) Negation of the statement/condition Truth table S Not S False True

Evaluating More Complex Logical Expressions Order of operation (left to right evaluation if the ‘level’ is equal) Brackets (inner first) Negation AND OR True OR False AND False NOT (False OR True) OR True (False AND False) OR (False AND True) False OR (False OR True) AND False NOT NOT True NOT NOT False NOT NOT NOT False True False 16

Evaluating More Complex Logic: Truth Table C1 AND C2 NOT (C1 AND C2) (C1 OR C2) NOT(C1 AND C2) AND (C1 OR C2) FALSE TRUE

After This Section You Should Now Know Three logical operators: AND, OR, NOT How to evaluate logical expressions regardless the method of specification e.g., truth table