Chapter-1-Overview-of-Computer-Software-and-Programming-Languages
Chapter-1-Overview-of-Computer-Software-and-Programming-Languages
Software and
Programming
Languages
Chapter - 1
Prepared by C Programming
Kabin Devkota
Udita Bista
Number System
Decimal Number System(base 10)
uses symbols 0 to 9
position
place value
Number System
position
place value
Number System
Octal Number System(base 8)
position
place value
Number System
Hexadecimal Number System(base 16)
decimal equivalent of hexadecimal number B25 can be
found as:
=B*16^2 + 2*16^1 + 5*16^0
=11*256 + 2*8 + 5*1
=2816 + 32 + 5
=2853
Number System
Binary Number System(base 2)
uses symbols 0 and 1
The nibble
collection of 4 bits
The Byte
8- bits
Byte represents 2^8 or 256 different values
Usually byte represents
unsigned numeric values in range 0 to 255
signed numbers in range -128 to +127
ASCII (American Standard Code for Information Interchange) character codes
other special data types requiring no more than 256 different values
The word
16-bits
can represent 2^16(65,536) different values
uses for words
16-bit integer data values
16-bit memory addresses
b. Packaged Software
different kinds of programs related to an application are combined together
to form a package
packages are common to many users
eg. Ms Word, Excel, Power point as a packaged software named Microsoft
Office
c. Utility Software
software designed to help to analyze, configure, optimize or maintain a
computer system
It is used to support the computer infrastructure
eg. Anti-virus, disk manager, etc.
Computer Program and
Programming Languages
Instruction
basic command that tells/instructs computer to do something
Program
set of instructions or command that is arranged in a sequence to guide a
computer to find solution for the given problem
a program when executed causes the computer to behave in a certain pre-
determined manner
contains statements and variables where variable represents various types of
data and statements are instructions
Features of Good Computer Program
1. Accuracy
2. Efficiency
3. Generality
4. Modularity
5. Clarity
6. Simplicity
Programming Languages
the process of developing and implementing computer program to solve a
program is known as computer programming
There are various programming languages used for programming purpose
Programming language helps to give instruction to the computer in a specific
standard way
Standard communication technique between user and computer
Generation of Programming Languages
First Generation(Machine Language)
first generation language
lowest level language
uses strings of 0's and 1's to give instructions and data to computer
instructions are entered through switches
Advantages Disadvantages
code or programs run all operation codes and memory addresses have to be
very fast remembered
no need of compiler or difficult to learn
assembler tough to debug errors
difficult to insert new instructions in already created programs
portability of programs are difficult because architecture of CPU
may be different for different computers
Second Generation(Assembly Language)
more descriptive and user friendly than machine language
uses large number of mnemonics to make programming easier rather than
strings of 1's and 0's as in machine languages
is also machine dependent
sometimes used in kernels and device drivers
Advantages Disadvantages
easier to understand programs are usually long
easier to locate and correct errors it is still complex
can be modified easily is machine dependent
needs assembler(a program to translate assembly
language to machine language)
Third Generation(Procedural Oriented Language)
designed to express the logic or the procedure of program
more programmer friendly
eg. FORTRAN, ALGOL, COBOL - early 3GL
C, C++, Java, C#, Python, Delphi
Advantages Disadvantages
more user friendly have to be translated to machine languages by a
programs are written fast and translator(compiler or interpreter) i.e. extra task
easier to maintain object code generated by translator might be
inefficient as compared to assembly language program
Language Processor and its types
a computer understands instructions in machine code
but it's not practical to write a computer program directly in machine code
the programs written in high level languages are called source code
this program cannot be directly executed by the computer and must be converted
into machine language to be executed, done by language processor
the program after translation into machine code is called object code
The language processors can be of three types:
a. Compiler
b. Assembler
c. Interpreter
Language Processor and its types
a. Compiler
the language processor that reads the complete source program written in high
level language as a whole in one go and translates it into an equivalent program in
machine language
eg. C, C++, C#, Java
source code is translated to object code if it is error free
the errors are specified at the end of compilation with line numbers in case of
presence of errors
Language Processor and its types
b. Assembler
it is used to translate the program written in assembly language into machine code
c. Interpreter
it translates single statement of source code into machine code and executes
immediately before moving on to the next line
if at any line, an error is encountered, interpreter terminates its translating process
directly executes instructions without previously converting them all into object
code or machine code
eg. Perl, Python, Matlab
End of Chapter 1