Professional Documents
Culture Documents
INTRODUCTION
Generation and Classification of Computers
Basic Organization of a Computer
Number System
Binary Decimal Conversion Problems
Need for logical analysis and thinking
o Algorithm
o Pseudo code
o Flow Chart
LEARNING OBJECTIVES:
LEARNING OUTCOMES:
Able to think logically and write own Algorithm and Pseudocode for the given problem
delay due to waiting for input/output operations. Recall that programs were executed by
processing the machine instructions in a strictly sequential order. As a result, the CPU, with its
high speed electronic component, was often forced to wait for completion of I/O operations
which involved mechanical devices (card readers and tape drives) that were order of magnitude
slower.
These hardware developments led to enhancements of the operating system. I/O and data
channel communication and control became functions of the operating system, both to relieve
the application programmer from the difficult details of I/O programming and to protect the
integrity of the system to provide improved service to users by segmenting jobs and running
shorter jobs first (during "prime time") and relegating longer jobs to lower priority or night time
runs. System libraries became more widely available and more comprehensive as new utilities and
application software components were available to programmers.
The second generation was a period of intense operating system development. Also it was
the period for sequential batch processing. Researchers began to experiment with multi
programming and multiprocessing.
The Third Generation, 1964-1979
The third generation officially began in April 1964 with IBMs announcement of its
System/360 family of computers. Hardware technology began to use integrated circuits (ICs)
which yielded significant advantages in both speed and economy. Operating System
development continued with the introduction and widespread adoption of multiprogramming.
This marked first by the appearance of more sophisticated I/O buffering in the form of
spooling operating systems. These systems worked by introducing two new systems
programs, a system reader to move input jobs from cards to disk, and a system writer to move
job output from disk to printer, tape, or cards. The spooling operating system in fact had
multiprogramming since more than one program was resident in main storage at the same time.
Later this basic idea of multiprogramming was extended to include more than one active user
program in memory at time. To accommodate this extension, both the scheduler and the dispatcher
were enhanced. In addition, memory management became more sophisticated in order to assure
that the program code for each job or at least that part of the code being executed was resident
in main storage. Users shared not only the system hardware but also its software resources and file
system disk space.
The third generation was an exciting time, indeed, for the development of both computer
hardware and the accompanying operating system. During this period, the topic of operating
systems became, in reality, a major element of the discipline of computing.
The Fourth Generation, 1979 - Present
The fourth generation is characterized by the appearance of the personal computer and the
workstation. Miniaturization of electronic circuits and components continued and Large Scale
Integration (LSI), the component technology of the third generation, was replaced by Very
Large Scale Integration (VLSI), which characterizes the fourth generation. However,
improvements in hardware miniaturization and technology have evolved so fast that we now
have inexpensive workstation-class computer capable of supporting multiprogramming and time3
sharing. Hence the operating systems that supports todays personal computers and
workstations look much like those which were available for the minicomputers of the third
generation. Examples are Microsofts DOS for IBM-compatible personal computers and UNIX for
workstation.
However, many of these desktop computers are now connected as networked or
distributed systems. Computers in a networked system each have their operating system
augmented with communication capabilities that enable users to remotely log into any system on
the network and transfer information among machines that are connected to the network. The
machines that make up distributed system operate as a virtual single processor system from the
users point of view; a central operating system controls and makes transparent the location in
the system of the particular processor or processors and file systems that are handling any given
program.
CLASSIFICATION OF COMPUTERS
Computers are available in different shape, size and weights. Due to these different shapes and
sizes they perform different sorts of jobs from one another. A computer that is used in home differs in
size and shape from the computer being used in hospital.
calculations are done in 'parallel mode'. It is very easy to get graphical results directly using analog
computer. However, the accuracy of analog computers is less.
Digital Computer
A computer that operates with information, numerical or otherwise, represented in a digital
form is known as digital computer. Such computers process data (including text, sound, graphics and
video) into a digital value (in 0s and 1s).
Digital computers can give the results with more accuracy and at a faster rate. The accuracy
of such computers is limited only by the size of their registers and memory. The desktop PC is a
classic example of digital computer.
Hybrid Computer (Analog + Digital)
Hybrid computer incorporated the measuring feature of an analog computer and counting
feature of a digital computer. For computational purposes, these computers use the analog
components and for the storage of intermediate results, digital memories are used. To bind the
powers of analog and digital techniques, that is, analog to digital and digital to analog, the hybrid
computers comprehensively use converters. Such computers are broadly used in scientific
applications, various fields of engineering and industrial control processes.
BASED ON UTILITY
Based on utility computers are classified into two categories. They are General-purpose
Computers and Specific-purpose Computers
General-purpose Computers
A general-purpose computer, as the name suggests, is designed to perform a range of tasks.
These computers have the ability to store numerous programs. These machines can be used for
various applications, ranging from scientific to business-purpose applications. Even though such
computers are versatile, they generally lack in speed and efficiency.
The computers used in schools and homes are general-purpose computers.
Specific-purpose Computers
These computers are designed to handle a specific problem or to perform a single specific
task. A set of instructions for the specific task is built into the machine. Hence, they cannot be used
for other applications unless their circuits are redesigned, that is, they lack versatility. However,
being designed for specific tasks, they can provide the result very quickly and efficiently.
These computers are used for airline reservations, satellite tracking and air traffic control.
BASED ON SIZE AND CAPACITY
Based on size and Capacity computers are classified into four categories. They are Micro
Computers, Mini Computers, Mainframe Computers, and Super Computers.
Micro Computers
Micro computer is a small, low cost digital computer, which usually consists of
microprocessor, a storage unit, an input channel, and an output channel, all of which may be on one
chip inserted into one or several PC boards. It is the smallest of the computer family. They were
designed for individual users only, but nowadays they have become powerful tools for many
businesses that, when networked together, can serve more than one user.
IBM-PC Pentium 100, IBM-PC Pentium 200, and Apple Macintosh are examples.
Micro computers include desktop, laptop and hand-held computers.
Characteristics of Micro Computers
5
Mini Computers
A Mini computer is a small digital computer, which normally is able to process and store less
data than a mainframe but more than a micro computer.
It is also called as mid-range computer designed to meet the computing needs for several
people simultaneously in a small to medium size business environment. It is
a multiprocessing system capable of supporting from 4 to about 200 users simultaneously. It serves
as a centralized storehouse for cluster of work stations or as a network server.
Some of the widely used mini computers are PDP 11, IBM (8000 series) and VAX 7500.
Characteristics of Mini Computers
They have less memory & storage capacity than mainframe computers.
They are not very sensitive to the external environment and hence are more generalised.
Mainframe Computers
Mainframe is an ultra-high performance computer made for high-volume, processor-intensive
computing. It is very large and expensive computer capable of supporting hundreds, or even
thousands, of users simultaneously.
Mainframe computers are powerful computers used mainly by large organisations for critical
applications, typically bulk data processing such as census, industry and consumer statistics,
enterprise resource planning, and financial transaction processing.
Examples of mainframe computers are IBMs ES000, VAX 8000 and CDC 6600.
Characteristics of Mainframe Computers
6
They are big computer systems sensitive to temperature, humidity, dust etc.
Super Computers
Super computers are the special purpose machines, which are specially designed to maximise
the numbers of FLOPS (Floating point Operation Per Second). It has the highest processing speed at
a given time for solving scientific and engineering problems. They can resolve complex
mathematical equations in a few hours, which would have taken a scientist with paper and pencil a
lifetime, or years, using a hand calculator. It basically consists of number of CPUs that operate in
parallel to make it faster.
Examples of super computers are CRAY-3, Cyber 205, and PARAM.
Characteristics of Super Computers
They are the fastest, costliest and most powerful computers available today.
They are huge computers installed in space centres, nuclear power stations etc.
computers, palmtops are severely limited, but they are practical for certain functions such as phone
books and calendars. Palmtops that use a pen rather than a keyboard for input are often called handheld computers or PDAs (Personal Digital Assistant).
Because of their small size, most palmtop computers do not include disk drives. However,
many contain PCMCIA slots in which you can insert disk drives, modems, memory, and
other devices.
Desktop
This type of computer would contain most of the computer components, such as the CPU,
the hard disk, and the RAM, within a single case that would sit horizontally on a desktop. A monitor
would then sit on top of the desktop computer case, and an external mouse and keyboard would
attach to it.
Desktop models designed to be very small are sometimes referred to as slimline models. In
general, a desktop computer describes any traditional computer a home user uses.
Personal Computers
Personal computers are computers that are meant to be used by individuals in homes or
offices. Their retail prices, size, and capabilities make them practical for use in almost every home
and office in developed countries. The operation of these computers relies on a small computer
chip known as a microprocessor, which governs the functioning of the computer.
Workstations
A workstation is a high-end microcomputer designed for technical or scientific applications.
Intended primarily to be used by one person at a time, they are commonly connected to a local area
network and run multi-user operating systems.
Clients and Servers
Client/server describes the relationship between two computer programs in which one
program, the client, makes a service request from another program, the server, which fulfils the
request.
The client/server model has become one of the central ideas of network computing. Most
business applications being written today use the client/server model.
BASIC ORGANIZATION OF COMPUTERS
The task of performing operations like arithmetic and logical operations is called processing.
The Central Processing Unit (CPU) takes data and instructions from the storage unit and makes all
sorts of calculations based on the instructions given and the type of data provided. It is then sent back
to the storage unit.
4. Output Unit:
This is the process of producing results from the data for getting useful information. Similarly
the output produced by the computer after processing must also be kept somewhere inside the
computer before being given to you in human readable form. Again the output is also stored inside
the computer for further processing.
Types of Output device
Printing: Printer, Plotter
Sound: Speakers
Visual: Monitor
5. Control:
The manner how instructions are executed and the above operations are performed.
Controlling of all operations like input, processing and output are performed by control unit. It takes
care of step by step processing of all operations inside the computer.
CENTRAL PROCESSING UNIT (CPU)
The ALU and the CU of a computer system are jointly known as the central processing unit.
You may call CPU as the brain of any computer system. It is just like brain that takes all major
decisions, makes all sorts of calculations and directs different parts of the computer functions by
activating and controlling the operations.
MEMORY UNIT
The fundamental components of a general-purpose computer are arithmetic and logic unit,
control circuitry, storage space, and input/output devices. If storage was removed, the device we had
would be a simple calculator instead of a computer.
We can classify memory into two broad categories: Primary memory and Secondary memory.
Primary Memory
Primary storage or Internal memory or Main memory, is computer memory that is
accessible to the central processing unit of a computer without the use of computer's input/output
channels. It is the main area in a computer in which data is stored for quick access by the
computer's processor.
Primary Memory can be further classified into Random Access Memory (RAM) and Read Only
memory (ROM)
1)Random Access Memory
RAM is like the computers scratch pad. It allows the computer to keep track of what is
currently being processed.
It is much faster to read from and write to than the other kinds of storage in a computer like the
hard disk of floppy disk. However, RAM is volatile in nature; the data in RAM stays there only as
long as the computer is running. When the computer is turned off, RAM loses all its contents.
2) Read Only memory
ROM is a type of "built-in" memory that is capable of holding data and having that data read
from the chip, but not written to. Unlike Random Access Memory (RAM), ROM is nonvolatile which means it keeps its contents regardless if it has power or not. A good example of ROM
is EEPROM, which is a programmable ROM used for the computer BIOS.
Secondary Memory
Secondary Memory also known as auxiliary storage, secondary memory or external memory,
is used to store a large amount of data at lesser cost per byte than primary memory. It is the slowest
and cheapest form of memory. It cannot be processed directly by the CPU. It must first be copied
into primary storage (also known as RAM ). It non-volatile and persistent in nature and is not
directly accessed by a computer/processor. It allows a user to store data that may be instantly and
easily retrieved, transported and used by applications and services.
Secondary memory devices include magnetic disks like hard drives and floppy disks ; optical
disks such as CDs and CDROMs ; and magnetic tapes, which were the first forms of secondary
memory.
NUMBER SYSTEM
Binary
Decimal
Octal
Hexadecimal
0000
00
0001
01
0010
02
0011
03
0100
04
4
11
0101
05
0110
06
0111
07
1000
08
10
1001
09
11
1010
10
12
1011
11
13
1100
12
14
1101
13
15
1110
14
16
1111
15
17
DECIMAL NUMBERS
In the decimal number systems each of the ten digits, 0 through 9, represents a certain
quantity. The position of each digit in a decimal number indicates the magnitude of the quantity
represented and can be assigned a weight. The weights for whole numbers are positive powers of
ten that increases from right to left, beginning with 10 = 1 that is 10 10 10 10
For fractional numbers, the weights are negative powers of ten that decrease from left to
right beginning with 10-1 that is 10 10 10. 10-1 10-2 10-3
The value of a decimal number is the sum of digits after each digit has been multiplied by its
weights as in following examples
Express the decimal number 87 as a sum of the values of each digit.
The digit 8 has a weight of 10 which is 10 as indicated by its position. The digit 7 has a weight
of 1 which is 10 as indicated by its position.
1)
0
87 = (8 x 10 + (7 x 10 )
Express the decimal number 725.45 as a sum of the values of each digit.
725. 45 = (7 x 10) + (2 x 10) + (5 x 10) + (4 x 10-1) + (5 x 10-2) = 700 + 20 + 5 + 0.4 + 0.05
BINARY NUMBERS
The binary system is less complicated than the decimal system because it has only two
digits; it is a base- two system. The two binary digits (bits) are 1 and 0. The position of a 1 or 0 in a
binary number indicates its weight, or value within the number, just as the position of a decimal digit
determines the value of that digit. The weights in a binary number are based on power of two as:
4
2 1 0 -1 -2
.. 2 2 2 2 2 . 2 2 .
With 4 digits position we can count from zero to 15.In general, with n bits we can count up
to a number equal to K - 1. Largest decimal number = K - 1.A binary number is a weighted
number. The right-most bit is the least significant bit (LSB) in a binary whole number and has a
12
weight of 2 =1. The weights increase from right to left by a power of two for each bit. The leftmost bit is the most significant bit (MSB); its weight depends on the size of the binary number.
BINARY-TO-DECIMAL CONVERSION
The decimal value of any binary number can be found by adding the weights of all bits that
are 1 and discarding the weights of all bits that are 0
Example
Lets convert the binary whole number 101101 to decimal
5
Weight:
Binary no:
1 0
Value
Sum
32 0
=
8 4
0 1
0
45
HEXADECIMAL NUMBERS
The hexadecimal number system has sixteen digits and is used primarily as a compact way
of displaying or writing binary numbers because it is very easy to convert between binary and
hexadecimal. Long binary numbers are difficult to read and write because it is easy to drop or
transpose a bit. Hexadecimal is widely used in computer and microprocessor applications. The
hexadecimal system has a base of sixteen; it is composed of 16 digits and alphabetic characters.
The maximum 3-digits hexadecimal number is FFF or decimal 4095 and maximum 4-digit
hexadecimal number is FFFF or decimal 65.535.
BINARY-TO-HEXADECIMAL CONVERSION
Simply break the binary number into 4-bit groups, starting at the right-most bit and
replace each 4-bit group with the equivalent hexadecimal symbol as in the following example
Convert the binary number to hexadecimal: 1100101001010111
Solution:
1100 1010 0101 0111
C
A
5
7 = CA57
HEXADECIMAL-TO-DECIMAL CONVERSION
One way to find the decimal equivalent of a hexadecimal number is to first convert the
13
C
4
1100 = 2 + 2 + 2 = 16 +8+4 = 28
DECIMAL-TO-HEXADECIMAL CONVERSION
Repeated division of a decimal number by 16 will produce the equivalent hexadecimal
number, formed by the remainders of the divisions. The first remainder produced is the least
significant digit (LSD).
Each successive division by 16 yields a remainder that becomes a digit in the equivalent
hexadecimal number. When a quotient has a fractional part, the fractional part is multiplied by
the divisor to get the remainder.
Convert the decimal number 650 to hexadecimal by repeated division by 16
650 /16 = 40.625
0.625 x 16 = 10 = A (LSD)
40 /16 = 2.5
0.5 x 16 = 8
=8
2/16 = 0.125
0.125 x 16 = 2 = 2 (MSD)
The hexadecimal number is 28A
OCTAL NUMBERS
Like the hexadecimal system, the octal system provides a convenient way to express
binary numbers and codes. However, it is used less frequently than hexadecimal in conjunction
with computers and microprocessors to express binary quantities for input and output purposes.
The octal system is composed of eight digits, which are:
0, 1, 2, 3, 4, 5, 6, 7
To count above 7, begin another column and start over: 10, 11, 12, 13, 14, 15, 16, 17, 20, 21 and so
on. Counting in octal is similar to counting in decimal, except that the digits 8 and 9 are not used.
OCTAL-TO-DECIMAL CONVERSION
Since the octal number system has a base of eight, each successive digit position is an
increasing power of eight, beginning in the right-most column with 8. The evaluation of an octal
number in terms of its decimal equivalent is accomplished by multiplying each digit by its weight
and summing the products.
Lets convert octal number 2374 in decimal number.
Weight
Octal number
8 8
2 3
8 1 80
7 4
14
0.875 x 8 = 7 (LSD)
0.5 x 8 = 4
0.625 x 8 = 5 (MSD)
OCTAL-TO-BINARY CONVERSION
Because each octal digit can be represented by a 3-bit binary number, it is very easy to
convert from octal to binary.
Octal Digit
Binary
0
1
2
3
4
5
6
7
000 001 010 011 100 101 110 111
2
010
5
101
1 4
0
001 100 000
BINARY-TO-OCTAL CONVERSION
Conversion of a binary number to an octal number is the reverse of the octal-to-binary conversion.
Lets convert the following binary numbers to octal:
110 101
6
5 = 65
solving techniques like algorithms, flowcharts and pseudocodes are carried out in arriving at the
most efficient solution.
All the activities, which have to be performed by a user in order to solve a problem using
computer, are grouped into three phases,
Developing a program
o Identifying the logical structure
o Writing the computer program
o Debugging the program
ALGORITHM
To make a computer do anything, we have to write a computer program. To write a computer
program, we have to tell the computer, step by step, exactly what we want it to do. The computer
then "executes" the program, following each step mechanically, to accomplish the end goal.
When we are telling the computer what to do, we also get to choose how it's going to do it.
That's where computer algorithms come in. The algorithm is the basic technique used to get the job
done.
An Algorithm is a process or set of rules to be followed in calculations or other problemsolving operations, especially by a computer.
Algorithms help a programmer in breaking down the solution of a problem into a number of
sequential steps. Corresponding to each step, a statement is written in a programming language; all
these statements are collectively termed as a program. The following is an example of an algorithm
to add integers and display the result:
There is a time and space complexity associated with each algorithm. Time complexity
specifies the amount of time required by an algorithm for performing the desired task. Space
complexity specifies the amount of memory space required by an algorithm for performing the
desired task. When solving a complex problem, it is possible to have more than one algorithm to
provide the required solution. The algorithm that takes less time and requires less memory space is
the best one.
Characteristics of an algorithm
The various characteristics that are necessary for a sequence of instruction to qualify as an
algorithm are:
The instruction must be in an ordered form.
The instruction must be simple and concise. They must not be ambiguous.
There must be an instruction (condition) for program termination.
The repetitive programming constructs must possess an exit condition. Otherwise, the
program might run infinitely.
The algorithm must completely and definitely solve the given problem statements.
16
17
1. Complex logic: Sometimes, the program logic is quite complicated. In that case, flowchart
becomes complex and clumsy.
2. Alterations and Modifications: If alterations are required the flowchart may require redrawing completely.
3. Reproduction: As the flowchart symbols cannot be typed, reproduction of flowchart
becomes a problem.
4. The essentials of what is done can easily be lost in the technical details of how it is done.
Flowchart Symbols
GUIDELINES FOR DRAWING A FLOWCHART
Flowcharts are usually drawn using some standard symbols; however, some special symbols
can also be developed when required. Some standard symbols, which are frequently required for
flowcharting many computer programs.
The following are some guidelines in flowcharting:
a. In drawing a proper flowchart, all necessary requirements should be listed out in logical
order.
b. The flowchart should be clear, neat and easy to follow. There should not be any room for
ambiguity in understanding the flowchart.
c. The usual direction of the flow of a procedure or system is from left to right or top to
bottom.
d. Only one flow line should come out from a process symbol.
18
or
e. Only one flow line should enter a decision symbol, but two or three flow lines, one for
each possible answer, should leave the decision symbol.
<
0
>
0
<
0
>
0
=
0
If the flowchart becomes complex, it is better to use connector symbols to reduce the
number of flow lines. Avoid the intersection of flow lines if you want to make it more effective and
better way of communication.
g.
19
Sample flowchart
Draw a Flowchart for calculating the roots of quadratic equation.
20
PSEUDOCODES
Analysing detailed algorithms before developing a program is very time consuming. Hence,
there arises a need of a specification that only focuses on the logic of the program. Pseudocodes serve
this purpose by specifying only the logic, which is used by the programmer for developing a
computer program.
Pseudocode is not written using specific syntax of a programming language, rather it is
written with a combination of generic syntax and normal English language, it helps the programmer
understand the basic logic of the programe after which it is the programmers choice to write the final
code in any programming language.
Sample Pseudocode
A pseudocode to add two numbers and display the result
BEGIN
Define: integer num1, num2, result.
Input: integer num1.
Input: integer num2.
Sum: result = num1 + num2
Output: display (result).
END
After the pseudocodes for a computer program has been written, it is used develop the source code
for the computer program. The source code is developed using a programming language, which can
be an assembly language or a high-level programming language. After the source code has been
written, the programmer detects and eliminates any errors in the program so that the program
generates the desired output on execution.
Advantage of pseudocodes
Some of the key advantage of using a flowchart in program design is:
Pseudocode is easy to comprehend as it used English phrases for writing program
instructions.
Developing program code using pseudocode is easier in comparison to developing the
program code from scratch.
Developing program code using pseudocode is also easier in in comparison to developing the
program code from flowchart.
The pseucode instructions are easier to modify in comparison to a flowchart.
The use of pseudocode works well for large program design.
Disadvantage of pseudocodes
Pseudocodes also have certain limitations, such as:
Since, pseudocode does not use any kind of pictorial representations for program elements; it
may at times become difficult to understand the program logic.
There is no standard format for developing a pseudocode. Therefore, it may become a
challenge to use the same pseudocode by different programmers.
Pseudocodes are at a disadvantage in comparison to flowchart when it comes to
understanding the flow of program control.
21
UNIT I
INTRODUCTION
SAMPLE TWO MARKS QUESTIONS WITH ANSWERS
1. Define computers?
A computer is a programmable machine or device that performs pre-defined or programmed
computations or controls operations that are expressible in numerical or logical terms at high speed
and with great accuracy.
(Or)
Computer is a fast operating electronic device, which automatically accepts and store input data,
processes them and produces results under the direction of step by step program.
2. Why computer is known as data processing system? (MAY 2009)
Any process that uses a computer program will enter data and summarize, analyze or
otherwise convert data into usable information. The process may be automated and run on a
computer. It involves recording, analysing, sorting, summarizing, calculating, disseminating and
storing data. Thus Computer is known as data processing system.
3. How will you classify computer systems? (JAN2009)
Based on physical size, performance and application areas, we can generally divide
computers into four major categories:
Micro computer
Mini Computer
Mainframe computer and
Super Computer
4. Specify the Electronic components used for different computer
generations.
Generation
s
I Generation
II
Generation
III
Generation
IV
Generation
V
Generation
Electronic
Components
Vacuum tubes
Transistors
Integrated Circuits
Microprocessors
Artificial Intelligence
Languages used
Machine Language.
Assemble Language,
Mnemonics
22
III Generation
Example:
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 for playing games.
Examples:
Floppy disk storage media
Hard disk
CD / DVD
Pen drive
Memory chips etc.
17. What are the positional number systems and what is their base?
Number System
Decimal Number System
Binary Number System
Octal Number System
HexaDecimal Number System
Base
10
2
8
16
18. Write the binary and octal equivalent of hexadecimal number 7BD? (APR2009)
Binary Equivalent of 7BD = (0111 1011 1101)2
Octal Equivalent of 7BD = (011 110 111 101) = (3675)8
19. Convert binary number 100110 into its octal equivalent? (JAN2009)
Octal equivalent of 100110 = (100 110) = (46)8
20. Differentiate analog and digital computers? (JAN2010)
S No.
1
2
3
4
Analog Computer
Process measured data
Analog computers are not precise
Processing speed is low.
Less accuracy.
Digital Computer
Process discrete data
Digital computers are more precise
Processing speed is high.
More accuracy.
25