0% found this document useful (0 votes)
19 views4 pages

21CSE161 ModelQP

Uploaded by

yashasesankol1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views4 pages

21CSE161 ModelQP

Uploaded by

yashasesankol1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

USN:

B.N.M. Institute of Technology


An Autonomous Institution under VTU
Model Question Paper
Sixth Semester BE, 2023-24 Scheme
System Software and Compiler Design– 21CSE161
Duration: 3 Hour Max. Marks: 100

Note: 1. Answer one full question from each Module 1,2,3,4,5 (5Q x 20M=100 Marks)

Module 1
Q. Cognitives
Questions Marks CO PO
No Level
Generate the object code for the following SIC/XE program.
Also write the symbol table and calculate the program length.
Assume starting address 1000H
LDX #0
LDT #100
LOOP TD INDEV
JEQ LOOP
RD INDEV
1 (a) 10 1 1,2,3,4 Apply
STCH RECORD, X
TIXR T
JLT LOOP
INDEV BYTE X’F1’
RECORD RESB 100
END
OPCODE values are LDX=04, LDT=74, TD=E0, JEQ=30,
RD=D8, STCH=54, TIXR=B8, JLT=38, (X)=0000
Apply the concept of program blocks to a suitable code
1 (b) snippet and explain how program blocks helps us achieve 10 1 1,2,3,4 Apply
logical rearrangement of source program
OR
Apply program relocation to suitable example and show how
2 (a) 10 1 1,2,3,4 Apply
loader is informed about the relocation information
Write the algorithm for a pass-1 of two-pass assembler and
2 (b) 10 1 1,2,3,4 Apply
simple bootstrap loader
Module 2
Illustrate the structure of a compiler with neat diagram. Also
3 (a) apply the output of each phase for the expression given below 10 2 1,2,3,4 Apply
position=initial + rate*60
Write the transition diagram for specifying (i) identifiers
3 (b) 10 2 1,2,3,4 Apply
(ii) Signed numbers
OR
Apply input buffering strategy for any input and explain the
4 (a) 10 2 1,2,3,4 Apply
working of the same
4 (b) Illustrate the specification of tokens with suitable examples 10 2 1,2,3,4 Apply

1
USN:

Module 3
Make use of an example to explain the process of
identifying ambiguous grammar. Check whether the grammar
given below is ambiguous and if yes eliminate ambiguity for
5 (a) the following dangling-else grammar: 5 3 1,2,3,4,7 Apply
stmt -> if expr then stmt
| if expr then stmt else stmt
|other

Eliminate left recursion from the following grammar :


(a) S->A (b) A->ABd| Aa| a Apply
5 (b) 5 3 1,2,3,4,7
A->Ad|Ae|aB|ac B->Be | b
B->bBc|f
Apply predictive parsing LL (1) table for following
grammar
E->TE’
E’->+TE’|€
T->FT’
T’->*FT’| € Apply
5 (c) 10 3 1,2,3,4,7
F->(E) | id
and do the following
(i) Identify first and follow
(ii) Construct Parsing table
(iii) Solve parser moves e for the input (id*id)
OR
For the given grammar give the parsing moves of shift
reduce parser for the acceptance or rejection of the input
6 (a) string (a, (a, a)) 5 3 1,2,3,4,7 Apply
S -> (L) |a
L -> L, S | S
For the given grammar
S->AB
A->xA
A->B
6 (b) B->yxB|z 10 3 1,2,3,4,7 Apply
do the following:
(i) Identify First and follow
(ii) By constructing Parsing table check whether the
grammar is LL(1)
For the grammar
S->CC
6 (c) 5 3 1,,2,3,4,7 Apply
C->cC / d
Construct LR(1)items
Module 4
a) Construct an annotated parse tree for the following
7 (a) expression given using SDD for a simple desk 10 4 1,2,3,4,5 Analyze
calculator.

2
USN:

(3+4)*(5+6)n

Define SDD, synthesized and inherited attribute with


examples. Analyze and bring out the distinct differences
7 (b) 10 4 1,2,3,4,5 Analyze
between syntax tree, parse tree and annotated parse tree with
examples
OR
a)Analyze the expression given below and write DAG and the
three address code for the following
8 (a) i) x=Z*y + sin(Z*x) 10 4 1,2,3,4,5 Analyze
Z=x/Z
ii)b=( ( ( a + a ) + ( a + a ) ) + ( ( a + a ) + ( a + a ) ) )
Illustrate the three-address form and apply this to find
quadruple representation and triples and indirect triples for a
8(b) given expression 10 4 1,2,3,4,5 Analyze
(a-b)*(c+d)-(x+y)
Module 5
9 (a) Apply the design issues of code generator 10 5 1,2,3,4,5 Apply
Construct Basic Blocks for the code: 1,2,3,4,5 Apply
begin
prod := 0;
i := 1;
do begin
9 (b) 10 5
prod := prod + a[i] * b[i];
i = i+ 1;
end
while i <= 20
end
OR
Construct flow graph for the code: 1,2,3,4,5 Apply
Sum=0
10 (a) 10 5
For i=1 to n
Sum=sum+a[i[
Illustrate the various code optimization techniques with 1,2,3,4,5 Apply
10(b) 10 5
example for each

Signature of Chief
Signature of MQP Setter Signature of HoD Controller of
Examination

3
USN:

You might also like