Sunteți pe pagina 1din 33

Holy Grace Academy of Engineering module 1

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.

DIGITAL AND ANALOG COMPUTERS


A digital computer uses distinct values to represent the data internally. All information are
represented using the digits 0s and 1s. The computers that we use at our homes and offices
are digital computers. Analogue computer is another kind o f a computer that represents data
as variable across a continuous range of values. The earliest computers were analogue
computers. Analogue computers are used for measuring of parameters that vary continuously
in real time, such as temperature, pressure and voltage. Analogue computers may be more
flexible bur generally less precise than digital computers. Slide rule is an example of an
analogue computer.

1.1 CHARACTERISTICS OF COMPUTER


Speed, accuracy, diligence, storage capability and versatility are some of the key
characteristics of a computer.
A brief overview of these characteristics are—

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.

 ACCURACY: Computer provides high degree of accuracy. For example, the


computer can accurately give the result of division of any two numbers up to 10 decimal
places.

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

 STORAGE CAPABILITY: Large volumes of data and information can be


stored in the computer and also retrieved whenever required. A limited amount of data
can be stored, temporarily, in the primary memory. Secondary' storage devices like floppy
disk and compact disk can store a large amount of data permanently.

Prepared by Sreelakshmi K Shaji Page 1

To Get more materials click here> www.ktustudents.in


Holy Grace Academy of Engineering module 1

 VERSATILITY: Computer is versatile in nature. It can perform different types of


tasks with the same ease. At one moment you can use the computer to prepare a letter
document and in the next moment you may play music or print a document.
Computers have several limitations too. Computer can only perform tasks that it has been
programmed do. Computer cannot do any work without instructions from the user. It
executes instructions as specified by the user and does not take its own decisions.

1.2 CLASSIFICATION OF COMPUTER


The digital computers that are available nowadays vary in their sizes and types. The
computers are broadly classified into four categories (Figure 1) based on their size and type—
(1) Microcomputers, (2) Minicomputers, (3) Mainframe computers, and
(4) Supercomputer.

www.ktustudents.in

Figure 1 Classification of computers based on size and type

