Ist Unit Notes
Ist Unit Notes
SCIENCE
SCHOOL OF COMPUTING SCIENCES
NOTES FOR
MODULE 1
PROBLEM SOLVING TECHNIQUES AND LANGUAGES
INTRODUTION:
Computer definition
Computer is an electronic device which converts raw data into meaningful data or
processed data.
Computer is an electronic device designed in such a way that is automatically
accepts and stores the input data process them and produce the desired output.
Computer is an electronic device that operates upon information given.
Basic operations of a computer:
1. Input: It is a process of capturing the information.
2. Process: It is a transformation process to convert input into output.
3. Output: It is the result which comes from transformation process.
4. Storing: It is the process of saving the data.
5. Controlling: It is the process of directing/sequence in which all operation have to
be performed.
Applications of computer:
1. Education
2. Business
3. communication
4. Science
5. Engineering
6. Entertainment
7. Banking
8. Health
Evolution of computer:
Computer is Latin word computer which means to calculate .
1. calculating machine
2. Napier bones
3. Slide rule
4. Pascal add/Sub machine.
5. Leibniz’s mul/div machine.
6. Punch card system.
7. Babbage’s analytical engine.
8. Hollerith’s punched card tabulating machine.
Generation of Computers:
1. First generation computers
2. second generation computers
3. Third generation computers
4. Fourth generation computers
5. Fifth generation computers
Synopsis
Hardware technology
Software technology
Computing characteristic
Physical appearance
Application
Examples
Advantages
Disadvantages
Hardware technology:
They used vacuum tubes for circuitry and magnetic drums for memory.
The Input to the computer was through punched cards.
The output was displayed printouts.
Software technology: The Instructions were written in
machine language.
Machine language uses ’s and ’s for coding the machine instructions.
First generation computers can solve only one problem at a time.
Computing characteristics:
The Computation time was in milliseconds. (1 milliseconds = 1*10 -3 Seconds).
Physical appearance:
These computers are Enormous in size.
They required large room for installation.
Applications:
They were used for scientific applications.
Examples:
UNIVAC- UNIVersal Automatic Computer
ENIAC – Electronic numerical integrator and Computer
EDVAC – Electronic Discrete Variable Automatic Computer
Advantages:
They were fastest computing device in their time
They can able to execute complex mathematical problems in efficient manner.
Disadvantages:
First generation computers used a large number of vacuum tubes and thus
generated a lot of heat.
Because of heat these machine leads to malfunctioning.
They consumed large amount of electricity and were expensive to operate. These
computers are not reliable need high maintenance.
It depends on machine language ’s and ’s these computers were not easy to
program.
Special purpose computers not flexible in running different type of applications.
Single tasking not productive.
It is not transferable because of large size.
Hardware technology:
Transistors replaced the vacuum tubes from first generation computers.
It allows the computer become smaller faster, cheaper energy efficient and reliable.
The second generation computer uses magnetic core technology for primary
memory.
They use magnetic tapes and magnetic disks for secondary memory.
The Input to the computer was through punched cards.
The output was displayed as printouts.
They used the concept of stored program.
Instructions were stored in memory of computer.
Software technology:
Instructions were written using assembly language.
Assembly language uses mnemonics like ADD, SUB, MUL, DIV, etc.
High level programming languages such as COBOL, FORTRAN were also developed
during this period.
Computing characteristics:
The Computation time was in Micro seconds. (1 Micro seconds = 1*10-6 Seconds).
Physical appearance
Transistors are smaller than vacuum tubes so size of computers is also reduced.
Applications:
They are used for special purpose.
Examples
PDP-8,IBM 1401,CDC 1604
Advantages:
They are fastest computing device of their time.
It is easier to write instructions in assembly language than machine language.
It can be transferred easily from one location to other locations because of small
size and light weight components.
They required less maintenance than first generation computers and reliable.
Disadvantages:
Input and output mechanisms are not improved.
The Cost of these computers is very high beyond to use home users.
They are special purpose computers only for specific applications.
Application:
These Computers become accessible to mass audience.
They are produced commercially.
They are general purpose computers and it can be used for any purpose.
Example:
IBM System 370, PDP 11
Advantages:
The third generation computers used less power and generated less heat than the
second generation computers.
The cost of the computers reduced significantly as individual components of the
computer were not required to assemble manually.
The maintenance cost of the computer was also less compared to previous
generation computers.
They were fastest computing device compared to first and second generation
computers.
It can be transferred easily from one location to other locations because of small
size.
These computers are productive because of less computing time.
It is easier to program in high level language than any other language.
These computers are multi tasking and general purpose computers.
Disadvantages
The storage capacity of the computer is small.
The performance of the computer got degraded while executing large applications
and complex calculations.
These computers were needed to be placed in Air-conditioned room.
High level language:
It is a computer programming language that is independent of machine details.
The Programmers find it easy to use them.
The Programs written in one computer can be executed in other computers.
Fourth generation computers (1971 to present)- Micro processors
Hardware technology
They use the large scale integration and the very large scale integration technology.
Thousands of transistors are integrated on a small silicon chip using LSI
technology.
VLSI allows hundreds of transistors are integrated
Software technology
Several operating systems like the MS-DOS and MS –windows developed during
this time.
This generation of computer supports Graphical user interface (GUI).
GUI is a user friendly interface that allows user to interact with the computer via
menus and icons,
High level languages are used for writing of programs.
Computing characteristic
The computation time is in Pico seconds (1 Pico seconds = 1*10-12 Seconds).
Physical appearance
They are smaller than the computers of the previous generation. Some can even fit
into the palm of the hands
Application
They become widely available for commercial purpose
Personal computers become available to the home users.
Examples
The Intel 14004 chip was the first microprocessor.
The components of the computers like CPU and memory were located in a single
chip.
Advantages
The micro processor has resulted in the fourth generation computers being smaller
and cheaper than their predecessors.
Storage capacity is very large and faster.
They are portable and more reliable.
They generate much lesser heat and require less maintenance compared to their
predecessors.
Networking has resulted in resource sharing and communication among different
computers.
It provides user friendly environment because of GUI and input /output devices.
Disadvantages
Soldering of LSI and VLSI chips on the board was not easy process and it needs a
complex technology.
Working of these computers depends on instructions given by programmers. Fifth
generation computers (Present- Next generation)
Hardware technology
The goal of fifth generation computer is to develop computers that are capable of
learning and self –organization.
They use super large scale integrated (SLSI) chips that are able to store millions of
components on one silicon chip.
They have large memory requirements.
Software technology
They use parallel processing that allows several instructions to be executed in
parallel, instead of serial execution.
Parallel processing results in faster processing speed.
The Intel dual core micro processor uses parallel processing.
They are based on Artificial intelligence; they try to simulate human way of
thinking and reasoning.
AI includes areas like expert system, natural language processing (NLP), Speech
recognition, voice recognition, and robotics.
Computing characteristic
Computing time is less than Pico seconds.
Physical appearance
It is available according to the user needs. Laptop, PC, PDA
Application
General purpose.
Examples
Apple, MAC, Notepad, Tab.
Advantages
Fastest computing device.
Many applications can be run on same time (high speed).
VLSI technology leads to reduced size, these computers can be used in travelling.
Multimedia features and wireless are available.
Disadvantages
Not provided intelligence program that can guide computers in different
applications.
Classifications of computers
Minicomputer:
A minicomputer is a medium-sized computer. That is more powerful than a
microcomputer. These computers are usually designed to serve multiple users
simultaneously (Parallel Processing). They are more expensive than microcomputers.
Examples: Digital Alpha, Sun Ultra.
Mainframe computers:
Computers with large storage capacities and very high speed of processing
(compared to mini- or microcomputers) are known as mainframe computers. They
support a large number of terminals for simultaneous use by a number of users like
ATM transactions. They are also used as central host computers in distributed data
processing system.
Examples: - IBM 370, S/390.
Supercomputer:
Supercomputers have extremely large storage capacity and computing speeds
which are many times faster than other computers. A supercomputer is measured in
terms of tens of millions Instructions per second (mips), an operation is made up of
numerous instructions. The supercomputer is mainly used for large scale numerical
problems in scientific and engineering disciplines such as Weather analysis. Examples: -
IBM Deep Blue
Analog Computers: -
An analog computer is a form of computer that uses the continuously changeable
aspects of physical phenomena such as electrical, mechanical, or hydraulic quantities to
model the problem being solved. In contrast, digital computers represent varying
quantities symbolically, as their numerical values change.
Hybrid Computers: -
Hybrid Computers are computers that exhibit features of analog computers and digital
computers. The digital component normally serves as the controller and provides logical
operations, while the analog component normally serves as a solver of differential
equations.
Single User: - Only one user can use the resource at any time.
Multi User: -
A single computer shared by a number of users at any time.
Network: -
A number of interconnected autonomous computers shared by a number of users at any
time.
This topic explains the way in which different units of computer are interconnected
with each other and controlled.
It describes the various operations performed by each units.
It has four units
1. Input unit
2. Output unit
3. CPU
4. Memory unit
This unit contains devices with the help of which we enter data into computer. This
unit makes link between user and computer.
The input devices translate the information into the form understandable by
computer.
1. Keyboard
2. Mouse
3. Joy Stick
4. Light pen
5. Track Ball
6. Scanner
7. Graphic Tablet
8. Microphone
9. Webcam
10. Bar Code Reader
Key Board
Keyboard is the most common and very popular input device which helps in
inputting data to the computer.
The layout of the keyboard is like that of traditional typewriter, although there are
some additional keys provided for performing additional functions.
Keyboards are of two sizes 84 keys or 101/102 keys, but now keyboards with 104
keys or 108 keys are also available for Windows and Internet.
The keys on the keyboard are as follows:
Keys Description
Typing These keys include the letter keys (A-Z) and digit keys (0-9) which generally
Keys give same layout as that of typewriters.
Numeric It is used to enter numeric data. Generally, it consists of a set of 17 keys that
Keypad are laid out in the same configuration used by most adding machines and
calculators.
Function The twelve function keys are present on the keyboard which is arranged in
Keys a row at the top of the keyboard. Each function key has unique meaning and
is used for some specific purpose.
Control These keys provide cursor and screen control. It includes four directional
keys arrow keys. Control keys also include Home, End, Insert, Delete, Page Up,
Page Down, Control(Ctrl), Alternate(Alt), Escape(Esc).
Special Keyboard also contains some special purpose keys such as Enter, Shift, Caps
Purpose Lock, Num Lock, Space bar, Tab, and Print Screen.
Keys
Mouse
Mouse is most popular pointing device. It is a very famous cursor-control device
having a small palm size box with a round ball at its base which senses the
movement of mouse and sends corresponding signals to CPU when the mouse
buttons are pressed.
Generally it has two buttons called left and right button and a wheel is present
between the buttons. Mouse can be used to control the position of cursor on screen,
but it cannot be used to enter text into the computer.
Advantages
Easy to use
Not very expensive
Moves the cursor faster than the arrow keys of keyboard.
Scanner
Scanner is an input device which works more like a photocopy machine.
It is used when some information is available on a paper and it is to be transferred
to the hard disc of the computer for further manipulation.
Scanner captures images from the source which are then converted into the digital
form that can be stored on the disc. These images can be edited before they are
printed.
It converts hard copy into soft copy.
Output unit:
Following are few of the important output devices which are used in a computer
Monitors
Graphic Plotter
Printer
Monitor
Monitors, commonly called as Visual Display Unit (VDU), are the main output
device of a computer. It forms images from tiny dots, called pixels that are arranged in a
rectangular form. The sharpness of the image depends upon the number of pixels. There
are two kinds of viewing screen used for monitors.
Cathode-Ray Tube (CRT)
Flat- Panel Display (LED, LCD)
Printers:
It is one of the output device which convert text which displays on the screen into paper
sheets, which means it converts soft copy into hard copy.
Types of printers:
1. Dot matrix printers
2. Ink jet printers
3. Laser printers
4. Poster printers
Speakers:
It is a kind of output device which convert electrical signal into sound.
It may be inbuilt or externally attached.
The sound card and audio driver should be attached to the computers to produce
audio output.
MEMORY UNIT
Memory is primarily of three types
Primary Memory/Main Memory
Secondary Memory
Internal processing memory/Cache Memory
The memory unit of the computer is used to store the following,
Data
Instructions required for processing the data
Intermediate results of processing
Final processed results
Primary Memory
Primary memory holds only those data and instructions on which computer is currently
working. It has limited capacity and data is lost when power is switched off. It is generally
made up of semiconductor device. These memories are not as fast as registers. The data
and instruction required to be processed reside in main memory. It is divided into two
subcategories RAM and ROM.
Secondary Memory
This type of memory is also known as external memory or non-volatile. It is slower than
main memory. These are used for storing data/Information permanently. CPU directly
does not access these memories instead they are accessed via input-output routines.
Contents of secondary memories are first transferred to main memory, and then CPU can
access it. For example: disk, CD-ROM, DVD etc.
Cache Memory
Cache memory is a very high speed semiconductor memory which can speed up CPU. It
acts as a buffer between the CPU and main memory. It is used to hold those parts of data
and program which are most frequently used by CPU. The parts of data and programs
are transferred from disk to cache memory by operating system, from where CPU can
access them.
The advantages of cache memory are as follows
Cache memory is faster than main memory.
It consumes less access time as compared to main memory.
It stores the program that can be executed within a short period of time.
It stores data for temporary use.
The disadvantages of cache memory are as follows
Cache memory has limited capacity. It is
very expensive.
NUMBER SYSTEM:
Number system will be having following two values.
1. Base value
2. Position value
(Base position)
Types of number system:
1. Decimal number system
2. Binary number system
3. Octal number system
4. Hexadecimal number system
Algorithm
The solution to any computing problem involves executing a series of actions in a
specific order.
A procedure for solving a problem in terms of the actions to be executed, and the
order in which these actions are to be executed is called an algorithm.
Correctly specifying the order in which the actions are to be executed is important.
Algorithm is an ordered sequence of finite, well-defined, Unambiguous
instructions for completing a task.
It is a step by step procedure for solving a task or problem.
Algorithm helps a programmer in breaking down the solution of a problem into a
no of sequential steps.
Corresponding to each step a statement is written in a programming language.
Characteristics of algorithm:
Each and every instruction should be simple.
Instructions should not repeat infinity.
Algorithm should ultimately terminate.
It should be in sequence.
It should be in normal English.
Derived results should be obtained only after the algorithm terminates.
Example:
Flow chart
Flow chart is defined as graphical representation of the logic for problem solving
The purpose of flowchart is make the logic of the program clear in a visual form
Advantages of flowchart:
1. Communication: - Flowcharts are better way of communicating the logic of a
system to all concerned.
2. Effective analysis: - With the help of flowchart, problem can be analyzed in more
effective way.
3. Proper documentation: - Program flowcharts serve as a good program
documentation, which is needed for various purposes.
4. Efficient Coding: - The flowcharts act as a guide or blueprint during the systems
analysis and program development phase.
5. Proper Debugging: - The flowchart helps in debugging process.
6. Efficient Program Maintenance: - The maintenance of operating program
becomes easy with the help of flowchart. It helps the programmer to put efforts
more efficiently on that part.
*Detailed explanation of Program Controls with examples will be explained in Unit II.
Programming Paradigms:
A programming paradigm is a way or style of how computer programs are written.
There are three fundamentally different programming paradigms:
2. Object-oriented Programming
1. Machine Language:
Low-level languages are closer to the language used by a computer, while high-
level languages are closer to human languages.
• Machine language is a collection of binary digits or bits that the computer reads
and interprets.
• Machine languages are the only languages understood by computers.
• While easily understood by computers, machine languages are almost impossible
for humans to use because they consist entirely of numbers.
1. COMPILER
A computer program that translates source code into object code.
Source code: - High-level language version of the program.
Object code: -The resulting machine code program.
Primary reason for compiling source code is to create an executable program.
It checks all kinds of limits, ranges, errors etc. before executing it completely but the
disadvantage is that when an error in a program occurs it is difficult to pin-point its
source in the original program.
Fig. COMPILER
2. Interpreter:
An interpreter is closely related to a compiler, but takes both source program and input
data. The basic purpose of interpreter is same as that of complier but it can’t create a
executable file like compiler.
Fig. Interpreter
3. Assembler
Assembler is software or a tool that translates Assembly language to machine code.
Assembly is a human readable language but it typically has a one to one relationship
with the corresponding machine code. Therefore, an assembler is said to perform
isomorphic (one to one mapping) translation.
Fig. Assembler
Characteristic of A Good Programming Language
There are various factors, why the programmers prefer one language over the another.
And some of very good characteristics of a good programming language are,
If I take Real world example of an orthogonal system Would be a radio, where changing
the station does not change the volume and vice versa.
When the features of a language are orthogonal, language is easier to learn and
programs are easier to write because only few exceptions and special cases to be
remembered.
3) Support for Abstraction:- There is always found that a substantial gap remaining
between the abstract data structure and operations that characterize the solution to a
problem and their particular data structure and operations built into a language.
Reusability:
We verify the program by many more techniques. A language that makes program
verification difficult maybe far more troublesome to use. Simplicity of semantic and
syntactic structure is a primary aspect that tends to simplify program
verification.
Computation of nCr
0! = 1
1! = 1
2! = 2 x 1 = 2
3! = 3 x 2 x 1 = 6
4! = 4 x 3 x 2 x 1 = 24
1. Define Computer.
18. What are the primary memory available and its types?
48. Write the binary and octal equivalent of hexadecimal number 7BD?
8 MARKS:
1. Explain the characteristics of computer?
4. Write an algorithm, flowchart and pseudo code for to check given number is
palindrome or not
5. Write an algorithm, flowchart and pseudo code to solve the quadratic Equation.
7. Explain the need for an algorithm and highlight its advantages. Write an algorithm
to find the greatest among three numbers?
(59.6825)10
(EBC)16
(654)8
9. Explain in detail on Programming Paradigms.
10. With Examples write in detail on Programming Control Structures.
11. With Examples write characteristics of good programming languages.