D75P 34R - HNC Computer Architecture Week 6 Boolean Logic © C Nyssen/Aberdeen College 2004 All images © C Nyssen /Aberdeen College unless otherwise stated.

Slides:



Advertisements
Similar presentations
DAT2343 Basic Logic Gates © Alan T. Pinck / Algonquin College; 2003.
Advertisements

Logic Gates.
Programmable Logic Controllers.
Computer Systems 1 Fundamentals of Computing
Logic Gates.
Logic Gates.
Lecture 2 Dr Richard Reilly Dept. of Electronic & Electrical Engineering Room 153, Engineering Building To insert your company logo on this slide From.
10/22/2004EE 42 fall 2004 lecture 221 Lecture #22 Truth tables and gates This week: Circuits for digital devices.
Lecture 3. Boolean Algebra, Logic Gates
Propositional Calculus Math Foundations of Computer Science.
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.
3. DIGITAL ELECTRONICS..
22C:19 Discrete Math Boolean Algebra & Digital Logic Fall 2010 Sukumar Ghosh.
Lecture 3. Boolean Algebra, Logic Gates Prof. Sin-Min Lee Department of Computer Science 2x.
Logical Circuit Design Week 5: Combinational Logic Circuits Mentor Hamiti, MSc Office ,
Boolean Logic By: Arthur Brooks February 25, 2003 Think, Speak, and Write Computer Science.
Systems Architecture I1 Propositional Calculus Objective: To provide students with the concepts and techniques from propositional calculus so that they.
XOR and XNOR Logic Gates. XOR Function Output Y is TRUE if input A OR input B are TRUE Exclusively, else it is FALSE. Logic Symbol  Description  Truth.
Today’s Agenda 1.Research Paper –Rough draft due Mon, Feb. 11 –Peer edit session on Wed, Feb. 13 –Final version due Wed, Feb. 20 –Oral presentation Tues,
CSC 107 – Programming For Science. Follow-Up From Last Lecture.
CSC Intro. to Computing Lecture 5: Boolean Logic, Gates, & Circuits.
CSC Intro. to Computing Lecture 5: Boolean Logic, Gates, & Circuits.
Discrete Mathematics and Its Applications.  The English mathematician George Boole ( ) sought to give symbolic form to Aristotle's system of.
Logic Gates Shashidhara H S Dept. of ISE MSRIT. Basic Logic Design and Boolean Algebra GATES = basic digital building blocks which correspond to and perform.
Week 6: Gates and Circuits: PART I READING: Chapter 4.
Chapter 33 Basic Logic Gates. 2 Objectives –After completing this chapter, the student should be able to: Identify and explain the function of the basic.
Sneha.  Gates Gates  Characteristics of gates Characteristics of gates  Basic Gates Basic Gates  AND Gate AND Gate  OR gate OR gate  NOT gate NOT.
D75P 34R - HNC Computer Architecture Week 8 More Boolean Logic © C Nyssen/Aberdeen College 2004 All images © Focus Clipart, used with permission except.
A-Level Computing#BristolMet Session Objectives#6 MUST understand and produce simple logic diagrams using the operations NOT, AND and OR SHOULD explain.
CSC 107 – Programming For Science. George Boole  Mathematician from English middle-class  Lived from 1815 – 1864  Started work at age 16 as a teaching.
Logic Gates. The Inverter The inverter (NOT circuit) performs the operation called inversion or complementation. Standard logic symbols: 1 1 input output.
D75P 34R – HNC Computer Architecture Week 1 Introduction to Binary Storage © C Nyssen/Aberdeen College 2004 All images © C Nyssen /Aberdeen College unless.
D75P 34R - HNC Computer Architecture Week 4 Signed Integers © C Nyssen/Aberdeen College 2004 All images © C Nyssen /Aberdeen College unless otherwise.
COMPUTER ARCHITECTURE TRUTH TABLES AND LOGIC GATES.
Chapter-3: BOOLEAN ALGEBRA & LOGIC GATES Analysis and logical design.
Chapter 4 Fundamentals of Computer Logic 1 Chapter 4: Fundamental of Computer Logic - IE337.
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,
Logic Simplification-Using Boolean Laws Logic Design Laboratory EE 2121 Lectures By Manesh T EE2121-In Charge
Logic Gates and Boolean Algebra Introduction to Logic II.
Chapter 3 Boolean Algebra and Digital Logic T103: Computer architecture, logic and information processing.
Logic Gates Review. Logic Gates OR gate – 1 if either input is 1 – 0 if they both are 0.
Dr. ClincyLecture Slide 1 CS6020- Chapter 3 (3A and ) Dr. Clincy Professor of CS First Exam - Tuesday, September 6th Coverage: All subjects up to.
Logic gates.
Computer Architecture & Operations I
Boolean Algebra & Logic Gates
CPS120 Introduction to Computer Science
Unit 1 Logical operators.
Digital Logic.
Morgan Kaufmann Publishers
Eng. Mai Z. Alyazji October, 2016
Logic Gates and Boolean Algebra
Computer Science 210 Computer Organization
Logic Gates and Boolean Algebra
A mechanism for deciding whether an action should be taken
Logic Gates.
Logic Gates Benchmark Companies Inc PO Box Aurora CO
Basic Logical Operations (Fascinating)
Digital Signals Digital Signals have two basic states:
Practice #Digital Logic Mr. Burleson
For OCR GCSE Computing Unit 1 - Theory
Logic Gates.
Computer Science 210 Computer Organization
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.
GCSE Computer Science – Logic Gates & Boolean Expressions
ECB2212-Digital Electronics Boolean algebra
Logic Gates.
Chapter 4 Gates and Circuits.
Chapter 4: Boolean Expressions, Making Decisions, and Disk Input and Output Prof. Salim Arfaoui.
Truth tables Mrs. Palmer.
Presentation transcript:

