Lecture 1 Hardware, Software and Control Structures - PowerPoint PPT Presentation

1 / 38
About This Presentation
Title:

Lecture 1 Hardware, Software and Control Structures

Description:

... instructions) that tell the hardware how to perform a task ... Use top-down design approach. Require a compiler to translate the program ... design ... – PowerPoint PPT presentation

Number of Views:41
Avg rating:3.0/5.0
Slides: 39
Provided by: jimand
Category:

less

Transcript and Presenter's Notes

Title: Lecture 1 Hardware, Software and Control Structures


1
Lecture 1Hardware, Softwareand Control
Structures
  • ENGR17 Engineering Programming
  • Section 1
  • Fall 2001

8/30/01
2
Outline
  • History of PC
  • Components of PC
  • History of Programming Languages
  • Object-oriented languages
  • Control Structures

3
Microcomputer Systems
  • First appeared in marketplace in the mid 70s
    (Altair)
  • Also called personal computers
  • Composed of hardware and software
  • Hardware
  • Physical components of the system
  • Software
  • Programs (step-by-step instructions) that tell
    the hardware how to perform a task
  • Apple had first broadly successful personal
    computer
  • Based on proprietary hardware and software
  • IBM followed with the AT in early 80s
  • Operation System Microsoft DOS
  • Microprocessor Intel 8088

4
Microcomputer Systems
5
Hardware and Software
  • Hardware
  • System unit
  • Internal memory (RAM and ROM)
  • Central processing unit (CPU)
  • Input devices
  • Output devices
  • Peripheral devices
  • Software
  • Operating system software
  • Application software

6
System Unit
7
System Unit Internal Memory
8
RAM and ROM
  • Random-Access Memory (RAM) chips
  • User can read and write to memory
  • Volatile
  • Read-Only Memory (ROM) chips
  • User can only read from memory
  • Nonvolatile

9
Main Memory (RAM)
SIMM (Single In-line Memory Modules) most PCs
DIMM (Dual In-line Memory Modules) higher end
Laptop Memory usually proprietary
10
CPU/Microprocessor
  • Brain of the computer
  • CPU resides on a microprocessor chip
  • CPU contains two components
  • Control unit
  • Makes sure the computer correctly processes
    program instructions and data stored in internal
    memory
  • Arithmetic/Logic Unit (ALU)
  • Performs arithmetic calculations and logic
    operations
  • Microprocessors
  • Intel 32-bit 2GHz Pentium 4 (desktop) Xeon
    (servers)
  • Intel 64-bit Itanium Family (servers)
  • Sun Microsystems SPARC
  • Hewlett Packard PA-RISC
  • IBM PowerPC
  • DEC Alpha

11
Intel Pentium 4
12
Operating System Software
  • Manages computer and its peripheral devices
  • Allows communication between user and computer
  • Examples
  • Windows 98, NT, ME, 2000, CE, XP (hits shelves in
    October)
  • UNIX
  • Linux
  • DOS (obsolete)
  • OS/2 (obsolete)
  • For personal computers
  • Windows 98, 2000, or XP
  • For workstations, servers, and other big-iron
  • Windows NT or 2000
  • UNIX (HPUX, Berkeley, etc.)
  • Linux (Red Hat, etc.)

13
Application Software
  • Word processors
  • Spreadsheets
  • Databases
  • Graphics programs
  • Programming languages

14
History of Programming Languages
  • Machine languages
  • Assembly languages
  • High-level procedure-oriented languages
  • Object-oriented languages

15
Machine Languages
  • Are based on the binary number system
  • Use combination of 0s and 1s to communicate
    directly with the computer
  • Are tedious and error-prone require highly
    trained programmers
  • Machine Language Example

16
Machine Languages
17
Assembly Languages
  • Allow programmers to use mnemonics in place of 0s
    and 1s in the program
  • Require an assembler (a program to convert
    assembly instructions into machine code)
  • Are easier to write than machine language, but
    still tedious and require highly trained
    programmers
  • Assembly Language Example

18
Assembly Languages
19
High-Level Procedure Languages
  • Allow programmers to use instructions that more
    closely resemble English
  • View a problem solution as a set of ordered steps
    (correct sequence is critical)
  • Use top-down design approach
  • Require a compiler to translate the program into
    machine language
  • Do not require a great amount of technical
    expertise to write simple programs
  • Examples COBOL, BASIC, Pascal, C
  • Procedure language example

20
High-Level Procedure Languages
21
Object-Oriented Languages
  • View a problem solution as a set of interacting
    objects
  • Use object-oriented design methodology
  • Require a compiler to translate high-level
    instructions into machine code
  • Examples
  • C
  • Visual Basic
  • Object-Oriented Language Example

22
Object-Oriented Languages
23
Advantages of OO Languages
  • Allow programmer to use familiar objects to solve
    problems
  • Because each object is viewed as an independent
    unit, an object can be used in more than one
    application, with little or no modification

24
OOP Terminology
  • OOP
  • OOD
  • Object
  • Attributes (data) and behaviors
  • Class
  • Instance
  • Encapsulation
  • Abstraction
  • Hidden/exposed
  • Inheritance (derived class and base class)

25
Illustration of OOP Terms
26
Control Structures
  • Control the flow of a programs logic
  • Also called logic structures
  • Three basic structures
  • Sequence
  • Selection
  • Repetition

27
Sequence Structure
  • Directs the computer to process the instructions,
    one after another, in the order listed in the
    program
  • Are found in every program
  • Algorithm
  • Step-by-step instructions to solve a problem
  • Sequence Example

28
Sequence Structure
29
Repetition Structure
  • Directs the computer to repeat one or more
    instructions until some condition is met
  • Repetition Example

30
Repetition Structure
31
Repetition Structure
32
Selection Structure
  • Directs the computer to make a decision, and then
    select an appropriate action based on that
    decision
  • Also called the decision structure
  • Selection Example

33
Selection Structure
34
Selection Structure
35
Summary
  • Components of a microcomputer system
  • Relationship between hardware and software
  • History of programming languages
  • Object-oriented languages
  • Control structures
  • Sequence structure
  • Repetition structure
  • Selection (decision) structure

36
Questions
  • Microcomputer System is composed of what two
    components?
  • Hardware and Software
  • System Unit is composed of what two components?
  • Memory and CPU
  • Two types of Memory?
  • Random Access Memory Read Only Memory
  • CPU is composed of what two components?
  • Control Unit Arithmetic/Logic Unit
  • Which microprocessor did your instructor help
    design?
  • Itanium
  • Three examples of an operating system?
  • Windows, UNIX, Linux

37
Questions
  • 4 types of programming languages?
  • Machine, Assembly, High-Level Procedural,
    Object-Oriented
  • Advantages of High Level languages?
  • Closer to English
  • Ordered steps
  • Top-down design
  • Advantages of object-oriented?
  • Code reuse
  • Easier to solve some problems
  • Three control structures?
  • Sequence, Repetition, Selection
  • Whats your favorite control structure and why?
  • Selection

38
Questions
  • Write an algorithm using all three control
    structures to instruct someone to
  • Walk to the light switch
  • Turn the all the switches on if any are off
    otherwise turn the 1st switch off
  • Return to their chair
Write a Comment
User Comments (0)
About PowerShow.com