CH 1_CH2_Introduction of Computer Science
CH 1_CH2_Introduction of Computer Science
Lecturer Notes in
Introduction to Computer
Science
Prepared by
1
1.1 Introduction
Being a modern-day kid you must have used, seen, or read about computers.
This is because they are an integral part of our everyday existence. Be it
school, banks, shops, railway stations, hospital or your own home, computers
are present everywhere, making our work easier and faster for us. As they are
such integral parts of our lives, we must know what they are and how they
function. Let us start with defining the term computer formally.
What is a Computer?
2
Input device: users interact with a computer using input devices. Input
devices usually a keyboard and mouse are used by a user in order to provide
instructions to a computer.
Computer input is called data and the output obtained after processing it,
based on user’s instructions is called information. Raw facts and figures
which can be processed using arithmetic and logical operations to obtain
information are called data.
ALU (Arithmetic Logic Unit) that carries out arithmetic and logic operations
on the operands in computer instruction words.
3
Control Unit (CU): controls and co-ordinates computer components.
Memory − All input data, instructions and data interim to the processes
are stored in the memory. Memory is of two types – primary
memory and secondary memory. Primary memory resides within the
CPU whereas secondary memory is external to it.
Registers: Stores the data that is to be executed next.
4
• SPEED: In general, no human being or any other device can compete to
solve complex computation, faster than computer.
• STORAGE: Computer has the capacity to store mass volume of data with
appropriate format.
• DILIGENCE: Computer never feels bored and it can work for hours and
hours without any break and creating error.
Now that we know the characteristics of computers, we can see the advantages
that computers offer−
Computers can do the same task repetitively with same accuracy.
Computers do not get tired or bored.
Computers can take up routine tasks while releasing human resource for
more intelligent functions.
5
Regular electric supply is necessary to make computers work,
which could prove difficult everywhere especially in developing
nations.
Booting
Computers are of various types and they can be categorized in two ways on
the basis of size and on the basis of data handling capabilities.
1. Supercomputer
2. Mainframe computer
6
3. Minicomputer
4. Workstation
5. PC (Personal Computer)
And on the basis of data handling capabilities, there are three types of
computer:
1. Analogue Computer
2. Digital Computer
3. Hybrid Computer
1. Supercomputer:
When we talk about speed, then the first name that comes to mind when
thinking of computers is supercomputers. They are the biggest and fastest
computers (in terms of speed of processing data). Supercomputers are
designed such that they can process a huge amount of data, like processing
trillions of instructions or data just in a second. This is because of the
thousands of interconnected processors in supercomputers. It is basically used
in scientific and engineering applications such as weather forecasting,
scientific simulations, and nuclear energy research. It was first developed by
Roger Cray in 1976.
Characteristics of supercomputers:
Supercomputers are the computers which are the fastest and they are
also very expensive.
7
It is used in scientific research areas for analyzing data obtained from
exploring the solar system, satellites, etc.
2. Mainframe computer:
Mainframe computers are designed in such a way that it can support hundreds
or thousands of users at the same time. It also supports multiple programs
simultaneously. So, they can execute different processes simultaneously. All
these features make the mainframe computer ideal for big organizations like
banking, telecom sectors, etc., which process a high volume of data in general.
It can process a huge amount of data (like data involved in the banking
sector) very quickly.
3. Minicomputer:
Characteristics of minicomputer:
It is fast.
8
4. Workstation:
Characteristics of Workstation:
It is also used to handle animation, data analysis, CAD, audio and video
creation, and editing.
5. PC (Personal Computer):
It is smallest in size.
It is easy to use.
6. Analogue Computer:
7. Digital Computer:
Digital computers are designed in such a way that it can easily perform
calculations and logical operations at high speed. It takes raw data as an input
and processes it with programs stored in its memory to produce the final
output. It only understands the binary input 0 and 1, so the raw input data is
converted to 0 and 1 by the computer and then it is processed by the computer
to produce the result or final output. All modern computers, like laptops,
desktops including smartphones are digital computers.
8. Hybrid Computer:
As the name suggests hybrid, which means made by combining two different
things. Similarly, the hybrid computer is a combination of both analog and
digital computers. Hybrid computers are fast like an analog computer and
have memory, and accuracy like a digital computer. So, it has the ability to
process both continuous and discrete data. For working when it accepts analog
signals as input then it converts them into digital form before processing the
input data. So, it is widely used in specialized applications where both analog
and digital data is required to be processed. A processor which is used in petrol
pumps that converts the measurements of fuel flow into quantity and price is
an example of a hybrid computer.
Question 1. On the basis of data handling capabilities, how many computers are
there?
(A) 5
(B) 3
(C) 2
(D) None of the above
The correct option is B i.e., 3
10
On the basis of data handling capabilities, there are three types of computer which are
Analogue Computer, Digital Computer, Hybrid Computer.
(A) Supercomputer
(B) Minicomputer
(C) Workstation
(D) Personal computer
Solution: The correct option is D, i.e., Personal computer
Q 4. Which type of computer has two or more processors and it supports 4 to 200
users at one time.
(A) Minicomputer
(B) Personal computer
(C) Analogue computer
(D) All of the above
Solution: The correct option is A, i.e., Minicomputer
(A) Hybrid
(B) Analogue
(C) Digital
(D) Supercomputer
Solution: The correct option is C, i.e., digital
11
Assessment: Reflective Activities
Answers
• A computer is an electronic device that accepts inputs, processes the input based on an
algorithm and finally produces an output.
• Computers can be classified based on size, electronic components used for their
development, method of operations, their purpose of use and computing capacity.
12
Used vacuum tubes as components for the electronic circuit.
Punched cards were the main source of inputs, and magnetic grams
were used for internal storage.
Operate in a speed of milliseconds (thousandths of a second) and
could handle more than 10,000 additions each second.
Most applications were scientific calculations.
13
Software become more important with sophisticated operating
systems, and improved programming languages.
E. Fifth generation
14
1.6 Activity Conclusion
The task of entering and altering programs for the ENIAC was
extremely tedious. The limitations of early days computers were successfully
addressed through the Von Neumann architecture which you will learn in the
next unit. Computers evolution is grouped into four generations with each
generation characterized by the dominant electronic component used, the type
of programming language as well as the type of operating systems used.
Transistors placed on one tiny silicon chip.
Assessment: Reflective Activities
a. What was the type of electronic component used in the second generation of
computers?
b. What type of operating system was used in the first generation of computers?
c. The type of operating system used in the third generation was a time sharing one, what
does time sharing mean?
Answers
15
a. Vacuum tube
b. There was no notion of operating system then, it was programmer who also assumes
the role of operating system by connecting or disconnecting wires
c. Time sharing operating systems are systems that enables program share the computer
resources including the CPU based on a scheduled time.
16
Chapter 2
Types of Number
Systems
17
2.0 Introduction
Based on the base value and the number of allowed digits, number systems
are of many types. The four common types of Number System are:
1. Decimal Number System
2. Binary Number System
3. Octal Number System
4. Hexadecimal Number System
18
14 can be written as 1110
19 can be written as 10011
50 can be written as 110010
2.3 Octal Number System
Octal Number System is one in which the base value is 8. It uses 8 digits i.e.
0-7 for creation of Octal Numbers. Octal Numbers can be converted to
Decimal value by multiplying each digit with the place value and then adding
the result. Here the place values are 80, 81, and 82. Octal Numbers are useful
for the representation of UTF8 Numbers.
Example:
Examples:
19
1. Conversion from Decimal Number System to Other Number Systems
Decimal Numbers are represented with digits 0-9 and with base 10.
Conversion of a number system means conversion from one base to another.
Following are the conversion of the Decimal Number System to other
Number Systems:
Decimal numbers are represented in base 10, but the binary numbers are of
base 2. Hence, to convert a decimal number to binary number, the base of
that number is to be changed. Follow the steps given below:
Step 1: Divide the Decimal Number with the base of the number system
to be converted to. Here the conversion is to binary, hence the divisor will
be 2.
Step 2: The remainder obtained from the division will become the least
significant digit of the new number.
Step 3: The quotient obtained from the division will become the next
dividend and will be divided by base i.e. 2.
Step 4: The remainder obtained will become the second least significant
digit i.e. it will be added in the left of the previously obtained digit.
Now, the steps 3 and 4 are repeated until the quotient obtained becomes 0,
and the remainders obtained after each iteration are added to the left of the
existing digits.
After all the iterations are over, the last obtained remainder will be termed
as the Most Significant digit.
20
B. Decimal to Octal Conversion:
Binary Numbers are represented with digits 0 and 1 and with base 2.
Conversion of a number system means conversion from one base to
another. Following are the conversion of the Binary Number System to
other Number Systems:
Binary numbers are represented in base 2 but the decimal numbers are of
base 10. Hence, to convert the binary number into a decimal number, the
base of that number is to be changed. Follow the steps given below:
Step 1: Multiply each digit of the Binary number with the place value
of that digit, starting from right to left i.e. from LSB to MSB.
Step 2: Add the result of this multiplication and the decimal number
will be formed.
22
Example: To convert (11101011)2 into a decimal number
Binary numbers are represented in base 2 but the octal numbers are of
base 8. Hence, to convert the binary number into octal number, the base
of that number is to be changed. Follow the steps given below:
Step 1: Divide the binary number into groups of three digits starting
from right to left i.e. from LSB to MSB.
Step 2: Convert these groups into equivalent octal digits.
Example: To convert (11101011)2 into an octal number
23
C. Binary to Hexadecimal Conversion:
Octal Numbers are represented with digits 0-7 and with base 8.
Conversion of a number system means conversion from one base to
another. Following are the conversions of the Octal Number System to
other Number Systems:
24
A. Octal to Decimal Conversion:
Octal numbers are represented in base 8, but the decimal numbers are of
base 10. Hence, to convert an octal number to a decimal number, the base
of that number is to be changed. Follow the steps given below:
Step 1: Multiply each digit of the octal number with the place value
of that digit, starting from right to left i.e. from LSB to MSB.
Step 2: Add the result of this multiplication and the decimal number
will be formed.
Example:
Octal numbers are represented in base 8, but the binary numbers are of
base 2. Hence, to convert an octal number to a binary number, the base
of that number is to be changed. Follow the steps given below:
Step 1: Write each digit of the octal number separately.
Step 2: Convert each digit into an equivalent group of three binary
digits.
Step 3: Combine these groups to form the whole binary number.
Example: (247)8 is to be converted to binary
25
C. Octal to Hexadecimal Conversion:
26
4. Conversion from Hexadecimal Number System to Other Number
Systems
Hex Numbers are represented with digits 0-9 and with letters A-F and
with base 16. Conversion of a number system means conversion from one
base to another. Following are the conversions of the Hexadecimal
Number System to other Number Systems:
27
Step 3: Add the result of multiplications and the final sum will be the
decimal number.
Example: To convert (8EB4)16 into a decimal value
Hex numbers are represented in base 16, but the binary numbers are of
base 2. Hence, to convert a hexadecimal number to a binary number, the
base of that number is to be changed. Follow the steps given below:
Step 1: Convert the Hex symbols into its equivalent decimal values.
Step 2: Write each digit of the Hexadecimal number separately.
Step 3: Convert each digit into an equivalent group of four binary
digits.
Step 4: Combine these groups to form the whole binary number.
28
C. Hexadecimal to Octal Conversion:
Hexadecimal numbers are represented in base 16, but the octal numbers
are of base 8. Hence, to convert a hex number to an octal number, the
base of that number is to be changed. Follow the steps given below:
Step 1: We need to convert the Hexadecimal number to Binary first.
For that, follow the steps given in the above conversion.
Step 2: Now to convert the binary number to octal number, divide the
binary digits into groups of three digits starting from right to left i.e.
from LSB to MSB.
Step 3: Add zeros prior to MSB to make it a proper group of three
digits(if required)
Step 4: Now convert these groups into their relevant decimal values.
29
Binary Number System
Descriptions of binary number system:
Each binary digit is also called a bit. Binary number system is also positional
value system, where each digit has a value expressed in powers of 2, as
displayed here.
30
n any binary number, the rightmost digit is called least significant bit
(LSB) and leftmost digit is called most significant bit (MSB).
And decimal equivalent of this number is sum of product of each digit with
its positional value.
(11010)2 = 1×24 + 1×23 + 0×22 + 1×21 + 0×20
= 16 + 8 + 0 + 2 + 0
= (26)10
Computer memory is measured in terms of how many bits it can store. Here
is a chart for memory capacity conversion.
1 Zettabyte = 1024 EB
31
Octal Number System
Octal number system has eight digits – 0, 1, 2, 3, 4, 5, 6 and 7. Octal number
system is also a positional value system with where each digit has its value
expressed in powers of 8, as shown here −
Decimal equivalent of any octal number is sum of product of each digit with its positional value.
= 448 + 16 + 6
= (470)10
= (10234)10
32
HEXADECIMAL DECIMAL OCTAL BINARY
0 0 0 0000
1 1 1 0001
2 2 2 0010
3 3 3 0011
4 4 4 0100
5 5 5 0101
6 6 6 0110
7 7 7 0111
8 8 10 1000
9 9 11 1001
A 10 12 1010
B 11 13 1011
C 12 14 1100
D 13 15 1101
E 14 16 1110
F 15 17 1111
33
EFERENCES
1. Internet Society. http://www.internetsociety.org/internet/what-internet/ history-internet/brief-
history-internet, Date accessed February, 2016.
34
3. 10 Most Common Uses of Internet, http://www.sooperarticles.com/internet-articles/10-most-
common-uses-internet-19405.html, Date accessed, February, 2016.
35