UNIT - I (Hardware & Software)
UNIT - I (Hardware & Software)
Computer hardware includes all the electrical, mechanical, and the electronic parts
of a computer. Any part that we can see or touch is the hardware.
System Unit
Peripheral devices
Input devices i.e. keyboard, mouse etc.
Output devices i.e. Display Unit, printer etc.
Storage devices like hard disk, floppy disks etc.
Software:
Software: The functioning of the computer is not dependent on hardware alone. So,
what else is required? It requires a set of instructions that tells the computer what is
to be done with the input data. In computer terminology, this set of instructions is
called a program and one or more programs is termed as software.
Software used for computers may be of different types. Some of which are :
1). Application Software
2). System Software
You read about application of computer and identified certain areas where
computers are used today.
a. Machine Language:
This is the language (in the form of 0’s and 1’s, called binary numbers) understood
directly by the computer. It is machine dependent. It is difficult to learn and even
more difficult to write programs.
b. Assembly Language:
This is the language where the machine codes comprising of 0’s and 1’s are
substituted by symbolic codes (called mnemonics) to improve their understanding.
It is the first step to improve programming structure.
Program need not be compiled every Every time higher level program is
5
time converted into lower level program
Errors are displayed after entire Errors are displayed for every
6
program is checked instruction interpreted (if any)
In order to solve a problem by the computer, one has to pass though certain stages
or steps. They are
3. Developing the solution: Here the overview of the sequence of operations that
was the result of analysis stage is expanded to form a detailed step by step solution
to the problem under consideration.
4. Coding and implementation: The last stage of the problem solving is the
conversion of the detailed sequence of operations in to a language that the
computer can understand. Here each step is converted to its equivalent instruction
or instructions in the computer language that has been chosen for the implantation.
Algorithm
The word Algorithm means “a process or set of rules to be followed in calculations
or other problem-solving operations”. Therefore Algorithm refers to a set of
rules/instructions that step-by-step define how a work is to be executed upon in
order to get the expected results.
Characteristics of Algorithm:-
Clear and Unambiguous: Algorithm should be clear and unambiguous. Each
of its steps should be clear in all aspects and must lead to only one meaning.
Well-Defined Outputs: The algorithm must clearly define what output will
be yielded and it should be well-defined as well.
Feasible: The algorithm must be simple, generic and practical, such that it can
be executed upon will the available resources. It must not contain some future
technology, or anything.
Advantages of Algorithms:
5. By using algorithm, the problem is broken down into smaller pieces or steps
hence; it is easier for programmer to convert it into an actual program.
Disadvantages of Algorithms:
Pseudo code
Pseudo code is a combination of two words: Pseudo and Code. 'Pseudo' means
imitation and 'code' refer to instruction written in the programming language.
Pseudo code is not a real programming code. It is the generic way of describing an
algorithm without using any specific programming language-related notations.
The pseudo code cannot be compiled. It cannot be executed and there are no real
formatting or syntax rules for writing pseudo codes.
It is simply an important step in producing the final code. Some important terms
used in pseudo code for different activities are:
The two major constructions in pseudo code structures are: Sequence and Selection
(decision). Sequence indicates the continuous flow of the program, whereas
selection uses logical comparison or conditional check for making decisions.
Example:
No. 1
……………
IF (condition> THEN
List of Actions
ELSE
List of Different Actions
END IF
………………
…………………
No. 2
READ A, B, AND C
IF A is greater than C THEN
DISPLAY A
ELSE
DISPLAY C
END IF
ELSE
IF B is greater than C THEN
DISPLAY B
ELSE
DISPLAY C
END IF
END IF
STOP
No. 3
INITIALIZE Count to zero
DO WHILE Count is greater than or equal to 10
ADD 1 to Count
PRINT Count
ENDDO
STOP