Вы находитесь на странице: 1из 46

INDEX

Unit -1 Content PAGE NO


H I ST O RY OF 2
C OM P U T E RS

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

Generation and Classification of Computers- Basic Organization of a Computer –Number System –


Binary – Decimal – Conversion – Problems. Need for logical analysis and thinking – Algorithm –
Pseudo code – Flow Chart.

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. Pascal’s Addition& Subtraction Machine:


 Pascal’s Addition& Subtraction Machine was developed by Blaise Pascal.
 It is used to add and subtract.
 The machine consisted of wheels, gears and cylinders.
5. Leibniz's Multiplication and diving machine:
 Leibniz's Multiplication and diving machine was a mechanical device that could multiply
and divide.
 The German philosopher and mathematician Gottfried Leibniz built it around 1673.
6. Punch card System:
 Punch card System was developed by Jacquard to control the power of loom in 1801.
 He invented the punched card reader that could recognize the presence of hole in the punched
card as binary one and the absence of hole as binary zero.
 The 0’s and 1s are the basis of the modern digital computer.

Pascaline Leibniz's Calculating Machine Punched card

7. Babbage’s Analytical Engine:


 An English man Charles Babbage built a mechanical machine to do complex calculatiuons,
in the year 1823.The machine was called as Difference Engine.
 Later ,Charles Babbage and lady Ada Lovelace developed a general-purpose calculating
machine, the Analytical Engine.
 Charles Babbage is also called the Father of computer.
 Ada Lovelace is the Mother of computer.

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.

Difference Engine Analytical Engine Tabulating Machine

GENERATION OF COMPUTERS

First Generation (1940-1956) Vacuum Tubes

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.

First generation computers relied on machine language, the lowest-level programming


language understood by computers, to perform operations, and they could only solve one problem at
a time. Input was based on punched cards and paper tape, and output was displayed on printouts.

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.

Second-generation computers moved from cryptic binary machine language to symbolic, or


assembly, languages, which allowed programmers to specify instructions in words. High-level
programming languages were also being developed at this time, such as early versions of COBOL
and FORTRAN. These were also the first computers that stored their instructions in their memory,
which moved from a magnetic drum to magnetic core technology.

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.

Index registers were introduced which increased flexibility of programming.

 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.

 Separate input-output processors were developed that could operate in


parallel with CPU. Punched cards continued during this period also.

1000 fold increase in speed.

 Increasingly used in business, industry and commercial organizations for


preparation of payroll, inventory control, marketing, production planning,
research, scientific & engineering analysis and design etc.

Third Generation (1964-1971) Integrated Circuits

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)

ICs were used

 Small Scale Integration and Medium Scale Integration technology were


implemented in CPU, I/O processors etc.

 Smaller & better performance

 Comparatively lesser cost

Faster processors

 In the beginning magnetic core memories were used. Later they were replaced
by semiconductor memories (RAM & ROM)

Introduced microprogramming

 Microprogramming, parallel processing (pipelining, multiprocessor system etc),


multiprogramming, multi-user system (time shared system) etc were
introduced.

 Operating system software were introduced (efficient sharing of a computer


system by several user programs)

 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.

Fourth Generation (1971-1989) Microprocessors

The microprocessor brought the fourth generation of computers, as thousands of integrated


circuits were built onto a single silicon chip. What in the first generation filled an entire room could
now fit in the palm of the hand. The Intel 4004 chip, developed in 1971, located all the components

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)

 Microprocessors were introduced as CPU– Complete processors and large section of


main memory could be implemented in a single chip.

 Tens of thousands of transistors can be placed in a single chip (VLSI design


implemented) CRT screen, laser & ink jet printers, scanners etc were developed.
 Semiconductor memory chips were used as the main memory.
 Secondary memory was composed of hard disks – Floppy disks & magnetic tapes
were used for backup memory
 Parallelism, pipelining cache memory and virtual memory were applied in a better
way LAN and WANS were developed (where desktop work stations interconnected)
 Introduced C language and Unix OS Introduced Graphical User Interface
 Less power consumption
 High performance, lower cost and very compact Much increase in the speed of
operation

Fifth Generation (1989 to present) Artificial Intelligence

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.)

