You are on page 1of 3

CBIT, KOLAR Page 1 of 3

DEPARTMENT: Computer Science & Engineering

QUESTION BANK

SEMESTER: 6 SUBJECT: System Software and Compiler Design SUB CODE: 15CS63

MODULE I
Questions Marks
1. What is system software and Explain Diff between two types of software with examples? 4
2. Explain the SIC machine architecture in detail. 8
3. Write a SIC/XE program to copy array A of 100 words to array of B of same size 6
4. Explain the instruction formats and addressing modes of SIC/XE machine architecture 6
5. What are the Different types of assemblers and Explain the Data Structures used in assemblers 7
6. Suppose alpha is an array of 100 words. Write a sequence of instructions for SIC\XE to set all 100 elements to
0
7. What is Program Relocation? Explain the problem associated with it and there solution 5
8. Give the format of the following: header, text, end and modification record 5
9. Give the algorithm for pass1 of and 2 pass assembler 5
10. Explain the following: SYMTABLE,LOCCTR,OPTAB 4
11. Define MACRO Briefly explainthe various data structures used in the design of MACRO PROCESSOR 5
MODULE II
Questions Marks
1. With source code, explain the working of boot-strap loader
6
2. Explain machine dependent features of loader
5
3. Write the algorithm of absolute loader. 5
4. Define program relocation. Explain the different ways of doing program relocation 6
5. With an algorithm, explain pass1 of a linking loader 6
6. Explain the facilities available in MS-DOS liker for program linking 5
7. Explain briefly the design options of loaders
8. What are the basic functions of a loader? Develop an algorithm for a bootstrap loader . 8
9. What is the difference between linkage editor and linking loader?
10. What is dynamic binding? explain the process of loading and calling a subroutine using dynamic 6
binding
11. Explain various data structures used for a linking loader. 6
12. With the help of an example show how relocation and linking operations are performed. 5

MODULE III
Questions Marks
1. Explain with a neat diagram phases of a compiler by taking an example A=B+C*50. 10
2. What is token, pattern and lexeme? Give example for each 3
3. Write the look ahead code with sentinels for input buffering used in lexical analysis 5
4. Construct a transition diagram for identifier and unsigned numbers 6
5. Write a regular definitions for i) identifier ii) unsigned number 4
6. What is regular expression? Write the algebraic laws of regular expression 7
7. What is printed by the following code 2
#define a (x+1)
int x=2;
CBIT, KOLAR Page 2 of 3

void b() { x=a; printf(“%d\n”,x);}


void c() { x=5; printf(“%d\n”,a);}
void main() { b(); c(); }
8. Discuss the various applications of compiler technology 10
9. Differentiate between static and dynamic policy 2
10. Define regular expression and also write the algebraic laws for regular expression 7
11. Construct a transition diagram for recognizing relational operators. Sketch the program segment to implement it 8
showing the first and one final state
MODULE IV
Questions Marks
1. Explain panic mode and phrase level error recovery strategies 6
2. Define left recursion. Eliminate left recursion from the following grammar 6
E->E+E|T
T->T*F|F
F->(E)|id
3. Give rules for constructing FIRST and FOLLOW sets. Find FIRST and FOLLOW for the grammar in question 2 of 10
module 4
4. What is recursive decent parser? Trace and explain working of the recursive descent parser for the input “bcd” and 8
grammar:
A->bCd
C->ce|e

5. S->(L)|a 10
L->L,S|S
Make the grammar suitable for top down parsing. Construct predictive parsing table and parse the input string (())
6. What is Handle pruning? Give Bottom up parses for the input string aaa*a++ using the grammar 6
S->SS+ | SS* | a
7. Explain the working of shift reduce parser. Give shift reduce configuration on the input string 000111 using the 5
grammar
S->0S1|01

8. Construct SLR(1) parsing table for the following grammar. 6


S->CC
C->cC | d
And also show the sequence of moves made by the parser on the input ccdd
9. Write an algorithm for construction of CLR parsing table 5
10. Write an algorithm to construct LALR parsing table 5
11. Consider the following grammar 8
S->L=R|R
L->*R|id
R->L
i). Construct set of LR(1) items ii).Construct LR(1) canonical parsing table
12. Show that following grammar 8
S-> Aa | bAc | dc | bda
A->d
is LALR(1) but not SLR(1)
MODULE V
Questions Marks
1. Write an SDD for simple desk calculator and show annotated parse tree for the expression 3*5+4n 5
2. Construct a dependency graph for the declaration float id1,id2,id3 6
3. Define i) synthesized attribute ii) inherited attribute 6
CBIT, KOLAR Page 3 of 3

4. Obtain DAG for the expression a+a*(b-c)+(b-c)*d 6


5. Generate three address code for the following statement 4
Switch(ch)
{
case 1: c=a+b; break;
case 2: c=a-b; break;
}
6. List any 5 common three address instruction forms 5
7. Explain the following with example i) quadruples ii) triples iii)indirect triples iv) Static single assignment form 10
8. Discuss the various issues in the code generation phase 10
9. Write an algorithm to partition three address instruction into basic blocks 6
10. Generate intermediate code for the following statements and identify the basic blocks(given w=8 bytes) 10
for i from 0 to 10 do
for j from 0 to 10 do
result=c[i,j]*d[i,j];
for i from 0 to 9 do
a[i,i]=1.0
11. Find liveliness and next-use information for the following code block. Given only c, d e are live on exit 10
i) d=b*c
ii) e=a+b
iii) b=b*c
iv) a=e-d
construct DAG and simplify the above code

Prepared by Approved by HOD

Date & sign Date & sign

You might also like