Computer Science Reference Note Class 11

Download as pdf or txt
Download as pdf or txt
You are on page 1of 187

Computer Science Reference Note Grade-XI

Introduction of Computer

The word "Computer" is derived from the Latin word "Computare" which means 'to calculate'.
Nowadays, computer has become an indispensable part of our life. Computer is used in various
places like: home, school, college, offices etc. Computer can perform complex mathematical
calculations accurately in a short period of time. The modern computer has lots of capabilities
like creating documents, videos, games, music presentation, etc. It can use AI (Artificial
Intelligence) for understanding natural language, taking self-decision capabilities, analyzing
graphs and patterns, etc.

 Computer is a multi-tasking programmable electronic machine which performs the


calculations and processes information with astonishing speed.

Characteristics of computer
Every computer has certain common characteristics irrespective of their type and size. The
computer is not just adding machines; they are capable of doing complex activities and
operations. They can be programmed to do complex, tedious and monotonous tasks.
Computers are what they are because of the following characteristics:
i.) Word length
A digital computer operates on binary digits i.e 0 and 1. It can understand information only in
terms of 0s and 1s. A binary digit is called a bit. a group of 8 bits is called a byte. The number of
bits that a computer can process at a time in parallel is called its word length. Commonly used
word length are 8,16,32 or 64 bits. Word length is the major of the computing power of a
computer. When we talk of a 32-bit computer, it means that it's word length is 32 bits.
ii.) Speed
The calculation in the computer is at very high speeds. For example, a micro computer can
perform millions of instructions per second as many times without any mistake. The speed
increases, as the power of computer increase. For example, a super computer can operate at
speed measures on nanoseconds and even picosecond.
iii.) Storage
The computer has main memory and auxiliary memory. The computer can store a large amount
of data. With more and more auxiliary storage devices, which are capable of storing huge
amounts of the data, the storage capacity of a computer is virtually unlimited. The reason that
makes computer storage unique is not that it can store huge amount of data, but the fact that it
can retrieve the information that the user wants in a few seconds. For example, computer
dictionaries are available and the contents of this software version are the same as that of the
printed dictionary.
Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

iv.) Accuracy
The accuracy of a computer is very high unless the input is given correctly. In most cases, the
error is because of human factor rather that technology mistake. For example, if the person
input wrong code or the data is corrupted,the processing result is also wrong or corrupted. So if
wrong input is given, the output also will be wrong- GIGO (Garbage In Garbage Out)
v.) Versatility
Computers can perform activities ranging from simple calculation like arithmetic calculation, to
a complex calculation like launching a missile, which it makes a computer a versatile machine.
some application area of computers like a business, bank medical diagnosis, science and
technology,communication and astronomy, so it is a versatile machine.
vi.) Diligence
Diligence means being constant and determined in effort and application. The computer can
perform the repetitive task without being a bore and it never gets tired. It can work
continuously for several hour or day without getting bored and tired. Unlike human beings, a
computer is free from tiredness, weakness, lack of concentration and monotony. Computers
can perform activities ranging from simple calculation like arithmetic calculation, to a complex
calculation like launching a missile, which it makes a computer a versatile machine.
vii.) Automation
A computer is an automatic machine, capable of functioning automatically once they are an
appropriate set of instruction and data provided to the computer. Once the task is initiated on a
computer it can proceed continuously. The computer can be programmed to perform a series of
a task involving multiple programs. Computers are capable of these levels of automation if the
instruction is provided correctly.
viii.) Reliability
Computers are used widely as they are reliable. The computer never gives the wrong result as
long as the input is given correctly. The probability of error in the computer is negligible. A Huge
amount of verities of data like monetary transaction, banking account, personal information is
stored in a computer with the strong reliability to the computer.
The computer has become an integral part of our lives and is helping us in improving the
standard living, enhancing the quality products, providing better healthcare, assisting in
teaching and learning and other however computer have many limitations like lack of
intelligence, lack of reasoning capabilities and other.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Advantages and disadvantages of computer


Advantages

1. The computer can perform a complex operation in a short time.


2. The computer can process a large volume of data.
3. Computer can work continuously for a long time
4. A single computer can perform multiple tasks such as watching a movie, playing games,
listening song and others.
5. The computer does not make a mistake.
6. Computer increases the curricular performance of the student.

Disadvantages

1. The computer does not have a brain and cannot decide itself.
2. It does not have its own intelligence.
3. The computer does not have emotion and feelings.
4. It needs electricity to operate.
5. It cannot operate itself, unless, a human command is given.

GENERATIONS OF COMPUTERS
Computer generations classification is mainly based on the basic devices used. Also, the
considerations are the architecture, languages, modes of operation, etc. The function
performed by the computer and the speed of their operations have been changing since the old
days to the most modern computer. Based on the period of development and the features
incorporated, the computers are classified into different generations- First generation to Fifth
generation. This is called the computer generation.
The classification and time periods are given below:

1. First Generation Computer (1945-1955)


2. Second Generation Computer (1957-1963)
3. Third Generation Computer (1964-1971)
4. Fourth Generation Computer (1972 onward)
5. Fifth Generation Computer (Present and future)

1.) First Generation Computer (1945-1955)

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Fig: First Generation Computer


First generation computers were characterized by the fact that operating instructions were
made to order for the specific task for which the computer was to be used. It was operated on
the ' Principle of Thermionic Emission".
In the first generation computer, vacuum tubes as CPU, magnetic drum for data storage , and
machines languages were used for giving instruction.The computer of this generation was very
large in size called room-sized computers.
The programming of first generation computers was done in machine languages (0s and 1s).
Afterward, assembly languages were developed and used in first generation computer.

Features of first generation computers:

 Technology used: vacuum tube


 Machines languages were used to instruct the computer.
 Magnetic core memory was used as primary memory.
 Electrostatic tubes, Parer tape, punch card, magnetic tape
 Punched card, printing devices were used for input/output operations and store the
result.
 It occupies very large space, slow processing, inefficient and unreliable due to low
accuracy.
 Power consumption was very high and it generated much heat.
 It could only perform straight forward simple numerical calculation.
 Computer used to be much expensive.

The example of first generation computers is ENIAC, UNIVAC,EDVAC, and EDSAC.


2.) Second Generation Computer (1957-1963)
Second generation computer replaced machine language with assembly language, allowing
abbreviated programming codes to replace long, difficult binary codes.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Fig: Second Generation Computer


The transistor was developed in this generation. A transistor transfers electric signals across a
resistor. A transistor was highly reliable compared to tubes.
The transistor was far more superior in performance on account of their miniature size, smaller
power consumption, and heat production rate. The second generation computer used these
semiconductor devices.

Some of its features are:

 Technology used: Transistor


 Operating speed was in terms of a microsecond.
 Assembly language and machines independent language such as COBOL (Common
Business Oriented Language) and FORTRAN (Formula Translation) were introduced the
size of the computer.
 Magnetic core memory was used as primary memory.
 Magnetic drum and magnetic tape were used as secondary memory.
 Power required to operate them was low.
 It could perform scientific calculation such as solving differential equations.
 Storage capacity and use of computers are increased.

3.) Third Generation Computer (1964-1971)


Transistors were an improvement over the vacuum tube, but they still generated a great heat,
which damaged the computer's sensitive parts. The quartz eliminated this problem.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Fig: Third Generation Computer


Transistors were replaced with an integrated circuit known popularly as chips. Scientist
managed to fit many components on a single chip. As a result, the computer became ever
smaller as more components were squeezed on the chip.
IC was first designed and fabricated by Jack S Kilby at Texas Instrument and by Robert S Noyce
at Fairchild independently. IC is a circuit consisting of a large number of electronic components
placed on a single silicon chip by a photo-lithographic process.
Magnetic disks began to replace magnetic tape for auxiliary and video display terminals were
introduced for the output of data. Keyboards were used for the input of data. A new operating
system was introduced for automatic processing and multi-programming.
These computers were highly reliable, relatively expensive and faster. High-level programming
languages continued to be a developer. The example of third generation computers is IBM-360
series, ICL-900 series, and Honeywell 200 series.
Features of the third generation computers are:

 The technology used: IC (Integrated Circuit).


 Transistors were replaced by IC in their electronic circuitry.
 High-level languages like FORTAN , BASIC and other are used to develop programs.
 Semiconductor memory like RAM and ROM were used as primary memory.
 Monitor and keyboard were introduced for data input and output respectively.
 Multiprogramming facility was developed.
 The computer was used in census calculation, military, banks and industries.
 Size, cost, power requirement and heat generation decreased.
 Processing speed and storage capacity used of computer increased.

4.) Fourth Generation Computer (1972 onward)

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Fig: Fourth Generation Computer


The invention of microprocessor chip marked the beginning of the fourth generation
computers. Semiconductor memories replaced magnetic core memories. The invention of
microprocessors led to the development of microcomputer or the personal computer.
The first microprocessor called Intel 4004 was developed by American Intel Corporation 1971.
This computer has faster generation language and application software for microcomputers
became popular and allowed home and business users to adapt their computers for word
processing, spreadsheet manipulating, file handing and graphics.
In this generation, the concept of computer networks and CD-ROMs came into existence.
Features of the fourth generation computer are:

 Technology in use: VLSI is introduced and used Microprocessor-based technology.


 Problem-oriented fourth generation language (4GL) is used to develop the program.
 Semiconductor like RAM, ROM and cache memory is used as a primary memory.
 Magnetic disks like hard disk, optical disk (CD,DVD), Blue-ray disk, flashes memory
(memory chip, pen drive) are used as secondary memory.
 E-mail, Internet and mobile communication are developed.
 Advanced, user-friendly, web page software are developed.
 Size, cost, power requirement, heat generation decreased compared to the previous
generation.
 Operating speed, storage capacity ,use of computer increased compared to the previous
generation

The example of the fourth generation computer is IBM-PC, HP laptops, Mac notebook etc.
5.) Fifth Generation Computer (Present and future)

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Fig: Fifth generation Computer

The aim is to bring machines with genuine IQ, the ability to reason logically and with real
knowledge of the word. Thus, this computer will be totally different, totally novel and totally
new than last four generations of computer.
Fifth generation computer was based on Artificial Intelligence (AI) and that is still developing
process, but not yet a reality i.e this computer is incomplete. The scientists are working on it
still.
These computers will be able to converse with people and will be able to mimic human sense,
manual skills, and intelligence.
Features of the fifth generation computers are:

 Technology to be used: These machines will incorporate Bio-chip and VVLSI (Very Very
Large Scale Integration) or Ultra-Large Scale Integration (ULSI)
 The computer will have Artificial Intelligence (AI).
 Natural language will be used to develop programs.
 The computer will have parallel processing in full fledge.
 The operating speed will be in terms of LIPS(Logical Inference per Second)
 This aim is to solve highly complex problems, which require great intelligence and
expertise when solved by people.
 Quantum computation, molecular and nanotechnology will be used completely.

Evolution of computer
Evolution of computer is a study of past development of computer i.e. it is meant by the gradual
improvements of accuracy, speed and efficiency of computers through generations, whereas
generations of computers may be defined as the development of computer in an average period
of time in which old computer technology may be replaced by newer technology.

Ancient people lived on the earth for centuries without counting.Then, they started to count
their ten figures. It become so difficult to live and to remember anything. These phenomena
were gradually replaced by the use of stones, counting notches on sticks or marks on walls. The
Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

different generations are described below which has helped the humans for keeping records
with the passing of time.
1.) The Mechanical Era (Zeroth generation)
The calculator of this age was developed by using mechanical components like wood, metal,
stone, bone, etc. It was used for simple mathematical calculations. Some of the popular
calculations used in this ages are:

 Abacus

In ancient period, it was used to calculate mathematical calculation. It was used for performing
simple calculation like counting, addition, subtraction and multiplication of number. An abacus
consists of a rectangular frame carrying a number of wooden rods. Mid-bar divides each of
these rods in top unequal -upper and lower parts.

Fig: Abacus
Source: www.computerhistory.org

The upper part is called heaven,whereas lower part is called earth.The heaven consists of two
beads, whereas the earth part consists of five beads to each rod. The value of bead on heaven
part is five and earth is one. Each abacus consists of nine or eleven or thirteen rods.

 John Napier (1550-1617 AD)

THE SCOTTISH mathematician John Napier first published the table of logarithms in 1614 AD. It
was very used and consists of a large number of calculations.
He invented bone rods and used bones to demonstrate by subtracting and multiplication by
addition according to his principle. These are made of strips of bones on which numbers were
carved and painted that`s why it is also called Napier's bone.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Fig: Napier bone

 William Oughtred (1575-1660AD)

It is a rectangular device-slide-rule. It was a calculating device based on the principle of a log. A


rule consists of two graduated scales, one of which slips upon other. It is devised in such a way
that suitable alignment of one scale against the other makes it possible to find products and
quotient of any numbers.

Fig: Oughtred ruler


Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

 Blaise Pascal (1623-1662AD)

The man name Blaise Pascal, was a brilliant mathematician and religious thinker. Pascal made a
mercury barometer and measured atmospheric pressure to assist his father in his work
accounting. Pascal invented the first mechanical calculation machine in Paris.

Fig: Pascal Calculator

 Baron Gottfried Wilhelm Von Leibniz (1646-1716AD)

He develops a new method of calculation called 'Calculus'. He modified the masculine machine
and invented a first calculator, Stepped Reckoner, which was able to perform automatic
addition, subtraction, multiplication, division, but could find out square root. Each with nine
teeth of varying lengths instead of wheels it was called 'Leibniz Calculator' or 'Stepped
Reckoner'.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Fig : Leibniz Calculator

 Joseph Marie Jacquard (1752-1834 AD)

The french man, Joseph Marie Jacquard, was a textile manufacturer who invented a mechanism
for automated weaving clothes for the textile industry at Lyon, in 1802 AD. This machine was
used to automatically control weaving looms to facilitate the production of weaving cloth with
complex patterns.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Fig: Jacquard loom

 Charles Babbage (1791-1871 AD)

The English Professor and Mathematician, Charles Babbage, invented the Different Engine at
Cambridge University, in 1822 AD. This machine can solve differential equations and calculate
various mathematical functions. It is also called " Analytical Engine ".

Fig: Analytical engine

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

 Lady Augusta Ada Byron Lovelace (1515-1852 AD)

The English intelligent and independent-minded woman, Lady Augusta, was a daughter of
English poet Lord Byron and a very Great follower, assistant of Charles Babbage. Lady
documents Babbage`s work and writes programs for Babbage.

This plan is now regarded as the first computer program. That`s why, she was considered the
first computer programmer and a software language developed by the US Defense Department,
was named Ada in her honor.

 Herman Hollerith (1860-1929 AD)

An American Inventor, Herman Hollerith, also applied the Jacquard loom concept in computing
and applies for patents for an automatic punch-card tabulating machine. He invented a machine
knows as " Tabulating Machine ". This device could process on the punch cards and perform
census calculating faster than ever before.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

 John Von Neumann (1903-1975 AD)

The Hungarian Mathematician, John gave an idea of stored program computer in the sense that
program is stored internally in the main memory of the computer along with its associated data,
in 1945. So, he is called the "Father of Stored Program". Before that, program required for the
computer were integrated and written permanently in chips. So, modification of program was
not possible. But, after Neumann, such programs were stored on a computer in some storage
media, so modification was easy and flexible.

2.) The Electro-Mechanical Era


The calculator of this age was developed by using mechanical and electronic component
vacuum tube.
Successful general purpose mechanical computers were built, in the 1930s. Konrad Zuse
developed mechanical computer, the Z1, in 1983 in Germany.

 The Mark I Computer (1937 - 1944)

A Professor of Physics, Howard H. Aiken designed a general purpose mechanical computer at


Harvard University and IBM Automatic Sequence Controlled Calculator (IBM ASCC). It was the
first fully automatic calculating machine and later as Harvard Mark I.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

It used binary numbers for its operation. Later, Mark II was invented by Aiken and his colleagues
that were working electromechanical relays for its operation. Mark II used 19000 valves.

 The Mark II Computer

It used about 18 thousand vacuum tubes as the main memory device with 7 lakes 50 thousand
parts. It is 51 feet long, 8 feet height and 3 feet wide as bulky in size.It was capable of
performing five basic arithmetic operations; additions, subtraction, multiplication, division and
table reference. The result was printed at the rate of one result per five seconds.

 The Atanasoff-Berry Computer (1939 - 1942)

In 1939, John Vincent Atanasoff and Clifford Berry designed Atanasoff-Berry computer or ABC
solving systems of mathematical simultaneous equation. It used 18000 valves and other 45
valves for internal logic and capacitors for storage.

It used punch cards as input and output operation i.e secondary. It is considered as the first
computing machine which introduced the idea of binary arithmetic, regenerative memory and
logic circuits.

 The Colossus (1941 - 1944)

In 1944, Colossus computer is designed by Alan M. Turing and build by British mathematician
Alan Mathison Neuman, Alan with some colleagues, creates a computer named colossus at the
University of Manchester, England, which comprised 1800 vacuum tubes.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

It was one of the world's earliest working programmable electronic digital computers. Colossus
was a special purpose machine that suited a narrow range of tax (for example, it was capable of
performing decimal multiplication ).

 The Electronic Computer Era

The computers of this age are developed by using electronic components like a vacuum tube,
transistors IC, VLSI, etc. These computers are smaller, faster and more reliable.

 The Eniac (1943-1946)

In 1946, John W. Mauchly and J.presper Eckert constructed ENIAC (Electronic Numerical
Integrated and Calculator), at the Moore School of Engineering of the University of
Pennsylvania. USA ENIAC was the first popular general purpose all electronic digital computers.
John Von Neumann was the consultant of the ENIAC project.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

It was a very large machine weighing about 30 tons and containing about 17,468 vacuum tubes,
70,000 resistors, 5 million soldered joints and it consumed 160 kilowatts.

 The EDVAC (1946-1952)

EDVAC (Electronic Discrete Variable Automatic Computer) was developed by Dr.John Von
Neumann,and a member of the Moore School of Engineering of the Unversity of
Pennslyvania,J.P Eckert, and J.W Mauchly. The EDVAC is used for more school personnel and the
Ballistics Research Laboratory of the US Army,which was based on Jhon Von Neumann`s ideas of
Stored Program".

 The UNIVAC (1951)

UNIVAC (Universal Automatic Computer) was developed by J.P.Eckert and J. Mauchly in 1951. It
was the first computer manufactured for commercial use and general purpose digital
computer.It was designed to handle both numeric and textual information. Before this, all the
computers were either used for defense or census was by General Electrical Corporation in
1954.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

MOBILE COMPUTING
Mobile computing is the form of human-computer interaction by which a computer is expected
to be transported during normal usages. Mobile computing has three aspects: mobile
communication, mobile hardware and mobile software.
The first aspect addresses communication issues in ad-hoc and infrastructure networks as well
as communication properties, protocol, data format and concrete technologies. The second
aspect is on hardware, e.g., mobile device or device components. The third aspect deals with
the characteristics and requirements of mobile applications.

Fig: Mobile Computing


Mobile computing is a generic term describing one's ability to use technology while moving, as
opposed to portable which is the only particle for use while deployed in a stationary
configuration. A mobile computing device is created using mobile components, such as mobile
hardware and software.
Mobile computing devices are portable devices capable of operating, executing, providing
services and applications to a computing device. It is a computing device used in transit. Users
can access data and information from wherever they are. Here's the example view of how does
the mobile computing works on a server and mobile networks.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Fig: Working of Mobile Computing

Fig: Layers of Mobile Computing


Mobile computing is the process of computation on a mobile device. In mobile computing, a set
of distributed computing systems or service provider servers participate, connect, and
synchronize through mobile communication protocols.
Mobile computing provides decentralized (distributed) computations on diversified devices,
systems, and networks, which are mobile, synchronized, and interconnected via mobile
communication standards and protocols.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Many types of mobile computers have been introduced since the 1990's including wearable
computer, PDA, enterprise digital assistant, smart phone, UMPC (Ultra-mobile PC), Tablet PC.
CHARACTERISTICS OF MOBILE COMPUTING

 It is a portable device that you can carry during mobility.


 It has limited processing and storage capability.
 It includes mobile communication, mobile hardware, and mobile software.
 It usually contains touch screen for providing input.
 It contains on-screen or virtual keyboard for proving text inputs. However, an external
keyboard can be connected by using USB port, infrared or Bluetooth.
 It contains the camera, speaker, and microphone etc.
 It contains handwriting recognizing software.
 Most of the mobile computing devices contain memory card slot to expand the storage
capacity.
 It has wireless connectivity such as Bluetooth, Wi-Fi, to connect the Internet or with
other computing devices as well as the wired connection through the USB port.
 The most mobile computing device can synchronize their data with the applications on a
user's computer.
 It can be used for cloud computing and remote access.
 It uses the mobile computing operating system such as Android, iOS, Windows Mobile
OS, Plam OS.
 It can include GPS (Global Positioning System) receiver for navigation.

Fig: Mobile Computing

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Speed Measurement units of Computer


In computers, the size of a device does not reflect the space available to store data in it. There
many tiny devices that store the unbelievable amount of data whereas larger device only can
store few amount of data. How long, how thick cannot determine how much we can store
inside inspite, we need to find some other way to measure space available on the computer.
Almost all of the computers use binary numbering systems.
Binary numbering system consists of two digits i.e 0 and 1 which represents any quantity.
Everything in computers is represented in strings of binary numbers. For example capital A is
represented by a computer as 0100 0001 and B is 0100 0010. All characters, symbols, images,
numbers, animations, sounds, videos and everything is converted into binary code to process by
a computer to store in computer. So if there is any device that can store one binary digit, 1 bit is
its storage capacity.
We’ve know that bit is the abbreviation of binary digit. Any device that has storage space to
confirm 5 binary digits has 5 bits space.There require thousands and millions of bits for a file
and expressing the space available in bits which are really inconvenient because of its extreme
large number. So, there are larger units which represent a group of lower units.
A group of 4 binary digits is called a nibble. Similarly, a group of 8 bits is called a byte.As the
example, each character requires 8 bits which are 1 byte, so 1 character requires only 1-byte
space. If we have a text file whose size is 32 bytes, it means there are 32 x 8 binary digits stored
in it. .1024 (=2 10) is that digit which converts higher unit in a binary numbering system.
Following table lists the different units and their values:
Units Equivalent
0 or 1 1 Bit
4 bits 1 Nibble
8 bits 1 Byte
1024 bytes 1 Kilobytes (KB)
1024 Kilobytes 1 Megabyte (MB)
1024 Megabytes 1 Gigabytes (GB)
1024 Gigabytes 1 Terabytes (TB)
1024 Terabytes 1 Petabyte (PB)
1024 Petabytes 1 Exabyte (EB)
Units Equivalent
1000th of a second 1 Milliseconds (MS)
1000th of a milliseconds 1 Microseconds (μs)
1000th of a microseconds 1 Nanosecond (ns)

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

