cs110: programming language i - wordpress.com · lecture contents computer science department...

Post on 23-May-2018

214 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

CS110: PROGRAMMING

LANGUAGE I

Lecture 1: Introduction Computer Science

Department

1

Lecture Contents

Computer Science Department

Course Info.

Elements of a Computer system.

Evolution of programming languages

The code Life Cycle

2

Course info

Website

cs110spr14.wordpress.com

Books

Course plan

Assessment methods and grading

Labs and practical assignments

Practical exam

3

[1]

[2]

Elements of a Computer System

Computer Science Department

4

Hardware

Software

Computer

Hardware

5

Computer Science Department

Memory Unit 6

Ordered sequence of cells or locations

Stores instructions and data in binary

Types of memory

Read-Only Memory (ROM)

Random Access Memory (RAM)

Bit: A binary digit 0 or 1.

A sequence of eight bits is called a byte.

Binary Data 7

Computer Science Department

ASCII Code 8

Every letter, number, or special symbol (such as * or {) on your keyboard is encoded as a sequence of bits, each having a unique representation.

The most commonly used American Standard Code for Information Interchange (ASCII).

Computer Science Department

9

Central Processing Unit (CPU)

Executes stored instructions

Arithmetic/Logic Unit (ALU)

Performs arithmetic and logical operations

Control Unit

Controls the other components

Guarantees instructions are executed in sequence

Input and Output Devices 10

Interaction with humans

Gathers data (Input)

Displays results (Output)

Computer Science Department

Software

loads first when you turn on your PC

Also called the operating system.

The operating system monitors the overall activity of the computer and provides services, such as memory management, input/output activities, and storage management.

perform specific tasks

Examples :

Word processors

spreadsheets, and

games

11

Computer Science Department

System programs Application programs

Both operating systems and application programs are

written in programming languages.

12

Are Computers Intelligent?

Do we really need to be involved in programming

computers?

They have beaten world chess champions.

They help predict weather patterns.

They can perform arithmetic quickly.

So, a computer has an IQ of _____.

Computer Science Department

Computer Science Department

13

What is Computer Programming?

Planning or scheduling a sequence of steps for a

computer to follow to perform a task.

Basically, telling a computer what to do and how to

do it.

A program:

A sequence of steps to be performed by a computer.

Expressed in a computer language.

Computer Science Department

14

Computer Languages

A set of

Symbols (punctuation),

Special words or keywords (vocabulary),

And rules (grammar)

used to construct a program.

Evolution of Programming Languages

Computer Science Department

15

Languages differ in

Size (or complexity)

Readability

Expressivity (or writability)

"Level"

closeness to instructions for the CPU

Machine Language 16

Binary-coded instructions

Used directly by the CPU

Lowest level language

Every program step is ultimately

a machine language instruction

10010110

11101010

00010010

10101010

10010110

11101010

11111111

01010101

10101101

2034

2035

2036

2037

2038

2039

2040

2041

2042

Address Contents

Computer Science Department

Assembly Language

Computer Science Department

17

Each CPU instruction is labeled with a mnemonic.

Very-low level language

Almost 1 to 1 correspondence with machine language

Assembler: A program that translates a program written in

assembly language into an equivalent program in machine

language.

Mnemonic Instruction

ADD 10010011

MUL X,10

ADD X,Y

STO Z,20

SUB X,Z

Sample Program

Examples of Instructions in Assembly Language and

Machine Language 18

Computer Science Department

Computer Science Department

19

High-Level Languages

Closer to natural language

Each step maps to several

machine language instructions

Easier to state and solve

problems

Compiler: A program that

translates a program written

in a high-level language into

the equivalent machine

language.

Computer Science Department

20

Examples of High-Level Languages

Language Primary Uses

Pascal Learning to program

C++ General purpose

FORTRAN Scientific programming

PERL Web programming, text processing

Java Web programming, application

programming

COBOL Business

The java Language

Computer Science Department

21

source

program.

Saved in File

ClassName.ja

va

The Code life Cycle!!

Edit compile run

22

Processing a java program 23

Computer Science Department

Text book

[1] chapter 1 (pages 1-13)

That’s all for this week 25

Computer Science Department

top related