Prepared by: Pst.
Dahiru Aliyu
LANGUAGES, OPERATING SYSTEM &
SOFTWARE PACKAGES
Introduction
A computer can only do what a programmer asks it to do.
To perform a particular task programmer writes a sequence, called the program.
An instruction command given to the computer to perform a certain specified operation
on the given data.
Now as we know only human languages and computer knows only machine language,
we need some media through which we can communicate with the computer.
So we can complete our desired task. That media is Language.
Languages are tools human can use to communicate with the hardware of a computer
system.
Each language has a systematic method of using symbols of that language.
In English, this method is given by the rules of grammar.
Similarly, the symbols of particular one computer language must also be used as per set
of rules which are known as the “Syntax” of that language, the language which you are
using.
Computer Languages can be classified into three broad categories:
LANGUAGES
MACHINE
LANGUAGES ASSEMBLY HIGH – LEVEL
LANGUAGES LANGUAGES
1
Prepared by: Pst. Dahiru Aliyu
1. WHAT IS MACHINE LANGUAGE?
Computer programs are written using many different computer Languages but the
language which is understood by the computer without translating program is called
machine language.
Machine language is normally written as string of binary 1s and 0s.
A machine language instruction has two-part format.
OPCODE OPARAND
OPERATION CODE OPERATION ADDRESS
The 1st part is the operation code which tells the computer what function to be
performed.
The 2nd part is the operand which tells the computer where to find & store data to be
manipulated.
So each instruction tells the computer what operation to perform & the length & location
of the data field which are involved in the operation.
ADVANTAGES
Programs can be executed immediately upon completion because it doesn’t require any
translation.
Now extra storage space is needed.
Programmer has complete control over the performance of the hardware.
DISADVANTAGE
Tedious to program
Difficult to program
Difficult to modify
2
Prepared by: Pst. Dahiru Aliyu
Time consuming to code
Error prone
Operation codes have to be memorized
Assignment of memory is done by programmer
Time consuming for development
Programs development are machine dependent
Preparation of programs was slow and costly.
2. EXPLAIN ASSEMBLY LANGUAGE.
Assembly language is a language which allows instruction & storage location to be
represented by letters & symbols, instead of number.
A program written in an assembly language is called assembly language program or
symbolic program.
Assembly language was introduced in 1952.
Machine language was tedious to code and errors were expected to arise in bulk.
To solve these problems mnemonic codes and symbolic addresses were developed.
It allows using alphanumeric mnemonic codes instead of numeric code for the
instructions in instruction set. For example, using ADD instead of 1110 or 14 to add.
The storage locations are to be represented in the form of alphanumeric addresses instead
of numeric address.
Format of assembly language is similar to machine language:
MNEMONIC CODE SYMBOLIC ADDRESS
Example of Assembly language instruction:
This instruction adds value of NUM1 to the AX (Accumulator Register).
3
Prepared by: Pst. Dahiru Aliyu
The symbolic language made program writing so much easier for the Programmers but it
must be translated into machine code before being used for operation.
The translation is actually done by a special translating program.
Assembler
Assembler is a special program (translator) which translates symbolic operation codes
into machine codes, and symbolic address is addressed into an actual machine address.
ADVANTAGE
Easier to use, code and understand.
Easier to correct error.
Easier to modify.
No worry about addresses.
Easily relocatable.
Efficiency of machine language.
Can use Macros (Macro is a bunch of instruction referred as a single name)
DISADVANTAGE
Machine depended.
Programs have to be translated before execution.
Translation of programs takes up time.
Knowledge of hardware is required.
Additional storage area needed for the source programs and object code.
Examples of Assembly Language
Microsoft Assembly Language (MASM), Turbo Assembler
3. WRITE A NOTE ON HIGH LEVEL LANGUAGE.
4
Prepared by: Pst. Dahiru Aliyu
The machine language & assembly language requires a good knowledge of internal
structure of computer.
The both languages are machine dependent & it is difficult to solve error.
To remove this limitation, the high level language is introduced.
The high level languages machine independent so it can be easily ported & executed on
any computer.
The high level language programs do not require any knowledge of internal structure of
computer so the programmer concentrate on the logic of problem rather than internal
structure of computer. It enables the programmer to write instructions using English
words & familiar mathematical symbols & expression so the program makes easier to
code & understand.
It requires a translator program to convert high level program into machine language.
Compiler
Compiler is a special program (translator) which translates high level programs into
machine codes.
ADVANTAGES:
Machine independent.
Easier to learn, use and understand.
Easier to correct error.
Easier to maintain.
Less time & efforts.
Easily relocatable.
Program preparation cost is low.
5
Prepared by: Pst. Dahiru Aliyu
Few errors.
DISADVANTAGES:
Less flexible.
Lower efficiency.
Require more time & storage space.
4. SHORT NOTE: ASSEMBLER
A computer can directly execute only machine language programs so the assembly
language program must be converted into its equivalent machine language program
before can be executed.
This translation is done with the help of a translator program which is known as
assembler.
Assembler is a special program (translator) which translates symbolic operation codes
into machine codes, and symbolic address is addressed into an actual machine address.
ASSEMBLY Input Output MACHINE
LANGUAGE ASSEMBLER LANGUAGE
PROGRAM PROGRAM
(Source Program) ONE TO ONE CORRESPONDENCE (Object Program)
As shown in figure that the input to assembler is the assembly language program (source
program) and the output is the machine language program (object program).
Assembler translates each assembly language instruction into equivalent machine
language instruction.
There is one to one correspondence between the assembly language instructions of source
program & the machine language instruction of its equivalent object program.
6
Prepared by: Pst. Dahiru Aliyu
In case of assembly language program the computer not only has to run the program but
also must first run assembler program to translate the original assembly language
program into machine language program.
So the computer has to spend more time in getting desired answer.
5. WRITE A NOTE ON COMPILER
A computer can directly execute only machine language programs.
So the high level language program must be converted into its equivalent machine
language program before can be executed.
This translation is done with the help of a translator program which is known as compiler.
A compiler is a translator program which translates a high level language program into
equivalent machine language program.
The process of translating is shown in below figure:
High level Language Input Output Machine Language
Program COMPILER Program
(Source Program) ONE TO MANY CORRESPONDENCE (Object Program)
As shown in figure that the input to compiler is the high level language program (source
program) and the output is the machine language program (object program).
High level language instructions are macro instructions.
The compiler translates each high level language instruction into set of machine language
instructions rather than a single machine language instruction.
There is one to many correspondence between high level language instructions of source
program into equivalent object program.
During the translation the source program is only translates not executed.
7
Prepared by: Pst. Dahiru Aliyu
A compiler can translates only those source programs which have written in the language
for which compiler is designed.
A compiler can also detect & indicates the syntax errors during the compilation process
but cannot able to detect logical errors.
5. WRITE A NOTE ON INTERPRETER.
An interpreter is another type of translator which is used for translating program
written using high level languages.
It takes one statement of high level language, translates into machine language &
immediately executes the resulting machine language instructions.
The main difference between compiler & interpreter is that compiler can translate the
entire code but not involve in execution.
High level Language Input INTERPRETER (Translate Output Result of Program
Program & Executes statement by Execution
statement)
As shown in figure that the input to an interpreter is a source program & the output is
the result of an execution program.
Interpreter translates & executes a high level language program statement-by statement.
A program statement is reinterpreted every time it is encountered during program
execution.
The main advantage of interpreter is that interpreter makes it easier & faster to correct
programs.
The main disadvantage is that interpreter is slower than compilers when running
a finished program.
8
Prepared by: Pst. Dahiru Aliyu
WHAT IS OPERATING SYSTEM?
An operating system is a software program that provides an interface between user & the
computer and manages thousands of applications.
It’s a collection of system software that co-ordinates between the hardware, provides a
platform for software to run on.
An operating system is an integrated set of programs that the resources (the CPU,
memory, I/O devices etc) of computer system & provides an interface to the user to run
the machine.
The main two primary objective of operating system are:
o Making a computer system convenient to use
o Managing the resources of a computer system
FUNCTION OF OPERATING SYSTEM
1) PROCESS MANAGEMENT
The process management of OS taking care about the creation & deletion of user &
system process, providing mechanism for process synchronization & process
communication.
2) MEMORY MANAGEMENT
The memory management of OS taking care about the allocation & deallocation of
memory space to the various programs in need of this resource.
3) FILE MANAGEMENT
The file management of OS is taking care about the file related activities such as
creation, storing, retrieving, naming, sharing & organization of files.
4) SECURITY
9
Prepared by: Pst. Dahiru Aliyu
The security model of OS protects the resources & information of a computer system
against destruction & unauthorized access.
5) COMMAND INTERPRETATION
This model taking care of interpreting user commands & directing the system resources
to handle the requests.
WHAT IS BATCH OPERATING SYSTEM?
o In Batch operating system, data is collected over a period of time and the processing of
the data is deferred to a later time.
o This approach was used very commonly in the past when punch cards served as data
storage media and is used as input into the computer system for processing.
o In batch processing, the data have first to be captured, normally as a form of source
documents, like time cards, or alternatively, by RJE (Remote Job Entry) where data is
gathered through remote terminals.
o The data will then be transmitted to the computer or the source document will be
physically transported to the data centre where transcription (conversion of source
document data into machine readable form) is performed.
o The data is processed by the computer and the resulting output is given to the users.
o Batch processing is suitable in application where there are large amounts of data and
when the turnaround times are not critical.
o As data are transcribed into machine readable form before submitting for processing, the
speed of processing is therefore determined by the computer and not by the operator.
o Payroll processing is suitable for batch processing as it is only performed on a regular
basis. (for example every month)
10
Prepared by: Pst. Dahiru Aliyu
o ADVANTAGES:
o Less complicated.
o After input process is over, while processing is going on, user can attend other
o jobs.
o DISADVANTAGES:
o Long turnaround time.
o Access to one is not possible.
o Difficult to provide priority scheduling.
o Not convenient for program development.
o 9. EXPLAIN REALTIME OPERATIN SYSTEM.
o Real-Time systems are always on-line but on-line systems need not be real-time
o systems.
o However, further constraints are placed in terms of response time and
o availability of the system.
o By definition, a real time system receive data and process it quickly enough to
o produce output which can be used to control or affect the outcome of an
o ongoing activity of process.
o In general, real-time systems handle small volumes of data at any one time and
o the turnaround time is critical.
o Feedback is essential in real-time systems so that processing can keep pace with
o external factors.
o Most real-time systems are used in mission critical application like process
o control and therefore, reliability and availability is of paramount importance.
o Missile guidance systems are examples of real-time systems.
o Control signals are sent to the fins of the missile to correct any deviations.
o Advantages
o Error messages are immediate
o Source documents are available at the time the error occurs.
o Faster than on-line systems.
o Disadvantages
o Direct access devices have to be used.
o Elaborate controls and backup procedures to guard against unwarranted access
o to the system.
o Control checks are difficult since updating occurs at the time of processing.
11