EMB1006 Boolean Logic Jonathan-Lee Jones.

Slides:



Advertisements
Similar presentations
CT455: Computer Organization Logic gate
Advertisements

Programmable Logic Controllers.
Combinational Circuits
Cosc 2150: Computer Organization Chapter 3: Boolean Algebra and Digital Logic.
1 Digital Logic
Section 10.3 Logic Gates.
Lecture 3. Boolean Algebra, Logic Gates
Propositional Calculus Math Foundations of Computer Science.
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.
In this module you will learn: What the various logic gates do. How to represent logic gates on a circuit diagram. The truth tables for the logic gates.
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.
Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar.
Binary Numbers.
Systems Architecture I1 Propositional Calculus Objective: To provide students with the concepts and techniques from propositional calculus so that they.
SUPLEMENTARY CHAPTER 1: An Introduction to Digital Logic The Architecture of Computer Hardware and Systems Software: An Information Technology Approach.
1 The Chinese University of Hong Kong Faculty of Education Diploma in Education (Part-Time) Winter 1997 Educational Communications and Technology Assignment.
Computer Organization 1 Logic Gates and Adders. Propositions –Venn Diagrams.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Logic Circuits I.
1 Boolean Algebra & Logic Gates. 2 Objectives Understand the relationship between Boolean logic and digital computer circuits. Learn how to design simple.
Apr. 3, 2000Systems Architecture I1 Systems Architecture I (CS ) Lecture 3: Review of Digital Circuits and Logic Design Jeremy R. Johnson Mon. Apr.
CS1Q Computer Systems Lecture 6 Simon Gay. Lecture 6CS1Q Computer Systems - Simon Gay2 Algebraic Notation Writing AND, OR, NOT etc. is long-winded and.
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.
Computing Systems Designing a basic ALU.
IT253: Computer Organization Lecture 7: Logic and Gates: Digital Design Tonga Institute of Higher Education.
4. Computer Maths and Logic 4.2 Boolean Logic Logic Circuits.
Digital Logic. 2 Abstractions in CS (gates) Basic Gate: Inverter IO IO GNDI O Vcc Resister (limits conductivity) Truth Table.
1 Lecture 6 BOOLEAN ALGEBRA and GATES Building a 32 bit processor PH 3: B.1-B.5.
In1200/04-PDS 1 TU-Delft Digital Logic. in1200/04-PDS 2 TU-Delft Unit of Information l Computers consist of digital (binary) circuits l Unit of information:
Logic Gates Informatics INFO I101 February 3, 2003 John C. Paolillo, Instructor.
CS1Q Computer Systems Lecture 6 Simon Gay. Lecture 6CS1Q Computer Systems - Simon Gay2 Algebraic Notation Writing AND, OR, NOT etc. is long-winded and.
1 GCSE Computing Binary Logic. GCSE Computing 2 Candidates should be able to understand and produce simple logic diagrams using the operations NOT, AND,
R. Johnsonbaugh Discrete Mathematics 5 th edition, 2001 Chapter 9 Boolean Algebras and Combinatorial Circuits.
1  2004 Morgan Kaufmann Publishers Lets Build a Processor Almost ready to move into chapter 5 and start building a processor First, let’s review Boolean.
Logic Design EE-2121 Manesh T. Digital Systems  Introduction  Binary Quantities and Variables  Logic Gates  Boolean Algebra  Combinational Logic.
Activity 1 Revise/research what the word binary means Revise/research what the word logic means 5 minutes.
LECTURE 4 Logic Design. LOGIC DESIGN We already know that the language of the machine is binary – that is, sequences of 1’s and 0’s. But why is this?
WORKING PRINCIPLE OF DIGITAL LOGIC
Minute Paper 4/4/04 Z=50+j86.7=100
LOGIC CIRCUITLOGIC CIRCUIT. Goal To understand how digital a computer can work, at the lowest level. To understand what is possible and the limitations.
L OGIC G ATES Computer Organization – week 3. W HAT ’ S ALU? 1. ALU stands for: Arithmetic Logic Unit 2. ALU is a digital circuit that performs Arithmetic.
Boolean Algebra Learning Objectives Learn that Boolean algebra produces a result that equals TRUE or FALSE Learn how truth tables are used to represent.
Logic Gates Learning Objectives Learn that there is a one-to-one relationship between logic gates and Boolean expressions Learn how logic gates are combined.
GCSE OCR Computing A451 Binary logic Computing hardware 6.
Morgan Kaufmann Publishers
Logic Gates & Boolean Algebra
Lesson Objectives Aims Be able to define problems using Boolean logic
Digital Signals Digital Signals have two basic states:
Jeremy R. Johnson Wed. Sept. 29, 1999
Fundamentals & Ethics of Information Systems IS 201
Jeremy R. Johnson Anatole D. Ruslanov William M. Mongan
CSE 370 – Winter Combinational Logic - 1
For OCR GCSE Computing Unit 1 - Theory
Boolean Algebra.
Week 7: Gates and Circuits: PART II
Fundamentals of Computer Systems
Digital Logic.
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
Digital Logic.
COMS 361 Computer Organization
Logic Circuits I Lecture 3.
CMSC250 Fall 2018 Circuits 1 1.
Truth tables Mrs. Palmer.
ECE 352 Digital System Fundamentals
What are Logic Gates?.
Presentation transcript:

