The Programming Process Summer 2010 Margaret Reid-Miller

Similar documents
Chapter 1: Why Program? Computers and Programming. Why Program?

Computer Basics 1/24/13. Computer Organization. Computer systems consist of hardware and software.

Chapter 1 Computer and Programming. By Zerihun Alemayehu

Chapter. Focus of the Course. Object-Oriented Software Development. program design, implementation, and testing

Computer Basics 1/6/16. Computer Organization. Computer systems consist of hardware and software.

Chapter 1: Why Program? Main Hardware Component Categories 8/23/2014. Main Hardware Component Categories: Why Program?

Topics. Hardware and Software. Introduction. Main Memory. The CPU 9/21/2014. Introduction to Computers and Programming

Chapter 1: Introduction to Computers and Programming

An Overview of the Computer System. Kafui A. Prebbie 24

Computer Fundamentals

9/11/08 (c) 2008 Matthew J. Rutherford Class (c) 2008 Matthew J. Rutherford Class

Fundamentals of Programming (Python) Basic Concepts. Ali Taheri Sharif University of Technology Spring 2018

CMSC131. Hardware and Software. Hardware

CMSC131. Hardware and Software

C H A P T E R 1. Introduction to Computers and Programming

Computer is an electronic machine that can receive, store, transform and output data of all kinds (image, text, numeric, graphics and sound).

AN INTRODUCTION TO THE COMPUTER

Introduction. Arizona State University 1

CHAPTER 1 Introduction to Computers and Java

Chapter 1: Introduction to Computers and Java

8/23/2014. Chapter Topics. Introduction. Java History. Why Program? Java Applications and Applets. Chapter 1: Introduction to Computers and Java

COMP Computer Basics. Yi Hong May 13, 2015

8/16/12. Computer Organization. Architecture. Computer Organization. Computer Basics

Introduction to Computers. Joslyn A. Smith

Zimmer CSCI /24/18. CHAPTER 1 Overview. COMPUTER Programmable devices that can store, retrieve, and process data.

Components of a Computer System

Introduction to Computers and Java

CMSC 104 -Lecture 2 John Y. Park, adapted by C Grasso

Elements of Computers and Programming Dr. William C. Bulko. What is a Computer?

Introduction to Computers and Java

CC411: Introduction To Microprocessors

Week 0: Intro to Computers and Programming. 1.1 Why Program? 1.2 Computer Systems: Hardware and Software. Hardware Components

8. A is approximately one billion bytes a. Kilobyte b. Bit c. Gigabyte d. Megabyte 9. SMPT, FTP and DNS are applications of the layer a. Data link b.

! Learn how to think like a computer scientist. ! Learn problem solving. ! Read and write code. ! Understand object oriented programming

Introduction To Computer Hardware. Hafijur Rahman

Electricity: Voltage. Gate: A signal enters the gate at a certain voltage. The gate performs operations on it, and sends it out was a new signal.

Computer Programming-1 CSC 111. Chapter 1 : Introduction

What is the typical configuration of a computer sold today? 1-1

CSC 121 Computers and Scientific Thinking

INTRODUCTION TO COMPUTERS

Introduction to Computers and Java

Computer Principles and Components 1

1.1 Bits and Bit Patterns. Boolean Operations. Figure 2.1 CPU and main memory connected via a bus. CS11102 Introduction to Computer Science

Introduction. This book is about writing well-designed software. To understand CHAPTER OBJECTIVES

Chapter 1 Introduction to Computers and Programming

Ms. Minerva A. Lagarde

Chapter 1. Introduction to Computers and Programming. M hiwa ahmad aziz

Information Communications Technology (CE-ICT) 6 th Class

Introduction to Computers and Java. Objectives. Outline. Harald Gall, Prof. Dr. Institut für Informatik Universität Zürich.

Introduction to Computers and Java

Introduction to Computers and Java

CSCE150A. Administrivia. Overview. Hardware. Software. Example. Program. Pseudocode. Flowchart. Control Structures. Hello World Program CSCE150A

Computer Science & Engineering 150A Problem Solving Using Computers

Computer Basics PC-100

System Unit Components Chapter2

Introduction to Computers and Java. Objectives. Outline. Harald Gall, Prof. Dr. Institut für Informatik Universität Zürich.

