CSC 107 – Programming For Science. Follow-Up From Last Lecture.

Slides:



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

Sahar Mosleh PageCalifornia State University San Marcos 1 Introductory Concepts This section of the course introduces the concept of digital circuits and.
Discrete Event Control
BOOlean Logic The basis for digital electronics..
Cosc 2150: Computer Organization Chapter 3: Boolean Algebra and Digital Logic.
Data Storage – Part 1 CS 1 Introduction to Computers and Computer Technology Rick Graziani Fall 2013.
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Lecture 3 Dr. Shi Dept. of Electrical and Computer Engineering.
BOOLEAN LOGIC CSC 171 FALL 2004 LECTURE 7. ASSIGNMENT Review Quiz # 2 Start reading Chapter 5.
Chapter 4 Logic Gates and Boolean Algebra. Introduction Logic gates are the actual physical implementations of the logical operators. These gates form.
Copyright © Cengage Learning. All rights reserved. CHAPTER 2 THE LOGIC OF COMPOUND STATEMENTS THE LOGIC OF COMPOUND STATEMENTS.
EMB1006 Boolean Logic Jonathan-Lee Jones.
New Mexico Computer Science For All Booleans and Logic Maureen Psaila-Dombrowski.
Logic Gate A logic gate is an electronic circuit which makes logic decisions. It has one output and one or more inputs. The output signal appears only.
3. DIGITAL ELECTRONICS..
Boolean Logic By: Arthur Brooks February 25, 2003 Think, Speak, and Write Computer Science.
Computer Science 101 The Boolean System. George Boole British mathematician ( ) Boolean algebra –Logic –Set theory –Circuits –Conditions in if.
OCR GCSE Computing © Hodder Education 2013 Slide 1 OCR GCSE Computing Chapter 2: Binary Logic.
Lecture 7 How computers process data (Number Systems) PRESENTED BY MD. MAHBUBUL ALAM, PHD 1.
CSC Intro. to Computing Lecture 5: Boolean Logic, Gates, & Circuits.
 In studying digital integrated circuits, one must start with the simplest group of circuit, the SSIs or Small Scale Integrated Circuits. Since these.
Computer Science 210 Computer Organization Introduction to Boolean Algebra.
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.
CSC 107 – Programming For Science. Announcements.
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /05/2013 Lecture 4: Basics of Logic Design Instructor: Ashraf Yaseen DEPARTMENT OF MATH & COMPUTER.
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.
Lecture 22: 11/19/2002CS170 Fall CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University.
Week 6: Gates and Circuits: PART I READING: Chapter 4.
D75P 34R - HNC Computer Architecture Week 6 Boolean Logic © C Nyssen/Aberdeen College 2004 All images © C Nyssen /Aberdeen College unless otherwise stated.
CSC 107 – Programming For Science. Announcements  Memorization is not important, but…  … you will all still be responsible for information  Instead.
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. The Week’s Goal.
CSC 107 – Programming For Science. George Boole  Mathematician from English middle-class  Lived from 1815 – 1864  Started work at age 16 as a teaching.
Linear Algebra. Circuits The circuits in computers and other input devices have inputs, each of which is either a 0 or 1, the output is also 0s and 1s.
June 10, 2002© Howard Huang1 Number systems To get started, we’ll discuss one of the fundamental concepts underlying digital computer design:
Decision Structures and Boolean Variables. Sequence Structures Thus far, we’ve been programming “sequence structures” Thus far, we’ve been programming.
Laws of Boolean Algebra Commutative Law Associative Law Distributive Law Identity Law De Morgan's Theorem.
Chapter 4 Fundamentals of Computer Logic 1 Chapter 4: Fundamental of Computer Logic - IE337.
Arithmetic-logic units1 An arithmetic-logic unit, or ALU, performs many different arithmetic and logic operations. The ALU is the “heart” of a processor—you.
PHY 107 – Programming For Science. Announcements no magic formulas exist  Need to learn concepts: no magic formulas exist  Single solution not useful;
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Yaohang Li.
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.
CSC 107 – Programming For Science. Announcements  Lectures may not cover all material from book  Material that is most difficult or challenging is focus.
Operators A binary operator combines two values to get one result: x OP y where OP is any binary operators such as +, -, *, /, ==, !=, >, &&, or even =.
BOOLEAN ALGEBRA BIRLA VISHVAKARMA MAHAVDYALAYA V. V. NAGAR Guided By: Prof. P. B. Swadas Prepared By:
LOGIC CIRCUITLOGIC CIRCUIT. Goal To understand how digital a computer can work, at the lowest level. To understand what is possible and the limitations.
Logic Gates Unit 16.
Computer Programming Boolean Logic.
Logic gates.
Introduction to Decision Structures and Boolean Variables
CMSC201 Computer Science I for Majors Lecture 03 – Operators
3 – Boolean Logic and Logic Gates 4 – Binary Numbers
The basis for digital electronics.
Morgan Kaufmann Publishers
Logic Gates.
Computer Science 210 Computer Organization
A mechanism for deciding whether an action should be taken
CSCI-100 Introduction to Computing
COMPUTING FUNDAMENTALS
Computer Science 210 Computer Organization
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
SE1H421 Procedural Programming LECTURE 4 Operators & Conditionals (1)
Binary Logic.
Lecture 5 Binary Operation Boolean Logic. Binary Operations Addition Subtraction Multiplication Division.
Some basic electronics and truth tables
Truth tables Mrs. Palmer.
Copyright © Cengage Learning. All rights reserved.
Computer Programming Boolean Logic Trade & Industrial Education
Conditionals.
Presentation transcript:

CSC 107 – Programming For Science

Follow-Up From Last Lecture

Announcements

George Boole  Mathematician from English middle-class  Lived from 1815 – 1864  Started work at age 16 as a teaching assistant  Held two assistantships to support family  Opened own school after many years of work  In 1847 wrote Mathematical Analysis of Logic

Mathematical Analysis of Logic  Boole’s book proposed new logical system  World began with 2 values– though more created  Devised rules to add, subtract, & multiply  Work ignored during Boole’s lifetime  System only had 2 values, so what was the point?  What is done with developer of pointless knowledge?  Basis for most technology in the modern age  All it took was a simple little discovery…

Gate  Combines input(s) to generate output signal  Like most electronics, uses “on-off” state  Input is "off", if line drops below 3.3 volts  From volts, an input is considered on  Gate is deep fried silicon if line goes above 5 volts,  Like Boole’s logic, electronics have 2 values  Simple gates combine to make modern circuitry  All initially part of Boolean algebra  Basis of programming at the lowest, rawest level

Truth Table  Normal way that Boolean functions presented  All combinations of inputs shown in this table  This is really easy, inputs must be true or false  Output shown for each of the possible inputs  Given how it sounds, not at all complicated  Very simple rules to follow to construct  Does requires you count up to 2

NOT Gate  Simplest gate: computes opposite of input  Output false when input true;  Output true when input false; !a  Written in C++ as !a  a is gate’s input a !a!a!a!a true false a !a!a

OR Gate  Equivalent to addition in Boolean algebra  If either input is true is going to be checked  true when either a OR b are true; false otherwise a || b  Written in C++ as a || b  a & b are both inputs to gate ab a || b false true false true a b a || b

AND Gate  Equivalent to multiplication in Boolean algebra  If both inputs are true is going to be checked  True when a AND b are true; false otherwise a && b  Written in C++ as a && b  a & b are both inputs to gate a b a && b ab false true false true

Boolean Values  3 boolean functions can combine into computer  Billions of gates combined by engineers to make CPU (a && b) || (a && !c)  Could use, for example: (a && b) || (a && !c)  But how to generate inputs for these functions  First need boolean values of true and false  Easy in hardware (true is any signal > 3.3V)  But how could we do get values within our program?

Relational Operators  < ( less than)  > ( greater than)  <= ( less than of equal to)  >= ( greater than of equal to)  != ( inequality ≠)  == ( equality – if two things have same value)

Relational Operators

Assignment vs. Comparison

Relational Operators  Relational operators compute bool  Like any expression, can be used in any statements int nfl = 32; bool team = 0 > 6; bool group = 45 <= nfl; bool gang = nfl == 32; team = sqrt(144) == 12.0; group = (133 == pow(12, 2)); gang = (group == team);

Your Turn  Get in groups & work on following activity

For Next Lecture  Read sections 2.1 – 2.9 for Monday  Why do programmers never wash their hair?  How do we discuss & display program ideas?  Why do coders have flow? How can we chart this?  Week #3 weekly assignment due Tuesday  Problems available on Angel  If problem takes more than 10 minutes, TALK TO ME!