topic 1: overview of computers and programming - e

Download Report

Transcript topic 1: overview of computers and programming - e

CHAPTER 1:
OVERVIEW OF COMPUTERS AND PROGRAMMING
By the end of this chapter, students should be
able to:
 Describes
the
concept
of
including
hardware,
system
application software.
 Apply
method.
and
practice
the
computer
software
software
basic
and
development
 Explain the programming language ranges
machine language to high level language.
from
 Describe the processes of entering, translating
and running a high -level language program.
Reference... Hanly, Koffman, C Problem Solving and Program Design in C, Fifth
Edition, Pearson International Edition. Refer chapter 1 (Pg 1 – 28)
Prepared By: Pn. Nik Maria Nik Mahamood (Coordinator DDC 1012)
This chapter introduces to:
Introduction
 Computer Hardware
 Computer Software
 The Software Development Method
 Applying
the
Software
Development
Method

INTRODUCTION
The Computer Defined
 Computer is an electronic device – a
flexible machine that can manipulates
data.
 A computer is programmable; that is what
the computer does depends on the program
the computer is using.
 A
Computer is a machine that can
receive, store, transform and output
data of all kinds.
FOR MORE INFO...
A program is a list of instruction telling computer what
to do.

FOR MORE INFO...
Figure 1.1
The Intel Pentium 4 Processor
chip is an integrated circuit
containing the full circuitry of
a central processing unit. This
processor can execute a simple
instruction such as an integer
addition in one six-billionth of
a second.
Source: This figure is taken from Pearson Addison-Wesley, 2007.
Figure 1.2
(a) Notebook Computer(ThinkPad®,
Courtesy of IBM).
(b) Palmtop Computer (Sony Clié
PDA ®,
Courtesy of Sony).
(c) Desktop Computer (IBM
NetVista Desktop, Courtesy of
IBM).
Source: This figure is taken from Pearson Addison-Wesley, 2007.



A computer’s hardware – the machine and
its components – is designed to be
flexible as possible.
By using computer programs, called
software, you transform this flexible
hardware into a tool for a specific
purpose.
Computer
system
has
three
basic
components, which are:
– Hardware, software and people.
COMPUTER HARDWARE
Figure 1.3
Components of a Computer
Source: This figure is taken from Pearson Addison-Wesley, 2007.
FOR MORE INFO...
Components of a computer : main memory, secondary storage, Central
Processing Unit (CPU), Input devices and Output devices.
Memory



Is main memory - an essential component
in any computer.
Stores programs, data and result.
Most computers have two types of memory:
– Random access memory (RAM)
– Read only memory (ROM)

RAM
– offers temporary storage of programs and data.
– representing a collection of numbered cells
for storage of instructions and data of all
kinds; cells can be accessed in any order.
– is volatile; everything in RAM will be lost
when the computer is switched off.
Memory (cont’..)

ROM
– offers stores information permanently within the
computer.
– Computer can retrieve (or read) but cannot store
(or write) information in ROM.
– is not volatile; the data stored do not disappear
when the computer is switched off.
– Start-up
instructions
and
other
critical
instructions are burned into ROM chips.


When we refer to main memory, we mean RAM
because that is the part of main memory is
normally accessible to the programmer.
All data stored in memory are represented
digitally.
FOR MORE INFO...
Digital representation ~ binary numbers made up of digits 0
and 1.
Secondary Storage
 Unit such as disks or tapes that retain
data even when the power to the disk
drive or tape drive is off.
 Computer
systems provide storage in
addition to main memory because of two
reasons:
– Computer needs storage that is permanent;
information can be retained during a power
loss or the computer is turned off.
– Computer
systems
typically
store
more
information than will fit in memory.
Figure 1.4
Secondary Storage Media
Source: This figure is taken from Pearson Addison-Wesley, 2007
Central Processing Unit
 Data
processing
done
by
Central
Processing Unit (CPU).
 CPU
– the brain of a computer. It
transforms
data
from
one
form
to
another.
 The CPU is composed of two parts:
– Control Unit
• Coordinates and controls all the other
parts of computer system.
• The
control
unit
even
oversees
the
operations of the input and output devices.
– Arithmetic Unit
• Does the actual processing by performing
mathematical
operations
and
logic
comparisons.
FOR MORE INFO...
Microprocessor ~ an entire CPU on a single chip
Register ~ high speed memory location inside the CPU
Input Devices
 You
can
enter
data
into
the
computer in many ways.
 The
most
commonly
used
input
devices are
– Keyboards:
– Pointing
devices
such
as
mouse,
trackball, Joysticks, Touch-sensitive
screen, pen-based systems.
– Scanners
such
as
Magnetic
Ink
character Recognition (MICR)
– Voice Recognition such as Voice User
Interface(VUI).
FOR MORE INFO...
Figure 1.5
Example of keyboard for IBM-Type Computers
Source: This figure is taken from Pearson Addison-Wesley, 2007
Output Devices

Most output can be divided into two categories
– Softcopy
• Is ideal when you are writing a document,
playing
game,
watching
video
clip
or
reading the latest news.
• Is temporary. There nothing solid to hold.
• Can
transfer
softcopy
to
a
disk
to
transport it.
– Hardcopy
• Can be touched and carried
• Some form of paper.

