Question 3 of 19intermediate💡 UnderstandShort Answer2 marks

Why is the execution time of the machine code less than that of source code?

Correct Answer

Machine code has less execution time because it is written using 1s and 0s which are directly understood and executed by the computer. The computer does not need any translator to process machine code.

On the other hand, source code is written in assembly or high-level language which is not directly understood by the computer. It requires translators (like compiler or interpreter) to convert it into machine understandable form before execution. This translation process takes additional time.

In case of an interpreter, it translates one line at a time during execution, and the interpreter is always needed whenever the source code is to be executed. This makes the execution slower compared to machine code which needs no translation.

Exercise: EXERCISE | Q: 3 | (Page 24)
For More Understanding

Explanation

The textbook context clearly states that machine language uses 1s and 0s which are 'directly understood and executed by the computer.' Source code, whether written in assembly or high-level language, is 'not directly understood by the computer' and requires translators to convert it to machine code. The interpreter specifically 'takes one line, converts it into executable code' and is 'always needed whenever a source code is to be executed,' adding overhead to execution time. Machine code eliminates this translation step entirely.