1000th of a nanoseconds 1 Picoseconds (ps)


th
1000 of a picoseconds 1 Femtoseconds (fs)
The computers can be classified into three categories on the basis of brand. They are:
a) IBM PC
b) IBM Compatible
c) Apple/Macintosh

IBM PC (International Business Machine Personal Computer)


IBM is the largest computer manufacturing company established in 1924, in the USA. The IBM
PCs are developed by a company named, International Business Machine (IBM) Company so,
the computers are known as IBM PC.The technology used in IBM PC is designed by the engineer
of IBM Company. IBM PCs are more reliable, durable and have better quality but costly. It was
specifically designed for professionals and scientific problem solvers.
(NEB NOTES)
The IBM PC was not as powerful as many of the other personal computers that it was
competing against at the time of its release. The IBM PC was created by a team of 12 IBM
engineers and designers under the direction of Don Estridge of the IBM Entry Systems Division
in Boca Raton, Florida.

IBM Compatibles
The computers that have some functional characteristics and principles of IBM computers are
called IBM compatible. IBM compatible computers are developed by other companies than IBM
companies using the technology of IBM PC. They are easily available and cheaper. Their parts
are easily available in the market. They are also duplicate or assemble a computer. They are
popular in the world.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Apple/Macintosh
All the computers manufactured by Apple Co-operation are known as Apple/Macintosh
computer. It is a leading computer manufacturing company of USA. Apple computers are
developed by Apple Co-operation which was established in the late 1970s in the USA. Apple
computers are costlier than IBM computers.
These computers use their own software and hardware. Software developed for IBM computer
can't run in apple computers and vice-versa. They are totally different than that of IBM
computers, in terms of both hardware and software. They are available in a different capacity,
cost and sizes. These computers are nearly 8% in the market. The first Macintosh was
introduced on January 24, 1984, by Steve Jobs.

CLASSIFICATIONOF COMPUTERON THEBASIS OFWORKINGPRINCIPLE


Computer is more and more common in the world today. In less than 100 years, computers
have revolutionized much of human society. The many ways in which people communicate,
create, work and play continue to be influenced and possibly even enhanced by modern
computers. Considering how common computers have become, there are different types of a
computer for various of different necessities.
The computers on the basis of application/working principle are:

 Analog computer
 Digital computer
 Hybrid computer

Analog Computer

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Analog computer is one which operates on continuous data, usually of a physical nature such as
length, voltage or current, etc. An analog machine is usually a special purpose device dedicated
to a single task. Analog computers are based on analog signals that are continuous signals.
These types of computers were widely used in scientific and industrial applications. These are
used in a hospital to measure the size of the stone in kidney and mental diseases diagnostics.
Analog computer works by measuring rather than counting. It is usually used for scientific work
rather than personal purpose and commercial use so it is special purpose computer. It is
powerful in solving differential equations.
Comparing to the digital computer, it has less storage capacity and less accuracy performance. It
is specially designed to perform continuous physical force like computing the temperature,
pressure and other. It represents physical quantities in the form of waves or in continuous form.
Presley, thermometer , speedometer, barometer, lactometer, etc are the example of an analog
computer. An example of analog devices is a thermometer, barometer, speedometer and
ammeter.
Characteristics of analog computer

 The speed of an analog computer is fast but have no state.


 These computers work with physical values such as temperature, pressure etc.
 These computersare based on continuous data.
 These computers are not reliable and are difficult to use and operate.
 These computers are the base for digital computers.
 These computers have small memory.
 No possibility of reprogramming.
 Normally, an analog computer cannot be reprogrammed.

Digital Computer

The computer which works on discrete data or discontinuous data is known as a digital
computer. It works on a binary system where 0 represent off and 1 represents on. It is based on
digital signals i.e discrete signals.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

So, the basic principle of these computers are either present or absence of an electric pulse in
the signals. It is a multipurpose and programmable computer. It is fast processing, more
accurate and has large memory capacity. It is usually general purpose computer. Some
examples of a digital computer are IBM PC, Apple/Macintosh computer, etc.
Characteristics of digital computer are:

 Digital computer operates by calculation.


 It is multipurpose computer and can be reprogrammed.
 It has large storage capacity than an analog computer.
 The results are accurate and high.
 It stores the data in the form of a bit.
 The processing speed is very fast.
 These machines are automatic.
 These computers are versatile in a sense that they can carry out different types of a job
at a time without any interference.
 A computer works with same speed,same accuracy, and with the same efficiency at all
time.

The differences between analog and digital technologies :are


Digital computer Analog computer
i. Digital computer works upon i. Analog computer works on
discrete (discontinuous) data. continuous data.
ii. This computer works with a ii. These computers work with
digit. natural or physical value.
iii. The accuracy is high. iii. The accuracy is low.
iv. It is general purpose in iv. It is a special purpose in
nature. nature.
v. It has no or limited storage
v. It has high storage capacity.
capacity.
vi. It does single purpose job. vi. It does a multi-purpose job.
vii. No possibility of
vii. It can be reprogrammed.
reprogramming.
viii. The cost is low and viii. The cost is high and easily
portable. not portable.
v.. Example: Desktop computer v. Example: Presley

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Fig;Hybrid Computer
Hybrid Computer
A computer, which has a combination best feature of both analog and digital computers is
called a hybrid computer. It helps the user to process discrete and continuous data. The hybrid
computer can convert the analog signal into digital signals and digital signal into analog signal.
Hybrid computers are used mainly in specialized applications where both kinds of data need to
be processed. Therefore, they help the user to process both continuous and discrete data.
They have usually the speed of digital computers and the accuracy of analogcomputers. They
can perform the task of both analog and digitalcomputer.They are usually used for special
problems, as it is a special purpose computer in which input data are derived and measurement
are converted into digits and processed by a computer.
The practically they are used in the field of the following places:

 During rocket launching process, where the analog components/ devices measure the
speed of the rocket, temperature and pressure of the atmosphere, then, these
measurements are converted into digital signals and supplied to the digital devices to
analyze the data for taking appropriate steps on launching.

 In hospitals, analog components measure the temperature and blood pressure of a


patient, then, these measurements are converted into a digital signal and fed to the
digital devices that monitor patient's vital information.

 In weather forecasting, analog devices measure wind speed, humidity, temperature,


wind direction and fed to the digital devices that compare with the past information to
predict the climate changes.

 In automated industry, analog component measure temperature, pressure, speed and


provide it to digital component that takes proper action.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

CHARACTERISTICSOF HYBRIDCOMPUTER

 It is the combination of qualities of analog as well as a digital computer.


 It can process both continuous and discrete data.
 It is special purpose computer.
 It can convert one type of data into another.
 It is mostly used in radar communication, rocket launching, weather forecasting and in
other fields.
 It usually high cost compared to analog and digital computer.
 Hybrid Machines are generally used in scientific applications or in controlling industrial
processes.

CLASSIFICATION OFCOMPUTER ON THE BASIS OF SIZE

1. Super Computer
2. Mainframe Computer
3. Mini Computer
4. Micro Computer

1) Super Computer

Fig: Super Computer


Super computer is one of the most powerful computers which is used to perform the complex
calculations. They are the fastest computer which works in nanosecond even in a picosecond
too. This computer is used for a special purpose. Usually, such computer uses parallel
processors. Nowadays, the computing capability of a super computer is equal to that of 40,000
micro computers. Mostly super computers are used by government agencies. These computers
are used in research and other operations where there is a huge numerical calculation. Different
industries also use this huge computer for designing their products. It is also used in Hollywood
movies for animation purposes. It requires large space and temperature control room. CRAY X-
MP/24, NEC-500, PARAM, etc are some of the examples of a super computer. Today's super
computers are designed by companies such as HP, IBM, Cray Inc.
2) Mainframe computers

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Fig: mainframe Computer


Mainframe computers are powerful multi-user computers capable of supporting many
hundreds of users simultaneously. It is also large in size. This computer has slower processing
speed than a super computer but faster than a mini and micro computer. It is designed for
large-scale data processing and a huge amount of data storage. They are used in a big
organization such as bank, insurance companies, airlines, railway reservation system, e-mail
service providers, web hosting, etc. It needed a large area approximately 1000 sq.ft. It supports
a large number of I/O terminals, more than 100 terminals.
In a mainframe, each user accesses the mainframe’s resources through a device called a
terminal. Their terminals are attached to the mainframes to perform the different types of task
in FIFO.
Dumb terminal and intelligent terminal are the two kinds of terminals. A dumb terminal is the
input/output device that functions as a window into a computer located somewhere else. An
intelligent terminal can perform some processing operations, but it usually does not have any
storage.
IBM 1401, ICL 2950/10,CYBER 170, etc are some of the examples of mainframe computers.
3) Minicomputer

Fig: Mainframe Computer


Minicomputer is also a multi-user computer capable of supporting ten to hundreds of users
simultaneously. Due to the smaller size and its cost compared to mainframe and a super
computer, it got its name as a minicomputer. It is also known as midrange computer.
Minicomputer can handle more input and output than a micro computer. It can support about
50 terminals and requires an area around 100 sq ft. This computer is useful for medium sized
business, organizations, industries, universities and banks. It is cheap and easy to operate than a
mainframe computer.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Prime 9755, VAX 7500, HCL, MAGNUM, CDC-1700, etc. are some of the examples of a mini
computer.
4) Microcomputer
A computer which is based on a microprocessor is called microcomputer. They are small and
single user computer. This computer has a keyboard for entering data, a monitor for displaying
and a storage device for storing the data. It requires less area compared to other computers.
This computer consists of central processing unit and a single chip. It is mainly used in office,
school, house, shop, etc.The smallest of this category are a laptop, notebook, palmtop and PDA.
IBM PC, Apple/Macintosh, etc. are the examples of the microcomputer. The microcomputer is
categorized as a non-portable and portable category.
Some of the examples of microcomputer are described below:
 Desktop

Fig: Desktop

The desktop computer is the kind of personal computer (PC), which is a common type of
computer used by many people today. They are a non-portable computer.
The term “desktop computer” means the concept of such a computer actually sitting on top of a
desk. A computer is known as “workstation” is actually a relatively powerful kind of desktop.
This type of desktop has a faster processor, more memory and other advanced features
compared to another desktop. Common desktops often have much computing capability
compare to the workstation.
 Laptop

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Fig: Laptop
A ‘laptop’ computer is a light, compact and portable PC. It contains a rechargeable battery. They
also contain a built-in LCD monitor. It is a portable computer.
To make them as portable as possible; most laptops try to avoid any sort of cable or wire. In
laptop, instead of a mouse, a trackpad is used. Instead of wired connection to a network or
printer, ‘wireless’ radio connection are used.
A laptop is also known as a notebook, which is another kind of personal computer used by many
people today. It has usually a flat-screen monitor and keyboard attached to the computer.
Most of the laptop have a clam-shell case design, which means that the case opens in a way
similar to a clam. Some of the laptops are in the form of a tablet.
 Handheld

Fig: Handheld
A handheld computer is a kind of portable computer that is intended to be held and used in a
hand. A handheld computer is becoming more and more common in modern society.
This computer includes various kinds of PDA (Personal Digital Assistant) computers, such as
those running palm OS or windows mobile. Nowadays, mobile phones have slowly replaced by
smartphones and similar handhelds with mobile phone capabilities.
Those phones which contains the running of Google Android, windows mobile and also the
iPhone are the handheld computer which has the function of mobile phones.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

 Personal Digital Assistant (PDA)


A PDA is similar to a palmtop computer. It is more compact and typically has no keyboard, using
a touch screen for all data input. The screen of PDA has a small screen. So, it has a small stylus
(plastic stick) that is used to press things on a screen.
Most PDAs use some sort of handwriting recognition system to allow the user to write on the
screen and have their writing converted into text. PDAs use a ‘digital diaries’ to take their e-
mail, documents, appointments, etc.

Fig: Personal Digital Assistant


COMPONENTS OF COMPUTERSYSTEM
The computer is a device that operated upon information or data. It is an electronic device
which accepts inputs data, stores the data, does arithmetic and logic operations and provides
the outputs in the desired format. The computer receives data, process it, produces output and
stores it for further references. So, a computer should have at least four major components to
perform these tasks. A block diagram of the basic computer organization has the following
functional units.

Fig: Block diagram of computer architecture


Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

Input Unit
The input unit is formed by the input devices attached to the computer. Input devices are used
to interact with a computer system or used enter data and instructions to the computer. These
devices convert input data and instructions into a suitable binary form such as ASCII, which can
be acceptable by the computer. In brief, an input unit performs the following function:

 It accepts data and instruction from the outside worlds.


 It converts these data and instruction into computer understandable from a binary form.
 It supplied the converted data and instruction to the computer system for further
processing.

E.g of input devices are keyboard, mouse, scanner etc.


Memory Unit
This unit is also called storage unit. The data and instructions, which are entered through an
input unit must be stored on the computer before the actual processing starts. The result
produces by the computer after processing is also kept somewhere before passed to the output
units. If intermediate results are produced during processing, it should be stored in somewhere
in memory. The storage unit of a computer performs all these needs. In brief, the specific
functions performed by the storage unit are as follow:

 It stored data and instructions, which are entered through input devices.
 It stores an intermediate result of processing.
 It stores the final result of processing before these results are passed to an output
device.

The storage unit of computers consists of two types of memory or storage: primary and
secondary storage:
i. Primary Storage
Memory storage that communicates directly with CPU is called main memory. It enables the
computer to store, at least temporarily data and instruction. It is mainly used to hold data and
instructions and as well as the intermediate result of processing which the computer system is
currently working on. Primary memory is volatile, that is, it lose its content when power supply
is off. The Random access memory (RAM) is an example of a primary to main memory.
ii. Secondary Storage
Auxiliary storage is also known as secondary storage. It is the memory that supplements the
main memory. These are a non-volatile memory. It is mainly used to transfer data to program
from one computer to another computer. There is high capacity storage devices used to store
Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

data and program permanently. These are also used as backup devices which allows to store the
valuable information as backup on which you are working on. The examples of secondary
memory are Magnetic Disk, Optical disk, etc.
Central Processing Unit (CPU)
CPU is the component that actually responsible for interpreting and executing most of the
commands from the computer hardware and software and also controls the operation of all
other components such as memory unit, input and output devices. It simply accepts binary data
as input and processes data according to those instructions and provides the result as output. It
is the logic machine. So, its main function is run the program by fetching instructions from the
RAM, evaluating and executing them in sequence. In summary, the function of CPU are as
follow:

 Read instruction from memory


 Communicate with all peripherals using the system bus.
 It controls the sequence of instructions.
 It controls the flow of data from one component to another component.
 Performs the computing task specified in the program.

The CPU has three components responsible for different function, these components are
Control units, arithmetic-logical unit (ALU) and Register.

Fig: Components of CPU


Control Unit
The control unit provides the necessary timing and control signals to all the operations on the
computer. It controls the flow of data between the CPU, memory and peripherals. It also
controls the entire operation of a computer. It obtains the instructions from the program stored

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

in the main memory, interprets the instructions and issues the signals, which cause the other
units of the system to execute them. So, it is considered as a central nervous system of a
computer that provides status, control and timing signals necessary for the operation of other
parts of CPU, memory and I/O devices. The main functions of control units are given below:

 It performs the data processing operations with the aid of program prepared by the user
and send control signals to various parts of the computer system.
 It gives commands to transfer data from the input devices to the memory to an
arithmetic logic unit.
 It also transfers the results from ALU to the memory and then to the output devices.
 It stores a program in the memory.
 It fetches the required instruction from the main storage and decode each instruction
and hence execute them in sequence.

Arithmetic Logic Unit


This is the area of CPU where various computing functions are performed on data. The ALU
performs arithmetic operations such as addition, subtraction, multiplication and division and
logical operation such as comparison AND, OR and Exclusive OR. The result of an operation is
stored in Accumulator or in some register. The main functions of ALU are as follow:

 It accepts operands from registers.


 It performs arithmetic and logic operations.
 It returns a result to register or a memory.

The logical operations of ALU give the computer the decision-making ability.
Registers
Registers are the high-speed temporary storage locations in the CPU made from electronic
devices such as transistors, flip-flops, etc. So, registers can be thought as CPU’s working
memory. Register are primarily used to store data temporarily during the execution of a
program and are accessible to the user through instructions. These are the part of Control unit
and ALU rather than of memory. Hence, their contents can be handled much faster than the
contents of memory. Although the number of registers varies from computer to computer.
There are some registers which are common to all computers. Five registers that are essential
for instruction execution are:

 Program Counter (PC): Contains the address of the next instruction to be fetched.
 Instruction Register (IR): Contains the instruction most recently fetched.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

 Memory Address registers (MAR): Contain the address of a location in memory for read
and write operation.
 Memory Buffer Register (MBR): It contains the value to be stored in memory or the last
value read from memory.
 Accumulator (ACC): An accumulator is a general purpose register used for storing
temporary result and result produced by the arithmetic logic unit.

Output Unit
The output unit is formed by the output devices attached to the computer. Output devices are
used to present result produced by the computer to the users. The output from the computer is
in the form electric signals, which is then converted into human understandable form into
human readable form.
The examples of output devices are the monitor, printer and speaker.
The main functions of the output unit are as follow:

 Accepts the result produced by the computer which is in electric binary signals.
 It then converts the result into human readable form.
 Finally, it supplied the converted results to the outside word.

We can also discuss some of the categories of a computer system. Some of the categories of
computer system are:

 Hardware
 Software
 Data or information
 Procedure (data which the computer converts)
 User
 Communication

1. Hardware

Hardware refers to the part of the computer which we can touch. It is the physical devices of
the computer. It consists of interconnected electronic equipment that controls everything the
computer does. It includes input devices, input devices, output devices, processing devices and
storage devices. Example of hardware are keyboard, monitor, CPU, hard disk and RAM.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

2. Software

The software is the term used to describe the instruction that tells the hardware, what and how
to perform a task. Without software, the hardware is useless. Examples of software are Window
7, MS office, Internet explorer, etc.

3. Data/Information

The function of a computer system is to convert data into information. Data can be considered
as the raw facts whether in a paper, electronic or the other form that is processed by the
computer. In other words , data consist of the raw facts and figures that are processed to form
information. Information is summarized data or manipulated or processed data.

4. People

People constitute the most important parts of the computer system. People operate the
computer hardware and create the computer software. They also follow a certain procedure
when using the hardware and software.

5. Procedure

The procedure is a description of how things are done, step for accomplishing a result.
Procedure for a computer system appears in documentation manual, also known as reference
manual which contains instruction, rules, and guidelines to follow when using hardware and
software. When you buy a microcomputer or software package, it comes with one or more
documentation manuals.

6. Communication

When one computer system is set up to share data and information electronically with another
computer system, communication becomes a system element. In other words, the manner on
which the various individual system are connected by wires, cables, phone lines, microwave,
Wi-Fi or satellite is an element of the total computer system.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Fig:Memory

MEMORY
Memory is the part of the computer system that is used to store data or instruction temporarily
and permanently. The memory can be assumed as the set of boxes and the boxes are numbered
from zero upwards so that each box can be identified.
Once data is stored in the memory of memory box, it holds there till it is replaced by other data
in the computer system. The computer cannot function without the memory. So, memory is the
key factor of the computer to run smoothly and nicely and it is used to store data.
CPU (Central Processing Unit ) contains necessary data processing and controlling other
components of the computer. It does not have any other place to store programs and data
during data calculation and data processing. We also know that the CPU obtain several registers
for storing data and instructions.
On the basis of technological point of view, memory can be classified as below:

1. Semiconductor memory

It is the memory that is built by using transistor and IC. It is faster, lighter, has smaller
storage capacity and consumes less power. It is used as the main memory of the computer.
It has an access time of about 50ns. Examples: ROM, RAM, Cache memory, etc.

2. Magnetic memory
It is the memory that consists of magnetic property for storing data. It stores data in the
form of magnetized dots. It is slower for read / write and cheaper than semiconductor. It
is used as the secondary or backup memory of the computer. Examples: Hard disk,
Floppy disk, Tape drive, etc.

3. Optical memory
It is the memory that uses optical property (light) to the read-write operation of the data.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

It is slower and cheaper than semiconductor memory and used for mass storage and
backup. Example: CD, DVD, BD, etc.

The time to fetch and load data from the storage space into CPU must be very small to that
from disk storage to reduce the speed mismatch problem with CPU speed. Every computer has
a storage space called main memory or primary memory. It is temporary area built into the
computer hardware.
Memory consist of IC (Integrated circuit), chips either on the motherboard or on a small circuit
board attached to the motherboard of a computer system. Hence, the rate of data fetching
from the main memory is faster than that from high-speed secondary storage like a disk.
Primary Memory
Primary memory is also known as system memory or main memory or primary storage or
internal memory. Primary memory is the working area for the computer's processor.
It holds data for processing. It holds instructions for processing data. It holds data after it is
processed waiting to be sent to an output or storage device.
Features of Primary memory

1. It is used for storing data and programs for temporary.


2. It is normally used for smaller storages.
3. It is expensive and faster for read / write operations than secondary memory.

Here are some of them that comes under the primary memory

 RAM (Random Access Memory)

Fig:Random Access Memory


RAM is the read/write memory of the computer. It is used for both purpose read and write. It
possesses random access property that means CPU can access any memory location in a
random sequence form.
It is a volatile memory. It stores data or information as long as power supply is on. But ,after
power supply is off,data will be gone. There are two types of RAM.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Types of RAM

 Static RAM (SRAM)

SRAM stores data and programs as long as the computer is in ON state. It is expensive but faster
for read/write than DRAM.it is typically used for CPU cache while DRAM is used for a
computer's main memory.

Fig: Static RAM

 Dynamic RAM (DRAM)

The data stored in DRAM will be lost after a few milliseconds even if the computer is on. It is
cheap but slow for read/write than SRAM.

Fig: Dynamic RAM

 Read Only Memory (ROM)

ROM stands for Read only memory. It can be used only to perform the read operations. It does
not have write access. It is non-volatile memory i.e, the information stored in it is permanent
and is not lost even if the power supply is cut down.

Fig:Read Only Memory


Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

