Computers and Programming - PowerPoint PPT Presentation

About This Presentation
Title:

Computers and Programming

Description:

... and computes in binary code called machine code. ... Problem : HLL -- machine code. Solution: A translation mechanism : Compiler or an interpreter ... – PowerPoint PPT presentation

Number of Views:52
Avg rating:3.0/5.0
Slides: 13
Provided by: binarama
Learn more at: https://cse.buffalo.edu
Category:

less

Transcript and Presenter's Notes

Title: Computers and Programming


1
Computers and Programming
  • Bina Ramamurthy

127 Bell Hall bina_at_cs.buffalo.edu
2
Introduction
  • A computer executes the solution designed for a
    problem. A program expresses the solution in a
    form that a computer can understand.
  • In this discussion we will look at the basic
    components of a computer, the programming
    environment, the system support, and program
    development phases.

3
Topics for discussion
  • Basic components of a computer
  • Operating systems
  • High level language
  • Processing a program
  • Software development stages
  • Example

4
Basic Components of a digital computer
CONTROL
INPUT
OUTPUT
PROCESSOR
MEMORY
DATA
CONTROL
5
..Components ...
  • Processor Arithmetic Logic Unit (ALU)
  • ALU Control CPU Central Processing Unit
  • Ex PowerPc 604, Intel Pentium, Motorola 68xxx
  • Ex Input Mouse Output laser printer
  • Memory main memory (RAM)
  • Secondary memory Floppy disk, hard disk.

6
Operating systems
  • Provides user interface
  • Resource management
  • Security and protection
  • Provides utility programs and libraries Editor,
    math library
  • Example unix , MS-DOs, windows-95

7
High level language
  • The hardware underlying a computer communicates
    and computes in binary code called machine code.
  • 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
  • Problem HLL --gtmachine code
  • Solution A translation mechanism Compiler or
    an interpreter

8
(No Transcript)
9
Steps in software development
  • Problem analysis
  • Clear understanding of the problem
  • identify problems input, output, requirements
    and constraints.
  • 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
Steps in software development (contd.)
  • Documentation
  • Provide information for use and maintenance of
    the software. Provide an example that gives input
    and output.
  • Implementation
  • Code the algorithms into a programs using a HLL.
  • Debugging
  • Compile and execute the software. Remove any
    errors.
  • Testing
  • Execute with various test data and make sure the
    software works as expected.

11
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
Example (computer problem)
  • Problem 2 Count the number of times the letter
    a occurs in a piece of text.
  • Solution
  • 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
Write a Comment
User Comments (0)
About PowerShow.com