Upload
alphs-alphonse
View
218
Download
0
Embed Size (px)
Citation preview
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 1/54
LECTURE 1 :
OVERVIEW OF
COMPUTERS ANDPROGRAMMING
KK10103/KK14303 Programming Principles
Prepared By Tan Soo Fun
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 2/54
Contents
1.1 Introduction
1.2 Electronic Computers Then and Now
1.3 Computers : Hardware
1.4 Computers : Software
1.5 The Software Development Method
1.6 Applying the Software Development Method
CASE STUDY : CONVERTING MILES TOKILOMETERS
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 3/54
Learning Outcomes
Upon completion of this topic, the studentsshould able to :- Describe basic computer systems concepts
Identify the basic elements of computer hardware andsoftware
List and describe the classifications of computerlanguages
Apply the software development method
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 4/54
1.1 Introduction
Source : http://www.freeinfosociety.com/article.php?id=74
Bill Gates
- Born on October 28, 1955in Seattle, Washington-Start Microsoft 1975
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 5/54
1.1 Introduction
Steven Paul "Steve" Jobs
- Born February 24,1955, San Francisco-Start Apple Inc. , 1976
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 6/54
1.1 Introduction
Robin Li李彦宏
- Born inYangquan, Shanxi, China-Start China's most popularsearch engine Baidu
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 7/54
1.1 Introduction
Mark
Zuckerberg - born May 14, 1984-co-founder of Facebook
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 8/54
1.2 Electronic Computers Then and Now
Atanasoff –BerryComputer (ABC)First Electronic Computer, 1937 John Vincent Atanasoff ,Clifford Berry at Iowa StateUniversity The machine was notprogrammable, being designedonly to solve systems of linear
equations
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 9/54
1.2 Electronic Computers Then and Now
ENIAC (Electronic NumericalIntegrator And Computer) first general-purposeelectronic computer
created at University ofPennsylvania, funded by UnitedStates Armydesigned tocalculate artillery firing tables forthe United States Army's Ballistic
Research Laboratory
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 10/54
1.2 Electronic Computers Then and Now
Third Generation
IBM 7090
designed for "large-scalescientific and
technological applications
PDP-8- First successfulcommercial minicomputer - produced by Digital
Equipment Corporation(DEC) in the 1960s
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 11/54
1.2 Electronic Computers Then and Now
Fourth Generation
VAX -an instruction set architecture (ISA)-developed by Digital Equipment
Corporation (DEC) in the mid-1970s
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 12/54
1.2 Electronic Computers Then and Now
Intel Atom processor chip
contains the full circuitry of a central processing unit in an integrated circuitwhose small size and low power requirements make it suitable for use inmobile internet devices. (Intel Corporation Pressroom Photo Archives)
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 13/54
1.2 Electronic Computers Then and Now
Now
(a) Notebook Computer (HP Pavilion
dv5©, Courtesy of Hewlett-Packard).
(b) Palmtop Computer (iPhone 4G©,
Courtesy of Apple, Inc.)
(c) Desktop Computer (iMac©, Courtesy
of Apple, Inc.)
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 14/54
1.2 Electronic Computers Then and Now
Future ??
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 15/54
1.2 Electronic Computers Then and Now –
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 16/54
1.1 Electronic Computers Then
and Now-Future ??
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 17/54
1.3 Computers : Hardware
Computers ?? a device that can perform computations and
make logical decisions billions of times faster thanhuman beings can.
Modern Computers can be categorized (sizeand Performance) into :
Personal ComputersMainframes
Supercomputers
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 18/54
1.3 Computers : Hardware
Components of Computers
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 19/54
1.3 Computers : Hardware
Components of Computers (Top Level View)
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 20/54
1.3 Computers : Hardware
Memory
1000 Memory Cells inMain Memory
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 21/54
1.3 Computers : Hardware
Bytes
The amount of storage required to store a singlecharacter
Bits The smallest element a computer can deal with
A binary digit, a 0 or a 1
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 22/54
1.3 Computers : Hardware
Digits of the binary, octal, decimal andhexadecimal number system
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 23/54
1.3 Computers : Hardware
Converting a binary number to decimalQuestion 1 : 110101 answer : 53
Conversion of decimal to binary
Will discuss more on tutorial 1
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 24/54
-The part of memory thatpermanently stores programs ordata
- Not Volatile Memory
-The part of main memory thattemporarily stores programs, dataand results
-Volatile Memory-Contents that disappearwhen the computer isswitched off
1.3 Computers : Hardware
Main Memory
RAM
(Random AccessMemory)
ROM
(Read OnlyMemory)
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 25/54
1.3 Computers : Hardware
Secondary Storage
Units such as disks or flash drives that retain data evenwhen the power to the drive is off
Why ?? Store more information/data that will fit in memory
Need permanent/semipermanent data –during power lossor when computer is turned off
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 26/54
1.3 Computers : Hardware
File
Named collection of data storedon a disk
Directory
A list of the names of files storedon a disk
Subdirectory
A list of the names of files thatrelate to a particular topic
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 27/54
1.3 Computers : Hardware
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 28/54
1.3 Computers : Hardware
Central Processing Unit (CPU)
Controls the
operation of thecomputer
Performs thedata processing
functions
Referred to asProcessor
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 29/54
1.3 Computers : Hardware
Computer Networks
Local Area Network (LAN)
Computers, printers, scanners and storage devices
connected by cable for intercommunication
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 30/54
1.3 Computers : Hardware
Computer Networks
Wide Area Network (WAN)
A network such as the Internet that connects
computers and LANs over a large geographic area
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 31/54
1.3 Computers : Hardware
Computer Networks
World Wide Web (WWW)
A part of the Internet whose graphical user interface
(GUI) make associated network resources easilynavigate
allows computer users to locate and view multimedia-based documents on almost any subject over theInternet—the Internet has exploded into the world’s
premier communication mechanism.
Today’s applications can be written to communicate
among the world’s computers.
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 32/54
1.3 Computers : Software
Operating System
Software that controls interaction of user andcomputer hardware
manages allocation of computers resources
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 33/54
1.3 Computers : Software
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 34/54
1.3 Computers : Software
Bootstrap program is loaded at power-up orreboot
Typically stored in ROM or EPROM, generally
known as firmware Initializes all aspects of system
Loads operating system kernel and startsexecution
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 35/54
1.3 Computers : Software
System Calls
Command-Line GUI
Interface
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 36/54
- Software used for a specific tasksuch as word processing,accounting , or database
management
1.3 Computers : Software
Software
- manage and integrate acomputer's capabilities, but
typically do not directly applythem in the performance oftasks that benefit the use
Application
Software
System Software
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 37/54
1.3 Computers : Software
Types of Software
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 38/54
1.3 Computers : Software
Computer languages may be divided into threegeneral types:
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 39/54
1.3 Computers : Software
Machine Language Binary number codes understood by a specific CPU
―natural language‖ of a computer and as such is defined byits hardware design
Advantages : Fast Processing and response Drawbacks : machine dependent (i.e., a particular machine
language can be used on only one type of computer).
Such languages are cumbersome for humans, asillustrated by the following section of an early machine-
language program that adds overtime pay to base pay andstores the result in gross pay: +1300042774
+1400593419+1200274027
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 40/54
1.3 Computers : Software
Machine Language
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 41/54
1.3 Computers : Software
Assembly LanguagesMnemonic codes that correspond to machine
language instructions Translator programs called assemblers were developed to
convert early assembly-language programs to machinelanguage at computer speeds.
The following section of an assembly-language programalso adds overtime pay to base pay and stores the result ingross pay:
load basepay
add overpaystore grosspay
Although such code is clearer to humans, it’sincomprehensible to computers until translated to machinelanguage.
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 42/54
1.3 Computers : Software
Assembly Languages
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 43/54
1.3 Computers : Software
High-Level Language
Machine-independent programming language thatcombines algebraic expressions and English symbols
Translator programs called compilers convert high-level language programs into machine language.
High-level languages allow programmers to writeinstructions that look almost like everyday English andcontain commonly used mathematical notations.
A payroll program written in a high-level languagemight contain a statement such as
grossPay = basePay + overTimePay;
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 44/54
1.3 Computers : Software
High-Level Language
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 45/54
1.3 Computers : Software
Entering, Translating,and Running a High-LevelLanguage Program
myprog.c
myprog.obj
myprog.exe
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 46/54
1.3 Computers : Software
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 47/54
1.4 Computers : Software
Flow of Information During Program Execution
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 48/54
1.5 The Software Development Method
Software development Method
1 6 A l i th S ft D l t
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 49/54
1.6 Applying the Software DevelopmentMethod
CASE STUDY : CONVERTING MILES TOKILOMETERS
PROBLEM :
Your summer surveying job requires you to studysome maps that give distances in kilometers and
some that use miles. You and your coworkers prefer todeal in metric measurements. Write a program thatperforms the necessary conversion
1 6 A l i th S ft D l t
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 50/54
1.6 Applying the Software DevelopmentMethod
Step 1 : Identify the system Requirements
PROBLEM :
Your summer surveying job requires you to studysome maps that give distances in kilometers andsome that use miles. You and your coworkers prefer to
deal in metric measurements. Write a program thatperforms the necessary conversion
1 6 Applying the Software Development
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 51/54
1.6 Applying the Software DevelopmentMethod
Step 2 : Analysis
Problem Input :
distance in miles
Problem Output : distance in kilometers
Relevant Formula
1 mile = 1.609 kilometers
1 6 Applying the Software Development
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 52/54
1.6 Applying the Software DevelopmentMethod
Step 3 :Design
1. Get the distance in miles
2. Convert the distance to kilometers
3. Display the distance in kilometers
1 miles =1.609
kilometers
1 6 Applying the Software Development
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 53/54
1.6 Applying the Software DevelopmentMethod
Implementation
8/3/2019 Lecture 1 Overview of Computers and Programming
http://slidepdf.com/reader/full/lecture-1-overview-of-computers-and-programming 54/54
THE END