It is used for permanent storage of programs. It is cheaper than RAM on per unit basis but while
compared to storage ROM is expensive than RAM.
Types of ROM

 PROM (Programmable Read Only Memory)

It is a programmable memory that users can write data at once only. The user can store
permanent programs, data or any kind of information in PROM.

Fig: Programmable Read only Memory

 EEPROM ( Electrical erasable programmable read only memory)

It is a memory that can also be erasable via electric. It can be erased and reprogrammed on the
byte by byte basis single data or the entire chip can be erased.

Fig: Electrical erasable programmable read only memory

 EPROM ( Erasable Programmable Read Only Memory)

It is an erasable memory. Data stored on it can be erasable via passing the Ultra-Violet light so
that entire data will be erased.

Fig: ErasableProgrammable Read Only Memory

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Secondary Memory
Secondary memory is non-volatile and has a lower cost per bit. It generally has an operating
speed far slower than that of primary memory. Secondary memory is also called as "Auxiliary
Memory". It is primarily used to store a large volume of data on the permanent basis that can
be partially transferred to primary storage.
Secondary storage is the storage device that is designed to store data and instructions
(programs) in a computer relatively in permanent form. It is non-volatile storage.ie. stored data
and instructions can be retained even if the power supply is cut off. It is also known as backup
memory.
Features of secondary memory

1. It is not directly accessible to CPU; it requires primary memory for its operation.
2. It is usually non-volatile memory.
3. It is usually cheaper and slower for read /write operation than primary memory.

Cache Memory
Cache memory pronounced as cash, is a special high speed and expensive memory used in CPU,
so that CPU doesn`t have to wait for data to be delivered. The most frequently used instructions
are kept in the cache memory.
Cache memory computer runs fast and smoothly. It doesn`t have to swap instruction in and out
of RAM. Hence, the cache memory is placed in between CPU and RAM so that the speed of
operation of main memory and cache memory together can meet speed requirements.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Source:www.cnblogs.com

Fig:Buffer
There are usually two levels of cache memory. They are:

 Level 1 (L1)

L1 is smaller and the faster. Multi-level caches generally operate by checking the L1
cache first If it hits the processor proceeds at high speed.

 Level 2 (L2)

L2 is larger and the slower. If the smaller cache misses the next larger cache L2 is checked and
so on.
Buffer
It is a temporary holding area for data; unlike register it stores more than one piece of data. It is
normally used between the CPU and the input/output devices. The purpose of a buffer is to
hold data prior being used by CPU.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Microprocessor

Fig: Microprocessor
The microprocessor is an entire CPU built on a single chip. To elaborate, it is a computer
processor which embodies the functions of a CPU on a single IC or at most a few Integrated
Circuits. Integrated Circuits are very complex electronic circuits which consist of extremely tiny
components that are formed on a single, flat, thin piece of material known as Semiconductor. In
other words, microprocessor isan integrated circuit that contains all the functions of a central
processing unit of a computer.A microprocessor is designed to perform arithmetic and logic
operations that make use of small number-holding areas called registers.

Fig: Microprocessor

The microprocessor is an electronic device which is attached to the main circuit board
(motherboard) of a microcomputer which serves as the brain of the computer. It is linked with
various peripheral equipment such as main memory, input/output devices and auxiliary storage
devices, etc.
Before microprocessors, computers had Small Scale Integration (SSI) and Medium Scale
Integration (MSI) chips. Though 3 companies; Intel Corporation, Garret Air Research and Texas

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Instruments, all developed the microprocessors at around the same time, Intel Corporation’s
microprocessor is considered to be the 1st one as the Intel 4004 microprocessor. Conceived the
idea in 1968, this single chip was brought into reality in November 1971 as the very
1st commercial microprocessor.

Fig: Microprocessor
Intel 4004 by Intel Corporation
The Intel 4004 ("four-thousand-four") is a 4-bit central processing unit (CPU) released
by Intel Corporation, in 1971. It was the first microprocessor as well as the first general purpose
programmable microprocessor on the market.

Fig:Intel 4004 by Intel Corporation Intel 8008 by Intel Corporation


The very next year in 1972, Intel Corporation again released a more advanced microprocessor
called Intel 8008 as the 1st 8-bit microprocessor.It was an 8-bit CPU with an external 14-bit
address bus that could address 16 KB of memory.
The 8008 had other advantages over the 4004:

 The processor supported of 16 KB of memory (ROM and RAM combined).


 The size of internal CPU stack was 7 levels in contrast to 3 level-stack for the i4004.
 The Intel 8008 could handle interrupts.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Fig:Intel 8008 by Intel corporation

COMPONENTSOF MICROPROCESSOR
A microprocessor is often referred to as the CPU or Central Processing Unit. It is considered to
be the heart of a computer as it controls all the functions of a computer. It can be considered as
an artificial brain. This system can control everything from large automobiles to small devices,
such as mobile phones and calculators.

Fig: Components of Microprocessor


But, a microprocessor alone does not have any meaning unless and until it is attached to other
components of a digital computer. It consists of several sections. The Arithmetic/Logic Unit
(ALU) performs calculations and makes logical decisions; the Control Unit deciphers programs;
digital information is carried by Buses throughout the computer and the chip; the registers store
temporary information like a scratch pad does and on-chip computation is supported by local
memory.
There are some more complex microprocessors too, which contains some extra sections like
Cache Memory for the storage of specialized memory and to speed up access for external data
storage devices. Generally, though, it consists of 3 major components. They are:

 ALU
 CU
 Register Array

ALU (Arithmetic and Logic unit): This is the area of the microprocessor where various
computing functions are performed on data. The ALU performs arithmetic operations such as
addition, subtraction, multiplication and division and logical operations such as AND, OR and
NOT .The result of the operation is stored in the registers called Accumulator. ALU also
performs an operations like increment, decrement, shift and clear.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Fig: Arithmetic Logic Unit


Control Unit: The control unit provides the necessary timing and control signals to all the
operation in the microcomputer. It is the one in charge of informing all the ALU units of what
operations are to be performed on. Some of its features are:

 It receives, decodes, stores the results and manages the execution of data that flows
throughout the CPU.
 It controls the flow of data between the microprocessor and memory and peripherals.
 It also directs the Arithmetic and Logic Unit.
 It generates the Control Output based on the input called Operation Code (Opcode)
which can also be called as an Instruction.
 It commands and controls the Program Unit which is responsible for giving away the data
based on the addresses.
 It supervises and controls the entire operation of a computer.
 Based on the CPU, the functions that a Control Unit performs can be varied.

Fig: Control Unit


cnx.org

Therefore, the ALU might be able to perform lots of its functions at a time but based on the
Control Unit, it can perform only one operation at a time. It controls the flow of data between
the microprocessor and memory and peripherals.
Register Array: Simply, it is a vital component of a computer which serves as the storage
location that is inside the processor. This is the area of the microprocessor which consists of
various registers. These registers are primarily used to store data temporarily during the

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

execution of a program. It accepts, stores and transfers the data and instructions that are used
immediately.

Fig: Memory Unit

Fig: Memory chips


These registers are very small memory locations which hold the data to be processed. The
instruction pointer is known as the most important register that directs the CPU to the next
location from where it has to receive data. The accumulator is another type of register which
stores the next values to be processed by the CPU. The size of the register determines the
overall speed of the computer.
FUNCTIONS OF MICROPROCESSOR
The microprocessor is considered to be the heart and brain of a computer as it is responsible for
the whole performance from directing every function within the computer. It can conduct any
computation or operation accurately at the earliest due to floating point processors. With the
Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

incorporated effort of the ALU, Control Unit and Registers, microprocessor carries out the
required instructions and duties efficiently. There are mainly 2 important memories that are
responsible for any microprocessor to control and function. They are:

1. ROM (Read Only Memory):

ROM is a program with a finite and fixed set of bytes and instructions. Within it, it has a small
program called the Basic Input Output System or BIOS. It is a program which tests the hardware
of the machine when it starts up. Then, it fetches a program called the boot sector from another
memory which executes some instructions serially which helps in utilizing the computer
efficiently.

RAM (Random Access Memory):


RAM is a program which consists of pre-set number of bytes which can store a limited amount
of information. Its set of bytes does not last long and is variable. On switched off, this memory is
completely wiped off from the computer.

Fig: Random Access Memory


Together, these 2 memories constitute microprocessor and makes it work with efficiency.
Without them, microprocessor possibly cannot perform any of its function properly. Among all
the functions, some of them are given below in summary:
Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

 It obtains instruction from the main memory.


 Then, the instruction is decoded in order to determine what action is to be done.
 Based on the instructions’ nature or requirement, data and information are fetched from
the main memory or input / output module.
 With the help of logical and arithmetic calculation, the instruction is then executed.
 Along with the execution of the instruction, it also controls and supervises the input /
output devices.
 If requested action gets interrupted from I/O devices, it suspends the current program's
execution and transfers to its control to an interrupt handling program.
 Finally, the instruction’s results may need to be transferred to memory or an I/O module,
throughout which the microprocessor keeps performing its tasks.

Input Devices
INTRODUCTION
The devices that are used to receive the data and instructions are called input devices. These
devices are used to input program and data to the computer. These are the parts through which
instructions or data are given to a computer for processing purpose. These input devices
converts input data and instructions into a suitable binary form which can be accepted by the
computer. Input devices are necessary to enter data and instructions into a computer as input
unit is the only medium through which users can interact with the computer.

COMMONLY USED INPUT DEVICES


 Keyboard
A keyboard is the primary input device through which instructions and data are entered into the
computer. It was first invented, in 1868 A.D, in America by Christopher Latham Sholes. This
commonly used input device mostly uses a Qwerty layout. The layout is called "Qwerty layout"
because such keyboard has those keys as the first 6 letters on top of an alphabetic line of a
keyboard.

Fig: Keyboard

A keyboard is connected to the CPU with a cable. When a key is pressed, an electronic signal is
produced which is then detected by an electronic circuit called keyboard encoder. The main
function of an encoder is to detect which key has been pressed and to send a binary code that is
Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

correspondent to the pressed key of a computer. This binary code may be ASCII, EBDIC or HEX
code.
Earlier, keyboard with serial port containing 9 pins was in use. These days, we have USB
(Universal Serial Bus) port keyboard and some even wireless. Keyboard with navigation keys like
play, pause, next, previous, etc. with multimedia functions is also available. There are 4 types of
keyboards for PCs now available. The first 3 were invented by IBM while, the latter is the result
of changes made when Microsoft Windows 95 was released. They are:

1. The 83-key keyboard (PC/XT)


2. The 84-key keyboard (PC/AT)
3. The 102-key keyboard (called the extended keyboard)
4. The 105-key Microsoft Windows 95-compatible keyboard)

 Mouse
A mouse is a small input device which is used to point, draw and select items that are displayed
on the computer screen. The pointer of the mouse is called a cursor. As we move the mouse
across the screen, the cursor moves according to the movement of the mouse. It was invented
in 1960 A.D by Douglas Englebart.

Fig:Mouse

A mouse is one of the most important and popular input devices. Its movement and the
direction of movement are detected by 2 rotating wheels on the underside of the mouse. These
wheels have their axes at right angles where, in each wheel is connected to a shaft encoder
which emits electrical pulses for everyday increment movement of the wheel. The pulses
transmitted by the mouse determine the distance moved.
There are 3 types of mouse found in a market.They are:
a.) Scroll mouse: It is a type of mouse which comes with a scroll wheel perpendicular to its
surface. This scroll wheel or a mouse wheel is made up of a rubbery disc or hard plastic on the
computer mouse. It is generally located between the right and left mouse buttons.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Fig: Scroll Mouse


b.) Optical mouse: It is a more advanced mouse which uses a light source, typically LED (Light
Emitting Diode), a DSP (Digital processing) and an optical sensor instead of the regular mouse
ball. It uses a light detector such as an image sensor or an array of photodiodes to detect any
relative movement to a surface.

Fig: Optical Mouse


c.) Laser mouse: It is an even more advanced mouse which uses laser to detect movements on a
surface. It can track more than 2,000 DPI (Dots Per Inch) whereas, a typical optical mouse can
track between 400 and 800 DPI only. This mouse emits light to the surface where it is put on.
The emitted light is reflected back which tells the computer to control the pointer on the
screen. Generally, laser mouse available nowadays is connected to the USB (Universal Serial
Bus) port.

Fig:Laser Mouse

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

 Joystick
The joystick was invented, in 1944 A.D., in Germany but the video game joystick was invented
in, 1967 A.D. A joystick is a stick which is mounted on a spherical ball which moves in a socket. It
allows the user to navigate easily around the display on the screen. A user may move the stick
on the device in different directions. This is particularly useful at homes for playing video games
and for indicating positions in graphic systems.

Fig:Joystick

 Touch Pad
A touch pad is a small touch-sensitive pad that is used as a pointing device in portable
computers. It can be used in place of an external mouse. It uses pressure sensors to track the
position of a device on its surface. Each position on the touch pad is translated to the specific
location on the screen.A touchpad is operated by using your finger.

Fig:Touch Pad

 Track Ball
A track ball is an upside down of a roller mouse. It was used to be a basic input device in laptops
earlier. It is similar to the mouse but with a mouse, the ball is rolled by moving the entire unit
over the surface whereas, with track ball, the ball itself is rolled with fingers.
Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

Fig: Trackball
 Scanner
The scanner is an input device that needs images or text and converts the data into digital
signals. The image is scanned and converted into a format that the PC can interpret. It was
invented by Rudolph Hell, in 1963 A.D, in Germany.

Fig: Scanner

A scanner works by digitizing an image, dividing it into a grid of small dots called pixel and
representing each dot with RGB value for that pixel value by binary bits. The resulting matrix of
bits is called a bitmap, which can be stored in a file and can be displayed on a screen.
 Bar Code Reader
The Bar Code Reader is a device which is used to read a barcode field. Bar Code is a technology
that uses white spaces and black bars to represent encoded information. This encoded
information can be read with an optical device that converts the bars and spaces into an
electrical signal which is then decoded into the original characters. The bar code was invented
by Woodland.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Fig: Barcode reader


The bar code reader is used in labeling consumer products and books. It is detected as ten
digits. The first 5 digits identify the supplier or manufacturer of the item whereas, the second 5
digits identify an individual product. The code also contains a check digit to ensure that the
information read is correct.
 Light Pen
A light pen is a pencil shaped device which is used to select screen positions by detecting the
light coming from points on a screen. It was 1 stinvented in 1952 A.D, in MIT (Massachusetts
Institute of Technology). A light pen is sensitive to the short burst of light emitted from the
phosphor coating at the instant the electron beam strikes on a particular point.

Fig: Light pen


Though the light pens are still in use, they are not as popular as they used to be as they have
several disadvantages comparing to other input devices.
 OCR (Optical Character Reader)
Optical Character Reader (OCR) is the device that helps in the recognition of printed or written
text characters by a computer. OCR is used for reading text from paper and translating it into a
form that the computer can manipulate. An OCR reader scans the document using the
photoelectric device to convert it into electric signals. These patterns are then compared with
the stored patterns of the characters which the reader can recognize. If a match is found, the
character scanned is identified otherwise, it is rejected by the reader. This device is widely used
in airlines, banks, postal offices (for reading postal code), etc.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Fig: Optical Character Reader


 OMR (Optical Mark Reader)
Optical Mark Reader is widely used device for scoring answers for multiple choice questions. It
can sense the presence of a pen or pencil mark. Special marks such as squares or bubbles are
prepared on examination answer sheets or questionnaires .The user fills in these squares or
bubbles with soft pencil or ink to indicate their choice. These marks are detected by the Optical
Mark Reader and the corresponding signals are sent to the processor.

Fig: Optical Mark Reader


 MICR (Magnetic Ink Character Reader)
Magnetic Ink Character Reader has been used to read documents that are written by a special
ink made of a magnetic material called magnetic ink. MICR is capable of reading characters on a
paper written with the magnetic ink which is magnetized during the input process. The MICR
reads the magnetic pattern of the written characters. To identify the characters, these patterns
are compared with a special pattern stored in the memory. It is mostly used in banks and postal
services.

Fig: Magnetic Ink Character Reader

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

 Touch Screen
Touch screen is a kind of screen which is sensitive to user’s touch. One can use a finger to point
the command or menu displayed on the screen. Touch screen was invented in 2009 A.D, in
Apple store. It is widely popular on laptops.

Fig: Touchscreen
 Voice Input System
The input system which is used to give the instruction to the computer invoice, without using
the keyboard i.e. without typing is called Voice Input System. In Voice Input System, the speech
is converted into electrical signals employing a microphone. The signals are sent to a processor
for processing. Then, the signal pattern is compared with the pattern already stored in the
memory .A word is recognized only when a choice is found, and then, the computer gives a
corresponding output.

Fig: Voice Input System


A voice recognition system can be used in factories at places where both hands of workers are
engaged in the job like if he is doing some handful of work and he wants to input some data into
the computer. It can also be used to assist handicapped people or for identification purposes in
banks, etc.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

COMPUTER ARCHITECTURE
In computer fields, computer architecture is a set of rules and ways that explain the
functionality, organization and implementation of computer systems. Some definitions of
computer architecture and organization describes the capabilities and programming model of a
computer but not a particular implementation.
The term computer is used to describe a device made up of a combination of electronic and
electro-mechanical (electronic and mechanical) components.
By itself, a computer has no intelligence and is referred to as hardware, which means simply the
physical equipment. A computer can`t be used until it is connected to other parts of a computer
system and software is installed.

The design, arrangement , construction or organization of the different parts of a computer


system is known as Computer Architecture. It is the conceptual design and fundamental
operational structure of a computer system.
It is a framework and functional description of requirements and design implementations for
the various parts of a computer, focusing largely on the way by which the Central Processing
Unit (CPU) performs internally and accesses addresses in memory.
It may also be defined as the science and art of selecting, interconnecting hardware
components to create computers to meet functional performance and cost.

HISTORY
The first document of Computer Architecture was a correspondence between Charles Babbage
and Ada Lovelace, that describes the analytical engine. Here is the example of other early
important machines: John Von Neumann and Alan Turing.
Computer architecture is the art of determining the needs of the user of a structure and then
designing to meet those needs as effectively as possible with economic status and as well as the
Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

technological constraints. In ancient period, computer architectures were designed and


prepared on the paper and then, directly built into the final hardware form. Later, in today`s
computer architecture, prototypes were physically built in the form of transistor logic (TTL)
computer such as the prototypes of the 6800 and the PA-RISC tested, and tweaked before
committing to the final hardware form. (Wikipedia and Quora)

LAYER OF COMPUTER ARCHITECTURE


Under the Computer architecture, it consists of 6 layers. They are as follows:

 Electrical and electronic component level


 Digital logic level
 Micro programmed level
 Machine level
 System software level
 Application program level

 Electrical and Electronic component level

Almost all the modern computer devices are built from a simple electric component such as
transistors, capacitors, a resistor which works on suitable power supplies.

 Digital logical level

All the basic operations of the machine are provided at this level. The basic element at this level
can store, manipulate and transmit data in the simple binary form. These digital logic elements
are called gates which are normally constructed or made from a small number of transistors and
other electronic components.
The standard digital logic devices are combined together to form computer processor or
computer memories.

 Micro program level

In this level, a sequence of microinstruction constitutes the microprogramming, which we called


firmware, which is permanently stored in ROM. At the time, when the computer was made
without microprogram level processor, it was built from a combination of a digital logic
component.
The use of micro programmed level enables a manufacturer to produce a family of processors
all of which process the same set of machine instruction at the machine level which differs in
terms of construction and speed.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

 Machine level

Several hardware levels are presented in machine level. These are the basic elements of the
computer. They are processor, input/output device, main memory, auxiliary storage, etc.

 System software level

The program that directs the internal operation of a computer system is called system software.

 Application software level

The program directs the computer to solve user-oriented problems are called application
software.
According to the Computer architecture, it has three subcategories:

 Instruction set Architecture


 Micro-architecture
 System Design

ROLES OF COMPUTER ARCHITECTURE


Computer Architecture is to design a computer that maximizes performance while keeping
power consumption in check, costs low relatively to an amount of expected performance and it
is also reliable.
There are many aspects to be considered like Set Design, Functional Organization, Logic Design
and Implementation are the first prior.

Computer Organization
Computer organization refers to the operational units and their interconnection that realize the
architecture specification. Computer organization deals with physical aspects of computer
design, memory and their types and microprocessors design.
Whereas computer architecture deals with design aspects of computer that assembly
programmer needs to know like instruction set (i.e. instruction supported), instruction format
(i.e. how instruction will be specified), addressing modes, data types supported, etc.
The difference between Computer Architecture and Computer Organization are:
Computer Architecture Computer Organization
Computer organization is concerned with the way
Computer architecture is concerned with the
the hardware components operate and the way
structure and behavior of computer system
they are connected together to form a computer
Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

as seen by the user. system.


It includes information, formats, instruction It includes Hardware details transparent to the
set, and techniques for addressing memory. programmer such as control signal and peripheral.
It describes how the computer performs.Ex, circuit
It describes what the computer does.
design, control signals, memory types and etc.

INTERFACES AND PORTS


A special piece of circuitry that is fitted inside a computer and sits between the computer and
the port is called interface. The purpose of an interface is to provide a compatible connection
between computer and port where the peripheral devices are connected.
A place where data can pass into or out of a central processing unit, computer, or peripheral is
called port.

TYPES OF INTERFACES
There are two types of interfaces. They are:

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

 Serial interface
 Parallel interface

Serial Interface
The serial interface is an interface which transfers one bit of data at a time. In a serial interface,
only one line or a pair of lines are used to transmit a data. It is used for low-speed peripherals.
Normally, serial interface is found in 9 pins. In the serial interface, data is transferred serially.
So, the speed is slow.
Parallel Interface
The interface which transfers set of a bit at a time is called parallel interface. In a parallel
interface, there are multiple lines to connect the peripheral to the port. A parallel interface is
used to transfer data at a faster rate for high-speed peripherals such as a printer; disk and tape.
A parallel interface is also known as Centronics interface as it was first popularized for
interfacing printers manufactured by Centronics. In parallel interface, data is transferred in
parallelly. So, speed is high.
A port is a socket on the outside of the system unit that is connected to an expansion board on
the inside of the system unit. A port allows connecting a peripheral device such as a monitor,
printer, or modem so that it can communicate with the computer system.
Port is defined as a connection point on a computer where we can connect a device that passes
data in and out of a computer. For example- a printer is typically connected to a parallel port
(also called LPT port), and a modem is typically connected to a serial port (also called a COM
port (COM1, COM2)).

