0% found this document useful (0 votes)
13 views11 pages

UNIT - I (Hardware & Software)

Hardware & Software FOR BCA

Uploaded by

Sandeep Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views11 pages

UNIT - I (Hardware & Software)

Hardware & Software FOR BCA

Uploaded by

Sandeep Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

HARDWARE AND SOFTWARE HARDWARE AND 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.

Computer hardware includes:

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

Applicatioin Software Software specially suited for specific applications for


example, railway and airline reservation, billing, accounting or software which
enables creation and storage of documents are termed as application software.
System software In the airline reservation ex System software clerk types your
name and other details through the keyboard. But how does this go to the system
unit? This activity is done by a set of instructions called the Operating Systems.
Operating Systems.
COMPUTER LANGUAGES
Languages are a means of communication. Normally people interact with each
other through a language. On the same pattern, communication with computers is
carried out through a language. This language is understood both by user and the
machine.

1. Low Level Language:


The term low level means closeness to the way in which machine understand. The
low level languages are:

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.

Assembly language programming is simpler and less time consuming than


machine level programming, it is easier to locate and correct errors in assembly
language than in machine language programs. It is also machine dependent.
Programmers must have knowledge of the machine on which the program will
run.

2. High Level Language:


You know that low level language requires extensive knowledge of the hardware
since it is machine dependent. To overcome the limitation, high level language has
been evolved which uses normal English like, easy to understand statements to
solve any problem. Higher level languages are computer independent and
programming becomes quite easy and simple.
 Compiler: It is a program which translates a high level language program
into a machine language program. A compiler is more intelligent than an
assembler. It checks all kinds of limits, ranges, errors etc. But its program
run time is more and occupies a larger part of the memory. It has slow speed.
Because a compiler goes through the entire program and then translates the
entire program into machine codes.

 Interpreter: An interpreter is a program which translates statements of a


program into machine code. It translates only one statement of the program
at a time. It reads only one statement of program, translates it and executes
it. Then it reads the next statement of the program again translates it and
executes it. In this way it proceeds further till all the statements are
translated and executed. On the other hand, a compiler goes through the
entire program and then translates the entire program into machine codes. A
compiler is 5 to 25 times faster than an interpreter.

 Assembler: The Assembler is used to translate the program written in


Assembly language into machine code. The source program is a input of
assembler that contains assembly language instructions. The output
generated by assembler is the object code or machine code understandable
by the computer.
Difference between Compiler and Interpreter
No Compiler Interpreter

Compiler Takes Entire program as Interpreter Takes Single instruction as


1
input input .

Intermediate Object Code is No Intermediate Object Code is


2
Generated Generated

Conditional Control Statements are Conditional Control Statements are


3
Executes faster Executes slower

Memory Requirement : More(Since


4 Memory Requirement is Less
Object Code is Generated)

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)

7 Example : C Compiler Example : BASIC,python

Characteristics of good language-


There might be many reasons for the success of a language, but one obvious
reason is the characteristics of the language. Several characteristics believed to be
important for making a programming language good are:

 Simplicity : A good programming language must be simple and easy to


learn and use. It should provide a programmer with a clear, simple and
unified set of concepts, which can be easily grasped.
 Naturalness:- A good language should be natural for the application area,
for which it has been designed. That is, it should provide appropriate
operators, data structures, control structures, and a natural syntax to
facilitate the users to code their problem easily and efficiently.
 Abstraction:- Abstraction means the ability to define and then use
complicated structures or operations in ways that allow many of the details
to be ignored.
 Efficiency :- Programs written in a good programming language are
efficiently translated into machine code, are efficiently executed, and acquire
as little space in the memory as possible.
 Structured:- Structured means that the language should have necessary
features to allow its users to write their programs based on the concepts of
structured programming.
 Compactness :- In a good programming language, programmers should be
able to express intended operations concisely.

Problem Solving Concept


A computer cannot solve a problem on its own. One has to provide step by step
solutions of the problem to the computer. In fact, the task of problem solving is not
that of the computer. It is the programmer who has to write down the solution to
the problem in terms of simple operations which the computer can understand and
execute.

In order to solve a problem by the computer, one has to pass though certain stages
or steps. They are

1. Understanding the problem


2. Analyzing the problem
3. Developing the solution
4. Coding and implementation.

1. Understanding the problem: Here we try to understand the problem to be


solved in totally. Before with the next stage or step, we should be absolutely sure
about the objectives of the given problem.

2. Analyzing the problem: After understanding thoroughly the problem to be


solved, we look different ways of solving the problem and evaluate each of these
methods. The idea here is to search an appropriate solution to the problem under
consideration. The end result of this stage is a broad overview of the sequence of
operations that are to be carries out to solve the given problem.

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 Inputs: If an algorithm says to take inputs, it should be well-


defined inputs.

 Well-Defined Outputs: The algorithm must clearly define what output will
be yielded and it should be well-defined as well.

 Finite-ness: The algorithm must be finite, i.e. it should not end up in an


infinite loops or similar.

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

 Language Independent: The Algorithm designed must be language-


independent, i.e. it must be just plain instructions that can be implemented in
any language, and yet the output will be same, as expected.

Advantages of Algorithms:

1. It is a step-wise representation of a solution to a given problem, which


makes it easy to understand.

2. An algorithm uses a definite procedure.

3. It is not dependent on any programming language, so it is easy to understand


for anyone even without programming knowledge.

4. Every step in an algorithm has its own logical sequence so it is easy to


debug.

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:

1. Writing an algorithm takes a long time so it is time-consuming.


2. Difficult to show Branching and Looping in Algorithms.

3. Big tasks are difficult to put in 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 features of pseudo code are:

 It uses plain English statements.


 It emphasizes on the design of the computer program.
 It uses structured English.
 It is detailed and readable to draw an inference.
 It enables the programmers to concentrate on the algorithms.

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:

 Input: Read, Obtain, Get and Prompt


 Output: Print, Display, and Show
 Computer: Computer, Calculate, and Determine
 Initialize: Set and Initialize
 Add one: Increment

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

Advantages of Pseudo code:

 Since it is language independent, it can be used by most programmers.


 It helps to design in plain nature language.
 It is easy to translate into programming language.

Disadvantages of Pseudo code:

 It does not provide the visual representation of the program logic.


 There are no accepted standards for writing pseudo code.

You might also like