wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

H446 Compilers and Translators

Total questions: 62

Worksheet time: 32mins

Name
Class
Date
1.
What are CPUs able to process?
a)
0-9
b)
0-F
c)
0 and 1
d)
0-8
e)
All Options are incorrect
2.
The CPU can only understand one type of code; which one?
a)
High-Level Code
b)
Source Code
c)
Hexadecimal
d)
Machine Code
e)
All Options are incorrect
3.
Would it be possible to write an entire program in binary?
a)
YES
b)
NO
4.
Would it be desirable to write an entire progarm in binary
a)
YES
b)
NO
5.
How is machine code stored?
a)
As a binary number
b)
As a decimal number
c)
As a number separated by dots
d)
As a series of letters
e)
All Options are incorrect
6.
An example of a low level language is…?
a)
Source Code
b)
High Level Code
c)
Assembly Language
d)
Java Scipt
e)
All Options are incorrect
7.
This language has a small set of commands which represent certain pieces of machine code
a)
Assembly Language
b)
Source Code
c)
High Level Code
d)
Java Scipt
e)
All Options are incorrect
8.
Assembly Language commands are known as ….?
a)
Instructions
b)
Data Flow
c)
Mnemonics
d)
Binary
e)
All Options are incorrect
9.
Assembly language can be processed by the CPU far more quickly than high level languages.
a)
True
b)
False
10.
Source code can be processed by the CPU more quickly that High Level Code
a)
True
b)
False
11.
High level code and source code are different
a)
True
b)
False
12.
To aid translation, high level code makes use of
a)
Registers
b)
Syntax
c)
Key Words
d)
CU
e)
All Options are incorrect
13.
What is the PRINT command known as?
a)
Reserved Word
b)
Key Command
c)
Key Syntax
d)
High Level command
e)
All Options are incorrect
14.
Are there any benefits to using Assmebly Language?
a)
YES
b)
NO
15.
Whch of these are benefits of using Assembly Language?
a)

Intuitive to write

b)

More precise CPU Control

c)

Avoid CPU running unnecesary commands

d)

Better control of how RAM is used

e)

All Options are incorrect

16.
Which of these are disadvantages of using High Level Language?
a)
Hard to learn compared to Low Level Code
b)
Difficult to control how RAM is used
c)
CPU may run instructions that are not required
d)
Program may run slower that it should
e)
All Options are incorrect
17.
Which of these are exmples of High Level Code
a)
Java
b)
C#
c)
Assembly Language
d)
Perl
e)
All Options are incorrect
18.

Which word describes an app that converts high level code into low level code

(a)  

19.
Which application takes the whole code and converts it into machine code before running it?
a)
Compiler
b)
Interpreter
c)
Javascript
d)
Perl
e)
All Options are incorrect
20.
Which program takes the code one instruction at a time, translates and runs the instruction, before translating the next instruction?
a)
Compiler
b)
Interpreter
c)
Javascript
d)
Perl
e)
All Options are incorrect
21.
What is the name of intermediate code that has been partially translated by an interpreter?
a)
Lexical Analysis
b)
Bytecode
c)
Compilation
d)
Assembly Language
e)
All Options are incorrect
22.
How quickly does Bytecode run?
a)
Faster than fully compiled code
b)
Slower than fully compiled code
c)
At the same speed as fully compiled code
d)
It cannot run and needs further compiling
e)
All Options are incorrect
23.
Can the same bytecode can be created from different languages?
a)
YES
b)
NO
24.
Can the same translator can be used to run bytecode, regardless of the original coding language?
a)
YES
b)
NO
25.

The bytecode translator can translate the bytecode at run-

(a)  

26.

If the translator runs the bytecode at run-time, this is known as a (a)   compiler?

27.

Bytecode is only (a)   translated before the code is run.

28.

When compiling bytecode the translator can first check the computer’s (a)   before deciding how to translate it,

29.
What is the process of translating source code into executable machine code?
a)
Lexical generation
b)
Syntactical generation
c)
Compilation
d)
Residual interpreting
e)
All Options are incorrect
30.
How many stages are there in compilation?
a)
1
b)
2
c)
3
d)
4
e)
5
31.

