A-Level Computer Science CIE 16.2 Program Translators

?
Assembler
Assemblers are program translators that will translate a low-level language (assembly language) into machine code (binary)
1 of 17
Advantages of an Assembly language:
1. Speed: Programs that are written in this language, are faster than high level languages, since they are closer to the machine code and do not require extra translation steps like higher level languages.
2. Size: They are typically smaller in size due t
2 of 17
Disadvantages of an Assembly language:
1. Difficult to debug and create low level programs due to the lack of error catching
2. The language is machine dependent, meaning that it can not be used on every type of computer
3 of 17
Interpreter
It executes the program it is interpreting, and it executes one statement at a time, and it translates the high-level language into low-level languages
4 of 17
Advantages of an interpreter
Easier to debug than compiler,
Less Memory and intermediate steps,
Execution Control (can stop execution and edit code at any point)
5 of 17
Disadvantages of an interpreter
Less Secure (As it doesn’t generate any executable files that can be shared with others),
Dependencies file required (An interpreter has to be installed to run code),
Slower than compiler (As it reads, analyses and converts code line-by-line)
6 of 17
Compiler
It doesn't execute the
program it is compiling, it executes the entire program and it translates the high-level language into low-level languages
7 of 17
Advantages of a Compiler
Runs Faster than interpreter,
No dependencies,
More secure,
Optimized
8 of 17
Disadvantages of a Compiler
Requires more memory than interpreter,
Incompatibility issues (due to the code being optimized for the system that it is run on, so may lead to incompatibility on the same OS as well),
More difficult to debug
9 of 17
Lexical Analysis
The process of converting a sequence of characters to a sequence of tokens (Strings with an assigned meaning).
10 of 17
Syntax Analysis
The process of checking the code for any grammar mistakes typically twice at least
11 of 17
Code Generation
The process by which an intermediate code is generated after syntax analysis is complete
12 of 17
Optimization
The process in which the code is edited to make improvements in efficiency.
13 of 17
What does BNF stand for and what does it do?
Backus Naur Form,
Can be used as a basis for an algorithm
Can be defined recursively
14 of 17
What does RPN stand for and what does it do?
Reverse Polish Notation,
Used for representing algebraic expressions
Operator placed after operands
15 of 17
Write the RPN for the following expressions:
i) (A+B) * (C-D) [2]
ii) -A/B*4/(C-D) [3]
i) A B + C D -*
ii) A - B/ 4* C D -/
16 of 17
iii) Explain one advantage of using RPN for the evaluation of an expression: [2]
1. No Need for rules of precedence
2. No need for brackets
3. In RPN evaluation of operators is always left to right
17 of 17

Other cards in this set

Card 2

Front

1. Speed: Programs that are written in this language, are faster than high level languages, since they are closer to the machine code and do not require extra translation steps like higher level languages.
2. Size: They are typically smaller in size due t

Back

Advantages of an Assembly language:

Card 3

Front

1. Difficult to debug and create low level programs due to the lack of error catching
2. The language is machine dependent, meaning that it can not be used on every type of computer

Back

Preview of the back of card 3

Card 4

Front

It executes the program it is interpreting, and it executes one statement at a time, and it translates the high-level language into low-level languages

Back

Preview of the back of card 4

Card 5

Front

Easier to debug than compiler,
Less Memory and intermediate steps,
Execution Control (can stop execution and edit code at any point)

Back

Preview of the back of card 5
View more cards

Comments

No comments have yet been made

Similar Computing resources:

See all Computing resources »See all 16.2 Program Translators resources »