Presentation is loading. Please wait.

Presentation is loading. Please wait.

B.Ramamurthy11/9/20151 Computers and Programming Bina Ramamurthy 127 Bell Hall

Similar presentations


Presentation on theme: "B.Ramamurthy11/9/20151 Computers and Programming Bina Ramamurthy 127 Bell Hall"— Presentation transcript:

1 B.Ramamurthy11/9/20151 Computers and Programming Bina Ramamurthy 127 Bell Hall bina@cs.buffalo.edu

2 B.Ramamurthy11/9/20152 Introduction u A computer executes the solution designed for a problem. A program expresses the solution in a form that a computer can understand. u In this discussion we will look at the basic components of a computer, the programming environment, the system support, and program development phases.

3 B.Ramamurthy11/9/20153 Topics for discussion u Basic components of a computer u Operating systems u High level language u Processing a program u Software development stages u Example

4 B.Ramamurthy11/9/20154 Basic Components of a digital computer INPUT PROCESSOR OUTPUT CONTROL MEMORY DATA CONTROL

5 B.Ramamurthy11/9/20155..Components... u Processor = Arithmetic Logic Unit (ALU) u ALU + Control = CPU = Central Processing Unit u Ex: PowerPc 604, Intel Pentium, Motorola 68xxx u Ex: Input : Mouse Output : laser printer u Memory : main memory (RAM) u Secondary memory : Floppy disk, hard disk.

6 B.Ramamurthy11/9/20156 Operating systems u Provides user interface u Resource management u Security and protection u Provides utility programs and libraries : Editor, math library u Example : unix, MS-DOs, windows-95

7 B.Ramamurthy11/9/20157 High level language u The hardware underlying a computer communicates and computes in binary code called machine code. u But in order for the humans to effectively communicate the solutions to a computer we need a language that is closer to human language : High Level language (HLL). ex: C++ u Problem : HLL -->machine code u Solution: A translation mechanism : Compiler or an interpreter

8 B.Ramamurthy11/9/20158

9 B.Ramamurthy11/9/20159 Steps in software development u Problem analysis –Clear understanding of the problem –identify problem’s input, output, requirements and constraints. u Solution design –Class design : Identify the classes of objects required by the problem and draw relationship among these. –Algorithm design: Stepwise solution to carry out the functionality of the classes.

10 B.Ramamurthy11/9/201510 Steps in software development (contd.) u Documentation –Provide information for use and maintenance of the software. Provide an example that gives input and output. u Implementation –Code the algorithms into a programs using a HLL. u Debugging –Compile and execute the software. Remove any errors. u Testing –Execute with various test data and make sure the software works as expected.

11 B.Ramamurthy11/9/201511 Example (non-computer problem) Problem 1: You are on your way to visit a friend in Chicago. You are driving in downtown Chicago and are lost. Solve this problem.

12 B.Ramamurthy11/9/201512 Example (computer problem) u Problem 2: Count the number of times the letter ‘a’ occurs in a piece of text. u Solution: u 1. Initialize Acounter = 0; // Assignment - memory 2. Input a character from input. //input 3. If it is an “a” then // selection Increment Acounter; // arithmetic - memory 4. Repeat steps 2 - 3 until end of input. //repetition 5. Output Acounter. // output 6. Exit


Download ppt "B.Ramamurthy11/9/20151 Computers and Programming Bina Ramamurthy 127 Bell Hall"

Similar presentations


Ads by Google