FUNCTIONSOF PORTS

1. Ports are the connecting peripheral devices.


2. Ports are used to transmit data to and from peripheral devices.
3. It provides electrical power to those devices having low power requirement such as a
mouse, keyboard, pen drive, etc.

Some of the popular communication ports are given below:

 Parallel port

A parallel port allows lines to be connected that will enable 8 bits to be transferred
simultaneously, like cars on an eight lane highway. It moves information faster than the serial
lines.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

It can be used to transfer data efficiently only up to 15 feet. Thus, parallel ports are used
principally for faster speed devices such as connecting printers.

 Serial Port

A serial port enables a line to be connected that will send bits one after the other on the single
line, like cars on a one lane highway. Serial lines are used to link slow speed devices and
equipment that is not close by.

It is also known as an RS-232 port. Serial ports are used principally for communications lines,
modems and mice. They are frequently labeled COM for communications purpose.

 Universal Serial Bus (USB)

Universal Serial Bus (USB) is a serial bus standard to connect devices to a host computer. It was
designed to allow many peripherals to be connected using a single standardized interfaces
socket, to improve plug and play capabilities that allows devices to get connected and
disconnected without powering off the computer.
It includes providing power to low-consumption devices eliminating the need for an external
power supply and allowing many devices to be used without requiring manufacture-specific
drivers to be installed.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

USB is used to connect computer peripheral devices such as a mouse, keyboard, gamepad,
joystick, scanner, digital camera, printer, personal media player, flash drive, external drive, etc.
For many of those devices, USB has been a great medium of connecting to a computer.
The USB 1.0 was introduced in 1994 and created by the core group of companies that consisted
of Intel, Compaq, Microsoft, Digital, IBM and Northern Telecom. The USB 2.0 specification was
released in 2000 and was standardized by the USB-IF in 2001. Again, USB 3.0 specification was
released on 2008 by Promoter Group. Its transfer rate was up to 10 times faster than the
USB2.0 version and has been dubbed the Super –speed USB.
 IEEE 1394 Interface (Firewire port)
The IEEE 1394 interface is a serial bus interface standard for high-speed communication and
isochronous real-time data transfer, frequently used by the personal computer as well as in
digital audio, digital video and aeronautics applications.

(Firewire port)
It replaced parallel SCSI in many applications because of lower implementation cost and a
simple more adaptable cabling system in the computer system.
 SCSI port
SCSI port provides an interface for transferring data at high speeds for up to eight SCSI-
compatible devices. These devices include external hard disk drives, magnetic tape backup units
and the CD-ROM drives.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

SCSI port pronounced “scuzzy” and short for small computer system interface.
 Peripheral Component Interconnect (PCI Slot)
Peripheral Component Interconnect (often shortened to PCI) is a computer bus for attaching
hardware devices in a computer. These devices can take the form of an integrated circuit fitted
on the motherboard itself.

PCI specification or an expansion card, that fits into a socket PCI slots in PC helps to connect
devices like network cards, sound cards, internal modems, etc.

SOFTWARE
A software is a means of communication between the computer system and computer users. It
is the operating system and applications that are used in computers. Basically, it is the collection
of computer programs, documentation and procedures performing several tasks on a computer
system. Thus, it is considered to be the heart of computer systems.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Generally, computer software consists of a machine language consisting of groups of binary


values, specifying the processor instructions. The instructions change the state of computer
hardware in a sequence that is pre-determined. In conclusion, a computer system is a language
in which a computer speaks. There are 2 types of computer software. They are:
1.) System Software:
It is a collection of operating system, servers, device drivers, utilities and windows systems
which helps in running the computer hardware and the computer system. It is designed to
provide a platform to run application software and operate the computer hardware.
This software helps an application programmer to view away memory, hardware and other
internal complexities of a computer. Some of its common types are:
i) Operating system:
From performing basic tasks to running important programs, the operating system is the most
important program to run a computer. It is the 1stprogram that loads into memory when the
computer is turned on. Without the operating system, no other programs such as spreadsheet
software, word processing software, etc. can be run. So, in a sense, this system brings the
computer to life.
When given a command, the operating system issues the instructions to the ‘brain’ i.e. the CPU
or microprocessor. While working on the application software, such as Microsoft Word, your
given commands are sent through the operating system to the CPU. Some of its examples are
Windows2000, Windows95/98, DOS, UNIX, Mac OS, etc. Below are some of its functions.

 Provide security and backup.


 Booting computers.
 Controlling peripheral devices such as a keyboard, disk drives, printers, etc.
 Provide interface between software and hardware.
 Scheduling processes.
 Memory management.
Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

 Keeping track of files and directories on the disk.


 Recognize input from the keyboard.
 Send output to the display screen.

ii) Utility Software:


Utility software are set of collective programs, available to help you with the day to day chores
that are associated with personal computing and to keep your computer system run at peak
performance. These are designed to help manage, control and maintain computer resources.
Some examples of utility software are:

 Virus scanning Software / Antivirus: It protects computers from computer viruses.


 Scandisk: It scans disks for any potential problems on them, such as bad disk areas or any
physical error.
 Backup software: It helps in making copies of your files and even an entire computer
hard drive for backup and restoration.
 Debuggers: These are used mainly to solve programming errors.
 Disk Defragmenter software: It assists you in reorganizing those disk drives which have
been scattered across several hard disk locations while files are saved, deleted and
resaved again.
 File managers: They provide you a convenient method to perform routine data
management, management tasks and e-mail recovery.

iii) Language processor:


It is a special kind of computer software which translates the programs written in one language
into another language. It is compulsory for both low and high-level language. The types of
language translators are:

1. Compiler
2. Interpreter
3. Assembler

2) Application Software:
Application software is used to solve application type of problems. Business software,
educational software and databases are some forms of application software. This software
enables the users to accomplish certain specific tasks and utilizes the capacities of a computer
directly to a dedicated task. It can manipulate numbers, texts and graphics. It can also focus on
a certain single task like work processing, spreadsheet or playing of audio and video files. Its
types are:
Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

i) Package software:
Package software is for general purposes. Designed by software companies, it is mainly to
generalize the tasks. Some common package software are:
Word Processing Software:This software enables the users in creating and editing documents.
MS-Word, Notepad, Word pad and some other text editors are some most popular examples of
Word Processing Software.
Database Software:It organizes the data and enables the users to achieve database operations.
It also allows the users to store and retrieve data from databases. MS Access, Oracle, etc. are its
examples.
Spreadsheet Software:By displaying multiple cells that make up a grid, this software simulates
paper worksheets and allows the users to perform calculations. Its examples are Apple
Numbers, Excel, Lotus 1-2-3, etc.
Multimedia Software:This software allows the users to create and play audio and video media.
Audio converters, burners, players, video encoders and decoders are some forms of it. Real
Player and Media Player are examples of this software.
Presentation Software:This software is best used to display information in the form of a slide
show. It includes 3 functions.

1. Editing, allowing insertion and formatting of text.


2. A functionality of executing the slide shows.
3. Methods to include graphics in the text.

Microsoft Power Point is its best example.


ii) Tailored software:
Tailored Software is also called small type of software. Tailored software is for specific purposes.
Written in high-level languages such as C, JAVA, C++, COBOL (Common Business Oriented
language), etc. these types of software are developed for a specific task. Banking software,
hotel reservation software, hospital software, billing software, etc. are its examples.

Computer Virus
Computer viruses are the programs or malware which are loaded onto your computer by ‘mean’
people, without your knowledge. These viruses replicate relentlessly and infect computer
programs. They might even delete or corrupt your computer data or erase your hard disk too.
These virus programs are placed into commonly used programs. So, when those programs are
run, the attached virus infects the executable program or file.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

These viruses are not of same purposes. Some have destructive intents while some are designed
to play annoying tricks. Some might present themselves as jokes while doing destructive
functions secretly. There are 2 major kinds of viruses. They are:

1. Compiled Viruses:executed by the operating system.


2. Interpreted Viruses:executed by an application.

Symptoms of Virus:

 Slowing down of the speed of the computer.


 Change in files’ extension.
 A long time in the loading of a program.
 Showing of unusual error message on the screen.
 System data corruption.
 Memory space reduction in a computer.
 Inaccessibility to the location of files.

Prevention of Virus:

 Password protection should be employed.


 Execute familiar programs only as to their origin. Programs sent by e-mail should always
be suspicious.
 Load software only from original CDs or disks instead of pirated or copied ones.
 Check all shareware and free programs downloaded from online services with a virus
checking program.
 Computer uploads and “system configuration” changes should be always performed by
the computer owner.
 Purchase or download an anti-virus program that runs as you boot or work on your
computer. Also, update it frequently.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Types of Viruses

1. Trojan Horse: Appearing as a useful and desired function, a Trojan Horse program
neither replicates nor copies itself, but causes damages and compromises the security of
a computer. This virus program may arrive in the form of software of some sort or a joke
program that must send by someone or carried by another program.
2. Worm: It is a program that copies and facilitates self-distribution from one disk drive to
another or by copying itself using e-mail or any other transport mechanism.
3. Macro Virus: These viruses infect documents such as MS Excel or MS Word and other
similar documents. These viruses use another application’s macro programming language
to distribute themselves.
4. Boot sector Virus: Normally, spread by floppy disks, this virus attaches itself to the
1st part of the hard disk which is read by the computer upon boot up.
5. Polymorphic Virus: A Polymorphic Virus is a very sophisticated virus program as it not
only replicates itself by creating multiple files itself but also changes its digital signature
each time it replicates.
6. Memory Resident Virus: This virus is initiated from a virus within the computer and they
stay in a computer’s volatile memory (RAM) after its initiating program closes.

Computer Antivirus
An antivirus is a computer software designed to scan, detect and remove viruses and malicious
software from computers. This software defends your computer against computer viruses that
threaten to infect your computer files and systems. In order to be an effective defense virus, an
antivirus needs to run all the times in the background and should be kept updated frequently.

Originally developed for the detection and removal of computer viruses, with the emerge of
several kinds of viruses, antivirus software programs started to protect from other computer
threats. Antivirus scans the files and folders and alerts the user if viruses are found. Some
known and popular antivirus software are Kasper-sky, Avira, Norton, Avast, AVG, etc.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Identification Methods:

1. Sandbox detection
2. Data mining techniques
3. Signature based detection
4. Rootkit detection
5. Heuristic detection

Bus Architecture:
A bus is a collection of wires, chips and slots inside the computer through which data are
transmitted from one part of the computer to another from peripheral devices. It is also called a
pathway in the computer on which data travels. It is a set of parallel distinct wires, serving
different purposes, which allow devices attached to it to communicate with the CPU.
The bus architecture in computer system is as shown below:

Figure: Bus Architecture


The function of BUS are:

 It carries information from one component to another.


 It carries data, address or control signal.
 One component of the computer can interact with other through a bus.

There are three main part of bus. They are described below:

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

1. Control Bus:

It carries the control signal. The control signal is used for controlling and coordinating the
various activities of the computer. It is generated from the control unit of the CPU. Different
architectures result in a different number of lines within the control bus, as each line is used to
perform a specific task.
For instance, different specific lines are used for each of read, write and reset requests. These
are not a group of lines like address bus and data bus, but individual lines that provide a pulse to
indicate a microprocessor operation. The control unit generates a specific control signal for
every operation, such as memory read or input/output operation. This signal is also used to
identify a device type, with which the microprocessor intends to communicate.

Fig: Control Bus

2. Address Bus:

Address bus carries memory address within the device. It allows the CPU to reference memory
locations within the device. It connects the CPU and other peripherals and carries only memory
address. In a computer system, each peripheral or memory location is identified by a numerical
value, called an address and the address bus is used to carry this numerical value as well as it
also contains a few control lines to carry control commands. The address bus is unidirectional,
bits flow in one direction from the processor to peripherals.
The processor uses the address bus to perform the first function of identifying a peripheral or a
memory location. The address bus contains the connections between the processor and
memory that carry the signals relating to the address which the CPU is processing at that time,
such as the locations that the CPU is reading from or writing to. The processor uses the address
bus to perform, identifying a peripheral or a memory location.
When the address bus carries 8 bit at a time, the CPU could address only 256 (i.e. 2 8) bytes of
RAM. Most of the early PCs had 20 bit address buses. So, CPU could address 2 20bytes of data.
Now, with 32-bit address buses, CPU can address 4GB of RAM. If there is wider bus path, more
information can be processed at a time and hence, it also affects the processing speed of a
computer.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Fig: Address Bus

3. Data Bus:

Data bus transfer data from one location to another across the computer. On these lines, the
meaningful data which is to be retrieved from a device is placed. Data bus is used by CPU to
transfer data. It may be 16-bit or 32-bit data bus. It is an electrical path that connects the CPU,
memory and other hardware devices on the motherboard. These lines are bidirectional in which
the data flows in both directions between the processor and memory and peripheral devices.
The number of wires in the bus affects the speed at which data can be travel between hardware
components just as the number of lanes on a highway affects the time it takes people to reach
their destination. Each wire can transfer 1 bit of data at a time and 8 wire bus can move 8 bit at
a time, which is 1-byte data at a time. A 16-bit bus can transfer 2 bytes. 32 bits can transfer 4
bytes and so on. Intel 80286 microprocessor used16 bit data bus and Intel 80386 used 32-bit
data bus. When the data bus width grows larger, more data can be transferred.
The transmission of the data on bus lines takes place between approximately 1M baud for the
microcomputer to about 1000 M baud or more for the large more expensive computers (1 baud
= 1 bit/sec). Communication between the different units of a processing system is carried out
along address and data bus and also along various control lines. All control operations are
governed by the master timing source and clock.

Fig: Data Bus

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Operating System can be classified into the following categories:


1. Classification of OS based on the Processing Method:
Multiprogramming OS:
A multiprogramming technique is used in the multi-user environment. It is the technique in
which multiple users programs are executed simultaneously by single processor or CPU.
Multiprogramming means when two or more programs are provided to the CPU for processing
or loaded into the internal storage of CPU at the same instant.

From the loaded programs, once the portion of one program is executed and after the
completion of previous program, the portion of another program is executed and this process
will go on until all the program don't get executed. Thus, it refers to the concurrent execution of
several programs. The main purpose of multiprogramming is to increase the utilization of the
computer and its resources.
High-speed CPU allocates its time to every program in a time sharing mode and in such a
manner that user feels that CPU is working for program only but in reality, the CPU is working
for other programs too at the same time.
Multitasking OS:
A multitasking OS allows more than one program to run concurrently mainly in a single user
system. Multitasking computers are capable of running several tasks or programs at the same
time. For executing several tasks, it can be single or multiprocessing system.
In some system, one of the processes is called the foreground (front panel or active) that
accepts input from the keyboard, mouse and other input devices. Background processes data to
the video display. For example, some word processors print files in the background,
(Simultaneous Peripheral Operation On-Line).

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Fig: Multitasking with three program


Presently, most of the operating systems like MS Windows, Linux and Mac OS are multitasking
operating systems. There are two types of multitasking OS: pre-emptive and co-operative. Pre-
emptive multitasking is task in which a computer's operating system uses some criteria to
decide how long to allocate to any one task before giving another task a turn to use the
operating system. Co-operative multitasking is a style of computer multitasking in which the
operating system never initiates a context switch from a running process to another process.
Multiprocessing OS:
A multiprocessing system has more than one processor linked together in a coordinated way. A
multiprocessing OS is one which supports running a program in more than one Central
Processing Unit (CPU). Server Systems and Super Servers are specially designed to support
multiple processors. MVS and UNIX are the two example.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Fig: Multiprocessing
It involves two or more processors (CPU) for controlling the different activities or execution of
many programs / instructions simultaneously. Multiprocessing concept is known as parallel
processing because parallel means solveing one big task or many tasks at the same time. It helps
to increase the program execution speed of the computer and it is more costly and complex
technique to employ.
Time-sharing System:
Time sharing system is a form of multi-programmed OS that operates in an interactive mode
with a quick response time. The user provides a request to the computer through a keyboard.
The computer processes to and a response (output) is displayed on the user`s terminal.

Fig: Time-sharing system


Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

It takes a very small fraction of time for each action or command. Only a little CPU time is
needed for each user. The CPU switches so rapidly from one user to another that each user is
given an impression that s/he has his/her own computer, while actually, it is one computer
being shared among many users.
Multithreading OS:
A program in execution (process) can be divided into multiple smaller sub-processes. These sub-
processes are known as a thread. Multithreading OS has the ability to divide the process into
threads and execute them concurrently. Threads are individual processes that execute
simultaneously in multi-tasking OS.

Fig: Multithreading
Threads are individual processes that execute simultaneously in multi-tasking OS. The
programmer must carefully design the program in such a way that all threads can execute at the
same time without interfering with each other. Each processor can handle different tasks or
different threads of execution for a single task and more processors can be added as necessary.
Threads are more useful because they eliminate the need for the OS to constantly load and
unload information to and from memory. This reduces overhead not only in memory space but
also in the time it takes to create the information in memory. It interacts with different parts of
the systems such as disks systems, network or the user.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Batch processing OS:


In batch processing environment, it requires grouping of similar jobs which consists of
programs, data and system commands. It is also known as offline processing. This type of
processing is suitable for programs with large computation time with no need of user
interaction and involvement. Examples are: Payroll, Forecasting, Statistical analysis, etc.

It does not allow the interaction between users and program during execution. The time taken
between job submission and job completion is very high. It is an older processing concept. Batch
processing OS is non-interactive environment and offline debugging, which means that a
programmer cannot correct bugs when it occurs. It has to be in later on.
Online processing OS:
In the online processing, method transactions are processed as soon as it happened and at the
place of origin. It is quite simple compared to real time processing. In this type of processing OS,
a user can interact or provide inputs during processing as well.

Fig: Online processing


Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

The output is provided back to the users as soon as the processing is completed. It is the
popular processing technique at a present time.
Real-time OS:
The real-time processing method is one that controls environment by receiving data, processing
them and taking action or returning results sufficientlyand quickly to affect the functioning of
the environment at that time.

It is an online processing system in which the processing time is critical. The entire processing
task has to be completed in the predefined time. The term real time refers to the technique of
updating files with the transaction data immediately after the event which it relates, occur.
Real-time OS is suitable for the following operations:

 Wholesale, supplier and manufacturer – Availability of stocks.


 Airlines or flight seat availability –Manufacturing status of production orders and flight
control.
 Monitoring and controlling nuclear power stations.
 Rocket launching system.
 Here are the examples of Real-time OS: Basic Real-time Monitor (Real-time OS for the
Philips p-885, p-860), CCP(Communications control program limited OS for the IBM
System /3) and CTOS (Real-time, multiprocessing, multitasking OS for 8086 families)

2. Classification of OS based on the User Interface


A user interface allows a user to communicate with the computer. A user interface brings
structure to the interaction between user and computer. There are mainly two types of user
interface. They are:

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

 Graphical User Interface (GUI)

A graphical user interface allows a user to enter commands by pointing and clicking at objects
that appear on the screen. It takes advantage of the computer`s graphical capabilities to make
the program easier to use for the users.
Well designed GUI can free the user from learning complex command languages. On the other
hand, many users find that they work more effectively with a command-driven interface,
especially if they already know the command language.
As a Graphical User Interface, it needs a lot of RAM and hard disks for the smoother execution.

Here are the features of Graphical User Interface (GUI):

 GUI interface is easy to operate and user-friendly.


 Users don`t have to understand the syntax.
 An amusing environment can be created because of a friendly environment.
 Users don’t have to remember all the commands.
 It requires larger space and faster processors to operate.
 GUI based OS are usually 32bit or 64bit Oss.
 It is capable of operating multitasking, multiprogramming and multiuser systems.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

 Character User Interface (CUI)

In character/command-driven system, to communicate with the computer, the user has to


instruct the computer in special commands (words). DOS is a very commonly used command-
driven user interface. CUI are very difficult to use if the user is a beginner or doesn`t know the
correct commands.
Command-driven systems can be very unfriendly and confusing for non-computer experts to
use. However, it can be used other older system with low processing capability and low
memory.

Fig: Character user interface


Features of Character User Interface (CUI)

 CUI is less user-friendly that GUI.


 Commands are used to instruct the computer.
 The user needs to remember the commands for operating this system.
 It cannot display graphics, icons, pictures, multimedia, etc.
 CUI based OS are usually 8 or 16 bits OS.
 It is much faster than GUI based systems.
 It is single tasking and single user OS.
 It can be used in low memory and low processing speed computers.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

3. Classification of OS based on the Mode of User


Under the classification of OS based on the Mode of User, it consists of two OS and they are:

 Single User OS:

The majority of small microcomputer based systems have single user OS, which allows a single
user to operate the machine in an interactive mode but normally, only allows one user program
to be run in main storage and processed at a time i.e. there is no multiprogramming of user
programs.

Fig: Single user OS


There is a number of well-established OS that falls into this category such as MS-DOS, PC-DOS
are single user program or operating system.

 Multi-user OS:

A multi-user OS allows two or more users to run programs at the same time. Some permit
hundreds or even thousands of concurrent users. Some of the examples are UNIX, LINUX etc.
The multi-user OS shares computer resources among these users, allowing each a small slice of
the processor time.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Fig: Multi-user OS
This concept is known as time-sharing. Due to the high speed of computers, the overall effect of
time-sharing is that it gives the users the impression that they are all being served at the same
time even through the OS serfs them one at a time.

MS-DOS
Ms-Dos is a result of shortening of Microsoft operating system. It is a popular operating system
designed by Microsoft corporation for the user of IBM compatible computer and is replaced by
its extension of Windows OS. It is a Character User Interface (CUI) or Text Based Interface (TBI),
in which all commands and correct meaning have to be remembered and all are in text form.
The main function is to establish the relationship between hardware and software. It also
provides an executable environment to the software inside the system. Out of this, it also allows
a user to communicate with a computer by all the way by the use of commands called DOS
command.
Thus, it is an interpreter between hardware and software and provides the working
environment to the users. It also controls the hardware, such as the keyboard, monitor, printer,
etc.
Features of MS-DOS:

 It is the primary type of OS, used before the Windows was developed.
 It is a 6-bit operating system developed for personal computers.
 It uses CUI. So, a user needs to provide instructions through the text and internal
commands.
 It uses two types of commands: externals and internal commands.
 It does not provide graphics facility but, some application programs which runs under
DOS and may provide graphics facility.
 Improved memory management capabilities

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

 Hierarchical file directory structure.

CUI (Character User Interface)


