Number System and Conversion Boolean Logic Unit 2 … 83.
ii. Octal to Binary
For converting octal to binary form, it should be first converted into decimal and the resulting
decimal should be converted to binary. Or the individual octal digit will be converted into 3-bit
binary and arrange in order from right to left according to the order of octal digit.
Eg. Convert (134)8 to Binary
(134)8 = (92) 10 = (1011100) 2
iii. Octal to Hexadecimal
For converting octal to hexadecimal form, first converted octal to decimal and then converted
decimal to hexadecimal by dividing the decimal by base of hexadecimal.
Eg. Convert (134)8 to Hexadecimal
(134) 8 = (92) 10 = (5C) 16
Conversion of Hexadecimal Number system to other Number systems
i. Hexadecimal to Decimal
For converting hexadecimal number to its decimal form, each hexadecimal digit should be multiplied
by its position weights and added to obtain the equivalent decimal number. Eg.
Convert (1D7F)16 into Decimal
Position 4th 3rd 2nd 1st
Weights 163 162 161 160
Value 1 D7F
F × 160 = 15
7 × 161 = 112
D × 162 = 3328
1 × 163 = 4096
(7551)10
Therefore (1D7F)16 = (7551)10
ii. Hexadecimal to Binary
A hexadecimal number can be converted to its binary equivalent by using two methods.
Method I
Hexadecimal number first converted into its decimal equivalent and that decimal number can be
converted into binary form. While converting hexadecimal to decimal, it is needed to multiply each
hexadecimal digit with its position weights and sum to obtain equivalent decimal number.
Eg. Convert (2D4AC)16 to Decimal
Therefore (2D4AC) 16 = (185516)10 = (101101010010101100)2
Method II
This method uses the concept that a each hexadecimal digit can be represented by four bit binary
number.
Hexadecimal 2 D 4 AC
Decimal 2 13 4 10 12
Binary power 23 2221 20 23 2221 20 23 2221 20 23 2221 20 232221 20
Representation
Binary Number 0010 1101 0100 1010 1100
Therefore (2D4AC)16 = (00101101010010101100)2
Approved by Curriculum Development Centre (CDC), Nepal
.84 … Computer Science–I
iii. Hexadecimal to Octal
Hexadecimal number, first converted into its decimal equivalent and that decimal number can be
converted into octal by dividing decimal number repeatedly using base 8.
Eg. Convert (2D4AC)16 into Octal
Therefore (2D4AC) 16 = (185516) 10 = (552254) 8
ONE’S AND TWO’S COMPLEMENT METHODS FOR BINARY SUBTRACTION
Subtraction with binary numbers is done in a same manner and using the same procedure as in 9's and
10's complement method. Since the binary number has base two, replace 9's with 1's and 10's with 2's
complement in the procedure described under 9's and 10's complement method of subtractions, to perform
1's and two's complement method of subtractions.
Example 1
Subtract (1000100)2 from (1010100)2 using 2's complement method of subtraction.
Here,
M = 1010100, and N = 1000100
Rule 1 : Find 2's complement of N = N = 1000100.
2's complement is: 1's complement of N 1000100 + 1
= 0111011 + 1
= 0111100
Rule 2 : Add minuend M = 1010100 to 2's complement of N. Therefore;
1010100
+01111100
Sum = 1 0010000
1 is Called end around Carry
Rule 3 : Since there is an end around carry, we can discard it. Therefore, the remaining number is
0010000. This is positive and true answer.
Now, let us consider another example by with N > M.
Example 2
Subtract 1010100 from 1000100.
Here,
M = 1000100, and N = 1010100.
Now, Apply the rule to subtract the numbers.
Rule 1 : Find 2's complement of N = 1010100.
2's complement is: 1's complement of 1010100 + 1
= 0101011 + 1
= 0101100
Rule 2 : Add minuend M = 1000100 to 2's complement of N. Therefore;
1000100
+01101100
Sum = 1110000
Approved by Curriculum Development Centre (CDC), Nepal
Number System and Conversion Boolean Logic Unit 2 … 85.
Rule 4 : In this case, there is no end around carry (therefore, rule 3 is not applicable here.). Therefore,
according to rule 4, when there is no end around carry, the obtained result (sum) is negative
and is in 2's complement form of true answer. To find the true answer, find the 2's
complement of obtained answer.
1's complement of 1110000 is: 0001111
2's complement of 0001111 is: 0001111 + 1 = 0010000
Therefore, the final answer is (– 0010000)2.
Example 3
Subtract 1000100 from 1010100 using 1's complement method of subtraction.
Here,
M = 1010100, and
N = 1000100
Rule 1 : Find 1's complement of N = 1000100.
1's complement is: = 0111011
Rule 2 : Add minuend M = 1010100 to 1's complement of N. Therefore;
1010100
+0111011
Sum = 1 0001111
Rule 3 : 1 is Called end around Carry
Since there is an end around carry, the answer is positive, and end around carry should be
added to the result to get the final answer.
0001111
+1
0010000
This is positive and true answer.
Example 4
Subtract 1010100 from 1000100.
Here,
M =1000100, and N = 1010100.
Now, Apply the rule to subtract the numbers.
Rule 1 :
Find 1's complement of N = 1010100.
1's complement is: = 0101011
Rule 2 : Add minuend M = 1000100 to 1's complement of N. Therefore;
1000100
+0101011
Sum= 1101111
Approved by Curriculum Development Centre (CDC), Nepal
.86 … Computer Science–I
Rule 4 : In this case, there is no end around carry (therefore, rule 3 is not applicable here.). According
to rule 4, when there is no end around carry, the obtained result (sum) is negative and is in 1's
complement form of true answer. To find the true answer, find the 1's complement of
obtained result.
1's complement of 1101111 is: 0010000.
Therefore, the final answer is (– 0010000)2.
BOOLEAN LOGIC
Introduction
Digital computer is based on discrete signal. That means, digital circuits are used for two state operations.
For example, a toggle switch which has two states 'Open' or 'Closed' is an example of digital operation.
When the switch is ON, then it is in one state, and when OFF then it is in another state. The ON state and
OFF state can have some values below or above the reference level. If the value is below the reference level
then it is in one state such as OFF, and when above the reference level then it is in another state such as
ON. The value below the reference level can be termed as LOGIC LOW and the value above the reference
standard as LOGIC HIGH. The digital circuits use either logic low or logic high as input. Therefore, the
circuit which has two or more than two logic input and having only one logic output is called Logic
Circuit.
Boolean Algebra
Logic circuits can be used to represent two state operations. Two state operations such as True or False?
Yes or No? Right or Wrong? Good or Bad? High or Low? In or Out? are some examples of digital
operation. These questions have some kind of logic. There is close relationship between logic and Boolean
algebra. Boolean algebra is an algebra developed by George Boole (1854) and is used to represent the two
state operations. The Boolean algebra can be used to analyze and design computer circuits. Generally,
every digital circuit has two or more than two inputs and only one output. The relationship between input
variables and output variable can be represented using function, called logic function (Boolean function).
Logic function is a logic expression having input and output variables in the form of equation. A Logic
function is an expression formed with binary variables, two binary operators OR and AND, the unary
operator NOT, parentheses and equal sign. Since the binary variable can take either 0 or 1, for a given
value of variables the logic function can be either 0 or 1.
In Boolean algebra, an input or output signal can be low or high. Low is represented by '0' and High by '1'.
Therefore, in Boolean algebra a variable can be either Low or High. Boolean algebra basically uses three
types of operators to show the relationship between input and output variables. The three basic types of
Boolean operators are plus (ORs), times (ANDs), and over bar (NOT).
Not Operation
According to Boolean algebra, the output Y is always a complement of the input X. The logical relationship
can be represented with the logic function;
Y = NOT A
The over bar is used for NOT operation.
Therefore; Y=Ā
If A= 0, then;
Y = NOT A = NOT 0 = 1 or Y = 0 = 1
And if A=1 then;
Y = NOT A =NOT 1 = 0 or Y = 1 = 0
Therefore, NOT operation is used to get the inversion of the input value.
Approved by Curriculum Development Centre (CDC), Nepal
Number System and Conversion Boolean Logic Unit 2 … 87.
OR Operation
In Boolean algebra, the output is obtained by ORing the inputs. This can be written as;
Y = A OR B
The OR operation is represented by plus '+' sign in Boolean algebra. Therefore; the relationship becomes;
Y = A + B (Y equals A or B)
When A = 0 (Low) and B = 0 (Low), then;
Y = A OR B = 0 OR 0 = 0 or Y = A + B = 0 + 0 = 0
When A = 1 (High) and B = 0 (Low), then;
Y = A OR B = 1 OR 0 = 1 or Y = A + B = 1 + 0 = 1
When A = 0 and B = 1 then;
Y = A OR B = 0 OR 1 = 1 or Y = A + B = 0 + 1 = 1
When A = 1 and B = 1, then;
Y = A OR B = 1 OR 1 = 1 or Y = A + B = 1 + 1 = 1
Therefore, OR operation states that the output will be high (i.e. 1) when any one or all the inputs are high
and vice versa. Here, '1' and '0' represent binary values, and '1' means logic high and '0' means logic low.
AND Operation
The output is obtained by ANDing the inputs. The operation is represented as;
Y = A AND B
In Boolean algebra, the AND operation is represented by multiplication sign (.). Therefore, the relationship
becomes;
Y = A.B or Y = AB (Y equals A AND B)
When A and B both are low, then;
Y = A AND B = A.B = 0.0 = 0
When A=0 and B=1 (A low and B high), then;
Y = A AND B = A.B = 0.1 = 0
When A=1 and B=0 (A high and B low), then;
Y = A AND B = A.B = 1.0 = 0
When A=1 and B = 1 (both High), then;
Y = A AND B = A.B = 1.1 = 1
It can be concluded that the output becomes high only when A=1 is ANDed with B=1, and in all other
cases the output is low. Therefore, AND operation gives high output only when all the inputs are high.
Therefore, in logic operations, we can say that;
OR operation gives;
Low + Low = Low
Low + High = High
High + High = High
AND operation gives; Low . Low = Low
Low. High = Low
High. High = High
NOT Operation; Low becomes High
High becomes Low
Approved by Curriculum Development Centre (CDC), Nepal
.88 … Computer Science–I
Truth Table and Boolean Expression
Digital circuits have input and output variables. Each variable may have either low or high value. These
input and output variables and their possible combinations can be shown using a table. This table which
shows all the possible relationships and combinations of input and output variables is called 'truth table'.
Since the digital circuits are used for two state operations, binary 1 or 0 can be inserted in the table. The
table contains columns and rows. The columns contain input and output variables and the rows contain
the possible values under each variable.
As discussed earlier, Boolean algebra can be represented by Boolean expressions in the form of equations.
Let's consider the AND Boolean algebra. The Boolean expression for AND operation is;
Y = A.B ……………… (i)
The truth table for Boolean expression in equation (i) is;
Truth Table
Inputs Output
Table 2.1 A B Y=AB
Truth table of AND operation
L LL
L HL
H LL
H HH
Table 2.2 Inputs Output
Binary Equivalent
AB Y=AB
00 0
01 0
10 0
11 1
Let's consider a digital circuit having 3-inputs for OR operation. The logic expression for OR operation is;
Y=A+B+C
The truth table is;
Inputs Output
A B C Y=A+B+C
0000
0011
Table 2.3 0 1 0 1
Truth Table for 3-input OR 0 1 1 1
operation
1001
1011
1101
1111
Approved by Curriculum Development Centre (CDC), Nepal
Number System and Conversion Boolean Logic Unit 2 … 89.
OR, AND, and NOT operations can be combined to form somewhat complex digital circuits. Let's consider
a digital circuit which gives the following Boolean output;
Y=Ā+BC
The truth table for the above expression is;
Inputs Output
A B C Y=Ā+BC
0 0 0 1+0.0=1
0 0 1 1+0.1=1
Table 2.4 0 1 0 1+1.0=1
Truth Table for Y=Ā+BC 0 1 1 1+1.1=1
1 0 0 0+0.0=0
1 0 1 0+0.1=0
1 1 0 0+1.0=0
1 1 1 0+1.1=1
Boolean Values and Boolean Functions
The storing true and false value is called bool, named after the British mathematician, George Boole. Bool
is a data type that store values in the form of true or false. George Boole created Boolean Algebra, which is
the basis of all modern computer arithmetic. There are only two Boolean values. They are True and False.
Boolean Functions define as:
1. A Boolean variable is a variable that may take on values only from the set B = {0, 1}.
2. A Boolean function of degree n or of order n is a function with domain Bn = {(x1, x2, ..., xn)|xi ∈ B}
and co-domain B. In other words, Boolean functions of degree n are functions of the form F : Bn → B.
3. Two Boolean functions, F and G are equivalent if F(x1, x2, x3, . . . , xn) = G(x1, x2, x3, . . . , xn) for every
ordered n-tuple (x1, x2, x3, . . . , xn) ∈ Bn .
Example
A Boolean function of degree 2, F(x, y) : B2 → B, may be defined by a chart. For example, this function may
be defined as follows using AND operation.
X0011
Y0101
F(x,y) 0 0 0 1
Generally Boolean function is used either SOP or POS structure, they are briefly discussed below:
Sum of Product (SOP)
It stands for Sum of Product. SOP form is a form of expression in Boolean algebra in which different
product terms of inputs are being summed together. This product is not arithmetical multiply but it is
Boolean logical AND and the Sum is Boolean logical OR.
To understand better about SOP, we need to know about min term.
Min Term
Min term means the term that is true for a minimum number of combinations of inputs. That is true for
only one combination of inputs. Since AND gate also gives True only when all of its inputs are true so we
can say min terms are AND of input combinations like in the table given below.
Approved by Curriculum Development Centre (CDC), Nepal
.90 … Computer Science–I
A0 0 0 0 1 1 1 1
B0 0 1 1 0 0 1 1
C0 1 0 1 0 1 0 1
Min term m0 m1 m2 m3 m4 m5 m6 m7
= A¯ B¯ C¯ = A¯ B¯ C = A¯ B C¯ = A¯ B C = A B¯ C = A B C¯ = A¯ B¯ C¯ =ABC
3 inputs have 8 different combinations. Each combination has a min terms denoted by small m and its
decimal combination number written in subscript. Each of these min terms will be only true for the
specific input combination.
SOP expression implements 2 level AND-OR design in which the 1st level gate is AND gate following the
2nd level gate which is OR gate. Schematic design of SOP expression needs a group array of AND gates
and one OR gate.
The number of inputs and the number of AND gates depend upon the expression one is implementing.
Example of designs of canonical and minimal SOP expression for a function is given below.
Figure: 2.1 Canonical Form Figure: 2.2 Minimal Form
A
A
B FB
F
CC
=AB’C+A’B’C+A’BC’+A’BC F=A’B+B’C
Product of Sum (POS)
It stands for Product of Sum. The product of Sum form is a form in which products of different sum
terms of inputs are taken. These are not arithmetic product and sum but they are logical Boolean
AND and OR respectively.
To better understand about Product of Sum, we need to know about Max term.
Max Term
Max term means the term or expression that is true for a maximum number of input combinations or
that is false for only one combination of inputs. Since OR gate also gives false for only one input
combination. So Max term is OR of either complemented or non-complemented inputs.
Max terms for 3 input variables are given below.
A0 0 0 0 1 1 1 1
B0 0 1 1 0 0 1 1
C0 1 0 1 0 1 0 1
Min m0 m1 m2 m3 m4 m5 m6 m7
term = A + B + C = A + B + C¯ = A + B¯ + C = A + B¯ + C¯ = A¯ + B + C = A¯ + B + C¯ = A¯ + B¯ + C = A¯ + B¯ + C¯
3 inputs have 8 different combinations so it will have 8 max terms. Max terms are denoted by capital
M and decimal combination.
Approved by Curriculum Development Centre (CDC), Nepal
Number System and Conversion Boolean Logic Unit 2 … 91.
In max term each input is complemented because max term gives ‘0’ only when the mentioned
combination is applied and max term is complement of min term.
M3 = m3’
M3 = (A’ B C)’
M3 = A + B’ + C’ De Morgan’s Law.
POS expression has a specific schematic design of OR-AND. In OR-AND the inputs go through an
array of OR gates which is the 1st level of gates, the output of the 1st level OR gates goes through the
2nd level of the gate which is an AND gate.
The number of inputs and number of gates used in the design depends upon the expression that is to
be implemented.
The canonical form consists of the max number of possible inputs and gates, however the minimal
form consists of the lowest possible number of inputs and gates. The schematic design of canonical
and minimal POS form is given below.
Figure: 2.3 Canonical Form Figure: 2.4 Minimal Form
A
A
B F
F
B
CC
F=(A+B+C).(A’+B+C).(A’+B’+C’).(A’+B’+C’) F=(A’+B’).(B+C)
Logic Gates
Logic gate is a building block of any logic circuit. The combinations of logic circuits are used to analyze or
design complex digital circuits. The combination of AND, OR and NOT operations can be used to perform
logic operations other than binary addition, multiplication and complementation. Therefore, Logic gate is
a logic circuit that has one or more than one logic input and only one logic output. Logic input can be
either logic Low (0) or Logic High (1).
There are three types of fundamental or basic gates. They are;
1. NOT Gate
2. OR Gate
3. AND Gate
Basic Gates
The logic gates which are used to perform the basic Boolean operations are called basic gates. The basic
Boolean operations are complement, plus and multiplication. The logic gates that are used to perform
these operations are NOT, OR and AND gates respectively.
1. NOT Gate
The NOT gate is also called the Inverter. NOT gate has one logic input and only one logic output. The
basic logic gate that gives the complement of the input is called NOT gate. If the input is low, then
the output will be high. Similarly, if the input is high then the output will be low. Therefore, the NOT
gate acts as a switch. When the output is high, the gate acts as closed switch, and when low, it acts as
open switch.
Approved by Curriculum Development Centre (CDC), Nepal
.92 … Computer Science–I
The Logic expression for NOT gate is;
Y=Ā
The Logic symbol of NOT gate is;
Figure: 2.5 Not Gate
The truth table for logic NOT gate is
Table 2.5 Input A Output Y=Ā
Truth Table for NOT gate Low (or 0) High (or 1)
High (or 1) Low (or 0)
2. OR Gate
Unlike NOT gate, which has only one input, OR and AND gates have two or more than two inputs.
A logic gate that has two or more than two inputs that gives high output, when any or all the inputs
are high is called OR gate. The output will be low only when all the inputs are low. The OR gate is
used to perform the logic addition (OR) of inputs.
The Logic symbol of OR gate is;
Figure: 2.6 OR Gate
A Y
B
The logic expression for output of OR gate that has two inputs A and B is;
Y=A+B
The truth table for logic OR gate is;
Inputs Output
A B Y=A+B
Table 2.6 0 0 0
Truth Table-OR gate 0 1 1
101
111
3. AND Gate
A logic gate that has two or more than two inputs, and produces high output only when all the
inputs are high is called AND gate. Therefore, AND gate gives low output if any one of the input is
low. The AND gate is used for logical multiplication.
The logic symbol of AND gate is;
Figure: 2.7 AND Gate
A Y
B
Approved by Curriculum Development Centre (CDC), Nepal
Number System and Conversion Boolean Logic Unit 2 … 93.
The logic expression for output of AND gate with two inputs A and B is;
Y=A.B
The truth table for logic AND gate is;
Inputs Output
A B Y=A.B
Table 2.7 0 0 0
Truth Table-AND gate 0 1 0
100
111
Basic gates can be used to build some other gates, known as derived gates. They are;
1. NAND Gate
2. NOR Gate
3. Exclusive OR Gate (Ex-OR or XOR)
4. Exclusive NOR Gate (Ex-NOR or XNOR)
NAND and NOR gates are called universal gates, and Exclusive OR and Exclusive NOR gates
are called processing devices and they are combinational circuits.
Universal Gates
The logic gates which can be used to obtain all the basic logic operations (NOT, AND, OR) are called
universal gates. There are two universal gates: NAND and NOR. Either NAND-NAND or NOR-NOR
gates can be connected to generate any of the basic logic functions.
1. NAND Gate
NAND gate is a combination of AND and NOT gate. That means output of AND gate is
complemented with NOT gate. NAND gate is sometimes also called NOT-AND
(NOT+AND=NAND) gate. This gate produces high output when any one of the input is low, and
low output when all the inputs are
high as shown in the table 2.8.
The logic symbol for NAND gate is;
Figure: 2.8 NAND Gate
A
BY
The logic expression for NAND gate is;
Y = A––.B–
Since the output is first ANDed and then inverted, it can be read as "Y equals NOT A AND B" or "Y
equals the complement of A AND B".
The truth table is;
Approved by Curriculum Development Centre (CDC), Nepal
.94 … Computer Science–I
Table 2.8 Inputs Output
Truth Table-NAND gate AB Y = A––.B–
00 1
01 1
10 1
11 0
Figure: 2.9 Bubbled OR Gate
A Y
B
The NAND gate is identical to bubbled OR gate, because both of them produce the same output as
shown in Fig 2.9. Therefore, NAND and bubbled OR gate can be used interchangeably.
2. NOR Gate
NOR gate is a combination of OR and NOT gate. That means output of OR gate is complemented
with NOT gate. NOR gate is, sometimes, also called NOT-OR (NOT+OR=NOR) gate. This gate
produces high output when all the inputs are low, and low output when any or all the inputs are
high as shown in the table 2.9.
The logic symbol for NOR gate is;
Figure: 2.10 NOR Gate
A Y
B
The logic expression for NOR gate is;
Y = A––+–B
Since the output is first ORed and then inverted, it can be read as "Y equals NOT A OR B" or "Y
equals the complement of A OR B".
The truth table is;
Inputs Output
Table 2.9 A B Y = A––+–B
Truth Table-NOR gate 01
0 10
0
100
110
Figure: 2.11 Bubbled and Gate
A
Y
B
The NOR gate is identical to bubbled AND gate, because both of them produce the same output as
shown in Fig. and. Therefore, NOR and bubbled AND gates can be used interchangeably.
Approved by Curriculum Development Centre (CDC), Nepal
Number System and Conversion Boolean Logic Unit 2 … 95.
Exclusive-OR and Exclusive – NOR Gate
Exclusive-OR and Exclusive NOR gates can be designed by connecting basic gates. They fall under
combinational circuits, in which output of one gate becomes the input of another gate. They are also
called processing devices, as they can be used to process the data.
1. Exclusive-OR Gate
A. Definition, Symbol, Expression and Truth Table
Exclusive-OR can be written as X-OR or Ex-OR. The X-OR gate can be build as shown in Fig.
2.11.
Figure: 2.12 X-OR Gate
A AB
B Y
B AB
B
It consists of two Inverters, two AND gates and an OR gate. The upper AND gate produces –A–
B, as input A is given through an Inverter and input B is connected directly. Similarly, the lower
AND gate produces A–B– , because the input B is complemented and input A is provided
directly. The outputs of both AND gates are given to OR gate as input. Therefore, these two
inputs will be ORed by OR gate and output becomes;
Y = –A– B + A–B–
Y=–A– B + A–B– is a logic expression for XOR gate.
A truth table can be derived for the above circuit, as shown in the table 2.10.
Inputs Output
Table 2.10 A B Y = –A– B + A–B–
Truth table-Exclusive-OR 00
0 11
0
101
110
The truth table for two-input Exclusive OR gate shows that, when both A and B are low or both
are high, output Y is also low. When A is low and B is high or A is high and B is low, the output
Y is high. This means, output is high only when either A or B is high; and output is low when
all the inputs are either low or high.
Therefore, Exclusive-OR gate can be defined as a logic circuit which produces high output only
when an odd number of inputs are high. When even numbers of inputs are high, the output will
be low.
Approved by Curriculum Development Centre (CDC), Nepal
.96 … Computer Science–I
The logic symbol for Exclusive-OR gate is;
Figure: 2.13 Exclusive-OR Gate
A
Y
B
B. Uses of XOR gate
Exclusive-OR and Exclusive-NOR gates can be used in;
i) Parity generator to generate the parity bit, and
ii) Parity checker to check the error in data transmission.
2. Exclusive-NOR Gate
Exclusive-NOR can be written as X-NOR or Ex-NOR. The X-NOR gate can be build as shown in Fig.
2.13 .
Figure: 2.14 Ex-NOR Construction
A AB
B
AA Y
B AB
It consists of the same number of gates as XOR gate; two Inverters, two AND gates and an OR gate.
But, both the Inverters are connected the lower AND gate. The upper AND gate produces AB, as
both inputs are connected directly. Similarly, the lower AND gate produces –A– –B– , because both
inputs are complemented first before going to AND gate. The outputs of both AND gates are given to
OR gate as input. Therefore, these two inputs will be ORed by OR gate and output becomes;
Y = AB + –A– –B–
Y = AB + –A– –B– is a logic expression for EX-NOR gate.
A truth table can be derived for the above circuit, as shown in the table 2.11.
Inputs Output
Table 2.11 A B Y = AB + –A– –B–
Truth table-Exclusive-OR 01
0 10
0
100
111
The truth table for 2-input Exclusive-NOR gate shows that, when both A and B are low or high,
output Y is high. When A is low and B is high or A is high and B is low, the output Y is low. This
means, output is high only when either both the inputs are low or high, and is low when either of the
inputs is high.
Approved by Curriculum Development Centre (CDC), Nepal
Number System and Conversion Boolean Logic Unit 2 … 97.
Therefore, Exclusive-NOR gate can be defined as a logic circuit which produces high output only
when all the inputs are either high or low. When odd number of inputs is high, the output will be
low.
The logical symbol for Exclusive-NOR gate is;
Figure: 2.15 Exclusive-NOR Gate
A
Y
B
Duality Principle
Let us consider two Boolean expressions;
A + 0 = A …..(a)
A.1 = A …..(b)
Expression (a) is an OR operation, and expression (b) is an AND operation. The output result is same in
both the cases, i.e. A. In the first expression, if we replace the OR (+) sign with AND (.), and '0' with '1', we
can obtain expression (b). Similarly, on replacing AND (.) with OR (+), and '1' with '0' in expression (b), we
can obtain expression (a). This is an important property of Boolean algebra, used in advanced
mathematics. This is called Hutington postulate. It has two parts, part (a) and part (b), listed in pairs. The
above discussion shows that, one part can be obtained from the other part if the binary operators and the
identity elements are interchanged. This property of Boolean algebra is called Duality Principle.
Duality Theorem states that, another Boolean relation can obtained from the given Boolean relation by
1. Changing each OR (+) sign to an AND (.) sign
2. Changing each AND (.) sign to OR (+) sign
3. Complementing any '0' or '1' appearing in the expression
Duality theorem is an important and useful theorem because it can be used to obtain a new Boolean
relation.
Some of the Boolean relations and their duals (or new relation after applying duality theorem) are shown
in the table
Boolean expressions Duals
A+B=B+A AB = BA
A (B + C) = AB + AC A + BC = (A + B) (A + C)
A+1=1 A.0 = 0
Table: A+0=A A.1 = A
A+A=A A.A = A
Boolean relations and their A+–A– = 1 A. –A– = 0
duals A + –A– B = A + B A(–A– + B) = AB
A + AB = A A(A + B) = A
–A–+––B =–A– –B– –A––.B– =–A– +–B–
Approved by Curriculum Development Centre (CDC), Nepal
.98 … Computer Science–I
Laws of Boolean Algebra
Boolean algebra is similar to ordinary algebra in many aspects. The two-valued Boolean algebra uses a set
of two elements, 1 and 0, two binary operators '+' and '.' equivalent to AND and OR operations
respectively, and a complement operator equivalent to NOT operation. It can be used to represent the
properties of bistable electrical switching circuits or binary logic. Boolean algebra helps to simplify the
complex Boolean equations to design simpler logic circuits. The basic laws and theorems of Boolean
algebra are;
1. Associative Law
2. Commutative Law
3. Distributive Law
4. Identity Law
5. Complement Law
1. Associative Law
The associative laws are;
With respect to '+': A + (B + C) = (A + B) + C ………. (i)
With respect to '.': A(BC) = (AB)C ………. (ii)
These equations indicate that the order of combining variables doesn't effect the final answer. Fig.
2.16 and 2.17 show that the output in both the cases is same. Therefore, we can change the order of
inputs.
Figure: 2.16 A + ( B + C ) = ( A + B ) + C
A Y = A + (B + C) A A+B Y = (A + B) + C
BB C
C B+C
Figure: 2.17 A(BC)=(AB)C
Truth table of Associative Law
A+(B+C) = (A+B)+C
Input B+C A+(B+C) Result (A+B)+C
ABC 0 0 A+B 0
000 1 1 0 1
001 1 1 0 1
010 1 1 1 1
011 0 1 1 1
100 1 1 1 1
101 1 1 1 1
110 1 1 1 1
111 1
Approved by Curriculum Development Centre (CDC), Nepal
Number System and Conversion Boolean Logic Unit 2 … 99.
2. Commutative Law
The commutative laws are;
A + B = B + A ……….(i) with respect to '+'.
A.B = B.A ………..(ii) with respect to '.'.
These equations show that the order of a logical operation is not important, as the same result can be
obtained either way. If we draw a logic circuits for Left hand side (LHS) and right hand side (RHS) of
equation (i) and (ii) separately, transposing the inputs doesn't change the output as shown in fig. 2.18
and 2.19.
Figure: 2.18 A + B = B + A Figure: 2.19 AB = BA
A A+ B B B +A A AB B BA
A
BA B
Truth table of Commutative Law
A.B = B.A
Input Result
AB A.B B.A
00 0 0
01 0 0
10 0 0
11 1 1
3. Distributive Law
The distributive law is;
A(B + C) = AB + AC ……….(i)
This law shows that by rearranging the Boolean expression, we can simplify the logic circuit as
shown in Fig. 2.20.
Figure: 2.20 A(B + C) = AB + AC
A AB
A A(B + C) B AB + AC
B A
C B+C C BA
Approved by Curriculum Development Centre (CDC), Nepal
.100 … Computer Science–I
Truth table of Distributive Law
A . (B+C) = A.B + A.C
Input B+C A.(B+C) Result A.C A.B+A.C
ABC 0 0 A.B 0 0
000 1 0 0 0
001 1 0 0 0 0
010 1 0 0 0 0
011 0 0 0 0 0
100 1 1 0 1 1
101 1 1 0 0 1
110 1 1 0 1 1
111 1
1
4. Identity Law
The identity law with respect to OR operation states that;
i. A variable ORed with 0 equals the variable. A+0=A
ii. A variable ORed with itself equals the variable. A+A=A
iii. A variable ORed with 1 equals 1. A+1=1
iv. A variable ORed with its complement equals 1. A + A– = 1
Similarly, the identity laws related with AND operation are;
i. A variable ANDed with 1 equals the variable. A.1=A
ii. A variable ANDed with itself equals the variable. A.A=A
iii. A variable ANDed with 0 equals 0. A.0=0
iv. A variable ANDed with its complement equals 0. A . A– = 0
5. Complement Law
The complement law is;
A– = A
The complement law states that the complement of a complement gives the variable. That means, the
double complement of a variable equals the variable. This is also called double inversion.
De Morgan's Theorem
De Morgan's theorem is also related with the simplification of Boolean expression. There are two theorems
of De Morgan. We can also describe the De Morgan's theorems in terms of duality principle.
De Morgan's First Theorem
De Morgan's first theorem states that "the complement of a logical sum equals the logical product of the
complements".
If A and B are two binary variables then according to the first theorem, the logic expression is;
A––+–B = A– –B
In terms of logic circuit, NOR gate can be used to generate complement of sum A––+–B , and bubbled AND
gate can be used to get product of the complements A B as shown in fig.
Approved by Curriculum Development Centre (CDC), Nepal
Number System and Conversion Boolean Logic Unit 2 … 101.
Figure: 2.21 De Morgan's First theorem
A A+B AA AB
B B
B
De Morgan's First Theorem
This theorem can be proved using truth table as shown in table 2.13 below.
A B Y=A––+–B Y = A– –B
Table: 2.13 0 011
0
De Morgan's First 1 100
Theorem
000
1100
From the truth table, we can find that Y = A––+–B and Y = A– –B both have the same value in each row.
Therefore, it proves that the complement of sum is equal to the product of complements.
De Morgan's Second Theorem:
De Morgan's second theorem states that "the complement of logical product equals the logical sum of the
complements". If A and B are two binary variables then according two the second theorem, the logic
expression is;
–A–.–B = A– + –B
In terms of logic circuit, NAND gate can be used to generate complement of product –A–.–B , and bubbled
OR gate can be used to get sum of the complements A– + –B as shown in fig.
Figure: 2.22 De Morgan's second theorem
A A+B AA AB
B B
B
This theorem can be proved using truth table as shown in table 2.14 below.
De Morgan's Second Theorem
A B Y=–A–.–B Y = A– + –B
Table 2.14 0 0 1 1
Truth table 0 1 1 1
1011
1100
From the truth table, we can find that Y = –A–.–B and Y = A– + –B both have the same entry in each row.
Therefore, it proves that the complement of product is equal to the sum of complements.
Venn Diagram
Approved by Curriculum Development Centre (CDC), Nepal
.102 … Computer Science–I
Venn diagrams or set diagrams are diagrams that show all hypothetically possible logical relations
between finite collections of sets. Venn diagrams were conceived around 1880 by John Venn. They are
used to teach elementary set theory, as well as illustrate simple set relationships in probability, logic,
statistics, linguistics and computer science. Venn Diagrams are useful for examining similarities and differences
in characters, stories, poems, etc.
It is frequently used as a prewriting activity to enable students to organize thoughts or textual quotations
prior to writing a compare/contrast essay. This activity enables students to organize similarities and
differences visually.
Venn diagram can also be used in digital logic to describe the Boolean expressions or show the validity of
theorems in digital logic. Venn diagram can be defined as a graphical representation used to describe the
relationship between the variables of a Boolean expression.
Venn diagram uses two graphical symbols; Rectangle and Circle. Each circle represents a variable and
labeled with the name of variable. A circle(s) is/are drawn inside the rectangle, one for each variable.
Circles may overlap with each other. All the points inside the circle belong to the named variable, and all
the points outside the circle do not belong to the variable.
Let's consider a variable a. A circle, labeled a is drawn inside the rectangle as shown in fig. If we take
points inside the circle then it is represented by a, and a = 1. Similarly, if we are outside the circle then it is
represented by a', and
A = 0.
Figure: 2.23 Venn Diagram for one variable
a’
a
Now let's draw two overlapping circles labeled a and b inside the rectangle as shown in fig
Figure: 2.24 Venn Diagram for two variables
ab
ab’ ab a’b
a’b’
Approved by Curriculum Development Centre (CDC), Nepal
Number System and Conversion Boolean Logic Unit 2 … 103.
There are four distinct areas inside the rectangle. They are;
• The area not belonging to a or b i.e. a'b'.
• The area inside the circle a but outside b i.e. ab'.
• The area inside the circle b but outside a i.e. a'b.
• The area inside both circles i.e. the common area ab.
We can draw Venn diagram to represent the logic gates, Boolean algebra, theorems and laws.
Venn Diagram for AND Gate
The logic expression for AND gate is Y = AB. This means "Y equals A AND B". So, we can take the
common area inside both circles as shown in fig.
Figure: 2.25 Venn diagram for Y=AB (AND operation)
ab
ab
Venn Diagram for OR Gate
The logic expression for OR gate is Y = A + B. This means "Y equals A OR B". So, we can take the all the
area inside each circle as shown in fig.
Figure: 2.26 Venn diagram Y = A + B (OR operation)
AB
Approved by Curriculum Development Centre (CDC), Nepal
.104 … Computer Science–I
Venn Diagram for NOT Gate
The logic expression for NOT gate is Y = A– . This means "Y equals NOT A". So, we can take the area
outside the circle. That means all the area other than A, as shown in fig by shaded lines.
Figure: 2.27 Venn diagram for Y = A– (NOT operation)
A'
A
Few more examples of Venn diagram are shown below. Figure: 2.29 (ii) AB + A
Figure: 2.28 (i) A(B + C) AB
BC
A
SUMMARY
Number System Boolean Logic
There are different types of number systems in use, some are Digital computer is based on discrete signal. That means, digital
more common and others are rarely used. Each number system circuits are used for two state operations. For example, a toggle
uses different types and number of symbols, digits, alphabets or switch which has two states 'Open' or 'Closed' is an example of
some other representation mechanism. The total number of digital operation. When the switch is ON, then it is in one state,
symbols or digits in a number system is called a radix or base. The and when OFF then it is in another state. The ON state and OFF
base or radix indicates the total number of possible digits or state can have some values below or above the reference level.
symbols in a number system. For example; decimal number
system is known as base ten systems because it uses ten different Boolean Algebra,
digits from 0 to 9. Depending upon the position of a digit in a
number, the value it represents also varies. The position of an Logic circuits can be used to represent two state operations. Two
individual digit in a number is called its weight. For example; in state operations such as True or False? Yes or No? Right or
decimal number 123, the weight of 3 is 100(=1), of 2 is 101(=10) Wrong? Good or Bad? High or Low? In or Out? are some
and 1 is 102(=100). examples of digital operation. These questions have some kind of
logic. There is close relationship between logic and Boolean
algebra. Boolean algebra is an algebra developed by George
Boole (1854) and is used to represent the two state operations.
The Boolean algebra can be used to analyze and design computer
Approved by Curriculum Development Centre (CDC), Nepal
Number System and Conversion Boolean Logic Unit 2 … 105.
circuits. Generally, every digital circuit has two or more than two values in the form of true or false. George Boole created Boolean
inputs and only one output. Algebra, which is the basis of all modern computer arithmetic.
There are only two Boolean values. They are True and False.
Truth Table and Boolean Expression,
Laws of Boolean Algebra,
Digital circuits have input and output variables. Each variable may
have either low or high value. These input and output variables Boolean algebra is similar to ordinary algebra in many aspects.
and their possible combinations can be shown using a table. This The two-valued Boolean algebra uses a set of two elements, 1 and
table which shows all the possible relationships and combinations 0, two binary operators '+' and '.' equivalent to AND and OR
of input and output variables is called 'truth table'. Since the digital operations respectively, and a complement operator equivalent to
circuits are used for two state operations, binary 1 or 0 can be NOT operation. It can be used to represent the properties of
inserted in the table. The table contains columns and rows. bistable electrical switching circuits or binary logic.
Boolean Values and Boolean Functions,
The storing true and false value is called bool, named after the
British mathematician, George Boole. Bool is a data type that store
EXERCISE
Short Answer Questions
1. Define number system.
2. How number system categorized?
3. Define binary number system.
4. Define hexadecimal number system.
5. Why binary number system used in computer?
6. Define radix.
7. Why octal number is used instead of binary number system in computer.
8. Define Boolean algebra.
9. Define NOT, AND, and OR operation in Boolean.
10. Define truth table.
11. Define Boolean expression.
12. Define Boolean values.
13. Define functions.
14. Define logic gate.
15. What do you mean by basic gate?
16. Define universal gate.
17. Define derived gate.
18. Convert (513)10 number to (?)2 number system.
19. Convert (DAD)16 number to octal equivalent number.
20. Convert (ABC)16 number to binary equivalent number.
21. Convert (356)8 number to hexadecimal equivalent number.
22. Perform the following:
a. 11111 – 10001 b. 1111+1111
Approved by Curriculum Development Centre (CDC), Nepal
.106 … Computer Science–I
Long Answer Questions
1. Define and explain computer arithmetic calculation.
2. Write steps to convert decimal number to binary number using remainder method.
3. Write steps to convert decimal fraction number to binary fraction number.
4. Write steps to convert binary number system to decimal number system.
5. Write steps to convert binary number to octal number by using direct method.
6. Write steps to subtract binary number by using 1’s complements method.
7. Write steps to subtract binary number by using 2’s complements method.
8. Subtract (110)2 from (101)2 by using 1’s complement method.
9. Subtract (101)2 from (110)2 by using 2’s complement method.
10. Convert (0.25)10 to (?)2 number system.
11. Define and explain Min term using truth table.
12. Define and explain Max term using truth table.
13. Explain different logic gates with truth table.
14. Briefly explain the laws of Boolean algebra.
15. Explain De Morgan’s theorem using truth table.
Activities
1. Draw the NAND and NOR gates using paper board.
2. Take two variable give different input to the OR gate simulator, observe output in each input
and plot Truth table. Likewise other gates too.
■■■
Approved by Curriculum Development Centre (CDC), Nepal
Computer Software
& Operating System
LEARNING OBJECTIVES
After studying this chapter, the students will be able to understand to:
Computer is a complex system having two distinct components H/W and S/W that is clearly
........ understood up to this point. In this unit S/W and their classification, role, importance, brief ..........
etymology, interface (CUI and GUI), creation of files and folders, customizing taskbar and
..
desktop, installing and removing of utilities and apps, protecting and providing basic security
measures, concepts of open source and mobile OS will have knowledge at the end of this unit.
.108 … Computer Science–I
SOFTWARE AND ITS CLASSIFICATION
A computer cannot do anything on its own. It must be instructed to do a job desired by user. Hence, it is
necessary to specify a sequence of instructions a computer must perform to solve a problem. Such a
sequence of instructions written in a language understood by a computer is called a computer program. A
program controls a computer’s processing activity, and the computer performs precisely what the
program wants it to do. When a computer is using a program to perform a task, we say, it is running or
executing that program.
The term software refers to a set of programs, procedures, and associated document describing the
programs, and how they are to be used. Software is an important component of a computer system.
Without software, a computer is of no use because it is a processing device. It means, it is a life of
hardware components. Based on the use, the software can be system software, application software,
language processor and different types of utilities programs.
Figure: 3.1 Software and its Classification
Software
System Software Application Software
Operating Language Device drivers and General Purpose Specialist Customize
System Processer utilities software Software Software
Assembler Interpreter Compiler
Types of Software
Although the range of software available today is vast and varied, most software can be divided into two
major categories:
1. System software
2. Application software
Figure: 3.2 Software
Application Software
System Software
Hardware
System software
System software is a set of one or more programs designed to control the operation and extend the
processing capability of a computer system. In general, a computer’s system software performs one or
more of the following functions:
Approved by Curriculum Development Centre (CDC), Nepal
Computer Software and Operating System Unit 3 … 109.
1. Supports development of other application software.
2. Supports execution of other application software.
3. Monitors and manages effective use of various hardware resources such as CPU, memory,
peripherals, etc.
4. Communicates and controls different peripheral devices such as printers, disk, tape, etc.
Hence, system software makes the operation of a computer system more effective and efficient. It helps the
hardware components work together, and provides support for the development and execution of
application software. The programs included in a system software package are called system programs.
The programmers who prepare system software are referred to as system programmers. Sometime, the
system software indicates simply an operating system.
The system software can also be divided into different types. The most commonly known system software
are: operating system, language processors and utility programs.
1. Operating system: The operating system is system software that is stored on secondary storage
device such as hard disk, CD-ROM, floppy disk (or in ROM). When a computer is switched on, the
operating system is transferred from the storage device into main memory through BIOS ROM
program. The handheld devices have the entire operating system in the ROM chip. This type of ROM
based operating system is difficult to update.
An operating system is a link between hardware, application software and the user. An operating
system controls and co-ordinates the overall operations and resources of the computer system. It
manages the computer hardware, controls the execution of application programs and provides the
set of services to the users. The operating system acts as an interface between user and the computer.
The users interact with the operating system indirectly through application program. For detail on
operating system, please refer to next heading of this unit.
2. Language Processors: We know that the computer understands instructions in machine code only, i.e.
in the form of 0s and 1s. It is difficult to write computer program directly in machine code. Nowadays,
the programs are written mostly in high-level languages, i.e. BASIC, C, PASCAL, etc. A high level
language uses English like syntax, and a program written in any high-level programming language (or
written in assembly language) is called the Source Program. The source code cannot be executed
directly by the computer. The source program must be converted into machine code to run it on the
computer. The program translated into machine code is known as Object Program or object code.
To convert a source code into object code, we need a language processor, also known as translator.
Every programming language has its own language processor. Therefore, language processor is
defined as "a programming language converter that converts the instructions prepared by
programmers in a programming language into a form that can be understood, interpreted and
executed by a computer system". The language processors are divided into three types.
1. Compilers 2. Interpreters 3. Assemblers
1. Compiler: The language processor that translates the complete source program as a whole in
machine code before execution is called compiler. The C and C++ compilers are best examples
of compilers. (For more detail on compiler, please refer to unit 5)
2. Interpreter: The language processor that translates (converts) each statement of source program
into machine code and executes it immediately before to translate the next statement is called
Interpreter. If there is an error in the statement the interpreter terminates its translating process at
that statement and displays an error message. (For more detail on interpreter, please refer to unit 5)
3. Assembler: An assembler is third type of translator program. It is used to translate the program
written in Assembly language into machine code. An assembler performs the translation
Approved by Curriculum Development Centre (CDC), Nepal
.110 … Computer Science–I
process in the same way as compiler. But assembler is the translator program for low-level
programming language, while a compiler is the translator program for high-level programming
languages. (For more detail on assembler, please refer to unit 5)
3. Utility program: Utility programs are a set of programs that help users in system maintenance tasks,
and in performing tasks of routine nature. These utility programs are the part of operating system
which enhances the performance of the OS and the system to its optimum.
Utility programs assist users in system maintenance tasks, such as defragmentation, disk formatting,
data compression, data backup, and scanning a system for computer viruses. Some frequently used
utility programs are:
1. Defragmentation Utility: With the use of defragmentation the used space and unused space
remains one and another side, due to this one large unused space form and can store large file
easily.
2. Disk Formatting Utility: To use a new disk on a computer system, we need to format it according
to the requirements of the computer’s operating system. Disk formatting utility enables users to
perform this task with great ease.
3. Data Compression Utility: This utility uses a compression algorithm to transform files into a
fraction of their normal size, so that they occupy less storage space on disk, or can be transferred
across a network in less time. It has an associated decompression algorithm used to convert a
compressed file into its normal form and size when accessed by a user. It helps in significant
saving of disk space – it can effectively double the capacity of a disk.
4. Data Backup Utility: Data stored in a computer system can be damaged or lost in several ways
such as crash, virus, hardware malfunctioning, accidental deletion of files, or natural disasters
like fire, earthquake, etc. Hence, we must always keep extra copies of important data. A backup
utility enables creation of copy of data on some storage media, such as floppy disk, CD, pen
drive, or magnetic tape. The storage media with backup data is often stored off-line away from
computer system to prevent loss of critical data due to natural disasters. When some data stored
online is damaged or lost, it can be restored from backup media. It is not necessary that backup
media is always kept off-line. In today’s era of computer networks, some backup devices are kept
online at a place away from main computer system and data backup on this device is done
automatically by the computer system.
5. Antivirus Utility: Computer virus is a piece of code attached to a program or files that when
executed, infects other programs in a system by replicating and attaching itself to them. In
addition to this replicating effect, a virus normally does some other damage to the system, such as
corrupting/erasing files. Therefore, due to its spreading nature, a virus can cause severe damage
to a system.
When a computer system suffers from virus infection, it has to be cured. Antivirus utilities are often
used to cure a computer from virus infection. These utilities first identify the type of virus that
has infected the computer by matching its marker against markers of well known viruses. Once
the type is known, original programs are restored from their infected versions by applying a
detailed knowledge of the infection method used by the virus.
Application software
Application software is a set of one or more programs designed to solve a specific problem, or do a specific
task. Application programs are for executing the user tasks. For example, payroll processing software,
banking software, computer games etc. Similarly, a program written by a scientist to solve a research
problem is also an application software. The programs included in an application software package are
called application programs. The programmers who prepare application software are referred to as
application programmers.
Approved by Curriculum Development Centre (CDC), Nepal
Computer Software and Operating System Unit 3 … 111.
There are literally thousands of application software available for a wide range of applications. They range
from simple application such as word processing, inventory management, banking, hospital management
etc to complex scientific and engineering application such as weather forecasting, space shuttle launching,
oil and natural gas exploration, design of complex aircrafts, etc.
While an operating system makes the hardware run properly, application software make hardware do
useful work. Application programs are specially prepared to do certain specific tasks. Application
software can be divided into two categories. The categories of application software are:
1. Standard Applications Package (Software)
2. Specific or Customized Applications Package (Software)
1. Standard Applications Package (Software): Some applications are common for all. These are ready
to use software packages and are available from hardware and/or software vendors. Microsoft office
package is one of the best examples of standard application package, because MS Word, Excel,
PowerPoint etc are same all over the world. There is no need to modify the application according to
individual need, as same package can be used by all to perform their task. These are a kind of general
purpose applications.
2. Specific or Customized Applications Package (Software): The software developed to meet
individual needs is called customized or unique software. These are called unique because an
individual program can be developed to suit one's own requirements. These are also called tailored
software. The same program can't be used by others to perform their task. The software used by NEB
to process the students result is an example of customized software
Some commonly known application software are:
1. Word-Processing Software: Word processing software enables us to make use of a computer
for creating, editing, viewing, formatting, storing, retrieving, and printing documents.
2. Spreadsheet software: Spreadsheet software is a numeric-data analysis tool that allows us to
create a kind of computerized ledger. Mathematical calculation of large amount of data can be
process by using formulas and functions within a minute.
3. Database Software: A database is a collection of related data stored and treated as a unit for
information retrieval purposes. Means information are manage such a way that whenever need
can accessed within no time easily and efficiently.
4. Presentation Software: Presentation software is a presenting tool which is used to create slide,
animation on text and made transition on slide.
5. Entertainment Software: Entertainment software allows a computer to be used as an
entertainment tool. Computer video games belonging to this category of software.
Difference between hardware and software
Hardware Software
1. Hardware is a physical device. 1. Software is a code (instruction).
2. Hardware forms structure of a computer 2. It gives life to hardware component.
3. Hardware is generally multi-purpose, in the 3. Most software is designed to perform only
sense that a variety of different tasks can be one task, or a few similar tasks.
performed on the same piece of hardware.
4. It can be seen and touched. 4. It cannot be seen and touched.
5. Hardware is independent of software. 5. Software is depends on hardware.
6. According to their function, they are input, 6. They are system and application software.
output, processor, and memory.
7. For example, Mouse, Monitor, and Hard disk 7. For example: OS, Word processor,
etc Photoshop etc.
Approved by Curriculum Development Centre (CDC), Nepal
.112 … Computer Science–I
Web based application
Web-based applications are a particular type of application software that allows users to interact with a
remote server through a web browser interface. They have seen a huge increase in popularity in recent
years, replacing desktop applications and becoming a crucial instrument for small and large businesses
around the world.
Web-based applications have a number of advantages over traditional desktop apps, most prominently
their portability. With web-based apps, users don’t have to install additional software, and developers
don’t have to write multiple versions of the same application for different operating systems. Web apps
work on any device that can run a supported browser and has an active Internet connection throughout
interconnection system. A single web-based application that will be run on a server and fulfill all the
requirements. The app can be written in various programming languages and make use of multiple
technologies and frameworks. A web-based application will run on the client computer’s browser no
matter what operating system is installed. This makes web-based apps one of the most universal cross-
platform solutions available today.
The web apps can be in any form:
• Static web application.
• Dynamic web application.
• E-commerce
• Portal web app.
• Content Management System (CMS).
The examples of Web applications can be online forms, shopping carts, word processors, spreadsheets,
video and photo editing, file conversion, file scanning, and email programs such as Gmail, Yahoo and
AOL. Popular applications are Google Apps and Microsoft 365.
Advantages of Web-Based Applications
• Web-based apps are cross-platform and universally accessible.
• Web-based applications allow you to invest less money in software development.
• Web-based applications are highly scalable.
• Web-based apps are great at storing your data.
• Web-based apps are secure.
• Web-based apps deployment is easy, cost-effective, and fast.
• Web-based applications are easy to update and maintain.
Mobile apps
A mobile application (also called a mobile app) is a type of application designed to run on a mobile
(portable) device, which can be a smart phone or tablet computer. Even if apps are usually small software
units with limited function, they still manage to provide users with quality services and experiences. This
type of apps is isolated instead of integrated application software system.
Because of the limited hardware resources of the mobile devices, mobile apps avoided multi-functionality.
However, even if the devices used today are far more sophisticated, mobile apps remain narrowly
functional.
Approved by Curriculum Development Centre (CDC), Nepal
Computer Software and Operating System Unit 3 … 113.
Mobile apps generally develop either native, web or hybrid technology. Mobile apps can be gaming,
business, educational, lifestyle, m-commerce, utility, entertainment, travel etc.
The example of most used and downloaded Apps:
• Facebook.
• Facebook Messenger.
• WhatsApp Messenger.
• Instagram.
• Snapchat.
• Skype.
• TikTok.
• UC Browser etc.
OPERATING SYSTEM
A Brief Operating System History (Etymology)
Initially computer was evolved from the simple calculating device to mechanical to electro-mechanical to
electronic device. From the beginning to 1950s devices were operated by the human operator. Because of
increased complexity on electronic devices and difficult to cope with complexity electronic components the
concept of program introduced to operate the system after wards operator named as an operating system.
In order to find the first operative systems we must travel to the decade of the 50s’ of the 20th Century.
Previously, during the 1940s, programs were introduced directly onto the machine hardware through a
series of micro switches. In the 1950s some technologies emerged that allowed a more “simple” interaction
between the user and the mainframe and specialized computers.
1. Resident monitor: this is a system that loads the program into the computer, reading it from a tape
or punched cards. This technology gave rise to the first operating system in history, created in 1956
for an IBM 704 computer, which was responsible for loading programs successively (starting with the
next one when the previous one had finished loading), reducing the work time required.
2. Temporary storage: this is a system that also tried to increase speed by simultaneously loading
programs and executing tasks.
In the 1960s, the rise of the integrated circuit launched the power of computers, and operating
systems responded by becoming increasingly complex and offering new techniques.
3. Multiprogramming: In this technique, the main memory already holds more than one program, and
the operating system is responsible for allocating the machine’s resources to execute tasks based on
existing needs.
4. Timeshare: This is a system that assigns the execution of applications within a group of users
working online.
5. Real time: It is used specially in the area of telecommunications, it is responsible for processing
events external to the computer, so that, once a certain time has passed without success, it considers
them as failed.
6. Multiprocessor: these are systems that try to manage the readings and writings made in memory by
two programs that are running simultaneously, in order to avoid errors. As their name suggests, they
are designed for use in computers that use more than one processor.
Approved by Curriculum Development Centre (CDC), Nepal
.114 … Computer Science–I
In the 1970s, IT continued to become increasingly complex, resulting in the first versions of some of
the operating systems that have served as the basis for many of the ones we use today, such as UNIX.
The operating systems of this decade are still available only to highly qualified users, and their
complexity means that they consume a large amount of resources. Among the most outstanding, in
addition to UNIX, we find MULTICS, BDOS and CP/M, widely used in computers with Intel
microprocessor.
The 1980s gave rise to the boom in commercial computing. The arrival of computers in thousands of
offices and homes changes the focus of operating systems, forcing the development of more user-
friendly systems that introduced graphic elements such as menus.
In this decade the development is such that it gives rise to some operating systems already
legendary, and that contribute to the rise of computing in later decades, such as C++, SunOS
(developed by Sun Microsystems and derived from UNIX), AmigaOS (developed for the
Commodore Amiga) and some classics such as these:
7. MS-DOS: Developed by Microsoft for IBM PCs, which contributed enormously to the popularization
of computing and gave rise to Windows systems.
8. Mac OS: A system of Macintosh computers developed by Apple Inc, launched in 1984, and which
included a novel graphic interface and the use of the mouse (a rarity at that time for users that were
used to typing commands). The decade of the 90’s continues with the explosive line marked in the
80’s, giving rise to many of the operating systems that, in more modern versions, we use today.
9. GNU/Linux: It was developed based on UNIX, and which is one of the greatest exponents of free
software. Today, GNU/Linux (Ubuntu) is widely used all over the world, having a pre-eminence
close to 100% in fields as striking as supercomputers.
10. Solaris: Also developed on UNIX base by Sun Microsystems for servers and workstations.
11. Microsoft Windows: Which has resulted in a popular family of commercially successful operating
systems used by millions of users around the world? Examples MS Windows started from Win 1.0 to
latest MS Windows 10.
12. In the first decade of the present century, new operating systems continue to succeed each other,
perhaps with less impact than those that emerged in the previous decade, but have their own place.
Highlights include SymbOS, MorphOS, Darwin, Mac OS, Haiku and OpenSolaris.
13. Presently now we are in the current decade, in which the rise of phones gives rise to some popular
operating systems, including Android, developed by Google or iOS, created by Apple.
The operating system history is relatively short, but it has been very intense in 2nd decades of 21st century.
Introduction to Fundamental Concept of Operating System
In simple terms, an operating system is the "executive manager", the part of computer system that
manages all of the hardware and all of the software. The operating system is the core software component
of any computer. It is also called system software that is stored in the memory of the computer. When the
computer is switched on, the operating system is loaded into the main memory through ROM program.
Once loaded, it runs all the time. It manages the resources of the computer system and schedules its
operation. It is an interface between the computer and the outside world including user. It also provides
platform and facilitates the execution of other programs. The user interacts with the OS through the
application program. Operating system is a prerequisite to operate the computer. That means we can not
run the computer without an operating system. It checks the status of every component of computer and
the peripheral devices, and links peripherals with the computer.
Approved by Curriculum Development Centre (CDC), Nepal
Computer Software and Operating System Unit 3 … 115.
On the one hand, an 0S maximizes the productivity of computer system by operating efficiently, and on
the other hand it minimizes the human intervention by managing all the resources and avoiding the
conflict between applications and resource allocation. In short, an operating system controls every file,
every device, every section of main memory and every fraction of processing time. It manages who can
use the system and how. Therefore, it is the boss.
Figure: 3.3 The OS and its four sub-systems
Process Manager Memory Manager
File Manager Device Manager
An operating system is usually available with hardware manufacturers. Computers are built from wide
variety of microprocessor chips and each chip may use different operating system. Similarly, the
architecture of computers developed by different manufacturers may also be different, and use different
operating system. Therefore an OS that runs on one computer may not run on the other. There are
different types of operating systems available in the market depending on the type, purpose and use of
computers such as single user OS, multi-user OS, command based (eg. DOS), graphics based (eg windows
XP, Vista,10), OS/2, UNIX, ZENIX, CP/M etc.
Generally, an operating system can be divided into two parts;
Resident part: This is a core part of an OS and contains critical functions. This part is called kernel. The
kernel portion of OS is loaded into the main memory during the booting process, and performs the entire
task residing there.
Non-resident part: This part of OS remains in hard disk and loaded into main memory whenever
required.
Role of Operating System
It is clear from the introductory part of OS that an operating system is an important and fundamental
prerequisite to operate a computer. OS provides life to a computer, which in the absence of an OS is just
like a dead body. A computer consists of several components and peripherals including printer, monitor,
keyboard, mouse, and other parts. The operating system provides an interface to these parts using "device
drivers". It coordinates and controls the overall components and operation of computer. It manages all the
resources including hardware and application programs, and provides a set of services to the users.
User gives instructions to the computer using application programs. But the application program can not
directly access the peripheral devices, memory or execute instruction. Therefore, an OS performs all these
tasks on behalf of an application program. The role of operating system can be better understood with the
following tasks that an OS can perform.
• Accept input from users through input devices.
• Send output to output devices.
• Communicate the message from the system to the user through the VDU.
• Help in the loading of programs and data from external sources into the internal memory before they
are executed.
Approved by Curriculum Development Centre (CDC), Nepal
.116 … Computer Science–I
• Store and manage the files and applications on the memory.
• Monitor, control, coordinate and manage the resources including peripheral devices.
• Help user develop programs.
• Deal with faults and inform the operator etc.
• Platforms for the other application programs.
When the computer starts, it starts the operating system that takes control of the machine. An Operating
System is a set of programs that help in controlling and managing the hardware and the software
resources of a computer system. A good operating system should have the following features;
1. Help in the loading of programs and data from external sources into the internal memory before they
are executed.
2. Help programs to perform input/output operations, such as;
• Print or display the result of a program on the printer or the screen.
• Store the output data or programs written on the computer in storage device.
• Communicate the message from the system to the user through the VDU.
• Accept input from the user through the keyboard or mouse.
Functions of an Operating System
As mentioned earlier, an OS manages all the operations of the computer and performs many functions;
such as finding the status of different components and connecting them with the CPU to managing
resources and executing instructions. We may not be aware of the many functions of an OS, but, still it
helps us to navigate computer more easily, manage programs and work with computer system itself.
An operating system performs, basically three types of functions;
• Essential Functions: Storage management and processor management are two essential functions of
an operating system.
• Monitoring Functions: These functions are concerned with collection of resource utilization and
system performance information.
• Service Functions: The functions of operating systems that enhance facilities provided to users is
called service function.
In general, the major functions of an OS can be described as follows;
1. User Interface: The operating system acts as an interface between user and the computer hardware.
An OS provides a platform on top which application programs can run. The user interacts with the
OS through application programs. Interface is the gateway into the computer which enables the
human computer interaction. We can run spreadsheet, open document, enter data or print report.
These are examples of user interface. There are two types of interface; command-line user interface
and Graphical user interface.
2. Resource Management: OS efficiently manages and allocates computer resources such as CPU,
memory, main and secondary storage space, input and output devices, to different jobs. Resources
can be memory, input devices, output devices, CPU etc.
3. Memory Management and virtual storage: Computer memory is generally arranged in hierarchy
with the fastest memory near the cpu and the slowest one farthest from CPU. The OSs memory
manager coordinates the use of these different types of memory by finding out which memory is
available, which is to be allocated and which one to be de-allocated, and to which process, when and
how to move data between them. Similarly, the OS manages the virtual memory by swapping the
programs between the main memory and secondary memory, when the primary memory capacity
becomes low to accommodate the large files.
Approved by Curriculum Development Centre (CDC), Nepal
Computer Software and Operating System Unit 3 … 117.
4. Process Management: It is one of the important functions of an OS. Every program running in a
computer, whether it is on the background or foreground, is a process. Generally a single program
can be executed by a CPU. But, in multitasking system time can be shared among more than one
process or in multiprocessing system more than one program can be executed by more than one CPU
in parallel. The operating system takes care of allocating single cpu time to different processes or
different processes to different CPU's efficiently.
The OS determines the orders in which the processes are executed when there are more than one
processes exist. Generally the processes are executed based on first come first serve (FCFS) principle.
But, sometimes, one process may have higher priority than others. In such cases, the OS needs to
decide and schedule the sequence of execution of processes.
5. Input-output Management: The OS also manages the input to and output from computer system.
User and application programmes use device manager of OS to deal with input and output devices.
It coordinates, controls and assigns the input and output devices to different programmes being
executed. Moreover, the basic task of recognizing the input from keyboard, mouse and sending the
output to the display screen, printer etc and controlling peripheral devices is performed by an OS.
6. File Management: Disk and file management is another important function of an OS. The OS helps
in creating folders, sub-folders and files, moving files, organizing files within the hierarchy of
directory or folders. An OS keeps track of all the folders, sub folders and files. This type of
systematic and tree like hierarchical organization helps to search and find the files quickly. The OS
also keeps track of different disk drives by assigning names (such as C, D) to them. The OS also helps
in de-fragmenting the memory, efficiently managing files and freeing the memory.
7. Networking and internet connection: There are different types of network operating systems that
are used to run the networks. These systems manage and coordinate multiple users, and help access
and share computer resources and data.
Even, the simple operating systems like windows XP can use TCP/IP networking protocols. They
can support connecting one computer with the other. This helps one system appearing on a network
of other the other and share resources such as printer, files, scanners etc. This feature also allows the
user to connect their computer to the internet and browse the web, search and download materials.
8. Protection and Security: Security of computer system, data stored on it and the network security are
emerging as critical issues. Therefore, every OS is supposed to provide security to computer system,
data, users and programmers. The OS can allow and disallow the access from other system, provide
user accounts, password and encryption facility to protect the system. This prevents the
unauthorized intrusion and use by any irrelevant person and provides security.
9. On-line Processing: When the computer system is on-line, and the program that processes the data is
available continuously in the internal memory, then the on-line processing can be used. In this, the
program instructions are executed instantaneously as and when the data is entered into the system.
The inventory control, airline reservation, and banking systems are some of the examples of on-line
processing. Here, the request will be instantaneously processed by the on-line software and the reply
will be sent within few seconds. The operating systems having online processing capability also have
multi-user and multitasking capabilities.
10. Task Management: A computer can perform many tasks at a time. For example, in word processing
it accepts input data, stores data on the disk and prints out a document simultaneously. Some
operating systems can handle more than one program at the same time. For example, we can
download information from the Internet, listen song, print a document through word processor,
Approved by Curriculum Development Centre (CDC), Nepal
.118 … Computer Science–I
enter data into a worksheet etc. Each program is displayed in a separate window on the screen. The
operating system manages all these tasks. A task is the one which is executed such as storing,
printing or playing song etc. Some operating systems have single user functionality and can support
only one user at a time.
The operating system provides for several other functions including:
• System tools (programs) used to monitor computer performance, debug problems, or maintain parts
of the system.
• A set of libraries or functions which programs may use to perform specific tasks especially relating to
interfacing with computer system components.
Booting, buffering and spooling, and virtual management functions are also solely accomplished by an
operating system. Therefore, these functions of an OS are also explained here.
Operating system terminologies
Based on how operating system process and handle the data and task request, some of the
terminologies are briefly discuss below. These terminologies are also discussed under the types of
operating system based on processing method.
Multiprogramming OS
A multiprogramming technique is used in the multi-user environment. It is the technique in which
multiple users programs are executed simultaneously by single processor or parallel by multi processor.
Multiprogramming means when two or more programs are provided to the CPU for processing or loaded
into the internal storage of CPU at the same instant concurrently. It means concurrent execution of several
programs at a time.
Figure: 3.4 Software
Program A Run Wait Run Wait
Program B Wait Run Wait Run Wait
Program C Wait Run Wait Run Wait
Run Run Run Wait Run Run Run Wait
AB A B
Combined
Time
Programming with three programs
Multitasking operating system
Multitasking means more than one task at a time. That means a multitasking OS allows more than one task
to be executed concurrently mainly in single user system. Sometimes, multitasking and multiprocessing
are used interchangeably, as both of them allow more than one concurrent tasks to exist. But, the
multitasking operating system uses only one CPU while the multiprocessing system uses more than one
CPU. Multitasking can also be of different types, such as time-slice multitasking, context switching or
cooperative.
Approved by Curriculum Development Centre (CDC), Nepal
Computer Software and Operating System Unit 3 … 119.
Figure: 3.5 Software
Browser Excel Paint Media Player
Process Process Process
Process
Operating SystemProcess
CPU
Multitasking
In time-slice multitasking the CPU time is shared among the multiple tasks. A fraction of second of CPU
time is provided to each task and the CPU switches from one task to another quickly, and gives the
impression of executing all the programs concurrently. The tasks are executed in round robin fashion or
on some priority basis. This is also called preemptive multitasking.
Another form of multitasking is called cooperative multitasking. This form of multitasking allows each
program to seize the CPU for as long as it needs it. However, if a program is not active currently, then it
will allow another program to use CPU time temporarily during the idle period of foreground program.
When multiple programs are running, one will be in foreground called the active window and others will
be on the background. When the foreground program doesn't use the CPU, it can allow the background
window to use the CPU temporarily.
Similar to cooperative multitasking, context switching multitasking allows the user to switch between
foreground and background programs. The user can switch the active foreground program to the
background and bring the background program to the foreground and make it active. OS/2, Windows 98,
Windows NT, windows XP and UNIX use preemptive multitasking, whereas Microsoft Windows 3.x and
the MultiFinder in Mac computers are cooperative multitasking.
Multiprocessing operating system
As mentioned earlier, a multi processing system consists of more than one CPU. It means each CPU can
run separate programs at the same time. Hence, the operating system that supports multiprocessing
system allows the computer to execute more than one program concurrently. This makes the processing
very fast. But they are more complex because the system needs to allocate the resources to competing
processes efficiently. Multiprocessing is also called parallel processing. MVS, UNIX and OS/2 are
multiprocessing operating systems.
Approved by Curriculum Development Centre (CDC), Nepal
.120 … Computer Science–I Figure: 3.6 Software
CPU - 1
CPU - 2 CPU - 3 CPU - 1
Main Memory
Input/ Output Input/ Output
Multithreading operating system
The operating system that allows different parts of a single program, called threads, to be executed
simultaneously. Similarly, in multithreading, a running program can start the execution of another part or
program before completing its own execution. The new program, called child program, can also initiate
another child program and so on. The child programs are called threads and the first program that starts
other programs is called parent. The execution of the parent program will be completed only after the
completion of execution of all the child programs. The care must be provided while developing the
program in such a way that different threads run concurrently without interfering with each other.
Figure: 3.7 Software
registers
Code Data Files Code Code Code
Register Stack reg... reg... reg...
stack stack stack
thread
thread
Single Threaded Process Multi Threaded Process
Distributed OS
It is the operating system which runs on multiple, independent CPUs. An operating system designed to
work in a network. More complex than a centralized or decentralized architecture, each computer in a
distributed system operates and scales independently but is part of the whole. An inter-process
communication (IPC) is designed to share data and resources as efficiently as possible.
Approved by Curriculum Development Centre (CDC), Nepal
Computer Software and Operating System Unit 3 … 121.
Distributed OS system consists of various autonomous interconnected computers communicate each other
using a shared communication network. The autonomous systems possess their own memory unit and
CPU. It is referred as loosely coupled systems or distributed systems.
It is running on the different computers act like a single OS. Process does not need to know that other
resources/processes are at other computers. There is only one interface to all resources in the network. The
regular program can be made to run in a distributed fashion. It is operating systems which model where
distributed applications are running on multiple computers, linked by communications. Resources are
sharing among the distributed system. Loads are balanced and failure of any individual system will not
create problem of smoothly running distributed system.
Figure: 3.8 Distributed Operating System (DOS)
Machine A Machine B Machine C
Distributed applications
Distributed operating system services
Kernel Kernel Kernel
Network
Booting
An operating system is the most essential system software that manages the operations of a computer. The
computer is a useless dead machine without essential software that makes it ready to use. Therefore, we
can't use the computer without an operating system. An operating system is a system software which
makes the computer ready to use by a process called 'booting'.
Whenever we switch on the computer, the instructions stored in the primary memory ROM are
automatically executed. The instructions in the ROM help to load the operating system from external
storage (eg. hard disk) to internal storage (primary memory i.e. RAM). This process of loading the
operating system into primary memory from the secondary memory is called booting. Booting process is
shown in fig. 3.2.
Figure: 3.9 Loading of Operating System (Booting)
Switch on the Computer
Automatic Execution of
Instructions stored in ROM
Hard RAM
Disk
There are two types of booting;
1. Cold Boot - When the computer is switched on for the first time, the booting process is called Cold
Boot.
2. Warm Boot - The process to restart the computer that is already powered on is called Warm Boot,
such as pressing Reset switch to restart the computer or press Ctrl + Alt + Del.
Approved by Curriculum Development Centre (CDC), Nepal
.122 … Computer Science–I
Buffering and Spooling (Simultaneous Peripheral Operations on Line)
CPU is a faster device, while the input/output devices are relatively slower. Therefore, when an
input/output is occurring, the CPU is idle, waiting for the input/output to complete; while the CPU is
executing input/output devices are idle. This resulted in reduced throughput and resource utilization. To
overcome this, the input/output and processing operations can be overlapped. The overlapping of
operations can be implemented by using buffering and spooling. Buffering and Spooling are two
approaches used to increase the system performance.
Buffering
It is a method of overlapping input, output and processing of a single job. After data has been read and the
CPU is about to start operating on it, the input device starts to input next data immediately. The CPU and
the input device are then both busy simultaneously. Once the CPU completes its processing, it starts
processing newly read data, while the input device starts to read the following data. Similarly, it can be
done for output device as well. In such cases, the CPU is faster and output device is slower. So, the output
device may not be able to process the job immediately. Therefore, CPU creates data that is put into a buffer
until an output device becomes free and accepts it. A buffer is a temporary storage area in memory, which
is used to place data creating while input/output take place.
Spooling
Sometimes, a device is busy in processing a job and another job is sent to that device. For example, three
documents are sent to printer but the printer can print only one document at a time. In this case, the
operating system places the other documents in buffers. In this case, operating system uses buffers with
print jobs. This process is called Spooling. Therefore, SPOOLING is a more sophisticated form of
input/output buffering which essentially uses the disk as a very large buffer for reading and storing
output files. Spooling is a technique employed in third generation operating system in which an operating
system uses buffers (a segment of memory) to place data before transferring it from or to low speed
input/output devices. This is done because sometime earlier data is being processed while the new data
arrives. Instead of writing directly to a printer, for example, outputs are written to the disk. Programs can
run to completion faster, and other programs can be initiated sooner when the printer becomes available,
the outputs may be printed.
The major distinction between buffering and SPOOLING is that, buffering overlaps input, output and
processing of a single job whereas input of one job is overlapped with the processing and output of other
jobs. Therefore, Spooling is considered better than buffering. Multiple print jobs are arranged in a queue in
the buffer. This new data can now be placed in a buffer, which will be fed to the printer later on whenever
the printer completes its previous job.
Virtual Memory
Some operating systems use virtual memory to manage multiple programs simultaneously. Virtual
memory is actually a portion of secondary storage like hard disk, which is linked with real memory (i.e.
RAM). Thus a greater memory space becomes available to run programs. This increases the speed of
computer and user can run programs, which are larger than actual RAM space. Virtual memory is a
memory management technique which splits a large program into number of pieces and swaps those
pieces between secondary memory and primary memory. This technique helps to fit large programs into
the small primary memory. The operating system keeps those parts of the program in the primary
memory which is required during execution and the rest on the disk. The size of the programs and data
may be larger than the size of physical memory (RAM). Therefore, Virtual memory gives illusion of much
larger memory than the available physical memory.
Approved by Curriculum Development Centre (CDC), Nepal
Computer Software and Operating System Unit 3 … 123.
Major advantages of virtual memory are;
1. Program size is not constrained by the available size of physical memory.
2. More user programs may be available simultaneously in the memory, which increases the CPU
utilization and throughput.
WINDOWS (GUI) BASED OPERATING SYSTEM
The system which follows WIMP (Windows, Icons, Mouse and Pointer) mechanism is known as GUI
operating system. GUI uses windows based environment, graphical pictures and symbols called icons and
menus as commands. Application programs, commands, disk drives, folders, files etc are provided in the
form of icons. The mouse and pointer are used to click the icons to open the files and activate the
commands, instead of typing as in CUI.
The GUI provides a more convenient and user friendly means of communication between users and the
computer. As the GUI uses visual components, it is much easier to learn and operate. It relieves from the
tedious job of remembering all the commands and syntax. Since the GUI uses standard format for
representing text and graphics, we can move data from one application to another, and data can be shared
between different applications that use common GUI.
Hence, the graphics based environment has been developed which is user friendly and easy to operate. It
uses pull down menus, pictures, symbols, buttons, tabs and icons. Such a system is called graphical user
interface. In GUI system, each opened application is displayed in a window on the screen. We can do most
of our work in the window. Therefore, the GUI based system is also called windows operating system. The
window can be opened, closed, maximized, minimized, hided, resized or moved. The window provides
an interactive environment to the user to interact with the computer. We can open more than one window
on the screen at a time. But, user can work on single window at a time and this window is called active
window.
In windows operating system, both the keyboard and mouse can be used as the input device. But, the
mouse and the pointer play major role to provide user friendly environment to interact with the system by
pointing and clicking on icons and symbols. Windows based operating system has gone many
modifications, developments and advancements as developed at the time of introduced.
Windows is the widely used GUI, which is similar to Mac user interface. Earlier, the major drawback was
that the high power CPU and quality monitor was required, but it is no more a matter of concern for
present days' systems. Windows 98, Windows XP, VISTA, Windows 10, Mac, partially Linux etc are GUI
based OSs which are widely used in our computers.
Features of GUI
Windows is a GUI based operating system. It has been continuously upgraded to new versions lots of new
features embedded into it.
Windows provides flexibility to configure hardware, easy link to a network or setup a network, install and
uninstall programs automatically, provide security to networks, users, and the system. It also has lots of
other useful features like easy Internet access, multitasking, and its most useful feature is long file names.
Windows provides user-friendly interface to work on. Its improved graphical user interface makes
learning and using Windows more natural and easier for all types of users. It is more powerful,
customizable and efficient. Windows or GUI based operating system can provide powerful multi-featured
capabilities such as multitasking, file sharing and networking capabilities. The major features of GUI are:
1. User friendly: GUI is easier than CUI while working on this system.
2. Web Integration: It provides improved web features by combining the power of the computer with
the interactive content of the internet.
Approved by Curriculum Development Centre (CDC), Nepal
.124 … Computer Science–I
3. Improved Reliability: It provides improved computer reliability through utilities, wizards,
resources, scandisk, file checker etc. It helps to run the computer smoothly and efficiently.
4. Multiple Displays: In windows operating system, we can use multiple monitors simultaneously to
run different programs on separate monitors or multiple programs on the same monitor.
5. Power Management: It improves the start up time of computer. We can start the computer within a
few second. The files can be restored in their last saved position.
6. More Multimedia Function and Entertainment: It has faster and enhanced television, video
playback and Web TV for windows, enhanced support for CUI based games and sound files etc.
Windows support rich graphics, high quality audio and video. It requires all most no editing of
Config.sys files so as to support these technologies. All this is possible because of Windows
compatibility with latest and hottest technologies like Plug and Play, AutoPlay, and built-in support
for MIDI and digital and surrounds video.
7. Built in Networking: Most of the GUI systems provide onto correctly to the internet if we have
modern or NIC and connection similarly we can easily set up networks following the built in
wizards.
8. Windows Explorer: GUIs allow us to display the hierarchical structure of files, folders, and drives
using Windows Explore. Windows explore also shows any network drives that have been mapped to
drive letters on our computer. Using Windows Explorer, we can copy, move, rename, and search for
files and folders. For example, we can open a folder that contains a file you want to copy or move,
and then drag the file to another folder or drive.
9. Plug and Play: It means just plug a device in and Windows does the rest by installing any necessary
drivers, updating the system, and allocating resources. Most devices manufactured since 1995 are
Plug and Play. Plug and Play also recognizes new hardware when you start your computer and
loads any drivers that the hardware device needs.
10. OLE (Object Linking and Embedding): GUI based system allows to transfer and share information
between applications by pasting information created in one application into a document created in
another application, such as a spreadsheet or word processing file.
11. WIMP based system: It uses window, icon, mouse (menu) and pointer. Therefore, it is more user
friendly and easier to learn and operate. Therefore, GUI provides improved and user friendly
Interface:
12. Long File Names: As the Ms-DOS convention follows, non-of the file used in DOS environment
should be more than 8 characters of primary name and optional secondary name (extension) of three
characters. However, Windows supports long file names, maximum of 255 characters. It also allowed
space to be used in between file name. This helps to make files and folders easier to organize and
find.
13. Multitasking: Multitasking allows the user to activate and accomplish more than one task at a time.
For example, work on a document file in Word programs, while copying file from other computer
available in the network. With Windows XP, 32-bit computing environment, the user can do more
than one task a time.
14. Software Compatibility
Windows provides backward compatibility. It is easily compatible with applications developed for
MS-DOS and earlier versions of Windows environment. It also supports the latest 64-bit technology.
Most of the latest software packages are now built on Windows operating environment.
15. Easy Internet Access and Resource Sharing: One of the most useful features is easy access to
Internet. It provides built-in Internet functionality to setup link and access Internet with fewer
amounts of hardware and software requirement. It improves the efficiency of working on Internet
Approved by Curriculum Development Centre (CDC), Nepal
Computer Software and Operating System Unit 3 … 125.
with applications that support the latest Internet technologies, such as ActiveX, Java, and streaming
audio and video. It also helps setting up networks connecting computers with each other and share
files and other resources.
16. Hardware Compatibility: Windows provides greater hardware compatibility as compare to any
other operating environment. It has flexibility of supporting hardware from different vendors. Its
Plug and Play functionality allows inserting the hardware card into the computer and when the
computer is turned on Windows XP automatically recognizes and sets up the hardware.
DESKTOP APPLICATION AND WINDOWS ENVIRONMENT
A single-user computer, typically refers to a Windows PC or Mac, but may also refer to a Linux PC. It is
also called a "client computer" or "client" or simply a "desktop."
An application that runs stand-alone in a desktop or laptop computer is known as desktop application.
Contrast with "Web-based application," which requires the Web browser to run. The term may be used to
contrast desktop applications with mobile applications that run in smart phones and tablets.
Figure: 3.10 Desktop Application and Windows Environment
The most common desktop environment on personal computers is Microsoft Windows' built-in interface.
It was titled Luna in Windows XP, Aero in Windows Vista and Windows 7, Metro in Windows 8 and 8.1,
and Fluent in Windows 10. Also common is Aqua, included with Apple's macOS.
Some examples of desktop applications for Windows
• Windows File Explorer (to find files on your computer)
• Microsoft Office applications (Word, Excel, etc.)
• Web browsers (Chrome, Firefox, Internet Explorer)
• Adobe Photoshop.
• Tweet Deck (lets you use Twitter on your computer outside of a web browser)
The window environment is provided by GUI based systems. That means we can use window items such
as icons, pictures, menus, mouse and pointer etc. to work with different objects. The major components
that are used while working with a window environment are described here.
1. Desktop: The area on the display screen where files and folders represented by icons are arranged is
called desktop. Several icons or small pictures are located on the left side of the desktop. Each icon
represents an object, such as a folder or a program. The icons may have a name associated with it, such
as My computer, My Network places, My Documents, Recycle bean etc. Desktop is the first screen that
is displayed whenever we switch on the computer. It is similar to our personalized work space.
Approved by Curriculum Development Centre (CDC), Nepal
.126 … Computer Science–I
2. Window: The area on the screen covered by each opened application can be termed as window. That
means, window is a portion of the screen where programs and processes can be run. There can be
more than one open windows at the same time, and in each window we can run a different program
or display a different file. For example, you can open your e-mail in one window, work on a budget
in a spreadsheet in another, download pictures from your digital camera in another window, and
order your weekly groceries on the Web in another window. We can enter text or data on the
working area of the window. We can close, move, re-arrange a window, or minimize to a button on
the taskbar, or maximized to take up the whole screen the windows.
3. Pointer: A symbol that appears on the display screen and that you move to select objects and
commands. A symbol, usually a small triangular arrow that appears on the screen, is called a pointer.
We can move the pointer to point or to select an object and commands by clicking the mouse button.
Generally, text-processing applications such as ms word, excel etc make use of an I-beam pointer,
because the pointer looks like capital I.
4. Pointing Device: A device, such as a mouse or trackball that enables you to select objects on the
display screen.
5. Icons: Symbols or small pictures on the screen that represent commands, files, folders or windows is
called icon. The pointer is used to point or select the icon, and clicking the mouse button activates the
command represented by the icon. We can also move the icons around the display screen.
6. Menus: Most of the GUIs make extensive use of pull-down or pop-up menus having many options
within them. We can execute the commands by selecting the options in the menu. Start Button and
7. Taskbar: Start button on taskbar at the bottom left corner helps to work with multiple programs. It is
the gateway of accessing most of the functionality available in the computer. We can click on the
Start button anytime to start any programs, open or find documents, change windows settings, get
Help, manage Files, Log off or Shut down the computer, and much more.
The bottom horizontal bar on the desktop is known as taskbar. The Task bar provides information
and access to the entire task that has been currently activated by Windows. Taskbar keeps a track of
what all programs have been activated and switched between them. All the opened windows or
program appear as a minimized icons. Click on the desired icon to open the designated program.
Similarly, if you don't need a window too frequently, click on the minimized button of the windows.
This will send the activated window as small icon to the task bar.
8. Windows Explorer: Windows Explorer is more or less acts as a File Manager for Window, with lots
of new features. It is efficient, faster and user friendly. Whenever we right click on any icon, a pop up
menu appears which contains Explore option. Using Explorer one can easily browse through all the
files, folders, drives and network resources available and manage them.
9. Right Mouse Button: Clicking on the right mouse button activates a pop-up menu in any programs
so as to help in completing a task efficiently.
10. Shortcuts: As the name suggests, SHORTCUTS are the shortest way to access programs, files and
other resources. Instead of going through the structural process of accessing a program, one can
create "shortcuts" to access them. It creates links for easy access to files, programs, folders, and more.
A shortcut does not change the location of a file, instead it is just a pointer that lets us open the file
quickly. If we delete the shortcut, the original file is not deleted.
We can create shortcuts by right clicking on the desired location, and selecting Shortcut option, and
then browsing the required file or folder.
Approved by Curriculum Development Centre (CDC), Nepal
Computer Software and Operating System Unit 3 … 127.
11. Search Utility: Search Utility of Windows allows doing searches by partial name, type of file, last
modified date, location or full text. In addition, we can save, rename, or view files from within the
result pane, just like you can from Windows Explorer.
12. Help: Windows provides built in and online help to accomplish a task. If the user is not sure how to
perform a task, Windows Help will provide structured process how to accomplish the task.
Windows Desktop Icons:
• My Computer: It provides direct access to local drives, printers, Control panel, system tasks, and the
Network places etc..
• My network places: provide access to networks, shared resources on the machine, FTP sites and
computers on local and wide area network.
• My Documents: It provides quicker access to letters, reports, and other documents and files.
• Recycle Bin: Provides drag and drop a facility, deletion of file from folders in the machine and
provides a second chance to recover files deleted from the hard disk.
Figure: 3.11 Desktop
• Computer: It allows looking at a glance to all the resource available on the machine such as floppy
drive, CD-ROM drive, Hard Disk etc. If you have network drives mapped as local drives they will
also show up here. Double clicking on a drive of my computer will open another window containing
the main files and folders on the selected drive. Double clicking on any of the folders in the drive
window will open another window showing the contents of the folder.
Figure: 3.12 My Computer
Approved by Curriculum Development Centre (CDC), Nepal
.128 … Computer Science–I
Computer is the quickest way of accessing all the resources available on the computer. Even this can
be used to copy, move, and delete files among or between floppy and Hard Disk or network drives.
Figure: 3.13 Local Disk Properties
Approved by Curriculum Development Centre (CDC), Nepal
Computer Software and Operating System Unit 3 … 129.
Computer also provides the tools to change the settings of the available resources. Select the media
such as floppy disk, hard disk drive you want to change the settings and right click on it. This will
activate a Pop-Up menu. Now select the Properties option from the pop-up menu. This action will
display the property windows with options like General, Tools, Hardware, Quota and Sharing. Using
these options you can change the properties of the selected media.
• Explorer: As the name suggests, Explorer lets us explore the contents of your computer and do file
management.
Figure: 3.14 Explorer
To activate Explorer, Right Click on the Start Button on the Taskbar and select Explore option.
Explorer displays all the folders on the computer in a hierarchical order on the left-hand side of the
screen. On the right hand side of the screen, it displays all the files and folders in each selected folder.
Figure: 3.15 Exploring the Content
Windows Explorer is especially useful for copying and moving files. You can open the folder that
contains the file you want to move or copy, and then drag it to the folder you want to put it in.
Approved by Curriculum Development Centre (CDC), Nepal
.130 … Computer Science–I
WORKING WITH A WINDOWS APPLICATION PROGRAMS
We can install new programs or remove the existing programs from the computer. Similarly, we can open
and work on any program or quit the program after completing the work. Therefore, in this lesson, we will
discuss about working with a windows application programs.
Adding and Removing Programs
We can quickly install programs, such as word processing application program or games using
Add/Remove Programs feature in control panel. To install or uninstall a program;
• Go to StartControl Paneland then double click Add/Remove Programs icon.
• Select Change or Remove Program Icon to modify or remove the program from the computer or
select Add New Programs icon on the left side task pane to add new program.
• Follow the instructions on your screen.
Starting and Quitting a program
Most of the programs installed are available from one convenient location-the All Programs section of
Start menu. Depending on how your computer is set up, what we see on the start menu varies.
To Start a Program;
• Click on the Start button, and then point to All Programs option.
• Select the program you want to run. If the program you want is not on the menu, point to the folder
that contains the program.
• Click on the program icon or menu.
Once the selected program starts, a small icon appears on the taskbar. If you have opened more than one
program, click on the required program icon on the taskbar to make it currently activated program. If the
desired program is not available on the program menu or one of its submenus, point to Search on the Start
menu, and then select the appropriate option from the task pane on the left. Or use Run option from Start
menu and type the executable file name of the program and click Ok to start it.
To quit a program;
• Click on Close button in the upper right corner of the window. Or,
• Go to File MenuExit.
Working with Files and Folders
In windows, we can organize our documents and programs to suit our preferences. we can store data,
instructions and information in files, files in folders, and we can move, copy, rename and even search for
files and folders.
1. Creating Folders: When we use program and save our work, or when we install a program, we are
creating files. We can store our files in many locations-on the hard disk, a network drive, a flash
drive, and so on. To better organize these files, we can also store them in folders. To create a folder:
• Go to Computer, open the folder in which you want to create a new folder by double clicking
on it.
• Go to the File menu, point to New, and then click on the Folder option. Or Right click any
where and select NewFolder from the pop up menu that appears.
• The new folder appears with a temporary name.
• Type a name for the new folder, and then press Enter.
Note: File names in Windows can be up to 255 characters, including spaces. However, it cannot contain any of
the following characters: \ / : * ? " < > |
Approved by Curriculum Development Centre (CDC), Nepal
Computer Software and Operating System Unit 3 … 131.
2. Copying and Moving Files and Folders: When we create files and folders, we may want to copy or
move them to another location. The steps to copy or move files and folders are;
• In a window select the file or folder you want to copy by clicking on it.
(We can select multiple items. To select non-adjacent items, hold down CTRL key and click the
items you want to select. To select adjacent items, hold down shift key while you select items.
To select all of the items in a window, click Select All on the Edit menu)
• Go to Edit Menu and Click Copy to copy the file, or click cut to move the file.
• Open by double clicking the folder or disk drive where you want to place the file or folder.
• Go to Edit Menu and Click Paste option.
Opening or Deleting Files and Folders:
We can open or delete a file or folder from any location. The steps are;
• Open Computer by double clicking or open Windows Explore.
• Double click the drive that contains file or folder.
• Double click the file or folder to open.
• Just select the file or folder you want to delete.
• Go to File Menu and click Delete option or press Delete key. The Confirm File Delete dialog
box appears.
• Click Yes. The file is moved to the Recycle Bin.
Note: Files or folder deleted are stored in the Recycle Bin until the Recycle Bin is emptied. Files or folders can
also be deleted by dragging file or folder icons onto the Recycle Bin icon. If SHIFT key is pressed while
dragging, the item will be deleted permanently from the computer without being stored in the Recycle Bin.
3. Renaming Files and Folders: If we decide to change the name a file or folder, we can quickly rename
it. The steps are;
• In a window select the file or folder you want to rename.
• Go to the File menu, and Click Rename or right click on file or folder and select Rename.
• Type a new name for the file or Folder, and then press ENTER.
4. Working with Frequently Used Files and Folders: We can quickly open documents and programs
that we use often. The start menu may list the documents used most recently, if it contains
Documents option, and we can reopen them just by clicking. The My Documents folder on the
desktop is a convenient place for users to store frequently used files and folders. Similarly, for easy
access to a file that we use frequently, we can also create a shortcut to it.
Customizing the Taskbar and Desktop
Windows like windows XP provides tools to change the look and feel of the desktop window. Use
Display in Control Panel or right click on the blank space of desktop window and
click on Properties option to select a desktop theme, customize desktop, and modify
display settings. Select a theme to define the overall appearance of your desktop. A
theme determines your background, screen saver, Window fonts, colors and three-
dimensional effects in windows and dialog boxes, the look of icons and mouse
pointers, and sounds. You can customize a theme by changing individual elements.
Desktop can be customized in other ways as well, such as adding Web content to
desktop background or selecting icons that you want to display on the desktop. You
Approved by Curriculum Development Centre (CDC), Nepal
.132 … Computer Science–I
can also specify color settings, change your screen resolution, and set the refresh rate for your monitor. If
you are using multiple monitors, you can specify individual settings for each. We can also activate these
tools from Control panel by selecting the Display icon.
1. Desktop Background: To change the background of the desktop;
• Right Click on the Desktop and click Properties.
• In the Desktop or Background tab, select the appropriate background from the list.
• To cover the entire screen with wallpaper image, click Tile.
• To center a wallpaper image, click Center.
Figure: 3.16 Desktop Background
• Click on Customize Desktop button in the Desktop tab window to customize desktop. Desktop
Items window appears. We can deselect the check boxes under Desktop icons box if we don't
want to display those items, and vice versa. Similarly we can change icon formats, or run
desktop clean up wizard to remove some icons from the desktop.
Similarly all other option such as Appearance (for changing windows and buttons style, text
color schemes, font size, effects for menus and tool tips, icon size etc.) Screen Saver (for screen
saver style, and adjusting monitor power settings) and Settings can be used. Using the Settings
option, one can select the number of colors, pixel type and display adapter for the system.
To use a picture as a desktop background
• Open My Pictures.
• Click the picture you want to use as a desktop background.
• Under Picture Tasks, click Set as desktop background.
To create your own desktop theme
• click Start, click Control Panel, and then double-click Display.
• On the Themes tab, under Theme, click the theme you want to modify.
• Make your changes to the theme.
• When you finish making changes, click Apply on the Themes tab in the Display Properties
dialog box, and then click Save As.
• Type a name for the theme and click OK.
2. Customizing the Start Menu and the Taskbar: We can customize the Start menu to help us work
more efficiently. If we add folders or files that we open frequently, we can open them quickly from
the Start menu. Or we can create our own groups of files and programs. We can also add items to or
remove them from the Start menu. For example, we can reduce the size of Start menu by removing a
program that we no longer use. If we remove an item from the Start menu, we're not uninstalling the
program or removing it from the computer.
Approved by Curriculum Development Centre (CDC), Nepal