Computer Science Reference Note Class 11
Computer Science Reference Note Class 11
Computer Science Reference Note Class 11
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.
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.
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:
The example of the fourth generation computer is IBM-PC, HP laptops, Mac notebook etc.
5.) Fifth Generation Computer (Present and future)
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.
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.
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.
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'.
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.
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 ".
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.
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.
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.
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.
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.
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.
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.
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 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.
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.
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.
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".
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.
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.
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
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.
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.
Analog computer
Digital computer
Hybrid computer
Analog Computer
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
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.
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:
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.
CHARACTERISTICSOF HYBRIDCOMPUTER
1. Super Computer
2. Mainframe Computer
3. Mini Computer
4. Micro Computer
1) Super Computer
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
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.
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 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:
The CPU has three components responsible for different function, these components are
Control units, arithmetic-logical unit (ALU) and Register.
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.
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.
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.
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.
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.
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
Here are some of them that comes under the primary memory
Types of RAM
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.
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.
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.
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
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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
execution of a program. It accepts, stores and transfers the data and instructions that are used
immediately.
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:
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.
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.
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:
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.
Fig:Laser Mouse
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.
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.
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.
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
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.
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.
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.
The program that directs the internal operation of a computer system is called system software.
The program directs the computer to solve user-oriented problems are called application
software.
According to the Computer architecture, it has three subcategories:
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
TYPES OF INTERFACES
There are two types of interfaces. They are:
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
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.
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) 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.
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.
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.
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.
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.
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:
Symptoms of Virus:
Prevention of Virus:
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.
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:
There are three main part of bus. They are described below:
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.
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.
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.
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).
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.
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.
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.
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:
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.
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.
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.
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
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:
There are some rules for writing the file name. Such as:
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:
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.
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.
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.
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
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
Networks:
The Networks folder display all the shared resources connected to your computer by a network.
Fig. Networks
To open the Network Folders:
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.
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
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:
Fig. Folders
Creating the personal folder on the desktop:
OR
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.
Enhanced for Windows 7, the Search Companion is designed to help you quickly find what
you`re looking for.
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.
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:
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.
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.
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.
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.
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
scheduler), allocates the processors to the process (dispatcher), and free the processor when
the process is executed.
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.
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.
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
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.
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.
.
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
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.
Thread
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:
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.
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 :
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.
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:
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.
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.
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.
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.
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.
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.
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.
Electronic payment system using credit /debit cards, ATM, online payment, electronic
cheque, smart card, electronic purse, etc.
It is the most common medium for spreading malicious software like virus, worm, etc..
Pornography (uploading, publishing, viewing sexual contents in the form of text, image,
audio and video).
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.
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:
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
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.
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.
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.
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.
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.
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.
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.
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,
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.
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 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
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.
</BODY>
</HTML>
Comments in HTML
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):
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
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.
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.
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.
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:
Move the cursor over the transition buttons to preview the effects.
Click onApply to Allbutton to apply the same transition effect to all the slides.
On Mouse Click.
For transitions, go to Animation tab and choose the icon which represents the transitions.
Custom Animation:
Steps :
Now, select the object you prefer from the Custom Animation Panel that appears on the
right-hand side of the slide.
Table
Source:www.tiktip.com
Draw a table:
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:
Now, select a category from the dialog box on the left and review the Smart Art graphics
that has appeared in the center.
Select the animation effect from the slide you want to add sound to.
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.
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.
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.
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.
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
Output area
4. Algorithm:
problem. An algorithm should be simple and clear. It must be to the point and should lead to
In other words, the set of rules that define how a particular problem can be solved in a finite
each of which may require one or more operations. Each operation must be definite, effective
and finite
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
Step3: Read x, y
Step4: Z←x+y
Step5: Print Z
5. Flowchart:
fig. flowchart
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 is unambiguous as there can be only one direction of logic at any one time.
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.
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.
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:
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:
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.
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:
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.
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.
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.
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.
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.
Fig:Unicode in Python
Source: ian-albert.com
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.
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.
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
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.
Generality: It should be flexible and easy to operate with a wide range of platform.
Documented: Documentation helps for smooth operation for the users and even helps
for further modification and maintenance.
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:
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
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.
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:
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 &
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.
Source: www.devsaran.com
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)
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 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.
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.
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.
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 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.
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.
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
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 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
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.
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:
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:
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.
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 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:
Fig. Assembler
2. Compiler:
Fig. Compiler
3. Interpreter:
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
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.
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. C 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.
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
based applications and distributed mobile applications. J#, C#, Visual Basic, Visual C++,
etc. are some of its examples.
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
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.
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.
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.
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.
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).
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
Algorithm
Step 1: start
Step 2: input N
Step 3: if (n>0), output is positive
Step 4: end
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.
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
executed.
Step 4: end
Figure:
Figure:
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.
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
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
}
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)
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.
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