The operating system which provides the user with the faculty of entering commands through
interactive terminals for initiating program and applications is called CUI OS. CUI based on OS
allows a user to type their commands using the keyboard to get computer’s response. The
response is to display on the screen .
CUI never call a program running. Under it, we have to give a command to create the folder,
copying files, deleting folder, etc. Examples: MS-DOS, PC-DOS.
Characteristics of CUI:

 They are very difficult to use because the user needs to memorize the command and
syntax.
 Not user operating system.
 Graphics design and image are presented to the user in the form of a text line.
 It does not support multimedia and animation.
 Input and output are provided to the user in the form of a text line.

File
A file is a collection of related information. It has a name with the extension that specifies a type
of file. Executable files are also called Program files and often have an extension like .exe and
.com. Examples: practical.doc, where practical is a file name and .doc, is an extension.

TYPES OF FILES
Basically, there are 4 types of files. They are:

1. Program or executable file (.exe, .com, .bat)


2. Graphics file or picture files (.bmp, .jpg, .gif)
Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

3. Data file (.dat, .mdb)


4. Text file (.doc, .txt, .ini)

There are some rules for writing the file name. Such as:

 The primary filename cannot be more than 8 characters. Example: computer.jpg


 Extension file name cannot exceed 3 characters. Example: vtae.xls
 No blank space is allowed between file name and extension.
 Primary and extension file name are separated by a period dot (.).
 Punctuation marks; @, $, ^, #, %, can be used for file name. Example: [email protected]
 Rest of the other symbols is not allowed to use in a file name.
 Characters (a-z, A-Z) and numbers (0-9) can be used for a file name.

Directory
A directory is a catalog for files stored on the disk of personal computers. It is used for
organizing the files on the disk to make it easier to find the files. It contains the names of the
files, size, date and time the stamps are created or modified. The root directory is the initial
directory of a storage disk. All other directories on that are sub-directories of that root. The root
directory is indicated by the backslash (/). A subdirectory is a directory within another directory.
Rules for writing the directory names:

 Directory name must not exceed 8 characters.


 The extension can be up to 3 characters.
 Blank space is not allowed.
 Both the upper and lower case letter are accepted.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Given figure represent the


directories:

Wildcard Character
Wildcards are characters that can be used to stand-in for unknown characters in file names. In
DOS, wildcard characters can match up with any character that is allowable in a file name. There
are two wildcards in DOS:
*: Matches up with any combination of allowable characters.
? : Matches up with any single allowable character.
The asterisk character '*' can stand in for any number of characters.
Some example of this command:
C:\>del*.doc
This command would delete every file with the doc extension from the root directory of C:
The question mark wildcard, ? stand in for any single character.
Some example of this command:
C:\>del?.doc
This command would only delete files that had a single character a.doc or 1.doc is history, but a
file like io.doc is perfectly safe as it has two characters.
System files
This operating system has three essential files and many command files for booting the
computer system. The files are:
Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

 SYS: This file let the DOS communicate with hardware through the BIOS. It provides the
basic capabilities of I/O. SYS direct the overall process of loading the OS.

 MS-Dos.SYS: This is the program used by application programs. It contains special


subprograms to make common operations easy for the programs. It runs after the IO.SYS.
It contains the core operating system code called kernel.

 com: This file accepts and understands the common that enter using the above two files
to give desired results. It is the command interpreter.

 Sys: Config.sys is a kind of text file containing special Dos commands that tell the OS how
the component so that MS-Dos and application can use them.

 BAT: All the programs that are supposed to run at startup are called BAT. It is a file used
to run initialization programs and command that, we would normally type each time we
sat on the computer.

Desktop:
The desktop is the background displayed on your computer screen. It is the total visible area on
the screen which users get immediately after turning on the computer. Files, folders, and
program icons can be displayed on the desktop for easy access to users.

Figure: Desktop
On the desktop, files, folders and programs are displayed on window frame. The desktop may
contain many items such as Computer, Network, Recycle Bin, User, etc. The desktop can be
customized with themes and backgrounds to personalize the look of the computer.
Start Menu:
The start menu provides access to the most useful items on your computer including all
programs, most recent documents, help and support and other items on your computer.
Present Windows includes more Start menu customization options. This menu appears by
clicking on the start button.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Fig. Startup menu


Icons:
Icons are the small graphical image used in GUI OS environment. It represents the symbolic
meaning of the command, file, program, web page, etc. Icons help to execute commands, open
programs or documents quickly. To execute a command by using an icon, click or double-click
on the icon. An icon is a group of images of various formats (size and colors).

Fig. Icons
Window:
Windows are frames on the desktop that contains the contents of opened files, folders, and
programs. In other words, it is usually a rectangular portion of the display on a computer
monitor that presents its contents (e.g. the contents of a directory, a text file or an image) on
the screen. Windows are one of the elements that comprise a graphical user interface (GUI).
Task Bar:
The taskbar displays opened files, folders, and programs. When multiple windows are open, you
can click on the file, folder or program buttons in the taskbar to switch between windows.

Fig. Task Bar

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

List of components of tasks bar:

1. Start button
2. Quick launch bar
3. System trays with some programs
4. Time bar

For example, all documents using the same extension have the same icon. Some folders can
have a customized icon applied to them. The name of file, folder or program is displayed under
the icon.
Computer:
Computer folder displays all hard disk drives and removable storage devices connected to your
computer. Double-clicking on a drive or removable storage device displays its contents.

Fig. Computer

To open the computer Folder:

1. Click on start Icon>Computer or double-click on the Computer icon.

Documents:
Documents folder provides a place to store all of your files. When you save a document, the
default save location is the Documents folder:

Fig. Documents
Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

To open the Documents Folder:

1. Click Start>Documents or Double-Click.


2. Networks
3. The Networks folder displays all the shared resources connected to your computer by a
network.

Networks:
The Networks folder display all the shared resources connected to your computer by a network.

Fig. Networks
To open the Network Folders:

1. Click start>Networks or Double-click on the Networks.

Recycle Bin:
When you delete a program, file or folder, it is moved to the Recycle Bin. The Recycle Bin gives
you the opportunity of retrieving your deleted items later if you change your minds. Items in the
Recycle Bin still take up hard disk space.

Fig. Recycle bin


When the Recycle Bin is full, Windows automatically cleans out enough space to accommodate
the newest deleted items. By default, the Recycle Bin is located on your desktop.
To restore items from the Recycle Bin:

1. Double-click on the Recycle Bin on the desktop. This opens the Recycle Bin windows.
Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

2. Select the items you want to restore.


3. Click the Restore this item link in the Recycle Bin Tasks area.

Music:
By default, the Music folder is situated in the Libraries folder. When you use Windows Media
Player to copy music from a CD or download music from the Internet, the default save location
is the music folder.

Fig. Music
To open the Music folder:

1. Click start>Music.

Pictures:
By default, my pictures folder is situated in the libraries folder. When you save pictures from
your digital camera or scanner to your computer or save a file in a graphics program, such as
Microsoft Paint, the default save location is the pictures folder.

Fig. Pictures
To open the Pictures folder:

1. Click start>My pictures.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

2. Working with files and folders


Folder:
Folders on a computer provide a storage system similar to folders in a filing cabinet. Folders can
contain files and other subfolders. Windows provides a number of personal folders to start your
computer filing system. A folder is typically represented by a folder icon. The folder name is the
icon. The folder in Windows is also known as a directory in DOS.

Fig. Folders
Creating the personal folder on the desktop:

1. Right click on the desktop.


2. Select New>folder.
3. Give the name of the folder then press enter.

Alternative way to create the personal folder:

1. Click on the file>folder.


2. Give the name of the folder then press enter.

Operating a file or folder:

1. Double-click on the file or folder you want to open.


2. The file or folder is displayed in a window.

To copy or cut files and folders:

1. Right click on the file or folder you want to copy or cut.


2. From the pop-up menu, Select Copy or cut.
3. Open the location you want the copied or cut item to be placed.
4. Right-click in the location.
5. From the pop-up menu, select paste.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

To rename files and folders:

1. Right-click on the file or folder you want to rename.


2. From the pop-up menu, select rename.
3. Type a new name.
4. Press the Enter key on your keyboard.

To delete a file or folder location in a folder:

1. Select the file or folder you want to delete.


2. Right, click on the file or folder you want to delete.
3. From the pop-up menu, select Delete.

OR

1. Select the file or folder you want to delete.


2. Press the Delete key on your keyboard.

Changing File and Folder Views:

Fig. Changing file and folder views


To change how the files and folders within a folder are viewed:

1. Click the Change your Views option.


2. Select the file and folder view you want.

Display File and Folder Properties:


Files and folders have property sheets that include information such as the type, size and
location of file or folder; the data of a file or folder was created, modified or accessed; file and

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

folder attributes; the name of the program that opens a file and the number of files or
subfolders contained in a folder.
To display properties for files and folders within a folder window:

1. Select the file or folder (in the folder window) for which you want to display properties.
2. Right –click on the file or folder for which you want to display properties.
3. From the pop-up menu, select properties.

Modifying Folder Options:

1. Open the folder for which you want to modify.


2. Select Organize> Folder and Search Options.
3. This opens the folder Options dialog box.
4. Make the folder modifications you want
5. Click OK.

Using Task Panels:


Task panels provide an easy way to access the most commonly used folder tasks. The task panel
displays a list of hyperlinked tasks to the left of the folder contents.

Fig.Using task panel


Several folders offer additional specialized hyperlinked tasks. For example, the pictures and
Music folders offer links that help you manage your picture and music files. The recycle bin
offers links to empty the Recycle Bin or restore items from Recycle Bin.
Computer folders offer links to view system information, add or remove programs, and change
system settings.
Searching Files/ folders using search companion:

Fig. Searching files and folders


Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

Enhanced for Windows 7, the Search Companion is designed to help you quickly find what
you`re looking for.

1. Click start Icon


2. Type whatever you want to search.

3. Working with a Windows Application Program


Customizing the Desktop:
By default, the Windows theme is applied the first time you start Windows. A desktop theme
affects the whole look of your desktop.

Fig. Customizing the desktop


To apply a desktop theme:

1. Right click a desktop.


2. From the pop-up menu, select personalize. This opens the Personalization dialog box.
3. Select a theme from the Theme option.

To apply a desktop background:

1. Right click on the Desktop.


2. From the pop-up menu, select Personalize. This opens the Personalization dialog box.
3. Click the Desktop Background option.
4. Select a background from Background list.
Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

5. Click on Save Changes.

Control Panel:
As you`ve read earlier Control panel is one of the most important system folders, which consist
of various controlling program`s icon to control an overall operation of the Windows. The
following is the Sample of Control panel.

Fig. Control panel


Date and Time:
With the help of this option, we can change / set our system date and time as we need.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Display:
This option is to customize the Desktop environment.
Keyboard:
We can set keyboard settings like its character repetition and cursor blinking rate, a width of the
cursor.
Program and Features:
This option allows the user to do following things;
Allows users to uninstall and change existing software packages, as well as indicating how much
space individual programs take and how frequently they are used.

1. Allows users to manually install software and install add-ons from Windows Update.
2. Allows users to change which Windows components are installed.

Administrative Tools:
This option contains tools for system administration, including security, performance, and
service configuration. These are the links to various configurations of the Microsoft
Management Console such as the local services list and the Even Viewer.
Windows Update:
This option is used to specify how the automatic updates client should download updates from
Microsoft update website, by default this is set to download and install daily.
Windows Keyboard Shortcuts:

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Use shortcut keys as an alternative to the mouse when working Windows. You can open, close
and navigate the Start menu, desktop, menus dialogue boxes and Web pages using keyboard
shortcuts. It makes users use Windows easy.

Introduction and Role of Operating System

An operating system is an integrated set of programs that controls the resources (the CPU,
memory, I/O devices etc.) of the computer system. It provides an interface to its users, which is
more convenient to use than the bare machine. Making a computer system more convenient to
use and managing the resources of the computer system are the two primary objectives of an
operating system. An operating system is a collection of programs that controls the overall
operation of the computer system. Operating system controls and coordinates the use of the
hardware among the various application programs for the various users. So it acts as an
interface between the user and the computer hardware.
An operating system manages and coordinates the function performed by the computer
hardware, including the CPU, input/output devices, secondary storage device, and
Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

communication and network equipment. The operating system is the most important program
that runs on a computer. For every purpose, a computer must have an operating system to run
other programs. It performs basic tasks, such as recognizing input from the keyboard, sending
output to display units, keeping track of files and directories on the disks, and controlling
peripheral devices such as disk drives and printers. The operating system also hides the
complexities of the hardware from a user.
The operating system is also defined as a program suite of programs that control the input and
output devices. The primary goal of an operating system is to maximize the productivity of a
computer system by operating it in the most efficient manner and minimizing the amount of a
human intervention required. MS-DOS, MS Windows 3.1, UNIX, LINUX, MS Windows 2000, etc.
are the examples of an operating system.

The function of an operating system are described below:


 IO Management
Input/output (IO) is an essential element for the operation of any computer. It allows the
computer to interact with peripheral devices such as a keyboard, mouse, terminals (like
modem, TV card, and NIC card), disks or tapes (CD, DVD, and Floppy disk), printer etc.

Fig: IO Management
 Command interpreter
The command interpreter reads the commands that a user types at a terminal, interprets them,
and translate them into a detailed set of instructions that the computer hardware can
understand. It varies from one OS to another. Every OS must provide command interpreter of
its operation.

Fig: Command Interpreter


Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

 Data Management:
Data management allows organizing their data into logical groupings called files. Earlier, only a
few of OS provide data management, containing limited flexibility and usefulness. At present,
most of the OS provides this feature.

Fig: Data management


 Memory
Memory management is the function responsible for managing the computer's primary
memory. Memory is a large array of words or bytes, each with its own address. When the user
requests to the CPU for read/write operation, OS determines the amount of memory required
for the program instructions and data. Then, OS allocates required memory to load the program
and data into RAM. When a program terminates, its memory space is free and the same
memory area can be allocated to another program.

 Process Management
Process management is the process by which operating systems manage processes, threads,
enable processes to share information, protect process resources and allocate system resources
to processes that request them in a safe manner. It finds the status of processors and processes
(Traffic controller), chooses a job (job scheduler), chooses process in the job (process

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

scheduler), allocates the processors to the process (dispatcher), and free the processor when
the process is executed.

Fig: Process Management


 Device Management
The device management allocates a device to a process. It finds the status of device, channels
and control units, finds answer to questions like which process, which device how much and
allocates the device to the process (IO Scheduling), initiates the IO operation and finally free the
device when the process is completed.

Fig: Device Management


 File Management
The file management keeps track of all information on files. It is an opens and closes files. It
finds and records the following for all files: location, size, usage (attributes) status etc. It also
finds as to which process wants which files, checks through the protection routine, opens the
file if allowed, and allocates it to the process. Finally, it closes the file when the process is
executed. Processor management is at a low level which is very near to the machine whereas
file management is at a higher level which is very near to the user.
Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

Figure: File management


 Time sharing
Time sharing management is a function of OS which involves the CPU to allocate the time to a
number of users on the same computer. it is generally found in network operating system. As
the number of users increases the response time for each terminal declines. Time sharing
creates the illusion to the each user so that they are the sole user of the system because the
speed of the CPU compared to that of the monitor and terminal, which is so much faster.
thereby giving each time slice for each user to operate the program interactively. Time sharing
manages the time of CPU. Time sharing checks for CPU requests from higher-priority processes
that are made every 10 milliseconds.

Figure: Time sharing


 Security
The security feature protects one user from another and the OS as a whole from all users. Its
main function is to make sure that only authorized users to get access from the computer, and
the users only do things they are authorized to do. Larger OS provides some kind of security but
the degree varies from one OS to another.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Figure:Security Policy
 Deadlock prevention
During the processing, a situation can arise in which a resource (hardware or software) shared
by two or more processes cannot continue because the resource required by a process is held
by another. This situation is known as deadlock. For example: if process 1 is allocated to
resource A and later it requests resources B, and process 2 is allocated to resource B and later it
requests to resource A. in this situation, neither process 1 nor process 2 will be executed. Such a
situation is known as deadlock.
OS ensures that the above condition does not hold, and thus prevents it from deadlock. It takes
suitable action by the careful allocation of resources so that deadlock can be avoided. If
deadlock cannot be avoided. OS detects it and tries to recover from it.

Fig: Deadlock prevention


 Interrupt handling
An interrupt is a signal from a device attached to a computer or from a program within the
computer that causes the main program that operates the computer (the operating system) to
stop and figure out what to do next. Almost all personal (or larger) computers today are
interrupt-driven- that is, they start down the list of computer instructions in one program
(perhaps an application such as a word processor) and keep running the instructions until either
(A) they can't go any further or (B) an interrupt signal is sensed. After the interrupt signal is
sensed, the computer either resumes running the program it was running or begins running
another program.

Figure:Interrupt Handling
Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

 Virtual storage:
In a multiprogramming system, there can be many programs located in the memory along with
the operating system. If the program is larger than main memory of the computer, operating
system uses free space of secondary memory which is termed as virtual memory. It is not
necessary to have the entire program in primary storage at one time, only the part on which the
computer is working is needed. The area of secondary storage used for storing pages is called
virtual storage.

Figure: Virtual Storageu


OPEN SOURCE OPERATING SYSTEM
Open source is a methodology or approach towards the design and development of software
with the intention of giving the user to access the source. If we use open source software, not
only we will be able to use it, but also will be able to see how it works, debug it, modify it and
redistribute it. Open source software is licensed in a way that makes it legal to use as many
copies of it as you want, and wherever you want. That software usually uses less resource than
its commercial counterpart because they don’t have any code for licensing, authentication and
promoting other products to attach an advertisement etc.

There is a core difference between open source and free software. Both represent the same
core idea. Open source allows the commercial utilization of the code with the motive of profits.
Many companies such as Red Hat gain significant revenue from sales, distribution, maintenance

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

and consultancy services provided by open source software. However, free software cannot be
used for commercial purpose.
Being an open source program, the program codes of an open source operating system are
available. The user can modify those codes and develop new applications according to his/her
requirements. Some common examples of open source (OS) are Linux, Minix, Free BSD, Open
BDS, Open Solaris, FreeDOS, FreeRTOS, E/OS etc.

Introduction to UNIX, Linux and Mac OS


UNIX

UNIX is a powerful, flexible and manageable OS with good utilities and communication abilities.
It is multiuser, multitasking and multiprocessing operating system. It was used in bigger size
machines like mainframe and minicomputers. It was developed in AT&T Bell labs around 1970.
The development of UNIX has given birth to many operating systems that can work on different
types of sizes of computers. For example, UNIX has developed in ‘C’ and assembly language.
Many of the popular commercial operating system e.g. Linux, Xenix, HP UNIX, SUN OS etc. has
inherited its main features.
Linux

Linux is an open source powerful UNIX-based OS. It's OS runs on a variety of platforms, including
Intel, SPARCE, PowerPC and DEC Alpha processors as well as multiprocessing systems. It was
developed by Linux Torvalds, at the University of Helsinki in Finland as a college project. He
released the version of Linux, including all source code. With the help of literally thousands of
Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

volunteers all over the world, Linux grew dramatically. It is multi-user, multitasking,
multiprogramming OS, mainly popular for server systems. It is distributed through different
distributors such as Red Hat, Mandrake, OpenSUSE, Ubuntu, Slackware, Sabayon, Debian,
Mandriva, PC-BSD, OpenSolaris, Gentoo, Fedora, Granular Linux etc.
Mac OS

Mac OS is a popular GUI based OS for Apple Inc. It is used in Apple’s Macintosh computer. It has
very high-quality graphical user interface. Earlier versions of this OS were only compatible with
Motorola 68000 series of processors, but now these are compatible with Intel processor also.

Some Terms Related To Operating System


Spooling
The term spooling is derived from the term SPOOL(Simulation peripheral operationOn-line). A
spool is a buffer used in spooling. Spooling is a process used to balance the difference of high-
speed of the CPU and slow speed of the input/output devices. It is primarily used for printing
purpose. When we provide multiple files to print together to a printer, although the printer can
print one file at a time. But, all files get lined up in a queue and get printed one-by-one. In this
process, CPU remains free and the user can work on other applications. This technique of
printing is possible through a capability of the operating system known as spooling. Actually,
when a user provides many documents together for printing to a printer, then the CPU begin a
high-speed component process for all the given document and provides these documents to a
printer by the CPU. Here, the spooling technique is used which allows the processed jobs in the
CPU and to be arranged in a separate area in the memory known as spooling area and the CPU
remains free for other jobs.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

.
Process
A process is basically a program in execution. The process doesn’t mean Program. The Program
is static while a process is dynamic. For simplicity, we can define a program as a job that resides
in the secondary storage. A process is a program, which is currently in a running/ ready state. A
process in a computer system may be in one of a number of different possible states, such as

 Running: A process is said to be in running state if it is currently running in the process.


 Ready: A process is said to be ready if it is temporarily stopped to let other process run in
the processor.
 Blocked: A process is said to be in blocked state if it is unable to run until some external
event happen.

Fig: process
Logically, the first two states are similar. In both cases the process is willing to run only in the
second one, there is temporarily no CPU available for it. The third state is different from two in
that the process cannot run, even the CPU has nothing else to do unless some external events
happen.

1. Process suspended for input


2. The Scheduler picks another process
3. The Scheduler picks another process
4. The Input becomes available

Thread

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Fig:Thread
In multiprogramming, with time slicing mode, multiple processes are loaded into memory at
once. When one process goes in blocked state or in a ready state, another process is chosen by
the scheduler to be in the running state. During this phase, the current state of a previous
running process must be stored somewhere so that it can resume from that state at the next
time. This mechanism is called context switching. Context switching is a very costly operation
and it reduces the efficiency if the process operates in I/O operations much frequently. A single
process is divided into multiple sub-processes and even if one sub-process for I/O operation end
then, another piece of same processes start executing, which minimizes the burden of context
switching to some extent. There are two types of thread:

 Kernel level thread


 User level thread

In the Kernal level thread, the operating system itself manages to create threads of a process. In
User level thread, user itself determines how to create multiple threads insides a single process.
Scheduling
When more than one process is able to run, the operating system must decide which one to run
first. This part of the operating system concerned with this process, so it is called scheduler and
it uses the algorithm which is called scheduling algorithm. The next process to execute is chosen
so as to achieve as much as possible of the following objectives.

 Maximum system throughput.


 Be fair to all users.
 Provide acceptable response time to interactive users and an acceptable turnaround
time for batch users.
 Ensure the hardware resources are kept as busy as possible.
 Avoid deadlock.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Fig:Scheduling
Scheduling can be of various types which are mentioned below:
Priority scheduling: Each program is assigned a priority level. At any time, the highest priority is
selected to run. The major drawback of this scheduling is that a small job has to wait for a long
time if some large job is having higher priority.
Time sharing scheduling: Each program is given a fixed amount of time to execute. The
operating system maintains a queue of an executable program resident in memory. In time-
sharing scheduling, when the currently running program leaves the CPU, it joins at the end of
the queue.
Buffering
A buffer is a small, high-speed storage device, located in I/O units, used to hold data at the time
of input/output operations. So it is divided into the input buffer and output buffer. Input buffer
accepts data at low speed and release at high speed to CPU, output buffer works in reverse
order, it accepts data at high speed from main memory and releases at low speed to output
devices. Buffering is the process of using buffer during I/O operation. The term buffering is also
used while accessing files like audio/video through the internet. Here, it is the process of
holding downloaded data before it can be played. Buffering is used to :

 Cope with the difference in operating speed between different devices.


 Adopt between devices that have different data transfer sizes.

Virtual Memory
In a multiprogramming system, when we use multiple programs at the same time, the space of
primary memory (RAM) may not be enough to store all the programs. In this case, operating
system uses free space of secondary memory to store these data. This free space in secondary
memory, used to store the contents of primary memory temporarily is known as virtual
memory. An operating system is responsible for creating, managing and operating virtual
memory.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

It is not an actual memory but it is a technique used by operating system to execute large size
programs with small size available primary memory. This is done by dividing the larger program
into small size segments known as pages.

Introduction of Internet
Internet is a network of networks. Millions of computer all over the world are connected
through the internet. Computer users on the internet can contact with one another anywhere in
the world. If a computer is connected to the internet, one can connect to millions of computers.
It is very much similar to the telephone connection where one can talk with any person
anywhere in the world.

Fig.The Internet
On the internet, a huge resource of information is accessible to people across the world.
Information in every field starting from education, Science, Health, Medicine, History and
Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

Geography to business, news, etc. can be retrieved from the internet. One can also download
programs and software packages from the internet.
Due to the tremendous information resources the internet can provide, it is now indispensable
to every organization and personal activities.
Some of the popular services of the internet are:

1. E-mail: Sending and receiving mail electronically.


2. File Transfer: Transferring files from one computer to another.
3. WWW (World Wide Web): Retrieving information residing on the internet servers in the
form of websites.
4. Chat: Exchanging views or communicating information instantly.

The development of internet started when US Defense Department set up the ARPANET
(Advanced Research Project Agency Network) to have a failure proof communication network
for defense department of US.
This architecture was later adopted by an educational institute for an exchange of views among
research scholars and then, it was thrown open to the public. Since 1994, the internet has
grown by leaps and bounds driven by cheaper cost, easier to use and increase in information.

USES OF INTERNET

 On-line communication:

Computer users around the world use the E-mail services to communicate with each other
extensively.

 Feedback about products:

Commercial organizations are also using the internet to gather information about the
satisfaction of existing products and market opportunities of new products. This is usually
accomplished by putting up an interactive survey application by the organization on a WWW
site on the Internet.

 Product promotion:

Several commercial organizations are effectively using the internet services for promoting their
products by the use of different social networks.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

 Customer Support Service:

Many organizations are also using the internet to provide timely customer support.

 On-line shopping:

The Internet has also facilitated the introduction of a new market concept, which consists of
virtual shops. These shops remain open 24 hrs all the year round and are accessible to make
purchase all around the world.

 On-line journals and magazines:

There are many WWW sites on the internet, which consists of an electronic version of many
journals and magazines.

 Real-time updates:

It helps to provide news and other happenings that may be on-going in different parts of the
word but with the use of the internet, we come to know about the real-time updates in every
field be it in business, sports, finance, politics, entertainment and others very easily. Many time
the decisions are taken on the real-time updates that are happening in the various parts of the
world and for this, the internet is very essential and helpful.

 Research:

In order to do research, we need to go through hundreds of books as well as the references and
that was one of the most difficult jobs to do earlier. Since, the internet came into life,
everything is available in just a click. The user just has to search for the concerned topic and will
get hundreds of references that may be beneficial for the research and since, the internet is
here to make research activity easy and hence, public user can take a large amount benefit from
the research work that have been done.

 Education:

Education is one of the best things that the internet can provide. There are a number of books,
reference books, online help centers, expert`s views and other study oriented material on the
internet that can make the learning process very easier as well as a fun to learn.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Figure:Use of Internet in Education

 Financial Transaction:

