0% found this document useful (0 votes)
18 views6 pages

Fundamentals of Computer Langua6ges

Uploaded by

Sadhik Vs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views6 pages

Fundamentals of Computer Langua6ges

Uploaded by

Sadhik Vs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

COMPUTER SOFTWARE

A sequence of instructions, written in a language, which can be understood by a


computer is called a computer program. The term software refers to the set of computer
programs, procedures and associated documents (flowcharts, manuals etc) which describe the
programs and how they are to be used. The objective of these programs is to enhance the
capabilities of hardware (hardware refers to the physical devices of a computer system). A
software package is a group of programs which solve a specific problem or perform a specific
type of job. E.g. a word processing package may contain programs for text editing, text
formatting, drawing graphics, spelling checking etc.

TYPES OF SOFTWARE
1. System software
2. Application software
System software is a set of one or more programs designed to control the operation and
extend the processing capability of a computer system. In general, a computer’s system
software performs one or more of the following functions:
i) Supports the development/execution of other software
ii) Monitors the effective use of various hardware resources
such as CPU, memory, peripherals etc.
iii) Communicates and controls the operation of peripheral
devices such as printer, disk, tape etc.
Common types of system softwares are: a) Operating system
b) Programming language translators
c) Communication softwares
d) Utility programs
Application Software is a set of one or more programs, designed to solve a specific
problem or to do a specific task. Some of the commonly known application softwares are
i) word processing softwares
ii) spreadsheet software
iii) Data base software
iv) Graphics software
v) Personal Assistance software
vi) Education software
vii) Entertainment software

LOGICAL SYSTEM ARCHITECTURE

The architecture basically shows the relationship among the hardware, system software,
application software and users of a computer system. The center of any computer system is the
hardware, which comprises of the physical devices/components of the computer system.
Surrounding the hardware is the system software layer which constitutes the operating and
programming environment of the computer system. Application software layer consists a wide
range of software which are designed to do a specific task or solve a specific problem. The final
layer is the layer of users who normally interact with the system via the user interface provided
by the application software.
HARDWARE

SYSTEM SOFTWARE

APPLICATION SOFTWARE

USERS

Firm Ware: Computer software in conventional systems is supplied on storage medias like
CDs, floppies, tapes, disks etc. However with the advancement in technology and reduction in
hardware cost, today, software is also being made available by many computer manufacturers
on read-only memory (ROM) chips. These ROM chips can be easily plugged into the computer
system and they form a part of the hardware. Such programs (software) which are, made
available on hardware are known as firmware.

PROGRAM PLANNING

ALGORITHM: The term algorithm is used to refer the logic of a program. It is defined as a
sequence of instructions designed in a manner that, if these instructions are executed in the
specific sequence, the desired result will be obtained. An algorithm must posses the following
characteristics:-
1. Each and every instruction should be precise and unambiguous.
2. Each instruction should be such that it can be performed in a finite time.
3. One or more instructions should not be repeated infinitely – to ensure that the algorithm
will ultimately terminate.
4. After the algorithm terminates, the desired result must be obtained.
Example 1:-
50 students in a class appeared in a final exam. Their mark sheets have been given to you. The
division column of the mark sheet contains the division (FIRST, SECOND, THIRD or FAIL)
obtained by the student. Write an algorithm to calculate and print the total number of students
who passed in FIRST division.
Algorithm:
Step 1: Initialize Total_First_Division and Total_Marksheets_Checked to Zero
Step 2: Take the mark sheet of the next student.
Step 3: Check the division column of the mark sheet to see if it is FIRST. If no, go to Step 5.
Step 4: Add 1 to Total_First_Division.
Step 5: Add 1 to Total_Marksheets_Checked.
Step 6: Is Total_Marksheets_Checked = 50? If no, go to Step 2.
Step 7: Print Total_First_Division
Step 8: Stop.

Example 2:-
There are 100 employees in an organization. The organization wants to distribute annual bonus
to the employees based on their performance. The performance of the employees is recorded
in their annual appraisal forms. Every employee’s appraisal form contains his/her basic salary
and the grade of his/her performance during the year. The grade is of three categories – ‘A’ for
outstanding, ‘B’ for good, and ‘C’ for average performance. It has been decided that the bonus
of an employee will be 100% of the basic salary for outstanding performance, 70% of the basic
salary for good performance, 40% of the basic salary for average performance and zero for all
other cases. Write an algorithm to calculate and print the total bonus amount to be distributed
by the organization.

Algorithm:
Step 1: Initialize Total_Bonus and Total_Employees_Checked to Zero.
Step 2: Initialize Bonus and Basic_Salary to Zero.
Step 3: Take the appraisal form of the next employee.
Step 4: Read the employee’s Basic_Salary and Grade.
Step 5: If Grade=A, then Bonus=Basic_Salary. Go to Step 8.
Step 6: If Grade=B, then Bonus=Basic_Salary* 0.7. Go to Step 8.
Step 7: If Grade=C, then Bonus=Basic_Salary*0.4.
Step 8: Add Bonus to Total_Bonus.
Step 9: Add 1 to Total_Employees_Checked.
Step 10: If Total_Employees_Checked < 100, then go to Step 3.
Step 11: Print Total_Bonus
Step 12: Stop.

