SlideShare a Scribd company logo
1 of 2
Download to read offline
Name
51959
Reg. N o:..................................
FIRST SEMESTER M.TECH DEGREE EXAMINATION, JANUARY 2014
MCS 10 104-COMPILER DESIGN
Time : Three Hours Maximum : 100 Marks
MODULE I
1. a. What are the different phases of a compiler? Explain in detail the process of
compilation. Illustrate the output of each phase of compilation for the input
"a = ( b+c )* ( b+c ) * 2 (15)
b. What is the need for intermediate code representation? What are the different forms of
intermediate cod( representations? (5)
2. a. What is symbol table? How it is implemented? Explain the structure of the symbol
table in detail. (10)
b. What is LEX tool? Write a LEX program to recognize an arithmetic expression. (10)
MODULE II
3. a. Consider the following code in intermediate representation: (10)
Stepl: int a, b, c;
Step2:, a = 0;
Step3: c = 1;
Step4: LI:
Step5: b = a+1;
Step6: c = c+b;
Step7: a = b*2;
Step8: if(a < 10) goto LI;
Step9: return c;
i. Draw a control flow graph for the code.
ii. Which variables are live between steps 5 and 6?
iii. Which variables are live between steps 7 and 8?
iv. Define a data flow analysis that will determine,- at each program point, and for
each integer variable, whether the values that it holds may be positive, negative, zero,
or some combination of these three. State any assumptions that you make.
b. List out the basic assumptions of dataflow algorithms. How the segments are
transformed using data flow analysis? (10)
4. a. Explain the framework of structure based data flow analysis. (10)
b. With example briefly discuss about the dependency analysis. (10)
Turn over
51959
- 2 -
MODULE III
5. a. Consider the following code in intermediate representation: ' (10)
A: read a, b, c, d, e, f, g
B:a=b+c
C: b=f*g
E:c=d-a
if(a < c) goto G
F:e=e+b
goto C
G: if(b == f) goto I
H:f= 5*d
if(f <= a) goto H
J:g=b+c
I: d = a - 6
if(c > d) goto E
D: if(d <= a) goto B
i. Identify the basic blocks, and-draw a basic block graph.
ii. Draw the dominator tree for the basic block graph.
iii. Determine the dominance frontier fox each node in the basic block graph.
b. What is the need for redundancy elimination? Discuss the redundancy elimination
with example. (10)
6. a. Discuss the need for loop optimization and procedure optimization. (10)
b. Explain the different loop optimization techniques with example. (10)
MODULE IV
7. a. What is register allocation? List its importance. Explain the different register
allocation approaches. (10)
b. Explain the local and global instruction scheduling with example. (10)
8. a. Discuss about the interprocedural analysis and scheduling in detail. (10)
b. What is DAG? How it is constructed? How it is useful in finding common sub
expressions. ’ (10)
'k ic 'k 'k it 'k

More Related Content

What's hot

(Www.entrance exam.net)-tcs placement sample paper 2
(Www.entrance exam.net)-tcs placement sample paper 2(Www.entrance exam.net)-tcs placement sample paper 2
(Www.entrance exam.net)-tcs placement sample paper 2Pamidimukkala Sivani
 
Cs6660 compiler design november december 2016 Answer key
Cs6660 compiler design november december 2016 Answer keyCs6660 compiler design november december 2016 Answer key
Cs6660 compiler design november december 2016 Answer keyappasami
 
Control Flow Graphs
Control Flow GraphsControl Flow Graphs
Control Flow Graphsdaimk2020
 
Cs6660 compiler design may june 2017 answer key
Cs6660 compiler design may june 2017  answer keyCs6660 compiler design may june 2017  answer key
Cs6660 compiler design may june 2017 answer keyappasami
 
EC202 SIGNALS & SYSTEMS PREVIOUS QUESTION PAPER
EC202 SIGNALS & SYSTEMS PREVIOUS QUESTION PAPEREC202 SIGNALS & SYSTEMS PREVIOUS QUESTION PAPER
EC202 SIGNALS & SYSTEMS PREVIOUS QUESTION PAPERVISHNUPRABHANKAIMAL
 
[Question Paper] Object Oriented Programming With C++ (Revised Course) [June ...
[Question Paper] Object Oriented Programming With C++ (Revised Course) [June ...[Question Paper] Object Oriented Programming With C++ (Revised Course) [June ...
[Question Paper] Object Oriented Programming With C++ (Revised Course) [June ...Mumbai B.Sc.IT Study
 
Mini project title prime number generator
Mini project title prime number generatorMini project title prime number generator
Mini project title prime number generatorMd. Asad Chowdhury Dipu
 
Function presentation
Function presentationFunction presentation
Function presentationjamil sadiq
 
Principles of Combinational Logic-1
Principles of Combinational Logic-1Principles of Combinational Logic-1
Principles of Combinational Logic-1Supanna Shirguppe
 
[Question Paper] E-Commerce (Old Course) [September / 2013]
[Question Paper] E-Commerce (Old Course) [September / 2013][Question Paper] E-Commerce (Old Course) [September / 2013]
[Question Paper] E-Commerce (Old Course) [September / 2013]Mumbai B.Sc.IT Study
 

What's hot (20)

(Www.entrance exam.net)-tcs placement sample paper 2
(Www.entrance exam.net)-tcs placement sample paper 2(Www.entrance exam.net)-tcs placement sample paper 2
(Www.entrance exam.net)-tcs placement sample paper 2
 
embedded-systems
embedded-systemsembedded-systems
embedded-systems
 
Cs6660 compiler design november december 2016 Answer key
Cs6660 compiler design november december 2016 Answer keyCs6660 compiler design november december 2016 Answer key
Cs6660 compiler design november december 2016 Answer key
 
Assignment 01 (1)
Assignment 01 (1)Assignment 01 (1)
Assignment 01 (1)
 
Control Flow Graphs
Control Flow GraphsControl Flow Graphs
Control Flow Graphs
 
Cs6660 compiler design may june 2017 answer key
Cs6660 compiler design may june 2017  answer keyCs6660 compiler design may june 2017  answer key
Cs6660 compiler design may june 2017 answer key
 
Assignment 4
Assignment 4Assignment 4
Assignment 4
 
Cs 64
Cs 64Cs 64
Cs 64
 
K map
K mapK map
K map
 
Exam1 (example with solutions)
Exam1 (example with solutions)Exam1 (example with solutions)
Exam1 (example with solutions)
 
EC202 SIGNALS & SYSTEMS PREVIOUS QUESTION PAPER
EC202 SIGNALS & SYSTEMS PREVIOUS QUESTION PAPEREC202 SIGNALS & SYSTEMS PREVIOUS QUESTION PAPER
EC202 SIGNALS & SYSTEMS PREVIOUS QUESTION PAPER
 
[Question Paper] Object Oriented Programming With C++ (Revised Course) [June ...
[Question Paper] Object Oriented Programming With C++ (Revised Course) [June ...[Question Paper] Object Oriented Programming With C++ (Revised Course) [June ...
[Question Paper] Object Oriented Programming With C++ (Revised Course) [June ...
 
BCH CODE AND DECODING BCH
BCH CODE AND DECODING BCHBCH CODE AND DECODING BCH
BCH CODE AND DECODING BCH
 
Mini project title prime number generator
Mini project title prime number generatorMini project title prime number generator
Mini project title prime number generator
 
Function presentation
Function presentationFunction presentation
Function presentation
 
Principles of Combinational Logic-1
Principles of Combinational Logic-1Principles of Combinational Logic-1
Principles of Combinational Logic-1
 
Subtractor (1)
Subtractor (1)Subtractor (1)
Subtractor (1)
 
[Question Paper] E-Commerce (Old Course) [September / 2013]
[Question Paper] E-Commerce (Old Course) [September / 2013][Question Paper] E-Commerce (Old Course) [September / 2013]
[Question Paper] E-Commerce (Old Course) [September / 2013]
 
3. logic 101
3. logic 1013. logic 101
3. logic 101
 
Solid modeling
Solid modelingSolid modeling
Solid modeling
 

Similar to Mcs 10 104 compiler design dec 2014

A109210503 digitallogicdesign1
A109210503 digitallogicdesign1A109210503 digitallogicdesign1
A109210503 digitallogicdesign1jntuworld
 
Bca spring driveassignments (1)
Bca spring driveassignments (1)Bca spring driveassignments (1)
Bca spring driveassignments (1)solved_assignments
 
Informatics practises 12th CBSE INDIA 2012-2013 MAIN EXAM paper
Informatics practises 12th CBSE INDIA 2012-2013 MAIN EXAM paperInformatics practises 12th CBSE INDIA 2012-2013 MAIN EXAM paper
Informatics practises 12th CBSE INDIA 2012-2013 MAIN EXAM paperHarish Gyanani
 
CBSE Grade12, Computer Science, Sample Question Paper
CBSE Grade12, Computer Science, Sample Question PaperCBSE Grade12, Computer Science, Sample Question Paper
CBSE Grade12, Computer Science, Sample Question PaperMalathi Senthil
 
Smu bca sem 5th summer 2014 solved assignments
Smu bca sem   5th summer 2014 solved assignmentsSmu bca sem   5th summer 2014 solved assignments
Smu bca sem 5th summer 2014 solved assignmentssmumbahelp
 
Mcs 011 ignou question paper c language
Mcs 011 ignou question paper c languageMcs 011 ignou question paper c language
Mcs 011 ignou question paper c languagewolverine x-man
 
09 a1ec01 c programming and data structures
09 a1ec01 c programming and data structures09 a1ec01 c programming and data structures
09 a1ec01 c programming and data structuresjntuworld
 
A109211002 switchingtheoryandlogicdesign1
A109211002 switchingtheoryandlogicdesign1A109211002 switchingtheoryandlogicdesign1
A109211002 switchingtheoryandlogicdesign1jntuworld
 

Similar to Mcs 10 104 compiler design dec 2014 (20)

3rd Semester Computer Science and Engineering (ACU) Question papers
3rd Semester Computer Science and Engineering  (ACU) Question papers3rd Semester Computer Science and Engineering  (ACU) Question papers
3rd Semester Computer Science and Engineering (ACU) Question papers
 
6th Semester (June; July-2015) Computer Science and Information Science Engin...
6th Semester (June; July-2015) Computer Science and Information Science Engin...6th Semester (June; July-2015) Computer Science and Information Science Engin...
6th Semester (June; July-2015) Computer Science and Information Science Engin...
 
2013-June: 5th Semester CSE / ISE Question Papers
2013-June: 5th  Semester CSE / ISE Question Papers2013-June: 5th  Semester CSE / ISE Question Papers
2013-June: 5th Semester CSE / ISE Question Papers
 
5th Semester CS / IS (2013-June) Question Papers
5th Semester CS / IS (2013-June) Question Papers5th Semester CS / IS (2013-June) Question Papers
5th Semester CS / IS (2013-June) Question Papers
 
A109210503 digitallogicdesign1
A109210503 digitallogicdesign1A109210503 digitallogicdesign1
A109210503 digitallogicdesign1
 
Bca spring driveassignments (1)
Bca spring driveassignments (1)Bca spring driveassignments (1)
Bca spring driveassignments (1)
 
5th Semester (June; July-2015) Computer Science and Information Science Engin...
5th Semester (June; July-2015) Computer Science and Information Science Engin...5th Semester (June; July-2015) Computer Science and Information Science Engin...
5th Semester (June; July-2015) Computer Science and Information Science Engin...
 
Informatics practises 12th CBSE INDIA 2012-2013 MAIN EXAM paper
Informatics practises 12th CBSE INDIA 2012-2013 MAIN EXAM paperInformatics practises 12th CBSE INDIA 2012-2013 MAIN EXAM paper
Informatics practises 12th CBSE INDIA 2012-2013 MAIN EXAM paper
 
CBSE Grade12, Computer Science, Sample Question Paper
CBSE Grade12, Computer Science, Sample Question PaperCBSE Grade12, Computer Science, Sample Question Paper
CBSE Grade12, Computer Science, Sample Question Paper
 
Smu bca sem 5th summer 2014 solved assignments
Smu bca sem   5th summer 2014 solved assignmentsSmu bca sem   5th summer 2014 solved assignments
Smu bca sem 5th summer 2014 solved assignments
 
Bca spring driveassignments
Bca spring driveassignmentsBca spring driveassignments
Bca spring driveassignments
 
7th Semester (June; July-2015) Computer Science and Information Science Engin...
7th Semester (June; July-2015) Computer Science and Information Science Engin...7th Semester (June; July-2015) Computer Science and Information Science Engin...
7th Semester (June; July-2015) Computer Science and Information Science Engin...
 
3rd Semester Computer Science and Engineering (ACU) Question papers
3rd Semester Computer Science and Engineering  (ACU) Question papers3rd Semester Computer Science and Engineering  (ACU) Question papers
3rd Semester Computer Science and Engineering (ACU) Question papers
 
Mcs 011 ignou question paper c language
Mcs 011 ignou question paper c languageMcs 011 ignou question paper c language
Mcs 011 ignou question paper c language
 
09 a1ec01 c programming and data structures
09 a1ec01 c programming and data structures09 a1ec01 c programming and data structures
09 a1ec01 c programming and data structures
 
SMU ,CA FALL 2014 ASSIGNMENTS
SMU ,CA FALL 2014 ASSIGNMENTSSMU ,CA FALL 2014 ASSIGNMENTS
SMU ,CA FALL 2014 ASSIGNMENTS
 
A109211002 switchingtheoryandlogicdesign1
A109211002 switchingtheoryandlogicdesign1A109211002 switchingtheoryandlogicdesign1
A109211002 switchingtheoryandlogicdesign1
 
7th Semester (June-2016) Computer Science and Information Science Engineering...
7th Semester (June-2016) Computer Science and Information Science Engineering...7th Semester (June-2016) Computer Science and Information Science Engineering...
7th Semester (June-2016) Computer Science and Information Science Engineering...
 
7th Semester (June-2016) Computer Science and Information Science Engineering...
7th Semester (June-2016) Computer Science and Information Science Engineering...7th Semester (June-2016) Computer Science and Information Science Engineering...
7th Semester (June-2016) Computer Science and Information Science Engineering...
 
6th Semester CS / IS (2013-June) Question Papers
6th Semester CS / IS (2013-June) Question Papers6th Semester CS / IS (2013-June) Question Papers
6th Semester CS / IS (2013-June) Question Papers
 

Recently uploaded

Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxPoojaSen20
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)cama23
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 

Recently uploaded (20)

Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 

Mcs 10 104 compiler design dec 2014

  • 1. Name 51959 Reg. N o:.................................. FIRST SEMESTER M.TECH DEGREE EXAMINATION, JANUARY 2014 MCS 10 104-COMPILER DESIGN Time : Three Hours Maximum : 100 Marks MODULE I 1. a. What are the different phases of a compiler? Explain in detail the process of compilation. Illustrate the output of each phase of compilation for the input "a = ( b+c )* ( b+c ) * 2 (15) b. What is the need for intermediate code representation? What are the different forms of intermediate cod( representations? (5) 2. a. What is symbol table? How it is implemented? Explain the structure of the symbol table in detail. (10) b. What is LEX tool? Write a LEX program to recognize an arithmetic expression. (10) MODULE II 3. a. Consider the following code in intermediate representation: (10) Stepl: int a, b, c; Step2:, a = 0; Step3: c = 1; Step4: LI: Step5: b = a+1; Step6: c = c+b; Step7: a = b*2; Step8: if(a < 10) goto LI; Step9: return c; i. Draw a control flow graph for the code. ii. Which variables are live between steps 5 and 6? iii. Which variables are live between steps 7 and 8? iv. Define a data flow analysis that will determine,- at each program point, and for each integer variable, whether the values that it holds may be positive, negative, zero, or some combination of these three. State any assumptions that you make. b. List out the basic assumptions of dataflow algorithms. How the segments are transformed using data flow analysis? (10) 4. a. Explain the framework of structure based data flow analysis. (10) b. With example briefly discuss about the dependency analysis. (10) Turn over
  • 2. 51959 - 2 - MODULE III 5. a. Consider the following code in intermediate representation: ' (10) A: read a, b, c, d, e, f, g B:a=b+c C: b=f*g E:c=d-a if(a < c) goto G F:e=e+b goto C G: if(b == f) goto I H:f= 5*d if(f <= a) goto H J:g=b+c I: d = a - 6 if(c > d) goto E D: if(d <= a) goto B i. Identify the basic blocks, and-draw a basic block graph. ii. Draw the dominator tree for the basic block graph. iii. Determine the dominance frontier fox each node in the basic block graph. b. What is the need for redundancy elimination? Discuss the redundancy elimination with example. (10) 6. a. Discuss the need for loop optimization and procedure optimization. (10) b. Explain the different loop optimization techniques with example. (10) MODULE IV 7. a. What is register allocation? List its importance. Explain the different register allocation approaches. (10) b. Explain the local and global instruction scheduling with example. (10) 8. a. Discuss about the interprocedural analysis and scheduling in detail. (10) b. What is DAG? How it is constructed? How it is useful in finding common sub expressions. ’ (10) 'k ic 'k 'k it 'k