It is a term which is used when there is an exchange of money. With the use of internet in the
financial transaction, the work has become a lot easier. Payments, Funds transfer, banking
transactions can be done through on-line banking service.

 Entertainment:

The Internet is also used for entertainment. Such as chatting with friends, sharing videos,
watching movies, listening music, live telecast of sports and other events, playing games, etc.

Figure: Use of Internet in Entertainment

 Job Search:

Using internet, searching job has become an easier task. There are an endless amount of
websites on the internet that provided news about a vacancy in various post as required.

Use of Internet in Job search

 Blogging:

There are many people who are very much interested in writing blogs and for them the internet
is the best place. They can not only write blogs as per their wish but can also publicize their
work so that their work reaches to most of the people and they get appreciated.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Positive impacts of Internet


The positive impacts of internet to the society, organization and individual are:

 Faster, cheaper and easier medium of communication.

 Information sharing and browsing.

 File transferring facility.

 Reach to the worldwide viewers.

 Effective, easier, faster and cheaper promotion of product or service.

 Better customer support and customer relationship management (CRM).

 Online services like banking, shopping, education, etc.

 E-mail communication for sending and receiving an electronic document.

 Enhanced collaboration between different organizations.

 Effective Supply Chain Management (SCM).

 Electronic payment system using credit /debit cards, ATM, online payment, electronic
cheque, smart card, electronic purse, etc.

 Newsgroups for instant sharing of news and feedback system.

 Creation of new job opportunities related with the internet.

 Source for entertainment.

 Social networking for instant touch with friends and relatives.

Misuses of Internet / Negative impacts of Internet


The negative impacts of internet to the society, organization and individual are:

 It is the most common medium for spreading malicious software like virus, worm, etc..

 It has increased piracy.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

 Pornography (uploading, publishing, viewing sexual contents in the form of text, image,
audio and video).

 Stealing, modifying or destructing data.

 Piracy of software, audio, video or other intellectual contents.

 Hacking of organizational system, website, database etc.

 It is also used to harass people by sending insulting comments, making vulgar cartoons,
blackmailing, etc.

 Unemployment problem for the individuals not having knowledge about the Internet.

 It has increased digital divide.

INTRODUCTION OF E-MAIL
Commonly known as email or e-mail, electronic mail is a method of exchanging digital messages
from an author to one or more persons. Email operates across the Internet or other computer
networks. Email is an electronic mail for sending, receiving and storing of our electronic
messages. Email has gained popularity with the spread of the Internet. Today, email is the
preferred method of communication.

Fig: E-mail
Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

The email system is based on store and forward model in which email server computer system
accepts, forwards, delivers and stores the messages on behalf of users to send and receive
email messages. Email consists of two parts: the message header and the message body. The
header contains the information like one or more sender's address, receiver's address, data,
content, length, etc. whereas the body part contains the actual message which the sender has
sent to the receiver.
It is one of the most frequently used features of the internet. Many people sign up for internet
services so that they can send and receive e-mail messages. The internet is now the world’s
largest electronic mail system. More than 30 million people are directly connected to the
internet and can send and receive electronic mails.
Uses of Email:

 Email enables individuals and groups to communicate with one another.


 Group of people can work on the same topic through email and generate one common
document together.
 Through email, we can stay in touch with our family, relatives and friends who are away
from us.
 It is the convenient way of sending job application, sending valuable documents,
important images and videos.
 The use of email is essential in today's business culture for communication purpose.
Businesses of all sizes, places and types can use email for multiple purposes effectively.
 It is the most efficient and certain way to communicate with management, colleagues,
clients and vendors.
 Email is used when colleagues of the same or different departments need to send and
receive information about projects.
 Clients and vendors use email to order products and services
 Employees can receive dates and times for meetings, conferences and mandatory
training sessions via email.

ADVANTAGESOF E-MAIL

 Fast: It can relay our message to the recipient in a matter of minutes or seconds. Many
systems also let us check to see if the receiver has seen our message or not.

 Fun: International electronic mail system enables us to find ‘pen pals’ all over the world.

 Easy: When we open our email box, we see a list of the message we have received. First,
we read the message and then decide how to respond. We can reply to the message if

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

we like or just delete if it requires no reply. We can save it or print it. We can even
forward the message to the others.

 Cheap: We can send messages to others through email around the world cheaply in
comparison to the charge we are paying for telephone services.

 Flexible: We can send a message to more than one person if we like.

 Convenient: Because it’s written, we can compose and review our message before
sending which helps in any inconvenience.

 Word wide presence: We can check our emails from any computer in the world while on
vacation in other countries or from transportation vehicles, etc.

DISADVANTAGES OF E-MAIL

 Threat of viruses:Emails may carry viruses. These are small programs that harm your
computer system. They can read out your email address book and send themselves to a
number of people around the world.
 Spam:Having to deal with spam and spoofs is one of the worst avoidable time wasters
online. Use some anti spam software.

 Misunderstandings:Emails from people who don’t take the time to read what they write
before clicking ‘send’. Time is wasted, either to clarify or, worse, acting on a
misinterpretation of the message.

 No guarantee the mail will be read until the user logs on and checks their email.

 Need of internet:The recipient needs access to the Internet to receive email.

TYPESOF E-MAIL
Email is probably the most used feature of the web. With this technology, we can not only send
text messages but also digital files like images, audio, video, etc. attached to the email message.
There are mainly 2 major email types: POP email and Web-based email.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

1) POP email account

Fig: POP email account

This type of email account requires a client application installed on the user's computers. The
user has to get the service from the email service provider for free or by paying some amount.
The user then gets user id and password along with the POP mail server configuration that is
required to setup the email client. The popular email clients are Microsoft Outlook, Opera Mail
etc. To send the mail, a user composes the mail using the email client and posts the mail to the
email server. The email server then sends the mail to the destination address.
2) Web-based email account:

Web-based email accounts can be accessed using a web browser (yes, the same program that
we use for surfing the web) from which we can compose, reply, send, forward and organize
email.
To gain access to our account, we use a web browser to visit the home page of the email service
and enter our login details. All of our messages and address book (contact list) are stored on
web servers owned by the respective companies. We need an active internet connection to log
on to our account and check our emails. For instance, the sign in page for Yahoo is located at
www.yahoo.com and to log in at our Hotmail account, we need to enter our full email address
and our password.

Advantages of Web-based email:

 No need of third party software to view it. The simple web browser can access it.
 Most of the webmail services are free on the web.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

 The email inbox can be accessed from all around the globe with an internet connection
and computer.
 It can be accessed from the different computer platform i.e. can be accessed through
Window, Mac, Linux, etc.

Disadvantages of Web-based email:

 Webmail is slow to access because every email should be accessed and downloaded from
the server to view it.
 Webmail does not have off-line messaging services. For that, we need an internet
connection.
 Webmail consists of a large number of advertisers and spam emails.
 Size on the webmail server for one user account is limited. For large spaces, we need to
buy spaces.

Some other sub-types of email accounts are:


1) Email accounts provided by the ISP:
ISPs generally provide an email account for free with the internet connection. If we don't
get one from our ISP, we should seriously consider shifting to another provider. Anyway,
the main advantage of using an email account provided by the ISP is the support we
receive; we can either call the ISP or refer the extended documentation (usually)
provided in their manual.

ISPs know that many users would be new to the web and so have a helpful and patient
staff to help troubleshoot problems. This is in direct contrast to web-based email service
providers such as Hotmail, Gmail or Yahoo! Mail where, unless we take the paid version,
the support is sadly missing. However, there is one major drawback in having our ISP
account as our primary email address for online correspondence. If we change our
service provider or shift to a new location where our old ISP has no service, we might
lose the email address; else we have to keep paying for it.
2) Website email accounts:
Do we own a website? Depending on our hosting package, we can create email accounts on the
websites for ourselves or our staff. Most web hosting companies let us access emails through a
web-based interface or download the messages using email programs such as Outlook Express,

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Windows Mail, Thunderbird, Apple Mail, etc.

3) Email accounts from institutions, schools, colleges etc:


Our schools or institutions can also provide us with email accounts. Typically, we need to
contact the IT department that provides the email id and password required for the email
service .This type of email account is not recommended to be used as our primary email
account. It's good for internal purposes in school and colleges because it helps in being updated
about things going around in school. This email account is unusable once we leave the
institution or the school.

4) Email account from our company:

If we work in a medium-sized or a large company, they would probably have their own email
servers. Generally, we get our own email address a few days after joining the company. This
would be our business email ID. It is better to keep this type of email account away from
personal correspondence.

INTRODUCTION
HTML (Hyper Text Markup Language) is text markup language used to create HTML documents
(Web Pages) for The Internet. HTML is a set of logical codes or tags (markup) that are used to
define the Web browser how to present the information in the Web page.
It can be applied and embedded in the text to add formatting, linking that constitute the
appearance of the Web documents and the information. It is interpreted by the Web browser.
The Web browser is software that runs on the Web client (user computer ) and it interprets
HTML tags to display the contents of the Web page.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Fig. HTML
HTML is platform independent language. It is not a programming language like C, C++, java and
BASIC.
Basically, it is a set of markup tags that tells the browser how to display the Web page content.
Some popular markup languages are DHTML, SGML (Standard Generalized Markup Language),
XHTML (Extended HTML),XML (Extensible Markup Language), etc.
Tim Berners Lee developed HTML in 1990, at CERN (Conseil Europeenne pour la Recherche
Nucleaire ), the European Particle Physics Laboratory in Geneva, Switzerland.
There are different versions of HTML; these are HTML, HTML+, HTML 1.0, HTML 2.0, HTML 3.2,
HTML 4.01 (It has accessibility of Cascading Style sheet, and Multimedia) and now HTML 5.0 ( It
has accessibility of local storage and offline database).

Uses of HTML

1. It is used for basic layout creating or designing the Web page.


2. Without HTML, the World Wide Web will not exist.
3. It allows embedding text, image, multimedia (audio / video) and links to other
documents and the Web pages.
4. It provides a means to create structured document by using paragraph, character
formatting, links and lists.
5. It can embed scripts such as CSS, JavaScript, which affect the behavior and design of the
Web page.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Advantages of using HTML

1. It is highly flexible and user-friendly.


2. It is an open technology that supports almost all the Web browser and platforms like MS-
Windows, Macintosh, UNIS, etc.
3. It is efficient and reliable. You can create the Web page in order to advertise and
promote products and services.
4. It is easily understandable and does not require long time training.
5. It provides search engine compatible to the Web sites.

Disadvantages of using HTML

1. It is complex to design attractive Web page only using HTML. So, other languages are
used for additional programming.
2. It is difficult to develop a complete Web Site by using only HTML. Web development
tools like Dreamweaver, Foundation are used.
3. It cannot be used to develop a dynamic Web page.
4. There is no any complete acceptable standard of HTML.
5. There are many incompatibilities of HTML.

HTML Tags
HTML is made up of different tags and attributes. The tag is an HTML command that shows the
layout or displays the desired output of a whole or part of the Web page. HTML tag is bound by
angular brackets ( < > ) that always opens with a < (less than ) sign and closes with a > (greater
than) sign. It controls the appearance, layout and flow of the Web page.
A tag contains three parts: element (identification of tag), attribute and value.
The basic structure of tag is:
text
e.g. Computer
Here, is the beginning tag and is the ending tag.
HTML tags can be of two types:

1. Paired Tags
2. Singular Tags

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

1. Paired Tags
It is also called container tag. A tag is said to a paired tag if it along with a companion tag or
closing tag appears at the end. For example, the tag is paired tag. The tag with its closing tag is
used to rendered in Bold Text. In paired tag, first tag is called the opening tag and the second
tag is called the closing tag.
2. Singular Tags
The second type of tag is the singular tag, which is also known as a stand-alone tag or empty
tag. The stand-alone tag does not have companion tag or closing tag.
For example : Other singular tags are:
Tags Description
<BR> Insert a link break
<HR> Defines a horizontal rule
<!--> Defines a comment
Meta Tag
The Meta tag is one of the head elements. Meta tag is used to make the Website or its content
searchable on the WWW or internet. This tag offers information about page or description
about page or author of page or keyword that is relevant to that page. Actually, it is used for
search engine information. The search engine interacts with the Meta tag of the HTML page at
first.

Basic Structure of HTML Document


The HTML document is mainly divided into two sections. They are: Head section and Body
section.
Head section is used as the first tag of any web page which signifies that it is beginning of web
page.It has some elements that define header materials. It gives a descriptive title to a
document. The HTML 4.0 for many good reasons requires a use of the tag. Titles show up in
browser windows title bars and in bookmark and history listings. In each of these cases, one
provides an important reader service when one specifies a title because the browser will display
just the document’s URL. The remaining HTML elements are contained within.
Here’s the example of basic structure of HTML
<HTML>
<HEAD> <TITLE> Document Title </TITLE> </HEAD>
<BODY>
This is the Body of the Webpage.
Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

</BODY>
</HTML>

Fig: basic structure of HTML


Creating Webpage
We can prepare a web page in any text editor (e.g. notepad, word pad). After typing contents of
the web page, we need to save a page with an extension of HTML. The prepared web page now
can be viewed using a browser like Internet Explorer, Mozilla Firefox, Netscape, Opera, etc.
While typing contents of the webpage, it can be in any case. HTML is not case-sensitive like
HTML and HTML are same.
Comments in HTML
The comment tag is used to insert a comment in the HTML source code. The browser will not
display comment. We can use a comment to explain tag / code, which can help us when we edit
the source code later.
<!—This is comment à
Comment tag requires ! after opening bracket, but not before the closing bracket.

Comments in HTML

Fig: Editing of presentation


A presentation can be edited by using several menus likeView, Insert, Design or Animation,
etc.. View menu contains other sub-menus too like slide sorter, notes page, handout
master, slide master, etc. Slide sorter helps in creating and changing the order of slides. It can
also add slides between slides.
Whereas, Animation menu is used for different custom and transition animations. There are
different animation schemes to make slides even more attractive.
Designing and Formatting a Presentation:
Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

Designing and formatting of a presentation are done by using format menu. There are several
design slides from different options on the menu.
Text Section (to change font and its size, color and style of text):

 Select the text of the slide to format.


 Click the Font option you like from the Format
 Choose the font, font style, color, size and effects that you prefer and click on OK

Font section
The font which is associated with the text is the way your words will look when they are typed.
You can format your text with indentation, alignment and line spacing.
Paragraph Section (using bullets and numbering):
If your content needs to break its flow, use bulletin. It can be used for listing or prioritizing items
of your document.
For example:

 Pen
 Cell phone
 Laptop

Whereas, numbering can be used to create instructions, to do list, outlines, etc.


For example:

1. Run a grocery errand.


2. Make brunch.
3. Pick Sam from school.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Paragraph section
To use bullets and numbering:

 Click on Bullets and Numbering in the Format. Select the bullets designs or click on the
Numbers to insert numbers and select the style.

 Use Line spacing, Alignment and Change case.

 Line spacing is used to specify the spaces between the lines of text. Click on Line
spacingin Format menu to use line spacing. Set the Line spacing, Before paragraph and
After paragraph and click OK.

 Alignment is for formatting the text; as to define the format for the display of text.
Alignment can be Align Left, Center, Align Right and Justify. Select any one alignment
from the Format

 Change case is used to change the case of the text like from lower case to upper case. For
this, click on Change Case from the Format menu and select to your preference.

To use Slide Design:


Slide design allows using pre-designed backgrounds for your slides. To use slide designs:

 Go to the Format menu and click on Slide Design. A task pane displays different designs.
Click on the design you want to select.

 To use different designs for different slides, select the slides and right click on the slide
design preview. Then, click on Apply to selected slides.

To use Slide Layout:


Slide Layout provides with different formats for creating slides.

 Click on the Slide layout on Format menu and select the one you like among different
layouts displayed.
Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

 To use a different layout for different slides, select the slides and right click on the slide
layout preview. Click on Apply to selected slides.

To change Background:
By using Slide Design, background of the text can be changed or you can also design your own
design. For that:

 Click on Design in the Format menu and choose your own color schemes and effects for
patterns. Go to Background and open the Fill option to design more with solid fill,
gradient fill and picture or texture fill in the background.

Transition of Presentation:
Slide transitions are animation effects appearing between slides. These transitions look fancy if
not distracting when overused. So, it is better to keep it at a minimum.
Create a Slide Transition:

Source:www.java2s.com

Steps:

 Click on animation tabs >>Animations>>Transition to This Slide.

 Move the cursor over the transition buttons to preview the effects.

 Click on theTransition effectbutton,Transition Soundbutton and theTransition


Speedbutton to apply the slide transition effect, sound effect, and speed adjustment
respectively.

 Click onApply to Allbutton to apply the same transition effect to all the slides.

For even more advanced transition, you can useAdvance slide.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

 On Mouse Click.

 Automatically After,for each slide transition, the time can be set.

Animation and Custom Animation:


Adding Animation: In PowerPoint, there are 2 types of animations.

 Animation from a slide to another i.e. transition.


 Animation of particular elements within a slide.

For transitions, go to Animation tab and choose the icon which represents the transitions.

Fig. Custom Animation

Custom Animation:
Steps :

 Go to Animation tab and click on Custom Animation.

 Now, select the object you prefer from the Custom Animation Panel that appears on the
right-hand side of the slide.

 For the animation effect, go to Add Effect and choose.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

 You can find some frequently used effects in Entrance.

 Click Play for a preview of the animation.

Modify Animation effects and order of animated objects:


You can customize the animation effects under the Modify in Custom Animation Panel:

 Start - how to start the animation.


 Direction – direction of the animation.
 Speed – speed of the animation.

Also, change animated objects’ orders:

 Select objects from the list under Modify.


 Hold the mouse and bring up or down for order change of the objects.

Working with Tables, Graphics and Word Art:


Table:
Add a table:

 Select your preference of slide to add a table too.

 Go to Insert tab and click Table in the Tables.

Table
Source:www.tiktip.com

 Do one of the following:


- select the number of rows and columns you want.
- click Insert Table and enter the number in the Number of rows and Number of columns
lists.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Select the number of rows


