You are on page 1of 15

Lecture-01

Introduction
Objectives

❏ Introduction to course
❏ To review basic computer systems concepts
❏ Computer Languages
❏ Computer Language Translator

Ghalib Univeristy: By Farman Ali 1


Exam Weighting

 Introduction to Programming
Languages marks distribution.
 Internal Evolution 40% marks
 Quizzes + Assignment + Presentation+
Attendance = 20%
 Midterm = 20%
 Final term 60% marks
 Total Marks 100
Ghalib Univeristy: By Farman Ali 2
Computer Systems
Today computer systems are found everywhere.
Computers have become almost as common as
televisions. But what is a computer? A computer is a
system made of two major components: hardware and
software.

Two components of computer:


Computer Hardware
Computer Software

Ghalib Univeristy: By Farman Ali 3


 Hardware. is any part of the computer you can touch.
 Software. The logical part of the system or is a set of instructions
that makes the computer to perform task. In other words, software
tells the computer what to do. For example, programs. And
program can be writing in computer language.

FIGURE 1-1 A Computer System

Ghalib Univeristy: By Farman Ali 4


Language

Language is a source of communication. In general,


there are two classes of languages

•Natural languages

•Computer Languages

Ghalib Univeristy: By Farman Ali 5


 Natural languages
These are the languages through which the human beings
communicate with each other. For example: English, Urdu, Farsi,
Pashto etc.

 Computer languages
These are the languages through which the human beings
communicate with the computer. These are the most widely used
mediums between the user and the computer. Examples are C++,
COBOL, PASCAL, BASIC, FORTRAN etc.

 The computer languages are classified into three types:


1) Low level languages.
2) middle level languages.
3) High level languages.

Languages

Ghalib Univeristy: By Farman Ali 6


1) Low-Level Language
• low level languages are those languages which is easy in
understanding for a computer system but difficult for a human.
• These languages are machine dependent languages. For Example
Machine language.
Machine language
Machine Language was the first language used for computers as a
source of communication This is the only language which is
directly understandable by the machine (computer) and needs no
translation programs (compiler, Assembler, Interpreter).
Machine language is the language of binary digits 0’s and 1’s(“0”
means “OFF” and “1” means “ON) that is why it is also called as
binary language. It is very difficult to write programs using 0’s
and 1’s i.e. in machine language. Thus machine language is
totally machine dependent and is efficient for computers and
inefficient for programmers
Ghalib Univeristy: By Farman Ali 7
2) Middle-Level Language
• The computer professionals developed one step higher language
than the machine language which is called Middle level
languages. Example
• ASSEMBLY LANGUAGE
• The binary codes of machine language (0’s and 1’s) were replaced
by some special codes called mnemonics. The programs in
Assembly language are written using these mnemonic codes as:
ADD for addition, SUB for subtraction MUL for multiplication

• These mnemonics are understandable by the human but not


understandable by the machine.

• To make it understandable for the machine, a program called


assembler is developed its function is to translate a program
written in assembly language into machine language
Ghalib Univeristy: By Farman Ali 8
3) High Level Language
• These languages are fairly machine independent and English like.

• The programmer can understand more easily and enable the


programmer to write instructions easily using English words and
familiar mathematical symbols such as if else, for, goto, +,- etc.
Examples C, C++, VB etc.

• A program written in high-level language is translated into


machine understandable form with the help of Translation
programs i.e interpreter or compiler.

• The high level languages are of two types:


• Procedural languages/Structured languages.
• OOP (Object Oriented Programming) languages
Ghalib Univeristy: By Farman Ali 9
Language Translator
• Translators are system programs, which translate programs
written in any high, or assembly language into 1’s and 0’s or
machine language.

Program code Language Machine code


translator

• There are three types of language processors or translators


• Assembler
• Compiler
• Interpreter
Ghalib Univeristy: By Farman Ali 10
Language Translators
• Assembler
• The software that translates assembly code into the computer’s
machine code is called assembler

• A program written by a programmer in assembly language is


called source program

• After this source code has been converted into object code.

Source Program Assembler Machine code

Ghalib Univeristy: By Farman Ali 11


Language Translators
• Compiler
• A compiler is a computer software that translates a whole
program, called the source code at once into machine code
(object code)

Ghalib Univeristy: By Farman Ali 12


Language Translators
• Interpreter
• An interpreter in another type of translator used for
translating a language program into machine code
• It takes one statement of program and translates it into a
machine instruction which is immediately executed by
computer

Compiler VS Interpreter ->

Ghalib Univeristy: By Farman Ali 13


Program
• Is a set of instructions, which are given to computer to solve
a specific problem. Programs are written in computer
languages like BASIC, PASCAL,C++ etc

--------------
--------------
------C++-------
---program- Run on computer
--------------
--------------
---------------

Ghalib Univeristy: By Farman Ali 14


Have a nice day

Ghalib Univeristy: By Farman Ali 15

You might also like