1 Intro to Computer Science I Chapter 1 Introduction to Computation Algorithms, Processors, and Programs.

Slides:



Advertisements
Similar presentations
Computer Systems Nat 4/5 Computing Science Computer Structure:
Advertisements

Dr. Ken Hoganson, © August 2014 Programming in R COURSE NOTES 2 Hoganson Language Translation.
4/23/2015Engineering Problem Solving with C++ second edition, J. ingber 1 Engineering Problem Solving with C++, Etter/Ingber Chapter 1.
Microprocessors. Microprocessor Buses Address Bus Address Bus One way street over which microprocessor sends an address code to memory or other external.
CSCE 145: Algorithmic Design I Chapter 1 Intro to Computers and Java Muhammad Nazmus Sakib.
LECTURE 1 CMSC 201. Overview Goal: Problem solving and algorithm development. Learn to program in Python. Algorithm - a set of unambiguous and ordered.
Engineering Problem Solving With C++ An Object Based Approach Fundamental Concepts Chapter 1 Engineering Problem Solving.
Chapter 1: An Overview of Computers and Programming Languages J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program.
1 Engineering Problem Solving With C++ An Object Based Approach Fundamental Concepts Chapter 1 Engineering Problem Solving.
Low-Level Programming Languages
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. COMPSCI 125 Introduction to Computer Science I.
1 Programming Languages b Each type of CPU has its own specific machine language b But, writing programs in machine languages is cumbersome (too detailed)
Computing Components 01/26/11. Announcements & Reminders Programs 1 due Friday, 9/2/11 What is my late policy? Proxy Codes for Labs  You should be able.
Introduction to Computers and Programming. Some definitions Algorithm: –A procedure for solving a problem –A sequence of discrete steps that defines such.
Consider With x = 10 we may proceed as (10-1) = 9 (10-7) = 3 (9*3) = 27 (10-11) = -1 27/(-1) = -27 Writing intermediates on paper.
Chapter 16 Java Virtual Machine. To compile a java program in Simple.java, enter javac Simple.java javac outputs Simple.class, a file that contains bytecode.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages C++ Programming:
CS 101 Problem Solving and Structured Programming in C Sami Rollins Spring 2003.
Introduction to Computers and Programming. Some definitions Algorithm: Algorithm: A procedure for solving a problem A procedure for solving a problem.
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers.
Assembly Language for Intel-Based Computers, 5 th Edition Chapter 1: Basic Concepts (c) Pearson Education, All rights reserved. You may modify.
1 I.Introduction to Algorithm and Programming Algoritma dan Pemrograman – Teknik Informatika UK Petra 2009.
Computer Programming-1 CSC 111 Chapter 1 : Introduction.
1 Chapter-01 Introduction to Computers and C++ Programming.
Chapter 1 An Overview of Computers and Programming Languages.
An Introduction Chapter Chapter 1 Introduction2 Computer Systems  Programmable machines  Hardware + Software (program) HardwareProgram.
Assembly Language for x86 Processors 7th Edition
Chapter 1 Introduction. Goal to learn about computers and programming to compile and run your first Java program to recognize compile-time and run-time.
Computer Systems Organization CS 1428 Foundations of Computer Science.
Introduction to Computer Systems and the Java Programming Language.
Java means Coffee Java Coffee Beans The name “JAVA” was taken from a cup of coffee.
4-1 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Principles.
Fundamental Programming: Fundamental Programming K.Chinnasarn, Ph.D.
IXA 1234 : C++ PROGRAMMING CHAPTER 1. PROGRAMMING LANGUAGE Programming language is a computer program that can solve certain problem / task Keyword: Computer.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages.
Basic of Programming Language Skill Area Computer System Computer Program Programming Language Programmer Translators.
Computer Operations A computer is a programmable electronic device that can store, retrieve, and process data Data and instructions to manipulate the data.
CHAPTER 1 INTRODUCTION 2 nd Semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
Represents different voltage levels High: 5 Volts Low: 0 Volts At this raw level a digital computer is instructed to carry out instructions.
Computer Science I CSCI Summer 2009 David E. Goldschmidt, Ph.D.
Chapter 1 Introduction. Components of a Computer CPU (central processing unit) Executing instructions –Carrying out arithmetic and logical operations.
Textbook C for Scientists and Engineers © Prentice Hall 1997 Available at NUS CO-OP at S$35.10.
Spring 2009 Programming Fundamentals I Java Programming XuanTung Hoang Lecture No. 8.
Simple ALU How to perform this C language integer operation in the computer C=A+B; ? The arithmetic/logic unit (ALU) of a processor performs integer arithmetic.
Chapter 1 An Overview of Computers and Programming Languages.
©Brooks/Cole, 2003 Chapter 1 Introduction. ©Brooks/Cole, 2003 Figure 1-1 Data processor model This model represents a specific-purpose computer not a.
Software. Introduction n A computer can’t do anything without a program of instructions. n A program is a set of instructions a computer carries out.
Computer Operation. Binary Codes CPU operates in binary codes Representation of values in binary codes Instructions to CPU in binary codes Addresses in.
C++ Programming: From Problem Analysis to Program Design, Fifth Edition Chapter 1: An Overview of Computers and Programming Languages.
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
Programming Languages Salihu Ibrahim Dasuki (PhD) CSC102 INTRODUCTION TO COMPUTER SCIENCE.
Algorithms in Programming Computer Science Principles LO
Chapter 1 Introduction 2nd Semester H
Computing Science Computer Structure: Lesson 1: Processor Structure
What Do Computers Do? A computer system is
Java Programming: From the Ground Up
Introduction to Computers and C++ Programming
Assembly Language for x86 Processors 6th Edition
Engineering Problem Solving With C An Object Based Approach
CPU Organisation & Operation
Lecture 1: Introduction to JAVA
COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE
Chapter 1: An Overview of Computers and Programming Languages
Computer Architecture and Organization Miles Murdocca and Vincent Heuring Chapter 4 – The Instruction Set Architecture.
C++ Programming: From Problem Analysis to Program Design
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
CS105 Introduction to Computer Concepts Intro to programming
Low Level Programming Languages
MARIE: An Introduction to a Simple Computer
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
Presentation transcript:

