1.programming (BS Phy6) Lec1
1.programming (BS Phy6) Lec1
• The computer is an electronic device that takes data as input from the user and
processes these data under the control of a set of instructions (called program)
and gives the result (output) and saves future use.
• A computer is a system, of an interrelated, interacting components that
performs the basic function of input, processing, output, storage, and control.
Data
Data is raw, unorganized facts that need to be processed. Data can be
something simple and seemingly random and useless until it is organized.
Information
When data is processed, organized, structured or presented in a given
context so as to make it useful, it is called information.
Example
Language:
Language is the source of communication among the peoples.
The primary purpose of language is to facilitate communication, in the sense of
transmission of information from one person to another Natural language:
Natural language such as English is the language, which is spoken and written for
communication.
The natural language consists of syntax, semantics, phonetics, etc. All natural
languages have some fundamental rules, which are based on the structure of
grammar. These grammatical rules are used by people in communication.
Programming languages
A set of words, symbols and codes used to write programs is called program
language. Different programming languages are available for writing different
types of programs. Some languages are specially used for writing business
programs, other are used for writing scientific programs etc.
• Low-level languages
• High-level languages
Low-level languages
These languages are near to computer hardware and far from human languages.
Machine language
A type of language in which instructions are written in binary form is called
machine language. Programs written in machine language consist of 1s and 0s.
Programs written in assembly language are easier to write and modify than
machine language. Assembly language is mostly used for writing system software.
Assembly language is also known as second generation language.
Source code
A program written in a high-level language is called source code.
Source code is also called source program. Computer cannot understand the
statements of high-level language. The source code cannot be executed by
computer directly. It is converted into object code and then executed.
Object Code
A program in machine language is called object code. It is also called object
program or machine code.
Computer understands object code directly.
Translator
A program written in high-level or assembly language cannot be run on a
computer directly. It must be converted into machine language before execution.
Language processor or translator is a software that converts these programs into
machine language. To convert the source code into machine code, translators are
needed. Different types of translators are as follows:
Compiler
A compiler is a program that converts the instruction of a high-level language into
machine language as a whole. A program written in high-level language is called
source program. Compiler converts source program into machine code known as
object program.
The compiler checks each statement in the source program and generates
machine instruction. Compiler also checks syntax errors in the program. A source
program containing an error cannot be compiled.
Interpreter
An interpreter is a program that converts one statement of a program at one
time. It executes this statement before translating the next statement of the
source program. If there is an error in the statements, the interpreter stops
working and displays an error message.
The disadvantage of interpreter is that it is not very efficient. The interpreter does
not produce an object program. It must convert the program each time it is
executed.
Assembler
An assembler is translating program that translates the instruction of an assembly
language into machine language.
References
• https://www.javatpoint.com/what-is-computer
• https://www.educba.com/types-of-computer-language/
• https://www.tutorialspoint.com/difference-between-high-level-
language-and-low-level-language
• https://codescracker.com/computer-fundamental/computer-
language-translators-with-types.htm
Channel name
MJaved Learning
Channel link
https://www.youtube.com/channel/UCZ3bJokA8Jmj6QJ11h7bGQg
Video links
https://www.youtube.com/watch?v=2t-
7pUJ_SUw&list=PLtgDiTatpOXAKHv9xXzchEanNWYSYZoAv&index=2&t=11s
• Programming Basics in Urdu Source code, Object code,
Translator, Types of Translators
https://www.youtube.com/watch?v=pWr3zUMcPxw&list=PLtgDiTatpOXAK
Hv9xXzchEanNWYSYZoAv&index=3
Thanks