Chapter 1 Introduction. Components of a Computer CPU (central processing unit) Executing instructions –Carrying out arithmetic and logical operations.

Slides:



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

 Computer hardware components are the physical pieces of the computer.  The major hardware components of a computer are: – The central processing.
COSC 120 Computer Programming
Chapter 1: An Overview of Computers and Programming Languages J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program.
©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.
Introduction to Computers and Programming. Some definitions Algorithm: –A procedure for solving a problem –A sequence of discrete steps that defines such.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. COMPSCI 125 Introduction to Computer Science I.
1 CS150 Introduction to Computer Science 1 Professor: Chadd Williams
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
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.
CMSC 104, Version 9/01 1 Machine Architecture and Number Systems Topics Major Computer Components Bits, Bytes, and Words The Decimal Number System The.
CS190/295 Programming in Python for Life Sciences: Lecture 1 Instructor: Xiaohui Xie University of California, Irvine.
Introduction to Computers and Python. What is a Computer? Computer- a device capable of performing computations and making logical decisions at speeds.
Computer Programming-1 CSC 111 Chapter 1 : Introduction.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Alternate Version of STARTING OUT WITH C++ 4 th Edition Chapter 1 Introduction to Computers and Programming.
Chapter Introduction to Computers and Programming 1.
Introduction to Programming Dr Masitah Ghazali Programming Techniques I SCJ1013.
CSC 125 Introduction to C++ Programming Chapter 1 Introduction to Computers and Programming.
Chapter 1 An Overview of Computers and Programming Languages.
Computer Hardware and Software Chapter 1. Overview Brief History of Computers Hardware of a Computer Binary and Hexadecimal Numbers Compiling vs. Interpreting.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Chapter 1: Introduction to Computers and Programming.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
Lesson 1b: Computer Systems and Program Development CPS118.
CISC105 General Computer Science Class 1 – 6/5/2006.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Seventh Edition by Tony Gaddis, Judy.
What is a Computer? An, electrical machine, that can be programmed to accept data (input), process it into useful information (output) and store it away.
Computer Programming I. Today’s Lecture  Components of a computer  Program  Programming language  Binary representation.
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.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages.
Computer organization Practical 1. Administrative Issues The course requirements are: –To be nice and open minded –To pass the exam (there is a boolean.
CS 127 Introduction to Computer Science. What is a computer?  “A machine that stores and manipulates information under the control of a changeable program”
1 TOPIC 1 INTRODUCTION TO COMPUTER SCIENCE AND PROGRAMMING Topic 1 Introduction to Computer Science and Programming Notes adapted from Introduction to.
Machine Architecture and Number Systems
Chapter 1 Computers, Compilers, & Unix. Overview u Computer hardware u Unix u Computer Languages u Compilers.
CS 1308 Computer Literacy and the Internet. Objectives In this chapter, you will learn about:  The components of a computer system  Putting all the.
Chapter 1 : Overview of Computer and Programming By Suraya Alias
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
Problem Solving Techniques Using Pascal Allen C.-H. Wu Department of Computer Science Tsing Hua University Hsinchu, Taiwan 30043, ROC
1 Chapter 1 Programming Languages Evolution of Programming Languages To run a Java program: Java instructions need to be translated into an intermediate.
A.Abhari CPS1251 Topic 1: Introduction to Computers Computer Hardware Computer components Connecting Computers Computer Software Operating System (OS)
Computer Programming (1) Code & No.: CS 102 CREDIT HOURS: 5 UNIT Lecture 3.0 hours/week Lab: 2.0 hour/on every week a. This course introduces the students.
Ch 1 - Introduction to Computers and Programming Hardware Terminology Main Memory Auxiliary Memory Drives Writing Algorithms Using Pseudocode Programming.
1. COMPUTERS AND PROGRAMS Rocky K. C. Chang September 6, 2015 (Adapted from John Zelle’s slides)
Chapter 1 An Overview of Computers and Programming Languages.
©2013 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. Introduction to Computers and Computing.
Copyright © 2014, 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Eighth Edition by Tony Gaddis,
C++ Programming: From Problem Analysis to Program Design, Fifth Edition Chapter 1: An Overview of Computers and Programming Languages.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
CIT 140: Introduction to ITSlide #1 CSC 140: Introduction to IT Operating Systems.
Chapter 3 Getting Started. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. Objectives To give an overview of the structure of a contemporary.
Computer Architecture and Number Systems
Java Programming: From the Ground Up
BASIC PROGRAMMING C SCP1103 (02)
Chapter 1: An Overview of Computers and Programming Languages
BASIC PROGRAMMING C SCP1103 (02)
Introduction to Programming
Chapter 1: An Overview of Computers and Programming Languages
C++ Programming: From Problem Analysis to Program Design
Chapter 1: Introduction to Computers and Programming
CS190/295 Programming in Python for Life Sciences: Lecture 1
Chapter 1: Computer Systems
Computer Science I CSC 135.
Introduction CSC 111.
Machine Architecture and Number Systems
Machine Architecture and Number Systems
Chapter 1: Introduction to Computers and Programming
Presentation transcript:

Chapter 1 Introduction

Components of a Computer CPU (central processing unit) Executing instructions –Carrying out arithmetic and logical operations (+, -, *, /, and, or, …) –Coordinating: Accessing memory (read, write), handling exceptions (divided by zero), …

Components of a Computer (cont.) Memory Storing and retrieving (writing and reading) information (instructions and data). RAM (random-access memory) –volatile Secondary storage –Hard disk, CD, USB –Non-volatile

Information in Memory Binary, … A string of 0s and 1s can mean different things –A number (integer, floating-point) –An instruction (addition, load, store) In RISC, every piece of information (number or instruction) is 32 bits long.

Numbers in Memory Binary Converting decimal to binary –Integers 100 = 1*2^6 + 1*2^5 + 0*2^4 + 0*2^3 + 1*2^2 + 0*2^1 + 0*2^ =

Converting decimal to binary –Fractions 2^0 2^(-1) 2^(-2) 2^(-3) 2^(-4) 2^(-5) 2^(-6) … 2* … … 1*10^(-1) = 1*2(-4) + 1*2^(-5) + 0*2^(-6) + … 1*10^(-1) = …*2^(-4) = … 2

Converting binary to decimal Integers = 2^6 + 2^5 + 2^2 = = Fractions = 2^0 + 2^(-1) + 2^(-4) + 2^(-5) = 1 + 1/2 + 1/16 + 1/32 =

Components of a Computer (cont.) I/O (input/output) devices –Keyboard, mouse –Monitor Communication links –Bus –Network

Algorithms Method for solving a problem using a computer Unambiguous (well-defined and precise) Executable (can be carried out) Finite (does not run on forever) An algorithm is language independent.

Program Implementation of an algorithm in a language (Java), so a computer can understand. Stored in a file (source file) extension to identify the language (hw1.java).

From Program to Machine Code Compiler: Translates a program (high-level language) into machine language (low- level). –Machine architecture dependent (Intel, sparc). –End result: Executable file (binary). Often object files are linked together to produce an executable.

From Program to Machine Code Interpreter –Translate a program into an intermediate language, independent of machine architecture. –Run an intermediate language program by an interpreter that implements the intermediate language on that machine. JVM (Java virtual machine) executes an intermediate language program on the underlying machine.

Program Errors Computers (hardware) are very rigid, cannot tolerate slightest errors: Missing “;” Misplaced spaces Upper case in place of lower case …

Programming Disciplines Design, design, design. Think logically, structure your program carefully, know exactly what each step is supposed to do, anticipate future changes. Your program is to be read and modified by others.

Programming Disciplines Consistent style –Comments –Indentations –Line breaks –Blank lines –Positions of “{“ and “}” Programming is a craftsmanship, requires skills and art.