notes1software
notes1software
To take an analogy, a cassette player and its cassettes purchased from the
market as hardware. Hence, the songs recorded on the cassettes are its
software. listen to a song, that song has to be recorded on one of the cassettes
first, which is then mounted on the cassette player and played. Similarly, to
get a job done by a computer, the corresponding software has to be loaded in
the hardware first and then executed. Following important points regarding
the relationship between the hardware and software are brought out by this
analogy:
1-Both hardware and software are necessary for a computer to do useful jobs.
Both are complementary to each other.
2-Same hardware can be loaded with different software to make a computer
perform different types of jobs just as different songs can by played using the
same cassette player.
3-Except for upgrades (like increasing main memory and hard disk
capacities, or adding speakers and moderns, etc) hardware is normally a one-
time expense whereas software is a continuing expense. Like we buy new
cassettes for newly released songs or for songs whose cassettes, we do not.
have, we buy, new software to be run on the same hardware as and when need
arises or funds become available.
Computer Language
A programming language is a formal constructed language designed to
communicate instructions to a machine, particularly a computer.
Programming languages can be used to create programs to control the
behavior of a machine or to express algorithms.
Machine Language
In machine language program, the computation is based on binary numbers.
All the instructions including operations, registers, data and memory locations
are given in there binary equivalent. The machine directly understands this
language by virtue of its circuitry design so these programs are directly
executable on the computer without any translations. This makes the program
execution very fast. Machine languages are also known as first generation
languages.
• An Operation Part:
Specifies operation to be performed by the computer, also known as Opcode.
Advantages
Machine language makes most efficient use of computer system resources like
storage, registers, etc. the instruction of a machine language program are
directly executable so there is no need of translators. Machine language
instruction can be used to manipulate the individual bits in a computer system
with high execution speed due to direct manipulation of memory and registers.
Drawbacks
Machine languages are machine dependent and, therefore, programs are not
portable from one computer to other. Programming in machine language
usually results in poor programmer productivity. Machine languages require
programmers to control the use of each register computer’s Arithmetic Logic
Unit and computer storage locations in the must be addressed directly, not
symbolically. Machine language requires a high level of programming skill
which increases programmer training costs. Programs written in machine
language are more error prone and difficult to debug because it is very difficult
to remember all binary equivalent of register, opcode, memory location, etc.
program size is comparatively very big due to non-use of reusable codes and
use of very basic operations to do a complex computation.
Assembly Language
Assembly language is also known as second generation languages. These
languages substitutes alphabetic or numeric symbols for the binary codes of
machine language. That is, we can use mnemonics for all opcodes, registers
and for the memory locations which provide us with a facility to write reusable
code in the form of macros. Has two parts, one is macro name and the other
is macro body which contains the line of instructions. A macro can be called
at any point of the program by its name to use the instruction. A macro can be
called at any point of the program by its name to use the instructions given in
the macro repetitively.
Advantages
Drawbacks
Assembly language programs are not directly executable due to the need of
translation. Also, these languages are machine dependent and, therefore, not
portable from one machine to another. Programming in assembly language
requires a high level of programming skills and knowledge of computer
architecture of the particular machine.
Procedures
Procedures are the reusable code which can be called at any point of the
program. Each procedure is defined by a name and set of instructions
accomplishing a particular task.
The procedure can be called by its name with the list of required parameters
which should pass to tat procedure.
Advantages of High Level Languages
These are the third generation languages. These are procedure-oriented
languages and are machine independent. Programs are written in English like
statements. As high level languages are not directly executable,
translators(compilers and interpreters) are used to convert them in machine
language equivalent.
Advantages
Assembler:
A computer will not understand any program written in a language, other than
its machine language. The programs written in other languages must be
translated into the machine language. Such translation is performed with the
help of software. A program which translates an assembly language program
into a machine language program is called an assembler. If an assembler
which runs on a computer and produces the machine codes for the same
computer then it is called self assembler or resident assembler. If an assembler
that runs on a computer and produces the machine codes for other computer
then it is called Cross Assembler.
Assemblers are further divided into two types: One Pass Assembler and Two
Pass Assembler. One pass assembler is the assembler which assigns the
memory addresses to the variables and translates the source code into machine
code in the first pass simultaneously. A Two Pass Assembler is the assembler
which reads the source code twice. In the first pass, it reads all the variables
and assigns them memory addresses. In the second pass, it reads the source
code and translates the code into object code.
Compiler:
It is a program which translates a high level language program into a machine
language program. A compiler is more intelligent than an assembler. It checks
all kinds of limits, ranges, errors etc. But its program run time is more and
occupies a larger part of the memory. It has slow speed. Because a compiler
goes through the entire program and then translates the entire program into
machine codes. If a compiler runs on a computer and produces the machine
codes for the same computer then it is known as a self compiler or resident
compiler. On the other hand, if a compiler runs on a computer and produces
the machine codes for other computer then it is known as a cross compiler. .
Interpreter:
An interpreter is a program which translates statements of a program into
machine code. It translates only one statement of the program at a time. It
reads only one statement of program, translates it and executes it. Then it reads
the next statement of the program again translates it and executes it. In this
way it proceeds further till all the statements are translated and executed. On
the other hand, a compiler goes through the entire program and then translates
the entire program into machine codes. A compiler is 5 to 25 times faster than
an interpreter.
By the compiler, the machine codes are saved permanently for future
reference. On the other hand, the machine codes produced by interpreter are
not saved. An interpreter is a small program as compared to compiler. It
occupies less memory space, so it can be used in a smaller system which has
limited memory space.
Linker:
In high level languages, some built in header files or libraries are stored. These
libraries are predefined and these contain basic functions which are essential
for executing the program. These functions are linked to the libraries by a
program called Linker. If linker does not find a library of a function then it
informs to compiler and then compiler generates an error. The compiler
automatically invokes the linker as the last step in compiling a program. Not
built in libraries, it also links the user defined functions to the user defined
libraries. Usually a longer program is divided into smaller subprograms called
modules. And these modules must be combined to execute the program. The
process of combining the modules is done by the linker.
Loader:
Loader is a program that loads machine codes of a program into the system
memory. In Computing, a loader is the part of an Operating System that is
responsible for loading programs. It is one of the essential stages in the process
of starting a program. Because it places programs into memory and prepares
them for execution. Loading a program involves reading the contents of
executable file into memory. Once loading is complete, the operating system
starts the program by passing control to the loaded program code. All
operating systems that support program loading have loaders. In many
operating systems the loader is permanently resident in memory.
There are some popular high-level programming languages, while there are
others that could not become so popular in-spite of being very powerful. There
might be reasons for the success of a language but one obvious reason is its
characteristics. Several characteristics believed to be important for making it
good:
A good programming language must be simple and easy to learn and use. It
should provide a programmer with a clear, simple and unified set of concepts
that can be grasped easily. The overall simplicity of a this strongly affects the
readability of the programs written in that language and programs that are
easier to read and understand are easier to maintain. It is also easy to develop
and implement a compiler or an interpreter for a simple language. However,
the power needed for the language should not be sacrificed for simplicity. For
Example, BASIC is liked by many programmers because of its simplicity.