Professional Documents
Culture Documents
1.3.7 High & and Low Level Languages
1.3.7 High & and Low Level Languages
Human Languages
• Bonjour
• Comment allez vous?
• Tu vas bien?
• Bien sûr, vous êtes bon
Hello
How are you?
You're okay?
of course you are good
1.3.7 High- and low-level languages and their translators
Computer Program
• Human languages are known as natural
languages. Unfortunately, computers can
not understand natural languages, as a
result we must communicate with
computers using computer languages.
• These languages are;
• High Level Languages
• Machine Language
1.3.7 High- and low-level languages and their translators
Parity bits
1.3.7 High- and low-level languages and their translators
Advantages of HLL
• one statement is equal to many low-level language
statements
• problem oriented
• needs converting to machine code before execution
1.3.7 High- and low-level languages and their translators
Assembly languages
Programmers write code in assembly language for
following reasons:
• to make use of special hardware
• to make use of special machine-dependent
instructions
• to write code that doesn’t take up much space in
primary memory to write code that performs a task
very quickly.
1.3.7 High- and low-level languages and their translators
Machine code
• Programmers do not usually write in machine code
as it is difficult to understand and it can be
complicated to manage data manipulation and
storage.
• The following snippet of program to add two numbers
together
Language Translators
• Language Translators convert programming source
code into language that the computer processor
understand.
• Programming source code has various structures
and commands, but the computer processors
understand only machine language.
• Language translators are of three types:
• Compiler
• Interpreter
• Assembler
1.3.7 High- and low-level languages and their translators
Compiler
• Translates the whole HLL program as a
complete unit / at once.
• Creates an executable file / object code.
• A report / list of errors in the code is created.
• Optimises the source code (to run efficiently)
1.3.7 High- and low-level languages and their translators
Interpreter
• Translates a HLL program one line of code at a
time.
• Machine code is directly executed // The
interpreter is used each time.
• the program / code is executed.
• Will identify an error as soon as it finds one in
a line of code.
1.3.7 High- and low-level languages and their translators
Assembler
• translates a program written in an assembly
language into machine code so that it can be directly
used by a computer to perform a required task.
Once a program is assembled the machine code can
be used again and again to perform the same task
without re-assembly.
1.3.7 High- and low-level languages and their translators
Interpreter Vs Compiler
Statements Interpreter Compiler
Error in Program
Error
Syntax Error – Where a program statement doesn’t
obey the rules of the programing language. A program
cannot be translated if it contains syntax errors.
Compiler : A list of all errors in whole program.
Interpreter : Check program statements until found any
error; after rectification of error, program will
reinterpreted & may stop at next error.
Summary
• High-level language
• Low-level language
• Machine code
• Assembly language
• Syntax
• Compiler
• Interpreter
• Source code
• Executable file
1.3.7 High- and low-level languages and their translators
Summary
• Mnemonic codes
• Assembler
• Driver