Which stage of compilation is concerned with ‘cleaning the code’ of unnecessary characters and splitting the code up into chunks that the translator can understand?

a)

Lexical Analysis

b)

Syntax Alalysis

c)

Code generaton & Optimisation

d)

Bytecode generation

32.
In which stage of compilation are comments and whitespace removed from the source code?
a)
Lexical Analysis
b)
Syntax Alalysis
c)
Code generaton & Optimisation
d)
Bytecode generation
33.

In which stage of compilation is the high level code converted into “tokens”?

a)

Lexical Analysis

b)

Syntax Alalysis

c)

Code generaton & Optimisation

d)

Bytecode generation

34.
In which stage of compilation would a symbol table be produced?
a)
Lexical Analysis
b)
Syntax Alalysis
c)
Code generaton & Optimisation
d)
Bytecode generation
35.
What does a symbol table contain?
a)
Key Words
b)
Identifiers
c)
Memory locations
d)
Data types
36.
What are the variable names known as when written to a symbol table?
a)
Key words
b)
Identifiers
c)
Juxtapositions
d)
Bytecode nominals
37.
Syntax refers to the rules of a ________?
a)
Compiler
b)
Translators
c)
Analysis tool
d)
Language
38.

The compiler produces a list of syntax (a)   ?

39.

The AST represents the (a)   ?

40.
What are opcodes?
a)
Instructions
b)
Data
c)
Memory locations
d)
Syntax
41.
What are operands?
a)
Instructions
b)
Data
c)
Memory locations
d)
Syntax
42.
In which stage does the compiler converts the abstract syntax tree (AST) into object code?
a)
Lexical Analysis
b)
Syntax Alalysis
c)
Code generaton & Optimisation
d)
Bytecode generation
43.
During code generation and optimisataion, what is not converted to object code?
a)
Memory locations
b)
Variables
c)
Libraries
d)
Opcode
44.

Making the code as efficient as possible so that it minimises the amount of memory it requires to run is known as (a)   ?

45.
When does optimisation happen?
a)
Before code generation
b)
After code generation
c)
During code generation
d)
Not at this stage
46.
Are object code and machine code the same?
a)
YES
b)
NO
47.

What is used to link any references that the program has made to library code?

(a)  

48.
What is object code?
a)
Completed machine code
b)
Incomplete machine code
c)
Complete source code
d)
Incomplete source code
49.

What does DLL stand for?

(a)  

50.
What is the issue with static linkers?
a)
Result in larger programs
b)
Result in slower programs
c)
Take longer to compile
d)
Inefficient use of memory
51.
What is the issue with dynamic linkers?
a)
Libraries must be relatively small in size
b)
CPUs process DLLs independently
c)
Libraries must be available at runtime
d)
Code may not run
52.

Main reason why an ​ (a)   is used is at the ​ (b)   or development ​ (c)  

Choose from the below words
interpreter
testing
stage
53.

An ​ (a)   converts ​ (b)   ​ (c)   ​ (d)   instructions into ​ (e)   code.

Choose from the below words
Assembler
mnemonic
assembly
language
machine
54.

A ​ (a)   can take a ​ (b)   to compile ​ (c)   as the translator will often have to convert the ​ (d)   into various sets of ​ (e)   as different CPUs will understand instructions with different machine code from one another.

Choose from the below words
compiler
long time
source code
instructions
machine code
55.

Which translator must be present on the computer for the program is to be run

(a)  

56.

Type of translator not used for high level languages

(a)  

57.

This type of translator allows programmers to quickly detect errors

(a)  

58.

What is used to associate additional library code to the object code?

(a)  

59.

Reorder the following

a)

Source Code

b)

Library Code

c)

Object Code

d)

Linker

e)

Executable code

1)
2)
3)
4)
5)
60.

All ​ (a)   have to be written in accordance to the ​ (b)   otherwise a ​ (c)   would be ​ (d)   to translate the code

Choose from the below words
programs
language's rules
translator
unable
61.

In the code generation and optimisation stage the compiler links to any libraries and other (a)   that the program has made use of

62.

Bytecode is highly....

a)

Reliable

b)

Adaptable

c)

CPU Dependent

d)

Portable