D75P 34R - HNC Computer Architecture Week 6 Boolean Logic © C Nyssen/Aberdeen College 2004 All images © C Nyssen /Aberdeen College unless otherwise stated George Boole courtesy of Roger Parsons/ Lincoln Cathedral First transistor ©Bell Labs USA Decision Making © Microsoft Prepared 2/11/04

Boolean Logic is a branch of mathematics. It deals with rules for manipulating the two values true and false. Boolean Logic is particularly relevant to computers as it is binary logic.  Deals with only two values  Can only be in one state at any given point in time  Can’t be between states  Time taken to jump between states is negligible In other words, 1 = true and 0 = false!

George Boole ( ) was an English mathematician, the first to develop and describe a formal system of working with truth values. He was born in 1815 as the son of a shoemaker in Lincoln. Young George was taught maths by his father, but by the age of eight, had outgrown his father's self-taught limits, and a tutor was hired to teach him Latin. At 16 he became an assistant teacher, at 20 he opened his own school. He went on to become the first Professor of Mathematics at University College Cork, despite having no degree himself. His books The Mathematical Analysis of Logic (1847) and An Investigation of the Laws of Thought (1854) form the basis of present-day computer science and cybernetics.

A Boolean expression is any expression that evaluates out to true or false. Is the expression 1+3 a Boolean expression? What about 1+3=7? Other examples - x > 100 y < z a = 100 w <> 10

We can use Boolean Operators to construct more complex Boolean operations. The first three we will look at are AND, OR and NOT. Some examples are - X > 100 AND x < 250 A = 0 OR B > 100 NOT x = 100

Boolean Logic Gates are built from transistors. These are tiny switches built of semiconductor material, usually silicon. If the gate is open, no current can flow (0 state). If the gate is closed, current can flow (1 state).

The simplest gate of all is the NOT gate, or INVERTER All this does is reverse the value that went in. We already saw an example of this when calculating 1’s complements. The Logic Circuit for a NOT gate looks like this -

The Truth Table for a NOT gate looks like this Example - If x = 10 and y = 15 NOT X > 0 is FALSE NOT X > Y is TRUE We write NOT A as A

We can show how a NOT works in Pascal using this routine - VAR choice: char; {more stuff here} write (‘Enter a number from 0 - 6’); readln (choice); IF NOT (choice IN [‘0’..’6’]) THEN BEGIN {to run error handling routine} write (‘Error! Enter a number from 0 - 6!’); readln (choice); END[if}; We are actually running a check on what choice is NOT as opposed to what it is!