New operating systems developed – Windows 95/98/XP/…, LINUX, etc.

 Got hot pluggable features – which enable a failed component to be replaced


with a new one without the need to shutdown the system, allowing the uptime
of the system to be very high.

 The recent development in the application of internet is the Grid technology


which is still in its upcoming stage.

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

In Aerospace industry - to simulate airflow around an aircraft at different speeds and


altitude. This helps in producing an effective aerodynamic design for superior
performance

In Automobile industry- to do crash simulation of the design of an automobile before


it is released for manufacturing – for better automobile design

In structural mechanics – to solve complex structural engineering problems to ensure


safety, reliability and cost effectiveness. Eg. Designer of a large bridge has to ensure
that the bridge must be proper in various atmospheric conditions and pressures from
wind, velocity etc and under load conditions.

In Meteorological centers use super computers for weather forecasting


In Biomedical research – atomic nuclear and plasma analysis – to study the structure
of viruses such as that causing AIDS

For weapons research and development, sending rockets to space etc .

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

Supports multi-user facility


Number of processors varies from one to six.
Cost: 3500 to many million dollars
Kept in air conditioned room to keep them cool,
Supports many I/O and auxiliary storage devices

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)

4. Micro Computers E.g.:- IBM PC, PS/2 and Apple Macintosh


A microcomputer uses a microprocessor as its central Processing Unit.
Microcomputers are tiny computers that can vary in size from a single chip to the size
of a desktop model
They are designed to be used by only one person at a time.
Small to medium data storage capacities 500MB – 2GB
The common examples of microcomputers are chips used in washing machines, TVs,
Cars and Note book/Personal computers.

Applications
Used in the field of desktop publishing, accounting, statistical analysis, graphic designing,
investment analysis, project management, teaching, entertainment etc

The different models of microcomputers are given below:-


 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

11
Cost Speed Applications

Superfast Weapon design


Weather forecasting Super Computers
Aircraft design
fast Biomedical applications

Scientific calculations Main frame computers


Data Processing for large business
Teaching systems in Universities
medium
Large multi-user systems
Manufacturing processes Mini Computers
Hospital Administration
Teaching systems in Colleges

slow Office automation


Small business systems Micro Computers
Control applications
Teaching systems in schools

FUNCTIONAL UNITS OF A 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.
Even though the size, shape, performance, reliability and cost of computers have been
changing over the years, the basic logical structure proposed by Von Neumann has not change.
The internal architecture of computers differs from one system model to another. A block
diagram of the basic computer organization specifying 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.

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

Central Processing Unit

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.

Arithmetic and Logic Unit (ALU)


Most computer operations (Arithmetical and logical) are executed in ALU of the
processor. For example: Suppose two numbers (operands) located in the main memory
are to be added.
These operands are brought into arithmetic unit – actual addition is carried. The result is
then stored in the memory or retained in the processor itself for immediate use.
Note that all operands may not reside in the main memory. Processor contains a number
of high speed storage elements called Registers, which may be used for temporary
storage of frequently used operands. Each register can store one word of data.
Access times to registers are 5 to 10 times faster than access time to memory.

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

Types of number system:


The following are the types of number systems:
1. Decimal number system
2. Binary number system
3. Octal number system
4. Hexadecimal number systems

In a Base r (or) Radix r is the total numbers of digits available in the number system.

1. Decimal 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

3. Octal number system:



It consists of 8 number: 0,1,2,3,4,5,6,7

The base value of octal number system is 8

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 8 8 8 . 8 8 8-3
Quantity 512 64 8 . 1/8 1/64 1/512

4. Hexadecimal number systems:

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

DECIMAL, BINARY, OCTAL AND HEXADECIMAL NUMBER EQUIVALENT:

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

Types of Number System Conversion:


I. Conversion from decimal to Binary, Octal, Hexadecimal.
a. Decimal to Binary
b. Decimal to Octal
c. Decimal to Hexadecimal
II. Conversion from Binary, Octal, Hexadecimal to Decimal.
a. Binary to Decimal
b. Binary to Octal
c. Binary to Hexadecimal
III. Conversion from Binary to Octal and Hexadecimal.
a. Binary to Octal
b. Binary to Hexadecimal
IV. Conversion from Octal and Hexadecimal to Binary.
a. Octal to Binary
b. Hexadecimal to Binary

