Monday, May 3, 2010

Class XI Question with answer

What is a Translator? Explain its various types.
A translator is a program which is used to convert the source program into machine understandable form is called Translator.
There are three types of translator they are as follow:
a) Assembler
b) Compiler
c) Interpreter

Assembler: Assembler is a program which translates an assembly language program into a machine language program is called assembler.

Compiler: A program which translates a high level language into machine language is called a compiler. A compiler is more intelligent than assemblers. It checks all kinds of limits, ranges, error etc. But program execution time is more, occupies a larger part of memory and faster than interpreter. For example: TC.EXE, JAVAC.EXE etc.

Interpreter: An interpreter is a program which translates a statement of high level language program into machine codes. An interpreter is a smaller program as compared to compiler and slower than compiler. For Example: GWBASIC.EXE, JAVA.EXE etc.

What is Machine Level Language? Mention its advantages and disadvantages.

Programming language that can be directly understood and obeyed by a machine (computer) without conversion (translation). Different for each type of CPU, it is the native binary language (comprised of only two characters: 0 and 1) of the computer and is difficult to be read and understood by humans. Programmers commonly use more English-like languages (called high level languages) such as Basic, C, Java, etc., to write programs which are then translated into machine language (called a low level language) by an assembler, compiler, or interpreter.

Advantages and disadvantages of MLL are as follows:
Advantages
a) Time taken to execute program is less.
b) The program written in this language need not to be translated.

Disadvantages
a) Difficult to learn
b) It is a machine oriented language.
c) The knowledge of computer internal architecture is essential for program coding.