Академический Документы
Профессиональный Документы
Культура Документы
GENERATION OF 5
COMPUTERS
TYPES OF COMPUTERS 10
FUNCTIONAL UNITS OF 13
A COMPUTER
NUMBER SYSTEM 15
LOGICAL ANALYSIS 22
AND THINKING
PROGRAM 24
DEVELOPMENT
LIFECYCLE
ALGORITHM 26
FLOWCHART 28
PSEUDOCODE 38
1
UNIT -1 INTRODUCTION
W H AT IS A C OM P U T E R
Computer is derived from a Latin word “computare” which means to “to calculate”,“to
count”, “to sum up” or “to think together”. So, more precisely the word computer means a
"device that performs computation".
A computer is an electronic machine that accepts information, stores it until the information
is needed, processes the information according to the instructions provided by the user, and finally
returns the results to the user. The computer can store and manipulate large quantities of data at very
high speed, but a computer cannot think. A computer makes decisions based on simple comparisons
such as one number being larger than another. Although the computer can help solve a tremendous
variety of problems, it is simply a machine. It cannot solve problems on its own.
H IST O RY OF C OM P U T E R S
INTRODUCTION
Since civilizations began, many of the advances made by science and technology have
depended upon the ability to process large amounts of data and perform complex mathematical
calculations. For thousands of years, mathematicians, scientists and businessmen have searched for
computing machines that could perform calculations and analyze data quickly and efficiently. One
such device was the abacus.
The abacus was an important counting machine in ancient Babylon, China, and throughout
Europe where it was used until the late middle ages. It was followed by a series of improvements in
mechanical counting machines that led up to the development of accurate mechanical adding
machines in the 1930’s. These machines used a complicated assortment of gears and levers to
perform the calculations but they were far to slow to be of much use to scientists. Also, a machine
capable of making simple decisions such as which number is larger was needed. A machine capable
of making decisions is called a computer.
The first computer like machine was the Mark I developed by a team from IBM and Harvard
University. It used mechanical telephone relays to store information and it processed data entered
on punch cards. This machine was not a true computer since it could not make decisions.
2
In June 1943, work began on the world's first electronic computer. It was built at the
University of Pennsylvania as a secret military project during World War II and was to be used to
calculate the trajectory of artillery shells. It covered 1500 square feet and weighed 30 tons. The
project was not completed until 1946 but the effort was not wasted. In one of its first
demonstrations, the computer solved a problem in 20 seconds that took a team of mathematicians
three days. This machine was a vast improvement over the mechanical calculating machines of the
past because it used vacuum tubes instead of relay switches. It contained over 17,000 of these tubes,
which were the same type tubes used in radios at that time.
The invention of the transistor made smaller and less expensive computers possible.
Although computers shrank in size, they were still huge by today’s standards. Another innovation to
computers in the 60’s was storing data on tape instead of punch cards. This gave computers the
ability to store and retrieve data quickly and reliably.
HISTORY OF COMPUTER
Until the development of the first generations computers based on vacuum tubes, there had been
several developments in the computing technology related to the mechanical computing devices. The
key development that took place till the first computer was developed is as follows:
1. Calculating machine
2. Napier’s Bones
3. Slide Rule
4. Pascal’s Addition& Subtraction Machine
5. Leibniz's Multiplication and diving machine
6. Punch card System
7. Babbage’s Analytical Engine
8. Hollerith’s Punched card Tabulating Machine
1. Calculating machine:
ABACUS was the first mechanical calculating device for counting of large numbers.
The word ABACUS means calculating board.
It consists of bars in horizontal positions on which sets of beads are inserted. The horizontal
bars have 10 beads each, representing units, tens, hundreds, etc.
2. Napier’s Bones:
Napier’s bones was a mechanical device built for the purpose of multiplication in 1671 AD.
Invented by an English mathematician John Napier.
3. Slide Rule:
Slider rule was developed by English Mathematician Edmund Gunter in the 16th century.
Using the slide rule, one could perform operations like addition, subtraction, multiplication
and division.
It was used extensively till late 1970s.
3
Abacus Napier’s Bones Slide Rule
4
8. Hollerith’s Punched card Tabulating Machine:
Hollerith’s Punched card Tabulating Machine was invented by Herman Hollerith.
The machine could read the information from a punched card and process it electronically.
GENERATION OF COMPUTERS
The first computers used vacuum tubes for circuitry and magnetic drums for memory, and
were often enormous, taking up entire rooms. They were very expensive to operate and in addition to
using a great deal of electricity, generated a lot of heat, which was often the cause of malfunctions.
The UNIVAC (Universal Automatic Computer IBM 701), ENIAC (Electronic Numerical
Integrator And Calculator) computers, EDSAC (Electronic Delay Storage Automatic Calculator )
and EDVAC (Electronic Discrete Variable Automatic Computer ) are examples of first-generation
computing devices.
Vacuum tubes were used – basic arithmetic operations took few milliseconds.
Consume more power with limited performance
High cost
Uses assembly language – to prepare programs. These were translated into machine level
language for execution.
Mercury delay line memories and Electrostatic memories were used Fixed point arithmetic
was used 100 to 1000 fold increase in speed relative to the earlier mechanical and relay based
electromechanical technology .
Punched cards and paper tape were invented to feed programs and data and to get results.
Magnetic tape / magnetic drum were used as secondary memory.
Mainly used for scientific computations.
5
Second Generation (1956-1963) Transistors
Transistors replaced vacuum tubes in the second generation of computers. The transistor was
invented in 1947 but did not see widespread use in computers until the late 1950s. The transistor was
far superior to the vacuum tube, allowing computers to become smaller, faster, cheaper, more
energy-efficient and more reliable than their first-generation predecessors. Though the transistor still
generated a great deal of heat that subjected the computer to damage, it was a vast improvement over
the vacuum tube. Second-generation computers still relied on punched cards for input and printouts
for output.
The first computers of this generation were developed for the atomic energy industry.
(Manufacturers – IBM 7030, Digital Data Corporation’s PDP 1/5/8 Honeywell 400)
Transistors were used in place of vacuum tubes. (invented at AT&T Bell lab in 1947)
Small in size
Lesser power consumption and better performance
Lower cost
Magnetic ferrite core memories were used as main memory which is a random-
access nonvolatile memory
Magnetic tapes and magnetic disks were used as secondary memory Hardware for
floating point arithmetic operations was developed.
High level languages such as FORTRAN, COBOL etc were used - Compilers
were developed to translate the high-level program into corresponding
assembly language program which was then translated into machine language.
6
The development of the integrated circuit was the hallmark of the third generation of
computers. Transistors were miniaturized and placed on silicon chips, called semiconductors, which
drastically increased the speed and efficiency of computers.
Instead of punched cards and printouts, users interacted with third generation computers through
keyboards and monitors and interfaced with an operating system, which allowed the device to run
many different applications at one time with a central program that monitored the memory.
Computers for the first time became accessible to a mass audience because they were smaller and
cheaper than their predecessors.
(System 360 Mainframe from IBM, PDP-8 Mini Computer from Digital Equipment Corporation)
Faster processors
In the beginning magnetic core memories were used. Later they were replaced
by semiconductor memories (RAM & ROM)
Introduced microprogramming
Cache and virtual memories were introduced (Cache memory makes the main
memory appear faster than it really is. Virtual memory makes it appear larger)
High level languages were standardized by ANSI eg. ANSI FORTRAN, ANSI
COBOL etc Database management, multi-user application, online systems like
closed loop process control, airline reservation, interactive query systems,
automatic industrial control etc emerged during this period.
7
of the computer—from the central processing unit and memory to input/output controls—on a single
chip.
In 1981 IBM introduced its first computer for the home user, and in 1984 Apple introduced
the Macintosh. Microprocessors also moved out of the realm of desktop computers and into many
areas of life as more and more everyday products began to use microprocessors.
As these small computers became more powerful, they could be linked together to form
networks, which eventually led to the development of the Internet. Fourth generation computers also
saw the development of GUIs, the mouse and handheld devices.
(Intel’s 8088,80286,80386,80486 .., Motorola’s 68000, 68030, 68040, Apple II, CRAY I/2/X/MP
etc)
Fifth generation computing devices, based on artificial intelligence, are still in development, though
there are some applications, such as voice recognition, that are being used today. The use of parallel
processing and superconductors is helping to make artificial intelligence a reality. Quantum
computation and molecular and nanotechnology will radically change the face of computers in years
to come. The goal of fifth-generation computing is to develop devices that respond to natural
language input and are capable of learning and self-organization.
IBM notebooks, Pentium PCs-Pentium 1/2/3/4/Dual core/Quad core. SUN work stations,
Origin 2000, PARAM 10000, IBM SP/2 are examples for V generation.
Generation number beyond IV, have been used occasionally to describe some current
computer system that have a dominant organizational or application driven feature.
Computers based on artificial intelligence are available
Computers use extensive parallel processing, multiple pipelines, multiple processors etc
8
Massive parallel machines and extensively distributed system connected by
communication networks fall in this category.
Introduced ULSI (Ultra Large Scale Integration) technology – Intel’s Pentium 4
microprocessor contains 55 million transistors millions of components on a
single IC chip.
Superscalar processors, Vector processors, SIMD processors, 32 bit micro
controllers and embedded processors, Digital Signal Processors (DSP) etc have
been developed.
Memory chips up to 1 GB, hard disk drives up to 180 GB and optical disks up
to 27 GB are available (still the capacity is increasing)
Object oriented language like JAVA suitable for internet programming has
been developed. Portable note book computers introduced
Storage technology advanced – large main memory and disk storage available
Introduced World Wide Web. (and other existing applications like e-mail, e
Commerce, Virtual libraries/Classrooms, multimedia applications etc.)
Quantum mechanism and nanotechnology will radically change the phase of computers.
TYPES OF COMPUTERS
1. Super Computers
2. Main Frame Computers
3. Mini Computers
4. Micro Computers
1. Super Computers
E.g.:- CRAY Research :- CRAY-1 & CRAY-2, Fujitsu (VP2000), Hitachi (S820) , NEC (SX20),
PARAM 10000 by C-DAC, Anupam by BARC, PACE Series by DRDO
9
Most powerful Computer system - needs a large room
Minimum world length is 64 bits
CPU speed: 100 MIPS Equivalent to 4000 computers
High cost: 4 – 5 millions
Able to handle large amount of data
High power consumption
High precision
Large and fast memory (Primary and Secondary)
Uses multiprocessing and parallel processing
Supports multiprogramming
Applications
In petroleum industry - to analyze volumes of seismic data which are gathered during
oil seeking explorations to identify areas where there is possibility of getting petroleum
products inside the earth
2. Main Frame Computers E.g.:- IBM 3000 series, Burroughs B7900, Univac 1180, DEC
Able to process large amount of data at very high speed
10
Supports network of terminals
Applications
Used to process large amount of data at very high speed such as in the case of Banks/
Insurance Companies/ Hospitals/ Railway which need online processing of large
number of transactions and requires massive data storage and processing capabilities
Used as controlling nodes in WANs (Wide Area Networks) Used to mange large centralized
databases
3. Mini Computers E.g.:- Digital Equipments PDP 11/45 and VAX 11) Perform better than micros
Large in size and costlier than micros
Designed to support more than one user at a time
Posses large storage capacities and operates at higher speed Support faster peripheral devices
like high speed printers
Can also communicate with main frames
Applications
These computers are used when the volume of processing is large for e.g. Data
processing for a medium sized organization
Used to control and monitor production processes
To analyze results of experiments in laboratories
Used as servers in LANs (Local Area Networks)
Applications
Used in the field of desktop publishing, accounting, statistical analysis, graphic designing,
investment analysis, project management, teaching, entertainment etc
11
Cost Speed Applications
has not change. The internal architecture of computers differs from one system
model to another. A block diagram of the basic computer organization specifying
12
different functional units is shown below. Here the solid lines indicate the flow of
instruction and data and the dotted lines represent the control exercised by the
control unit.
Secondary
Storage
Program Information
& Data Input Unit Output Unit (Result)
Primary
Storage
Control
Unit
ALU
13
INPUT UNIT
Input unit accepts coded information from human operators through electromechanical
devices such as the keyboard or from other computers over digital communication lines. The
information received is either stored in the memory for later reference or immediately used by
the Arithmetic and Logic circuitry to perform the desired operation. Finally the result is sent
back to the outside through the output unit.
The keyboard is wired so that whenever a key is pressed, the corresponding letter or digit is
automatically translated into its corresponding code and sent directly to either the memory or
the processor.
Other kinds of input devices: Joy stick, track ball, mouse (pointing devices), scanner etc.
MEMORY UNIT
The memory unit stores program and data. There are two classes of memory devices
:-Primary memory and Secondary memory.
Primary memory (Main memory)
Contains a large number of semiconductor cells each capable of storing one bit of
information
These cells are processed in group of fixed size called words containing ‘n’ bits. The
main memory is organized such that the contents of one word can be stored or retrieved
in one basic operation.
For accessing data, a distinct address is associated with each word location. Data and
programs must be in the primary memory for execution.
Number of bits in each word is called the word length and it may vary from 16 to 64 bits. Fast
memory
Expensive
Time required to access one word is called Memory Access Time - 10nS to 100nS. This
time is fixed and independent of the location.
E g. Random Access Memory (RAM)
Secondary storage
They are used when large amount of data have to be stored (also when frequent access
is not necessary)
E.g. Hard Disk, Compact Disk, Floppy Disk, Magnetic Tapes etc.
PROCESSOR UNIT
The heart of the computer system is the Processor unit.
It consists of Arithmetic and Logic Unit and Control Unit.
Control Unit
14
The operations of all the units are coordinated by the control unity (act as the nerve
centre that sends control signal to other units)
Timing signal that governs the I/O transfers are generated by the Control
Unit. Synchronization signals are also generated by the Control Unit
By selecting, interpreting and executing the program instructions the program
instructions the control unit is able to maintain order and direct the operation of the
entire system.
The control unit and ALU’s are usually many times faster than other devices connected to a
computer system. This enabled a single processor to control a number of external devices such
as video terminals, magnetic taped, disk memories, sensors, displays and mechanical
controllers which are much slower than the processor.
OUTPUT UNIT
Counter part of input unit
Output devices accept binary data from the computer - decodes it into original form and
supplies this result to the outside world.
E.g. Printer, Video terminals (provides both input & output functions), graphic displays etc
Number System
Binary Decimal Octal hexadecimal
0000 00 0 0
0001 01 1 1
0010 02 2 2
0011 03 3 3
0100 04 4 4
0101 05 5 5
0110 06 6 6
0111 07 7 7
1000 08 10 8
1001 09 11 9
1010 10 12 A
1011 11 13 B
1100 12 14 C
1101 13 15 D
1110 14 16 E
1111 15 17 F
Introduction:
Numbers are created by the combination of digits. The digits of a number have 2 kinds of values:
Face value :
The face value of a digit is the digit located at that position. For example in decimal number
52, face value at position 0 is 2 and face value at position 1 is 5.
Position value: The position values of digit is(base position). For example in decimal number 52,
the position values of digit 2 is 10 0 and the position value of the digit 5 is 101
15
The number is calculated as the sum of face values * base position of each of the number. For decimal
number 32,
3*10 1 + 2*10 0 = 30+2=>32
In a Base r (or) Radix r is the total numbers of digits available in the number system.
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 representedand can
be assigned a weight. The weights for whole numbers are positive powers of ten thatincreases 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¯¹ that is 10² 10¹ 10º. 10¯¹ 10¯² 10¯³The value of a decimal number is the sum of
digits after each digit has been multiplied by itsweights .
It consists of 10 numbers: 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9.
The base value of decimal number system is 10
Example: 129, 0.45, 129.45
The position value and quantity of a digit at different positions are as follows:
Position 3 2 1 . -1 -2 -3
3 2 1 -1 -2
Position value 10 10 10 . 10 10 10-3
Quantity 1000 100 10 . 1/10 1/100 1/1000
2. Binary number system: The binary system is less complicated than the decimal system because
it has only two digits, it is abasetwo system. The two binary digits (bits) are 1 and 0. The position
of a 1 or 0 in a binarynumber indicates its weight, or value within the number, just as the position
of a decimal digitdetermines the value of that digit. The weights in a binary number are based on
power of two as:
….. 24 2³ 22 21 20. 2-1 2-2 ….
With 4 digits position we can count from zero to 15.In general, with n bits we can count up to
anumber equal to Ķ - 1. Largest decimal number = Ķ - 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
weight of2º =1. The weights increase from right to left by a power of two for each bit. The left-
most bitis the most significant bit (MSB); its weight depends on the size of the binary number.
16
It consists of only 2 numbers: 0 and 1
The base value of binary number system is 2
Example: 01010,0.01010,
The position value and quantity of a digit at different positions are as follows:
Position 3 2 1 . -1 -2 -3
3 2 1 -1 -2
Position value 2 2 2 . 2 2 2-3
Quantity 8 4 2 . 1/2 1/4 1/8
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.
Thehexadecimal 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-
digithexadecimal number is FFFF or decimal 65.535.
It consists of 16 number: 0,1,2,3,4,5,6,7,8,9, and A to represent 10 & B,C,D,E,F for
11,12,13,14,15 respectively.
The base value of octal number system is 16
Example: 742,0.125,127.651
The position value and quantity of a digit at different positions are as follows:
Position 3 2 1 . -1 -2 -3
3 2 1 -1 -2
Position value 16 16 16 . 16 16 16-3
Quantity 4096 256 16 . 1/16 1/256 1/4096
17
DECIMAL BINARY OCTAL HEXADECIMAL
0 0000 000 0
1 0001 001 1
2 0010 002 2
3 0011 003 3
4 0100 004 4
5 0101 005 5
6 0110 006 6
7 0111 007 7
8 1000 010 8
9 1001 011 9
10 1010 012 A
11 1011 013 B
12 1100 014 C
13 1101 015 D
14 1110 016 E
15 1111 017 F
16 10000 020 10
18
For Decimal to Hexadecimal - Divide by 16
2 25 8 25 16 25
2 12 - 1 3 -1 1 -9
2 6 -0
2 3 -0
1 -1
The method used for the conversion of integer part of binary, octal and
hexadecimal number to decimal number is the same. This conversion operation is uses the face
value and position value of digits. The steps for conversion are as follows:
Find the sum of Face Value*(From BASE) position for each digit in the number.
i. In a non-fractional number, the right most digits have position 0 and the position increases as
we go towards the left.
ii. In a fractional number, the first digit right to the right of the decimal point as position -1 and it
decreases as we go the right.(-2,-3,etc)
For Example:
19
III.Conversion of binary to octal, hexadecimal
A binary number can be converted into octal and hexadecimal number using a shortcut method. The
shortcut method is based on the following:
An octal digit from 0 to 7 can be represented as a combination of 3 bits.
A hexadecimal digit from 0 to 15 can be represented as a combination of 4 bits.
(1100110001.00111101)2 = ( ?) 8 (1100110001.00111111)2 = ( ?) 16
1 100 110 001 . 00 111 101 11 0011 0001 . 0011 1111
1 4 6 1 . 0 7 5 3 3 1 . 3 F
(1100110001.00111101)2 = ( 1461.075) 8 (1100110001.00111111)2 = ( 331.3F) 16
20
IV.Conversion of Octal, Hexadecimal To Binary
The conversion of a number from octal and hexadecimal to binary uses the
inverse of the previous conversion.
The steps for octal to binary conversions:
Convert each octal number into a three-digit binary number`
The result is the number formed by the combination of all the bits
Program Design is the phase of computer program development in which the hardware and software
resources needed bythe program are identified and the logic to be used by the program isdetermined.
Program Design consists of the steps ,a programmer should do before they start coding the program
21
in a specific language.These steps when properly documented will make the completed program
easier for other programmers to maintain in the future.
The programming process is similar in approach and creativity to
writing a paper. In composition, you are writing to express ideas; in programming you are expressing
a computation. Both the programmer and the writer must adhere to the syntactic rules (grammar) of
aparticular language. In prose, the fundamental idea-expressing unit isthe sentence; in programming,
two units - statements and comments -are available.
An important difference between programming and composition is that in programming
you are writing for two audiences:people and computers. As for the computers, what you write is
“read”by interpreters and compilers specific to the language you used. Theyare very rigid about
syntactic rules, and perform exactly thecalculations you say.Humans demand even more from
programs. This audienceconsists of two main groups, whose goals can conflict. The larger ofthe two
groups consists of users. Users care about how the programpresents itself, its user interface, and how
quickly the program runs,how efficient it is. To satisfy this audience, programmers may
usestatements that are overly terse because they know how to make theprogram more readable by the
computer’s compiler, enabling thecompiler to produce faster, but less human-intelligible program.
Thisapproach causes the other portion of the audience, i.e. programmers, toboo and hiss. The smaller
audience, of which you are also a member,must be able to read the program so that they can enhance
and/orchange it.A characteristic of programs is that you and others will seek tomodify your program
in the future.
The program’s meaning isconveyed by statements, and is what the computer
interprets. Humansread this part, which in virtually all languages bears a strongrelationship to
mathematical equations, and also read comments.Comments are not read by the computer at all, but
are there to helpexplain what might be expressed in a complicated way byprogramming language
syntax. The document or program you writetoday should be understandable tomorrow, not only by
you, but also byothers. The program’s organization should be easy to follow and theway you write the
program, using both statements and comments.
Activities involved in program design:
There are three broad areas of activities that are considered during program design:
Understanding the Program
Using Design Tools to Create a Model
Develop Test Data
Understanding the Program:
22
If you are working on a project as a one of many programmers,the system analyst may have created a
variety of documentation itemsthat will help you understand what the program is to do. These
couldinclude screen layouts, narrative descriptions, documentation showing the processing steps, etc.
Understanding the purpose of a programusually involves understanding it's:
Inputs
Processing
Outputs
This IPO approach works very well for beginningprogrammers. Sometimes, it might help to visualize
the programmingrunning on the computer. You can imagine what the monitor will looklike, what the
user must enter on the keyboard and what processing ormanipulations will be done.
Using Design Tools to Create a Model:
At first you will not need a hierarchy chart because your first programs will not be complex. But as
they grow and become more complex, you will divide your program into several modules (or
functions).
The first modelling tool you will usually learn is pseudocode.You will document the logic
or algorithm of each function in yourprogram. At first, you will have only one function, and thus
yourpseudocode will follow closely the IPO approach above.There are several methods or tools for
planning the logic of aprogram. They include: flowcharting, hierarchy or structure charts,pseudocode,
etc. Programmers are expected to be able to understandand do flowcharting and pseudocode. Several
standards exist forflowcharting and pseudocode and most are very similar to each other.However,
most companies have their own documentation standardsand styles. Programmers are expected to be
able to quickly adapt toany flowcharting or pseudocode standards for the company at whichthey
work.Understanding the logic and planning the algorithm on paperbefore you start to code is very
important concept. Many studentsdevelop poor habits and skipping this step is one of them.
23
4) Module/program evaluation and testing, during which yourefine the program and find errors.
5) Program documentation, which pervades all other phases.The result of following these steps is an
efficient, easy-to-useprogram that has a user’s guide (how does someone else run yourprogram) and
internal documentation so that other programmers candecipher the algorithm.
PROGRAM DEVELOPMENT LIFE CYCLE
A program is needed to instruct the computer about the way a task is to be performed. The n in a
program have 3 essential parts:
i. Instructions to accept the input data needs to be processed.
ii. Instructions that will act upon the input data and process it, and
iii. Instructions to provide the output to the user.
Instructions in a program are defined in specific sequence. Writing a computer program is not a
straight forward task. A person who writes the computer program has to follow the Program
Development Life Cycle (PDLC).The following are the phases of Program Development Life Cycle.
1. Problem Analysis
2. Program Design
3. Program Development
4. Program Documentation and Maintenance.
1. Problem Analysis:
The programmer first understands the problem to be solved. The programmer determines the
various ways in which the problem can be solved, and decides upon a single solution which will be
followed to solve the problem.
2. Program Design:
The selected solution is represented in a form, so that can be coded. This requires the three steps:
A. An Algorithm is written, which is an English-like explanation of the solution.
B. a Flowchart is drawn, which is a diagrammatic representation of the solution. The solution is
represented diagrammatically, for easy understanding and clarity.
C. Pseudo code is written for the selected solution. Pseudo code uses the structured programming
constructs. The Pseudo code becomes an input to the next phase.
3. Program Development:
The computer programming languages are of different kinds.- low-level languages, and high-level
languages like C,C++ and Java. The Pseudo code is coded using a suitable programming language.
b. The coded Pseudo code are program, is compiled for any syntax error. The syntax error arise due to
the incorrect use of the programming languages or due to the grammatical error with respect to the
programming languages used. Using compilation, the syntax errors, if any, are removed.
C. the successfully compiled program is now ready for execution.
D. The executed program generates the output result, which may be correct or incorrect. The program
is tested with various inputs, to see that it generates the desired results. If incorrect results are
24
displayed, then the program has semantic errors (logical error). The semantic errors are removed the
program to get the correct the correct results.
E. The successfully tested program is ready for use and is installed on the user machine.
4. Program Documentation and Maintenance:
The program is properly documented, so that later on, anyone can use it and understand it’s working. Any changes
made to the program after installation, forms the part of the maintenance of program. The program may require
updating, fixing of errors etc. during the maintenance phase.
S.No Name of the phase Action taken
ALGORITHM
In mathematics, computer science, and related subjects, an algorithm is a finite sequence of steps
expressed for solving a problem. An algorithm can be defined as “a process that performs some
sequence of operations in order to solve a given problem”. Algorithms are used for calculation, data
processing, and many other fields. In computing, algorithms are essential because they serve as the
25
systematic procedures that computers require. A good algorithm is like using the right tool in the
workshop.
Properties of an algorithm:
1. Finiteness:
2. Definiteness:
3. There must be no ambiguity in instructions.
4. There should not be any uncertainty in which instruction to be executed next.
5. The algorithm must be general enough to deal with any problem.
The primary factors that are used to judge the quality of the algorithm:
Time
Memory
Accuracy
Sequence
Generability
26
Abstraction: Algorithms provide a level of abstraction in solving problems because many seemingly
complicated problems can be distilled into simpler ones for which well known
algorithms exist.
Reusability: Algorithms are often reusable in many different situations.
Benefits of algorithm
Development of procedure
Consistency
Improvement
Efficiency
The use of algorithms provides a number of benefits. One ofthese benefits is in thedevelopment of the
procedure itself, which involves identification of the processes, major decision points, and variables
necessary to solve the problem. Developing an algorithm allows and even forces examination of the
solution process in arational manner.
Identification of the processes and decision pointsreduces the task into a series of smaller steps of
more manageable size.Problems that would be difficult or impossible to solve in entirety canbe
approached as a series of small, solvable sub-problems.
27
Consistency comes from both the use of the same specifiedprocess and increased skill in applying the
process.
A final benefit of the use of an algorithm comes from theimprovement it makes possible. As
timegoes by and results are compared with goals, the existence of aspecified solution process allows
identification of weaknesses anderrors in the process. Reduction of a task to a specified set of steps
oralgorithm is an important part of analysis, control and evaluation.
Flowchart
Flowchart - A visual representation of the sequence of steps and decisions needed to perform a
process.
Each step in the sequence is noted within a diagram shape. Steps are linked by
connecting lines and directional arrows. This allows anyone to view the flowchart and logically
follow the process from beginning to end.
28
For example, consider that we need to find the sum, average and product of 3 numbers given by the
user.
FLOW CHART
29
When to Use a Flowchart:
To communicate to others how a process is done.A flowchart is generally used when a new
project begins in order to plan for the project.
A flowchart helps to clarify how things are currently workingand how they could be
improved. It also assists in finding thekey elements of a process, while drawing clear lines
betweenwhere one process ends and the next one starts.
Flowcharts are used to help team members, to identify whoprovides inputs or resources to
whom, to establish importantareas for monitoring or data collection, to identify areas
forimprovement or increased efficiency, and to generatehypotheses about causes.
Flowcharts are very useful for documenting a process (simpleor complex) as it eases the
understanding of the process.
Flowcharts are also very useful to communicate to others how aprocess is performed and
enables understanding of the logic ofa process.
30
What Kinds of Flowcharts are there?
swimlane flowcharts,
data flow diagrams,
influence diagrams,
workflow diagrams,
process flow diagrams,
and many more.
project planning
31
program or system design
process documentation
audit a process for inefficiencies or malfunctions
map computer algorithms
and many more.
For most flowcharts, these five basic symbols are all you will need.
Name
Symbol Description
(alias)
Show a Process or action step. This is the most common symbol in both
Process
process flowcharts and process maps.
A Predefined Process symbol is a marker for another process step or
series of process flow steps that are formally defined elsewhere. This
Predefined shape commonly depicts sub-processes (or subroutines in programming
Process flowcharts). If the sub-process is considered "known" but not actually
(Subroutine) defined in a process procedure, work instruction, or some other process
flowchart or documentation, then it is best not to use this symbol since it
implies a formally defined process.
As the shape name suggests, this flowchart symbol is used when the
Alternate
process flow step is an alternate to the normal process step. Flow lines
Process
into an alternate process flow step are typically dashed.
32
Name
Symbol Description
(alias)
The Delay flowchart symbol depicts any waiting period that is part of a
Delay
process. Delay shapes are common in process mapping.
As the names states, any process step that is a Preparation process flow
Preparation
step, such as a set-up operation.
Manual Operations flowchart shapes show which process steps are not
automated. In data processing flowcharts, this data flow shape indicates
Manual
a looping operation along with a loop limit symbol (which is not
Operation
supported by Microsoft Office, but a Manual Operation symbol rotated
180° will do the trick.)
Name
Symbol Description
(alias)
Flow Line
(Arrow, Flow line connectors show the direction that the process flows.
Connector)
Terminator Terminators show the start and stop points in a process. When used
(Terminal Point, as a Start symbol, terminators depict a trigger action that sets the
Oval) process flow into motion.
33
Name
Symbol Description
(alias)
Off-Page Connector shows continuation of a process flowchart onto
another page. When using them in conjunction with Connectors, it's
Off-Page best to differentiate the labels, e.g. use numbers for Off-Page
Connector Connectors and capital letters for Connectors. In actual practice,
most flowcharts just use the Connect shape for both on-page and
off-page references.
Flowchart: Shows the merging of multiple processes or
Merge
information into one.
(Storage)
Process Mapping: commonly indicates storage of raw materials.
Flowchart: Shows when a process splits into parallel paths. Also
Extract commonly indicates a Measurement, with a capital 'M' inside the
(Measurement) symbol.
Process Mapping: commonly indicates storage of finished goods.
The logical Or symbol shows when a process diverges - usually for
more than 2 branches. When using this symbol, it is important to
Or
label the out-going flow lines to indicate the criteria to follow each
branch.
The logical Summing Junction flowchart shape is shows when
multiple branches converge into a single process. The merge
Summing
symbol is more common for this use, though. This symbol and the
Junction
Or symbol are really more relevant in data processing flow
diagrams than in process flowcharts.
Name
Symbol Description
(alias)
The Data flowchart shape indicates inputs to and outputs from a process.
Data
As such, the shape is more often referred to as an I/O shape than a Data
(I/O)
shape.
Pretty self explanatory - the Document flowchart symbol is for a process
Document
step that produces a document.
Same as Document, except, well, multiple documents. This shape is not
Multi-
as commonly used as the Document flowchart shape, even when multiple
Document
documents are implied.
Indicates a process step where information is displayed to a person (e.g.,
Display
PC user, machine operator).
34
Name
Symbol Description
(alias)
Manual Input flowchart shapes show process steps where the operator/
Manual
user is prompted for information that must be manually input into a
Input
system.
This is the companion to the punched tape flowchart shapes. This shape is
Card
seldom used.
If you're very good at stretching all the life out of a machine, you may
Punched
still have use for the Punched Tape symbol - used for input into old
Tape
computers and CNC machines.
Name
Symbol Description
(alias)
A general Data Storage flowchart shape used for any process step that
Stored Data stores data (as opposed to the more specific shapes to follow next in
this table).
Magnetic Disk The most universally recognizable symbol for a data storage location,
(Database) this flowchart shape depicts a database.
Direct Access
Direct Access Storage is a fancy way of saying Hard Drive.
Storage
Sequential
Although it looks like a 'Q', the symbol is supposed to look like a reel
Access Storage
of tape.
(Magnetic Tape)
Name
Symbol Description
(alias)
The Collate flowchart shape indicates a process step that requires organizing data,
Collate
information, or materials according into a standard format or arrangement.
Sort Indicates the sorting of data, information, materials into some pre-defined order.
35
Caveat: The descriptions given above are written from the perspective of someone using them to
create process flow charts, whereas many of the flowchart symbols actually have their roots in the
data processing diagrams and programming flow charts. So, not all the flowcharting shapes shown
below may be relevant to your needs.
The flowchart symbol names in parentheses are common alternates for a given shape. Sometimes a
flowchart shape can have more than one meaning, as with the Circle shape, which depicts a jump
node in flow charts and inspection point in business process mapping. Other times, there are just
multiple names for the same flow chart symbol - such as Terminator and Terminal Point.
The majority of flowcharts rely on just a few of the process-related symbols to do all the heavy
lifting: Terminator, Process, Decision, Document, and Connector. In fact, if you use other
flowcharting shapes, many people won't know what they are for, so you may want to add a symbol
key to your flowchart.
Types of flowchart:
Document flowcharts, showing controls over a document-flow through a system
Data flowcharts, showing controls over a data-flow in a system
System flowcharts showing controls at a physical or resource level
Program flowchart, showing the controls in a program within a system
36
Limitations of Using Flowcharts:
37
PSEUDOCODE
Defining Pseudocode
Pseudocode is a simple way of writing programming code in English. Pseudocode is not an actual
programming language. It uses short phrases to write code for programs before you actually create it
in a specific language. Once you know what the program is about and how it will function, then you
can use pseudocode to create statements to achieve the required results for your program.
Pseudo code consists of short, readable and formally-styled English language used for
explaining an algorithm. Pseudo code does not include details like variable declarations, subroutines
etc. Pseudo code is a short-hand way for describing a computer program.Pseudo code is an outline of
a program written in a form that can be easily converted into a real programming statement. It is a
generic way of describing an algorithm without any specific programming language related notations.
Understanding Pseudocode
Pseudocode makes creating programs easier. Programs can be complex and long. Preparation is the
key. For years, flowcharts were used to map out programs before writing one line of code in a
language. However, they were difficult to modify, and with the advancement of programming
languages, it was difficult to display all parts of a program with a flowchart. It is challenging to find a
mistake without understanding the complete flow of a program. That is where pseudocode becomes
more appealing.
To use pseudocode, all you do is write what you want your program to say in
English. Pseudocode allows you to translate your statements into any language because there are no
special commands and it is not standardized. Writing our programs before you code can enable you to
38
better organize and see where you may have left out needed parts in your programs. All you have to
do is write it out in your own words in short statemen
Basic Guidelines
Pseudocode should be universal. So, when creating the task list you would not include commands that
are for any specific language like C++, Java, C#, or Perl. The point of pseudocode is to design a
program that can be translated into any language.
Make sure you put only one task on each line. Including too much information on one line can be
confusing and increases the possibility of errors.
Capitalize Keywords
capitalizing keywords like Read, Write, or Display helps to show when an action is occurring or when
a specific command or process will be necessary when coding in your specific language.
39
Limitations of pseudo code:
A graphical representation of program is not available.
There are no standard rules to follow while using pseudo code.
Example 1:
Write the pseudo code for addition of two numbers.
RAEAD X, Y
COMPUTE Z=X+Y
PRINT Z
Stop
Example 2:
Write an algorithm to determine a student’s final grade and indicate whether it is passing or
failing. The final grade is calculated as the average of four marks.
Pseudo code:
if average is below 50
Print “FAIL”
else
Print “PASS”
Detailed Algorithm
Print “FAIL”
else
Print “PASS”
endif
40
IF-THEN-ELSE
Binary choice on a given Boolean condition is indicated by the use of four keywords: IF, THEN,
ELSE, and ENDIF. The general form is:
IF condition THEN
sequence 1
ELSE
sequence 2
ENDIF
The ELSE keyword and "sequence 2" are optional. If the condition is true, sequence 1 is performed,
otherwise sequence 2 is performed.
Example
WHILE
The WHILE construct is used to specify a loop with a test at the top. The beginning and ending of the
loop are indicated by two keywords WHILE and ENDWHILE. The general form is:
WHILE condition
sequence
ENDWHILE
41
The loop is entered only if the condition is true. The "sequence" is performed for each iteration. At
the conclusion of each iteration, the condition is evaluated and the loop continues as long as the
condition is true.
Write an algorithm and draw a flowchart that will read the two sides of a rectangle and
calculate its area.
Pseudocode
Input the width (W) and Length (L) of a rectangle
Calculate the area (A) by multiplying L with W
Print A
flow chart
42
UNIT -1 2 MARKS
1. Define computers?
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.
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, analyzing, sorting, summarizing, calculating, disseminating
and storing data. Thus Computer is known as data processing system.
Data - Data is the fact or raw material for the information processing.
Information – The processed data is called information.
43
•Humans can communicate better than computers.
• Humans are much reliable than computers.
11. How will you classify computer systems based on physical size?
Micro computer
Mini Computer
Mainframe computer and
Super Computer
12. What is a volatile and non-volatile memory?
Volatile memory: also known as volatile storage is computer memory that requires
power to maintain the stored information, unlike non-volatile memory which does not require a
maintained power supply. It has been less popularly known as temporary memory.
13. Specify the Electronic components used for different computer generations.
Generations Electronic Components
44
14 . What are the languages used in computer generations?
Personal computers:- The name PC was given by the IBM for its microcomputers.
PCs are used for word processing, spreadsheet calculations, database management
etc.
Note book or Lap Top:- Very small in terms of size – can be folded and carried
around – Monitor is made up of LCD and the keyboard and system units are
contained in a single box. Got all the facilities of a personal computer (HDD, CDD,
Sound card, N/W card, Modem etc) and a special connection to connect to the
desktop PC which can be used to transfer data.
Palm Top:- Smaller model of the microcomputer- size is similar to that of a
calculator – pocket size- It has a processor and memory and a special connection
to connect to the desktop PC which can be used to transfer data.
Wrist PC:- Smallest type of microcomputer – can be worn on our wrist like a
watch- It has a processor and memory and a wireless modem
18.What is Flowchart?
A Flowchart is a pictorial representation of an algorithm. It is often used by programmeras a
program planning tool for organizing a sequence of step necessary to solve a problem by a
computer.
46