I. Conversion from decimal to Binary, Octal, Hexadecimal


A. Converting the Decimal Integer to Binary ,Octal, Hexadecimal :
The Decimal Integer is converted to any other base by using the division operation.
 For Decimal to Binary - Divide by 2
 For Decimal to Octal - Divide by 8

18
 For Decimal to Hexadecimal - Divide by 16

DECIMAL INTEGER TO BINARY ,OCTAL,HEXADECIMAL


Decimal integer to Binary Decimal integer to Octal Decimal integer to
Hexadecimal
2510 = (?)2 2510 = (?)8 2510 = (?)16

2 25 8 25 16 25
2 12 - 1 3 -1 1 -9
2 6 -0
2 3 -0
1 -1

2510 = (11001)2 2510 = (3 1)8 2510 = (19)16

II. Conversion from Binary, Octal, Hexadecimal to Decimal.

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)

The following are the conversion method in this category:


a. Binary to Decimal
b. Binary to Octal
c. Binary to Hexadecimal

For Example:

Binary Integer to Decimal Octal Integer to Decimal Hexadecimal Integer to


Decimal
(1010)2= (?)10 (51)8 = (?)10 (C11)16 = (?)10
=(1*23)+(0*22)+( 1*21)+( 0*20) =(5*81)+( 1*80) =(C*162)+( 1*161)+ ( 1*160)
=8+0+2+0 =40+1 =(12*256)+( 1*16)+ ( 1*1)
=10 =41 =3072+16+1
(1010)2= (10)10 (51)8= (41)10 = (3089)10

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.

The steps for binary to octal conversion:


 Partition the binary number in groups of the three bits, starting from the right-most side.
 For each group of three bits, find its octal number.
 The result is the number formed by the combination of octal number.

The steps for binary to hexadecimal conversion:


 Partition the binary number in groups of the four bits, starting from the right-most side.
 For each group of three bits, find its hexadecimal number.
 The result is the number formed by the combination of hexadecimal number.

BINARY TO OCTAL BINARY TO HEXADECIMAL


Binary Integer to Octal Binary Integer to Hexadecimal
(11101011100101)2 = ( ?) 8 (11101011101111)2 = ( ?)16
11 101 011 100 101 11 1010 1110 1111
3 5 3 4 5 3 A E F
(11101011100111)2 = ( 35345) 8 (11101011100111)2 = ( 3AEF)16
Binary Fraction to Octal Binary Fraction to Hexadecimal
(0.11111111)2 = ( ?) 8 (0.11011011)2 = ( ?)16
11 011 011 1111 1011
3 7 7 F B
(0.11011011)2 = ( 0.377) 8 (0.11011011)2 = ( FB)16

Binary Interger.Fraction to Octal Binary Interger.Fraction to Hexadecimal

