情報基礎B   Lecture 7 Takeshi Tokuyama Tohoku University Graduate School of Information Sciences System Information Sciences Design and Analysis of Information.

Slides:



Advertisements
Similar presentations
Excel Formulas Some Notes About Formulas Mr. Specter Some Notes About Formulas Mr. Specter.
Advertisements

UNIT 8 DIGITAL LOGIC. (1) To study and understand Boolean algebra and Boolean properties. (2) To design and analyze Logic gates. (3) To design and analyze.
CS 101 Introductory Programming - Lecture 7: Loops In C & Good Coding Practices Presenter: Ankur Chattopadhyay.
情報基礎 B Lecture 5 Takeshi Tokuyama Tohoku University Graduate School of Information Sciences System Information Sciences Design and Analysis of Information.
情報基礎 A Lecture 10 Takeshi Tokuyama Tohoku University Graduate School of Information Sciences System Information Sciences Design and Analysis of Information.
Chapter 4 Control Structures I. Objectives ► Examine relational and logical operators ► Explore how to form and evaluate logical (Boolean) expressions.
General Computer Science for Engineers CISC 106 Lecture 19 Dr. John Cavazos Computer and Information Sciences 04/06/2009.
Computer ArchitectureFall 2008 © August 25, CS 447 – Computer Architecture Lecture 3 Computer Arithmetic (1)
J. Michael Moore Computer Processing CSCE 110. J. Michael Moore ProcessorInputOutput Memory Storage.
Unit 1. Sorting and Divide and Conquer. Lecture 1 Introduction to Algorithm and Sorting.
Propositional Equivalence Goal: Show how propositional equivalences are established & introduce the most important such equivalences.
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.
Working with Arduino: Lesson #1: Getting Acquainted with the Kit EGN1007.
ALGORITHMS AND FLOWCHARTS
Tell the robot exactly how to draw a square on the board.
情報基礎 A Lecture 15 Takeshi Tokuyama Tohoku University Graduate School of Information Sciences System Information Sciences Design and Analysis of Information.
Test #1 rescheduled to next Tuesday, 09/20/05 The contents will cover chapter 1, 2, and part of Chapter 4. The contents will cover chapter 1, 2, and part.
Binary Numbers.
情報基礎 B Lecture 8 Takeshi Tokuyama Tohoku University Graduate School of Information Sciences System Information Sciences Design and Analysis of Information.
Decision II. CSCE 1062 Outline  Boolean expressions  switch statement (section 4.8)
CPS120: Introduction to Computer Science Operations Lecture 9.
BASIC LOGIC GATES. In studying digital in integrated circuits, one must start with the simples group of circuits, the SSIs or Small Scale Integrated Circuits.
4. Computer Maths and Logic 4.2 Boolean Logic Logic Circuits.
Logic Design CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 8 Arrays.
Logic Gates Informatics INFO I101 February 3, 2003 John C. Paolillo, Instructor.
1 Lecture 10: Floating Point, Digital Design Today’s topics:  FP arithmetic  Intro to Boolean functions.
ICC Module 3 Lesson 1 – Computer Architecture 1 / 12 © 2015 Ph. Janson Information, Computing & Communication Computer Architecture Clip 5 – Memory Circuits.
Variables Continued In the last session we saw how variables are objects that allow us to store values in the RAM of the computer In this session we shall.
The Department of Engineering Science The University of Auckland Welcome to ENGGEN 131 Engineering Computation and Software Development Lecture 2 Debugging,
Logic Design EE-2121 Manesh T. Digital Systems  Introduction  Binary Quantities and Variables  Logic Gates  Boolean Algebra  Combinational Logic.
Lecture 7: Menus and getting input. switch Multiple-selection Statement switch Useful when a variable or expression is tested for all the values it can.
情報基礎 A Lecture 9 Takeshi Tokuyama ・ Jinhee Chun Tohoku University Graduate School of Information Sciences System Information Sciences Design and Analysis.
CSC 331: DIGITAL LOGIC DESIGN COURSE LECTURER: E. Y. BAAGYERE. CONTACT: LECTURE TIME: 15:40 – 17:45 hrs. VENUE: SP-LAB.
情報基礎 A Lecture 12 Takeshi Tokuyama Tohoku University Graduate School of Information Sciences System Information Sciences Design and Analysis of Information.
Looping I (while statement). CSCE 1062 Outline  Looping/repetition construct  while statement (section 5.1)
The Department of Engineering Science The University of Auckland Welcome to ENGGEN 131 Engineering Computation and Software Development Lecture 2 Debugging,
CMSC201 Computer Science I for Majors Lecture 05 – Comparison Operators and Boolean (Logical) Operators Prof. Katherine Gibson Prof. Jeremy.
Unit 1 Introduction Number Systems and Conversion.
CDA3101 Recitation Section 5
CMSC201 Computer Science I for Majors Lecture 05 – Comparison Operators and Boolean (Logical) Operators Prof. Katherine Gibson Based on slides by Shawn.
CSE111 Introduction to Computer Applications
Unit 1 Logical operators.
GCSE OCR Computing A451 Binary logic Computing hardware 6.
Computer Science 210 Computer Organization
IGCSE 1 Cambridge Algorithms and flowcharts Unit 7 Computer Science
Propositional Equivalence
GC211Data Structure Lecture2 Sara Alhajjam.
Unit 1. Sorting and Divide and Conquer
CS1001 Programming Fundamentals 3(3-0) Lecture 2
Intro to C Tutorial 4: Arithmetic and Logical expressions
4-1 LOGIC OPERATIONS In Chapter 3 we discussed the fact that data inside a computer is stored as patterns of bits. Logic operations refer to those operations.
MIPS ALU.
ALGORITHMS AND FLOWCHARTS
Software Programming J. Holvikivi 2014.
Computer Science 210 Computer Organization
A451: Computer Systems and Programming
CISC101 Reminders Your group name in onQ is your grader’s name.
Week 7: Gates and Circuits: PART II
ALGORITHMS AND FLOWCHARTS
Montek Singh Mon, Mar 28, 2011 Lecture 11
Lecture 5 Binary Operation Boolean Logic. Binary Operations Addition Subtraction Multiplication Division.
ICT Gaming Lesson 2.
XOR Function Logic Symbol  Description  Truth Table 
情報基礎B   Lecture 6 Takeshi Tokuyama Tohoku University Graduate School of Information Sciences System Information Sciences Design and Analysis of Information.
Chapter 3: Selection Structures: Making Decisions
in Excel Instructor: Zhe He Department of Computer Science
COS 151 Bootcamp – Week 4 Department of Computer Science
COMPUTING.
Presentation transcript:

情報基礎B   Lecture 7 Takeshi Tokuyama Tohoku University Graduate School of Information Sciences System Information Sciences Design and Analysis of Information Systems

COMPUTATION AND PROGRAMMING

Computation The world of {0, 1} AND operation OR operation Boolean algebra Logical operation AND operation 0 × 0 = 0 × 1 = 1 × 0 = 0, 1 × 1 = 1 Series circuit OR operation 0 + 0 = 0, 0 + 1 = 1 + 0 = 1, 1 + 1 = 1 Parallel circuit NOT operation NOT(0) = 1, NOT(1) = 0 NOT

Computation AND operation 0 × 0 = 0 × 1 = 1 × 0 = 0, 1 × 1 = 1 Series circuit Switching : relay, transistor, diode

Computation OR operation 0 + 0 = 0, 0 + 1 = 1 + 0 = 1, 1 + 1 = 1 Parallel circuit

Computation a NOT(a) NOT operation NOT(0) = 1, NOT(1) = 0 electromanget NOT(a)

Example of Adder a b Circuit to calculate a + b (a, b = 0 or 1) 0 + 0 = 00 1 + 0 = 01 0 + 1 = 01 1 + 1 = 10 NOT Upper Bit Lower Bit

Computation Model AND, OR, NOT Logical operation Addition, subtraction, multiplication, division, comparison IF Programming model (decision tree model) Load data from storage Store data to storage

Program and Decision Tree IF(B2>=90, “A”, IF(B2>=80, “B”, IF(B2>=70, “C”, IF(B2>=60, “D”, “F”)))) B2 True False A True False B True False C True False D F Computation proceeds through the tree

Loop SUM(A2:A100) Decision tree becomes deep Loop structure Loop management When to stop? In Excel… By setting range A2:A100 Read a cell in column A Adder Temporal Result

Loop Example: SUM(A2:A100) i=2 i = i + 1 Read A(i) TRUE Adder i<100 Temporal Result i = i + 1 TRUE i<100 FALSE Output Temporal Result

Programming Think about an algorithm e.g. Grading procedure Show a flowchart with decision tree and loop structure Write the algorithm in programming language Small vocabulary, easy

Programming Make an operation which a computer work on Algorithm designing Logical work Coding Learning a programming language Read programs Make some change on programs Debug(Error correction)

Programming hints Learning programming language Follow examples Practice makes perfect Follow examples This is a pen > This is a dog Follow good examples Learn from the mistakes This is a apple ?? I is a man ?? System will tell you mistakes Guess what is wrong: logical mind and imagination

Exercise Write a flowchart of program that acts same as COUNTIF(B2:B21, “A”) without using COUNTIF