Book Intro To Cs
Book Intro To Cs
Book Intro To Cs
1
Computer Science
Computer science is the study of information, protocols and algorithms for idealized
and real automata.
2
Computer Science
algorithms and the practical problems that exist in implementing them through
computer software and hardware.
A computer terminal is not some clunky old television with a typewriter in front of it.
It is an interface where the mind and body can connect with the universe and move
bits of it about. "Douglas Adams".
Computers exist in a wide range of forms, and thousands of computers are hidden in
devices we use every day but don’t think of as computers such as cars, phones, TVs,
microwave ovens, and access cards. Our primary focus is on universal computers,
which are computers that can perform all possible mechanical computations on
discrete inputs except for practical limits on space and time
3
Computer Science
Computer - Overview
4
Computer Science
Computer - Overview
Today’s world is an information-rich world and it has become a necessity for everyone to know
about computers. A computer is an electronic data processing device, which accepts and stores
data input, processes the data input, and generates the output in a required format.
The purpose of this tutorial is to introduce you to Computers and its fundamentals.
Functionalities of a Computer
If we look at it in a very broad sense, any digital computer carries out the following five
functions −
Step 2 − Stores the data/instructions in its memory and uses them as required.
Advantages of Computers
Following are certain advantages of computers.
High Speed
5
Computer Science
Accuracy
Storage Capability
Diligence
Unlike human beings, a computer is free from monotony, tiredness, and lack of
concentration.
It can work continuously without any error and boredom.
It can perform repeated tasks with the same speed and accuracy.
Versatility
Reliability
Automation
6
Computer Science
The use of computers for data processing in an organization leads to reduction in paper work
and results in speeding up the process.
As data in electronic files can be retrieved as and when required, the problem of maintenance
of large number of paper files gets reduced.
Though the initial investment for installing a computer is high, it substantially reduces the
cost of each of its transaction.
Disadvantages of Computers
Following are certain disadvantages of computers.
No I.Q.
Dependency
Environment
The operating environment of the computer should be dust free and suitable.
No Feeling
7
Computer Science
Computer - Applications
Business
A computer has high speed of calculation, diligence, accuracy, reliability, or versatility which
has made it an integrated part in all business organizations.
Payroll calculations
Budgeting
Sales analysis
Financial forecasting
Managing employee database
Maintenance of stocks, etc.
Banking
8
Computer Science
Online accounting facility, which includes checking current balance, making deposits and
overdrafts, checking interest charges, shares, and trustee records.
ATM machines which are completely automated are making it even easier for customers to
deal with banks.
Insurance
Insurance companies are keeping all records up-to-date with the help of computers. Insurance
companies, finance houses, and stock broking firms are widely using computers for their
concerns.
Insurance companies are maintaining a database of all clients with information showing −
9
Computer Science
Education
The computer provides a tool in the education system known as CBE (Computer Based
Education).
CBE involves control, delivery, and evaluation of learning.
Computer education is rapidly increasing the graph of number of computer students.
There are a number of methods in which educational institutions can use a computer to
educate the students.
It is used to prepare a database about performance of a student and analysis is carried out on
this basis.
Marketing
In marketing, uses of the computer are following −
Advertising − With computers, advertising professionals create art and graphics, write and
revise copy, and print and disseminate ads with the goal of selling more products.
Home Shopping − Home shopping has been made possible through the use of computerized
catalogues that provide access to product information and permit direct entry of orders to be
filled by the customers.
10
Computer Science
Healthcare
Computers have become an important part in hospitals, labs, and dispensaries. They are being
used in hospitals to keep the record of patients and medicines. It is also used in scanning and
diagnosing different diseases. ECG, EEG, ultrasounds and CT scans, etc. are also done by
computerized machines.
Following are some major fields of health care in which computers are used.
Diagnostic System − Computers are used to collect data and identify the cause of illness.
Lab-diagnostic System − All tests can be done and the reports are prepared by computer.
Patient Monitoring System − These are used to check the patient's signs for abnormality such
as in Cardiac Arrest, ECG, etc.
Pharma Information System − Computer is used to check drug labels, expiry dates, harmful
side effects, etc.
Surgery − Nowadays, computers are also used in performing surgery.
Engineering Design
Computers are widely used for Engineering purpose.
One of the major areas is CAD (Computer Aided Design) that provides creation and
modification of images. Some of the fields are −
11
Computer Science
Structural Engineering − Requires stress and strain analysis for design of ships, buildings,
budgets, airplanes, etc.
Industrial Engineering − Computers deal with design, implementation, and improvement of
integrated systems of people, materials, and equipment.
Architectural Engineering − Computers help in planning towns, designing buildings,
determining a range of buildings on a site using both 2D and 3D drawings.
Military
Computers are largely used in defense. Modern tanks, missiles, weapons, etc. Military also
employs computerized control systems. Some military areas where a computer has been used are
−
Missile Control
Military Communication
Military Operation and Planning
Smart Weapons
12
Computer Science
Communication
Communication is a way to convey a message, an idea, a picture, or speech that is received and
understood clearly and correctly by the person for whom it is meant. Some main areas in this
category are −
E-mail
Chatting
Usenet
FTP
Telnet
Video-conferencing
Government
Computers play an important role in government services. Some major fields in this category are
−
Budgets
Sales tax department
Income tax department
Computation of male/female ratio
Computerization of voters lists
Computerization of PAN card
Weather forecasting
13
Computer Science
Computer - Types
PC (Personal Computer)
A PC can be defined as a small, relatively inexpensive computer designed for an individual user.
PCs are based on the microprocessor technology that enables manufacturers to put an entire CPU
on one chip. Businesses use personal computers for word processing, accounting, desktop
publishing, and for running spreadsheet and database management applications. At home, the
most popular use for personal computers is playing games and surfing the Internet.
Although personal computers are designed as single-user systems, these systems are normally
linked together to form a network. In terms of power, now-a-days high-end models of the
Macintosh and PC offer the same computing power and graphics capability as low-end
workstations by Sun Microsystems, Hewlett-Packard, and Dell.
14
Computer Science
Workstation
Workstations generally come with a large, high-resolution graphics screen, large amount of
RAM, inbuilt network support, and a graphical user interface. Most workstations also have mass
storage device such as a disk drive, but a special type of workstation, called diskless workstation,
comes without a disk drive.
Common operating systems for workstations are UNIX and Windows NT. Like PC, workstations
are also single-user computers like PC but are typically linked together to form a local-area
network, although they can also be used as stand-alone systems.
Minicomputer
It is a midsize multi-processing system capable of supporting up to 250 users simultaneously.
Mainframe
Mainframe is very large in size and is an expensive computer capable of supporting hundreds or
even thousands of users simultaneously. Mainframe executes many programs concurrently and
supports many simultaneous execution of programs.
15
Computer Science
Supercomputer
Supercomputers are one of the fastest computers currently available. Supercomputers are very
expensive and are employed for specialized applications that require immense amount of
mathematical calculations (number crunching).
For example, weather forecasting, scientific simulations, (animated) graphics, fluid dynamic
calculations, nuclear energy research, electronic design, and analysis of geological data (e.g. in
petrochemical prospecting).
Computer - Components
All types of computers follow the same basic logical structure and perform the following five
basic operations for converting raw input data into information useful to their users.
16
Computer Science
Input Unit
This unit contains devices with the help of which we enter data into the computer. This unit
creates a link between the user and the computer. The input devices translate the information into
a form understandable by the computer.
17
Computer Science
Output Unit
The output unit consists of devices with the help of which we get the information from the
computer. This unit is a link between the computer and the users. Output devices translate the
computer's output into a form understandable by the users.
18
Computer Science
Its size affects speed, power, and capability. Primary memory and secondary memory are two
types of memories in the computer. Functions of the memory unit are −
It stores all the data and the instructions required for processing.
It stores intermediate results of processing.
It stores the final results of processing before these results are released to an output device.
All inputs and outputs are transmitted through the main memory.
Control Unit
This unit controls the operations of all parts of the computer but does not carry out any actual
data processing operations.
It is responsible for controlling the transfer of data and instructions among other units of a
computer.
It manages and coordinates all the units of the computer.
It obtains the instructions from the memory, interprets them, and directs the operation of the
computer.
It communicates with Input/Output devices for transfer of data or results from storage.
It does not process or store data.
19
Computer Science
Arithmetic Section
Logic Section
Arithmetic Section
Logic Section
Function of logic section is to perform logic operations such as comparing, selecting, matching,
and merging of data.
Following are some of the important input devices which are used in a computer −
Keyboard
Mouse
Joy Stick
Light pen
Track Ball
Scanner
Graphic Tablet
Microphone
Magnetic Ink Card
Reader(MICR)
Optical Character
Reader(OCR)
Bar Code Reader
Optical Mark
Reader(OMR)
20
Computer Science
Monitors
Plotters
Printer (All types)
Projector
Speaker(s)
LCD Projection Panels
Computer Output Microfilm (COM)
Note Basic types of monitors are a.Cathode Ray Tube (CRT). B. Liquid Crystal Displays
(LCD).
C.light-emitting diode (LED).
Printer types: 1-Laser Printer. 2-Ink Jet Printer. 3-Dot Matrix Printer
Computer - Memory
memory is just like a human brain. It is used to store data and instructions. Computer memory is
the storage space in the computer, where data is to be processed and instructions required for
processing are stored. The memory is divided into large number of small parts called cells. Each
location or cell has a unique address, which varies from zero to memory size minus one. For
example, if the computer has 64k words, then this memory unit has 64 * 1024 = 65536 memory
locations. The address of these locations varies from 0 to 65535.
21
Computer Science
Cache Memory
Primary Memory/Main Memory
Secondary Memory
Cache Memory
Cache memory is a very high speed semiconductor memory which can speed up the CPU. It acts
as a buffer between the CPU and the main memory. It is used to hold those parts of data and
program which are most frequently used by the CPU. The parts of data and programs are
transferred from the disk to cache memory by the operating system, from where the CPU can
access them.
Advantages
Disadvantages
22
Computer Science
Secondary Memory
This type of memory is also known as external memory or non-volatile. It is slower than the
main memory. These are used for storing data/information permanently. CPU directly does not
access these memories, instead they are accessed via input-output routines. The contents of
secondary memories are first transferred to the main memory, and then the CPU can access it.
For example, disk, CD-ROM, DVD, etc.
23
Computer Science
A computer word, like a byte, is a group of fixed number of bits processed as a unit, which
4
varies from computer to computer but is fixed for each computer.
The length of a computer word is called word-size or word length. It may be as small as 8
24
Computer Science
bits or may be as long as 96 bits. A computer stores the information in the form of
computer words.
25
Computer Science
Computer - Hardware
Hardware represents the physical and tangible components of a computer, i.e. the components
that can be seen and touched.
26
Computer Science
Computer - Software
Software is a set of programs, which is designed to perform a well-defined function. A program
is a sequence of instructions written to solve a particular problem.
System Software
Application Software
System Software
The system software is a collection of programs designed to operate, control, and extend the
processing capabilities of the computer itself. System software is generally prepared by the
computer manufacturers. These software products comprise of programs written in low-level
languages, which interact with the hardware at a very basic level. System software serves as the
interface between the hardware and the end users.
Some examples of system software are Operating System, Compilers, Interpreter, Assemblers,
etc.
27
Computer Science
Application Software
Application software products are designed to satisfy a particular need of a particular
environment. All software applications prepared in the computer lab can come under the
category of Application software.
Application software may consist of a single program, such as Microsoft's notepad for writing
and editing a simple text. It may also consist of a collection of programs, often called a software
package, which work together to accomplish a task, such as a spreadsheet package.
Payroll Software
Student Record Software
Inventory Management Software
Income Tax Software
Railways Reservation Software
Microsoft Office Suite Software
Microsoft Word
Microsoft Excel
Microsoft PowerPoint
28
Computer Science
29
Computer Science
Regardless of their physical representations, these 0s and 1s are commonly referred to as bits, a
computing term derived from the phrase binary digits. A bit is the smallest unit of data that a
binary computer can recognize. Therefore, the input you enter via a keyboard, the software
program you use to play your music collection, the term paper stored on your USB flash drive,
and the digital photos located on your mobile phone are all just groups of bits. Representing data
in a form that can be understood by a digital computer is called digital data representation.
Because most computers can only understand data and instructions in binary form, binary can be
thought of as the computer’s natural language. People, of course, do not speak in binary. For
example, you are not likely to go up to a friend and say,
0100100001001001
which translates into the word “HI” using one binary coding system. People communicate with
one another in their natural languages, such as English, Chinese, Spanish, and French. For
example, this book is written in English, which uses a 26-character alphabet. In addition, most
countries use a numbering system with 10 possible symbols—0 through 9. As already
mentioned, however, binary computers understand only 0s and 1s. For us to interact with a
computer, a translation process from our natural language to 0s and 1s and then back again to our
natural language is required. When we enter data into a computer system, the computer translates
30
Computer Science
the natural-language symbols we input into binary 0s and 1s. After processing the data, the
computer translates and outputs the resulting information in a form that we can understand.
A bit by itself typically represents only a fraction of a piece of data. Consequently, large
numbers of bits are needed to represent a written document, computer program, digital photo,
music file, or virtually any other type of data. Eight bits grouped together are collectively
referred to as a byte. It is important to be familiar with this concept because byte terminology is
frequently used in a variety of computer contexts, such as to indicate the size of a document or
digital photo, the amount of memory a computer has, or the amount of room left on a storage
medium. Because these quantities often involve thousands or millions of bytes, prefixes are
commonly used in conjunction with the term byte to represent larger amounts of data. For
instance, a kilobyte (KB) is equal to 1,024 bytes, but is usually thought of as approximately
1,000 bytes; a megabyte (MB) is about 1 million bytes; a gigabyte (GB) is about 1 billion bytes;
a terabyte (TB) is about 1 trillion bytes; a petabyte (PB) is about 1,000 terabytes.
Computers represent programs and data through a variety of binary-based coding systems. The
coding system used depends primarily on the type of data that needs to be represented; the most
common coding systems are discussed in the next few sections.
The digit
The position of the digit in the number
The base of the number system (where the base is defined as the total number of digits available
in the number system)
31
Computer Science
In both numbering systems, the position of each digit determines the power, or exponent, to
which the base number (10 for decimal or 2 for binary) is raised. In the decimal numbering
system, going from right to left, the first position or column (the ones column) represents 100 or
1; the second column (the tens column) represents 101 or 10; the third column (the hundreds
32
Computer Science
column) represents 102 or 100; and so forth. Therefore, as the previous figure shows, the
decimal number 7,216 is understood as 7 × 103 + 2 ×102 + 1 × 10l + 6 × 100 or 7,000 + 200 + 10
+ 6 or 7,216. In binary, the concept is the same but the columns have different place values. For
example, the far-right column is the ones column (for 20), the second column is the twos column
(21), the third column is the fours column (22), and so on. Therefore, although 1001 represents
“one thousand one” in decimal notation, 1001 represents “nine” (1 × 23 + 0 × 22 + 0 × 21 + 1 × 20
or 8 + 0 + 0 + 1 or 9) in the binary numbering system, as illustrated in the lower half of the
previous figure.
Example
33
Computer Science
Example
Example
Binary
Step Decimal Number
Number
Step 1 19FDE16 ((1 x 164) + (9 x 163) + (F x 162) + (D x 161) + (E x 160))10
34
Computer Science
Step 2 19FDE16 ((1 x 164) + (9 x 163) + (15 x 162) + (13 x 161) + (14 x 160))10
Step 3 19FDE16 (65536+ 36864 + 3840 + 208 + 14)10
Step 4 19FDE16 10646210
Step 2 − Multiply the obtained column values (in Step 1) by the digits in the corresponding
columns.
Step 3 − Sum the products calculated in Step 2. The total is the equivalent value in decimal.
Example
35
Computer Science
Step 2 − Get the remainder from Step 1 as the rightmost digit (least significant digit) of the new
base number.
Step 3 − Divide the quotient of the previous divide by the new base.
Step 4 − Record the remainder from Step 3 as the next digit (to the left) of the new base number.
Repeat Steps 3 and 4, getting remainders from right to left, until the quotient becomes zero in
Step 3.
The last remainder thus obtained will be the Most Significant Digit (MSD) of the new base
number.
36
Computer Science
As mentioned in Steps 2 and 4, the remainders have to be arranged in the reverse order so that
the first remainder becomes the Least Significant Digit (LSD) and the last remainder becomes
the Most Significant Digit (MSD).
37
Computer Science
The conversion of a decimal fraction to binary is accomplished by a method similar to that used
for integers. However, multiplication is used instead of division, and integers instead of
remainders are accumulated. Again, the method is best explained by example.
Step 2 − Convert the decimal number so obtained to the new base number.
38
Computer Science
Step 2 − Convert each group of three binary digits to one octal digit.
Example
39
Computer Science
Step 2 − Combine all the resulting binary groups (of 3 digits each) into a single binary number.
Example
Step 2 − Convert each group of four binary digits to one hexadecimal symbol.
Step 2 − Combine all the resulting binary groups (of 4 digits each) into a single binary number.
Example
41
Computer Science
Complements
Complements are used in digital computers for simplifying the subtraction operation and for logical
manipulation. Simplifying operations leads to simpler, less expensive circuits to implement the
operations. There are two types of complements for each base-r system: the radix complement and the
diminished radix complement. The first is referred to as the r's complement and the second as the (r-1)'s
complement. When the value of the base r is substituted in the name, the two types are referred to as the
2‘s complement and 1‘s complement for binary numbers, and the 10‘s complement and 9‘s complement
for decimal numbers.
For example, if n = 4, we have 104= 10,000 and 104- 1 = 9999. It follows that the 9’s
complement of a decimal number is obtained by subtracting each digit from 9.Here are some
numerical examples:
42
Computer Science
. Thus, the 1’s complement of a binary number is obtained by subtracting each digit from 1.
However, when subtracting binary digits from 1, we can have either 1 - 0 = 1 o r 1 - 1 = 0,
which causes the bit to change from 0 to 1 or from 1 to 0, respectively. Therefore, the 1’s
complement of a binary number is formed by changing 1’s to 0’s and 0’s to 1’s. The
following are some numerical examples:
The (r - 1)'s complement of octal or hexadecimal numbers is obtained by subtracting each digit
from 7 or F (decimal 15), respectively.
Radix Complement
The r’s complement of an n-digit number N in base r is defined as rn - N for N ≠ 0 and as 0 for
N = 0. Comparing with the (r - 1)'s complement, we note that the r’s complement is obtained by
adding 1 to the (r - 1)'s complement, since rn - N = [(rn- 1) - N] + 1. Thus, the 10’s complement
of decimal 2389 is 7610 + 1 = 7611 and is obtained by adding 1 to the 9’s complement value.The
2’s complement of binary 101100 is 010011 + 1 = 010100 and is obtained by adding 1 to the 1’s-
complement value.
and
The 10’s complement of the first number is obtained by subtracting 8 from 10 in the least
significant position and subtracting all other digits from 9. The 10’s complement of the second
number is obtained by leaving the two least significant 0’s unchanged, subtracting 7 from 10,
and subtracting the other three digits from.
Similarly, the 2’s complement can be formed by leaving all least significant 0’s and the first 1
unchanged and replacing 1’s with 0’s and 0’s with 1’s in all other higher significant digits. For
example,
The 2’s complement of 1101100 is 0010100
and
43
Computer Science
The 2’s complement of the first number is obtained by leaving the two least significant 0’s and
the first 1 unchanged and then replacing 1’s with 0’s and 0’s with 1’s in the other four most
significant digits. The 2’s complement of the second number is obtained by leaving the least
significant 1 unchanged and complementing all other digits.
In the previous definitions, it was assumed that the numbers did not have a radix point. If the
original number N contains a radix point, the point should be removed temporarily in order to
form the r’s or (r - 1)'s complement. The radix point is then restored to the complemented
number in the same relative position. It is also worth mentioning that the complement of the
complement restores the number to its original value. To see this relationship, note that the
r’s complement of N is rn- N, so that the complement of the complement is rn- (rn- N) = N and
is equal to the original number.
Another way of obtaining the 2’s complement of a binary number is to start with the LSB
(the rightmost bit) and leave the bits unchanged until you find the first 1. Leave the first 1
unchanged and complement the rest of the bits (change 0 to 1 and 1 to 0).
Example
44
Computer Science
sign-magnitude
1’s complement
2’s complement.
Sign-Magnitude
o for an n-bit number, the range of values that could be represented using sign-magnitude
notation is from
–(2n-1-1) to +(2n-1-1).
o For example if n=8 the range is from –127 to 127
45
Computer Science
30 = 00011110
-30 = 11100001
o the number equals the 1’s complement of 30
121 = 01111001
-121 = 10000110
99 = 01100011
–(2n-1-1) to +(2n-1-1).
o exactly the same as the range of numbers in sign-magnitude
o For example if n=8 the range is from –127 to 127
46
Computer Science
30 = 00011110
-30 = 11100010
o the number equals the 2’s complement of 30
121 = 01111001
-121 = 10000111
99 = 01100011
–(2n-1) to +(2n-1-1)
if n=8 the range is from –128 to 127
Positive and negative numbers in the 2's complement system are evaluated by summing the
weights in all bit positions where there are 1s and ignoring those positions where there are
zeros.
The weight of the sign bit in a negative number is given a negative value
Example
01010110 = 64 + 16 + 4 + 2 = +86
-27 26 25 24 23 22 21 2°
0 1 0 1 0 1 1 0
47
Computer Science
Binary Addition
1 1 1 1 1 1 1 1 1 1
0 0 1 1 1 1 1 1 1 1 1 0 1 1 0 1
0 1 1 1 1 1 0 0 0 1 0 0 0 0 1 1
1 0 1 1 1 0 1 1 1 0 0 1 1 0 0 0 0
11101101 + 01000011 = 100110000 This example shows that the result could not fit in 8-bits (
237 + 67 = 304) and the maximum capacity of 8-bits is 255. That is what we call overflow.
Binary Subtraction
0 10 0 10
1 0 1 1 1 1 1 1 1 1 1 0 1 1 0 1
0 1 1 1 1 1 0 0 0 1 0 0 0 0 1 1
0 1 0 0 0 0 1 1 1 0 1 0 1 0 1 0
Binary Multiplication
48
Computer Science
1 1 1 0 0 1 1 0 1 1
1 0 1 1 1 0 1
1 1 1 0 0 1 1 0 1 1
0 0 0 0 0 0 0 0 0 0
1 1 1 0 0 1 1 0 1 1
1 0 0 0 1 1 0 0 1 1 0 1 1
1 0 1 0 1 1 1 1 1
Binary Division
Addition
49
Computer Science
Overflow Condition
o When two numbers are added and the number of bits required to represent the sum
exceeds the number of bits in the two numbers, an overflow results
o incorrect sign bit
o only when both numbers are positive or both numbers are negative
The subtraction of two n -digit unsigned numbers M-N in base r can be done as follows:
50
Computer Science
(b) Y = 1000011
2's complement of X = + 0101100
Sum = 1101111
There is no end carry. Therefore, the answer is Y - X = -(2's complement of 1101111) =-0010001
Subtraction of unsigned numbers can also be done by means of the (r - 1)'s complement.
Remember that the (r- 1)'s complement is one less than the r’s complement. Because of this, the
result of adding the minuend to the complement of the subtrahend produces a sum that is one less
than the correct difference when an end carry occurs. Removing the end carry and adding 1 to
the sum is referred to as an end‐around carry.
A) 00001000-00000011 B) 00001100-11110111
C)11100111-00010011 D) 10001000-11100010
51
Computer Science
E) 10001000 – 11100010
-120 - (-30) = -120 + 30 = -90
10001000 Minuend (-120)
+ 00011110 2's complement of subtrahend (+30)
10100110 Difference (-90)
Although the binary number system is the most natural system for a computer because it is
readily represented in today’s electronic technology, most people are more accustomed to the
decimal system. One way to resolve this difference is to convert decimal numbers to binary,
perform all arithmetic calculations in binary, and then convert the binary results back to decimal.
This method requires that we store decimal numbers in the computer so that they can be
converted to binary. Since the computer can accept only binary values, we must represent the
decimal digits by means of a code that contains 1’s and 0’s. It is also possible to perform the
arithmetic operations directly on decimal numbers when they are stored in the computer in coded
form.
A binary code will have some unassigned bit combinations if the number of elements in the set is
not a multiple power of 2. The 10 decimal digits form such a set. A binary code that
distinguishes among 10 elements must contain at least four bits, but 6 out of the 16 possible
combinations remain unassigned. Different binary codes can be obtained by arranging four bits
into 10 distinct combinations. The code most commonly used for the decimal digits is the
straight binary assignment listed in the next Table. This scheme is called binary‐coded decimal
and is commonly referred to as BCD. Other decimal codes are possible and a few of them are
presented later in this section.
The next Table gives the four‐bit code for one decimal digit. A number with k decimal digits will
require 4k bits in BCD. Decimal 396 is represented in BCD with 12 bits as 0011 1001 0110, with
each group of 4 bits representing one decimal digit. A decimal number in BCD is the same as
its equivalent binary number only when the number is between 0 and 9. A BCD number greater
than 10 looks different from its equivalent binary number, even though both contain 1’s and 0’s.
Moreover, the binary combinations 1010 through 1111 are not used and have no meaning in
BCD. Consider decimal 185 and its corresponding value in BCD and binary:
52
Computer Science
Binary coded decimal (BCD) is used to represent each of the ten decimal digits as a 4-bit binary
code.
53
Computer Science
In each case, the two BCD digits are added as if they were two binary numbers. If the binary
sum is greater than or equal to 1010, we add 0110 to obtain the correct BCD sum and a carry. In
the first example, the sum is equal to 9 and is the correct BCD sum. In the second example, the
binary sum produces an invalid BCD digit. The addition of 0110 produces the correct BCD sum,
0010 (i.e., the number 2), and a carry. In the third example, the binary sum produces a carry.
This condition occurs when the sum is greater than or equal to 16. Although the other four bits
are less than 1001, the binary sum requires a correction because of the carry. Adding 0110, we
obtain the required BCD sum 0111 (i.e., the number 7) and a BCD carry.
The addition of two n- digit unsigned BCD numbers follows the same procedure.
Consider the addition of 184 + 576 = 760 in BCD:
BCD 11
0001 1000 0100 184
+0101 0111 0110 +576
Binary sum 0111 10000 1010
Add 6 0110 0110
BCD sum 0111 0110 0000 760
The first, least significant pair of BCD digits produces a BCD digit sum of 0000 and a carry for
the next pair of digits. The second pair of BCD digits plus a previous carry produces a digit sum
of 0110 and a carry for the next pair of digits. The third pair of digits plus a carry produces a
binary sum of 0111 and does not require a correction.
54
Computer Science
55
Computer Science
Data is represented with the help of characters such as alphabets (A-Z, a-z), digits (0-9) or
special characters (+,-,/,*,<,>,= etc.)
What is Information?
Information is organized or classified data, which has some meaningful values for the receiver.
Information is the processed data on which decisions and actions are based.
For the decision to be meaningful, the processed data must qualify for the following
characteristics −
56
Computer Science
Input − In this step, the input data is prepared in some convenient form for processing. The form
will depend on the processing machine. For example, when electronic computers are used, the
input data can be recorded on any one of the several types of input medium, such as magnetic
disks, tapes, and so on.
Processing − In this step, the input data is changed to produce data in a more useful form. For
example, pay-checks can be calculated from the time cards, or a summary of sales for the month
can be calculated from the sales orders.
Output − At this stage, the result of the proceeding processing step is collected. The particular
form of the output data depends on the use of the data. For example, output data may be pay-
checks for employees.
Computer - Networking
computer network is a system in which multiple computers are connected to each other to share
information and resources.
57
Computer Science
Network Cables
Distributors
Routers
Internal Network Cards
External Network Cards
An operating system is a program that acts as an interface between the software and the
computer hardware.
It is an integrated set of specialized programs used to manage overall resources and operations of
the computer.
It is a specialized software that controls and monitors the execution of all other programs that
reside in the computer, including application programs and other system software.
To act as an intermediary between the hardware and its users, making it easier for the users to
access and use other resources.
To manage the resources of a computer system.
To keep track of who is using which resource, granting resource requests, and mediating
conflicting requests from different programs and users.
To provide efficient and fair sharing of resources among users and programs.
Memory Management − Keeps track of the primary memory, i.e. what part of it is in use by
whom, what part is not in use, etc. and allocates the memory when a process or program requests
it.
Processor Management − Allocates the processor (CPU) to a process and deallocates the
processor when it is no longer required.
Device Management − Keeps track of all the devices. This is also called I/O controller that
decides which process gets the device, when, and for how much time.
File Management − Allocates and de-allocates the resources and decides who gets the
resources.
Security − Prevents unauthorized access to programs and data by means of passwords and other
similar techniques.
Job Accounting − Keeps track of time and resources used by various jobs and/or users.
Control Over System Performance − Records delays between the request for a service and
from the system.
Interaction with the Operators − Interaction may take place via the console of the computer in
the form of instructions. The Operating System acknowledges the same, does the corresponding
action, and informs the operation by a display screen.
Error-detecting Aids − Production of dumps, traces, error messages, and other debugging and
error-detecting methods.
Coordination Between Other Software and Users − Coordination and assignment of
compilers, interpreters, assemblers, and other software to the various users of the computer
systems.
59
Computer Science
GUI OS
GUI is the acronym for Graphical User Interface. An operating system that presents an interface
comprising graphics and icons is called a GUI OS. GUI OS is very easy to navigate and use as
users need not remember commands to be given to accomplish each task. Examples of GUI OS
includes Windows, macOS, Ubuntu, etc.
Time Sharing OS
Operating systems that schedule tasks for efficient processor use are called time sharing OS.
Time sharing, or multitasking, is used by operating systems when multiple users located at
different terminals need processor time to complete their tasks. Many scheduling techniques like
round robin scheduling and shortest job next scheduling are used by time sharing OS.
Real Time OS
An operating system that guarantees to process live events or data and deliver the results within a
stipulated span of time is called a real time OS. It may be single tasking or multitasking.
Distributed OS
An operating system that manages many computers but presents an interface of single computer
to the user is called distributed OS. Such type of OS is required when computational
requirements cannot be met by a single computer and more systems have to be used. User
interaction is restricted to a single system; it’s the OS that distributed work to multiple systems
and then presents the consolidated output as if one computer has worked on the problem at hand.
Windows − Windows is a GUI operating system first developed by Microsoft in 1985. The latest
version of Windows is Windows 10. Windows is used by almost 88% of PCs and laptops
globally.
Linux − Linux is an open source operating system mostly used by mainframes an
supercomputers. Being open source means that its code is available for free and anyone can
develop a new OS based on it.
BOSS − Bharat Operating System Solutions is an Indian distribution of Linux based on Debian,
an OS. It is localized to enable use of local Indian languages. BOSS consists of −
60
Computer Science
o Linux kernel
o Office application suite BharteeyaOO
o Web browser
o Email service Thunderbird
o Chat application Pidgim
o File sharing applications
o Multimedia applications
Mobile OS
An operating system for smartphones, tablets and other mobile devices is called mobile OS.
Some of the most popular OS for mobile devices includes−
Android − This Linux-based OS by Google is the most popular mobile OS currently. Almost
85% of mobile devices use it.
Windows Phone 7 − It is the latest mobile OS developed by Microsoft.
Apple iOS − This mobile OS is an OS developed by Apple exclusively for its own mobile
devices like iPhone, iPad, etc.
Blackberry OS − This is the OS used by all blackberry mobile devices like smartphones and
playbooks.
61
Computer Science
62
Computer Science
There are two types of NIC: wireless NIC and wired NIC.
o Wireless NIC: All the modern laptops use the wireless NIC. In Wireless NIC, a
connection is made using the antenna that employs the radio wave technology.
o Wired NIC: Cables use the wired NIC to transfer the data over the medium.
63
Computer Science
Hub
Hub is a central device that splits the network connection into multiple devices. When computer
requests for information from a computer, it sends the request to the Hub. Hub distributes this
request to all the interconnected computers.
Switches
Switch is a networking device that groups all the devices over the network to transfer the data to
another device. A switch is better than Hub as it does not broadcast the message over the
network, i.e., it sends the message to the device for which it belongs to. Therefore, we can say
that switch sends the message directly from source to the destination.
o Twisted pair cable: It is a high-speed cable that transmits the data over 1Gbps or more.
o Coaxial cable: Coaxial cable resembles like a TV installation cable. Coaxial cable is
more expensive than twisted pair cable, but it provides the high data transmission speed.
o Fibre optic cable: Fibre optic cable is a high-speed cable that transmits the data using
light beams. It provides high data transmission speed as compared to other cables. It is
more expensive as compared to other cables, so it is installed at the government level.
Router
Router is a device that connects the LAN to the internet. The router is mainly used to connect the
distinct networks or connect the internet to multiple computers.
Modem
Modem connects the computer to the internet over the existing telephone line. A modem is not
integrated with the computer motherboard. A modem is a separate part on the PC slot found on
the motherboard.
64
Computer Science
o Peer-To-Peer network
o Client/Server network
65
Computer Science
Peer-To-Peer network
o Peer-To-Peer network is a network in which all the computers are linked together with
equal privilege and responsibilities for processing the data.
o Peer-To-Peer network is useful for small environments, usually up to 10 computers.
o Peer-To-Peer network has no dedicated server.
o Special permissions are assigned to each computer for sharing the resources, but this can
lead to a problem if the computer with the resource is down.
Client/Server Network
o Client/Server network is a network model designed for the end users called clients, to
access the resources such as songs, video, etc. from a central computer known as Server.
66
Computer Science
o The central controller is known as a server while all other computers in the network are
called clients.
o A server performs all the major operations such as security and network management.
o A server is responsible for managing all the resources such as files, directories, printer,
etc.
o All the clients communicate with each other through a server. For example, if client1
wants to send some data to client 2, then it first sends the request to the server for the
permission. The server sends the response to the client 1 to initiate its communication
with the client 2.
67
Computer Science
A computer network can be categorized by their size. A computer network is mainly of four
types:
68
Computer Science
69
Computer Science
Wireless Personal Area Network: Wireless Personal Area Network is developed by simply
using wireless technologies such as WiFi, Bluetooth. It is a low range network.
Wired Personal Area Network: Wired Personal Area Network is created by using the USB.
70
Computer Science
o Geographical area: A Wide Area Network provides a large geographical area. Suppose
if the branch of our office is in a different city then we can connect with them through
WAN. The internet provides a leased line through which we can connect with another
branch.
o Centralized data: In case of WAN network, data is centralized. Therefore, we do not
need to buy the emails, files or back up servers.
o Get updated files: Software companies work on the live server. Therefore, the
programmers get the updated files within seconds.
o Exchange messages: In a WAN network, messages are transmitted fast. The web
application like Facebook, Whatsapp, Skype allows you to communicate with friends.
o Sharing of software and resources: In WAN network, we can share the software and
other resources like a hard drive, RAM.
Internetwork
o An internetwork is defined as two or more computer network LANs or WAN or
computer network segments are connected using devices, and they are configured by a
local addressing scheme. This process is known as internetworking.
o An interconnection between public, private, commercial, industrial, or government
computer networks can also be defined as internetworking.
o An internetworking uses the internet protocol.
71
Computer Science
Types of Internetwork:
1. Extranet: An extranet is a communication network based on the internet protocol such
as Transmission Control protocol and internet protocol. It is used for information sharing.
The access to the extranet is restricted to only those users who have login credentials. An
extranet is the lowest level of internetworking. It can be categorized as MAN, WAN or other
computer networks. An extranet cannot have a single LAN, atleast it must have one connection
to the external network.
What is Topology?
Topology defines the structure of the network of how all the components are interconnected to
each other. There are two types of topology: physical and logical topology.
72
Computer Science
Bus Topology
o The bus topology is designed in such a way that all the stations are connected through a
single cable known as a backbone cable.
o Each node is either connected to the backbone cable by drop cable or directly connected
to the backbone cable.
o When a node wants to send a message over the network, it puts a message over the
network. All the stations available in the network will receive the message whether it has
been addressed or not.
o The bus topology is mainly used in 802.3 (ethernet) and 802.4 standard networks.
o The configuration of a bus topology is quite simpler as compared to other topologies.
Ring Topology
73
Computer Science
Star Topology
o Star topology is an arrangement of the network in which every node is connected to the
central hub, switch or a central computer.
o The central computer is known as a server, and the peripheral devices attached to the
server are known as clients.
o Coaxial cable or RJ-45 cables are used to connect the computers.
o Hubs or Switches are mainly used as connection devices in a physical star topology.
o Star topology is the most popular topology in network implementation.
74
Computer Science
Tree topology
o Tree topology combines the characteristics of bus topology and star topology.
o A tree topology is a type of structure in which all the computers are connected with each
other in hierarchical fashion.
o The top-most node in tree topology is known as a root node, and all other nodes are the
descendants of the root node.
o There is only one path exists between two nodes for the data transmission. Thus, it forms
a parent-child hierarchy.
Mesh topology
75
Computer Science
o It does not contain the switch, hub or any central computer which acts as a central point
of communication.
o The Internet is an example of the mesh topology.
o Mesh topology is mainly used for WAN implementations where communication failures
are a critical concern.
o Mesh topology is mainly used for wireless networks.
o Mesh topology can be formed by using the formula:
Number of cables = (n*(n-1))/2;
o Full Mesh Topology: In a full mesh topology, each computer is connected to all the
computers available in the network.
o Partial Mesh Topology: In a partial mesh topology, not all but certain computers are
connected to those computers with which they communicate frequently.
76
Computer Science
Hybrid Topology
o Effective: Hybrid topology is very effective as it can be designed in such a way that the
strength of the network is maximized and weakness of the network is minimized.
o Costly infrastructure: The infrastructure cost is very high as a hybrid network requires a
lot of cabling, network devices, etc.
77
Computer Science
78
Computer Science
In this section, we will discuss about the different terminology used in Computer Security.
79
Computer Science
Confidentiality
Confidentiality is the concealment of information or resources. Also, there is a need to keep
information secret from other third parties that want to have access to it, so just the right people
can access it.
Example in real life − Let’s say there are two people communicating via an encrypted email
they know the decryption keys of each other and they read the email by entering these keys into
the email program. If someone else can read these decryption keys when they are entered into
the program, then the confidentiality of that email is compromised.
Integrity
Integrity is the trustworthiness of data in the systems or resources by the point of view of
preventing unauthorized and improper changes. Generally, Integrity is composed of two sub-
elements – data-integrity, which it has to do with the content of the data and authentication
which has to do with the origin of the data as such information has values only if it is correct.
Example in real life − Let’s say you are doing an online payment of 5 USD, but your
information is tampered without your knowledge in a way by sending to the seller 500 USD,
this would cost you too much.
80
Computer Science
In this case cryptography plays a very major role in ensuring data integrity. Commonly used
methods to protect data integrity includes hashing the data you receive and comparing it with
the hash of the original message. However, this means that the hash of the original data must be
provided in a secure way.
Availability
Availability refers to the ability to access data of a resource when it is needed, as such the
information has value only if the authorized people can access at right time. Denying access to
data nowadays has become a common attack. Imagine a downtime of a live server how costly it
can be.
Example in real life − Let’s say a hacker has compromised a webserver of a bank and put it
down. You as an authenticated user want to do an e-banking transfer but it is impossible to
access it, the undone transfer is a money lost for the bank.
81
Computer Science
A good feature of this site is URL checking, before entering to a website you can enter the URL
and it checks for you if the site has infection and can harm you.
82
Computer Science
I did a test with a URL and it came out to be clean and that too 100%, so I can visit it without
my computer being infected.
Avast Antivirus
This antivirus has good scores in malware blocking and anti-phishing test scans, it can be
downloaded from https://www.avast.com/en-eu/index
For server installation you need a commercial version.
83
Computer Science
AVG Antivirus
It can be downloaded from http://www.avg.com/us-en/free-antivirus-download. For server
installation you need to purchase the commercial version.
Rescue Disk
USB protection
Process Monitor
84
Computer Science
For server installation you will need to purchase the commercial version.
Bitdefender Antivirus
It can be downloaded from http://www.bitdefender.com/solutions/free.html A good feature in
this antivirus is that it can work entirely in the background. No configuration setting. For server
installation you need to buy the commercial version.
85
Computer Science
Commercial Antivirus
I should mention that all the producers of free antiviruses offers their commercial versions too.
Based on PC magazine, the best commercial antiviruses are −
Kaspersky Anti-Virus
Bitdefender Antivirus Plus 2016
McAfee AntiVirus Plus (2016)
Webroot SecureAnywhere Antivirus (2015)
Please see the following link to check by yourself
− http://www.pcmag.com/article2/0,2817,2372364,00.asp
Kaspersky Antivirus
It can be downloaded as a free trial from http://www.kaspersky.com/free-trials/anti-virus
It has an excellent score in anti-phishing. It also gives a useful bonus in security tools like credit
card protection in your computers.
86
Computer Science
In the previous sections we treated antiviruses which helped us to protect our systems but in this
chapter we will treat malwares, how to detect them manually, what are their forms, what are
their file extensions, signs of an infected computer, etc. They are important to be treated
because the infection rates of businesses and personal computers are too high in nowadays.
They are self-replication programs that reproduce their own codes by attaching themselves to
other executable codes. They operate without the permissions or knowledge of the computer
users. Viruses or malwares like in real-life, in computers they contaminate other healthy files.
However, we should remember that viruses infect outside machines only with the assistance of
a computer user only. These can happen by clicking a file that comes attached with email from
an unknown person, plugging a USB without scanning, opening unsafe URLs for that reason.
We as system administrators have to remove the administrator permissions of users in these
computers. We categorize malwares in three types −
Characteristics of a Virus
Following are a couple of characteristics of any virus that infects our computers.
They reside in a computer’s memory and activates themselves while the program that is
attached starts running.
For example − They attach themselves in general to the explorer.exe in windows OS
because it is the process that is running all the time, so you should be cautious when this
process starts to consume too much of your computer capacities.
They modify themselves after the infection phase like they source codes, extensions, new
files, etc. so it is harder for an antivirus to detect them.
They always try to hide themselves in the operating systems in the following ways −
o Encrypts itself into cryptic symbols, and they decrypt themselves when they
replicate or execute.
For example − You can see this in the following image for better understanding
as in my computer I found this file.
87
Computer Science
After finding this file, I opened it with a text editor and as thought the text was not
understandable as shown in the following screenshot.
After finding this, I tried it on a base64 decoder and I found that it was a Virus file.
88
Computer Science
Start by themselves
Transmit themselves by using non-executable files
Infect other networks or computer
From the above conclusions, we should know that when some unusual processes or services are
run by themselves we should further investigate their relations with a possible virus. The
investigation process is as follows −
To investigate these processes, start with the use of the following tools −
fport.exe
pslist.exe
handle.exe
netstat.exe
The Listdll.exe shows all the dll files being used, while the netstat.exe with its variables shows
all the processes that are being run with their respective ports.
You can see the following example on how I mapped the process of Kaspersky antivirus which
I used along with the command netstat-ano to see the process numbers and task manager to see
to which process belongs to this number.
89
Computer Science
Then we should look for any modified, replaced or deleted files and the shared
libraries should also be checked. They generally infect executable program files with extension
like .EXE, .DRV, .SYS, .COM, .BIN. Malwares changes extension of genuine files, for
example: File.TXT to File.TXT.VBS.
If you are a system administrator of a webserver, then you should be aware of another form of
malware which is called as webshell. It generally is in a .php extension but with strange file
names and in an encrypted form. You should delete them in case you detect them.
After that is done, we should update the antivirus program and rescan the computer again.
Error while the system is booting in bios stage, like Bios’s battery cell display, timer error
display.
Hardware errors, like beeps RAM burn, HDD, etc.
If a document fails to start normally like a corrupted file, but the other files can be opened
accordingly.
Keyboard or mouse doesn’t answer to your commands, you have to check the plug-ins.
90
Computer Science
Monitor switching on and off too often, like blinking or vibrating, this is a hardware fault.
On the other hand, if you have the following signs in your system, you should check for
malware.
Your computer shows a pop-up or error tables.
Freezes frequently.
It slows down when a program or process starts.
Third parties complain that they are receiving invitation in social media or via email by
you.
Files extensions changes appear or files are added to your system without your consent.
Internet Explorer freezes too often even though your internet speed is very good.
Your hard disk is accessed most of the time as you can see from the LED light on your
computer case.
OS files are either corrupted or missing.
If your computer is consuming too much bandwidth or network resources this is the case
of a computer worm.
Hard disk space is occupied all the time, even when you are not taking any action, for
example installing a new program.
Files and program sizes changes comparing to its original version.
Some Practical Recommendations to Avoid Viruses −
Don’t open any email attachment coming from unknown people or from known people that
contain suspicious text.
Don’t accept invitation from unknown people on social media.
Don’t open URL sent by unknown people or known people that are in any weird form.
Virus Information
If you have found a virus but you want to investigate further regarding its function. I would
recommend you to have a look at these virus databases, which are offered generally by antivirus
vendors.
Kaspersky Virus Database − (http://www.kaspersky.com/viruswatchlite?hour_offset=-
1)
F-Secure − (https://www.f-secure.com/en/web/labs_global/threat-descriptions)
Symantec – Virus Encyclopedia −
(https://www.symantec.com/security_response/landing/azlisting.jsp)
91
Computer Science
92
Computer Science
93
Computer Science
94
Computer Science
What is Data?
Data is a collection of a distinct small unit of information. It can be used in a variety of forms
like text, numbers, media, bytes, etc. it can be stored in pieces of paper or electronic memory,
etc.
Word 'Data' is originated from the word 'datum' that means 'single piece of information.' It is
plural of the word datum.
In computing, Data is information that can be translated into a form for efficient movement and
processing. Data is interchangeable.
What is Database?
A database is an organized collection of data, so that it can be easily accessed and managed.
You can organize data into tables, rows, columns, and index it to make it easier to find relevant
information.
Database handlers create a database in such a way that only one set of software program
provides access of data to all the users.
The main purpose of the database is to operate a large amount of information by storing,
retrieving, and managing data.
There are many dynamic websites on the World Wide Web nowadays which are handled
through databases. For example, a model that checks the availability of rooms in a hotel. It is an
example of a dynamic website that uses a database.
There are many databases available like MySQL, Sybase, Oracle, MongoDB, Informix,
PostgreSQL, SQL Server, etc.
SQL or Structured Query Language is used to operate on the data stored in a database. SQL
depends on relational algebra and tuple relational calculus.
95
Computer Science
Evolution of Databases
The database has completed more than 50 years of journey of its evolution from flat-file system
to relational and objects relational systems. It has gone through several generations.
The Evolution
File-Based
1968 was the year when File-Based database were introduced. In file-based databases, data was
maintained in a flat file. Though files have many advantages, there are several limitations.
One of the major advantages is that the file system has various access methods, e.g., sequential,
indexed, and random.
1968-1980 was the era of the Hierarchical Database. Prominent hierarchical database model was
IBM's first DBMS. It was called IMS (Information Management System).
Below diagram represents Hierarchical Data Model. Small circle represents objects.
96
Computer Science
Like file system, this model also had some limitations like complex implementation, lack
structural independence, can't easily handle a many-many relationship, etc.
In this model, files are related as owners and members, like to the common network model.
This model also had some limitations like system complexity and difficult to design and
maintain.
Relational Database
1970 - Present: It is the era of Relational Database and Database Management. In 1970, the
relational model was proposed by E.F. Codd.
Relational database model has two main terminologies called instance and schema.
Schema specifies the structure like name of the relation, type of each column and name.
This model uses some mathematical concept like set theory and predicate logic.
During the era of the relational database, many more models had introduced like object-oriented
model, object-relational model, etc.
Cloud database
Cloud database facilitates you to store, manage, and retrieve their structured, unstructured data
via a cloud platform. This data is accessible over the Internet. Cloud databases are also called a
database as service (DBaaS) because they are offered as a managed service.
97
Computer Science
Lower costs
Generally, company provider does not have to invest in databases. It can maintain and support
one or more data centers.
Automated
Cloud databases are enriched with a variety of automated processes such as recovery, failover,
and auto-scaling.
Increased accessibility
You can access your cloud-based database from any location, anytime. All you need is just an
internet connection.
NoSQL Database
A NoSQL database is an approach to design such databases that can accommodate a wide variety
of data models. NoSQL stands for "not only SQL." It is an alternative to traditional relational
databases in which data is placed in tables, and data schema is perfectly designed before the
database is built.
98
Computer Science
Advantage of NoSQL
High Scalability
NoSQL can handle an extensive amount of data because of scalability. If the data grows, NoSQL
database scale it to handle that data in an efficient manner.
High Availability
NoSQL supports auto replication. Auto replication makes it highly available because, in case of
any failure, data replicates itself to the previous consistent state.
Disadvantage of NoSQL
Open source
Management challenge
Data management in NoSQL is much more complicated than relational databases. It is very
challenging to install and even more hectic to manage daily.
GUI tools for NoSQL database are not easily available in the market.
Backup
Backup is a great weak point for NoSQL databases. Some databases, like MongoDB, have no
powerful approaches for data backup.
99
Computer Science
Graph Databases
A graph database is a NoSQL database. It is a graphical representation of data. It contains nodes
and edges. A node represents an entity, and each edge represents a relationship between two
edges. Every node in a graph database represents a unique identifier.
Graph databases are beneficial for searching the relationship between data because they highlight
the relationship between relevant data.
Graph databases are very useful when the database contains a complex relationship and dynamic
schema.
o DBMS provides the interface to perform the various operations like creation, deletion,
modification, etc.
o DBMS allows the user to create their databases as per their requirement.
o DBMS accepts the request from the application and provides specific data through the
operating system.
o DBMS contains the group of programs which acts according to the user instruction.
o It provides security to the database.
Advantage of DBMS
Controls redundancy
It stores all the data in a single database file, so it can control data redundancy.
Data sharing
100
Computer Science
Backup
It providesBackup and recovery subsystem. This recovery system creates automatic data from
system failure and restores data if required.
Disadvantage of DBMS
Size
Cost
DBMS requires a high-speed data processor and larger memory to run DBMS software, so it is
costly.
Complexity
o Table
o Record/ Tuple
o Field/Column name /Attribute
o Instance
o Schema
o Keys
An RDBMS is a tabular DBMS that maintains the security, integrity, accuracy, and consistency
of the data.
101
Computer Science
Types of Databases
There are various types of databases used for storing different varieties of data:
1) Centralized Database
It is the type of database that stores data at a centralized database system. It comforts the users to
access the stored data from different locations through several applications. These applications
contain the authentication process to let users access data securely. An example of a Centralized
database can be Central Library that carries a central database of each library in a
college/university.
102
Computer Science
2) Distributed Database
Unlike a centralized database system, in distributed systems, data is distributed among different
database systems of an organization. These database systems are connected via communication
links. Such links help the end-users to access the data easily. Examples of the Distributed
database are Apache Cassandra, HBase, Ignite, etc.
o Homogeneous DDB: Those database systems which execute on the same operating
system and use the same application process and carry the same hardware devices.
o Heterogeneous DDB: Those database systems which execute on different operating
systems under different application procedures, and carries different hardware devices.
3) Relational Database
This database is based on the relational data model, which stores data in the form of rows(tuple)
and columns(attributes), and together forms a table(relation). A relational database uses SQL for
storing, manipulating, as well as maintaining the data. E.F. Codd invented the database in 1970.
Each table in the database carries a key that makes the data unique from others. Examples of
Relational databases are MySQL, Microsoft SQL Server, Oracle, etc.
103
Computer Science
A means Atomicity: This ensures the data operation will complete either with success or with
failure. It follows the 'all or nothing' strategy. For example, a transaction will either be
committed or will abort.
C means Consistency: If we perform any operation over the data, its value before and after the
operation should be preserved. For example, the account balance before and after the transaction
should be correct, i.e., it should remain conserved.
I means Isolation: There can be concurrent users for accessing data at the same time from the
database. Thus, isolation between the data should remain isolated. For example, when multiple
transactions occur at the same time, one transaction effects should not be visible to the other
transactions in the database.
D means Durability: It ensures that once it completes the operation and commits the data, data
changes should remain permanent.
4) NoSQL Database
Non-SQL/Not Only SQL is a type of database that is used for storing a wide range of data sets. It
is not a relational database as it stores data not only in tabular form but in several different ways.
It came into existence when the demand for building modern applications increased. Thus,
NoSQL presented a wide variety of database technologies in response to the demands. We can
further divide a NoSQL database into the following four types:
a. Key-value storage: It is the simplest type of database storage where it stores every single
item as a key (or attribute name) holding its value, together.
104
Computer Science
5) Cloud Database
A type of database where data is stored in a virtual environment and executes over the cloud
computing platform. It provides users with various cloud computing services (SaaS, PaaS, IaaS,
etc.) for accessing the database. There are numerous cloud platforms, but the best options are:
6) Object-oriented Databases
The type of database that uses the object-based data model approach for storing data in the
database system. The data is represented and stored as objects which are similar to the objects
used in the object-oriented programming language.
7) Hierarchical Databases
It is the type of database that stores data in the form of parent-children relationship nodes. Here,
it organizes data in a tree-like structure.
105
Computer Science
Data get stored in the form of records that are connected via links. Each child record in the tree
will contain only one parent. On the other hand, each parent record can have multiple child
records.
8) Network Databases
It is the database that typically follows the network data model. Here, the representation of data
is in the form of nodes connected via links between them. Unlike the hierarchical database, it
allows each record to have multiple children and parent nodes to form a generalized graph
structure.
9) Personal Database
Collecting and storing data on the user's system defines a Personal Database. This database is
basically designed for a single user.
106
Computer Science
107
Computer Science
Windows
After opening an application, you will also have a window with an active application which will
appear in your desktop and taskbar.
108
Computer Science
Desktop
The Desktop is the very first screen you see after Windows starts. There you find the folders:
My Documents, My Computer, the Recycle Bin and any Shortcuts for applications and files that
you have created.
109
Computer Science
My Computer
When you double-click on the My Computer icon on the desktop, it will open a window similar
to the one shown below, where you can navigate between the computer's drives and Control
Panel tools.
Recycle Bin
When you delete a file from your computer's hard drive, it is removed to the folder called
Recycle Bin. Files deleted from your hard drive are still available for
restoring if needed, unless you empty your Recycle Bin.
To restore the files, open the Recycle Bin folder by double-clicking the icon on your
desktop, select the file and then select Restore.
To clear the Recycle Bin, select Empty Recycle Bin and the files will be permanently removed from
your computer.
110
Computer Science
Note that the recycle bin does not apply to the contents of a floppy disk. If you delete a file from
a floppy disk, it is permanently deleted, and you cannot restore it.
Minimize/Maximize/Close Buttons
The first one when clicked minimize your screen, sending it to the taskbar. The second one
maximize your screen, filling all desktop with the document you are working with.The last
button is used to close your document.
Start Menu
By clicking the Start button, in the very bottom-left corner of the screen, a vertical window will
come up with the Start Menu.
The list of submenus in the pop-up window let you navigate and select the application you want
to run.
111
Computer Science
Taskbar
The Taskbar is the row at the bottom of the Windows screen where all currently open
applications or files are listed.
The taskbar is used to select a file or application that is already opened or to put an application in
the foreground.
To put an application in the foreground, just click on the icon of the application in the taskbar.
Another way to put an application in the foreground when more than one is in use is to hold the
ALT button and then click TAB on your keyboard to see all the open applications; you will need
to hold the ALT button and continue pressing TAB to go through each application until you
come to the one you want to use.
Shortcut
A shortcut creates a button or icon which typically stays on the
desktop and when clicked, quickly allows you to start a program or
open a file without having to go to its permanent location on your
computer.
112
Computer Science
To create a shortcut, open the Windows Explorer or go to the Start menu, select the file or
program you want to create a shortcut for, place the cursor on the icon for the file, then right-
click and select Create Shortcut from the menu that pops up. The shortcut file will be created.
After that, you drag the shortcut file to the desktop and whenever you click on it, it will open the
application or document related to the shortcut.
113
Computer Science
Multitasking
The term multitasking means to be running or working in two or more applications at the same
time. You can be more productive by multitasking. For instance, you can download files from
the Internet while managing your files or word processing.
In order to switch between the applications you can use the Taskbar, clicking on the icon of the
application you want to have in the foreground.
114
Computer Science
Highlight
Put your cursor at the beginning of a word or sentence you want to highlight, then click and drag
your mouse to the end of the selection.
115
Computer Science
Another way of using the copy, cut or paste commands is using the
right-click button of your mouse.
1. After highlighting the text you right-click and a menu will appear
where you can select Copy or Cut.
2. To paste you just insert your cursor where you want, right-click and
select Paste.
1. Highlight the text you want to copy or cut, press CTRL+C (for copy) or CTRL+X (for paste).
116
Computer Science
The Formatting Toolbar is used to format a text using alignments, font type, font size, bold,
italic, and lists. It is provided in most applications. The image below shows the Formatting
Toolbar from Netscape Composer.
117
Computer Science
Note that clicking Save will replace whatever file you were
working on.
Save As is used when you want to save a file with a different name
to create backups of a file in the creation process. In that way, you
can have different versions of the same document and can return to
a previous stage.
Print Command
To print a page go to the File menu and select Print. A window will pop up with options for how many
copies and which pages you want to print. Other options are also available depending on the printer.
118
Computer Science
New Folder
To create a New Folder, which means a new directory (a place where documents from the same
subject are stored), go to the File menu, then New and select Folder from the pop-up menu,
either in My Computer or in Windows Explorer.
Copy/Move Files
To copy and move a file or folder, use Windows Explorer.
To open the Explorer application, click the Start button and select Programs and Windows
Explorer (some computer have Explorer under Programs/Accessories).
119
Computer Science
1. Select the disk drive that contains the file by clicking twice on it.
2. Click on the folder where the file is located
3. Select the file by clicking on it.
4. Go to Edit menu, select Copy (if you want to retain a copy of the file in the original place) or Cut (if you
want to move the file).
5. Navigate to the new location where you want to paste the file.
6. Go to Edit menu, select Paste.
The same procedure can be used if you want to copy or move an entire folder.
120
Computer Science
Here is an example of dragging and dropping a file from the hard drive to the floppy drive in
Windows Explorer:
1. Select the file, hold down the left mouse button and drag it in the direction of the floppy drive on the left
side.
2. After the floppy drive highlights you can release the mouse button; the file will be dropped and copied
there.
121
Computer Science
File Extensions
A file extension is the three letters of a file name after the dot. It is created by the application
when you save a file. It is the way operation systems identify which application to use to open a
file. Windows often doesn't list them when you are searching for a file, but they are there.
Examples are: .txt, .doc, .exe, .html, .jpg, .gif, .wav.
However, sometimes you will want to save a file with different extensions. In order to do that,
select Save As in the File menu. The Save As box will open. Choose from the drop-down menu
next to Save As Type the type you want to save. The extension of the type will be created for
you by the application.
The hard drive, also called the C: drive, is used for storing all your applications and files. The
floppy drive, or A: drive, is used when you insert a floppy disk to store files that you want to
transport or create a back up.
122
Computer Science
To select the hard drive or floppy drive for file management you can go to either Windows
Explorer in programs or to My Computer on the desktop.
Hard Drive C:
Floppy Drive A:
123
Computer Science
Hard Drive C:
Floppy Drive A:
1. Navigate and select the file or folder you want to rename from the proper drive (c:, a:).
2. Go to the File menu and select Rename.
3. The file name will be highlighted and blinking in the right corner waiting for you to type the new file
name.
124
Computer Science
Another way of renaming or deleting a file or folder is using the right-click button of your
mouse. After highlighting the file or folder, you right-click and a menu will appear where you
can select Rename or Delete.
125
Computer Science
References
https://en.wikipedia.org/wiki/Computer_science#cite_note-6
"What is Computer Science? - Computer Science, The University of York".
www.cs.york.ac.uk. Retrieved June 11, 2020.
Dijkstra, E.W. (1986). "On a cultural gap". The Mathematical Intelligencer. 8 (1):
48–52. doi:10.1007/bf03023921. S2CID 120847834.
"WordNet Search—3.1". Wordnetweb.princeton.edu. Retrieved May 14, 2012.
"Definition of computer science | Dictionary.com". www.dictionary.com.
Retrieved June 11, 2020.
Jump up to:a b c d e Denning, Peter J. (2000). "Computer Science: The Discipline"
(PDF). Encyclopedia of Computer Science. Archived from the original (PDF) on
May 25, 2006.
Denning, Peter J. (April 1, 2005). "Is computer science science?". Communications
of the ACM. 48 (4): 27–31. doi:10.1145/1053291.1053309. S2CID 827843.
Floridi, Luciano (February 25, 2010). Information: A Very Short Introduction.
OUP Oxford. ISBN 978-0-19-160954-1.
https://www.tutorialspoint.com
Computer Science: An Overview (12th Edition)Apr 11, 2014
by Glenn Brookshear and Dennis Brylow
Invitation to Computer ScienceFeb 4, 2015
by G.Michael Schneider and Judith Gersting
An Introduction to Computer Science, 2nd Ed.May 7, 2010 | Student
Edition by John Zelle
Introduction to Computer ScienceJun 20, 2011
by ITL Education Solutions Limited
A Balanced Introduction to Computer Science (3rd Edition)Sep 10,
2010 by David Reed
Introduction to Computer Science: A Textbook for Beginners in
InformaticsOct 11, 2013 by Gilbert Brands
Connecting with Computer Science (Introduction to CS) Jan 14, 2010
by Greg Anderson and David Ferro
Ecdl Information Technology Manual
126
Computer Science
127