1 Intro to Computer Science I Chapter 1 Introduction to Computation Algorithms, Processors, and Programs

BGA 2 Algorithm A sequence of unambiguous steps for accomplishing some task or process. In theory an algorithm can have an infinite number of steps but in practice algorithms must have a finite number of steps. Example: calculating requires an infinite number of steps (infinite non-repeating decimal expansion).

BGA 3 Finite Algorithm for

BGA 4 Processor Any device, calculator, computer, virtual machine, or human being that can process or execute an algorithm. Each type of processor understands a language (e.g., machine language) and algorithms must be expressed in this language in order for the processor to be able to execute them.

BGA 5 Memory words, addresses Memory WordsAddressesMemory words contain data. Each memory word has an address which is used to locate this data. A common size for a word is 8 bits (byte). One or more bytes is required to store each data item (an integer for example) or machine language instruction.

BGA 6 Block diagram of a computer Main Memory Secondary Memory Input Devices Output Devices Registers Control Unit ALU

BGA 7 Program A representation of an algorithm as a sequence of instructions that can be understood and executed by a processor to complete the task, problem or process described by the algorithm. For a CPU the program is a sequence of machine language instructions stored in memory in binary form

BGA 8 Computer Languages Machine language (Lowest level) Assembly language mnemonic form of machine language High level language C, C++, Java Closer to the human level of problem solving

BGA 9 An addition problem Pseudo-code i6(assign 6 to i) j7(assign 7 to j) k511(assign 511 to k) sumi + j + k(assign sum to sum)

BGA 10 Machine Language (PC) Following string of 112 bits

BGA 11 Assembly language (PC) movax,i addax,j addax,k movsum,ax idw6 jdw7 kdw511 sumdw0

BGA 12 Java, C++ int i = 6 ; int j = 7 ; int k = 511 ; int sum = i + j + k ;

BGA 13 The compilation process High Level Language Program Source Code Machine Language Program Object Code Compiler The compiler translates the high level language source code program into a machine language object code program that can be understood by the computer's CPU.

BGA 14 The interpretation process High Level Language Program Source Code Statement The interpreter translates one statement at a time and has it executed by the CPU before returning to translate another statement Interpreter Back for next statement

BGA 15 The Java Virtual Machine Java Source Code Bytecode (class file) Java Compiler Bytecode (class file) Java Virtual Machine Real Machine Java Interpreter (a) (b)

BGA 16 Java translation example AssemblyBytecodeBytecode Language(hexadecimal)(binary) bipush istore_13C bipush istore_23D sipush FF istore_33E iload_11B iload_21C iadd iload_31D iadd istore