Representation of Algorithms
There are various ways to represent an algorithm:
1. As programs
2. As flowcharts
3. As pseudocodes

FLOWCHARTS: A flowchart is a pictorial representation of an algorithm – used as a


program planning tool. It uses boxes of different shapes to denote different types of
instructions. The actual instructions are written within these boxes. These boxes are connected
by solid lines having arrow marks to indicate the flow of operation.
Advantages:- i) While drawing a flowchart, a programmer is not concerned with the details of
the elements of programming language. Hence, he/she can fully concentrate
on the logic of the procedure.
ii) Since a flowchart shows the flow of operations in pictorial form, any error in
the logic of the procedure can be easily detected.

Flowchart symbols: The basic flowchart symbols have been standardized by the American
National Standards Institute (ANSI).

Terminal Input/Output Processing

Decision Flow lines Connectors

COMPUTER LANGUAGES
All computer languages can be broadly classified into the following three categories:-
1. Machine Language
2. Assembly Language
3. High-level Language

Machine Language:- It is the only language understood by the computer without using a
translator program – normally written as strings of binary 1s and 0s. A machine language
instruction normally has a two-part format: first part is the operation code (opcode), which tells
the computer what function to perform and the second part is the operand, which tells the
computer where to find or store the data or other instructions, which are to be manipulated.

OPCODE OPERAND
(Operation code) (Address/Location)

For example:- A typical program instruction to print out a number on the printer might be:
101100111111010011101100
Typical operations included in the instruction set of a computer are as follows:
i) Arithmetic operations ii) logical operations iii) Branch operations iv) Data movement
operations – between memory locations and registers OR from/to one of the computer’s I/O
devices
Since human programmers are more familiar with the decimal number system, most of them
will prefer to write the computer instructions in decimal and leave the input device to convert
these to binary. This set of instructions, whether in binary or decimal, which can be directly
understood by a computer without the help of a translating program is called a machine code
or machine language program.

Advantages and Limitations of Machine Languages:


1. Machine dependent: Because the internal design of every computer is different from
every other type of computer, the machine language also differs from computer to
computer – so programmers will have to learn the new language and to rewrite all the
existing programs.
2. Difficult to program
3. Error prone
4. Difficult to modify

Assembly Language:- Allows instructions and storage locations to be represented by


letters and symbols, instead of numbers.
It uses alphanumeric mnemonic codes, instead of numeric codes for the instructions. For
example: using ADD instead of 1110 (binary) or 14 (decimal) for the instruction to add, using
SUB instead of 1111 (binary) or 15 (decimal) for the instruction to subtract and so on.
Therefore instructions can be easily remembered.
Storage locations can also be represented in the form of alphanumeric address, instead
of numeric addresses. For example: the memory locations 1000, 1001 and 1002 may be
represented as FRST, SCND and ANSR respectively, in an assembly language program.
Therefore programmers can easily remember and use the storage locations of the data and
instructions used.
Assembly language provides additional instructions called pseudo instructions, which are
used for instructing the system how we want the program to be assembled inside the
computer’s memory.

Assembler: A computer can directly execute only machine language programs. An assembler is
a system software, supplied by the computer manufacturer, which translates an assembly
language program (source program) into an equivalent machine language program (object
program).
Input Output

Assembler
Assembly language program Machine language program

(Source program) one-to-one correspondence (Object program)

Since an assembler translates each assembly language instruction into an equivalent machine
language instruction, there is a one-to-one correspondence between them.

Advantages of Assembly language over Machine language


i) Easier to understand and use
ii) Easier to locate and correct errors
iii) Easier to modify
iv) No worry about addresses
v) Easily relocatable
vi) Enjoys the efficiency of its corresponding machine language program.

Limitations of Assembly language


i) Machine dependant
ii) Knowledge of hardware required
iii) Machine level coding - hence time consuming and not very easy

High Level Language: They are machine independent programmes written using English
words and familiar mathematical symbols and expressions. Programmers are not required to
know the internal structure of the computer.

Compiler: It is a translator program (much more sophisticated than an assembler) which


translates a high level language (source program) into its equivalent machine language
program (object program). They are large programs reside permanently on secondary storage.

Input Output
Compiler
High-level language program Machine language program

(Source program) one-to-many correspondence (Object program)

Since high-level language instructions are macro instructions, the compiler translates each high-
level language instructions into a set of machine language instruction, rather than a single
machine language instruction. Hence there is a one-to-many correspondence between them.

Note: A compiler can translate only those source programs meant for it. i.e. a FORTRAN
compiler can translate source programs written in FORTRAN only. To execute both FORTRAN
and COBOL programs on a computer, the computer must have a FORTRAN compiler and a
COBOL compiler.

In addition to translation, compilers can automatically detect and indicate certain types of
errors in source programs. These errors are referred to as syntax errors e.g. illegal characters,
illegal combination of characters, improper sequencing of instructions in a program, use of
undefined variable names. Compilers cannot detect logic errors.

Interpreter: An interpreter is another type of translator which is used for translating programs
written in high level languages. It takes only one statement at a time, translates it into machine
language instruction and immediately executes the resulting machine language instruction.
Where as a compiler translates the entire source program into an object program

You might also like