Beginning Snapshots - PowerPoint PPT Presentation

About This Presentation
Title:

Beginning Snapshots

Description:

Intel Pentium, AMD K6, Motorola PowerPC, Sun SPARC, C An Introduction to Computing, 3rd ed. ... Examples: MacOS, Windows-95, Windows-NT, UNIX, Linux, Solaris, ... – PowerPoint PPT presentation

Number of Views:31
Avg rating:3.0/5.0
Slides: 25
Provided by: steve1846
Category:

less

Transcript and Presenter's Notes

Title: Beginning Snapshots


1
Beginning Snapshots
  • Chapter 0

2
Objectives
  • Give an overview of computer science
  • Show its breadth
  • Provide context for computer science concepts
  • Events from the past
  • Describe basic components, organization of a
    computer

3
Areas of Computer Science
  • Algorithms and Data Structures
  • Architecture
  • Artificial Intelligence and Robotics
  • Database and Information Retrieval
  • Human-Computer Communication
  • Numerical and Symbolic Computation
  • Operating Systems
  • Programming Languages
  • Software Methodology and Engineering
  • Social and Professional Context

4
Important Concepts in Computer History
  • The mechanism of arithmetic
  • The stored program
  • The graphical user interface
  • The computer network

5
Computing Systems
  • Computers have two kinds of components
  • Hardware physical devices such as
  • CPU
  • memory
  • storage devices
  • Software programs such as
  • Operating system
  • applications
  • utilities

6
Hardware CPU
  • Central Processing Unit (CPU)
  • the brain of the machine
  • Circuitry that performs arithmetic and logical ML
    statements
  • CPU measurement
  • Speed (roughly) in megahertz (millions of
    clock-ticks per second)
  • Examples
  • Intel Pentium, AMD K6, Motorola PowerPC, Sun
    SPARC,

7
Storage
  • Random Access Memory (RAM)
  • Main memory, which is fast, but volatile...
  • Analogous to a persons short-term memory.
  • Many tiny on-off switches
  • on is represented by 1, off by 0.
  • Each switch is called a binary digit, or bit.
  • 8 bits is called a byte.
  • 210 bytes 1024 bytes is called a kilobyte (1K)
  • 220 bytes is called a megabyte (1M).

8
Storage
  • Secondary Memory (Disk)
  • Stable storage using magnetic or optical media.
  • Analogous to a persons long-term memory.
  • Slower to access than RAM.
  • Examples
  • floppy disk (measured in kilobytes)
  • hard disk (measured in gigabytes (230 bytes))
  • CD-ROM (measured in megabytes), ...

9
Input and Output
  • Input devices
  • Instructions and data must be encoded in binary
    form and transmitted to the CPU
  • Examples
  • keyboard
  • mouse, trackball, joystick
  • scanner
  • audio, video capture boards

10
Input and Output
  • Output devices
  • Convert data from binary to another form
  • Examples
  • monitors, printers
  • sound, video
  • robotics control
  • Communication between CPU and peripheral devices
    is through ports
  • Ports communicate via the system bus

11
Software OS
  • OS acts as the manager of the system,
  • Making sure that each hardware device interacts
    smoothly with the others.
  • Provides an interface
  • Enables user to interact with the computer,
  • Awaits user input if no application is running.
  • Examples MacOS, Windows-95, Windows-NT, UNIX,
    Linux, Solaris, ...

12
Software Applications
  • Applications are non-OS programs
  • Perform some useful task
  • Including word processors, spreadsheets,
    databases, web browsers, C compilers
  • Example C compilers/environments
  • CodeWarrior (MacOS, Win95, WinNT, Solaris)
  • GNU C (UNIX, Linux)
  • Turbo/Borland C (Win95, WinNT)
  • Visual C (Win95, WinNT)

13
Software User Programs
  • Programs that are neither OS programs nor
    applications are called user programs.
  • User programs are what youll be writing in this
    course.

14
What is Programming?
  • Computer Program
  • A sequence of statements that instruct a computer
    in how to solve a problem.
  • Programming
  • The act of designing, writing and maintaining a
    program
  • Programmers
  • People who write programs

15
What kinds of statementsdo computers understand?
  • A computer only understands machine
    language statements.
  • Characteristics of machine language
  • A sequence of ones and zeros
  • Cause the computer to perform a particular
    action, such as add, subtract, multiply, ...

16
Machine Language (ML)
  • ML statements
  • Stored in a computers memory
  • Computer memory is a sequence of switches.
  • an on switch is represented by 1,
  • an off switch is represented by 0.
  • ML thus appears to be binary (base-2)
  • 0010111010110101

17
Early Computers
  • ... required a programmer to write in ML...
  • Problem
  • Easy to make mistakes!
  • Such mistakes are hard to find!
  • Not portable -- only runs on one kind of machine!
  • Programming was very difficult!

18
A Bright Idea
  • Devise a set of abbreviations (mnemonics)
    corresponding to the ML statements
  • Create a program (the assembler) to translate
    them into ML.

100111001110010110100110110111
ADD 34, R1MOVE R1,1200CMPR R1, R2
Assembler
19
Advantages and Disadvantages
  • Still not portable to different machines
  • Each machine had its own set of mnemonics
  • Each had its own assembler
  • More natural than binary.
  • Much easier to read programs
  • Much easier to find and fix mistakes

20
High Level Languages
  • Improvement on assembly language
  • Devise a set of statements that are close to
    human language (if, while, do, ...)
  • Create a program to translate them into ML.
  • The set of statements is called a high level
    language (HLL)
  • The translation program is called a compiler.

21
Contrast Assembler and HLL Compiler
  • Assembler translates one mnemonic into one ML
    statement
  • Compiler translates one HL statement into several
    ML statements

1010110011110101 0000000000010000 001011101011010
1 0000000000010010 0010111011111101 00000000000101
00
Compiler
z x y
22
Advantage of HLLs
  • Programs are easier to read
  • Errors are easier to find
  • Programs are portable from one computer to
    another
  • Assumes the language is standard
  • Just create a new compiler which does the
    translation into the correct ML

23
Objectives in Programming A program should solve
a problem
  • Correctly
  • Efficiently
  • Readably
  • In user-friendly fashion
  • It actually solves the problem
  • Without wasting time or space
  • Understandable by another person
  • In a way that is easy for its user to use

24
Summary of "Levels" of Computer Languages
  • Low levelML in binary language
  • Medium Level Assembly language
  • High Levelas in C
  • Hard to read, not portable
  • Mnemonics, easier to read, still not portable
  • Reads like English and algebra, portable
Write a Comment
User Comments (0)
About PowerShow.com