The next gate is the AND gate. It always takes at least two inputs. All of the inputs have to be TRUE before the outcome is also TRUE. The logic gate for an AND looks like this -

The truth table for AND looks like this - Example If x = 10 and y = 15 x > 0 AND y < 20 is TRUE x = 10 AND x > y is FALSE We write A AND B as A.B

We can show how an AND works in Pascal using this routine - VAR BlindDateIsAttractive: boolean; MoneyInPocket: integer; {more stuff here} IF (BlindDateIsAttractive = true) AND (MoneyInPocket > 100) THEN writeln (‘Let’s go to Poldinos!’) ELSE writeln (‘Lets go to Burger King.’); {endif} Both conditions have to be true before it will go on to do the statement after the THEN.

The next gate is the OR gate. Again, it needs at least two inputs. But unlike the AND, only ONE of the inputs has to be TRUE before the outcome is also TRUE. The logic gate for an OR looks like this -

The truth table for OR looks like this - Example - If x = 10 and y = 15 x > 0 OR x < 20 is TRUE x = 10 OR x > y is TRUE We write A OR B as A+B DO NOT confuse this with A PLUS B!

We can show how an OR works in Pascal using this routine - VAR DayOfWeek: String; {more stuff here} IF (DayOfWeek = ‘Friday’) OR (DayOfWeek = ‘Saturday’) THEN writeln (‘Let’s go out clubbing!’) ELSE writeln (‘Better stay home and study’); {endif} Only one of the conditions has to be true before it will go on to do the statement after the THEN.

Let’s try some examples of Boolean Expressions. ((x = 10) OR (y = 10)) AND (z > x) True Assume that x = 10, y = 15 and z = 20. X = 10 Y = 10 z > x

(x = y) OR (NOT (x > z)) True Assume that x = 10, y = 15 and z = 20. x > z x = y

Assume that x = 10, y = 15 and z = 20. ((x = y) AND (x = 10)) OR (y > z) False x = y x = 10 y > z

Assume that x = 10, y = 15 and z = 20. NOT ((x > y) AND (z > y) AND (x < z)) True x > y z > y x < z

As part of your assessment material, you will be asked to perform logical operations between pairs of binary numbers. Example - Perform a logical AND between the numbers

A logical OR between the same two numbers

The next gate you need to be able to use is the XOR (exclusive OR) gate. Again, it needs at least two inputs. Unlike the AND and OR, however, it needs the inputs to be DIFFERENT from each other for a TRUE output. If all of the inputs are the same, whether they are true or false, the output will be FALSE. The logic gate for an XOR looks like this -

The truth table for XOR looks like this - Example If x = 10 and y = 15 x > 0 XOR y < 20 false x = 10 XOR x > ytrue We write A XOR B as A + B Sometimes you will see XOR written as EOR

A logical XOR between the same two numbers

In addition to the basic gates, there are also three composite gates - NAND, NOR and XNOR. These comprise - an AND immediately followed by a NOT an OR immediately followed by a NOT an XOR immediately followed by a NOT To perform the logical operation, just treat the numbers as a normal AND, OR or XOR, then reverse the result!

The logic gates for NAND, NOR and XNOR look like this -

The Truth Tables for NAND, NOR and XNOR

Logic gates are the basic building blocks of any computer system. Using combinations of logic gates, complex circuits can be constructed.

Summary [1].  Boolean Expressions are expressions that evaluate to either TRUE or FALSE.  We can use the operators NOT, AND, OR, XOR, NAND, NOR and XNOR.  Boolean Logic is particularly compatible with computers as both work in a bistable environment.

Summary [2]  NOT (inverter) reverses any input.  AND requires ALL inputs to be TRUE for a TRUE output.  OR requires only ONE input to be TRUE for a TRUE output.  XOR requires differences in the inputs for a TRUE output.  NAND is equivalent to an AND immediately followed by a NOT.  NOR is equivalent to an OR immediately followed by a NOT.  XNOR is equivalent to an XOR immediately followed by a NOT.