EMB1006 Boolean Logic Jonathan-Lee Jones

Overview What is logic Types of Logic gate Truth Tables Examples to work through Other Gates Binary Arithmetic Boolean Logic in Programming Boolean Algebra De Morgan’s Laws

What is Logic Computers and logic are inseparable - right? They are now but at the start things were much more hazy. The first computers were conceived as automatic arithmetic engines and while their creators were aware that logic had something to do with it all, they weren’t 100% clear as to the how or why.

What is Logic Boolean logic is very easy to explain and to understand. You start off with the idea that some statement P is either true or false, it can’t be anything in between (this called the law of the excluded middle). Then you can form other statements, which are true or false, by combining these initial statements together using the fundamental operators And, Or and Not.

Types of Logic Gate There are THREE types of fundamental Logic gate. These for the basis for Boolean logic. Other gates exist, but these can be made from combining the three fundamental types. AND gates OR gates NOT gates

Types of Logic Gate AND Gates These gates give a true (or 1) response if BOTH their inputs are true.

Types of Logic Gate OR Gates These gates give a true (or 1) response if EITHER or BOTH their inputs are true.

Types of Logic Gate NOT Gates These gates give a true (or 1) response if their input is false. These are known as INVERTERS

Truth Tables The rules for combining expressions are usually written down as tables listing all of the possible outcomes. These are called truth tables. They usually use either TRUE of FALSE, or 1 and 0 to represent the data. The truth tables for the three fundamental operators these are:

Truth Tables A B O 1 AND Gate A O B

Truth Tables A B O 1 AND Gate A O B

Truth Tables A B O 1 AND Gate A O B

Truth Tables A B O 1 AND Gate A O B

Truth Tables A B O 1 AND Gate A O B

Truth Tables A B O 1 OR Gate A O B

Truth Tables A B O 1 OR Gate A O B

Truth Tables A B O 1 OR Gate A O B

Truth Tables A B O 1 OR Gate A O B

Truth Tables A B O 1 OR Gate A O B

Truth Tables A O 1 NOT Gate A O

Truth Tables A O 1 NOT Gate A O

Truth Tables A O 1 NOT Gate A O

Examples A O B C D E A B C D E O

Examples A O B C D E A B C D E O

Examples A O B C D E A B C D E O 1

Examples A O B C D E A B C D E O 1

Examples A O B C D E A B C D E O 1

Examples A O B C D E A B C D E O 1

Examples A O B C D E A B C D E O 1

Examples A O B C D E A B C D E O 1

Examples A O B C D E A B C D E O 1

Examples A D B E O C A B C D E O

Examples A D B E O C A B C D E O 1

Examples A D B E O C A B C D E O 1

Examples A D B E O C A B C D E O 1

Examples A D B E O C A B C D E O 1

Examples A D B E O C A B C D E O 1