(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

Prepared by Sreelakshmi K Shaji Page 2

To Get more materials click here> www.ktustudents.in


Holy Grace Academy of Engineering module 1

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.

(3) Mainframe Computers


Mainframe computers are multi-user, multi-programming and high performance
computers. They operate at a very high speed, have very large storage capacity and can
handle the workload of many users. Mainframe computers are large and powerful systems
generally used in centralized databases. The user accesses the mainframe computer via a
terminal that may be a dumb terminal, an intelligent terminal or a PC. A dumb terminal
cannot store data or do processing of its own. It has the input and output device only. An
intelligent terminal has the input and output device, can do processing, but, cannot store data
of its own. The dumb and the intelligent terminal use the processing power and the storage
facility of the mainframe computer. Mainframe computers are used in organizations like
banks or companies, where many people require frequent access to the same data. Some
examples of mainframes are CD C 6600 and IBM ES000 series.

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

1.3 THE COMPUTER SYSTEM


www.ktustudents.in
Computer is an electronic device that accepts data as input, processes the input data by
performing mathematical and logical operations on it, and gives the desired output. The
computer system consists of four parts –
(1) Hardware, (2) Software, (3) Data, and (4) Users.

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.

Prepared by Sreelakshmi K Shaji Page 3

To Get more materials click here> www.ktustudents.in


Holy Grace Academy of Engineering module 1

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.

The input-process-output concept of the computer is explained as follows.

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.

Components of Computer Hardware :-


The computer system hardware consists of three main components –
(1) Input/Output (I/O) Unit,
(2) Central Processing Unit (CPU) and
(3) Memory Unit.

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.

Prepared by Sreelakshmi K Shaji Page 4

To Get more materials click here> www.ktustudents.in


Holy Grace Academy of Engineering module 1

Figure 2 The computer system interaction


Input/Output Unit – The user interacts with the computer via the I/O unit. The Input unit
accepts data from the user and the Output unit provides the processed data. i.e. the
information to the user.
The Input unit converts the data that it accepts from the user, into a form that is
understandable by the computer. The Output unit provides the output in a form that is
understandable by the user. The input is provided to the computer using input devices like
keyboard, trackball and mouse. Some of the commonly used output devices are monitor and
printer.

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

VON NEUMANN ARCHITECTURE

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

Prepared by Sreelakshmi K Shaji Page 5

To Get more materials click here> www.ktustudents.in


Holy Grace Academy of Engineering module 1

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.

Von Neumann architecture is composed of three distinct components (or sub-systems): a


central processing unit (CPU), memory, and input/output (I/O) interfaces. Figure represents
one of several possible ways of interconnecting these components.

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

Prepared by Sreelakshmi K Shaji Page 6

To Get more materials click here> www.ktustudents.in


Holy Grace Academy of Engineering module 1

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

Prepared by Sreelakshmi K Shaji Page 7

To Get more materials click here> www.ktustudents.in


Holy Grace Academy of Engineering module 1

www.ktustudents.in

Prepared by Sreelakshmi K Shaji Page 8

To Get more materials click here> www.ktustudents.in


Holy Grace Academy of Engineering module 1

www.ktustudents.in

Prepared by Sreelakshmi K Shaji Page 9

To Get more materials click here> www.ktustudents.in


Holy Grace Academy of Engineering module 1

www.ktustudents.in

Prepared by Sreelakshmi K Shaji Page 10

To Get more materials click here> www.ktustudents.in


Holy Grace Academy of Engineering module 1

www.ktustudents.in

Prepared by Sreelakshmi K Shaji Page 11

To Get more materials click here> www.ktustudents.in


Holy Grace Academy of Engineering module 1

www.ktustudents.in

Prepared by Sreelakshmi K Shaji Page 12

To Get more materials click here> www.ktustudents.in


Holy Grace Academy of Engineering module 1

www.ktustudents.in

Prepared by Sreelakshmi K Shaji Page 13

To Get more materials click here> www.ktustudents.in


Holy Grace Academy of Engineering module 1

www.ktustudents.in

Prepared by Sreelakshmi K Shaji Page 14

To Get more materials click here> www.ktustudents.in


Holy Grace Academy of Engineering module 1

www.ktustudents.in

Prepared by Sreelakshmi K Shaji Page 15

To Get more materials click here> www.ktustudents.in


Holy Grace Academy of Engineering module 1

www.ktustudents.in

Prepared by Sreelakshmi K Shaji Page 16

To Get more materials click here> www.ktustudents.in


Holy Grace Academy of Engineering module 1

www.ktustudents.in

Prepared by Sreelakshmi K Shaji Page 17

To Get more materials click here> www.ktustudents.in


Holy Grace Academy of Engineering module 1

www.ktustudents.in

Prepared by Sreelakshmi K Shaji Page 18

To Get more materials click here> www.ktustudents.in


Holy Grace Academy of Engineering module 1

www.ktustudents.in

Prepared by Sreelakshmi K Shaji Page 19

To Get more materials click here> www.ktustudents.in


Holy Grace Academy of Engineering module 1

hu

www.ktustudents.in

Prepared by Sreelakshmi K Shaji Page 20

To Get more materials click here> www.ktustudents.in


Holy Grace Academy of Engineering module 1

www.ktustudents.in

Prepared by Sreelakshmi K Shaji Page 21

To Get more materials click here> www.ktustudents.in


Holy Grace Academy of Engineering module 1

www.ktustudents.in

Prepared by Sreelakshmi K Shaji Page 22

To Get more materials click here> www.ktustudents.in


Holy Grace Academy of Engineering module 1

www.ktustudents.in

Prepared by Sreelakshmi K Shaji Page 23

To Get more materials click here> www.ktustudents.in


Holy Grace Academy of Engineering module 1

www.ktustudents.in

Prepared by Sreelakshmi K Shaji Page 24

To Get more materials click here> www.ktustudents.in


Holy Grace Academy of Engineering module 1

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 :

Prepared by Sreelakshmi K Shaji Page 25

To Get more materials click here> www.ktustudents.in


Holy Grace Academy of Engineering module 1

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

Regardless of the programming language used, the program needs to be converted


into machine language so that the computer can understand it. In order to do this a program is
either compiled or interpreted.

Figure1 shows the hierachy of programming languages. The choice of programming


langauge for writing a program depends on the functionality required from the program and
the kind of program to be written. Machine langages and assembly languages are also called
low-level languages, and are generally used to write the system software. Application
software is usually written in high-level languages. The program written in a programming
language is also called the source code.

www.ktustudents.in

Figure 1 hierarchy of programming languages

(1) MACHINE LANGUAGE


A program written in machine language is a collection of binary digits or bits that the
computer reads and interprets. It is a system of instructions and data executed directly by a
computer’s CPU. It is also referred to as machine code or object code. It is written as strings
of 0’s and 1’s. Some of the features of machine language are given below :

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

Prepared by Sreelakshmi K Shaji Page 26

To Get more materials click here> www.ktustudents.in


Holy Grace Academy of Engineering module 1

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

Advantage of Machine Language:


The only advantage is that program of machine language run very fast because no
translation program is required for the CPU.

Disadvantages of Machine Language:


1. It is very difficult to program in machine language. The programmer has to know
details of hardware to write program.
2. The programmer has to remember a lot of codes to write a program which results
in program errors.

www.ktustudents.in
3. It is difficult to debug the program.

(2) ASSEMBLY LANGUAGE


It was developed to overcome some of the many inconveniences of machine language.
This is another low level but a very important language in which operation codes and
operands are given in the form of alphanumeric symbols instead of 0’s and l’s. These
alphanumeric symbols will be known as mnemonic codes e.g. ADD for addition, SUB for
subtraction etc. Because of this feature it is also known as ‘Symbolic Programming
Language’. Small, English-like representation is used to write the program in assembly
language.

A translator program is required to translate the Assembly Language to machine language.


This translator program is called `Assembler'. It is considered to be a second-generation
language.

Advantages of Assembly Language:


1.The symbolic programming of Assembly Language is easier to understand and use as
compared to machine language.
2. It is easier to correct errors and modify program instructions.

Disadvantages of Assembly Language:


1.One of the major disadvantages is that assembly language is machine-dependent. A

Prepared by Sreelakshmi K Shaji Page 27

To Get more materials click here> www.ktustudents.in


Holy Grace Academy of Engineering module 1

program written for one computer might not run in other computers with different hardware
configuration.

(3) HIGH LEVEL LANGUAGES


High Level Languages are user-friendly languages which are similar to English with
vocabulary of words and symbols. These are easier to learn and require less time to write.
Higher level languages are problem-oriented languages because the instructions are suitable
for solving a particular problem. For example COBOL (Common Business Oriented
Language) is mostly suitable for business oriented language where there is very little
processing and huge output. There are mathematical oriented languages like FORTRAN
(Formula Translation) and BASIC (Beginners All-purpose Symbolic Instruction
Code) where very large processing is required.

Advantages of High Level Languages:

 User-friendly

 Similar to English with vocabulary of words and symbols

 Therefore it is easier to learn.

 They require less time to write.

 They are easier to maintain.

www.ktustudents.in


Problem oriented rather than 'machine' based.

Program written in a high-level language can be translated into many machine


language and therefore can run on any computer for which there exists an appropriate
translator.

 It is independent of the machine on which it is used i.e.Programs developed in high


level language can be run on any Computer

Disadvantages of High Level Language :


 A high-level language has to be translated into the machine language by a translator and
thus a price in computer time is paid.

**************************************************************************

TRANSLATOR SOFTWARE (PROGRAM TRANSLATORS)


A computer can only understand programs defined using machine code. Consequently
a program written in a high level language cannot be run directly. To execute a computer
program written in high or low level language, it must be translated. There are 3 types of

Prepared by Sreelakshmi K Shaji Page 28

To Get more materials click here> www.ktustudents.in


Holy Grace Academy of Engineering module 1

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

Figure Translator software

A program written in a particular programming language is known as source code.


To execute the program, it must be translated into machine language, ie the language that
the computer understands. The translated program is called the object code.

Assembler converts a program written in assembly language to machine language.


Compiler and interpreter convert a program written in high-level language to machine
language.

www.ktustudents.in
1. Assembler

Assembly language is also referred to as a symbolic representation of the machine


code. Assembler is a software that converts a program written in assembly language into
machine code. There is usually a one-to-one correspondence between simple assembly
statements and machine language instructions.

Advantages of using an Assembler:


 Very fast in translating assembly language to machine code as 1 to 1 relationship
 Assembly code is often very efficient (and therefore fast) because it is a low level
language
 Assembly code is fairly easy to understand due to the use of English-like mnemonics

Disadvantages of using Assembler:


 Assembly language is written for a certain instruction set and/or processor
 Assembly tends to be optimised for the hardware it's designed for, meaning it is often
incompatible with different hardware
 Lots of assembly code is needed to do relatively simple tasks, and complex programs
require lots of programming time.

Prepared by Sreelakshmi K Shaji Page 29

To Get more materials click here> www.ktustudents.in


Holy Grace Academy of Engineering module 1

2. Compiler

A program written in a high-level language has to be converted to a language that the


computer can understand, i.e. binary form. Compiler is the software that translates the
program written in a high-level language to machine language. The program written in high-
level language is referred to as the source code and compiled program is referred as the object
code. The object code is the executable code, which can run as a stand-alone code. It does not
require the compiler to be present during execution. Each programming language has its own
compiler. Some languages that use a compiler are C++, COBOL, Pascal and FORTRAN. In
some languages, compilation using the compiler and linking using the linker are required for
creating the executable object code.

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

The purpose of interpreter is similar to that of a compiler. The interpreter is used to


convert the high-level language program into computer-understandable form. However, the
interpreter functions in a different way than a compiler. Interpreter performs line-by-line
execution of the source code during program execution. Interpreter reads the source code

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.

DIFFERENCE BETWEEN A COMPILER AND AN INTERPRETER

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.

Prepared by Sreelakshmi K Shaji Page 30

To Get more materials click here> www.ktustudents.in


Holy Grace Academy of Engineering module 1

OR

Compiler Interpreter

1 Compiler looks at the entire source Interpreter looks at a source code


code. line-by-line.

2 Intermediate Object Code is No Intermediate Object Code is


Generated Generated

3 Program need not Every time higher level program is


be compiled every time converted into lower level program

4 During execution of an object For interpretation, both interpreter


code, the compiler is not required. and the source code is required
during execution.

5 It takes large amount of time to It takes less amount of time to


analyze the source code but the analyze the source code but the
overall execution time is overall execution time is slower.
comparatively faster.

6 Errors are displayed after entire Errors are displayed for every

www.ktustudents.in
7
program is checked

Programming language like C,


C++ use compilers.
instruction interpreted (if any)

Programming language like Python,


use interpreters.

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

Figure1 : View of components of computer system.

Prepared by Sreelakshmi K Shaji Page 31

To Get more materials click here> www.ktustudents.in


Holy Grace Academy of Engineering module 1

www.ktustudents.in

Prepared by Sreelakshmi K Shaji Page 32

To Get more materials click here> www.ktustudents.in


Holy Grace Academy of Engineering module 1

www.ktustudents.in

Prepared by Sreelakshmi K Shaji Page 33

To Get more materials click here> www.ktustudents.in

S-ar putea să vă placă și