0% found this document useful (0 votes)
112 views13 pages

Atcd Questions

Atcd

Uploaded by

andhamgayi
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)
112 views13 pages

Atcd Questions

Atcd

Uploaded by

andhamgayi
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/ 13

Assignments Given With Dates

Last date would be last day of your mid examination.

MaharajVijayaramGajapathi Raj College Of Engineering


Accredited by NBA of AICTE, NAAC with ‘A’ Grade of UGC,
Approved by AICTE, New Delhi, and Listed under 2(F), 12(B) of UGC Act
Permanently Affiliated to JNTU, Kakinada
Vijayaram Nagar Campus, Chinthalavalasa, VIZIANAGARAM-535 005
College Code:33
Class: III/IV Semester: I Sec:B&C YEAR: 2021-22 Subject: ATCD Max. Marks: 10
UNIT-1
Set-1:
1. Explain the following terminology with examples for each.
i. Alphabet ii. Strings iii. Length of a string
iv. Empty string v. Power of an alphabet vi. Language vii. Kleene Closure
2.

3. The symmetric difference(SD) of languages L and M, which is denoted by SD(L,M), is


the set of strings that are in exactly one of L and M. Suppose L = L({0,a}*) and
M=L({1,a}*). Find all the strings of length 3 or less in SD(L,M)?
4. Design a finite automaton that reads strings made up of letters in the word CHARIOT
and recognize those strings that contain the word ’CAT’ as a substring.
5. Let A= {ϵ, a} and B={ab}. List the elements of the following sets.
(i) A+
(ii) B*
(iii) AB

Set-2:
1. Define formal language. Discuss operations on formal languages.
2. Explain the following terms with example. [7M]
i. Initial State
ii. Final State
iii. Dead state
iv. Unreachable State.
3. Give the transition table representation for the given transition diagram.
4. Differentiate between DFA and NFA.
5. The operation DM(L) is defined as follows.
(i) Throw away every even-length string from L.
(ii) For each odd length string, remove the middle character.
Find all the strings of length 3 or less in DM(L) if L is a language over {a,b}.

Set-3
1. Explain the various Language recognizers
2. Let ∑1 and ∑2 are the alphabets of symbols of binary and decimal number systems
respectively. Also let L1 and L2 are the languages over ∑1 and ∑2 respectively. Then find
all strings of length 3 or less in the language L1∩L2. [3M]
3. Explain various types of states that a finite automaton can have with an example.
4. Design a DFA for L= {0m1n| m, n>=0}
5. From the given transition table check whether the following strings are accepted or not.
(i) 101101 (ii) 000000

Set-4
1. What is a finite automaton? Explain about the model of Finite Automaton.
2. Take any two strings and explain their acceptance in the given NFA using extended
transition function. [3M]
3. List the various applications of Finite automaton.

4. State the relations among regular expression, deterministic finite automata,


non-deterministic finite automaton and finite automaton with epsilon transition.

5. Design a DFA which accepts all the strings with even number of 0`s and odd number of
1`s over an alphabet {0,1}.
Assignments Given With Dates

MaharajVijayaramGajapathi Raj College Of Engineering


Accredited by NBA of AICTE, NAAC with ‘A’ Grade of UGC,
Approved by AICTE, New Delhi, and Listed under 2(F), 12(B) of UGC Act
Permanently Affiliated to JNTU, Kakinada
Vijayaram Nagar Campus, Chinthalavalasa, VIZIANAGARAM-535 005
College Code:33
Class: III/IV Semester: I Sec:B&C YEAR: 2021-22 Subject: ATCD Max. Marks: 10
UNIT-2
Set-1
1. Design an epsilon NFA to accept strings with zero or more a’s followed by zero or
more b’s followed by zero or more c’s. Also give its formal representation
2. Explain Closure properties of regular sets with examples.
3.

Set-2
1. Explain the procedure for converting NFA without Epsilon to DFA.
2.

3.

Set-3
1. Explain the procedure for converting NFA with epsilon to NFA without Epsilon with
example.
2. Obtain the epsilon closure for the states 1, 2, 3, 4, 7 and 8 for the given epsilon NFA.
3. It is given that the complement of a regular language L over an alphabet Σ is defined as
Σ* - L. Find all the strings of length 3 or less that belongs to the complement of the
language of the following DFA.

Set-4
1. What is regular expression? Explain in detail about regular expressions with
examples
2. Find all the equivalent states for the following DFA.

3. Write regular expressions for the following languages.


L= {goto, break, continue}.
L= { w|w starts and ends with the same symbol over {a,b}}.
L= {w|w has atleast three zeros and w ∈ {0,1}* }
Assignments Given With Dates

MaharajVijayaramGajapathi Raj College Of Engineering


Accredited by NBA of AICTE, NAAC with ‘A’ Grade of UGC,
Approved by AICTE, New Delhi, and Listed under 2(F), 12(B) of UGC Act
Permanently Affiliated to JNTU, Kakinada
Vijayaram Nagar Campus, Chinthalavalasa, VIZIANAGARAM-535 005
College Code:33
Class: III/IV Semester: I Sec:B&C YEAR: 2021-22 Subject: ATCD Max. Marks: 10
UNIT-3
Set-1
1. Explain about the various grammars under Chomsky hierarchy?
2. What is meant by closure properties? List and explain the closure properties of Context
Free Languages
3. Consider two binary operators ↑ and ↓ with precedence of operator ↓ being lower than
that of operator ↑. Operator ↑ is right associative while operator ↓ is left associative.
Obtain parse tree for the expression 7↓3↑4↑3↓2.
4. Compute FIRST and FOLLOW for all the non-terminals in the following grammar.
E → aA
E → (E)
A → +E
A → *E
A→ε
5. Explain about the model of table driven predictive parser.

