Module 1
Module 1
Computer is an advanced electronic device that takes raw data as input from the user and
processes these data under the control of set of instructions (called program) and gives the result
(output) and saves output for the future use.
Computer Architecture
The basic components of a modern digital computer are: Input Device, Output Device, Central
Processor Unit (CPU), mass storage device and memory.
It is the brain of the computer system. All major calculation and comparisons are made inside the
CPU and it is also responsible for activation and controlling the operation of other unit. This unit
consists of two major components that are arithmetic logic unit (ALU) and control unit (CU).
Here arithmetic logic unit performs all arithmetic operations such as addition, subtraction,
multiplication and division. It also uses logic operation for comparison.
The control unit of a CPU controls the entire operation of the computer. It also controls all
devices such as memory, input/output devices connected to the CPU.
1
Input /Output Unit
The input/output unit consists of devices used to transmit information between the external world
and computer memory. The information fed through the input unit is stored in computer's
memory for processing and the final result stored in memory can be recorded or display on the
output medium.
Memory Unit
The content of ROM cannot be changed and can be used only by CPU. It is needed to store Basic
Input Output System (BIOS), which is responsible for booting. This memory is permanent in
storage (non volatile) and is very small in size.
The RAM is a volatile memory i.e. its contents get destroyed as soon as the computers is
switched off. All kinds of processing of CPU are done in this memory.
Secondary Memory
Primary memory has limited storage capacity and is volatile. Secondary memory overcome this
limitation by providing permanent storage of data and in bulk quantity. Secondary memory is
also termed as external memory and refers to the various storage media on which a computer can
store data and programs. The Secondary storage media can be fixed or removable. Fixed Storage
media is an internal storage medium like hard disk that is fixed inside the computer. Storage
2
medium that are portable and can be taken outside the computer are termed as removable storage
media.
eg: Hard disk, Magnetic Tapes, Pen drive
System Software:
System Software is the type of software which is the interface between application software
and system. Low level languages are used to write the system software. System Software
maintain the system resources and give the path for application software to run. An important
thing is that without system software, system cannot run. It is a general purpose software.
Application Software:
Application Software is the type of software which runs as per user request. It runs on the
platform which is provide by system software. High level languages are used to write the
application software. It is a specific purpose software.
The main difference between System Software and Application Software is that without system
software, system cannot run on the other hand without application software, system always runs.
3
S.NO SYSTEM SOFTWARE APPLICATION SOFTWARE
Low level languages are used to write the High level languages are used to
2.
system software. write the application software.
Types of Languages
Computer programs can be written in high and low level languages, depending on the task and
the hardware being used.
High level languages are written in a form that is close to human language, enabling to
programmer to just focus on the problem being solved.
Advantages
4
Low Level Language
Low level languages are used to write programs that relate to the specific architecture and
hardware of a particular type of computer.
They are closer to the native language of a computer (binary), making them harder for
programmers to understand.
Assembly Language
System Translator
A translator is a programming language processor that converts a computer program from one
language to another. It takes a program written in source code and converts it into machine
code. It discovers and identifies the error during translation. There are 3 different types of
translators as follows:
1) Compiler
5
BASIS FOR
COMPILER INTERPRETER
COMPARISON
Errors Display all errors after compilation, Displays error of each line one by
all at the same time. one.
6
Disadvantages of Structured Programming Approach:
1. Since it is Machine-Independent, so it takes time to convert into machine code.
2. The converted machine code is not the same as for assembly language.
Algorithm
It is a complete step by step representation of the solution of the problem, represented in English
like Languages. An algorithm can be abstract or quite detailed. A detailed algorithm consists of
every step, equivalent to one instruction of a programming language.
Example: Algorithm to find area of circle
Pseudo Code
It is a more formal representation than the algorithm. Here, we represent every stp in a formal
way which is very close to the actual programming language representation. In pseudocode, each
of the steps will be written via operator and statements equivalent to some programming
language instructions. The only difference will be that the exact syntax of the programming
language will not be followed. All pseudocodes will start with the keyword “START” and
complete with keyword “STOP” or “END”.
7
Flowchart
Very popular method to represent the steps of the solution is the flowchart, which uses many
graphical symbols and thus, is more understandable. The symbol used for various different types
of statements are as shown
Start, Stop
Read, Print
Processing Statements
Condition Check
Direction of flow
8
1) Arithmetic Operation
9
3) Largest of three numbers
4) Odd or even
10
5) Sum of first n numbers
11
7) Check whether a number is palindrome or not
12
9) Check whether a number is perfect or not
13
11) Sum and average of an array
14
13) Linear Search
15
15) Bubble Sort
16