1

CS110: PROGRAMMING LANGUAGE I Computer Science Department

Lecture 1: Introduction

Lecture Contents 2

   

Course Info. Elements of a Computer system. Evolution of programming languages The code Life Cycle

Computer Science Department

Course info 3



  

 

Website cs110spr14.wordpress.com Books Course plan Assessment methods and grading Labs and practical assignments Practical exam

[2]

[1]

Elements of a Computer System 4

Hardware

Computer Software

Computer Science Department

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)

7

Binary Data Bit: A binary digit 0 or 1. A sequence of eight bits is called a byte. 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).

Central Processing Unit (CPU) 9

 

Executes stored instructions Arithmetic/Logic Unit (ALU)  Performs

arithmetic and logical operations



Control Unit  Controls

the other components  Guarantees instructions are executed in sequence

Computer Science Department

Input and Output Devices 10

  

Interaction with humans Gathers data (Input) Displays results (Output)

Computer Science Department

Software 11

System programs 

 

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.

Application programs 



perform specific tasks Examples :   

Word processors spreadsheets, and games

Both operating systems and application programs are written in programming languages. Computer Science Department

Are Computers Intelligent? 12



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

What is Computer Programming? 13







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

Computer Languages 14



A set of  Symbols

(punctuation),  Special words or keywords (vocabulary),  And rules (grammar)

used to construct a program.

Computer Science Department

Evolution of Programming Languages 15



Languages differ in  Size

(or complexity)  Readability  Expressivity (or writability)  "Level"  closeness

to instructions for the CPU

Computer Science Department

Machine Language 16

Binary-coded instructions  Used directly by the CPU  Lowest level language  Every program step is ultimately a machine language instruction 

Address Contents 2034

10010110

2035

11101010

2036

00010010

2037

10101010

2038

10010110

2039

11101010

2040

11111111

2041

01010101

2042

10101101 Computer Science Department

Assembly Language 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. Sample Program

Mnemonic Instruction ADD

10010011

MUL ADD STO SUB

X,10 X,Y Z,20 X,Z

Computer Science Department

18

Examples of Instructions in Assembly Language and Machine Language

Computer Science Department

High-Level Languages 19

 

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

Examples of High-Level Languages 20

Language Pascal C++

Primary Uses Learning to program General purpose

FORTRAN

Scientific programming

PERL

Web programming, text processing

Java

Web programming, application programming Business

COBOL

Computer Science Department

The java Language 21

source program. Saved in File ClassName.ja va

Computer Science Department

The Code life Cycle!! 22

Edit  compile  run

23

Processing a java program

Computer Science Department

IDE 24



The programs that you write in Java are typically developed using an integrated development environment (IDE).

23-Jan-14

Computer Science Department

25

That’s all for this week Text book [1] chapter 1 (pages 1-13)

Computer Science Department