0% found this document useful (0 votes)
70 views3 pages

PF Tutorial 1

The document discusses various components of a computer system including the CPU, RAM, ROM, integrated circuits, and control unit. It then explains the advantages and disadvantages of high-level programming languages compared to low-level languages. Similarities between compilers and interpreters are that they both convert source code to machine code. A compiler translates the entire program at once while an interpreter translates one line at a time. The document also defines and compares the functions of a compiler, assembler, interpreter, linker, and loader in converting programs to machine-readable format and facilitating their execution.

Uploaded by

Parth Solanki
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)
70 views3 pages

PF Tutorial 1

The document discusses various components of a computer system including the CPU, RAM, ROM, integrated circuits, and control unit. It then explains the advantages and disadvantages of high-level programming languages compared to low-level languages. Similarities between compilers and interpreters are that they both convert source code to machine code. A compiler translates the entire program at once while an interpreter translates one line at a time. The document also defines and compares the functions of a compiler, assembler, interpreter, linker, and loader in converting programs to machine-readable format and facilitating their execution.

Uploaded by

Parth Solanki
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/ 3

PF Tutorial 1

==============================================
1. A central processing unit (CPU) is the hardware within a computer that carries out the instructions of
a computer program by performing the basic arithmetical, logical, and input/output operations of the
system.

2. Random Access Memory Retains data as long as it is kept powered.

3. The ROM portion of main memory is needed for storing an initial program called bootstrap loader,
which is Used For start the computer software operating when power is turned on

4. Integrated circuits are used in Third generation of computers.

5. The time required for fetching and execution of one simple machine instruction is CPU Cycle.

6. Control Unit interprets program instructions and initiate control operations

7. Advantages of high level language: There have many advantage of high level language; some of them
are listed below;

 In this instructions and commands much easier to remember by programmer.

 Its logic and structure are much easier to understand.

 Debugging is easier compare to other languages.

 Less time consuming to writing new programs.

 HLL are described as being portable language.

Disadvantages of high level language: Some of the disadvantages of high level language are listed
below;

 HLL programming language take more space compare to other MLL (machine level language)
and/or ALL (Assembly level language).

 Cannot communicate directly with the hardware

 High level programs are comparatively slower than low level programs.

 Compared to low level programs, they are generally less memory efficient.
8. Similarities between Compiler and Interpreter:

i) compiler or an interpreter both are use for convert the source code from high level
language to machine level language

ii) Compiler and interpreter is basically use to create object code based on source code

9. Briefly explain the operation of the following:

A. 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. If
a compiler runs on a computer and produces the machine codes for the same computer then it is known
as a self compiler or resident compiler. On the other hand, if a compiler runs on a computer and
produces the machine codes for other computer then it is known as a cross compiler.

B. Assembler: A computer will not understand any program written in a language, other than its
machine language. The programs written in other languages must be translated into the machine
language. Such translation is performed with the help of software. A program which translates an
assembly language program into a machine language program is called an assembler. If an assembler
which runs on a computer and produces the machine codes for the same computer then it is called self
assembler or resident assembler. If an assembler that runs on a computer and produces the machine
codes for other computer then it is called Cross Assembler. Assemblers are further divided into two
types: One Pass Assembler and Two Pass Assembler. One pass assembler is the assembler which assigns
the memory addresses to the variables and translates the source code into machine code in the first
pass simultaneously. A Two Pass Assembler is the assembler which reads the source code twice. In the
first pass, it reads all the variables and assigns them memory addresses. In the second pass, it reads the
source code and translates the code into object code.

C. 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. By the compiler, the machine
codes are saved permanently for future reference. On the other hand, the machine codes produced by
interpreter are not saved. An interpreter is a small program as compared to compiler. It occupies less
memory space, so it can be used in a smaller system which has limited memory space.

D. Linker: In high level languages, some built in header files or libraries are stored. These libraries are
predefined and these contain basic functions which are essential for executing the program. These
functions are linked to the libraries by a program called Linker. If linker does not find a library of a
function then it informs to compiler and then compiler generates an error. The compiler automatically
invokes the linker as the last step in compiling a program. Not built in libraries, it also links the user
defined functions to the user defined libraries. Usually a longer program is divided into smaller
subprograms called modules. And these modules must be combined to execute the program. The
process of combining the modules is done by the linker.

E. Loader: Loader is a program that loads machine codes of a program into the system memory. In
Computing, a loader is the part of an Operating System that is responsible for loading programs. It is one
of the essential stages in the process of starting a program. Because it places programs into memory and
prepares them for execution. Loading a program involves reading the contents of executable file into
memory. Once loading is complete, the operating system starts the program by passing control to the
loaded program code. All operating systems that support program loading have loaders. In many
operating systems the loader is permanently resident in memory.

You might also like