Code No: R05311201 R05 Set No. 2
III B.Tech I Semester Supplementary Examinations,June 2010
AUTOMATA AND COMPILER DESIGN
Common to Information Technology, Computer Science And Systems
Engineering
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
? ? ? ? ?
1. Construct the predictive parse table for the following grammar: S → iEtSS0 |a
S0 → eS |∈
E → b. [16]
2. (a) Consider the following code sequence. i. MOV B, R0
ADD C, R0
MOV R0, A
ii. MOV B, A ADD C, A
Calculate the cost of above instructions interms of access time and memory usage
(b) What are assembler directives and explain? [8+8]
3. Translate the executable statements of the following 'C' program into a three- address code by assuming each element of an array 'a' takes 4 bytes. [16] void main()
{
int i = 1, a[10];
while(i++ < = 10)a[i] = 0;
}
4. (a) What is LR parser? Compare and contrast the different types of LR parsers. (b) Construct the CLR parse table for the following augmented grammar:
A0 → A
A → (A) |a [8+8]
5. Write and Explain about algorithm for construction of equivalence trees? [16]
6. (a) Explain how loop invariant computation can be eliminated?
(b) Explain how "Redundant sub-expression eliminates" can be done in a given program? [8+8]
7. (a) Design a DFA that accepts strings over Σ={0, 1} if and only if the value of the string, interpreted as a binary representation of an integer is zero modulo
5.
1
Code No: R05311201 R05 Set No. 2
(b) Construct an NFA equivalent to the following Regular Expressions:
i. 10 + (0 + 11) 0* 1
ii. (a + b)* (aa + bb) (a + b)*. [10+6]
8. (a) Explain Type Conversion. Give the Type conversion rules for converting the type from integer to real.
(b) Explain the algorithm for testing the structural Equivalence. [10+6]
? ? ? ? ?
2
Code No: R05311201 R05 Set No. 4
III B.Tech I Semester Supplementary Examinations,June 2010
AUTOMATA AND COMPILER DESIGN
Common to Information Technology, Computer Science And Systems
Engineering
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
? ? ? ? ?
1. Write and Explain about algorithm for construction of equivalence trees? [16]
2. (a) Consider the following code sequence. i. MOV B, R0
ADD C, R0
MOV R0, A
ii. MOV B, A ADD C, A
Calculate the cost of above instructions interms of access time and memory usage
(b) What are assembler directives and explain? [8+8]
3. (a) Design a DFA that accepts strings over Σ={0, 1} if and only if the value of the string, interpreted as a binary representation of an integer is zero modulo
5.
(b) Construct an NFA equivalent to the following Regular Expressions:
i. 10 + (0 + 11) 0* 1
ii. (a + b)* (aa + bb) (a + b)*. [10+6]
4. (a) Explain how loop invariant computation can be eliminated?
(b) Explain how "Redundant sub-expression eliminates" can be done in a given program? [8+8]
5. (a) Explain Type Conversion. Give the Type conversion rules for converting the type from integer to real.
(b) Explain the algorithm for testing the structural Equivalence. [10+6]
6. Construct the predictive parse table for the following grammar: S → iEtSS0 |a
S0 → eS |∈
E → b. [16]
7. (a) What is LR parser? Compare and contrast the different types of LR parsers. (b) Construct the CLR parse table for the following augmented grammar:
A0 → A
A → (A) |a [8+8]
3
Code No: R05311201 R05 Set No. 4
8. Translate the executable statements of the following 'C' program into a three- address code by assuming each element of an array 'a' takes 4 bytes. [16] void main()
{
int i = 1, a[10];
while(i++ < = 10)a[i] = 0;
}
? ? ? ? ?
4
Code No: R05311201 R05 Set No. 1
III B.Tech I Semester Supplementary Examinations,June 2010
AUTOMATA AND COMPILER DESIGN
Common to Information Technology, Computer Science And Systems
Engineering
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
? ? ? ? ?
1. (a) What is LR parser? Compare and contrast the different types of LR parsers. (b) Construct the CLR parse table for the following augmented grammar:
A0 → A
A → (A) |a [8+8]
2. (a) Consider the following code sequence. i. MOV B, R0
ADD C, R0
MOV R0, A
ii. MOV B, A ADD C, A
Calculate the cost of above instructions interms of access time and memory usage
(b) What are assembler directives and explain? [8+8]
3. (a) Explain Type Conversion. Give the Type conversion rules for converting the type from integer to real.
(b) Explain the algorithm for testing the structural Equivalence. [10+6]
4. Translate the executable statements of the following 'C' program into a three- address code by assuming each element of an array 'a' takes 4 bytes. [16] void main()
{
int i = 1, a[10];
while(i++ < = 10)a[i] = 0;
}
5. Write and Explain about algorithm for construction of equivalence trees? [16]
6. Construct the predictive parse table for the following grammar: S → iEtSS0 |a
S0 → eS |∈
E → b. [16]
7. (a) Design a DFA that accepts strings over Σ={0, 1} if and only if the value of the string, interpreted as a binary representation of an integer is zero modulo
5.
5
Code No: R05311201 R05 Set No. 1
(b) Construct an NFA equivalent to the following Regular Expressions:
i. 10 + (0 + 11) 0* 1
ii. (a + b)* (aa + bb) (a + b)*. [10+6]
8. (a) Explain how loop invariant computation can be eliminated?
(b) Explain how "Redundant sub-expression eliminates" can be done in a given program? [8+8]
? ? ? ? ?
6
Code No: R05311201 R05 Set No. 3
III B.Tech I Semester Supplementary Examinations,June 2010
AUTOMATA AND COMPILER DESIGN
Common to Information Technology, Computer Science And Systems
Engineering
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
? ? ? ? ?
1. Construct the predictive parse table for the following grammar: S → iEtSS0 |a
S0 → eS |∈
E → b. [16]
2. Translate the executable statements of the following 'C' program into a three- address code by assuming each element of an array 'a' takes 4 bytes. [16] void main()
{
int i = 1, a[10];
while(i++ < = 10)a[i] = 0;
}
3. (a) Explain how loop invariant computation can be eliminated?
(b) Explain how "Redundant sub-expression eliminates" can be done in a given program? [8+8]
4. (a) What is LR parser? Compare and contrast the different types of LR parsers. (b) Construct the CLR parse table for the following augmented grammar:
A0 → A
A → (A) |a [8+8]
5. Write and Explain about algorithm for construction of equivalence trees? [16]
6. (a) Design a DFA that accepts strings over Σ={0, 1} if and only if the value of the string, interpreted as a binary representation of an integer is zero modulo
5.
(b) Construct an NFA equivalent to the following Regular Expressions:
i. 10 + (0 + 11) 0* 1
ii. (a + b)* (aa + bb) (a + b)*. [10+6]
7. (a) Consider the following code sequence. i. MOV B, R0
ADD C, R0
MOV R0, A
ii. MOV B, A ADD C, A
7
Code No: R05311201 R05 Set No. 3
Calculate the cost of above instructions interms of access time and memory usage
(b) What are assembler directives and explain? [8+8]
8. (a) Explain Type Conversion. Give the Type conversion rules for converting the type from integer to real.
(b) Explain the algorithm for testing the structural Equivalence. [10+6]
No comments:
Post a Comment