54
LECTURE 1 : OVERVIEW OF COMPUTERS AND PROGRAMMING KK10103/KK14303 Programming Principles Prepared By Tan Soo Fun

Lecture 1 Overview of Computers and Programming

Embed Size (px)

Citation preview

Page 1: Lecture 1 Overview of Computers and Programming

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

Page 2: Lecture 1 Overview of Computers and Programming

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

Page 3: Lecture 1 Overview of Computers and Programming

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

Page 4: Lecture 1 Overview of Computers and Programming

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

Page 5: Lecture 1 Overview of Computers and Programming

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

Page 6: Lecture 1 Overview of Computers and Programming

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

Page 7: Lecture 1 Overview of Computers and Programming

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 

Page 8: Lecture 1 Overview of Computers and Programming

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

Page 9: Lecture 1 Overview of Computers and Programming

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

Page 10: Lecture 1 Overview of Computers and Programming

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

Page 11: Lecture 1 Overview of Computers and Programming

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

Page 12: Lecture 1 Overview of Computers and Programming

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)

Page 13: Lecture 1 Overview of Computers and Programming

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.)

Page 14: Lecture 1 Overview of Computers and Programming

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 ??

Page 15: Lecture 1 Overview of Computers and Programming

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 – 

Page 16: Lecture 1 Overview of Computers and Programming

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 ??

Page 17: Lecture 1 Overview of Computers and Programming

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

Page 18: Lecture 1 Overview of Computers and Programming

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

Page 19: Lecture 1 Overview of Computers and Programming

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)

Page 20: Lecture 1 Overview of Computers and Programming

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

Page 21: Lecture 1 Overview of Computers and Programming

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 

Page 22: Lecture 1 Overview of Computers and Programming

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

Page 23: Lecture 1 Overview of Computers and Programming

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

Page 24: Lecture 1 Overview of Computers and Programming

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)

Page 25: Lecture 1 Overview of Computers and Programming

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

Page 26: Lecture 1 Overview of Computers and Programming

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

Page 27: Lecture 1 Overview of Computers and Programming

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 

Page 28: Lecture 1 Overview of Computers and Programming

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  

Page 29: Lecture 1 Overview of Computers and Programming

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

Page 30: Lecture 1 Overview of Computers and Programming

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

Page 31: Lecture 1 Overview of Computers and Programming

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. 

Page 32: Lecture 1 Overview of Computers and Programming

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

Page 33: Lecture 1 Overview of Computers and Programming

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 

Page 34: Lecture 1 Overview of Computers and Programming

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

Page 35: Lecture 1 Overview of Computers and Programming

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

Page 36: Lecture 1 Overview of Computers and Programming

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

Page 37: Lecture 1 Overview of Computers and Programming

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

Page 38: Lecture 1 Overview of Computers and Programming

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:

Page 39: Lecture 1 Overview of Computers and Programming

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

Page 40: Lecture 1 Overview of Computers and Programming

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

Page 41: Lecture 1 Overview of Computers and Programming

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.

Page 42: Lecture 1 Overview of Computers and Programming

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

Page 43: Lecture 1 Overview of Computers and Programming

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;

Page 44: Lecture 1 Overview of Computers and Programming

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

Page 45: Lecture 1 Overview of Computers and Programming

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

Page 46: Lecture 1 Overview of Computers and Programming

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 

Page 47: Lecture 1 Overview of Computers and Programming

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

Page 48: Lecture 1 Overview of Computers and Programming

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

Page 49: Lecture 1 Overview of Computers and Programming

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

Page 50: Lecture 1 Overview of Computers and Programming

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

Page 51: Lecture 1 Overview of Computers and Programming

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

Page 52: Lecture 1 Overview of Computers and Programming

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

Page 53: Lecture 1 Overview of Computers and Programming

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

Page 54: Lecture 1 Overview of Computers and Programming

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