Information and
Communication Technology
Class XI-XII
Chapter-5
Programming Language
CPU= Central Processing Unit
Control Unit
Arithmetic logic Unit
Output
Input
Memory
Calculation is the main task of CPU:
Control Unit: control the task of CPU
ALU: Addition, subtraction, multiplication,
division etc. are example of calculation.
Logical task: AND, OR, NOT etc.
Memory:
Memory unit need to store data.
Data used in calculation.
After processing result produced. This results
are also needed to store in memory
Memory
Volatile-Memory Non-volatile Memory
RAM Hard disk
Cache memory ROM
DVD/CD
Register
USB drive
Volatile-Memory:
The computer takes data directly from
memory for processing
Its temporary memory
Loses data if computer is switch off
Loses data if program is close
Loses data if power supply goes off
Example:
RAM(Random Access Memory),
Register, cache memory
Non-volatile Memory
Permanent memory
Slow speed
Greater storage capacity
Example:
Hard disk, DVD, ROM, USB memory
Register:
Store data on temporary basis
Used to store very small amount of data
Used when processing
Located inside CPU
Fastest memory
Costly
Cache memory
Frequently used data are kept in cache
memory.
Increase the speed of memory access
Larger capacity than register
But slower than register
RAM
Can storage large amount of data
Larger than register and cache memory
Slower than register and cache memory
Cheaper than register and cache memory
Register
Cache memory
Capacity
Speed
RAM
Virtual memory
Virtual Memory
Part of hard disk can be used as main
memory(like RAM).
This is applied when shortage of RAM occurs
Its slower than RAM
Hard disk
CPU Virtual Memory
Programming language
Program:
A set of sequentially arranged instructions to
solve a particular problem is called Program.
Instruction set:
CPU of computer can execute only specific
set of instructions called instruction set.
Programming language
Programming language provides
interactions between human and
computer.
Some special character/letter, words,
rules, are to be followed in a particular
programming language.
Example:
C, C++, Java , Python etc.
Programming language needed to:
Communicate with computer
Send commands to computer
Let computer work and solve problem
for human
Control the behavior of computer
Programming language
Machine language
Low level
Assembly Language
Mid level language
high level language
4th Generation Language
Machine language
Use binary number system (0 and 1)
Communicate with computer directly
Low level language
Machine language: Advantages
Easy for computer
No translator program needed
Works faster
If you want to understand
architecture of computer you must
learn machine language.
Machine language: Disadvantage
Very Hard for human
Writing a large program is next to
impossible
Time consuming for human to write
Chance to do mistake/error is very high
Debugging is also very hard
Without knowing architecture of computer ,
NOT possible to write program
CQ
In ICT class Nafiza madam was discussing
about programming language. She told that
program were written only by using 0 and 1
long ago.
C) describe the language metioned in the
stem
Assembly Language
Assembly Language was created to make
programming easier.
Low level language
Easier than machine language
But writing large program is hard and time
consuming
Assembly Language
Computer can’t understand Assembly
Language directly
Translator named assembler used to convert
it into machine language
Some Assembly Language Command
ADD= Addition
SUB= Subtraction
MUL = Multiply
DIV= Division
MOV= Move
LDA = Load
STP= STOP
JMP=JUMP
Mid level language
It joint computer hardware and programming
as a bridge.
It stands between assembly language(low
level) and high level language
Mid level language
C is a Mid level language(also considered as
high level)
Best feature of low level Best feature of high level
Language Language
C programming
Language
C Programing language
Very popular for general use
Developed by Dennis Ritchie in 1972
In 1972
Bell laboratory
Software that can be developed by C
programming:
Operating System
Database Management Program
Internet Browser
google chrome, mozilla etc.
Interpreter(translator program)
Driver software for hardware
Knowing C programming makes it easier to
learn any other computer language.
C programming is a structured
programming language.
A complex program can be created by
combining many small things through
structured programming.
C programing can used to develop
application software for daily life use
Example:
Google Chrome
High level Language
Easy for human being to write large
program
Designing program is also easy
But the computer does not understand it
directly, so it has to be translated into
machine language using a translator
program
High level Language: Example:
C
C++
Visual basic
Java
Algol
Fortran
Python
Cobol
C sharp (C#)
PHP
Alavi wrote a program in language which is
similar to English.
C) what kind of language Alavi wrote?
Low level language VS High Level Langauge
Machine language High Level language
Uses only 0 and 1. Very similar to human
Communicate with language (English) that
computer directly easy for human being
Communicate with Computer can’t recognize
computer directly directly
Not needed to be Needed to be translated
translated by translator program
Hard to write a Easy to write a
program program
On the date of 12/08/2016 the ICT teacher was
discussing in the class on the Program the solution to
the general problems to make the computer know the
programming language of a generation with the help of
computer and told that in the next class he would teach
how to find out the result of a number of digit in a series
with the help of C programming.
(d) Which of the programs mentioned on the date in
Stimuli by the ICT teacher? Do you think is more
useful? Illustrate your answer.
C++
In 1980
Bjarne Stroustrop
Bel laboratory
C++
The C ++ language was created by adding
classes to the C programming language and
later adding some new features.
Some things which have similar
characteristics are called class.
The basic principle of this language is to give
a programmer the freedom to program as he
sees fit.
Visual basic
in 1991, Microsoft developed Visual Basic
language for programming on their Windows
operating system.
Gained widespread popularity as soon as it
reached a stable level.
Visual basic
This is extremely easy programming
language
If the program was changed, the program
could be run without re-compiling(re-
translating)
This was very popular both for a general user
and for programmers.
Java
The Sun micro system created Java
programming language in 1991.
Very popular for developing back end of
website.
Java
WORA: Write Once, Run Anywhere
The main feature is that it can be compiled on
one platform and used directly on any other
such platform(that also supported by Java) .
It quickly became popular because the
important web browsers (google chrome,
Mozilla etc. ) gave ability to launch Java
applets inside web pages.
Algol
Algol =Algorithmic language
The Algal programming language was
created in 1958 by the combined efforts of
several computer scientists in Europe and
America.
For that time there was a much more futuristic
and modern programming language than
programming languages.
Algol
Even in the syntax of today's modern
programming languages, the influence of
Algol can be noticed
Although widely used in science and
research, it has not been popular in the
business world due to lack of simple input
and output method.
Fortran
In 1957, IBM invented a high-level language
called Fortran for use in science and
technology.
The latest version of Fortran has been
released in 2018.
The language is still used in large simulations
because it can calculate very quickly. C ++ in
other languages close to it in terms of speed
Fortran
Scientists and researchers adopted the
language because it has a special ability to
perform mathematical analysis.
Physics and chemistry can solve many big
mathematical problems. Still it is used by
scientists in their research.
At one time this language was used
exclusively in almost all scientific research in
the world.
Python
Guido Van Rossum created Python in
1991.
It is currently one of the most popular
languages and in 2018 it was recognized
as the greatest programming language by
the IEEE.
Python: features
Simple and readable syntax.
It runs on different platforms.
Python: Applications
Cloud-based web application
Data analysis
Machine learning applications
4GL
The language very close to human
language is the language of the fourth
generation.
Examples:
Database(SQL)
Graphical interface
Use menu/button etc.
Translator program
A translator is a computer program
translate high level language into Low
level language(machine language)
High Translator Low level/
Level Program/ Machine
Language Software Language
Why translator program needed?
Human like to write program in high
level language.
So people writes program in high level
language ( C/C++, Java etc)
Computer can understand only low level
language(0 and 1).
Translator program convert it into
machine language.
Types of Translator program
Translator
Compiler Interpreter Assembler
Compiler
Translate high level language program into
low level machine language
It checks whether the program is in correct
syntax
Makes sure that the program is following the
proper rules
High Low level/
Level Compiler Machine
Language Language
Compiler
Compiler is a translator that takes entire
program at a time and shows all errors at a
time.
Work faster
Hard for debugging(error correction)
Interpreter
Translate high level language program into
machine language
Take one line (or one statement) at a time
Easy to debug
Time consuming
Interpreter
High Level Interpreter
Machine code
Language
Difference between a compiler and
an interpreter
Compiler Interpreter
1. Translate high level 1. Translate high level
language program into low language program into low
level machine language level machine language
2. Take entire program at a 2. Take one line (or one
time statement) at a time
[Link] faster 3. Works slower
4. All errors (bugs) are 4. Error message shown
shown together when any error is found
5. Debugging is harder 5. Debugging is easier
Assembler
Translate assembly language program into
machine language
Assembly Machine
Language Assembler Language
Assembler
MOV AX , B 1010101010101
MOV BX , C 1010100101010
MUL AX , BX 000100101011
1010111010101
MOV BX , A Assembler 101111101110
ADD AX , BX 1010100101111
MOV BX, D 10101011111111
ADD AX, BX
Program structure
A big program has many small parts and
there is a relationship among these parts.
This is called the structure of the program
Input Process Output
Program structure: features
Specific and clear flow control
It follows the rules
Good data structure
Data in memory and their relationship
Easy relation among parts