You are on page 1of 25

CSC 101

INTRODUCTION TO
COMPUTER SCIENCE
AY 2014-2015 (Term 2)

Grading System
Exam
Laboratory Exercise/Quiz
HW/SW
Attendance
Passing Rate:
No Removal Exam
Main References:

60 %
25
10
5

60%

JAVATM Programming: From Problem Analysis to Program Design by D. S. Malik


JAVATM How to Program, 7th ed by Deitel

LECTURE 1

INTRODUCTION TO COMPUTER
SYSTEMS

Lecture Outline
What is a computer?
Hardware

and Software
Components of a Computer System
Starting a Program
Networks
Language of a Computer
Evolution of Computer Language
Programming
Programming Methodologies

What is a computer?

a general purpose device that can be


programmed to carry out a set of arithmetic
or logical operations automatically

a complex system consisting of both


hardware and software components

Variations:

embedded computers

calculator, ATM, printer, videogame console

personal computer (aka desktop and home


computer), laptop, portable, notebook
computer

PDA

Mainframe or Supercomputer

Hardware vs Software
Hardware

Software

collection of instructions that


enables a user to interact with the
Devices that are required to store
computer
a program that enables a
and execute (or run) the
Definition
software.
computer to perform a specific
task, as opposed to the physical
components of the system
Types

Input, storage, processing,


control, and output devices.

Examples

System software, Utility software,


and Application software.

CD-ROM, monitor, printer, video


card, scanners , label makers,
routers , and modems.

Operating systems, drivers, Adobe


Acrobat, Internet Explorer ,
Microsoft Word , Microsoft Excel

Components of a Computer System


Computer
I/O

CPU
System
Bus

Memory

Components of a Computer System


CPU

Computer
I/O

CPU
System
Bus

Registers

ALU
Internal
Bus

Memory

Control
Unit

Components of a Computer System


Memory
Main/Primary

Secondary

closely connected to the


processor.
stored data are quickly and
easily changed.
holds the programs and data
that the processor is actively
working with.
interacts with the processor
millions of times per second.
needs constant electric power
to keep its information.

connected to main memory


through the bus and a
controller.
stored data are easily changed,
but changes are slow
compared to main memory.
used for long-term storage of
programs and data.
before data and programs can
be used, they must be copied
from secondary memory into
main memory.
does not need electric power
to keep its information.

Starting a Program
1.

The user asks to run an application.

2.

The OS determines the name of the application.

3.

The OS finds the files on the hard disk where the application and its data are
stored.

4.

The OS finds an unused section of main memory that is large enough for the
application.

5.

The OS makes a copy of the application and its data in that section of main
memory.

6.

The OS sets up resources for the application.

7.

Finally, the OS starts the application running.

Computer Networks
Network

consists of two or more computers connected so that they can


exchange data and programs

through network interface card

Computer Networks
Internet

a global system of interconnected computer networks that use the


standard Internet protocol suite (TCP/IP) to link several billion devices
worldwide

carries an extremely large number of network services, including the

World Wide Web, electronic mail, Internet phone, audio, video and file
transfer services

World Wide Web


a global set of documents, images and other resources, logically

interrelated by hyperlinks

Language of a Computer
Electrical Signals
Analog

continuous waveforms used to represent things, such as sound

Digital

represent information with a sequence of 0s and 1s

more reliable carriers of information than analog signals and can be copied from
one device to another with exact precision

Machine Language is digital.

Language of a Computer
binary digit or bit

digit 0 or 1

binary code or binary number

sequence of 0s and 1s

byte

8 bits

American Standard Code for


Information Interchange (ASCII)

most commonly used

encoding scheme on personal


computers

Evolution of Programming Languages


Machine Language

provides program instructions in bits

even though most computers perform the same kinds of operations, the designers of different
CPUs sometimes choose different sets of binary codes to perform those operations

Ex: user wants to use the equation c = a + b


a

010001

load

100100

010010

addition

100101

010011

store

100010

100100 010001

100101 010010
100010 010011

Assembly Language

developed to make the programmers job easier

an instruction is an easy-to-remember form called a mnemonic

LOAD a
ADD b
STOR c

High-Level Language
closer to spoken languages
Basic, FORTRAN, COBOL, Pascal, C, C++, and Java

Ex:
c = a + b;

Processing a JAVA

program

Programming
a process of problem solving
1.

analyzing a problem

2.

outlining the problem requirements

3.

designing steps (algorithm)

Algorithm

a step-by-step problem-solving process in which a solution is arrived at in a


finite amount of time

programming process

Ex: Design an algorithm to find the perimeter and area of a

rectangle
1. Get the length of the rectangle.

2. Get the width of the rectangle.


3. Find the perimeter using the following equation:

perimeter = 2*(length + width)


4. Find the area using the following equation:
area = length*width

Programming Methodologies
Structured Programming
problem

is divided into smaller subproblems then each subproblem


is analyzed and a solution for the subproblem is obtained. The
solutions to all the subproblems are then combined to solve the
overall problem

also

known as top-down design, bottom-up design, stepwise


refinement, and modular programming

Programming Methodologies
Object-Oriented Programming
first

step in the problem-solving process is to identify the


components called objects, which form the basis of the solution,
and to determine how these objects interact with one another

Review

True or False:
1.

Assembly language is the language that uses mnemonics for its instructions.

2.

The arithmetic operations are performed inside CPU and, if an error is found, it outputs the
logical errors.

3.

A Java compiler is a program that translates a Java program into bytecode.

4.

Bytecode is the machine language of the JVM.

5.

The CPU stands for command performing unit.

6.

RAM stands for readily available memory.

7.

A program written in a high-level programming language is called a source program.

8.

The operating system is the first program loaded into the computer when the power is turned
on.

9.

The first step in the problem-solving process is to analyze the problem.

References

JAVATM Programming: From Problem Analysis to Program Design by D. S. Malik


JAVATM How to Program, 7th ed by Deitel
Computer. http://www.computerhope.com/jargon/c/computer.htm
Top 10 Most Popular Programming Languages. http://www.english4it.com/reading/40
Introduction to Computer Science using Java.
http://chortle.ccsu.edu/CS151/cs151java.html
Introduction to Computer Science.
http://en.wikiversity.org/wiki/Introduction_to_Computer_Science
Hardware vs Software. http://www.diffen.com/difference/Hardware_vs_Software

You might also like