0% found this document useful (0 votes)
10 views

1.programming (BS Phy6) Lec1

The document defines what a computer is and its basic components including input, processing, output, storage and control. It describes data, information, natural and programming languages. It discusses low-level languages like machine language and assembly language and high-level languages. It also defines source code, object code and language translators like compilers and interpreters.

Uploaded by

Umar Islam
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

1.programming (BS Phy6) Lec1

The document defines what a computer is and its basic components including input, processing, output, storage and control. It describes data, information, natural and programming languages. It discusses low-level languages like machine language and assembly language and high-level languages. It also defines source code, object code and language translators like compilers and interpreters.

Uploaded by

Umar Islam
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

What is Computer?

• 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

Each student's test score is one piece of data.


The average score of a class or of the entire school is information that can be
derived from the given data.

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.

There are two types of computer programming languages.

• Low-level languages
• High-level languages
Low-level languages
These languages are near to computer hardware and far from human languages.

Computer can understand these languages easily. Writing a program in low-level


languages require a deep knowledge of the internal structure of computer
hardware. Two low-level languages are machine language and assembly language.

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.

It is the only language that is directly understood by the computer. It is the


fundamental language of computer. Program written in machine language can be
executed very fast by the computer. Programs written in machine language are
machine-dependent. Machine language is difficult to understand. Writing and
modifying program in machine language takes a lot of time. Machine language is
also known as first generation language.
Assembly language:
Assembly language is a low-level language. It is one step higher than machine
language. In assembly language, symbols are used instead of binary code. These
symbols are called mnemonics. For example, sub instruction is used to subtract
two numbers. Assembly language is also called symbolic language.

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.

High Level Languages


A type of language that is close to human language is called high level language.

High-level languages are easy to understand. Instruction of theses languages are


written in English-like words such as input and print etc. A program written in
high-level language is easier to write and modify.

For example, C, C++, VB, JAVA etc.

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 advantage of interpreters over the compliers is that an error is found


immediately. So the programmer can correct errors during program development.

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

• Intro to computer, Generation and History of computer ICT


https://www.youtube.com/watch?v=4HOk3J1k_7Q&list=PLtgDiTatpOXBFjJ
YEjfR2awDTrk0Q5q1S&index=12&t=60s

• Programming Basics in Urdu know to language, Computer


language, types of computer languages

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

For any query or suggestion, students can send E-mail at:


[email protected]

Thanks

You might also like