and columns
To add text, click on the cell and write down your text.
 After that, click outside the table.

Draw a table:

 Select your preference of slide to add a table too.


 Go to Insert tab and click Table in the Tables group and click Draw Table.
The pointer changes into a pencil and you can draw rows and columns.

Graphics:
A Smart Art Graphic represents your information and ideas visually. With this, designer quality
presentations can be created.
To insert a Smart Art graphic:

 Select the slide you wish to use the Smart Art.


 Click on the Insert
 Select Smart Art command and a dialog box appear.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Fig: Insert a Smart Art graphic


Source:msdn.microsoft.com

 Now, select a category from the dialog box on the left and review the Smart Art graphics
that has appeared in the center.

Fig: Choose a SmartArt Graphic

 Select a graphic you like and click OK.


 You can switch to different graphic layouts by clicking on the Design tab below the Smart
Art Tools that appears in the Ribbon while selecting graphics.

FIG: SmartArt Tools


With the Design tab, there is a Format tab too in the ribbon and by it, you can format the
graphic in several ways.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Working with graphs and Organization charts:


By clicking on the Chart icon on any slide in PowerPoint opens the Insert Chart dialog box. To
add a graph or a chart in your presentation, you can either embed and insert it after editing in
Office Excel 2007 as the worksheet is saved with the PowerPoint file or you can paste an Excel
chart and link the data in Office Excel 2007.
Organization chart:
For a quick and easy creation of organization chart, type or paste text in your organization chart
and have it automatically positioned and arranged for you. For Organization chart, you can use
Smart Art as above.
Working with Multimedia:
Add sound to an animation:

 Select the animation effect from the slide you want to add sound to.

 Click Custom Animation on the Animations tab from the Animations.

 Click the right side arrow of the animation effect in the list and select Effect Options.

 Click the arrow on the Sound list and do one of the following:
- click a sound.
- click Other Sound and then locate your own sound file you want to use.

Add sound from Insert menu:

 Select the hyperlink.

 Click Action in the Links group on the Insert tab and do one of the following:
- click the Mouse Click tab.
- click the Mouse over tab when the pointer is resting on the hyperlink.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

To insert a movie from your computer file:

Fig. Insert a movie from your computer file

Select the slide you want your movie to be inserted to.

 Click on the Insert tab.

 In the Media Clips group, click the drop-down arrow on the Movie command.

INTRODUCTION
Also known as the Programming tools, Program Design tools are the tools used to develop a
program. During designing a program, different tools are required to solve several problems.
Some of the frequently used tools are:
1. Decision table:
A decision table allows an analyst to identify the exact course of action for given condition. A
decision table provides unambiguous (clear) decisions leading to a good program design. A
decision table generally consists of two parts: Conditions and Actions.

Fig. Decision table


Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

A decision table is preferred when one of the large numbers of actions is to be selected depends
on upon a large number of conditions.
2. Decision tree:
Decision tree also does more or less same job as decision table, except that it allows the tree
structure and each node of tree denote conditions. A decision tree is more user-friendly
because it provides a graphical hierarchical diagrammatic view of the conditions and actions.

Fig. Decision tree

3. Structured English (Pseudo code):

The general meaning of Pseudo code is false code or fake code. Before we write a real program,
we write a program that looks like a code on the basis of algorithm and flowchart, which may
not be syntactically correct but looks like a program code is called Pseudo code.The instruction
of pseudo code is written by using English phrase and mathematical expression. It has no hard
or fast rules for writing instruction but the instruction is closer to high-level language
instructions. Therefore, the pseudo code designers should have basic knowledge about high-
level language before writing it. It is independent of any programming language.
Example: Pseudo code for calculating area of rectangle

Input length, breadth

Calculate area= length*breadth


Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

Output area

4. Algorithm:

An algorithm is a sequence of instructions or step by step instruction to find the solution of a

problem. An algorithm should be simple and clear. It must be to the point and should lead to

the solution of the problem in a finite number of steps.

In other words, the set of rules that define how a particular problem can be solved in a finite

number of steps is known as an algorithm. An algorithm is composed of a finite set of steps,

each of which may require one or more operations. Each operation must be definite, effective

and finite

A program is the expression of an algorithm in a programming language. Thus, the success of a

program depends on upon the algorithm. Therefore, the logic of the problem must be clearly

expressed in an algorithm. In another way, we can say that an algorithm is a collection of a finite

number of instructions arranged in a sequence to find the solution of a problem.

Example 1: Algorithm for adding the two numbers.

Step1: Start the program

Step2: Input number x,y

Step3: Read x, y

Step4: Z←x+y

Step5: Print Z

Step6: Stop the program

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Example 2: An algorithm to go to the cinema and see a movie.

Step1: Start the program

Step2: Go to the cinema hall

Step3: Is the ticket counter open?

Step4: If it is not open, return home

Step5: If it is open, buy a ticket

Step6: Get into the cinema hall

Step7: Watch the movie

Step8: Return home

Step9: End the program

5. Flowchart:

A flowchart is a pictorial representation of an algorithm. We can also define it as a program


planning tool for organizing a sequence of steps necessary to solve a problem, which is shown in
terms of symbols.
Flowchart uses symbols that have geometrical shapes to indicate the different operations.
These symbols are connected by flow lines which indicate the order of execution of the various
activities. It is used by the programmers to develop programs and by system, designers to
represent the overall system while analyzing and developing the system.
Example:

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

fig. flowchart

The advantages of flowchart are:

 It is an independent language. So, the flowchart we design for programming in one


language is applicable for programming in another language.

 Once the flowchart is prepared, it is very easy to do the coding by looking at


thealgorithm.

 It is very easy to understand the logic of program by designing the flowchart. Even people
who don’t know the coding can understand the logic of a program with the help of
flowchart.

 Systematic debugging and testing is easily possible with the help of flowchart.

 It provides good documentation for an organization.

 It is useful in debugging the program.

 It provides valuable information which cannot be expressed by thousands of words.

 It is user-friendly and can be more easily understood.

 It expresses the clear logic of a given procedure.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

 It is unambiguous as there can be only one direction of logic at any one time.

 It is used as working models in the design of new programs and systems.

The disadvantages of flowchart are:


 Preparing a flowchart is a time-consuming process.

 If there is a change in logic again, we have to develop the new flowchart.

 Flowchart does not provide any convenient means to highlight the most important
operation.

 The flowchart is quite costly to produce and difficult to use and manage.

 Complex and detailed charts can be laborious to plan and draw.

 The translation of flowchart into computer programs is not easy.

 Preparation of flowchart is a very slow process.

 Most software developers believe that flowcharts are a waste of time and that these
slow down the process of software development. So, they do not start the software
development with flowcharts. Flowcharts are only used for the purpose of
documentation.

Symbols for flowcharts:

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Fig. Basic symbol for flowchart

TYPES OF FLOWCHART

 System flowchart

A flowchart that gives information about a system is called system flowchart. The system can be
data processing system, production system, reservation system, inventory system, accounting
system and evaluation system. It plays a very important role in analysis and designing of the
new system.
In system flowchart, the information flows from one section of the organizational unit to
another section or forms one processing machine to another. It is drawn by the system designer
while developing the new system. It does not focus on the process to solve a particular
problem. An information processing cycle can be illustrated below:
Example:

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

cbse-notes.blogspot.com

In other words, a system flowchart describes the data flow and operations for a data processing
system. It shows how the data processing is to be accomplished.

 Program flowchart:

Program flowchart describes the sequence of operations and decisions for a particular program.
In other words, we can say that a diagrammatical or pictorial sequence of instructions used by a
programmer to solve any problem is called Program Flowchart.
Program flowchart is a flowchart which is used by the programmer to solve a problem. It is the
detailed program which is shown in the form of pictures that how program processing steps will
be performed within the computer to convert input data into the desired output.
Example:

Fig. Flowchart for sum of two number


Source: forum.codecall.net

Differences between System flowchart and Program flowchart:


System flowchart Program flowchart
It is designed by systemIt is designed by
designers. programmers.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

It shows a system’s flow ofIt shows a program’s flow of


data. instructions.
It gives a broad overviewIt gives a specific view of a
of the overall system. control flow of a program.
It is used to design small sized
It is used to design large
logical & mathematical
sized real world problems.
problems.
Since there are limitedOne must have good
symbols, it is easy toknowledge of various existing
understand for normalsymbols to understand the
people also. system flowchart.
(Bhusal, Khanal, & Manandhar, 2013)
INTRODUCTION TO DATA TYPE
Data type is defined as a set of values that a variable can store along with a set of operations
that can be performed on that variable. Data type specifies the type of data that is to be used in
a program.

Fig. Data Type


Source:www.subjectcoach.com

There are 2 types of data. They are:


Primitive/ Simple data type
Simple data type is classified into 4 data type:

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Fig: Types of Data Type


Source: www.daydreameducation.co.uk

1. Integer: Integer is the basic data type which contains discrete numbers (both +ve and –
ve) like 2,-5, etc. The range of value for integer differs from one programming language
to another. An integer data type cannot have fraction or an exponent.

2. Real: The data type which contains any numeric representation is called real data type.
The value may be signed or unsigned, fractions or exponential as well. Example: 0, 0.5,
4.7234, 3.0e-4, etc are real numbers.

3. Characters: The data type which contains any printable alpha-numeric character plus
another special character like #, @, %, etc are called Character data type.
Example: Alphabets: a to z/ A to Z
Numbers: 0 to 9

4. Boolean (logical): The data type which only takes one of two possible values at any one
time is called Boolean data type. The two values are true and false. It is useful for
checking the condition inside a program. Example: AND, OR and NOT.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Data Structure:
A data structure is an organized group of data items which is treated as a unit. It may be
regarded as the computer data type. The main data structures are listed below:

Fig: Types of Data Structures


Source :www.slideshare.net

1. Array: Array is a collection of sequences from the storage of the same type of data such
as Integer, Real or Character. It is of 1 to 3 dimensions.

2. String: String is an array of characters. They are used in programming for storing and
manipulating texts such as words, names and sentences. The combination of more than
one character inside double quotation mark like “welcome”, “056-2345”, etc. is called
string data type. In programming, there can be various string processing operations such
as string comparison, string sorting, etc.

3. Tree: It is a hierarchical complex data structure where each element known as node,
contains data part and a pointer (address) to another node.The top most nodes (which
are not pointed by any other node) are called Root nodes. The node which doesn’t point
to any other node is known as Leaf node. If a node can point two nodes at the maximum,
then such tree is known as Binary tree.

4. Link list: Link List is a data structure composed of elements, containing data and pointers
to the next element of the same type. In other words, link list is a chain of elements
where one element points to another.
The first node does not contain information. It only contains the address of another
node. The last node points to NULL but stores information. But, if the last pointer points
to the first element of the list, then the list becomes circular link list. The info field
contains actual elements on the list. The next address field contains the address of the
next node in the list.

Differences between Array and Structure:


Array Structure

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Array is a collection of
Structure is a collection of
sequences, of storage of
heterogeneous data (different
the same type of data such
types of data) under the same
as integer, real or
name.
character.
Array are one dimensional,
Structure is only of one
two dimensional or three
dimension.
dimensional.
In the array, we can storeIn structure, we have to use
any number of data typedifferent variables to store
using only one variable. different data types.
Array cannot store varyingStructure stores varying data
data types. types.
Example: If we construct
an array A of integer there
Example: In structure, we can
we can only store integer
put different data type under
data type. We cannot put
the same name.
integer and character data
in a single array
In the array, a structure isIn structure, we can easily
not included. include array.

INTRODUCTIONTO CODES
A computer can only understand binary numbers which are in the form of two electronic states
i.e. high voltage and low voltage. Such notations are further derived into standard codes and
such codes can represent the data for users' convenience. Some of the popular codes are:

1. Absolute Binary (pure binary): In an absolute binary method, 0 is placed before the
binary number to represent positive number and 1 is placed before the binary number to
represent a negative number. The most significant bit in binary number denotes the sign
bit and the rest bits represent the actual number. The binary number is expressed in
8,16,32,64, etc. bit format.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Fig: pure binary clock with Arduino


Source:www.instructables.com

2. BCD (Binary Coded Decimal): It is a simple system for converting decimal numbers into a
binary form where each decimal number is converted separately into binary and placed
spaces in between numbers. In BCD, each decimal digit occupies 4 bit. For example, the
decimal number 24 can be represented in BCD as (0010 0100) 2.

Fig: Binary Coded Decimal


Source:www.tutorialspoint.com

3. ASCII (American Standard Code for Information Interchange): ASCII is a standard coding
system that assigns numeric values to the letter, numbers, punctuation marks and
control characters to achieve compatibility with different hardware and peripherals.
ASCII was developed in 1968 and was divided into 2 sets: Standard ASCII (7 bits code, 128
characters) and Extended ASCII (8 bits code, 256 characters). Most systems use 8 bit
extended ASCII to represent foreign language characters and other graphical symbols.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Fig: ANSI Extended ASCII


Source:www.cplusplus.com

In ASCII, each character is represented by a unique integer value from 0 to 255. The value
0 to 31 is used for non-printing control characters and the range from 32 to 127 is used
to represent the letters of the alphabet and common punctuation symbols. For example:
ASCII code for capital letter A is 65, for * is 42, etc. Since, ASCII code uses 8 bits, each
character represented in ASCII code occupies 1-byte storage space in a computer.

4. EBCDIC (Extended Binary Coded Decimal Interchange Code): It is an 8-bit code system
which is commonly used on large IBM mainframe computers, most IBM minicomputers
and computers from many other manufacturers. It allows 256 characters to be
represented in computers.
In this code, placement of the letters of the alphabet is discontinuous and there is no
direct character to character match when converting from EBCDIC to ASCII and vice
versa.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Fig: EBCDIC Format


Source:shieldsdesignllc.com

5. Unicode: It is a 16-bit character code defined by the Unicode Consortium and


International Standard Organization (ISO) that supports up to 65,536 characters. It allows
all the characters and symbols in any language in the world to be represented by a single
code. For example, the Chinese language has almost 10,000 characters which can be
represented by Unicode only. If Unicode is universally adopted, then it will make
multilingual software much easier to write and maintain.

Fig:Unicode in Python
Source: ian-albert.com

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Since, Unicode uses 16 bits, each character represented in Unicode occupies 2 bytes
storage space in the computer. This coding system has been developed to overcome the
drawback of ASCII code that supports only 256 different characters, which is sufficient
only for English language but not for all the languages like Chinese, Japanese, etc. which
has more than 256 characters. The Unicode Worldwide Character Standard provides up
to 4 bytes (32 bits) now.

(Shrestha & Karn, 2015)

Bibliography
Shrestha, R. K., & Karn, M. K. (2015). Computer Science I. Anamnagar, Kathmandu: Buddha
Publication.
Adhikari, Deepak et.al., Computer Science-XI, Asia Publication Pvt. Ltd,ktm

CONCEPT OF PROGRAM
Introduction
A program is a set of instructions or statements to perform some specific tasks. It is a composed
list of instructions that commands a computer to perform a particular job. An instruction is also
called a statement and a group of statements is composed to form a program.
A program is composed of a main module and sub-modules which are stored as a collection of
files. Some files may contain instructions while the others contain data.

Some examples of program files are:

1. Executable file (.exe or .com): This part of program sends commands to the processor
which then executes those commands of the file. Their file extension is .exe or .com.

2. Dynamic Link Library file (.dll): This is a partial executable file which does not run
independently. Commands of these files are shared among several programs.

3. Initialization files (.ini): Configuration information like size and starting point of a
window, a color of background, user’s name and so on is contained in this file.

4. Help files (.hlp or .chm): This file contains help information about the programs.
Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

FEATURES / QUALITIES OF A GOOD PROGRAM

 Integrity: It means that the calculations used in the program should be very accurate. It
must provide the desired output for the given input. It must do the work according to the
specification.

 Clarity: The program should be well readable to help maintenance later. This can be
provided in-line documentation or external documentation. On in-line documentation,
the function of each piece of code is defined within the program itself. In the external
documentation, a separate report includes the working principle of each inside the
program.

 Simplicity: The program should be able to express the logic in a considerably simple way.
This feature enhances integrity and clarity. The same problem can be solved in two or
more ways, but one needs to choose the simplest way to solve the problem.

 Efficiency: The program should have a good compromise between time and space used;
it means it should run as fast as possible with the minimum memory requirements.

 Modularity: Program should be separated to different logical and self-contained


modules. If the entire program is divided into simpler modules, then one can easily
understand what’s happening inside it.

 Generality: It should be flexible and easy to operate with a wide range of platform.

 Robustness: Program should be fault-tolerant as much as possible. A program cannot be


100% full-proofs. So, it must be built in such a way that, if some unavoidable
circumstance appears, then it must tackle with it without being crashed.

 Security: A program must be secured enough so as to avoid tampering from unwanted


people. All the loopholes in the programs must be avoided as much as possible.

 Documented: Documentation helps for smooth operation for the users and even helps
for further modification and maintenance.

Differences between Program and Software:


Program Software
It is a collection of instructions,
It is a set of instructions which
programs, and data which instruct
instructs computer to perform a
the computer on how to solve
specific job.
computer problems.
To develop software, collections of
It is independent.
programs are needed.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

It is a logical unit driving the


It is a component of software
computer system.
It defines the computer process. It defines both data and process.
Software is created by groups of
A programmer creates programs.
programmers as a team.
It is generally licensed under a
It is not generally licensed for sale.
company.
It can be divided under various
It cannot be divided in accordanceneeds and uses like application
to needs and uses. software, utility software, system
software, etc.
Example: SYS, FoRMAT.SYS, interestExample: MS Word, Adobe
calculations, etc. Photoshop, Internet Explorer, etc.
(Bhusal, Khanal, & Manandhar, 2013)
CONCEPTOF PROGRAMMING STATEMENT
An instruction (also called code) written in the high level language to do a specific task in a
program is called programming statement. Each programming statement commands the
computer to do some specific task such as input, output, calculation or some logical decisions.
One program statement in high level language may result in several instructions in machine
language when the program is compiled. Programming statement may consist of keywords,
variables, operators, control structures, data type, library function, user defined function, etc.

There are 3 types of Programming Statements used in programs. They are:

1. Simple statement: It is a basic part of a program and it’s a single line expression which is
used to carry out an assignment, calculation or to test logical decision. Example:

X=10 - assign integer values 10 to X variable


a>=50 - logical statement to check whether a is greater than or equals to 50 or not.

2. Compound statement: Compound statement is defined as a statement which consists of


two or more individual instructions. Example:

A= l*b
where one instruction is for multiplication of l and b and another instruction is for assigning
multiplication value to the variable A.

3. Control Statement: A statement that affects the flow of execution through a program is
called a Control Statement. Control statements are also called control structures in high
level languages which are their basic building blocks. There are 3 types of control
statements. They are Sequence, Selection and Iteration (repetition).
Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

Testing and Debugging:


Programs are not always perfect. Some always have limitations about them causing them to
have errors and such program errors are called bugs. The process of locating and correcting
them after their detection is known as debugging. Testing is the process where it is made sure
that the program performs the intended task and debugging is where they locate and correct
program errors. Though time-consuming, these 2 are very important steps in program
development.

Fig. Testing and debugging


Source: www.slideshare.net

There are several stages of testing. They are:

 Unit testing involves the individual components’ testing.

 Integration testing involves the separate components’ testing as they are put together.

 System testing that involves the whole final form of a program testing.

 User acceptance testing involves the user testing the program to see that it is the result
what is required.

Debugging is basically done to find:

 Syntax error: The error which occurs when the instruction of program does not match
the structural rule of the programming language is called syntax error

 Semantic error: Semantic errors are the errors which causes the wrong output due to
wrong calculation or wrong input of data.

 Run-time error: The error which appears during the execution or runtime of a program is
called runtime error. Such errors appear when the computer is asked to divide by zero or
Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

when the variable is assigned a large value which is beyond its capacity. The run-time
error causes the termination of program execution.

Syntax and Semantics:

Fig. Describing Syntax and Semantics


Source: slideplayer.com

Syntax:
The rules that we use while writing code is called Syntax. A syntax is the grammatical rules of
writing the programming statement. In other words, the syntax is the rules that tell us whether
a string is a valid program or not. The error which is detected by the computer if we violate the
rule of writing programming statement is called Syntax error.
Semantics:
The rule that gives the meaning to programs is called Semantics and the error which occurs in
program logic is called Semantic error. It is also called logical error. The semantic error is not
detected by the computer and the compiler compiles it successfully. We can only see the error
after the program is being executed and gives out the wrong output. So, it is very difficult to find
the semantic or logical error because no satisfactory method has been found to detect the
logical error yet.

For example:
Statements Descriptions
Syntactically & Semantically
I eat fruits.
correct.
Syntactically correct but
I eat a laptop.
Semantically incorrect.
I eats laptop. Both Syntactically &

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Semantically incorrect.
Also, when a program is running, it is said to be at runtime and if any error occurs while the
program is executing, it is called aRun-time error. For example: peripheral devices may not be
turned on.
PROGRAMMING CONCEPT
A program is a set of sequenced instructions which commands the computer to perform a
particular operation or a special task. It is written in a programming language which is then
translated into machine code by a language processor so that the computer can execute its
tasks.
The thorough understanding regarding the entire process of the development of programs is
called programming concept. It includes the overall understanding and applications of different
computer programming languages, compiler, interpreter, control structures, program design
tools, syntax, semantic, programming techniques and different stages involved in a program
development.
When we write a program, we have to follow the grammatical rules as to write the statement in
a program. The program is finally created when such statements are written in chronological
order and starts performing tasks. Simply said, programming is a way of creating a sequence of
instructions to enable the computer to do something.
PROGRAMMING LANGUAGE
Language is a means of communication among humans. Even animals and every other living
being need language. One simply cannot communicate with others without language. Likewise,
a computer also needs a language so that it can communicate with the users, which is called a
programming language.

Fig: Programming Language

Source: www.devsaran.com

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

A programming language is a language used by computers by which they understand to do what


the program users want. It is a set of codes and written symbols that provide the platform for
instructing computers to perform some specified tasks. The process of writing a program is
known as coding or programming and the person who writes the program codes is
called a programmer.
On the basis of nature, programming languages are divided into 2 categories. They are:

1. General purpose programming languages: for solving almost all types of problems.
2. Specific purpose programming languages: for solving problems of specific nature.

Whereas, generally, programming languages are divided into 2 categories. They are:
1) Low-Level Languages (LLL)

Low-level language can be divided into two types:

 Machine language (1GL)


 Assembly language (2GL)