Week One: Introduction A SHORT INTRODUCTION TO HARDWARE, SOFTWARE, AND ALGORITHM DEVELOPMENT

An Introduction to Computers and Java CSC 121 Spring 2015 Howard Rosenthal

Java and Software Design

An Introduc+on to Computers and Java CSC 121 Spring 2017 Howard Rosenthal

Chapter 1: An Overview of Computers and Programming Languages. Objectives. Objectives (cont d.) Introduction

LECTURE SCHEDULE 2. Units of Memory, Hardware, Software and Classification of Computers

15/09/15. Introduction to Computers & The Internet. Contents. Computer hardware and software. Input and output devices CPU. Memory.

Chapter Two. Hardware Basics: Inside the Box

About the Presentations

Intermediate Programming & Design (C++) Notation

CMSC 1513 Lecture 1.2

BITG 1113: Introduction To Computers And Programming Language LECTURE 1 LECTURE 1 1

CSI31 Introduction to Computer Programming I. Dr. Sharon Persinger Fall

Ch. 1: Computer System part I

Dec Hex Bin ORG ; ZERO. Introduction To Computing

Programming: detailed instructions which tell the computer hardware what to do aka software Computer Science: the study NOT of computers, but of what

Computers Are Your Future

Hardware and Software - Revision Summary

Chapter 1 Introduction to Computers, Programs, and Java

Computer Memory. Data Structures and Algorithms CSE 373 SP 18 - KASEY CHAMPION 1

Programming 1. Lecture 1 COP 3014 Fall August 28, 2017

Q1. Briefly describe the characteristic features of input and output devices of a computer system.

Computer Organization

Chapter One. Introduction to Computer System

CHAPTER 1: INTRODUCTION TO COMPUTERS AND PROGRAMMING. 1 Muhalim Mohamed Amin Faculty of

Chapter 2. Prepared By: Humeyra Saracoglu

Computer Systems. IGCSE OCR AQA Edexcel Understand the term. embedded system and how an Purpose of embedded system

From High Level to Machine Code. Compilation Overview. Computer Programs

Introduction to Computers and Java

Parts are adapted from Windows 98 by Mark Twain Media, Inc. A Computer System has Hardware and Software

What's in a computer?

COMPUTER SYSTEM. COMPUTER SYSTEM IB DP Computer science Standard Level ICS3U. COMPUTER SYSTEM IB DP Computer science Standard Level ICS3U

Intentionally Blank 0

Data Representation. Types of data: Numbers Text Audio Images & Graphics Video

Computer Organization

Introduction to File Structures

National 5 Computing Science Software Design & Development

Lecture 01: Basic Structure of Computers

Masters of Computer Application (MCA) Entrance 2012 Computer Knowledge Paper I 1. All of the following are examples of real security and privacy

Downloaded from various sources on the NET

Computer Software: Introduction

Sahalsoftware college. Welcome To understanding Basic Computer Concept

Programming 1 - Honors

Agenda Computer Hardware Input Devices Output Devices Secondary Storage Computer Software System Software Application Software Working with Windows

Transcription:

The Programming Process 15-110 Margaret Reid-Miller

Hardware Components Central Processing Unit (CPU) Program control Arithmetic/logical operations Coordinates data movement between memory and registers (small amount of storage) Memory Main (RAM): fast, expensive, volatile Secondary (Hard disk, CD, DVD): slow, nonvolatile Input/Output (I/O) Devices Keyboard, mouse, camera, microphone, Monitor, speakers, printers, 15-110 (Reid-Miller) 2

Software Algorithm - A sequence of steps (strategy) to solve a problem (not necessarily computational). Program - A sequence of instructions and decisions executed by a computer to achieve a task E.g., web browser, mailer, editor, operating system, compiler, scheduler Programming helps to explain the approach computer scientists use to solve complex problems. 15-110 (Reid-Miller) 3

Digital and Analog Analog information is continuous e.g., mercury in a thermometer, sound waves, light waves Digital information is discrete and can be represented by numbers. e.g., music on a CD is made by sampling the sound briefly at a high rate. Computers stores information in binary numbers, which has only two digits (0, 1) 15-110 (Reid-Miller) 4

