0% found this document useful (0 votes)
34 views225 pages

Computer (ISS)

Uploaded by

Gunjan Agarwal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views225 pages

Computer (ISS)

Uploaded by

Gunjan Agarwal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 225

C HA PTE R 2

COMPUTER ORGANISATION
AND ARCHITECTURE

Chapter Outline Chapter Objectives


2.1 Introduction In this chapter, we will learn:
2.2 Central Processing Unit ∑ The role of Central Processing Unit (CPU)
2.2.1 Arithmetic Unit in a computer system.
2.2.2 Logic Unit ∑ The working of various components of CPU.
2.2.3 Control Unit ∑ The concept of processor communication
with memory and I/O devices.
2.2.4 Main Memory Unit ∑ The concept of machine cycle for
2.2.5 Cache Memory executing an instruction.
2.2.6 Registers ∑ Different types of bus, used in a computer
2.3 Internal Communications system, and their purposes.
2.3.1 Processor to Memory ∑ Types of instructions set implemented in a
Communication computer system.
2.3.2 Processor to I/O Devices
Communication
2.1 INTRODUCTION
2.4 Machine Cycle
2.4.1 Instruction Cycle
Computer organisation and computer architecture
2.4.2 Execution Cycle are two different but related, important concepts
2.5 The Bus that are required to describe a computer system.
2.5.1 Data Bus Computer architecture refers to the definition
2.5.2 Address Bus of basic attributes of hardware components
2.6 Instruction Set and their interconnections, in order to achieve
certain specified goals in terms of functions and
2.6.1 Complex Instruction Set
performance. The attributes may include, for
2.6.2 Reduced Instruction Set example the instruction set, data representation, I/O
Chapter Summary mechanisms, etc. The architecture basically defines
Key Terms to Remember the logical structure of a computer system.
Review Questions Computer organisation refers to the design and
Fill in the Blanks physical arrangement of various hardware units
to work in tandem, in an orderly manner, in order
Multiple Choice Questions
to achieve the goals specified in the architecture.
Discussion Questions For a given architecture, there could be many
Computer Organisation and Architecture 27

different models, each representing a different type of organisation, depending on the cost, physical size
and technology used.
In this chapter, we shall discuss in detail the functioning of the central processor of a computer system,
how the processor communicates with the memory and input/output devices, and the instruction sets used
in the design of processors.

2.2 CENTRAL PROCESSING UNIT

The function of any computer system revolves around a central component known as central processing
unit (CPU). The CPU, which is popularly referred to as the “brain” of the computer, is responsible for
processing the data inside the computer system. It is also responsible for controlling all other components of
the system. Figure 2.1 shows a typical block diagram of the computer system, illustrating the arrangement
of CPU with the input and output units as well as the memory of the computer system.

Fig. 2.1 The block diagram of a computer system

The main operations of the CPU include four phases:


∑ Fetching instructions from the memory.
∑ Decoding the instructions to decide what operations to be preformed.
∑ Executing the instructions.
∑ Storing the results back in the memory.
This four-phase process is known as the CPU cycle, which is illustrated in Fig. 2.2.
As shown in the Fig. 2.1, the central processing unit consists of the following subsystems:
∑ Arithmetic Unit (AU)
∑ Logic Unit (LU)
∑ Control Unit (CU)
28 Fundamentals of Computers

The CPU makes use of the following memory subsystems for carrying out its processing operations:
∑ Main Memory Unit
∑ Cache Memory
∑ Registers

Fig. 2.2 The CPU cycle

2.2.1 Arithmetic Unit


Arithmetic Unit (AU) is a part of the CPU that performs arithmetic operations on the data. The arithmetic
operations can be addition, subtraction, multiplication or division. The multiplication and division
operations are usually implemented by the AU as the repetitive process of addition and subtraction
operations respectively. Some CPUs contain separate AUs for integer or fixed-point operations (integers)
and real or floating-point operations (real/decimal). AU takes the input in the form of an instruction that
contains an opcode, operands and the format code. The opcode specifies the operation to be performed
and the operands specify the data on which operation is to be performed. The format code suggests the
format of the operands, such as fixed-point or floating-point. The output of AU contains the result of the
operation and the status of the result, whether it is final or not. The output is stored in a storage register by
the AU. Register is a small storage area inside the CPU from where data is retrieved faster than any other
storage area.

2.2.2 Logic Unit


Logic Unit (LU) is a part of the CPU that performs logical operations on the data. It performs 16
different types of logical operations. The various logical operations include greater than (>), less than (<),
equal to (=), not equal to (≠), shift left, shift right, etc. LU makes use of various logic gates, such as AND,
OR, NOR, etc for performing the logical operations on the data.
Computer Organisation and Architecture 29

2.2.3 Control Unit


Control Unit (CU) is an important component of CPU that controls the flow of data and information.
It maintains the sequence of operations being performed by the CPU. It fetches an instruction from the
storage area, decodes the instruction and transmits the corresponding signals to the AU or LU and the
storage registers. CU guides the AU and LU about the operations that are to be performed and also suggests
the I/O devices to which the data is to be communicated. CU uses a program counter register for retrieving
the next instruction that is to be executed. It also uses a status register for handling conditions such as overflow
of data.

2.2.4 Main Memory Unit


The main memory is referred to as the internal memory or primary memory of the computer. It is also
known as Random Access Memory (RAM). It is a temporary storage medium that holds the data only
for a short period of time. Once the computer is switched off, the data stored in the RAM gets erased.
The memory space of RAM is limited and therefore all the files and instructions cannot be stored in it.
These files and instructions are normally stored in a different location known as secondary storage and are
copied from there to the RAM before execution. This technique is referred as swapping. The memory space
available in RAM also affects the speed of a computer system. If the memory space is more, more number
of instructions can be copied and executed at the same time. As a result, the computer system need not read
the data from the secondary storage again and again, thus making the processing faster. The main memory
is also responsible for holding intermediate data transferred between CPU and the I/O devices.

2.2.5 Cache Memory MP


Cache memory is a small, fast and expensive memory that stores the copies
of data that needs to be accessed frequently from the main memory. The
processor, before reading data from or writing data to the main memory,
checks for the same data in the cache memory. If it finds the data in the
cache memory the processor reads the data from or writes the data to the
cache itself because its access time is much faster than the main memory.
The cache memory is always placed between CPU and the main memory of
the computer system, as shown in Fig. 2.3.
Figure 2.3 shows that the transfer of data between the processor and
the cache memory is bidirectional. The availability of data in the cache is
known as cache hit. The capability of a cache memory is measured on the
basis of cache hit.
There are usually two types of cache memory found in the computer
system:
Fig. 2.3 The cache memory
∑ Primary cache It is also known as Level 1 (L1) cache or internal
cache. The primary cache is located inside the CPU. It is smaller but
fastest type of cache that provides a quick access to the frequently accessed data by the microprocessor.
∑ Secondary cache It is also known as Level 2 (L2) cache or external cache. The secondary cache
is located outside the CPU. It is normally positioned on the motherboard of a computer. The secondary
cache is larger but slower than the primary cache.
30 Fundamentals of Computers

2.2.6 Registers
Central processing unit contains a few special purpose, temporary storage units known as registers.
They are high-speed memory locations used for holding instructions, data and intermediate results that
are currently being processed. A processor can have different types of registers to hold different types of
information. They include, among others:
∑ Program Counter (PC) to keep track of the next instruction to be executed.
∑ Instruction Register (IR) to hold instructions to be decoded by the control unit.
∑ Memory Address Register (MAR) to hold the address of the next location in the memory to be
accessed.
∑ Memory Buffer Register (MBR) for storing data received from or sent to CPU.
∑ Memory Data Register (MDR) for storing operands and data.
∑ Accumulator (ACC) for storing the results produced by arithmetic and logic units.
Many computers employ additional registers for implementing various other requirements. The number
and sizes of registers therefore vary from processor to processor. An effective implementation of registers
can increase considerably the speed of the processor.

2.3 INTERNAL COMMUNICATIONS

CPU of the computer system communicates with the memory and the I/O devices in order to transfer
data between them. However, the method of communication of the CPU with memory and I/O devices
is different. The CPU may communicate with the memory either directly or through the cache memory.
However, the communication between the CPU and I/O devices is usually implemented with the help of
interfaces. Therefore, the internal communication of a processor in the computer system can be divided into
two major categories:
∑ Processor to memory communication
∑ Processor to I/O devices communication

2.3.1 Processor to Memory Communication


The direct communication between the processor and memory of the computer system is implemented
with the help of two registers, Memory Address Register (MAR) and Memory Buffer Register (MBR).
Figure 2.4 shows the communication between the processor and the memory of the computer system.

/////
MBR
Fig. 2.4 Processor to memory communication

The processor can interact with the memory of the computer system for reading data from the memory
as well as for writing data on to the memory. The MAR and MBR registers play a very important role in
Computer Organisation and Architecture 31

implementing this type of communication. These registers are the special-purpose registers of the processor.
MAR is used by the processor to keep track of the memory location where it needs to perform the reading
or writing operation. This register actually holds the address of the memory location. On the other hand, the
Memory Data Register (MDR) is used by the processor to store the data that needs to be transferred from/to
the memory of the computer system. The reading and writing operations performed by the processor are
called memory read and memory write operations.
Figure 2.5 illustrates the memory read operation performed by the processor of the computer system.
The processor performs the following steps to read the data from the desired memory location:

Fig. 2.5 Illustrating the memory read operation

1. First, the processor loads the address of the memory location from where data is to be read into the
MAR register, using the address bus.
2. After loading the address of the memory location, the processor issues the READ control signal
through the control bus. The control bus is used to carry the commands issued by the processor, and
the status signals are generated by the various devices in response to these commands.
3. After receiving the READ control signal, the memory loads the data into the MDR register from the
location specified in the MAR register, using the data bus.
4. Finally, the data is transferred to the processor.
The memory write operation helps the processor to write the data at the desired memory location.
Figure 2.6 illustrates the memory write operation performed by the processor of the computer system.

Fig. 2.6 Illustrating memory write operation

The processor performs the following steps for writing the data at the desired memory location in the
computer system:
32 Fundamentals of Computers

1. First, the processor loads the address of the memory location where data is to be written in the MAR
register, using the address bus.
2. After loading the address of the memory location, the processor loads the desired data in the MDR
register, using the data bus.
3. After this, the processor issues the WRITE control signal to the memory, using the control bus.
4. Finally, the memory stores the data loaded in the MDR register at the desired memory location.

2.3.2 Processor to I/O Devices Communication


The communication between I/O devices and processor of the computer system is implemented using an
interface unit. In a computer system, data is transferred from an input device to the processor and from
the processor to an output device. Each input and output device in the computer system is provided with
a controller, called device controller. The device controller is used to manage the working of various
peripheral devices. The processor actually communicates with the device controllers of the various I/O
devices for performing the I/O operations.
Figure 2.7 illustrates how the communication between the processor and the I/O devices of the computer
system is implemented. The interface unit acts as an intermediary between the processor and the device
controllers of various peripheral devices in the computer system. The basic function of the interface unit is
to accept the control commands from the processor and interpret the commands so that they can be easily
understood by the device controllers for carrying out necessary operations. Therefore, we can sayPO that
the interface unit is responsible for controlling the input and output operations between the processor and
the I/O devices. The interface unit contains data register and status register. The data register is used to
store the data to be transferred, either to the processor or to an output device. The status register is used
to indicate the status of the data register, i.e., whether it is currently holding the data or not. If the data
register is holding the data to be transferred, the flag bit of the status register is set to one. The processor
to I/O devices communication involves two important operations, i.e., I/O read and I/O write. The I/O read
operation helps the processor to read the data from an input device.

Fig. 2.7 Illustrating the communication process between the processor and I/O devices

Figure 2.8 illustrates how the data is transferred from an input device to the processor of the computer
system. The steps performed while transferring the data from an input device to the processor are:
1. The data to be transferred is placed on the data bus by the input device, which transfers single byte of
data at a time.
Computer Organisation and Architecture 33

2. The input device then issues the data valid signal through the device control bus to the data register,
indicating that the data is available on the data bus.
3. When the data register of the interface unit accepts the data, it issues a data accepted signal through
the device control bus as an acknowledgement to the input device, indicating that the data has been
received. The input device then disables the data valid signal.
4. As the data register now holds the data, the F or the flag bit of the status register is set to 1.
5. The processor now issues an I/O read signal to the data register in the interface unit.
6. The data register then places the data on the data bus connected to the processor of the computer
system. After receiving the data, the processor sends an appropriate acknowledgement signal to the
input device, indicating that the data has been received.

Fig. 2.8 Illustrating the I/O read operation

The I/O write operation helps the processor to write the data to an output device. Figure 2.9 illustrates
how the data is transferred from the processor to an output device. The steps performed while transferring
the data from the processor to the output device are:

Fig. 2.9 Illustrating I/O write operation

1. The processor places the data that needs to be transferred on the data bus connected to the data
register of the interface unit.
2. The CPU also places the address of the output device on the device address bus.
3. After placing the address and data on the appropriate buses, CPU issues the I/O write signal, which
writes the data on the data register. The flag bit in the interface unit is set to 1, indicating that the data
register now holds the data.
34 Fundamentals of Computers

4. The data register of the interface unit issues a data accepted signal through the control bus to the
processor, indicating that the data has been received.
5. The interface unit then places the data stored in the data register on to the data bus connected to the
device controller of the output device.
6. The output device then receives the data and sends an acknowledgement signal to the processor of the
computer system through the interface unit, indicating that the desired data has been received.

2.4 MACHINE CYCLE

The cycle during which a machine language instruction is executed by the processor of the computer system
is known as machine cycle. If a program consists of 10 machine language instructions, 10 separate machine
cycles would be executed for running the program. Figure 2.10 shows the typical machine cycle performed
by the CPU of a computer system. As shown, the machine cycle contains four phases, namely, fetching,
decoding, executing and storing.

Fig. 2.10 Illustrating the process of machine cycle

The four phases of the machine cycle are usually grouped into two categories:
∑ Instruction cycle
∑ Execution cycle

2.4.1 Instruction Cycle


Instruction cycle includes the first two phases, fetching and decoding.
∑ Fetching In this phase, the CPU retrieves the instruction from the main memory of the computer
system. The address of the instruction that needs to be executed is sent to the CPU through the address
Computer Organisation and Architecture 35

bus. The address of the instruction is then stored by the CPU in its internal register known as Program
Counter (PC). After the address of the instruction is confirmed by the CPU, the actual instruction is
retrieved by the CPU form the main memory and stored in the Instruction Register (IR).
∑ Decoding This phase of instruction cycle is responsible for breaking down the instruction into
different parts, so that it can be easily understood before being processed by the CPU. The instruction
is usually decoded by the instruction decoder, which is a vital component of the CPU. The decoding
of an instruction is also known as interpreting. The instructions are interpreted to determine two key
attributes of an instruction, the opcode and the operands. The opcode specifies the operation to be
performed and the operands specify the data on which the operation is to be performed. The data is
transferred to the Data Register (DR).

2.4.2 Execution Cycle


Execution cycle includes two phases, executing and storing. The execution cycle executes the instruction
and stores the result back to the main memory or sends it to the output device of the computer system.
∑ Executing In this phase, the decoded instruction is executed by the ALU of the CPU. The execution
time spent by the ALU for executing an instruction may vary, depending on the type of the instruction.
The execution time also depends on the processor architecture.
∑ Storing In this phase, the result computed in the execution phase is either sent to the memory or to
an output device of the computer system. The PC of the CPU is also updated in this phase to point to
the next instruction that is to be executed.
After the execution cycle is completed, the next machine cycle begins.

2.5 THE BUS

A bus is a set of wires that is used to connect the


different internal components of the computer
system for the purpose of transferring data as well
addresses amongst them. There may be several
buses in a computer system. A bus can either be
a serial bus or a parallel bus. In serial bus, only
one bit of data is transferred at a time amongst
the various hardware components. On the other
hand, in parallel bus, several bits of data can be
transferred at a time amongst the various hardware
components. The speed of any type of bus is
measured in terms of the number of bits transferred
per second, between two components.
Figure 2.11 shows a bus system used in a
computer system. The figure depicts the two
different types of buses according to the type of
operations performed by them. These buses are
data bus and the address bus. Apart from data
and address bus, a third type of bus—known as Fig. 2.11 Data and address buses
36 Fundamentals of Computers

control bus—also exists in the computer system. The control bus manages the transfer of data and addresses
among various components by transferring appropriate control signals. DAC
2.5.1 Data Bus
As the name suggests, the data bus in a computer
system is used to transfer data amongst the
different internal components. The speed of the
data bus also affects the overall processing power
of a computer system. Modern computer systems
use 32-bit data buses for data transfer. This means
that these buses are capable of transferring 32 bits
of data at a time. Figure 2.12 shows the data bus
implemented between the main memory and the
processor of a computer system.
The figure shows that a bidirectional data bus Fig. 2.12 The data bus
is implemented between the main memory and
the processor of the computer system. The bidirectional data bus allows the transfer of data in both the
directions. The data bus is generally bidirectional in nature in most computer systems.

2.5.2 Address Bus


The address bus is also known as memory bus. It
transfers the memory addresses for read and write
memory operations. It contains a number of address
lines that determine the range of memory addresses that
can be referenced using the address bus. For example, a
32-bit address bus can be used to reference 232 memory
locations. Like data bus, the address bus can also be a
serial or a parallel bus. Figure 2.13 shows the address
bus, used for transferring memory locations between Fig. 2.13 An address bus
processor and memory.
The figure shows that the address bus between the main memory and the processor of a computer system
is unidirectional. However, an address bus may also be bidirectional. For example, the address bus between
the processor and the I/O system is bidirectional.

2.6 INSTRUCTION SET

An instruction set can be defined as a group of instructions that a processor can execute to perform different
operations. On the basis of complexity and the number of instructions used, the instruction set can be
classified as:
∑ Complex instruction set
∑ Reduced instruction set

2.6.1 Complex Instruction Set


The complex instruction set refers to the set of instructions that includes very complex and large number
of instructions. The number of instructions in this set varies from 100 to 250. The instructions in this set
Computer Organisation and Architecture 37

are mostly memory-based instructions, which involve frequent references to the memory. The complex
instruction set makes use of a large number of addressing modes because of the frequent references
to registers as well as memory. The instructions in this instruction set have variable length instruction
format, which is not limited to only 32-bits. The execution of the instructions takes a lot of time because
the instructions are memory-based and accessing the memory is a time consuming process as compared to
accessing the registers.
The computer, which makes use of complex instruction set, is called Complex Instruction Set Computer
(CISC). The instruction set of CISC has a large number of instructions and for each instruction type, the
computer requires a separate circuitry, which makes the CPU design more complicated.
Some of the advantages of CISC are as follows:
∑ There is no need to invent an instruction set for each new design. A new processor can use the
instruction set of its predecessor.
∑ A program written in CISC requires less memory space, as the code is confined to less number of
instructions.
∑ CISC makes the job of a compiler easier by facilitating the implementation of high-level language
constructs.
Some of the disadvantages of a CISC are as follows:
∑ The inheritance of old instructions into new processors increases the complexity.
∑ Many CISC instructions are not frequently used.
∑ CISC commands are translated into a large number of lines of microcode, which makes the CPU
processing slower.
∑ CISC systems have a complex hardware, so they require more time for designing.
2.6.2 Reduced Instruction Set
The reduced instruction set refers to a set of instructions that contains very few instructions ranging from
0 to 100. It comprises of only those instructions, that are frequently used by the processor for the execution
of a program. These instructions are generally very simple to execute. The instructions used in this set are
mostly register-based, which means that the execution of the instruction involves frequent references to the
registers. The memory-based instructions, which involve frequent references to the memory locations, are
very few in this instruction set. The memory-based instructions include only load and store instructions.
The instructions in this instruction set have fixed length instruction format of 32 bits. An instruction format
divides the bits of instruction into small groups called fields. Generally, an instruction has the following fields:
∑ Opcode field. It represents the operation to be performed by the instruction.
∑ Operand field. It represents the data on which the operation is to be performed, or the memory
location or register where the data is stored.
∑ Mode field. It represents the method of fetching the operands stored at specified memory location or
registers.
The computer, which makes use of reduced instruction set, is called Reduced Instruction Set Computer
(RISC). As the instruction set of RISC has very few instructions, the design of hardware circuitry becomes
easier and also the speed of processing increases. The speed of RISC processors is measured in MIPS
(Millions of Instructions Per Second).
The comparison of RISC and CISC processors indicates that the RISC processors are always preferred
over the CISC processors because of their compact size and small instruction set. The other advantages of
the RISC processors over the CISC processors are as follows:
∑ In RISC processors, the instructions are executed by decoding, whereas in CISC processors, the
instructions are executed by first translating them into equivalent microcode instructions. The
38 Fundamentals of Computers

conversion of instructions into microcode consumes a lot of space in the memory, thereby reducing
the speed of execution.
∑ The RISC processors execute instructions in a single clock cycle, while the CISC processors require
multiple clock cycles for the execution of an instruction.
∑ The hardware of the RISC processors is very simple and can be designed easily, as compared to the
hardware of the CISC processors that is very complex, difficult to design and large in size.
The only disadvantage of RISC, in comparison to CISC, is that the number of instructions required to
perform an operation is comparatively large.

Chapter Summary
Computer organisation and architecture refers to the study of different functional components of the computer
system and the manner in which these components interact with each other to perform a specific operation. The
central and main component of a computer system is the CPU. CPU is the only component in the computer system
that is responsible for carrying out different operations. The major internal components of CPU are AU, LU, and
CU. The two major components of a computer system that communicate with the CPU to perform an operation
are main memory unit and cache memory. AU is responsible for performing arithmetic operations while LU is
responsible for performing logical operations. CU controls the functioning of the CPU.
The CPU also interacts with the memory unit for reading and writing the data in the computer system. Generally,
the communication between the memory and the CPU is direct. However, a computer system can also be provided
with a cache memory to speed up the process of CPU to memory communication. CPU can also interact with the
I/O devices through an interface unit to perform various input and output operations.
An instruction is executed by the CPU in two different phases, known as instruction cycle and execution cycle.
During the instruction cycle, the CPU fetches the instruction from the memory and decodes it. The execution
cycle executes the instruction and stores the result back to the main memory or sends it to the output device of the
computer system.

Key Terms to Remember

∑ Computer architecture: It refers to the definition of basic attributes of hardware components and their
interconnections, in order to achieve certain specified goals in terms of functions and performance.
∑ Computer organisation: It refers to the design and physical arrangement of various hardware units to work in
tandem, in an orderly manner, in order to achieve the goals specified in the architecture.
∑ CPU: It is referred to as the brain of the computer and is responsible for processing the data inside the computer
system.
∑ AU: It is a part of the CPU that performs arithmetic operations on the data.
∑ LU: It is a part of the CPU that performs logical operations on the data.
∑ CU: It is an important component of CPU that controls the flow of data and information.
∑ Opcode: It specifies the operation to be performed on data.
∑ Operand: It is the data on which the operation is to be performed.
∑ Main memory: It is referred to as the internal memory or primary memory of the computer and is a temporary
storage medium that holds the data only for a short period of time.
∑ Cache memory: It is a small, fast and expensive memory that stores the copies of the data that needs to be
accessed frequently from the main memory.
Computer Organisation and Architecture 39

∑ Primary cache: It is known as L1 cache or internal cache and is located inside the CPU.
∑ Secondary cache: It is also known as L2 cache or external cache and is located on the motherboard of a computer.
∑ Registers: They are high-speed memory locations used for holding instructions, data and intermediate results that
are currently being processed.
∑ PC: This register is used to keep track of the next instruction to be executed.
∑ IR: This register is used to hold instructions to be decoded by the control unit.
∑ MAR: This register is used to hold the address of the next location in the memory to be accessed.
∑ MBR: This register is used to store data received from or sent to CPU.
∑ MDR: This register is used to store operands and data.
∑ Accumulator: This register is used to store the results produced by arithmetic and logic units.
∑ Machine cycle: It refers to a cycle during which a machine language instruction is executed by the processor of
the computer system.
∑ Bus: It is a set of wires that is used to connect the different internal components of the computer system for the
purpose of transferring data as well addresses amongst them.
∑ Data bus: It is a bus used to transfer data among the different internal components.
∑ Address bus: It is a bus used to transfer the memory addresses for read and write memory operations.
∑ Control bus: It is a bus that manages the transfer of data and addresses among various components by transferring
appropriate control signals.
∑ Complex instruction set: It refers to a set of instructions that includes very complex and large number of
instructions.
∑ Reduced instruction set: It refers to a set of instructions that contains very few instructions ranging from
0 to 100.
∑ CISC: It refers to a computer that makes the use of complex instruction set.
∑ RISC: It refers to a computer that makes use of reduced instruction set.

Review Questions

Fill in the Blanks

1. The central processing unit of the computer system is popularly known as ________ of the computer system.
2. _________ unit is responsible for performing all the arithmetic operations in the computer system.
3. The _________ register keeps the track of the next instruction to be executed.
4. _____________ is called the main-memory of the computer.
5. The access time of _________ memory is faster as compared to that of main memory.
6. The group of wires used to connect the components of CPU to transfer the data is called ________________.
7. The time taken by the CPU to fetch an instruction and execute it is called ________________.
8. The group of instructions that a processor can execute is called ________________.
9. _________ bus is used to transfer data from the memory.
10. The instruction set can be classified as ________________ and ________________.
11. The _______ field represents the operation to be performed by the instruction.
40 Fundamentals of Computers

12. The instruction set of _________ has a few instructions compared to that of _________.
13. The direct communication between processor and memory of the computer system is implemented with the help
of two registers, __________ and __________.
14. The two important operations performed while communicating with the memory of the computer system are
_________ and _________.
15. The flag bit of the status register is ______, when the register holds the data.
16. The computer, which makes use of reduced instruction set, is called ________.
17. The speed of the RISC processors is measured in ________.
18. __________ bus transfers the memory addresses for reading or writing the data.

Multiple Choice Questions

1. The definition of basic attributes of hardware components and their interconnections, in order to achieve certain
specific goals, in terms of functions and performance is known as:
A. Computer organisation B. Computer architecture
C. Computer management D. Computer arrangement
2. The design and physical arrangement of various hardware components to work in a tandem in an orderly manner,
so as to archive the goals specified in the architecture is known as:
A. Computer organisation B. Computer architecture
C. Computer management D. Computer arrangement
3. What does CPU stand for?
A. Center processing unit B. Central processing unit
C. Central programming unit D. Computer processing unit
4. Which one of the following is not an internal component of CPU?
A. Arithmetic unit B. Logic unit C. Interface unit D. Control unit
5. What is the main function of CPU in a computer system?
A. Storing the data B. Programming the computer
C. Transferring the data to an output device D. Processing the data
6. Which of the following memory locations are first referred by the CPU while searching for data?
A. Main memory B. Cache Memory C. ROM D. Secondary memory
7. Cache memory is used to transfer data between:
A. Main memory and secondary memory B. Processor and an input device
C. Main memory and processor D. Processor and an output device
8. Which one of the following cache memory is also known as internal cache?
A. L2 cache B. L1 cache C. L3 cache D. L4 cache
9. Which one of the following hardware components is normally used to accommodate secondary cache?
A. Motherboard B. Processor
C. RAM D. Any secondary storage device
Computer Organisation and Architecture 41

10. Which one of the following statement is not true about L1 cache?
A. L1 cache is a type of cache memory.
B. L1 cache stores the data from the main memory.
C. L1 cache is an expensive type of memory.
D. L1 cache is usually slower than L2 cache.
11. Which one of the following register is not a CPU register?
A. Memory control register B. Memory data register
C. Memory buffer register D. Instruction register
12. What is the purpose of memory address register?
A. Stores the address of the next location in the main memory
B. Stores the address of the next location in the secondary memory
C. Stores the address of the next location in the cache memory
D. Stores the address of an output device to which the data is to be sent
13. Which of the following registers is used to indicate whether the data register holds the data to be transferred
or not?
A. Status register B. MAR C. MBR D. MDR
14. Which of the following two registers are used by the CPU to transfer the data between processor and memory?
A. MDR and IR B. PC and IR C. IR and MAR D. MAR and MDR
15. Which of the following sequence of operations represents the machine cycle?
A. Fetch-Execute-Decode-Store B. Store-Execute-Fetch-Decode
C. Fetch-Decode-Execute-Store D. Store-Fetch-Decode-Execute
16. The decoding phase of the instruction cycle is also known as:
A. Translating B. Interpreting C. Analysing D. Breaking
17. Which of the following is not a type of bus used in the computer system?
A. Data bus B. Address bus C. Information bus D. Control bus
18. Which of the following is a characteristic of the CISC processor?
A. Number of instructions varying between 100 and 250
B. Large number of addressing modes
C. Variable length instruction format
D. All of the above
19. What is the fixed length of the instruction format used in RISC processors?
A. 30-bits B. 16-bits C. 32-bits D. 24-bits

Discussion Questions

1. What do you understand by computer architecture? Is it same as computer organisation? If no, explain the
difference between the two.
2. Draw the block diagram of a computer system and explain its main components.
3. How does the control unit assist the CPU in carrying out its operations?
4. What do you understand by CPU cycle? What are the main operations accomplished using the CPU cycle?
C HA PTE R 3
MEMORY AND STORAGE SYSTEMS

Chapter Outline Chapter Objectives


3.1 Introduction In this chapter, we will learn:
3.2 Memory Representation ∑ The concept of memory and its
3.3 Random Access Memory representation.
3.3.1 Static RAM ∑ How data is stored in Random Access
3.3.2 Dynamic RAM Memory (RAM) and the various types of
3.4 Read Only Memory RAM.
3.4.1 Programmable ROM ∑ How data is stored in Read Only Memory
3.4.2 Erasable PROM (ROM) and the various types of ROM.
3.4.3 Electrically Erasable PROM ∑ The concept of storage systems and the
3.4.4 Flash ROM various types of storage systems.
3.5 Storage Systems ∑ The criteria for evaluating storage
3.6 Magnetic Storage Systems systems.
3.6.1 Magnetic Tapes
3.6.2 Magnetic Disks
3.7 Optical Storage Systems 3.1 INTRODUCTION
3.7.1 Read only Optical Disks
3.7.2 Write Once, Read Many Disks Computers are used not only for processing of data
3.8 Magneto Optical Systems for immediate use, but also for storing of large
3.8.1 Principle used in Recording Data volume of data for future use. In order to meet
3.8.2 Architecture of Magneto Optical Disks these two specific requirements, computers use two
3.9 Solid-State Storage Devices types of storage locations—one, for storing the data
3.9.1 Structure of SSD that are being currently handled by the CPU and the
3.9.2 Advantages of SSD other, for storing the results and the data for future
3.9.3 Disadvantages of SSD use. The storage location where the data are held
3.10 Storage Evaluation Criteria temporarily is referred to as the primary memory
Chapter Summary while the storage location where the programs
Key Terms to Remember and data are stored permanently for future use is
Review Questions referred to as the secondary memory. The primary
Fill in the Blanks memory is generally known as “memory” and the
secondary memory as “storage”.
Multiple Choice Questions
The data and instructions stored in the primary
Discussion Questions memory can be directly accessed by the CPU
44 Fundamentals of Computers

using the data and address buses. However, the information stored in the secondary memory is not directly
accessible to CPU. Firstly, the information has to be transferred to the primary memory using I/O channels
and then, to the CPU.
Computers also use a third type of storage location known as the internal process memory. This memory
is placed either inside the CPU or near the CPU (connected through special fast bus). Figure 3.1 illustrates
all the three categories of computer memory and their relative speed, storage capacity and cost.

Fig. 3.1 Memory categories

Primary memory (also known as main memory) includes two types, namely, Random Access Memory (RAM)
and Read Only Memory (ROM). The data stored in RAM are lost when the power is switched off and
therefore, it is known as volatile memory. However, the data stored in ROM stay permanently even after the
power is switched off and therefore ROM is a non-volatile memory.
Secondary memory (also known as auxiliary memory) includes primarily magnetic disks and magnetic
tapes. These storage devices have much larger storage capacity than the primary memory. Information
stored on such devices remains permanent (until we remove it).
Internal process memory usually includes cache memory and registers both of which store data
temporarily and are accessible directly by the CPU. This memory is placed inside or near the CPU for the
fast access of data.
We have discussed briefly cache memory and various registers used in Chapter 2. In this chapter, we
shall discuss the various types of memory units, RAM and ROM and their functions. We shall also discuss
the classification of storage devices such as magnetic disks, magnetic tapes and optical disks and their
functions.

3.2 MEMORY REPRESENTATION

As we discussed earlier, data being worked on is stored in the computer memory. In the memory, values
are represented by sequences of binary digits, known as bits. Most computers use a group of eight bits,
Memory and Storage Systems 45

known as a byte, to represent a character. How does the computer know what any particular sequence of
bits represents? We can think of memory as a “bunch” of bytes or cells into which we can place data. Each
cell, known as a data item, is assigned a unique number known as address (which is like the index in an
array). The CPU can identify each cell by its address as shown in Fig. 3.2.

Fig. 3.2 Memory representation

The byte is defined as the “smallest addressable unit” of memory. Most computers use groups of bytes,
usually 2 or 4, known as “words” to represent information.
Computer memories are often rated in terms of their capacity to store information. Typically, capacities
are described using the unit of byte as follows:
1 KB (Kilobyte) = 1,024 bytes
1 MB (Megabyte) = 1,048,576 bytes
1 GB (Gigabyte) = 1,073,741,824 bytes
1 TB (Terabyte) = 1,099,511,627,776 bytes
46 Fundamentals of Computers

3.3 RANDOM ACCESS MEMORY

Random Access Memory (RAM) is a volatile memory and loses all its data when the power is switched
off. It is the main memory of the computer system that stores the data temporarily and allows the data to be
accessed in any order. As compared to the secondary storage, the data can be accessed at a faster speed in
RAM because it is the internal memory of the computer. Figure 3.3 shows RAM with ICs.

Fig. 3.3 Random access memory with ICs


RAM is made up of different ICs, which are mounted on a printed circuit board. RAM stores the
application programs and the data on which the user is currently working so that the processor can easily
access the required application program and data in a less amount of time. RAM is also known as read/write
memory because it can perform both read as well as write operations. The speed of RAM is faster than the
other memory devices, such as hard disk, floppy disk, etc.
The programs, which are being currently executed by the computer system, are stored in RAM. RAM
is volatile and, therefore, the programs and the data stored in the RAM get lost when the power supply is
switched off. The storage capacity of RAM is usually less than the secondary storage devices.
RAM can be categorised into two main types, namely, Static RAM (SRAM) and Dynamic RAM (DRAM),
which can be further divided into various types for storing data. Figure 3.4 shows the hierarchy of RAM memory.

Fig. 3.4 Types of random access memory


Memory and Storage Systems 47

3.3.1 Static RAM


Static RAM (SRAM) is a type of
RAM in which data is stored till the
power of the computer system is
switched on. SRAM uses a number
of transistors to store a single bit of
digital information. Figure 3.5 shows
the organisation of data in a cell of
SRAM.
In the figure, b1 and b2 represent
the two bit lines and Wx represents
the word line. In the memory, the
data is stored in the form of a two-
dimensional array, containing rows Fig. 3.5 Organisation of data in a cell of static random access memory
and columns. The row can be accessed
globally by a line (known as word line) and the column can be accessed individually by a line (known as
bit line). Depending on the function performed by SRAM, it can be divided into the following three types:
∑ Asynchronous SRAM (ASRAM) ASRAM performs its operations without the use of system
clock. It makes use of three signals for working, namely, Chip Select (CS), Write Enable (WE) and
Output Enable (OE). The CS signal enables the processor to select the memory for performing read
and write operations. If the value of CS signal equals zero, then the memory is enabled to perform the
operations. On the other hand, if the value of the CS signal equals one, then the memory is disabled
and operations—such as reading and writing in ASRAM—cannot be performed. The signal WE makes
the decisions related to data, i.e., whether it should be read from or write to the memory. If the value
of WE signal equals zero, then no data can be read from or written to the memory. The signal OE is
an active low signal that enables the processor to give the output for the data. If the value of OE signal
equals zero, then only it will output the data.
∑ Burst SRAM (BSRAM) BSRAM works in association with the system clock and is also known as
synchronous SRAM. BSRAM is most commonly used with high-speed applications because the read
and write cycles are synchronised with the clock cycles of the processor. The access-waiting time gets
reduced after the read and write cycles are synchronised with the clock cycles. The speed and the cost
of BSRAM increases or decreases simultaneously.
∑ Pipeline Burst SRAM (PBSRAM) PBSRAM makes use of the pipeline technology in which a
large amount of data is broken up in the form of different packets containing data. These packets are
arranged in a sequential manner in the pipeline and are sent to the memory simultaneously. PBSRAM
can handle a large amount of data at a very high speed. It is the fastest type of SRAM because it can
operate at bus rates as high as 66 MHz.

3.3.2 Dynamic RAM


DRAM is the RAM in which data is stored in a storage cell, consisting of a transistor and a capacitor. TC
Unlike SRAM, the DRAM needs to be continuously refreshed with power supply because the capacitor has
the tendency to get discharged. DRAM retains the data for a very short span of time, even after the power
supply is switched off. Figure 3.6 shows the organisation of data in a cell of DRAM.
48 Fundamentals of Computers

Fig. 3.6 Organisation of data in a cell of dynamic random access memory

In Fig. 3.6, b1 represents a bit line and Wx represents a word line. The DRAM can be divided into the
following types:
∑ Synchronous DRAM (SDRAM) SDRAM performs its operations in the synchronous mode, i.e.,
in association with the clock cycle of the processor bus. It consists of two internal memory banks
such that if the address lines are sent from the first bank, then the address can be read by using the
second bank. The internal banks are used because the row and the column address lines need to be
charged for reading an address. SDRAM provides a synchronous interface in which it waits for a clock
signal before responding to a control input. Generally, it is used with the processors for storing the
data in a continuous manner. The continuous form of data storage helps in processing more number of
instructions per unit time that increases the speed of data access.
∑ Rambus DRAM (RDRAM) RDRAM designed by Rambus Inc. works at a faster speed, as
compared to SDRRAM. It is compact in size and uses 16-bit address bus. It provides the facility to
transfer data at a maximum speed of 800 MHz. It contains multiple address and data lines that help in
increasing the speed of data access. These multiple address and data lines help in performing different
read and write operations simultaneously. It is not popular among the users because of its high cost and
low compatibility.
∑ Extended Data Out DRAM (EDODRAM) EDODRAM can access more than one bit of data at
one time which helps in achieving faster data access rates. It provides the facility to perform various
operations at one time such as reading, writing, etc. It starts accepting the next bit of data immediately
after getting the first bit of data for performing read or write operation.
∑ Fast Page Mode DRAM (FPMDRAM) FPMDRAM makes use of paging in which read or write
operation is performed by selecting the address of the data from the rows and the columns of a matrix.
Once the data is read, the address of the particular column is incremented, so that the user can read the
next part of the data. The use of paging concept in FPDRAM does not allow to work with the buses at
the memory speed more than 66 MHz. As a result, a lot of time is consumed in reading and writing the
data from the matrix.
Memory and Storage Systems 49

3.4 READ ONLY MEMORY

ROM is the memory that stores the data permanently, i.e., it can retain the data even when the power of
the computer system is switched off. The data can be easily read from this type of memory but cannot be
changed. ROM is most commonly used in devices such as calculators, laser printers, etc.
ROM does not allow the random access of data rather it allows sequential access of data. It is less
expensive as compared to RAM and other storage devices, such as magnetic disk, etc. ROM is divided into
four types, which are as follows:
∑ Programmable ROM (PROM)
∑ Erasable PROM (EPROM)
∑ Electrically Erasable PROM (EEPROM)
∑ Flash ROM

3.4.1 Programmable ROM


Programmable ROM (PROM) is a memory chip on which the write operation of data can be performed
only once. The data is stored on this chip permanently, i.e., once a program is written on the PROM, it
cannot be erased or destroyed. To write the data on the PROM chip, a device known as PROM programmer
or PROM burner is required. The method of writing data on the chip is known as burning the PROM.
PROM is reliable and stores the data permanently without making any change in it. It is mostly used in
video games and electronic dictionaries.

3.4.2 Erasable PROM


Erasable PROM (EPROM) is a type of ROM in which data can be erased or destroyed using Ultraviolet
Light (UL). Erasable ROM provides the facility of changing the contents of the data, i.e., it can be
reprogrammed. It contains the floating gate transistors, which have the capability to hold an electric charge,
even when the power of the computer system is switched off. It also facilitates the storage of data for a
longer period of time.

3.4.3 Electrically Erasable PROM


Electrically Erasable PROM (EEPROM) is a type of ROM in which data can be erased or destroyed by
exposing it to an electric charge. It has the ability to retain the data stored in it, even if the power of the
computer system is switched off. It stores the data permanently but allows us to make changes in the data
by erasing it with the help of electric charges. In this type of memory, the data can be written or erased only
one byte at a time because of which it works very slowly.

3.4.4 Flash ROM


Flash ROM is a type of EEPROM that stores the information using floating-gate transistors, which can store
electric charge for a longer period of time as compared to the normal transistors. This memory is mainly
used in the memory cards of mobile phones, digital cameras and ipods for storing data. The data stored in
flash ROM memory can be easily transferred using transmission mediums such as data cable, bluetooth and
infrared technology. For example, we can transfer the data stored in flash ROM memory of mobile phone to
the memory of a computer using data cable. We can easily erase the data stored in flash ROM memory and
reprogram this type of memory. Flash ROM has faster speed of reading data, as compared to any other type
of ROM. It uses continuous memory cells for storing data.
50 Fundamentals of Computers

The memory cells of flash ROM are made up of floating-gate transistors. A Single-level Cell (SLC) can
store only one bit of data, whereas Multi-level Cell (MLC) provides the facility of storing more than one
byte. The two types of flash ROM memory are as follows:
∑ NAND flash In NAND flash or NAND gate flash memory, each cell behaves like a Metal Oxide
Semiconductor Field Effect Transistor (MOSFET), which has two gates for amplifying an electric
signal.
∑ NOR flash NOR gate flash or NOR flash memory provides the facility to write data or information,
with the help of tunnel injection. It can be defined as the process of inserting electrons to an electric
conductor using a layer of electric insulator. It also provides the facility to erase the instructions using
tunnel release.

3.5 STORAGE SYSTEMS

Storage systems are the devices—such as hard disks, optical disks and magnetic disks—used for data
storage. The main objective of the storage system is to permanently store data—which can be of any type, such
as images, videos and text—for future use. The storage systems provide the facility to use the data at any time.
Different storage systems have varying storage capacities. For example, the normal storage capacity of
Compact Disk (CD) is 700 Megabytes (MB). The storage systems can be classified as shown in Fig. 3.7.

Fig. 3.7 Classification of storage systems

3.6 MAGNETIC STORAGE SYSTEMS

Magnetic storage systems can be defined as the storage systems that store the data on a magnetised medium,
with the help of magnetised particles. Magnetic tapes, magnetic disks, hard disks, floppy disks are examples
of magnetic storage systems. The magnetic storage systems are non-volatile and provide the facility to store
any type of data, such as text, audio, video, image, etc. In case of magnetic storage systems, data can be
accessed randomly as well as sequentially. For example, we can access data sequentially from a magnetic
Memory and Storage Systems 51

tape and randomly from a magnetic disk. When data is accessed sequentially, the access time is directly
proportional to the searching point. In other words, if the searching point is near, then the access time is
less, and if the searching point is far, then the access time is more. On the other hand, when data is accessed
randomly, the access time is less.

3.6.1 Magnetic Tapes


Magnetic tapes are the plastic tapes with magnetic coating that are used for storing the data, such as text,
audio or video. Magnetic tapes are similar to the normal recording tapes, which are used for audio and
video recording. The data stored on the magnetic tapes can be accessed using the sequential access method.
The magnetic tape could be compared with a cassette in which, in order to listen to the third song, we have
to go pass the first two songs first. Similarly, in the magnetic tape, we cannot directly jump over to the third
song. Therefore, magnetic tapes are used in the cases where a large amount of data needs to be stored, but
performance is not a major issue. Magnetic tapes are best suited as the backup devices for storing a large
amount of the data. Figure 3.8 shows a magnetic tape.

Fig. 3.8 Magnetic tape

A magnetic tape usually consists of a tape of 1/2 or 1/4 inch wide, 600 to 3,000 feet long and is
wound on a spool in the form of a cartridge or a reel. A metal foil, called marker, is used to determine
the Beginning of Tape (BOT). When a write command is given, a block of data is written on the tape.
The next block is then written after a gap called Inter Block Gap (IBG). One block may contain one or
more records that are again separated by blank spaces known as Inter Record Gaps (IRG). A series of
blocks are written in this manner and the end-of-tape is described by the marker known as End of Tape
(EOT). After the data is written, the tape is rewound and kept ready for reading. The data is stored in
the form of tiny magnetised segments. A magnetised portion refers to the binary digit ‘1’ while the
non-magnetised portion refers to ‘0’.
Labelling can be done on a magnetic tape in order to retrieve any particular information when required.
Magnetic tape is easy to store and is less prone to damage as compared to the other storage devices, such as
hard disk, floppy disk, etc.
Generally 1/2 inch magnetic tape, consisting of either seven or nine tracks, is used for storing data.
These tracks are mainly decided by the read/write heads of the tape unit that helps in reading or writing the
data from or to the magnetic tape.
In magnetic tapes, the data is stored in the form of records and a set of different records is known as
file. The data of any size can be recorded on a magnetic tape but the length and the storage capacity of
the magnetic tape should be considered before storing the data. The speed of the magnetic tape should be
52 Fundamentals of Computers

predetermined for reading and writing data. When the magnetic tape moves at high speed, slows down or
stops, the data cannot be read or written to the tape.
Major advantages of magnetic tapes are:
∑ Low cost
∑ Large storage capacity
∑ Easily transportable
∑ Easy to handle and store
Major disadvantages of using magnetic tapes are:
∑ Low data transmission speed due to sequential access.
∑ Not suitable for random access.
∑ Require protected environment for storage.
∑ Updating, such as insertion or deletion is difficult.
∑ Fast wear-out.

3.6.2 Magnetic Disks


Magnetic disk is a flat disk that is covered with magnetic coating for holding information. It is a type
of secondary memory device that is used to store different programs and files. It is used to store digital
information in the form of small and magnetised needles. These needles help in encoding a single bit of
information by getting polarized in one direction represented by 1, and opposite direction represented by 0.
Magnetic disk can store a large amount of data and is less expensive as compared to RAM. As it takes
more time to read the information from a specified location, its data access rate is slow compared to the
main memory. It allows the random access of data and provides the facility of erasing and re-recording the
data as many times as required. Figure 3.9 shows a magnetic disk with sectors and tracks.

Fig. 3.9 Magnetic disk surface

Tracks are the concentric circles on the magnetic disk, having a common centre and containing a
block of recorded data. The thickness between two tracks affects the storage capacity of a magnetic disk.
If the thickness between the two tracks is less, then the magnetic disk can store a large amount of data. On
the other hand, if the thickness between the two tracks is more then less amount of data can be stored in the
Memory and Storage Systems 53

magnetic disk. The data is stored in a magnetic disk in the form of tiny dots on the tracks, which are known
as spots. The size of these spots should be small, in order to hold large amount of data and information.
The broken-up units of tracks are known as sectors. The data stored on the sectors is in the form of very
small unit, which can be read or written. The size of a sector in a magnetic disk is 512 bytes.
There are two popular types of magnetic disks:
∑ Hard disks
∑ Floppy disks
A hard disk, also known as a fixed disk, can hold a large volume of data and is used with large
computers. A floppy disk, a removable disk with relatively less storage capacity, is commonly used with
personal computers.
Major advantages of magnetic disks are:
∑ High storage capacity
∑ Easy, direct access to data
∑ Easily moveable from one place to another
∑ Better data transfer rate as compared to magnetic tapes
∑ Low cost compared to RAM
∑ Less prone to corruption of data as compared to tapes
The disadvantages of magnetic disks are:
∑ More expensive as compared to magnetic tapes.
∑ When used on-line, they are more susceptible to data corruption and data theft.
∑ Not ideally suitable, when the data files are to be read sequentially.
∑ Require dust-free environment.

3.7 OPTICAL STORAGE SYSTEMS

The optical storage systems are used for the same purpose as the magnetic storage systems. However, like
magnetic storage systems, the optical storage systems do not employ the magnetism medium to read and
store data. The optical storage systems use the laser light as the optical medium to retrieve as well as record
data. The following are some of the examples of optical storage systems:
∑ Compact Disk—Read Only Memory (CD-ROM)
∑ Digital Video Disc (DVD)
∑ Compact Disc—Recordable (CD- R)
∑ Compact Disc—Rewritable (CD-WR)
∑ Digital Video Disc—Recordable (DVD-R)
∑ Digital Video Disc—Rewritable (DVD-WR)
Note: The DVD disks have much higher storage capacity than the CD disks.
Like other storage systems, the optical storage systems are non-volatile in nature. Also, the optical
storage systems are more reliable as compared to the magnetic storage systems because they are less prone
to mechanical damage. Unlike magnetic storage systems, which are fully read and write-capable storage
devices, the optical storage devices are either read-only or writable. Among the writable optical storage
devices, those devices that can be used for writing data multiple times are termed as rewritable optical
storage devices. Some examples of read-only optical storage devices are CD-ROM and DVD, while some
examples of writable optical storage devices are CD-R, CD-RW and DVD-R.
54 Fundamentals of Computers

The following are some of the significant properties of the optical storage devices:
∑ Storage capacity Storage capacity refers to the amount of data that can be stored in an optical
storage system. It is directly proportional to the spot size and the geometrical dimensions of disk.
∑ Data transfer rate Data transfer rate refers to the speed at which data can be read from the optical
storage system. It depends on the linear density and the rotational speed of the drive.
∑ Access time Access time defines the time taken to access the desired data from the optical storage
systems. It is directly proportional to the weight of head and the rotation speed of the disk.
Major advantages of optical disks are:
∑ Large storage capacity
∑ Longer life span as compared to magnetic disks
∑ Lost cost per bit of storage
∑ Easily portable and stored
The disadvantages of optical disks include:
∑ Low data access speed as compared to magnetic disks.
∑ Drive mechanism is more complicated compared to that of magnetic disks.

3.7.1 Read-only Optical Disks


Read-only optical disk is a storage device that
provides the facility of storing data, such as audio,
video, and text. It stores the data permanently
and allows it to be accessed randomly, whenever
required. Read-only optical disks can store data
in the range of 700 MB. The data is burnt into
the read-only optical disks from a master disk.
The end users can read the data by using a disk
drive. Figure 3.10 shows an optical disk.

3.7.2 Write Once, Read Many Disks


Write Once, Read Many (WORM) disks allow
the end users to write the data onto the disk only
once. The burnt data can later be read as many
number of times. A WORM disk is also called
blank disk, since initially it does not contain any
data. To burn the data onto the WORM disk, a
CD writer device is required. Together with the Fig. 3.10 Optical disk
CD writer device and the appropriate burning
software, data can be written on to the disk. The main objective of WORM optical disk is to store the data
for backup use, i.e. these disks are used for writing the data once and storing it for a long period of time.
WORM disks are much cheaper than the read-only optical disks, which contain the data already burnt by
the manufacturer.
Memory and Storage Systems 55

3.8 MAGNETO OPTICAL SYSTEMS

Magneto Optical (MO) storage systems include the features of both magnetic and optical disks. The main
objective of the MO system is to store the data used in personal computers for a long period of time. It
reads/writes data by making use of laser and optical technologies. It has a ferromagnetic material enclosed
in the plastic coating. The laser beam used for reading data gets reflected due to the magnetic surface of the
disk. The MO system is not popular among the users because its speed is slower and manufacturing cost is
higher than other storage devices. These optical storage systems are available in two standard forms:
∑ 3.5 inch form factor
∑ 5.5 inch form factor

3.8.1 Principle used in Recording Data


The MO systems use Curie temperature for recording data. Curie temperature is the temperature at which
the material loses its magnetic properties and above this temperature the material becomes paramagnetic.
Paramagnetic is the form of magnetism at extreme magnetic field. The Curie temperature of the modern
MO systems is 200°C. The coercivity of a material can be defined as the resistance of the material against
magnetisation. Coercivity decreases at a higher temperature by applying magnetic field and provides the
facility of recording data. When the temperature of a material becomes equal to the room temperature,
its coercivity increases—that helps in preserving the magnetic data. Figure 3.11 shows the principle of
recording data in MO systems.

Fig. 3.11 Principle used in recording data

The basic requirements of a material used for recording in MO system are as follows:
∑ It should have low thermal conductivity that provides the facility to limit lateral heating.
∑ It should have a smooth surface and domain boundaries to decrease the system’s noise.
∑ The coercivity of the material should be high at room temperature.
∑ The melting point of the material should be high enough to provide stability.

3.8.2 Architecture of Magneto Optical Disks


The architecture or the design of MO disks includes various layers of materials, protective coating and laser
beam. The design of the MO disks defines the combination and the uses of anti-reflection layer, quadrilayers
56 Fundamentals of Computers

and amorphous metal. The anti-reflection layers are used to increase the light absorption. The quadrilayers
are used to decrease the reflection of light that provides the facility to decrease the requirement of laser
light. The amorphous metal is used as MO media. Figure 3.12 shows the design features of MO disks.

Fig. 3.12 Architecture of MO disks

3.9 SOLID-STATE STORAGE DEVICES

Solid-state Storage Devices (SSDs) were developed in 1978 by Storage Tek Company. In 1983, the Sharp-
5000 laptop computers developed by Sharp Corporation used SSD of 128 KB storage. In 1995, M-System
developed the SSD on flash based memory.
SSD can be defined as the device that contains all the properties of hard disk drives to store the data and
use solid-state memory, which has no moving parts. These devices do not use magnetic and optical medium
to store data. Rather, these devices use the semiconductor devices. The main objective of these devices is to
process the instructions electronically. SSDs have no mechanical parts due to which access time in case of
SSDs is less. This provides the facility of faster accessing of data as compared to any other storage devices.
The storage capacity of SSD is lower than that of the hard disk. The examples of SSD are flash memory
cards and Universal Serial Bus (USB) devices. These devices are widely used in laptops to store data. They
also prove to be of great use in the critical applications used in defence industry.

3.9.1 Structure of SSD


The structure of SSD basically uses the advantages, such as non volatility, low consumption and
high reliability of DRAM and NAND flash memory. These advantages of DRAM and NAND flash
memory help in creating SSD. The SSD created using the advantages of flash memory is called flash
memory based SSD. On the other hand, the SSD created using advantages of DRAM is called DRAM
based SSD. The flash memory based SSD is slower, as compared to the DRAM volatile memory.
DRAM based SSD provides the facility of accessing the data at a faster speed as compared to hard
drive and flash memory. It secures data using the backup storage system and battery, which allows us

flash memory is non-volatile ,removable & portable ,slow write but fast read
memory
Memory and Storage Systems 57

to save data by copying all the data from the RAM to the backup storage, when the power is switched
off due to any reason. It also works as a buffer memory. Nowadays, in case of power problem,
lithium-iron batteries are being used as back-up.

3.9.2 Advantages of SSD


Solid-state storage devices possess many advantages. They include:
∑ Better performance Performance includes various factors like accessing speed, searching and
spin-up function. SSDs provide random accessing of the stored data and their accessing speed is faster
as compared to the hard drives. The searching process of the required data is faster than the hard disk
drives. Moreover, they do not need any spin-up process to start-up.
∑ Low power and heat SSD provides the facility to decrease the power consumption due to low
storage capacity. They provide the facility to decrease the heat reduction due to low storage capacity,
except for the D-RAM based SSD.
∑ High reliability SSD provides constant and more reliable performance, as compared to hard
disk drives because the seek time, which is the delay associated with the reading or writing data on
computer’s disk drives, is constant in SSDs. They provide the facility of high mechanical reliability, as
they have no moving parts in their construction.
∑ Small dimension SSDs have low weight and small size, as compared to the weight and size of the
hard disk drives. The reason behind the less weight and the small size is the low storage capacity of the
SSD that also facilitates easy transportation.
∑ Small form factor Form factor defines the size and the dimensions of a physical device. SSD
provides small form factor to Ultra Mobile Personal Computers (UMPC) that can be very useful in the
market of Personal Computers (PC) for compact space.

3.9.3 Disadvantages of SSD


Apart from the various advantages, the solid-state storage devices possess some disadvantages too. These
include:
∑ High price The prices of SSD are high as compared to the prices of hard disk drives. Generally, the
price of SSD is 32 times more than the hard disk drives. However, their cost is decreasing these days.
∑ Low capacity The storage capacity of the SSD is lower, as compared to that of hard disk drives.
∑ Low writing speed The writing speed of flash memory based SSD is slower, as compared to the
writing speed of hard disk drives, due to the presence of large erased blocks.
∑ Low storage density Storage density can be defined as data per unit volume. It is low in case of
SSDs as compared to hard disk drives.
∑ Vulnerable SSD are affected by power loss, electrostatic discharge and magnetic fields, whereas
the hard disk drives are not affected by these processes. The data in the SSD can get damaged due to
electrical failures. The recovery of data damaged due to electrical failure is more difficult, as compared
to the data recovery in case of hard disk drives.
58 Fundamentals of Computers

3.10 STORAGE EVALUATON CRITERIA

Before selecting a memory device to store the data, we must evaluate critically the different characteristics
of storage systems. They primarily include:
∑ Access mode Access mode is used for accessing some specific data from the memory. The
different access modes include random access mode, sequential access mode and direct access mode.
In the random access mode, the data can be accessed randomly, i.e., without considering the location
of the required data. On the other hand, in the sequential access mode, the data and the information can
be accessed in a sequential manner, i.e., by specifying the location of the required data. In the direct
access mode, the data can be accessed by using both the random access mode and the sequential access
mode. Cassette player is an example of a device using sequential access mode because data is accessed
from it in a sequential manner only. On the other hand, CD player is an example of a device using
random access mode as well as direct access mode because data can be accessed from it randomly as
well as sequentially.
∑ Access time Access time refers to the time taken by the processor in completing the requests
made by the user for performing the read and write operations. The access time depends on the type of
storage device used and the access mode of the data. The access time of primary memory is faster than
that of the secondary memory.
∑ Storage capacity It refers to the storage space available in the computer system for holding the
data. In other words, storage capacity is defined as the size of the memory available for storing the data
in the system. The storage capacity is measured in terms of bytes and usually a large storage capacity is
desirable for storing the data. The storage capacity of the secondary memory devices is more than the
primary memory devices.
∑ Storage type It refers to the type of memory used to store the data. The storage type includes the
temporary and permanent memory. The temporary memory is also known as the volatile memory,
which is able to store the data only when the power or computer system is switched on. The permanent
memory is also known as the non-volatile memory, which is able to store the data, even when the
power or computer system is turned off.
∑ Cost It refers to the cost of the storage device used in the computer system for holding the data. It is
measured by determining the cost per bit of storage for a given storage capacity.

Chapter Summary
Computer systems use two types of memory, namely primary memory and secondary memory. Primary memory is
used to store data that is used by the CPU during processing. It consists of two types, RAM and ROM. RAM is a
volatile type of memory and stores data temporarily. On the other hand, ROM is a non-volatile memory and holds
data permanently.
Secondary memory includes magnetic disks, magnetic tapes and optical disks. Magnetic disks store data in
concentric circles known as tracks and these tracks are further divided into sectors. Magnetic tapes are used to store
data sequentially. Optical disks use an optical medium to store data and a laser diode to read data.
A hybrid version of magnetic and optical technologies known as magneto-optical disk is also available.
It employs a laser beam to read data and an electromagnetic head to write data. Storage systems developed using
solid-state technology have no mechanical moving parts, thus providing better data access speed.
Memory and Storage Systems 59

Key Terms to Remember

∑ Primary memory: It refers to the storage locations that are used to hold the programs and data temporarily in a
computer system. The primary memory is usually known as memory.
∑ Secondary memory: It refers to the storage locations that are used to hold the data and programs permanently.
The secondary memory of a computer system is popularly known as storage.
∑ Internal process memory: This type of memory is placed either inside or near the CPU. It is generally connected
to the CPU through special fast bus. Internal process memory usually includes the cache memory and the registers.
∑ RAM: It is a volatile memory in which data can be accessed in random fashion. Since it is a volatile memory, the
data and programs stored in it will be lost when the power is switched off.
∑ ROM: It is a non-volatile memory that is used to store data permanently.
∑ Byte: It is the smallest addressable unit of memory.
∑ Static RAM: It is a type of RAM in which data is stored till the power of the computer system is switched on.
Static RAM uses a number of transistors to store a single bit of digital information.
∑ Dynamic RAM: It is the RAM in which data is stored in a storage cell consisting of a transistor and a capacitor.
Unlike SRAM, the DRAM needs to be continuously refreshed with power supply because the capacitor has the
tendency to get discharged. DRAM retains the data for a very short span of time even after the power supply is
switched off.
∑ Programmable ROM: It is a memory chip on which the write operation of data can be performed only once.
∑ Erasable PROM: It is a type of ROM in which data can be erased or destroyed using ultraviolet light.
∑ Electrically Erasable PROM: It is a type of ROM in which data can be erased or destroyed by exposing it
to an electric charge. It has the ability to retain the data stored in it, even if the power of the computer system is
switched off.
∑ Flash ROM: It is a type of EEPROM that stores the information using floating-gate transistors.
∑ Magnetic storage systems: These are the storage systems that store the data on a magnetised medium with the
help of magnetised particles.
∑ Magnetic disk: It is a flat disk that is covered with magnetic coating for holding information.
∑ Magnetic tapes: These are the magnetic-coated plastic tapes, which are used for storing data and audio or
video files.
∑ Optical storage systems: It uses the laser light as the optical medium to retrieve as well as record data.
∑ Magneto Optical (MO) storage systems: These are the storage systems that include the features of both magnetic
and optical storage systems.

Review Questions

Fill in the Blanks

1. The data to be stored in the memory is assigned a unique number known as _________.
2. The permanent memory is also called _______ while temporary memory is called ________.
3. _________ and ________ belong to the primary memory of the computer system.
4. The ________ memory is kept near the CPU.
5. The data is stored in the memory by considering the _________ of the memory.
60 Fundamentals of Computers

6. The ________ includes the temporary and permanent memory.


7. _________ is the smallest unit of measurement in a computer system’s memory.
8. _________ and ________ are the two main types of RAM.
9. _______ performs its operations without the use of system clock.
10. RDRAM is compact in size and uses ________ bit address bus.
11. The memory, which is used to store the data permanently, is known as ________.
12. A computer system stores the data on a hard disk by using _______ and _______ methods.
13. A _________ is defined as a circle within a circle on the magnetic disk.
14. The broken-up units of tracks are known as ________.
15. The _________ is used in the hard disk in order to read or write the data from or to the specific tracks on
the disk.
16. ________ provides the facility of erasing and re-recording of data as many times as required.
17. ________ is also known as a diskette as it is flexible in nature.
18. An optical disk is the ________ memory storage device.
19. _________ reads/writes the data by making use of laser and optical technologies.
20. ________ are defined as the memory locations where the data and instructions are stored temporarily.

Multiple Choice Questions

1. Which one of the following memories is used to store data permanently?


A. Primary memory B. Secondary memory C. Cache memory D. Registers
2. Which of the following memory is the fastest type of memory?
A. Secondary memory B. Primary memory
C. Cache memory D. ROM
3. Which of the following is the cheapest type of memory?
A. Primary memory B. Registers C. Cache memory D. Secondary memory
4. Which one of the following memory is not a type of primary memory?
A. RAM B. ROM C. Cache D. SRAM
5. Which of the following statement is not true about RAM?
A. It is usually faster, as compared to the internal processor memory.
B. It is a volatile memory.
C. It is the type of primary memory of a computer system.
D. The data and information stored in the RAM is directly accessible by the CPU.
6. Which of the following is the auxiliary memory of the computer system?
A. ROM B. SRAM C. Magnetic tape D. Cache memory
7. The amount of space available in the computer system for holding the data is called:
A. Storage space B. Storage capacity C. Storage area D. Storage address
8. On which type of ROM, data can be written only once?
A. PROM B. EPROM C. EEPROM D. EROM

Magnetic tape is Sequential Access storage


Device & Magnetic, optical, and magneto-
optical disks are direct access storage
Device
The additional RAM chips, which plug into special sockets
on the motherboard, are known as single-in-line memory
modules (SIMMs)
shorter the clock cycle, faster the processor

New CPU whose instruction set includes instruction set of its


predecessor CPU is said to be backward compatible with its
predecessor
CISC Mostly used in
personal
Registers are part of the CPU (not main memory) of a
computers
computer
Memory and Storage Systems 61

9. In which memory, are the files and programs that are currently being used by a user, stored?
A. ROM B. RAM C. Cache D. Registers
10. Which of the following statement is not true about storage systems?
A. They are used to store data permanently.
B. They can store any type of data.
C. The data stored in these systems can be accessed at any time.
D. The data stored in these systems can be directly accessed by the CPU.
11. Which one of the following is not a type of magnetic storage system?
A. Magnetic tape B. Compact disk C. Hard disk D. Floppy disk
12. What does IBG stand for?
A. Inter bit gaps B. Intra byte gaps C. Intra block gaps D. Inter block gaps
13. Which of the following is a type of magnetic disk?
A. Hard disk B. Compact disk C. Digital video disk D. All the above
14. What is the medium used in optical storage systems for reading and recording data?
A. Ultraviolet light B. High-energy visible light
C. Laser light D. Black light
15. Which one of the following is not a type of optical disk?
A. Write-only optical disk B. Write once, read many optical disk
C. Read-only optical disk D. All of the above are optical disks
16. Which of the following temperature is used in MO systems as the recording medium?
A. Curie temperature B. Neel temperature
C. Room temperature D. Boiling point temperature
17. Which of the following is a solid-state memory?
A. Parallel serial bus B. Universal parallel bus C. Universal computer bus D. Universal serial bus

Discussion Questions

1. What do you understand by memory? List the two different categories of memory.
2. What is meant by internal processor memory? What is the advantage of having an internal process memory in a
computer system?
3. What is a RAM and why it is called so?
4. What is the difference between volatile and non-volatile memory? Is RAM a volatile or non-volatile memory?
5. What is the difference between primary memory and secondary memory of a computer system? List two
examples of secondary memory.
6. Differentiate between a bit, a byte and a word.
7. Describe the way of storing information in the memory of a computer system, with the help of a diagram.
8. What is the difference between static RAM and dynamic RAM? List different types of static and dynamic RAM.
9. Explain the concept of ROM by listing a few applications in which it is employed.
10. List different types of ROM with their key features.
11. What is meant by storage systems? What is the advantage of having storage systems in a computer system?

in magnetic disk Hard disks are of three types


Average access time $ Zip/Bernoulli disks
= Average seek time + Average latency § Disk packs
§ Winchester disks
C HA PTE R 4
INPUT DEVICES

Chapter Outline Chapter Objectives


4.1 Introduction In this chapter, we will learn:
4.2 Keyboard ∑ The input devices used for pointing the
4.3 Pointing Devices objects on the screen, such as mouse,
4.3.1 Mouse trackball and joystick.
4.3.2 Trackball ∑ The process of scanning documents with
4.3.3 Light Pen the help of different scanning devices,
4.3.4 Joystick such as hand-held scanner and flat-bed
4.3.5 Touchscreen scanner.
∑ The various optical recognition devices
4.4 Scanning Devices
that are used for recognising characters in
4.4.1 Hand-held Scanners
different application areas.
4.4.2 Flatbed Scanners ∑ The input devices, such as microphone
4.4.3 Drum Scanners and graphics tablet used in media.
4.4.4 Slide Scanners ∑ The data acquisition sensor, an advanced
4.5 Optical Recognition Devices input device, used for inputting data.
4.5.1 OCR Devices
4.5.2 OMR Devices
4.5.3 MICR Devices 4.1 INTRODUCTION
4.5.4 Bar Code Reader
4.6 Digital Camera Input devices are electromechanical devices that
4.7 Voice Recognition Systems are used to provide data to a computer for storing
4.8 Data Acquisition Sensors and further processing, if necessary. They act as
4.9 Media Input Devices an interface between the computer and the user.
Chapter Summary The basic task of an input device is to take the
Key Terms to Remember input from the user, translate it into the machine-
Review Questions readable form and then present it to the processing
Fill in the Blanks unit of the computer for execution. In effect, the
Multiple Choice Questions input devices provide a means of communication
Discussion Questions between the computer and the outer world.
The input may be in different forms, such as
numeric data, text commands, graphics, video
64 Fundamentals of Computers

and audio. We can provide the input to a computer in two ways, either manually through devices such as
keyboard and mouse, or directly from documents using devices such as scanners. Depending upon the type
or method of input, the input device may belong to one of the following categories:
∑ Keyboard
∑ Pointing devices
∑ Scanning devices
∑ Optical recognition devices
∑ Digital camera
∑ Voice recognition devices
∑ Media input devices
We shall discuss in this chapter briefly the operation and applications of these devices.

4.2 KEYBOARD

Keyboard is the most commonly used input device. We can use a keyboard to type data and text and execute
commands. A standard keyboard, as shown in Fig. 4.1, consists of the following groups of keys:
∑ Alphanumeric keys The alphanumeric keys include the number keys and alphabet keys. These
keys are arranged in the same style as in the normal typewriters, popularly known as QWERTY layout.
∑ Function keys The function keys are arranged in a row on the top of the keyboard. These keys help
perform specific tasks, such as searching a file or refreshing a web page.
∑ Central keys The central keys are used for controlling the movement of cursor and screen display.
These include arrow keys (for moving the cursor) and modifier keys such as SHIFT, ALT and CTRL
(for modifying the input).
∑ Numeric keypad The numeric keypad is located on the right side of the keyboard. This looks like
a calculator’s keypad with its 10 digits and mathematical operators.
∑ Special purpose keys The special purpose keys help perform a certain kind of operation, like
exiting a program or deleting some characters in a document. The various special purpose keys in a
keyboard are Escape, Insert, Delete, Print Screen, Pause, Tab, Spacebar, etc.
A standard keyboard would include about 100 keys. However, many manufacturers add special buttons
to perform some special tasks.

Fig. 4.1 The presently used keyboard


Input Devices 65

Keyboards are attached to the computer system with the help of a cable. Each key of the keyboard, when
pressed, sends a different signal to the processor. However, today wireless keyboards are also available that
work with the help of batteries. We can also classify the keyboards on the basis of additional keys present
in them. For example, multimedia keyboard and gaming keyboard are the keyboards, which are classified
on the basis of the additional keys present in them.

4.3 POINTING DEVICES

Pointing devices are the input devices that are generally used for moving the cursor to a particular location
to point an object on the screen. With the help of pointing devices, we can easily select the icons, menus,
windows, etc on the Graphical User Interface (GUI). Thus, the users can easily interact with a computer
system by means of a pointing device. We can simply change the position of the objects displayed on the
screen by first pointing at the object and then dragging it to the desired position. Some of the commonly
used pointing devices are:
∑ Mouse
∑ Trackball
∑ Light pen
∑ Joystick
∑ Touchscreen

4.3.1 Mouse
Mouse is a small hand-held pointing device that basically controls the two-dimensional movement of
the cursor on the displayed screen. It is an important part of the Graphical User Interface (GUI) based
Operating Systems (OS) as it helps in selecting a portion of the screen and copying and pasting the text.
The mouse, on moving, also moves the pointer appearing on the display device. The most commonly used
types of mouse are as follows:
∑ Mechanical mouse A mechanical mouse consists of three buttons: left button, right button and
scroll button. Inside the plastic coating of the mouse, there is a ball, which is rolled over a flat surface
corresponding to which the cursor moves on the display screen. The left button on the mouse is the
most frequently used button as it helps in selecting the icons, folders and text on the display screen.
The right button on the mouse helps in displaying the short cut menu, whereas the scroll button helps
in moving the cursor up and down on the screen by scrolling it. Figure 4.2 shows the upper and the
lower portion of the mechanical mouse.

(a) The upper portion (b) The lower portion


Fig. 4.2 Mechanical mouse
66 Fundamentals of Computers

∑ Optical mouse An optical mouse is a pointing


input device in which the reflected light determines the
movement of the cursor on the displayed screen. The
upper portion of the optical mouse is similar to that of
the mechanical mouse. The lower portion of the optical
mouse consists of a ball having Light Emitting Diodes
(LEDs), an optical sensor and a Digital Signal Processor
(DSP). Figure 4.3 shows the lower portion of the optical
mouse. Fig. 4.3 The lower portion of the optical mouse

4.3.2 Trackball
Trackball is a pointing device that basically consists of a socket
containing the ball, which can be rolled manually to move the cursor
on the screen. The socket also contains sensors, which detect the
movement of the ball. With the help of the trackball, we can change
the position of the cursor on the screen by simply rotating the ball
with our fingers or thumb. On the basis of size, the trackballs are
classified into two types, small trackball and large trackball. The
small trackballs are commonly used in portable computers, whereas Fig. 4.4 The trackball on the desk
the large trackballs find their use in the desktop computer systems,
which are used for computer-aided designing. One of the most important advantages of the trackball is that
it can be placed on different surfaces, such as desk, mouse pad and even user’s hand. The trackball finds its
use as a game controller in games like Centipede, Golden Tee and Marble Madness. Figure 4.4 shows the
trackball placed on a desk.

4.3.3 Light Pen


Light pen is an electro-optical pointing device
that is used for selecting the objects on the
display screen with the help of a light sensitive
pen. It is generally connected to the Visual
Display Unit (VDU) of the computer system.
The pen contains a light-sensitive diode, which
helps in pointing the objects displayed on the
screen. Using a light pen, we can directly draw
the objects on the screen by holding it in our
hand. When the tip of the light pen is brought
in contact with the screen, the light coming
from the screen causes a pulse to be generated
in the pen which in turn causes the processor
to identify the position pointed to by the pen.
Light pens provide all the capabilities
of a mouse. They do not require any pad or
horizontal surface and therefore, are useful
when desk space is limited. Figure 4.5 shows
the light pen attached to a computer system. Fig. 4.5 The light pen
Input Devices 67

4.3.4 Joystick
Joystick is a pointing device that usually consists of one or more
buttons and a stick, which controls the movement of the cursor
on the screen by pointing in all directions. It continues to point
in a particular direction until and unless it is brought back to the
vertical position. The trigger button, which is used to trigger some
kind of action like firing in game sequence, is made available
on a joystick. The joystick facilitates three types of control:
glide, direct and digital. The glide and the direct control allow
the movement of the joystick in all possible directions, i.e., left,
right, up and bottom. On the other hand, the digital control helps
in the movement of the joystick in limited directions. Earlier,
the joysticks could provide only 2D movements, but now, the
joysticks are capable of providing 3D movements as well. The
joystick is generally used in computer games, CAD systems,
industrial applications, etc. Figure 4.6 shows a joystick.
Fig. 4.6 Joystick
4.3.5 Touchscreen
Touchscreen is a pointing device that enables us to enter data such
as text, pictures and images by directly touching the screen. The
touchscreen is the display monitor with which the user can directly
interact with the computer system by touching the screen. These
devices do not make use of the keyboard and the mouse for inputting
the data in the computer system. The touchscreen is used in a variety
of applications, such as cell phones, ATM’s, PDA’s and games.
Figure 4.7 shows a touchscreen.
There are different types of touchscreen technologies used today.
They include:
Fig. 4.7 Touchscreen
∑ Surface wave technology This technology generally makes
use of ultrasonic waves, which are absorbed when they are passed through the touchscreen panel.
These waves are generally absorbed, when a user touches a point on the touchscreen pad. Then, these
absorbed waves are sent to the controller for further processing. This is greatly affected by elements
such as dust and water.
∑ Capacitive technology This technology makes use of indium tin oxide material, which is coated
on the touchscreen for providing continuous electric charge. In this, the touchscreen is provided with
circuits at each corner. When the user touches the screen, a small amount of charge is absorbed at
this point. This charge is then transferred by the circuits to the controller for further processing. The
touchscreens based on capacitive technology do not get damaged by elements such as dust or liquids.
∑ Resistive technology In this technology, the touchscreen panel generally consists of different
layers, which are coated with very thin electrically conductive metal and separated by some space.
When the user touches the panel at any point, the change in the electric current occurs that is passed
to the controller for further processing. The touchscreens based on resistive technology do not get
damaged by elements like dust or water.
68 Fundamentals of Computers

4.4 SCANNING DEVICES

Scanning devices are the input devices that can electronically capture text and images, and convert them
into computer readable form. The basic task of a scanning device is to convert an image or the textual
data into digital data, i.e., in the form of boxes, where each box represents either zero or one. The resultant
matrix is known as bit map and is displayed on the screen. The scanning devices can be differentiated from
each other on the basis of the following characteristics:
∑ Resolution Resolution is the closeness of the pixels in the bit map. The resolution of scanning
devices can vary from 72 to 600 dots per inch (dpi), depending on the bit depth. Bit depth represents
the number of bits used to represent each pixel of an image or a text.
∑ Size Some scanning devices are very small in size, whereas others are very big. The small sized
scanning device can scan approximately two to five inches of the document, whereas the large sized
scanning device can scan approximately up to forty inches of the document. Therefore, it follows that
the small scanning devices are appropriate for scanning small documents, whereas the large scanning
devices are appropriate for scanning large documents.
∑ Scanning technology Some scanning devices use Charged Coupled Device (CCD) arrays,
whereas others use Photo Multiplier Tubes (PMT) technology. The CCD consists of a series of light
receptors, which are sensitive to the variation in the light frequency. As the frequency of light changes,
these scanning devices detect the change and the output obtained after scanning also gets accordingly
changed. The PMT consists of a photocathode, which is a photosensitive surface used for generating
the electrons. PMT is used for identifying the light emitted by the weak signals.
On the basis of these characteristics, the scanning devices can be categorised as follows:
∑ Hand-held scanners
∑ Flat-bed scanners
∑ Drum scanners
∑ Slide scanners

4.4.1 Hand-held Scanners


Hand-held scanners are the scanning devices that are generally used for
digitising the images into bit map, which is a matrix of 0’s and 1’s.The
size of these scanners is small and the price is relatively less as compared
to the other three types of scanners. These scanners are also known as
half page scanners, as they can scan maximum upto 5 inches at a time.
The hand-held scanners are suitable for scanning small images rather
than the whole page of text or pictures. Figure 4.8 shows a hand-held
scanner.
The hand-held scanning devices are generally used for identifying
the bar-code label of the products. They are divided into two categories,
namely, contact scanning device and non-contact scanning device. The Fig. 4.8 Hand-held scanner
contact scanning device works by moving the tip of a light pen across
the bar-code label to capture the bar-code. The bar-code is a code comprising vertical bars of different
widths that can be read only electronically. The code captured by the scanning device is stored permanently
in the memory. The non-contact scanning device operates by pointing the gun to the bar-code label so as
Input Devices 69

to capture the code. These devices are comparatively more complex, heavier and costlier than the contact
scanning device.

4.4.2 Flatbed Scanners


Flatbed scanners consist of a flat surface composing
of glass pane on which the documents are kept for
scanning. Under this glass pane, there is xenon light
and a CCD, which consists of an array of red, green
and blue filters. The object to be scanned is put upside
down on the glass pane and the cover is lowered.
The light reflected from the document surface helps
in identifying the image or the text present in the
document. The scanning is done from left to right
horizontally, line by line and the procedure is repeated
until all the lines are scanned. Nowadays the flatbed
scanners are widely used in almost every organisation.
Figure 4.9 shows a flat-bed scanner.
The lid of flat-bed scanners is adjustable that
makes the scanning of different objects such as
documents and leaflets possible. The size of these Fig. 4.9 A flat-bed scanner
scanners usually starts from 8.5"×11", which is the
standard letter size. The flat-bed scanners are best suited for slides and photo scanning, as they provide the
optical resolution of 5,500 dots per inch (dpi).

4.4.3 Drum Scanners


Drum scanners generally consist of a large
drum, which is used for scanning the documents.
These scanners make use of the Photo Multiplier
Tubes (PMT) technology, instead of the CCD
technology. The resolution image of these
scanners is very high due to which they are very
expensive. The disadvantage of these scanners is
that they are slow in speed. Figure 4.10 shows a
drum scanner.
The drum scanners can usually scan the
documents having the size up to 8"×10" but there
are few drum scanners that can scan even up to
11"×24". The optical resolution of these scanners
ranges from 8000 dpi to 11000 dpi. These
scanners are suitable for scanning negatives. The
aperture, which is the opening space through Fig. 4.10 Drum scanner
which light can pass and scan the document, is
easily controlled by the drum scanners. In addition, the drum scanners can also control the sample area,
which is the area of the individual pixel scanned by the scanner.
70 Fundamentals of Computers

4.4.4 Slide Scanners


Slide scanners are used for scanning slides as well as film
negatives. The slides are created on a transparent base using
photochemical solution. The film negatives are the inversion of
the positive images. In order to scan the slide, it is put into the
tray, which is meant for scanning the objects. These scanners are
also known as film scanners as they can easily scan the original
image of the film. In the slides taken with this scanner, the
dark areas appear light and the light areas appear dark. These
scanners consist of a stepper motor and a CCD sensor, which
Fig. 4.11 A slide scanner
helps in scanning the film. Figure 4.11 shows a slide scanner.
The slide scanners are capable of scanning up to 35 slides at a time and offer an optical resolution
ranging from 4000 dpi to 4800 dpi. Slide scanners can efficiently scan negatives and black and white films.
With the help of slide scanners, we can very easily scan the photos and send them to our friends via e-mail
and the Internet.

4.5 OPTICAL RECOGNITION DEVICES

Optical recognition devices are used for recognising the characters optically. The optical recognition devices
basically make use of optical scanner for inputting data. Unlike keyboards, the optical recognition devices
do not enter the data by pressing the keys. Therefore, these devices help the user in saving a lot of time as
entering data through a keyboard is a time consuming task. The following are some of the commonly used
optical recognition devices:
∑ OCR devices
∑ OMR devices
∑ MICR devices
∑ Bar code reader

4.5.1 OCR Devices


Optical Character Recognition (OCR) devices scan a particular document by recognising its individual
characters and converting it into the editable form. These devices distinguish the dark area on the document
from the light areas for recognising the characters. The images scanned by the OCR device can be easily
edited and formatted on a computer system. These devices generally consist of the following three
components for the purpose of character recognition:
∑ Image scanner The basic task of the image scanner is to capture the text image, which is to be
recognised optically.
∑ OCR software and hardware The OCR software and hardware processes the text images
captured by the image scanner. In order to scan the document, firstly it is analysed so as to extract the
character images. After analysing, the character images are recognised according to their shapes.
∑ Output interface The output interface helps in establishing communication between the OCR
devices and the outside world.
Input Devices 71

Figure 4.12 illustrates the basic function of an OCR system. The paper document is fed into the optical
scanner for scanning. The optical scanner typically scans the text and converts it into machine readable
form using the OCR software. The document displayed on the user’s computer is in the editable format.
The OCR devices basically make use of photoelectric cells for recording the patterns of the light reflected
by the printed text. These patterns are recognised for the identification of the characters represented by
them. The software program also recognises the character images and converts them into character code
data, if any color change exists in the image. The OCR devices are popularly used in telebanking and in the
processing of credit cards.

Fig. 4.12 Illustrating the basic functioning of an OCR device

4.5.2 OMR Devices


The Optical Mark Recognition (OMR) devices
make use of OMR technology, which helps
in obtaining the data from the marked fields.
These devices prove to be of great use in
recognising characters in question sheets,
enrolment forms, registration forms, employee
payroll, etc. Most popularly, the OMR devices
are used for scanning the documents having
multiple choices as in the question papers used Fig. 4.13 Illustrating the functioning of the OMR device
in schools, colleges, etc. The correct answer is
marked by the student in the boxes with the dark pencil or ink while answering. The OMR device consists
of OMR reader, which is a special device that helps in recognising the marks on the predefined box areas.
The OMR devices do not scan the entire document sheet. Instead, they analyse the darkened area only to
check whether it is marked or not.
Figure 4.13 illustrates the basic use of the OMR device. The document having marked and unmarked
boxes is fed into the OMR device for scanning. The OMR device will scan only the box area and not the
whole document. The OMR device generally scans the documents accurately and quickly. It can scan
maximum 10000 documents per hour.

4.5.3 MICR Devices


Magnetic Ink Character Recognition (MICR) devices are the special devices used for recognising the
characters written with magnetic ink consisting of iron oxide particles. These devices were specially
developed for the banking operations. The details on the bank cheques, such as cheque number, bank and
branch code are written with the magnetic ink. The MICR devices process the cheque, identify the numeric
characters and store the data on the disk. The characters present at the bottom of the cheque are in human
72 Fundamentals of Computers

readable form and can be recognised, even if the cheque has become trampled or dirty. If a copy of the
cheque is made with the help of coloured photocopy scanning machine, then the characters written with the
magnetic ink will simply not respond. This provides an extra level of security in the banks for the protection
of the cheques from illegal copying.
Figure 4.14 illustrates the basic functioning of an MICR device. The bank cheque containing the
magnetic characters is fed into the MICR scanner for processing. The MICR scanner consists of MICR
toner, which produces magnetic charge for reading the MICR line. The MICR scanner scans the cheques at
a faster speed, and thus helps in saving a considerable amount of time while processing the cheques.

Fig. 4.14 Illustrating the basic functioning of the MICR device

4.5.4 Bar Code Reader


Bar code reader is the scanner that usually reads bar code, which is used to label the items in the super
markets, retail stores, books numbering in library, etc. The bar code is the computer readable code
representing vertical lines of different widths. The bar code reader basically consists of a scanner, decoder
and cable. The scanner is used for scanning
the bar code, which is later converted into
numbers or letters using decoder. Finally, the
decoded data is sent to the computer system
via cable for processing.
Figure 4.15 illustrates the basic use of
the bar code reader. The bar code is scanned
with the help of the bar code reader, which
directs the light beam over the bar code. Fig. 4.15 Illustrating the basic functioning of the bar code reader
A part of the beam is reflected back from the
bar code by the sensor. Then, this light energy is converted into electrical energy by the bar code scanner.
Finally, the electrical energy is transformed into data and forwarded to the computer system.

4.6 DIGITAL CAMERA

A digital camera is a handheld electronic device that is used to capture the image of an object electronically.
The digital camera consists of a built-in computer, which helps in recording the images electronically.
Whenever a user initiates the process of capturing an image by pressing the button available on the camera,
Input Devices 73

the image light enters the camera through the lens. This light gets stored on a microchip consisting of an
array of light sensitive sensors. The light sensitive sensors are the charge-coupled devices (CCD) that
consist of a number of light sensitive diodes known as photosites. These diodes convert light into electric
charges called electrons. These charges are in the analog form but are later converted into the digital form
using the analog to digital converter. The following are the main features of the digital camera:
∑ It is capable of capturing and storing thousands of images on a single memory chip.
∑ It is capable of editing as well as deleting the images.
∑ It is capable of recording the video clip with sound.
∑ It is capable of showing the just recorded video clip on the camera screen.
Figure 4.16 shows the front and the rear view of a digital camera.
The digital cameras can be classified into the following types:
∑ Video cameras Video cameras
are the digital cameras that capture an
image by converting it into horizontal
lines and then scanning each line from
top to bottom. The two main types of
video cameras include professional
video cameras and camcorders. The
professional video cameras are used
for recording the moving images and
are mostly used in film studios. On
the other hand, the camcorders are not
only used for capturing images but
Fig. 4.16 The front and the rear view of the digital camera
also help in recording audio. These
video cameras consist of a Liquid Crystal Display (LCD) for displaying the captured picture and the
built-in recorder for recording audio.
∑ Compact digital cameras Compact digital cameras are very small in size, and hence can
easily be carried by a person. These cameras do not contain advanced features for capturing an
image. Therefore, the quality of the picture produced by the compact digital cameras is not as good
as the pictures produced by the other cameras. The images are stored in these cameras in the Joint
Photographic Experts Group (JPEG) format.
∑ Digital single-lens reflex cameras Digital single-lens reflex cameras consist of a mirror
and a pentaprism that are used for capturing the image digitally. The light entering through the lens
is reflected by the mirror attached with the lens. It then passes through the pentaprism to reach the
eyepiece of the camera. These cameras have live preview feature, which helps in previewing the
captured image before taking the final photograph.
∑ Line-scan camera Line-scan camera consists of an array of image sensors. These cameras capture
the image in the form of lines and then scan the image line by line. These cameras capture the images
very quickly and their image resolution is also very high.
The image captured by a digital camera is in the digital format and can be easily downloaded on
a computer system. By using a digital camera, the photographs can be developed in a considerably less
amount of time and that too, at a very low price. The quality of the pictures captured by a digital camera
depends on the resolution factor. The more the resolution of a digital camera, the better is the image quality.
74 Fundamentals of Computers

4.7 VOICE RECOGNITION SYSTEM

The voice recognition devices generally record the voice of a person and transform it into electrical signals.
The electrical signals are then converted into the machine readable code. The voice recognition system only
recognises the voice of the speaking person rather than what he speaks. The following are the two methods,
which are used to identify the voice with the help of voice recognition system:
∑ Template matching This method of voice recognition is speaker dependent, i.e., this method
matches the words spoken by the users to the predefined templates. In this method of voice recognition,
a phrase or a word is spoken by the user into the microphone. This phrase or word is then converted
into the machine readable code by the analog to digital converter (A/D converter). The output of the
A/D converter is compared with the voice templates, which are the digitised entries stored in the
database. This comparison is performed by the voice recognition software. The biggest limitation of
this system is the availability of limited vocabulary that consists of only the words, which have been
used in the training sessions.
∑ Feature analysis This method of voice recognition is speaker independent as it does not match
the speaker’s voice with the predefined templates, rather just processes the voice input by means of
fourier analysis. It is the process of changing the frequency of the voice input. The output of the fourier
analysis is matched with the stored voice input template for finding the featuristic similarities between
the two. The major limitation of the feature analysis method is that it fails to match the accents,
volume, pitch and inflection of different users.
The voice recognition devices are used for various purposes such as dictation, training air-traffic
controllers, etc. These systems allow users to communicate with computers directly without using a
keyboard or mouse. They are ideal for people who are visually impaired.

4.8 DATA ACQUISITION SENSORS

Sensors are the devices that are used for detecting and measuring the physical quantities, such as heat
and temperature and converting them into electrical signals. The sensors are most commonly used in data
acquisition systems. The data acquisition system collects the electrical signals from various devices and
converts them into the digital signals for further assessment.
The data acquisition sensor is one of the most important components of the data acquisition system as
it helps in detecting the electrical properties of different signals such as resistance. The data acquisition
system simply accepts these signals and converts them into the digital format. The computer system, which
is used for communicating with the data acquisition system, helps in gathering the signals. As per the
requirements of the users, the data acquisition system can be constructed as a simple or a complex system.
The data acquisition system is generally portable, battery operated and easy to use.

4.9 MEDIA INPUT DEVICES

The input devices, which are generally used in media for communicating with the mass audiences, are
known as media input devices. The following are the most popularly used media input devices:
∑ Microphone It is an input device that basically converts the sound waves into electrical signals
with the help of sensors. The sound wave pattern is converted into the electrical pattern, which is either
Input Devices 75

in the form of voltage or current. The microphones are also called


transducers as they transform one form of signal into another. The
cable used for connecting the microphones should be less than
10 feet so that it helps in avoiding noise disturbances. A number of
techniques—such as capacitance change, electromagnetic generation,
magnetic change and resistance change—are used for the conversion
of signals. The microphones are used in various applications, such
as radios, tape recorders and telephones. Figure 4.17 shows a
microphone.
∑ Webcam It is an input device that is usually attached to the user’s
computer for recording videos as well as images. It functions like a
video camera and can be used for displaying the images over the
Internet. With the help of a webcam, the users can easily participate
Fig. 4.17 A microphone
in video conferencing, which is the online video communication
between two persons. The quality of the video
taken through the webcam largely depends
upon two factors—frame rate and resolution. FR
The frame rate is defined as the frequency of
the images captured per second by a webcam.
On the other hand, the resolution is defined
as the number of pixels appearing on the
computer screen. For a video to be smooth
and clear, the frame rate and the resolution
should be maximum. Today, the webcams
have become very popular and are widely
used in a number of applications. Figure 4.18
shows the web cam.
∑ Graphics tablet It is a media input Fig. 4.18 The webcam
device with the help of which a user can enter
pictorial information into the computer system. The graphics tablet is a combination of a digitising
pen and an electronic tablet. The digitising pen is similar to the ballpoint pen and has an electronic
head for drawing the images. The digitising pen
is also known as cursor or stylus. The electronic
tablet refers to the flat surface, which is used for
converting the movement of the pen into the
digital signals. These digital signals are sent to
the computer system and are represented on the
display screen. The image drawn on the tablet
is visible on the display screen rather than on the
tablet itself. The graphics tablet helps in drawing
more accurately as compared to the mouse. The
graphics tablet is commonly used for technical
drawings and Computer System Design (CAD)
systems. Figure 4.19 shows the graphics tablet Fig. 4.19 The graphics tablet with a pen
with a digitising pen.
76 Fundamentals of Computers

Chapter Summary
Input devices are the hardware devices that help in inputting the data from any outside source into the computer
system. There are various input devices, with the help of which a user can enter different types of data into the
computer system. Keyboard is one of the most widely used input devices for providing alphanumeric information
to the computer. A user simply presses these buttons for entering the data into the computer system. The user can
also input data into a computer system with the help of pointing devices such as mouse, trackball, light pen joystick
and touchscreen. The user can easily select the objects, menus and icons available on the screen using a pointing
device. These devices basically control the movement of the pointer on the screen. Apart from the pointing devices,
different scanning devices are also available, which are used for capturing the text and the images and converting
them into the graphical image. A variety of scanning devices are available for scanning the documents, such as
hand-held scanners, flatbed scanners, drum scanners and slide scanners.
Optical recognition devices are used for recognising the characters optically. These devices make use of optical
scanner for scanning documents and images. OCR device, OMR device, MICR device and bar code reader are the
various types of optical recognition devices. Voice recognition devices are used for recognising the voice of the
user. These devices generally record the voice of a person and transform it into electrical signals. Devices—such as
microphone, webcam and graphics tablet—generally used in media are known as media input devices. Apart from
these commonly used input devices, there are certain advanced devices—such as data acquisition sensors—that are
used for inputting the data.

Key Terms to Remember

∑ Input device: It is an electromechanical device that is generally used for entering information into a computer
system.
∑ Keyboard: It is a computer input device consisting of keys or buttons arranged in the similar fashion as they are
arranged in a typewriter.
∑ Pointing devices: These are the input devices used for moving the cursor to a particular location to point an object
on the screen.
∑ Mouse: It is a pointing device that basically controls the two-dimensional movement of the cursor on the displayed
screen.
∑ Trackball: It is a pointing device consisting of a socket containing the ball that can be rolled manually to move the
cursor on the screen.
∑ Light pen: It is a pointing device containing the light-sensitive element, which is used for selecting the objects
displayed on the screen.
∑ Joystick: It is a pointing device that consists of one or more buttons and a stick that controls the movement of the
cursor on the screen.
∑ Touchscreen: It is a pointing device that enables the users to enter data such as text, pictures and images by
directly touching the screen.
∑ Scanning devices: These are the input devices that electronically capture text and images and convert them into
computer readable form.
∑ Hand-held scanner: It is a scanning device used for digitising the images into bit map.
∑ Flatbed scanner: It is a scanning device that consists of a flat surface composing of glass pane on which the
documents are kept for scanning.
Input Devices 77

∑ Drun scanner: It is a scanning device consisting of a large drum that is used for scanning the documents.
∑ Slide scanner: It is a scanning device used for scanning slides as well as film negatives.
∑ OCR devices: These devices scan a document by recognising its individual characters optically and converting it
into the editable form.
∑ OMR devices: These are input devices are used for electronically recognising the characters written in the marked
fields only.
∑ MICR devices: These are input devices used for recognising the characters written with the help of magnetic ink.
∑ Bar code reader: It is a scanning device used to read bar codes labelled on different items.
∑ Digital camera: It is a handheld electronic device that is capable of capturing videos as well as graphical images
electronically.
∑ Video cameras: These are the digital cameras that capture an image by converting it into horizontal lines and then
scanning each line from top to bottom.
∑ Compact digital cameras: These are the small-sized digital cameras that lack some of the advanced image
capturing features.
∑ Digital single-lens reflex cameras: These cameras consist of a mirror and a pentaprism used for capturing the
image digitally.
∑ Light-scan cameras: These cameras consist of an array of image sensors and are used to capture an image in the
form of lines. After capturing an image, it scans the image line by line.
∑ Voice recognition system: It is a system that recognises the voice of an individual and converts it into the machine
readable code.
∑ Data acquisition sensors: These are the devices used for detecting and measuring the different physical quantities
and converting them into electrical signals.
∑ Media input devices: These are the input devices used in media for communicating with the mass audiences.
∑ Microphone: It is a media input device that converts the sound waves into the electrical signals with the help of
sensors.
∑ Webcam: It is a media input device that is attached with the computer for recording videos as well as images.
∑ Graphics tablet: It is a media input device that helps a user to enter pictorial information into the computer
system.

Review Questions

Fill in the Blanks

1. An input device generally acts as an interface between ___________ and __________.


2. The ___________ layout was generally used in the traditional keyboards.
3. The arrow keys used for controlling the movement of ___________ are known as ___________keys.
4. Keyboards are also classified as ___________ and ___________ keyboards, based on additional keys present on
them.
5. ____________ devices are used for changing the position of the cursor on the screen.
6. A mechanical mouse basically consists of _____________, ___________ and __________ buttons.
7. An optical mouse consists of ________________, ___________________ and ___________ for moving the
position of the pointer on the screen.
78 Fundamentals of Computers

8. In case of trackball, ___________ is used for effecting the movement of the cursor on the screen.
9. ____________ device consists of a light- sensitive diode, which is used for pointing the objects on the screen.
10. The ___________, ____________ and ____________ are the different types of controls provided by joystick.
11. __________ devices are used for inputting data into a computer system with the help of human touch.
12. _____________devices are used for converting the images into machine-readable form.
13. Hand-held scanners are also called ______________.
14. ________________ scanners use red, green and blue filters.
15. Drum scanners make use of ________________ technology for scanning a particular document.
16. Slide scanners also known as _________scanners.
17. The OCR devices make use of_____________ for recognising the characters on the document.
18. _______________ devices are used for recognising the characters written only in the marked fields.
19. A MICR device basically recognises the numerals written with the ____________ ink.
20. ______________ is the computer readable code representing the vertical lines of different widths.
21. ___________ is the hand-held device used for capturing images and videos.
22. The methods used for recognising the voice of the users are ___________ and _____________.
23. ________________helps in detecting the electrical properties of different signals.
24. _____________ input device is used for converting the sound waves into the electrical waves.
25. Graphics tablet is the combination of ____________ and _________________.

Multiple Choice Questions

1. What is the main function of an input device in a computer?


A. Receiving data from a computer B. Providing data to a computer
C. Storing data for processing D. Processing the data
2. Which of the following devices is not an input device?
A. Scanner B. Keyboard C. Disk D. Joystick
3. Which one of the following is a modifier key?
A. Tab B. ALT C. Insert D. Pause
4. Which of the following belongs to the category of special purpose keys?
A. Tab B. SHIFT C. ALT D. CTRL
5. Which of the following device is not a pointing device?
A. Joystick B. Mouse C. Trackball D. Scanner
6. Which of the following statements is not true for a mouse?
A. It controls the two-dimensional movement of the cursor on the displayed screen.
B. It is usually of two different types: mechanical mouse and optical mouse.
C. It can be used as an alternate to keyboard for all purposes.
D. It is an input device.
7. Which pointing device exhibits the point, click and drag functions?
A. Trackball B. Joystick C. Mouse D. Light pen
Input Devices 79

8. Which of the following technologies is not a part of an optical mouse?


A. LED B. DSP C. Optical sensor D. CCD
9. Which of the following indicates the location on the computer screen?
A. Scroll bar B. Light pen C. Cursor D. Track ball
10. Which of the following devices is used for pointing in all directions?
A. Light pen B. Joystick C. Trackball D. Mouse
11. Which one of the following technologies is not a touch-screen technology?
A. Surface wave technology B. Capacitive technology
C. Resistive technology D. Inductive technology
12. What is the other name of a hand-held scanner?
A. Drum scanner B. Slide scanner C. Half page scanner D. Full page scanner
13. Which scanning device consists of a stepper motor and a CCD sensor?
A. Drum scanner B. Slide scanner C. Flatbed scanner D. None of the above
14. Which of the following device is not an optical recognition device?
A. MICR B. OMR C. OCR D. Microphone
15. Which of the following devices makes use of photoelectric cells for character recognition?
A. Hand-held scanner B. OCR C. OMR D. Bar code reader
16. What does MICR stand for?
A. Magnetic Ink Character Recognition B. Magnetic Input Column Reader
C. Magnetic Ink Column Recognition D. Magnetic Ink Character Reader
17. Which device is used for scanning the question sheet having multiple choices?
A. Drum scanner B. OMR device C. OCR device D. Flatbed scanner
18. Which of the following devices are used for recognising the characters in the supermarkets?
A. OCR device B. OMR device C. MICR device D. Bar code reader
19. Which device is used for reading the characters written on the cheques?
A. Hand-held scanner B. Light pen C. MICR device D. OCR device
20. Which of the following devices help in viewing a video clip just after it has been recorded?
A. Joystick B. Webcam C. Digital camera D. All of the above
21. Which of the following device is not a media input device?
A. Microphone B. Webcam C. Digital camera D. Graphics tablet

Discussion Questions

1. What is meant by an input device? What is the importance of an input device in a computer system?
2. List different categories of input devices.
3. Explain all the categories of keys found on a typical keyboard with the help of a diagram.
4. What are pointing devices? List different types of pointing devices.
5. Explain the basic functioning of mechanical and optical mouses with the help of sketches.
6. How does light pen help in inputting data into a computer system?
C HA PTE R 5
OUTPUT DEVICES

Chapter Outline Chapter Objectives


5.1 Introduction In this chapter, we will learn:
5.2 Display Monitors ∑ Different output devices used to present
5.3 Printers the processed data to the users.
5.4 Impact Printers ∑ Different types of display monitors.
5.4.1 Dot Matrix Printers ∑ Working of printers and plotters.
∑ How printers and plotters are classified
5.4.2 Daisy Wheel Printers
into various categories.
5.4.3 Drum Printers ∑ Different types of voice output devices.
5.5 Non-impact Printers ∑ How projectors and terminals function.
5.5.1 Ink-jet Printers
5.5.2 Laser Printers
5.5.3 Special Purpose Printers 5.1 INTRODUCTION
5.6 Plotters
Output devices are essential part of a computer
5.6.1 Drum Plotters
system. They receive the processed data
5.6.2 Flat-bed Plotters (information) from the CPU and present it to the
5.6.3 Ink-jet Plotters user in a desired form. They act as an interface
5.6.4 Electrostatic Plotters between the computer and the user. The main task
5.7 Voice Output Systems of an output device is to convert the machine-
5.8 Projectors readable information into human-readable form
which may be in the form of text, graphics, audio
5.9 Terminals
or video. Depending upon the form of output
Chapter Summary required, the output device may belong to one of
Key Terms to Remember the following categories:
Review Questions • Display monitors
Fill in the blanks • Printers
Multiple Choice Questions • Plotters
• Voice output systems
Discussion Questions
• Projectors
82 Fundamentals of Computers

While the printers and plotters provide the physical form of output known as hard copy, the display
monitors, voice output systems and projectors provide temporary output known as soft copy. Unlike hard
copy, soft copy is not a permanent form of output.
In this chapter, the principle of operation and application of some of the popular output devices will be
discussed briefly.

5.2 DISPLAY MONITORS

Display monitors are the most commonly used soft copy output devices. Earlier the display monitors were
capable of displaying the characters only in a single font and in a single colour. These characters were
arranged in a rectangular grid on the screen. The display screens, which are available today, support many
fonts and colours. Different types of display monitors use different technology for displaying the data. On
the basis of technology used display monitors may be classified into three categories:
1. Cathode Ray Tube Monitor
2. Liquid Crystal Display Monitor
3. Thin Film Transistor Monitor

5.2.1 Cathode Ray Tube (CRT) Monitor


A CRT monitor contains an empty glass tube with a phosphor coated fluorescent screen and a source of
electrons known as electron gun. This glass tube containing screen and electron gun is known as a CRT.
When the CRT gets heated due to the current flowing through it, the electron gun present inside the CRT
emits a beam of electrons, which hits the screen comprising small dots known as pixels. The striking of
electron beam on the phosphor coated pixels results in emission of light. The intensity of light emitted at
a certain point varies with the force with which the electron beam strikes the screen. The electron beam
scans across the screen due to the deflection caused to it by the electromagnetic coils present in the glass
tube. This scanning of screen by the electron beam produces an image on the screen and the variation in
the intensity of emitted light enables the human eyes to see the image thus produced. Figure 5.1(a) and (b)
show a CRT monitor and the internal components of a CRT.

Fig. 5.1 A CRT monitor and the internal components of a CRT

A CRT monitor has many advantages, such as a high contrast ratio and colour depth because of which
many graphic designers prefer this type of display monitors. It also provides a change in the resolution
without affecting the clarity of the picture. Though CRT monitor has many advantages, there are some
Output Devices 83

disadvantages associated with it. It is very bulky and occupies a lot of space on the desk. It also consumes a
lot of power and produces a large amount of heat.

5.2.2 Liquid Crystal Display (LCD) Monitor


An LCD monitor uses liquid crystals technology to
display the images. The liquid crystals are actually
the molecules of the liquid filled in the LCD. These
molecules easily flow in different directions and
have the capability to bend a beam of light. Each
pixel on the LCD screen contains a number of
liquid molecules layered between two transparent
electrodes and crossed polarising filters. The liquid
molecules uphold their directions and remain
in the same position with respect to each other.
As the light falls on the molecules, they bend the
light and direct them towards a polarising filter.
The polarising filter absorbs the light making the
polariser appear dark for the display of images.
Figure 5.2 shows an LCD monitor.
An LCD monitor is small in size and light Fig. 5.2 An LCD monitor
in weight so it occupies less space on the
desk. Also, the power consumption by an LCD monitor is very less as liquid molecules need less power
to bend light. There are a few disadvantages of using an LCD monitor. It has a fixed resolution due to
which the images on an LCD monitor become blurred when the resolution is changed. The clarity of
the images also gets reduced when the images on an LCD monitor move at a fast rate or, say, when the
rate of change of images on the screen is high. Moreover, it has a weak colour quality as compared to a
CRT monitor.

5.2.3 Thin Film Transistor (TFT) Monitor


A TFT monitor is similar to an LCD monitor except
for one difference that it uses thin film transistor
technology along with liquid crystal technology to
improve the quality of the image (unlike LCD, which
uses only the liquid crystal technology). For each
pixel on the screen, a small transistor switch as well
as a capacitor is used and each pixel is controlled
separately. A row scan driver turns on the transistor
switch to charge the capacitors of all the pixels in a
particular row. The transistor is switched off as soon
as the capacitors get charged. When the transistor is
switched off, the capacitor maintains the same voltage
of the pixels till the transistor is switched on again by
the row scan driver. Figure 5.3 shows a TFT monitor.
Fig. 5.3 A TFT monitor
84 Fundamentals of Computers

5.3 PRINTERS

Printers are the most widely used output devices in real life applications. A printer is a computer hardware
that generates the hard copy of the information processed by a computer system. The hard copy produced
by the printer can be in the form of a paper or any other physical printing medium. To produce a hard copy,
first the printer is connected to a computer with the help of a cable and then the print command is given by
the user through the user interface of the computer. The output on the hard copy produced by a printer can
be preserved for a long time as compared to the output displayed on the display monitors. Based on the
features, such as colour, resolution, memory and speed possessed by the printers, they are classified into
many types. Some printers have a very high printing speed, whereas others have a slow printing speed.
Moreover, all computers cannot produce multicoloured printouts. Some of them produce single colour
printouts only. On the basis of their working principles printers can be classified into two major categories,
namely impact and non-impact printers.

5.4 IMPACT PRINTERS

Impact printers are those printers in which there exists a mechanical contact between print head and paper.
Print head is the part of the printer that resembles a hammer and is responsible for transferring the ink to the
paper in the form of required characters. Impact printer contains an individual print head for each character.
The print head of a character strikes the ink ribbon, and the ink ribbon in turn strikes the paper, leaving an impression
of that particular character on the paper. Some of the most popular impact printers are as follows:
• Dot matrix printers
• Daisy wheel printers
• Drum printers
5.4.1 Dot Matrix Printer
A dot matrix printer is an impact printer in which a character is printed on the paper by the back and forth
movement of a print head against the ribbon drenched in ink. In dot matrix printer, the characters are
formed out of a matrix containing dots as shown Fig. 5.4. Each dot is produced with the help of a metal pin
brought forward by a small electromagnet. A small plate guides the pins to the ribbon and the pins strike the
ribbon to form an impression of a dot on the paper.
Dot matrix printer is capable of printing a complete line of characters at a time. It is very durable as it
does not wear out quickly; however, the circular channels on the guide plate get damaged due to frequent
striking of pins. This damage in the shape
of circular channels makes the guide plate
less accurate because of which the printed
characters become hazy.
The dot matrix printers are also capable of
producing carbon copies. They ensure reliable
printing and are best suitable for the fields
where the content of the printed data is more
important than the quality of printing. There is
no need of providing individual single sheets
to these printers again and again as they take
continuous papers. Figure 5.5 shows a dot Fig. 5.4 Matrix characters
matrix printer.
Output Devices 85

Dot matrix printers are cheap to use as the cost of printing


per page is very less. If the printer has not been in use for a
long time, even then, the ink ribbon remains preserved for
the future use and does not dry quickly. Besides advantages,
these printers have some disadvantages. They produce a lot
of noise while printing and have low printing speed as well
as printing quality. These printers support limited colours
and need a lot of maintenance as the damage to the pins may
cause printing of improper text.
Although dot matrix printers are not commonly used at Fig. 5.5 A dot matrix printer
homes, they are still widely used in business and industries
as they are cheap and can produce carbon copies.

5.4.2 Daisy Wheel Printer


A daisy wheel printer is an impact printer that produces
printouts of good quality characters. It contains a metal or a
plastic disk on which the characters reside on the outer edge
of the petals. Figure 5.6 shows a daisy wheel printer.
The disk in the daisy wheel printer is rotated until the petal,
containing the character to be printed, faces the paper. Once
the required Fig. 5.6 A daisy wheel printer
character is
positioned towards the paper, the disk is struck by a hammer,
which acts as print head. The striking of hammer on the disk
forces the disk to hit the ink-soaked ribbon and the ribbon
leaves an impression of the character on the paper. Figure 5.7
shows the disk of a daisy wheel printer.
The only advantage of daisy wheel printers is that they
allow the printing of characters in different fonts. The daisy
wheel printers are capable of printing text only and not
graphics. They are very noisy as well as very slow and can
Fig. 5.7 Disk of a daisy wheel printer print approximately 10 to 75 characters per second.
5.4.3 Drum Printer
Drum printers are the impact printers in which the characters are engraved on a cylindrical drum, which
is rotated around print head hammer. The paper and the ink ribbon lie between the hammer and the drum.
When a character is to be printed, the hammer
strikes the paper and forces it to hit the ribbon.
The ribbon in turn hits the character on the drum
and the impression of the character is formed on
the paper. The advantages of the drum printers are
low cost, higher speed as compared to other impact
printers; and it requires no feeding of paper again
and again. The disadvantages of these printers
include poor quality of printing and large noise
production. Figure 5.8 shows the internal components Fig. 5.8 Internal components of a drum printer
of a drum printer.
86 Fundamentals of Computers

5.5 NON-IMPACT PRINTERS

Non-impact printers are the printers in which there exists no mechanical contact between the print head and
paper. These printers spray ink on the paper with the help of a nozzle. Non-impact printers do not produce
much noise and are fast as compared to impact printers. The reason for the production of less noise is the
absence of mechanical moving parts in the printer. The most popular non-impact printers are:
1. Ink-jet printers
2. Laser printers

5.5.1 Ink-jet Printer


Ink-jet printers are the non-impact printers that produce an
image by spraying small droplets of ink on the paper with
the help of a nozzle. A magnetised plate guides the sprayed
ink to form the particular shape of a character or a symbol
on the paper. The ink-jet printers offer a resolution of 300
dots per inch and produce high quality printouts, such
as graphics and images. They are cheaper and portable as
compared to the other non-impact printers. The slow speed
and the requirement of a special ink, which is suitable for
the inexpensive papers, are the two drawbacks of the ink-
jet printers. The printouts taken from an ink-jet printer also
Fig. 5.9 An ink-jet printer
require some time to dry. Figure 5.9 shows an ink-jet printer.

5.5.2 Laser Printers


Laser printers are the non-impact printers that produce images
with the help of a laser beam. It works on the same technology
as the one used in a copier machine. The laser beam electrically
charges the drum coated with selenium and then transfers the
entire document, which is to be printed to it. The charged drum
is then allowed to roll into the dry powder ink known as toner.
The toner sticks to the charged images on the drum and is then
transferred to the paper with the help of heat and pressure. The Fig. 5.10 A laser printer
electrical charges and the remaining toner automatically get
removed from the drum after the printing of the document. Laser printers are capable of printing both black
and coloured text but as colour laser printers are very costly so generally single colour laser printers are
used. Laser printers have a high speed and resolution. They produce high quality printing in various fonts
and that too, without producing any noise. Figure 5.10 shows a laser printer.

5.5.3 Special Purpose Printers


Although most applications use ink-jet or laser printers, there are some high quality printers that are
primarily used by publishers and print shops to create high quality colour images. These printers include:
• Photo printers
• Thermal-wax printers
• Dye-sublimation printers
These printers are very slow and expensive.
Output Devices 87

5.6 PLOTTERS

Plotter is a device used to print high quality graphics and images. It uses one or more pens to produce a
high quality drawing. These pens change their positions and draw continuous lines to produce an image.
The plotters were used as a substitute to the coloured printers when the printers were very expensive and
were also not capable of drawing bigger images such as graphs. The plotters provided cheap and efficient
drawing but required a separate pen for each colour. This affected the speed of plotters but later the plotters
started using four basic colours only, i.e., cyan, magenta, yellow and black. These are the primary colours,
which combine in different ratios to form other different colours. So, now the speed of plotters increased as
there was no need of changing the pens frequently. The plotters are further divided into the following four
categories on the basis of their working:
• Drum plotters
• Flat-bed plotters
• Ink-jet plotters
• Electrostatic plotters

5.6.1 Drum Plotter


Drum plotter is a plotter in which pen is
moved vertically, i.e., along the Y axis and
the paper wrapped on the drum is moved
horizontally, i.e., along the X axis. The movement
of pen in left or right direction and the movement
of paper in backward or forward direction produce
a graph or an image. Figure 5.11 shows a drum
plotter.

5.6.2 Flat-bed Plotter


Flat-bed plotter is the plotter in which the
position of the paper is kept constant and the
pens are moved around in various directions
Fig. 5.11 A drum plotter
to draw graphs and images. The pens can be
moved both along X and Y axis. The size of the
drawing, which can be drawn using these
plotters, depends on the size of the flat bed on
which the paper is adjusted. Figure 5.12 shows a
flat-bed plotter.

5.6.3 Ink-jet Plotter


Ink-jet plotters are the plotters in which a line
or a solid colour output is drawn with the help
of spraying ink droplets on the paper. They
have a high speed and produce higher quality
output as compared to the other plotters. However,
as the nozzles, which spray the ink can get blocked
Fig. 5.12 A flat-bed plotter
88 Fundamentals of Computers

soon, they require more maintenance as compared to the


other plotters. Figure 5.13 shows an ink-jet plotter.

5.6.4 Electrostatic Plotter


Electrostatic plotters are the plotters in which the
electrostatic charges are used to draw images and
graphs. These images and graphs are made of tiny dots
on a special paper. The electrostatic plotters are the
fastest plotters and produce an output of high quality

Fig. 5.13 An ink-jet plotter

and resolution. One of the disadvantages of using


these plotters is that one becomes vulnerable to
chemicals, which are used in the plotters to produce
the electrostatic charge. Figure 5.14 shows an
electrostatic plotter.
Fig. 5.14 An electrostatic plotter

5.7 VOICE OUTPUT SYSTEMS

Voice output systems are also known as voice response systems. These systems record the simple messages
in human speech form and then combine all these simple messages to form a single message. The voice
response system is of two types—one uses a reproduction of human voice and other sounds, and the other
uses speech synthesis.
The voice response system, which uses a reproduction of human voice takes the sound input in the
analog form and converts it into the digital form. It stores the converted data permanently on some storage
device. The digital sound produced as an output may be in the form of words, phrases or music. The digital
sound stored at the storage device is then sent to the speakers through which the output is made audible to
the users.
The voice response system, which uses speech synthesis, takes the sound input in analog form and
converts it into speech form. Besides sound expansion card and speech synthesiser, the written text to be
converted into the form of a speech requires special software. The speech synthesiser is a device used for
the conversion of written text into speech. The speech synthesiser combines approximately 50 to 60 basic
sounds to produce a single word. The different words formed by the combination of basic sounds then
combine to form a speech. The quality of the speech produced as an output depends on its resemblance to
the human voice and also on the ease with which a user can understand it.
The basic application of a voice output system is in Interactive Voice Response (IVR) systems, which are
used by the customer care or customer support departments of an organisation, such as telecommunication
companies, etc.
Output Devices 89

5.8 PROJECTORS

A projector is a device that is connected to a


computer or a video device for projecting an
image from the computer or video device onto
the big white screen. The images projected by
a projector are larger in size as compared to the
original images. A projector consists of an optic
system, a light source and displays, which contain
the original images. The projectors are classified
into three categories:
• Ultralight portable projectors
• Conference room projectors
Fig. 5.15 A portable projector
• Fixed installation projectors
The ultralight projectors are small in size and, are therefore referred as portable projectors. The
conference room projectors are the projectors used for projecting the output at large venues such as business
meetings and huge gatherings. They are not light weight but have a better projection as compared to the
ultralight projectors. The fixed installation projectors are the most expensive projectors. They are fixed
permanently at the place of presentation and are capable of projecting images in bright light also.
Projectors were initially used for showing films but now they are used on a large scale for displaying
presentations in business organisations and for viewing movies at home. The projectors in home theatres
help to project the images of a movie on the white screen at a comparatively large size as compared to the
small images displayed on a small television screen. Figure 5.15 shows a portable projector.

5.9 TERMINALS

A terminal is a combination of an input device and an output device that helps a computer in receiving as
well as transmitting data. The classification of computer terminals is done on the basis of the data handled
by them. A keyboard and a display monitor are respectively the input and the output devices, which are
paired together to form a common terminal. The display monitor used in the terminal can be of any of the
three types—a CRT, an LCD or a TFT. The terminals are broadly classified into three categories:
• Intelligent terminals
• Smart terminals
• Dumb terminals
An intelligent terminal is a terminal that possesses all the processing power, i.e., the logic required to
perform the operations, such as calculations and formatting. It does not require any processor but instead
performs all the tasks by itself. A smart terminal is a terminal that contains some logic. It requires the help
of a processor to perform complex operations such as performing calculations but is capable of performing
simple operations such as making the displayed data appear bold. A dumb terminal is a terminal that does
not contain any logic at all. It only displays the data received from the processor. It has the slowest speed as
compared to the other two terminals.
90 Fundamentals of Computers

Chapter Summary
An output device is the device that is used to pass on the processed data to the end users. The output produced can
be in the form of a soft copy or a hard copy. To display a soft copy of the text or graphical output, a display monitor
is required. The display monitor is of three types: CRT, LCD and TFT. These monitors differ in their appearance
as well as their working. The other commonly used output devices are printers and plotters. Printers are used to
produce a hard copy of text and image format output.
On the basis of their mechanism, printers are divided into two types, impact printers and non-impact printers.
In impact printers, print head has a mechanical contact between print head and paper, whereas in non-impact
printers, there’s no mechanical contact between print head and paper. The printers are capable of producing efficient
print-outs of text but they cannot produce very clear printouts of images. For image printing, another output device
called plotter is used. It is again divided into four categories: drum plotter, flat-bed plotter, ink-jet plotter and
electrostatic plotter.
Apart from text format, an output can also have an audio format. The audio format output requires speakers
and voice output systems so that it can be communicated to the users. The voice output system includes speech
synthesisers, which concatenate small sounds to produce a word of a speech.
Another example of output devices is the projector. Projectors allow the users to view the output on a big
screen. Projectors vary on the basis of their sizes such as portable projectors, conference room projectors and fixed
installation projectors.

Key Terms to Remember

∑ Monitor: Monitor is the most commonly used output device, which displays the soft copy output of text and
graphics to the users.
∑ CRT monitors: CRT monitors use a Cathode Ray Tube (CRT), including an electron beam and a phosphor coated
screen for producing an image on the screen.
∑ LCD monitors: LCD monitors use liquid crystals, which are activated by electric field to display the images of
high resolution.
∑ Printers: Printers are the output devices that are used to produce a hard copy output of the text or the documents
stored in a computer.
∑ Impact printers: Impact printers are the printers in which a mechanical contact exists between print head and
paper. The impression of characters is developed on the paper with the help of striking the ink ribbon by the print
head.
∑ Non-impact printers: Non-impact printers are the printers in which mechanical contact does not exist between
print head and paper and ink is sprayed on the paper with the help of a nozzle to form an impression of the
character.
∑ Plotters. Plotters are the output devices attached with computer to plot high quality graphs or images.
∑ Drum plotter: Drum plotter is the plotter that consists of a paper mounted on a drum and pens to plot the graph.
Both pens and paper on the drum are moved to produce images.
∑ Flat-bed plotter: Flat-bed plotter consists of a plain surface known as bed on which the paper is fixed and only the
pens are moved to produce an image or a graph.
∑ Speakers: Speakers are the output devices used to generate output in an audio format from the computer.
∑ Projectors: Projectors are the output devices that are used to project big picture of the data stored on some storage
device such as CD and DVD on a white screen.
Output Devices 91

∑ Terminal: A terminal is a collection of an input device and an output device that helps a computer in receiving as
well as transmitting data.
∑ Intelligent terminal: The terminal, which possesses all processing power, i.e., the logic required to perform
operations such as calculations and formatting, is known as intelligent terminal.
∑ Smart terminal: The terminal, which possesses small processing power, is known as smart terminal. It requires
the help of a processor to perform certain operations.
∑ Dumb terminal. The terminal, which possesses no processing power, is known as dumb terminal. It does not
perform any operation by itself.

Review Questions

Fill in the Blanks

1. ___________ devices are the devices, which help in communicating the processed data to the users.
2. ___________ is one of the most essential and commonly used output devices.
3. ___________, ___________ and __________ are the three main types of display monitors.
4. The screen in display monitors consists of a number of small dots like structures known as ___________.
5. ___________ printers do not have a mechanical contact between print head and paper.
6. ___________ printers contain an ink ribbon, which is hit by a print head to form an impression of a character on
the paper.
7. CRT is an abbreviation for ________ ________ _________.
8. ________ monitor consists of liquid molecules.
9. _________ printers are best suitable for the fields where the content of the printed data is more important than
the quality of printing.
10. __ _______ produce a high quality drawing as compared to printers.
11. _________ are used to generate a sound format output.
12. _________ helps the users to project a big picture of the generated output.
13. _________ terminals contain a built-in logic, which is capable of processing the data.
14. _________ terminals are not capable of processing the output.
15. ________ are the most expensive projectors.
16. The portable projectors are also known as _________ projectors.
17. ________ records the simple messages in human speech form and then combines them to form a single message.
18. In _________ plotters, both pen and paper are moved in opposite directions to plot a graph or an image.
19. ________ printers use a laser beam to produce an image on paper.
20. A daisy wheel printer is the impact printer that produces _________ type printouts.
21. A _______ monitor uses thin film transistor technology to improve the quality of image.
22. The power consumption by an LCD monitor is _________ as compared to a CRT monitor.
23. The quality of image of a _________ monitor is better than the LCD monitor.
24. Special purpose printers are primarily used by _________ .
Important printer characteristics include resolution (in dots per inch), speed (in sheets of paper
printed per minute), colour (full-colour or black-and-white), and cache memory (which affects the
speed at which a file can be printed).

92 Fundamentals of Computers

Multiple Choice Questions

1. Which of the following is not an output device?


A. Scanner B. Plotter C. Printer D. Speaker
2. Which of the following monitors are commonly used with desktop computers?
A. CBT monitors B. CRT monitors C. CPT monitors D. None of the above
3. Which of the following are the properties of a printer?
A. Resolution B. Speed C. Pages per minute D. All of the above
4. Which of the following printers print by spraying ink on the paper?
A. Daisy wheel printer B. Dot matrix printer C. Drum printer D. Laser printer
5. Which of the following units can be used to measure the speed of a printer?
A. Characters per inch (cpi) B. Dots per inch (dpi)
C. Pages per minute (ppm) D. None of the above
6. Which of the following devices are capable of producing large-format drawings like graphs and construction
drawings?
!!
A. Dot matrix printers B. Flat-bed plotters C. Impact printers D. Ink-jet printers
7. Which of the following is a hard copy output device?
A. Printer B. Speaker C. Display monitor D. Projector
8. Which of the following is an impact printer?
A. Dot matrix printer B. Ink-jet printer C. Laser printer D. All of the above
9. Which of the following is a non-impact printer?
A. Daisy wheel printer B. Dot matrix printer C. Laser printer D. All of the above
10. Which of the following is one of the components of a CRT?
A. Toner B. Liquid crystals C. Electromagnetic coils D. None of the above
11. In which of the following plotters, both pen and papers are moved to produce an image?
A. Drum plotter B. Electrostatic plotter C. Flat-bed plotter D. Ink-jet plotter
12. In which of the following plotters the graphs are plotted by spraying ink on the paper?
A. Drum plotter B. Electrostatic plotter C. Flat-bed plotter D. Ink-jet plotter
13. Which of the following are the components of a projector?
A. Optic system B. Displays C. Electron beam D. Both A and B
14. Which of the following are portable projectors?
A. Conference room projectors B. Fixed installation projectors
C. Ultralight projectors D. All of the above
15. Which of the following devices are included in a terminal?
A. Monitor and printer B. Printer and keyboard C. Keyboard and monitor D. All of the above
16. Which of the following is a type of terminal?
A. Intelligent terminal B. Dumb terminal C. Both A and B D. All of the above
C HA PTE R 6
COMPUTER CODES

Chapter Outline Chapter Objectives


6.1 Introduction In this chapter, we will learn:
6.2 Decimal System ∑ The concept of positional number system.
6.3 Binary System ∑ Different types of positional number
6.4 Hexadecimal System systems.
6.5 Octal System ∑ The need of computer codes.
∑ Different types of 4-bit and 8-bit BCD
6.6 4-bit Binary Coded Decimal Systems
systems.
6.6.1 Weighted 4-bit BCD Code ∑ The importance of 16-bit Unicode.
6.6.2 Excess-3 BCD Code ∑ The conversion of numbers represented in
6.7 8-bit BCD Systems one system into another.
6.7.1 EBCDIC Code
6.7.2 ASCII Code
6.7.3 Gray Code
6.1 INTRODUCTION
6.8 16-bit Unicode
6.9 Conversion of Numbers
A computer is a digital system that stores and
6.9.1 Non-decimal to Decimal processes different types of data in the form of
6.9.2 Decimal to Non-decimal 0s and 1s. The different types of data handled by
6.9.3 Octal to Hexadecimal a computer system include numbers, alphabets
Chapter Summary and some special characters. Therefore, there is a
Key Terms to Remember need to change the data entered by the users into
a form that the computer system can understand
Review Questions
and process. Different types of codes have been
Fill in the Blanks developed and used to represent the data entered by
Multiple Choice Questions the users in the binary format. The binary system
Discussion Questions represents each type of data in terms of binary
digits, 0s and 1s. Since these codes convert the data
into the binary form, the computer codes are also
referred as binary codes.
The decimal system is not the only number
system used by computer users. Computer
professionals use different number systems
Computer Codes 95

according to their requirements to communicate with the computer system. Therefore, before understanding
the various computer codes, we need to understand the concept of number systems. All the number systems
used by computer professionals to interact with computer systems come under the category of positional
number system. The positional number system is a number system in which numbers are represented using
some symbols called digits and the values of these numbers can be determined by taking the position of
digits into consideration. The different number systems, which come under the category of positional
number system, are as follows:
∑ Decimal system
∑ Binary system
∑ Hexadecimal system
∑ Octal system

6.2 DECIMAL SYSTEM

The decimal system is the most common number system used by human beings. It is a positional number
system that uses 10 as a base to represent different values. Therefore, this number system is also known as
base10 number system. In this system, 10 symbols are available for representing the values. These symbols
include the digits from 0 to 9. The common operations performed in the decimal system are addition (+),
subtraction (–), multiplication (×) and division (/).
The decimal system can be used to represent both the integer as well as floating point values. The
floating point values are generally represented in this system by using a period called decimal point. The
decimal point is used to separate the integer part and the fraction part of the given floating point number.
However, there is no need to use a decimal point for representing integer values. The value of any number
represented in the decimal system can be determined by first multiplying the weight associated with each
digit in the given number with the digit itself and then adding all these values produced as a result of
multiplication operation. The weight associated with any digit depends upon the position of the digit itself
in the given number. The most common method to determine the weight of any digit in any number system
is to raise the base of the number system to a power that initially starts with a 0 and then increases by 1 as
we move from right to left in the given number. To understand this concept, let us consider the following
floating point number represented in the decimal system:

In the above example, the value 6543, which comes before the decimal point, is called integer value
and the value 124, which comes after the decimal point, is called fraction value. Table 6.1 lists the weights
associated with each digit in the given decimal number.
Table 6.1 Place values in decimal system

Digit 6 5 4 3 . 1 2 4
Weight 103 102 101 100 10-1 10-2 10-3

The above table shows that the powers to the base increases by 1 towards the left for the integer part
and decreases by 1 towards the right for the fraction part. Using the place values, the floating point number
6543.124 in decimal system can be computed as:
96 Fundamentals of Computers

6 ¥ 103 + 5 ¥ 102 + 4 ¥ 101 + 3 ¥ 100 + 1 ¥ 10–1 + 2 ¥ 10–2 + 4 ¥ 10–3


= 6000 + 500 + 40 + 3 + 0.1 + 0.02 + 0.004
= 6543.124

6.3 BINARY SYSTEM

Among all the positional number systems, the binary system is the most dominant number system that is
employed by almost all the modern digital computer systems. The binary system uses base 2 to represent
different values. Therefore, the binary system is also known as base-2 system. As this system uses base 2,
only two symbols are available for representing the different values in this system. These symbols are 0 and
1, which are also known as bits in computer terminology. Using binary system, the computer systems can
store and process each type of data in terms of 0s and 1s only.
The following are some of the technical terms used in binary system:
∑ Bit. It is the smallest unit of information used in a computer system. It can either have the value 0 or
1. Derived from the words Binary digIT.
∑ Nibble. It is a combination of 4 bits.
∑ Byte. It is a combination of 8 bits. Derived from words ‘by eight’.
∑ Word. It is a combination of 16 bits.
∑ Double word. It is a combination of 32 bits.
∑ Kilobyte (KB). It is used to represent the 1024 bytes of information.
∑ Megabyte (MB). It is used to represent the 1024 KBs of information.
∑ Gigabyte (GB). It is used to represent the 1024 MBs of information.
We can determine the weight associated with each bit in the given binary number in the similar manner
as we did in the decimal system. In the binary system, the weight of any bit can be determined by raising
2 to a power equivalent to the position of bit in the number. To understand this concept, let us consider the
following binary number:

In binary system, the point used to separate the integer and the fraction part of a number is known as
binary point. Table 6.2 lists the weights associated with each bit in the given binary number.
Table 6.2 Place values in binary system

Digit 1 0 1 0 0 1 . 0 1 0 1
Weight 25 24 23 22 21 20 2-1 2-2 2-3 2-4

Like the decimal system, the powers to the base increases by 1 towards the left for the integer part
and decreases by 1 towards the right for the fraction part. The value of the given binary number can be
determined as the sum of the products of the bits multiplied by the weight of the bit itself. Therefore, the
value of the binary number 101001.0101 can be obtained as:
1 ¥ 25 + 0 ¥ 24 + 1 ¥ 23 + 0 ¥ 22 + 0 ¥ 21 + 1 ¥ 20 + 0 ¥ 2–1 + 1 ¥ 2–2 + 0 ¥ 2–3 + 1 ¥ 2–4
= 32 + 8 + 1 + 0.25 + 0.0625
= 41.3125
The binary number 101001.0101 represents the decimal value 41.3125.
Computer Codes 97

Table 6.3 lists the 4-bit binary representation of decimal numbers 0 through 15.
Table 6.3 Binary representation of first 16 numbers

Decimal number 4-bit binary


0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
10 1010
11 1011
12 1100
13 1101
14 1110
15 1111

6.4 HEXADECIMAL SYSTEM

The hexadecimal system is a positional number system that uses base 16 to represent different values.
Therefore, this number system is known as base-16 system. As this system uses base 16, 16 symbols are
available for representing the values in this system. These symbols are the digits 0–9 and the letters A, B,
C, D, E and F. The digits 0–9 are used to represent the decimal values 0 through 9 and the letters A, B, C,
D, E and F are used to represent the decimal values 10 through 15.
The weight associated with each symbol in the given hexadecimal number can be determined by raising
16 to a power equivalent to the position of the digit in the number. To understand this concept, let us
consider the following hexadecimal number:

In hexadecimal system, the point used to separate the integer and the fraction part of a number is known as
hexadecimal point. Table 6.4 lists the weights associated with each digit in the given hexadecimal number.
98 Fundamentals of Computers

Table 6.4 Place values in hexadecimal system

Digit 4 A 9 . 2 B
Weight 162 161 160 16–1 16–2

The value of the hexadecimal number can be computed as the sum of the products of the symbol
multiplied by the weight of the symbol itself. Therefore, the value of the given hexadecimal number is:
4 ¥ 162 + 10 ¥ 161 + 9 ¥ 160 + 2 ¥ 16–1 + 11 ¥ 16–2
= 1024 + 160 + 9 + 0.125 + 0.0429
= 1193 + 0.1679
= 1193.1679
The hexadecimal number 4A9. 2B represents the decimal value 1193.1679.

6.5 OCTAL SYSTEM

The octal system is the positional number system that uses base 8 to represent different values. Therefore,
this number system is also known as base-8 system. As this system uses base 8, eight symbols are available
for representing the values in this system. These symbols are the digits 0 to 7.
The weight associated with each digit in the given octal number can be determined by raising 8 to a
power equivalent to the position of digit in the number. To understand this concept, let us consider the
following octal number:

In octal system, the point used to separate the integer and the fraction part of a number is known as
octal point. Table 6.5 lists the weights associated with each digit in the given octal number.
Table 6.5 Place values in octal system

Digit 2 1 5 . 4 3
Weight 82 81 80 8–1 8–2

Using these place values, we can now determine the value of the given octal number as:
2 ¥ 82 + 1 ¥ 81 + 5 ¥ 80 + 4 ¥ 8–1 + 3 ¥ 8–2
= 128 + 8 + 5 + 0.5 + 0.0469
= 141 + 0.5469
= 141.5469
The octal number 215.43 represents the decimal value 141.5469.
Table 6.6 lists the octal representation of decimal numbers 0 through 15.
Computer Codes 99

Table 6.6 Octal representation of first 16 numbers

Decimal number Octal representation


0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 10
9 11
10 12
11 13
12 14
13 15
14 16
15 17

6.6 4-BIT BINARY CODED DECIMAL (BCD) SYSTEMS

The BCD system is employed by computer systems to encode the decimal number into its equivalent binary
number. This is generally accomplished by encoding each digit of the decimal number into its equivalent
binary sequence. The main advantage of BCD system is that it is a fast and efficient system to convert the
decimal numbers into binary numbers as compared to the pure binary system. However, the implementation
of this coding system requires a lot of circuits that makes the design of the computer systems very
complicated.
The 4-bit BCD system is usually employed by the computer systems to represent and process numerical
data only. In the 4-bit BCD system, each digit of the decimal number is encoded to its corresponding 4-bit
binary sequence. The two most popular 4-bit BCD systems are:
∑ Weighted 4-bit BCD code
∑ Excess – 3 (XS – 3) BCD code

6.6.1 Weighted 4-Bit BCD Code


The weighted 4-bit BCD code is more commonly known as 8421 weighted code. It is called weighted code
because it encodes the decimal system into binary system by using the concept of positional weighting into
consideration. In this code, each decimal digit is encoded into its 4-bit binary number in which the bits
from left to right have the weights 8, 4, 2, and 1 respectively. Table 6.7 lists the weighted 4-bit BCD code
for decimal digits 0 through 9.
100 Fundamentals of Computers

Table 6.7 Weighted 4-bit BCD codes

Decimal digits Weighted 4-bit BCD code


0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001

Note: Apart from 8421, some other weighted BCD codes are 4221, 2421 and 5211.

Example 6.1 Represent the decimal number 5327 in 8421 BCD code.
Solution
The given decimal number is 5327.
The corresponding 4-bit 8421 BCD representation of decimal digit 5 is 0101.
The corresponding 4-bit 8421 BCD representation of decimal digit 3 is 0011.
The corresponding 4-bit 8421 BCD representation of decimal digit 2 is 0010.
The corresponding 4-bit 8421 BCD representation of decimal digit 7 is 0111.
Therefore, the 8421 BCD representation of decimal number 5327 is 0101 0011 0010 0111.

Example 6.2 Convert the decimal number 159 to 8421 BCD code.

Solution
The given decimal number is 159.
The corresponding 4-bit 8421 BCD representation of decimal digit 1 is 0001.
The corresponding 4-bit 8421 BCD representation of decimal digit 5 is 0101.
The corresponding 4-bit 8421 BCD representation of decimal digit 9 is 1001.
Therefore, the 8421 BCD representation of decimal number 159 is 0001 0101 1001.

Example 6.3 Convert the decimal number 87. 34 to 8421 BCD code.
Solution
The given decimal number is 87.34.
The corresponding 4-bit 8421 BCD representation of decimal digit 8 is 1000.
The corresponding 4-bit 8421 BCD representation of decimal digit 7 is 0111.
The corresponding 4-bit 8421 BCD representation of decimal digit 3 is 0011.
The corresponding 4-bit 8421 BCD representation of decimal digit 4 is 0100.
Therefore, the 8421 BCD representation of decimal number 87.34 is 1000 0111. 0011 0100.
Computer Codes 101

We can also transform a number represented in 8421 BCD code into its corresponding decimal
representation. To accomplish this, we first need to divide the BCD number into sets of 4-bit binary digits
starting from the Least Significant Bit (LSB) and then write the corresponding decimal number for each set.
To understand this concept, let us consider the following examples:

Example 6.4 Determine the decimal number corresponding to the 8421 BCD code 01001001.
Solution
The given 8421 BCD code is 01001001.
To determine the equivalent decimal number, simply divide the 8421 BCD code into sets of 4-bit binary
digits as:
0100 1001
The decimal number corresponding to the binary digits 0100 is 4.
The decimal number corresponding to the binary digits 1001 is 9.
Therefore, the decimal number equivalent to 8421 BCD code 0100 1001 is 49.

Example 6.5 Determine the decimal number corresponding to the 8421 BCD code
0111010000100110.
Solution
The given 8421 BCD code is 0111010000100110.
To determine the equivalent decimal number, simply divide the 8421 BCD code into sets of 4-bit binary
digits as:
0111 0100 0010 0110
The decimal number corresponding to binary digits 0111 is 7.
The decimal number corresponding to binary digits 0100 is 4.
The decimal number corresponding to binary digits 0010 is 2.
The decimal number corresponding to binary digits 0110 is 6.
Therefore, the decimal number equivalent to 8421 BCD code 0111010000100110 is 7426.

Example 6.6 Determine the decimal number corresponding to the 8421 BCD representation
010100100001.0110.
Solution
The given 8421 BCD code is 010100100001.0110.
To determine the equivalent decimal number, simply divide the 8421 BCD code into sets of 4-bit binary
digits as:
0101 0010 0001 . 0110
The decimal number corresponding to binary digits 0101 is 5.
The decimal number corresponding to binary digits 0010 is 2.
The decimal number corresponding to binary digits 0001 is 1.
The decimal number corresponding to binary digits 0110 is 6.
Therefore, the decimal number equivalent to 8421 BCD representation 010100100001.0110 is 521.6.

6.6.2 Excess-3 BCD Code


The Excess-3 (XS-3) BCD code does not use the principle of positional weights into consideration
while converting the decimal numbers to 4-bit BCD system. Therefore, we can say that this code is a
102 Fundamentals of Computers

non-weighted BCD code. The function of XS-3 code is to transform the decimal numbers into their
corresponding 4-bit BCD code. In this code, the decimal number is transformed to the 4-bit BCD code by
first adding 3 to all the digits of the number and then converting the excess digits, so obtained, into their
corresponding 8421 BCD code. Therefore, we can say that the XS-3 code is strongly related with 8421
BCD code in its functioning. Table 6.8 lists the XS-3 BCD code for decimal digits 0 through 9.
Table 6.8 Excess-3 BCD codes

Decimal digits Excess-3 BCD code


0 0011
1 0100
2 0101
3 0110
4 0111
5 1000
6 1001
7 1010
8 1011
9 1100

Note: Apart from XS-3 code, the other non-weighted BCD code is 4-bit Gray code.

Example 6.7 Convert the decimal number 85 to XS-3 BCD code.


Solution
The given decimal number is 85.
Now, add 3 to each digit of the given decimal number as:
8 + 3 = 11
5+3=8
The corresponding 4-bit 8421 BCD representation of the decimal digit 11 is 1011.
The corresponding 4-bit 8421 BCD representation of the decimal digit 8 is 1000.
Therefore, the XS-3 BCD representation of the decimal number 85 is 1011 1000.

Example 6.8 Represent the decimal number 173 in XS-3 BCD code.
Solution
The given decimal number is 173.
Now, add 3 to each digit of the given decimal number as:
1+3=4
7 + 3 =10
3+3=6
The corresponding 4-bit 8421 BCD representation of the decimal digit 4 is 0100.
The corresponding 4-bit 8421 BCD representation of the decimal digit 10 is 1010.
The corresponding 4-bit 8421 BCD representation of the decimal digit 6 is 0110.
Therefore, the XS-3 BCD representation of the decimal number 173 is 0100 1010 0110.
Computer Codes 103

Example 6.9 Convert the decimal number 3456 into XS-3 BCD code.
Solution
The given decimal number is 3456.
Now, add 3 to each digit of the given decimal number as:
3+3=6
4+3=7
5+3=8
6+3=9
The corresponding 4-bit 8421 BCD representation of decimal digit 6 is 0110.
The corresponding 4-bit 8421 BCD representation of decimal digit 7 is 0111.
The corresponding 4-bit 8421 BCD representation of decimal digit 8 is 1000.
The corresponding 4-bit 8421 BCD representation of decimal digit 9 is 1001.
Therefore, the XS – 3 BCD representation of decimal number 3456 is 0110 0111 1000 1001.

Note: 4-bit BCD systems are inadequate for representing and handling non-numeric data. For this
purpose, 6-bit BCD and 8-bit BCD systems have been developed.

6.7 8-BIT BCD SYSTEMS

The 8-bit BCD systems were developed to overcome the limitations of 6-bit BCD systems. The 6-bit BCD
systems can handle numeric as well as non-numeric data but with few special characters. The 8-bit BCD
systems can handle numeric as well as nonnumeric data with almost all the special characters such as
+, - , *, /, @, $, etc. Therefore, the various codes under the category of 8-bit BCD systems are also known
as alphanumeric codes. The three most popular 8-bit BCD codes are:
∑ Extended Binary Coded Decimal Interchange Code (EBCDIC)
∑ American Standard Code for Information Interchange (ASCII)
∑ Gray code

6.7.1 EBCDIC Code


The EBCDIC code is an 8-bit alphanumeric code that was developed by IBM to represent alphabets,
decimal digits and special characters, including control characters. Control characters are the special
characters that are used to perform a specific function. For example, the control character FF is used to feed
the next page into the printer or eject the current page from the printer. The EBCDIC codes are generally
the decimal and the hexadecimal representation of different characters. This code is rarely used by non
IBM-compatible computer systems.
Table 6.9 lists some important EBCDIC characters and their corresponding decimal and hexadecimal
representation.

The American National Standards Institute - ANSI


104 Fundamentals of Computers

Table 6.9 EBCDIC codes

Characters Decimal representation Hexadecimal representation


NUL 0 00
SOH 1 01
STX 2 02
ETX 3 03
HT 5 05
DEL 7 07
VT 11 0B
FF 12 0C
CR 13 0D
SO 14 0E
SI 15 0F
DLE 16 10
IUS 31 1F
ESC 39 27
BEL 47 2F
SUB 63 3F
[ 74 4A
. 75 4B
< 76 4C
( 77 4D
+ 78 4E
& 80 50
$ 91 5B
* 92 5C
- 96 60
/ 97 61
% 108 6C
? 111 6F
= 126 7E
a–i 129 – 137 81 – 89
j –r 145 – 153 91 – 99
s –z 162 – 169 A2 – A9
A–I 193 – 201 C1 – C9
J–R 209 – 217 D1 – D9
S–Z 226 – 233 E2 – E9
0–9 240 – 249 F0 – F9
Computer Codes 105

6.7.2 ASCII Code


The ASCII code is pronounced as ASKEE and is used for the same purpose for which the EBCDIC code is
used. However, this code is more popular than EBCDIC code as unlike the EBCDIC code this code can be
implemented by most of the non-IBM computer systems. Initially, this code was developed as a 7-bit BCD
code to handle 128 characters but later it was modified to an 8-bit code. We can check the value of any
ASCII code by just holding down the Alt key and typing the ASCII code. For example, when we hold down
the Alt key and type 66 from the keyboard, then the character B appears on the screen. This shows that the
ASCII decimal code 66 represents the character B.
Table 6.10 lists some important ASCII codes and their corresponding decimal and hexadecimal
representations.
Table 6.10 ASCII codes

Characters Decimal representation Hexadecimal representation


NUL 0 0
SOH 1 1
STX 2 2
ETX 3 3
EOT 4 4
ENQ 5 5
ACK 6 6
BEL 7 7
BS 8 8
HT 9 9
CAN 24 18
SUB 26 1A
ESC 27 1B
RS 30 1E
US 31 1F
! 33 21
# 35 23
$ 36 24
% 37 25
& 38 26
* 42 2A
+ 43 2B
/ 47 2F
0–9 48 – 57 30 – 39
< 60 3C
= 61 3D
Contd...
106 Fundamentals of Computers

Table 6.10 continued

Characters Decimal representaion Hexadecimal representation


> 62 3E
? 63 3F
A–I 65 – 73 41 – 49
J–O 74 – 79 4A – 4F
P–Z 80 – 90 50 – 5A
a –i 97 – 105 61 – 69
j –o 106 – 111 6A – 6F
p–z 112 – 122 70 – 7A

6.7.3 Gray Code


Gray code is another important code that is also used to convert the decimal number into 8-bit binary
sequence. However, this conversion is carried in a manner that the contiguous digits of the decimal number
differ from each other by one bit only. Table 6.11 lists the 8-bit Gray code for decimal numbers 0 through 9.
Table 6.11 8-Bit Gray code

Decimal number 8-Bit Gray code


0 00000000
1 00000001
2 00000011
3 00000010
4 00000110
5 00000111
6 00001111
7 00001011
8 00001001
9 00001101

We can convert the Gray coded number to its binary equivalent by remembering the following two major
rules:
∑ The Most Significant Bit (MSB) of the Gray coded number and the equivalent binary number is
always the same.
∑ The next-to-most significant bit of the binary number can be determined by adding the MSB of the
binary number to the next-to-most significant bit of the gray coded number.

Example 6.10 Convert the Gray coded number 11010011 to its binary equivalent.
Solution
The given Gray coded number is 11010011.
The following table lists the steps showing the conversion of the Gray coded number into its binary
equivalent:
Computer Codes 107

S.No. Gray coded digit Binary addition operation Binary digit


1 1 1
2 1 1+1 0
3 0 0+0 0
4 1 1+0 1
5 0 0+1 1
6 0 0+1 1
7 1 1+1 0
8 1 1+0 1

Hence, the binary equivalent of Gray coded number 11010011 is 10011101.

Example 6.11 Convert the Gray coded number 10101110 to its binary equivalent.
Solution
The given Gray coded number is 10101110.
The following table lists the steps showing the conversion of the Gray coded number into its binary
equivalent:

S.No. Gray coded digit Binary addition operation Binary digit


1 1 1
2 0 0+1 1
3 1 1+1 0
4 0 0+0 0
5 1 1+0 1
6 1 1+1 0
7 1 1+0 1
8 0 0+1 1

Hence, the binary equivalent of Gray coded number 10101110 is 11001011.


We can also convert a number represented in the binary form to Gray code representation. For carrying
out this conversion, we need to remember the following two rules:
∑ The Most Significant Digit (MSD) of the binary number and the gray coded number is always the
same.
∑ The next MSD of the gray coded number can be obtained by adding the subsequent pair of bits of the
binary number starting form the left.
Note: We need to ignore the carry, if it is generated while adding the subsequent pairs of bits of the binary
number.

Example 6.12 Convert the binary number 10100011 to its equivalent Gray coded number.
Solution
The given binary number is 10100011.
108 Fundamentals of Computers

The following table lists the steps showing the conversion of binary number to its equivalent Gray coded
number:

S.No. Binary digit Binary addition operation Gray coded digit


1 1 1
2 0 1+0 1
3 1 0+1 1
4 0 1+0 1
5 0 0+0 0
6 0 0+0 0
7 1 0+1 1
8 1 1+1 0

Hence, the Gray coded equivalent of the binary number 10100011 is 11110010.

Example 6.13 Convert the binary number 01010010 to its equivalent Gray coded number.
Solution
The given binary number is 01010010.
The following table lists the steps showing the conversion of binary number to its equivalent Gray coded
number:
S.No. Binary digit Binary addition operation Gray coded digit
1 0 0
2 1 0+1 1
3 0 1+0 1
4 1 0+1 1
5 0 1+0 1
6 0 0+0 0
7 1 0+1 1
8 0 1+0 1

Hence, the Gray coded equivalent of the binary number 01010010 is 01111011.

6.8 16-BIT UNICODE

The computer systems can only understand data in the form of numbers. Therefore, each character should
be first coded into a specific number before being processed by the computer systems. Many 7-bit and 8-
bit character codes are developed to encode only the well-known characters, such as letters a–z in lower as
well as upper case, digits 0–9 and some special symbols. These character sets can represent a maximum of
256 different characters only. These 7-bit and 8-bit character codes are confined to represent the characters
used by the popular languages around the globe. Therefore, there was always a need of a character code that
could contain all the characters used by almost all the languages in the world.
Computer Codes 109

The 16-bit Unicode is an International 16-bit character set that contains a maximum of 216 = 65,536
different characters. These characters are sufficient to represent almost all the technical and special symbols
used by the major languages of the world. The 16-bit Unicode, (also called 16-bit universal character set),
encodes the different characters by assigning them a unique value. In computer terminology, this unique
value is referred as code point. The code assigned to each character of different languages is universal and
can be used on any platform without any modification. Therefore, we can say that the 16-bit Unicode allows
the computer systems to deal with almost all the characters belonging to different languages used in the
world.
The 16-bit Unicode is a character code that is supported by almost all the operating systems such as
MS Windows, Linux and Mac OS X. For example, MS Windows operating system allows the use of all the
Unicode characters through an accessory called Character Map. Figure 6.1 shows the user interface of the
character map.

Fig. 6.1 The character map window

Using the Character Map window, we can select any of the Unicode character and copy it to the
clipboard. After copying it to the clipboard, we can use the selected Unicode character in any application
running under MS Windows operating system.
110 Fundamentals of Computers

6.9 CONVERSION OF NUMBERS

The computer systems accept the data in decimal form, whereas they store and process the data in binary
form. Therefore, it becomes necessary to convert the numbers represented in one system into the numbers
represented in another system. The different types of number system conversions can be divided into the
following major categories:
∑ Non-decimal to decimal
∑ Decimal to non-decimal
∑ Octal to hexadecimal

6.9.1 Non-Decimal to Decimal


The non-decimal to decimal conversions can be implemented by taking the concept of place values into
consideration. The non-decimal to decimal conversion includes the following number system conversions:
∑ Binary to decimal conversion
∑ Hexadecimal to decimal conversion
∑ Octal to decimal conversion
Binary to decimal conversion A binary number can be converted to equivalent decimal number by
calculating the sum of the products of each bit multiplied by its corresponding place value.

Example 6.14 Convert the binary number 10101101 into its corresponding decimal number.
Solution
The given binary number is 10101101.
Now, calculate the sum of the products of each bit multiplied by its place value as :
(1 ¥ 27) + (0 ¥ 26) + (1 ¥ 25) + (0 ¥ 24) + (1 ¥ 23) + (1 ¥ 22) + (1 ¥ 21) + (1 ¥ 20)
= 128 + 0 + 32 + 0 + 8 + 4 + 0 + 1
= 173
Therefore, the binary number 10101101 is equivalent to 173 in the decimal system.

Example 6.15 Convert the binary number 1101 into its equivalent in decimal system.
Solution
The given binary number is 1101.
Now, calculate the sum of the products of each bit multiplied by its place value as:
(1 ¥ 23) + (1 ¥ 22) + (1 ¥ 21) + (1 ¥ 20)
=8+4+1
= 13
Therefore, the binary number 1101 is equivalent to 13 in the decimal system.

Example 6.16 Convert the binary number 10110001 into its equivalent in decimal system.
Solution
The given binary number is 10110001.
Now, calculate the sum of the products of each bit multiplied by its place value as:
(1 ¥ 27) + (1 ¥ 26) + (1 ¥ 25) + (1 ¥ 24) + (0 ¥ 23) + (0 ¥ 22) + (0 ¥ 21) + (0 ¥ 20)
Computer Codes 111

= 128 + 0 + 32 + 16 + 0 + 0 + 0 + 1
= 177
Therefore, the binary number 10110001 is equivalent to 177 in the decimal system.

Example 6.17 Convert the binary number 1011.010 into its equivalent in decimal system.
Solution
The given binary number is 1011.010.
Now, calculate the sum of the products of each bit multiplied by its place value as:
(1 ¥ 23) + (0 ¥ 22) + (1 ¥ 21) + (1 ¥ 20) + (0 ¥ 2–1) + (1 ¥ 2–2) + (0 ¥ 2–3)
1
= 8 + 2 +1+
4
= 11 + 0.25
= 11.25
Therefore, the binary number 1011.010 is equivalent to 11.25 in the decimal system.

Example 6.18 Convert the binary number 11011.0110 to its equivalent in decimal system.
Solution
The given binary number is 11011.0110.
Now, calculate the sum of the products of each bit multiplied by its place value as:
(1 ¥ 24) + (1 ¥ 23) + (0 ¥ 22) + (1 ¥ 21) + (1 ¥ 20) + (0 ¥ 2–1) + (1 ¥ 2–2) + (1 ¥ 2–3) + (0 ¥ 2–4)
1 1
= 16 + 8 + 1 + +
4 8
= 27 + 0.25 + 0.125
= 27.375
Therefore, the binary number 11011.0110 is equivalent to 27.375 in the decimal system.
Hexadecimal to decimal conversion A hexadecimal number can be converted into its equivalent
number in decimal system by calculating the sum of the products of each symbol multiplied by its
corresponding place value.

Example 6.19 Convert the hexadecimal number A53 into its equivalent in decimal system.
Solution
The given hexadecimal number is A53.
Now, calculate the sum of the products of each symbol multiplied by its place value as:
(10 ¥ 162) + (5 ¥ 161) + (3 ¥ 160)
= 2560 + 80 + 3
= 2643
Therefore, the hexadecimal number A53 is equivalent to 2643 in the decimal system.

Example 6.20 Convert the hexadecimal number 6B39 into its equivalent in the decimal system.
Solution
The given hexadecimal number is 6B39.
Now, calculate the sum of the products of each symbol multiplied by its place value as:
(6 ¥ 163) + (11 ¥ 162) + (3 ¥ 161) + (9 ¥ 160)
112 Fundamentals of Computers

= 24576 + 2816 + 48 + 9
= 27449
Therefore, the hexadecimal number 6B39 is equivalent to 27449 in the decimal system.

Example 6.21 Convert the hexadecimal number 5A6D into its equivalent in the decimal system.
Solution
The given hexadecimal number is 5A6D.
Now, calculate the sum of the products of each symbol multiplied by its place value as:
(5 ¥ 163) + (10 ¥ 162) + (6 ¥ 161) + (13 ¥ 160)
= 20480 + 2560 + 96 + 13
= 23149.
Therefore, the hexadecimal number 5A6D is equivalent to 23149 in the decimal system.

Example 6.22 Convert the hexadecimal number AB21.34 into its equivalent in the decimal system.
Solution
The given hexadecimal number is AB21.34.
Now, calculate the sum of the products of each symbol multiplied by its place value as:
(10 ¥ 163) + (11 ¥ 162) + (2 ¥ 161) + (1 ¥ 160) + (3 ¥ 16–1) + (4 ¥ 16–2)
3 4
= 40960 + 2816 + 32 + 1 + +
16 256
= 43809 + 0.1875 + 0.015625
= 43809.203
Therefore, the hexadecimal number AB21.34 is equivalent to 43809.203 in the decimal system.

Example 6.23 Convert the hexadecimal number 6A11.3B into its equivalent in the decimal system.
Solution
The given hexadecimal number is 6A11.3B.
Now, calculate the sum of the products of each symbol multiplied by its place value as:
(6 ¥ 163) + (10 ¥ 162) + (1 ¥ 16–1) + (1 ¥ 160) + (3 ¥ 16–1) + (11 ¥ 16–2)
3 11
= 24576 + 2560 + 16 + 1 + +
16 256
= 27153 + 0.1875 + 0.043
= 27153.2305
Therefore, the hexadecimal number 6A11.3B is equivalent to 27153.2305 in the decimal system.
Octal to decimal conversion An octal number can be converted into its equivalent number in decimal
system by calculating the sum of the products of each digit multiplied by its corresponding place value.

Example 6.24 Convert the octal number 5324 into its equivalent in decimal system.
Solution
The given octal number is 5324.
Now, calculate the sum of the products of each digit multiplied by its place value as:
(5 ¥ 83) + (3 ¥ 82) + (2 ¥ 81) + (4 ¥ 80)
Computer Codes 113

= 2560 + 192 + 16 + 4
= 2772
Therefore, the octal number 5324 is equivalent to 2772 in the decimal system.

Example 6.25 Convert the octal number 13256 into its equivalent in decimal system.
Solution
The given octal number is 13256.
Now, calculate the sum of the products of each digit multiplied by its place value as:
(1 ¥ 84) + (3 ¥ 83) + (2 ¥ 82) + (5 ¥ 81) + (6 ¥ 80)
= 4096 + 1536 + 128 + 40 + 6
= 5806
Therefore, the octal number 13256 is equivalent to 5806 in the decimal system.

Example 6.26 Convert the octal number 4567 into its equivalent in decimal system.
Solution
The given octal number is 4567.
Now, calculate the sum of the products of each digit multiplied by its place value as:
(4 ¥ 83) + (5 ¥ 82) + (6 ¥ 81) + (7 ¥ 80)
= 2048 + 320 + 48 + 7
= 2423
Therefore, the octal number 4567 is equivalent to 2423 in the decimal system.

Example 6.27 Convert the octal number 325.12 into its equivalent in decimal system.
Solution
The given octal number is 325.12.
Now, calculate the sum of the products of each digit multiplied by its place value as:
(3 ¥ 82) + (2 ¥ 81) + (5 ¥ 80) + (1 ¥ 8–1) + (2 ¥ 8–2)
1 2
= 192 + 16 + 5 + +
8 64
= 213 + 0.125 + 0.03125
= 213.15625
Therefore, the octal number 325.12 is equivalent to 213.15625 in the decimal system.

Example 6.28 Convert the octal number 7652.01 into its equivalent in decimal system.
Solution
The given octal number is 7652.01.
Now, calculate the sum of the products of each digit multiplied by its place value as:
(7 ¥ 83) + (6 ¥ 82) + (5 ¥ 81) + (2 ¥ 80) + (0 ¥ 8–1) + (1 ¥ 8–2)
1
= 3584 + 384 + 40 + 2 +
64
= 4010 + 0.015625
= 4010.0156
Therefore, the octal number 7652.01 is equivalent to 4010.0156 in the decimal system.
114 Fundamentals of Computers

6.9.2 Decimal to Non-Decimal


The decimal to non-decimal conversions are carried out by continually dividing the decimal number by
the base of the desired number system till the decimal number becomes zero. After the decimal number
becomes zero, we may note down the remainders calculated at each successive division from last to first
to obtain the decimal number into the desired system. The decimal to non-decimal conversion includes the
following number system conversions:
∑ Decimal to binary conversion
∑ Decimal to hexadecimal conversion
∑ Decimal to octal conversion
Decimal to binary conversion The decimal to binary conversion is performed by repeatedly dividing
the decimal number by 2 till the decimal number becomes zero and then reading the remainders from last
to first to obtain the binary equivalent of the given decimal number. The following examples illustrate the
method of converting decimal number to its binary equivalent:

Example 6.29 Convert the decimal number 30 into its equivalent binary number.
Solution
The given decimal number is 30.
The following table lists the steps showing the conversion of the given decimal number to its binary
equivalent:

Decimal number Divisor Quotient Remainder


30 2 15 0
15 2 7 1
7 2 3 1
3 2 1 1
1 2 0 1

Now, read the remainders calculated in the above table in upward direction to obtain the binary
equivalent, which is 11110.
Therefore, the binary equivalent of the decimal number 30 is 11110.

Example 6.30 Convert the decimal number 111 into its equivalent binary number.
Solution
The given decimal number is 111.
The following table lists the steps showing the conversion of the given decimal number to its binary
equivalent:
Computer Codes 115

Decimal number Divisor Quotient Remainder


111 2 55 1
55 2 27 1
27 2 13 1
13 2 6 1
6 2 3 0
3 2 1 1
1 2 0 1

Now, read the remainders calculated in the above table in upward direction to obtain the binary
equivalent, which is 1101111.
Therefore, the binary equivalent of the decimal number 111 is 1101111.

Example 6.31 Convert the decimal number 215 into its equivalent binary number.
Solution
The given decimal number is 215.
The following table lists the steps showing the conversion of the given decimal number to its binary
equivalent:

Decimal number Divisor Quotient Remainder


215 2 107 1
107 2 53 1
53 2 26 1
26 2 13 0
13 2 6 1
6 2 3 0
3 2 1 1
1 2 0 1

Now, read the remainders calculated in the above table in upward direction to obtain the binary
equivalent, which is 11010111.
Therefore, the binary equivalent of the decimal number 215 is 11010111.
The procedure of converting the fractional part of the given decimal number to its binary equivalent is
different. In this procedure, we need to continually multiply the fractional part by 2 and then note down the
whole number part of the result. The multiplication process will terminate when the fractional part becomes
zero or when we have achieved the desired number of bits.

Example 6.32 Convert the decimal number 45796 to its equivalent octal number.
Solution
The given decimal number is 45796.
The following table lists the steps showing the conversion of the given decimal number to its octal
equivalent:
116 Fundamentals of Computers

Decimal number Divisor Quotient Remainder


45796 8 5724 4
5724 8 715 4
715 8 89 3
89 8 11 1
11 8 1 3
1 8 0 1

Now, read the remainders calculated in the above table in upward direction to obtain the octal equivalent,
which is 131344.
Therefore, the corresponding octal equivalent of 45796 is 131344.

Example 6.33 Convert the decimal number 9547 into its equivalent octal number.
Solution
The given decimal number is 9547.
The following table lists the steps showing the conversion of the given decimal number to its octal
equivalent:

Decimal number Divisor Quotient Remainder


9547 8 1193 3
1193 8 149 1
149 8 18 5
18 8 2 2
2 8 0 2

Now, read the remainders calculated in the above table in upward direction to obtain the octal equivalent,
which is 22513.
Therefore, the corresponding octal equivalent of 9547 is 22513.

Example 6.34 Convert the decimal number 1567 into its equivalent hexadecimal number.
Solution
The given decimal number is 1567.
The following table lists the steps showing the conversion of the given decimal number to its
hexadecimal equivalent:

Decimal number Divisor Quotient Remainder


1567 16 97 15
97 16 6 1
6 16 0 6

Now, read the remainders calculated in the above table in upward direction to obtain the hexadecimal
equivalent, which is 61F.
Therefore, the hexadecimal equivalent of the given decimal number is 61F.
Computer Codes 117

Example 6.35 Convert the decimal number 9463 into its equivalent hexadecimal number.
Solution
The given decimal number is 9463.
The following table lists the steps showing the conversion of the given decimal number to its
hexadecimal equivalent:

Decimal number Divisor Quotient Remainder


9463 16 591 7
591 16 36 15
36 16 2 4
2 16 0 2

Now, read the remainders calculated in the above table in upward direction to obtain the hexadecimal
equivalent, which is 24F7.
Therefore, the hexadecimal equivalent of the given decimal number is 24F7.
Decimal to octal conversion The decimal to octal conversion is performed by repeatedly dividing
the decimal number by 8 till the decimal number becomes zero and reading the remainders from last to first
to obtain the octal equivalent of the given decimal number. The following examples illustrate the method of
converting decimal number to its octal equivalent:

Example 6.36 Convert the decimal number 45796 to its equivalent octal number.
Solution
The given decimal number is 45796.
The following table lists the steps showing the conversion of the given decimal number to its octal
equivalent:

Decimal number Divisor Quotient Remainder

45796 8 5724 4

5724 8 715 4

715 8 89 3

89 8 11 1

11 8 1 3

1 8 0 1

Now, read the remainders calculated in the above table in upward direction to obtain the octal equivalent,
which is 131344.
Therefore, the corresponding octal equivalent of 45796 is 131344.
118 Fundamentals of Computers

Example 6.37 Convert the decimal number 9547 into its equivalent octal number.
Solution
The given decimal number is 9547.
The following table lists the steps showing the conversion of the given decimal number to its octal
equivalent:

Decimal number Divisor Quotient Remainder


9547 8 1193 3
1193 8 149 1
149 8 18 5
18 8 2 2
2 8 0 2

Now, read the remainders calculated in the above table in upward direction to obtain the octal equivalent,
which is 22513.
Therefore, the corresponding octal equivalent of 9547 is 22513.

6.9.3 Octal to Hexadecimal


The given octal number can be converted into its equivalent hexadecimal number in two different steps.
Firstly, we need to convert the given octal number into its binary equivalent. After obtaining the binary
equivalent, we need to divide the binary number into 4-bit sections starting from the LSB.
The octal to binary conversion is a simple process. In this type of conversion, we need to represent each
digit in the octal number to its equivalent 3-bit binary number. Table 6.12 lists the binary representation of
all the digits used in an octal system.
Table 6.12 Binary representation of octal symbols

Octal Binary representation

0 000
1 001
2 010
3 011
4 100
5 101
6 110
7 111
Computer Codes 119

Example 6.38 Convert the octal number 365 into its equivalent hexadecimal number.
Solution
Octal number: 3 6 5
Ø Ø Ø Ø
Binary equivalent: 011 110 101 Step 1
Ø
Regrouping into 4-bit sections: 0000 1111 0101 Step 2
Ø Ø Ø Ø
Hexadecimal equivalent: 0 F 5 Step 3
Hexadecimal number is F5

Example 6.39 Convert the octal number 6251 into its equivalent hexadecimal number.
Solution
Octal number: 6 2 5 1
Ø Ø Ø Ø Ø
Binary equivalent: 110 010 101 001 Step 1
Ø
4-bits grouping: 1100 1010 1001 Step 2
Ø Ø Ø Ø
Hexadecimal equivalent: C A 9 Step 3
Hexadecimal number is CA9

Chapter Summary
Computer systems represent and process the data in binary form only. However, they can accept the data in many
forms. Therefore, it is very necessary to implement a mechanism in the computer system that can convert the data
from the accepted form to the binary form. Computer codes help the computer system to convert the data received in
a different number system to the data in the binary form so that it can be stored and processed in an efficient manner.
In computer terminology, the number system used to represent data is generally known as positional number system.
It is called positional number system because the value of the number represented in this system depends upon the
position of the digits in the given number. The positional number system can be of four different types, namely,
decimal system, binary system, hexadecimal system and octal system. We can easily convert the number represented
in one system to its equivalent in another system. The major number system conversions are non-decimal to decimal,
decimal to non-decimal and octal to hexadecimal.
The different computer codes usually come under the category of BCD systems, which are mainly of 4-bit or
8-bit. The 4-bit BCD systems include the weighted 4-bit BCD code and XS-3 BCD code. On the other hand, the
8-bit BCD system includes the EBCDIC code, ASCII code and Gray code.

Key Terms to Remember

∑ Computer codes: The computer codes are the codes that help in converting the data entered by the users into the
binary form.
∑ Positional number system: The positional number system is a system in which numbers are represented using certain
symbols called digits and the values of these numbers is determined by taking the position of digits into consideration.
120 Fundamentals of Computers

∑ Decimal system: The decimal system is a positional number system that uses base 10 to represent different values.
∑ Binary system: The binary system is a positional number system that uses base 2 to represent different values.
∑ Bit: Bit is the smallest unit of information used in a computer system. It can have either have 0 or 1 as its value.
∑ Byte: Byte is the combination of 8 bits.
∑ Hexadecimal system: The hexadecimal system is a positional number system that uses base 16 to represent
different values.
∑ Octal system: The octal system is a positional number system that uses base 8 to represent different values.
∑ BCD system: The BCD system is used to encode decimal number into its equivalent binary number.
∑ Weighted 4-bit BCD code: The weighted 4-bit BCD code is used to encode the decimal digits into binary sequence
by specifying the weights 8, 4, 2, and 1 respectively to the bits from left to right.
∑ Digital codes: Digital codes allow the computer to handle numeric as well as non-numeric data in an efficient manner.
∑ EBCDIC code: The EBCDIC code is an 8-bit alphanumeric code that was developed by IBM to represent alphabets,
decimal digits and special characters including control characters.
∑ ASCII code: The ASCII code is also used to represent alphabets, decimal digits and some special characters.
However, this code is usually implemented by the non-IBM computer systems.
∑ 16-bit Unicode: The 16-bit Unicode is an International 16-bit character set that can represent a maximum of
216 = 65,536 different characters.

Review Questions

Fill in the Blanks

1. Human beings generally employ the _________ number system to carry out their routine computations.
2. The most common system used by computer systems is _________.
3. The weight of any digit in the number system generally depends upon its _________ in the given number.
4. The binary system represents each type of data in the form of _________ and _________.
5. The digits in binary system are referred as _________.
6. The base of any number system depends upon the number of _________ in the system.
7. Computer designers and professionals generally deal with _________ number system.
8. The octal system is also known as _________ system.
9. The octal number 5624 is equivalent to _________ in decimal system.
10. The binary number 1001010 represents a decimal value of _________.
11. The hexadecimal system consists of _________ symbols.
12. Human beings usually supply data to the computer system in the _________ form.
13. Computer codes help computer systems convert the decimal data into _________ data.
14. BCD stands for _________.
15. _________ and _________ are the two most popular 4-bit BCD codes.
16. The 8421 BCD representation of the decimal number 3569 is _________.
17. The 4-bit BCD systems are suitable for handling _________ data only.
18. The 16-bit __________ is an international standard for representing characters from various languages.
19. The hexadecimal number B45A is equivalent to _________ in decimal system.
20. The hexadecimal representation of the octal number 2564 is _________.
Computer Codes 121

Multiple Choice Questions

1. Computer codes are also more commonly known as:


A. Octal codes B. Digital codes C. Binary codes D. None of the above
2. Which of the following is not a positional number system?
A. Octal system B. Decimal system C. Binary system D. Roman number system
3. Human beings usually employ the following number system for their routine computations:
A. Decimal system B. Octal system C. Binary system D. Hexadecimal system
4. The number system with base 2 is known as:
A. Decimal system B. Binary system C. Octal system D. Hexadecimal system
5. The smallest unit of information in binary system is:
A. Bit B. Byte C. Word D. Kilobyte
6. The combination of 8 bits is known as:
A. Kilobyte B. Bit C. Byte D. Word
7. The 4-bit binary equivalent of the decimal number 6 is:
A. 0111 B. 1000 C. 0010 D. 0110
8. The octal representation of 15 is:
A. 17 B. 16 C. 15 D. 14
9. Which of the following form of data is processed more efficiently by the computer system?
A. Binary data B. Octal data C. Hexadecimal data D. Decimal data
10. The point used to separate the integer part and the fractional part in octal system is referred as:
A. Decimal point B. Binary point C. Hexadecimal point D. None of the above
11. The system implemented by the computer systems to convert the decimal numbers into equivalent binary
numbers is known as:
A. BCD system B. Octal system C. Weighted system D. Gray code system
12. Which of the following codes come under the category of 4-bit BCD system?
A. Gray code B. Excess-3 code C. ASCII code D. None of these
13. The weighted 4-bit BCD code is commonly known as:
A. 8421 code B. 4221 code C. 5211 code D. 6211 code
14. The 8-bit BCD codes are better known as:
A. Digital codes B. Alphanumeric codes C. Numeric codes D. None of the above
15. Which of the following code is a type of digital code?
A. ASCII code B. Packed code C. 8421 code D. None of the above
16. EBCDIC code was developed by:
A. Microsoft B. IBM
C. Both by Microsoft and IBM D. None of the above
17. Which of the following keys helps in displaying the value of the ASCII code?
A. Alt key B. Shift key C. Ctrl key D. Tab key
18. Which of the following is not a valid computer number system conversion?
A. Non-decimal to decimal B. Decimal to non-decimal
C. Octal to hexadecimal D. Roman to decimal
19. The hexadecimal equivalent of the octal number 4263 is:
A. 8B3 B. A42 C. 923 D. BA31
C HAPTER 7
COMPUTER ARITHMETIC

Chapter Outline Chapter Objectives


7.1 Introduction
In this chapter, we will learn:
7.2 Binary Addition
7.3 Binary Multiplication ∑ The concept of computer arithmetic and
7.4 Binary Subtraction different types of arithmetic operations
7.5 Binary Division ∑ The concept of signed and unsigned
7.6 Signed/Unsigned Numbers number representation
7.7 Complements of Binary Numbers ∑ The importance of complement system for
7.7.1 One’s Complement
the representation of negative integers
7.7.2 Two’s Complement
7.8 Binary Subtraction using Complements ∑ The methods of performing binary
7.8.1 Smaller Number from Larger One subtraction using complements
7.8.2 Larger Number from Smaller One ∑ The different types of representations for
7.8.3 Positive Number from Negative integer and floating-point numbers
Number ∑ The methods of performing integer as well
7.9 Representing Numbers
7.9.1 Integer Representation
as floating-point arithmetic.
7.9.2 Floating-point Representation
7.10 Integer Arithmetic
7.10.1 Signed-magnitude System
7.10.2 One’s Complement System
7.10.3 Two’s Complement System
7.1 INTRODUCTION
7.11 Floating-point Arithmetic
7.11.1 Addition A computer system stores and processes billions
7.11.2 Subtraction of instructions in a second that involves a lot of
7.11.3 Multiplication arithmetic computations. The different arithmetic
7.11.4 Division
7.12 Errors in Arithmetic operations in the computer system are performed
7.13 Laws of Arithmetic by the Arithmetic and Logic Unit (ALU), which
7.13.1 Identity Laws is an important component of the CPU. Besides
7.13.2 Commutative Laws performing arithmetic operations, the ALU of the
7.13.3 Associative Laws computer system also performs various logical
7.13.4 Distributive Laws
operations.
Chapter Summary
Key Terms to Remember The computer arithmetic is also referred as
Review Question binary arithmetic because the computer system
Fill in the Blanks stores and processes the data in the binary form
Multiple Choice Questions only. Various binary arithmetic operations can
Discussion Questions be performed in the same way as the decimal
124 Fundamentals of Computers

arithmetic operations, but by following a predefined set of rules. Each binary arithmetic operation has an
associated set of rules that should be adhered to while carrying out that operation. The binary arithmetic
operations are usually simpler to carry out as compared to the decimal operations because one needs to deal
with only two digits, 0 and 1, in the binary operations. The different binary arithmetic operations performed
in a computer system are:
∑ Binary addition
∑ Binary multiplication
∑ Binary subtraction
∑ Binary division

7.2 BINARY ADDITION

Binary addition is the simplest arithmetic operation performed in the computer system. Like decimal
system, we can start the addition of two binary numbers column-wise from the right most bit and move
towards the left most bit of the given numbers. However, we need to follow certain rules while carrying out
the binary addition of the given numbers. Table 7.1 lists the rules for binary addition.
Table 7.1 Binary addition rules

A B A+B Carry
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1

In the above table, the first three entries do not generate any carry. However, a carry would be generated
when both A and B contain the value, 1. The carry, if it is generated, while performing the binary addition
in a column would be forwarded to the next most significant column.

Example 7.1 Perform the binary addition operation on the following binary numbers:
0010
0111
Solution
The given binary numbers are 0010 and 0111.
Now, perform the binary addition of the given numbers as:
Binary number Decimal value
0 0 1 0 2
0 1 1 1 7
1 0 0 1 9
Therefore, the result of the binary addition performed on 0010 and 0111 is 1001.
Note: In the above example, a carry is generated in the 2nd and the 3rd column only.
Computer Arithmetic 125

Example 7.2 Perform the binary addition of the following binary numbers:
1 0 1 0 1 0
0 1 0 0 1 1
Solution
The given binary numbers are 101010 and 010011.
Now, perform the binary addition of the given numbers as:
Binary number Decimal value
1 0 1 0 1 0 42
0 1 0 0 1 1 19
1 1 1 1 0 1 61
Therefore, the result of the binary addition performed on 101010 and 010011 is 111101.
Note: In the above example, a carry is generated in the 2nd column only.

Example 7.3 Evaluate the binary sum of the following numbers:


00011010
10001100
Solution
The given binary numbers are 00011010 and 10001100.
Now, perform the binary addition of the given numbers as:
Binary number Decimal value
0 0 0 1 1 0 1 0 26
1 0 0 0 1 1 0 0 140
1 0 1 0 0 1 1 0 166
Therefore, the result of the binary addition performed on 00011010 and 10001100 is 10100110.
Note: In the above example, a carry is generated in the 4th and the 5th column only.
We can also perform the binary addition on more than two binary numbers. Table 7.2 lists the rules for
adding three binary numbers.
Table 7.2 Rules for adding three binary numbers

A B C A+B+C Carry
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
126 Fundamentals of Computers

To understand the concept of triple binary addition, let us consider the following examples:

Example 7.4 Perform the binary addition operation on the following three numbers:
0 0 1 0
0 0 0 1
0 1 1 1
Solution
The given binary numbers are 0010, 0001 and 0111.
Now, perform the binary addition of the given numbers as:
Binary number Decimal value
0 0 1 0 2
0 0 0 1 1
0 1 1 1 7
1 0 1 0 10
Therefore, the result of the binary addition performed on 0010, 0001 and 0111 is 1010.
Note: In the above example, a carry is generated in the 1st and the 2nd column only.

Example 7.5 Evaluate the binary sum of the following numbers:


0 1 0 1 0
0 0 1 1 0
0 1 1 1 1
Solution
The given binary numbers are 01010, 00110 and 01111.
Now, perform the binary addition of the given numbers as:
Binary number Decimal value
0 1 0 1 0 10
0 0 1 1 0 6
0 1 1 1 1 15
1 1 1 1 1 31
Therefore, the result of the binary addition performed on 01010, 00110 and 01111 is 11111.
Note: In the above example, a carry is generated in the 2nd, 3rd and 4th column only.

7.3 BINARY MULTIPLICATION

The multiplication of two binary numbers can be carried out in the same manner as the decimal
multiplication. However, unlike decimal multiplication, only two values are generated as the outcome
of multiplying the multiplicand bit by 0 or 1 in the binary multiplication. These values are either 0 or
1. The binary multiplication can also be considered as repeated binary addition. For instance, when we
are multiplying 7 with 3, it simply means that we are adding 7 to itself 3 times. Therefore, the binary
Computer Arithmetic 127

multiplication is performed in conjunction with the binary addition operation. Table 7.3 lists the rules for
binary multiplication.
Table 7.3 Binary multiplication rules

A B A¥B
0 0 0
0 1 0
1 0 0
1 1 1

The above table clearly shows that binary multiplication does not involve the concept of carry. To
understand the concept of binary multiplication, let us consider the following examples:

Example 7.6 Perform the binary multiplication of the decimal numbers 12 and 10.

Solution
The equivalent binary representation of the decimal number 12 is 1100.
The equivalent binary representation of the decimal number 10 is 1010.
Now, perform the binary multiplication of the given numbers as:
1 1 0 0 Multiplicand
1 0 1 0 Multiplier
0 0 0 0 First partial product
1 1 0 0
0 0 0 0
1 1 0 0
1 1 1 1 0 0 0 Final product
Therefore, the result of the binary multiplication performed on the decimal numbers 12 and 10 is
1111000.

Example 7.7 Evaluate the binary product of the decimal numbers 15 and 14.
Solution
The equivalent binary representation of the decimal number 15 is 1111.
The equivalent binary representation of the decimal number 14 is 1110.
Now, perform the binary multiplication of the given numbers as:
1 1 1 1 Multiplicand
1 1 1 0 Multiplier
0 0 0 0 First partial product
1 1 1 1
1 1 1 1
1 1 1 1
1 1 0 1 0 0 1 0 Final product
128 Fundamentals of Computers

Therefore, the result of the binary multiplication performed on the decimal numbers 15 and 14 is
11010010.

Example 7.8 Perform the binary multiplication of the following numbers:


1101
111
Solution
The given binary numbers are 1101 and 111.
Now, perform the binary multiplication of the given numbers as:
1 1 0 1 Multiplicand
1 1 1 Multiplier
1 1 0 1 First partial product
1 1 0 1
1 1 0 1
1 0 1 1 0 1 1 Final product
Therefore, the result of the binary multiplication performed on the numbers 1101 and 111 is 1011011.

Example 7.9 Evaluate the binary product of the following numbers:


100010
10010
Solution
The given binary numbers are 100010 and 10010.
Now, perform the binary multiplication of the given numbers as:
1 0 0 0 1 0 Multiplicand
1 0 0 1 0 Multiplier
0 0 0 0 0 0 First partial product
1 0 0 0 1 0
0 0 0 0 0 0
0 0 0 0 0 0
1 0 0 0 1 0
1 0 0 1 1 0 0 1 0 0 Final product
Therefore, the result of the binary multiplication performed on the numbers 100010 and 10010 is
1001100100.

7.4 BINARY SUBTRACTION

The binary subtraction is performed in the same way as the decimal subtraction. Like binary addition and
binary multiplication, binary subtraction is also associated with a set of rules that need to be followed while
carrying out the operation. Table 7.4 lists the rules for binary subtraction.
Computer Arithmetic 129

Table 7.4 Binary subtraction rules

A B A–B Borrow
0 0 0 0
0 1 1 1
1 0 1 0
1 1 0 0

The above table shows that the binary subtraction like the decimal subtraction uses the borrow method
to subtract one number from another. To understand the concept of binary subtraction, let us consider the
following examples:

Example 7.10 Subtract the following binary numbers:


0101
0010
Solution
The given binary numbers are 0101 and 0010.
Now, perform the binary subtraction of the given numbers as:
1 Borrow
0 1 0 1 Minuend
0 0 1 0 Subtrahend
0 0 1 1 Difference
Therefore, the result of the binary subtraction performed on the numbers 0101 and 0010 is 0011.

Example 7.11 Perform the binary subtraction of the following numbers:


10101
01110
Solution
The given binary numbers are 10101 and 01110.
Now, perform the binary subtraction of the given numbers as:
1 1 1 Borrow
1 0 1 0 1 Minuend
0 1 1 1 0 Subtrahend
0 0 1 1 1 Difference
Therefore, the result of the binary subtraction performed on the numbers 10101 and 01110 is 00111

Example 7.12 Perform the binary subtraction of the following numbers:


10111011
01001001
Solution
The given binary numbers are 10111011 and 01001001.
130 Fundamentals of Computers

Now, perform the binary subtraction of the given numbers as:


1 Borrow
1 0 1 1 1 0 1 1 Minuend
0 1 0 0 1 0 0 1 Subtrahend
0 1 1 1 0 0 1 0 Difference
Therefore, the result of the binary subtraction performed on the numbers 10111011 and 01001001 is
111001.

Example 7.13 Perform the binary subtraction of the following numbers:


101110101010
001111011100
Solution
The given binary numbers are 101110101010 and 001111011100.
Now, perform the binary subtraction of the given numbers as:
1 1 1 1 1 1 1 1 Borrow
1 0 1 1 1 0 1 0 1 0 1 0 Minuend
0 0 1 1 1 1 0 1 1 1 0 0 Subtrahend
0 1 1 1 1 1 0 0 1 1 1 0 Difference
Therefore, the result of the binary subtraction performed on the numbers 101110101010 and
001111011100 is 11111001110.

7.5 BINARY DIVISION

Binary division is also performed in the same way as we perform decimal division. Like decimal division,
we also need to follow the binary subtraction rules while performing the binary division. The dividend
involved in binary division should be greater than the divisor. The following are the two important points,
which need to be remembered while performing the binary division:
∑ If the remainder obtained by the division process is greater than or equal to the divisor, put 1 in the
quotient and perform the binary subtraction.
∑ If the remainder obtained by the division process is less than the divisor, put 0 in the quotient and
append the next most significant digit from the dividend to the remainder.

Example 7.14 Divide 14 by 7 in binary form.


Solution
The equivalent binary representation of the decimal number 14 is 1110.
The binary representation of 7 is 111.
Now, perform the binary division of the given numbers as:
1 1 1 ) 1 1 1 0 (10 (Quotient)
1 1 1
0 0 0 0
Computer Arithmetic 131

Therefore, the result of the binary division performed on the decimal numbers 14 and 7 is 10.

Example 7.15 Perform the binary division of the decimal numbers 18 and 8.
Solution
The equivalent binary representation of the decimal number 18 is 10010.
The equivalent binary representation of the decimal number 8 is 1000.
Now, perform the binary division of the given numbers as:
1 0 0 0 ) 1 0 0 1 0 ( 1 0 (Quotient)
1 0 0 0
0 0 0 1 0
0 0 0 0 0
0 0 0 1 0 (Remainder)
Therefore, the result of the binary division performed on the decimal numbers 18 and 8 is 10 with a
remainder of 10.

Example 7.16 Perform the binary division of the decimal numbers 11011 and 1001.
Solution
The given binary numbers are 11011 and 1001.
Now, perform the binary division of the given binary numbers as:
1 0 0 1 ) 1 1 0 1 1 ( 1 1 (Quotient)
1 0 0 1
1 0 0 1
1 0 0 1
0 0 0 0
Therefore, the result of the binary division performed on the numbers 11011 and 1001 is 11.

Example 7.17 Perform the binary division of 217 and 12.


Solution
The equivalent binary representation of the decimal number 217 is 11011001.
The equivalent binary representation of the decimal number 12 is 1100.
Now, perform the binary division of the given numbers as:
1 1 0 0 ) 1 1 0 1 1 0 0 1 ( 1 0 0 1 0 (Quotient)
1 1 0 0
0 0 0 1 1
0 0 0 0 0
0 1 1 0
0 0 0 0
1 1 0 0
1 1 0 0
0 0 0 1 (Remainder)
132 Fundamentals of Computers

Therefore, the result of the binary division performed on the decimal number 217 and 12 is 10010 with a
remainder of 1.

7.6 SIGNED/UNSIGNED NUMBERS

The unsigned binary number is the number with a magnitude of either zero or greater than zero.
The unsigned binary numbers are usually represented using the unsigned-magnitude representation.
The unsigned-magnitude representation only represents the magnitude of the numbers. This type of
representation does not take the sign of the binary numbers into consideration while representing these
numbers. Therefore, we can say that the unsigned-magnitude representation is used to represent the positive
numbers only.
The signed binary numbers are the numbers that are always associated with a sign. This sign helps in
identifying whether the given binary number is a positive quantity or a negative quantity. Signed-magnitude
representation is a method used in the computer system for representing the signed binary numbers. In this
method, an extra bit called sign bit is associated with the magnitude of the given number. This sign bit is
used to indicate whether the given binary number is positive or negative. The value of the sign bit is 0 for
the positive numbers and 1 for the negative numbers. The signed-magnitude representation method can be
used to represent both the positive and the negative numbers. However, the unsigned numbers or the positive
numbers in the computer system are usually represented with the help of unsigned-magnitude representation.
This is because the numbers represented in the unsigned-magnitude representation can be processed more
efficiently and rapidly by the computer system as compared to the signed-magnitude representation.
In the signed-magnitude representation, the number of bits assigned to the signed numbers depends upon
the word size of the microprocessor of the computer system. For instance, consider the 8-bit word size
computer system of representing integers. The 8-bit word size computer system can represent the numbers
between – (28 – 1) to (28 – 1), i.e., – 255 to 255. Figure 7.1 shows the storage system of an 8-bit word size
computer system.
8 7 0
Sign bit Magnitude bits

Fig. 7.1 The 8-bit signed-magnitude representation

In Fig. 7.1, the first 7 bits of the 8-bit word size computer system are used to represent the magnitude of
the number and the last bit, is used to indicate the sign of the number. This bit is known as the sign bit.
Figure 7.2 shows the signed-magnitude representation of the decimal number 50 in an 8-bit word size
computer system. Here, the sign bit contains 0 indicating that the number is positive.
0 0 1 1 0 0 1 0

( 1 complement) numbers -(2^(n-1)-1),2^(n-1)-1


Sign bit
Fig. 7.2 The 8-bit signed-magnitude representation of 50

for n bits
unsigned numbers [0,2^(n)-1]

for a n bit multiplicant and n bit multiplier for signed ( 2 complement) numbers
the maximum bits to store the result is 2n
[-2^(n-1),2^(n-1)-1]
Computer Arithmetic 133

Figure 7.3 shows the signed-magnitude representation of –50 in an 8-bit word size computer system.

1 0 1 1 0 0 1 0

Sign bit

Fig. 7.3 The 8-bit signed-magnitude representation of –50

Here, the sign bit contains 1 indicating that the number is a negative number.
The following are some of the advantages of the signed-magnitude representation:
∑ The main advantage of the signed-magnitude representation is its simplicity. It is very easy to
represent and understand positive as well as negative numbers using this representation.
∑ The binary multiplication and the binary division of the signed binary numbers can be easily
performed.
∑ The signed-magnitude representation can represent equal number of positive and negative quantities
that makes it a very symmetrical method of representation.
The following are some of the disadvantages of the signed-magnitude representation:
∑ The implementation of the signed-magnitude representation in the computer system requires the
use additional digital circuits that make the internal architecture of the computer system little more
complicated.
∑ It is not an easy task to perform the binary addition and the binary subtraction using this
representation.
∑ It provides two different representations of zero, one for plus zero and another for negative zero
but actually they are the same values. This could lead to some confusion while performing various
arithmetic operations.

7.7 COMPLEMENTS OF BINARY NUMBERS

The complement system can also be used to represent the signed binary numbers apart from the signed-
magnitude representation method. In the complement system, the positive integers are represented in a
similar manner as they are represented in the signed-magnitude representation. The following are the two
most popular complement methods used in the computer system:
∑ One’s complement
∑ Two’s complement

7.7.1 One’s Complement


One’s complement method can be used to represent negative binary numbers. A negative number can be
represented using one’s complement method by first computing the binary equivalent of that number and
then changing all the zeros with ones and all the ones with zeros. For example, the binary equivalent of
the decimal number 15 is 00001111. Therefore, –15 can be represented using one’s complement method as
11110000.
Figure 7.4 shows the one’s complement representation of –15 in an 8-bit word size computer system.
134 Fundamentals of Computers

1 1 1 1 0 0 0 0

Sign bit
Fig. 7.4 The one’s complement representation of –15

The one’s complement method also uses the left most bit as the sign bit to indicate the sign of the
number. Like the signed magnitude representation, the values, 0 and 1 indicate positive and negative
numbers respectively. In the above figure, the value of the sign bit is 1 which shows that the represented
number is a negative value.
Table 7.5 lists the one’s complement representation of the integers from – 7 to 7.
Table 7.5 One’s complement representation

Integers One’s complement representation


–7 1000
–6 1001
–5 1010
–4 1011
–3 1100
–2 1101
–1 1110
–0 1111
+0 0000
+1 0001
+2 0010
+3 0011
+4 0100
+5 0101
+6 0110
+7 0111

Note: The one’s complement method of representing signed numbers also has two different
representations for the number, zero.

Example 7.18 Represent –25 in the one’s complement system in byte size.
Solution
The given number is –25.
The equivalent binary representation of 25 in byte size is 00011001.
Now, change all the zeros to ones and all the ones to zeros in order to obtain the one’s complement
representation as:
Computer Arithmetic 135

0 0 0 1 1 0 0 1

1 1 1 0 0 1 1 0
Therefore, the one’s complement representation of –25 is 11100110.

Example 7.19 Represent –32 in the one’s complement system in byte size.
Solution
The equivalent binary representation of 32 in byte size is 00100000.
Now, change all the zeros to ones and all the ones to zeros in order to obtain the one’s complement
representation as:
0 0 1 0 0 0 0 0

1 1 0 1 1 1 1 1
Therefore, the one’s complement representation of –32 is 11011111.

Example 7.20 Represent –32 in the one’s complement system in byte size.
Solution
The given number is –54.
The equivalent binary representation of 54 in byte size is 00110110.
Now, change all zeros to ones and all ones to zeros to obtain the one’s complement representation as:
0 0 1 1 0 1 1 0

1 1 0 0 1 0 0 1
Therefore, the one’s complement representation of -54 is 11001001.

7.7.2 Two’s Complement


Two’s complement is the most widely used method for representing negative numbers in the computer
system. The two’s complement of the given integer can be obtained by adding 1 to the one’s complement
of that number. For example, the two’s complement representation of –15 can be obtained by adding
1 to 11110000, which is the one’s complement representation of –15. Therefore, the two’s complement
representation of –15 is 11110001.
Figure 7.5 shows the two’s complement representation of –15 in an 8-bit word size computer system.
Like the one’s complement method, the two’s complement method also uses the left most bit to represent
the sign of the given integer.

1 1 1 1 0 0 0 1

Sign bit
Fig. 7.5 The two’s complement representation of –15
136 Fundamentals of Computers

Table 7.6 lists the two’s complement representation of integers from – 7 to 7.


Table 7.6 Two’s complement representation

Integers Two’s complement representation


–7 1001
–6 1010
–5 1011
–4 1100
–3 1101
–2 1110
–1 1111
–0 0000
+0 0000
+1 0001
+2 0010
+3 0011
+4 0100
+5 0101
+6 0110
+7 0111

Example 7.21 Represent –33 in the 2’s complement system in byte size.

Solution
The given number is –33.
The equivalent binary representation of 33 in a byte is 00100001.
Now, change all the zeros to ones and all the ones to zeros in order to obtain the one’s complement
representation as:
0 0 1 0 0 0 0 1

1 1 0 1 1 1 1 0
Therefore, the one’s complement representation of –33 is 11011110.
Now, add 1 to the one’s complement representation in order to obtain the two’s complement
representation of the given number as:
1 1 0 1 1 1 1 0
1
1 1 0 1 1 1 1 1
Therefore, the two’s complement representation of –33 is 11011111.
Computer Arithmetic 137

Example 7.22 Represent –11 in the 2’s complement system.


Solution
The given number is –11.
The equivalent binary representation of 11 is 00001011.
Now, change all the zeros to ones and all the ones to zeros in order to obtain the one’s complement
representation as:
0 0 0 0 1 0 1 1

1 1 1 1 0 1 0 0
Therefore, the one’s complement representation of –11 is 11110100.
Now, add 1 to the one’s complement representation in order to obtain the two’s complement
representation of the given number as:
1 1 1 1 0 1 0 0
1
1 1 1 1 0 1 0 1
Therefore, the two’s complement representation of –11 is 11110101.

Example 7.23 Represent –59 in the 2’s complement system.


Solution
The given number is –59.
The equivalent binary representation of 59 in byte size is 00111011.
Now, change all the zeros to ones and all the ones to zeros in order to obtain the one’s complement
representation as:
0 0 1 1 1 0 1 1

1 1 0 0 0 1 0 0
Therefore, the one’s complement representation of –59 is 11000100.
Now, add 1 to the one’s complement representation in order to obtain the two’s complement
representation of the given number as:
1 1 0 0 0 1 0 0
1
1 1 0 0 0 1 0 1
Therefore, the two’s complement representation of –59 is 11000101.

7.8 BINARY SUBTRACTION USING COMPLEMENTS

The complement methods can be used to perform the binary subtraction of the signed integers. The binary
subtraction of the signed integers can be divided into the three following categories:
138 Fundamentals of Computers

∑ Smaller number from larger one


∑ Larger number from smaller one
∑ Positive number from negative number
Note: We can use both the one’s complement and two’s complement method to perform all the categories
of binary subtraction.

7.8.1 Smaller Number from Larger One


Using one’s complement To subtract a smaller number from the larger one using the one’s
complement method, we need to perform the following steps:
1. Obtain the one’s complement of the smaller number.
2. Perform the binary addition on the one’s complement and the larger number.
3. If a carry is generated, add it to the calculated result for obtaining the final result.
Consider the following examples for understanding the method of subtracting a smaller number from a
larger number using one’s complement system:

Example 7.24 Subtract 3 from 8 using the one’s complement method.


Solution
The equivalent binary representation of the decimal number 8 is 1000.
The equivalent binary representation of the decimal number 3 is 0011.
The one’s complement representation of the smaller number 3 is 1100.
Now, perform the binary addition of the one’s complement and the larger number as:
1 0 0 0
1 1 0 0
1 0 1 0 0
Add the generated carry to the calculated result as:
0 1 0 0
1
0 1 0 1
Therefore, the result of the binary subtraction performed on the given numbers using one’s complement
method is 0101.

Example 7.25 Subtract 4 from 7 using the one’s complement method.


Solution
The equivalent binary representation of the decimal number 4 is 0100.
The equivalent binary representation of the decimal number 7 is 0111.
The one’s complement representation of the smaller number 4 is 1011.
Now, perform the binary addition of the one’s complement and the larger number as:
0 1 1 1
1 0 1 1
1 0 0 1 0
Add the carry to the calculated result as:
Computer Arithmetic 139

0 0 1 0
1
0 0 1 1
Therefore, the result of the binary subtraction performed on the given numbers using one’s complement
method is 0011.
Using two’s complement To subtract a smaller number from a larger number using the two’s
complement method, we need to perform the following steps:
1. Obtain the two’s complement of the smaller number.
2. Perform the binary addition of the two’s complement and the larger number.
3. Discard the carry to obtain the final answer.
Consider the following examples for understanding the method of subtracting a smaller number from a
larger number using two’s complement system:

Example 7.26 Subtract 13 from 15 using the two’s complement method.


Solution
The equivalent binary representation of the decimal number 15 is 1111.
The equivalent binary representation of the decimal number 13 is 1101.
The two’s complement representation of the smaller number 13 is 0011.
Now, perform the binary addition of the two’s complement and the larger number as:
1 1 1 1
0 0 1 1
1 0 0 1 0
Discard the carry to obtain the final answer, which is 0010.
Therefore, the result of the binary subtraction performed on the given numbers using two’s complement
method is 0010.

Example 7.27 Subtract 4 from 8 using two’s complement method.


Solution
The equivalent binary representation of the decimal number 4 is 0100.
The equivalent binary representation of the decimal number 8 is 1000.
The two’s complement representation of the smaller number 4 is 1100.
Now, perform the binary addition of the two’s complement and the larger number as:
1 0 0 0
1 1 0 0
1 0 1 0 0
Discard the carry to obtain the final answer, which is 0100.
Therefore, the result of the binary subtraction performed on the given numbers using two’s complement
method is 0100.

7.8.2 Larger Number from Smaller One


Using one’s complement To subtract a larger number from a smaller number using the one’s
complement method, we need to perform the following steps:
140 Fundamentals of Computers

1. Obtain the one’s complement of the larger number.


2. Perform the binary addition on the one’s complement and the smaller number to obtain the final
answer.
Consider the following examples for understanding the method of subtracting a larger number from a
smaller number using one’s complement system:

Example 7.28 Subtract 8 from 3 using the one’s complement method.


Solution
The equivalent binary representation of the decimal number 8 is 1000.
The equivalent binary representation of the decimal number 3 is 0011.
The one’s complement representation of the larger number 8 is 0111.
Now, perform the binary addition of the one’s complement and the smaller number as:
0 1 1 1
0 0 1 1
1 0 1 0
Therefore, the result of the binary subtraction performed on the given numbers using one’s complement
method is 1010.

Example 7.29 Subtract 11 from 7 using one’s complement method.


Solution
The equivalent binary representation of the decimal number 11 is 1011.
The equivalent binary representation of the decimal number 7 is 0111.
The one’s complement representation of the larger number 11 is 0100.
Now, perform the binary addition on the one’s complement and the smaller number as:
0 1 0 0
0 1 1 1
1 0 1 1
Therefore, the result of the binary subtraction performed on the given numbers using one’s complement
method is 1011.
Using two’s complement To subtract a larger number from the smaller one using two’s complement
method, we need to perform the following steps:
1. Obtain the two’s complement of the larger number.
2. Perform the binary addition of the two’s complement and the smaller number to obtain the final
answer.
Consider the following examples for understanding the method of subtracting a larger number from a
smaller number using two’s complement system:

Example 7.30 Subtract 6 from 4 using two’s complement method.


Solution
The equivalent binary representation of the decimal number 6 is 0110.
The equivalent binary representation of the decimal number 4 is 0100.
The two’s complement representation of the larger number 6 is 1010.
Computer Arithmetic 141

Now, perform the binary addition on the two’s complement and the smaller number as:
1 0 1 0
0 1 0 0
1 1 1 0
Therefore, the result of the binary subtraction performed on the given numbers using two’s complement
method is 1110.

Example 7.31 Subtract 12 from 11 using two’s complement method.


Solution
The equivalent binary representation of the decimal number 12 is 1100.
The equivalent binary representation of the decimal number 11 is 1011.
The two’s complement representation of the larger number 12 is 0100.
Now, perform the binary addition on the two’s complement and the smaller number as:
0 1 0 0
1 0 1 1
1 1 1 1
Therefore, the result of the binary subtraction performed on the given numbers using two’s complement
method is 1111.

7.8.3 Positive Number from Negative Number


Using one’s complement The subtraction of a positive number from a negative number always yields
a negative integer. To subtract a positive number from a negative number using the one’s complement
method, we need to perform the following steps:
1. Obtain the one’s complement of both the numbers.
2. Perform the binary addition on the one’s complement representation of both the given numbers.
3. If a carry is generated, add it to the calculated result to obtain the final result.
Consider the following examples for understanding the method of subtracting a positive number from a
negative number using one’s complement system:

Example 7.32 Subtract 7 from –3 using the one’s complement method.


Solution
The one’s complement representation of –7 is 1000.
The one’s complement representation of –3 is 1100.
Now, perform the binary addition on the one’s complement representation of both the given numbers as:
1 0 0 0
1 1 0 0
1 0 1 0 0
Add the carry to the calculated result as:
0 1 0 0
1
0 1 0 1
142 Fundamentals of Computers

Therefore, the result of the binary subtraction performed on the given numbers using one’s complement
method is 101.
Example 7.33 Subtract 9 from –5 using the one’s complement method.
Solution
The one’s complement representation of –9 is 0110.
The one’s complement representation of –5 is 1010.
Now, perform the binary addition on the one’s complement representation of both the given numbers as:
0 1 1 0
1 0 1 0
1 0 0 0 0
Add the carry and add it to the calculated result as:
0 0 0 0
1
0 0 0 1
Therefore, the result of the binary subtraction performed on the given numbers using one’s complement
method is 0001.
Using two’s complement To subtract a positive number from a negative number using the two’s
complement method, we need to perform the following steps:
1. Obtain the two’s complement of both the numbers.
2. Perform the binary addition on the two’s complement representation of both the given numbers.
3. Discard the carry to obtain the final answer.
Consider the following examples for understanding the method of subtracting a positive number from a
negative number using two’s complement system:

Example 7.34 Subtract 9 from –3 using two’s complement method.


Solution
The two’s complement representation of –9 is 0111.
The two’s complement representation of –3 is 1101.
Now, perform the binary addition on the two’s complement representation of both the given numbers as:
0 1 1 1
1 1 0 1
1 0 1 0 0
Discard the carry to obtain the final answer, which is 0100.
Therefore, the result of the binary subtraction performed on the given numbers using two’s complement
method is 0100.

Example 7.35 Subtract 3 from –12 using two’s complement method.


Solution
The two’s complement representation of –3 is 1101.
The two’s complement representation of –12 is 0100.
Now, perform the binary addition on the two’s complement representation of both the given numbers as:
Computer Arithmetic 143

1 1 0 1
0 1 0 0
1 0 0 0 1
Discard the carry to obtain the final answer, which is 0001.
Therefore, the result of the binary subtraction performed on the given numbers using two’s complement
method is 0001.

7.9 REPRESENTING NUMBERS

The numbers processed by the computer system are of two types, integer and floating-point. Therefore, the
number representations used in the computer system are also of two types. These are known as:
∑ Integer representation
∑ Floating-point representation

7.9.1 Integer Representation


Integer numbers are those numbers which do not have fractional parts. Integer numbers include both
positive numbers and negative numbers. They can be handled using any of the following representations:
∑ Unsigned magnitude representation
∑ Signed magnitude representation
∑ One’s complement representation
∑ Two’s complement representation
∑ Biased representation
We have already discussed about the unsigned, signed, one’s complement and two’s complement
representation of integers. The unsigned-magnitude representation is used to represent the positive integers
only. The signed magnitude representation uses an extra bit called sign bit to represent the sign of the
given number. Therefore, this representation can be used by computer system to represent positive as well
as negative integers. The one’s complement and two’s complement representation is mostly suitable for
representing negative integers only.
Apart from these integer representations, there is one more integer representation called biased
representation, which is not commonly used. The biased representation is basically an unsigned
representation but can also be used to represent the negative integers. This can be accomplished by using
the concept of a bias, which is actually a positive value added to the given integer to obtain an unsigned
value. The value chosen for a bias depends upon the number of bits required to represent the given integer.
The bias value for any biased system can be determined by using the formula 2n–1, where n is the number
of bits required to represent the integer. For example, for a 4-bit system the bias would be equal to 8. This
type of biased system would be called biased-8 representation. In biased system, the number of values that
can be represented depends upon the bias value. For instance, we can represent integers from –8 to 7 using
biased-8 system.
The biased-8 representation of the integer –8 can be determined by adding the bias value 8 to the given
integer; this gives the output as 0. Therefore, the biased-8 representation of the integer –8 is 0000. Similarly,
the biased-8 representation of the integer 7 is 1111 which is determined by adding 8 to 7.

7.9.2 Floating-point Representation


Floating-point numbers are the numbers containing two different parts, integer part and fractional part.
144 Fundamentals of Computers

The floating-point numbers are also referred as real numbers. Some of the examples of the floating-point
numbers are 0.5, 3.8 and –102.8. A notation known as scientific notation is used to represent the real
numbers in the computer system. The scientific notation is usually applied for the real numbers, which are
either very small or very large. The scientific notation, also called exponential notation, represents the real
numbers in the following form:
m ¥ be
where,
m is the real value called mantissa
b is the base of the number system
e is the intger value called exponent
Therefore, in the scientific notation, the real numbers are expressed as the product of some real value and
the base of the number system, where the base is raised to some integer value. For example, the floating-
point representation for the real number 325.123 is 3.25123 ¥ 102. Similarly, the number 0.000000245 can
be represented using floating-point representation as 2.45 ¥ 10–7.
A binary number can be represented in the scientific notation by using base 2. For example, the binary
number 1000.0101 can be represented using scientific notation as 1.0000101 ¥ 23.
A given number can be stored in the scientific notation in different forms. For example, the number
4333.123 can be represented in the scientific notation in any one of the following forms:
4.333123 ¥ 103
43.33123 ¥ 102
433.3123 ¥ 101
The modern computer systems usually employ the normalized scientific notation to represent real
numbers. The following are some of the examples of the real numbers represented in the normalized
scientific notation:
0.324521 ¥ 102
0.523 ¥ 10–3
–0.5469 ¥ 105
The format used to store the binary numbers in the computer system is known as binary floating-point
format. In this format, the binary numbers are stored in the normalised scientific form. The binary floating-
point format stores the binary number by dividing it into the following three parts:
Sign The sign part is always 1-bit long and is used to store the information pertaining to the sign of the
number. This part stores either 0 or 1 value for the positive and negative numbers respectively.
Exponent The exponent part is always stored using excess-N notation. The value of N depends upon the
number of bits available for storing the exponent. For example, if the exponent is to be stored in 7 bits,
excess-64 notation would be used. If the exponent is to be stored in 8 bits, excess-127 notation would be
used. Therefore, if 6 is to be stored as the exponent value in a 7-bit word size, it would be stored using
excess-64 notation and its value would be 70. Therefore, the exponent value that is actually stored in the
computer system is determined by adding the value of N to the actual value of the exponent.
Mantissa The mantissa part of the binary number is always stored in the normalised scientific notation in
the computer system.
Figure 7.6 shows the storage layout of the 32-bit binary floating-point number in the computer system.
Computer Arithmetic 145

Sign bit Exponent bits Mantissa bits

1 bit 7/8 bits 24/23 bits


Fig. 7.6 Storing binary numbers in the computer system

To understand the storage layout of the binary numbers, let us consider the following binary floating
point number:
1000100.1
Before storing the given binary floating-point number in the computer system, we need to normalise its
mantissa as:
0.10001001 ¥ 27
Now, the mantissa part of the given number is 0.10001001 and the exponent part of the given number is 7.
Suppose the number of bits available for storing the exponent is 7. In this case, the excess-64 notation
would be implemented by the computer system to store the exponent part of the given number.
The excess-64 notation for the decimal number 7 is 71.
The equivalent binary representation of the decimal number 71 is 1000111.
Therefore, the following are the binary values stored in the sign, the exponent and the mantissa parts in
the computer system:
∑ 0 in the sign part
∑ 1000111 in the exponent part
∑ .10001001 in the mantissa part
Figure 7.7 shows the storage layout of the binary floating point number 1000100.1 in the computer
system.

0 1000111 100010010000000000000000

1 bit 7 bits 24 bits


Fig. 7.7 Storing of the binary number 1000100.1 in the computer system

7.10 INTEGER ARITHMETIC

The integer arithmetic involves a number of arithmetic operations, which are performed on the unsigned
and the signed binary numbers. We have already covered the binary addition, binary subtraction, binary
multiplication and binary division operations on the unsigned binary numbers. We can perform these
arithmetic operations on the signed binary numbers as well. The signed numbers can be represented in the
computer system using any one of the following systems:
∑ Signed-magnitude
∑ One’s complement
∑ Two’s complement

7.10.1 Signed-magnitude System


In the signed-magnitude system, the binary addition can be performed by using the same basic rules that
are used with the unsigned binary numbers. However, while performing the binary addition in the signed-
146 Fundamentals of Computers

magnitude system, we need to take care of two additional rules related to the sign of the binary numbers.
These rules are as follows:
∑ If both the given numbers have the same sign bit, perform the binary addition on the magnitude of the
numbers and use the same sign bit in the final result.
∑ If the sign bits are opposite, instead of binary addition, binary subtraction would be performed on the
given numbers.
Consider the following examples for understanding the method of adding binary numbers in the signed-
magnitude system:

Example 7.36 Add 4 and 3 using signed-magnitude system.


Solution
The signed-magnitude representation of the decimal number 4 is 0 0100.
The signed-magnitude representation of the decimal number 3 is 0 0011.
Now, perform the binary addition as:
0 0 1 0 0
0 0 0 1 1
0 0 1 1 1
Therefore, the result of the binary addition performed on the given numbers in the signed-magnitude
system is 0 0111.

Example 7.37 Add –5 and – 4 using signed-magnitude system.


Solution:
The signed-magnitude representation of the decimal number –5 is 1 0101.
The signed-magnitude representation of the decimal number –4 is 0 0100.
Now, perform the binary addition as:
1 0 1 0 1
1 0 1 0 0
1 1 0 0 1
Therefore, the result of the binary addition performed on the given numbers in the signed-magnitude
system is 1 1001.
While performing the binary subtraction in the signed-magnitude system, the following two
considerations about the sign bits should be kept in mind:
∑ If both the given numbers have opposite sign bits, perform the binary addition on the magnitudes of
the numbers.
∑ If the sign bits are the same, compare the magnitudes of the given numbers. The smaller number
should always be subtracted from the larger number. If minuend is the smaller number and subtrahend
is the larger number, the value of the sign bit would be 1. However, if the minuend is the larger
number and subtrahend is the smaller number, the value of the sign bit would be 0.
Consider the following examples for understanding the method of subtracting binary numbers in the
signed-magnitude system:
Computer Arithmetic 147

Example 7.38 Subtract 12 from 5 using signed-magnitude representation.


Solution
The signed-magnitude representation of 12 is 0 1100.
The signed-magnitude representation of 5 is 0 0101.
As the sign bits are same, larger magnitude would be subtracted from smaller magnitude as:
0 1 1 0 0
0 0 1 0 1
1 0 1 1 1
As the larger number is to be subtracted from the smaller number, we have kept the value of the sign bit
as 1.
Therefore, the result of the binary subtraction performed on the given numbers in the signed-magnitude
system is 1 0111.

Example 7.39 Subtract 5 from 12 using signed-magnitude representation.


Solution
The signed-magnitude representation of 5 is 0 0101.
The signed-magnitude representation of 12 is 0 1100.
Now, perform the binary subtraction by subtracting the smaller number from the larger number as:
0 1 1 0 0
0 0 1 0 1
0 0 1 1 1
As the smaller number is to be subtracted from the larger number, we have kept the value of the sign bit
as 0.
Therefore, the result of the binary subtraction performed on the given numbers in the signed-magnitude
system is 0 0111.
While performing the binary multiplication in the signed-magnitude system, the following two
considerations about the sign bits should be kept in mind:
∑ If the both the numbers have same sign bits, perform the binary multiplication on the magnitudes of
the numbers only. The sign bit to represent the positive result would always be zero.
∑ If both the numbers have opposite sign bits, perform the binary multiplication on the magnitudes of
the numbers. The sign bit to represent the negative result would always be one.
Consider the following examples to understand the method of multiplying binary numbers in the
signed-magnitude system:
Example 7.40 Perform the binary multiplication of 5 and 4 using signed-magnitude system.
Solution
The signed-magnitude representation of 5 is 0 0101.
The signed-magnitude representation of 4 is 0 0100.
Now, perform the binary multiplication only on the magnitudes of the given numbers as:
0 1 0 1 Multiplicand
0 1 0 0 Multiplier
0 0 0 0 First partial product
0 0 0 0
148 Fundamentals of Computers

0 1 0 1
0 0 0 0
0 0 1 0 1 0 0 Final product
As the sign bits of both the given numbers are same, keep the sign bit in the final result as 0.
Therefore, the binary product of the given numbers in signed-magnitude system is 0 10100.

Example 7.41 Perform the binary multiplication of –6 and 2 using signed-magnitude system.
Solution
The signed-magnitude representation of –6 is 1 0110.
The signed-magnitude representation of 2 is 0 0010.
Now, perform the binary multiplication only on the magnitudes of the given numbers as:
0 1 1 0 Multiplicand
0 0 1 0 Multiplier
0 0 0 0 First partial product
0 1 1 0
0 0 0 0
0 0 0 0
0 0 0 1 1 0 0 Final product
As, the sign bits of both the given numbers are opposite, keep the sign bit in the final result as 1.
Therefore, the binary product of the given numbers in signed-magnitude system is 1 1100.
While performing the binary division in the signed-magnitude system, the following two considerations
about the sign bits should be kept in mind:
∑ If the both the numbers have same sign bits, perform the binary division on the magnitudes of the
numbers only. The sign bit to represent the positive result would always be zero.
∑ If both the numbers have opposite sign bits, perform the binary multiplication on the magnitudes of
the numbers only. The sign bit to represent the negative result would always be one.
Consider the following examples to understand the method of dividing the binary numbers in the
signed-magnitude system:

Example 7.42 Evaluate the binary division of the decimal numbers –18 and –9.
Solution
The signed-magnitude representation of –18 is 1 10010.
The signed-magnitude representation of –9 is 1 01001.
Now, perform the binary division only on the magnitudes of the given numbers as:
1 0 0 1) 1 0 0 1 0(1 0 (Quotient)
1 0 0 1
0 0 0 0 0 (Remainder)
As the sign bits of both the numbers are same, keep the sign bit in the final result as 0.
Therefore, the binary division output of the given numbers in the signed-magnitude system is 0 10.
Computer Arithmetic 149

Example 7.43 Evaluate the binary division of the decimal numbers 6 and –3.
Solution
The signed-magnitude representation of 6 is 0 0110.
The signed-magnitude representation of –3 is 1 0011.
Now, perform the binary division only on the magnitudes of the given numbers as:
0 1 1) 0 1 1 0(1 0 (Quotient)
0 1 1
0 0 0 0 (Remainder)
As the sign bits of both the numbers are opposite, keep the sign bit in the final result as 1.
Therefore, the binary division output of the given numbers in the signed-magnitude system is 1 10.

7.10.2 One’s Complement System


The one’s complement system can also be used to perform various arithmetic operations. We have already
discussed the method of performing binary subtraction using one’s complement. Apart from binary
subtraction, the other two major arithmetic operations, which we can perform in one’s complement system,
are binary addition and binary multiplication. The binary addition can be performed in one’s complement
system by following the same rules as followed in the unsigned binary system. If any carry is generated
while performing binary addition, it should be added to the calculated result to obtain the final result.
Consider the following examples for understanding the method of adding the binary numbers in the
one’s complement system:

Example 7.44 Perform the binary addition of –2 and –4 using one’s complement system.
Solution
The one’s complement representation of –2 is 1101.
The one’s complement representation of –4 is 1011.
Now, perform the binary addition of the given numbers as:
1 1 0 1
1 0 1 1
1 1 0 0 0
Discard the carry by adding it to the final result as:
1 0 0 0
1
1 0 0 1
Therefore, the result of the binary addition performed on the given numbers in one’s complement system
is 1001.

Example 7.45 Perform the binary addition of 3 and –6 using one’s complement system.
Solution
The one’s complement representation of 3 is 0011.
The one’s complement representation of –6 is 1001.
Now, perform the binary addition of the given numbers as:
150 Fundamentals of Computers

0 0 1 1
1 0 0 1
1 1 0 0
Therefore, the result of the binary addition performed on the given numbers in one’s complement system
is 1100.
The binary multiplication in one’s complement system can be performed by using the concept of sign bit
extension. According to this concept, when the signed integer is to be represented in the larger bit system,
the additional bits on the left side of the number are filled with the sign bit value. We can use this concept
in one’s complement multiplication by extending the bits in the first partial product. The other binary
multiplication rules are the same as used with the unsigned integers.
Consider the following examples to understand the method of multiplying the binary numbers in the
one’s complement system:

Example 7.46 Multiply –2 and 2 using one’s complement method.


Solution
The one’s complement representation of –2 is 101.
The one’s complement representation of 2 is 010.
Now, perform the binary multiplication as:
1 0 1
0 1 0
1 1 0 0 0
1 0 1
0 0 0
1 0 0 0 1 0
Add the carry to the final product as:
0 0 0 1 0
1
0 0 0 1 1
Therefore, the result of the binary multiplication performed on the given numbers in one’s complement
system is 011.

7.10.3 Two’s Complement System


We can also perform the binary addition and the binary multiplication operations in two’s complement
system. The binary addition can be performed in two’s complement system in the same way as it is
performed in one’s complement system. However, if any carry is generated while performing the binary
addition, it should be discarded completely without adding it to the final result.
Consider the following examples to understand the method of adding the binary numbers in the two’s
complement system:

Example 7.47 Perform the binary addition of 4 and –5 in two’s complement system.
Solution
The two’s complement representation of 4 is 0100.
Computer Arithmetic 151

The two’s complement representation of –5 is 1011.


Now, perform the binary addition as:
0 1 0 0
1 0 1 1
1 1 1 1
Therefore, the result of the binary addition performed on the given numbers in two’s complement system
is 1111.

Example 7.48 Perform the binary addition of –8 and –2 in two’s complement system.
Solution
The two’s complement representation of –8 is 1000.
The two’s complement representation of –2 is 1110.
Now, perform the binary addition as:
1 0 0 0
1 1 1 0
1 0 1 1 0
Discard the carry to obtain the final result, which is 0110.
Therefore, the result of binary addition performed on the given numbers in two’s complement system
is 0110.
The binary multiplication can also be performed in two’s complement system by using the concept of
sign bit extension. Consider the following examples for understanding the method of multiplying the binary
numbers in the two’s complement system:

Example 7.49 Multiply –14 and 5 using two’s complement method.


Solution
The two’s complement representation of –14 is 0010.
The two’s complement representation of 5 is 0101.
Now, perform the binary multiplication as:
0 0 1 0 Multiplicand
0 1 0 1 Multiplier
1 1 0 0 1 0 First Partial Product
0 0 0 0 0
0 0 1 0
1 1 1 0 1 0 Final Product
Therefore, the result of binary multiplication performed on the given numbers in two’s complement
system is 111010.

Example 7.50 Multiply 2 and –4 using two’s complement method.


Solution
The two’s complement representation of 2 is 0010.
The two’s complement representation of –4 is 1100.
152 Fundamentals of Computers

Now, perform the binary multiplication as:


0 0 1 0
1 1 0 0
1 1 1 0 0 0 0
0 0 0 0
0 0 1 0
0 0 1 0
1 0 0 0 1 0 0 0
Discard the carry to obtain the final result as 1000.
Therefore, the result of binary multiplication performed on the given numbers in two’s complement
system is 1000.

7.11 FLOATING-POINT ARITHMETIC

The various floating-point arithmetic operations are performed in the computer system usually on the
numbers represented in the normalised floating-point notation. We can perform four basic arithmetic
operations: addition, subtraction, multiplication, and division, on the normalised binary floating-point
numbers.

7.11.1 Addition
The addition operation is performed on the normalised floating-point numbers by making the exponents of
both the numbers equal. This can be accomplished by shifting the mantissa of the smaller number to the
right by a number equal to the difference between the exponents of the given numbers.
Consider the following examples for understanding the method of adding binary numbers represented in
the normalized binary floating-point format:

Example 7.51 Perform the addition operation on the following numbers:


0.001010110E0101000
0.010001001E0100011
Solution
The given binary floating-point numbers are 0.001010110E0101000 and 0.010001001E0100011.
As the difference between the exponents of both the numbers is 5, shift the mantissa of the second
number to the right by 5 places.
Now, the second number becomes:
0.000000100E0101000
Now, add the mantissa of both the given numbers as:
0.001010110 + 0.000000100 = 0.001011010
Therefore, the result of the addition operation performed on the given numbers is 0.001011010E0101000

Example 7.52 Perform the addition operation on the following numbers:


0.110110100E0100011
0.110001010E0100001
Computer Arithmetic 153

Solution
The given binary floating-point numbers are 0.110110100E0100011 and 0.110001010E0100001.
As the difference between the exponents of both the numbers is 2, shift the mantissa of the second
number to the right by 2 places.
Now, the second number becomes:
0.001100010E0100011
Now, add the mantissa of both the given numbers as:
0.110110100 + 0.001100010 = 1.000010110
Therefore, the addition of the given numbers is 1.000010110E0100011
Transform this result into normalised binary floating-point form as:
0.100001011E0100100
Therefore, the result of the addition operation performed on the given numbers is
0.100001011E0100100.

7.11.2 Subtraction
The subtraction operation is also performed on the given numbers after making their exponent parts equal.
The subtraction operation is carried out by calculating the two’s complement of the subtrahend and adding
it to the minuend for obtaining the final result.
Consider the following examples for understanding the method of subtracting binary numbers
represented in the normalized binary floating-point format:

Example 7.53 Perform the binary subtraction of the following numbers:


0.101100011E0001001
0.011011011E0000110
Solution
The given binary floating-point numbers are 0.101100011E0001001 and 0.011011011E0000110.
As the difference between the exponents of both the numbers is 3, shift the mantissa of the second
number to the right by 3 places.
Now, the second number becomes:
0.000011011E0001001
The two’s complement of the second number is 0.111100101E0001001
Add the two’s complement of the second number to the first number as:
0.111100101E0001001 + 0.101100011E0001001
= 1.101001000E0001001
Discard the overflow bit to obtain the final result as:
0.101001000E0001001
Therefore, the result of the binary subtraction performed on the given numbers is
0.101001000E0001001.

7.11.3 Multiplication
The multiplication operation can be performed on the normalised binary floating-point numbers by
multiplying the mantissa and adding the exponent parts. Consider the following example for understanding
the method of multiplying binary numbers represented in the normalised binary floating-point format:
154 Fundamentals of Computers

Example 7.54 Perform the multiplication operation on the following numbers:


0.110011110E0010101
0.110000100E0001001
Solution
The given binary floating-point numbers are 0.110011110E0010101 and 0.110000100E0001001.
Firstly multiply the mantissa of the given numbers and obtain the result in the normalised floating-point
form as:
0.110011110 × 0.110000100 = 0.100111000
Now, add the mantissas of both the given numbers as:
0010101 + 0001001 = 0011110
Therefore, the result of the binary multiplication performed on the given numbers is
0.100111000E0011110

7.11.4 Division
The division operation can be performed on the normalised binary floating-point numbers by dividing the
mantissa of the first number by the mantissa of the second number and subtracting the exponent of the
second number from the exponent of the first number. Consider the following example for understanding
the method of dividing binary numbers represented in the normalised binary floating-point format:

Example 7.55 Evaluate the division of the following numbers:


0.101110111E0011011
0.001001011E0010001
Solution
The given binary floating-point numbers are 0.101110111E0011011 and 0.001001011E0010001.
First, divide the mantissa of first number by the mantissa of the second number and obtain the result in
the normalised floating-point form as:
0.101110111/0.00100101 = 0.000001010
Now, subtract the mantissa of the first number from the mantissa of the second number as:
0011011 – 0010001 = 0001010
Therefore, the result of the binary division performed on the given numbers is 0.000001010E0001010.

7.12 ERRORS IN ARITHMETIC

Computer arithmetic errors can be divided into two categories, integer arithmetic errors and floating-point
arithmetic errors. The integer arithmetic errors are the errors generated by the computer system while
performing various integer arithmetic operations. On the other hand, the floating-point arithmetic errors
may arise in the computer system while performing various floating-point arithmetic operations.
The following are some important types of integer arithmetic errors in the computer system:
∑ Overflow The overflow error may occur when the computer system attempts to use a number in the
integer arithmetic that is too large to be handled. This type of error may also be generated as the
final result of the integer arithmetic operations. Therefore, the computer users should always use the
numbers only within the range that the computer system can handle.
Computer Arithmetic 155

∑ Underflow The underflow error may occur when the computer system attempts to use a number in
the integer arithmetic that is too small to be handled. The binary subtraction and the binary division
operations may generate this type of error in the computer system.
∑ Truncation The truncation errors may occur in the computer system when the computer system
attempts to convert an integer from one data type to another. If the value of the given integer is
beyond the range of the desired data type, the given integer would be truncated by preserving the
low-order bits only. The binary division operation may generate this kind of error in the computer
system.
∑ Sign The sign errors may occur in the computer system when the computer system attempts to
represent an unsigned number into signed representation and vice versa.
The floating-point arithmetic errors may also occur in the computer system while carrying out various
floating-point arithmetic operations. Overflow and underflow errors also come under the category of
floating-point arithmetic errors. Apart from overflow and underflow, the following are some other important
reasons that may cause floating-point arithmetic errors:
∑ The shifting of mantissa to the right for the purpose of representing the real number in the normalised
scientific floating-point form may alter the value of the number.
∑ The conversion of a floating-point decimal number to its equivalent floating-point binary form may
generate a binary number containing some repeated sequence of bits in the fraction part. This repeated
sequence may sometimes be truncated by the computer system resulting in the wrong output.
∑ The rounding-off of a very large fraction to the desired number of digits may also generate the
floating-point errors.

Example 7.56 Multiply the numbers 0.200000 E4 and 0.400000 E–2.


Solution
fz = 0.200000 × 0.400000
= 0.080000
Ez = 4–2=2
z = 0.080000 E2
= 0.800000 E1 (normalised)
= 0.800000

Example 7.57 Divide the number 0.8765453 E–5 by 0.200000 E–3.


Solution
fz = 0.876543 ∏ 0.200000
= 4.382715
Ez = – 5 – (– 3) = –2
z = 4.382715 E–2
= 0.438271 E–1 (normalised)
Note that the mantisa of the result is shortened.

Example 7.58 Add the numbers 0.500000 E1 and 0.100000 E–7.


Solution
Let x = 0.500000 E1 and y = 0.100000 E–7
Ez = 1
156 Fundamentals of Computers

fy = 0.000000001
fz = 0.500000001 = 0.500000
z = 0.500000 E1
Note that the value of z is the same as that of x.

Example 7.59 Multiply the number 0.350000 E40 by 0.500000 E70.


Solution
Ez = 110
fy = 0.175000
z = 0.175000 E110
If the maximum value of exponent is 99, then the result overflows.

Example 7.60 Divide the number 0.875000 E–18 by 0.200000 E95.


Solution
Ez = – 18 – 95 = – 113
fz = 0.875000 ∏ 0.200000
= 4.375000
z = 4.375000 E–113
= 0.437500 E–114
If the minimum value of exponent is –99, then the result underflows.

Example 7.61 Subtract 0.499998 from 0.500000.


Solution
fx = 0.500000
fy = 0.499998
fx – fy = 0.000002
Ez = 0
Thus, z = 0.000002 × 100
= 0.200000 × 10–5

Example 7.62 Associative law for addition.


Solution
Let x = 0.456732 × 10–2,
y = 0.243451,
z = – 0.248000
(x + y) = 0.004567 + 0.243451 = 0.248018
(x + y) + z = 0.248018 – 0.248000 = 0.000018 = 0.180000 × 10–4
(y + z) = 0.243451 – 0.248000 = – 0.004549 = – 0.4549 × 10–2
x + (y + z) = (0.456732 – 0.454900) 10–2 = 0.183200 × 10–2
Thus,
(x + y) + z π x + (y + z)
Computer Arithmetic 157

7.13 LAWS OF ARITHMETIC

The different arithmetic laws hold true for addition as well multiplication operations. The arithmetic laws
can be divided into the following four major categories:
∑ Identity laws
∑ Commutative laws
∑ Associative laws
∑ Distributive laws

7.13.1 Identity Laws


The two basic identity laws are as follows:
∑ a¥1=a
∑ a+0=a
The first identity law, a ¥ 1 = a, holds true for the multiplication operation. It states that the
multiplication of a number with 1 always yields the same number. For example, 5 ¥ 1 always yields 5.
The second identity law a + 0 = a holds true for the addition operation. It states that the addition of 0 to a
number always yields the same number. For example, 5 + 0 always yields 5.

7.13.2 Commutative Laws


The two basic commutative laws are as follows:
∑ a¥b=b¥a
∑ a+b=b+a
The first commutative law, a ¥ b = b ¥ a, holds true for the multiplication operation. It states that
multiplying a by b or b by a yields the same result. For example, the multiplication of 3 by 7 and the
multiplication of 7 by 3 always yield 21.
The second commutative law a + b = b + a holds true for the addition operation. It states that the addition
of the two numbers always yields the same result irrespective of the ordering of the numbers. For example,
adding 3 to 5 and adding 5 to 3 always yields 8.

7.13.3 Associative Laws


The two basic associative laws are as follows:
∑ a ¥ (b ¥ c) = (a ¥ b) ¥ c
∑ a + (b + c) = (a + b) + c
The first associative law holds true for the multiplication operation. It states that the multiplication
operation always yields the same result irrespective of the grouping of the numbers. For example, the
multiplication operations, 3 ¥ (5 ¥ 2) and (3 ¥ 5) ¥ 2 always yield the same result 30.
The second associative law holds true for the addition operation. It states that the addition operation
always yields the same result irrespective of the grouping of the numbers. For example, the addition
operations, 3 + (5 + 2) and (3 + 5) + 2 will always yield the same result, i.e., 10.

Example 7.63 Associative law for multiplication.


Solution
Let x = 0.400000 × 10+40, y = 0.500000 × 10+70,
z = 0.300000 × 10 –30

(x × y) × z = (0.200000 × 10+110)(0.300000 × 10–30)


158 Fundamentals of Computers

Note that (x × y) causes overflow and so the result will be erroneous.


x × (y × z) = (0.400000 × 1040) × (0.1500000 × 1040)
= 0.060000 × 1080
0.600000 × 1079
This gives the correct result assuming that the exponent can take a value upto +99.
Note that the associative law of arithmetic is not always satisfied as illustrated by the Example 7.62.

7.13.4 Distributive Laws


The two basic distributive laws are as follows:
∑ a ¥ (b + c) = a ¥ b + a ¥ c
∑ (a + b) ¥ (c + d) = ac + ad + bc + bd
The distributive laws hold true for the addition as well as multiplication operations. These laws help
solve the complicated multiplication operations involving large numbers by breaking down the numbers
into smaller numbers.
For example, the multiplication operation 29 ¥ 9 can also be performed as:
= (20 + 9) ¥ 9
= (20 ¥ 9) + (9 ¥ 9)
= 180 + 81
= 261

Chapter Summary
The main function of the computer system is to process the data. The processing of data by the computer system
involves a lot of arithmetic, which is usually of binary type. The basic arithmetic operations performed by the
computer system are binary addition, binary multiplication, binary subtraction and binary division.
The basic arithmetic operations can be performed on the integer data as well on floating-point data. The integers
in the computer system can be represented by using four different systems: unsigned, signed-magnitude, one’s
complement and two’s complement. The unsigned system is used to represent positive integers only. The other
systems can be used to represent positive as well negative integers. The complement system can also be used to
perform the binary subtraction in an efficient manner. The floating-point numbers can be represented in the computer
system using normalized binary floating-point form. The computer system can generate different types of errors
while performing different arithmetic operations. Therefore, a suitable mechanism should be adopted to prevent the
occurrence of these errors.

Key Terms to Remember

∑ ALU: ALU is an important component of CPU that is used to perform various arithmetic and logical operations in
the computer system.
∑ Integer arithmetic: Integer arithmetic refers to various arithmetic operations involving integer operands only.
∑ Floating-point arithmetic: Floating-point arithmetic refers to various arithmetic operations involving floating-point
operands only.
∑ Unsigned binary number: Unsigned binary number is the number with a magnitude of either zero or greater than
zero.
∑ Signed binary number: Signed binary number is the number that is always associated with a sign.
Computer Arithmetic 159

∑ Sign bit. Sign bit is an additional bit indicating the sign of the number. It has the value 0 for the positive integers
and value 1 for the negative integers.
∑ One’s complement: One’s complement is a system of representing negative integers. Any negative number can be
represented in this system by complementing the bits of its equivalent binary number.
∑ Two’s complement: Two’s complement is another system of representing negative integers. Any negative integer
can be represented in this system by first calculating the one’s complement of that number and then adding 1 to it.

Review Questions

Fill in the Blanks

1. The arithmetic operations are usually performed in the computer system by _________ and _________ unit of
the CPU.
2. The computer arithmetic is also referred to as the _________ arithmetic.
3. The binary multiplication can be considered as the _________ process of binary _________.
4. Unsigned binary number is a number with a magnitude of either _________ or _________.
5. The unsigned-magnitude representation only represents the _________ of the numbers.
6. The _________ most bit of the given signed number is used to represent the sign of that number.
7. The signed binary numbers always associate a _________ bit with them.
8. The signed-magnitude representation can represent _________ as well as _________ numbers.
9. _________ system can also be used for representing negative integers.
10. The two’s complement of any negative number can be obtained by adding _________ to the one’s complement
of that number.
11. The biased representation of integers uses the concept of a_________.
12. A bias is actually a _________ that is added to the given integer to obtain an unsigned value.
13. The bias value depends upon the number of _________ required to represent the number.
14. The floating-point numbers consist of two major parts, _________ and _________.
15. The floating-point representation is a _________ notation of representing real numbers in the computer system.
16. The scientific notation is usually applied for the real numbers, which are either very _________ or very _______.
17. The different arithmetic laws hold true for _________ as well _________ operations.

Multiple Choice Questions

1. Which of the following unit performs the arithmetic operations in the computer system?
A. Control unit B. ALU C. Shift unit D. None of the above
2. Which of the following operation is not performed by the ALU of the computer system?
A. Binary addition B. AND operation C. Storing the data D. Binary division
3. Which of the following is not an appropriate operand for arithmetic operations?
A. Integers B. Strings C. Real D. None of the above
160 Fundamentals of Computers

4. Which of the following is not a valid binary addition rule?


A. 0 + 0 = 0 B. 1 + 0 = 1 C. 1 + 1 = 0 with a carry 1 D. 1 + 1 = 0 with no carry
5. What is the result of the binary addition performed on the numbers 1001 and 0101?
A. 0010 B. 1110 C. 1010 D. 1111
6. The binary multiplication can be considered as the repetitive process of:
A. Binary addition B. Binary subtraction C. Binary division D. Binary multiplication
7. Which of the following is not a valid binary multiplication rule?
A. 0 × 0 = 1 B. 0 × 1 = 0 C. 1 × 1 = 1 D. 1 × 0 = 0
8. What is the result of the binary multiplication performed on the numbers 12 and 10?
A. 101011 B. 0111101 C. 1111000 D. 1010000
9. Which of the following is not a valid binary subtraction rule?
A. 0 – 0 = 0 B. 1 – 0 = 1 with no borrow
C. 1 – 1 = 0 D. 0 – 1 = 1 with no borrow
10. What is the result of binary subtraction performed on the numbers 1001 and 0101? 0100
A. 0001 B. 0101 C. 1000 D. 0011
11. Binary division is closely related with the arithmetic operation:
A. Binary addition B. Binary subtraction C. Binary multiplication D. Binary division
12. Unsigned binary number are the numbers with a magnitude of:
A. Exactly zero B. Either zero or greater than zero
C. Less than zero D. None of the above
13. The signed-magnitude representation is used to represent:
A. Positive numbers only B. Negative numbers only
C. Numbers with magnitude zero only D. Both the positive and negative numbers
14. The sign bit is used in the signed-magnitude system for representing:
A. Value of the number B. Whether the number is positive or negative
C. Whether the number is zero D. None of the above
15. What is the value of sign bit for positive numbers?
A. 1 B. Not defined C. 0 D. None of the above
16. Which of the following bit is reserved for the sign bit in signed-magnitude representation?
A. MSB B. LSB
C. Exactly the middle of the bits D. None of the above
17. Which of the following statement is true for one’s complement?
A. One’s complement of a binary number can be obtained by replacing 0 by 1 and 1 by 0.
B. One’s complement is only used to represent negative numbers.
C. One’s complement of a binary number can be obtained by subtracting the number from 9999.
D. None of the above.
18. Two’s complement of a number can be obtained by adding:
A. 0 to the one’s complement of the number
B. 1 to the one’s complement of the number
C H APT ER 10
COMPUTER SOFTWARE

Chapter Outline Chapter Objectives


10.1 Introduction
In this chapter, we will learn:
10.2 Types of Computer Software
10.2.1 System Software
∑ Fundamentals of computer software
10.2.2 Application Software ∑ Types of software
10.3 System Management Programs ∑ Role of system software
10.3.1 Operating System ∑ Types of system software and their
10.3.2 Utility Programs functions
10.3.3 Device Drivers ∑ Functions of operating system
10.4 System Development Programs ∑ Different types of application software
10.4.1 Language Translators
10.4.2 Linkers
∑ Basic steps in solving a problem
10.4.3 Debuggers ∑ Basic steps in developing a program
10.4.4 Editors
10.5 Standard Application Programs
10.5.1 Word Processor
10.5.2 Spreadsheet
10.5.3 Database Management System 10.1 INTRODUCTION
10.5.4 Desktop Publishing System
10.6 Unique Application Programs All computer systems consist of two major
10.6.1 Inventory Management System
components, namely, hardware and software. The
10.6.2 Payroll System
10.7 Problem Solving hardware refers to the physical equipments that are
10.7.1 Hierarchy Chart necessary for performing various operations, such
10.7.2 Algorithms as reading and processing data, storing results and
10.7.3 Flowcharts providing output to the users in a desired form. The
10.7.4 Pseudocodes software refers to a set of computer programs that
10.8 Structuring the Logic are required to enable the hardware to work and
10.8.1 Sequence Structure
perform these operations effectively.
10.8.2 Selection Structure
10.8.3 Repetition Structure A computer program is basically a set of logical
10.9 Using the Computer instructions, written in a computer programming
Chapter Summary language that tells the computer how to accomplish
Key Terms to Remember a task. The software is therefore an essential
Review Questions interface between the hardware and the user as
Fill in the Blanks shown in Fig. 10.1.
Multiple Choice Questions
We can say that software gives life to the
Discussion Questions
hardware and therefore, the software is popularly
214 Fundamentals of Computers

referred to as the “soul” of the computer


system while the hardware as the “heart”.
There is an array of computer programs
available for operating and controlling the
computer. It is the judicious combination
of these programs that gives the computer
its power and versatility, and the users their
satisfaction.
In this chapter, we shall discuss the various
types of computer software and their functions
and utility. Fig. 10.1 Software interface between hardware and software

10.2 TYPES OF COMPUTER SOFTWARE

As stated earlier, a computer software performs


two distinctive tasks. The first task is to control and
coordinate the hardware components and manage
their performances and the second one is to enable the
users to accomplish their required tasks. The software
that is used to achieve the first task is known as the
system software and the software that is used to achieve
the second task is known as the application software.
While the system software is essential for a computer
to work, the application software is the additional
software required for the user to perform a specific job.
The system software not only controls the hardware
functions but also enables the hardware to interact
with the application software as well as the users as
Fig. 10.2 Layers of software and their interactions
illustrated in Fig. 10.2.

10.2.1 System Software


System software consists of many different programs that manage and support different tasks. Depending
upon the task performed, the system software can be classified into two major groups:
∑ System management programs used for managing both the hardware and software systems.
∑ System development programs used for developing and executing application software.

10.2.2 Application Software


Application software includes a variety of programs that are designed to meet the information processing
needs of end users. They can be broadly classified into two groups:
∑ Standard application programs that are designed for performing common application jobs.
∑ Unique application programs that are developed by the users themselves to support their specific
needs.
Figure 10.3 illustrates the major categories of computer software.
Computer Software 215

Fig. 10.3 Major categories of computer software

10.3 SYSTEM MANAGEMENT PROGRAMS

System management programs are those programs that are


meant for operating the hardware system and managing their
resources effectively. They also enable the users to perform
certain utility functions, such as creating backup files,
recovering damaged files and merging files. They minimise the
human intervention during processing and aid in maximising
the productivity of a computer system. System management
programs include:
∑ Operating system
∑ Utility programs Fig. 10.4 System Management Programs
∑ Device drivers
These programs work in close interaction with each other as
shown in Fig. 10.4.

10.3.1 Operating System


Operating System (OS) is the principal component of system
software and is responsible for overall management of computer
resources. It also provides an interface between the computer and
the user and helps in implementing the application programs as AH
illustrated in Fig. 10.5.
Major functions of an operating system are:
∑ Scheduling and execution of all processes.
∑ Allocation and management of main memory and other
storage areas to the programs.
∑ Coordination and assignment of different hardware devices
to the programs.
∑ Creation, storage and manipulation of files required by the Fig. 10.5 Hardware-OS-User interface
various processes.
216 Fundamentals of Computers

∑ Determining and maintaining the order of execution of programs.


∑ Interpretation of commands and instructions.
∑ Coordination and assignment of other development and utility programs.
∑ Providing a friendly interface between the computer and the user.
∑ Ensuring security of access to computer resources.
Operating systems are usually supplied by the hardware manufacturers and are rarely developed by the
users due to its technical complexity. The operating system is discussed in more detail in the next chapter.
The most popular operating system, MS-DOS, is discussed in Chapter 12.

10.3.2 Utility Programs


Utility programs refer to small programs, which provide additional capabilities to the computer system in
addition to the ones provided by the operating system. They enable an operating system to perform some
additional tasks, such as searching and printing the files and scanning the viruses, etc. A utility program is
not an essential part of an operating system, because it does not help the operating system in the execution
of a command or a program. A utility program only provides the additional features to the computer system.
In other words, an operating system can execute most of the programs without having the utility programs.
Utility programs are added to an operating system to perform many different tasks, that include:
∑ Search and replace. It enables the operating system to search a file on the basis of the specified
search criteria.
∑ Print. It enables an operating system to initiate the print operation of the printer connected with the
computer system.
∑ Disk defragmenter. It helps in defragmenting the memory space. Defragmentation is the process of
storing the data at a single place in the memory instead of disjointed memory locations.
∑ System profiler. It provides the information related to the various hardware and software components
installed in the computer system. In other words, it provides a list of the hardware components, which
are presently connected with the computer system, and the software components, which are currently
installed in the computer system.
∑ Encryption. It enables the operating system to generate the encrypted format of the messages or
the files, which have to be transmitted from one system to another system over the network or the
Internet.
∑ Virus scanner. It enables the operating system to detect viruses and bugs, which may affect the
correct functioning of the computer system.
∑ Backup. It enables the creation of a copy of various files and folders on a secondary medium such as
magnetic disk and magnetic tape, in order to keep the original data safe.
∑ Data recovery. It enables the retrieval of lost data from a corrupted or damaged primary storage
medium.
Like operating systems, utility programs are prewritten by manufacturers and supplied with the
hardware. They may also be obtained from standard software vendors. A good range of utility programs can
make the life much easier for the user.

10.3.3 Device Drivers


A computer system is connected with multiple input and output (I/O) devices, so that it can communicate
with the end user. In order to interact with the I/O devices, the computer system requires special software
called device driver. The device driver acts as a translator between the I/O devices and the computer.
A device driver of the input device interprets the input provided by the user into the computer
Computer Software 217

understandable form and directs it to the operating system. Similarly, the device drivers of the output
devices translate the output generated by the computer into the user understandable format and display it
on the screen. In other words, a device driver is special software that enables a hardware device, such as
keyboard, monitor and printer to perform an operation according to the command given by the end user.
Whenever a program needs to use a
connected hardware device, it issues a
command to the operating system. The
operating system calls the respective
routine or process of the device driver,
which instructs the device to perform
the task. For providing instruction to the
devices, the device driver sends various
control and data signals through buses
and cables to the device. In order to
acknowledge the device driver’s signal,
the device sends the acknowledgment
signals to the device driver. After
performing the task, the device sends
a message to the device driver, which
returns the value to the calling program
of the operating system. In other words,
a device driver instructs a hardware
device the way it should accept the input
from the operating system and the way
in which it should communicate with
the other units of the computer system.
Fig. 10.6 Working of a device driver
Figure 10.6 illustrates the working of
the device driver.

10.4 SYSTEM DEVELOPMENT PROGRAMS

System development programs known as programming software allow the users to develop programs
in different programming languages. The process of developing and executing a program involves the
following tasks:
∑ Debugging the program
∑ Linking the various variables and objects with the libraries files
∑ Translating the code from one language to another
∑ Running the machine code to perform the desired task
In order to carry out these tasks, we need the following system development tools:
∑ Language translators
∑ Linkers
∑ Debuggers
∑ Editors
218 Fundamentals of Computers

10.4.1 Language Translators


Language translator is used to convert
the program code written in one
language to another language. The
program code provided as an input to
the language translator is known as
source code. The source code is a high-
level or an assembly language program.
The language translator converts the
high-level language program into the
low-level language program called
object code. Compiler, interpreter
and assembler are the most common
examples of language translator.
A compiler translates a high-level
program into a low-level program and
Fig. 10.7 Language translators
an assembler translates an assembly
language program into a low-level program. An interpreter also produces a low-level program from a
high-level program, but the working of the interpreter is not similar to that of the compiler. An interpreter
processes the high-level program line-by-line and simultaneously, produces the low-level program. On the
other hand, a compiler compiles the high-level program in one go. Figure 10.7 shows the input and the
output of the various language translators.

10.4.2 Linkers
Most of the high-level languages allow the developer to develop a large program containing multiple
modules. Linker arranges the object code of all the modules that have been generated by the language
translator into a single program. The execution unit of the computer system is incapable of linking all the
modules at the execution time and therefore, linker is regarded as one of the important software because of
its ability to combine all the modules into a single program. Linker assembles the various objects generated
by the compiler in such a manner that all the objects are accepted as a single program during execution.
Linker also includes the links of various objects, which are defined in the runtime libraries. In many cases,
linker inserts the symbolic address of the objects in place of their real address. Figure 10.8 illustrates the
working of a linker.

10.4.3 Debuggers it is a three stage process of detection,isolation & correction of errors


Debugger is the software that is used to detect the errors and bugs present in the programs. The debugger
locates the position of the errors in the program code with the help of what is known as the Instruction Set DIC
Simulator (ISS) technique. ISS is capable of stopping the execution of a program at the point where an
erroneous statement is encountered.
Debugger is divided into two types, namely, machine-level debugger and symbolic debugger. The
machine-level debugger debugs the object code of the program and shows all the lines where bugs
are detected. On the other hand, the symbolic debugger debugs the original code, i.e., the high-level
language code of the program. It shows the position of the bug in the original code of the program
developed by the programmer.
Computer Software 219

Fig. 10.8 Working of linker

While debugging a program, the debugger performs a number of functions other than debugging, such as
inserting breakpoints in the original code, tracking the value of specific variables, etc. In order to debug the
program, a debugger helps us to perform the following tasks:
∑ Step-by-step execution of a program
∑ Back tracking for checking the previous steps
∑ Stopping the execution of the program until the errors are corrected

10.4.4 Editors
Editor is a special program that allows the user to work with text in the computer system. It is used for the
documentation purposes and enables us to edit the information present in an existing document or a file.
The editor enables us to perform the various editing operations such as copy, cut and paste while editing the
text. On the basis of the content edited by the editors, they are divided into the following categories:
∑ Text editor It is used to edit plain text. An operating system always includes a text editor for
updating the configuration files.
∑ Digital audio editor It is used to edit the information related to the audio components of a
multimedia application. These editors are used in audio applications where editing the music and the
sound signals is necessary.
∑ Graphics editor It is used to edit the information related to the graphical object. These editors
are generally used in the multimedia applications where the user is working with multiple animation
objects.
∑ Binary file editor It is used to edit the digital data or the binary data, i.e., data having strings of
0s and 1s.
∑ HTML editor It is used to edit the information included in the web pages.
220 Fundamentals of Computers

∑ Source code editor It is used to edit the source code of a program written in a programming
language such as C, C++ and Java.

10.5 STANDARD APPLICATION PROGRAMS

Standard application programs, also known as general-purpose application programs, are programs that
perform certain common information processing tasks for the users. For example, preparing documents such
as letters and notes are common among almost all organisations as well as individuals. Similarly, creating
and managing databases of products and employees are very common activities in large organisations.
Ready-to-use programs for such applications are available from hardware or software vendors. These
programs would not only increase significantly the productivity of users but also decrease the investment in
terms of time and cost. Examples of standard application programs include:
∑ Word processor
∑ Spreadsheet
∑ Database Manager
∑ Desktop Publisher
∑ Web Browser
We shall briefly discuss some of these programs in this section.

10.5.1 Word Processor


Word processor is an application software that is generally used to create documents such as letters, reports,
etc. It is one of the most commonly used computer applications. Word processor enables us to enter text
in a document in a particular format. It also allows us to modify the existing text and apply the formatting
features, such as boldface and italic, change the colour of the text, change the writing style of the text,
etc. The word processor application software also allows us to perform different operations, such as
cut-paste for moving the text within the document, copy-paste for copying the text within a document or
from one document to another document, etc. MS Word is the most common example of a word processor.
Figure 10.9 shows the default window of MS Word.

Fig. 10.9 The default window of MS Word


Computer Software 221

10.5.2 Spreadsheet
Spreadsheet is an application software that enables the user to maintain a worksheet in which information
is stored in different cells. Each cell in the spreadsheet can contain numeric and alphanumeric data.
Spreadsheet is also used as a computational tool by applying formulas on the values of cells. If we change
the value of a cell in a spreadsheet, then all the values, which are dependent on that value, get automatically
updated according to the new value. As a result, the users, who need to store and maintain financial
information, always prefer a spreadsheet for storing the information.
MS Excel is the most common example of the spreadsheet software. Figure 10.10 shows the default
window of MS Excel.

Fig. 10.10 The default window of MS Excel

10.5.3 Database Management System


Database Management System (DBMS) is a computer software that helps us to store and maintain records
in a database. Database refers to a set of records, which are stored in a structured manner in the computer
system. Record refers to a set of similar or dissimilar values related to an entity such as student and
employee. DBMS allows a user to perform various operations such as search, update and delete on the data
stored in the database. With the help of DBMS an end user can store, retrieve, and modify the data in an
easy manner. The advantages of DBMS are as follows:
∑ It enables the user to organise all the information in a strategic manner.
∑ It helps the users in maintaining consistency in the information stored in the database.
∑ It helps the user in maintaining data integrity while performing the various operations on the database
values.
∑ It allows the user to maintain the security of the confidential information by password-protecting the
database.
∑ It helps in accessing information from any system connected in a networked system environment.
The DBMS used for maintaining a database always uses specific data model such as relational,
hierarchical and network that describes the physical and the logical arrangement of data in the database.
In the relational data model, different records are arranged in the form of tables containing rows and
222 Fundamentals of Computers

columns. In the hierarchical model, records are arranged in the form of a tree where each record is attached
with one parent node and one or more child nodes. In the network model, data is arranged in the form of a
network where each node is connected with one or more parent nodes as well as child nodes. Figure 10.11
shows the arrangement of records in different data models of the DBMS.

Fig. 10.11 Different data models used to design DBMS


Computer Software 223

DBMS comprises of different components, which are responsible for performing a specific task in the
database system. Some of the components of DBMS are as follows:
∑ Data structure Data structure refers to a storage mechanism that is used to store multiple values
as a single entity. In DBMS, different types of data structures are used to store the information related
to an entity. These data structures include:
❏ File It refers to a collection of multiple records.
❏ Record It refers to a collection of multiple values of different data types related to one entity.
❏ Field It refers to a set of different values having similar data type.
∑ Transaction mechanism DBMS always includes a transaction mechanism, which ensures that
the basic properties of the database system are not affected by the processing of the transactions.
A transaction mechanism included in a database system consists of the following properties:
❏ Atomicity The transaction mechanism should complete either all tasks included in a transaction
processing or none of them.
❏ Consistency The transaction mechanism should be capable of maintaining consistency in the
information stored in the multiple files of DBMS after the processing of a transaction.
❏ Isolation The transaction mechanism should not allow any sub process of the transaction to use
the intermediate data of another transaction.
❏ Durability The transaction mechanism should be capable of providing information related to
the transactions, which have been processed to change the information stored in the database.
∑ Database query language DBMS includes a query language system, which enables a user to
perform various operations such as searching and updating the information stored in the database.

10.5.4 Desktop Publishing System


Desktop publishing system enables the user to perform various activities required for publishing of a page
or set of pages. These activities include organising the content layout by setting margins and justification
properties of the page. In the desktop publishing system, a page layout software is installed on a computer
system that enables the end users to view the changes done at the time of designing the document. The
page layout software uses the ‘What You See Is What You Get (WYSIWYG)’ technique for displaying the
preview of the page being designed. Desktop publishing system is also referred as DTP.
Desktop publishing system is generally used in the publishing industry, where there is a need to publish
information either through print media or display media. It helps the users to design the desired page layout
containing different components such as text, graphics and images. Some of the commonly used DTP
application software include: Quark XPress, InDesign, Microsoft Publisher, Apple Pages.

10.6 UNIQUE APPLICATION PROGRAMS

There are situations where organisations need to develop their own programs to accomplish certain tasks
that are unique to their areas of operations. Similarly, individuals like scientists, engineers, accountants,
teachers and other professionals write their own programs to solve their problems. Such programs are
224 Fundamentals of Computers

known as unique application programs or application-specific programs. These programs are also referred
to as end-user application programs. Examples of unique applications include:
∑ Managing the inventory of a store
∑ Preparing pay-bills of employees in an organisation
∑ Processing examination results of students
∑ Reserving seats in trains or airlines
∑ Analysing mathematical models
∑ Computing personal income tax
∑ And many more
These programs are usually developed in one of the high-level languages, such as C, C++ or Java and
therefore, developing such programs in-house would require skilled programmers with deep knowledge not
only in programming languages but also in programming environment.
We will discuss below in this section two applications which are usually developed in-house to suit the
user’s unique requirements.

10.6.1 Inventory Management System


Inventory management system helps in keeping a record of the huge amount of items stored in warehouse
and storerooms. In order to keep a record of inventory or items, application software called inventory
management system, which makes use of DBMS, is used. DBMS is responsible for storing the information
related to the items in the form of various files and tables. It also helps in storing the information related
to the location, where a particular item is placed. Inventory management system enables a user to get a
report on the items stored in the warehouse or storeroom on the basis of the different conditions, such as
availability of items, shipping date of item, etc.
The database of the inventory management system identifies each item by a unique identification
number. The identification number is used as the primary key of an item in the database. Primary key refers
to an attribute, which must contain a unique value for each item of the database. The identification number
can be dependent on the various properties, such as type, model and
manufacturing date of the items, etc. Nowadays, the identification number
of an item is specified on the barcodes printed on each item. Barcode is a
group of small and black vertical lines of varying widths. The barcodes
are not understandable by a human being and is always read by an input
device called barcode reader. A barcode reader is similar to the handheld
scanner that scans the barcode of the item in order to enter the barcode in Fig. 10.12 Barcode of an item
the database. Figure 10.12 shows the sample barcode of an item.
The use of barcode technology with inventory management system saves a lot of time as the user is not
required to manually enter the item details. These details are automatically read by the barcode scanner
and stored in the database of the inventory management system. An inventory management system finds its
application in those organisations where a constant maintenance and updation of inventory information is
required.

10.6.2 Pay-roll System


Pay-roll system is the application software that enables us to perform the various activities related to pay-
roll accounting and pay-roll administration process. It is used by the HR department of an organisation
for the purpose of computation of salary of employees. A typical pay-roll processing system provides
an interface to the user through which the user can enter salary related details, such as attendance, tax
Computer Software 225

deduction, etc. A pay-roll system is an effective and efficient way of computing the salary of employees
as it eliminates the manual task of performing computations and automates most of the tasks related to
pay-roll processing.
A pay-roll system can be custom built or it can be an off-the-shelf application software. Several ERP
products include a dedicated module on pay-roll processing which is particularly used in enterprise-wise
implementation of pay-roll processing. A pay-roll system can also be used to print or e-mail the salary slips
of employees.

10.7 PROBLEM SOLVING

Problems that can be solved through a computer may range in size and complexity. Since computers do not
possess any common sense and cannot make any unplanned decisions, the problem, whether it is simple or
complex, has to be broken into a well-defined set of solution steps for the computer to implement.
Problem solving is the process of solving a problem in a computer system by following a sequence of
steps. The major steps that we need to follow for solving a problem are:
1. Preparing hierarchy chart A hierarchy chart shows the top-down solution of a problem. In case
of large problems, we can break them into parts representing small tasks, prepare several algorithms
and later combine them into one large algorithm.
2. Developing algorithm An algorithm is a sequence of steps written in the form of English phrases
that specify the tasks that are performed while solving a problem. It involves identifying the variable
names and types that would be used for solving the problem.
3. Drawing flowchart A flowchart is the graphical representation of the flow of control and logic in
the solution of a problem. The flowchart is a pictorial representation of an algorithm.
4. Writing Pseudocode Pseudocode is pretty much similar to algorithms. It uses generic syntax for
describing the steps that are to be performed for solving a problem. Along with the statements written
using generic syntax, pseudocode can also use English phrases for describing an action.

10.7.1 Hierarchy Chart


Hierarchy chart is a solution approach
that suggests a top-down solution of a
problem. We very often come across large
problems to be solved using computers.
It may be very difficult to comprehend
the solution steps of such large problems
at one go. In such situations, we can
decompose the problem into several parts,
each representing a small task which is
easily comprehensible and solvable. We can
then prepare solution steps for each task
independently and later combine them into
one large solution algorithm. Figure 10.13
Fig. 10.13 Hierarchy chart for pay-roll problem
illustrates a hierarchy chart for computing
226 Fundamentals of Computers

pay of an employee in an organisation. Since the chart graphically illustrates the structure of a program, it is
also known as a structure chart.
While developing a computer program, we may treat each subtask as a module and prepare computer
code for testing independently. This approach is popularly known as modular programming. Note that the
hierarchy chart does not provide any detail about program logic. We have to use the tools discussed below
to prepare logic for each task.

10.7.2 Algorithms
Algorithms help a programmer in breaking down the solution of a problem into a number of sequential
steps. Corresponding to each step a statement is written in a programming language; all these statements
are collectively termed as a program. The following is an example of an algorithm to add two integers and
display the result:

Algorithm to add two integers and display the result


Step 1 – Accept the first integer as input from the user.
(integer1)
Step 2 – Accept the second integer as input from the user.
(integer2)
Step 3 – Calculate the sum of the two integers.
(integer3 = integer1 + integer2)
Step 4 – Display integer3 as the result.

There is a time and space complexity associated with each algorithm. Time complexity specifies the
amount of time required by an algorithm for performing the desired task. Space complexity specifies the
amount of memory space required by an algorithm for performing the desired task. When solving a complex
problem, it is possible to have more than one algorithm to provide the required solution. The algorithm that
takes less time and requires less memory space is the best one.

10.7.3 Flowcharts
A flowchart can be defined as the pictorial representation of a process, which describes the sequence and
flow of the control and information in a process. The flow of information is represented in a flowchart in a
step-by-step form. This technique is mainly used for developing business workflows and solving problems
using computers.
Flowchart uses different symbols for depicting different activities, which are performed at different
stages of a process. The various symbols used in a flowchart are as follows:
∑ Start and end It is represented by an oval
or a rounded rectangle in a flowchart. It is used to
represent the starting and the ending of a process.
Every process starts and ends at some point so a
flowchart always contains one start as well as one Fig. 10.14 Start and end symbol
end point. Figure 10.14 shows the start and the end
symbols used in a flowchart.
∑ Input or output It is represented by a parallelogram in a
flowchart. It is used to represent the inputs given by the user
Fig. 10.15 Input or output symbol
to the process and the outputs given by the process to the user.
Figure 10.15 shows the input or output symbol.
Flowchart that outlines the main segments of a program
or that shows less details is a macro flowchart

§ Flowchart with more details is a micro flowchart, or


detailed flowchart

Computer Software 227

∑ Action or process It is represented by a rectangle. It


represents the actions, logics and calculations taking place in
a process. Figure 10.16 shows the action or process symbol.
∑ Decision or condition It is represented by a rhombus or
a diamond shape in a flowchart. It represents the condition
or the decision-making step in the flowchart. The result of
the decision is a Boolean value, which is either true or false. Fig. 10.16 Action or process symbol
Each of these values takes the flow of the program to a certain
point, which is shown with the help of arrows. Figure 10.17
shows the decision or condition symbol.
∑ Arrow It is represented by a directed line in a flowchart.
It represents the flow of process and the sequence of steps in
the flowchart. It guides the process about the direction and
the sequence, which is to be followed while performing the Fig. 10.17 Decision or condition symbol
various steps in the process. Figure 10.18 shows the arrow
symbol.
∑ Connector It is represented by a circle in a flowchart. It represents the continuation of the flow
of steps when a flowchart continues to the next page. A character, such as an alphabet (a to z) or
a symbol (a, b or c), etc. can be placed in the circle at the position where the flow is broken and
the same character is also placed in the circle at the position from where the flowchart continues.
Figure 10.19 shows the connector symbol.

Fig. 10.18 Arrow symbol Fig. 10.19 Connector symbol

In order to understand how a flowchart represents flow


of information, consider an example of flowchart in which
addition of two numbers is represented. Figure 10.20 shows
the flowchart for addition of two numbers.

10.7.4 Pseudocodes
Analysing a detailed algorithm before developing a program
is very time consuming. Hence, there arises a need of a
specification that only focuses on the logic of the program.
Pseudocodes serve this purpose by specifying only the
logic, which is used by the programmer for developing a
computer program.
Pseudocode is not written using specific syntax of
a programming language rather it is written with a
combination of generic syntax and normal English language. Fig. 10.20 Flowchart of addition of two numbers
228 Fundamentals of Computers

It helps the programmer understand the basic logic of the program after which it is the programmer’s choice
to write the final code in any programming language.
The example of a pseudocode to add two numbers and display the result is shown below:

A pseudocode to add two numbers and display the result


Define: Integer num1, num2, result.
Input: Integer num1.
Input: Integer num2.
Sum: result = num1 + num2
Output: Display(result).

After the pseudocode for a computer program has been written, it is used to develop the source code
for the computer program. The source code is developed using a programming language, which can be
an assembly language or a high level programming language. After the source code has been written, the
programmer detects and eliminates any errors in the program so that the program generates the desired
output after its execution.

10.8 STRUCTURING THE LOGIC

While writing the pseudocode for a problem, it is necessary to define all the logics used in the pseudocode
for developing the program. Pseudocode of a problem should be able to describe the sequence of execution
of statements and procedures specified in the program. The sequence of the execution of instructions
determines the basic structure of a program or the logic used to solve a problem.
The basic structure of a program comprises of different sets of the statements, whose execution is
dependent on some conditions and decisions. These conditions and decision-making statements are
specified in a control structure. Depending upon the sequence of the execution of the statements, the control
structures are categorised into the following types:
• Sequence structure The execution of the statements in a sequence structure is done sequentially,
i.e., all the statements are executed in the same order as they are written in the program.
• Selection structure In the selection structure, two sets of statement blocks are written in a
program along with one or more conditions. The execution of a particular block’s statements occurs
only if the conditional statement specified at the beginning of the block is true. A selection structure is
also known as branching structure.
• Repetition structure In the repetition structure, a block of two or more instructions is specified
along with a conditional statement. The execution of these instructions is repeated many times if the
conditional statement is true. This structure is also known as looping structure.
We must incorporate these program constructs into the program design, whether as a flowchart or as a
pseudocode. We can also combine the constructs, if necessary. For example, a selection structure can be a
part of a looping structure.

10.8.1 Sequence Structure


In a sequence structure, multiple statements are written in a simple sequence in the program. The execution
of these statements is not affected by any condition. Generally, sequence structure is used for performing
Computer Software 229

simple computations, which do not require any decision-making. Figure 10.21 shows the representation of
statements in the sequence structure.

Fig. 10.21 Representation of statements in the sequential structure

10.8.2 Selection Structure


In the selection structure, the execution of a set of statements is done according to a pre-specified condition.
The selection structure is also known as decision-making structure because the decision to execute a
particular set of statements is made on the basis of the conditional statement. The selection structure is
categorised into the following types:
• If-Then In this selection structure, If and Then clauses are used to represent a condition as well as
set of statements. In the If clause, the conditional statement is written, while in the Then clause the
set of statements to be executed are specified. The execution of the statements specified in the Then
clause occurs only if the condition is true.
• If-Then-Else This selection structure is very much similar to the If-Then selection structure. The
only difference between the two is that in If-Then-Else selection structure two sets of statements are
specified. One set of statements is represented in the Then clause and another is represented in the
Else clause. If the condition given in the If clause is true, then all the statements specified in the Then
clause are executed; otherwise statements given in the Else clause are executed.
• Case Type In this selection structure, multiple sets of statements are specified. Each block of
statements is associated with a value. The selection of a particular set of statements is made on the
basis of the value of the variable given at the beginning of the selection structure.
230 Fundamentals of Computers

Figure 10.22 shows the representation of statements in the If-Then-Else selection structure.

Fig. 10.22 Representation of statements in the If-Then-Else selection structure

10.8.3 Repetition Structure


In the repetition structure, only one set of multiple statements is specified. The same set of statements is
executed several times on the basis of the condition specified along with the structure. The various types of
repetition structure are as follows:
∑ Do-while In the Do-while structure, a set of statements is given in the Do block and a condition is
given in the While block. The statements given in the Do block are executed till the given condition
is true. At each instance of execution of block statements, the condition is checked. If the condition is
true, then only the block statements are executed; otherwise the repetition structure is terminated.
∑ Repeat-until The Repeat-until structure is opposite to the Do-while repetition structure. In this
structure, the repetitive execution of statements given in the Repeat clause occurs only when the
condition given in the Until clause is false.
Computer Software 231

Figure 10.23 shows the representation of statements in the Do-while repetition structure.

Fig. 10.23 Representation of the statements in the Do-while repetition structure

10.9 USING THE COMPUTER

Whenever a user wants to use a computer for solving a problem, he/she has to perform various interrelated
tasks in a systematic manner. A user can not get the solution of a problem by simply providing input to the
computer without preparing the base for solving the problem. The working process of a computer is similar
to the human mind, which first analyses the complete situation of a problem, its causes and its parameters,
and then decides the way to solve the problem on the basis of available parameters. All the activities, which
have to be performed by a user in order to solve a problem using computer, are grouped into three phases:
∑ Understanding the problem
∑ Developing a program
∑ Executing the program
232 Fundamentals of Computers

1. Understanding the problem It is the first stage of problem solving using a computer. In this
stage, two basic activities are performed by the user. These activities are as follows:
❏ Identifying parameters and constraints A user has to identify the role of different
parameters in solving the problem, i.e., the user must have the knowledge about the relation
between the various parameters and the problem itself. After identifying the problem and its
parameters, the user has to identify the associated constraints that need to be considered in order
to generate an accurate solution of the problem. The identification of parameters and constraints
help in choosing the most appropriate method to solve the problem.
❏ Collecting information After analysing the problem and choosing the solution method, a
user has to collect the information related to the identified parameters of the problem. In order
to collect the information, a user can use the documents and reports pertaining to the previous
versions of the problem. The collected information helps in designing the layout of the output or
solution of the problem.
2. Developing a program After analysing the problem, a user has to plan for developing the
program, which will provide the solution of the program after execution. A program includes multiple
instructions having a specific syntax. For developing a program, a user has to perform the following
activities:
❏ Identifying the logical structure It is the most important activity in which a user prepares
the logical structure of the program by analysing the various tasks that need to be performed for
solving the problem. In order to prepare the logical structure of a program, a user performs the
following task:
(i) Writing algorithm to list the various steps.
(ii) Drawing flowchart to represent the flow of information.
(iii) Writing pseudocode to specify the programming specifications.
❏ Writing the computer program After preparing the logic, a user has to write the program
code in a particular programming language. The program code should be syntactically and
semantically correct in order to generate the desired result.
❏ Debugging the program After writing the complete program, a user has to apply the
debugging techniques for removing any possible errors in the program. Several programming
environments provide debugging tools that aid the users in effectively and efficiently remove the
errors in a program.
3. Executing the program After developing an error free program, it needs to be executed in order
to view the solution of the original problem.

Chapter Summary
Computer software is one of the most important components of a computer system. The other component of
a computer system is computer hardware. Computer software helps the computer hardware in carrying out their
functions in an effective manner. Computer software can be either system software or application software.
System software is responsible for managing and controlling the hardware resources of a computer system.
System software can be further divided into two major categories, which are system management programs and
system development programs. Operating system, utility programs and device drivers are some of the examples of
Computer Software 233

system management programs. Typical examples of system development programs include linkers, debuggers, and
editors.
Application software is specially designed to cater the information processing needs of end users. Like system
software, application software can be further divided into two major categories, which are standard application
programs and unique application programs. Word processor, spreadsheet, database manager, desktop publisher
and web browser are some of the standard application programs. The unique application programs are specially
developed by the users to meet their specific requirements. For examples, inventory management system and
pay-roll system comes under the category of unique application programs.
Computer based problem solving requires a series of steps such as preparing hierarchy charts, developing
algorithms, drawing flowcharts, writing pseudocodes, and developing and executing programs.

Key Terms to Remember


∑ Hardware: Hardware refers to various electronic and mechanical devices, which are responsible for performing
various operations, such as storing data into the storage devices, transferring data through buses and cables, etc.
∑ Software: Software is a set of programs and procedures containing a number of instructions for processing the
data.
∑ System software: System software is the program that directly controls the working of hardware components of
the computer system, and enables implementation of application software.
∑ Application software: Application software is the software that enables the end user to perform various tasks,
such as creating documents, preparing presentations, creating databases, developing graphics and images, etc.
∑ Operating system: Operating system is a set of various small system software, which control the execution of
various sub processes in a computer system.
∑ Utility program: Utility program refers to a small program that helps perform utility tasks in a computer system.
∑ Device driver: Device driver is a special software that enables a hardware device such as keyboard, monitor and
printer to perform an operation according to the command given by the end user.
∑ Editor: Editor is a program that allows the user to write and edit text in the computer system.
∑ Spreadsheet: Spreadsheet is a computer program that enables the user to maintain a worksheet in which
information is stored in different cells.
∑ Hierarchy chart: Hierarchy chart is a design tool that shows the top-down design of a problem solution.
∑ Pseudocode: Psuedocode is a set of instructions that describe the logic of a solution.
∑ Algorithm: Algorithm is a sequential structure of steps, which are performed to solve a particular problem.
∑ Flowchart: Flowchart is a pictorial representation of a process, which describes the sequence and flow of the
control and information in a process.
∑ Language translator: It is a program that converts a high-level language program into a low-level language
program. Compilers, assemblers and interpreters are examples of language translator.
∑ Compiler: It is a program that translates a high-level program into a machine language program.
∑ Assembler: It is a program that translates a program written in the assembly language into a machine language
program.
∑ Interpreter: It is a program that translates a high-level program into machine code statement-by-statement. That
is, a translated statement is executed before the next statement is translated.
∑ Linker: A program that combines several object code files into a single executable program.
∑ Debugger: It is a program used to detect errors and bugs in a program.
234 Fundamentals of Computers

Review Questions

Fill in the Blanks

1. A computer system consists of two types of components, ______________ components and ______________
components.
2. Computer software is classified into two categories, namely, ______________ and ______________.
3. System software consists of two groups of programs: ______________ and ______________.
4. ______________ is responsible for managing the allocation of devices and resources to the various processes.
5. Device driver acts as a translator between the ______________ and the ______________ .
6. A computer system requires special software called ______________ in order to interact with the I/O devices.
7. Language translator converts the high-level language program into the low-level program called _____________.
8. Application software includes two types programs: ______________ and ______________ .
9. ______________ enables you to enter text in the document in a particular format.
10. Spreadsheet is generally used to calculate the values stored in a cell by applying ______________ on the values
of other cells.
11. Database refers to a set of records, which are stored in a ______________ in the computer system.
12. In the hierarchical model, records are arranged in form of a ______________ in which each record is attached
with one parent node and one or more children node.
13. Desktop publishing system is also known as ______________ .
14. Pseudocode is not written using any specific ______________ of a programming language.
15. ______________ is a pictorial representation of a process, which describes the sequence and flow of the control
and information in a process
16. In the ______________ structure, multiple statements are written in a simple sequence in the program.

Multiple Choice Questions

1. Which of the following is a hardware device?


A. Device driver B. Barcode reader C. Interpreter D. Linker
2. A device driver acts as an interface between:
A. End-user and I/O device B. Application software and I/O device
C. Application software and operating system D. Operating system and I/O device
3. Which of the following software components enables a user to store data in the form of tables?
A. Spreadsheet B. Editor C. DBMS D. Word processor
4. Which of the following is not a system software?
A. Linkers B. Device drivers C. Operating system D. Word processor
5. Which of the following software helps the users to detect the errors while executing a program?
A. Language Translator B. Debugger C. Loader D. Linker
6. Which of the following software runs at the basic level of computer system?
A. Application software B. System software C. User software D. All of the above
Computer Software 235

7. A program in which multiple instructions of high-level language or assembly language instructions are written is
generally known as:
A. Psuedocode B. Source code C. Object code D. Machine code
8. A small program, which provides additional capabilities to the operating system, is known as:
A. Application program B. System development program
C. Utility program D. Translator program
9. A software, which links different elements of an object code with the library files, is known as:
A. Editor B. Linker C. Loader D. Debugger
10. Which of the following options is not a utility system?
A. Virus scanner B. System profiler C. Disk defragmenter D. Debugger
11. Which of the following is not a data structure?
A. Record B. Table C. File D. Field
12. Which of the following data models enables us to arrange data files in the tree structure?
A. Network model B. Relational model C. Hierarchical model D. None of the above
13. The software, which enables an end user to edit text and other components of a publishing document, is known
as:
A. Word processor B. Editor
C. Desktop publishing system D. Debugger
14. A control structure in which only a single set of instructions executes several times is known as:
A. Repetition structure B. Sequence structure C. Selection structure D. None of the above
15. Which of the following structure executes the set of instruction only when the given condition is false?
A. If-Then B. Do-While C. If-Then-Else D. Repeat-Untill

Discussion Questions
1. What do you know about the components of a computer system?
2. Explain the different types of computer software.
3. What do you understand by the term system software?
4. Explain the major functions of an operating system.
5. What is the purpose of translator programs?
6. List a few popular standard application programs.
7. Explain the application of system development programs.
8. What does utility program mean?
9. What are the basic functions of DBMS?
10. What do you know about inventory management system?
11. What is meant by unique application program?
12. What is a language translator?
13. Differentiate between a compiler, an assembler and an interpreter.
14. What is a debugger?
C HA PTE R 11
OPERATING SYSTEMS

Chapter Objectives

In this chapter, we will learn: 11.6.3 File Access Permissions


• The concept of operating systems. 11.6.4 File Systems
∑ Various functions of operating systems.
11.7 Device Management
∑ Different types of operating systems.
∑ How user interfaces are provided in an 11.8 Security Management
operating system. 11.8.1 Security Methods
∑ Highlights of some important operating 11.9 Types of Operating Systems
systems. 11.9.1 Batch Processing Operating
Systems
11.9.2 Multi-user Operating Systems
Chapter Outline 11.9.3 Multitasking Operating Systems
11.9.4 Real-time Operating Systems
11.1 Introduction 11.9.5 Multiprocessor Operating
11.2 History of Operating Systems Systems
11.3 Functions of Operating Systems 11.9.6 Embedded Operating Systems
11.4 Process Management 11.10 Providing User Interface
11.4.1 Process State 11.10.1 Graphical User Interface
11.4.2 Process Control Block 11.10.2 Command Line Interface
11.4.3 Process Operations 11.11 Popular Operating Systems
11.4.4 Process Scheduling 11.11.1 MS-DOS
11.4.5 Process Synchronisation 11.11.2 UNIX
11.4.6 Interprocess Communication 11.11.3 Windows
11.4.7 Deadlock
Chapter Summary
11.5 Memory Management
11.5.1 Segmentation Key Terms to Remember
11.5.2 Paging Review Questions
11.5.3 Swapping Fill in the Blanks
11.6 File Management Multiple Choice Questions
11.6.1 File Attributes Discussion Questions
11.6.2 File Operations
238 Fundamentals of Computers

11.1 INTRODUCTION

An operating system (OS) is a software that makes the computer hardware to work. While the hardware
provides ‘raw computer power’ , the OS is responsible for making the computer power useful for the users.
As discussed in the previous chapter, the OS is the main component of system software and therefore must
be loaded and activated before we can accomplish any other task.
The operating system provides an interface for users to communicate with the computer. It also manages
the use of hardware resources and enables proper implementation of application programs. In short,
the operating system is the master control program of a computer. Figure 11.1 shows the different roles
performed by an operating system. The main functions include:
• Operates CPU of the computer.
• Controls input/output devices that provide the interface between the user and the computer.
• Handles the working of application programs with the hardware and other software systems.
• Manages the storage and retrieval of information using storage devices such as disks.
Every computer, irrespective of its size and application,
needs an operating system to make it functional and
useful. Operating systems are usually prewritten by
the manufacturers and supplied with the hardware and
are rarely developed in-house owing to its technical
complexity. There are many operating systems developed
during the last few decades but the popular among them
are MS-DOS, Windows 2000, Windows XP, Windows
Server 2003, UNIX and Linux.
In this chapter we shall discuss in detail the various
functions of operating systems, different types of operating
systems and their services, and the types of user interfaces
available. Fig. 11.1 The roles of an operating system

11.2 HISTORY OF OPERATING SYSTEMS

A series of developments in the computer architecture led to the evolution of the operating system during
the later half of the 20th century. During the 1940’s, there was no operating system and assembly language
was used to develop programs that could directly interact with the hardware. The computer systems during
this period were mainly used by the researchers, who were both the programmers as well as the end users of
the computer system.
During the 1950s, more number of people started using the computer systems. This led to a repetition of
tasks as everyone started developing their own programs and device drivers. Different people created device
drivers for the same input and output devices. To avoid this repetition of tasks, various batch processing
operating systems such as BKY, CAL and Chios were developed during this period. FORTRAN Monitor
System, General Motors Operating System and Input Output System are the other operating systems
developed in the 1950s. The operating systems developed during this period were capable of performing
only a single task at a time.
Operating Systems 239

During the 1960s, multi-tasking operating systems were developed. These operating systems ensured
better utilisation of resources by allowing the multiple tasks to be performed simultaneously. They also
allowed multiple programs to remain in memory at the same time. Central Processing Unit (CPU) executed
multiple processes at a single time and also handled the hardware devices attached to the computer
system. These operating systems used the concepts of spooling and time-sharing model for achieving the
multi-tasking functionality. The various operating systems developed during the 1960s include Admiral,
Basic Executive System, Input Output Control System and SABRE (Semi-Automatic Business Related
Environment).
During the 1970s, a major breakthrough was achieved in the development of operating system with the
introduction of UNIX by AT&T Bell Labs. UNIX supported a multi-user environment where multiple users
could work on a computer system. The core functionality of UNIX resided in a kernel that was responsible
for performing file, memory and process management. UNIX also came bundled with utility programs for
performing specific tasks. The other operating systems that were introduced in the 1970s include DOS/VS,
OS/VS1and OpenVMS.
During the 1980s, some key operating systems were developed including MS-DOS, HP-UX and
Macintosh. MS-DOS was developed by Microsoft and could be installed on desktop Personal Computers
(PCs), such as Intel 80x86 PCs. HP-UX was similar to UNIX and was developed by Hewlett Packard.
This operating system could be installed on the HP PA RISC computer systems. Macintosh was developed
by Apple computers and could be installed on the desktop PCs such as Motorola 680x0. MS DOS and
Macintosh became quite popular in the 1980’s and are still in use.
A number of operating systems were developed during the 1990s including Windows 95, Windows 98,
Windows NT, FreeBSD and OS/2. Windows 95, Windows 98 and Windows NT were GUI based operating
systems developed by Microsoft. FreeBSD was similar to UNIX and was available free of cost. OS/2 was
introduced by IBM and could be installed on Intel/AMD Pentium and Intel 80x86 based computer systems.
The decade of 1990 revolutionised the way of computing through robust GUI-based operating systems and
fast processing devices.
The first decade of 21st century has seen the development of operating systems such as MAC OS X,
Windows 2000, Windows Server 2003, Windows ME and Windows XP. With the advent of Internet,
security has been the prime focus of the operating systems of this era.

11.3 FUNCTIONS OF OPERATING SYSTEMS

The main function of an operating system is to manage the resources such as memory and files of a
computer system. The operating system also resolves the conflicts that arise when two users or programs
request the same resource at the same time. Therefore, the operating system is also called the resource
manager of a computer system. The currently used operating systems such as Windows 2000, Windows
Server 2003 and Linux also support networking that allows the sharing of files and resources such as printer
and scanner. The following are some of the important functions of an operating system:
∑ Process management It manages the processes running in a computer system. A process is
basically a program that is being currently run by a user on a computer system. For example, a word
processor application program such as Microsoft Word runs as a process in a computer system.
∑ Memory management It manages the memory resources of a computer system. There are
various memory resources of a computer system including primary memory or Random Access
Memory (RAM) and secondary memory like hard disk and Compact Disk (CD). All the programs
240 Fundamentals of Computers

are loaded in the main memory before their execution. It is the function of the operating system to
determine how much memory should be provided to each process.
∑ File management It manages the files and directories of a computer system. A file can be defined
as a collection of information or data that is stored in the memory of a computer system. Every file
has a unique name associated with it. The organisation of files and directories in a computer system
is referred as file system. An operating system allows us to create, modify, save, or delete files in a
computer system.
∑ Device management This function of operating system deals with the management of peripheral
devices, such as printer, mouse and keyboard attached to a computer system. An operating system
interacts with the hardware devices through specific device drivers. The primary task of an operating
system is to manage the input/output operations performed by the end users.
∑ Security management It ensures security for a computer system from various threats such
as virus attacks and unauthorised access. An operating system uses various techniques, such as
authentication, authorisation, cryptography, etc for ensuring security of a computer system.
Figure 11.2 depicts the various functions of an operating system.

Fig. 11.2 The functions of an operating system

11.4 PROCESS MANAGEMENT

Process management involves the execution of various tasks such as creation of processes, scheduling of
processes, management of deadlocks and termination of processes. When a process runs in a computer
system, a number of resources such as memory and CPU of the computer system are utilised. It is the
responsibility of an operating system to manage the running processes by performing tasks such as resource
allocation and process scheduling. The operating system also has to synchronise the different processes
effectively in order to ensure consistency of shared data.
Generally, only a single process is allowed to access the CPU for its execution at a particular instant
of time. When one process is being processed by the CPU, the other processes have to wait until the
execution of that particular process is complete. After the CPU completes the execution of a process, the
resources being utilised by that process are made free and the execution of the next process is initiated. All
the processes that are waiting to be executed are said to be in a queue. In some cases, a computer system
supports parallel processing allowing a number of processes to be executed simultaneously.
A process consists of a set of instructions to be executed called process code. A process is also associated
with some data that is to be processed. The resources that a process requires for its execution are called
process components. There is also a state associated with a process at a particular instant of time called
Operating Systems 241

process state. Similar to these concepts, there are a number of concepts associated with the process
management function of an operating system. Some of these key concepts are:
∑ Process state
∑ Process Control Block (PCB)
∑ Process operations
∑ Process scheduling
∑ Process synchronisation
∑ Interprocess communication
∑ Deadlock

11.4.1 Process State


A process state can be defined as the condition of a process at a particular instant of time. There are
basically seven states of a process:
∑ New It specifies the time when a process is created.
∑ Ready It specifies the time when a process is loaded into the memory and is ready for execution.
∑ Waiting It specifies the time when a process waits for the allocation of CPU time and other
resources for its execution.
∑ Executing It is the time when a process is
being executed by the CPU.
∑ Blocked It specifies the time when a process
is waiting for an event like I/O operation to
complete.
∑ Suspended It specifies the time when a
process is ready for execution but has not been
placed in the ready queue by the operating system.
∑ Terminated It specifies the time when a
process is terminated and the resources being
utilised by the process are made free.
Figure 11.3 illustrates the various process states.
The Fig. 11.3 shows that a process is initially in
the new state when it is created. After the process has
been created, the state of the process changes from
new to ready state where the process is loaded into the
memory. The state of the process changes from ready
to the waiting state when the process is loaded into the
memory. The process state changes from waiting to the
executing state after the CPU time and other resources
are allocated to it and the process starts running. After Fig. 11.3 The different states of a process
the process has executed successfully, it is terminated
and its state changes to terminated.
242 Fundamentals of Computers

11.4.2 Process Control Block (PCB)


PCB is a data structure associated with a process that provides complete information about the process.
PCB is important in a multiprogramming environment as it captures information pertaining to a number of
processes running simultaneously. PCB comprises of the following:
∑ Process id It is an identification number that uniquely identifies a process.
∑ Process state It refers to the state of a process such as ready and executing.
∑ Program counter It points to the address of the next instruction to be executed in a process.
∑ Register information It comprises of the various registers, such as index and stack that are
associated with a process.
∑ Scheduling information It specifies the priority information pertaining to a process that is
required for process scheduling.
∑ Memory related information This section of the PCB comprises of page and segment tables.
It also stores the data contained in base and limit registers.
∑ Accounting information This section of the PCB stores
the details relate to CPU utilisation and execution time of a
process.
∑ Status information related to I/O This section of the
PCB stores the details pertaining to resource utilisation and the
files opened during process execution.
The operating system maintains a table called process table,
which stores the PCBs related to all the processes. Figure 11.4
shows the structure of PCB.

11.4.3 Process Operations


The process operations carried out by an operating system are
primarily of two types, process creation and process termination.
Process creation is the task of creating a new process. There are
different situations in which a new process is created. A new process
can be created during the time of initialisation of operating system
or when system calls such as create-process and fork( ) are initiated
Fig. 11.4 The structure of a PCB
by other processes. The process, which creates a new process using
system calls, is called parent process while the new process that is
created is called child process. The child processes can further create new processes using system calls.
A new process can also be created by an operating system based on the request received from the user.
Figure 11.5 shows the hierarchical structure of multiple processes running in a computer system.
The process creation operation is very common in a running computer system because corresponding
to every task that is performed there is a process associated with it. For instance, a new process is created
every time a user logs on to a computer system, an application program such as MS Word is initiated, or
when a document is printed.
Process termination is an operation in which a process is terminated after it has executed its last
instruction. When a process is terminated, the resources that were being utilised by the process are released
by the operating system. When a child process terminates, it sends the status information back to the parent
Operating Systems 243

process before terminating. The child process can also be terminated by the parent process if the task
performed by the child process is no longer needed. In addition, when a parent process terminates, it has
to terminate the child process as well because a child process cannot run when its parent process has been
terminated.

Fig. 11.5 The hierarchical structure of processes

The termination of a process when all its instructions have been executed successfully is called normal
termination. However, there are instances when a process terminates due to some error. This is called
abnormal termination of a process.

11.4.4 Process Scheduling


Process scheduling is the task performed by an operating system for deciding the priority in which the
processes, which are in ready and waiting states, are allocated the CPU time for their execution. Process
scheduling is very important in multiprogramming and multitasking operating systems where multiple
processes are executed simultaneously. Process scheduling ensures maximum utilisation of CPU because
a process is always running at a specific instant of time. At first, the processes that are to be executed are
placed in a queue called job queue. The processes, which are present in the main memory and are ready for
CPU allocation, are placed in a queue called ready queue. If a process is waiting for an I/O device then that
process is placed in a queue called device queue.
An operating system uses a program called scheduler for deciding the priority in which a process is
allocated the CPU time. Scheduler is of three types:
∑ Long term scheduler It selects the processes that are to be placed in the ready queue. The long
term scheduler basically decides the priority in which processes must be placed in the main memory.
∑ Mid term scheduler It places the blocked or suspended processes in the secondary memory of a
computer system. The task of moving a process from the main memory to the secondary memory is
referred as swapping out. The task of moving back a swapped-out process from the secondary memory
to the main memory is referred as swapping in. The swapping of processes is performed to ensure the
best utilisation of main memory.
∑ Short term scheduler It decides the priority in which processes in the ready queue are allocated
the CPU time for their execution. The short term scheduler is also referred as CPU scheduler.
An operating system uses two types of scheduling policies for process execution, preemptive and
non preemptive. In the preemptive scheduling policy, a low priority process has to suspend its execution if
a high priority process is waiting in the queue for its execution. However in the non preemptive scheduling
244 Fundamentals of Computers

policy, processes are executed in first come first serve basis, which means the next process is executed only
when currently running process finishes its execution. The selection of the next process, however, may be
done considering the associated priorities. Operating systems perform the task of assigning priorities to
processes based on certain scheduling algorithms. Some of the key scheduling algorithms are:
∑ First Come First Served (FCFS) scheduling In this scheduling algorithm, the first process in
a queue is processed first.
∑ Shortest Job First (SJF) scheduling In this scheduling algorithm, the process that requires
shortest CPU time is executed first.
∑ Priority scheduling In this scheduling algorithm, a priority is assigned to all the processes and
the process with highest priority is executed first. Priority assignment of processes is done on the basis
of internal factors such as CPU and memory requirements or external factors such as user’s choice.
The priority scheduling algorithm can support either preemptive or non-preemptive scheduling
policy.
∑ Round Robin (RR) scheduling In this scheduling algorithm, a process is allocated the CPU for
a specific time period called time slice or time quantum, which is normally of 10 to 100 milliseconds.
If a process completes its execution within this time slice then it is removed from the queue otherwise
it has to wait until the next time slice.

11.4.5 Process Synchronisation


Process synchronisation is the task of synchronising the execution of processes in such a manner that no
two processes have access to the same shared data or resource. When multiple processes are concurrently
running then they may attempt to gain access to the same shared data or resource. This can lead to
inconsistency in the shared data as the changes made by one process in the shared data may not be reflected
when another process accesses the same shared data. In order to avoid such inconsistency of data, it is
important that the processes are synchronised with each other.
One of the important concepts related to process synchronisation is that of critical section problem.
Each process contains a set of code called critical section through which a specific task, such as changing
the value of a global variable and writing certain data to a file, is performed. To ensure that only a single
process enters its critical section at a specific instant of time, the processes need to coordinate with other by
sending requests for entering the critical section. When a process is in its critical section no other process is
allowed to enter the critical section.
Peterson’s solution is one of the solutions to critical section problem involving two processes. Peterson’s
solution states that when one process is executing its critical section then the other process executes the rest
of the code and vice versa. This ensures that only one process is in the critical section at a particular instant
of time.
Locking is another solution to critical section problem in which a process acquires a lock before entering
its critical section. When the process finishes executing its critical section, it releases the lock. The lock is
then available for any other process that wants to enter the critical section. The locking mechanism also
ensures that only one process is in the critical section at a particular period of time.
Another solution to the critical section problem is that of Semaphore. It is basically a synchronisation
tool in which the value of an integer variable called semaphore is retrieved and set using wait and signal
operations. Based on the value of the Semaphore variable, a process is allowed to enter its critical section.
Operating Systems 245

11.4.6 Interprocess Communication


Interprocess communication is the method of communication between processes through which processes
interact with each other for gaining access to shared data and resources. There are two methods of
interprocess communication, shared memory and message passing.
In the shared memory method, a part of memory is shared between the processes. A process can write
the data that it wants to share with other processes in to the memory. Similarly, another process can read the
data that has been written by another process. Figure 11.6 shows the shared memory method of interprocess
communication.
In Fig. 11.6, P1 and P2 represent the two processes. P1 writes the data that it needs to share with P2 in
the shared memory. P2 then reads the data written by P1 from the shared memory.
In the message passing method, a process sends a message to another process for communication.
This method allows the sharing of data between processes in the form of messages. Figure 11.7 shows the
message passing method of interprocess communication.
In Fig. 11.7, P1 sends the shared data in the form of a message to the kernel and then the kernel sends
the message sent by P1 to P2.

Fig. 11. 6 The shared memory method Fig. 11.7 The message passing method for
of interprocess communication the interprocess communication

11.4.7 Deadlock
Deadlock is a condition that occurs when multiple processes wait for each other to free up resources and
as a result all the processes remain halted. Let us understand the concept of deadlock with the help of
an example. Suppose there are two processes P1 and P2 running in a computer system. P1 requests for a
resource, such as printer that is being utilised by the P2 process. As a result, the P1 process has to wait till
the time P2 completes its processing and frees the resource. At the same time, the P2 process requests for
246 Fundamentals of Computers

a resource, such as shared data that has been locked by the process P1. Thus, both the processes end up
waiting for each other to free up the required resources. This situation is called a deadlock.
The following are some of the reasons due to which a deadlock situation may arise.
∑ Mutual exclusion In mutual exclusion, processes are not allowed to share resources with each
other. This means that if one process has control over a resource, then that resource cannot be used by
another process until the first process releases the resource.
∑ Hold and wait In this condition, a process takes control of a resource and waits for some other
resource or activity to complete.
∑ No preemption In this condition, a process is not allowed to force some other process to release
a resource.
There are a number of methods through which the deadlock condition can be avoided. Some of these
methods are:
∑ Ignore deadlock In this method, it is assumed that a deadlock would never occur. There is a good
chance that a deadlock may not occur in a computer system for a long period of time. As a result, the
ignore deadlock method can be useful in some cases.
∑ Detect and recover from deadlock In this method, the deadlock is first detected using
allocation /request graph. This graph represents the allocation of resources to different processes.
After a deadlock has been detected, a number of methods can be used to recover from the deadlock.
One way is preemption in which a resource held by one process is provided to another process. The
second way is rollback in which the operating system keeps a record of the process states and makes
a process roll back to its previous state; thus eliminating the deadlock situation. The third way is to
kill one or more processes to overcome the deadlock situation.
∑ Avoid deadlock In this method, a process requesting a resource is allocated the resource only if
there is no possibility of deadlock occurrence.

11.5 MEMORY MANAGEMENT

Memory management function of an operating system helps in allocating the main memory space to the
processes and their data at the time of their execution. Along with the allocation of memory space, memory
management also perform the following activities:
∑ Upgrading the performance of the computer system
∑ Enabling the execution of multiple processes at the same time
∑ Sharing the same memory space among different processes
Memory management is one of the most important functions of operating system because it directly
affects the execution time of a process. The execution time of a process depends on the availability of data
in the main memory. Therefore, an operating system must perform the memory management in such a
manner that the essential data is always present in the main memory. An effective memory management
system ensures accuracy, availability and consistency of the data imported from the secondary memory to
the main memory.
Operating Systems 247

An effective memory management system must ensure the following:


∑ Correct relocation of data The data should be relocated to and from the main memory in
such a manner that the currently running processes are not affected. For example, if two processes
are sharing a piece of data then the memory management system must relocate this data only after
ensuring that the two processes are no longer referencing the data.
∑ Protection of data from illegal change The data present in the main memory should be
protected against unauthorised access or modifications. The memory management system should
ensure that a process is able to access only that data for which it has the requisite access and it should
be prohibited from accessing data of other processes.
∑ Provision to share the information An ideal memory management system must facilitate
sharing of data among multiple processes.
∑ Utilisation of small free spaces A memory management system should be able to apply
appropriate defragmentation techniques in order to utilise small chunks of scattered vacant spaces in
the main memory.
Segmentation, paging and swapping are the three key memory management techniques used by
an operating system.

11.5.1 Segmentation
Segmentation refers to the technique of
dividing the physical memory space into
multiple blocks. Each block has a specific
length and is known as a segment. Each
segment has a starting address called the
base address. The length of a segment
determines the available memory spaces
in the segment. Figure 11.8 shows the
organisation of segments in a memory unit.
The location of data values stored in a
segment can be determined by the distance
of the actual position of data value from
the base address of the segment. The
distance between the actual position of data
and the base address of segment is known
as displacement or offset value. In other Fig. 11.8 Memory unit having segments
words, whenever it is required to obtain
data from the segmented memory then the
actual address of the data is calculated by adding the base address of the segment and with offset value.
The base address of the segment and the offset value is specified in a program instruction itself. Figure 11.9
shows how the actual position of an operand in a segment is obtained by adding the base address and the
offset value.
248 Fundamentals of Computers

Fig. 11.9 Obtaining the actual address of data

11.5.2 Paging
Paging is a technique in which the main memory of the computer system is organised in the form of equal
sized blocks called pages. In this technique, the addresses of the occupied pages of the physical memory are
stored in a table, which is known as page table.
Paging enables the operating system to obtain data from the physical memory location without
specifying its lengthy memory address in the instruction. In this technique, a virtual address is used to
map the physical address of the data. The length of the virtual address is specified in the instruction and
is smaller than the physical address of the data. It consists of two different numbers, first number is the
address of a page called virtual page in the page table and second number is the offset value of the actual
data in the page. Figure 11.10 shows how the virtual address is used to obtain the physical address of an
occupied page of physical memory using a page table.

Fig. 11.10 Obtaining data from a page using the paging technique
Operating Systems 249

11.5.3 Swapping
Swapping is a technique used by an operating system for efficient management of memory space of a
computer system. Swapping involves performing two tasks called swapping in and swapping out. The task
of placing the pages or blocks of data from hard disk to the main memory is called swapping in. On the
other hand, the task of removing pages or blocks of data from main memory to hard disk is called swapping
out. The swapping technique is useful when a large program has to be executed or some operations have to
be performed on a large file.
The main memory in a computer system is limited.
Therefore, to run a large program or to perform some
operation on a large file, the operating system swaps
in certain pages or blocks of data from the hard disk.
To make space for these pages or blocks of data in
the main memory, the operating system swaps out the
pages or blocks of data that are no longer required
in the main memory. The operating system places
the swapped out pages or blocks of data in a swap
file. A swap file is the space in the hard disk that is
used as an extension to the main memory by the
operating system. Figure 11.11 shows the technique
of swapping used by the operating system for memory Fig. 11.11 Swapping of pages
management.

11.6 FILE MANAGEMENT

File management is defined as the process of manipulating files in a computer system. A file is a collection
of specific information stored in the memory of the computer system. File management includes the process
of creating, modifying and deleting the files. The
following are some of the tasks performed by the file
management function of operating system:
∑ It helps in creating new files and placing them at
a specific location.
∑ It helps in easily and quickly locating the files in
the computer system.
∑ It makes the process of sharing the files among
different users easy.
∑ It helps store the files in separate folders known
as directories that ensure better organisation of
data.
∑ It helps modify the content as well as the name
of the file as per the user’s requirement.
Figure 11.12 shows the general hierarchy of file
storage in an operating system.
In Fig. 11.12, the root directory is present at the Fig. 11.12 The general hierarchy of file
highest level in the hierarchical structure. It includes all storage in an operating system
250 Fundamentals of Computers

the subdirectories in which the files are stored. Subdirectory is a directory present inside another directory
in the file storage system. The directory based storage system ensures better organisation of files in the
memory of the computer system.
The file management function of OS is based on the following concepts:
∑ File attributes It specifies the characteristics, such as type and location that completely describe
a file.
∑ File operations It specifies the tasks that can be performed on a file such as opening and closing
a file.
∑ File access permissions It specifies the access permissions related to a file such as read
and write.
∑ File systems It specifies the logical method of file storage in a computer system. Some of the
commonly used file systems include FAT and NTFS.

11.6.1 File Attributes


File attributes are the properties associated with a file that specify different information related to a file. The
following are some of the key file attributes:
∑ Name It specifies the name of a file given by the user at the time of saving it.
∑ File type It specifies the type of a file such as a Word document or an Excel worksheet.
∑ Location It specifies the location of a file where it is stored in the memory.
∑ Size It specifies the size of the file in bytes.
∑ Date and time It specifies the date and time when the file was created, last modified and last
accessed.
∑ Read-only It specifies that the file can be opened only for reading purpose.
∑ Hidden If this attribute of a file is selected, then the file is hidden from the user.
∑ Archive If this attribute of a file is selected, then the back up of a file is created.

11.6.2 File Operations


File operations are the various tasks that are performed on files. A user can perform these operations
by using the commands provided by the operating system. The following are some of the typical file
operations:
∑ Creating It helps in creating a new file at the specified location in a computer system. The new file
could be a Word document, an image file or an Excel worksheet.
∑ Saving It helps in saving the content written in a file at some specified location. The file can be
saved by giving it a name of our choice.
∑ Opening It helps in viewing the contents of an existing file.
∑ Modifying It helps in changing the existing content or adding new to an existing file.
∑ Closing It helps in closing an already open file.
Operating Systems 251

∑ Renaming It helps in changing the name of an existing file.


∑ Deleting It helps in removing a file from the memory of the computer system.

11.6.3 File Access Permissions


File access permissions help specify the manner in which a user can access a file. These are the access rights
that allow us to read, write or execute a file. The following are some of the typical file access permissions:
∑ Read It allows a user to only read the content of an existing file.
∑ Write It allows a user to only modify the content of an existing file.
∑ Execute It allows a user to run an existing file stored in the computer system.

11.6.4 File Systems


File systems are used by an operating system to store and organise the various files and their information
on a hard disk. The following are the two different file systems that are used to organise files in a computer
system:
∑ File Allocation Table (FAT) It is a method used for organising the files and folders in the form
of a table, which is known as FAT. This type of system is used for disks that are smaller in size and
contain simple folders. The different types of FAT systems are FAT12, FAT16 and FAT32.
∑ New Technology File System (NTFS) This file system is specifically designed for large hard
disks for performing basic file operations, such as reading, writing, modifying, saving, etc., quickly
and efficiently. NTFS overcomes the drawbacks of the FAT system.

11.7 DEVICE MANAGEMENT

Device management is another important function of the operating system. Device management is
responsible for managing all the hardware devices of the computer system. It may include the management
of the storages devices as well as the management of all the input/output devices of the computer system. It
is the responsibility of the operating system to keep a track of the status of all the devices in the computer
system. The status of any computer device, internal or external, may be either free or busy. If a device
requested by a process is free at a specific instant of time, the operating system allocates it to the process.
An operating system manages the devices in a computer system with the help of device controllers and
device drivers. Each device in the computer system is equipped with a corresponding device controller.
For example, the various device controllers in a computer system may be disk controller, printer controller,
tape-drive controller and memory controller. All these device controllers are connected with each other
through a system bus. The device controllers are actually the hardware components that contain some
buffer registers to store the data temporarily. The transfer of data between a running process and the various
devices of the computer system is accomplished only through these device controllers.
Apart from device controllers, device drivers also help the operating system to manage and allocate the
devices to different processes in an efficient manner. Device drivers are the software programs that are used
by the operating system to control the functioning of various devices in a uniform manner. An operating
system communicates with the device controllers with the help of device drivers while allocating the
devices to the various processes running on the computer system. The device drivers may also be regarded
as the software programs acting as an intermediary between the processes and the device controllers.
252 Fundamentals of Computers

Figure 11.13 shows the mechanism of allocating a device to a process by the operating system.

Fig. 11.13 Device management

Figure 11.3 shows how a device or resource can be allocated to an application program by the operating
system. If an application program or process, during its execution, requires a device to perform a specific
task, it generates a request. This request is handled by the operating system through the corresponding
device driver and device controller.
The device controller used in the device management operation usually includes three different registers:
command, status and data. The command register is used to contain the information regarding the request
issued by an application program. It is the only register of device controller that specifies the type of service
requested by the application program. The status register is used to keep track of the status of the device.
It contains information about whether or not the device is free to service the request of an application
program. The data register holds the necessary data required to be transferred between the application
program and the corresponding device.
Apart from handling the commands issued by the application program, the other major responsibility of
the device management function is to implement the Application Programming Interface (API). API is the
only interface through which the application programs running on the computer system can communicate
with the kernel of the operating system to issue the various device-related requests. It can also be regarded
as the set of functions or routines that can be called by the application programs to access various services
required for their proper execution. This API provides a uniform interface for accessing all the device
controllers in the computer system.
Operating Systems 253

11.8 SECURITY MANAGEMENT

The security management function of an operating system helps in implementing mechanisms that
secure and protect the computer system internally as well as externally. Therefore, an operating system is
responsible for securing the system at two different levels, which are internal security and external security.
Internal security refers to the protection of activities of one process from the activities of another
process. The term internal security may also be regarded as system protection. The internal security of the
computer system also ensures the reliability of the computer system. There may be a number of processes
running in the computer system concurrently. It is the responsibility of the operating system to make sure
that only one process at a time has access to a particular resource of the computer system. Most of the
operating systems use the concept of least privilege to implement internal security. In this concept, each
process or program running in the computer system is assigned enough privileges to access the various
resources of the computer system. If two processes running on the computer system send a request to the
operating system for the allocation of same device or resource, the kernel of the operating system checks
the privileges of both the processes. The process with more privileges will be serviced by the operating
system. The process with fewer privileges will be blocked by the operating system from gaining access to
the particular computer device.
External security refers to the implementation of mechanisms for securing the data and programs stored
in the computer system as well as the various resources of the computer system against unauthorised access.
The term external security may also be regarded as system security. External security is particularly required
when a computer system is either on a network or connected to the Internet. The system security can be
desecrated either intentionally or accidentally. It is easier for the operating system to implement the security
mechanisms for accidental security breaches. Most of the external security mechanisms implemented by the
operating system are only to prevent the computer system against accidental misuse. The various external
threats, accidental or intentional, to the computer system may include reading, writing or deletion of
computer data by an unauthorised user and accessing of computer resources or devices by an unauthorised
user. It is not possible to prevent the computer system from external threats only at the operating system
level. Apart from the operating system, the three other major levels at which external security should be
implemented are physical, human and network. The most common external security mechanism employed
by most operating systems is a software firewall. The software firewall is software included in the operating
system that is specially designed to prevent the computer system against unauthorised users or programs
from gaining access to the data and programs stored in the computer system.

11.9 TYPES OF OPERATING SYSTEMS

Many different types of operating systems have evolved till date. As the computers have improved in terms
of speed, reliability, and cost so have the operating systems in terms of their capabilities. The operating
systems supported by first generation computers were not very powerful. They were only designed and
developed to cater the needs of a single user at a time. Also, the users of these operating systems were
capable of performing only one task at a time. However, there has been a tremendous amount of
improvement in operating systems in the recent years. The modern-day operating systems allow multiple
users to carry out multiple tasks simultaneously. Based on their capabilities and the types of applications
supported, the operating systems can be divided into the following six major categories:
∑ Batch processing operating systems
254 Fundamentals of Computers

∑ Multi-user operating systems


∑ Multitasking operating systems
∑ Real-time operating systems
∑ Multiprocessor operating systems
∑ Embedded operating systems

11.9.1 Batch Processing Operating Systems


The batch processing operating systems are capable of executing only one job at a time. The jobs or the
programs submitted by different users are grouped into batches and one batch of jobs is provided as input to
the computer system at a time. The jobs in the batch are processed on the first-come-first-serve basis. After
getting an appropriate command from the operator, the batch processing operating system starts executing
the jobs one-by-one. The execution of a particular job generally involves three major activities, which are
reading the job from the input device, executing the job by the system and printing the calculated result on
to the output device. After the execution of one job is complete, the operating system automatically fetches
the next job from the batch without any human intervention.
The following are some of the advantages of batch processing operating systems:
∑ The computer systems employing the batch processing operating systems were very efficient
computer systems of their times because the idle time for these systems was very small.
∑ These operating systems facilitated the execution of jobs in an organised manner.
The following are some of the disadvantages of batch processing operating systems:
∑ The jobs are processed only in the order in which they are placed in a batch and not as per their
priority.
∑ The debugging of a program at execution time is not possible in these operating systems.
∑ The executing jobs may enter an infinite loop, as each job is not associated with a proper timer.

11.9.2 Multi-user Operating Systems


The multi-user operating systems enable multiple users to use the resources of a computer system at the
same time. In other words, a multi-user operating system allows a number of users to work simultaneously
on the same computer system. These types of operating systems are specially designed for the multi-user
systems. A multi-user system is usually implemented by following the multi-terminal configuration. In this
type of configuration, a single powerful computer system is connected to multiple terminals though serial
ports. This computer system is responsible for processing the different requests generated by the various
terminals at the same time. The devices connected with the various terminals are keyboard, mouse, and
monitor. The central computer system is equipped with a fast processor and a memory of large capacity for
catering to the multiple requests of the end users. Examples of multi-user operating system include Unix,
Linux, Windows 2000 and VM-386
The following are some of the advantages of the multi-user operating systems:
∑ It allows the resources of the computer system to be utilised in an efficient manner.
∑ It enhances the overall productivity of the various users by providing simultaneous access to the
various computer resources.
The following are the disadvantages of the multi-user operating systems:
∑ The configuration of the computer system employing multi-user operating system is complex and
hence, is difficult to handle and maintain.
∑ This type of system may result in an inconsistent data if the activities of one user are not protected
from another user.
∑ This type of operating system is required to have robust security mechanisms.
Operating Systems 255

11.9.3 Multitasking Operating Systems


The multitasking operating systems allow a user to carry out multiple tasks at the same time on a single
computer system. The multitasking operating systems are also known as by several other names, such
as multiprocessing, multiprogramming, concurrent or process scheduling operating systems. The first
multitasking operating systems evolved during 1960s. The number of tasks or processes that can be
processed simultaneously in this type of operating system depends upon various factors, such as the speed
of the CPU, the capacity of the memory, and the size of the programs.
In this type of operating system, the different processes are executed simultaneously by implementing
the concept of time slicing. According to this concept, a regular slice of CPU time is provided to each of the
processes running in the computer system. Multitasking operating systems can be of two different types,
which are preemptive multitasking operating systems and cooperative multitasking operating systems. In
preemptive multitasking operating system, slices of CPU time are allocated to the various processes on
some priority basis. These priorities are assigned to the various processes in such a manner that the overall
efficiency of the system is maintained. In cooperative multitasking operating system, it strongly depends
upon the processes whether or not to relinquish CPU control for other running processes. Examples of
multitasking operating system include Unix, Linux, Windows 2000, and Windows XP.
The following are some of advantages of multitasking operating systems:
∑ It helps in increasing the overall performance of the computer system.
∑ It helps in increasing the overall productivity of the user by performing a number of tasks at the same
time.
The following are some of the disadvantages of multitasking operating systems:
∑ A large amount of memory is required to execute several programs at the same time.
∑ Some mechanism needs to be implemented to ensure that the activities of one process do not interfere
with the activities of another process.

11.9.4 Real-time Operating Systems


The real-time operating systems are similar to multitasking operating systems in their functioning.
However, these operating systems are specially designed and developed for handling real-time applications
or embedded applications. The real time applications are those critical applications that are required to be
executed within a specific period of time. Therefore, time is the major constraint for these applications. The
different examples of real-time applications are industrial robots, spacecrafts, industrial control applications
and scientific research equipments.
The real-time operating systems can be of two different types, hard real-time operating system, and soft
real-time operating system. In the hard real-time operating system, it is necessary to perform a task in the
specified amount of time, i.e. within the given deadline. On the other hand, in the soft real-time operating
system, a task can be performed even after its allocated time has elapsed.
The following are some of the examples of real-time operating system:
∑ MTOS
∑ Lynx
∑ RTX
The following are some of the advantages of the real-time operating systems:
∑ It is easy to design and develop and execute real-time applications under real-time operating system
as compared to other types of operating systems.
∑ The real-time operating systems are usually more compact as compared to other operating systems.
Thus, these systems require less memory space.
256 Fundamentals of Computers

The following are some of the disadvantages of real-time operating systems:


∑ It is primarily focused on optimising the execution time of an application and thus, it sometimes
overlooks some of the other critical factors related to the overall efficiency of the computer system.
∑ It is only used for providing some dedicated functionality, and thus, cannot be used as a general-
purpose operating system.

11.9.5 Multiprocessor Operating Systems


The multiprocessor operating system allows the use of multiple CPUs in a computer system for executing
multiple processes at the same time. By using more than one CPU, the processes are executed in a faster
manner as compared to the computer systems performing multiprocessing with a single CPU.
The following are some of the examples of the multiprocessor operating system:
∑ Linux
∑ Unix
∑ Windows 2000
The following are some of advantages of multiprocessor operating systems:
∑ It helps in improving the overall performance and throughput of the computer system.
∑ It helps in increasing the reliability of the computer system. If one CPU of the computer system fails,
the other CPU takes control and executes the currently running process.
The following are some of disadvantages of the multiprocessor operating systems:
∑ The cost of the computer systems employing multiprocessor operating systems is very high.
∑ A large amount of memory is required for running and executing several user programs.

11.9.6 Embedded Operating Systems


The embedded operating systems are somewhat similar to real-time operating systems. The embedded
operating system is installed on an embedded computer system, which is primarily used for performing
computational tasks in electronic devices. These operating systems provide limited functionality that
is required for the corresponding embedded computer system. The other common functions that a usual
operating system supports are not found in these operating systems.
The following are some of the examples of embedded operating systems:
∑ Palm OS
∑ Windows CE
The following are some of the advantages of embedded operating systems:
∑ These operating systems allow the implementation of embedded systems in an efficient manner.
∑ The computer system with embedded operating system is easy to use and maintain.
The following are some of the disadvantages of embedded operating systems:
∑ It is only possible to perform some specific operations with these operating systems.
∑ These operating systems cannot be used in frequently changing environments.

11.10 PROVIDING USER INTERFACE


AU User Interface (UI) facilitates communication between an application and its users by acting as an
intermediary between them. Each application including the operating system is provided with a specific
UI for effective communication. The two basic functions of the UI of any application are to take the inputs
Operating Systems 257

from the user and to provide the outputs to the user. However, the types of inputs taken by the UI and the
types of outputs provided by the UI may vary from one application to another.
The UI of any operating system can be classified into one of the following types:
∑ Graphical User Interface (GUI)
∑ Command Line Interface (CLI)

11.10.1 Graphical User Interface


GUI is a type of UI that enables the users to interact with the operating system by means of point-and-click
operations. GUI contains several icons representing pictorial representation of the various objects such as
file, directory and device. The graphical icons provided in the UI can be manipulated to perform different
types of tasks. These UI graphical icons are usually manipulated by the users using a suitable pointing
device, such as mouse, trackball, touch screen and light pen. The other input devices like keyboard can also
be used to manipulate these graphical icons. GUIs are considered to be very user-friendly interfaces because
each object is represented with a corresponding icon. Unlike the other UIs, the users need not provide text
commands for executing tasks.
Figure 11.14 shows the GUI of Windows XP operating system.

Fig. 11.14 The user interface of Windows XP operating system

The following are some of the advantages of GUI-based operating systems:


∑ The GUI interface is easy to understand and even the new users can operate on them on their own.
∑ The GUI interface visually acknowledges and confirms each type of action performed by the users.
For example, when the user deletes a file in the Windows operating system, then the operating system
asks for the confirmation before deleting it.
∑ The GUI interface enables the users to perform a number of tasks at the same time. This feature of
operating system is also known as multitasking.
258 Fundamentals of Computers

11.10.2 Command Line Interface


CLI is a type of UI that enables the users to interact with the operating system by issuing some specific
commands. In order to perform a task in this interface, the user needs to type a command at the command
line. As soon as the user presses the Enter key, the command is received by the command line interpreter.
The command line interpreter is a software program that is responsible for receiving and processing the
commands issued by the user. After processing the command, the command line interpreter displays
the command prompt again along with the output of the previous command issued by the user. The
disadvantage of the CLI is that the user needs to remember a lot of commands to interact with the operating
system. Therefore, these types of interfaces are not considered very friendly from the user’s perspective.

Fig. 11.15 The command line interface of MS-DOS

Figure 11.15 shows the command line user interface of MS-DOS. In order to perform a task, we need to
type a command at the command prompt denoted by C:\>. For example, to copy a text file, say, a1.txt, from the
C drive of our computer system. to the D drive, we need to type the copy command at the command
prompt, as shown in Fig. 11.16.
Figure 11.16 shows that a text file from the C drive of the computer system has been copied to the
D drive of the computer system. However, before typing the copy command at the command prompt, we
need to make sure that the file, a1.txt, exists in the C drive of the computer system.

11.11 POPULAR OPERATING SYSTEMS

To date, many operating systems have been developed that suit different requirements of the users. Some of
these operating systems became quite popular while others did not do well. The following are some of the
popular operating systems:
∑ MS-DOS
Operating Systems 259

∑ UNIX
∑ Windows

Fig. 11.16 Copying a file in MS-DOS

11.11.1 MS-DOS
MS-DOS was developed and introduced by Microsoft in 1981. It is a single-user and single-tasking
operating system developed for personal computers. MS-DOS was specifically designed for the family of
Intel 8086 microprocessors. This operating system provides a command line user interface, which means
that a user needs to type a command at the command line for performing a specific task. The CLI of
MS-DOS is more commonly known as DOS prompt. The user interface of MS-DOS is very simple to use
but not very user-friendly because of its non-graphical nature. The user has to issue a command to carry out
even a simple task.
The command prompt of MS-DOS only allows the execution of the files with the extensions: .COM
(Command files), .BAT (Batch files) and .EXE (Executable file). The structure of MS-DOS comprises the
following programs:
∑ IO.SYS It is an important hidden and read only system file of MS-DOS that is used to start the
computer system. It is also responsible for the efficient management and allocation of the hardware
resources through the use of appropriate device drivers.
∑ MSDOS.SYS It is another hidden and read only system file that is executed immediately after the
execution of IO.SYS file is finished. MSDOS.SYS acts as the kernel of MS-DOS. It is responsible for
managing the memory, processors and the input/output devices of the computer system.
∑ CONFIG.SYS It is a system file that is used to configure various hardware components of the
computer system so that they can be used by the various applications.
260 Fundamentals of Computers

∑ COMMAND.COM It is the command interpreter that is used to read and interpret the various
commands issued by the users.
∑ AUTOEXEC.BAT It is a batch file consisting of a list of commands that is executed automatically
as the computer system starts up.
The use of various features of MS-DOS is discussed in Chapter 12.

11.11.2 UNIX
UNIX is an operating system that allows several users to perform a number of tasks simultaneously. The
first version of UNIX was introduced during the 1970s. However, since then, it is in constant development
phase for further improving its functionality. UNIX operating system provides a GUI that enables its users
to work in a more convenient environment. UNIX is most suitable for the computers that are connected
to a Local Area Network (LAN) for performing scientific and business related operations. It can also
be implemented on personal computers. The following are the core components of the UNIX operating
system:

∑ Kernel It is the central part of the UNIX operating system that manages and controls the
communication between the various hardware and software components of the computer system. The
other major functions performed by the kernel are process management, memory management and
device management.

∑ Shell It is the user interface of the UNIX operating system that acts as an intermediary between
the user and the kernel of the operating system. Shell is the only program in UNIX operating system
that takes the commands issued by the users and interprets them in an efficient manner to produce the
desired result.

∑ Files and processes The UNIX operating system arranges everything in terms of files and
processes. The directory in this operating system is also considered as a file that is used to house
other files within it. The process is usually a program executed under the UNIX operating system.
Several processes can be executed simultaneously in this operating system and are identified by a
unique Process Identifier (PID) assigned to them.
Figure 11.17 shows the directory structure of UNIX operating system.
The UNIX operating system supports hierarchical directory structure in the form of a tree for arranging
different files in the computer system. The root of the tree is always denoted by slash (/). The current
working directory of the user is denoted by home. There can be several home directories corresponding
to the different users of the UNIX operating system. All the files and directories under the home directory
belong to a particular user. The path of any file or directory in UNIX operating system always starts with
the root (/). For example, the full path of the file word.doc can be represented as /home/its/ag2/mmdata/
word.doc.
The following are some of the significant features of UNIX operating system:
∑ It allows multiple users to work simultaneously.
∑ It allows the execution of several programs and processes at the same time to ensure efficient
utilisation of the processor.
Operating Systems 261

∑ It implements the concept of virtual memory in an efficient manner. This feature enables the UNIX
operating system to execute a program whose size is larger than the main memory of the computer
system.

Fig. 11.17 UNIX directory structure

11.11.3 Windows
Microsoft has provided many operating systems to cater the needs of different users. Microsoft is a well
known name in the development of operating system as well as various software applications. Initially,
Microsoft introduced Windows 1.x, Windows 2.x and Windows 386 operating systems. However, these
operating systems lacked certain desirable features, such as networking and interactive user interface.
Microsoft continued to work towards developing an operating system that met the desirable features of
users and came up with a new operating system in the year 1993, which was known as Windows NT 3.1.
This operating system was specially designed for the advanced users performing various business and
scientific operations. After the release of Windows NT 3.1, several other operating systems were introduced
by Microsoft in the successive years with their own unique features. Table 11.1 lists some of other important
Windows operating system introduced by Microsoft with their release dates and significant features.
262 Fundamentals of Computers

Table 11.1 Microsoft Windows operating system

Name of operating system Date of release Significant features


Windows 95 August, 1995 ∑ 32-bit file system
∑ Multitasking
∑ Object Linking and Embedding (OLE)
∑ Plug and play
∑ Optimised memory management
Windows 98 June, 1998 ∑ 32-bit Data Link Control (DLC) protocol
∑ Improved GUI
∑ Improved online communication through vari-
ous tools, such as outlook express, personal web
server and web publishing wizard
∑ Multiple display support
∑ Windows update
Windows 2000 February, 2000 ∑ More reliable against application failures
∑ Improved Windows explorer
∑ Secure file system using encryption
∑ Microsoft Management Console (MMC)
∑ Improved maintenance operations
Windows ME September, 2000 ∑ System restoration against failure
∑ Universal plug and play
∑ Automatic updates
∑ Image preview
Windows XP October, 2001 ∑ Attractive desktop and user interface
∑ System restore
∑ Windows firewall
∑ Files and settings transfer wizard
Windows Server 2003 April, 2003 ∑ Enhanced Internet Information Services (IIS)
∑ Enhanced Microsoft Message Queuing (MSMQ)
∑ Enhanced active directory support
∑ Watchdog timer
Windows Vista November, 2006 ∑ Multilingual user interface
∑ Enhanced search engine
∑ Enhanced Internet explorer
∑ Enhanced Windows media player
∑ Enhanced Windows update
∑ Windows system assessment tool

Chapter Summary
Operating system is a system software installed on a computer system that performs several key tasks, such as
process management, memory management, device management, file management, etc. An operating system also
secures the computer system from various threats such as virus and unauthorised access. There are different types
of operating system available such as multi-user, batch processing and embedded. The multi-user operating system
allows multiple users to use the computer system simultaneously. The batch processing operating system processes
CPU bound: Mostly perform computations with little
I/O operations. Scientific and engineering
computations usually fall in this category

§ I/O bound: Mostly perform I/O operations with little


computation. Commercial data processing applications
usually fall in this category

Operating Systems 263

the jobs in groups called batches. The embedded operating system is installed on an embedded computer system,
which is primarily used for performing computational tasks in electronic devices.
An end user interacts with an operating system through a user interface, which is of two types, GUI or CLI. A
GUI interface allows the end users to issue commands through point-and-click operations while a CLI interface
allows the end users to issue commands only by typing them at the command prompt. Windows, UNIX and
MS-DOS are some of the most popular operating systems. Windows is a GUI based operating system, while MS-
DOS is a CLI based operating system.

Key Terms to Remember

∑ Operating system: It is a system software that manages the hardware and other resources of a computer system and
enables effective user interaction.
∑ Process management: Process management involves the execution of various tasks, such as creation of processes,
scheduling of processes, management of deadlocks and termination of the processes.
∑ Process state: Process state is the condition of a process at a particular instant of time.
∑ Process Control Block: PCB is a data structure associated with a process that provides complete information about
the process.
∑ Process scheduling: Process scheduling is a task performed by an operating system for deciding the priority in
which the processes are allocated the CPU time for their execution.
∑ Process synchronisation: Process synchronisation is the task of synchronising the execution of processes in such a
manner that no two processes have access to the same shared data or resource.
∑ Interprocess communication: Interprocess communication is the method of communication between processes
through which processes interact with each other for gaining access to shared data and resources.
∑ Deadlock: It is a condition that occurs when multiple processes wait for each other to free up resources and as a
result all the processes remain halted.
∑ Memory management: Memory management function of an operating system helps in allocating the main memory
space to the processes and their data at the time of their execution.
∑ File management: File management is defined as the process of manipulating files in a computer system.
∑ Security management: Security management function of an operating system helps in implementing mechanisms
that secure and protect the computer system internally as well as externally.
∑ Batch processing operating system: This operating system processes the jobs by organising them in groups called
batches. It processes only one job at a time.
∑ Multi-user operating system: It allows multiple users to work simultaneously on the same computer system.
∑ Multitasking operating system: It allows a user to carry out multiple tasks at the same time on a single computer
system.
∑ Real-time operating system: It is used for processing critical applications that are required to be executed within a
specific period of time.
∑ Multiprocessor operating system: It allows the use of multiple CPUs in a computer system for executing multiple
processes at the same time.
∑ Embedded operating system: It is installed on an embedded computer system, which is primarily used for
performing computational tasks in electronic devices.
∑ User Interface (UI): UI facilitates communication between an application and its users by acting as an intermediary
between them.

Commands supported by the command interpretation


module are known as system calls
264 Fundamentals of Computers

∑ Graphical User Interface: GUI is a type of UI that enables the users to interact with the operating system by means
of point-and-click operations.
∑ Command Line Interface: CLI is a type of UI that enables the users to interact with the operating system by
issuing some specific commands.
∑ Kernel: Kernel is the central part of the UNIX operating system that manages and controls the communication
between the various hardware and software components.
∑ Shell: Shell is the user interface of the UNIX operating system that acts as an intermediary between the user and the
kernel of the operating system.

Review Questions

Fill in the Blanks

1. ____________ is a system software that allows the users to interact with the hardware and other resources of a
computer system.
2. In ____________ interface, users type the commands pertaining to the tasks that they want to perform.
3. In ____________ interface, commands are given by means of point-and-click operations performed using a
pointing device, such as mouse.
4. The process of managing the files and directories contained in a computer system is known as ___________.
5. The ___________ state specifies the time when a process is ready for execution but has not been placed in the
ready queue by the operating system.
6. ___________ is a data structure associated with a process that provides complete information about the process.
7. The operating system maintains a table called ___________, which stores the PCBs related to all the processes.
8. The process, which creates a new process using the system call, is called ____________.
9. ____________ is the task performed by an operating system for deciding the priority in which the processes,
which are in ready and waiting states, are allocated the CPU time for their execution.
10. An operating system uses a program called ________ for deciding the priority in which a process is allocated the
CPU time.
11. In __________ scheduling algorithm, a process is allocated the CPU for a specific time period called time slice
or time quantum.
12. ____________ is the task of synchronising the execution of processes in such a manner that no two processes
have access to the same shared data or resource.
13. ____________ is a condition that occurs when multiple processes wait for each other to free up resources and as
a result all the processes remain halted.
14. The ____________ function of an operating system helps in allocating the main memory space to the processes
and their data at the time of their execution.
15. Paging is a technique in which the main memory of the computer system is organized in the form of equal sized
blocks called ______.
16. _________ management is responsible for managing all the hardware devices of the computer system.
17. The ______________ function of an operating system helps in implementing mechanisms that secure and protect
the computer system internally as well as externally.
18. In ___________ operating system, jobs are grouped into groups called batches and assigned to the computer
system with the help of a card reader.
Operating Systems 265

19. In ____________ operating system, multiple users can make use of computer system’s resources simultaneously.
20. UI facilitates communication between a _________ and its ______ by acting as an intermediary between them.
21. ___________ is the central part of the UNIX operating system that manages and controls the communication
between the various hardware and software components.

Multiple Choice Questions

1. Which of the following program is essential for the functioning of a computer system?
A. MS Word B. Operating system C. MS Excel D. System software
2. Which of the following operating systems makes use of CLI?
A. MS-DOS B. Windows 2000 C. Windows Server 2003 D None of the above
3. Which of the following operating systems makes use of GUI?
A. Windows 2000 B. Windows Server 2003 C. Windows Vista D. All of the above
4. Which of the following operating systems makes use of both command line interface and GUI?
A. Windows 2000 B. Linux C. Windows Vista D. None of the above
5. Which of the following functions is provided by an operating system?
A. Process management B. Security management
C. File management D. All of the above
6. Which of the following provides complete information related to a process?
A. Process state B. Process scheduling C. Process communication D. PCB
7. Which of the following is an operation related to a process?
A. Process creation B. Process execution C. Process completion
& process termination
D. None of the above
8. Which of the following is responsible for ascertaining the order in which processes are executed?
A. Scheduler B. Process schedule manager
C. Operating system scheduler D. Process Scheduler
9. Which one of the following scheduling algorithm is the simplest algorithm for the scheduling of processes?
A. FCFS scheduling algorithm B. RR scheduling algorithm
C. Priority scheduling algorithm D. SJF scheduling algorithm
10. Which of the following methods is used for interprocess communication?
A. Shared cache memory B. Shared region
C. Message passing D. Cache memory
11. Which one of the following methods is used for handling of deadlocks?
A. Detect and recover deadlock B. Mutual exclusion
C. No preemption D. All of the above
12. Which one of the following is a file operation?
A. Opening a file B. Manipulating a file C. Resising a file D. All of the above
13. Which one of the following software components is used by an operating system for device management
function?
A. Driver B. Device driver C. Program driver D. Application driver
266 Fundamentals of Computers

14. Which one of the following types of the operating systems allows multiple users to work simultaneously?
A. Multitasking operating system B. Multi-user operating system
C. Multiprocessor operating system D. None of the above
15. Which of the following type of UI allows a user to enter commands at command line?
A. GUI B. CLI C. Both GUI and CLI D. Neither GUI nor CLI
16. Which of the following is a part of MS-DOS?
A. DOS.SYS B. CONFIGURATION.SYS
C. EXEC.BAT D. COMMAND.COM
17. Which of the following is the core component of UNIX?
A. Command shell B. Kernel
C. Directories and programs D. None of the above

Discussion Questions

1. What is an operating system? Explain briefly with the help of examples.


2. Briefly state the history of operating system.
3. Briefly explain the various functions of an operating system.
4. What is a process state? Explain the various states of a process with the help of a figure.
5. What is a PCB and what information is contained in it?
6. Explain the process creation and process termination operations related to a process.
7. Briefly explain the term process scheduling.
8. Explain the three types of schedulers that help in process scheduling.
9. Which scheduling algorithms are used in process scheduling? Explain each one of them briefly.
10. Briefly explain the task of process synchronisation performed by an operating system.
11. What is interprocess communication? Explain the two methods used for interprocess communication.
12. What is a deadlock? Explain briefly the methods that can be used to handle this condition.
13. What is memory management? Explain briefly.
14. Briefly explain the function of file management performed by an operating system.
15. Briefly explain the device management function of an operating system. Also, describe the role of device drivers
in device management.
16. Briefly explain any three types of operating system.
17. What is a UI? Explain the two types of UI.
18. State the programs that are a part of the MS-DOS structure.
19. Explain the core components of UNIX operating system.
20. Briefly explain why Windows operating system is one of the most popular operating systems.
C HA PTE R 14
DATA COMMUNICATIONS AND NETWORKS

Chapter Outline Chapter Objectives

14.1 Introduction In this chapter, we will learn:


14.2 Data Communication Using Modem ∑ The process of data transmission from the
source to the destination.
14.3 Computer Networks
∑ The interconnectivity of computers in
14.3.1 Local Area Networks different types of networks, such as LAN,
14.3.2 Wide Area Networks WAN, Internet etc.
14.3.3 Metropolitan Area Networks ∑ The use of network protocols and software
14.3.4 Internet by computers for communicating with
14.3.5 Intranet each other.
∑ How to use network for accessing various
14.3.6 Client Server Networks
resources.
14.3.7 Peer-to-peer Networks
14.3.8 Value-added Networks
14.4 Network Topologies
14.4.1 Hierarchical Topology 14.1 INTRODUCTION
14.4.2 Linear Bus Topology
14.4.3 Star Topology Computers were originally developed as stand-
14.4.4 Ring Topology alone, single-user systems. Stand-alone computers
14.4.5 Mesh Topology can receive user’s data, manipulate them and
14.4.6 Hybrid Topology provide useful information for making decisions.
Here, the user uses his own data for his own
14.4.7 Network Media
decision making purposes. When the use of
14.5 Network Protocols and Software computers spread across government offices and
14.6 Applications of Network business organisations, a number of issues were
Chapter Summary raised.
Key Terms to Remember ∑ What if a user wants to share his computer
Review Questions generated information with other colleagues?
∑ What if a user wants to explore the
Fill in the Blanks
possibility of using certain information stored
Multiple Choice Questions elsewhere?
Discussion Questions These issues were addressed by the subsequent
developments in software, hardware and
Data Communications and Networks 357

communication technologies which have enabled the computers to communicate between each other and
exchange information quickly and accurately and at any time.
The process of electronic transfer of information between two locations is known as data communication.
The five basic elements of data communication are:
∑ Message It is the information to be communicated. It may be in the form of text, pictures, audio,
video, or any combination of these.
∑ Sender It is the device that creates and transmits the information.
∑ Receiver It is the device that receives the information.
∑ Medium It is the communication channel through which the information travels from sender to
receiver. It could be a physical wire or radio waves.
∑ Protocol It represents a set of rules that governs the communication process between the sender
and the receiver.
Figure 14.1 illustrates these five elements of data communication.

Fig. 14.1 Basic elements of data communication

Data communication may occur in a simple point-to-point mode as shown in Fig. 14.1 or in a multipoint
mode where more than two computers are connected together in the form of a network. A network is a
system of interconnected computers that can communicate with one another to share applications and data.
We shall discuss in this chapter the various forms of networks, their topologies, protocols used and
network applications.

14.2 DATA COMMUNICATION USING MODEM

In data communication, data from one computer is transferred to another computer using various channels
such as analog transmission channel and satellites. One of the analog transmission channels, which is
most commonly used in data communication is the telephone lines. A computer that sends data to another
computer is called the source terminal and the computer which receives the data from a sender computer is
called the destination terminal.
The sender computer provides the data for transmission in the form of digital signals. These digital
signals have to be first converted into analog signals for transmission through an analog transmission
channel such as telephone lines. The process of converting digital signals into analog signals is called
modulation. The analog signals have to be again converted into digital signals when they reach the
358 Fundamentals of Computers

destination so that the receiver computer can understand the signals. The process of converting the analog
signals again into digital signals is called demodulation. The modulation and demodulation processes are
performed by a device called modem during data transfer between computers. A modem is basically an
electronic device that converts the digital signals into analog signals. It also helps to convert analog signals
into digital signals.
A modem must be present both at the source and destination for data transmission. This means a sender
computer as well as a receiver computer must have a modem for data transmission. If a sender computer
does not have a modem then it will not be able to send data to the receiver computer through an analog
transmission channel. Similarly, if a receiver computer does not have a modem then it will not be able to
receive the data sent by a sender computer through analog transmission channel. Figure 14.2 shows the use
of modem in data communication.

Fig. 14.2 Data Communication through Modem

Figure 14.2 shows that data in the form of digital signals are passed from the sender computer to
the modem. Modem then converts the digital signals into analog signals. The converted analog signals
are transferred from source to destination using analog transmission channel such as telephone lines.
At the destination, a modem again converts the analog signal to digital signals. The converted digital signals
are then passed to the receiver computer.
When using a modem in data communication, there are two factors that are of importance, modem speed
and modem type. Modem speed refers to the time period that a modem takes to convert digital signals into
analog signals or analog signals into digital signals. The speed of the modem is very important for data
transmission between the sender computer and receiver computer. If a modem is able to convert digital
signals into analog signals or analogs signals into digital signals at a high speed then data will also be
transmitted at high speed. A modem’s speed is measured in bits per second (bps). Modem type refers to the
type of a modem. There are basically two types of modems: internal modem and external modem. Internal
modem is the modem that is present on the expansion board, which is contained in a computer. An external
modem on the other hand is a modem that is connected externally to the COM port of the computer through
a cable. Normally internal modems are considered better than external modems because these types of
modems are present inside a computer and save desktop space.
Windows operating system provides built-in mechanism for setting up a connection using modem. We
can either set up a direct connection or a dial-up connection using a modem. In Windows operating system,
a new connection through a modem is established using the New Connection Wizard. Figure 14.3 shows
the welcome screen of the New Connection Wizard.
Data Communications and Networks 359

Fig. 14.3 The New Connection Wizard

The New Connection Wizard provides explicit information in each of its screen to guide the end user on
setting up the desired connection using modem.

14.3 COMPUTER NETWORK

Computer network is a system of interconnected computers that enable the computers to communicate
with each other and share their resources, data and applications. The physical location of each computer is
tailored to personal and organisational needs. A network may include only personal computers or a mix of
PCs, minis and mainframes spanning a particular geographical area. Computer networks that are commonly
used today may be classified as follows:
∑ Based on geographical area:
o Local Area Networks (LANs)
o Wide Area Networks (WANs)
360 Fundamentals of Computers

o Metropolitan Area Networks (MANs)


o International Network (Internet)
o Intranet
∑ Based on how computer nodes are used:
o Client Server Networks (CSNs)
o Peer-to-peer Networks (PPNs)
o Value-added Networks (VANs)

14.3.1 Local Area Network (LAN)


LAN is a group of computers, as shown in Fig. 14.4, that are connected in a small area such as building,
home, etc. Through this type of network, users can easily communicate with each other by sending and
receiving messages. LAN is generally used for connecting two or more personal computers through some
medium such as twisted pair, coaxial cable etc. Though the number of computers connected in a LAN is
limited, the data is transferred at an extremely faster rate.

Fig. 14.4 A LAN

14.3.2 Wide Area Network (WAN)


WAN is a group of computers that are connected in a large area such as continent, country, etc. WAN
is generally used for connecting two or more LANs through some medium such as leased telephone
lines, microwaves, etc. In WAN, data is transferred at slow rate. A typical WAN network is shown in
Fig. 14.5.
Data Communications and Networks 361

Fig. 14.5 A WAN system

14.3.3 Metropolitan Area Network (MAN)


MAN is a network of computers that covers a large area like a city. The size of the MAN generally lies
between that of LAN and WAN, typically covering a distance of 5 Km to 50 Km. The geographical area
covered by MAN is comparatively larger than LAN but smaller than WAN. MAN is generally owned by
private organisations. MAN is generally connected with the help of optical fibres, copper wires etc. One
of the most common example of MAN is cable television network within a city as shown in Fig. 14.6. A
network device known as router is used to connect the LANs together. The router directs the information
packets to the desired destination.

Fig. 14.6 A typical MAN system


362 Fundamentals of Computers

14.3.4 The Internet


The Internet is a global area network that allows computers connected over the network to share resources
and information using different protocols. It is basically a network of networks across the globe. Users
at different locations can very easily communicate with each other via the Internet. They can access data
and information from other computers if they are permitted to do so. The Internet basically uses a set of
protocols such as Transmission Control Protocol/ Internet Protocol (TCP/IP) for transferring the data over
the network. The following are the different types of services provided by the Internet to the users:
∑ E-mail E-mail is the widely used service of the Internet through which users can send and receive
messages in an efficient way. It allows an individual to send the message even if the other individual
is offline. The e-mail messages are sent to and from a unique e-mail address. The series of the
characters usually in the form username@hostname for sending the messages to a person is known as
the e-mail address.
∑ Online chat The online chat generally allows one-to-one communication between the individuals
over the Internet. Users can communicate directly by sending and receiving messages to there fellow
friends easily. Online chat is possible only when the sender and receiver both are online.
∑ Online shopping The Internet has become popular by providing shopping of different products
online. Now, it is very easy and simple to buy the products from the other parts of the country or from
anywhere across the world. A user can purchase an item with the use of personal computer, Internet
and special softwares such as shopping cart and e-cash. The shopping cart is used for selecting the
items online whereas e-cash is used for making the online payment of the items purchased.
∑ Usenet Usenet is the Internet based newsgroup that allows individuals to share their views
regarding a specific topic or subject over the network. People accessing the usenet can receive these
views through private or public e-mail.
There are various advantages of using the Internet:
∑ Information The Internet allows users to access large amount of information efficiently. The
information could be related to any topic, such as law, marketing, finance, science, technology etc.
∑ Availabilty The Internet is available continuously to the users all the time without any delay. Users
can access the information from the Internet at any time.
∑ Cost The Internet provides different facilities to the users at a low cost. Users can access any
website over the Internet absolutely free. The cost of sending messages through e-mail is also cheaper
as compared to postal messages.
The following are some of the disadvantages of using the Internet:
∑ Hacking The process of illegally accessing the personal information stored over the Internet is
called hacking. The person who is involved in this activity is called a hacker.
∑ Virus The software program that itself gets activated in our computer system and destroys the stored
information is called virus. Virus usually corrupts the resourses that are connected over the Internet.
∑ Bulk e-mail It is the most common problem of the Internet where the unwanted bulk messages
such as subscription mails, advertisement mails, job alert mails etc. are received on the users account.
These messages are sometimes frustrating and irritating for the users because the user simply does not
require these mails.
Data Communications and Networks 363

14.3.5 The Intranet


it is a wide area network using TCP/IP protocol like Internet
Intranet is a private network, which is confined to a single organisation only. This type of computer network
allows only the internal users of the organisation to share the resources. However, the users outside the
organisation can also access the Intranet but they can do so only if they are authorised. The concept of
Intranet was used for sharing the company’s information amongst the employees. Certain protocols such
as TCP/IP, HTTP, etc. are used by Intranet for enabling the communication between the computer systems.
Organisations that use Intranet for transferring the messages generally make use of tunneling, which is
a technique used for sending private messages. The website of the Intranet is provided with the firewall,
which is a layer that helps in ensuring the security of the information and resources. The only disadvantage
of Intranet is that it is relatively insecure as compared to the other networks. The various advantages of
using Intranet are as follows:
∑ It allows the employees of an organisation to access the organisation’s information easily and quickly.
∑ Intranet users can easily communicate with each other within the organisation.
∑ It is relatively easier to maintain and implement Intranet than the Internet.

14.3.6 Client Server Network (CSN)


CSN basically consists of two computers, client computer and server computer. The client computers are
dummy computers, which simply send requests to the server computer, whereas the server computers receive
and execute the requests sent by the client computer. CSN is also known as the client server architecture.
This architecture is a two-tier architecture, which is divided into two layers. The first layer comprises
of the user interface that is located on the client’s desktop. On the other hand, the second layer is the
database management layer, which is located on the server machine so as to provide services to the clients.
In CSN, a client computer sends a request related to processing of data to the server. The server receives the
request from the client computer and processes the data. It then sends the output obtained after the processing
of data to the client computer as a response to its request. The following are the advantages of the CSN:
∑ There is a proper distribution of computing tasks. The task of the client computer is to send request
to the server for processing of data. The server receives the request of the client computer, processes
the data and sends the result back to the client
computer.
∑ All the important data is stored on the server
and only authorised persons are allowed to
access the data from the server. As a result,
there is greater security of data in a CSN.
∑ It is easy to manage the data updates as data is
stored in a centralised manner on a server.
∑ Multiple client computers having varying
hardware configuration are able to interact
with a server.
The following are the disadvantages of the CSN:
∑ If the server crashes, the complete network
breaks down.
∑ The load on the server increases in a CSN
because there are multiple clients sending
Application layer some request to a server. As a result, the
>> network traffic increases and network
congestion occurs. Fig. 14.7 A CSN
Figure 14.7 shows a typical CSN.
DNS(Domain Name System ) translates domain names to IP addresses so browsers can load
Internet resources
Hypertext Transfer Protocol (HTTP) is an application-layer protocol for transmitting hypermedia documents,
such as HTML. It was designed for communication between web browsers and web servers, but it can also
be used for other purposes. HTTP follows a classical client-server model, with a client opening a connection
to make a request, then waiting until it receives a response. HTTP is a stateless protocol, meaning that the
server does not keep any data (state) between two requests.
The File Transfer Protocol (FTP) is a standard communication protocol used for the transfer of computer
files from a server to a client on a computer network.

The Dynamic Host Configuration Protocol (DHCP) is a network management protocol used on Internet
Protocol (IP) networks for automatically assigning IP addresses and other communication parameters to
devices connected to the network using a client server architecture.

364 Fundamentals of Computers

14.3.7 Peer-to-peer Network (PPN)


In PPN, there is no separate division as clients and servers. Every computer in the PPN is treated equally
and can send as well as receive the messages directly. PPN architecture cannot work under heavy load.
This type of architecture is commonly used for file sharing and chatting in real time. Computers connected
in this network can easily share their resources with the other computers. PPN is used in a variety of fields
such as business, education, telecommunications, military etc. The advantages of PPN are as follows:
∑ PPN is relatively cheaper than the CSN, as the centralised server is not required.
∑ PPN is simpler than the CSN because computers connected in the network can communicate
efficiently with each other.
The following are the disadvantages of the PPN:
∑ PPN is less secure because message flows freely between the computers.
∑ PPN is decentralised as there is no specific space for the storage of files.
∑ PPN is less expandable as performance and speed of network degrades when more computers
are added.
Figure 14.8 shows the PPN.

Fig. 14.8 The PPN

14.3.8 Value-added Network (VAN)


VAN is a network that is generally used by the companies privately for Electronic Data Interchange (EDI),
which is a standard used for interchanging the business data. In other words, VAN is a network that usually
adds the value to the transmitted information by providing value-added services. An example of value
added service could be the conversion of data in eXtensible Markup Language (XML) to EDI provided
through VAN to specific companies.

Telnet is an application protocol used on the Internet or local area network to provide a bidirectional
interactive text-oriented communication facility using a virtual terminal connection.

The Simple Mail Transfer Protocol (SMTP) is an internet standard communication protocol for electronic
mail transmission. Mail servers and other message transfer agents use SMTP to send and receive mail
messages.
Post Office Protocol (POP) is a type of computer networking and Internet standard protocol that extracts
and retrieves email from a remote mail server for access by the host machine.

Presentation Layer>>

Multipurpose Internet Mail Extension (MIME) in order to expand the limited capabilities of email.
MIME that allows non-ASCII data to be sent through SMTP. It allows the users to exchange different kinds
of data files on the Internet: audio, video, images, application programs as well.

Data Communications and Networks 365

Apart from providing value-added services, VAN also provides the auto error detection and correction
and protocol conversion services for data modification. Error detection and correction is a technique used
for detecting the errors in the transmitted data and then rectifying it. On the other hand, protocol conversion
is basically used for converting a message, which has been transferred using a specific protocol to another
protocol with the help of protocol converter.

14.4 NETWORK TOPOLOGIES

Network topology refers to the arrangement of computers connected in a network through some physical
medium such as cable, optical fibre etc. Topology generally determines the shape of the network and the
communication path between the various computers (nodes) of the network. The various types of network
topologies are as follows:
∑ Hierarchical topology
∑ Bus topology
∑ Star topology
∑ Ring topology
∑ Mesh topology
∑ Hybrid topology

14.4.1 Hierarchical Topology


The hierarchical topology is also known as tree topology, which is divided into different levels connected
with the help of twisted pair,
coaxial cable or fibre optics. This
type of topology is arranged in the
form of a tree structure in which
top level contains parent node
(root node), which is connected
with the child nodes in the second
level of hierarchy with the point-
to-point link. The second level
nodes are connected to the third
level nodes, which in turn are
connected to the fourth level
nodes and so on. Except the top-
level node, each level node has a
parent node.
The number of point-to-point Fig. 14.9 The hierarchical topology
links in the hierarchical type of
topology is generally one less than the total number of nodes in the structure. The hierarchical topology
is symmetrical, having a fixed branching factor, f, associated with each node. The branching factor is the
number of point-to-point links between the levels of hierarchy. Figure.14.9 shows the arrangement of
computers in hierarchical topology.
Advantages of hierarchical topology are:
∑ The hierarchical topology is generally supported by most hardware and software.

Secure Socket Layer (SSL) provides security to the data that is transferred between web browser and
server. SSL encrypts the data

Trnasport Layer>>

The Transmission Control Protocol (TCP) is a transport protocol that is used on top of IP to ensure
reliable transmission of packets.
The User Datagram Protocol (UDP) is a lightweight data transport protocol that works on top of IP.
UDP provides a mechanism to detect corrupt data in packets, but it does not attempt to solve other
problems that arise with packets,

Network Layer>>

The Internet Control Message Protocol (ICMP) is used by network devices, including routers, to send error
messages and operational information indicating success or failure when communicating with another IP
address,
366 Fundamentals of Computers

∑ In the hierarchical topology, data is received by all the nodes efficiently because of point-to-point
link.
The following are the disadvantages of hierarchical topology:
∑ In the hierarchical topology, when the root node fails, the whole network crashes.
∑ The hierarchical topology is difficult to configure.

14.4.2 Linear Bus Topology


In the linear bus topology, all the nodes are connected to the single
backbone or bus with some medium such as twisted pair, coaxial
cable etc. When a node wants to communicate with the other
nodes in the network, it simply sends a message to the common
bus. All the nodes in the network then receive the message but the
node for which it was actually sent only processes it. The other
nodes discard the message. Figure 14.10 shows the arrangement
of computers in the linear bus topology.
Advantages of linear bus topology are:
∑ The linear bus topology usually requires less cabling.
∑ The linear bus topology is relatively simple to configure and
install.
∑ In the linear bus topology, the failure of one computer does
not affect the other computers in the network.
The following are the disadvantages of linear bus topology:
∑ In the linear bus topology, the failure of the backbone cable
results in the breakdown of entire network.
∑ Addition of computers in the linear bus topology results in
the performance degradation of the network.
∑ The bus topology is difficult to reconstruct in case of faults. Fig. 14.10 A linear bus topology

14.4.3 Star Topology


In the star topology, all the nodes are connected to a common device known as hub. Nodes are connected
with the help of twisted pair, coaxial cable or optical
fibre. When a node wants to send a message to the other
nodes, it first sends the message to the hub, which in turn
forwards the message to the intended node. Each node in
the network is connected with a point-to-point link to the
centralised hub. The task of hub is to detect the faulty node
present in the network. On the other hand, it also manages
the overall data transmission in the network. Figure 14.11
shows the arrangement of computers in star topology.
Advantages of star topology are:
∑ This topology allows easy error detection and
correction.
∑ In the star topology, the failure of one computer does
not affect the other computers in the network.
∑ Star topology is easy to install. Fig. 14.11 A star topology

IEEE 802.3 -Ethernet IEEE 802.15 Bluetooth


IEEE 802.11 - WiFi

Cables>>
Unshielded Twisted pair(UTP) cabling is a form of wiring in which pairs of wires are twisted together for
the purposes of canceling out electromagnetic interference (EMI) from other wire pairs and from external
sources. This type of cable is used for home and corporate Ethernet networks.
The transmission of energy in the Coaxial cables occurs totally through the dielectric inside the cable
between the conductors.Coaxial cables are commonly used for television and other broadband signals.

An optical fiber cable consists of a center glass core surrounded by several layers of protective material.
Optical fiber deployment is expensive but offers higher bandwidth and can cover longer distances

Data Communications and Networks 367

The following are the disadvantages of star topology:


∑ In the star topology, the hub failure leads to the overall network crash.
∑ The star topology requires more amount of cable for connecting the nodes.
∑ It is expensive due to the cast of hub.

14.4.4 Ring Topology


In the ring topology, the nodes are connected in the form of a ring with the help of twisted pair. Each
node is connected directly to the other two
nodes in the network. The node, which wants
to send a message, first passes the message to
its consecutive node in the network. Data is
transmitted in the clockwise direction from
one node to another. Figure 14.12 shows the
arrangement of computers in the ring topology.
Each node incorporates a repeater, which passes
the message to next node when the message is
intended for another node.
Advantages of ring topology are:
∑ Each node has an equal access to other
nodes in the network.
∑ Addition of new nodes does not degrade
the performance of the network.
∑ Ring topology is easy to configure and
install. Fig. 14.12 A ring topology
The following are the disadvantages of ring
topology:
∑ It is relatively expensive to construct the ring topology.
∑ The failure of one node in the ring topology affects the other nodes in the ring.

14.4.5 Mesh Topology


In mesh topology, each computer is connected
to every other computer in point-to-point mode
as shown in Fig. 14.13. For example, if we have
four computers, we must have six links. If we
have n computers, we must have n(n – 1)/2 links.
A message can take several possible paths to
reach a destination.
Advantages of mesh topology are:
∑ Message delivery is more reliable.
∑ Network congestion is minimum due to
large number of links.
The following are the disadvantages:
∑ It is very expensive to implement.
∑ It is very difficult to configure and install.
Fig. 14.13 Mesh topology

Thick Ethernet was the first commercially available form of cabling supported by Ethernet. It is
technically known as 10-BASE-5. Here, 10 is the maximum throughput, i.e. 10 Mbps and 5 refers to the
maximum segment length of 500 metres .
Thin Ethernet, popularly known as cheapernet or thinnet, is among the family of Ethernet standards
that uses thinner coaxial cable as a transmission media. It is technically known as 10-BASE-2.

There are three cable types commonly used for Ethernet cabling: coaxial, twisted pair, and fiber-optic
cabling.
368 Fundamentals of Computers

14.4.6 Hybrid Topology


The hybrid topology is the combination of multiple topologies, used for constructing a single large
topology. The hybrid topology is created when two different network topologies are interconnected. If two
ring topologies are connected then the resultant topology is not the hybrid topology. On the other hand, if
the ring topology is connected to the bus topology then the resulting topology is called the hybrid topology.
This topology generally combines the features of the two topologies and is therefore more effective and
efficient than the individual topologies. Figure 14.14 shows a typical arrangement of computers in hybrid
topology.

Fig. 14.14 A hybrid topology

Advantages of hybrid topology are:


∑ The hybrid topology is more effective as it uses multiple topologies.
∑ The hybrid topology contains the best and efficient features of the combined topologies from which it
is constructed.
The following are the disadvantages of hybrid topology:
∑ The hybrid topology is relatively more complex than the other topologies.
∑ The hybrid topology is difficult to install and configure.

14.4.7 Network Media


Network media refers to the physical media used to connect the computer nodes together. There are many
types of transmission media, the most popular being cables, optical fibre, microwave and satellite.
∑ Cables Cable is one of the easiest methods of transferring messages from one place to another.
Some of the commonly used cables are telephone lines, twisted-pair cables and coaxial cables.

Firmware is a specific class of computer software that provides the low-level control for a device's
specific hardware.Typical examples of devices containing firmware are embedded systems (running
embedded software), home and personal-use appliances, computers, and computer peripherals.
Firmware is held in non-volatile memory devices such as ROM, EPROM, EEPROM, and Flash
memory.(works in between software and hardware)
INTERNET SECURITY TERMS

Adware bombards users with endless ads and pop-up windows and cause a nuisance to user experience

The most common anti-botnet solution is, CAPTCHA (Completely Automated Public Turing test to tell
Computers and Humans Apart).

Clickjacking involves tricking someone into clicking on one object on a web page while they think they are
clicking on another.

A Greylist contains items that are temporarily blocked (or temporarily allowed) until an additional step is
performed.

Malvertising is the use of online ads to distribute malicious programs.

Phishing is a type of internet fraud that seeks to acquire a user s credentials by deception. It includes
theft of passwords, credit card numbers, bank account details, and other confidential information.

Process Hollowing is a security exploit in which an attacker removes code in an executable file and
replaces it with malicious code.

A Rootkit is a collection of software tools or a program that gives a hacker remote access to, and control
over, a computer or network

Packet sniffing allows the capture of data as it is being transmitted over a network.

A Spoof is an attack attempt by an unauthorized entity or attacker to gain illegitimate access to a system
by posing as an authorized user.

Which of the following circuit is used to store one bit of data?- flip flop

Which of the following circuit convert the binary data into a decimal?- code converter

Which of the following is a combinational logic circuit which sends data from a single source to two or
more separate destinations?- Demultiplexer

Which of the following is a combinational logic circuit which converts binary information from n coded
inputs to a maximum of 2^n unique outputs?- decoder

Which of the following is a combinational logic circuit that change the binary information into N output
lines? encoder

Which of the following is a combinational logic circuit that has 2n input lines and a single output line?
multiplexer

An n-bit microprocessor has - n-bit instruction register


The multiplexer is a many-to-one circuit whereas the Demultiplexer is a one-to-many circuit.

A Demultiplexer (Demux) is a combinational logic circuit that includes single input and an n
number of outputs.

The digital circuits that perform encoding of digital information are called encoders while digital
circuits that decode the coded digital information are called decoders.

An encoder with enable pins is called multiplexer while a decoder with enable pins is called
demultiplexer.

In an encoder, the number of output lines is less than the number of inputs.

1024 memory locations * 8bits 4 chips containing 2048 locations and


each location is of 2 bytes
i.e. 2^10 m.locations * 8bits
i.e. 2^11 locations * (2*8 bits)
i.e. 10 address lines & 8 data lines
i.e. 11 address lines * 16 data lines

k=2^10 M=2^20 G=2^30 T=2^40


2kb

2*1024 loc and 8 bits


256K *64
i.e. 11 address lines and 8 data lines
2^8 * 2^10 and 64
18 add lines and 64 data lines
Spyware is any software that installs itself on your computer and starts covertly monitoring your
online behavior without your knowledge or permission. Spyware is a kind of malware that secretly
gathers information about a person or organization and relays this data to other parties.

In more technical terms, a computer virus is a type of malicious code or program written to alter the way
a computer operates and is designed to spread from one computer to another. A virus operates by
inserting or attaching itself to a legitimate program or document that supports macros in order to execute
its code.
Data Communications and Networks 369

Twisted-pair cables are insulated and twisted around each other in order to reduce noise (unwanted
signal). They are generally used to connect hubs to nodes in star topology. Coaxial cables have single
copper conductor with a shield around it. They are very robust and used for crossing large distances
such as the ocean.
∑ Optical fibre An optical fibre is a thin strand of glass that transmits pulsating beams of light
rather than electric current. These light pulses carry information. Fibre-optic cables can thus carry
information in digital form. They can carry enormous amount of messages at extremely fast speed.
These are used for long distance communications. It is a highly secured transmission medium.
∑ Microwave Communication through microwave can be used when the transmitting and receiving
ends are located at a large distance from one another. Microwaves are used to transmit analog signals.
WANs often use microwave links to connect LANs together. This mode of transmission is greatly
affected by the weather conditions.
∑ Satellite Satellites are used for receiving and transmitting analog signals globally. We can send
data from one country to another with the help of satellites. WANs that cover long distances often use
satellites for linking LANs.

14.5 NETWORK PROTOCOLS AND SOFTWARE

In order to share data between computers, it is essential to have appropriate network protocols and software.
With the help of network protocol, computers can easily communicate with each other and can share data,
resources etc.

14.5.1 Network Protocol


Network protocols are the set of rules and regulations that are generally used for communication between
two networks. Any two networks communicate with each other by sending and receiving messages in the
form of packets. The technique that is used separating a message into packets is called packet switching.
Each packet contains the address of the computer from which the message was sent and also of the
computer, which will receive the message. In order to send the packet, routers and switches are connected
over the network path that forwards the packet to the intended receiver. Using network protocol, the
following tasks can be performed:
∑ Identification of the type of the physical connection used
∑ Error detection and correction of the improper message
∑ Initiation and termination of the communication session
∑ Message formatting
Some of the commonly used network protocols are Hyper Text Transfer protocol (HTTP), Simple Mail
Transfer Protocol (SMTP), File Transfer Protocol (FTP), Transmission Control Protocol/ Internet Protocol
(TCP/IP), Telecommunications Network (Telnet), Domain Name System (DNS) etc.

14.5.2 Network Software


Network software refers to the set of instructions that are given to the computers connected in a network to
perform different tasks. These instructions are given in the form of a program, which is usually written in
some programming language such as C++, Java, C etc. The network software generally provides support
to the computers connected in a network so that they can communicate with each other by exchanging

Malware (short for malicious software ) is a file or code, typically delivered over a network,
that infects, explores, steals or conducts virtually any behavior an attacker wants. And because
malware comes in so many variants, there are numerous methods to infect computer systems.

antivirus Software that is created specifically to help detect, prevent and remove malware
(malicious software).
Antivirus is a kind of software used to prevent, scan, detect and delete viruses from a
computer. Once installed, most antivirus software runs automatically in the background to
provide real-time protection against virus attacks.

In scripting ,assuming availability of programs , we combine components to perform complex task


and they don't support strong data typing

370 Fundamentals of Computers

information. Network operating system software is the type of network software that basically controls the
network traffic, access to the network resources such as printers, files, etc. This type of software generally
provides multiuser, multitasking facilities so as to ensure effective communication between the computers
over the network. It also establishes the communication between multiple computers that are performing a
single task.

14.6 APPLICATIONS OF NETWORK

Network is the system of computers generally linked together to enable the flow of data between
the interconnected computers. With the help of network, we can access the data remotely. Some of the
applications of a network are:
∑ Data sharing It is the capability of sharing data with multiple users over the network. In order
to share the data among multiple users, it is generally stored on the servers. Different applications
can therefore access the data from these servers easily. A special software locking mechanism is
maintained over the network, so as to prevent multiple users from modifying the data. The sharing of
data among the multiple users in an interactive way is known as data conferencing.
∑ Remote data access Remote data access is the process of accessing the data from remote
location in an efficient way. Different software programs are used to provide an interface to the end
users for accessing the data remotely.
∑ Resource sharing Resource sharing is the process of sharing the resources such as storage
devices, input/output devices, etc. over the network. For example, printer can be shared among the
computers connected in a network by attaching it to the server computer. When the users want their
documents to be printed they can simply give the print command from there computers and get their
document printed. The sharing of a printer on a network is relatively cheaper than attaching separate
printers to the individual computers connected in the network.
∑ Personal communication The far-reaching applications of networks are electronic mail and
teleconferencing. These applications allow individuals as well as organisations to use networks for
exchanging messages (written, voice and video) extensively. Electronic mail enables a person to send
and receive instant messages over a computer network with the help of Internet. On the other hand,
teleconferencing enables real-time communication over a distance by allowing people at different
locations to communicate with each other by seeing the video picture of people at other sites. This is
also referred to as virtual meeting.

Chapter Summary
Data communication is the process of sending data to the destination via some communication medium such as
cables, satellites, fibre optics, etc. Modem is a device that works as a modulator as well as a demodulator. It receives
the outgoing signal in the digital form and converts them into the analog form for transmission. This process is
called modulation. The analog signal is then converted back into the digital signal at the receiving end. This process
is known as demodulation.
A cluster of computers connected together in order to share resources is termed as a computer network. Computer
network comes in a variety of shapes and sizes such as LAN, WAN, MAN, Internet, Intranet, CSN, PPN and value
added network. Computers in these networks are connected with each other in some pattern such as star, ring and
Data Communications and Networks 371

bus, which is referred as network topology. There are various types of network topologies such as hierarchical
topology, bus topology, star topology, ring topology, mesh topology and hybrid topology. The computers connected
in a network generally communicate with the help of network protocols. For the computers connected in a network,
a proper network software has to be installed so that they can communicate with each other.

Key Terms to Remember

∑ Data communication: It is the process of transmission of data from the source computer to the destination
computer.
∑ Modem: It is a device that converts outgoing digital signal into analog signal for onward transmission and converts
incoming analog signal into digital signal suitable for the computer.
∑ LAN: It is a group of interconnected computers covering a small area such as a building.
∑ WAN: It usually connects the computers in a large area such as country, continents etc.
∑ MAN: It is the regional area network that typically connects the computers within a city, campus etc.
∑ Internet: It is the global network, which comprises of various networks spread over globally.
∑ Intranet: It is the private network of computers, usually contained within an organisation.
∑ CSN: CSN consists of two computers, client computer and server computer, where the server computer simply
receives the request from the client computer and processes these requests.
∑ PPN: In PPN, every computer communicates directly with other computers by sending and receiving the requests.
∑ Network topology: The network topology is the physical arrangement of the computers connected with each other
in a network such as ring, star, bus, hierarchical and hybrid.
∑ Network protocol: The network protocol is the standard according to which different computers over the network
communicate with each other.
∑ Network media: It is the physical media used to connect the computer nodes together.
∑ Network software: It is a computer program that aids the computers to communicate with each other effectively.

Review Questions

Fill in the Blanks

1. Data communication is the process of sending the data from the ________ to the __________.
2. ______________ is a medium for transmitting the data in digital form from the source to the destination.
3. The process of converting the digital signal into analog signal is termed as __________.
4. ___________ is the method of transforming analog signals into digital signal.
5. ___________ is used for converting digital signal into analog signals and vice versa.
6. When computers are connected together in order to share resources, they are said to be in a __________.
7. ____________ is used for connecting the computers within a few kilometers of area.
8. ____________ is used for connecting the computers in a large geographical area.
9. The size of the MAN generally lies between that of LAN and WAN, typically covering a distance of
____________ to _______________.
372 Fundamentals of Computers

10. ______________ is the global area network consisting of many networks world over.
11. ______________ is the Internet based newsgroup that allows individuals to share their views regarding a specific
topic or subject over the network.
12. The software program that itself gets activated in our computer system and destroys the stored information is
called _______________.
13. The network that is restricted within an organisation is termed as ____________.
14. In the CSN architecture, ___________ sends the request to the ___________.
15. The _______________ architecture does not consist of client computer and the server computer.
16. ________________ is the network used for exchanging the data related to business.
17. Hierarchical topology is also known as _______________.
18. ____________ is the common point where all the nodes of the network are connected in the bus topology.
19. ____________ is used for connecting the nodes in the star topology.
20. The combination of multiple topologies connected in a network is known as ______________.
21. ______________ is the set of rules and regulations based on which computers in a network communicate.
22. _____________ is one of the tasks that can be performed using network protocol.
23. _____________ is used for transferring files from one computer to another over the network.
24. The set of instructions that are given to the computer for performing various tasks is known as ______________.

Multiple Choice Questions

1. Which one of the following uses light pulses for carrying information?
A. Satellite B. Microwave C. Optical fibre D. Coaxial cable
2. The process of converting digital signal into the analog signal is known as ______________ .
A. Demodulation B. Modulation C. Data compression D. None of the above
3. Which one of the following is the factor that must be considered when using modem for data communication?
A. Modem Speed B. Computer Port C. Modem size D. None of the above
4. Which of the following network is used for connecting the computers in a small geographical area?
A. MAN B. WAN C. LAN D. Internet
5. What is the full form of TCP?
A. Transfer Control Protocol B. Transmission Control Protocol
C. Transmit Control Protocol D. Transfer Communication Protocol
6. Which one of the following Internet services provides one to one communication?
A. Online chat B. Online messaging C. E-mail D. Usenet
7. A network that is restricted to use by a single organisation is referred to as:
A. LAN B. WAN C. Internet D. Intranet
8. In which network architecture there are no client computers and server computers?
A. CSN architecture B. Value added network architecture
C. PPN architecture D. All of the above
9. In which type of network can network congestion occur?
A. CSN B. PPN C. Value added network D. LAN
Multiplexing: Method of dividing physical channel into many logical
channels so that a number of independent signals may
be simultaneously transmitted

Networks that share some of the characteristics of both LANs and WANs are referred to as
Metropolitan Area Network (MAN)
Data Communications and Networks 373

10. Which type network cannot work under heavy load?


A. MAN B. LAN C. PPN D. VAN
11. Which topology is arranged in the form of a tree structure?
A. Hybrid topology B. Bus topology C. Star topology D. Hierarchical topology
12. Which of the one of the following topologies is not easy to reconstruct when a fault occurs?
A. Star topology B. Bus topology C. Ring topology D. Hybrid topology
13. Which of one of the following topologies allow easy error detection and correction?
A. Linear bus topology B. Hybrid topology C. Ring topology D. Star topology
14. Which device is used for connecting the computers in a star topology?
A. Router B. Bridge C. Hub D. Repeater
15. Which topology is the combination of multiple topologies?
A. Star topology B. Bus topology C. Hybrid topology D. Mesh topology
16. In which topology data is transferred in a circular pattern?
A. Star topology B. Ring topology C. Bus topology D. Hybrid topology
17. Which of the following topologies is the most complex but efficient?
A. Star topology B. Bus topology C. Ring topology D. Hybrid topology
18. What is the technique used for routing the packets to the destination according to their addresses?
A. Circuit switching B. Packet switching C. Routing D. None of the above
19. Which one of the following is not a network protocol?
A. FTP B. HTTP C. SMTP D. NMP
20. A set of rules that are used for communication between two networks is referred to as:
A. Network software B. Network media
C. Network protocol D. Network operating system

Discussion Questions

1. Explain the process of data communication with the help of a diagram.


2. What are the different components used in the data communication? Explain each component briefly.
3. How are modems used for the purpose of data communication?
4. What is a computer network?
5. Describe different types of computer networks with the help of illustrations.
6. What is the difference between LAN and WAN?
7. Explain CSN architecture.
8. What is PPN architecture?
9. What is metropolitan area network?
10. What is network topology?
11. What are the different types of network topologies? Explain any two network topologies through suitable
illustrations.
12. Explain hybrid topology in detail.
13. How network protocols helps in the communication of messages over the network?
14. What is the difference between ring topology and bus topology?
374 Fundamentals of Computers

15. What is network software?


16. What are the advantages and disadvantages of using Internet?
17. What is the importance of value added network in the business?
18. What is the difference between Internet and Intranet?
19. Explain the popular network media used for data transmission.
20. Differentiate among ring, star, bus and hybrid topology with the help of diagrams.
C HA PTE R 15
THE INTERNET AND WORLD WIDE WEB

Chapter Outline Chapter Objectives


15.1 Introduction In this chapter, we will learn:
15.2 History of the Internet ∑ The difference between the Internet and
15.3 The Internet Applications World Wide Web.
15.3.1 Use of the Internet in Business ∑ How the Internet has grown from a small
15.3.2 Use of the Internet in Education network to a large network over the years.
∑ The use of the Internet in various fields,
15.3.3 Use of the Internet in
such as business, education, entertainment
Communication
and communication.
15.3.4 Use of the Internet in Entertainment ∑ How web browser and World Wide Web
15.3.5 Use the Internet in Government are used for accessing websites and
15.4 Understanding World Wide Web gathering information.
15.5 Web Browsers ∑ The benefit of using search engines for
15.6 Browsing the Internet finding information over the Internet.
∑ How the email service provided by the
15.7 Using a Search Engine
Internet allows the users to send and
15.8 Email Service receive email messages over the Internet.
15.9 Protocols used in the Internet ∑ The various protocols used for the Internet
15.9.1 TCP/IP Model and their functions at different levels.
15.9.2 OSI Model
Chapter Summary
Key Terms to Remember
Review Questions
15.1 INTRODUCTION
Fill in the Blanks
Multiple Choice Questions
Internet is a popular buzzword among many people
Discussion Questions today. Almost everyone working in government
offices and business organisations is using the
Internet for exchange of information in one form or
the other.
World Wide Web is another popular phrase
among the computer users. It is commonly
referred to as the Web. Most people consider the
376 Fundamentals of Computers

Internet and the World Wide Web to be synonymous, but they are not. Although these two terms are used
interchangeably, they actually describe two different but related things.
The Internet is a massive network of networks that links together thousands of independent networks
thus bringing millions of computers on a single network to provide a global communication system. It acts
as a facilitator for exchange of information between computers that are connected to the Internet. It is like a
network of roads in a country that facilitates the movement of vehicles around the country.
We can create special documents known as hypertext documents containing text, graphics, sounds and
video on a computer. The storage location of these documents is known as website. The World Wide Web is
the network of all such websites all around the world. It is popularly known as WWW or Web. The websites
are spread across the Internet and therefore, the information contained in the websites can be transmitted
through the Internet. It is like transporting the goods stored in the warehouses using the road network. So
the Web is just a portion on the Internet and not same as the Internet.
In this chapter, we shall discuss the evolution of the Internet, the basics of World Wide Web, use of Web
browsers and search engines and the various Internet applications. We shall also discuss briefly various
protocols that are necessary for using the Web and the Internet.

15.2 HISTORY OF INTERNET

The Internet was not a worldwide network initially. It was a small network called ARPAnet, which was
developed at the Advanced Research Projects Agency (ARPA) of United States in 1969. ARPAnet
was developed to help the researchers at one university to communicate with the researchers at other
universities. The computers, which were connected through the ARPAnet, were the computers present at
the University of California, Stanford Research Institute (California) and the University of Utah (Nevada).
To transfer data between these computers, the ARPAnet used the concept of packet switching in which
the data was divided into small modules known as packets before transmitting. These packets were
transmitted individually over the network and were reassembled at the receiver’s end. During the process
of transmission of packets on the network, some rules and methods known as protocols were followed.
The ARPAnet initially used Network Control Protocol (NCP), which allowed the transmission of files,
directories and messages between two computers on the network. The use of NCP provided end-to-end
networking as the user could only trust the ends, i.e., the sender and the receiver but could not trust the
means of transmission, i.e., the network. In 1972, the access to ARPANET was extended and made available
to common people and business organisations.
In the year 1974, the scientists developed a new host-to-host protocol, which not only allowed the
sharing of files, directories and messages but also helped the users to share software and applications on
the network. This protocol was known as Transmission Control Protocol/Internet Protocol (TCP/IP). It
was a combination of two protocols, TCP and IP, which worked collectively. The IP was the protocol that
guided the packets on the different routes on the network. The IP routed each packet on a different route
and the selection of a route for a packet was made in such a manner that the packets should take minimum
time to reach their destination. The selection of different routes for different packets also facilitated the
transmission of packets even when one of the parts of the network was not working properly. The TCP was
the network protocol that was responsible for the reassembling of the packets at the destination.
The congestion on ARPAnet was increasing continuously because of its extensive use by the military.
In 1975, the Defence Communications Agency (DCA) took control of the ARPAnet and changed its
name to Defence Advanced Research Projects Agency (DARPA). DARPA allowed all the defence related
The Internet and World Wide Web 377

organisations to connect to it but at the same time it denied the connection to all the non-government
organisations. This led to the development of other commercial networks such as Telnet.
In 1976, the telephone companies from all over the world broadcasted a new protocol called X.25 with
the support of Consultative Committee for International Telegraphy and Telephony (CCITT). The X.25
protocol was similar to the packet switching technique but its implementation was different. The X.25
protocol reduced the packet size and provided a more reliable means of transmission of packets. It used
the concept of hop-to-hop networking in which the receiving of packet was acknowledged by the hop at
every step. In the X.25 protocol, the information of the path was contained only in the first packet, which
helped create a virtual path. The rest of the packets just followed the virtual path created by the first packet.
Though this protocol was used for a very short period of time but was crucial for the development of
enterprise networks.
In 1979, a research computer network known as Usenet was developed by a group of computer scientists
from all over the world. This network allowed computers to connect through a dial-up connection. In the
Usenet network, the UNIX-to-UNIX copy protocol was used to transfer data. Usenet provided two main
services, Usenet News and mail servers. The Usenet News still continues to be used as NetNews but the
mail servers did not prove to be a success. The failure of mail servers was due to the fact that to send a mail
through mail servers a user was required to provide the complete path to the destination computer with the
help of the UUCP bang addressing format. The UUCP bang addressing format was the format in which the
names of different machines were separated using a bang, i.e., an exclamation mark.
In 1982, a new network known as Eunet was developed in Europe to connect the networks of European
countries such as UK, Scandinavia and Netherlands. By the year 1983, a number of networks were added
to ARPAnet to connect around 300 computers. In the same year, TCP/IP was made the standard protocol
for ARPAnet. The TCP/IP protocol allowed communication between computers of different networks and
the ARPAnet became capable of internetworking. This was the time when ARPAnet was renamed as the
Internet. In 1983, the military part of ARPAnet was split and named as MILNET.
The number of computers connected to ARPAnet increased day-by-day because of which a new problem
arose. The mapping of host names to the IP addresses became difficult. The IP addresses were the addresses
provided to each host computer on the network. Earlier, the Network Information Center (NIC) maintained
a record of the IP addresses and the corresponding host names in a file and every computer downloaded
this file whenever required. But with the increase in the number of computers connected to the ARPAnet, it
became difficult for the NIC to do so.
In 1984, Domain Name Server (DNS) was developed that helped in the mapping of host names to the
IP addresses. The domain names such as .edu for educational, .com for commercial, .gov for governmental
and .org for international organisational hosts, were introduced along with a specific code for each country.
The DNS converted these domain names into the corresponding IP addresses. The domain names also made
it easier for the users to remember the addresses.
In 1987, the National Science Foundation established a network known as NSFNET that linked the
computers through a high speed of 56Kbps. NSFNET allowed many organisations to connect to the Internet
without following the ARPAnet’s policies. By 1990 almost all the organisations, which were connected to
ARPAnet shifted to NFSNET and ARPAnet came to an end. The use of the Internet was limited to email,
Telnet and FTP till 1990. In 1990, the McGill University introduced an FTP search tool known as Archie,
which helped the users search for the information on the Internet. In the next year, i.e., 1991, another
application known as Gopher was developed at the University of Minnesota. This service helped the users
arrange the documents on the Internet; and to locate these documents a Gopher search tool known as
Veronica was used.
378 Fundamentals of Computers

In 1992, Tim Berners-Lee, a physicist from Geneva, introduced the World Wide Web, which was
a network of websites that could be accessed with the help of a protocol known as HyperText Transfer
Protocol (HTTP). HTTP searched the required address from where the web pages had to be accessed and
retrieved the web pages for the user. The web page on the WWW had links in the form of text known as
hypertext. These links were helpful in accessing other web pages when a user clicked the hypertext with the
help of a mouse. In 1995, the commercial Internet providers started controlling the Internet by providing
connections to different people for accessing the Internet. Today the Internet is used in almost every field,
such as education, entertainment, business, defence and medicine. In all these fields, the Internet is used to
share data, gather information and communicate with the other users. According to the Internet world usage
statistics, more than 1.4 billion people use the Internet today.

15.3 INTERNET APPLICATIONS

Nowadays the Internet is used in almost all the fields for different purposes. Each and every field uses one
or the other services provided by the Internet. The Internet is extensively used in the following fields:
∑ Business
∑ Education
∑ Communication
∑ Entertainment
∑ Government

15.3.1 The Internet in Business


In business, the Internet can be used for many purposes. An organisation can provide details about its
products on the Internet that can be either used by the other organisations interested in developing business
links with it or by the prospective customers. Business transactions such as sale and purchase of products
and online payment can also be performed using the Internet. This service of the Internet is called e-
business, which can be further classified into the following categories:
∑ Business-to-business (B2B) B2B e-business refers to the business transactions that take place
between two business organisations. In B2B, a large website acts as a market place and helps the
buyers and suppliers interact at the organisational level. The website acting as a market place helps
the buyers to find new suppliers and the suppliers to search for new buyers. It also saves the time
and cost of interaction between the organisations. For example, a supplier business organisation can
provide certain raw materials to a manufacturing business organisation through its website.
∑ Business-to-consumer (B2C) B2C e-business refers to the business transactions that take
place between an organisation and a consumer directly. In B2C, a consumer can shop online for the
products offered by a business organisation. It provides all the information regarding the available
products through a website and allows the consumers to order and pay for the products online,
thus facilitating fast and convenient shopping. For example, the Asian Sky Shop sells the various
products offered by different business organisations online and any user who wants to purchase a
product can buy it online.
∑ Consumer-to-consumer (C2C) C2C refers to the business transactions that take place
between two consumers but with the help of a third party. In C2C, a consumer provides information
about a product, which is to be sold, on the website of the third party. Another consumer can buy the
The Internet and World Wide Web 379

same item through bidding on the website of the third party. The consumer, who provides an item
for sale on the website, is known as seller; whereas the consumer, who bids for the item, is known
as buyer. For example, e-bay is a website on which a consumer can provide information about the
products, which s/he needs to sell. The best bidder gets to buy the listed product.
∑ Consumer-to-business (C2B) C2B is a business model that allows individual consumers
to offer their products and services to companies in return of which they get payment from the
companies. One of the popular examples of C2B model is the online advertising site Google
Adsense. It allows individuals to display advertising content or promotional materials on their
personal websites. The administration and payment of these ads are done by Google itself. Also,
platforms like Google Video and Fotolia are good examples of C2B, where individuals can sell
digital content including images, animations, videos, etc. to companies.

15.3.2 The Internet in Education


In the field of education, the Internet is widely used for learning and teaching. The Internet not only helps
the students search information on various topics of their interest but also proves useful for the students
pursuing distance education. The distance education institutes provide notes, lectures and syllabus to
students through their respective websites. The students just have to access the website of the institute to
get all the required information from it. If the website of an educational institution supports e-learning, then
the students can participate in online lectures through simulations, Web Based Training (WBT), etc.
The Internet also provides the Usenet service, which contains a large number of Newsgroups through
which a user can submit as well as obtain the articles on different topics. The members of a newsgroup
connect to each other and have discussions through the Usenet network. Usenet contains a number of
message boards on which the articles are placed and the software known as newsreader is used to read the
articles published on message board. Most of the newsgroups allow the users to submit their articles on the
selected topics such as scientific research, social issues, religion and politics. Moreover, some newsgroups
also allow the users to submit their articles on a topic of their own choice. Newsgroup not only helps the
users in gaining knowledge but also allows them to make online friends.
The Internet also provides an application similar to Newsgroups known as Discussion forum. The
discussion forum also allows a large number of people to hold discussions or place their articles on
a particular topic similar to Newsgroups. But the only difference between the Discussion forums and
Newsgroups is that the Discussion forums display articles according to the time or the thread of receiving
the article. The thread refers to the grouping together of all the messages received on a particular topic.
Some discussion forums allow the users to place their articles even without having a membership of the
Discussion forum, while the other Discussion forums require the users to have membership along with valid
username and password. The members of such Discussion forums have special facilities such as to make
alterations in their previous articles, to initiate a new topic and to delete the previous articles submitted
by them.
Both Newsgroup and Discussion forums are used by students and other users of the Internet to share
their knowledge with each other by participating in a discussion on a specific topic. The extensive use of the
Internet in education has led to the creation of what are known as Virtual Universities in many countries.

15.3.3 The Internet in Communication


The Internet is mostly used by the people as a fast and cheap means of communication. Many services
provided by the Internet such as e-mail and instant messaging help the users to communicate quickly and
cheaply over long distances. E-mail is an application of Internet that allows a user to send and receive text
380 Fundamentals of Computers

messages electronically. To use the email services, a user requires an account on a mail server. The account
is created by the user by providing a username; a password and other personal information such as address
and contact number. Each time the user wants to access the email service, she/he has to log on to the server
using the username and the password provided during account creation. If the username or the password
provided by a user is invalid, then that user is considered as an unauthorised user and is prohibited from
using the service.
The Internet also provides another easy way of communication, i.e., communication through instant
messaging. Instant messaging is a service of the Internet through which it is possible for a user to perform
real-time communication with one or more users on the Internet. The real-time communication refers to
the communication in which there is an immediate response to a message. In case of instant messaging,
the communication between two users takes place by instant sending and receiving of message. To use this
service, the users have to log on to the instant messaging server. After a user has successfully logged on
to the server, a chat room with a list of online users is made available to the user. An online user is a user
who is available for chatting at a specific period of time. The user can then select an online user from the
list and then send a message to that online user. If a response is received from the online user to whom a
message was sent, then instant sending and receiving of message takes place. Chat rooms not only provide
the sharing of text messages but also allow the users to share images and graphics online.
Apart from e-mail and instant messaging, Internet telephony and web conferencing are the other
application areas of the Internet that facilitate, quick, cheap and efficient communication over long
distances. Through these mediums, the users can talk to the other uses in real-time through an audio-visual
interface.

15.3.4 The Internet in Entertainment


The Internet over the period of time has evolved as a great source of entertainment. It provides many
entertainment resources to the users such as games, music and movies. The most popular entertainment
resources on the Internet are the games, which are either free of cost or can be bought through the payment
of a small price. Multi User Dungeon (MUD) is a virtual environment in which fantasy characters such as
warriors, priests and thieves are adopted by end users for playing games. Each user represents a specific
character and interacts with other characters with the help of text messages. The information regarding
the game and the virtual environment is also provided to the users through commands displayed on the
screen. MUD is also available with graphics that enhance the background of the game by providing it a
3-dimensional look. This feature is known as virtual reality because the background and the characters in
the game resemble the real world entities.
Apart from games, the Internet also provides many other entertainment resources. Several websites
provide easy access to any type of music and videos, which can be freely downloaded on the computers.
The Internet also enables the users to share videos and photos with other users. Many websites on the
Internet also provide information regarding the sports events taking place at specific period of time. These
websites allow the users to access continuous score updates.

15.3.5 The Internet in Government


These days, the Internet is playing a crucial role in the functioning of the government organisations.
Almost all the government organisations have set up their websites that provide information related to the
organisation as well as help them in performing their operations. For example, nowadays people can submit
the passport application form and file the income tax returns through the use of Internet. Moreover, Internet
also enables the government agencies to share the data with each other.
The Internet and World Wide Web 381

The vast use of IT and Internet has paved the way for e-governance. More and more government
agencies are adopting the concept of e-governance to improve their service delivery capabilities.

15.4 UNDERSTANDING THE WORLD WIDE WEB

World Wide Web is a collection of web servers, which contain several web pages pertaining to different
websites. The web pages contain hypertext, simple text, images, videos and graphics. The web pages are
designed with the help of HyperText Markup Language (HTML). To view the web pages provided by a
web server, the software known as web browser is required. To display the web pages, a web browser runs
the HTML code segment written for a particular web page. Each web page on the Internet is provided its
own address known as Uniform Resource Identifier (URI) or URL. This URL helps the web browser in
locating a web page on the Internet. A URL string begins with the name of a protocol such as http or ftp
that represents the protocol through which a web page is accessed. The rest of the URL string contains
the domain server name of the web page being accessed and the location of the web page on the local
web server.
Uniform Resource Locator (URL)
15.5 WEB BROWSERS

Web browser is the software, which is used to access the Internet and the WWW. It is basically used to
access and view the web pages of the various websites available on the Internet. A web browser provides
many advanced features that help achieve easy access to the Internet and WWW. When we open a web
browser, the first page, which appears in the web browser window, is the home page set for that particular
web browser.
The web browsers are categorised into two categories, text based and Graphical User Interface (GUI)
based. The text based browsers are the browsers that display unformatted text contained in the HTML files.
These types of browsers do not display images, which are inline with the text contained in the HTML files.
However, the text based browsers have the ability of displaying the images that are not inline with the
text contained in the HTML files. The text based browsers are simple to use and do not require computers
with expensive hardware. They allow the downloading of graphic and sound files but only if the computer
contains the software and the hardware required for such files. The GUI based browsers, on the other hand,
display formatted text along with images, sounds and videos, which are contained in the HTML files.
The user has to just click the mouse button to view or download image, sound and video files. The most
commonly used web browsers are Internet Explorer (IE), Netscape Navigator and Mozilla Firefox.
The IE is the most widely used web browser that was developed in 1995 by Microsoft. The first version
of IE, i.e., IE 2.0 could be installed and run on the computers with Macintosh and the 32-bit Windows
operating systems. IE 2.0 was specially designed to access secure websites, and hence had the capabilities
of tracing any kind of errors. To trace the errors and provide secure access to websites, IE 2.0 included a
new protocol known as Secure Socket Layer (SSL) protocol. In 1996, the next version, i.e., IE 3.0 was
developed, which had many advanced features, such as Internet Mail, Windows Address Book and Window
Media Player. This version was basically developed for Windows 95 operating system. In 1997, the next
version, IE 4.0 was developed that included Microsoft Outlook Express 4.0, which is e-mail software used
for sending and receiving e-mail messages. Microsoft Outlook Express was included with IE 4.0 to provide
enhanced Internet mail and news features. The latest version of IE is IE 8.0. It is the most secure web
382 Fundamentals of Computers

browser as it contains many privacy and safety features as compared to any of the previous versions of IE.
The IE 8.0 version supports the latest Windows operating system, i.e., Windows Vista.
To access Internet Explorer on a computer, we need to select Start�Programs�Internet Explorer. The
Microsoft Internet Explorer window appears with the home page as shown in Fig. 15.1.

Fig. 15.1 Microsoft Internet Explorer window

Figure 15.1 shows that the home page for the Internet Explorer has been set to the google.com website,
which is a search engine that helps in searching information on the Internet. A user can change the home
page according to the requirements using the Internet Options option of the Tools menu.
Another commonly used web browser is Netscape Navigator, which was also known as Mozilla during
its development phase. This web browser was widely in use in the 1990’s. The only advantage of Netscape
Navigator over IE is that when a web page is being downloaded, unlike IE in which a blank screen appears
some of the text and graphics contained in the web page appears in the case of Netscape Navigator. This
prevents the wastage of time as the user can start reading the page even before it is completely downloaded.
Initially, Netscape Navigator became very popular because of its advanced features and free availability
to all the users. However, its usage declined later in 1995 when it was declared that the web browser
was freely available only to the non-profit and educational organisations. Another reason for the decline
in the usage of Netscape Navigator is that it was not capable of fixing the errors automatically. On the
other hand, IE 4.0 had the feature of automatically fixing errors. As a result, many people suddenly stopped
using Netscape Navigator. In order to increase the usage of Netscape Navigator many new features such
as mail and news reader were added to its older version. However, these new features affected the speed
of the Web browser and increased its size. As a result, Netscape Navigato is rarely being used nowadays.
The Internet and World Wide Web 383

To access Netscape Navigator, we need to select Start� Programs�Netscape Communicator Professional


Edition�Netscape Navigator. The Netscape window appears with the home page as shown in Fig. 15.2.

Fig. 15.2 The Netscape window with home page

The third most commonly used web browser is the Mozilla Firefox, which was developed by
Dave Hyatt and Blake Ross. Many versions of Mozilla Firefox web browser were developed before it was
officially released in November 2004. The latest version of Mozilla Firefox that is currently being used
is 2.0.0.14. This version includes many new features such as mail, news and HTML editing. The
Firefox web browser uses XML User Interface (XUL), which supports features such as Cascade Spread
Sheets (CSS) and JavaScript. XUL provides extensions and themes, which enable a user to increase
the capabilities of the Mozilla Firefox web browser. Initially, the Firefox was named as m/b (Mozilla/
Browser) but later its name was changed to Phoenix. The name Phoenix already existed for some BIOS
software so the web browser was renamed as Firebird but again the same problem persisted. This was
already a name of a popular database server. So, in February 2004 another name, i.e., Mozilla Firefox
was given to the web browser that persists till today. To access Mozilla Firefox, we need to select
Start � Programs�Mozilla Firefox�Mozilla Firefox. The Mozilla Firefox window appears with the home
page as shown in Fig. 15.3.
384 Fundamentals of Computers

Fig. 15.3 Mozilla Firefox window with home page

15.6 BROWSING THE INTERNET

Browsing the Internet is the process of accessing different websites available on the Internet using a web
browser. To browse the Internet, we need to first connect our computer to the Internet through a connection
provided by an ISP. To connect to the Internet, a modem is also required. Modem is a device that converts
analog signals into digital signals and vice versa. In addition, a telephone line is required for connecting the
computer to the server of the ISP. After connecting to the Internet, we can perform the following steps to
browse the Internet using IE web browser:
1. Select Start � Programs � Internet Explorer to display the Microsoft Internet Explorer window.
2. Type the URL of the website, which you want to access such as java.sun.com in the address bar that
appears at the top in the Microsoft Internet Explorer window.
3. Press the Enter key to display the home page of the java.sun.com website as shown in Fig. 15.4.
The Internet and World Wide Web 385

Fig. 15.4 Accessing an Internet website

When browsing the Internet, we can use one of the


important features, favourites, of the IE web browser. This
feature allows us to easily and quickly access the frequently
visited websites. In other words, the favourites features
allows the users who are browsing the Internet to keep a
record of all the websites that are their favourites and are
required to be accessed on a frequent basis. This feature also
proves to be handy when a user wants to avoid the tedious
task of remembering the URL of the websites, which are
frequently accessed by that user. Users can simply add the
websites, which are frequently accessed by them in the list
of favourites so that they can be easily accessed in the future
without remembering their URLs. To access a website, which
has been added to the favourites, we can use the Favourites
menu or the Favourites button, which appears in the Standard
toolbar. When we click the Favourites button in the toolbar,
the Favourites pane appears as shown in Fig. 15.5.
The Favourites pane contains a list of names of the
websites, which have been added to favourites. We can now
click a specific name in the Favourites pane to access the
corresponding website quickly. Fig. 15.5 The Favourites pane
386 Fundamentals of Computers

We can also use another important feature, i.e., ‘search’ available


in IE web browser when browsing the Internet. The search feature
allows us to search for information on a specific topic. If a user is not
aware of any website, which contains the desired information, then
the user can use the search feature of the IE web browser. When a user
searches for information through the search feature of IE, then a list
of websites containing the related information is displayed. To search
for information using the search feature of IE, we can click the Search
button, which appears in the Standard toolbar. The Search pane appears
as shown in Fig. 15.6.
In the Search pane, you can type a word in the Find a Web page
containing text box related to the topic on which you want to search the
information. After typing the word, click the Search button to search the
information related to the topic.
Note: Apart from Favourites and Search features, the Standard toolbar
of the IE web browser contains other options like Home, Next,
Previous etc, which are used for performing different functions.

Fig. 15.6 The Search pane


15.7 USING A SEARCH ENGINE

Search engines are the websites that provide the users the facility of searching for information related
to some topic. The search engines maintain an index of websites available on the Internet along with a
summary of the content contained in these websites. The summary of the content is displayed when a
user searches for information on some topic. We can use a number of techniques to make the process of
searching the information using search engines efficient and useful. These techniques are as follows:
∑ Use of double quotes (“ ”) Double quotes are used to search for a phrase collectively.
Generally, a search engine provides a list of websites that contains any of the words contained in the
text specified for searching of information. However, if a user wants the search engine to consider the
entire text specified for searching as a single phrase, then that user should provide the text in double
quotes. For example, suppose a user wants to search the information related to the topic, types of
computers. In this case, if the user specifies the text, types of computers, without double quotes for
searching the information, then the search engine will display all websites, which either contain the
word, types or the word, computers. However, if a user wants that a search engine should regard the
text, history of the Internet as a single phrase, then the user must provide the text in double quotes as
“types of computers”. This will make the search more efficient.
∑ Use of Boolean operators Boolean operators such as AND, OR and NOT can also be used in
the text specified for searching information in order to make the search process more efficient. The
Boolean AND operators can be used to search for websites, which contain the information related
to two words such as computer and hard disk. The Boolean OR can be used to search for websites,
which contain either of the two words. The Boolean NOT can be used to search for the websites,
which contain the information other than the information related to the word specified after the NOT
operator. For example, if a user is searching for some information regarding track ball present in the
mouse, then the user can specify the text “track ball OR touch ball” for searching the information as
The Internet and World Wide Web 387

both of the words mean the same. So, now the search engine will search and display all the websites
containing either of the words.
∑ Use of plus (+) and minus (-) sign Plus (+) sign is used to search the websites in which all
the words included in the text specified for searching are present. Minus (–) sign is used to search
all the websites in which the words included in the text specified for searching are not present. For
example, suppose a user wants to search the features of a mouse, then the user has to specify the text
“features + mouse” for searching the information related to the features of the mouse. The Internet
search engine will list all the web pages containing the words, features and mouse.
Some of the search engines that are commonly used by the users are www.google.com, www.altavista.
com, www.askjeeves.com, www.search.yahoo.com and www.ask.com. Among these search engines,
www.google.com is the most popular search engine, which is used worldwide. To use the google.com
search engine for searching information, the user has to perform certain steps, which are as follows:
1. Open IE web browser. The Microsoft Internet Explorer window appears.
2. Type the URL, google.com in the address bar, which appears at the top in the Microsoft Internet
Explorer window.
3. Press Enter to open the home page of the google.com search engine as shown in Fig. 15.7.

Fig. 15.7 The home page of google.com search engine


388 Fundamentals of Computers

Figure 15.7 shows that the home page of the google.com search engine contains a text box in which
we can specify the text for searching information. It also contains two buttons, Google Search and I’m
feeling Lucky. The Google Search button is used to initiate the searching process using the google.com
search engine. I’m Feeling Lucky button is used to display the first website returned as a search result
corresponding to the specified text. The home page of the Google.com search engine also contains the
following options:
∑ The web This option allows us to search the WWW for getting the information on a specific topic.
∑ Pages from India This option allows us to search the pages submitted from India for information
on specific topic.
∑ Advanced search This option allows us to specify certain advanced settings for making the
search more specific and efficient.
1. Type some text such as mouse + computers in the search text box to specify the text on the basis of
which information will be searched.
2. Click the Google Search button or press the Enter key to initiate the process of searching the
information related to mouse. A list of websites containing information related to the specified text such as
mouse gets displayed as shown in Fig. 15.8.

Fig. 15.8 The search results from google.com search engine

In Fig. 15.8, the blue text in the search result is the hypertext through which the web page containing the
required information can be accessed and the green text represents the URL of the website to which the web
page belongs. The user has to click the hypertext to view the web page containing the required information.
The Internet and World Wide Web 389

15.8 EMAIL SERVICE

Email service provided by the Internet is a very effective means of communication as it allows two persons
in remote places to communicate with each other. To use the e-mail service, a user must have a valid email
account. There are two ways in which a user can obtain an email account. The first way is to obtain an
email account from an ISP. A user can obtain an email account from an ISP when that user registers with
the ISP. To register, a user has to firstly purchase an Internet connection package offered by an ISP.
After purchasing the Internet connection package, the user registers with the ISP by providing
information such as name, address, username and password in the registration form available on the website
of the ISP. The user is then provided an email account and an email address by the ISP. The email address
consists of two parts separated by @ sign such as [email protected]. The first part written before
@ symbol in the email address is the unique identity of the user who uses the email service on the Internet.
The other part written after @ symbol is the name of the website, which provides the email service. In case
a user is using the email account of an ISP, the part after the @ sign will consist of the name of the website
owned by the ISP. No two users can have the same email addresses.
The second way to obtain an email account is to get registered on one of the websites such as hotmail.
com and yahoo.com, which provide free e-mail facility to their users. To register, a user must first access
one of these websites using a web browser. After accessing the website, the user must provide information
such as username, password, name and address in the registration form and finally the user must submit the
form to register on to the website. When the user has successfully registered, an email account is opened for
the user and an e-mail address is also provided. The user can now access the email account by providing
a valid username and password in the home page of the website such as hotmail.com and yahoo.com for
using the email service of the Internet.
The email service can be used by a user to send and receive email messages. An email message has two
sections, a header section and a body section. The header section contains the information about the sender,
the receiver and the subject of the email message. It consists of the fields such as to, cc and subject. The
to field contains the email address of the person to whom the e-mail message is to be sent. The cc field or
the carbon copy field contains the email addresses of other persons to whom a copy of the e-mail message
has to be sent. The body section contains the actual text message, which has to be sent. This section also
contains a signature block at the end where the sender places his/her signature.

15.9 PROTOCOLS USED FOR THE INTERNET

The Internet is a collection of computers, which are connected to each other for the purpose of sharing of
information. To share information, data has to be transferred from one computer to another. When data is
transferred between computers, certain rules called protocols have to be followed. The protocols perform
different tasks, which are arranged in a vertical stack and each task is performed at a different layer. The
computer, which sends the data to another computer, is called source computer. On the other hand, the
computer, which receives the data from another computer, is called destination computer. At the time of
transferring of data from the source to the destination computer, a protocol is responsible for determining
the network to which the destination computer belongs. It is also responsible for defining the procedure,
which must be followed for dividing the data into packets. The protocols are also responsible for detection
of errors in the data packets and the correction of these errors or loss of data packets. In addition, it is the
responsibility of the protocols to identify loss of connection between the computers in a network and help
the users to establish the connection again.
390 Fundamentals of Computers

Each computer on a network has a unique address, which is known as the Internet Protocol (IP) address.
An IP address is a group of four numbers and the numbers are separated from each other by a dot. When
any data is sent from one computer to another computer over the network, it is divided into small modules
known as packets or datagrams. These packets are transmitted on the network by the Internet Protocol.
Each packet transmitted on the network contains the addresses of both source and destination computer.
A gateway present on the network reads the address of the destination computer and sends the data to the
specified address. Gateway is a computer, which contains the software required for the transmission of
data over different networks. Each packet on the network is an independent entity, so they are transferred
through different routes to reach the destination computer. The packets received at the destination are not
in the same sequence in which they were transmitted. As a result, these packets are arranged in a right
sequence by a protocol known as Transmission Control Protocol (TCP) and then are merged at the
destination to form the complete data. TCP and IP work in coordination with other protocols such as Telnet
and User Datagram Protocol (UDP) but are considered as the most fundamental of all protocols. All these
protocols are collectively known as TCP/IP suite. A model known as TCP/IP model determines how the
protocols of the TCP/IP suite will work together for the transfer of data between computers in a network

15.9.1 TCP/IP Model


The TCP/IP model was initially developed by US Defence Advanced
Research Projects Agency (DARPA). This model is also known as the
Internet Reference model or DoD model. It consists of four layers,
namely, application layer, transport layer, network layer, and physical
layer. Figure 15.9 shows the four layers of TCP/IP model.
The physical layer in the TCP/IP model is responsible for interacting
with the medium of transmission of data, whereas the application layer
helps in interacting with the users. The four layers of TCP/IP and the
functions performed by these layers are as follows:
∑ Application layer The application layer is responsible
for managing all the user interface requirements. Many of the
protocols, such as telnet, FTP, SMTP, DNS, NFS, LPD, SNMP
and DHCP work on this layers.
∑ Transport layer The transport layer is responsible for the Fig. 15.9 Layers of TCP/IP model
delivery of packets or datagrams. It also hides the packet routing
details from the upper layer, i.e., the application layer. In addition, the transport layer allows detection
and correction of errors and helps to achieve end-to-end communication between devices. The
transport layer connects the application layer to the network layer through two protocols, namely,
TCP and UDP.
∑ Network layer The network layer is also known as Internetworking layer or IP layer. It contains
three protocols that perform different functions. The three protocols of Network layer are as follows:
a. Internet Protocol (IP) IP is a connectionless protocol that is responsible for the delivery of
packets. The IP protocol contains all the address and control information for each transmitted packet.
b. Internet Control Message Protocol (ICMP) The ICMP protocol is responsible for
reporting errors, sending error messages and controlling the flow of packets. It is more reliable
than the IP as it is capable of determining errors during data transmission.

appn layer:
Line Printer Daemon (LPD) protocol do print jobs
The Internet and World Wide Web 391

c. Address Resolution Protocol (ARP) It is responsible for determining the Media Access
Control (MAC) address corresponding to an IP address. It sends an ARP request on the network
for a particular IP address and the device, which identifies the IP address as its own, returns an
ARP reply along with its MAC address.
∑ Physical layer The physical layer is responsible for collecting packets so that the frames, which
are transmitted on the network, can be formed. It performs all the functions required to transmit the
data on the network and determines the ways for accessing the medium through which data will
be transmitted. This layer does not contain any protocols but instead of protocols, it contains some
standards such as RS-232C, V.35 and IEEE 802.3.

15.9.2 OSI Model


Open System Interconnection (OSI) is a layered design that defines the
functions of the protocols used in a computer network. It consists of
seven layers where each layer provides some services to the next layer.
Figure 15.10 shows the seven layers of OSI model.
The seven layers of the OSI model and the functions performed by them
are as follows:
∑ Application layer The application layer provides an interface
through which users can communicate and transfer data on the
network.
∑ Presentation layer The presentation layer determines the way in
which the data is presented to different computers. It converts the data
into a particular format, which is supported by a specific computer.
It is also responsible for encrypting, decrypting, compressing and
decompressing of data.
∑ Session layer The session layer manages the communication
between the computers on the network. This layer is responsible for
notifying the errors, which may have occurred in the layers above it. It
is also responsible for setting up and breaking the connection between
the computers or devices.
∑ Transport layer The transport layer is responsible for the delivery
of packets in a proper sequence. It also provides proper rectification of
errors and manages the flow of packets over the network. This layer Fig. 15.10 OSI model
ensures that data is properly delivered at the destination. It also keeps
track of all the packets, which fail to reach the destination, and transmits them again.
∑ Network layer The network layer is responsible for identifying the ways in which the data is
transmitted over the network from one device to another. It prevents the overloading of packets on the
network and maintains the proper flow so that all the resources on the network can be used efficiently
by all. The network layer directs the packets to the destination device on the basis of the IP address
of the device. It detects the errors, which occur during the transmission of packets. This layer is also
responsible for breaking the large size packets into smaller packets when the device is unable to
accept the packets due to their large size.
392 Fundamentals of Computers

∑ Data link layer The data link layer specifies the actions, which must be performed to maintain the
network communication. It collects the packets to form frames, which are then transmitted over the
network. It also finds out and then corrects the errors, which occur during the transmission of packets.
∑ Physical layer The physical layer describes all the physical requirements for the transmission of
data between devices on a network. For example, the physical layer can specify the layout of pins,
hubs and cables. This layer defines the relation between a single device and the transmission medium.
It specifies the way in which a device must transmit data and also the way in which another device
must receive data. This layer is responsible for the setting up and ending up of a network connection.

Chapter Summary
A collection of networks in which a large number of computers are connected to each other is known as the Internet.
The Internet marked its beginning with a network known as ARPAnet which was developed at Advanced Research
Projects Agency (ARPA) of the U S in 1969. The first protocol used on the ARPAnet was TCP/IP. From 1975 to
1982, different scientists developed many new networks, such as Telnet, Usenet and Eunet. All these continuous
developments led to the eventual development of the Internet.
The Internet can be used to gather information on a wide variety of topics. Today the Internet is used in many
fields such as business, education and entertainment. In business, the most popular use of the Internet is e-business
through which an organisation and a consumer can communicate with each other and perform business transactions.
In education field, the students use discussion forums and newsgroups on the Internet to gain specific information.
The internet also extends its application in communication field by providing services such as e-mail and instant
messaging through which a person at one location can communicate to another person located at a remote place.
The Internet also provides entertainment through games, music and movies.
To access the Internet and the WWW, the user requires a software known as web browser. Some commonly used
web browsers are IE, Netscape Navigator and Mozilla Firefox. To gather information from the Internet, a user has to
search for the information on the Internet. This is done with the help of search engines provided on the Internet. The
most commonly used search engines are www.google.com, www.altavista.com and www.askjeeves.com.

Multimedia in information technology refers to use of more than one of these media for
Key Terms to Remember information presentation to users

∑ Internet: The Internet is a large network of computers placed at different locations around the world that are
connected to each other through telephone lines and satellites.
∑ WWW: The WWW is a collection of interlinked hypertext documents stored on computers all around the world.
∑ Web page: Web page is a formatted document stored on a web server that can be accessed to gather information.
∑ Web server: Web server is a computer that contains the web pages corresponding to the websites available on the
Internet.
∑ Web browser: Web browser is a software, which is used to access the Internet and the WWW.
∑ Search engines: Search engines are websites, which provide the users the facility of searching for information
related to some topic.
∑ Email: Email is a service provided by the Internet that allows two persons in remote places to communicate with
each other.
∑ ISP: An ISP is an organisation that provides the Internet connection services to people who want to use Internet.
∑ Hypertext: Hypertext is that text on a web page which when clicked provides an access to the other web pages.

Animation deals with displaying a sequence of images at


a reasonable speed to create an impression of
movement

is commonly used in those instances where


videography is not possible
The Internet and World Wide Web 393

∑ Gateway: Gateway is a computer, which contains all the software required for the transmission of data over
different networks.
∑ Protocol: Protocol is the set of rules and methods that are to be followed to transfer data from one computer to
another on a network.
∑ IP (Internet Protocol): IP is a protocol that is responsible for the routing of data on the network.

Review Questions

Fill in the Blanks

1. _________ provides the facility of information sharing and communication between users.
2. WWW refers to _________ __________ ___________.
3. Each web page is accessed on a network using ___________.
4. _________ was the network founded at the Advanced Research Projects Agency (ARPA) of United States in
1969.
5. ARPAnet used the concept of _____________ to transfer the data from one computer to another.
6. The methods and the rules followed to transfer data on a network are known as __________.
7. __________ is the unique address of a computer on the network.
8. __________ is a network, which provides mail and news services to the users.
9. __________ converts domain names to corresponding IP addresses.
10. __________ refers to the business transactions conducted on the Internet.
11. __________ service of the Internet is used to perform real-time communication on the Internet.
12. __________ allows the users to search for some information on the Internet.
13. An email message consists of two sections __________ and ____________.
14. The web pages are designed with the help of ________________.
15. XML User Interface (XUL) supports features such as __________ and ____________.
16. The TCP/IP model contains four layers, which are _________, _________, _________ and _________.
17. The two types of web browsers are ________ and _________.
18. An OSI model is also referred as ______________.

Multiple Choice Questions

1. Which of the services of Internet allows the users to gather information from the Internet?
A. Email B. Discussion forums C. WWW D. Instant messaging
2. What is the address of a computer on a network known as?
A. URL B. IP address C. Host D. Domain name
3. When was the ARPAnet developed?
A. 1945 B. 1967 C. 1969 D. 1959
4. Which type of e-business transactions take place on the e-bay website?
A. B2B B. B2C C. C2C D. C2B
394 Fundamentals of Computers

5. Which of the following allows the users to share articles on the Internet?
A. Newsgroups B. Email C. Instant messaging D. None of the above
6. What is the name of the procedure followed before allowing a user to use email services?
A. Check in B. Login C. Set in D. None of the above
7. Which service of the Internet provides real-time communication?
A. Email B. Newsgroup C. Instant messaging D. MUD
8. Which of the following tasks can be performed using the Internet?
A. Book air tickets B. Shop for clothing
C. Check the bank statement D. All of the above
9. Which of the following are mentioned in a URL?
A. Domain name B. IP address C. Hypertext D. None of the above
10. Which of the following are the most commonly used search engines?
A. www.google.search.com B. www.yahoo.com
C. www.search.yahoo.com D. www.search. google.com
11. Which of the following are the sections of an email message?
A. Address B. Message C. Header D. Footer
12. At which layer of the TCP/IP model IP, ICMP and ARP protocols function?
A. Physical layer B. Application layer C. Network layer D. Transport layer
13. How many layers are there in a TCP/IP model?
A. 2 layers B. 5 layers C. 7 layers D. 4 layers
14. Which of the following are the protocols that work at the application layer of the TCP/IP model?
A. FTP B. SMTP C. IP D. ARP
15. How many layers does an OSI model contain?
A. 2 layers B. 5 layers C. 7 layers D. 4 layers
16. Which layer in the OSI model prevents the overloading of packets on the network?
A. Data link layer B. Application layer C. Network layer D. Session layer
17. Which of the following are the examples of a web browser?
A. Net navigator B. Mozilla foxfire
C. IE D. Netscape communicator
18. What is the function of a DNS?
A. To convert domain names into IP addresses B. To convert IP addresses into domain names
C. Both A and B D. None of the above
19. Which layer in a TCP/IP model does not contain any protocols?
A. Transport layer B. Application layer C. Network layer D. Physical layer
20. The term ISP stands for?
A. Information System Protocol B. Internet System Protocol
C. Internet Service Provider D. Information Service Provider

You might also like