A high-level programming language can be converted to machine language using…

2011

A high-level programming language can be converted to machine language using which of the following?

Answer: B. CompilerConcept — a language translator is system software that converts a program written in one language into an equivalent program in another language. Two things…

  1. A.

    Oracle

  2. B.

    Compiler

  3. C.

    MATLAB

  4. D.

    Assembler

Attempted by 80 students.

Show answer & explanation

Correct answer: B

Concept — a language translator is system software that converts a program written in one language into an equivalent program in another language. Two things classify a translator: the SOURCE language it is defined to accept, and what it produces. An assembler accepts assembly language and produces machine code. A compiler accepts a high-level language and produces an equivalent machine (object) code program, translating the whole source before it is run. An interpreter also accepts a high-level language, but instead of producing a machine-code file it executes the source statement by statement. So the source language narrows the choice and the output settles it.

Application — here the source language is a high-level programming language and the required target is a machine-language program. Applying both criteria: accepting a high-level source rules out the assembler, whose defined input is assembly language, and producing machine code rather than executing statement by statement rules out the interpreter. What is left is the translator that takes a complete high-level source program and outputs machine (object) code — the compiler.

Cross-check — what each of the offered items is:

  • Compiler — a language translator; input: a complete high-level source program, output: an equivalent machine (object) code program.

  • Assembler — a language translator; input: assembly language, i.e. mnemonics that correspond one-to-one with a processor's machine instructions, output: machine code. Its defined input is a low-level language, not a high-level one.

  • Oracle — a relational database management system (RDBMS); it stores, organises and queries data through SQL and performs no source-program-to-machine-language translation.

  • MATLAB — a numerical computing environment with its own array-oriented scripting language, carried out by the MATLAB runtime; it is a computing package, not the general high-level-to-machine-language translator the question asks for.

Hence a high-level programming language is converted to machine language by a compiler. A useful refinement: in a full language-processing pipeline a compiler may first emit assembly code, which an assembler then turns into machine code — but the translator whose defined input is the high-level language itself is still the compiler.

Explore the full course: Nta Ugc Net Paper 2

Loading lesson…