Skip to content
Exercises · Q2

Q.How does the computer understand a program written in high level language?

Uttarakhand UbseTextbookSubjective· 3mImportance★★★★★est
31% · 10/32 Questions
✓ Free question

The CPU executes only binary machine code, so a high-level-language program must first be converted by a language translator — a compiler (all at once) or an interpreter (line by line) — before the computer can "understand" it.

The idea. Hardware is built from digital circuits that recognise exactly two states — 0 and 1. The only language a CPU natively executes is therefore machine language: binary-coded instructions specific to that processor. Humans, on the other hand, find it far easier to write in a high-level language (HLL) such as Python, C++ or Java, whose statements resemble English and mathematics. The program we write in an HLL is called the source code, and there is a gap between the two: the CPU simply cannot run source code as-is.

The bridge: language translators. System software called a translator converts source code into machine code. There are two main kinds:

TranslatorHow it worksExamples
CompilerReads the entire source program, checks it, and translates it in one go into a machine-code (object/executable) file. Translation happens once; afterwards the executable runs directly, without the compiler. All syntax errors are reported together after scanning the whole program.C, C++ compilers
InterpreterTranslates and immediately executes the source code one line at a time, every time the program runs. It halts at the first erroneous line, so errors surface one at a time. No separate executable file is produced.Python, JavaScript

The overall flow:

High-level source code
        |
        v
Compiler / Interpreter   (translation)
        |
        v
Machine code (0s and 1s)
        |
        v
CPU fetches, decodes and executes

(For completeness: a program written in assembly language is converted to machine code by an assembler, a third kind of translator.)

Watch out

Don't say the computer "learns" the high-level language — it never does. The translation step always happens; with an interpreter it just happens invisibly on every run.

✓Final answer

A computer understands a high-level-language program only through a language translator: a compiler converts the whole source code into machine code at once, while an interpreter converts and executes it line by line — in both cases producing the binary machine instructions that the CPU can actually execute.

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.