Lesson 1b: Computer Systems and Program Development CPS118.

Slides:



Advertisements
Similar presentations
Chapter 1 An Overview of Computers and Programming Languages.
Advertisements

ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Lecture 1: Overview of Computers & Programming
INTRODUCTION OF COMPUTER
Flow chart and Algorithm. Announcement Exam One – Wednesday October 1st – 100 points – Mixture of short answer, problem solving, matching, and maybe a.
ENGR2216 FORTRAN PROGRAMMING FOR ENGINEERS. Chapter 1 The computer CPU MEMORY INPUT/OUTPUT DEVICES DATA REPRESENTATION BINARY SYSTEM OCTAL & HEXADECIMAL.
Chapter 1: An Overview of Computers and Programming Languages J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program.
Main Memory Lecture 2 CSCI 1405, CSCI 1301 Introduction to Computer Science Fall 2009.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. COMPSCI 125 Introduction to Computer Science I.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
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.
Chapter 1: An Overview of Computers and Programming Languages
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages C++ Programming:
Topic 1: Introduction to Computers and Programming
Introduction to Computers and Programming. Some definitions Algorithm: Algorithm: A procedure for solving a problem A procedure for solving a problem.
Starting Out with C++: Early Objects 5/e © 2006 Pearson Education. All Rights Reserved Starting Out with C++: Early Objects 5 th Edition Chapter 1 Introduction.
CIS 260 Computer Programming I in C Prof. Timothy Arndt.
CMSC 104, Version 9/01 1 Machine Architecture and Number Systems Topics Major Computer Components Bits, Bytes, and Words The Decimal Number System The.
1 I.Introduction to Algorithm and Programming Algoritma dan Pemrograman – Teknik Informatika UK Petra 2009.
CS102 Introduction to Computer Programming
Alternate Version of STARTING OUT WITH C++ 4 th Edition Chapter 1 Introduction to Computers and Programming.
WHAT IS A COMPUTER??? An electronic device that accepts: n Input n Processes the input n Stores the results of the processing n provides Output Computers.
Why Program? Computer – programmable machine designed to follow instructions Program – instructions in computer memory to make it do something Programmer.
Chapter Introduction to Computers and Programming 1.
Aug CMSC 104, LECT-021 Machine Architecture and Number Systems Some material in this presentation is borrowed form Adrian Ilie From The UNIVERSITY.
An Introduction to Hardware, Software, and the Internet
CSC 125 Introduction to C++ Programming Chapter 1 Introduction to Computers and Programming.
Chapter 1 An Overview of Computers and Programming Languages.
1 Machine Architecture and Number Systems Topics Major Computer Components Bits, Bytes, and Words The Decimal Number System The Binary Number System Converting.
Chapter 1: Introduction to Computers and Programming.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
Computer Programming Basics Assistant Professor Jeon, Seokhee Assistant Professor Department of Computer Engineering, Kyung Hee University, Korea.
CISC105 General Computer Science Class 1 – 6/5/2006.
An Introduction to Computers August 12, 2008 Mrs. C. Furman.
Machine Architecture CMSC 104, Section 4 Richard Chang 1.
Chapter 1: An Overview of Computers and Programming Languages
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages.
Lesson 3 — How a Computer Processes Data Unit 1 — Computer Basics.
School of Computer Science & Information Technology G6DICP Introduction to Computer Programming Milena Radenkovic.
Aug CMSC 104, LECT-021 Machine Architecture Some material in this presentation is borrowed form Adrian Ilie From The UNIVERSITY of NORTH CAROLINA.
Development of Computers. Hardware 1. Original concept: Charles Babbage 1840’s 2. 4 basic components of a computer system: input store mill output (Now:
Machine Architecture and Number Systems
Scott Marino MSMIS Kean University MSAS5104 Introduction to Programming with Data Structures and Algorithms Week 2 Scott Marino.
Beginning Snapshots Chapter 0. C++ An Introduction to Computing, 3rd ed. 2 Objectives Give an overview of computer science Show its breadth Provide context.
Chapter 1 : Overview of Computer and Programming By Suraya Alias
CMSC Machine Architecture and Number Systems Topics Major Computer Components Bits, Bytes, and Words The Decimal Number System The Binary Number.
A.Abhari CPS1251 Topic 1: Introduction to Computers Computer Hardware Computer components Connecting Computers Computer Software Operating System (OS)
Algorithm An algorithm, named after the ninth century scholar Abu Jafar Muhammad Ibn Musu Al- Khowarizmi, is defined as follows: An algorithm is a set.
Chapter 1 Introduction. Components of a Computer CPU (central processing unit) Executing instructions –Carrying out arithmetic and logical operations.
Chapter 1 An Overview of Computers and Programming Languages.
CHAPTER 1 COMPUTER SCIENCE II. HISTORY OF COMPUTERS (1.1) Eniac- one of the worlds first computers Used more electricity than an entire city block of.
C++ Programming: From Problem Analysis to Program Design, Fifth Edition Chapter 1: An Overview of Computers and Programming Languages.
Computer Basics Just How Does a Computer Work?
IC 3 BASICS, Internet and Computing Core Certification Computing Fundamentals Lesson 2 How Does a Computer Process Data?
1 Chapter 1 Background Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
Computer Graphics HARDWARE. Computers  Computers are automatic, electronic machines that –accept data & instructions from a user (INPUT) –store the data.
Computer Systems and Program Development
Computer Systems and Program Development
Computer Science II Chapter 1.
Chapter 1: An Overview of Computers and Programming Languages
Chapter 1: An Overview of Computers and Programming Languages
COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Chapter 1: An Overview of Computers and Programming Languages
C++ Programming: From Problem Analysis to Program Design
Overview of Computers & Programming Languages
Computer Science I CSC 135.
ICS103 Programming in C 1: Overview of Computers And Programming
Presentation transcript:

Lesson 1b: Computer Systems and Program Development CPS118

Objectives What Is a Computer? What is an algorithm? Computer Components Binary number system Software Development Method problem solving

Computer Systems Computers are electronic systems that can transmit, store and manipulate information (data). Data can be numeric, character, graphic and sound. For beginner programmers, the two most important are character and numeric. To manipulate data, a computer needs a set of instructions called a program. To write such programs is the object of this course.

Computer An electronic machine that can receive, store, transform, and output data of all kinds numbers, text, images, graphics, and sound, to name a few.

Algorithms An algorithm is a series of instructions on how to solve the problem. An algorithm is a finite set of instructions which, if followed, accomplish a particular task. Computing definition: A computable set of steps to achieve a desired result.

Characteristics of algorithms Algorithms have the following characteristics: Precision Uniqueness Finiteness Input Output Generality

Criteria of algorithm must satisfy the following: input: there are 0 or more quantities which are externally supplied; output: at least one quantity is produced; definiteness: each instruction must be clear and unambiguous; finiteness: for all cases the algorithm will terminate after a finite number of steps; effectiveness: every instruction must be sufficiently basic it can in principle be carried out by a person using only pencil and paper.

A friend come to visit you: The taxi algorithm: Go to the taxi stand. Get in a taxi. Give the driver my address. The call-me algorithm: When your plane arrives, call my cell phone.planecell phone Meet me outside baggage claim.baggage claim The rent-a-car algorithm: Take the shuttle to the rental car place. Rent a car. Follow the directions to get to my house. The bus algorithm: Outside baggage claim, catch bus number 70. Transfer to bus 14 on Main Street. Get off on Elm street. Walk two blocks north to my house.

Algorithm Example Input (what is needed by the program): n Output (the value computed by the program): 1/1+1/ /n 1. answer=0 (initialize the answer at 0) 2. d=1 (start the denominator at 1) 3. answer=answer+1/d (adding 1/d to the previous answer) 4. d=d+1 (adding 1 to the denominator) 5. repeat lines 3 and 4 until d is equal to n

Computer Systems 3 types of computer systems: Mainframes and minicomputers Workstations Personal computers PCs Laptops

Components of a Computer

Computer Components Central Processing Unit Main Memory ALUCU CD zip disk floppy disk Secondary Storage: mouse monitor keyboard hard disk printer scanner Input & Output Devices

Computer System CPU + Main Memory ~ “core” Secondary Storage + I/O Devices ~ “peripherals” Bus ~ communication between components CP U Sec. Storage I/O 1 I/O 2 I/O n Memo ry Bus

Storage Types CPU Registers: Only a few cells on CPU Main memory (RAM): Millions of cells on circuits separate from CPU. Secondary storage: Billions of cells on disks or tapes. Secondary storage is not volatile.

Internal representations Bit: Binary digit (0 or 1). Byte: A group of 8 bits. One character. Word: The width of a memory cell. Each byte of main memory has an address. All numbers are represented in binary.

Integer numbers NOTE: The following number representations are simplified. They do not represent the actual pattern inside most computers. All numbers are converted in binary: ex: 9 = 1001 In a computer system, the leftmost bit is the sign bit (0 is positive, 1 is negative). So 9 in a 32 bit system would be:

Real numbers Real numbers in binary are expressed with a mantissa, a base and an exponent. For a real number, the mantissa is defined as the positive fractional partreal numberpositivefractional part Suppose 9.0 in binary: In 32 bits a simple view is bit sign=0 base and exponent=16 (base=2, exponent=4). mantissa=9/16= for 32 bit float number (8: exp, 23 mantissa):

32 bit real number 1: : : : : : : : :

32 bit real number cont’d 10: : : : : : :

Real numbers A double number is expressed in 64 bits: 52 bits for the mantissa, 11 bits for the exponent and 1 sign bit. Exponent: right to left, like an integer. Mantissa: left to right, 0.5, 0.25, 0.125, ,... and so on. 1 if needed, 0 if not. So 9.0 is:

Characters Characters are expressed using the ASCII code: A =65 = g =103= $ =36 = =43= See code here:

Programming Languages Generation 1: Machine languages (pure binary) Generation 2: Assembly languages (mnemonic codes) MV R1,R3 Generation 3: High-Level Languages (C, Fortran, Java)

Solving Problems 1. Define the problem 2. Analyse the problem. 3. Design a solution. 4. Implement the solution. 5. Test the program. 6. Update and maintain the program.

Implementation Here is a detail of step #4, implementation (actual programming): 4.1 Write the program source. 4.2 Compile the source code and check for errors. 4.3 Link the code with libraries and build the program. 4.4 Run the program.

Why C? 1. It is portable. 2. It is efficient. 3. It is easy to learn. 4. It is modular. 5. It is widespread.

Summary Computer algorithm Computer Components Binary number system Software Development Method problem solving

End of lesson