I. Machine language:
The language that is called the language of CPU and is written in binary code (composed of 0
and 1) is called Machine language. In this language, a computer can understand every
instructions given only in the form of 0 and 1. All the valid computer operations are performed
in terms of binary operation.

The advantages of Machine language are:

 The program written in machine language does not need any translation.
 Although, it is very difficult to write a program in machine language, the program written
in machine language runs faster than any other program.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

The disadvantages of Machine language are:

 Machine language is very machine dependent. The program written for one processor
cannot be run in another processor i.e. a machine code of Intel processor doesn’t work
for Motorola processor.
 Machine language has to be written in the form of 1 and 0. So, it is quite stressful to do
programs in machine language.
 Chances of error are high while writing a program in machine language.
 It is very difficult to debug the program written in machine language.
 It is very time-consuming and difficult to solve complex problems under this language.

II. Assembly language:


The language in which a program is written in shortcodes like ADD, MUL or SUB instead of
writing instruction in a binary number (0 and 1) is called Assembly language. An assembler
converts the assembly language to the machine language to make it understandable by
computer hardware because a computer can understand the instruction written only in binary
form.
Assembly language is not a user-friendly language. This language is also very processor
dependent language. A program written for one processor does not work in another processor.
Computer viruses are mostly written in this language.
The general of its instructions are shown below:
OPCODE OPERAND Comment
ADD A, B Add B to A
Fig: Assembly language instruction format
The advantages of Assembly language are:

 Assembly language is easier to understand as compared to machine language.


 Unlike machine language, it is easier to modify.
 Chances of error are less than machine language.
 In assembly language, program execution time is faster than a program written in any
high-level languages.
 As compared to machine language, assembly language is of a more standard form of
language.
 We do not need to take care of storage location of data and instruction while writing a
program in assembly language.
 This language is more efficient in solving hardware interfacing problems.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Some of its disadvantages/ limitations are:

 It is a processor (Machine Dependent Language).


 Since, it is a machine dependent language, it requires the knowledge of hardware while
writing a program.
 There is one to one correspondence between the assembly language and machine
language instruction.
 Written in this language, a program can be very lengthy and complex for programming.
 Execution of program is slower and less efficient than machine language.

2) High-Level Languages (HLL)

The languages which are quite similar to written English


and are therefore very easier to use in compared to machine language and assembly language
are called High-level languages. Programs written in high-level languages are translated into
machine language by a language translator called a compiler or an interpreter.
The 1st high-level language was developed by John Backus, in IBM Laboratory, in 1956. Further
developed during the 60s, high-level languages were developed to make the programming
easier and to overcome the limitations of low-level languages. High-level languages are of 3
types. They are:

 Procedural oriented language (3GL)


 Problem-oriented (4th generation language (4GL))
 Natural (5th generation language (5GL))

1. Procedural oriented language:


Procedural Oriented Languages are the general purpose programming language. It is also
known as the 3rd generation languages (3GL). These are designed to express the logic and
the procedure of a problem. Procedural languages are very flexible becausethey are able
to solve a variety of problems. Examples are: Pascal, C, BASIC, etc.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

2. Problem-oriented language:
These languages are non-procedural languages which allows the users to specify what
the output should be. Problem-oriented languages are one step ahead of 3GL and they
don’t describe all the details of how the data are manipulated to produce the result.
These are result oriented and needs a translator like an interpreter or a compiler.
Examples are: C#, PHP, Visual Basic, etc.

4GL’s objectives include:

o To minimize user’s effort to obtain information from a computer.


o Increase the program development speed.
o Reduce the chances of errors while writing programs.
3. Natural language:
Also known as 5th generation languages (5GL), these are still in the developing stage. In
completion, we could write statements that would look like normal sentences. Natural
languages such as English, Nepali and other languages would be used in the computer
making them more intelligent and user-friendly.

Some of its characteristics are:

o They make computers more intelligent and natural.


o They make human and machine closer.
o They are used in the areas of research, robotics, defense system and different
types of expert systems.

The advantages of High-level languages are:

 High-level languages are machine independent language. So, it is portable (i.e. program
written in one processor easily runs on another processor also).
 A program written in the high-level language is easier to learn because it is similar to the
English language.
 It is user-friendly.
 Chance of error is less and it is very easy to debug.
 Programming in high-level languages requires less time and effort as compared to low-
level languages.

The disadvantages of High-level languages are:

 The program written in the high-level language is less efficient as compared to the
program written in assembly and machine language because it requires more memory
and more time to execute.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

 The task related to the computer hardware can be programmed or handled only by
either machine or assembly language. So, for these purposes,high-level languages cannot
be used.

PROGRAMMING CONCEPT
A program is a set of sequenced instructions which commands the computer to perform a
particular operation or a special task. It is written in a programming language which is then
translated into machine code by a language processor so that the computer can execute its
tasks.
The thorough understanding regarding the entire process of the development of programs is
called programming concept. It includes the overall understanding and applications of different
computer programming languages, compiler, interpreter, control structures, program design
tools, syntax, semantic, programming techniques and different stages involved in a program
development.
When we write a program, we have to follow the grammatical rules as to write the statement in
a program. The program is finally created when such statements are written in chronological
order and starts performing tasks. Simply said, programming is a way of creating a sequence of
instructions to enable the computer to do something.

PROGRAMMING LANGUAGE
Language is a means of communication among humans. Even animals and every other living
being need language. One simply cannot communicate with others without language. Likewise,
a computer also needs a language so that it can communicate with the users, which is called a
programming language.

Fig: Programming Language

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

A programming language is a language used by computers by which they understand to do what


the program users want. It is a set of codes and written symbols that provide the platform for
instructing computers to perform some specified tasks. The process of writing a program is
known as coding or programming and the person who writes the program codes is
called a programmer.
On the basis of nature, programming languages are divided into 2 categories. They are:

1. General purpose programming languages: for solving almost all types of problems.
2. Specific purpose programming languages: for solving problems of specific nature.

Whereas, generally, programming languages are divided into 2 categories. They are:
1) Low-Level Languages (LLL)

slideplayer.com

Low-level language can be divided into two types:

 Machine language (1GL)


 Assembly language (2GL)

I. Machine language:
The language that is called the language of CPU and is written in binary code (composed of 0
and 1) is called Machine language. In this language, a computer can understand every
instructions given only in the form of 0 and 1. All the valid computer operations are performed
in terms of binary operation.

The advantages of Machine language are:

 The program written in machine language does not need any translation.
 Although, it is very difficult to write a program in machine language, the program written
in machine language runs faster than any other program.
Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

The disadvantages of Machine language are:

 Machine language is very machine dependent. The program written for one processor
cannot be run in another processor i.e. a machine code of Intel processor doesn’t work
for Motorola processor.
 Machine language has to be written in the form of 1 and 0. So, it is quite stressful to do
programs in machine language.
 Chances of error are high while writing a program in machine language.
 It is very difficult to debug the program written in machine language.
 It is very time-consuming and difficult to solve complex problems under this language.

II. Assembly language:

The language in which a program is written in short codes like ADD, MUL or SUB instead of
writing instruction in a binary number (0 and 1) is called Assembly language. An assembler
converts the assembly language to the machine language to make it understandable by
computer hardware because a computer can understand the instruction written only in binary
form.
Assembly language is not a user-friendly language. This language is also very processor
dependent language. A program written for one processor does not work in another processor.
Computer viruses are mostly written in this language.
The general of its instructions are shown below:
OPCODE OPERAND Comment
ADD A, B Add B to A
Fig: Assembly language instruction format
The advantages of Assembly language are:

 Assembly language is easier to understand as compared to machine language.


 Unlike machine language, it is easier to modify.
 Chances of error are less than machine language.
 In assembly language, program execution time is faster than a program written in any
high-level languages.
 As compared to machine language, assembly language is of a more standard form of
language.
 We do not need to take care of storage location of data and instruction while writing a
program in assembly language.
 This language is more efficient in solving hardware interfacing problems.
Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

Some of its disadvantages/ limitations are:

 It is a processor (Machine Dependent Language).


 Since, it is a machine dependent language, it requires the knowledge of hardware while
writing a program.
 There is one to one correspondence between the assembly language and machine
language instruction.
 Written in this language, a program can be very lengthy and complex for programming.
 Execution of program is slower and less efficient than machine language.

2) High-Level Languages (HLL)

physinfo.ulb.ac.be

The languages which are quite similar to written English and are therefore very easier to use in
compared to machine language and assembly language are called High-level languages.
Programs written in high-level languages are translated into machine language by a language
translator called a compiler or an interpreter.
The 1st high-level language was developed by John Backus, in IBM Laboratory, in 1956. Further
developed during the 60s, high-level languages were developed to make the programming
easier and to overcome the limitations of low-level languages. High-level languages are of 3
types. They are:

 Procedural oriented language (3GL)


 Problem-oriented (4th generation language (4GL))
 Natural (5th generation language (5GL))

1. Procedural oriented language:


Procedural Oriented Languages are the general purpose programming language. It is also
known as the 3rd generation languages (3GL). These are designed to express the logic and
the procedure of a problem. Procedural languages are very flexible becausethey are able

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

to solve a variety of problems. Examples are: Pascal, C, BASIC, etc.

2. Problem-oriented language:

These languages are non-procedural languages which allows the users to specify what
the output should be. Problem-oriented languages are one step ahead of 3GL and they
don’t describe all the details of how the data are manipulated to produce the result.
These are result oriented and needs a translator like an interpreter or a compiler.
Examples are: C#, PHP, Visual Basic, etc.

4GL’s objectives include:

o To minimize user’s effort to obtain information from a computer.


o Increase the program development speed.
o Reduce the chances of errors while writing programs.
3. Natural language:
Also known as 5th generation languages (5GL), these are still in the developing stage. In
completion, we could write statements that would look like normal sentences. Natural
languages such as English, Nepali and other languages would be used in the computer
making them more intelligent and user-friendly.

Some of its characteristics are:


o They make computers more intelligent and natural.
o They make human and machine closer.
o They are used in the areas of research, robotics, defense system and different
types of expert systems.

The advantages of High-level languages are:

 High-level languages are machine independent language. So, it is portable (i.e. program
written in one processor easily runs on another processor also).
 A program written in the high-level language is easier to learn because it is similar to the
English language.
 It is user-friendly.
 Chance of error is less and it is very easy to debug.
 Programming in high-level languages requires less time and effort as compared to low-
level languages.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

The disadvantages of High-level languages are:

 The program written in the high-level language is less efficient as compared to the
program written in assembly and machine language because it requires more memory
and more time to execute.
 The task related to the computer hardware can be programmed or handled only by
either machine or assembly language. So, for these purposes,high-level languages cannot
be used.

Language Translator:
Introduction:

Fig. Translator
Language translator is a program which is used to translate instructions that are written in the
source code to object code i.e. from high-level language or assembly language into machine
language.
There are 3 types of language translators. They are:
1. Assembler:

Assembler is the language translator designed to translate assembly language program


(source codes) into machine language program (object codes). The original assembly
language program codes are called source codes and after translation, the final machine
language program codes are called object codes.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Fig. Assembler
2. Compiler:

A compiler is a language translator that translates high-level languages program to


machine language program. While translating, it checks the syntax (grammar of the
source code) and translates it into object code at a single attempt. If any error is found,
the compiler produces syntax errors and causes of the errors. The source code file must
be syntax error-free for complete compilation process.

Fig. Compiler
3. Interpreter:

The interpreter is the language translator designed to translate high-level language


program into machine language program, one instruction at a time. Unlike the compiler,

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

it translates and executes one statement at a time before moving to another. If any error
is encountered, the translation is halted and an error message is displayed.

Figure: Interpreter

Differences between Compiler and Interpreter:


Compiler Interpreter
It translates a complete high-level language It translates high-level language program
program into machine language at once. into machine language line by line.
It finds the syntax errors after compiling the It finds the syntax errors after translating
whole program. each line of the program.
The compiling process is faster than the The interpreting process is slower than a
interpreter. compiler.
It creates the object code after compiling It creates the object code after
the whole program. translating each line of the program.
The debugging process is complicated in a Debugging process is easy in the
compiler. interpreter.
Compiler demands more resources
Interpreter requires low resources.
(memory, CPU time etc) than interpreter.
Example: C, C++, Visual Basic, java, etc. Example: BASIC, QBASIC, GWBASIC, etc.

List of High-level Programming Languages:

1. FORTRAN: FORTRAN stands for FORmula TRANslator. Developed by John Backus for IBM,
in 1956, it is a very powerful language for scientific and engineering computations.
FORTRAN IV, FORTRAN 77 (ANSI standard), FORTRAN 90, FORTRAN 95, etc. are some of
its versions available.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Fig. Fortran Logo

2. BASIC: BASIC was developed in 1960 by John Kemeny and Thomas Kurtz, at Dartmouth
College. Standing for Beginner’s All-Purpose Symbolic Instruction Code, it was the
1stinterpreted language and is a good language for beginners to learn initial programming
skills.

Fig.BASIC

3. COBOL: COBOL (Common Business Oriented Language) was developed specially for
business data processing. Standardized by ANSI in 1968, it was developed for the US
Department of defence by Grace Murray Hopper, in 1960.

Fig. COBOL Programming

4. C: C is a powerful, general-purpose high-level language which also has features of low-


level programming. Earlier called as BPCL or simply B, it was developed by Dennis Ritchie,

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

in 1970s at Bell Laboratory.

Fig. C Logo

5. C++:Developed in the early 1980s by Bjarne Stroustrup, it is an updated version of C


language. C++ is the super set of C language that supports object-oriented features and is
extremely efficient.

Fig. C++ logo

6. PASCAL: PASCAL is a multipurpose programming language which is suitable for both


scientific and business application. Developed in the early 1970s in Switzerland, by
Niklaus Wirth at the Federal Institute of Technology, it was named after the 17th-century
French Mathematician Blasé Pascal, on his honoring.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Fig. Pascal logo

7. LISP: LISP which means LIST Processing is a suitable language for solving non-numeric
data processing and is used in the field of the expert system, artificial intelligence and
pattern recognition. It was developed by John McCarthy in the early 1960s, at IBM’s
Laboratory.

Fig. LISP Programming

8. JAVA: Developed by Sun Microsystems Inc. in 1991, JAVA is a simple and powerful
platform independent language. In the web and mobile fields, JAVA has very wide
applications.

JAVA Logo

9. NET: As an alternative for JAVA, NET is the Microsoft’s latest common platform which
combines all powerful features of different languages into one environment, also called
IDE (Integrated Development Environment). It is most commonly used for solving web

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

based applications and distributed mobile applications. J#, C#, Visual Basic, Visual C++,
etc. are some of its examples.

Fig. Net Logo

10. XML: XML (eXtensible Markup Language) is a web content development language which
helps to manage sources’ documents in several different formats such as web page, PDF
files, printable documents, etc. XML allows making their own tags to the users.

Fig. XML
11. PROLOG: Used for solving natural logic and in the knowledge-based system fields,
PROLOG (PROgramming LOGic) was developed in 1972 by Alain Coulmeraurer and
Philippe Roussel, in France.

fig. PROLOG

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

12. PHP: PHP stands for Hypertext Pre-processor. It is a very popular server site which scripts
languages on UNIX / Linux system. It is also very popular for accessing databases like My
SQL and Oracle which can be supported by Windows server too, by using 3 rd party
software. It is an open source software.

fig. PHP Logo

13. SQL: SQL was developed by IBM in the early 1970s. Standing for Structured Query
Language, it is a common standard database language that is now accepted by almost all
database packages like MS Access, Oracle, DB2, MS SQL Server, etc.

Fig. SQL Logo

14. ASP: Mostly used with MS Access or MS SQL, ASP (Active Server Page) is a server site
which is used for scripting language for accessing a database from a web application. ASP
can run only inside Microsoft Windows Server. ASP.net is its latest version.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Fig. ASP.NET
15. Python: Python is a general purpose high-level programming language which supports
multiple programming paradigms, including object-oriented features. It was developed in
1991 by Python Software Foundation and its main designer was Guido Van Rossum. It’s a
free and open source software.

Fig. Python Logo


16. PERL:PERL is one of the 1st scripting languages on UNIX system for web development.
PERL (Practical Extraction and Reporting Language) is an open source scripting language
and is found on UNIX/Linux based server. PERL is also supported by Windows Server.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Fig. Perl Programming

INTRODUCTION
The structures which regulate the order in which program statements are executed are called
Control Structures. There are 3 types of control structure. They are:

 Sequence:
It is the set of program instructions which follow one another and are to be executed
unconditionally (not dependent on any program conditions). Instructions are put in a
predefined sequence (just like a queue in a cinema hall) and the next instruction is
executed by CPU only after the execution of the previous instruction (C never comes
before B).

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Fig: Sequential Statement

 Selection:
It is the set of instructions which are to be executed conditionally i.e. they are executed
based on a condition that can be either true or false. Commonly used logic for selection
are if condition, if else condition, if else if condition, nested if else condition and switch
case condition.

1. If condition:
If condition is used in case the given problem has only one condition and only one action.
Considering either true or false part, if the given condition is true then the statement will
be executed. Otherwise, the control exits from the condition.

Fig: if condition

Example: Check the number is positive.

Algorithm
Step 1: start
Step 2: input N
Step 3: if (n>0), output is positive
Step 4: end

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Figure:

2. If else condition:
This condition is used if the problem has one condition but two alternative actions. Here,
if the condition is true, statement 1 will be executed; otherwise ,statement 2 will be
executed.

Example: Find the greatest between 2 numbers.


Algorithm
Step 1: start
Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

Step 2: input X, Y
Step 3: if (X>Y)
output X is greatest
else
output Y is greatest

Step 4: end

Figure:

3. If else if condition:

Also known as ladder type if else, we can use this condition if the given problem has more than
one interrelated conditions with their respective actions. Here, on a check, if condition 1 is true
then, statement 1 is executed. Otherwise, condition 2 is checked and if it is true, statement 2 is
executed and so on for next conditions. If all conditions are false, then the last statement will be

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

executed.

Example: Find the greatest among 3 numbers.


Algorithm
Step 1: start
Step 2: input P, Q, R
Step 3: if (P>Q && P>R)
output P is greatest
else if (Q>R)
output Q is greatest
else
output R is greatest

Step 4: end

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Figure:

4. Nested if else condition:


Nested if else condition is an entire if-else statement which is written within the body of
if part or else part of another if else statement. This condition is used when a condition is
to be checked that is inside another condition at a time in the same program, to make a
decision.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Example: Find the greatest 2 positive numbers.


Algorithm
Step 1: start
Step 2: input X, Y
Step 3: if (X>0 && Y>0)
{
if (X>Y)
output X is greatest
else
output Y is greatest
}
output X or Y may be
negative
Step 4: end

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Figure:

5. Switch case condition:

If the given problem has one condition and respective more than two actions, then in this
type of case scenario, we can use Switch case condition. It is the multiple branching
statements which checks the value of the variable to the case value and then, the
statements that are associated with it will be executed. If any expression does not match any
of the case value, then the default statement will be executed.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Example: Write an algorithm and draw a flowchart which takes the integer value 1 to 7 and
prints respective day.
Algorithm
Step 1: start
Step 2: switch (day)
{
case 1: output Sunday
break
case 2: output Monday
break
case 3: output Tuesday
break
case 4: output Wednesday
break
case 5: output Thursday
break
case 6: output Friday
break
case 7: output Saturday
break
default: output out of range
}
Step 4: end

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Figure:

 Iteration: These are the computer instructions which are to be performed repeatedly
and conditionally i.e. loop statements are driven by the loop condition. Commonly used
logic for iteration are while loop, do while loop and for a loop.

1. While loop:
In this loop, first, the condition is checked by the computer and if the condition turns out
to be true, then the statement inside the loop is executed. This process is repeated and
the value of increment and decrement operator is always changing. When the condition
is false, the loop stops.

Algorithm Syntax
Initialization
while (condition)
{
statements
……………….
……………….
Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np
Computer Science Reference Note Grade-XI

increment/ decrement
}

Example: Write an algorithm and draw a flowchart to print 1 to 10.


Algorithm
Step 1: start
Step 2: I=1
Step 3: while (I<=10)
{
output I
I++
}
Step 4: stop

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Figure:

2. Do while loop:
In this loop, first, the computer checks the initial value; second executes the statements
inside the loop and finally, checks the condition. The process is repeated for next pass, if
the condition is true. Otherwise, the loop stops. If the condition is initially false, it will
execute for at least one time.

Algorithm Syntax

Initialization
do {
statements
………………..
………………..
increment/ decrement
} while (condition)

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Example: Write an algorithm and draw a flowchart to print 100 to 1.


Algorithm
Step 1: start
Step 2: A=100
Step 3: do {
output A
A++
} while (A>1)
Step 4: stop

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Figure:

3. For loop:
It is the most commonly used loop. It consists of 3 expressions; initialization, condition
and counter, which are defined within a statement.

Algorithm Syntax
for (initialization; condition; counter)
{
statements
……………….
……………….
}
Where, initialization is starting point,
the condition is stopping point and increment/ decrement is a counter.

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

Write an algorithm and draw a flowchart to print a multiplication table of 7.


Algorithm
Step 1: start
Step 2: for (i=1; i<10; i++)
{
m= i*7
output m
}
Step 4: stop
Write an algorithm and draw a flowchart to print a multiplication table of 7.
Algorithm
Step 1: start
Step 2: for (i=1; i<10; i++)
{
m= i*7

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np


Computer Science Reference Note Grade-XI

output m
}
Step 4: stop

Bibliography
o Koirala, H., & Shrestha, R. K. (2015). Computer Science I.Anamnagar,
Kathmandu: Buddha Publication.
o Adhikari, Deepak et.al., Computer Science- XI, Asia Publication Pvt. Ltd, ktm
o Leon, Alex and Mathews Leon. Fundamental of Information Technology. India,
2015.
o Shrestha, Prachanda Ram, et al. Computer Essentials. Kathmandu: Asmita's
Publication, 2014.
 Dilli , S. P., Singh, k. E., Khadka , D., Bhatta, K. D., Baral, N., Saud, R. S., . Dangi, R.
(2015). Fundamental of Computer Science. Kathmandu: KEC publication and
Distribution.
 Adhikari,Deepak et.al.,Compute Science-XI,Asia Publication Pvt.Ltd,ktm
 Computer Science- XI, Asia Publication Pvt. Ltd, ktm

Prepared By: Bal Krishna Bhusal Website: www.bkbhusal.com.np

You might also like