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.

Slides:



Advertisements
Similar presentations
Truth Tables and Logic Gates. What are Logic Gates? Logic gates are components used in making logic circuits. Each gate has one or more inputs and produces.
Advertisements

Logic Gates.
INTRODUCTION LOGICAL OPERATIONS TRUTH TABLE AND RULES.
ECE 2110: Introduction to Digital Systems Combinational Logic Design Principles.
Chapter 2 Logic Circuits.
Boolean rules for simplification Dr. Ahmed Telba.
Logic Gate Level Combinational Circuits, Part 1. Circuits Circuit: collection of devices physically connected by wires to form a network Net can be: –
Propositional Calculus Math Foundations of Computer Science.
EMB1006 Boolean Logic Jonathan-Lee Jones.
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.
01 March 2009Instructor: Tasneem Darwish1 University of Palestine Faculty of Applied Engineering and Urban Planning Software Engineering Department Introduction.
Programming for GCSE Topic 3.3: Boolean Logic and Truth Tables
Logic Circuits In today’s lesson we will look at: the symbols for NOT, AND, OR and EOR using truth tables to represent logic circuits two new operators.
11.1 Boolean Functions. Boolean Algebra An algebra is a set with one or more operations defined on it. A boolean algebra has three main operations, and,
CHAPTER 2 Boolean Algebra
Computer Science 101 The Boolean System. George Boole British mathematician ( ) Boolean algebra –Logic –Set theory –Circuits –Conditions in if.
Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar.
Systems Architecture I1 Propositional Calculus Objective: To provide students with the concepts and techniques from propositional calculus so that they.
Logic gates & Boolean Algebra. Introduction Certain components (called logic elements) of the computer combine electric pulses using a set of rules. Electric.
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.
Computer Organization 1 Logic Gates and Adders. Propositions –Venn Diagrams.
Computer Science 210 Computer Organization Introduction to Boolean Algebra.
Combinational Logic 1.
Discrete Mathematics and Its Applications.  The English mathematician George Boole ( ) sought to give symbolic form to Aristotle's system of.
Selection Boolean What is Boolean ? Boolean is a set with only two values : –true –false true and false are standard identifiers in Pascal, called Boolean.
LOGIC GATES.
4. Computer Maths and Logic 4.2 Boolean Logic Simplifying Boolean Expressions.
Lecture 4 Boolean Algebra. Logical Statements °A proposition that may or may not be true: Today is Monday Today is Sunday It is raining °Compound Statements.
© BYU 03 BA1 Page 1 ECEn 224 Boolean Algebra – Part 1.
COMPUTER ARCHITECTURE TRUTH TABLES AND LOGIC GATES.
Logic Gates. A logic gate is an elementary building block of a digital circuit. Most logic gates have two inputs and one output. At any given moment,
Boolean Functions and Boolean Algebra Laxmikant Kale.
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).
Logic Gates and Boolean Algebra Introduction to Logic II.
LOGIC GATES. INTRODUCTION TO LOGIC GATES Boolean functions may be practically implemented by using electronic gates. The following points are important.
Dr. ClincyLecture Slide 1 CS6020- Chapter 3 (3A and ) Dr. Clincy Professor of CS First Exam - Tuesday, September 6th Coverage: All subjects up to.
Boolean Algebra & Logic Gates
Unit 1 Logical operators.
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.
Digital Logic.
Component 1 Logical operators.
Chapter 3 Notes – Part II Review Questions
Logic Gates.
Computer Science 210 Computer Organization
Boolean Algebra & De Morgan's Theorems
Logic Gates and Boolean Algebra
CHAPTER 2 Boolean Algebra
Logic Gates.
Logic Gates Benchmark Companies Inc PO Box Aurora CO
CHAPTER 2 Boolean Algebra This chapter in the book includes:
TN 221: DIGITAL ELECTRONICS 1
Jeremy R. Johnson Wed. Sept. 29, 1999
Circuits & Boolean Expressions
CHAPTER 2 Boolean Algebra
Jeremy R. Johnson Anatole D. Ruslanov William M. Mongan
Computers & Programming Languages
Computer Science 210 Computer Organization
Boolean Logic In today’s lesson we will look at:
Logic Gates.
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.
Boolean Algebra.
BOOLEAN ALGEBRA AND LOGIC SIMPLIFICATION Part (a)
GCSE Computer Science – Logic Gates & Boolean Expressions
Maths Unit 1 - Algebra Order of operations - BIDMAS Algebraic Notation
Lecture 5 Binary Operation Boolean Logic. Binary Operations Addition Subtraction Multiplication Division.
Introductory Concepts
Chapter 3 – Describing Logic Circuits
Circuits & Boolean Expressions
Presentation transcript:

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 equivalent expressions

Truth Values When we first looked at Boolean Logic, we introduced the idea of truth values – things that we could all agree on as being true or false. In computing, we are usually concerned with truths about circuits, e.g. the switch is on the light is on or mathematical truths (especially is application programming).

Mathematical Truths We have looked at Boolean variables, and also used if to test the truth of mathematical comparisons. Mathematical truths are usually easier to determine: –1 is equal to 1 –2 is more than 5 –3 is NOT equal to 5 They might involve a variable, e.g. if x = 10: –x is equal to 1 –x is more than 5 –x is NOT equal to 5 TRUE FALSE TRUE FALSE TRUE

Truth Values Truth values are pairs of opposites, and are usually written in one of three ways: –On or Off –True or False –1 or 0 For the rest of this topic we are going to use 0 and 1 as they are easier to write. Most programming languages also allow you to use numbers as Boolean values, with 0 as False and non-zero as True (and Python even allows you to use strings, where “” is False and a non-blank string is True), e.g. if x: is the same as if x > 0: (or if x: is the same as if x != “”:)

Truth Table - NOT We can use truth tables to describe the output of a particular Boolean logic operation. Truth tables describe the output for all possible inputs e.g. the NOT operator toggles the truth value to its opposite value: pNOT p NOT operates on a single value, so there are only two possible inputs; 0 or 1 Inputs and outputs are labelled

Truth Table - OR The OR operator gives a true result if any of the input values is true, e.g. pqp OR q OR operates on two values, so there are four possible inputs

Truth Table - AND The AND operator gives a true result if both of the input values are true, e.g. pqp AND q

Truth Table - EOR The EOR operator gives a true result if the two input values are different, e.g. pqp EOR q

Is Anything Always True? The following always give the same results: p OR NOT p is always 1 p AND NOT p is always 0 pNOT pP AND NOT p pNOT pP OR NOT p

Combining Operators AND and OR can work with more than two inputs, just take a pair of inputs at a time: Just like BIDMAS for arithmetic, there is a correct order to combinations of AND and OR. pqRp OR q OR r

Operator Precedence There are rules about which operations should be done first; this is known as operator precedence: –operations inside brackets are done first –AND is done before OR In fact, sometimes a AND b is written as a.b and a OR b can be written as a+b – this can help you to remember the order, as multiplication comes before addition in BIDMAS for ordinary arithmetic.

Duality Look at the truth tables for AND and OR – what do you see? If you swap 0 for 1 you get the other table! This is a property known as duality, and it can be useful for simplifying calculations (or logic circuits) pqp OR q pqp AND q

DeMorgan’s Duals This property leads to two rules, called DeMorgan’s Duals: –NOT(a OR b) = NOT a AND NOT b –NOT(a AND b) = NOT a OR NOT b It’s unlikely that you will need to know these for GCSE Computing, but they can be useful for simplifying calculations or logic circuits. We will look at logic circuits and the symbols used in them in the next lesson.