The
are
–
–
–
–
–
–
–
most
commonly
Monitors
Printers
Audio output
Plotters
Microfilm
CDROM
Diskette
used
output
devices
Computer Networks





Computers can communicate with one another via
networks.
LAN
connects
computers
and
other
devices;
allowing them to share information and resources
such as printers, scanners, and secondary storage
devices.
WAN is a network that links many individual
computer and local area networks over a large
geography area.
The most well know WAN, the internet, connects
university, corporate, government and publicaccess networks.
The most widely used aspect of internet
is the www.
FOR MORE INFO...
LAN ~ Local Area Network; WAN ~ Wide Area Network
WWW ~ World Wide Web
FOR MORE INFO...
Figure 1.6
Local Area Network
Source: This figure is taken from Pearson Addison-Wesley, 2007
Figure 1.7
A Wide Area Network with Satellite Relays of Microwave
Signals
Source: This figure is taken from Pearson Addison-Wesley, 2007
COMPUTER SOFTWARES





Software is a computer programs. It refers to any
program that tells the computer systems what to
do
Software is composed to two types:
– System software
– Application Software
Computer need software to function.
System
software
integrates
the
computer’s
hardware components and provides tools for dayto-day maintenance tasks such as displaying a
list of the files contained on a disk
Examples of system software:
– Operating system : To manage computer system.
Examples: MS-DOS, Unix, Microsoft Windows
Operating System


The collection of computer program that control
the interaction of the user and the computer
hardware is called operating system (OS).
Below is a list of OS responsibilities:
–
–
–
–
–
–
Booting computer
Communicating with the computer user
Collecting input from the input devices
Conveying program output to the output devices
Accessing data from secondary storage
Writing data to secondary storage.
Application Software


Turns the computer into a tool for a specific
tasks, such as writing.
Not all application programs will prove useful to
you.




Application programs are develop to assist a
computer users in accomplishing specific tasks.
Some application programs are special-purpose
programs, which perform a specific task for a
single profession.
– For examples safety managers use a program
that prints records of occupation-related
injuries and illness in a format required by
federal regulatory bureau.
Other application programs are general-purpose
programs.
Commonly used general-purpose programs include
the
following
Word
processing,
Desktop
processing, Electronic spreadsheet, Database,
Presentation, Graphic software,Telecommunications
software
COMPUTER LANGUAGES

Consists of two types:
– Low level language
• is to program a computer system for
targeting the maximum effective from the
use of a specific machine.
• Examples
machine
language,
assembly
language
• Advantage – the implementation is more
faster; can be extremely efficient, making
optimum use of both computer memory and
processing time
• Disadvantages – difficult to use, machine
dependent, need to know the architecture of
machine
– High level language
• to program applications for scientist, data
processing, words processing etc.
• Examples: C, C++, Java, Fortran, Cobol etc
• Thus before a high-level language program
can
be
executed,
it
must
first
be
translated
into
the
target
computer’s
machine language.
• The program that does this translation is
called compiler.
• Advantage: faster development of large
programs, machine independent, easy to
understand – uses simple English words, no
need to know machine architecture.
• Disadvantage: the implementation is slower.
FOR MORE INFO...
FOR MORE INFO...
Figure 1.8
Entering,
Translating,
and Running
a High-Level Language
Program
Source: This figure is taken from Pearson AddisonWesley, 2007
FOR MORE INFO...
Figure 1.9
Flow of Information During Program Execution
Source: This figure is taken from Pearson Addison-Wesley, 2007
THE SOFTWARE DEVELOPMENT METHOD
• Programmers use the software development
method for creating software or system
computer
• Software development method
- Step 1: Specify the problem requirements.
- Step 2: Analyze the problem
- Step 3: Design the algorithm to solve the
problem
- Step 4: Implement the algorithm
- Step 5: Test and verify the completed program
- Step 6: Maintain and update the program.
FOR MORE INFO...
See page 21 – 24
Specify the problem requirements
 Forces you to state the problem clearly and unambiguously and to gain a clear understanding of
what is required for its solution.
Analyze the problem
 Involves
identifying
the
problems
input, output, constraints and formula
including
Design the algorithm
 Requires you to develop a list of steps called an
algorithm to solve the problem and then verify
that
the
algorithm
solves
the
problem
as
intended.
Implementation the algorithm
 Involves writing it as a program.
 You must convert each algorithm step into one or
more statements in a programming languages.
Testing and Verifying the programs
 Requires testing the completed program to verify
that it works as desired.
 Do not rely on just one test case. Run a program
several times using different sets of data.
Maintenance and updating the program
 Involves modifying a program to remove previously
undetected errors and to keep it up-to-date as
government
regulations
or
company
policies
change.
APPLYING THE SOFTWARE DEVELOPMENT
METHOD
• Use the first three steps of the software
development method to solve problem in case study
given
Case Study: Converting Miles to Kilometers
“Your
some
that
deal
summer surveying job requires you to study
maps that give distances kilometers and some
use miles. You and your co-workers prefer to
in metric measurements. “
FOR MORE INFO...
See Page 25 – 27 for this case study. Discuss!
DISCUSSION

Why university curricula for engineers
and
scientist
include
in
solving
problems
using
a
general-purpose
programming language such as C?
– Discuss !!