To Get More Materials Click Here WWW - Ktustudents.in
To Get More Materials Click Here WWW - Ktustudents.in
MODULE 1
INTRODUCTION
The term computer is derived from the word compute. The word compute means to calculate.
A computer is an electronic machine that accepts data from the user, processes the data by
performing calculations and operations on it, and generates the desired output results.
Computer performs both simple and complex operations, with speed and accuracy.
www.ktustudents.in
SPEED: The computer can process data very fast, at the rate of millions of
instructions per second. Some calculations that would have taken hours and days to
complete otherwise, can be completed in a few seconds using the computer. For example,
calculation and generation of salary slips of thousands o f employees of an organization,
weather forecasting that requires analysis of a large amount of data related to temperature,
pressure and humidity of various places, etc.
DILIGENCE: When used for a longer period of time, the computer does not get
tired or fatigued. It can perform long and complex calculations with the same speed and
accuracy from the start till the end.
www.ktustudents.in
(1) Microcomputers
Microcomputers are small, low-cost and single-user digital computer. They consist of
CPU, input unit, output unit, storage unit and the software. Although microcomputers are
stand-alone machines, they can be connected together to create a network o f computers that
can serve more than one user. IBM PC based on Pentium microprocessor and Apple
Macintosh are some examples o f microcomputers. Microcomputers include desktop
computers, notebook computers or laptop, tablet computer, handheld computer, smart phones
and netbook.
(2) Minicomputers
Minicomputers are digital computers, generally used in multi-user systems. They have
high processing speed and high storage capacity than the microcomputers. Minicomputers
can support 4—200 users simultaneously. The users can access the minicomputer through
their PCs or terminal. They are used for real-time applications in industries, research centers,
etc. PDP 11. IBM (8000 series) are some of the widely used minicomputers.
(4) Supercomputers
Supercomputers are the fastest and the most expensive machines. They have high
processing speed compared to other computers. The speed of a supercomputer is generally
measured in FLOPS (FLoating point Operations Per Second). Some of the faster
supercomputers can perform trillions of calculations per second. Supercomputers are built
by interconnecting thousands of processors that can work in parallel.
Hardware consists o f the mechanical parts that make up the computer as a machine. The
hardware consists of physical devices of the computer. The devices are required for input,
output, storage and processing of the data. Keyboard, monitor, hard disk drive, floppy disk
drive, printer, processor and motherboard are some of the hardware devices.
Software is a set of instructions that tells the computer about the tasks to be performed
and how these tasks are to be performed. Program is a set of instructions, written in a
language understood by the computer, to perform a specific task. A set o f programs and
documents are collectively called software. The hardware of the computer system cannot
perform any task on its own. The hardware needs to be instructed about the task to be
performed. Software instructs the computer about the task to be performed. The hardware
carries out these tasks. Different software can be loaded on the same hardware to
perform different kinds of tasks.
Data are isolated values or raw facts, which by themselves have no much
significance. For example, the data like 29, January, and 1994 just represent values. The data
is provided as input to the computer, which is processed to generate some meaningful
information. For example, 29, January and 1994 are processed by the computer to give the
date of birth of a person.
Users are people who write computer programs or interact with the computer.
Programmers, data entry operators, system analyst and computer hardware engineers fall into
this category.
The Input-Process-Output Concept :-
A computer is an electronic device that (1) accepts data, (2) processes data, (3) generates
output, and (4) stores data. The concept of generating output information from the input data
is also referred to as input-process-output concept.
Input – The computer accepts input data from the user via an input device like keyboard. The
input data can be characters, word, text, sound, images, document etc.
Process – The computer processes the input data. It performs some actions on the data by
using the instructions or program given by the user of the data. During processing, the data,
instructions and the output are stored temporarily in the computer’s main memory.
Output – The output is the result generated after the processing of data. The output may be in
the form of text, sound, image, document etc. The computer may display the output on a
www.ktustudents.in
monitor, send output to the printer for printing, play the output etc.
Storage – The input data, instructions and output are stored permanently in the secondary
storage devices like disk or tape. The stored data can be retrieved later, whenever needed.
The I/O unit consists of the input unit and the output unit. CPU performs calculations and
processing on the input data, to generate the output. The memory unit is used to store the
data, the instructions and the output information. Figure2 illustrates the typical interaction
among the different components of the computer.
Central processing Unit – CPU controls, coordinates and supervises the operations of the
computer. It is responsible for processing of the input data. CPU consists of Arithmetic
Logic Unit (ALU) and Control Unit (CU).
www.ktustudents.in
ALU performs all the arithmetic and logic operations on the input data.
CU controls the overall operations of the computer i.e. it checks the sequence of
execution of instructions and controls and coordinates the overall functioning of the
units of computer.
Additionally, CPU also has a set of registers for temporary storage of data, instructions,
addresses and intermediate results of calculation.
Memory unit – Memory unit stores the data, instructions, intermediate results and output,
temporarily, during the processing of data. This memory is also called the main memory or
primary memory of the computer. The input data that is to be processed is brought into main
memory before processing. The instructions required for processing of data and any
intermediate results are also stored in the main memory. The output is stored in main memory
before being transferred to the output device.CPU can work with the information stored in the
main memory. Another kind of storage unit is also referred to as the secondary memory of
the computer. The data, the programs and the output are stored permanently in the storage
unit of the computer. Magnetic disks, optical disks and magnetic tapes are examples of
secondary memory
Computer architecture has undergone incredible changes in the past 20 years, from the
number of circuits that can be integrated onto silicon wafers to the degree of sophistication
with which different algorithms can be mapped directly to a computer's hardware. One
element has remained constant throughout the years, however, and that is the von Neumann
concept of computer design.
The basic concept behind the von Neumann architecture is the ability to store program
instructions in memory along with the data on which those instructions operate. Until von
Neumann proposed this possibility, each computing machine was designed and built for a
single predetermined purpose. All programming of the machine required the manual rewiring
of circuits, a tedious and error-prone process. If mistakes were made, they were difficult to
detect and hard to correct.
www.ktustudents.in
Figure : Basic Computer Components.
1. The CPU, which can be considered the heart of the computing system, includes three
main components: the control unit (CU), one or more arithmetic logic units (ALUs),
and various registers. The control unit determines the order in which instructions
should be executed and controls the retrieval of the proper operands. It interprets the
instructions of the machine. The execution of each instruction is determined by a
sequence of control signals produced by the control unit. In other words, the control
unit governs the flow of information through the system by issuing control signals to
different components. Each operation caused by a control signal is called a micro
operation (MO). ALUs perform all mathematical and Boolean operations. The
registers are temporary storage locations to quickly store and transfer the data and
instructions being used. Because the registers are often on the same chip and directly
connected to the CU, the registers have faster access time than memory. Therefore,
using registers both as the source of operands and as the destination of results will
improve the performance. A CPU that is implemented on a single chip is called a
microprocessor.
2. The computer's memory is used to store program instructions and data. Two of the
commonly used type of memories are RAM (random-access memory) and ROM
(read-only memory). RAM stores the data and general-purpose programs that the
machine executes. RAM is temporary; that is, its contents can be changed at any time
and it is erased when power to the computer is turned off. ROM is permanent and is
used to store the initial boot up instructions of the machine.
3. The I/O interfaces allow the computer's memory to receive information and send data
to output devices. Also, they allow the computer to communicate to the user and to
secondary storage devices like disk and tape drives. The preceding components are
connected to each other through a collection of signal lines known as a bus.
As shown in Figure 2.1, the main buses carrying information are the control bus, data bus,
and address bus. Each bus contains several wires that allow for the parallel transmission of
information between various hardware components. The address bus identifies either a
memory location or an I/O device. The data bus, which is bidirectional, sends data to or from
a component. The control bus consists of signals that permit the CPU to communicate with
the memory and I/O devices.
The execution of a program in a von Neumann machine requires the use of the three main
components just described. Usually, a software package, called an operating system, controls
how these three components work together. Initially, a program has to be loaded into the
memory. Before being loaded, the program is usually stored on a secondary storage device
(like a disk). The operating system uses the I/O interfaces to retrieve the program from
secondary storage and load it into the memory.
Once the program is in memory, the operating system then schedules the CPU to begin
executing the program instructions. Each instruction to be executed must first be retrieved
www.ktustudents.in
from memory. This retrieval is referred to as an instruction fetch. After an instruction is
fetched, it is put into a special register in the CPU, called the instruction register (IR). While
in the IR, the instruction is decoded to determine what type of operation should be performed.
If the instruction requires operands, these are fetched from memory or possibly from other
registers and placed into the proper location (certain registers or specially designated storage
areas known as buffers). The instruction is then performed, and the results are stored back
into memory and/or registers. This process is repeated for each instruction of the program
until the program's end is reached.
.
www.ktustudents.in
www.ktustudents.in
www.ktustudents.in
www.ktustudents.in
www.ktustudents.in
www.ktustudents.in
www.ktustudents.in
www.ktustudents.in
www.ktustudents.in
www.ktustudents.in
www.ktustudents.in
www.ktustudents.in
hu
www.ktustudents.in
www.ktustudents.in
www.ktustudents.in
www.ktustudents.in
www.ktustudents.in
www.ktustudents.in
PROGRAMMING LANGUAGES
A Programming Language consists of a set of vocabulary and grammatical rules, to
express the computations and tasks that the computer has to perform. Programming
languages are used to write a program, which controls the behavior of computers, codify the
algorithms precisely, or enables the human-computer interface. Each language has a unique
set of keywords and a special syntax for organizing program instructions. The programming
language should be understood, both by the programmer and the computer. A computer
understands the language of 0’s and 1’s , while the programmer is more comfortable with
English-like langauge. Programming Language usually refers to high-level languages like
COBOL, BASIC, FORTRAN, C, C++, Java etc. Programming languages fall into three
categories :
Machine language is what the computer can understand but it is difficult for
the programmer to understand. Machine languages consist of numbers only.
Each kind of CPU has its own unique machine language.
Assembly Language falls in between machine language and high-level
language. They are similar to machine language, but easier to program in,
because they allow the programmer to substitute names for numbers.
High-level language is easier to understand and use for the programmer but
difficult for the computer.
www.ktustudents.in
The computer can understand the programs written in machine language directly.
No translation of the program is needed.
Program written in machine language can be executed very fast (Since no
translation is required).
It is efficient for the computer but very inefficient for programmers. It is considered
to the first generation language.
Machine language is defined by the hardware of a computer. It depends on the type
of the processor that the computer uses and is thus machine-dependent. A machine
level program written on one computer may not work on another computer with a
different processor.
Most machine-level instructions have one or more opcode fields which specify the
basic instruction type ( such as arithmetic, logical etc), the actual operation (such as
add or compare), and some other fields.
It is difficult to write a program in machine language as it has to be written in binary
code. For e.g., 0001000101110001. Such programs are also difficult to modify.
www.ktustudents.in
3. It is difficult to debug the program.
program written for one computer might not run in other computers with different hardware
configuration.
User-friendly
www.ktustudents.in
Problem oriented rather than 'machine' based.
**************************************************************************
system software used for translating the code that a programmer writes into a form that the
computer can execute (i.e. machine code). These are:
1. Assembler
2. Compiler
3. Interpreter
www.ktustudents.in
1. Assembler
2. Compiler
The compilation process generally involves two parts – breaking down the source
code into small pieces and creating an intermediate representation, and constructing the
object code for the intermediate representation. The compiler also reports syntax errors in the
source code.
3. Interpreter
www.ktustudents.in
line-by-line, converts it into machine understandable form, executes the line and then
proceeds to the next line. Some languages that use an interpreter are BASIC and Python.
Compiler and Interpreter are used to convert a program written in high-level language to
machine language; however, they work differently. The key differences between a compiler
and an interpreter are as follows :
Interpreter looks at a source code line-by-line. Compiler looks at the entire source
code.
Interpreter converts a line into machine executable form, executes the line and
proceeds with the next line. Compiler converts the entire source code into object-
code. The object code is then executed by the user.
For a given source code, once it is compiled, the object code is created. This object
code can be executed multiple number of times by the user. However, interpreter
executes line-by-line, so executing the program using an interpreter means that during
each execution, the source code is first interpreted and then executed.
During execution of an object code, the compiler is not required. However, for
interpretation, both interpreter and the source code is required during execution.
Since interpreter interprets line-by-line, the interpreted code runs slower than the
compiled code.
OR
Compiler Interpreter
6 Errors are displayed after entire Errors are displayed for every
www.ktustudents.in
7
program is checked
OPERATING SYSTEM
An operating system (OS) is the software that manages the sharing of the resources of
a computer and provides programmers with an interface used to access those resources.
Operating system (OS) is the software that provides an interface between the computer
hardware and the applications programs or user(Figure1).
www.ktustudents.in
www.ktustudents.in