(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

The steps for hexadecimal to binary conversions:


 Convert each octal number into a four-digit binary number`
 The result is the number formed by the combination of all the bits.

OCTAL TO BINARY HEXADECIMAL TO BINARY


Octal Integer to Binary Hexadecimal Integer to Binary
(473)8 = (?) (2BAB7)16 = (?)2
4 7 3 2 B A B 7
100 111 011 0010 1011 1010 1011 0111
(473)8 = (100111011)2 (2BAB7)16 = (0010101110101011 0111)2
Octal Fraction to Binary Hexadecimal Fraction to Binary
(0.73145)8 = ( ?)2 (0.ACD)16 = ( ?)2
7 3 1 4 5 A C D
111 011 001 100 101 1010 1100 1101
(0.73145)8 = (111011001100101)2 (0.ACD)16 = (1010 1100 1101)2
Octal Integer. Fraction to Binary Hexadecimal Integer. Fraction to Binary
(54.74)8 = ( ?)2 (AB.2BC)16 = ( ?)2
5 4 . 7 4 A B . 2 B C
101 100 . 111 100 1010 1011 . 0010 1011 1100
(54.74)8 = (101100.111100)2 (AB.2BC)16 = (10101011.001010111100)2

LOGICAL ANALYSIS AND THINKING

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.

Develop Test Data:


Test data consists of the user providing some input values and predicting the outputs. This can be
quite easy for a simple program and the test data can be used to check the model to see if it produces
the correct results.

The fundamental components of good program design are:


1) Problem definition, leading to a program specification,
2) Modular program design, which refines the specification,
3) Module composition, which translates specification intoexecutable program,

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

1. Problem Analysis  Understand the problem.


 Have multiple solutions.
 Select a solution.

2. Program Design  Write algorithm


 Write flow chart
 Write pseudo code

 Choose a programming language.


3. Program Development  Write the program by converting the pseudo code, and
then using the programming language.
 Compile the program and remove the syntax errors, if
any
 Executes the program.
 Test the program. Check the output results with different
inputs. If the output is incorrect, modify the program to
get the correct results.
 Install the tested program on the user’s computer.

4. Program Documentation  Document the program, for later use.


and Maintenance  Maintain the program for updating, removing errors,
changing requirements etc.

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

Let us see example of how algorithm looks like.


The taxi/auto-rickshaw algorithm:
 Go to the taxi/auto-rickshaw stand.
 Get in a taxi/auto-rickshaw.
 Give the driver my address.
The bus algorithm:
 Outside the railway station, catch bus number 321.
 Transfer to bus 308 near madura station.
 Get off near ptr University.
 Walk two blocks west to my house.

Three reasons for using algorithms are


 efficiency,
 abstraction and
 reusability.
Efficiency: Certain types of problems, like sorting, occur oftenin computing. Efficient algorithms
must be used to solve suchproblems considering the time and cost factor involved in each algorithm.

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.

find sum average and product of three numbers


Algorithm for the given problem is as follows:
Step 1:Read X, Y, Z
Step 2:Compute Sum (S) as X + Y + Z
Step 3:Compute Average (A) as S / 3
Step 4:Compute Product (P) as X x Y x Z
Write an algorithm for addition of two numbers.
Step 1: Start the program
Step 2: read the value of x and y.
Step 3: add x& y then store the result in z.
Step 4: print z value.
Step 5: stop.

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.

Efficiency is an inherent result of the analysis and specificationprocess.

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.

A Flowchart is a type of diagram (graphical or symbolic) that represents an algorithm or


process. Each step in the process isrepresented by a different symbol and contains a short description
ofthe process step. The flow chart symbols are linked together witharrows showing the process flow
direction. A flowchart typicallyshows the flow of data in a process, detailing the operations/steps in
apictorial format which is easier to understand than reading it in atextual format.

A flowchart describes what operations (and in what sequence)are required to solve a


given problem. A flowchart can be likened to the blueprint of a building. As we know a designer
draws a blueprintbefore starting construction on a building. Similarly, a programmerprefers to draw a
flowchart prior to writing a computer program.Flowcharts are a pictorial or graphical representation
of a process. Flowcharts are used in analyzing, designing, documenting ormanaging a process or
program in various fields.Flowcharts are generally drawn in the early stages offormulating computer
solutions.
Flowcharts often facilitatecommunication between programmers and business
people. Theseflowcharts play a vital role in the programming of a problem and arequite helpful in
understanding the logic of complicated and lengthyproblems. Once the flowchart is drawn, it
becomes easy to write theprogram in any high level language. Often we see how flowcharts
arehelpful in explaining the program to others. Hence, it is correct to saythat a flowchart is a must for
the better documentation of a complexprogram.

28
For example, consider that we need to find the sum, average and product of 3 numbers given by the
user.

Algorithm for the given problem is as follows:


Read X, Y, Z
Compute Sum (S) as X + Y + Z
Compute Average (A) as S / 3
Compute Product (P) as X x Y x Z

FLOW CHART

Advantages of Using Flowcharts:


The benefits of flowcharts are as follows:
Communication: Flowcharts are better way of communicatingthe logic of a system to all concerned.
Effective analysis: With the help of flowchart, problem can beanalysed in more effective way.
Proper documentation: Program flowcharts serve as a goodprogram documentation, which is needed
for various purposes.
Efficient Coding: The flowcharts act as a guide or blueprintduring the systems analysis and program
development phase.
Proper Debugging: The flowchart helps in debugging process.
Efficient Program Maintenance: The maintenance of operatingprogram becomes easy with the help
of flowchart. It helps theprogrammer to put efforts more efficiently on that part.

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.

 Developing a flowchart stimulates communication amongparticipants and establishes a


common understanding about theprocess.
 Flowcharts also uncover steps that are redundant ormisplaced.

 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?

There are a wide variety of flowcharts, including:

 swimlane flowcharts,
 data flow diagrams,
 influence diagrams,
 workflow diagrams,
 process flow diagrams,
 and many more.

What are Some Uses of Flowcharts?

Some of the ways to use flowcharts include:

 project planning

31
 program or system design
 process documentation
 audit a process for inefficiencies or malfunctions
 map computer algorithms
 and many more.

Basic Flowchart Symbols

For most flowcharts, these five basic symbols are all you will need.

PROCESS / OPERATION SYMBOLS

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.)

BRANCHING AND CONTROL OF FLOW SYMBOLS

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.

Indicates a question or branch in the process flow. Typically, a


Decision Decision flowchart shape is used when there are 2 options (Yes/No,
No/No-Go, etc.)

Flowchart: In flowcharts, this symbol is typically small and is used


as a Connector to show a jump from one point in the process flow
to another. Connectors are usually labeled with capital letters (A, B,
AA) to show matching jump points. They are handy for avoiding
flow lines that cross other shapes and flow lines. They are also
handy for jumping to and from a sub-processes defined in a separate
area than the main flowchart.
Connector
Process Mapping: In process maps, this symbol is full sized and
(Inspection)
shows an Inspection point in the process flow.

[J U ST T O CO NF USE TH ING S F URT H E R , SOM E P E OP L E


W I L L USE A CIRCL E T O INDICAT E AN O P E RAT IO N A N D A
SQ U A R E T O INDICAT E AN INSP E CT IO N . T H AT ' S WHY IT'S
I M P O R T ANT TO INCL UDE A SYM B O L K E Y IN TH E
F L O W CH ART .]

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.

INPUT AND OUTPUT SYMBOLS

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.

FILE AND INFORMATION STORAGE SYMBOLS

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

Used in programming flowcharts to mean information stored in


Internal Storage
memory, as opposed to on a file.

Sequential
Although it looks like a 'Q', the symbol is supposed to look like a reel
Access Storage
of tape.
(Magnetic Tape)

DATA PROCESSING SYMBOLS

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.

T HE M OST C O M M O N L Y U SE D F L O W C HAR T S YMB OL S

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:

Although a flowchart is a very useful tool, there are a few limitations


in using flowcharts which are listed below:
Complex logic: Sometimes, the program logic is quite complicated. In that case, flowchart becomes
complex and clumsy.
Alterations and Modifications: If alterations are required the flowchart may require re-drawing
completely.
Reproduction: As the flowchart symbols cannot be typed,reproduction of flowchart becomes a
problem.

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

Pseudo code uses some keywords to denote programming process.


 Input: READ,OBTAIN,GET,PROMPT
 Output: PRINT,DISPLAY,SHOW
 Compute: CALCULATE, COMPUTE, DETERMINE,COMPARE
 Initialize: SET, INITIALIZE
 Add one: INCREMENT
 Decrease one: DECREMENT

Basic Guidelines

Do not use language specific commands in your statements

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.

Write only one task/statement per line

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.

Guidelines for preparing the Pseudo code:


 Write one statement per line.
 Capitalize keywords such as READ, COMPUTE,PRINT.
 Each set of instruction is return from top to bottom with one entry and one exit.
 End multiline structure: each structure must be end which provides more clarity.
 Keep statement language independent.

Advantages of pseudo code:


 It can be done easily in any word processor.
 It can be easily modified as compared to flowchart.
 It requires less time and effort than flow chart.
 No special symbols are used to represent specific functions.

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:

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

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

IF HoursWorked > NormalMax THEN


Display overtime message
ELSE
Display regular time message
ENDIF

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.

2.What are the devices used before first generation machines.


 Calculating machine
 Napier’s Bones
 Slide Rule
 Pascal’s Addition& Subtraction Machine
 Leibniz's Multiplication and diving machine
 Punch card System
 Babbage’s Analytical Engine
 Hollerith’s Punched card Tabulating Machine

3. Why computer is known as data processing system?

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.

5. What is Data and Information?

Data - Data is the fact or raw material for the information processing.
Information – The processed data is called information.

4. What are the basic operations of Computer?


 It accepts data or instructions by way of input.
 It stores data.
 It can process data as required by the user.
 It gives results in the form of output.
 It controls all operations inside a computer.

5.How will you classify computer system?


The computer system can be classified on the basis of Hardware design Utility Size and
Capacity,Mode of use.

6. what is 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.
7 . Give any two tasks, which humans perform better than computers?

43
•Humans can communicate better than computers.
• Humans are much reliable than computers.

8. Expand ENIVAC,ABC,EDVAC,EDSAC andUNIVAC.


ENIAC – ElectronicNumericalIntegratorand
Calculator.
ABC – AtanasoffandBerry Computer.
EDVAC – ElectronicDiscreteVariableAutomaticCalculator.
EDSAC – ElectronicDelayStorageAutomaticCalculator.
UNIVAC – UNIversalAutomaticComputer.

9.W H AT AR E T H E COMPONENTSOF T H E COMPUTERSYSTEMS?

Basiccomponents of the computer system are


InputUnit,CentralProcessingUnit,SecondaryStorage Unit and
Output unit.
10 what is the use of IC’S
 Small Scale Integration and Medium Scale Integration technology
were implemented in CPU, I/O processors etc.

 Smaller & better performance

 Comparatively lesser cost

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.

Non-volatile memory: nonvolatile memory, NVM or non-volatile storage, is computer


memory that can retain the stored information even when not powered.

13. Specify the Electronic components used for different computer generations.
Generations Electronic Components

I Generation Vacuum tubes


II Generation Transistors
III Generation Integrated Circuits
IV Generation Microprocessors
V Generation Artificial Intelligence

44
14 . What are the languages used in computer generations?

I Generation Machine Language


II Generation Assemble Language, Mnemonics
III Generation High Level Language, BASIC,PASCAL,
COBOL, FORTRON.
IV Generation 4GL
V Generation Artificial Intelligence.

15.Define Base or Radix?


It is defined as the total number of digits available in the number system.

16. what are the different models of microcomputers ?

 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

17. What are the rules for writing pseudo code?


* Write on statement per line
* Capitalize initial keywords
* Indent to show hierarchy
* End multiline structure
* Keep statements language independent.

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.

19. What is an algorithm?


Algorithm means the logic of a program. It is a step-by-step description of how to arrive at a
solution of a given problem.

20. How can you measure the quality of algorithm?


The primary factors used to judge the quality of an algorithm are time requirement, memory
requirement, and accuracy of solution.
45
21.what are registers.
A special,high-speed storage area within the CPU.All data must be re presented in a register
before it can be processed. if two numbers are to be multiplied both numbers must be in
registers ,and the result is also placed in a register.

IMPORTANT TWO MARKS QUESTION

1. Differentiate between RAM and ROM.


2. what is meant by pseudo code.
3. Why computer is called an idiotic genius
4. What are the Rules for drawing flowchart and algorithm
5. What are different components of computer systems.
6. Compare and contrast flowchart and algorithm.
7. Differentiate between analog and digital computers.
8. How will you classify computer systems?
9. Give the advantages and limitations of Pseudo code.
10. What are steps involved ,solving problem in computer system.
11. What are advantages and disadvantages of using first generation computers.
12. How second generation computers overcome by third generation computers.
13. What is the use aritificial intelligence in fifth generation computers.
14. Draw block diagram of basic computer organization.

IMPORTANT 16 MARKS QUESTION

1. Explain in detail the different generation of computers.


2. Describe the different classification of computers.
3. Explain in detail about the various components of a computer system with block
diagram. (or) Explain the organization of a computer
4. Problems in number systems
5. Algorithm and flowchart for any problem,
6. Mention the guidelines in detail while drawing a flowchart with examples and list out the
merits and demerits of flowcharting.
7. What are steps used to solve problems in computer.

46

Вам также может понравиться