PPS-1 Unit - 1
PPS-1 Unit - 1
PPS-1 Unit - 1
Computer System
Hardware Software
Hardware:
Computer hardware is the collection of physical elements that
constitutes a computer system. Computer hardware refers to the
physical parts or components of a computer such as the monitor,
mouse, keyboard, computer data storage, hard drive disk (HDD),
system unit (graphic cards, sound cards, memory, motherboard and
chips), etc. all of which are physical objects that can be touched.
Examples of Hardware are the following −
• Input devices − keyboard, mouse, etc.
• Output devices − printer, monitor, etc.
• Secondary storage devices − Hard disk, CD, DVD, etc.
• Internal components − CPU, motherboard, RAM, etc.
Input Unit
This unit contains devices with the help of which we enter
data into the computer. This unit creates a link between the
user and the computer. The input devices translate the
information into a form understandable by the computer.
Output Unit:
The output unit consists of devices with the help of which we
get the information from the computer. This unit is a link
between the computer and the users. Output devices translate
the computer's output into a form understandable by the users.
CPU (Central Processing Unit):
CPU is considered as the brain of the computer. CPU performs
all types of data processing operations. It stores data,
intermediate results, and instructions (program). It controls the
operation of all parts of the computer.
CPU itself has the following three components −
• ALU (Arithmetic Logic Unit)
• Memory Unit
• Control Unit
Memory is primarily of three types −
• Cache Memory
• Primary Memory/Main Memory
• Secondary Memory
Primary Memory (Main Memory)
• Primary memory holds only those data and instructions on which the computer is
currently working. It has a 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 resides in the 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 the 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. The contents of secondary memories are first transferred to the main
memory, and then the 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 the
CPU. It acts as a buffer between the CPU and the main memory. It is used to hold
those parts of data and program which are most frequently used by the CPU. The
parts of data and programs are transferred from the disk to cache memory by the
operating system, from where the CPU can access them.
SOFTWARE :
Software is a set of programs, which is designed to perform a well-defined
function. A program is a sequence of instructions written to solve a particular
problem.
There are two types of software −
• System Software
• Application Software
System Software
The system software is a collection of programs designed to operate, control,
and extend the processing capabilities of the computer itself. System
software is generally prepared by the computer manufacturers. These
software products comprise of programs written in low-level languages,
which interact with the hardware at a very basic level. System software
serves as the interface between the hardware and the end users.
Some examples of system software are Operating System, Compilers,
Interpreter, Assemblers, etc.
Application Software
• Application software products are designed to satisfy a particular need of a
particular environment. All software applications prepared in the computer
lab can come under the category of Application software.
• Application software may consist of a single program, such as Microsoft's
notepad for writing and editing a simple text. It may also consist of a
collection of programs, often called a software package, which work together
to accomplish a task, such as a spreadsheet package.
• Examples of Application software are the following −
• Payroll Software
• Student Record Software
• Inventory Management Software
• Income Tax Software
• Railways Reservation Software
• Microsoft Office Suite Software
• Microsoft Word
• Microsoft Excel
• Microsoft PowerPoint
Types of Languages
There are three main kinds of programming language:
• Machine language
• Assembly language
• High-level language
Machine language: is - it's the language of machines, consisting
of bits (1s and 0s) put together into chunks like bytes, a group
of 8 bits, and lots of other larger sizes. It's highly unlikely you
will ever have to write in machine language but in the old days,
we used to plot 1s and 0s on graph paper
Assembly language: is a little easier than machine language, but
not much! It uses more convenient numbers, symbols, and
abbreviations to describe the huge strings of 1s and 0s, to make
it both easier and more memorable to type in instructions.
Translators
• 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.
Purpose of Translator:
It translates high-level language program into a machine language program
that the central processing unit (CPU) can understand. It also detects errors
in the program.
Different Types of Translators
There are 3 different types of translators as follows:
Compiler:
A compiler is a translator used to convert high-level programming language to
low-level programming language. It converts the whole program in one
session and reports errors detected after the conversion. Compiler takes time
to do its work as it translates high-level code to lower-level code all at once
and then saves it to memory.
Interpreter:
Just like a compiler, is a translator used to convert high-level
programming language to low-level programming language. It
converts the program one at a time and reports errors detected at once,
while doing the conversion. With this, it is easier to detect errors than
in a compiler. An interpreter is faster than a compiler as it
immediately executes the code upon reading the code.
Assembler:
• An assembler is a translator used to translate assembly language to
machine language. It is like a compiler for the assembly language but
interactive like an interpreter. Assembly language is difficult to
understand as it is a low-level programming language. An assembler
translates a low-level language, an assembly language to an even
lower-level language, which is the machine code. The machine code
can be directly understood by the CPU.
• Introduction to Algorithms
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.
Advantages of Algorithms:
• It is easy to understand.
• Algorithm is a step-wise representation of a solution to a given
problem.
• In Algorithm the problem is broken down into smaller pieces
or steps hence, it is easier for the programmer to convert it into
an actual program.
Disadvantages of Algorithms:
• Writing an algorithm takes a long time so it is time-
consuming.
• Branching and Looping statements are difficult to show in
Algorithms.
How to Design an Algorithm?
Algorithm to add 2 numbers and print their sum:
Step 1- start
Step 6- stop
What is a Flowchart?
A flowchart is a graphical representations of steps. It was originated from
computer science as a tool for representing algorithms and programming
logic but had extended to use in all other kinds of processes.
A flowchart can also be used to define a process or project to be
implemented.
• Flowchart Example – Simple Algorithms
Advantages Of Flowchart
1. It is a convenient method of communication.
2. It indicates very clearly just what is being done, where a
program has logical complexities.
3. A key to correct programming.
4 .It is an important tool for planning and designing a new system.
5. It clearly indicates the role-played at each level.
6. It saves the inconveniences in future and serves the purpose of
documentation for a system.
7. It provides an overview of the system and also demonstrates the
relationship between various steps.
8. Facilitates troubleshooting.
9. It promotes logical accuracy.
10.It makes sure that no logical path is left incomplete without
any action being taken.
• Disadvantages Of Flowchart
• The flowchart is a waste of time and slows down the process
of software development.
• The flowchart is quite costly to produce and difficult to use
and manage.
• Flowcharts are not meant for man to computer communication.
• Sometimes the Complex logic of the program logic is quite
complicated to draw out on by using different defined shapes.
In that case, flowchart becomes complex and clumsy. This will
become a pain for the user, resulting in a waste of time and
money trying to correct the problem
• If you need to modify or alternate the process then it will be
very hard to do in the flowchart. Because either you will have
to erase the end of the flowchart or start.
• What is Pseudocode?
Pseudocode is an informal high-level description of a computer
program or algorithm. It is written in symbolic code which must be
translated into a programming language before it can be executed.
• Advantages of Pseudocode
• Improves the readability of any approach. It’s one of the best
approaches to start implementation of an algorithm.
• Acts as a bridge between the program and the algorithm or
flowchart. Also works as a rough documentation, so the program of
one developer can be understood easily when a pseudo code is
written out. In industries, the approach of documentation is
essential. And that’s where a pseudo-code proves vital.
• The main goal of a pseudo code is to explain what exactly each line
of a program should do, hence making the code construction phase
easier for the programmer.
Add Two Numbers Program Pseudocode
Algorithm
BEGIN
DEFINE : Integer num1,num2,result
DISPLAY: “enter the values of num1,num2:”
READ : num1,num2
COMPUTE: result= num1+num2
DISPLAY: result
END
Pseudocode to find the total and average of 3 subject marks
BEGIN
DEFINE : Integer m1,m2,m3,total
DEFINE : Real average
DISPLAY : “Enter the marks in three subjects:”
READ : m1,m2,m3
COMPUTE : total=m1+m2+m3
COMPUTE : average=(m1+m2+m3)/3
DISPLAY : total,average
END
What is C programming?
C is a general-purpose programming language that is extremely popular,
simple and flexible. It is machine-independent, structured programming
language which is used extensively in various applications.