CSC 101 Note
CSC 101 Note
CSC 101 Note
B.SC.
ICEEL IBBUL
Chapter One
1.0 Brief History of Computer
Computers truly came into their own as great inventions in the last two decades
of the 20th century. But their history stretches back more than 2500 years to the
abacus: a simple calculator made from beads and wires, which is still used in
some parts of the world (e.g. China) today. The difference between an ancient
abacus and a modern computer seems vast, but the principle of making repeated
calculations quicker than the human brain is exactly the same.
1
ones. But, in the 19th century, these ideas were still far ahead of their time. It
would take another 50–100 years for mathematicians and computer scientists
to figure out how to use them.
Neither the abacus, nor the mechanical calculators constructed by Pascal and
Leibniz really qualified as computers. A calculator is a device that makes it
quicker and easier for people to do sums—but it needs a human operator. A
computer, on the other hand, is a machine that can operate automatically,
without any human help, by following a series of stored instructions called a
program (a kind of mathematical recipe). Calculators evolved into computers
when people devised ways of making entirely automatic, programmable
calculators.
The first person to attempt this was a rather obsessive, notoriously grumpy
English mathematician named Charles Babbage (1791–1871). Many regard
Babbage as the "father of the computer" because his machines had an input
(a way of feeding in numbers), a memory (something to store these numbers
while complex calculations were taking place), a processor (the number-
cruncher that carried out the calculations), and an output (a printing
mechanism) the same basic components shared by all modern computers.
During his lifetime, Babbage never completed a single one of the hugely
ambitious machines that he tried to build. That was no surprise. Each of his
programmable "engines" was designed to use tens of thousands of precision-
made gears. It was like a pocket watch scaled up to the size of a steam engine,
a Pascal or Leibniz machine magnified a thousand-fold in dimensions,
ambition, and complexity. For a time, the British government financed
Babbage to the tune of £17,000, then an enormous sum. But when Babbage
pressed the government for more money to build an even more advanced
machine, they lost patience and pulled out. Babbage was more fortunate in
receiving help from Augusta Ada Byron (1815–1852), Countess of
Lovelace, daughter of the poet Lord Byron. An enthusiastic mathematician,
she helped to refine Babbage's ideas for making his machine programmable
and this is why she is still, sometimes, referred to as the world's first computer
programmer. Little of Babbage's work survived after his death. But when, by
chance, his notebooks were rediscovered in the 1930s, computer scientists
finally appreciated the brilliance of his ideas. Unfortunately, by then, most of
these ideas had already been reinvented by others.
2
Babbage had intended that his machine would take the drudgery out of
repetitive calculations. Originally, he imagined it would be used by the army
to compile the tables that helped their gunners to fire cannons more
accurately. Toward the end of the 19th century, other inventors were more
successful in their effort to construct "engines" of calculation. American
statistician Herman Hollerith (1860–1929) built one of the world's first
practical calculating machines, which he called a tabulator, to help compile
census data. Then, as now, a census was taken each decade but, by the 1880s,
the population of the United States had grown so much through immigration
that a full-scale analysis of the data by hand was taking seven and a half years.
The statisticians soon figured out that, if trends continued, they would run out
of time to compile one census before the next one felt due. Fortunately,
Hollerith's tabulator was an amazing success: it tallied the entire census in
only six weeks and completed the full analysis in just two and a half years.
Soon afterward, Hollerith realized his machine had other applications, so he
set up the Tabulating Machine Company in 1896 to manufacture it
commercially. A few years later, it changed its name to the Computing-
Tabulating-Recording (C-T-R) company and then, in 1924, acquired its
present name: International Business Machines (IBM).
Vacuum tube (as the major component) was an extremely important step in the
advancement of computers. Its purpose was to act like an amplifier and a switch.
Without any moving parts, vacuum tubes could take very weak signals and make
3
the signal stronger (amplify it). Vacuum tubes could also stop and start the flow
of electricity instantly (switch).
4
1.1.2 Second Generation Computers
5
• Output was displayed and printouts
• HLL such as FORTRAN, COBOL were used
• Lesser power consumption and better performance.
• Used in business, industry and commercial organizations for
preparation of payroll, inventory control, research, scientific &
engineering analysis and design etc.
6
• In the beginning, magnetic core memories were used. Later they were
replaced by semiconductor memories (RAM & ROM)
• Introduced microprogramming
• Used of High-level languages (FORTRAN-II, COBOL, PASCAL
PL/1, BASIC etc).
• Cache and virtual memories were introduced (Cache memory makes
the main memory appear faster than it really is. Virtual memory
makes it appear larger)
• Input was based on keyboard
• Output was based on monitor
• Interfaced with operating system which allow the application to run
multiple device at a time
• Small Scale Integration and Medium Scale Integration technology
were implemented in CPU, I/O processors etc.
• Smaller & better performance
• Comparatively lesser cost
• Faster processors
7
Fig. 1.4: Fourth Generation Computer
8
1.1.4.2 Kinds of Fourth-Generation Computers
• DEC 10
• STAR 1000
• PDP 11
• CRAY-1 (Super Computer)
• CRAY-X-MP (Super Computer)
1.1.5 Fifth Generation Computers
The period of fifth generation is 1980-till date. In the fifth generation, VLSI
technology became ULSI (Ultra Large-Scale Integration) technology,
resulting in the production of microprocessor chips having ten million
electronic components.
This generation is based on parallel processing hardware and AI (Artificial
Intelligence) software. AI is an emerging branch in computer science, which
interprets the means and method of making computers think like human
beings. All the high-level languages like C/C++, Java, .Net etc., are used in
this generation.
9
Chapter Two
2.0 Introduction to Computer
The word “computer” comes from the word “compute” which means to
calculate. A computer is an electronic device which can accept data, store data
in its memory, process them and produce useful information.
Data: Facts about a person, object or place, e.g. name, age, complexion,
school, class, height (unprocessed information).
10
l. Reflects human error
The computing system consists of the computer system, user and the
computing environment. The computer system is made up of hardware and
software.
2.1.1 Hardware
Hardware: Are the physical components of the computer. Comprise of the input
unit, the central processing unit (ALU, Control unit and Main Memory) and the
output unit. The main memory is made up of RAM (Random Access Memory)
and ROM (Read Only Memory).
2.1.2 Software
These are series of instructions that enable the computer to perform tasks. A
program is made up of set of instructions to perform a task. Software is made up
of series of programs. This can be categorized into three (3):
• System Software
• Utility Software
• Application software
• System Software: This is the program that facilitates the use of
the hardware and provides a suitable environment for writing,
editing, debugging, testing and running of user program. Usually,
every computer system comes with collection of the suits of
programs which are provided by the Hardware Manufacturer. E.g
Operating system (which act as an Interface between the user and
computer hardware).
11
• Utility Software: Also, known as general purpose programs, they
are used for copying files, file conversion, housekeeping
operations etc.
• Application Software: Set of programs designed to solve a
problem of specific nature. It could be a user program or supplied
by the manufacturer.
2.1.3 Computer User
These are different categories of people or personnel that operate the
computer systems. We have expert users and end users.
12
2.2.1.3 Hybrid Computer
2.2.2 Purpose
Computers differ based on their data processing abilities. They are
classified according to purpose, data handling and functionality. These
computers can be specified as;
2.2.2.1 Special Purpose Computer
These computers are Designed to perform a specific task. The
instructions to carry out the task are permanently stored in the machine.
They are not versatile, less complex than the general purpose and very
efficient for the tasks for which they are designed for. E.g.: Computer
used for military purpose, navigational purpose, for tracking airplane
or missiles, etc.
2.2.2.2 General Purpose Computer
Works on different types of program input to it and thus be used in
countless applications. The programs are not permanently stored, more
flexible than special purpose computers, they can handle a wide variety
of problems with Less efficient than the special purpose computers due
to such problems as inadequate storage, low operating etc. More
complex than special purpose computer. These computers are very
versatile. Examples of areas where general purpose computers are
employed include Payroll, Banking, billing etc.
2.2.3 Capacity
Different types of computers can be grouped into four major categories
according to size. Each category excels at specific functions. Generally,
sizes of computers determine the processing abilities. Larger computers
have higher processing speeds while smaller ones offer the better
experience for personal computing.
2.2.3.1 Micro Computer/Personal Computer
These are the smallest, least expensive and the most used types of
computers. They have a small memory, less processing power,
physically small and permit fewer peripherals compared to super and
mainframe computers. The operating system used include Windows,
Mac OS X, Linux, IOS, and Android with categories like Desktop,
Laptops, Mobile and Wearable Computers.
13
2.2.3.2 Mini Computer
Minicomputers are general purpose devices without the monumental
expenses associated with a larger system. Their processing power is
below that of mainframe system but above the capabilities of PC. Eg.
MicroVAX II, Texas Instrument TI-990 and K-202.
2.2.3.3 Main Frame Computer
Also known as big iron, mainframe are large sized computer types.
They are equally powerful but fall short in terms of the computation
ability in supercomputers. They are like big file servers, enabling
multiple users from nearby and remote locations to access resources at
the same time.
They are resilient as they are capable of operating for over ten years
without failing. E.g. System z9, Fujitsu-ICL VME and Hitachi’s Z800.
2.2.3.4 Super Computer
This is the most powerful in terms of speed and accuracy. They are type
of computers used in solving complex mathematical computations.
They are capable of executing trillions of instructions per second,
which is calculated in floating point operations per second (FLOPS).
Eg. Roadrunner (IBM-USA), Jaguar (Cray-USA), Tianhe-1A (NUDT-
China) etc.
2.3 Functional Component of Computer
Computer is a device that operates upon information or data. It is an electronic
device which accepts input data, stores the data, does arithmetic and logic
operation and outputs the information in desired format.
Since computer follows input – process – output cycle, the first stage is
performed in computer by input unit, second stage by its central processing unit
14
and output unit performs the third stage. The main memory holds the input and
intermediate output during processing.
15
• EEPROM: Electrically Erasable Programmable
ROM
16
2.3.4 Output Unit
An output unit of a computer system performs the following functions:
• It accepts the results produced by the computer, which are in
coded form and hence, cannot be easily understood by us
• It converts these coded results to human acceptable
(readable) form
• It supplies the converted results to outside world
Types of printers
We can choose any language for writing a program according to the need.
However, a computer executes programs only after they are represented in
binary form (Sequences of 1’s and 0’s). Programs written in any other
language must be translated to the binary representation of the instructions
before they can be executed by the computer. Programs written for a
computer may be in one of the following categories of languages.
Advantage:
It is faster in execution since the computer directly starts
executing it.
Disadvantage:
It is difficult to understand and develop a program using
machine language. Anybody going through this program for
17
checking will have a difficult task understanding what will be
achieved when this program is executed.
Disadvantages:
• Assembly language is specific to particular machine
language architecture.
18
• Assembly language program is not as fast as machine
language.
2.4.1.3 High Level Languages (Third Generation Languages)
The main purpose of high-level language is to enable the programmer to
write the program more easily. These languages consist of a set of words
and symbols. The most important characteristic of high-level language is
that it is computer independent. Programming languages like C, COBOL,
FORTRAN and BASIC are called high-level languages.
The Program shown below is written in BASIC to obtain the sum of two
numbers
10 LET X = 7
20 LET Y = 10
30 LET SUM = X + Y
40 PRINT SUM
50 END
Since a high-level language must be translated into a form the machine
can understand, this is done by software called Compiler which takes the
source code as input and produces as the output the machine language code
at the machine on which it is to be executed. During the process of
translation: the compiler reads the source programs statement-wise and
checks the syntactical errors. If there is any error, the computer generates
a printout of the errors it has detected.
Advantages:
19
Chapter Three
3.0 Introduction to Problem Solving
Regardless of the area of study, computer science is all about solving problems with
computers. The problems that we want to solve can come from any real-world
problem or perhaps even from the abstract world. We need to have a standard
systematic approach to solving problems.
3.1 Problem Solving
• Formulate a Model
Now we need to understand the processing part of the problem. Many
problems break down into smaller problems that require some kind of simple
mathematical computations in order to process the data.
• Develop an Algorithm
Now that we understand the problem and have formulated a model, it is
time to come up with a precise plan of what we want the computer to do.
An algorithm is a precise sequence of instructions for solving a problem.
20
necessarily in sequence and in may not even have a finite number of
instructions.
(a) Pseudocode
Pseudocode is a simple and concise sequence of English-like instructions
to solve a problem.
Pseudocode:
◼ Input a set of 4 marks
◼ Calculate their average by summing and dividing by 4
◼ if average is below 50
Print “FAIL”
else
Print “PASS”
Detailed Algorithm
◼ Step 1: Input M1, M2, M3, M4
Step 2: GRADE (M1+M2+M3+M4)/4
Step 3: if (GRADE < 50) then
Print “FAIL”
else
Print “PASS”
Endif
21
3.2 Introduction to Flowchart
22
Figure 3.1: Common Flowchart Symbols
23
3.2.2 Basic Structures of Flowchart
• Sequence Control Structure: This refers to line-by-line execution, in which
statements are executed sequentially, in the same order in which they appear
in the script. They might, for example, carry out a series of read or write
operations, arithmetic operations, or assignments to variables.
24
• Decision Control Structure: Depending on whether a condition is true or
false, the decision control structure may skip the execution of an entire block
of statements or even execute one block of statements instead of another.
• Loop Control Structure: This is a control structure that allows the execution
of a block of statements multiple times until a specified condition is met.
25
• A Select Case statement allows a variable to be tested for equality against a
list of values. Each value is called a case, and the variable being switched on
is checked for each select case.
◼ Example 2:
Flowchart of the above example of pseudocode
26
◼ Example 3:
Write an algorithm and draw a flowchart to convert the length in
feet to centimeter.
Pseudocode:
◼ Example 4:
Write an algorithm that reads two values, determines the largest value
and prints the largest value with an identifying message.
ALGORITHM
Step 1: Input VALUE1, VALUE2
Step 2: if (VALUE1 > VALUE2) then
MAX VALUE1
else
MAX VALUE2
endif
Step 3: Print “The largest value is”, MAX
27
28
Chapter Four
4.0 Number System
The base, or radix, of a number system tells you the number of symbols used in
that system. The base of any system is always expressed in decimal numbers.
The base, or radix, of the decimal system is 10. This means there are 10 symbols
0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 used in the system. A number system using two
symbols 0, and 1 would be base 2; eight symbols would be base 8; and so forth.
Remember to count the zero or the symbol used for zero when determining the
number of symbols used in a number system. The base of a number system is
indicated by a subscript (decimal number) following the value of the number.
29
Characteristics of Position Number System
4782 Number
value
The decimal system uses 10 symbols in which the place values are powers of 10.
Converting a number from binary to decimal is quite easy. All that is required is
to find the decimal value of each binary digit position containing a 1 and add
them up.
For example: convert 101012 to decimal
101012 = (1 x 24) + (0 x 23) + (1 x 22) + (0 x 21) + (1 x 20)
= 16 + 0 + 4 + 0 + 1
= 2110
30
prefix the number with 0’s so that each group contains 4 digits. For each four-
digit group, convert the 4-bit binary number into an equivalent hexadecimal
digit.
31
• The symbols A, B, C, D, E and F represents the decimal values 10,
11, 12, 13, 14, 15 respectively.
• The maximum value of a single digit is 15 (one less than the value
of the base.
• Each position of a digit represents a specific power of the base
(16).
• Since there are only 16 digits, 4 bits (24 = 16) are sufficient to
represent any hexadecimal number in binary.
Hex to Octal
Conversion of hex to octal is a two-step procedure. First, convert the
hex number to binary; and second, convert the binary number to octal.
Let’s convert the hexadecimal number ABC16 to octal:
A B C16
1010 1011 11002
32
Octal (Base 8)
The word octal is derived from the Latin root octo (eight). Base b = 8, and
Eight symbols, S = {0, 1, 2, 3, 4, 5, 6, 7}. The place values in the octal
number system are powers of 8. Figure 4 shows the place values and the
symbol values of the octal (1256)8. Note that we use subscript 8 to show that
the number is an octal number.
83 82 81 80 Place values
1 2 5 6 Symbols
512 +128 +40 +6 Symbol Value
686 Number value in decimal
The octal system uses 8 symbols in which the place values are powers of 8.
33
Hexadecimal 16 0,1,2,3,4,5,6,7,8,9, (A2C.A1)16
A,B,C,D,E,F
34
Characteristics
• Use symbols such as I for 1, II for 2, & III for 3 etc.
• Each symbol represents the same value regardless of its position in
the number
• The symbols are simply added to find out the value of a particular
number
Disadvantage
• It is difficult to perform arithmetic with such a number system
35
Chapter Five
5.0 Data Communication and Networking
There are three ways or modes for transmitting data from one point to
another. These are simplex, half-duplex and full-duplex.
Simplex:
Half-Duplex:
A half-duplex system can transmit data in both directions, but only in one
direction at a time. For example, wireless etc.
Full-Duplex:
36
Transmission Media
• Wire Pairs: It is also known as twisted pair. Wire pairs are wires twisted
together to form a cable, which is thin insulated. Wire pairs are inexpensive.
o Cheap
o Low data rate
o Short range
o Easy to work with
• Coaxial Cable: are groups of specially wrapped and insulated wire lines that
are able to transmit data at very high rates. These cables can transmit data
much faster than wire pairs.
Benefits:
Drawbacks:
o Comparatively costly
o Security problem
• Fiber Optics: Instead of using electricity to send data, fiber optics uses
light.
Application: Long haul trunks, Metropolitan trunks, LAN & WAN etc.
o Greater capacity
37
o Smaller size & weight
o Lower attenuation
• Physical topology: Is how the wires are run and the way in which a
network is laid out physically
• Logical topology is how the signal travels.
Mesh Topology
38
Advantage of Mesh Topology
Star Topology
39
Disadvantages of star topology
Bus Topology
• A multipoint topology
• Consists of cables connecting PCs or file servers
• Terminator attached to each end of bus cable segment
• to absorb signal and prevent signal reflection back on to covered
path
• Transmitting packet across bus
• Detected by all nodes on segment
• Given time limit to reach destination
• Not secured
• Can become quickly congested with network traffic
• A fault in bus cable stops all transmissions even between devices
on the same side of the problem. The damaged area reflects
signals back the direction of origin, creating noise in both
directions
• It can difficult to add new devices (adding more require
modification of the
40
• backbone).
Ring Topology
Advantage
Disadvantage
• Unidirectional traffic
• A break in the ring can disable the entire network. This can be solved
by use dual ring
41
Networks Categories
42