CSC 200 Spring 2006 Instructor: Matt Kayala. What is a “Computer”? We all use them for all kinds of tasks: –Games –Word Processing Good at repetitive.

Slides:



Advertisements
Similar presentations
Chapter 2: Data Manipulation
Advertisements

Machine cycle.
 Suppose for a moment that you were asked to perform a task and were given the following list of instructions to perform:
INTRODUCTION Chapter 1 1. Java CPSC 1100 University of Tennessee at Chattanooga 2  Difference between Visual Logic & Java  Lots  Visual Logic Flowcharts.
Lecture 1: Overview of Computers & Programming
EEE226 MICROPROCESSORBY DR. ZAINI ABDUL HALIM School of Electrical & Electronic Engineering USM.
Programming Languages Marjan Sirjani 2 2. Language Design Issues Design to Run efficiently : early languages Easy to write correctly : new languages.
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall 1.
The Binary Machine Modern high-level programming languages are designed to make programming easier. On the other end, the low level, all modern digital.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design First Edition by Tony Gaddis.
Low-Level Programming Languages
1 Lecture 1  Getting ready to program  Hardware Model  Software Model  Programming Languages  The C Language  Software Engineering  Programming.
Stored Program Concept: The Hardware View
Chapter 16 Programming and Languages: Telling the Computer What to Do.
Chapter 2: Impact of Machine Architectures What is the Relationship Between Programs, Programming Languages, and Computers.
Introduction to a Programming Environment
CMP 131 Introduction to Computer Programming Violetta Cavalli-Sforza Week 1, Lab.
Activity 1 - WBs 5 mins Go online and spend a moment trying to find out the difference between: HIGH LEVEL programming languages and LOW LEVEL programming.
1 Chapter-01 Introduction to Computers and C++ Programming.
Introduction to Programming Prof. Rommel Anthony Palomino Department of Computer Science and Information Technology Spring 2011.
CHAPTER 4: INTRODUCTION TO COMPUTER ORGANIZATION AND PROGRAMMING DESIGN Lec. Ghader Kurdi.
1 Lecture 2 : Computer System and Programming. Computer? a programmable machine that  Receives input  Stores and manipulates data  Provides output.
สาขาวิชาเทคโนโลยี สารสนเทศ คณะเทคโนโลยีสารสนเทศ และการสื่อสาร.
High level & Low level language High level programming languages are more structured, are closer to spoken language and are more intuitive than low level.
Levels of Architecture & Language CHAPTER 1 © copyright Bobby Hoggard / material may not be redistributed without permission.
IT253: Computer Organization Lecture 4: Instruction Set Architecture Tonga Institute of Higher Education.
Computer Systems Organization CS 1428 Foundations of Computer Science.
Board Activity Find your seat on the seating chart Login – Remember your login is your first initial your last name and the last three numbers of your.
CSC 3210 Computer Organization and Programming Chapter 1 THE COMPUTER D.M. Rasanjalee Himali.
Introduction to Computer Programming in c
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.
1 Lecture 2 : Computer System and Programming. Computer? a programmable machine that  Receives input  Stores and manipulates data  Provides output.
The Central Processing Unit (CPU) and the Machine Cycle.
Computer Operations A computer is a programmable electronic device that can store, retrieve, and process data Data and instructions to manipulate the data.
Important Concepts  Parts of the CPU  Arithmetic/Logic Unit  Control Unit  Registers  Program Counter  Instruction Register  Fetch/Decode/Execute.
What am I?. Translators Translators – Module Knowledge Areas Types of translators and their use Lexical analysis Syntax analysis Code generation and.
C o n f i d e n t i a l 1 Course: BCA Semester: III Subject Code : BC 0042 Subject Name: Operating Systems Unit number : 1 Unit Title: Overview of Operating.
1 Text Reference: Warford. 2 Computer Architecture: The design of those aspects of a computer which are visible to the programmer. Architecture Organization.
Chapter 7 Low-Level Programming Languages. 2 Chapter Goals List the operations that a computer can perform Discuss the relationship between levels of.
Chapter 7 Low-Level Programming Languages. 2 Chapter Goals List the operations that a computer can perform Discuss the relationship between levels of.
Chapter 7 Low-Level Programming Languages (slides modified by Erin Chambers)
1.4 Representation of data in computer systems Instructions.
CS-303 Introduction to Programming
 Computer Languages Computer Languages  Machine Language Machine Language  Assembly Language Assembly Language  High Level Language High Level Language.
