13 October 2015Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.

Slides:



Advertisements
Similar presentations
Introduction to Computer Systems
Advertisements

8 October 2013Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.
15 October 2013Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.
INTRODUCTION LOGICAL OPERATIONS TRUTH TABLE AND RULES.
EET 1131 Unit 7 Arithmetic Operations and Circuits
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, Java Version, Third Edition.
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, C++ Version, Third Edition.
Iteration & Branching CSC 171 FALL 2001 LECTURE 5.
Lecture 2 Dr Richard Reilly Dept. of Electronic & Electrical Engineering Room 153, Engineering Building To insert your company logo on this slide From.
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Lecture 3 Dr. Shi Dept. of Electrical and Computer Engineering.
Chapter 4 Operations on Bits
BOOLEAN LOGIC CSC 171 FALL 2004 LECTURE 7. ASSIGNMENT Review Quiz # 2 Start reading Chapter 5.
Boolean Algebra and Truth Table The mathematics associated with binary number system (or logic) is call Boolean: –“0” and “1”, or “False” and “True” –Calculation.
1 CSE 20: Lecture 7 Boolean Algebra CK Cheng 4/21/2011.
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.
4 Operations On Data Foundations of Computer Science ã Cengage Learning.
Programming for GCSE Topic 3.3: Boolean Logic and Truth Tables
Introduction to Computer Systems
Computers Organization & Assembly Language
Computer Science 101 The Boolean System. George Boole British mathematician ( ) Boolean algebra –Logic –Set theory –Circuits –Conditions in if.
CPSC 171 Introduction to Computer Science Boolean Logic, Gates, & Circuits.
Boolean Algebra – the ‘Lingua Franca’ of the Digital World The goal of developing an automata is based on the following (loosely described) ‘ideal’: if.
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.
Lecture 7 How computers process data (Number Systems) PRESENTED BY MD. MAHBUBUL ALAM, PHD 1.
Click to edit Master title style Click to edit Master text styles –Second level Third level –Fourth level »Fifth level 1 Today’s Topics How information.
25 November 2014Birkbeck College1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems
Fall 2012: FCM 708 Foundation I Lecture 2 Prof. Shamik Sengupta
An Introduction to Programming Using Alice Boolean Logic.
Computer Science 210 Computer Organization Introduction to Boolean Algebra.
6 October 2015Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.
6 October 2015Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.
D75P 34R - HNC Computer Architecture Week 6 Boolean Logic © C Nyssen/Aberdeen College 2004 All images © C Nyssen /Aberdeen College unless otherwise stated.
Bits, Data types, and Operations: Chapter 2 COMP 2610 Dr. James Money COMP
Computer Science 101 Circuit Design - Examples. Sum of Products Algorithm Identify each row of the output that has a 1. Identify each row of the output.
29 September 2015Birkbeck College, U. London1 Introduction to Computer Systems Department of Computer Science and Information Systems Autumn 2015 Preliminary.
29 September 2015Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.
Teaching Computing to GCSE Level with Python Session 3.
Digital Logic Design Week 4 Boolean algebra. Laws and rules De Morgan’s theorem Analysis of logic circuits Standard forms Project 1 preparation.
CMP 100 Introduction to Computing Lecture Binary Numbers & Logic Operations.
Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems
17 November 2015Birkbeck College1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
20 October 2015Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.
3 November 2015Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.
17 November 2015Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.
Appendix C Basics of Digital Logic Part I. Florida A & M University - Department of Computer and Information Sciences Modern Computer Digital electronics.
Introduction to Computer Systems
12 February 2016Birkbeck College, U. London1 Introduction to Programming Lecturer: Steve Maybank Department of Computer Science and Information Systems.
ECE DIGITAL LOGIC LECTURE 6: BOOLEAN ALGEBRA Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2016, 02/01/2016.
24 November 2015Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.
BOOLEAN ALGEBRA LOGIC GATES. Introduction British mathematician George Boole( ) was successful in finding the link between logic and mathematics.
DIGITAL ELECTRONICS. Everything in digital world is based on binary system. Numerically it involves only two symbols 0 or 1. –0 = False = No –1 = True.
Invitation to Computer Science, C++ Version, Fourth Edition
Introduction to Computer Systems
Computer Science 210 Computer Organization
CSS 342 Data Structures, Algorithms, and Discrete Mathematics I
Fundamentals & Ethics of Information Systems IS 201
University of Gujrat Department of Computer Science
Invitation to Computer Science, Java Version, Third Edition
Introduction to Programming
Agenda – 2/12/18 Questions? Readings: CSI 4, P
Computer Science 210 Computer Organization
Introduction to Programming
Boolean Algebra Introduction CSCI 240
Boolean Algebra.
CSE 311 Foundations of Computing I
CMSC250 Fall 2018 Circuits 1 1.
Lecture 5 Binary Operation Boolean Logic. Binary Operations Addition Subtraction Multiplication Division.
XOR Function Logic Symbol  Description  Truth Table 
Introduction to Programming
Presentation transcript:

