Introduction, Developing a Program, Algorithm, Flowchart, and Pseudo code (P Code). Introduction, Evolution of Programming Languages, Classification of Programming Languages, Generations of Programming Languages, Features of a Good Programming Language, Selection of a Programming Language. Introduction Software: Definition, Relationship between Software and Hardware, Software Categories, System Software, Application Software, Software Terminology. Introduction, Operating System, Evolution of Operating System, Types of Operating System, Functions of an Operating System, Modern Operating Systems.
1. Introduction to Computer System
Computer Program, Computer Languages,
Computer Software
Prepared By
S.K. Barnwal
Assistant Professor
Arka Jain University
Research Scholar (NIT, Jamshedpur)
2. Objectives
After studying this unit you would be able to understand:
About Computer Program, Computer Languages, Computer
Software
How to Develop a Program,
Algorithm, Flowchart, and Pseudo code (P Code).
Evolution of Programming Languages,
Classification of Programming Languages,
Generations of Programming Languages,
Features of a Good Programming Language,
Selection of a Programming Language.
Relationship between Software and Hardware,
Software Categories, System Software, Application Software,
Software Terminology.
3. Computer Program
A computer program is a sequential set of instructions written using a
Computer Programming Language to perform a special task by the
computer.
There are two important terms used in the above definition are −
Sequential set of instructions
Computer Programming Language
To understand these terms, consider a situation when somebody asks
you about yourself. What exactly you will say?
You will use Human Language to tell about yourself in this way;
First you will tell your name
Then your parents name
Then you belong to and so on…,
Here, you have used English Language (Human Language) to give the
answer of that question in the sequential manner.
4. Computer Program
As there are several languages used by human being, computer
scientists have developed several computer-programming languages to
provide instructions to the computer (i.e., to write computer programs).
Ex; Java, C, C++, Python, PHP, Perl, Ruby etc.
Applications of Computer Program: In current era computer
programs are being used in almost every field, household, agriculture,
medical, entertainment, defense, communication, etc. Listed below are
a few applications of computer programs:
MS Word, MS Excel, Adobe Photoshop, Internet Explorer, Chrome, etc.,
are examples of computer programs.
Computer programs are being used to develop graphics and special effects
in movie making.
Computer programs are being used to perform Ultrasounds, X-Rays, and
other medical examinations.
Computer programs are being used in our mobile phones for SMS, Chat,
and voice communication.
5. Computer Program
Steps used to write the program:
Understand the problem you are trying to solve
Design a solution
Draw a flow chart
Write pseudo-code
Write code
Test and debug
Test with real-world users
Release program
Iterate the steps for the next version
6. Algorithm
Algorithm is a finite sequence of instructions, each of which has a
clear meaning and can be performed with a finite amount of effort
in a finite length of time. No matter what the input values may be,
an algorithm terminates after executing a finite number of
instructions. We represent an algorithm using a pseudo language
that is a combination of the constructs of a programming
language together with informal English statements. The ordered
set of instructions required to solve a problem is known as an
algorithm.
Write a algorithm to find out number is odd or even?
• Ans. step 1 : start
• step 2 : input number
• step 3 : rem=number mod 2
• step 4 : if rem=0
then print "number even“
else
print "number odd"
endif
• step 5 : stop
7. Algorithm
The characteristics of a good algorithm are:
Precision – the steps are precisely stated (defined).
Uniqueness – results of each step are uniquely defined and only depend on
the input and the result of the preceding steps.
Finiteness – the algorithm stops after a finite number of instructions are
executed.
Input – the algorithm receives input.
Output – the algorithm produces output.
Generality – the algorithm applies to a set of inputs.
8. Flowchart
It is a diagrammatic representation of an algorithm very helpful in
writing program and explaining program to others. Different symbols
representing different states in flowchart. All symbols having their own
identifications.
9. Flowchart
Draw a flowchart to add two
numbers entered by user.
Draw flowchart to find the
largest among three different
numbers entered by user.
10. Pseudo Code
It is an artificial and informal language that helps programmers develop
algorithms. It is a "text-based" detail (algorithmic) design tool. The
rules of Pseudo-code are reasonably straightforward. All statements
showing "dependency" are to be indented.
Steps followed to write Pseudo-Code:
Start with the algorithm you are using, and phrase it using words that are
easily transcribed into computer instructions.
Indent when you are enclosing instructions within a loop or a conditional
clause. A loop is a set of instructions that is repeated. A conditional clause
is formed by a comparison and what to do if that comparison succeeds or
fails. This technique makes sure it's easy to read.
Avoid words associated with a certain kind of computer language.
is an informal way of programming description that does not require
any strict programming language syntax or underlying technology
considerations. It is used for creating an outline or a rough draft of a
program. Pseudo-Code summarizes a program's flow, but excludes
underlying details.
11. Computer Language
To communicate with the computers we required some languages
called computer languages. A programming language defines a set of
instructions that are compiled together to perform a specific task by the
CPU (Central Processing Unit).
There are mainly two different languages with the help of which we
can develop computer programs, named as;
Low Level Language: The low-level language is a programming
language that provides no abstraction from the hardware, and it is
represented in 0 or 1 forms, which are the machine instructions. The
languages that come under this category are the Machine level
language and Assembly language.
Machine Level language
Assembly Level Language and
High Level Language
12. Computer Language
Machine Level Language: Only Computers can understand such
language of Digital Electronics that deals with presence and absence of
voltages. Means, it deals with only two values (0 & 1) called Binary Digit.
A machine-level language is not portable as each computer has its machine
instructions, so if we write a program in one computer will no longer be
valid in another computer.
Assembly Level Language: After machine level language, the next level
of development in the evolution of computer languages was the Assembly
Language. Machine level language uses only the binary language. But on
the other hand, assembly language uses mnemonics or symbolic
instructions in place of a sequence of 0s and 1s. Ex; to add register A and
B in a particular computer, assembly language uses the mnemonic ‘ADD
B’ in place of 10001111.
High Level Language: It is the next development in the evolution of
computer languages. It like English-like language, with less words also
known as keywords and fewer ambiguities. Each high level language will
have its own syntax and keywords. The meaning of the word syntax is
grammar. Ex; C, C++, JAVA, Python etc.
13. Evolution of Computer Language
More than 200 years ago invention of the punch-card-programmable
Jacquard loom, was not really a programming language in the modern
sense, there was no computation and no logic, but it started a cascade
to initiate Analytical Engine (a proposed mechanical General Purpose
Computer)
It was a whole 100 years before the first electrical, programmable
computers would burst into existence.
Machine-specific assembly language in the 1940s was probably the
first human-readable programming language.
By the 1950s computer engineers realized that assembly language was
far too laborious and error-prone to build entire systems out of date.
In 1955 the first modern programming language was born: FORTRAN
(FORmula TRANslator). LISP (LISt Processor), ALGOL
(ALGOrithmic Language), and COBOL (COmmon Business Oriented
Language).
By 1964, BASIC had been invented, and then C was released in 1969.
14. Evolution of Computer Language
PASCAL: 1970
C++: 1983
PEARL: 1987
PYTHON: 1991
RUBY: 1993
PHP: 1995
JAVA: 1995
JAVASCRIPT: 1995
RUBY ON RAILS: 2005
15. Language Translators
These are the programs that converts the programs in one language into
machine language instructions, so that they can be executed by the
computer.
Compiler: It is a program which is used to convert the high level
language programs into machine language
Assembler: It is a program which is used to convert the assembly
level language programs into machine language
Interpreter: It is a program, it takes one statement of a high level
language program, translates it into machine language instruction
and then immediately executes the resulting machine language
instruction and so on.
16. Computer Software
The system software is a collection of programs designed to operate,
control, and extend the processing capabilities of the computer itself.
It is programming code executed on a computer processor.
There are two types of software −
System Software: The system software is a collection of programs
designed to operate, control, and extend the processing capabilities
of the computer itself. System software is generally prepared by the
computer manufacturers written in low-level languages interact with
the hardware at a very basic level. System software serves as the
interface between the hardware and the end users. Ex; Operating
System, Compilers, Interpreter, Assemblers, etc.
Features of a System Software −
Close to the system, Fast in speed, Difficult to design, Tough to
understand, Less interactive, Smaller in size, Difficult to manipulate,
Generally written in low-level language
17. Computer Software
Application Software: It is designed to satisfy a particular need of a
particular environment. Application software may consist of a single
program, such as Microsoft's word used for writing and editing any
kind of document. It may also consist of a collection of programs, often
called a software package, which work together to accomplish a task,
such as a spreadsheet package.
Ex; Scanner, Student Record Software, Inventory Management
Software, Income Tax Software, Railways Reservation Software,
Microsoft Word-Excel-PowerPoint, Libguru
Features of Application Software −
Close to the user, Easy to design, More interactive, Slow in speed,
Generally written in high-level language, Easy to understand, Easy to
manipulate and use, Bigger in size and requires large storage space
18. Operating System
The operating system provides services such as a user interface, file
and database access, and interfaces to communication systems such as
Internet protocols. The primary purpose of this software is to keep the
system operating in an efficient manner while allowing the users access
to the system. It is a program with the following features −
• It is a program that acts as an interface between the software and the
computer hardware.
• It is an integrated set of specialized programs used to manage overall
resources and operations of the computer.
• It is a specialized software that controls and monitors the execution of all
other programs that reside in the computer, including application programs
and other system software.
19. Operating System
OS provides link between users and system.
SOFTWARE
APPLICATION
SOFTWARE
SYSTEM
SOFTWARE
OPERATING SYSTEM
HARDWARE CPU RAM I/O
USER-1 USER-2 USER-N
20. Operating System
Objectives of Operating System
• To make the computer system convenient to use in an efficient manner.
• To hide the details of the hardware resources from the users.
• To provide users a convenient interface to use the computer system.
• To act as an intermediary between the hardware and its users, making it
easier for the users to access and use other resources.
• To manage the resources of a computer system.
• To keep track of who is using which resource, granting resource requests,
and mediating conflicting requests from different programs and users.
• To provide efficient and fair sharing of resources among users and
programs.
Features of OS:
• Memory Management − Keeps track of the primary memory, i.e. what
part of it is in use by whom, what part is not in use, etc. and allocates the
memory when a process or program requests it.
• Processor Management − Allocates the processor (CPU) to a process
and de-allocates the processor when it is no longer required.
21. Operating System
• File Management − Allocates and de-allocates the resources and decides
who gets the resources.
• Device Management − Keeps track of all the devices. This is also called
I/O controller that decides which process gets the device, when, and for
how much time
• Security − Prevents unauthorized access to programs and data by means
of passwords and other similar techniques.
• Job Accounting − Keeps track of time and resources used by various
jobs and/or users.
• Control Over System Performance − Records delays between the
request for a service and from the system.
• Interaction with the Operators − Interaction may take place via the
console of the computer in the form of instructions. The Operating
System acknowledges the same, does the corresponding action, and
informs the operation by a display screen.
• Error-detecting Aids − Production of dumps, traces, error messages, and
other debugging and error-detecting methods.
• Coordination Between Other Software and Users − Coordination and
assignment of compilers, interpreters, assemblers, and other software to
the various users of the computer systems.
22. Evolution of Operating System
Operating systems have evolved from slow and expensive systems to
present-day technology where computing power has reached
exponential speeds and relatively inexpensive costs.
In the beginning, computers were manually loaded with program code
to control computer functions and process code related to business
logic. This type of computing introduced problems with program
scheduling and setup time. As more users demanded increased
computer time and resources, computer scientists determined they
needed a system to improve convenience, efficiency, and growth
(Stallings, 2009, p. 51). As a result, they created an operating system
(OS) to process jobs in batches.
Later they created Multitasking and Time-Sharing to run multiple jobs
and allow user interaction to improve efficiency. Multitasking brought
challenges to manage I/O operations required by multiple jobs in which
computer vendors resolved with interrupts.
23. Evolution of Operating System
The first operating system used for real work was GM-NAA I/O,
produced in 1956 by General Motors' Research division for its IBM
704.
The inventor of Disk Operating System(DOS) Gary Kildall. Before
his invention, every computer chip needed to have its own set of codes
for users to interact with the computer.
An operating system has three main functions: (1) manage the
computer's resources, such as the central processing unit, memory, disk
drives, and printers, (2) establish a user interface, and (3) execute and
provide services for applications software.
• Early Systems(1950)
• Simple Batch System(1960)
• Multiprogrammed Batch system (1970)
• Time-Sharing & Real –Time System (1970)
• Personal/Desktop Computers (1980)
• Network/Distributed System (1980)
• Web-based Systems (1990)
24. Operating System
Types of Operating System (OS)
• 1. Batch Operating System
• 2. Time-Sharing Operating Systems
• 3. Distributed Operating System –
• 4. Network Operating System –
• 5. Real-Time Operating System –
1. Batch Operating System: This type of operating system does not
interact with the computer directly. There is an operator which
takes similar jobs having same requirement and group them into
batches. It is the responsibility of operator to sort the jobs with
similar needs.
25. Operating System
Ex; Payroll System, Bank Statements etc
Advantages:
• It is very difficult to guess or know the time required by any job to complete.
Processors of the batch systems know how long the job would be when it is in queue
• Multiple users can share the batch systems
• The idle time for batch system is very less
• It is easy to manage large work repeatedly in batch systems
Disadvantages:
• The computer operators should be well known with batch systems
• Batch systems are hard to debug
• It is sometime costly
• The other jobs will have to wait for an unknown time if any job fails
2. Time-Sharing Operating Systems –Each task is given some time to
execute, so that all the tasks work smoothly. Each user gets time of CPU as
they use single system. These systems are also known as Multitasking
Systems. The task can be from single user or from different users also. The
time that each task gets to execute is called quantum. After this time interval
is over OS switches over to next task.
26. Operating System
Ex; Multics, Unix etc.
Advantages:
• Each task gets an equal opportunity
• Less chances of duplication of software
• CPU idle time can be reduced
Disadvantages:
• Reliability problem
• Issue of security and integrity of user programs and data
• Data communication problem
27. Operating system
3. Distributed Operating System:Various autonomous interconnected
computers communicate each other using a shared communication
network. Independent systems possess their own memory unit and
CPU. These are referred as loosely coupled systems or distributed
systems. These types of operating system is a recent advancement in
the world of computer technology and are being widely accepted all-
over the world and, that too, with a great pace. These system’s
processors differ in size and function, benefit of working with these
types of operating system is that it is always possible that one user can
access the files or software which are not actually present on his system
but on some other system connected within this network i.e., remote
access is enabled within the devices connected in that network.
Disadvantages:
• Failure of the main network will stop the entire communication
• the language used in such systems are not well defined yet
• very expensive
• software is highly complex and not understood well
28. Operating System
Advantages:
• Failure of one will not affect the other network communication because all
systems are independent from each other
• Electronic mail increases the data exchange speed
• computation is highly fast and durable
• Load on host computer reduces
• These systems are easily scalable
• Delay in data processing reduces
29. Operating System
Network Operating System: The systems run on a server and provide
the capability to manage data, users, groups, security, applications, and
other networking functions. Such types of operating systems allow
shared access of files, printers, security, applications, and other
networking functions over a small private network. One more
important feature of Network Operating Systems is that all the users
are well aware of the underlying configuration, of all other users within
the network, their individual connections etc. and that’s why these
computers are popularly known as tightly coupled systems.
Ex; Microsoft Windows Server 2003, Microsoft Windows Server 2008,
UNIX, Linux, Mac OS X, Novell NetWare, and BSD.
Disadvantages:
• High cost of buying and running a server.
• Dependency on a central location for most operations.
• Regular maintenance and updates are required.
30. Operating System
Advantages:
• Centralized servers are highly stable.
• Security is server managed.
• Upgrades to new technologies
• Hardware can be easily integrated into the system.
• Remote access to servers is possible from different locations and types of
systems.
31. Operating System
5. Real-Time Operating System: Operating System that serves the
real-time systems. The time interval required to process and respond to
inputs is very small. This time interval is called response time. RTOS
are used when there are time requirements are very strict like missile
systems, air traffic control systems, robots etc.
There are 2 types of RTOS:
Hard Real-Time Systems: Where time constraints are very strict and
even the shortest possible delay is not acceptable, such systems are
built for saving life like automatic parachutes or air bags which are
required to be readily available in case of any accident. Virtual memory
is almost never found in these systems.
Soft Real-Time Systems: These OSs are for applications where for
time-constraint is less strict. It is less restrictive. A critical real-time
task gets priority over other tasks and retains the priority until it
completes. Soft RTOS have limited utility than hard RTOS. Ex;
multimedia, virtual reality, Advanced Scientific Projects like undersea
exploration and planetary rovers, etc.
32. Operating System
Ex; Scientific experiments, medical imaging systems, industrial control
systems, weapon systems, robots, air traffic control systems, etc.
Advantages of RTOS:
• Maximum Consumption: Maximum utilization of devices and system,thus
more output from all the resources
• Task Shifting: Time assigned for shifting tasks in these systems are very
less. For example in older systems it takes about 10 micro seconds in
shifting one task to another and in latest systems it takes 3 micro seconds.
• Focus on Application: Focus on running applications and less importance
to applications which are in queue.
• Real time operating system in embedded system: Since size of programs
are small, RTOS can also be used in embedded systems like in transport
and others.
• Error Free: These types of systems are error free.
• Memory Allocation: Memory allocation is best managed in these type of
systems.
33. Operating System
Disadvantages of RTOS:
• Limited Tasks: Very few tasks run at the same time and their concentration
is very less on few applications to avoid errors.
• Use heavy system resources: Sometimes the system resources are not so
good and they are expensive as well.
• Complex Algorithms: The algorithms are very complex and difficult for
the designer to write on.
• Device driver and interrupt signals: It needs specific device drivers and
interrupt signals to response earliest to interrupts.
• Thread Priority: It is not good to set thread priority as these systems are
very less prone to switching tasks.