Super Easy Short Computer Notes To Improve Computer Literacy and Your IT Skills

Sponsored Links

Friday, November 29, 2013

Types and Differences of Language Processors or Translators in Programming

Leave a Comment
Q. Define Language processor or Translator. Explain different types of Language processors.

Language Processors / Translator

Computer directly understands only machine language. Machine language is the native language of computer. Machine language is in binary form that is its instructions consists of strings of zeros and ones. A program written in high-level or assembly language cannot be run on a computer directly. Firstly, it is converted into machine language. So there is a need to translate the source program into object code for a computer to execute it. Language processor or translator may be defined as a software that converts source programs into object program. Therefore, a language translator software will take a source program(that cannot be understood by computer) as input and then will convert it into object code(that can be understood by computer).
Different types of language processors are:

  1. •     Compilers
  2. •     Interpreters
  3. •     Assemblers
how Compiler works, How Language translator works, Language processor explanation, difference between language translators, different types of language translators

Compiler

A compiler is a program that converts the source program into object program(machine code) as a whole.
 A program written in high-level language is called source program. A program in machine language is called Object program. The compiler converts source program in machine code called object program. Compiler also checks and reports syntax errors in the program. A source program containing an error cannot be compiled.
For example, C language and COBOL uses compiler. The function of a compiler is shown in the figure above.

Interpreter


How Interpreter works, How Language Translator Interpreter works, interpreter translates one instruction at a time An interpreter is a program that converts one statement of a program into machine code at one time. Then translated instruction is executed. If there is an error in the statements, the interpreter displays an errors message. In other words we can say that interpreter is a software that translates an instruction into a machine language and gets executed it before proceeding to the next instruction.
The advantage of interpreters over compilers is that an error is found immediately. The disadvantage of interpreter is that it is not very efficient. It does not create object file. So every time we execute the source program, it is translated again one instruction at a time. Whereas compiler creates an object code file. So next time when the program is executed, this object program is run( and no translation or compilation is needed unless we change the source code). Visual Basic uses interpreter.

Assembler

An assembler is a translating program that translates the instructions of a program written in assembly language into machine language.

Q11. Differentiate between: Compiler & Interpreter, Software & Hardware, Source & Object Program, Low-level & High-level Language, DOS and Windows,

Difference between Compiler & Interpreter

Difference between Compiler & Interpreter
Compiler

Interpreter

1.    Compiler   converts   a   program   into machine code as a whole.

1. Interpreter    converts    a    program    into machine code one statement at one time.

2.    Compiler creates object code file.

2. Interpreter does not create object code file.

3.    Program execution is fast. Since once program is compiled successfully, an object code file is produced. Now this object code file is executed. No need of re-compilation unless we change the source code.

3. Program execution is slow. Because every time we want to run a program it is interpreted again.
   
4.    Error detection and removal is comparatively difficult. Because, compiler will show a list of many errors in the whole program.

4. Error detection is instant and correction is relatively simple and easy, since only one line is translated at a time and if any error, then error message is displayed. We can correct one error at a time easily.
   

 

Read More...

Wednesday, November 20, 2013

Different Types of Programming Languages

1 comment
Explain Different Types of Computer Programming Languages

What is a Program and Programming Language

Program
A set of instructions that tell a computer what to do is called program. A computer works according to the given instructions in the program. Computer programs are written in programming languages. A person who develops a program is called programmer.
Programming Languages
A set of words, symbols and codes used to write programs is called programming language. Different programming languages are available for writing different types of programs. With the help of computer language, a programmer tells a computer what to do.

  Explain different Types of Programming Languages.

There are two main types of computer programming languages.
·        low-level languages
·        high-level languages.
Low Level Languages
These languages are near to computer hardware and far from human languages. Computer can understand these languages easily. Following are two low-level languages:
     Machine Language
     Assembly Language
  Machine Language
A computer language in which instructions are written in binary form (0 and 1) is called machine language. It is the only language that is directly understood by the computer.

Advantages:
a)     Very fast program execution
Disadvantages:
a)     difficult to understand
b)     difficult to learn
c)     difficult to modify
d)     Requires deep knowledge of hardware
e)     Difficult to remove errors
Machine language is also known as first generation language.
 Assembly Language
Assembly language is a low-level language. In assembly language, symbols are used instead of binary code. These symbols are easy to remember. For example Add instruction is used to add two numbers.
Assembly language is also known as second generation language
Advantages:
a) Fast execution of programs
b) easier to learn, understand and modify than machine language
Disadvantages:
a)     machine dependent
b)     Requires knowledge of hardware
 High Level Languages
A type of language that is close to human languages is called high level language. High-level languages are easy to understand. Instructions of these languages are written in English-like words e.g. Print, Display, Write etc.
Advantages:
a) Easy to learn and understand
b) Easy to modify
c) Easy to remove errors
d) Machine independent
e) Better documentation
Disadvantages:
a) Less fast program execution
b) Certain operations can be performed
Read More...

Recent Posts

Sponsored Links
.