2. Computer System – CPU –
Memory Unit – Data
Representation – Number System
and Conversion – Programming
Fundamentals – Program
Development Life Cycle –
Algorithm – Control Structures –
Flow Chart – Pseudo code –
Programming Paradigms –
Problem Formulation and Problem
Solving.
L.NIVETHA AP/CSE,KNCET
3. Computer is an electronic device that
accept data and process those data’s to
perform mathematical and logical operation
also provide desired output .
The computer system consist of four parts:
1. Hardware,
2. Software,
3. Data,
4. Users.
L.NIVETHA AP/CSE,KNCET
4. Hardware Consist of mechanical parts that
make up the computer as a machine.
The hardware consist of physical devices
of the computer, computer system having
input , output, storage and processing of
data.
Example: Keyboard, Monitor, RAM, Hard
disk, Printer, Processor……etc
L.NIVETHA AP/CSE,KNCET
5. Software is a set of instruction that is used to
perform the user task’s.
Program also set of instruction that written by
using some programming languages that is
understood by the computer also solve the
specified task.
The hardware components of the system
cannot perform any task without the use of
software.
There are two types of software:
1. System Software - Windows , Linux … etc
2. Application Software - Ms Office, C, C++
….. etc
L.NIVETHA AP/CSE,KNCET
6. The data is provided as a input to the
computer system , Which is processed and
generate meaningful information,
System that accept the data as Alphabets
A…. Z, and Numbers 0…..9. with the use of
Keyboard.
L.NIVETHA AP/CSE,KNCET
7. Users are peoples who write the computer
program or interact with the computer
Those are called as Programmers, Data
Entry operators, System analyst and
Computer Hardware Engineer comes under
the users of the computer system.
L.NIVETHA AP/CSE,KNCET
8. The Computer system having three major
components.
1. Input/Output(I/O)unit
2. Central Processing Unit
3.Memory Unit
L.NIVETHA AP/CSE,KNCET
9. Input/ Output Unit
The user interact with the computer through
the I/O unit.
The input unit accepts the data from the user
through input devices like keyboard, mouse,
scanner … etc
The output unit provides the processed data
through monitor, printer … etc
Central processing unit:
Central processing unit or processor called as
a brain of the computer, it consist of control unit,
ALU, and set of Registers.
Memory:
the memory unit consist of cache memory
and primary memory these memory are used to
store the data when the processing of
instruction.
L.NIVETHA AP/CSE,KNCET
10. Central Processing Unit or the processor
called as a brain of the computer,
it consist of control unit, Arithmetic Logic
Unit, and set of Registers which are
temporary storage areas for holding data and
instruction.
ALU perform arithmetic and logical
Operation, CU Control unit controls and
Coordinate the activity of other units.
L.NIVETHA AP/CSE,KNCET
12. CPU Executes the stored program
instructions, those instruction and data
stored in memory before execution.
It interprets the instruction and perform
the arithmetic and logic operation and send
the processed data or results into memory.
CPU also act as a administrator and
responsible for supervising operations of
other parts of the computer.
L.NIVETHA AP/CSE,KNCET
13. ALU consist of two units – arithmetic unit and
logic unit.
Arithmetic unit performs arithmetic
operations on the given data like addition,
subtraction, Multiplication, Division…
The logic unit of ALU is responsible for
performing logical operation.
It will perform the logical operation based on
the user Expression. Testing also performed by
using Relational Operator.
The ALU perform arithmetic logic operation
and store the processed results into memory.
L.NIVETHA AP/CSE,KNCET
14. Registers are high speed storage areas
with in the CPU. But having less storage
capacity.
Registers not having any address location
but register instruction directly accessed by
the CPU.
It store data instructions and addresses
and intermediate results of processing.
Before processing of any logics we need
data and program instruction within the
register.
CPU having different register each register
serving a specific purposes.
L.NIVETHA AP/CSE,KNCET
16. ACC – Accumulator it stores the result of
arithmetic and logic operation.
IC – Instruction Register it stores current
instruction most recently used.
PC – Program Counter contains the address
of next instruction to be processed.
MAR – Memory address Register contains
address of next location in the memory to be
accessed.
MBR – Memory Buffer Register Temporarily
stores data from memory or data store to the
memory.
DR - Data Register it stores variable and any
other data.
L.NIVETHA AP/CSE,KNCET
17. The control unit does not do any operation
but it organize the processing of data and
instruction.
It act as a Supervisor and controls the activity
of other units in the computer.
Control Unit directs the computer to carryout
stored program instruction by
communicating with ALU and registers.
CU also holds the CPU’s instruction set.
L.NIVETHA AP/CSE,KNCET
18. Memory unit used to store the instruction,
data, images and video….etc
There are following memory available in
the system
1. Cache Memory - Storage Buffer
2. Primary Memory(volatile memory) - RAM
and ROM
3. Secondary Memory(Non Volatile Memory) -
Hard disk, Memory Cards…etc
L.NIVETHA AP/CSE,KNCET
19. Cache memory is a very high speed
memory placed in between RAM and CPU. The
cache memory increases the speed of
processing.
Cache memory is a storage buffer that
stores the data and used by the CPU,
At first the CPU will check any data in
cache memory if not found then ask data
from RAM.
Cache memory is build-in into processor,
located between CPU and RAM memory.
L.NIVETHA AP/CSE,KNCET
20. The CPU has a build-in Level1(L1) Cache
and Level2(L2) Cache. In addition of L1 and
L2 Cache, some CPU,s have separate cache
chip on the motherboard called (L3) cache.
These cache stores the recently used
instruction.
Cache Memory is very expensive, so it is
small in size, computer have cache memory
size 256KB to 2MB
L.NIVETHA AP/CSE,KNCET
21. Primary Memory:
Primary memory is called as main
memory, It is used to store data and
information's during the processing of data.
Primary memory is a semiconductor
memory. Primary memory is two kinds RAM
and ROM.
RAM Random Access Memory is a volatile
memory, the information stored in RAM gets
erased when the computer is turned off.
L.NIVETHA AP/CSE,KNCET
22. The ROM is a non volatile memory, but it
is a read only memory. the storage in ROM is
permanent in nature, the instruction are
written by the manufacturer itself.
The input data entered through input
devices are stored in RAM, also processed
output data also stored in RAM.
RAM having limited storage capacity, due
to its high cost.
Data flow:
Hard disk - RAM - Cache - CPU.
L.NIVETHA AP/CSE,KNCET
23. Secondary Memory:
The secondary memory stores data and
instruction permanently. The information
stored in secondary memory for long time
and is generally permanent in nature unless
erased by the user. It is a non volatile
memory.
It provide backup storage for data and
instruction.
the secondary memory has a high storage
capacity than the primary memory.
L.NIVETHA AP/CSE,KNCET
24. secondary memory is also cheaper than
the main memory.
the stored data in the secondary devise
currently not used by CPU, but it may be
required in later use.
It take longer time to access the data and
instruction.
L.NIVETHA AP/CSE,KNCET
25. The data stored in a computer may be of
different kinds
1. Numerical data – (1,2,3……9)
2. Alphabetic data – (a,b………z)
3. Alphanumeric data – it is a combination of
(A,B…….Z ) and Numbers (1,2,3……….9).
All kind of data is represented in terms of
0’s and 1’s in the computer. Each symbol is
represented as unique notation.
L.NIVETHA AP/CSE,KNCET
26. The following number system are used in the
computer:
1. Decimal number system
2. Octal number system
3. Binary number system
4. Hexadecimal number system.
L.NIVETHA AP/CSE,KNCET
27. Decimal number system:
It consist of 10 digits - 0,1,2,3…..9
All the numbers in decimal are represented
within 0…9 for example : 3425
The base value of decimal is 10
Octal Number System:
The octal number system consist of eight
digit - 0……7
All the number in octal represented in eight
digit Example: 0,1……7
The base value of octal is 8
L.NIVETHA AP/CSE,KNCET
28. Binary Number System:
The Binary number system consist of two
digit – 0, 1
All the binary number are represented in this
two digits Example: 010010
The base value of binary is 2
Hexadecimal number system:
The hexadecimal number system consist of
sixteen digits - 0….9 A,B,C,D,E,F
All the hexadecimal number are represented
using this sixteen digit Example: 9A67E.
The base value of hexadecimal is 16
L.NIVETHA AP/CSE,KNCET
29. To convert one number system to another
number system is called number conversion.
There are 12 conversion is possible there
are:
1. Decimal to binary, Octal, Hexadecimal
2. binary, Octal, Hexadecimal to Decimal
3. Others to Others (without combination of
decimal)
L.NIVETHA AP/CSE,KNCET
44. Computer is an electronic device that
accepts data, processes it , and generate
relevant output. It can perform both simple
and complex task.
But the computer cannot perform any
task it’s own.
computer is need some instruction how to
process the specified task to be performed.
The set of instruction that instruct the
computer about way to task to be performed
is called program.
L.NIVETHA AP/CSE,KNCET
45. A program is required for all kind of tasks
like simple task to perform arithmetic
calculation and complex task like gaming.
Through this program to perform all kind
of task.
L.NIVETHA AP/CSE,KNCET
46. PROGRAM DEVELOPMENT LIFE CYCLE
Presented by,
L.Nivetha,AP/CSE,
KNCET
KONGUNADU COLLEGE OF ENGINEERING AND TECHNOLOGY
(AUTONOMOUS)
NAMAKKAL - TRICHY MAIN ROAD, THOTTIAM, TRICHY-621 215
L.NIVETHA AP/CSE,KNCET
47. A program is needed to instruct the
computer about the way a task is to be
performed. The instruction in a program have
three essential part.
1. Instructions to accept the input data
that needs to be processed.
2. Instruction that act as a input data and
process it.
3. instruction to provide the output to
user.
L.NIVETHA AP/CSE,KNCET
48. The instruction in a program are defined
in a specific sequence. A program is write by
a programmer based on the program
Development Life Cycle.
Program
Analysis
Program
Development
Program
Design
Program
development
life cycle
Program
Documentation
and
Maintenance
L.NIVETHA AP/CSE,KNCET
49. The programmer first understand the
problem to be solved.
The programmer find out the different
ways the problem can be solved, and decide
the best solving solution which will be
followed to solve the problem
L.NIVETHA AP/CSE,KNCET
50. The selected solution is represented in form,
then it will be coded. This require three types:
1. An algorithm is written, Which is in
simple English.
2. A flowchart is drawn, which is the
diagrammatic representation of a solution. It
is easy to understand.
3. A Pseudo code is written, Pseudo code
uses the structured program construct .
L.NIVETHA AP/CSE,KNCET
51. Definition:
Algorithm is an ordered sequence of finite,
well defined, unambiguous instruction for
completing task.
Algorithm is defined as a step by step procedure
for solving any problem . It is one of the basic tools
used to develop the problem solving .
It is also a precise rule to specifying how to solve a
problem.
L.NIVETHA AP/CSE,KNCET
52. Example:
ALGORITHM FOR AREA OF CIRCLE
STEP-1: Start the program
STEP-2: Read the value of radius r
STEP-3: Calculate Area=3.14*r*r
STEP-4: Print the area of circle
STEP-5: Stop the program
L.NIVETHA AP/CSE,KNCET
53. Example:
ALGORITHM FOR AREA OF CIRCLE
STEP-1: Start the program
STEP-2: Read the value of radius r
STEP-3: Calculate Area=3.14*r*r
STEP-4: Print the area of circle
STEP-5: Stop the program
L.NIVETHA AP/CSE,KNCET
54. Flowchart is a pictorial representation or
diagrammatic representation of an algorithm.
A flowchart uses different shaped symbols for
representing different instruction and this
information written into small boxes using
clear statement.
Here lines and arrow mark represent flow of
operation.
The purpose of drawing a flowchart is to
represent the logic of the program to clear
manner in visual form.
L.NIVETHA AP/CSE,KNCET
56. Example : Addition of two numbers
start
C=a+b
Read a
b
Write
c
stop
L.NIVETHA AP/CSE,KNCET
57. Pseudo code is also a formal design tool.
Pseudo code consist of short , readable and
written in normal English used to explain an
algorithm.
Pseudo code does not include details like
variable declaration , subroutines …
It is a short hand way of describing the
computer program
It is easier for programmer or non
programmer to understand the general
working of the computer program .
Pseudo code cannot be compiled or executed
L.NIVETHA AP/CSE,KNCET
58. Rules for writing Pseudocode:
1. Pseudo code written in structured English
2. Write one statement per line
3. Capitalize Keywords – READ,WRITE,IF,
ENDIF, WHILE , UNTIL.
4. Indent to show hierarchy
5. End with multiline structure
6. Keep statements Language independent
Input: READ , GET , INPUT
Output: OUTPUT , PRINT , DISPLAY.
Calculation: COMPUTE , CALCULATE , ADD
…etc
Increment : INCREMENT.
L.NIVETHA AP/CSE,KNCET
59. 3.PROGRAM DEVELOPMENT
The computer programming languages are different
kinds, low level and high level languages like C, C++, Java,
,,,etc
Based on the programming language first to write a
pseudo code.
Using this pseudo code to write the program based on
the language instruction.
These program compiled for any syntax error. Syntax
errors arise due to incorrect use of the programming
language.
The successfully compiled program to be executed
When the time of execution to give input data that will
be processed and produce the corresponding output.
L.NIVETHA AP/CSE,KNCET
60. 4.Testing the program:
Testing is the process of verify the
expected result is came or not.
5.Program Documentation and Maintenance.
The program is properly documented, so
that later on any one can use it and
understand it’s working.
Any changes made in the program, after
installation due to add some features in the
application is called maintenance.
L.NIVETHA AP/CSE,KNCET
61. • An Algorithm contains step by step effective
information, It is not a computer program ,It
is one of the basic tool in problem solving.
Characteristics:
Algorithm has a finite number of inputs.
Every instruction should be precise and
unambiguous.
It looks like a normal English.
Effectiveness of each step is very important.
The desired output must obtained only after
the algorithm terminates.
The algorithm should written in sequence.
L.NIVETHA AP/CSE,KNCET
62. Different algorithm may perform the
same task with different set of instruction.
Some algorithm is better than the other in
solving problem.
The following factors that determine the
Quality of algorithm are :
1.Time
2. Memory
3. Accuracy
4. Sequence
5. Generability
L.NIVETHA AP/CSE,KNCET
63. Control flow is defined as each and every
program having it’s own logic’s , Based on
this logic the control flow vary from one
program to another .
The basic control flow needed for writing
good and efficient algorithm there are.
1. Sequence Control Flow
2. Selection Control Flow
3. Iteration (Looping ) Control Flow
L.NIVETHA AP/CSE,KNCET
64. Here the instructions are executed in a
linear order one after the other,
The instruction in sequence control flow
are executed exactly once
Example:
Step1: start the program
Step2: Read the element num1 , num2
Step3: Calculate sum=num1 + num2
Step4: Print the sum
Step5: stop the program
L.NIVETHA AP/CSE,KNCET
65. Here the step to be executed based on the
decision taken (Based on the condition)
If the condition is true , it execute one path
of statements , If the condition is false , it
execute another path of instruction.
L.NIVETHA AP/CSE,KNCET
66. Example : Algorithm to find biggest among two
numbers
Step1: Start the program
Step2: Read the element num1 , num2
Step3: Compare two numbers if( num1 >
num2)
Step4: If the condition true to print num1 is a
biggest number
Step5: If the condition is false to print num2
is a biggest number
Step6: Stop the program
L.NIVETHA AP/CSE,KNCET
67. In iteration control flow , One or more
instruction executed repeatedly until the
particular condition become false,
Here it check the condition , If it is true
means it execute the group of statement
repeatedly , if the condition become false it
terminate the loop.
L.NIVETHA AP/CSE,KNCET
68. Step1: Start the program
Step2: Read the element num=5 , sum=0 ,
i=1
Step3: Check the condition while(num >=i):
Step4: if the condition is true do
sum =sum +i
i=i+1
Step5: if the condition false come out from the
loop.
Step6:Print the sum
Step7:Stop the program.
L.NIVETHA AP/CSE,KNCET
69. Flowchart is a pictorial representation or
diagrammatic representation of an algorithm.
A flowchart uses different shaped symbols for
representing different instruction and this
information written into small boxes using
clear statement.
Here lines and arrow mark represent flow of
operation.
The purpose of drawing a flowchart is to
represent the logic of the program to clear
manner in visual form.
L.NIVETHA AP/CSE,KNCET
70. Program preparation is simplified
Easier to understand
Provide effective documentation
Easy to analyze and compare with various
method
Reviewing and debugging is easy
L.NIVETHA AP/CSE,KNCET
72. The standard symbols only used .
Arrowhead represent direction of flow control
Usual procedure of direction is top to bottom
Only one flow line should come process
symbols and one flow line out from each
symbols.
<0 >0
=0
L.NIVETHA AP/CSE,KNCET
73. Three basic structure available There are:
1 . Sequence structure:
Here the steps are executed in a linear
order one after the other,
The steps in the sequence control flow
are executed exactly once
It is simplest method , Here flow is goes
to only one direction that is top to bottom.
L.NIVETHA AP/CSE,KNCET
74. Selection Structure:
Here the step to be executed based on the
decision taken (Based on the condition)
If the condition is true , it execute one
path of statements , If the condition is false
, it execute another path of instruction.
The following example flowchart
compares two numbers and find the
maximum of two numbers , Decision taken
based on the condition , if the condition is
true it will print a is big , If the condition is
false print b is big then stop the process
L.NIVETHA AP/CSE,KNCET
76. Loop Structure/Iteration Structure:
In iteration control flow , One are more
instruction executed repeatedly until the
particular condition become false,
Here it check the condition , If it is true
means it execute the group of statement
repeatedly , if the condition become false it
terminate the loop.
The following example it check condition
based on decision if true it execute the set of
statement sum=sum+i ,i=i+1 repeatedly , if
the condition is false it print the sum and
stop the process. L.NIVETHA AP/CSE,KNCET
78. 1. To understand the logic clearly
2. Better communication
3. Effective analysis
4. Effective synthesis
5. Effective coding
6. Proper program documentation
7. Systematic Debugging
8. Systematic testing
9. Efficient Program Maintenance.
L.NIVETHA AP/CSE,KNCET
79. Here the steps are executed in a linear order
one after the other,
The steps in the sequence control flow are
executed exactly once
It is simplest method , Here flow is goes to only
one direction that is top to bottom.
Example: Addition of two numbers
READ the values of a , b
COMPUTE sum= a+b
WRITE sum
STOP
L.NIVETHA AP/CSE,KNCET
80. Here the step to be executed based on the
decision taken (Based on the condition)
If the condition is true , it execute one path
of statements , If the condition is false , it
execute another path of instruction.
Example:
READ the values of a , b
COMPARE IF(a>b): THEN
IF true WRITE a is biggest
number
ELSE :
WRITE b is biggest number
ENDIF L.NIVETHA AP/CSE,KNCET
81. In iteration control flow , One are more
instruction executed repeatedly until the
particular condition become false,
Here it check the condition (WHILE()), IF it
is true means it execute the group of
statement repeatedly , IF the condition
become false it terminate the loop.
Example:
READ num , sum ,i
Check WHILE(num>i):
IF true do sum=sum+I
i=i+1
WRITE sum
STOP L.NIVETHA AP/CSE,KNCET
82. Programming paradigm was defined as
different pattern and models for writing a
program.
The programming paradigm may differ in
the terms of our own idea.
In earlier the unstructured style of
programming was used ,
Here all action are specified into small and
simple program.
L.NIVETHA AP/CSE,KNCET
83. Programming paradigm can be classified as
follows.
1. Structured programming
2. Object _Oriented programming
3. Aspect_ Oriented Programming
L.NIVETHA AP/CSE,KNCET
84. Here the problem to be solved by
subdividing the main task into small that can
be written independently.
Once we written the small task , those
task combined together and complete the
main task.
The structured programming written in
two ways:
1. procedural programming
2. modular programming .
L.NIVETHA AP/CSE,KNCET
85. Here the given task to be divided into
smaller procedure or functions that are
written with in the main function.
This will perform a specific task.
Here a procedure or function called , then
the execution control jumped to
corresponding procedure definition , after
execution control comes back to the called
procedure.
L.NIVETHA AP/CSE,KNCET
86. Here the large program subdivided
into group of files ,each file consist
of programs that can be executed
independently.
here all the task related to each
other .
example : C , COBOL and Pascal
L.NIVETHA AP/CSE,KNCET
87. This will developing the program
based on their component objects. the
components interacts with each other
to provide the functionality of the
software.
The terms that are related to OOPS:
1.Class - is the basic building blocks of algorithm.
2.Object - it is run time instances of the class.
3.Abstraction - is the process of picking essential
details from large program and ignore remaining
details.
L.NIVETHA AP/CSE,KNCET
88. 4. Encapsulation - is the process of
implementing abstraction
5.Inheritance - it is a feature application in
C++ I, it will derive a new class from the
base class.
6.Polymorphism – It allows different objects to
respond to the same message in different
ways.
Example: JAVA and C++
L.NIVETHA AP/CSE,KNCET
89. Aspect oriented programming is a new
technique that handles crosscutting concerns
like logging , authentication, security,
performance.
these aspects not fit into a single module
or related module.
L.NIVETHA AP/CSE,KNCET
91. Effective Problem formulation is fundamental
to the success of all analysis.
It is more essential even for small studies ,it
will save time later and help ensure quality.
There is no universally acceptable approach
to problem formulation.
L.NIVETHA AP/CSE,KNCET
92. Problem solving is the process of solving
any problem by using following methods.
1. Recognize and understand the problem.
2. Accumulate facts.
3. Select appropriate theory.
4. Make necessary assumptions.
5. Solve the problem.
6. Verify the result.
L.NIVETHA AP/CSE,KNCET
93. The five steps used in computer for problem
solving:
1. Develop an algorithm and flowchart.
2. Write the program in computer language.
3. Enter the program into computer.
4. Test and debug the program.
5. Run the program ,get input data and get the
result of the program
L.NIVETHA AP/CSE,KNCET
94. A=10, b=20
C=A+B
Print c
Step – 1 : Start the Program
Step – 2: read the two numbers A,B
Step – 3: Calculate C=A+B
Step – 4: print the calculated value C
Step – 5:Stop the Program
L.NIVETHA AP/CSE,KNCET
95. A=16
C=A*A
Print C
Step – 1: Start the program
Step - 2:Read the number A
Step – 3:Calculate C=A*A
Step – 4:Print the result C
Step – 5:Stop the program
L.NIVETHA AP/CSE,KNCET