13 October 2015Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems Autumn 2015 Week 3a: Boolean Operations

Recap: Binary Numbers In the standard notation for binary numbers a bit string such as 1001 stands for a sum of powers of 2: 1x2 3 +0x2 2 +0x2 1 +1x2 0 Binary[1001] and Decimal[9] are different names for the same number 13 October 2015Birkbeck College, U. London2

Recap: Conversion of Decimal to Binary Let m be a strictly positive integer Binary[b] = Decimal[m] m=2q+r b=c||r Binary[c] = Decimal[q] 26 October 2010Birkbeck College, U. London3

Recap: Binary Addition 13 October 2015Brookshear, Section 1.54 column: ===== There is a carry from column 1 to column 2 and from column 2 to column 3 In tests or examinations, always show the carries

Recap: Two’s Complement Two’s complement representations can be added as if they were standard binary numbers. 13 October 2015Brookshear, Section == ====

George Boole 13 October 2015Birkbeck College, U. London (Lincoln)-1864 (Ballintemple) 1849: publishes “An investigation into the laws of thought, on which are founded the mathematical theories of logic and probabilities”

Comparison of Numbers 13 October 2015Birkbeck College, U. London7 Symbol Description TrueFalse >greater than 5 > 15 > 10 >=greater than or equal to6 >= 6 1 >= 7 <less than 5 < 6 5 < 5 <=less than or equal to 2 <= 2 3 <= 2 ==equal to4 == 4 4 == 5 True and False are referred to as truth values

Examples of Boolean Statements 5>4 NOT(4==2) (5>4) AND (6>2) (1>4) OR (2>6) Note the use of NOT, AND and OR to create complicated statements out of simpler ones. 13 October 2015Brookshear, Section 1.18

Application Boolean statements are used to control the order in which the instructions (or statements) of a program are carried out. A Boolean statement is either True (1) or False (0). Example: x=4; if(x>6) then S(1) else S(2) 13 October 2015Birkbeck College, U. London9

Binary Boolean Operation A unary Boolean operation takes a truth value as input and outputs a truth value. Example: NOT A binary Boolean operation takes two truth values as input, and outputs a truth value. Examples: AND, OR, XOR 13 October 2015Brookshear, Section 1.110

13 October 2015Brookshire, Section Boolean Operations: AND, OR ABC C = A AND B ABC C = A OR B These are truth tables. 1 = True, 0 = False.

13 October 2015Brookshire, Section Boolean Operations: XOR, NOT AC C = NOT A 1 = True, 0 = False ABC C=A XOR B

13 October 2015Birkbeck College, U. London13 Boolean Statements Today is Thursday OR Today is Friday NOT[It is morning] He is in London AND He is in Leeds Each statement has a truth value. If the truth values of statements of A, B are known, then the truth values of (A OR B), NOT(A) and (A AND B) can be calculated.

13 October 2015Birkbeck College, U. London14 Combinations of Boolean Operations NOT(A AND B) A OR NOT(B) (A OR B)OR C A OR (B OR C) NOT(NOT(A) AND NOT(B))

13 October 2015Birkbeck College, U. London15 Application of a Boolean Operation 1. k=0 2. n=27 3. If 2 k+1 > n, Print(k); Halt 4. k=k+1 5. go to 3 Variables in this program: k, n

13 October 2015Birkbeck College, U. London16 While Loop Version 1. k = 0 2. n = While (2 k+1 <= n) 4. k = k+1 5. EndWhile 6. Print k 7. Halt

Boolean Operations for Addition 13 October 2015Birkbeck College, U. London17 x 2 x 1 y 1 ====== z 3 z 2 z 1

Binary Addition 13 October 2015Birkbeck College, U. London18 x 2 x 1 y 1 ====== z 3 z 2 z 1

13 October 2015Birkbeck College, U. London19 How Many Binary Boolean Operations? Answer 16. Why? A truth table with columns A, B, C has one row for each pair of values of A, B. This gives four rows. Each Boolean operation is defined by the entries in column C. The number of different choices for column C is 2x2x2x2 = 16.