Set-2
1. With an example Context Free Grammar, explain about sentential forms and derivation
trees .
2.

3.

Consider the following CFG. Construct all possible parse trees for the string aabbab.
S → aB | bA
A → a | aS | bAA
B → b | bS | aBB
4. Illustrate recursive descent parser with an example.
5. A. Define FIRST of a grammar Symbol. Write the steps/algorithm to compute FIRST.
b. Define FOLLOW of a non-terminal. Write the steps/algorithm to compute FOLLOW.

Set-3
1. Explain about ambiguity in context free grammars with an example
2.

3. Compare and contrast top down and bottom-up parsing.


4. Write in detail about the various phases of compiler.
5. Explain about structure of a lex program.

Set-4
1. What are the various applications of context free languages? Explain in detail.
2.

3.
Using the grammar and parsing table given below, show the sequence of configurations
taken by the LL(1) parser for the input string abacbab.
S → aSb | bSa | c

a b c $

S S→aSb S → bSa S → c

4. Describe about the various components/data structures in the model of table driven
predictive parser.
5. Describe about role of parser with a neat sketch
Assignments Given With Dates

MaharajVijayaramGajapathi Raj College Of Engineering


Accredited by NBA of AICTE, NAAC with ‘A’ Grade of UGC,
Approved by AICTE, New Delhi, and Listed under 2(F), 12(B) of UGC Act
Permanently Affiliated to JNTU, Kakinada
Vijayaram Nagar Campus, Chinthalavalasa, VIZIANAGARAM-535 005
College Code:33
Class: III/IV Semester: I Sec:B&C YEAR: 2021-22 Subject: ATCD Max. Marks: 10
UNIT-4
Set-1
1.

2.
Differentiate between synthesized and inherited attributes with example
3.

Set-2
1.

2. Using the following grammar show the handles of each right sentential form in the
bottom up parsing of the string (a,(a,a)).
S → (L) | a
L → L,S | S
3. Write a yacc program for desk calculator.
Set-3
1. Describe in detail about the structure about Yacc program.
2. Identify the attributes and their types in the following SDD.
3.

Set-4
1.

2.
Identify the attributes and their types in the following SDD.

3. Construct three address code for the following code segment in C language.
for(j=i*2 ; j<30 ; j++)
{
d = n%10;
rev = rev+d;
}
Assignments Given With Dates

MaharajVijayaramGajapathi Raj College Of Engineering


Accredited by NBA of AICTE, NAAC with ‘A’ Grade of UGC,
Approved by AICTE, New Delhi, and Listed under 2(F), 12(B) of UGC Act
Permanently Affiliated to JNTU, Kakinada
Vijayaram Nagar Campus, Chinthalavalasa, VIZIANAGARAM-535 005
College Code:33
Class: III/IV Semester: I Sec:B&C YEAR: 2021-22 Subject: ATCD Max. Marks: 10
UNIT-5
Set-1
1. What is a basic block? Write an algorithm to partition sequence of three address
statements into basic blocks with an example
2. Generate target code for the following statement x=a/(b+c)-d*(e+f)
3. Divide the following code into basic blocks.
1) if (A < C) goto (3)
2) goto (15)
3) if (B > D) goto (5)
4) goto (15)
5) if (A = 1) goto (7)
6) goto (10)
7) T1 = c + 1
8) c = T1
9) goto (1)
10) if (A <= D) goto (12)
11) goto (1)
12) T2 = A + B
13) A = T2
14) goto (10)

Set-2
1. Explain in detail about different machine dependent code optimization
2. Construct a DAG for the given basic block
a: =b+c
b: =b-d
c: =c+d
e: =b+c
3. Identify the leaders in the three address code equivalent of following fragment.
Set-3
1. Explain various issues in the design of a code generator
2. Explain the procedure to determine if a variable is live or not
3. Construct the flow graph for the following three address code in which the three address
statements numbered (1), (2), (3), (10), (12), (13) are leaders.
1) i = 1
2) j = 1
3) t1 = 10 * i
4) t2 = t1 + j
5) t3 = 8 * t2
6) t4 = t3 - 88
7) a[t4] = 0.0
8) j = j + 1
9) if j <= 10 goto (3)
10) i = i + 1
11) if i <= 10 goto (2)
12) i = 1
13) t5 = i - 1
14) t6 = 88 * t5
15) a[t6] = 1.0
16) i = i + 1
17) if i <= 10 goto (13)

Set-4
1. Explain different code optimization issues
2. Generate gen and kill sets for the basic blocks in the following flow graph.
3. Describe the different machine independent code optimization techniques in detail.

Sets assigned to the corresponding roll numbers.

Section: B
Assignment 1, 2 and 3
Set-1:67 to 83
Set-2:84 to A1
Set-3: A2 to B8
Se-4:B9 to C9 and all the laterals

Assignment 5 and 6

Set-1: B9 to C9 and all the laterals


Set:2: A2 to B8

Set-3: 84 to A1

Set-4: 67 to 83

Section –C

Assignment 1, 2 and 3
Set-1: D0 to E7
Set-2: E8 to G5
Set-3: G6 to I2
Set-4: I3 to J3 and All the laterals L-13 to L-18

Assignment 4 and 5
Set-1: I3 to J3 and All the laterals L-13 to L-18
Set-2: G6 to I2
Set-3: E8 to G5
Set-4: D0 to E7

You might also like