NEB New Curriculum of Class 11 Computer Science
Unit Contents
1.1 Introduction of computer
1.1.1 Definition, characteristics and application of computer
1.1.2 Evolution of computer technology
1.1.3 Measurement unit of processing speed and storage unit
1.1.4 Super, Mainframe, Mini and Microcomputers
1.1.5 Mobile Computing and its Application
1.2 Computer system and I/O devices
1.2.1 Concept of computer architecture and organization
1.2.2 Components of computer system: input unit, output unit, processing unit, memory unit
1. Computer
System (20
and storage
Hour)
1.2.3 Microprocessor: basic concepts, clock speed, word length, components and functions
1.2.4 Bus System: data bus, address bus and control bus
1.2.5 Primary memory: Definition, RAM, ROM, Cache, Buffer, types of RAM and ROM
1.2.6 Secondary Memory: Definition, Magnetic Disk, Flash Memory, Optical Disk,
External Storage Device and memo stick
1.2.7 Input Devices – Keyboard, Mouse, Scanner, Light Pen, OMR, OCR, BCR, MICR,
Scanner, Touch Screen, Microphone and Digital Camera.
1.2.8 Output Devices: Monitor (LCD, LED), Printer (Dot Matrix, Inkjet, Laser), Speaker
1.2.9 Hardware Interfaces: Parallel Port, Serial Port, USB Ports, HDMI and Expansion Slots
2. Number System 2.1 Number System and conversion
and Conversion
Boolean Logic (11 2.1.1 Decimal, Binary, Octal, Hexadecimal Number System & conversion
Hour)
XI Computer Science Bhakta Raj Tamang
2.1.2 Calculation in binary addition, subtraction
2.1.3 One’s and Two’s complement methods of binary subtraction
2.2 Logic Function and Boolean Algebra
2.2.1 Introduction to Boolean algebra
2.2.2 Introduction to Boolean values, truth table, Boolean expression and Boolean function.
2.2.3 Logic Gates –AND, OR, NOT, NAND, NOR, XOR and XNOR – its definition,
truth table, logic symbol, logic function
2.2.4 Laws of Boolean algebra – Boolean identities, Complement Laws, Identity,
Commutative, Associative and Distributive
2.2.5 Statement and verification of Laws of Boolean algebra using truth table
3.1 Concept of Software
3.1.1 Definition of software
3.1.2 Categories of software: System, Utility, Application, Web Based, Mobile Apps
3.2 Concept of Operating System
3.2.1 Introduction to Operating System
3.2.2 Role of Operating System
3. Computer
Software
3.2.3 Functions of an Operating System
and Operating
System (12 Hour)
3.2.4 Operating system terminology: multiprogramming, multitasking, multiprocessing and
distributed
3.3 Windows Operating System
3.3.1 Introduction to GUI based Operating system and its features
3.3.2 Working in Desktop Application and Window Environment
3.3.3 Manage Files and Folders with File Explorer
XI Computer Science Bhakta Raj Tamang
3.3.4 Customize the start screen and desktop
3.3.5 Installing and removing devices
3.3.6 Manage passwords and privacy levels
3.3.7 Use of control panel, system tools and accessories
3.4 Open sources and Mobile Operating System
3.4.1 Concept of Open Sources Operating System
3.4.2 Introduction to Linux and UNIX
3.4.3 Linux Distributions
3.4.4 Concept of Mobile Operating System
3.4.5 Types of Mobile Operating System
4.1 Introduction to Office Package -
Word processor, Presentation tool, spreadsheet package, database management system;
4. Application
4.2 Introduction to domain-specific tools - school management system, inventory
Package (5 Hour)
management system, payroll system, financial accounting, hotel management,
weather forecasting system.
5.1 Programming Concept
5.1.1 Introduction to programming languages
5.1.2 Low level, High level, 4 GL programming languages
5. Programming 5.1.3 Compiler, Interpreter and Assembler
Concepts &
5.1.4 Syntax, Semantic and Runtime errors
Logics (8 hours)
5.1.5 Control Structures: Sequence,Selection and Iteration
5.1.6 Program Design tools – Algorithm, Flowchart and Pseudocode
5.1.7 Absolute binary, BCD, ASCII and Unicode
XI Computer Science Bhakta Raj Tamang
5.2 C Programming Languages
5.2.1 Introduction and features of C Language
5.2.2 Structure of C program
5.2.3 C Preprocessor and Header Files
5.2.4 Character Set used in C
5.2.5 Use of Comments
5.2.6 Identifiers, Keywords and Tokens
5.2.7 Basic Data Types in C
5.2.8 Constants and Variables
5.2.9 Type of Specifier
5.2.10 Simple and Compound Statements
5.2.11 Operators and Expressions: arithmetic, relational, logical, assignment, unary and
conditional operators
5.2.12 Input/output (I/O) Functions
5.2.13 Selection Control Statement: Decisions (if, if-else, if-else-if, nested and, switch)
5.2.14 Iteration Control Statement: Looping (while, do while, for nested)
5.2.15 Array: definition, types(1D and 2D), matrix addition and subtraction
5.2.16 String: definition and string function : strlen(), strcat(), strcmp(), strrev(), strcpy(),
strlwr(), strupr()
6.1 Introduction: Web development introduction
6.2 Web browsers and search Engines
6. Web Technology I
(8 hour) 6.3 Overview of various internet & web technologies
6.4 Content Management System (CMS)
XI Computer Science Bhakta Raj Tamang
6.4. HTML: The Language of the Web
6.4.1 Objectives
6.4.2 Structure of HTML
6.4.3 Published and Hosting
6.4.4 HTML Tags vs. Attributes
6.4.5. Basic Tags of HTML: HTML, HEAD, TITLE, BODY (Setting the Fore color and
Background color, Background Image, Background Sound)
6.4.6 Heading tag (H1 to H6) and attributes (ALIGN),
6.4.7 FONT tag and Attributes (Size: 1 to 7 Levels, BASEFONT, SMALL, BIG,COLOR)
6.4.8 Paragraph Formatting (P)
6.4.9 Break Line BR
6.4.10. Comment in HTML ()
6.4.11. Formatting Text (B, I, U, Mark, Sup, Sub, EM, BLOCKQUOTE, PREFORMATTED)
6.4.12. Ordered List- OL (LI, Type- 1, I, A, a; START,VALUE)
6.4.13. Unordered List - UL (Bullet Type- Disc, Circle, Square, DL, DT, DD)
6.4.14 ADDRESS Tag
• Creating Links: Link to other HTML documents or data objects
• Links to other places in the same HTML documents
• Links to places in other HTML documents
• Anchor Tag and Hyperlink
6.4.15. Tables: Creating Tables using TH, TR and TD tags
6.4.16 Forms: Creating form using Textbox, radio, checkbox, text area, button
XI Computer Science Bhakta Raj Tamang
6.4.17 Introduction to HTML 5 Elements including audio, embed, source, track and
video attributes
6.4.18 HTML 5 Graphics using canvas and svg tags
6.4.19 Concept of domain name and web hosting
6.5 Cascading Style Sheets
6.5.1 Introduction to Cascading Style Sheet (CSS)
6.5.2 Inline CSS
6.5.3 Embedded CSS
6.5.4 External CSS
7.1 Introduction to Multimedia
7. Multimedia (6
7.2 Component of Multimedia: Text, Graphics, Audio, Video and Animation
hour)
7.3 Application of Multimedia
8.1 Digital society and computer ethics
8.2 Concept of Information security
8.3 Concept of Cybercrime
8.4 Malicious software and Spam
8. Information
Security and Cyber 8.5 Protection from cybercrime
Law
8.6 Intellectual Property Right
8.7 Concept of Digital Signature
8.8 Concept of Cyber Law in Nepal
8.9 ICT Policy in Nepal
XI Computer Science Bhakta Raj Tamang
COMPUTER SCIENCE
GRADE XI BHAKTA RAJ TAMANG
[BRT]
XI Computer Science Bhakta Raj Tamang
Computer Science (class XI)
Subject Code: 4271
Chapters
Chapter 1: Computer system
Chapter 2: Number System, Conversion and Boolean Logic
Chapter 3: Computer software and Operating System
Chapter 4: Application Package
Chapter 5: Programming Concepts and logics
Chapter 6: Web technology - I
Chapter 7: Multimedia
Chapter 8: Information Security and Cyber Law
New course of computer science is to be implemented from academic year 2077 BS.
S.N Content Area Hour
1 Computer system 20
2 Number system and conversion Boolean Logic 11
3 Computer software and operating system. 12
Application Package (Word, Excel,
4 5
PowerPoint)
5 Programming concepts and logics (C language) 8
6 Web Technology-I (HTML + CSS) 8
7 Multimedia 6
8 Information security and cyber law 10
XI Computer Science Bhakta Raj Tamang
Chapter 1: Computer system
Introduction
Computer is an electronic device derived from the Latin word "computare" which means to
calculate. It accepts raw facts and figures as an input which are isolated and uninterpreted
through input device, process it according to the requirement of the user or command supplied by
the user, store it before and after processing of require and produce a meaningful information as
an output through an output device. Generally, computer works on IPO (Input-Process-Output)
cycle. It follows GIGO (Garbage In Garbage Out) algorithm which means the output is always
based on the input supplied by the user. The basic operation of computer is illustrated by
following block diagram.
Fig: Block diagram of Computer / Von Neumann Architecture
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 microcomputer can
perform millions of instructions per second as many times without any mistake. The speed
XI Computer Science Bhakta Raj Tamang
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.
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.
XI Computer Science Bhakta Raj Tamang
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.
Applications/Implementations/Uses of computer
The uses of computer are increased day by day. Every aspect if human life is highly influenced
by computer. From simple domestic use to complex engineering and scientific solutions,
computer can be used. This is due to the versatility of computer. Some of the basic
implementation of computer are:
1. Education: Nowadays, computer are highly used in teaching and learning process. Many
interesting graphics can be made and provided for easy learning. Also, computer provide
features of internet which make learning easy and fun.
2. Communication: Computer is massively used in communication. Communication is
done by e-mail, chat, online conferencing. e-fax etc. with help of internet in computer. It
has made the communication faster, easier and cheaper.
3. Business: In business sector, computer are used to generate invoice, maintain stock and
make statistical analysis. E-commerce is the new and emerging way of buying and selling
goods and service through used of electronic means and media.
4. Engineering and designing: Scientific and engineering design requires complex and
massive computations. Design of bridges, towers, buildings, generators, motors, electrical
transmission etc. requires precise computation which are done through computers.
5. Health and Medicine: Computer in hospital is used for diagnosing illness, monitoring
the condition of patients, keeping the necessary records, and many other purposes. By
using computer one can take medical suggestions with expert doctors or medical
representative in any location of the world by sitting in the remote location where there is
lack of hospitals of doctors.
XI Computer Science Bhakta Raj Tamang
6. Entertainments: Computer are also playing very important role for the entertainment of
users. Nowadays computers can be used to watch games, TV programs videos or movies,
listening to music etc. It can also be used to play video games.
Advantages and disadvantages of computer
Advantages
1. The computer can perform a complex operation in a short time.
2. The computer can process a large volume of data.
3. Computer can work continuously for a long time
4. A single computer can perform multiple tasks such as watching a movie, playing games,
listening song and others.
5. The computer does not make a mistake.
6. Computer increases the curricular performance of the student.
Disadvantages
1. The computer does not have a brain and cannot decide itself.
2. It does not have its own intelligence.
3. The computer does not have emotion and feelings.
4. It needs electricity to operate.
5. It cannot operate itself, unless, a human command is given.
GENERATIONS OF COMPUTERS
Computer generations classification is mainly based on the basic devices used. Also, the
considerations are the architecture, languages, modes of operation, etc. The function performed
by the computer and the speed of their operations have been changing since the old days to the
most modern computer. Based on the period of development and the features incorporated, the
computers are classified into different generations- First generation to Fifth generation. This is
called the computer generation.
The classification and time periods are given below:
1. First Generation Computer (1945-1955)
2. Second Generation Computer (1957-1963)
3. Third Generation Computer (1964-1971)
4. Fourth Generation Computer (1972 onward)
5. Fifth Generation Computer (Present and future)
XI Computer Science Bhakta Raj Tamang
1.) First Generation Computer (1945-1955)
Fig: First Generation Computer
In the First-generation computer, vacuum tubes as CPU, magnetic drum for data storage, and
machines languages were used for giving instruction. The computer of this generation was very
large in size called room-sized computers.
The programming of First-generation computers was done in machine languages (0s and 1s).
Afterward, assembly languages were developed and used in first generation computer.
Features of first-generation computers:
• Technology used: vacuum tube
• Machines languages were used to instruct the computer.
• Magnetic core memory was used as primary memory.
• punch card, magnetic tape
• Punched card, printing devices were used for input/output operations and store the result.
• It occupies very large space, slow processing, inefficient and unreliable due to low
accuracy.
• Power consumption was very high and it generated much heat.
• It could only perform straight forward simple numerical calculation.
Computer used to be much expensive.
The example of first-generation computers is ENIAC, UNIVAC, EDVAC, and EDSAC.
2.) Second Generation Computer (1957-1963)
Second generation computer replaced machine language with assembly language, allowing
abbreviated programming codes to replace long, difficult binary codes.
XI Computer Science Bhakta Raj Tamang
Fig: Second Generation Computer
The transistor was developed in this generation. A transistor transfers electric signals across a
resistor. A transistor was highly reliable compared to tubes.
The transistor was far more superior in performance on account of their miniature size, smaller
power consumption, and heat production rate. The second-generation computer used these
semiconductor devices.
Some of its features are:
• Technology used: Transistor
• Operating speed was in terms of a microsecond.
• Assembly language and machines independent language such as COBOL (Common
Business Oriented Language) and FORTRAN (Formula Translation) were introduced the
size of the computer.
• Magnetic core memory was used as primary memory.
• Magnetic drum and magnetic tape were used as secondary memory.
• Power required to operate them was low.
• It could perform scientific calculation such as solving differential equations.
• Storage capacity and use of computers are increased.
3.) Third Generation Computer (1964-1971)
Transistors were an improvement over the vacuum tube, but they still generated a great heat,
which damaged the computer's sensitive parts.
Fig: Third Generation Computer
Transistors were replaced with an integrated circuit known popularly as chips. Scientist managed
to fit many components on a single chip. As a result, the computer became ever smaller as more
components were squeezed on the chip.
XI Computer Science Bhakta Raj Tamang
Magnetic disks began to replace magnetic tape for auxiliary and video display terminals were
introduced for the output of data. Keyboards were used for the input of data. A new operating
system was introduced for automatic processing and multi-programming.
These computers were highly reliable, relatively expensive and faster. High-level programming
languages continued to be a developer. The example of third generation computers is IBM-360
series, ICL-900 series, and Honeywell 200 series.
Features of the third-generation computers are:
• The technology used: IC (Integrated Circuit).
• Transistors were replaced by IC in their electronic circuitry.
• High-level languages like FORTAN, BASIC and other are used to develop programs.
• Semiconductor memory like RAM and ROM were used as primary memory.
• Monitor and keyboard were introduced for data input and output respectively.
• Multiprogramming facility was developed.
• The computer was used in census calculation, military, banks and industries.
• Size, cost, power requirement and heat generation decreased.
• Processing speed and storage capacity used of computer increased.
4.) Fourth Generation Computer (1972 onward)
Fig: Fourth Generation Computer
The invention of microprocessor chip marked the beginning of the fourth-generation computers.
Semiconductor memories replaced magnetic core memories. The invention of microprocessors
led to the development of microcomputer or the personal computer.
The first microprocessor called Intel 4004 was developed by American Intel Corporation 1971.
This computer has faster generation language and application software for microcomputers
became popular and allowed home and business users to adapt their computers for word
processing, spreadsheet manipulating, file handing and graphics.
In this generation, the concept of computer networks and CD-ROMs came into existence.
Features of the fourth-generation computer are:
XI Computer Science Bhakta Raj Tamang
• Technology in use: VLSI is introduced and used Microprocessor-based technology.
• Problem-oriented fourth generation language (4GL) is used to develop the program.
• Semiconductor like RAM, ROM and cache memory is used as a primary memory.
• Magnetic disks like hard disk, optical disk (CD, DVD), Blue-ray disk, flashes memory
(memory chip, pen drive) are used as secondary memory.
• E-mail, Internet and mobile communication are developed.
• Advanced, user-friendly, web page software is developed.
• Size, cost, power requirement, heat generation decreased compared to the previous
generation.
• Operating speed, storage capacity, use of computer increased compared to the previous
generation
The example of the fourth-generation computer is IBM-PC, HP laptops, Mac notebook etc.
5.) Fifth Generation Computer (Present and future)
Fig: Fifth generation Computer
The aim is to bring machines with genuine IQ, the ability to reason logically and with real
knowledge of the word. Thus, this computer will be totally different, totally novel and totally
new than last four generations of computer.
Fifth generation computer was based on Artificial Intelligence (AI) and that is still developing
process, but not yet a reality i.e. this computer is incomplete. The scientists are working on it
still.
These computers will be able to converse with people and will be able to mimic human sense,
manual skills, and intelligence.
Features of the fifth-generation computers are:
• Technology to be used: These machines will incorporate Bio-chip and VVLSI (Very Very
Large Scale Integration) or Ultra-Large Scale Integration
(ULSI)
• Natural language will be used to develop programs.
• The computer will have parallel processing in full fledge.
• The computer will have Artificial Intelligence (AI).
XI Computer Science Bhakta Raj Tamang
• 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 becomes 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
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 these 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
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.
XI Computer Science Bhakta Raj Tamang
• John Napier (1550-1617 AD)
THE SCOTTISH mathematician John Napier first published the table of logarithms in 1614 AD.
It was very used and consists of a large number of calculations.
He invented bone rods and used bones to demonstrate by subtracting and multiplication by
addition according to his principle. These are made of strips of bones on which numbers were
carved and painted that`s why it is also called Napier's bone.
Fig: Napier bone
• William Oughtred (1575-1660AD)
It is a rectangular device-slide-rule. It was a calculating device based on the principle of a log. A
rule consists of two graduated scales, one of which slips upon other. It is devised in such a way
that suitable alignment of one scale against the other makes it possible to find products and
quotient of any numbers.
XI Computer Science Bhakta Raj Tamang
Fig: Ought red ruler
• Blaise Pascal (1623-1662AD)
The man’s name Blaise Pascal, was a brilliant mathematician and religious thinker. Pascal made
a mercury barometer and measured atmospheric pressure to assist his father in his work
accounting. Pascal invented the first mechanical calculation machine in Paris.
Fig: Pascal Calculator
• Baron Gottfried Wilhelm Von Leibniz (1646-1716AD)
He develops a new method of calculation called 'Calculus'. He modified the masculine machine
and invented a first calculator, Stepped Reckoner, which was able to perform automatic addition,
subtraction, multiplication, division, but could find out square root. Each with nine teeth of
varying lengths instead of wheels it was called 'Leibniz Calculator' or 'Stepped Reckoner'.
XI Computer Science Bhakta Raj Tamang
Fig: Leibniz Calculator
• Joseph Marie Jacquard (1752-1834 AD)
The French man, Joseph Marie Jacquard, was a textile manufacturer who invented a mechanism
for automated weaving clothes for the textile industry at Lyon, in 1802 AD. This machine was
used to automatically control weaving looms to facilitate the production of weaving cloth with
complex patterns.
Fig: Jacquard loom
• Charles Babbage (1791-1871 AD)
XI Computer Science Bhakta Raj Tamang
The English Professor and Mathematician, Charles Babbage, invented the Different Engine at
Cambridge University, in 1822 AD. This machine can solve differential equations and calculate
various mathematical functions. It is also called " Analytical Engine ".
Fig: Analytical engine
• Lady Augusta Ada Byron Lovelace (1515-1852 AD)
The English intelligent and independent-minded woman, Lady Augusta, was a daughter of
English poet Lord Byron and a very Great follower, assistant of Charles Babbage. Lady
documents Babbage`s work and writes programs for Babbage.
This plan is now regarded as the first computer program. That`s why, she was considered the first
computer programmer and a software language developed by the US Defense Department, was
named Ada in her honor.
• Herman Hollerith (1860-1929 AD)
XI Computer Science Bhakta Raj Tamang
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.
• John Von Neumann (1903-1975 AD)
The Hungarian Mathematician, John gave an idea of stored program computer in the sense that
program is stored internally in the main memory of the computer along with its associated data,
in 1945. So, he is called the "Father of Stored Program". Before that, program required for the
computer were integrated and written permanently in chips. So, modification of program was not
possible. But, after Neumann, such programs were stored on a computer in some storage media,
so modification was easy and flexible.
XI Computer Science Bhakta Raj Tamang
2.) The Electro-Mechanical Era
The calculator of this age was developed by using mechanical and electronic component vacuum
tube.
Successful general purpose mechanical computers were built, in the 1930s. Konrad Zuze
developed mechanical computer, the Z1, in 1983 in Germany.
• The Mark I Computer (1937 - 1944)
A Professor of Physics, Howard H. Aiken designed a general-purpose mechanical computer at
Harvard University and IBM Automatic Sequence Controlled Calculator (IBM ASCC). It was
the first fully automatic calculating machine and later as Harvard Mark I.
It used binary numbers for its operation. Later, Mark II was invented by Aiken and his colleagues
that were working electromechanical relays for its operation. Mark II used 19000 valves.
• The Mark II Computer
It used about 18 thousand vacuum tubes as the main memory device with 7 lakes 50 thousand
parts. It is 51 feet long, 8 feet height and 3 feet wide as bulky in size. It was capable of
performing five basic arithmetic operations; additions, subtraction, multiplication, division and
table reference. The result was printed at the rate of one result per five seconds.
• The Atanasoff-Berry Computer (1939 - 1942)
In 1939, John Vincent Atanasoff and Clifford Berry designed Atanasoff-Berry computer or ABC
solving systems of mathematical simultaneous equation. It used 18000 valves and other 45
valves for internal logic and capacitors for storage.
XI Computer Science Bhakta Raj Tamang
It used punch cards as input and output operation i.e. secondary. It is considered as the first
computing machine which introduced the idea of binary arithmetic, regenerative memory and
logic circuits.
• The Electronic Computer Era
The computers of this age are developed by using electronic components like a vacuum tube,
transistors IC, VLSI, etc. These computers are smaller, faster and more reliable.
• The ENIAC (1943-1946)
In 1946, John W. Mauchly and 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.
XI Computer Science Bhakta Raj Tamang
It was a very large machine weighing about 30 tons and containing about 17,468 vacuum tubes,
70,000 resistors, 5 million soldered joints and it consumed 160 kilowatts.
• The EDVAC (1946-1952)
EDVAC (Electronic Discrete Variable Automatic Computer) was developed by Dr.John Von
Neumann,and a member of the Moore School of Engineering of the Unversity of
Pennslyvania,J.P Eckert, and J.W Mauchly. The EDVAC is used for more school personnel and
the Ballistics Research Laboratory of the US Army,which was based on Jhon Von Neumann`s
ideas of Stored Program".
• The UNIVAC (1951)
UNIVAC (Universal Automatic Computer) was developed by J.P.Eckert and J. Mauchly in 1951.
It was the first computer manufactured for commercial use and general purpose digital
computer.It was designed to handle both numeric and textual information. Before this, all the
computers were either used for defense or census was by General Electrical Corporation in 1954.
XI Computer Science Bhakta Raj Tamang
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 infrastructure networks as well as
communication properties, protocol, data format and concrete technologies. The second aspect is
on hardware, e.g., mobile device or device components. The third aspect deals with the
characteristics and requirements of mobile applications.
Fig: Mobile Computing
Mobile computing devices are portable devices capable of operating, executing, providing
services and applications to a computing device. It is a computing device used in transit. Users
can access data and information from wherever they are. Here's the example view of how does
the mobile computing works on a server and mobile networks.
XI Computer Science Bhakta Raj Tamang
Fig: Working of Mobile Computing
Fig: Layers of Mobile Computing
Mobile computing is the process of computation on a mobile device. In mobile computing, a set
of distributed computing systems or service provider servers participate, connect, and
synchronize through mobile communication protocols.
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.
XI Computer Science Bhakta Raj Tamang
CHARACTERISTICS OF MOBILE COMPUTING
• It is a portable device that you can carry during mobility.
• It has limited processing and storage capability.
• It includes mobile communication, mobile hardware, and mobile software.
• It usually contains touch screen for providing input.
• It contains on-screen or virtual keyboard for providing text inputs. However, an external
keyboard can be connected by using USB port, infrared or Bluetooth.
• It contains the camera, speaker, and microphone etc.
• It contains handwriting recognizing software.
• Most of the mobile computing devices contain memory card slot to expand the storage
capacity.
• It has wireless connectivity such as Bluetooth, Wi-Fi, to connect the Internet or with
other computing devices as well as the wired connection through the USB port.
• The most mobile computing device can synchronize their data with the applications on a
user's computer.
• It can be used for cloud computing and remote access.
• It uses the mobile computing operating system such as Android, iOS, Windows Mobile
OS, Palm OS.
• It can include GPS (Global Positioning System) receiver for navigation.
Fig: Mobile Computing
Speed Measurement units of Computer
In computers, the size of a device does not reflect the space available to store data in it. There
many tiny devices that store the unbelievable amount of data whereas larger device only can
store few amounts of data. How long, how thick cannot determine how much we can store inside
XI Computer Science Bhakta Raj Tamang
in spite, we need to find some other way to measure space available on the computer. Almost all
of the computers use binary numbering systems.
A group of 4 binary digits is called a nibble. Similarly, a group of 8 bits is called a byte. As the
example, each character requires 8 bits which are 1 byte, so 1 character requires only 1-byte
space. If we have a text file whose size is 32 bytes, it means there are 32 x 8 binary digits stored
in it. .1024 = (2 ˆ10) is that digit which converts higher unit in a binary numbering system.
Following table lists the different units and their values:
Units Equivalent
0 or 1 1 Bit
4 bits 1 Nibble
8 bits 1 Byte
1024 bytes 1 Kilobytes (KB )
1024 Kilobytes 1 Megabyte (MB )
1024 Megabytes 1 Gigabytes (GB )
1024 Gigabytes 1 Terabytes (TB )
1024 Terabytes 1 Petabyte (PB )
1024 Petabytes 1 Exabyte (EB )
Units Equivalent
1000th of a second 1 Milliseconds (MS)
1000th of a milliseconds 1 Microseconds (μs)
1000th of a microseconds 1 Nanosecond (ns)
th
1000 of a nanoseconds 1 Picoseconds (ps)
1000th of a picoseconds 1 Femtoseconds (fs)
CLASSIFICATION OFCOMPUTER ON THE BASIS OF SIZE
1. Super Computer
2. Mainframe Computer
3. Mini Computer
4. Micro Computer
1) Super Computer
XI Computer Science Bhakta Raj Tamang
Fig: Super Computer
Super computer is one of the most powerful computers which is used to perform the complex
calculations. They are the fastest computer which works in nanosecond even in a picosecond too.
This computer is used for a special purpose. Usually, such computer uses parallel processors.
Nowadays, the computing capability of a super computer is equal to that of 40,000
microcomputers. Mostly super computers are used by government agencies. These computers are
used in research and other operations where there is a huge numerical calculation. Different
industries also use this huge computer for designing their products. It is also used in Hollywood
movies for animation purposes. It requires large space and temperature control room. CRAY
XMP/24, NEC-500, PARAM, etc. are some of the examples of a super computer. Today's super
computers are designed by companies such as HP, IBM, Cray Inc.
Application of Super Computer
• Super computer used in weather forecasting and climate research.
• It can be used in military system and defense.
• Super computer is used to in analyzing geographical data.
• It is used to in industrial design and robots.
• Super computer is used to in aircraft and space engineering.
• It is used for testing nuclear weapon.
2) Mainframe computers
Fig: mainframe Computer
Mainframe computers are powerful multi-user computers capable of supporting many hundreds
of users simultaneously. It is also large in size. This computer has slower processing speed than a
XI Computer Science Bhakta Raj Tamang
super computer but faster than a mini and microcomputer. It is designed for large-scale data
processing and a huge amount of data storage. They are used in a big organization such as bank,
insurance companies, airlines, railway reservation system, e-mail service providers, web hosting,
etc. It needed a large area approximately 1000 sq.ft. It supports a large number of I/O terminals,
more than 100 terminals.
In a mainframe, each user accesses the mainframe’s resources through a device called a terminal.
Their terminals are attached to the mainframes to perform the different types of task in FIFO.
Dumb terminal and intelligent terminal are the two kinds of terminals. A dumb terminal is the
input/output device that functions as a window into a computer located somewhere else. An
intelligent terminal can perform some processing operations, but it usually does not have any
storage.
IBM 1401, ICL 2950/10,CYBER 170, etc. are some of the examples of mainframe computers.
3) Minicomputer
Fig: Mainframe Computer
Minicomputer is also a multi-user computer capable of supporting ten to hundreds of users
simultaneously. Due to the smaller size and its cost compared to mainframe and a super
computer, it got its name as a minicomputer. It is also known as midrange computer.
Minicomputer can handle more input and output than a microcomputer. It can support about 50
terminals and requires an area around 100 sq ft. This computer is useful for medium sized
business, organizations, industries, universities and banks. It is cheap and easy to operate than a
mainframe computer.
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.
XI Computer Science Bhakta Raj Tamang
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.
XI Computer Science Bhakta Raj Tamang
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.
Personal Digital Assistant (PDA)
A PDA is similar to a palmtop computer. It is more compact and typically has no keyboard, using
a touch screen for all data input. The screen of PDA has a small screen. So, it has a small stylus
(plastic stick) that is used to press things on a screen.
Most PDAs use some sort of handwriting recognition system to allow the user to write on the
screen and have their writing converted into text. PDAs use a ‘digital diaries’ to take their email,
documents, appointments, etc.
Fig: Personal Digital Assistant
XI Computer Science Bhakta Raj Tamang
COMPONENTS OF COMPUTERSYSTEM
The computer is a device that operated upon information or data. It is an electronic device which
accepts inputs data, stores the data, does arithmetic and logic operations and provides the outputs
in the desired format. The computer receives data, process it, produces output and stores it for
further references. So, a computer should have at least four major components to perform these
tasks. A block diagram of the basic computer organization has the following functional units.
Fig: Block diagram of computer architecture
Input Unit
The input unit is formed by the input devices attached to the computer. Input devices are used to
interact with a computer system or used enter data and instructions to the computer. These
devices convert input data and instructions into a suitable binary form such as ASCII, which can
be acceptable by the computer. In brief, an input unit performs the following function:
• It accepts data and instruction from the outside worlds.
• It converts these data and instruction into computer understandable from a binary form.
• It supplied the converted data and instruction to the computer system for further
processing.
E.g. of input devices are keyboard, mouse, scanner etc.
Memory Unit
This unit is also called storage unit. The data and instructions, which are entered through an input
unit must be stored on the computer before the actual processing starts. The result produces by
the computer after processing is also kept somewhere before passed to the output units. If
intermediate results are produced during processing, it should be stored in somewhere in
XI Computer Science Bhakta Raj Tamang
memory. The storage unit of a computer performs all these needs. In brief, the specific functions
performed by the storage unit are as follow:
• It stored data and instructions, which are entered through input devices.
• It stores an intermediate result of processing.
• It stores the final result of processing before these results are passed to an output device.
The storage unit of computers consists of two types of memory or storage: primary and
secondary storage:
i. Primary Storage
Memory storage that communicates directly with CPU is called main memory. It enables the
computer to store, at least temporarily data and instruction. It is mainly used to hold data and
instructions and as well as the intermediate result of processing which the computer system is
currently working on. Primary memory is volatile, that is, it loses 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 are high-capacity storage devices used to store
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 is as follow:
• Read instruction from memory
• Communicate with all peripherals using the system bus.
• It controls the sequence of instructions.
• It controls the flow of data from one component to another component.
• Performs the computing task specified in the program.
The CPU has three components responsible for different function, these components are Control
units, arithmetic-logical unit (ALU) and Register.
XI Computer Science Bhakta Raj Tamang
Fig: Components of CPU
Control Unit
The control unit provides the necessary timing and control signals to all the operations on the
computer. It controls the flow of data between the CPU, memory and peripherals. It also controls
the entire operation of a computer. It obtains the instructions from the program stored in the main
memory, interprets the instructions and issues the signals, which cause the other units of the
system to execute them. So, it is considered as a central nervous system of a computer that
provides status, control and timing signals necessary for the operation of other parts of CPU,
memory and I/O devices. The main functions of control units are given below:
• It performs the data processing operations with the aid of program prepared by the user
and send control signals to various parts of the computer system.
• It gives commands to transfer data from the input devices to the memory to an arithmetic
logic unit.
• It also transfers the results from ALU to the memory and then to the output devices.
• It stores a program in the memory.
• It fetches the required instruction from the main storage and decode each instruction and
hence execute them in sequence.
Arithmetic Logic Unit
This is the area of CPU where various computing functions are performed on data. The ALU
performs arithmetic operations such as addition, subtraction, multiplication and division and
logical operation such as comparison AND, OR and Exclusive OR. The result of an operation is
stored in Accumulator or in some register. The main functions of ALU are as follow:
• It accepts operands from registers.
• It performs arithmetic and logic operations.
XI Computer Science Bhakta Raj Tamang
• It returns a result to register or a memory.
The logical operations of ALU give the computer the decision-making ability.
Registers
Registers are the high-speed temporary storage locations in the CPU made from electronic
devices such as transistors, flip-flops, etc. So, registers can be thought as CPU’s working
memory. Register is 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.
XI Computer Science Bhakta Raj Tamang
Fig: Memory
MEMORY
Memory unit is responsible for storing data and instruction either for short or longer period of
time. Basically, memory unit stores data and instruction before and after processing. As we
know, memory is needed for program being currently used or to store data and instruction
permanently. Depending upon the nature of data stored memory unit are distinguished into
primary memory and secondary memory.
Memory unit of CPU is a primary memory where data and instruction are stored temporarily.
Whereas the processed data and information can be stored in secondary memory permanently so
that user can retrieve information whenever required.
There are two types of memory used in our computer system.
1. Primary memory/Main memory
2. Secondary memory/Auxiliary Memory
Primary Memory
Primary memory is also known as system memory or main memory or primary storage or
internal memory. Primary memory is the working area for the computer's processor.
It holds data for processing. It holds instructions for processing data. It holds data after it is
processed waiting to be sent to an output or storage device.
Features of Primary memory
1. It is used for storing data and programs for temporary.
2. It is normally used for smaller storages.
3. It is expensive and faster for read / write operations than secondary memory.
Here are some of them that comes under the primary memory
• RAM (Random Access Memory)
XI Computer Science Bhakta Raj Tamang
Fig: Random Access Memory
RAM is the read/write memory of the computer. It is used for both purposes read and write. It
possesses random access property that means CPU can access any memory location in a random
sequence form.
It is a volatile memory. It stores data or information as long as power supply is on. But, after
power supply is off, data will be gone. There are two types of RAM.
Types of RAM
• Static RAM (SRAM)
SRAM stores data and programs as long as the computer is in ON state. It is expensive but faster
for read/write than DRAM.it is typically used for CPU cache while DRAM is used for a
computer's main memory.
Fig: Static RAM
• Dynamic RAM (DRAM)
The data stored in DRAM will be lost after a few milliseconds even if the computer is on. It is
cheap but slow for read/write than SRAM.
XI Computer Science Bhakta Raj Tamang
Fig: Dynamic RAM
• Read Only Memory (ROM)
ROM stands for Read only memory. It can be used only to perform the read operations. It does
not have write access. It is non-volatile memory i.e., the information stored in it is permanent and
is not lost even if the power supply is cut down.
Fig: Read Only Memory
It is used for permanent storage of programs. It is cheaper than RAM on per unit basis but while
compared to storage ROM is expensive than RAM.
Types of ROM
• PROM (Programmable Read Only Memory)
It is a programmable memory that users can write data at once only. The user can store
permanent programs, data or any kind of information in PROM.
Fig: Programmable Read only Memory
• EEPROM (Electrical erasable programmable read only memory)
It is a memory that can also be erasable via electric. It can be erased and reprogrammed on the
byte-by-byte basis single data or the entire chip can be erased.
Fig: Electrical erasable programmable read only memory
XI Computer Science Bhakta Raj Tamang
• EPROM (Erasable Programmable Read Only Memory)
It is an erasable memory. Data stored on it can be erasable via passing the Ultra-Violet light so
that entire data will be erased.
Fig: Erasable Programmable Read Only Memory
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.
2.1) Magnetic Storage: It is a storage media in which data are stored in the form of magnetic
spot. A coating of magnetic metal oxide like ferric oxide is done over the disk which attracts the
data to be deposited over them. Data are stored in the form of magnetic pattern. Some of the
magnetic storage media are: Magnetic tape, Floppy disk and so on.
2.1.1) Hard disk: It is secondary storage device of Computer. It was introduced by IBM in 1956
AD. It was first called Winchester disk. Unlike, floppy disk it cannot be bend so it is known as
hard disk. It is mainly used to store huge volume of data and programs permanently so it is
known as non-volatile memory. The disk is divided into the number of concentric-circle called
tracks and this track is divided into invisible segments called sector.
XI Computer Science Bhakta Raj Tamang
2.1.2) Floppy disk: It is a round and flat disk made up of Mylar (Plastic material) coated with
magnetic material. It is read-write memory as we can read from it as well as write onto it. We
can access information from a floppy disk randomly. It has very small storage compare to hard
disk.
2.2) Optical Storage: is also non-volatile secondary storage media. It is a flat round disk made
up of plastic poly carbonate material coated with aluminium alloy. A very fine laser beam is
projected to read and write data from and onto the disk. Some commonly used optical storage is
CD-ROM, DVD and Blu-Ray (BD). The different types of optical storage are:
2.2.1) CD-ROM: It stands for Compact Disk- Read Only Memory. It is an optical storage media
as it uses laser beam to access data from the disk. It can store up to 700mb of data and are useful
to store large amount data like computer software, audio, video movies etc. Other types of CD-
ROM are CD-R and CD-RW.
2.2.2) DVD: DVD stands for Digital Versatile Disk or Digital Video Disk. It is also a type of
optical memory which can store very large amount of data and information almost six times
more than CD. It is also considered as improved form of CD-ROM and use same technology as
that of CD-ROM for reading and writing data.
2.3) Flash Memory: It is a non-volatile. erasable and programmable solid-state memory which
is made up of Semi- Conductor chip. It is derived from EEPROM. In Flash entire memory can be
eased in a few second by using electric technology. Examples memory card, pen-drive etc.
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.
There are usually two levels of cache memory. They are:
• Level 1 (L1)
XI Computer Science Bhakta Raj Tamang
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 is an 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.
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.
XI Computer Science Bhakta Raj Tamang
COMPONENTSOF MICROPROCESSOR
A microprocessor is often referred to as the CPU or Central Processing Unit. It is considered to
be the heart of a computer as it controls all the functions of a computer. It can be considered as
an artificial brain. This system can control everything from large automobiles to small devices,
such as mobile phones and calculators.
Fig: Components of Microprocessor
But a microprocessor alone does not have any meaning unless and until it is attached to other
components of a digital computer. It consists of several sections. The Arithmetic/Logic Unit
(ALU) performs calculations and makes logical decisions; the Control Unit deciphers programs;
digital information is carried by Buses throughout the computer and the chip; the registers store
temporary information like a scratch pad does and on-chip computation is supported by local
memory.
Generally, though, it consists of 3 major components. They are:
• ALU
• CU
• Register Array
ALU (Arithmetic and Logic unit): This is the area of the microprocessor where various
computing functions are performed on data. The ALU performs arithmetic operations such as
addition, subtraction, multiplication and division and logical operations such as AND, OR and
NOT. The result of the operation is stored in the registers called Accumulator. ALU also
performs an operations like increment, decrement, shift and clear.
Control Unit: The control unit provides the necessary timing and control signals to all the
operation in the microcomputer. It is the one in charge of informing all the ALU units of what
operations are to be performed on.
XI Computer Science Bhakta Raj Tamang
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.
FUNCTIONS OF MICROPROCESSOR
• Providing timing and control signals for all elements of the computer.
• Fetching instructions and data from memory.
• Transferring data to and from memory and I/O devices.
• Decoding instructions
• Performing arithmetic and logic operations according to the instruction fetch by user.
• Responding to I/O generated control signals.
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 convert
input data and instructions into a suitable binary form which can be accepted by the computer.
Input devices are necessary to enter data and instructions into a computer as input unit is the only
medium through which users can interact with the computer.
COMMONLY USED INPUT DEVICES
• Keyboard
A keyboard is the primary input device through which instructions and data are entered into the
computer. It was first invented, in 1868 A.D, in America by Christopher Latham Sholes. This
commonly used input device mostly uses a Qwerty layout. The layout is called "Qwerty layout"
because such keyboard has those keys as the first 6 letters on top of an alphabetic line of a
keyboard.
Fig: Keyboard
A keyboard is connected to the CPU with a cable. When a key is pressed, an electronic signal is
produced which is then detected by an electronic circuit called keyboard encoder. The main
function of an encoder is to detect which key has been pressed and to send a binary code that is
correspondent to the pressed key of a computer. This binary code may be ASCII, EBDIC or HEX
code.
XI Computer Science Bhakta Raj Tamang
Earlier, keyboard with serial port containing 9 pins was in use. These days, we have USB
(Universal Serial Bus) port keyboard and some even wireless. Keyboard with navigation keys
like play, pause, next, previous, etc. with multimedia functions is also available. There are 4
types of keyboards for PCs now available. The first 3 were invented by IBM while, the latter is
the result of changes made when Microsoft Windows 95 was released. They are:
1. The 83-key keyboard (PC/XT)
2. The 84-key keyboard (PC/AT)
3. The 102-key keyboard (called the extended keyboard)
4. The 105-key Microsoft Windows 95-compatible keyboard)
Mouse
A mouse is a small input device which is used to point, draw and select items that are displayed
on the computer screen. The pointer of the mouse is called a cursor. As we move the mouse
across the screen, the cursor moves according to the movement of the mouse. It was invented in
1960 A.D by Douglas Engelbart.
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.
• 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
XI Computer Science Bhakta Raj Tamang
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.
XI Computer Science Bhakta Raj Tamang
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.
XI Computer Science Bhakta Raj Tamang
Fig: Barcode reader
The bar code reader is used in labeling consumer products and books. It is detected as ten digits.
The first 5 digits identify the supplier or manufacturer of the item whereas, the second 5 digits
identify an individual product. The code also contains a check digit to ensure that the information
read is correct.
Light Pen
A light pen is a pencil shaped device which is used to select screen positions by detecting the
light coming from points on a screen. It was 1stinvented in 1952 A.D, in MIT (Massachusetts
Institute of Technology). A light pen is sensitive to the short burst of light emitted from the
phosphor coating at the instant the electron beam strikes on a particular point.
Fig: Light pen
Though the light pens are still in use, they are not as popular as they used to be as they have
several disadvantages comparing to other input devices.
OCR (Optical Character Reader)
Optical Character Reader (OCR) is the device that helps in the recognition of printed or written
text characters by a computer. OCR is used for reading text from paper and translating it into a
form that the computer can manipulate. An OCR reader scans the document using the
photoelectric device to convert it into electric signals. These patterns are then compared with the
stored patterns of the characters which the reader can recognize. If a match is found, the
character scanned is identified otherwise, it is rejected by the reader. This device is widely used
in airlines, banks, postal offices (for reading postal code), etc.
XI Computer Science Bhakta Raj Tamang
Fig: Optical Character Reader
• OMR (Optical Mark Reader)
Optical Mark Reader is widely used device for scoring answers for multiple choice questions. It
can sense the presence of a pen or pencil mark. Special marks such as squares or bubbles are
prepared on examination answer sheets or questionnaires. The user fills in these squares or
bubbles with soft pencil or ink to indicate their choice. These marks are detected by the Optical
Mark Reader and the corresponding signals are sent to the processor.
Fig: Optical Mark Reader
• MICR (Magnetic Ink Character Reader)
Magnetic Ink Character Reader has been used to read documents that are written by a special ink
made of a magnetic material called magnetic ink. MICR is capable of reading characters on a
paper written with the magnetic ink which is magnetized during the input process. The MICR
reads the magnetic pattern of the written characters. To identify the characters, these patterns are
compared with a special pattern stored in the memory. It is mostly used in banks and postal
services.
XI Computer Science Bhakta Raj Tamang
Fig: Magnetic Ink Character Reader
• Touch Screen
Touch screen is a kind of screen which is sensitive to user’s touch. One can use a finger to point
the command or menu displayed on the screen. Touch screen was invented in 2009 A.D, in Apple
store. It is widely popular on laptops.
Fig: Touchscreen
• Voice Input System
The input system which is used to give the instruction to the computer invoice, without using the
keyboard i.e. without typing is called Voice Input System. In Voice Input System, the speech is
converted into electrical signals employing a microphone. The signals are sent to a processor for
processing. Then, the signal pattern is compared with the pattern already stored in the memory. A
word is recognized only when a choice is found, and then, the computer gives a corresponding
output.
Fig: Voice Input System
A voice recognition system can be used in factories at places where both hands of workers are
engaged in the job like if he is doing some handful of work and he wants to input some data into
the computer. It can also be used to assist handicapped people or for identification purposes in
banks, etc.
Output Devices
There are two broad classes of output devices. They are:
XI Computer Science Bhakta Raj Tamang
1. Softcopy output
2. Hardcopy output
Soft Copy Output
Soft copy output refers to the data shown on display screen or produced by speaker. This type
output is untouchable. It is temporary in nature that means, output cannot be carried for being
shown to others. These types of output resides only when there is computer or continuous
electric supply. It is non-portable compared to hard copy output. for example, Output produced
on display screen or sound produced from speaker are soft copy output and whereas the device is
known as soft copy output device. The commonly used soft copy output devices are speaker and
monitor.
Digital Projector
A projector is an output device that enables the user to project the output onto a large surface
such as a big screen or wall. It can be connected to a computer and similar devices to project
their output onto a screen. It uses light and lenses to produce magnified texts, images, and
videos. So, it is an ideal output device to give presentations or to teach a large number of people.
Speaker
Speakers are output devices that generate audio sound and can be changed for loudness as
needed. A large group of individuals can be spoken to or the entire room can be heard with it. For
sound to be produced through speakers, a sound card is required. The sound card converts digital
audio into electrical current, which is then transmitted to the speakers, where it is heard by us. It
can be utilized when speaking with someone online or utilizing another type of technology.
XI Computer Science Bhakta Raj Tamang
Monitor
Monitor is an output device which is used for producing soft-copy output. It is also known as
VDU i.e. Visual Display Unit. It forms images from tiny dots, called pixels that are arranged in a
rectangular form.
Cathode-Ray Tube (CRT)
CRT’s Screen display is made up of small picture elements called pixels. The smaller the pixels
the better the image clarity or resolution. CRT is the large bulky sized monitor. It has high power
requirement so it is not appropriate for portable devices.
liquid crystal display
LCD contains liquid crystals in between two plates of the screen. The plates are made by either
glass or plastic. The front plate is transparent and the back plate is reflective. Liquid crystals are
charged electronically to display the content.
XI Computer Science Bhakta Raj Tamang
Light emitting diode
LED contains multiple small bulbs. The contents are displayed by turning the bulbs “on” and
“off”. Initially it was used only for simple digital displays like in calculator, digital watch, etc. At
present it is also used in television, desktop PC, laptop, etc.
Hard Copy Output
This type of output is in print form on the paper or some material that can be touched and carried
for being shown to other. It is permanent in nature. So that we can look after this output even
there is no computer. Unlike soft copy output, these type of output does not need continuous
supply of power. for example, output produce in paper or other material by printer or plotter is
known as hard copy output and the device is known as hard copy output device. The commonly
used hard copy output devices are printer and plotter.
Printer: A printer produces hard copies of the processed data. It enables the user, to print
images, text or any other information onto the paper. Users can pick from various printer types,
such as inkjet, laser, or dot matrix, to meet their printing demands. Based on the printing
mechanism, the printers are of two types:
1. Impact Printers
2. Non-impact Printers.
XI Computer Science Bhakta Raj Tamang
o Impact Printers: They are of two types:
A. Character Printers
i. Dot Matrix printers
ii. Daisy Wheel printers
B. Line printers
i. Drum printers
ii. Chain printers
o Non-impact printers: They are of two types:
A. Laser printers
B. Inkjet printers
Impact Printer
The impact printer uses a hammer or print head to print the character or images onto the paper.
The hammer or print head strikes or presses an ink ribbon against the paper to print characters
and images.
Impact printers are further divided into two types.
A. Character Printers
B. Line printers
A) Character Printers
Character printer prints a single character at a time or with a single stroke of the print head or
hammer. It does not print one line at a time. Dot Matrix printer and Daisy Wheel printer are
character printers. Today, these printers are not in much use due to their low speed and because
only the text can be printed. The character printers are of two types, which are as follows:
i) Dot Matrix Printer
XI Computer Science Bhakta Raj Tamang
Dot Matrix Printer is an impact printer. The characters and images printed by it are the patterns
of dots. These patterns are produced by striking the ink-soaked ribbon against the paper with a
print head. The print head contains pins that produce a pattern of dots on the paper to form the
individual characters. The print head of a 24-pin dot matrix contains more pins than a 9-pin dot
matrix printer, so it produces more dots which results in better printing of characters. To produce
color output, the black ribbon can be changed with color stripes. The speed of Dot Matrix
printers is around 200-500 characters per second.
B) Line Printers:
Line printer, which is also as a bar printer, prints one line at a time. It is a high-speed impact
printer as it can print 500 to 3000 lines per minute. Drum printer and chain printer are examples
of line printers.
i) Drum Printer:
Drum printer is a line printer that is made of a rotating drum to print characters. The drum has
circular bands of characters on its surface. It has a separate hammer for each band of characters.
When you print, the drum rotates, and when the desired character comes under the hammer, the
hammer strikes the ink ribbon against the paper to print characters. The drum rotates at a very
high speed and characters are printed by activating the appropriate hammers. Although all the
characters are not printed at a time, they are printed at a very high speed. Furthermore, it can
print only a predefined style as it has a specific set of characters. These printers are known to be
very noisy due to the use of hammering techniques.
XI Computer Science Bhakta Raj Tamang
Non-Impact Printer:
Non-impact printers don't print characters or images by striking a print head or hammer on the
ink ribbon placed against the paper. They print characters and images without direct physical
contact between the paper and the printing machinery. These printers can print a complete page
at a time, so they are also known as page printers. The common types of non-impact printers are
Laser printer and Inkjet printer:
i) Laser Printer:
A laser printer is a non-impact printer that uses a laser beam to print the characters. The laser
beam hits the drum, which is a photoreceptor and draws the image on the drum by altering
electrical charges on the drum. The drum then rolls in toner, and the charged image on the drum
picks the toner. The toner is then printed on the paper using heat and pressure. Once the
document is printed, the drum loses the electric charge, and the remaining toner is collected. The
laser printers use powdered toner for printing instead of liquid ink and produce quality print
objects with a resolution of 600 dots per inch (dpi) or more.
ii) Inkjet Printer:
XI Computer Science Bhakta Raj Tamang
The inkjet printer is a non-impact printer that prints images and characters by spraying fine,
ionized drops of ink. The print head has tiny nozzles to spray the ink. The printer head moves
back and forth and sprays ionized drops of ink on the paper, which is fed through the printer.
These drops pass through an electric field that guides the ink onto the paper to print correct
images and characters.
An inkjet printer has cartridges that contain ink. Modern inkjet printers are color printers that
have four cartridges containing different colors: Cyan, Magenta, Yellow, and Black. It is capable
of printing high-quality images with different colors. It can produce print objects with a
resolution of at least 300 dots per inch (dpi).
Differences between impact and non-impact printers.
Impact printer Non-Impact Printer
1. It uses electro-mechanical mechanism that causes 1. It uses thermal, chemical, electrostatic, laser
hammers or pins to strike against a ribbon and paper beam or ink jet technology for printing the text
to print the text and images.
2. It is slow while printing. 2. It is fast while printing.
3. It uses force for printing and produces more sound 3. Since it doesn't use force for printing it
while printing. produces less sound while printing.
4. It cannot print graphics perfectly. 4. It can print graphics perfectly.
5. It is usually single colored. 5. It can be single or multi-colored.
6. It is rarely used at present. 6. It is widely used at present.
examples: Dot matrix printer, Typewriter etc. Examples: Ink jet printer, laser printer etc.
Plotter
A plotter is a computer output device used to produce high-quality, large-scale graphics and
drawings. It works by precisely positioning a pen or other drawing tool to create lines, curves,
and shapes on paper or other media.
XI Computer Science Bhakta Raj Tamang
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 design, arrangement, construction or organization of the different parts of a computer system
is known as Computer Architecture. It is the conceptual design and fundamental operational
structure of a computer system.
It may also be defined as the science and art of selecting, interconnecting hardware components
to create computers to meet functional performance and cost.
ROLES OF COMPUTER ARCHITECTURE
Computer Architecture is to design a computer that maximizes performance while keeping power
consumption in check, costs low relatively to an amount of expected performance and it is also
reliable.
There are many aspects to be considered like Set Design, Functional Organization, Logic Design
and Implementation are the first prior.
Computer Organization
Computer organization refers to the operational units and their interconnection that realize the
architecture specification. Computer organization deals with physical aspects of computer
design, memory and their types and microprocessors design.
Whereas computer architecture deals with design aspects of computer that assembly programmer
needs to know like instruction set (i.e. instruction supported), instruction format (i.e. how
instruction will be specified), addressing modes, data types supported, etc.
The difference between Computer Architecture and Computer Organization are:
Computer Architecture Computer Organization
XI Computer Science Bhakta Raj Tamang
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 as they are connected together to form a computer system.
seen by the user.
It includes information, formats, instruction set, It includes Hardware details transparent to the
and techniques for addressing memory. programmer such as control signal and peripheral.
It describes how the computer performs. Ex, circuit
It describes what the computer does. design, control signals, memory types and etc.
Bus Architecture:
A bus is a collection of wires, chips and slots inside the computer through which data are
transmitted from one part of the computer to another from peripheral devices. It is also called a
pathway in the computer on which data travels. It is a set of parallel distinct wires, serving
different purposes, which allow devices attached to it to communicate with the CPU.
The bus architecture in computer system is as shown below:
Figure: Bus Architecture
The function of BUS is:
• It carries information from one component to another.
• It carries data, address or control signal.
• One component of the computer can interact with other through a bus.
XI Computer Science Bhakta Raj Tamang
There are three main parts 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.
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.
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.
INTERFACES AND PORTS
A special piece of circuitry that is fitted inside a computer and sits between the computer and the
port is called interface. The purpose of an interface is to provide a compatible connection
between computer and port where the peripheral devices are connected.
A place where data can pass into or out of a central processing unit, computer, or peripheral is
called port.
XI Computer Science Bhakta Raj Tamang
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 off 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.
XI Computer Science Bhakta Raj Tamang
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)).
FUNCTIONS OF PORTS
1. Ports are the connecting peripheral devices.
2. Ports are used to transmit data to and from peripheral devices.
3. It provides electrical power to those devices having low power requirement such as a
mouse, keyboard, pen drive, etc.
Some of the popular communication ports are given below:
Parallel port
A parallel port allows lines to be connected that will enable 8 bits to be transferred
simultaneously, like cars on an eight-lane highway. It moves information faster than the serial
lines.
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.
XI Computer Science Bhakta Raj Tamang
It is also known as an RS-232 port. Serial ports are used principally for communications lines,
modems and mice. They are frequently labeled COM for communications purpose.
Universal Serial Bus (USB)
Universal Serial Bus (USB) is a serial bus standard to connect devices to a host computer. It was
designed to allow many peripherals to be connected using a single standardized interfaces socket,
to improve plug and play capabilities that allows devices to get connected and disconnected
without powering off the computer.
It includes providing power to low-consumption devices eliminating the need for an external
power supply and allowing many devices to be used without requiring manufacture-specific
drivers to be installed.
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.
IEEE 1394 Interface (Firewire port)
IEEE 1394 is a standard serial bus interface used for fast communication and real-time data
transfer. It's commonly found in personal computers, digital audio, and digital video devices.
XI Computer Science Bhakta Raj Tamang
(Firewire port)
It replaced parallel SCSI (Small Computer System Interface) in many applications because of
lower implementation cost and a simple more adaptable cabling system in the computer system.
ALU
XI Computer Science Bhakta Raj Tamang
Chapter 2: Number System, Conversion and Boolean Logic
1's and 2's Complement
1's Complement: Reciprocal of 1s to 0s and 0s to 1s is its 1's complement. For eg, 1's
Complement of (1011)2 is (0100)2
2's Complement: Adding 1 to the 1's complement of a given binary number is its 2's
complement.
For eg, if (1010)2 is a given number then, its
1's complement is (0101)2 and 2's complement is (0101)2 +(1)2 = (0110)2
Very important
Subtraction using 1's and 2's Complement
Rules to remember [ let us consider, question be X-Y]
Using 1's Complement Using 2's Complement
Calculate 1's complement of ‘Y’ Calculate 2's complement of ‘Y’
Add result of step 1 with ‘X’ Add result of step 1 with ‘X’
If there is extra bit, remove that extra bit and add
If there is extra bit, remove that extra bit.
on its remaining bit.
If there is no extra bit, find 1's Complement of If there is no extra bit, find 2's Complement of
result in step 2 and add (-)ve sign. result in step 2 and add (-)ve sign.
Example
Q) Subtract (1000)2 from (111)2 using 1's and 2's complement.
Ans. Given question is (111)2 - (1000)2
A) Using 1's Complement,
First calculating 1's complement of (1000)2 is (0111)2
Adding (0111)2 with (111)2 we get
(0111)2 + (0111)2 = (1110)2
Since, there is no extra bit i.e. 4 digits added with 4 digits and gives 4 digits result
XI Computer Science Bhakta Raj Tamang
Calculating 1's complement of (1110)2 we get (0001)2 and putting (-)ve sign
Hence, result is -(0001)2
B) Using 2's Complement,
First calculating 2's complement of (1000)2 is (0111)2 + (1)2 = (1000)2
Adding (1000)2 with (111)2 we get
(1000)2 + (0111)2 = (1111)2
Since, there is no extra bit i.e. 4 digits added with 4 digits and gives 4 digits result
Calculating 2's complement of (1111)2 we get (0000)2 + (1)2 = (0001)2 and putting (-)ve sign
Hence, result is -(0001)2
Q) Subtract (11001)2 from (11101)2 using 1's and 2's complement.
Ans. Given question is (11101)2 - (11001)2
A) Using 1's Complement,
First calculating 1's complement of (11001)2 is (00110)2
Adding (00110)2 with (11101)2 we get
(00110)2 + (11101)2 = (100011)2
Since, there is extra bit i.e. 5 digits added with 5 digits and gives 6 digits result
Removing that extra bit and adding on it
(00011)2 + (1)2 = (00100)2
Hence, result is (00100)2
B) Using 2's Complement,
First calculating 2's complement of (11001)2 is (00110)2 + (1)2 = (00111)2
Adding (00111)2 with (11101)2 we get
(00111)2 + (11101)2 = (100100)2
Since, there is extra bit i.e. 5 digits added with 5 digits and gives 6 digits result
Removing that extra bit, we get (00100)2
XI Computer Science Bhakta Raj Tamang
Hence, result is (00100)2
Introduction: Boolean Logic
Boolean Algebra is algebra of logic, which deals with the study of binary variables and logical
operation. As every data are represented in terms binary values, we need to manipulate those
values by using some certain rules and expression which we can do through Boolean algebra. It
is most common and basic method to analysis and design logic circuit. It was introduced by an
English mathematician George Boole. In Boolean algebra the variables can have only one of the
two possible value 0 and1 (False or True). Every modern digital computers understand either this
two values.
Boolean algebra: It is algebra of logic which could accept either of the possible two values 0
and 1 and generate a result through logical relationship and operation.
Boolean variable: Those entities which has either or 0 and 1 and denote some specific operation
ore known as boolean variable. Simply, it is an entity in Boolean algebra which has only either
of the two possible values. This variable are denoted by A, B, P, Q, X, Y, Z….
Boolean function (logic functions): Boolean function is an expression formed by binary
variables, binary operators such as AND, OR, NOT, parentheses, and equal sign for a given set
of value this boolean function gives the 0 or 1 as a result.
let us consider,
F = XYZ’+XY
Where, F is a boolean function
X, Y, Z are a boolean variable.
X, Y, Z, Z’ are also literals.
Truth Table: A table which represents the input-output relationship between of the binary
variables for each logical gate called truth table. It shows the relationship between input and
output in tabular form. Thus, truth table is table representing the results the logical operation of
the logical operation on all possible combination of logical values.
Boolean Operator and Operands
Operators are the symbols that define the specific operation. These are three basic operators used
in Boolean Algebra, ie. AND, OR, NOT. Every other operations can be expressed in terms of
this basic operation. For examples, NOR operator is the combination of NOT and OR operators.
The three basic operators are:
a. AND Operators: AND operator is represented by “.” So, A AND B is represented by (A.B) .
The result of the AND operation is exactly same as simple arithmetic multiplication. That means
XI Computer Science Bhakta Raj Tamang
result will be high (1) only when both the inputs are high. Note: A AND B can also represented
bu AˆB or AnB. Truth table of AND operation is given below
A B Y = A.B
0 0 0
0 1 0
1 0 0
1 1 1
b. OR Operator: OR operator is represented by “+” So, A OR B is represented by (A+B) . The
result of the OR operation is exactly same as simple arithmetic addition. That means result will
be low (0) if and only both the inputs are low. Note: A OR B can also represented bu AvB or
AuB. Truth table of AND operation is given below
A B Y = A+B
0 0 0
0 1 1
1 0 1
1 1 1
c. NOT Operator: NOT operator is represented by “-” or “ ’ ” So, NOT operation of an
operands A is represented as A’ . NOT operation performs negation. That means it will give high
output (1) for low input (0) and vice-versa. Truth table of NOT operation is given below
A A'
0 1
1 0
XI Computer Science Bhakta Raj Tamang
Logic Gate
A logic Gate is an electronic circuit that operates on one or more inputs to produce an output.
Logic Gate are used for binary operations which are very fundamental components for modern
digital computer. Logic gates are embedded unit an Integrated Circuit (IC). Each gate has its
specific function and graphical symbol. In digital computer there are three basic logic gates.
a. AND gate: AND Gate is an electronic Circuit which produce high output (1) only when both
the inputs are high. The output is same as the result of basic arithmetic multiplication. This gate
may have more than two inputs and produce a single output.
Graphically AND gate is represented as
AND gate is denoted by “ . ” So, output is expressed algebraically as, Y = A
Truth table for AND gate is
A B Y = A.B
0 0 0
0 1 0
1 0 0
1 1 1
Venn-diagram
b. OR Gate: OR Gate is an electronic circuit which produce low output (0), when all the inputs
are low (0) and produce high (1) output for every possible combination of 0 and 1. The output is
same as basic binary addition. The gate may have two or more than two inputs and produce
single result.
XI Computer Science Bhakta Raj Tamang
Graphically OR gate is represented as
Algebraically output of OR Gate is represented as: Y = A+B
Truth table of OR Gate is
A B Y = A+B
0 0 0
0 1 1
1 0 1
1 1 1
Venn-diagram
c. NOT Gate: NOT Gate is another fundamental gate whose result is complement of its input. It
is also called inverter. It produces low-0 logic for high-1 input and vice-versa. This Gate has
single input and single output.
Graphically NOT gate is represented as:
XI Computer Science Bhakta Raj Tamang
Algebraically output of NOT Gate is represented as: Y = A’ for input A
Truth table of NOT gate is:
A A'
0 1
1 0
Venn-diagram
d. NAND Gate: NAND gate is a derived gate, derived from NOT and AND gate. This gate
reciprocal the output obtain from the AND gate. That means it will produce low-0 output when
both the inputs are high-1 and produce high-1 output when any one of the input is low-0. These
gate also may have two or more than two and a single output.
Graphically NAND gate is represented as:
Algebraically output of NAND Gate is represented as: Y = (A.B)’
Truth table of NAND Gate is:
A B A.B y=(A.B)'
0 0 0 1
0 1 0 1
XI Computer Science Bhakta Raj Tamang
1 0 0 1
1 1 1 0
Venn-diagram
e. NOR gate: NOR gate is a derived gate derived from the combination of OR gate and NOT
gate. This gate reciprocal the output obtain from the OR gate. That means NOR gate will
produce high-1 logic when both the inputs are low-0 and produce low output-0 in all possible
combination of 0 and 1. These gate also may have two or more than two input at a single output.
Graphically NOR gate is represented as
Algebraically output of NOR gate is represented as: Y: (A+B)’
Truth Table of NOR gate is
Y =
A B A+B
(A+B)'
0 0 0 1
0 1 1 0
1 0 1 0
1 1 1 0
Venn-diagram
XI Computer Science Bhakta Raj Tamang
f. Exclusive OR (X-OR): It is the type of digital electronic circuit will generate low-0 output
when both the inputs are either low-0 or high-1. It will give high-1 output only when one of the
given input is high. These gate also may have two or more the two input.
Graphically X-OR gate is represented as
Algebraically output of X-OR gate is represented as: Y: A’.B + A.B’
Truth Table of X-OR gate is
A B A' B' A'.B A.B' A'.B+A.B'
0 0 1 1 0 0 0
0 1 1 0 1 0 1
1 0 0 1 0 1 1
1 1 0 0 0 0 0
Venn-diagram
XI Computer Science Bhakta Raj Tamang
g. Exclusive NOR (X-NOR): It is the type of digital electronic circuit will generates high-1
output when both the inputs are either low-0 or high-1. It will give low-0 output only when one
of the given input is high-1. These gate also may have two or more the two input.
Graphically X-NOR gate is represented as
Algebraically output of X-NOR gate is represented as: Y: A.B + A’.B’
Truth Table of X-NOR gate is
A B A' B' A.B A'.B' A.B+A'.B'
0 0 1 1 0 1 1
0 1 1 0 0 0 0
1 0 0 1 0 0 0
1 1 0 0 1 0 1
Venn-diagram
XI Computer Science Bhakta Raj Tamang
De-Morgan's Theorem
First Theorem: The De-Morgan's first theorem states that, “The complement of a sum equals to
the product of its complement.”
It is represented as: (A+B)' = A'.B'
Graphical symbol
Proof:
A B (A+B) (A+B)' A' B' A'.B'
0 0 0 1 1 1 1
0 1 1 0 1 0 0
1 0 1 0 0 1 0
1 1 1 0 0 0 0
Second Theorem: The De-Morgan's second theorem states that, “The complement of a product
equals to the sum of its complement.”
It is represented as: (A.B)' = A'+B''
Graphical symbol
Proof:
A B (A.B) (A.B)' A' B' A'+B'
0 0 0 1 1 1 1
XI Computer Science Bhakta Raj Tamang
0 1 0 1 1 0 1
1 0 0 1 0 1 1
1 1 1 0 0 0 0
XI Computer Science Bhakta Raj Tamang
Chapter 3: Computer software and Operating System
Software - Introduction:
As we know standalone hardware cannot do nothing, for the smooth operation of our Computer
System there should be proper coordination between hardware and software. Software helps to
mobilize the hardware and other resources. In order to mobilize hardware, we have to write
several set of instruction which instruct computer what to do, what not to do. These set of
instruction are collectively known as program and the term software is the collection of related
programs and associated documents. In Order to produce useful output, hardware and software
must work together. Nothing useful can be done with the hardware only and software cannot be
utilize without hardware. The different types of software are:
1) System software: System software is set of one or more programs designed to control the
operation of our computer system. This type of software doesn't fulfill the specific requirement
of the user. They are general program written to assist human in the use of the computer system.
In general system software support the running of other software, communicate with peripheral
device, support the development of other types of software and monitors the use of various
hardware resources. Thus, the system software makes the operation of the computer system more
effective and efficient. The different types of system software.
1.1) Operating System: Operating system is a collection program that controls the overall
operation of the computer system. It is the 1st program that is loaded into memory when the
computer is turned on. It provides platform for other application program to run and execute. It
provides user with an interface so that user can easily communicate with computer. For example:
Linux, Windows, Mac etc.
XI Computer Science Bhakta Raj Tamang
1.2) Utility software: It is the supporting software which is used to perform specific task related
to the maintenance of the computer system. Some of the utility software are included in
operating system where as some are available as separate utility in market. They are also called
service program. For example: Norton Utility, PC tools, win zip etc.
1.3) Device driver: A device driver is a software which is responsible for smooth functioning of
the hardware device that is connected to the computer. When we add a new device to the
computer, we need to install new software called device driver. Device driver will co-ordinate
with the operating system and the newly installed hardware functions properly and smoothly.
1.4) Language translator: It is a special kind computer software which translates the programs
written one language in another language. It is compulsory for both low and high-level language.
It is also called language processor. The types of language translator are compiler, interpreter and
assembler.
2) Application Software: Application software is a set of one or more program which are
design to do a specific task. It is made to fulfill the user demand. This program directs a
computer to solve user-oriented problem such as preparing bills, calculating mathematical
equation, preparing mark sheet etc. The software that are develop for user purpose is called
application software. These types of software are generally develop by using high level
language. for example: Ms-Excel, Photoshop, Billing software etc. There are two types of
application software.
2.1) Packaged software: They are the generalized set of programs design and develop for
general purpose. It is generally large sized, error-free, advance and standard software with much
more functionality for especial work. This type of software doesn't perfectly match the
requirement of many organization or user. They cannot be changed easily are developed and
designed by reputed software Company so they are trust worthy. They are expensive for small
organization. for example: Ms-Office, Adobe, Macromedia etc.
2.2) Customized /Tailored software: This is a software develop in high level language for
special task. This types of software is developed for some specific purpose for solving specific
problem of specific user or organization. The requirement on the user or organization can be
perfectly matched. They can be changed easily since they are made by local programmer. for
example: payroll system, inventory management, school management, billing software, mark
sheet evaluation etc.
Operating system - Introduction
An operating system (OS) is an integrated set of program that controls overall resources such as
CPU, memory, input-output device of the computer system. The major objective of operating
system is to improve the performance and efficiency of a computer system. Like the manager of
a company, an operating system is responsible for the smooth and efficient functioning of the
entire computer system. The operating system provides the platform for other application
XI Computer Science Bhakta Raj Tamang
program/software to run and execute. It provides user with an interface so that user can easily
communicate with computers, which is more convenient to use and operate.
An operating system is a collection of program that controls the overall operation of the
computer system. It also controls and co-ordinate the use of hardware, among the various
application program for various user. So, it act as an interface between user and the computer
hardware. The other major functions of operating system are:
➢ It controls, monitor and co-ordinate overall operation of our computer system.
➢ It act as an interface between user and computer.
➢ It provide platform to develop, run and execute other computer program.
➢ It manages hardware resources such as CPU, memories, input-output terminals,
networking equipment etc.
➢ It hides programming and hardware complexity to the user.
The primary goal of an operating system is to maximize the productivity of a computer system
by operating it in most efficient manner and maintaining the amount of human intervention.
Some examples of operating system are: MS-DOS, Windows, LINUX, MACOS, UNIX,
Chrome, Fedora, Ubuntu etc.
Functions / Features / Advantages of Operating System (OS) - V.imp
1) Input-Output (I/O) Management: Input-Output is essential to operate any computer. It
allows computer to interact with several peripheral devices such as keyboard, mouse, printer,
scanner etc.
2) User Interface (UI): User Interface means an ideal environment in which user can work on it
so that s/he can interact with the computerized system. Every operating system provides the
feature of user interface in order to enhance the experience and joy of using computer or any
other computerized system. It act as a bridge between user and computer. There are 2 types of
user Interface.
➢ Character/Command User Interface ( CUI ): Eg MS-DOS
➢ Graphical User Interface (GUI ): Eg Windows, MAC OS
3) Security: The operating system of a computer has a number of built-in tools to protect against
security threats such as viruses, unauthorized access, suspicious network activity etc. The basic
security in a OS is to control access to your computer by setting users and password.
4) Process Management: The process management allocates a processor to execute a chosen
process. OS acts as a traffic controller, job scheduler, process scheduler and dispatcher.
5) Memory Management: Memory is a large array of bytes, each with its own address. When
the user request CPU for read-write operation. OS determines the amount of memory required
for the program instruction and data. Then OS allocates required memory to load the program
XI Computer Science Bhakta Raj Tamang
and data into RAM. When the program terminates it freezes up the space and new program is
loaded.
6) Data Management: Data management allows organizing their data into logical grouping
called files. Earlier Operating system does not provide features of data management. Hence, they
were inflexible but nowadays, every operating system provides this feature.
7) Command Interpreter: The command interpreter reads the command that a user types in at a
terminal, interprets them and translate them into detail set of instruction that computer hardware
can understand. Every operating system must have command interpreter for its operation.
8) Dead-Lock prevention: During processing a situation can arise in which a resource shared by
two or more process cannot continue because the resources required by a process is held by
other. This situation is known as dead lock. For eg. If process-1 allocates resources A and later
required resources B and process-2 allocates resources B and later requires resources A. In this
situation neither process-1 nor process-2 will be executed. Such situation is called deadlock.
Operating system ensure prevention of deadlock by taking situation action by careful allocation
of resources.
9) Time sharing: The function of OS that involves CPU to allocate time in a number of user on
same computer. This property generally found in network operating system such as windows
NT.
10) Virtual Memory: Virtual memory is the feature of an operating system that allows a
computer to compensate for shortage of physical memory by transferring temporary files from
RAM to disk. Virtual memory has twice as many address as main memory. The process of
translating virtual address into real address is known as mapping. The copying of virtual pages
from disk to main memory is swapping.
Types of Operating System (OS) - V.imp
Types of Operating System (OS)
Basis of Processing Basis of User Interface (UI) Basis of mode of user
Multi programming
Character User Interface Single user
OS
Multi tasking OS Graphical User Interface Multi user
Multi processing OS
XI Computer Science Bhakta Raj Tamang
Time sharing OS
Batch processing OS
Multi threading OS
Online processing OS
Real time OS
A) On the basis of processing
1) Multi-programming OS: Multi-programming is used in multi-user environment. It is the
technique in which multiple user program are executed simultaneously by single processor.
Multi-programming means when two or more than two program are provided to the CPU for
processing or loaded in the internal storage of CPU at the same instant of time. From the loaded
program once the portion of one program is executed and the portion of another program is
executed and so on. Thus, multi-programming refers to concurrent execution of several program.
The main purpose of multi-programming is to increase the utilization of computer and its
resources. Different forms of multi-programming OS are multi-tasking, multi-processing and
multi-user.
2) Multi-tasking OS: Multi-tasking OS allows more than one program to run concurrently
mainly in a single user system. These computer are capable of executing several tasks or
program at the same time. For executing several task it can be single or multi-processing system.
In some multi-tasking system one of the process is called fore-ground (active) other are called
background (inactive). Multi-tasking OS increase the productivity of the user by executing many
task simultaneously. Some of the most common example are MS-Windows, Linux, MAC OS
etc.
3) Multiprocessing OS: Multi-processing system has more than one processor linked in a
coordinated way. Multiprocessing OS supports running a program in more than one CPU.
Generally, super server are especially designed to support multiple processor. UNIX is
commonly used multi-processing OS. Multi-programming and multiprocessing are no the same
concept. Multi-programming involves concurrent execution of two or more programs by a single
CPU, whereas multi-processing involves two or more processor (CPU) for controlling the
different activities or execution of many program simultaneously. Multi-processing concept is
also known as parallel processing. It is more costly and complex technique the multi-
programming which dramatically increase the program execution speed of computer.
4) Time-Sharing OS:
XI Computer Science Bhakta Raj Tamang
Time sharing is a technique which enable many people located in various terminal to use a
particular computer system at a same time. Processors time which is shared among multiple user
simultaneously is termed as time sharing. Multiple jobs are executed by the CPU by switching
between them, but the switches occurs so frequently that user can receive a immediate response.
Advantages:
➢ Provide quick response.
➢ Reduce CPU idle time.
Disadvantages:
➢ Problem of reliability.
➢ Less security.
➢ Integrity.
5) Batch processing OS: Batch processing is a technique which requires grouping of similar
jobs, which consists of program, data and system command. It is also known offline processing.
This type of processing is suitable in program with large completion or involvement. For
example, Payroll, Weather forecasting, Statistical analysis and many more. User need not wait
while the job is being processed. They can submit their program to the operator and collect them
later which means, the jobs are entered stored on a disk in a batch or queue and is executed one
after another under the control of the OS.
Major disadvantage of batch processing is that it does not allow interaction between user and
program during execution.
6) Multi-threading OS: A program in execution is known as process and can be divide into
multiple smaller sub process. This sub-process are known as thread. Multi-threading OS has the
ability to divide process into threads and execute them concurrently. Threads are individual
process that execute simultaneously in multi-tasking OS.
7) Real time OS: Real time processing method is one that controls environment by receiving
data and taking action quickly to affect the functioning of the environment at the same instant of
time. It is an online processing system in which processing time is critical. The entire processing
task has to be completed in the predefined time. The real time OS is suitable for following type
of operation.
➢ Airlines or flight seat availability.
➢ Rocket Launching system
➢ Whole sell supplier and manufacturer. etc
8) Online processing OS: It is a popular processing technique at present. In this method
transaction are processed as soon as it happens at the place of its origin. It is quite simple
compare to real time OS. In this type, user can interact or provides input during processing as
well. The output is provided back to the user as soon as processing is completed.
XI Computer Science Bhakta Raj Tamang
B) On the basis of User Interface (UI)
A user interface allows user to interact with the computer system. It provides user with an ideal
environment so that user can experience better computing. It brings structure to the interaction
between user and computer. Without user interface it is almost impossible to operate a computer
smoothly. Hence, in order to enhance the experience of using computer, UI plays vital role.
Mainly there are 2 types of User Interface (UI).
➢ Character User Interface (CUI)
➢ Graphical User Interface (GUI)
1) Character User Interface (CUI): It is a type of operating system in which whole computer
operates or depend upon the command issued by user. All the operations that take place in CUI
have their own specific command. Hence, they are known as Character User Interface. User have
to remember all the command need to operate the computers. So, they are non user-friendly.
Only the people having technical knowledge would operate this type of operating system. It is
primitive type of OS, in which graphics, pictures, icons, drop-down menu, dialogue box etc. are
not used which make it more difficult to use. It uses the character or text mode of computer such
as DOS and UNIX. A command prompt is a sequence of character used in CUI. Commands are
typed in to instruct computer. MS-DOS is a Character User Interface operating system.
The major advantage of this type of OS is, they can have quick response as long as user enters
correct command whereas, the disadvantages of command driven User Interface is that, they are
very difficult to use if the user is beginner and doesn't know correct command. However, it can
be used in older system with no processing capabilities and low storage.
Features of CUI
➢ It is single user and single tasking operating system.
➢ Less user friendly than GUI.
➢ Commands are used to instruct the computer.
➢ User needs to remember the command for operating this system.
➢ It cannot display graphics, icon, pictures and multimedia.
➢ It is faster than GUI system.
➢ Pointing devices such as mouse, joystick, track-pad are not recognized.
➢ It can be used in low memory and low processing computer.
2) Graphical User Interface (GUI): It is a type of operating system in which computer are
operated just by clicking or selecting the required icon or dialogue box instead of writing a direct
command to the system. Since graphics like icons, pictures, drop-down menus, dialogue boxes
etc. are used which makes it more user-friendly than CUI. Since, user doesn't have to remember
a single command, every user without technical knowledge can also use this type of OS. Due to
user friendly interface, they are simple to use and widely used for domestic application. The goal
of graphical operating system is to create a system that the computer user can turn on and operate
in right way without any training or by remembering commands.
XI Computer Science Bhakta Raj Tamang
The main advantages of GUI is that they are easy to use especially for beginners. The main
disadvantage of GUI is they consume more memory for operation. Windows, MAC OS etc. are
the example of GUI.
The first Graphical User Interface was designed by Xerox-corporations Palo's Alto research
center in 1970's, but it was not popular whereas in until the 1980's the emergence of Apple
Macintosh that use GUI became popular.
Features of GUI
➢ It is user-friendly. So, it is easy to use.
➢ User don't have to remember supports full multimedia and animation.
➢ It requires larger memory for its processing.
➢ GUI environments supports full multimedia and animation.
➢ It can be used in network environment.
➢ It is multi-tasking, multi-programming, multi-user operating system.
➢ Every type of peripheral devices can be used.
➢ GUI environment have following basic components.
Icon: Icons are the small pictures that represent commands, files or windows.
Pointer: A symbol (usually angled arrow) that appears on the display screen and that are moved
to select objects and commands. They are controlled by a pointing device such as a mouse, track
pad, light pens etc.
Desktop: The area on the display screen where icons are grouped is refereed as desktop.
Windows: Windows are displayed on screen and we can change their shape and size at will.
Each window can run a different program or display different information.
Menus: Most graphical user interface let us to execute commands by selecting a choice from a
menu.
File: The systematic collection of related data and information.
Folders: Graphical representation of a directory.
Differentiate between Character User Interface and Graphical User Interface [ CUI v/s
GUI ] V. imp
Character User Interface [ CUI ] Graphical User Interface [ GUI ]
In CUI has to interact with the It is a user interface in which user interact with
applications by making use of commands. applications by making use of graphics.
XI Computer Science Bhakta Raj Tamang
CUI stands for Character User Interface. GUI stands for Graphical User Interface.
In CUI only one task can run at a time i.e. In GUI more than one task can run at a time
Single tasking simultaneously.
It is not user-friendly interface. It is very user-friendly interface.
The user do everything by using Everything are interacted by pointing the application using
commands. devices like mouse.
Faster than GUI. Slower than CUI.
Older computers were operated on CUI. Modern computers use GUI.
eg DOS, UNIX etc eg, Windows, MAC-OS
C) On the mode of user:
There are two types of OS on the basic of mode of user.
➢ Single User.
➢ Multi User.
1) Singe User: A single user OS is a type of OS that is develop and intended for use on a
computer or similar machine that will only have a single user at any given time. This is the most
common type of OS used on a home computer as well as on computer in office or other work
environment. There are two general type of single user system. Single user single tasking and
another is single user multi-tasking. The example of single user single tasking are not much more
feasible for general purpose computing. For eg MS-DOS, PC-DOS etc.
2) Multi User: Multi user OS is computer operating system that allows multiple user on
different terminal to access a single system with one OS in it . A multi user OS differs from a
single user system on network, in that each user is accessing same OS at different machine. The
multi user OS shares computer resources among different users, allowing each user a small slice
of the processor time. This concept is also known as time sharing. Due to that, it gives the user
XI Computer Science Bhakta Raj Tamang
the impression that they are all being served simultaneously even though the OS serves them one
at a time for example: Linux, UNIX etc.
Some important Operating System in use:
Open Source Operating System: Open source generally refers to those applications which
source code is freely available in the internet to the world wide user. Basically, the software that
falls under general public license are open source software. User can customize the source code
of the open source software according to the user requirements. They need not buy the license to
use the software. Source code can be modified and re-distributed to any other person legally.
This software are free of cost. Some of the examples of Open Source Software are Linux, Unix,
Mozilla, Apache etc. Similarly, Open Source operating system are those operating system whose
program code are open to all the user. Some common examples of open source operating system
are Linux, Unix, Minix, Open Solaris etc.
UNIX: UNIX is a powerful flexible and manageable operating system with good utilities and
communication abilities. It is multi-user, multi-tasking and multi-processing operating system. It
is used in bigger size machine like mainframe and minicomputer. It was developed by AT&T
Bell lab around 1970 AD. UNIX is developed in C and Assembly language. The development of
the UNIX has given birth to many operating system such as Linux, Solaris etc. These operating
system inherits its main feature from UNIX.
Linux: It is open source powerful UNIX based operating system, that can run on variety of
platform including Intel, Power PC, DEC Alpha processor as well as multiprocessing system. It
was developed by Linux Torvalds at the university of Helsinki as a college project. He release
the version of Linux including all the source code. It is user develop product, meaning that user
around the world who ran this OS for their own use have develop many of its components and
drivers. It is multi-user, multi-tasking and multi-programming OS mainly popular for server
system. It is distributed through different distributor such as Red Hat, Open USE, Ubuntu,
Fedora, Debian, Granular Linux, Mandriva etc.
MAC OS: MAC OS is a popular GUI based OS for Apple Inc. It is used in Apple Macintosh
computer. It has very high quality graphical user interface. Earlier version of this OS were only
compatible with motorola 68000 series of processors but now they are compatible with Intel
processors also.
Some terminologies related with OS.
Spooling: These process is used to balance the difference in speed of high speed CPU and slow
speed input-output device. It is primarily used for printing purpose. When we provide multiple
file to print to printer together, although printer can print one file at a time. But, all file get lined
up in a queue and get printed one by one. In this process, CPU remains free and user can work on
other application. These technique of printing is possible through a capability of operating
system known as spooling. The term spooling is derive from the term SPOOL ( Simultaneous
Peripheral Operation On Line ).
XI Computer Science Bhakta Raj Tamang
Process: A process is basically a program in execution. It doesn't mean a program. Program
itself is a static while process is dynamic. For simplicity we can define program as a job that
resides into the secondary storage ( which is not loaded in main memory ). A process is a
program which is currently in running or ready state ( which is loaded in main memory ). A
process in a computer maybe in a different possible state.
Running state: A process is said to be in running state if it is currently running in the processor.
Ready state: A process is said to be in ready state if it is temporary stopped to let other process
run in the processor.
Blocked state: A process is said to be in blocked state if it is unable to run until some external
events happens.
Thread: A single process is divided into multiple sub-process and even once of process goes for
input-output operation another piece of same process start executing. This minimize the burden
of context switching to some extend. When multiple process are loaded in a memory at once.
When one process goes in blocked or ready state, another process is chosen by the scheduler to
be in running state. During this phase, the current state of previously running process must be
stored somewhere, so that it can resume from that state at the next time. This mechanism is
known as context switching. It is very costly operation and it reduces efficiency. To solve such
problem newer operating system use the mechanism of threading ( Light-weight process ).
Scheduling: When more than one process are run the operating system must decide which one to
run first. This part of OS concerned with this decision is called scheduler and the algorithm it use
is called scheduling algorithm. Scheduling can be two types.
➢ Priority scheduling: Each program or job is assigned with a priority set to the program.
In this scheduling job or program having highest priority are treated first or selected to
run. The only demerits of this scheduling that small job may have to wait for longer
period of time due to having less priority.
➢ Time-sharing scheduling: Each program loaded in a memory are given fixed amount of
time to execute. Every program that are to be executable have equal processing time. So
that none of the job depends upon the time taken by another job while processing.
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 as low speed and release at high speed at CPU, output buffer works in
reverse order, it accepts data at high speed from main memory and releases at low speed to
output device. 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.
Virtual Memory: In a multi-programming 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
XI Computer Science Bhakta Raj Tamang
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
program with small size available primary memory. This is done by dividing the larger program
into small size segments known as pages.
Mobile Operating System
A mobile operating system allows the user to run other different application software on the mobile,
tablets, etc. Moreover, we can say that it is a type of operating system which is specially designed
for mobiles, tablets, smartwatches, etc. Furthermore, they are a mixture of computer OS with some
additional features for mobiles. Also, they are comparatively light and simple.
Types of Popular Mobile Operating System
1. Android OS
The Android OS is the most common operating system among the mobile operating system.
Furthermore, Google is the developer of Android. Moreover, it is an open source and free operating
system. This OS is based on the Linux kernel. The name for every new version of update is based
on ‘desserts’ for example Cupcake, Donut, Eclair, Oreo, Kitkat, etc.
2. Bada
Samsung is the launcher of this operating system. It came into market in 2010. Moreover, it
includes features like 3-D graphics, application installation, multipoint touch etc.
3. Blackberry OS
The developer of this operating system is Research In Motion (RIM). It was specifically designed
for blackberry devices. Furthermore, it is useful for corporate users.
4. Apple iOS
After android, it is one of the most popular OS. It is designed to run on Apple devices such as
iPhones, iPad tablets, etc. Moreover, like the android devices have the playstore for apps download.
Likewise, apple iOS contains the app store. Also, it has very strong security features.
5. Windows Mobile Operating System
The developer of this OS is Microsoft. It is basically designed for pocket PCs and smartphones.
Moreover, it has the features of computer based Windows OS and additional features for mobile
phones.
XI Computer Science Bhakta Raj Tamang
6. Symbian OS
Symbian Ltd. is the developer of this OS. Moreover, Nokia was the first to use this OS on its
mobile phones. Furthermore, it provides high level integration with communication. This OS is
based on java language.
7. Harmony OS
It is a latest OS moreover, Huawei is its developer. It is specifically designed for use in IoT devices.
8. Palm OS
Its other name is Garnet OS. Furthermore, Palm Ltd. is its developer which developed this OS for
use in Personal Digital Assisstants (PDAs).
9. WebOS
Palm Ltd is its developer. Moreover, it is based on Linux kernel and HP uses it in its mobile devices
and touchpads.
XI Computer Science Bhakta Raj Tamang
Chapter 4: Application Package
MS-Word (Word Processor)
Introduction: Ms-Word is a text editing or word processing software develop by Microsoft
Corporation, USA under MS-Office package. Word processing refers to use of computer to
create, edit and print documents. A word processor enables us to create a document, store it
electronically in a disk, display it on a screen, modify it by entering commands and characters
from keyboard and print it on a printer. MS-Word is a window based application it has many
powerful and advance feature to manipulate the document, With the help of this program we can
create any types of documents like letters, reports, thesis, manuals, brochures, advertisement an
many other document. Beside creating, editing and modifying the documents MS-Word provides
some special facilities such as checking spelling and grammatical error, to search for synonyms
and antonyms, to work with columns, tables, special symbols, pictures, graphs, charts and many
more. The document created with MS-Word have “.doc” extension. The newer version of MS-
Word has newer extension “.docx”".
Features of MS-Word
a. Fast operation: Since, MS-Word is a digital text editing software there is no any mechanical
movement associated. Hence, it is faster in operation.
b. Editing text feature (Character formatting): Any type of operation like insert, delete,
modify the documents and undo/redo, find/replace can be perform very easily. Similarly, we can
customize our text document in any form or style like bold, italic, underline, different font size,
different font color, different font style can be performedetc.
c. Permanent storage: Using MS-Word file and documents can be electronically stored in a
disk or any other storage media. So, we can retrieve it whenever require.
d. Graphics: Ms-Word allows us to insert several objects like pictures and graph anywhere in
the document whenever required.
e. OLE (Object Linking and Embedding): OLE is a technology which are used to share
information between program through object. Objects are saved entities of different type like
charts, equations, picture, audio and video files etc.
f. Mail merge: Mail merge a useful tool that will allow us to easily produce multiple letters,
labels, envelops and more using information stored in a list, database or spreadsheet.
g. Searching: Ms-Word allows us to search any word or text and replace or delete with other
necessary ones throughout the entire document.
h. Printing: Ms-Word allows user to print the documents created by the user anytime, anywhere.
i. Formatting a document: Word has various tools which help format a document. Formatting
refers to the process of enhancing the appearance of the document to make it more readable and
attractive. We can search and replace, display ruler, change a paragraph alignment, change line
XI Computer Science Bhakta Raj Tamang
spacing, creating bullets and numbering to show your information in list. To further enhances the
appearance of the text and documents. We can add border and shading even more we can add
watermark to denote some confidential information in a document.
j. Spelling and Grammar checker: Ms-Word provides you with several features that will help
you to produce professional and error free document. To make your document appear
professional, you want to make sure it is free from spelling and grammar error. Word also has
feature of checking grammatical and spelling error and notifying users by different colored wavy
lines either may be red or green.
k. Use of thesaurus: Ms-word thesaurus makes it possible to look up synonyms and antonyms to
words with few clicks of mouse. We can automatically replace a word by a respective antonyms
or synonyms.
MS-Excel (Spreadsheet)
MS-Excel is a spreadsheet software in the Microsoft office suite that allows user to store,
organize and analyze numerical and text data. It is a part of MS-Office package. A spreadsheet
program allows to present information in a clear way. It can be use to perform mathematical
calculation using several mathematical formula and equations. Excel also allows us to convert
spreadsheet data into various charts like bar-graph, columns and other. It can be use to calculate
the data according to the need of the user such as salary sheet, income and expenses statement,
balance sheet, budget preparation, grade and percentage calculation etc.
Some application areas of excel are:
➢ Basic mathematical calculation.
➢ Financial modeling and analysis.
➢ Statistical analysis
➢ Scientific and engineering calculation.
➢ Graphic presentation and more
➢ The extension of MS-Excel file is “.xlsx” and “.xls”".
Common terminologies used in spreadsheet.
Worksheet(Spreadsheet): Worksheet is the collection of rows and columns which are use to
list, organize and calculate data.
Workbook: The files that are used in spreadsheet are collectively known as workbook.
Workbook are made up of several numbers of worksheet. By default, one workbook have three
worksheet.
Cell: The intersection of rows and columns are called cell. In order to refer a cell, enter a column
letter followed by row number. For eg, C2 The cell where intersection point is called active cell.
Features of MS-Excel
➢ It facilitates us to work in a multiple worksheet at a time.
➢ It allows us to create different types of charts and graphs.
XI Computer Science Bhakta Raj Tamang
➢ It allows us to organize and manage large volume of data.
➢ It allows us to perform any type of calculation automatically by using custom formula
and equation.
➢ It allows us to easily sort the data in ascending and descending order.
➢ It supports high level features like object linking and embedding.
➢ It allows us to format a data to make it more attractive by using tools like font size, font
color etc.
➢ Simple computing operation such as cut, copy, paste, find, replace can be easily done.
➢ It includes internet features such as web tool bar.
➢ It allows us to store data electronically in any storage medium.
Cell reference in Excel (V.imp)
A cell location in a spreadsheet is referred to as its cell reference. To find a cell reference, simply
look at column heading to find which column the cell is in and across to find which row it is in.
The cell reference is a combination of column letter and row number such as A1, B3, Z9 …
When writing cell reference the column letter should always comes first. Specially cell reference
is very important while writing formula or addressing the cell to evaluate the cell. For eg, if we
want to add values 3 and 2 which are in A1 and A2 respectively, instead of writing A3=3+2 we
write A3=A1+A2
There are two types of cell reference.
Relative cell reference: In excel, a relative cell reference identifies the location of the cell or
group of cell. Cell reference are used in formula, functions, charts and other excel commands. By
default a spreadsheet cell reference is relative cell reference. This means, the formula and
functions can be copied and posted to other cell. A relative cell consist of column letter and row
number and intersect at the cell location, An example of relative cell reference would be A1, B4,
G9 etc.
Absolute cell reference: In Excel, an absolute cell reference identifies the location of cell or
group of cell which also contain column letter and row number surrounded by dollar sign($). An
example of absolute cell reference would be $A$2, $G$9, $Z$345 etc. An easy way to add dollar
sign us to click on cell reference and then press “F4” key from keyboard. An absolute cell
reference is use when you want a cell reference to stay fixed on a specific cell, which means
formula and functions can be copied and posted to other cell the formula and function doesn't
change.
MS-PowerPoint (Presentation)
Power point is the presentation software in the Microsoft office suite, with power point we can
create dynamic and professional presentation by using pre-defined layouts, themes and
templates. Powerpoint includes all the features we need to produce professional looking
presentation. Powerpoint presentation consists of series of slides which contain information that
we want to communicate with our audience, This information can include text, image, graph,
XI Computer Science Bhakta Raj Tamang
charts, video, audio and many more. Presentation program can be used as a supplement of older
visual aid technology such as pamphlets, handouts, posters, chalkboard etc.
The extension of powerpoint file is “.ppt", later version use “.pptx”". Similarly magic point,
apple keynote, IBM lotus, Harvard graphics etc are the alternative software for Ms-Powerpoint.
Features of MS-PowerPoint.
➢ Formatting of data helps to make document much more attractive, effective and
interactive by using tools like font, font color, hyperlinks etc.
➢ Simple computing operation such as cut, copy, paste, find and replace are supported,
➢ It allows user to use pre-defined layout, themes and templates which helps in faster
development and design of presentation.
➢ Slide transition and effects can also be used for further requirement,
➢ We can create our own custom animation.
➢ It supports both internal and external hyperlink.
➢ Different bar, graphs, charts can be used to convey, detailed and precise information.
➢ Internet features such as web toolbar, online help, web linking can also be done.
XI Computer Science Bhakta Raj Tamang
Chapter 5: Programming Concepts and logics
Introduction:
As we know every computerized device does not work by itself. They needed to be given some
sort of command that makes computer work. These commands help to instruct computer and
program specific action required by the user. Since the command are given in the form of
computer language, we need programming language are used to write the set of instruction
which commands the computer to perform certain action collectively called programs. These
programs are again integrated in order to make a complete software. Simply software is the
collection of different interrelated program which performs specific function.
Program Written in any type of programming language are not understood by the computer
hence we need some sort of language translator or processor such as assembler, complier and
interpreter which has the basic function of converting program written in any type of language
into machine level language.
The program written by the programmer is known as source program. After converting it
becomes program.
Qualities of good programs.
➢ It should be easily understood.
➢ A program should be correct; it should be error free.
➢ It should be reliable.
➢ It should have easily understandable user interface.
➢ It should be portable and flexible.
➢ Programming Language:
In order to make communication between user and computer, we need a computer language that
helps user to generate commands to perform as per the requirement. This language with which
we can give instruction to the computer is known as programming language. Programming
language are the set of different keywords, variables, operators, loops, and other entities using
different character sets including numbers, special symbol and alphanumeric values.
Hence, the process of writing the programming language is known as programming and the
person who writes program is programmers.
Types of Programming Language
There are several types of programming language which can be categorized as follows:
1. Low level language: Low level language are the machine dependent language which means
program written for one type of system cannot be run in another system. Developer should have
detail analysis and knowledge about the system for which s/he is going to write a program for.
Hence, programming in low level language is very much difficult and time consuming. Different
types of programming language are:
XI Computer Science Bhakta Raj Tamang
a. Machine level language(1GL): This language consists a sequence of 0’s and 1’s to generate
instruction. Since, it uses binary numbers, this type of language is directly understood by
processor. So, it has higher execution speed. It is also a machine dependent language in which
programmers should have detailed knowledge of the system.
Advantage:
➢ It is directly understood by the processor so execution speed is relatively high.
➢ Language translator or processor is not needed.
➢ They can be used to program specific purpose computer.
Disadvantage:
➢ It is difficult and time consuming to develop and debug program.
➢ It is machine dependent language. So, program developed for one system cannot be
operated in another system.
➢ All the syntax and commands are in the form of binary numbers which is difficult to
remember.
➢ Programmers should have detail knowledge about particular system and its architecture.
b. Assembly language(2GL): Assembly language are also an example of low-level language. In
this language, instead of writing instruction in the series of 0’s and 1’s we can use mnemonics
(symbolic instructions) like ADD, SUB, RST, DIV, MOD and so on. Since it is closer to
machine level language, a programmer should have detailed knowledge about computer internal
architecture. This language is faster in comparison to high level language. Since, this language is
not directly understood by the computer, we need language translator like assembler to convert it
into machine level language.
Advantage:
➢ It is easier to write, debug and understand programming written in assembly level
language compared to machine level language.
➢ Program execution is higher compared to high level language,
➢ Since they are machine dependent, they are used to develop different device drivers.
Disadvantage:
➢ It is machine dependent language, i.e. program made for one processor doesn’t run in
another processor.
➢ Use of mnemonics code makes assembly language much more complex.
➢ Program development and debugging is more difficult and time consuming compared to
high level language.
2. High level language: This language is close to English language. High level language code is
written in English like structure using mathematical notation. Since it is similar to English
language, it is easier to develop and debug the program. It is machine independent language (i.e.
XI Computer Science Bhakta Raj Tamang
program developed for one processor can work on another processor). Since HLL (high level
language) are not directly understood by the computers, we need language processor or translator
such as complier and interpreter for converting program written in high level language to
machine level language. FORTAN (Formula Translator) introduced on 1956 A.D is the first high
level language. Nowadays there are many high-level languages like C, C++, python, JavaScript,
etc.
Advantage:
➢ Since it is closer to English language, program written in this language is easier to write,
debug and understand.
➢ Since it is machine independent, program written for one processor can work in another
processor.
➢ Programmer doesn’t have to remember large number of mnemonics and other unusual
codes.
➢ Program development is faster and requires less effort than other language.
Disadvantage:
➢ Computer doesn’t understand high level language directly. So the program needs
conversion before execution.
➢ Program execution is slower compared to low level language.
High level language can further be classified into:
a. Procedural oriented Language(3GL): This type of language is high level language which
primarily focuses on procedure rather than on data. Hence, they are used to express the logic and
the procedure of the program. Since it focuses only on procedure, it is complex and time
consuming to write a large program. This type of language follows top to bottom approach i.e.
main function is written at the bottom of the program. This type of language doesn’t pose
important and powerful feature like data encapsulation, data inheritance, data extraction and so
on. So, this type of language has less security compared to object-oriented language. Because of
their flexibility, procedure language is able to solve verities of problem. Examples: C, FORTAN,
QBasic, etc.
Advantage:
➢ Program development and debugging is easier compared to low level language.
➢ More advance and user-friendly software can be developed.
➢ It is also a machine independent language.
Disadvantage:
➢ Language translator or processor is required to execute the program.
➢ Program execution is slower.
➢ Data security is less in comparison to other high-level language.
XI Computer Science Bhakta Raj Tamang
b. Problem/object Oriented Language(4GL): This is the advance form of high-level language
which primarily focuses on data rather than procedure. It allows the user to specify what the
output should be without describing all the detail (i.e. procedure) of how the data should be
manipulated. This type of language follows bottom up approach. That means all main function
are written at the bottom of the program whereas classes and object are described at top of the
program. Since it has several powerful features such as data encapsulation, data extraction and
inheritance, the data are more secure compared to procedure language. Examples: C#, C++, Java,
etc.
Advantage:
➢ Web based application and software can be developed.
➢ More advance and user-friendly software can be developed.
➢ It is also machine independent language.
Disadvantage:
➢ Language translator is required to execute the program.
➢ Program execution is slower.
c. Natural Language (5GL): Natural language uses simple statement of common
communication language where we could write statements that would look like normal
sentences. It is still in developing stage; computer scientists are working hard for developing
such language. However, programming language like PROLOG (programming logic) is
currently in use. For example: - instead of writing some unusual code, programmers would write:
“who are the salesmen who has sold more than 30,000 products last month?”
Advantage:
➢ It will be even easier to develop and debug the program.
➢ It will also be machine independent language.
➢ More advance and user-friendly program will be made.
Disadvantage:
➢ Language translator is required to execute the program.
➢ Program execution is slower
Language translator/processor:
Language translator is that system development software which helps to convert program
written in assembly or high-level language (source program) into machine level language (object
program). Since it is difficult and incontinent to write a program in machine level language,
language developer uses several assemblies and high level language which are not directly
understood by the computer. Hence, we use different types of language processor to convert and
make machine understandable.
XI Computer Science Bhakta Raj Tamang
There are different types of language translators.
1. Assembler: These language translator/processor converts program written in assembly
level language (source program) into machine understandable language (object language)
Since assembly level language are closer to machine level language, the conversion taken
by assembler is relatively less. It converts program at once into machine level language.
2. Compiler: Those language processors which helps to convert program written in high
level language (source program) into machine level program (object program). It converts
whole program into machine level language at once. It is the largest method of translating
a program in which debugging is complex and time consuming. Programming languages
like C, C++, Java, etc. use complier.
3. Interpreter: This is the type of language which converts program written in high level
language (source program) into machine level language (object program). It converts one
statement at a time so its debugging can be easier and less time consuming. Its program
execution is slower than that of compiler. Most of the new programming language use
interpreter which allocate less memory space. Programs like BASIC, C#, Php, etc. use
interpreter for conversion.
Difference between compiler and interpreter:
S.N. Compiler Interpreter
It translates the whole program into object code at It translates one line or a single statement of a
1
a time. program into object code at a time.
It finds out the error after compiling the complete It finds out the error after translating a line of
2
program. the program at a time.
3 The translating process is incredibly faster. The translating process is slower.
Compiler based program is difficult to code and Interpreter based program is easy to code and
4
debug. debug.
It is usually a large program and requires larger It is usually a smaller program and requires
5
memory space. less memory space.
XI Computer Science Bhakta Raj Tamang
6 New programming language don’t use complier. New programming language use interpreter.
7 For e.g.: C, C++, java, FORTAN etc. For e.g.: BASIC. C#, PHP etc.
Syntax and Semantics:
As we know programming language helps the user to communicate with the computer. User is
governing by several set of codes which instruct computer to perform some specific task. This
set of codes and its structure is known as syntax. In addition, semantics is the meaning attached
to individual word or symbol in programming language. For example:
In q basic:
Print “ This is programming”; P
Here, Print is Semantics and whole line is Structure (syntax)
Error (BUG):
There may be several errors inside a program which stops program from being executed. Thus,
an error in a program is known as a bug. This type of error in a program may arise by not
following proper rules given by the programming language due to poor problem analysis or
maybe due to hardware failure. Error in the program may five ambiguous (not accepted/false)
result. The process of removing error from a computer program is known as debugging.
There are three types of error:
1. Syntax error: the error which may arise due to not following proper rules or format
given by the programming language. Every programming language have their own
vocabulary, punctuation and structure. Programmers need to follow every detail while
programming. This type of error can be detected by language processor such as compilers
and interpreter. For e.g. In C, every statement should end with semi-colon at the end of
the statement then the errors encounter is syntax error.
2. Logical error: Logic refers to idea or concept used to solve a specific problem. If the
problem is poorly understood than it may hamper while solving the problem. The error
that is encountered due to poorly developed logic is called logical error. This type of error
is not detected by language processor. For example: In order to calculate simple interest,
we use the formula I =(P*T*R)/100, if we write above mentioned formula, as I=P*T*R,
then the error encounter is logical error.
3. Runtime error: When a program is running or executing, it is said to be runtime. Hence,
the error that are encounters/found while program is being executed is known as runtime
XI Computer Science Bhakta Raj Tamang
error. It is also not detected by language translator. For example: if insufficient memory
space, peripheral device not turning on.
Some common terminology in programming:
Data types: It specifies the type of data to be used in a program. Some common types of data
types are:
Numeric: It is the combination of all the positive and negative whole number including zero.
Character: it is the possible combination of all the alphanumeric values including especial
symbol.
Variable and Constant:
Variable: Those entities which holds either numeric or alphanumeric values and changes its
value throughout the time of program execution.
Constant: Those entities which holds either numeric or alphanumeric values but does not
change its value throughout the time of program execution.
Operands and Operators and Operations:
Let us consider as;
S=A+B
Where S, A, B are operands
+, = are operands
S=A+B denotes sum of two operands A, B which is Operation
Types of operators:
It is a special symbol which helps to make operation successful i.e. it helps to make some
specific operation.
Commonly used operators are:
1. Arithmetic operators: +, -, /, *
2. Relative operators: <, >, >=, <=, =
3. Logical operators: AND, OR, NOT
Program Design Tool
There are several program designs tools that are available. Some of the commonly used program
design tools are algorithm, flowchart, pseudocode.
Algorithm:
XI Computer Science Bhakta Raj Tamang
The step-by-step procedure or sequential steps for solving a specific problem is known as
algorithm. Algorithm are written in simple English language and are not even close to any
programming language.
Rules for writing algorithm:
➢ Algorithm should execute output after a finite step.
➢ Algorithm should not depend upon any programming language.
➢ Algorithm should terminate after finite steps.
Examples:
Write an algorithm to calculate simple interest.
Step 1: Start
Step 2: Read the value of P.T.R
Step 3: Calculate simple interest by using i=(P*T*R)/100
Step 4: Display simple interest(i)
Step 5: Stop
2. Write an algorithm to check greatest number among two number.
Step 1: Start
Step 2: Read any two-number a, b
Step 3: check if (a>b)
If yes, Display the greatest number is “a” and go to step 4
If no, Display the greatest number is “b” and go to step 4
Step 4: Stop
Flowchart:
It is a diagrammatic or pictorial representation of steps involve in algorithm for solving a
particular problem is known as flowchart. It uses several geometrical shapes, symbol for
representing different action involve in problem solving. There are two types of flowchart:
a. Program Flowchart: It is a type of flowchart which focuses on a specific problem. This type
of flowchart portage only a single task (logic) at a time.
Symbols used in flowchart:
XI Computer Science Bhakta Raj Tamang
SYMBOLS USED IN FLOWCHART
Examples:
Draw flowchart to calculate simple interest.
XI Computer Science Bhakta Raj Tamang
Draw flowchart to find greatest number among two numbers.
b. System Flowchart: It is also a type of flowchart that shows the logical flow of a program and
its collection. It shows the overview of the data flow and sequence of operation in a system.
Symbols used in system flowchart:
XI Computer Science Bhakta Raj Tamang
Symbol used in System flowchart
Example of System Flowchart
XI Computer Science Bhakta Raj Tamang
What is c programming language?
It is a High Level Programming Language, developed by Dennis Ritchie at AT & T’s Bell
Laboratories of USA, in 1970. It is a very powerful programming language. It is used for both
system programming and application programming. So, often known as Middle Level
Programming Language, also. It means, it supports or works as the low level language and high
level language, both.
What are the features of c language?
The features of c language are:
➢ It supports high level and level programming both, so known as mid level programming
language.
➢ It is mostly used for System programming but very popular for Application
programming, too.
➢ The program development is faster and more efficient.
➢ It has very powerful tools and keywords.
➢ It uses its own text editor.
➢ It has its own compiler.
➢ It supports structured programming.
➢ It is portable easily.
➢ It has very powerful library functions set.
➢ Flexible in programming.
What are the advantages and disadvantages of c language?
The advantages are:
➢ Suitable for system programming.
➢ It is easier to interact with hardware.
➢ Easy to learn.
➢ Program code is secure.
➢ It is compact and efficient.
The disadvantages are:
➢ It does not contain runtime checking.
➢ There is no strict data type checking.
➢ As the program extends, the debugging becomes more complex because it uses compiler
instead of interpreter for the compilation.
➢ Semi-colon requires for each statement.
Define the following terms:
a) Editor: This is the area, in which we type the program. C language has its own text editor but
we can use any other text editor program also.
XI Computer Science Bhakta Raj Tamang
b) Pre-processor: This is the collection of complex codes to instruct the machine to understand
the certain keywords. It is written with preceding # symbol. For example: #include, in this
example, include pre-processor with the hash symbol, uses the instruction or complex codes
from the file ‘stdio.h’, which is already stored by c language. These .h files are called header
files. So, include pre-processor is used for using the header files.
c) Compiler: It is a type of software to change the source code of high level programming
language into machine readable form called object code.
d) Linker: It is also a type of software, which links the various library files with the object codes
and creates an executable file with .exe extension. Then, exe file can run independently.
FUNDAMENTAL OF C
Define the character set. Also define the character set used in c language.
The set of alphabets, digits, white characters and other symbols used in any programming
language is called a character set. The character set used in c are:
Alphabet – A, B, C, ……..Z and a, b, c, ….z
Digits – 0, 1, 2, …………9
Special Symbols - ~ ‘ ! @ % ^ & * ( ) - _ + = | \ { } [] : ; “ ‘ <> , . ? /
Comment: Comment is a text or set of other characters, which is not compiled or executed from
the compiler. It is written in the program to give required information to other programmers and
the developers themselves. There are two types of comment writing methods:
a. Single line comment: It is written with the // symbol.
Eg. // This is my first program.
b. Multi-line comment: It is written with /*………….*/ symbols.
Eg. /* This is
multi line
comment style */
C Tokens.
The set of identifiers, keywords, constants, variables and operators is known as C Tokens. It
remains as a single unit and compiler does not break in the time of compilation.
Define the following terms:
a) Identifiers: Identifiers are names for entities in a C program, such as variables, arrays,
functions, structures, unions and labels.
XI Computer Science Bhakta Raj Tamang
b) Keyword: Keyword is a reserved word that is already stored by the c language developer. The
reserved word cannot be used as the identifiers. There 32 Keywords in C according to the ANSI
(American National Standard Institute) in c language. They are: void, printf, scanf, if, else,
while, getch, do, for, break, continue etc
c) Data types in c: The term Data Types in any language refers to the types of data which can be
used in the program execution for entering and manipulating as the values. In the same way, the
data types in c also refer to the data types, which can be used as the values. Basically it is of four
types. They are:
1. int : It represents the integer type data. It means the numbers without the decimal points.
It consumes 2 bytes memory. The derived data types from int are short int and long int.
2. float : It means the real numbers with the decimal points. It consumes 4 Bytes memory
space. It can also be signed and unsigned. Derived data types of it are double and long
double.
3. char : It is used for a single character (alphabet or symbol) like ‘A’, ‘f’, ‘@’ etc. It
requires 1 byte memory. It can also be signed or unsigned.
4. void : void means no value. It means null value. It is used for returning null value to the
modules.
d) Constants: Those entities which holds either numeric or alphanumeric values but does not
change its value throughout the time of program execution.
e) Variables : Those entities which holds either numeric or alphanumeric values and changes its
value throughout the time of program execution.
Variable declaration:
Syntax: data type variable_name;
Eg: int a;
f) Statements : The set of keywords, identifiers, operators, variables and constants ended with the
semicolon or a curly bracket is called statement. It is of two types:
1. Simple Statement : The statement written in a single line and ended with the semicolon is
simple statement. Eg. printf (“My program”);
2. Compound Statement: The group of simple statements grouped by the curly bracket
open and close is the compound statement. Eg.
if (n>0)
{
a=b+c;
x=x*x;
printf(“%d %d”, a,x);
}
XI Computer Science Bhakta Raj Tamang
g) Escape Sequences: The symbol \ or ‘ is supposed as the Escape character. It means, the
compiler of c programming language understands this character and the text after this to take as a
special case. And the set of this symbol and the character behind it is known as the Escape
Sequence. Some common escape sequences are:
Character Escape
New Line \n
Horizontal tab \t
Null character \0
Quotation mark \”
Apostrophe \’
Backslash (\) \\
h) Operators: (imp)The symbols, which are used to operate on the operands for the mathematical
and logical calculations are known as operators. C programming language has a rich set of built-
in operators. Operator that requires two operands are binary (dyadic) operators, operators that
require one operand is unary (monadic) and the operator that requires three operands is ternary
operator.
E: a + b, here + is an operator. And a and b are operands.
Types of operators:
➢ Arithmetic Operator
➢ Relational Operator
➢ Equality Operator
➢ Logical Operator
➢ Assignment Operator
➢ Increment/Decrement Operator
➢ Conditional Operator (Ternary Operator)
➢ Bitwise Operator
➢ Special Operator
i) Functions: Functions are the independent sections or the block of statements given a specific
name and they can be used by any program according to the requirements. They are developed to
perform a certain task. They are of two types:
XI Computer Science Bhakta Raj Tamang
a) Library Functions: These are the ready-made formula-like functions stored in c language
library. They can be used in any program. abs(), printf (), scanf (), clrscr(), getch(), strlen(),
sqrt(), etc. are some examples of Library functions.
b) User defined function: The functions developed by the users in their own program are called
User-defined functions.
INPUT/OUTPUT (I/O) functions
1. printf() : It is a formatted output function.
Eg. printf(“My School”);
2. scanf() : It is to enter any value to the program.
Eg. scanf(“%d”, &x);
Program Example
a) Write a c program to enter any two numbers and print the sum of them.
# include <stdio.h>
void main()
{
int a, b, s;
clrscr();
printf(“Enter First Number”);
scanf(“%d”, &a);
printf(“Enter Second Number”);
scanf(“%d”, &b);
s = a + b;
printf (“The sum is %d”, s);
getch();
}
b) Write a c program to calculate the area of a rectangle, where the length is 20 and breadth is 15.
# include <stdio.h>
void main( )
{
XI Computer Science Bhakta Raj Tamang
int l = 20, b = 15;
int a;
clrscr();
a = l * b;
printf (“The area is %d”, a);
getch();
}
c) WAP to calculate the area of a rectangle in c. [Hints: a = l x b]
# include <stdio.h>
void main()
{
int l, b, a;
printf (“Enter Length: ”);
scanf (“%d”, &l);
printf (“Enter Breadth: “);
scanf (“%d”, &b);
a = l * b;
printf (“The area is %d”, a);
getch();
}
d) Write a program to enter length and breadth of a rectangle and calculate the perimeter. [p = 2
(l + b) ]
# include <stdio.h>
void main ()
{
int l, b, p;
printf (“Enter Length :”);
scanf (“%d”, &l);
printf (“Enter Breadth :”);
XI Computer Science Bhakta Raj Tamang
scanf (“%d”, &b);
p = 2 * (l + b);
printf (“The perimeter is : %d”, p);
getch();
}
e) WAP to calculate the area of a triangle .
# include <stdio.h>
void main()
{
int b, h, a;
printf (“Enter base and height”);
scanf (“%d %d”, &b, &h);
a = ½ * b * h;
printf (“The area is %d”, a);
getch();
}
f) WAP to enter the length of any one side of a square and calculate the area and perimeter in c
language.
# include <stdio.h>
void main ()
{
int l, a, p;
clrscr ();
printf (“Enter length”);
scanf (“%d”, &l);
a = l * l;
p = 4 * l;
printf (“The area is %d and the Perimeter is %d”, a, p);
XI Computer Science Bhakta Raj Tamang
getch();
}
g) WAP to calculate the volume of a box.[v=l*b*h] (Do yourself)
h) WAP to enter the radius of a circle and print the circumference of it. [c = 2 pi r] (Do yourself)
CONTROL STRUCTURE IN C (important)
Normally, the program execution flows top to the bottom lines of the programs. It means
program executes one line after another. But sometime we need to execute other part of the
programs or we need to divert the program flow from its normal execution. In such a case, we
need some program statements, which are known as Control Structures. They are of three Types
of control structure:
a. sequence
b. selection
c. looping
A) Sequence: Program generally flows from top left top right bottom.
WAP to enter the length, breadth and height of a box and calculate the total surface area (TSA).
[TSA = 2 * (L*B + B*H + L*H)]
# include <stdio.h>
void main ()
{
int l, b, h, tsa;
clrscr();
printf (“Enter length, breadth and height”);
scanf (“%d %d %d”, &l, &b, &h);
tsa = 2 * (L*B + B*H + L*H);
printf (“Total surface area is %d”, tsa);
getch ();
}
WAP to enter the radius of a circle and calculate the area . [a = pi r 2]
# include <stdio.h>
XI Computer Science Bhakta Raj Tamang
void main ()
{
float r, a;
printf (“Enter radius”);
scanf (“%f”, &r);
a = 22/7 * r * r;
printf (“The area is %f”, a);
getch();
}
j) WAP to enter the radius of a circle and print the circumference of it. [c = 2 pi r]
B) Selection/branching/condition: These type of control structure changes the flow of program
execution with or without conditoon.
B.1) Conditional Statements: They break the program flow if the condition is matching. Eg. if,
if….else and if…..else….if
if condition
This condition is used for a single condition and single block of statements.
Syntax:
if (condition)
{
Block of statements'
}
Example:
1. WAP to enter the marks of English and print “Pass” if it is 40 or more.
# include <stdio.h>
void main ( )
{
float e;
printf (“Enter English Marks \n”);
scanf (“%f”, &e);
XI Computer Science Bhakta Raj Tamang
if (e >= 40)
{
Printf (“Pass”);
}
getch ( );
}
Note: The above program states only about pass. If the marks is less than 40, it displays blank.
2. WAP to enter the age of a person and print “He can vote”, if the age is 18 or above.
# include <stdio.h>
void main ( )
{
float a;
printf (“Enter age \n”);
scanf (“%f”, &a);
if (a >= 18)
{
Printf (“You can vote”);
}
getch ( );
}
If….else condition
This condition is used for a double conditions and double blocks of statements.
Syntax:
if (condition)
{
Block of statements'
XI Computer Science Bhakta Raj Tamang
}
else
{
Block of statements'
}
Example:
1. WAP to enter the marks of English and print “Pass” if it is 40 or more, otherwise “Fail”.
# include <stdio.h>
void main ( )
{
float e;
printf (“Enter English Marks \n”);
scanf (“%f”, &e);
if (e >= 40)
{
printf (“Pass”);
}
else
{
printf (“Pass”);
}
getch ( );
}
Example 2: WAP to enter the age of a person and print “He can vote” if the age is 18 or above,
otherwise print “He cannot vote”.
# include <stdio.h>
void main ( )
{
float e;
XI Computer Science Bhakta Raj Tamang
printf (“Enter age\n”);
scanf (“%f”, &a);
if (a >= 18)
{
printf (“You can vote”);
}
else
{
printf (“You cant vote”);
}
getch ( );
}
Example 3: WAP to check whether given number if odd or even
# include <stdio.h>
void main ( )
{
int n;
printf (“Enter number\n”);
scanf (“%d”, &n);
if (n%2 == 0)
{
printf (“%d is even”,n);
}
else
{
printf (“%d is odd”,n);
}
getch ( );
XI Computer Science Bhakta Raj Tamang
}
Example 3: WAP to find greatest among two number.
# include <stdio.h>
void main ( )
{
int a,b;
printf (“Enter two number\n”);
scanf (“%d %d”, &a,&b);
if (a>b)
{
printf (“%d is greatest”,a);
}
else
{
printf (“%d is greatest”,b);
}
getch ( );
}
If…else if…else statement (else if): This statement is used for the multiple conditions and
multiple blocks of statements.
Syntax:
if (condition 1)
{
Statement Block 1;
}
else if (condition 2)
{
Statement Block 2;
XI Computer Science Bhakta Raj Tamang
}
..
..
else
{
default staement
}
Example 1: WAP to enter a number and print “Positive” if it is greater than 0, print “Negative” if
it is less than 0, otherwise print “Zero”.
# include <stdio.h>
void main ( )
{
int n;
printf("Enter number");
scanf("%d",&n);
if (n > 0 )
{
printf (“Positive”);
}
else if (n < 0 )
{
printf (“Negative”);
}
else
{
printf (“Zero”);
}
getch ( );
XI Computer Science Bhakta Raj Tamang
}
Example 2: WAP to enter the percentage and print the division.
# include <stdio.h>
void main ()
{
float p;
clrscr ( );
printf (“Enter percentage:”);
scanf (“%f”, &p);
if (p > = 80 && p<=100)
printf (“Distinction”);
else if (p>=60 && p<80)
printf (“First”);
else if (p>=50 && p<60)
printf (“Second”);
else if ( p>=40 && p<50)
printf (“Third”);
else
printf("fail");
getch ();
}
Example 3: WAP to enter 3 number and print greatest number.
# include <stdio.h>
void main ( )
{
int a,b,c;
printf("Enter number");
scanf("%d %d %d",&a,&b,&c);
XI Computer Science Bhakta Raj Tamang
if (a>b && a>c)
{
printf (“%d is greatest”,a);
}
else if (b>a && b>c)
{
printf (“%d is greatest”,b);
}
else
{
printf (“%d is greatest”,c);
}
getch ( );
}
B.2) Unconditional Statements: They break the program flow without any condition. Eg. goto
statement
Syntax
label:
goto label;
OR
goto label;
label:
Program example of goto [This program allows user to only enter value under 100]
# include <stdio.h>
void main ()
{
float p;
clrscr ( );
label:
XI Computer Science Bhakta Raj Tamang
printf (“Enter percentage:”);
scanf (“%f”, &p);
if (p > 100)
{
printf (“Invalid input”);
goto label;
}
getch();
}
C) Looping: Loop is the process of repeating any block of statements up to the given number of
times or until the given condition is not over.
There are three types of Loop:
1. for loop
2. while loop
3. do while loop
1) FOR… loop: It has three expression where first expression is used for initialization value for
variable, and second expression represents the condition which decide the destination and last
expression represents increment or decrement the variable.
Syntax of for loop
for (initialization; condition; increment/decrement)
{
Statements (s);
}
Examples:
a) 1, 2, 3, 4, ………….100.
#include <stdio.h>
int main()
{
XI Computer Science Bhakta Raj Tamang
int i;
for (i=1;i<=100;i++)
{
printf("%d\n",i);
}
return 0;
}
b) 1, 3, 5, 7, ……………..99.
c) 2, 4, 6, 8, ………………100.
d) 5, 10, 15, ………………….50.
#include <stdio.h>
int main()
{
int i,s;
for (i=1;i<=10;i++)
{
s=5*i;
printf("%d\n",s);
}
return 0;
}
WAP to calculate sum of n-natural number.
#include <stdio.h>
int main()
{
int n,i,s=0;
printf("Enter any number\t");
XI Computer Science Bhakta Raj Tamang
scanf("%ld",&n);
for (i=1;i<=n;i++)
{
s=s+i;
}
printf("Sum is %d\n",s);
return 0;
}
WAP to calculate product of n-natural number. (Factorial of a given number.
#include <stdio.h>
int main()
{
int n,i,p=1;
printf("Enter any number\t");
scanf("%d",&n);
for (i=1;i<=n;i++)
{
p=p*i;
}
printf(“Product is %d\n”,p);
return 0;
}
WAP to generate fibonacci series. [ 0,1,1,2,3,5,8 …..10th term]
#include <stdio.h>
int main()
{
int i,a=0,b=1,c;
printf(“%d%d””,a,b);
XI Computer Science Bhakta Raj Tamang
for (i=1;i<=10;i++)
{
c=a+b;
printf(“%d”,c);
a=b;
b=c;
}
return 0;
}
WAP to generate 1 2 4 7 11 ...............10th term
#include <stdio.h>
int main()
{
int i,a=1,g=1;
for (i=1;i<=10;i++)
{
printf(“%d”,a);
a=a+g;
g=g+1;
}
return 0;
}
WAP to generate 1 2 5 10 17 ...............10th term
#include <stdio.h>
int main()
{
int i,a=1,g=1;
for (i=1;i<=10;i++)
XI Computer Science Bhakta Raj Tamang
{
printf(“%d”,a);
a=a+g;
g=g+2;
}
return 0;
}
WAP to generate 3 12 27 48 ................10th term
#include <stdio.h>
int main()
{
int a,i;
for (i=1;i<=10;i++)
{
a=3*I*I;
printf(“%d”,a);
}
return 0;
2) WHILE Loop (Entry Control loop): It is also called entry-controlled loop because it checks
the condition before executing and used keyword ‘while’. It doesn’t terminate with semicolon
( ; ).
Syntax:
while(condtion)
{
Block of statements;
}
WAP to calculate sum of n-natural number.
XI Computer Science Bhakta Raj Tamang
#include <stdio.h>
int main()
{
int n,s=0,i=1;
printf("Enter any number\t");
scanf("%d",&n);
while (i<=n)
{
s = s+i;
i=i+1;
}
printf("Sum of digits is %ld\n",s);
return 0;
}
WAP to calculate product of digits of a given number.
#include <stdio.h>
int main()
{
int n,p=1,i=1;
printf("Enter any number\t");
scanf("%d",&n);
while (i<=n)
{
p = p*i;
i=i+1;
}
printf(“Product of digits is %d\n”,p);
return 0;
XI Computer Science Bhakta Raj Tamang
}
WAP to generate 1 2 4 7 11 ...............10th term
#include <stdio.h>
int main()
{
int i=1,a=1,g=1;
while (i<=10)
{
printf(“%d”,a);
a=a+g;
g=g+1;
i=i+1;
}
return 0;
}
WAP to calculate sum of digits of a given number.
#include <stdio.h>
int main()
{
int n,s=0,r;
printf("Enter any number\t");
scanf("%d",&n);
while (n!=0)
{
r = n%10;
s = s+r;
n = n/10;
}
XI Computer Science Bhakta Raj Tamang
printf("Sum of digits is %d\n",s);
return 0;
}
WAP to calculate product of digits of a given number.
#include <stdio.h>
int main()
{
int n,p=1,r;
printf("Enter any number\t");
scanf("%d",&n);
while (n!=0)
{
r = n%10;
p = p*r;
n = n/10;
}
printf(“Product of digits is %d\n”,p);
return 0;
}
WAP to reverse a given number.
#include <stdio.h>
int main()
{
int n,p=0,r;
printf("Enter any number\t");
scanf("%d",&n);
while (n!=0)
{
XI Computer Science Bhakta Raj Tamang
r = n%10;
p = p*10+r;
n = n/10;
}
printf(“Reverse is %d\n”,p);
return 0;
}
WAP to check whether given number is palindrome or not.
#include <stdio.h>
int main()
{
int n,p=0,r,z;
printf("Enter any number\t");
scanf("%d",&n);
z=n;
while (n!=0)
{
r = n%10;
p = p*10+r;
n = n/10;
}
if (z==p)
{
printf(“%d is palindrome \n”,z);
}
else
{
printf(“%d is not palindrome \n”,z);
XI Computer Science Bhakta Raj Tamang
}
return 0;
}
WAP to check whether given number is armstrong or not. [153 is Armstrong]
#include <stdio.h>
int main()
{
int n,s=0,r,z;
printf("Enter any number\t");
scanf("%d",&n);
z=n;
while (n!=0)
{
r = n%10;
s = s+pow(r,3);
n = n/10;
}
if (z==s)
{
printf(“%d is armstrong \n”,z);
}
else
{
printf(“%d is not armstrong \n”,z);
}
return 0;
}
XI Computer Science Bhakta Raj Tamang
3) DO whileLoop : It is another types of loop which is also known as exit controlled loop
because it checks the condition after executing the program at once. It terminates with semicolon
( ; ).
Syntax:
do
{
Block of statements;
}while(condition);
WAP to calculate sum of n-natural number.
#include <stdio.h>
int main()
{
int n,s=0,i=1;
printf("Enter any number\t");
scanf("%d",&n);
do
{
s = s+i;
i=i+1;
}while (i<=n);
printf("Sum of digits is %ld\n",s);
return 0;
}
Array
An array is a collection of variables of same type that are represented by a common name i.e.
array is the collection of homogenous data type (Contains similar datas). If we declare array as
int then it must only contain all integer data and same for floats and char. Each array element is
specified by array name followed by index or subscript enclosed in square bracket (eg, a[10]).
Hence, it is also called indexed or subscripted variables. In an array index of array represent the
size of an array.
Let us consider, int age[5]
XI Computer Science Bhakta Raj Tamang
This mean array name is age which is capable of storing 5 different data under integer datatype.
age[0] = 15
age[1] = 25
age[2] = 13
age[3] = 22
age[4] = 17
Types of array
Depending upon the number of subscript or index number array are of 2 types:
1. 1-Dimension
2. N-Dimension (Multi-dimension)
1) 1-Dimension:
This type of array has only one subscript.
Declaration / syntax:
Data_type array_name[size]
Example:
int salary[100]
2Program example.
Q1. WAP to input 10 different number and print them all.
#include <stdio.h>
int main()
{
int a[10], i;
printf ("Enter any 10 number");
for(i=0;i<10;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<10;i++)
{
XI Computer Science Bhakta Raj Tamang
printf(“%d”,&a[i]);
}
return 0;
}
Q2. WAP to input salary of 1000 employees and calculate average salary.
#include <stdio.h>
int main()
{
int sal[1000], i, s=0;
float av;
printf ("Enter any 10 number");
for(i=0;i<1000;i++)
{
scanf(“%d”,&sal[i]);
}
for(i=0;i<1000;i++)
{
s=s+sal[i];
}
av = s/1000;
printf(“Average salary of 1000 employee is %f”, av);
return 0;
}
Q3. WAP to input salary of 1000 employees and count total number of employee getting salary
between 30000 and 50000.
#include <stdio.h>
int main()
{
int sal[1000], i, c=0;
XI Computer Science Bhakta Raj Tamang
for(i=0;i<1000;i++)
{
scanf(“%d”,&sal[i]);
}
for(i=0;i<1000;i++)
{
if(sal[i]>=30000 && sal[i]>=50000)
{
c=c+1;
}
}
printf(“Total number of employee is %d”, c);
return 0;
}
Q5. WAP to input 10 different number and find the greatest among them.
#include <stdio.h>
int main()
{
int a[10], i, g;
printf ("Enter any 10 number");
for(i=0;i<10;i++)
{
scanf("%d",&a[i]);
}
g = a[0];
for (i=0;i<10;i++)
{
if (g>a[i])
XI Computer Science Bhakta Raj Tamang
{
g=a[i];
}
}
printf("Greatest number is %d\n",g);
return 0;
}
Q6. WAP to input 10 different number and sort them in ascending order.
#include <stdio.h>
int main()
{
int a[10], i, j, temp;
printf ("Enter any 10 number");
for(i=0;i<10;i++)
{
scanf("%d",&a[i]);
}
for (i=0;i<10;i++)
{
for (j=i+1;j<10;j++)
{
If (a[j]>a[j+1])
{
temp = a[j];
a[j] = a[j+1];
a[j+1] = temp;
}
}
XI Computer Science Bhakta Raj Tamang
}
printf(“Ascending order is”);
for (i=0;i<10;i++)
{
Printf(“%d \t”,a[i]);
}
return 0;
}
Q3. WAP to input salary of n-employees and count total number of employee getting salary
between 30000 and 50000.
#include <stdio.h>
int main()
{
int sal[1000], i, c=0, n;
printf("Enter the number of employees");
scanf("%d",&n);
printf(“Enter the salary of N employees:”);
for(i=0; i<n; i++)
{
Scanf(“%d”, &sal[i]);
}
for(i=0; i<n; i++)
{
If (sal[i] > 30000 && sal[i] < 50000)
{
c= c+1;
}
}
XI Computer Science Bhakta Raj Tamang
printf(“Total number of employee is %d”, c);
return 0;
}
2) N-Dimension (Multidimension array):
This type of array has more than one subscript.
Declaration / syntax:
Data_type array_name[size][size]
Example:
int n[3][3]
Program example
Q1. WAP to input 3x3 matrix data and display the data of it.
#include <stdio.h>
int main()
{ int a[3][3],i,j;
printf("Enter 9 number");
for (i=0;i<3;i++)
{
for (j=0;j<3;j++)
{
scanf("%d",&a[i][j]);
}
}
for (i=0;i<3;i++)
{
for (j=0;j<3;j++)
{
printf("%d\t",a[i][j]);
XI Computer Science Bhakta Raj Tamang
}
printf("\n");
}
return 0;
}
Q2. WAP to input 3x3 matrix and perform matrix addition
#include <stdio.h>
int main()
{
int a[3][3], b[3][3], c[3][3],i ,j;
printf("Enter 9 number");
for (i=0;i<3;i++)
{
for (j=0;j<3;j++)
{
scanf(“%d%d”,&a[i][j],&b[i][j]);
}
}
for (i=0;i<3;i++)
{
for (j=0;j<3;j++)
{
c[i][j] = a[i][j] + b[i][j];
}
printf("\n");
}
printf(“Added matrix is”);
for (i=0;i<3;i++)
XI Computer Science Bhakta Raj Tamang
{
for (j=0;j<3;j++)
{
printf(“%d \t”,c[i][j]);
}
printf(“\n”);
}
return 0;
}
Q2. WAP to input 3x3 matrix and perform matrix multiplication
#include <stdio.h>
int main()
{ int a[3][3], b[3][3], p[3][3],i ,j, k;
printf("Enter 9 number");
for (i=0;i<3;i++)
{
for (j=0;j<3;j++)
{
scanf(“%d%d”,&a[i][j],b[I][j]);
}
}
for (i=0;i<3;i++)
{
for (j=0;j<3;j++)
{
p[i][j] = 0;
for(k=0;k<3;k++)
{
XI Computer Science Bhakta Raj Tamang
p[i][j] = p[i][j] + a[i][k]*b[k][j];
}
}
}
printf(“Multiplied matrix is”);
for (i=0;i<3;i++)
{
for (j=0;j<3;j++)
{
printf(“%d \t”,p[i][j]);
}
printf(“\n”);
}
return 0;
}
String: String is a group of characters that can be represented only by character array. To
represent a character/string we use ‘char’ datatype.
i.e. char a, char a=‘x’
Where, char is data type and a is string variable and ‘x’ is a character.
Similarly, we can initialize string as one-dimension character array as:
Char a[5] = “hello” which is stored in array as follow
a[0] a[1] a[2] a[3] a[4] a[5]
‘h’ ‘e’ ‘l’ ‘l’ ‘o’ \0
we can initialize array of string as two-dimension array as:
Char a[2][5] = {“ball” , “cat” , “apple”}, which is stored in array as follow
a[2][5] a[0] a[1] a[2] a[3] a[4] a[5]
XI Computer Science Bhakta Raj Tamang
a[0] ‘b’ ‘a’ ‘l’ ‘l’ \0
a[1] ‘c’ ‘a’ ’t’ \0
a[2] ‘a’ ‘p’ ‘p’ ‘l’ ‘e’ \0
String handling function [Library function / Inbuilt function] V.imp
As we know, functions are the self-contained program that performs certain task. Similarly the
function which are given by C-library itself or inbuilt in C-library are known as library or inbuilt-
function. String handling function or string function are the library functions which are used to
manipulate strings in our program for simplicity and convenience. This inbuilt functions are
defined under the header file ’string.h’ . In C we have several string handling functions which are
as follows:
[Note: don’t miss ’string.h’ header file]
1) strlen( )
Function: This function returns total number of characters in a given string.
Syntax: strlen(string);
Program example:
#include <stdio.h>
#include <string.h>
int main()
{
char a[10];
int l;
printf("Enter any string");
scanf("%s",a);
l=strlen(a);
printf("The length is %d",l);
return 0;
}
2) strrev( )
XI Computer Science Bhakta Raj Tamang
Function: This function returns reverse of given string i.e. if we enter ‘ball’ it will return ‘llab’
Syntax: strrev(string);
Program example:
#include <stdio.h>
#include <string.h>
int main()
{
char a[10];
printf("Enter any string");
scanf("%s",a);
strrev(a);
printf("The reverse is %s”,a);
return 0;
}
3) strlwr( )
Function: This function returns given string in lower case i.e. small letters.
Syntax: strlwr(string);
Program example:
#include <stdio.h>
#include <string.h>
int main()
{
char a[10];
printf("Enter any string");
scanf("%s",a);
strlwr(a);
printf("The lower case is %s”,a);
return 0;
XI Computer Science Bhakta Raj Tamang
}
4) strupr( )
Function: This function returns given string in upper case i.e. capital letters.
Syntax: strupr(string);
Program example:
#include <stdio.h>
#include <string.h>
int main()
{
char a[10];
printf("Enter any string");
scanf("%s",a);
strupr(a);
printf("The upper case is %s”,a);
return 0;
}
5) strcpy( )
Function: This function copies one string to another i.e. source_string to destination_string
Syntax: strcpy(destination_string,source_string);
Program example:
#include <stdio.h>
#include <string.h>
int main()
{
char a[10],b[10];
printf("Enter any string");
scanf("%s",a);
strcpy(b,a);
XI Computer Science Bhakta Raj Tamang
printf("The copied string is %s”,b);
return 0;
}
6) strcat( )
Function: This function adds two strings into one.The process of adding strings is known as
string concatenation.
Syntax: strcat(string1,string2);
Program example:
#include <stdio.h>
#include <string.h>
int main()
{
char a[10],b[10];
printf("Enter first string");
scanf("%s",a);
printf("Enter second string");
scanf(“%s”,b);
strcat(a,b);
printf("The added string is %s”,a);
return 0;
}
7) strcmp( )
Function: This function compare two strings and return 0 if both string are equal else return -1/1
if not equal.
Syntax: strcmp(string1,string2);
Program example:
#include <stdio.h>
#include <string.h>
int main()
XI Computer Science Bhakta Raj Tamang
{
char a[10],b[10];
Int x;
printf("Enter first string");
scanf("%s",a);
printf("Enter second string");
scanf(“%s”,b);
x = strcmp(a,b);
printf("The compared value is %d”,x);
return 0;
}
Some important program using string functions
1. WAP to check whether the given string is palindrome or not [MADAM is palindrome]
#include <stdio.h>
#include <string.h>
int main()
{
char a[10],b[10];
printf("Enter string");
scanf("%s",a);
strcpy(b,a)
strrev(a);
if(strcmp(a,b)==0)
{
printf("%s is palindrome”,b);
}
else
{
printf("%s is not palindrome”,b);
}
return 0;
}
XI Computer Science Bhakta Raj Tamang
Chapter 6: Web technology - I
Introduction to the Internet
Internet is the global network of networks. Or it is huge collection of computers all over the
world that is inter-connected to one another in various ways to form a web-net.
Components required for Internet Connections: The basic requirements Internet are:
a) A TCP/IP (Transmission Control Protocol/Internet Protocol) enabled computer with web
browser.
b) An account with an ISP (Internet Service Provider)
c) A telephone line
d) A MODEM to connect to the telephone line and computer
e) A set of computer: The capacity of computer should be as follow:
➢ Minimum 386 microprocessor chip with 16 MB RAM
➢ Color monitor with 256 color support and 640x480m resolution
➢ A hard disk of 200 MB free space
➢ Multimedia sound card and speaker
Some common terminologies of web designing.
a. Webpage: It is generally a HTML document or written in any other scripting language that
help to execute information in the form of text, image, or any other component through internet
is called webpage.
b. Website: The collection of interrelated webpages is known as website. It may contain any
piece of information or may have information that are interrelated with several webpages that are
connected through hyperlink. All website has two part
➢ Domain name: The name use to access website.
➢ Web server: It is a storage location where every piece of information associated with
website are stored.
c. Home page: The introductory page which is executed at first when we access the website.
d. Web browser: It is an application program which help to access any content of webpages that
may be in any form using HTTP (Hyper Text Transfer Protocol). This protocol helps to make
communication between web browser and web server. For eg, Google chrome, Internet explorer
(Microsoft Edge), Safari, Mozilla firefox, Netscape navigator etc.
e. URL: It stands for Uniform Research Locator. It is a standard way of referencing a protocol,
host and a directory. For eg: https://hamronepal.com)
XI Computer Science Bhakta Raj Tamang
f) HTTP (Hypertext Transfer Protocol): This is one of the protocols that web browsers and web
servers use to communicate with each other. When a web browser requests an HTML (Hypertext
Markup Language) document from a web server, the connection is open, the document is
transferred and the connection is closed with HTTP protocol.
Introduction to HTML
HTML stands for Hyper Text Markup Language which are used to create web pages that are
used in internet to exchange data and information. HTML file itself is a text file which contains
several tags and attributes. HTML was develop by Tim Berner Lee that was based on SGML
(Standard Generalized Markup Language). The tags and attributes used to create HTML file are
displayed using web browser. Web browser helps to understand all the tags and attributes given
by the user and generate the contain of the page. The different version of HTML are: HTML,
HTML+, HTML 1.0, HTML2.0, HTML3.2, HTML 4.01 and now HTML 5.0.
Use of HTML:
➢ It is used to create a basic layout or design of web page.
➢ Without HTML worldwide web wouldn't exist.
➢ It allows features like embedding images, videos, audio etc.
➢ It allows user to customize and format characters such as bold, italic, underline etc.
➢ It helps to create link and list.
Advantages of HTML:
➢ It is easy to use, flexible and user friendly.
➢ It can be supported by all the web browser and operating system such as Macintosh,
windows, unix etc
➢ It is easier to obtain and modify any of the content.
➢ It is compatible with all the search engine.
➢ There are several new and advance features in HTML 5.0.
➢ HTML file takes short period of time to load.
➢ Several tutorial can be easily accessed regarding HTML.
Disadvantage of HTML:
➢ It is difficult to create attractive and interactive webpages only using HTML. [php,
javascript, sql etc]
➢ It cannot be used to create dynamic webpages.
➢ It is only a scripting language and cannot be used as programming language.
➢ There are many incompatibilities of HTML.
➢ There is no any complete acceptable standard of HTML.
XI Computer Science Bhakta Raj Tamang
Tags
HTML tag are the instructions or command given to the web browser in order to organize text
image and any other components of web pages. This HTML tags are executed by web browser
respectively. Like any programming language this HTML tags also helps to perform some
specific actions. HTML tags are written inside angular brackets <> .There are two types of
HTML tag.
Note: HTML tags and attributes are not case sensitive.
a. Pair tag: Those tags which have both opening and closing tags are known as pair tag. They
are also known as container tags. If a tag is written only within the angular brackets <> then it is
known as opening tag. Whereas, same tag is written within a angular bracket preceded by slash /
then it is known as closing tag. For eg: <head>…</head>, <p>…</p>, <body>…</body> etc.
b. Singular tag: Those tag which have only opening tag but no closing tag are known as singular
tag. They are also known as empty tag.
For eg, <img>, <br>,<hr> etc.
Attributes
They are the descriptive properties of a HTML tags written within respective tag. Attributes
helps to add some extra feature, which allows designer to customize and modify several
components of webpages according to requirement.
Eg, If is the tag then its attributes are:
bgcolor = It helps to add background color.
text = It helps to change the color of the text written in webpages.
background = It helps to add image in background of webpages.
Which are written as:
<input type="text" placeholder="Enter your name">
Steps to write and execute HTML document.
a. Write all the HTML tags, attributes and related information in a notepad.
b. Save your document by using desired name followed by .HTML extension. Eg, sample.html
c. Execute the html file by using any web browser.
HTML Headings
HTML headings are defined with the <h1> to <h6> tags.
<h1> defines the most important heading. <h6> defines the least important heading.
XI Computer Science Bhakta Raj Tamang
Example
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
HTML Paragraphs
The HTML <p> element defines a paragraph.
A paragraph always starts on a new line, and browsers automatically add some white space (a
margin) before and after a paragraph.
Example
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
HTML Horizontal Rules
The <hr> tag defines a thematic break in an HTML page, and is most often displayed as a
horizontal rule.
The <hr> element is used to separate content (or define a change) in an HTML page:
Example
<h1>This is heading 1</h1>
<p>This is some text.</p>
<hr>
<h2>This is heading 2</h2>
<p>This is some other text.</p>
<hr>
The <hr> tag is an empty tag, which means that it has no end tag.
HTML Line Breaks
The HTML <br> element defines a line break.
Use <br> if you want a line break (a new line) without starting a new paragraph:
Example
XI Computer Science Bhakta Raj Tamang
<p>This is<br>a paragraph<br>with line breaks.</p>
The <br> tag is an empty tag, which means that it has no end tag.
HTML Formatting Elements
Formatting elements were designed to display special types of text:
• <b> - Bold text
• <strong> - Important text
• <i> - Italic text
• <em> - Emphasized text
• <mark> - Marked text
• <small> - Smaller text
• <del> - Deleted text
• <ins> - Inserted text
• <sub> - Subscript text
• <sup> - Superscript text
HTML <b> and <strong> Elements
The HTML <b> element defines bold text, without any extra importance.
Example
<b>This text is bold</b>
The HTML <strong> element defines text with strong importance. The content inside is
typically displayed in bold.
Example
<strong>This text is important!</strong>
HTML <i> and <em> Elements
The HTML <i> element defines a part of text in an alternate voice or mood. The content inside is
typically displayed in italic.
Example
XI Computer Science Bhakta Raj Tamang
<i>This text is italic</i>
The HTML <em> element defines emphasized text. The content inside is typically displayed in
italic.
Example
<em>This text is emphasized</em>
HTML <small> Element
The HTML <small> element defines smaller text:
Example
<small>This is some smaller text.</small>
HTML <mark> Element
The HTML <mark> element defines text that should be marked or highlighted:
Example
<p>Do not forget to buy <mark>milk</mark> today.</p>
HTML <del> Element
The HTML <del> element defines text that has been deleted from a document. Browsers will
usually strike a line through deleted text:
Example
<p>My favorite color is <del>blue</del> red.</p>
HTML <ins> Element
The HTML <ins> element defines a text that has been inserted into a document. Browsers will
usually underline inserted text:
Example
<p>My favorite color is <del>blue</del> <ins>red</ins>.</p>
HTML <sub> Element
XI Computer Science Bhakta Raj Tamang
The HTML <sub> element defines subscript text. Subscript text appears half a character below
the normal line, and is sometimes rendered in a smaller font. Subscript text can be used for
chemical formulas, like H2O:
Example
<p>This is <sub>subscripted</sub> text.</p>
HTML <sup> Element
The HTML <sup> element defines superscript text. Superscript text appears half a character
above the normal line, and is sometimes rendered in a smaller font. Superscript text can be used
for footnotes, like WWW:
Example
<p>This is <sup>superscripted</sup> text.</p>
HTML Images Syntax
The HTML <img> tag is used to embed an image in a web page.
Images are not technically inserted into a web page; images are linked to web pages.
The <img> tag creates a holding space for the referenced image.
The <img> tag is empty, it contains attributes only, and does not have a closing tag.
The <img> tag has two required attributes:
• src - Specifies the path to the image
• alt - Specifies an alternate text for the image
Syntax
<img src="url" alt="alternatetext">
Example:
<img src="img_chania.jpg" alt="Flowers in Chania">
HTML Table
A table in HTML consists of table cells inside rows and columns.
Example
A simple HTML table:
XI Computer Science Bhakta Raj Tamang
<table>
<tr>
<th>Company</th>
<th>Contact</th>
<th>Country</th>
</tr>
<tr>
<td>Alfreds Futterkiste</td>
<td>Maria Anders</td>
<td>Germany</td>
</tr>
<tr>
<td>Centro comercial Moctezuma</td>
<td>Francisco Chang</td>
<td>Mexico</td>
</tr>
</table>
Table Cells
➢ Each table cell is defined by a <td> and a </td> tag.
➢ td stands for table data.
➢ Everything between <td> and </td> are the content of the table cell.
Example
<table>
<tr>
<td>Emil</td>
<td>Tobias</td>
<td>Linus</td>
</tr>
</table>
Table Rows
➢ Each table row starts with a <tr> and ends with a </tr> tag.
➢ tr stands for table row.
Example
<table>
<tr>
<td>Emil</td>
XI Computer Science Bhakta Raj Tamang
<td>Tobias</td>
<td>Linus</td>
</tr>
<tr>
<td>16</td>
<td>14</td>
<td>10</td>
</tr>
</table>
Table Headers
➢ Sometimes you want your cells to be table header cells. In those cases use the <th> tag
instead of the <td> tag:
➢ th stands for table header.
Example
Let the first row be table header cells:
<table>
<tr>
<th>Person 1</th>
<th>Person 2</th>
<th>Person 3</th>
</tr>
<tr>
<td>Emil</td>
<td>Tobias</td>
<td>Linus</td>
</tr>
<tr>
<td>16</td>
<td>14</td>
<td>10</td>
</tr>
</table>
HTML List
HTML lists allow web developers to group a set of related items in lists.
XI Computer Science Bhakta Raj Tamang
Unordered HTML List
➢ An unordered list starts with the <ul> tag. Each list item starts with the <li> tag.
➢ The list items will be marked with bullets (small black circles) by default:
Example
<ul>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
Ordered HTML List
➢ An ordered list starts with the <ol> tag. Each list item starts with the <li> tag.
➢ The list items will be marked with numbers by default:
Example
<ol>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
HTML Description Lists
➢ HTML also supports description lists.
➢ A description list is a list of terms, with a description of each term.
➢ The <dl> tag defines the description list, the <dt> tag defines the term (name), and
the <dd> tag describes each term:
Example
<dl>
<dt>Coffee</dt>
<dd>- black hot drink</dd>
<dt>Milk</dt>
<dd>- white cold drink</dd>
</dl>
XI Computer Science Bhakta Raj Tamang
HTML List Tags
Tag Description
<ul> Defines an unordered list
<ol> Defines an ordered list
<li> Defines a list item
<dl> Defines a description list
<dt> Defines a term in a description list
<dd> Describes the term in a description list
DBMS (Database Management System)
Data: Data are the raw facts and figures. Data are isolated, uninterpreted and doesn't give any
sense unless and until they are processed. Simply, they are the entities collected from the random
word which under goes for processing. For eg, Ram,19,12,Pokhara
Information: Information are the meaningful result which are obtain after processing and gives
some meaning and sense. Generally, It is a processed version of data. For eg, Ram is a student
whose age is 19, he lives in Pokhara-12.
As we know, information are obtain after processing data. Hence, we need data processing for
converting data into information. Therefore, systematic and scientific arrangement and
organization of data so that, we can retrieve it whenever require quickly and easily is
called database. Database is organized collection of data for converting data and information so
that it can give some meaningful result. For eg, Dictionary, Mark ledger, Census, Telephone
directory etc.
Since, manual collection and organization of data is time consuming, unsecured and complex,
there is an application program which helps to maintain database i.e. systematic and scientific
organization and collection of data. so, we can retrieve any piece of information within a fraction
of time without any effort. Hence, the software or system built to fulfill the above requirement is
known as database management system. In other word, it is a collection of software that
manages data stored in database. The main purpose of DBMS is to store data, process them and
obtain desired information. For Eg, Ms-Access, My-SQL, Oracle, Fox pro, dBase.
XI Computer Science Bhakta Raj Tamang
Advantages/features/importance of DBMS
➢ It allows user to search quickly and easily.
➢ It helps to reduce data redundancy(repetition)
➢ It allows user to share data over a network.
➢ It helps in data security and privacy,
➢ It improves data inconsistency(variance).
➢ It provides an organized way of storing data.
Disadvantages
➢ Installation and operating cost is higher.
➢ It requires more disk space.
➢ It may sometime have security and privacy issue.
➢ Technical manpower (DBA) required to maintain and operate.
Q) Define CSS. Explain its type. [V.important]
CSS stands for Cascading Style Sheets which consists of various styles that defines how to
display HTML elements. It is used to make the design of the Website dynamic and attractive.
Styles are normally stored in Style Sheets. Since, every tags cannot design the Web site in very
fascinating way we use CSS to solve that problem.
Advantages of using CSS
➢ Web pages will load faster.
➢ It helps to maintain design consistency across all the pages of the Web site.
➢ CSS allows for customizing elements such as font, font size, font color and many other
➢ CSS can help to make Web pages available for different media (desktop PC, mobile
phones). i.e. device responsive
➢ It makes web page compatible with almost all the browsers.
XI Computer Science Bhakta Raj Tamang
CSS styles can be in various forms which are illustrated below with an example.
Without using CSS
<HTML>
<HEAD><TITLE>inline CSS</TITLE></HEAD>
<BODY bgcolor = “red”>
</BODY>
</HTML>
Above HTML file will generate empty webpage with just red color background. Same thing can
be done by using several types of CSS i.e inline, internal and external CSS.
1. Inline CSS
This types of CSS are written inside the HTML tag.
<HTML>
<HEAD><TITLE>Inline CSS</TITLE></HEAD>
<BODY style = “background-color: red;”>
XI Computer Science Bhakta Raj Tamang
</BODY>
</HTML>
In above HTML file we have added style inside BODY tag. Similarly, we can add any number of
CSS inside HTML tag.
2. Internal CSS
This types of CSS are written inside <STYLE> tag, which is placed in -between HEAD tag of an
HTML document.
<HTML>
<HEAD><TITLE>Internal CSS</TITLE>
<STYLE>
body{
background-color: red;
}
</STYLE>
</HEAD>
<BODY>
</BODY>
</HTML>
In above HTML file we have added STYLE tag inside HEAD. CSS is written directly selecting
body tag.
Note: We can select id as well as class of any HTML tag. # is used to access id of the tag
whereas, . is used to access class of the tag.
3. External CSS
In this type we have to prepare HTML file and CSS file separately. These two file are linked by
following statement.
<link rel=“stylesheet” href=“name.css”>
Consider the following HTML document.
XI Computer Science Bhakta Raj Tamang
<HTML>
<HEAD><TITLE>External CSS</TITLE>
<link rel=“stylesheet” href=“mero.css”>
</HEAD>
<BODY>
</BODY>
</HTML>
Since we have linked “mero.css” in HTML file we have to create a separate CSS file named
“mero.css”. We can directly write CSS without STYLE tag in CSS document.
body{
background-color: red;
}
In above HTML file we have a created separate HTML and CSS file which are linked together.
XI Computer Science Bhakta Raj Tamang
Chapter 7: Multimedia
Introduction: Multimedia consist of two words ‘Multi’ and ‘Media’, Where multi means many
and media means way/medium of expressing information. Hence, multimedia is the way of
expressing information in different forms. The information can be expressed in either text, audio,
video, graphics and animation. We use several forms of media for better understanding and
effective communication. By using multimedia any information can be illustrated in greater
depth.
Since single form of media is inefficient for better communication and greater understanding, we
integrate several components of multimedia (text, audio video, animation and graphics) by using
multimedia computer system. Hence the integration of different forms of media is mandatory for
effective communication.
Multimedia computer system consist of multimedia hardware and multimedia software. Printer,
projector, webcam, microphone, digital camera etc, are some of the widely used multimedia
computer hardware.
Similarly, software like text editor (MS Word), Presentation tool (Power Point), Photo editing
(Photo Shop), Video editing (iMovie), Accounting package (Tally) etc are used as a multimedia
software. These multimedia hardware and software works together in order to integrate several
components of multimedia. for eg: video can be a created by integrating audio and images.
Advantages/Merits/Pros/Importance of multimedia
➢ It helps to make communication much more effective
➢ It enhances the level of understanding in any particular topic.
➢ Games, Cartoons, movies are made more effective and realistic by using multimedia.
➢ It makes teaching and learning process much more interesting and intuitive.
➢ Virtual reality and simulation has become more realistic.
Disadvantages/De-merits/Cons/Limitation of multimedia
➢ Multimedia Components may be expensive.
➢ Technical knowledge and IT literacy is required to operate multimedia.
➢ Technology is always changing and never constant.
➢ Multimedia device runs on electricity.
Components/Elements of multimedia
1) Text: It is the collection of alpha numeric values or any characters. It can be a word,
single line or a paragraph. We can create and customize text by using several text editor
or word processor such as MS-Word, Notepad etc. It is the basic form or way of
expressing information. By using multimedia software we can customize the text by
giving several size, color, type, style etc. Extension of text documents are .docx, .txt etc.
2) Graphics / Images: “A picture is of thousand words" which means picture can describe
things more than a text. Graphics generally refers to image or pictures. The smallest
XI Computer Science Bhakta Raj Tamang
element of picture is called Pixel (Picture Element). Hence the quality of image or picture
is denoted by number of pixel available in that picture, Generally termed as resolution.
We use several multimedia software such as Adobe Photo shop, Corel draw, Adobe
indesign etc. Extension of images are .jpeg, .png etc.
3) Audio: Audio is the one of the important components of multimedia. It gives the
sensation of hearing. Audio can be used to enhance the understanding level in any
particular topic. Audio can be human voice, instrument notes, natural sound, digitally
synthesized sound and many more. In these days Audio can be transfer from one place to
another by converting it into digital signal. FM radio use this component to express their
information. Several multimedia software such as windows media player can be used to
play audio. Extension of audio are .mp3, .wma etc.
4) Video: The video is the running frames of static pictures that means video are generated
by capturing maximum number of images in unit time. Frame per second [FPS] is the
term widely used to describe the smoothness of a video. Generally, there are 15-25 frame
per seconds, to generate smooth movement in video. But 30 and 60 FPS are the widely
used standard in different devices. We can use different multimedia software such as
iMovie, Final cut pro, Filmora etc. to edit and customize our video. Extension of video
are .mp4, .mpeg etc.
5) Animation: Animation is the sequence of vector(Computer Generated) image displayed
in rapid succession to provide visual effects. These image are computer based images.
The animation is created to express ideas where complex explanation should be
effectively deliver. These components are widely used in movie industry, and in other
entertainment industry. Animation can be either 2D or 3D. 3D animation are more
realistic in nature. So, different movies used 3D animation to express information which
are not feasible in real life. We use several multimedia software such as Maya animation,
Auto CAD, Macromedia flash etc. Extension of animation are .flv, .gif etc.
Application of areas of multimedia.
1. Education: Multimedia enhances learning by providing interactive and engaging educational
materials. It includes videos, animations, simulations, and interactive exercises that cater to
different learning styles and make complex concepts easier to understand.
2. Communication: In communication, multimedia facilitates the exchange of information
through various media formats such as text, audio, video, and graphics. It enables effective
communication through platforms like video conferencing, social media, email, and instant
messaging.
XI Computer Science Bhakta Raj Tamang
3. Entertainment: Multimedia is extensively used in entertainment industries such as movies,
television, music, gaming, and virtual reality. It creates immersive and engaging experiences
through a combination of audio, video, graphics, and interactive elements.
4. Medicine: In medicine, multimedia is applied for purposes such as medical imaging (e.g.,
MRI, CT scans), patient education, surgical simulations, telemedicine, and healthcare training. It
aids in diagnosis, treatment planning, and medical education.
5. Science and Technology: Multimedia is used in science and technology for data
visualization, simulations, scientific modeling, and educational purposes. It helps scientists and
researchers present their findings, communicate complex ideas, and engage with the public.
6. Advertisement: Multimedia is a powerful tool for advertising and marketing campaigns. It
allows businesses to create visually appealing advertisements, promotional videos, and
interactive content to attract and engage customers across various platforms.
7. Websites/Webpages: Multimedia enhances the user experience on websites and webpages by
incorporating elements such as images, videos, animations, and interactive features. It makes
websites more visually appealing, engaging, and informative for visitors.
8. Research and Engineering: In research and engineering, multimedia is used for data
analysis, visualization, simulation, and communication of findings. It helps researchers and
engineers present their work, collaborate with colleagues, and disseminate information
effectively.
XI Computer Science Bhakta Raj Tamang
Chapter 8. Information Security and Cyber Law
Information Technology with its social impacts.
Information Technology is a modern concept or methodology of communication. It is the
combined form of Information and Communication Technology, which is highly used for the
information flow and in many other fields.
IT has made the world closer day by day. One can easily send and receive the message
throughout the world within a second. It has been widely used in education, industry, banks,
research center, hospitals, etc. It is being used as learning and teaching tool in the sector of
education. Distant learning has become possible due to the advancement of IT. It has been highly
used in the industries to control quantity and quality of the product. It is equally used for the
management in hospitals and for the treatment of the patients. IT is being used in the sector of
animation and other entertainment. Scientists can use computer or IT for their research and
experiment. Space technology has become possible due to the IT.
Thus, it has much such a positive impact on the society. But it has some negative impacts, too.
As the use of IT is increasing day by day, the cybercrimes are also increasing. Cyber criminals
can easily steal others’ information or data, they can disclose other secrecy, and they can easily
spread the virus in the network and disturbs the social peace and security.
Information Security
As we know, in a network or cyber space there is always threat of cyberattacks which may lead
to loss and damages of our precious data and information. It is always necessary to be aware of
such malicious activity. We need to adopt different measures while using computer from such
intentional and accidental activities. Thus, information security refers to the process of protecting
our network infrastructure from unauthorized access, misuse, modification, destruction or any
malfunction. We can use several physical and software preventive measures to protect ourselves
from such unethical activities. Information security helps to create a secure environment for
computers, users and programs.
Information security can mitigate security threats and security attacks. Security threats is
possible danger that might cause unwanted activities in our computer system to breach security
and thus cause possible harm whereas security attack is an attempt to gain unauthorized access to
destroy, expose, steal or alter others valuable data and information. This attack can be triggered
by malicious application such as viruses, spyware, Trojan horse, WORMS etc.
Information security are built around three major objectives:
1) Confidentiality: It means information are available for only the authorized individual,
that means individual or any other system cannot use or process others information
without proper authorization.
2) Integrity: It indicates accuracy and completeness of data and information which means
without proper authorization data and information cannot be tampered.
XI Computer Science Bhakta Raj Tamang
3) Availability: It means information must be always available as per the requirement of the
user. It generally refers to accessing out valuable data and information whenever required
with in no time.
computer ethics or cyber ethics:
The computer ethics or the cyber ethics are the set of moral principles or the codes of conduct,
which should be strictly followed by the computer professionals. The intention of the computer
or cyber ethics is to avoid the criminal activities through the use of computers.
The following are some examples or commandments of computer ethics:
Do not use other’s password
Do not steal other’s information
Do not use computers to harm others
Do not disclose other’s secrecy
Do not spread virus in the network
Do not copy licensed software, which you have not paid
Do not alter other’s data
Do not take possession to other people’s intellectual property
Do not misuse electronic transaction
Do not use computer to bear false witness, etc.
Cybercrime:
The act of misusing computers, Internet or other electronic media is called cybercrime. As the
use of Information Technology is increasing, the act of cybercrime is also increasing day by day.
The following are some examples of cybercrime:
Misuse of computers
Spreading virus
Stealing other’s information
Pirating licensed software
Disclosing of other’s secrecy
Misuse of electronic transaction and electronic media
Rude and vulgar comments in Internet on racial, communal and others
Alteration of other data without permission
Spying others’ information
Cracking or hacking
Password guessing
Forgery
DOS attack, etc.
XI Computer Science Bhakta Raj Tamang
To protect from Cybercrime
Keep software and operating system updated
Use anti-virus software and keep it updated
Use strong passwords
Never open attachments in spam emails
Do not click on links in spam emails or untrusted websites
Do not give out personal information unless secure
Contact companies directly about suspicious requests
Be mindful of which website URLs you visit
Keep an eye on your bank statements
Computer Virus: A computer virus is an ill-natured software application or authored code that
can attach itself to other programs, self-replicate, and spread itself onto other devices. When
executed, a virus modifies other computer programs by inserting its code into them. If the virus’s
replication is successful, the affected device is considered “infected” with a computer virus.
Various types of viruses:
• File Virus: This type of virus infects the system by appending itself to the end of a
file. It changes the start of a program so that the control jumps to its code. After the
execution of its code, the control returns back to the main program. Its execution is
not even noticed.
• Boot sector Virus:
It infects the boot sector of the system, executing every time system is booted and
before the operating system is loaded. It infects other bootable media like floppy
disks. These are also known as memory viruses as they do not infect the file
systems.
• Macro Virus: Unlike most viruses which are written in a low-level language (like
C or assembly language), these are written in a high-level language like Visual
Basic. These viruses are triggered when a program capable of executing a macro is
run. For example, the macro viruses can be contained in spreadsheet files.
• Source code Virus:
It looks for source code and modifies it to include virus and to help spread it.
• Polymorphic Virus: A virus signature is a pattern that can identify a virus (a
series of bytes that make up virus code). So, in order to avoid detection by antivirus
a polymorphic virus changes each time it is installed. The functionality of the virus
XI Computer Science Bhakta Raj Tamang
remains the same but its signature is changed.
• Stealth Virus: It is a very tricky virus as it changes the code that can be used to
detect it. Hence, the detection of viruses becomes very difficult. For example, it can
change the read system call such that whenever the user asks to read a code
modified by a virus, the original form of code is shown rather than infected code.
• Multipartite Virus: This type of virus is able to infect multiple parts of a system
including the boot sector, memory, and files. This makes it difficult to detect and
contain.
• Memory Resident Virus: Resident viruses installation store for your RAM and
meddle together along with your device operations. They behave in a very secret
and dishonest way that they can even connect themselves for the anti-virus software
program files.
• Overwrite virus: This type of virus deletes the information contained in the file
that it infects, rendering them partially or totally is useless once they have been
infected.
• Directory Virus: This virus is also called called File System Virus or Cluster Virus.
It infects the directory of the computer by modifying the path that is indicating the
location of a file.
• Companion Virus: This kind of virus usually use the similar file name and create a
different extension of it. For example, if there’s a file “Hello.exe”, the virus will
create another file named “Hello.com” and will hide in the new file.
Symptoms of Computer Virus
Your computer slows down without any reason.
Your computer system has less available memory than it should.
Unknown programs or files are being created.
Programs or files become missing.
Corrupted files.
Your computer restarts in unusual ways.
Some files or programs suddenly don't work properly.
Strange messages, displays, music or sounds.
Changed Hard Drive name or Volume name.
Hard Drives or Disk Drives are inaccessible.
To protect or prevention methods of / from computer virus
Install antivirus or anti-malware software
Keep your antivirus software up to date
XI Computer Science Bhakta Raj Tamang
Run antivirus scans regularly
Keep your operating system up to date
Protect your network
Think before you click
Keep your personal information secure
Don’t use unsecured Wi-Fi
Back up your files
Use several secure passwords
Cyber Law:
The law regarding the use of computers is called Cyber Law. It highly concerns with the misuse
of the computers, Internet and other electronic media, which are specially used for information
flow. Cyber ethics just suggest not committing computer crimes or cybercrimes but the cyber
law strictly defines the punishment in case of violation of the laws or cyber principles. Actually,
the cyber law is in practice to support the cyber ethics. Nepal Government also has issued the
Cyber Law on 11th Falgun, 2061 (18th March 2005) as “The Electronic Transaction Ordinance,
2005”.
It has the following provisions:
1) Electronic and Digital Signature Law
2) Intellectual Property Law
a. Copyright Law
b. Trademark Law
c. Patent Law
3) Telecommunication Law
4) Data Protection and Privacy Law
Concept of Digital Signature
A digital signature is a cryptographic technique used to verify the authenticity and integrity of
digital messages or documents. It provides a way to ensure that the sender of a message is who
they claim to be and that the message has not been altered during transmission.
Digital signatures works:
1. Signing Process: To create a digital signature, the sender uses a mathematical algorithm
to generate a unique digital fingerprint, or hash, of the message or document they want to
sign. This fingerprint is created using the sender's private key, which is known only to
them.
XI Computer Science Bhakta Raj Tamang
2. Verification Process: The recipient of the message can verify the digital signature using
the sender's public key, which is freely available. The recipient applies the same
algorithm to the received message to generate a new digital fingerprint. Then, they
compare this fingerprint to the one included in the digital signature. If the two
fingerprints match, it proves that the message has not been altered since it was signed and
that it was indeed signed by the holder of the corresponding private key.
Objectives of IT Policy of Nepal
The IT policies of Nepal are:
· To declare IT as a high priority sector of government and make it practical
· To establish knowledge-based industries to increase employment
· To make public information and service delivery inclusive and effective through the
philosophy of e-government
· To increase the productive use of IT in social, economic and business organizations
· To increase access to IT related international attempts and developments
· To make Government Integrated Data Center (GIDC) effective in order to develop as an
infrastructure for IT development
XI Computer Science Bhakta Raj Tamang