Programming Languages
Chapter 11  Getting ready to program  Hardware Model  Software Model  Programming Languages  Facts about C++  Program Development Process  The Hello-world.
©Brooks/Cole, 2003 Chapter 1 Introduction. ©Brooks/Cole, 2003 Figure 1-1 Data processor model This model represents a specific-purpose computer not a.
Lecture #1: Introduction to Algorithms and Problem Solving Dr. Hmood Al-Dossari King Saud University Department of Computer Science 6 February 2012.
Computer Operation. Binary Codes CPU operates in binary codes Representation of values in binary codes Instructions to CPU in binary codes Addresses in.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
Chapter 1 Introduction 2nd Semester H
Software Development Environment
Basic Concepts: computer, program, programming …
CSC235 Computer Organization & Assembly Language
Chapter 1: An Overview of Computers and Programming Languages
Microprocessor and Assembly Language
Computer System and Programming
A451 Theory – 7 Programming 7A, B - Algorithms.
Chapter 1: An Overview of Computers and Programming Languages
TRANSLATORS AND IDEs Key Revision Points.
Hello World 2 What does all that mean?.
Intro to Architecture & Organization
Programming Languages
MARIE: An Introduction to a Simple Computer
Principles of Programming Languages
An Introduction to Programming with C++ Fifth Edition
Algoritmos y Programacion
Chapter 4 The Von Neumann Model
Presentation transcript:

CSC 200 Spring 2006 Instructor: Matt Kayala

What is a “Computer”? We all use them for all kinds of tasks: –Games –Word Processing Good at repetitive tasks. Tasks not built in need to be programmed.

Program/Programming Computers can perform a small set of instructions –Add, Subtract, Send to Screen Program – Sequence of detailed steps to perform a task. Programming – the act of designing and implementing a program

Von Neumann Architecture Programs and Data stored in memory ALU can do limited number of ops Control Unit “fetches” instructions from memory

Machine Code At Von Neumann (hardware) level, instructions very primitive –(a) Move data stored in mem loc 19D8 to register B. –(b) Subtract 100 from register B. –(c) If result is negative, jump to instruction at mem loc 102C. In fact, all instructions encoded as numbers. Example: Instruction (a) might be encoded as “ D8” Not very readable/user friendly.

Assembly Language To move away from number encodings, people began using mnemonics for instructions Example: Instruction (a) might be written as “mov 19D8”. Mnemonics easily translated to Machine Code. Better, but still not great. –Lots of instructions still, even for simple tasks. –Different hardware (processors) all have different assembly langs.

Higher Level Languages In the 1950’s higher level languages appeared. Example: The whole set of three instructions two slides back might be written (abstractly) –“if (theNum < 100) then…” The key to these langs was the development of “Compilers”, special progs which translate higher langs to machine code. Better, and the best you’re gonna get: –Hardware independent –Many “flavors”

Language Design and Evolution 100’s of different languages Specific vs. General Purpose –Java, C++, Pascal – General –TSQL, Prolog – Specific Grown vs. Planned –C++ - Grown –Pascal - Planned

Simple C++ Program

Notes on Simple Program Case Sensitive –“main” != “Main” Free-form –Whitespace (spaces, tabs, new lines) does not matter –Format chosen for clarity (line spacing, indentation) Also, source code needs to be “compiled”

Compilation Process For semester we will use Dev C++, an IDE. IDE – Integrated Development Environment Does all of the above steps. Also includes a “debugger”.

Errors Two types of errors in programs: –Syntax – keep source from compiling. –Logic – compiles, but errors in logic make program perform not as designed. Errors WILL happen! Program in a manner to minimize. –Structured, modular thought. –Follow the Edit – Compile – Debug – Test Process.

Testing and Debugging Debugger – Special program to track down syntax errors and run program traces. Debugging – the act of fixing these errors. Testing – job of the programmer to test for logic errors. Trace – Stepping through a program one line at a time to discover errors.

Algorithms Programming is really process of designing and implementing algorithms Algorithm – series of steps to complete a specific task where each step is: –Unambiguous –Executable –Terminating Example: Calculate interest accrual over n years. Counterexample: Paint a masterpiece.