Computer Science 101 The Boolean System. George Boole British mathematician (1815-1864) Boolean algebra –Logic –Set theory –Circuits –Conditions in if.

Slides:



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

INTRODUCTION LOGICAL OPERATIONS TRUTH TABLE AND RULES.
1 If Control Construct A mechanism for deciding whether an action should be taken JPC and JWD © 2002 McGraw-Hill, Inc.
What is the Result and Type of the Following Expressions? int x=2, y=15;double u=2.0,v=15.0; -xx+yx-y x*vy / xx/yy%xx%y u*vu/vv/uu%v x * u(x+y)*uu /(x-x)
If Statements & Relational Operators Programming.
Assignment 2 Sample problems. Consider the following expression: ((False and not True) or False or (True and not True)) True False.
BOOLEAN LOGIC CSC 171 FALL 2004 LECTURE 7. ASSIGNMENT Review Quiz # 2 Start reading Chapter 5.
Boolean Logic & Truth Tables In today’s lesson we will look at: a reminder about truth values and NOT, AND, OR and EOR truth tables operator precedence.
Logic Gates Circuits to manipulate 0’s and 1’s. 0’s and 1’s used for numbers Also to make decisions within the computer. In that context, 1 corresponds.
PHY 201 (Blum)1 Some basic electronics and truth tables Some material on truth tables can be found in Chapters 3 through 5 of Digital Principles (Tokheim)
Computer Science 101 Circuit Design Algorithm. Circuit Design - The Problem The problem is to design a circuit that accomplishes a specified task. The.
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.
22C:19 Discrete Math Boolean Algebra & Digital Logic Fall 2010 Sukumar Ghosh.
Digital Logic Circuits – Chapter 1 Section 1-3, 1-2.
Logic gates & Boolean Algebra. Introduction Certain components (called logic elements) of the computer combine electric pulses using a set of rules. Electric.
Lecture 2 – Boolean Algebra Lecturer: Amy Ching Date: 21 st Oct 2002.
Computer Science 210 Computer Organization Introduction to Boolean Algebra.
Lecture 22: 11/19/2002CS170 Fall CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University.
A-Level Computing#BristolMet Session Objectives#6 MUST understand and produce simple logic diagrams using the operations NOT, AND and OR SHOULD explain.
Chapter 5 Logic; Got Any?. Flow of Control The order in which the computer executes statements in a program Control Structure A statement used to alter.
1 Compound Assignment C++ has a large set of operators for applying an operation to an object and then storing the result back into the object Examples.
1 Chapter 4, Part 1 If Control Construct A mechanism for deciding whether an action should be taken JPC and JWD © 2002 McGraw-Hill, Inc. Modified by S.
IB Computer Science – Logic
Chapter 51 Logical Operators Used with Boolean expressions Not – makes a False expression True and vice versa And – will yield a True if and only if both.
Section 3.4 Boolean Algebra. A link between:  Section 1.3: Logic Systems  Section 3.3: Set Systems Application:  Section 3.5: Logic Circuits in Computer.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
Lecture 4 Introduction to Boolean Algebra. Binary Operators In the following descriptions, we will let A and B be Boolean variables and define a set of.
Boolean values Gateway to decision making. Background Our problem-solving solutions so far have the straight-line property –They execute the same statements.
Laws of Boolean Algebra Commutative Law Associative Law Distributive Law Identity Law De Morgan's Theorem.
Computer Programming Boolean Logic Trade & Industrial Education
Assoc. Prof. Dr. Ahmet Turan ÖZCERİT.  Boolean postulate  Simplifying boolean equations  Truth tables You will learn: 2.
Boolean Algebra Boolean Assertions Statements that will result in true or false outcomes a > 50 = = ba
Ahmad Almulhem, KFUPM 2009 COE 202: Digital Logic Design Combinational Logic Part 1 Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:
Logic Simplification-Using Boolean Laws Logic Design Laboratory EE 2121 Lectures By Manesh T EE2121-In Charge
Boolean Algebra. BOOLEAN ALGEBRA Formal logic: In formal logic, a statement (proposition) is a declarative sentence that is either true(1) or false (0).
CS 106 Logic and Conditionals (Boolean Expressions)
Logic Gates and Boolean Algebra Introduction to Logic II.
Computer Programming Boolean Logic.
Logic gates.
Control Structures I Chapter 3
CPS120 Introduction to Computer Science
Morgan Kaufmann Publishers
Computer Science 210 Computer Organization
De Morgan’s Theorem,.
CS Chapter 3 (3A and ) Part 1 of 8
Logic Gates and Boolean Algebra
CHAPTER 2 Boolean Algebra
A mechanism for deciding whether an action should be taken
Logic Gates.
Data Types, Identifiers, and Expressions
Boolean Algebra.
CS Chapter 3 (3A and ) Part 1 of 8
TN 221: DIGITAL ELECTRONICS 1
September 7 Notes Boolean Algebra.
CHAPTER 2 Boolean Algebra
Computer Science 210 Computer Organization
Bools and simple if statements
Computer Science 210 Computer Organization
Logic Gates.
Boolean Algebra.
BOOLEAN ALGEBRA AND LOGIC SIMPLIFICATION Part (a)
ECB2212-Digital Electronics Boolean algebra
Expressions.
Binary Logic.
Lecture 5 Binary Operation Boolean Logic. Binary Operations Addition Subtraction Multiplication Division.
Some basic electronics and truth tables
XOR Function Logic Symbol  Description  Truth Table 
Truth tables Mrs. Palmer.
Computer Programming Boolean Logic Trade & Industrial Education
boolean Expressions Relational, Equality, and Logical Operators
Presentation transcript:

Computer Science 101 The Boolean System

George Boole British mathematician ( ) Boolean algebra –Logic –Set theory –Circuits –Conditions in if statements and while loops

Boolean Constants and Variables Just two constants –True and False –On and Off –5v and 0v –1 and 0 Boolean variables refer to these values

Boolean Operators Just three –AND –OR –NOT AND and OR are binary operators (like + and *) NOT is a unary operator

Boolean AND If A and B are Boolean variables (or expressions), then A AND B is True if and only if both A and B are True AND is sometimes written like multiplication in ordinary algebra: A AND B = AB or A. B

Truth Table for AND There are a finite number of possible values of A AND B We can specify these in a truth table ABA AND B True False TrueFalse

Boolean OR If A and B are Boolean variables (or expressions), then A OR B is True if and only if at least one of A and B is True OR is sometimes written like addition in ordinary algebra: A OR B = A + B

Truth Table for OR There are a finite number of possible values of A OR B We can specify these in a truth table ABA OR B True FalseTrue FalseTrue False

Boolean NOT If A is Boolean a variable (or expression), then NOT A has the opposite value of A NOT is sometimes written as a ~ (tilde) symbol: NOT A = ~A _ Or with a horizontal bar over the variable: A

Truth Table for NOT There are a finite number of possible values of NOT A We can specify these in a truth table ANOT A TrueFalse True

Boolean Expressions Constructed like arithmetic expressions NOT has a higher precedence than AND, which has a higher precedence than OR Parentheses can be used to override precedence or for clarity

Evaluating Boolean Expressions As in arithmetic, replace variables with values and apply the operators Let A be True and B be False Evaluate: A AND NOT (A OR B)

Evaluating Boolean Expressions As in arithmetic, replace variables with values and apply the operators Let A be True and B be False Evaluate: A AND NOT (A OR B) = True AND NOT (True OR False)

Evaluating Boolean Expressions As in arithmetic, replace variables with values and apply the operators Let A be True and B be False Evaluate: A AND NOT (A OR B) = True AND NOT (True OR False) = True AND NOT True

Evaluating Boolean Expressions As in arithmetic, replace variables with values and apply the operators Let A be True and B be False Evaluate: A AND NOT (A OR B) = True AND NOT (True OR False) = True AND NOT True = True AND False

Evaluating Boolean Expressions As in arithmetic, replace variables with values and apply the operators Let A be True and B be False Evaluate: A AND NOT (A OR B) = True AND NOT (True OR False) = True AND NOT True = True AND False = False

Constructing Truth Tables A truth table gives all of the possible values of a Boolean expression Construct a truth table for A AND NOT (A OR B) ABA OR BNOT (A OR B)A AND NOT (A OR B) True False TrueFalseTrueFalse True False TrueFalse

Constructing Truth Tables If there are N variables, there are 2 N rows in the table Best to use 0 and 1 and count in binary to fill in the inputs Construct a truth table for A AND NOT (B OR C) ABCB OR CNOT (B OR C)A AND NOT (B OR C)