Computers can only execute machine code (binary instructions). Since programmers write code in high-level or assembly languages, a translator is needed to convert the source code into machine code. Without translators, programs written in languages like Python would not be able to run on a processor.
Key points
All programs must be translated into machine code before the processor can execute them.
Exam Tip:'Why does the computer need to translate the code?' → The processor can only understand/execute machine code (binary). High-level code must be converted first.
Machine code is binary (0s and 1s) specific to a processor or family of processors.
High-level source code is translated by either a compiler or an interpreter.
Translators bridge the gap between human-readable code and processor-executable instructions.
Without translators, programmers would have to write in binary machine code directly.
Exam Tip:BOTH compilers and interpreters translate high-level code to low-level instructions. Only the COMPILER produces an executable file. Only the INTERPRETER needs to translate every time the program is run.