Sunteți pe pagina 1din 11

Lecture 05: Computer Software & Prog.

CS 101: Introduction to Computing

Computer Software and Programming

Saima Jabeen

Lec05: Computer Software & Prog.

S 101: Introduction to Computing

Computer Programming
Computer programming is the process of writing
instructions that direct a computer to carry out specific
tasks

A computer program is a set of step-by-step


instructions that tell a computer how to solve a problem or
carry out a task

The instructions that make up a computer program


are often referred to as code
A program is written in a computer programming
language

Lec05: Computer Software & Prog.

S 101: Introduction to Computing

Programming Languages (-1-)


A programming language is an artificial
language designed for creating instructions that a
computer can carry out

In contrast, the languages we speak [e.g., English / Urdu] are


natural languages

Programming
languages
languages in that

differ

from natural

natural languages are used for interaction between


people
programming languages allow humans to communicate
instructions to machines as well as machine-to-machine
interaction
3

Lec05: Computer Software & Prog.

S 101: Introduction to Computing

Programming Languages (-2-)


Programming languages can be divided into two major
categories
Low-level languages

Requires programmer to write instructions for the


lowest level of computers hardware
Easy for computer to understand; Difficult for humans

Examples: Machine Language, Assembly Language

High-level languages

Makes programming process easier by providing


commands such as PRINT or WRITE instead of
unintelligible strings of 1s and 0s
Examples: FORTRAN, C, C++, Java, Python

Languages can also be categorized by generations

Lec05: Computer Software & Prog.

S 101: Introduction to Computing

Programming Language Categorization

3GL, 4GL

HIGH-LEVEL
LANGUAGES

2GL

ASSEMBLY
LANGUAGE

1st Generation
Language [1GL]

LOW-LEVEL
LANGUAGES

MACHINE LANGUAGE
HARDWARE

Lec05: Computer Software & Prog.

S 101: Introduction to Computing

Machine Language / Machine Code


The first languages for programming computers sometimes
referred to as first-generation languages

Consists of a set of commands, represented as a series of 1s


and 0s, corresponding to the instruction set understood by a
microprocessor
A machine language is specific to a particular CPU or
microprocessor family

High-level languages are (mostly) translated [compiled] to


machine language in order to be understood and executed by
the microprocessor

Lec05: Computer Software & Prog.

S 101: Introduction to Computing

Assembly Language
Allows programmers to use abbreviated command words
rather than 1s and 0s used in machine languages

A significant improvement over machine languages

Mnemonics such as ADD, SUB, MUL, DIV, JMP etc are more
understandable than 0001, 0100 etc

Also referred to as second-generation languages

Assembly languages are also machine specific

Each assembly language command corresponds on a one-to-one


basis to a machine language instruction

Lec05: Computer Software & Prog.

S 101: Introduction to Computing

Algorithm
A concept that pervades all areas of computer science.
Algorithm is a process that a computer could carry out
to complete a well defined task within finite time and
resources.
The objective of computer science is to solve problems
by developing, analyzing, and implementing
algorithmic solutions.

Lec05: Computer Software & Prog.

S 101: Introduction to Computing

Al-Khwarizmi Principle

All complex problems can be broken into simpler


sub-problems.
Solve a complex problem by breaking it down into
smaller sub-problems and then solve them (in a
specified order), one at a time.
When all the steps are solved, the original
problem itself has also been solved.
This process is called Algorithm.

Lec05: Computer Software & Prog.

S 101: Introduction to Computing

Computer Programming
Computer is a powerful tool

It is not intelligent!

In order to use computer to solve our problems, we


must tell it what we want done and the order in which
we want it done.

These instructions are called computer program.

This process is called computer programming.

The person giving these instructions is called a


computer programmer.

10

Lec05: Computer Software & Prog.

S 101: Introduction to Computing

References
Computer Concepts, by Parsons & Oja
[Chapters 3]

11

S-ar putea să vă placă și