Why Binary? Simple; easy to build, reliable two stable states: (on, off), (high, low), (magnetized, demagnetized), Unambiguous signals threshold between high and low voltage unaffected by slight noise as it degrades the two extremes can be reinforced Flawless copying Can represent anything 15-110 (Reid-Miller) 5

Binary Numbers decimal binary decimal binary 0 1 2 3 4 5 6 7 0 1 10 11 100 101 110 111 8 9 10 11 12 13 14 15 1000 1001 1010 1011 1100 1101 1110 1111 15-110 (Reid-Miller) 6

Bits n Bytes n Memory A bit is a one binary digit. A byte is 8 bits. Main memory is a long list of bytes. A byte is just large enough to hold a single keyboard character Each byte in memory is conceptually numbered The number is called its address. Terms for the size of memory are Kilobyte (KB) is 2 10 =1024 bytes Megabyte (MB) is 2 20 (approx. million) bytes Gigabyte (GB) is 2 30 (approx. billion) bytes 15-110 (Reid-Miller) 7

Machine Instructions Each type of computer processor has a set of machine operations it can perform. Each operation does one very simple thing. e.g., get a value from memory and put it in a register, add the values in two registers, test if the value in a register is zero, jump to some instruction A machine instruction consists of several bytes of memory that tell what machine operation to perform and, if needed, what data to use. 15-110 (Reid-Miller) 8

Program Execution To execute (run) a program the operating system does the following: loads the program instructions from the hard drive into memory; finds some memory for the program to use; tells the CPU at what address the first instruction is; Then the CPU fetches one instruction at a time from memory into the CPU and carries out the operation. 15-110 (Reid-Miller) 9

Programming Language Types Machine - Uses only operations that the specific hardware can execute directly (e.g., 1101 0000 0000 0111) Assembly - Uses mnemonics to represent operations or data values (e.g., add %o0 %o1 %o0) High-level - Supports structured programming and use English-like phrases (e.g., C++, C, Java, Python, Lisp) (e.g., x = 1 + 2;) Fourth-generation - Describes what needs to be done, not how to do it. (e.g., SQL, SAS, Mathematica) (e.g., SELECT * FROM books WHERE price < 10.0) 15-110 (Reid-Miller) 10

Program Translation Compiler - program that translates code (a program) in the source language, all at once, into another language call the object or target language. E.g., translates Java to machine instructions. The code is translated only once and executed many times. Interpreter - program that translates and then executes only one (or several) statement(s) at a time. This translation needs to be done each time a statement is executed. 15-110 (Reid-Miller) 11

Traditional Compilation Different hardware/operating systems need slight variants of the program and separate compilers. Source Source code Source code code code compile Machine code Machine code Machine code Machine code Windows Intel Unix HP Unix Sun Mac OS X imac 15-110 (Reid-Miller) 12

Java Translation Java compiles to a single virtual machine. Source code Java bytecode Compile JVM JVM JVM JVM Windows Intel Unix HP Interpret Unix Sun (or compile) Mac OS X imac JVM - Java Virtual Machine 15-110 (Reid-Miller) 13

Programming Languages Syntax Rules of the programming language to form valid statements (punctuation, statement structure, order of operations,...). Semantics The meaning of the statements. That is, what will happen when the computer executes statements. 15-110 (Reid-Miller) 14

Types of Programming Errors Compile-time error- Syntax errors found by the compiler or syntax-aware editors. e.g., x - * y = Run-time error - Error causes program to stop abnormally; often called an exception. e.g., x = y / z (What if z is zero?) Logical error - Program produces incorrect results without complaint. e.g., Sort program does not always sort the data 15-110 (Reid-Miller) 15

Goals of the Course Understand basic programming concepts. Translate an algorithm specification into correct program code. Write programs to solve simple problems. Writing correct programs requires debugging your programs: Find and correct errors that causes your program not to do what you intend. 15-110 (Reid-Miller) 16

What is a computer system? Hardware is the electronic and mechanical parts. It is the tangible, physical device. But a computer must be programmed to be useful (other than as a doorstop or sculpture). Software is the sets of instructions and data necessary to solve problems. It is intangible, conceptual. 15-110 (Reid-Miller) 17