Code No: A107320502
Set No. 1
JAWAHARLAL NEHRU TECHNOLOGICAL
UNIVERSITY HYDERABAD III B.Tech. II Sem., II Mid-Term Examinations, April – 2010
COMPILER DESIGN Objective Exam
|
Answer All Questions. All Questions Carry Equal Marks.Time: 20 Min.
Marks: 20.
I Choose the correct alternative:
1. A hash function is defined as F(key) =
key mod 7 with linear probing is used to insert the keys
37,38,72,48,98,11,56 into a hash
table indexed from 0 to 6 .Then in
which location the key 11 is stored.
[ ] a. 6 b. 5 c. 1 d. 4
2. The storage strategy in which activation record
is maintained even after the execution of
a procedure is completed is [ ] a. Stack allocation b. Heap allocation c. Static allocation d. Dynamic allocation
3. The following symbol table implementation has the minimum
access time. [ ]
a. hash table
b. search tree c. linear list d. self-organizing list
|
4.
|
Machine independent code optimization
can be applied to
|
|
[
|
]
|
|
5.
|
a. Source
code b. Intermediate representation
c. Object code
Which of the following is not a
peephole optimization?
|
d. Run-time output
|
[
|
]
|
a. Removal of unreachable code b.
Elimination of multiple groups
c. Elimination
of loop invariant compilation d. Loop unrolling
6. In loop optimization technique a loop whose body is never executed is [ ]
a. Dead code b. Blank code c. Redundant code d. Blank
stripper
7. Replacing the exponent operator by the
shift of multiplication is [ ]
a. Constant folding b. Reduction in strength
c. Copy propagation d. Elimination of dead variables
|
8.
|
Use of machine idioms is one
of the characteristic of
|
[
|
]
|
|
|
a. Back
tracking b. Peephole optimization c. Dynamic programming
|
d. Global optimization
|
|
9. A basic block can be analyzed by
[ ]
a. Flow graph b. Flow chart c. DAG
d. RAG
10. Object code
[ ]
a. Is ready to execute b.
Is the output of compiler
but not assembler c. Must be loaded
before execution d. Must be rewritten
before execution
Cont…..2
Code
No: A107320502 :2: Set
No.1
II Fill in the blanks:
11. is used to depict the way control enters and leaves activation of procedures.
12. In activation record is used to refer to non-local data held in
other activation records.
13. is the hybrid method between call-by-value
and call-by-reference.
14. method is used for implicit
de allocation
15. Method to improve the target program by
examining
a short sequence of target
instructions is called
16. Movement
of the code from inside to outside is
17. Common sub expressions can be detected automatically by using
18. Instructions involving only register operands are _ _ _ _ _ than those involving Memory operands.
19. Addressing modes involving registers have
20. The output of code generator is
-oOo-
Code No: A107320502
Set No. 2
JAWAHARLAL NEHRU TECHNOLOGICAL
UNIVERSITY HYDERABAD III B.Tech. II Sem., II Mid-Term Examinations, April – 2010
COMPILER
DESIGN
Objective Exam
|
Answer All Questions. All Questions Carry Equal Marks.Time: 20 Min.
Marks: 20.
|
I
|
Choose
the correct alternative:
|
|
||
|
1.
|
Machine independent code optimization
can be applied to
a. Source code b. Intermediate
representation c. Object code
|
d. Run-time output
|
[
|
]
|
|
2.
|
Which of the following is not a
peephole optimization?
|
|
[
|
]
|
a. Removal of unreachable code b.
Elimination of multiple groups
c. Elimination of loop invariant
compilation d. Loop unrolling
3. In loop optimization technique a loop whose body is never executed is [ ]
a. Dead code b. Blank code c. Redundant code d. Blank
stripper
4. Replacing the exponent operator by the
shift of multiplication is [ ]
a. Constant folding b. Reduction in strength
c. Copy propagation d. Elimination of dead variables
|
5.
|
Use of machine idioms is one
of the characteristic of
|
[
|
]
|
|
|
a. Back
tracking b. Peephole optimization c. Dynamic programming
|
d. Global optimization
|
|
6. A basic block can be analyzed by
[ ]
a. Flow graph b. Flow chart c. DAG
d. RAG
7. Object code [ ]
a. Is ready to execute b.
Is the output of compiler
but not assembler c. Must be loaded
before execution d. Must be rewritten
before execution
8. A hash function is defined as F(key) =
key mod 7 with linear probing is used to insert the keys
37,38,72,48,98,11,56
into a hash table indexed from 0 to 6
.Then in which location the key 11 is stored. [ ] a. 6 b. 5 c. 1 d. 4
9. The storage strategy in which activation record
is maintained even after the execution of
a procedure is completed is
[ ] a. Stack allocation b. Heap allocation c. Static allocation d. Dynamic allocation
10. The following symbol table implementation
has the minimum
access time. [ ]
a. hash table
b. search tree c.
linear list d. self-organizing list
Cont…..2
Code
No: A107320502 :2: Set
No.2
II Fill in the blanks:
11. method is used for implicit
de allocation
12. Method to improve the target program by
examining
a short sequence of target instructions
is called
13. Movement
of the code from inside to outside is
14. Common sub expressions can be detected automatically by using
15. Instructions involving only register operands are _ _ _ _ _ than those involving Memory operands.
16. Addressing modes involving registers have
17. The output of code generator is
18. is used to depict the way control enters and leaves activation of procedures.
19. In activation record is used to refer to non-local data held in
other activation records.
20. is the hybrid method between call-by-value
and call-by-reference.
-oOo-
Code No: A107320502 Set No. 3
JAWAHARLAL NEHRU TECHNOLOGICAL
UNIVERSITY HYDERABAD III B.Tech. II Sem., II Mid-Term Examinations, April – 2010
COMPILER
DESIGN
Objective Exam
|
Answer All Questions. All Questions Carry Equal Marks.Time: 20 Min.
Marks: 20.
I Choose the correct alternative:
1. In loop optimization technique a loop whose body is never executed is [ ]
a. Dead code b. Blank code c. Redundant code d. Blank
stripper
2. Replacing the exponent operator by the
shift of multiplication is [ ]
a. Constant folding b. Reduction in strength
c. Copy propagation d. Elimination of dead variables
|
3.
|
Use of machine idioms is one
of the characteristic of
|
[
|
]
|
|
|
a. Back
tracking b. Peephole optimization c. Dynamic programming
|
d. Global optimization
|
|
4. A basic block can be analyzed by [ ]
a. Flow graph b. Flow chart c. DAG
d. RAG
5. Object code
[ ]
a. Is ready to execute b.
Is the output of compiler
but not assembler c. Must be loaded
before execution d. Must be rewritten
before execution
6. A hash function is defined as F(key) =
key mod 7 with linear probing is used to insert the keys
37,38,72,48,98,11,56 into a hash
table indexed from 0 to 6 .Then in
which location the key 11 is stored.
[ ] a. 6 b. 5 c. 1 d. 4
7. The storage strategy in which activation record
is maintained even after the execution of
a procedure is completed is
[ ] a. Stack allocation b. Heap allocation c. Static allocation d. Dynamic allocation
8. The following symbol table implementation has the minimum
access time. [ ]
a. hash table b. search tree c. linear list d. self-organizing list
9. Machine independent code optimization
can be applied to [ ]
a. Source code b. Intermediate
representation c. Object code d. Run-time
output
10. Which of the following is not a peephole
optimization?
[ ]
a. Removal of unreachable code b.
Elimination of multiple groups c. Elimination of loop invariant compilation d. Loop unrolling
Cont…..2
Code
No: A107320502 :2: Set No.3
II Fill in the blanks:
11. Movement
of the code from inside to outside is
12. Common sub expressions can be detected automatically by using
13. Instructions involving only register operands are _ _ _ _ _ than those involving Memory operands.
14. Addressing modes involving registers have
15. The output of code generator is
16. is used to depict the way control enters and leaves activation of procedures.
17. In activation record is used to refer to non-local data held in
other activation records.
18. is the hybrid method between call-by-value
and call-by-reference.
19. method is used for implicit
de allocation
20. Method to improve the target program by
examining
a short sequence of target
instructions is called
-oOo-
Code No: A107320502
Set No. 4
JAWAHARLAL NEHRU TECHNOLOGICAL
UNIVERSITY HYDERABAD III B.Tech. II Sem., II Mid-Term Examinations, April – 2010
COMPILER
DESIGN
Objective Exam
|
Answer All Questions. All Questions Carry Equal Marks.Time: 20 Min.
Marks: 20.
|
I
|
Choose
the correct alternative:
|
|
|
|
1.
|
Use of machine idioms is one
of the characteristic of
a. Back tracking b. Peephole optimization c. Dynamic programming
|
[
d. Global optimization
|
]
|
|
2.
|
A basic block can be analyzed
by
|
[
|
]
|
a. Flow
graph b. Flow chart c. DAG
d. RAG
3. Object code
[ ]
a. Is ready to execute b. Is the output of compiler but not assembler c. Must be loaded before
execution d. Must be rewritten before
execution
4. A hash function is defined as F(key) =
key mod 7 with linear probing is used to insert the keys
37,38,72,48,98,11,56 into a hash
table indexed from 0 to 6 .Then in
which location the key 11 is stored.
[ ] a. 6 b. 5 c. 1 d. 4
5. The storage strategy in which activation record
is maintained even after the execution of
a procedure is completed is
[ ] a. Stack allocation b. Heap allocation c. Static allocation d. Dynamic allocation
6. The following symbol table implementation has the minimum
access time. [ ]
a. hash table
b. search tree c. linear list d. self-organizing list
|
7.
|
Machine independent code optimization
can be applied to
|
|
[
|
]
|
|
8.
|
a. Source
code b. Intermediate representation
c. Object code
Which of the following is not a
peephole optimization?
|
d. Run-time output
|
[
|
]
|
a. Removal of unreachable code b.
Elimination of multiple groups
c. Elimination of loop invariant
compilation d. Loop unrolling
9. In loop optimization technique a loop whose body is never executed is [ ]
a. Dead code b. Blank code c. Redundant code d. Blank
stripper
10. Replacing the exponent operator by the
shift of multiplication is [ ]
a. Constant folding b. Reduction in strength
c. Copy propagation d. Elimination of dead variables
Cont…..2
Code
No: A107320502 :2: Set No.4
II Fill in the blanks:
11. Instructions involving only register operands are _ _ _ _ _ than those involving Memory operands.
12. Addressing modes involving registers have
13. The output of code generator is
14. is used to depict the way control enters and leaves activation of procedures.
15. In activation record is used to refer to non-local data held in
other activation records.
16. is the hybrid method between call-by-value
and call-by-reference.
17. method is used for implicit
de allocation
18. Method to improve the target program by
examining
a short sequence of target
instructions is called
19. Movement
of the code from inside to outside is
20. Common sub expressions can be detected automatically by using
-oOo-
Code No: A107320502
Set No. 1
COMPILER DESIGN KEYS
I Choose
the correct alternative
1. D
2. C
3. A
4. B
5. B
6. A
7. B
8. B or D
9. A
10. B
II Fill
in the blanks:
11. Activation tree
12. Access link
13. Copy Restore
14. reference counts or marking technique
15. peephole optimization
16. code motion
17. DAG
18. Faster
19. Zero
20. Target code
-oOo-
No comments:
Post a Comment