Other Gates EOR(XOR) Gates These gates give a true (or 1) response if one of their inputs is TRUE, but not BOTH. They are EXCLUSIVE OR GATES A O B A B O 1

Other Gates NAND Gates These gates give a true (or 1) response if BOTH their inputs are 0. They are a combination of A NOT and and AND gate. A O B A B O 1

Other Gates NOR Gates These gates give a true (or 1) response if both their inputs are 0. They are the combination of a NOT and an OR gate. A O B A B O 1

Binary Arithmetic Boolean logic can be used to implement binary arithmetic. Notice that there is no suggestion that binary arithmetic and Boolean logic are the same thing - they aren’t. Binary arithmetic is just an example of a place value system for representing values. That is, we humans work in base 10 and computers find it easier to work in base two because they don’t have ten fingers.

Binary Arithmetic However when you do binary arithmetic you follow standard rules that determine how you should combine bits together to produce result bits. These rule can be expressed as combinatorial logic - in other words a truth table. Buy using a series of gates, it is then possible to carry out some arithmetic procedures.

Binary Arithmetic A B RESULT CARRY

Binary Arithmetic A B RESULT CARRY 1

Binary Arithmetic A B RESULT CARRY 1

Binary Arithmetic A B RESULT CARRY 1

Binary Arithmetic You can see that this is just another truth table and the combinatorial logic needed for it can be produced in the usual way. Actually this is only a half adder - yes this is the real technical term - in that it doesn’t add a carry bit that might have been generated by a previous pair of bits.

Binary Arithmetic The table for a “full adder”, this too is the correct technical term is: A B C RESULT CARRY 1

Boolean Logic in Programming Boolean logic is fundamental to the design of computer hardware even if it isn’t the whole story. The same holds true for programming. A program also needs the element of time built into it to make it work and this takes it beyond the bounds of simple Boolean logic. However there are times when simple common sense reasoning lets even the best programmer down.

Boolean Logic in Programming For example, a common task is making a decision using an IF statement: IF (A>0 AND A<10) THEN do something The bracket following the IF is almost pure Boolean logic and the something only gets done if it works out to be true. So far so simple, so simple in fact that many programmers decide that they don’t need to know anything about Boolean logic at all; a serious error.

Boolean Logic in Programming Consider how you would change this example so that the “something” was done when the condition was false. The simplest way is to write: IF NOT(A>0 AND A<10) THEN do something Instead of using NOT, a programmer wrote the code like this:- IF (A<=0 AND A>=10) THEN do something Is this correct? If not, how would you write the statement without using a NOT?

Boolean Logic in Programming IF (A<=0 AND A>=10) THEN do something This is incorrect. A can never be BOTH less that or equal to 0 AND greater than or equal to 10. The correct NOT of the condition is: IF (A<=0 OR A>10) THEN do something The switch from AND to OR shocks many experienced programmers and it is a source of many programming errors.

Boolean Algebra We don’t always draw logic gates for these. In Boolean Algebra we use different symbols to represent the logic. The basic operations of Boolean algebra are as follows. AND (conjunction), denoted x∧y (sometimes x AND y or Kxy), satisfies x∧y = 1 if x = y = 1 and x∧y = 0 otherwise. OR (disjunction), denoted x∨y (sometimes x OR y or Axy), satisfies x∨y = 0 if x = y = 0 and x∨y = 1 otherwise. NOT (negation), denoted ¬x (sometimes NOT x, Nx or !x), satisfies ¬x = 0 if x = 1 and ¬x = 1 if x = 0.

Boolean Algebra

Boolean Algebra (X or Y) or Z X Y X or Y Z (X or Y) or Z 1

Boolean Algebra (X or Y) or Z X Y X or Y Z (X or Y) or Z 1

Boolean Algebra X or (Y or Z) X Y Z Y or Z X or (Y or Z) 1

De Morgan’s Laws The rules can be expressed in English as: The negation of a conjunction is the disjunction of the negations. The negation of a disjunction is the conjunction of the negations. or informally as: "not (A and B)" is the same as "(not A) or (not B)" and also, "not (A or B)" is the same as "(not A) and (not B)".