Sei sulla pagina 1di 183

BMS INSTITUTE OF TECHNOLOGY & MANAGEMENT

Avalahalli, Doddaballapur Main Road,


Yelahanka, Bengaluru-64

HAND BOOK
Of
5th Semester

DEPARTMENT OF INFORMATION SCIENCE AND ENGINEERING


BMS INSTITUTE OF TECHNOLOGY & MANAGEMENT
(Affiliated to VTU, Belagavi, Approved by AICTE, New Delhi and Govt. of Karnataka),
Avalalli Doddaballapur Main Road, Bangalore-560064.

URL: www.bmsit.in

2016-17

Disclaimer
The information contained in this document is the proprietary and exclusive property of Department of
Information Science & Engineering, BMS Institute of Technology & Management except as otherwise
indicated. No part of this document, in whole or in part, may be reproduced, stored, transmitted, or
used for course material development purposes without the prior written permission of BMS Institute of
Technology & Management.
The information contained in this document is subject to change without notice. The information in this
document is provided for informational purposes only.

Trademark

Edition: 2016 - 17
Document Owner
The primary contact for questions regarding this document is:
Author(s):

1.Prof.Swetha M S

2. Prof.Puspha S K.

3.Prof.Vinutha K

4. Dr.Manjunath T N

5.Prof.GireeshBabu C N

6. Prof.Ashwini N

Department:

Information Science & Engineering

Contact Email(s):

swethams_ise2014@bmsit.in
pushpask@bmsit.in
vinuthak_ise2014@bmsit.in
manju.tn@bmsit.in
gireeshbabu@bmsit.in
ashwinilaxman@bmsit.in

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: SOFTWARE ENGINEERING

SUBJECT CODE: 10IS51

Vision of the Institute


To emerge as one of the finest technical institutions of higher learning to develop
engineering professionals who are technically competent, ethical and environment
friendly for betterment of society.
Mission of the Institute
Accomplish stimulating learning environment through high quality academic instruction,
innovation and industry-institute interface.

Department of Information Science and Engineering


Vision of the Department
Emerge as one of the premier department of higher learning and research in
Information Technology
Mission of the Department
1. To provide excellence in technical education through contemporary teaching
learning process .
2. To inculcate ethical values, leadership abilities, and research capabilities towards
progress of society
Program Educational Objectives:
Graduates of the program will,
PEO1

Equip with required knowledge and skills to resolve business problems to


provide reliable and secure IT solutions.

PEO2

Encourage and participate in multi-disciplinary environments

PEO3

Maintain ethical conduct and engage in lifelong learning in response to the


contemporary needs of the society.

Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: SOFTWARE ENGINEERING

SUBJECT CODE: 10IS51

PROGRAMME OUTCOMES
Program outcomes are narrower statements that describe what students are expected to know and be
able to do by the time of graduation. These relate to the skills, knowledge and behavior. Bachelor of
Engineering Graduation students of Information science and Engineering program at B M S Institute of
Technology will attain the following program outcomes.

Program Outcomes:
After the successful completion of the course, the graduate will be able to
PO1: Engineering knowledge: Apply the knowledge of mathematics, science, engineering
fundamentals, and an engineering specialization to the solution of complex engineering problems.
PO2: Problem analysis: Identify, formulate, review research literature, and analyze complex
engineering problems reaching substantiated conclusions using first principles of mathematics, natural
sciences, and engineering sciences.
PO3: Design/development of solutions: Design solutions for complex engineering problems and
design system components or processes that meet the specified needs with appropriate consideration for
the public health and safety, and the cultural, societal, and environmental considerations.
PO4: Conduct investigations of complex problems: Use research-based knowledge and research
methods including design of experiments, analysis and interpretation of data, and synthesis of the
information to provide valid conclusions.
PO5: Modern tool usage: Create, select, and apply appropriate techniques, resources, and modern
engineering and IT tools including prediction and modeling to complex engineering activities with an
understanding of the limitations.
PO6: The engineer and society: Apply reasoning informed by the contextual knowledge to assess
societal, health, safety, legal and cultural issues and the consequent responsibilities relevant to the
professional engineering practice.
PO7: Environment and sustainability: Understand the impact of the professional engineering
solutions in societal and environmental contexts, and demonstrate the knowledge of, and need for
Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: SOFTWARE ENGINEERING

SUBJECT CODE: 10IS51

sustainable development.
PO8: Ethics: Apply ethical principles and commit to professional ethics and responsibilities and norms
of the engineering practice.
PO9: Individual and team work: Function effectively as an individual, and as a member or leader in
diverse teams, and in multidisciplinary settings.
PO10: Communication: Communicate effectively on complex engineering activities with the
engineering community and with society at large, such as, being able to comprehend and write effective
reports and design documentation, make effective presentations, and give and receive clear instructions.
PO11: Project management and finance: Demonstrate knowledge and understanding of the
engineering and management principles and apply these to ones own work, as a member and leader in
a team, to manage projects and in multidisciplinary environments.
PO12: Life-long learning: Recognize the need for, and have the preparation and ability to engage in
independent and life-long learning in the broadest context of technological change.

A) Course Administrator Details


Course Title

Course Code

Core/Elective

Semester

Year

SOFTWARE ENGINEERING

10IS51

Core

2016

Contact Hours/ week

Lecture

Tutorials

Practical

Department

Information Science and Engineering

Name of the faculty with


Designation and mail ID

Swetha M S,
Assistant Professor,
Swethams_ise2014@bmsit.in

Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: SOFTWARE ENGINEERING

Prerequisites for the Course


(exemption from the prerequisites
is provided only in exceptional
circumstances)

SUBJECT CODE: 10IS51

1. Programming Fundamentals,
2. Object Oriented Programming languages

B) Course Related Specifics


Syllabus (from VTU manual www.vtu.in)
SOFTWARE ENGINEERING
Sub Code : 10IS74
Hrs/Week : 04
Total Hrs :

IA Marks
:25
Exam Hours :03

PART A
UNIT 1

6 Hours

Overview: Introduction: FAQ's about software engineering, Professional and ethical responsibility.
Socio-Technical systems: Emergent system properties; Systems engineering; Organizations, people
and computer systems; Legacy systems.

UNIT 2

6 Hours

Critical Systems, Software Processes: Critical Systems: A simple safety-critical system; System
dependability; Availability and reliability. Software Processes: Models, Process iteration, Process
activities; The Rational Unified Process; Computer Aided Software Engineering.

UNIT 3

7 Hours

Requirements: Software Requirements: Functional and Non-functional requirements; User


requirements; System requirements; Interface specification; The software requirements document.
Requirements Engineering Processes: Feasibility studies; Requirements elicitation and analysis;
Requirements validation; Requirements management.

UNIT 4

Department of Information Science & Engineering, B M S Institute of Technology & Management

7 Hours

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: SOFTWARE ENGINEERING

SUBJECT CODE: 10IS51

System models, Project Management: System Models: Context models; Behavioral models; Data
models; Object models; Structured methods. Project Management: Management activities; Project
planning; Project scheduling; Risk management

PART - B
UNIT 5

7 Hours

Software Design: Architectural Design: Architectural design decisions; System organization; Modular
decomposition styles; Control styles. Object-Oriented design: Objects and Object Classes; An ObjectOriented design process; Design evolution

UNIT 6

6 Hours

Development: Rapid Software Development: Agile methods; Extreme programming; Rapid


application development. Software Evolution: Program evolution dynamics; Software maintenance;
Evolution processes; Legacy system evolution.

UNIT 7

7 Hours

Verification and Validation: Verification and Validation: Planning; Software inspections; Automated
static analysis; Verification and formal methods. Software testing: System testing; Component testing;
Test case design; Test automation.

UNIT 8

6 Hours

Management: Managing People: Selecting staff; Motivating people; Managing people; The People
Capability Maturity Model. Software Cost Estimation: Productivity; Estimation techniques;
Algorithmic cost modeling, Project duration and staffing
1. Write Requirements specification of software after studying the
problem domain
2. Use various process and design models for developing the software
3. Apply project management tools and techniques for scheduling the
diverse activities of software development
4. Document the design, implementation, and testing of the software
system
Department of Information Science & Engineering, B M S Institute of Technology & Management
5

Course Objectives

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: SOFTWARE ENGINEERING
SUBJECT CODE: 10IS51
5. Prepare the final report for the product

Recommended Text Books:

Text Books:
1. Ian Sommerville: Software Engineering, 8th Edition, Pearson Education, 2007. (Chapters-: 1, 2, 3,
4, 5, 6, 7, 8, 11, 14, 17, 21, 22, 23, 25, 26)
Reference Books:
1.Roger.S.Pressman: Software Engineering-A Practitioners approach, 7th Edition, Tata McGraw Hill,
2007.
2.Pankaj Jalote: An Integrated Approach to Software Engineering, Wiley India, 2009
Recommended Reference Materials:
1. Notes
2. PPT
3. Videos
Course Outcomes
CO1: Apply the importance of engineering practice in developing critical and non- critical system
CO2: Understand various software development process models and their requirements and
analysis process
CO3: Design software and apply strategies of Architecture design and project management
CO4: Understand and design planning, software inspections, automated static analysis, Verification
and validation of formal models
CO5: Apply rapid software development methods and decide on appropriate software architecture

Course Outcomes - Program Outcomes mapping:


COS/
POS
CO1

Program Outcomes
PO1

PO2

PO3

PO4

PO5

PO6

PO7

PO8

PO9

PO10

PO11

Department of Information Science & Engineering, B M S Institute of Technology & Management

PO12

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: SOFTWARE ENGINEERING
CO2

CO4

Total

CO3

CO5

SUBJECT CODE: 10IS51

3
9

1
7

1
2

NOTE: Mapping in terms of Slight (1), Moderate (2), Good (3) and Excellent (4) levels and COs need
not map all PO
Name of the Faculty: Prof.Swetha M S

No. of Hours: 52

LESSON PLAN
Lecture
No

Learning
Objective

Topic to be covered

Remarks

Unit I
1.
Write Requirements
specification of software after studying
the problem domain

1
2
3
4
5
6

Introduction: FAQ's about software


engineering,
Professional and ethical responsibility
Socio-Technical systems: Emergent
System properties
Systems engineering
Organizations, people and computer
systems
Legacy systems

Use
variou
s
proces
s and
design
model
s for
develo
ping
the
softwa
re

UNIT II
Critical Systems: A simple safety-critical
system

Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: SOFTWARE ENGINEERING
System dependability; Availability and
8
reliability
9

Software Processes: Models

10

Process iteration, Process activities

11

The Rational Unified Process

12

Computer Aided Software Engineering

SUBJECT CODE: 10IS51

13
14

15

16

17
18

Use various process and design models for


developing the software

UNIT III
Software Requirements
Functional and Non-functional
requirements
User requirements and System
requirements
Interface specification, The software
requirements document
Requirements Engineering Processes,
Feasibility studies;
Requirements elicitation and analysis;
Requirements validation,
Requirements management

19

UNIT IV
System Models: Context models

21

Behavioral models

22
23

24
25

Apply project
management tools and
techniques for scheduling the
diverse activities of software
development

20

Data models and Object models


Structured methods. Project
Management
Management activities and Project
planning
Project scheduling

Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: SOFTWARE ENGINEERING
26
Risk management.

SUBJECT CODE: 10IS51

30
31
32
33

System organization
Modular decomposition styles
Control styles. Object-Oriented design
development

29

diverse activities of software

28

Architectural Design, Architectural design


decisions
and techniques for scheduling the

27

Apply project management tools

UNIT V

Objects and Object Classes


An Object-Oriented design process
Design evolution
UNIT VI
Rapid Software Development

35
36
37
38
39

Document the design,


implementation, and testing of the
software system

34

Agile methods and Extreme


programming
Rapid application development
Software Evolution: Program evolution
dynamics
Software maintenance
Evolution processes and Legacy system
evolution.

40
41
42
43

Document
the design,
implementation,
and testing of the
software system

UNIT VII
Verification and Validation
Planning of the Software inspections
Automated static analysis
Verification and formal methods

Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: SOFTWARE ENGINEERING
44
Software testing: System testing
45

Component testing

46

Test case design and Test automation

SUBJECT CODE: 10IS51

UNIT VIII
Managing People: Selecting staff

48
49
50
51
52

Prepare the final report for


the product

47

Motivating people; Managing people


The People Capability Maturity Model
Software Cost Estimation: Productivity
Estimation techniques; Algorithmic cost
modeling
Project duration and staffing.

C) Course Assessment Procedure


Procedure for Internal Assessment
Best 2 out of 3 Tests
Maximum Marks for Internal Assessment

25

Procedure for External Assessment


Maximum Marks for Final Exam

100

TOTAL

125

NOTE 4: The administration of the Final exam/s and their evaluation is carried out by VTU directly
and with little direct input from the College.
D) Other Important Details
Department of Information Science & Engineering, B M S Institute of Technology & Management

10

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: SOFTWARE ENGINEERING

SUBJECT CODE: 10IS51

D.1 Occupational Health & Safety (OH&S) Procedures


Since this course does not have a practical component, no need to undergo OH&S procedures

D.2 Ethics and Code of Conduct Policy


This course complies with the B M S Institute of Technology Policies on Ethics and Code of Conduct
as described in the website: www.bmsit.in/Ethics&CodeofConductPolicy.
Accordingly, plagiarism in any student submissions, copying during assessments of any form and other
such unethical practices will not be tolerated at any time and failure to follow the rules will result in
severe penalties, including exclusion from the College.
Course Materials Availability to Students and Others under the Right to Information Act (RTI)
of India
Materials
Course Objectives & Outcomes
Lecture notes & homes work
assignments, (mini)projects.
Sample solutions
Course performance (e.g., student
surveys, etc)

Students Assistants/Tutors Department/Higherups

Question Bank
UNIT-1
1.
2.
3.
4.
5.
6.
7.
8.
9.

What is S/W? Explain and differentiate diff types of S/W products


Defining SE? How it is different from system engineering (5marks)
What are the emergent system properties? Give example for each.
Explain with neat diagram a simply-safety critical system.
What is process model? Describe the following models with merits and demerits
o (i) Evolutionary model (ii) component-based software engineering
Explain the type of S/W process model
Explain the generic process models or paradigms are S/W development.
What are attributes of a good S/W.?
Dec/Jan 2009/
What are the key challenges facing SE
June 2009

Department of Information Science & Engineering, B M S Institute of Technology & Management

11

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: SOFTWARE ENGINEERING

SUBJECT CODE: 10IS51

10. Explain the activities involved in system design process.


10mark/Jan 09
11. Explain the different types system requirement.
12. What is legacy system? Why these systems are critical to the operation of many business

UNIT-2
1. What are the most important dimensions of system dependability? 5marks / Jan 09
2. Give five reasons why dependability is important in critical systems. 5marks / Jan 09
3. Describe silent features of a Spiral model of S/W process with illustration diagram.
10 marks/ Jan 09/ Jan 2010
4. With a figure, explain the requirement of an engineering process May /June 2010
5. Describe the S/W life cycle with diagram. (or) Explain the features of waterfall model.
6. What is non-functional requirement? Explain different types of non-functional requirement.
5 marks / Jan 09
7. Write the structure for requirement document as suggested by IEEE std.
5 marks / Jan 09
8. With neat diagram explain the phases in RUP may/June 2010 (10 marks)
9. What is non-functional requirement? Explain different types of non-functional requirement (10
marks) may/June 2010

UNIT-3
1. What are Enduring and Volatile requirements?
2. Also give the classification of volatile requirements with brief explanation.
10 marks / Jan 09
3. What are all the various metrics for specifying nonfunctional requirements?
4. Write the requirement elicitation and analysis phase with spiral diagram. Give reasons.
2010.
5. Draw and explain the use case diagram and sequence diagram for the library system.
6. Draw and explain the use case diagram and sequence diagram for the ATM system.

MAY

7. Write the structure for requirement document as suggested by IEEE std.


5 marks / Jan 09
8. Why we need S/W system requirements? Explain the different types / category of requirement.
9. What is feasibility study? Discuss, Req, changes are inevitable.

10. Explain with fig the data flow model of an invoice processing system. Jan 2009
Department of Information Science & Engineering, B M S Institute of Technology & Management

12

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: SOFTWARE ENGINEERING

SUBJECT CODE: 10IS51

11. With an example, describe Repository model and give its advantages and dis advantage
5 marks / Jan 09

UNIT-4
1.

What is data-flow model? With an example show the notations used in data flow model.
2. Explain the object aggregation with example

3. Describe the three categories of risks. Explain different stages in risk management.

UNIT-5
1. What is Architectural design? Discuss the advantages of explicitly designing and documenting S/W
architecture.
2. How nonfunctional requirements are taken care in architectural design.
3. Explain the Client server model.
4. Explain the Layered model.
5. Discuss the different types of control models(style). ( i.e centralized model, event drive model )
6. Explain the modular decomposition model.
7. Illustrate with two examples for Object and Object class.
5 marks / Jan 09.
8. Develop an object model including a class hierarchy diagram, Service usage diagram and aggregate
diagram for a Library system.
10 marks / Jan 08.
9. What is architectural design? Explain the architectural design decision. MAY 2010
10. Why requirements need to be validated? Explain the check made in requirement validation.

UNIT-6
1. What are Agile methods? Give brief descriptions of five principles of agile methods. Also
explain why sometimes difficult to realize them.
10 marks /Jan 09
2. Discuss the advantages of pair programming.
5 marks /Jan 09
3. Briefly describe the three types of S/W maintenance. Why sometimes difficult to distinguish
between them.
10 marks / Jan 09
4. What is extreme programming? Explain different practices involved in extreme programming.
5. Explain the four basic issues in assessing business value of a Legacy system.
6. List and state the Lehmans laws given to Software evolution
Department of Information Science & Engineering, B M S Institute of Technology & Management

13

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: SOFTWARE ENGINEERING

SUBJECT CODE: 10IS51

UNIT-7
1. Explain different types of testing that will be done in system testing with neat block diagram
2. What is verification and validation? Explain why validation is a difficult process
3. Explain the clean room approach of software development based of the 5 key strategies.
4. With neat diagram explain logical part of legacy system.
5. Explain the characteristic of rapid software development.

UNIT-8
1.Explain factors governing staff selection.

[June 2013, Dec 2013] [10M]

2.Explain Maslows human-needs hierarchy of motivating people. [June 2014][10M]


3. Describe with block diagram, SEI people- CMM. [Dec 2013,June 2013, June 2015]
4. What are the factors affecting software pricing? What are the two types of metric used?
5. Explain. [Jan 2014, Dec 2014] [10M]
6. What are the factors affecting software pricing? What are the two types of metric used?
7. Explain. [Jan 2014, Dec 2014] [10M]
8. Explain cost estimation techniques.

[June 2013][10M]

Department of Information Science & Engineering, B M S Institute of Technology & Management

14

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
COUSE FILE (SK PUSHPA) / SUBJECT NAME: SYSTEM SOFTWARE

SUBJECT CODE: 10CS52

Vision of the Institute


To emerge as one of the finest technical institutions of higher learning to develop
engineering professionals who are technically competent, ethical and environment
friendly for betterment of society.

Mission of the Institute


Accomplish stimulating learning environment through high quality academic instruction,
innovation and industry-institute interface.

Department of Information Science and Engineering


Vision of the Department
Emerge as one of the premier department of higher learning and research in
Information Technology.
Mission of the Department
1: To provide excellence in technical education through Contemporary teaching learning
process
2: To inculcate ethical values, leadership abilities, and research capabilities towards
progress of society
Program Educational Objectives:
Graduates of the program will,
PEO1

Equip with required knowledge and skills to resolve business problems to


provide reliable and secure IT solutions.

PEO2

Encourage and participate in multi-disciplinary environments.

PEO3

Maintain ethical conduct and engage in lifelong learning in response to the


contemporary needs of the society.

Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
COUSE FILE (SK PUSHPA) / SUBJECT NAME: SYSTEM SOFTWARE

SUBJECT CODE: 10CS52

PROGRAMME OUTCOMES
Program outcomes are narrower statements that describe what students are expected to know and be
able to do by the time of graduation. These relate to the skills, knowledge and behavior. Bachelor of
Engineering Graduation students of Information Science & Engineering program at B M S Institute of
Technology will attain the following program outcomes.

Program Outcomes:
After the successful completion of the course, the graduate will be able to

PO1: Engineering knowledge: Apply the knowledge of mathematics, science, engineering


fundamentals, and an engineering specialization to the solution of complex engineering problems.
PO2: Problem analysis: Identify, formulate, review research literature, and analyze complex
engineering problems reaching substantiated conclusions using first principles of mathematics, natural
sciences, and engineering sciences.
PO3: Design/development of solutions: Design solutions for complex engineering problems and
design system components or processes that meet the specified needs with appropriate consideration for
the public health and safety, and the cultural, societal, and environmental considerations.
PO4: Conduct investigations of complex problems: Use research-based knowledge and research
methods including design of experiments, analysis and interpretation of data, and synthesis of the
information to provide valid conclusions.
PO5: Modern tool usage: Create, select, and apply appropriate techniques, resources, and modern
engineering and IT tools including prediction and modeling to complex engineering activities with an
understanding of the limitations.
PO6: The engineer and society: Apply reasoning informed by the contextual knowledge to assess
societal, health, safety, legal and cultural issues and the consequent responsibilities relevant to the
professional engineering practice.
PO7: Environment and sustainability: Understand the impact of the professional engineering
Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
COUSE FILE (SK PUSHPA) / SUBJECT NAME: SYSTEM SOFTWARE

SUBJECT CODE: 10CS52

solutions in societal and environmental contexts, and demonstrate the knowledge of, and need for
sustainable development.
PO8: Ethics: Apply ethical principles and commit to professional ethics and responsibilities and norms
of the engineering practice.
PO9: Individual and team work: Function effectively as an individual, and as a member or leader in
diverse teams, and in multidisciplinary settings.
PO10: Communication: Communicate effectively on complex engineering activities with the
engineering community and with society at large, such as, being able to comprehend and write effective
reports and design documentation, make effective presentations, and give and receive clear instructions.
PO11: Project management and finance: Demonstrate knowledge and understanding of the
engineering and management principles and apply these to ones own work, as a member and leader in
a team, to manage projects and in multidisciplinary environments.
PO12: Life-long learning: Recognize the need for, and have the preparation and ability to engage in
independent and life-long learning in the broadest context of technological change.

A) Course Administrator Details


Course Title

Course Code

System Software

10CS52

Lecture
Contact Hours/ week

Department

Core/Elective

Core

Tutorials

Semester

Year

2016

Practical

Information Science and Engineering

Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
COUSE FILE (SK PUSHPA) / SUBJECT NAME: SYSTEM SOFTWARE

Name of the faculty with


Designation and mail ID

SUBJECT CODE: 10CS52

S.K. Pushpa,
Associate Professor,
pushpask@bmsit.in

Prerequisites for the Course 1. Basic Concepts of Computer


(exemption from the prerequisites2. Unix shell programming
is provided only in exceptional 3. Assembly Language Programming
circumstances)

B) Course Related Specifics


Syllabus (from VTU manual www.vtu.in)

Subject: System Software


Subject Code: 10CS52
Hours/Week:
4
Total Hours :
52
UNIT 1

I.A. Marks:
50
Exam Hours: 03
Exam Marks: 100
6Hours

Machine Architecture: Introduction, System Software and Machine Architecture, Simplified


Instructional Computer (SIC) - SIC Machine Architecture, SIC/XE Machine Architecture, SIC
Programming Examples.

UNIT2

6Hours

Assemblers -1: Basic Assembler Function - A Simple SIC Assembler, Assembler Algorithm and Data
Structures, Machine Dependent Assembler Features - Instruction Formats & Addressing Modes,
Program Relocation.

UNIT 3

6Hours

Assemblers -2: Machine Independent Assembler Features


Literals, Symbol-Definition
Statements, Expression, Program Blocks, Control Sections and Programming Linking, Assembler
Design Operations - One- Pass Assembler, Multi-Pass Assembler, Implementation Examples
MASM Assembler.

Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
COUSE FILE (SK PUSHPA) / SUBJECT NAME: SYSTEM SOFTWARE

UNIT 4

SUBJECT CODE: 10CS52

8Hours

Loaders and Linkers: Basic Loader Functions - Design of an Absolute Loader, A Simple Bootstrap
Loader, Machine-Dependent Loader Features Relocation, Program Linking, Algorithm and Data
Structures for a Linking Loader; Machine-Independent Loader Features - Automatic Library Search,
Loader Options, Loader Design Options - Linkage Editor, Dynamic Linkage, Bootstrap Loaders,
Implementation Examples - MS-DOS Linker.

PART B
UNIT 5

6 Hours

Editors and Debugging Systems: Text Editors - Overview of Editing Process, User Interface,
Editor Structure, Interactive Debugging Systems - Debugging Functions and Capabilities,
Relationship With Other Parts Of The System, User-Interface Criteria

UNIT 6

8Hours

Macro Processor: Basic Macro Processor Functions - Macro Definitions and Expansion, Macro
Processor Algorithm and Data Structures, Machine- Independent Macro Processor Features Concatenation of Macro Parameters, Generation of Unique Labels, Conditional Macro Expansion,
Keyword Macro Parameters, Macro Processor Design Options - Recursive Macro Expansion,
General-Purpose Macro Processors, Macro Processing Within Language Translators, Implementation
Examples - MASM Macro Processor, ANSI C Macro Processor.

UNIT 7

6Hours

Lex and Yacc 1: Lex and Yacc - The Simplest Lex Program, Recognizing Words With LEX, Symbol
Tables, Grammars, Parser-Lexer Communication, The Parts of Speech Lexer, A YACC Parser, The
Rules Section, Running LEX and YACC, LEX and Hand- Written Lexers, Using LEX Regular
Expression, Examples of Regular Expressions, A Word Counting Program, Parsing a Command Line.

Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
COUSE FILE (SK PUSHPA) / SUBJECT NAME: SYSTEM SOFTWARE

UNIT 8

SUBJECT CODE: 10CS52

6 Hours

Lex and Yacc - 2 : Using YACC Grammars, Recursive Rules, Shift/Reduce Parsing, What YACC
Cannot Parse, A YACC Parser - The Definition Section, The Rules Section, Symbol Values and
Actions, The LEXER, Compiling and Running a Simple Parser, Arithmetic Expressions and
Ambiguity, Variables and Typed Tokens.

LABORATORY WORK
The following experiments should be practiced:
1.
2.
3.
4.

Course Objectives

a. To explain the major concepts of language


translation and assembler design.
b. To develop an awareness of the functions and
complexity of modern assembler.
c. To provide knowledge and skills necessary to
develop system software covering a broad range of
engineering and scientific applications
d. To deliver the required knowledge and skills
necessary to use lex and Yacc tools.

Recommended Text Books:


1. Leland.L. Beck: Systems Software, 3rd Edition, Addison-Wesley, 1997.
2. John.R.Levine, Tony Mason and Doug Brown : Lex and Yacc, OReilly, SPD, 1998
Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
COUSE FILE (SK PUSHPA) / SUBJECT NAME: SYSTEM SOFTWARE
SUBJECT CODE: 10CS52
nd
3. D.M.Dhamdhere: Systems Programming and Operating Systems, 2 Edition, Tata McGraw Hill, 1999

Recommended Reference Materials:


1. Notes
2. PPT
3. Videos

Web Resources:
1. http://solomon.ipv6.club.tw/Course/SP/

2. http://www.venim.cz/downloads/manualy/SIC/e8/e8V5_sictools_US.pdf3.
3. https://en.osdn.jp/projects/sfnet_sicvm/howto/install

Course Outcomes
CO1: Gain knowledge on basic internal architecture of a system.
CO2: Analyze and develop ALL programs for SIC and SIC/XE machine architecture
CO3: Understand and Demonstrate assembly programming language and different passing techniques
of assemblers
CO4: Describe the design and implementation of different system software
CO5: Ability to understand the process of scanning and parsing tools
CO6: Analyze and Develop the programs using LEX and YACC tools

Course Outcomes - Program Outcomes mapping:


COS/
POS
CO1

Program Outcomes
PO1

PO2

PO3

PO4

PO5

PO6

PO7

PO8

PO9

PO10

PO11

PO12

Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
COUSE FILE (SK PUSHPA) / SUBJECT NAME: SYSTEM SOFTWARE
CO2
CO3

SUBJECT CODE: 10CS52

CO4
CO5

CO6

Total

11

12

10

NOTE: Mapping in terms of Slight (1), Moderate (2), Good (3) and Excellent (4) levels and COs need
not map all POS

Name of the Faculty:

No. of Hours: 50

LESSON PLAN
Lecture
No

Learning
Objective

Topic to be covered

Remarks

1
2

3
4
5
6

Duties and scope of a system


programmer

UNIT I
Machine Architecture
Introduction, System
Machine Architecture,

Software

and

Simplified Instructional Computer (SIC)


- SIC Machine Architecture
SIC/XE Machine Architecture
SIC Programming Examples.
SIC/XE Programming Examples
UNIT II

Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering

8
9

10

11

To understand the processing of


an ALL program for execution
on a computer system.

COUSE FILE (SK PUSHPA) / SUBJECT NAME: SYSTEM SOFTWARE


7
Assemblers -1: Basic Assembler Function

SUBJECT CODE: 10CS52

A Simple SIC Assembler


Assembler Algorithm and Data
Structures
Assembler Algorithm and Data
Structures
Machine Dependent Assembler
Features - Instruction Formats &
Addressing Modes
Program Relocation

12

13

14
15

16
17
18

1. To understand the processing of an


ALL program for execution on a
computer system.

UNIT III
Assemblers -2: Machine Independent
Assembler Features

Literals,
Symbol-Definition
Statements,
Expression
Program Blocks,
Control Sections and Programming
Linking,
Assembler Design Operations - One- Pass
Assembler,
Multi-Pass Assembler,
Implementation Examples MASM
Assembler.

19
20
21

Implementatio
n and design g
goo loaders

UNIT IV
Loaders and
Functions -

Linkers:

Basic

Loader

Design of an Absolute Loader,


A Simple Bootstrap Loader,

Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
COUSE FILE (SK PUSHPA) / SUBJECT NAME: SYSTEM SOFTWARE
Machine-Dependent Loader Features,
22
Relocation, Program Linking,
23

Algorithm and Data Structures for a


Linking Loader;

24

Machine-Independent Loader Features Automatic Library Search, Loader


Options,

25

Loader Design Options - Linkage Editor,

26

Dynamic Linkage, Bootstrap Loaders,


Implementation Examples - MS-DOS
Linker.

SUBJECT CODE: 10CS52

27
28
29
30

31
32

implementation of assemblers,
macro processor, linker and loader

UNIT V
Editors and Debugging Systems: Text
Editors
Overview of Editing Process
User Interface, Editor Structure
Interactive Debugging Systems Debugging Functions and Capabilities
Relationship With Other Parts Of The
System
User-Interface Criteria

33

34

Macro Processor

UNIT VI
Macro Processor: Basic Macro Processor
Functions - Macro Definitions and
Expansion
Macro Processor Algorithm and Data
Structures

Department of Information Science & Engineering, B M S Institute of Technology & Management

10

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
COUSE FILE (SK PUSHPA) / SUBJECT NAME: SYSTEM SOFTWARE
Machine- Independent Macro Processor
35
Features - Concatenation of Macro
Parameters
36

Generation of Unique Labels

37

Conditional Macro Expansion, Keyword


Macro Parameters

38

Macro Processor Design Options Recursive Macro Expansion,

39

General-Purpose Macro Processors,


Macro Processing Within Language
Translators

40

Implementation Examples - MASM


Macro Processor, ANSI C Macro
Processor.

SUBJECT CODE: 10CS52

41

42

43

44

45

46

To understand the process of scanning and parsing tools.

UNIT VII
Lex and Yacc 1: Lex and Yacc - The
Simplest Lex Program, Recognizing Words
With LEX, Parsing a Command Line
Symbol Tables, Grammars, Parser-Lexer
Communication, A Word Counting
Program,
The Parts of Speech Lexer, Using LEX
Regular Expression, Examples of Regular
Expressions
A YACC Parser, The Rules Section,
Running LEX and YACC, LEX and HandWritten Lexers
Recognizing Words With LEX, Parsing a
Command Line
Lex and Yacc 1: Lex and Yacc - The
Simplest Lex Program

Department of Information Science & Engineering, B M S Institute of Technology & Management

11

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering

47
48

49

50

To understand the process of


scanning and parsing tools.

COUSE FILE (SK PUSHPA) / SUBJECT NAME: SYSTEM SOFTWARE


UNIT VIII

SUBJECT CODE: 10CS52

Lex and Yacc - 2 : Using YACC Grammars,


Recursive Rules, Shift/Reduce Parsing
What YACC Cannot Parse
A YACC Parser - The Definition Section,
The Rules Section, Symbol Values and
Actions
The LEXER, Compiling and Running a
Simple Parser

51

Arithmetic Expressions and Ambiguity

52

Variables and Typed Tokens

C) Course Assessment Procedure


Procedure for Internal Assessment
Best 2 out of 3 Assignments
Best 2 out of 3 Tests
Best 2 out of 3 Quizzes
Best 2 out of 3 (Name Assessment)
Maximum Marks for Internal Assessment

20

Procedure for External Assessment


Maximum Marks for Final Exam

100

TOTAL

125

NOTE 4: The administration of the Final exam/s and their evaluation is carried out by VTU directly
and with little direct input from the College.
D) Other Important Details
D.1 Occupational Health & Safety (OH&S) Procedures

Department of Information Science & Engineering, B M S Institute of Technology & Management

12

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
COUSE FILE (SK PUSHPA) / SUBJECT NAME: SYSTEM SOFTWARE

SUBJECT CODE: 10CS52

Since this course has a practical component, students are required to undergo OH&S training PRIOR
TO ENTERING the laboratory. Students must undergo this training every year for use of this
laboratory and their successful completion will be documented. Students must follow the OH&S
procedures meticulously and failure to follow them will result in severe penalties, including exclusion
from the College.
NOTE 5: Health and safety procedures have to be printed and displayed in the labs.

D.2 Ethics and Code of Conduct Policy


This course complies with the B M S Institute of Technology Policies on Ethics and Code of Conduct
as described in the website: www.bmsit.in/Ethics&CodeofConductPolicy.
Accordingly, plagiarism in any student submissions, copying during assessments of any form and other
such unethical practices will not be tolerated at any time and failure to follow the rules will result in
severe penalties, including exclusion from the College.
NOTE 6 D.2 to be included for all courses.
Course Materials Availability to Students and Others under the Right to Information Act (RTI)
of India

Materials
Course Objectives & Outcomes
Lecture notes & homes work
assignments, (mini)projects.
Sample solutions
Course performance (e.g., student
surveys, etc)

Students Assistants/Tutors Department/Higherups

Department of Information Science & Engineering, B M S Institute of Technology & Management

13

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
COUSE FILE (SK PUSHPA) / SUBJECT NAME: SYSTEM SOFTWARE

SUBJECT CODE: 10CS52

Question Bank
Unit I Machine Architecture

1. Define system software. Bring out the differences between system software and application
software. Bring out the differences between CISC and RISC
2. Explain SIC machine Architecture.
3. With reference to SIC/XE machine architecture explain
i) Instruction formats

ii) Addressing modes

iii) Data formats

iv) Register organization

4. Suppose that ALPHA is an array of 100 words. Write a sequence of instruction for SIC/XE to set all
100 elements of the array to 0. Use immediate addressing and register to register instructions to make
process as efficient as possible.
5. What are assembler directive? Give examples.
6. Suppose that RECORD contains a 20 byte record. Write a subroutine for SIC/XE that will write this
record on to device 05. Use immediate addressing and register to register instructions to make the
subroutine as efficient as possible
7. Explain the following with an example
(1) START

(2) END

(3) BYTE

(4) WORD

(5) RESB

(6) RESW

(7) BASE

Unit II Assemblers - 1
1. Give the functions of each pass of a two pass assembler.
Department of Information Science & Engineering, B M S Institute of Technology & Management

14

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
COUSE FILE (SK PUSHPA) / SUBJECT NAME: SYSTEM SOFTWARE

SUBJECT CODE: 10CS52

2. Write an algorithm for Pass1 of an assembler.


3. With reference to SIC/XE machine architecture explain different types of addressing modes with an
example for each.
4. Discuss the need for a two pass assembler. Explain how forward references are handled in one-pass
assembler.
5. Generate the object program for the ALP given below:
SUM
FIRST

LOOP

START 0

OPCODE

LDX

#0

LDX

04

LDA

#0

LDA

00

+LDB

#TABLE2

LDB

BASE

TABLE2

ADD

TABLE, X

TIX

2C

ADD

TABLE2, X

JLT

38

TIX

COUNT

STA

0C

JLT

LOOP

RSUB

4C

+STA

TOTAL

ADD

68
18

RSUB
COUNT

RESW

TABLE

RESW

2000

TABLE2

RESW

2000

TOTAL

RESW

END

FIRST

6. Explain programmers view of an SIC machine architecture.


7. Explain an algorithm for pass 2 of an assembler.
8. Explain program relocation. Also explain how the problems of relocation are solved.
Department of Information Science & Engineering, B M S Institute of Technology & Management

15

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
COUSE FILE (SK PUSHPA) / SUBJECT NAME: SYSTEM SOFTWARE

SUBJECT CODE: 10CS52

9. Explain the two major internal data structures used in simple assemblers. Give reason for using that
data structures.
10. Explain the structure and design of one pass assemblers.
11. What are the fundamental functions that any assembler must perform? With suitable example
explain any six assembler directives.
12. Show the structure of a head record, text record and modification record taking one example for
each.
13. With examples, show the target address calculation with different addressing modes of SIC/XE
machine.
14. Write a subroutine in SIC/XE to read a 100 byte record from a device f5 into BUFFER.
15. List various data structures used in the assembling process. With an algorithm explain the usage of
these data structures in pass-two of a two-pass assembler.
16. Show the structure of head record, text record, modification record and end record taking one
example for each.
17. Write a program to initialize 26 locations with ASCII code A to Z using SIC/XE and generate object
code for the same.
18. Write a program in SIC/XE to add two arrays ALPHA, BETA of 100 words each, and stores the result
in a new array GAMMA of 100 words. And generate object code for the same.
19. Enlist the various assembler features that are machine dependent and explain any one in detail.

Unit III Assemblers 2


1. What is LTORG? When is it used? Explain with an example.
2. Distinguish between literals and immediate operands. How does the assembler handle the literal
operand?

Department of Information Science & Engineering, B M S Institute of Technology & Management

16

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
COUSE FILE (SK PUSHPA) / SUBJECT NAME: SYSTEM SOFTWARE

SUBJECT CODE: 10CS52

3. Explain Symbol defining Statements with an example for each.


4. Explain Expressions with an example.
5. Explain the following with an example.
1. RESB 2. EXTREF 3.LTORG 4. EQU 5.ORG 6. BYTE 7. WORD 8. BASE
9 EQU

10. ORG

6. Enlist the various assembler features that are machine dependent


and machine independent. Explain program blocks .
7. Explain Control section and program linking
8. Explain the algorithm for one pass assembler. Explain how forward references are handled in one
pass assembler.
9. What is the need for relocation of the programs? With an example explain how relocation can be
done.
10. With an example explain how program linking can be done.
11. With figure explain how loading & calling of a subroutine can be done using dynamic linking.
12. Enlist the various assembler features that are machine dependent
and machine independent. Explain Control section and program linking

Unit IV Loaders and Linkers


1. a)What is a loader ? Explain basic loader functions?
b)Explain bootstrap loader with algorithm?
2. Explain program linking
3. Explain Dynamic linking loader with neat diagram ?
4. a) Write a note on Cray MP linker
Department of Information Science & Engineering, B M S Institute of Technology & Management

17

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
COUSE FILE (SK PUSHPA) / SUBJECT NAME: SYSTEM SOFTWARE

SUBJECT CODE: 10CS52

b) Write a note on ELENA macro processor


5. With an example explain how program linking can be done.
6. What is dynamic loading? What are its advantages and disadvantages? Explain
7. With a neat diagram loading and calling of a subroutine using dynamic linking
8. Write a note on MS-DOS Linker
9. What is relocating loader? Explain the two methods for specifying relocation as a part of object
program.
10. Differentiate between a linking loader and linkage editor, with the help of suitable diagrams.
11. Explain with example the data structures used for a linking loader.
12. With sketch explain how object program can be processed using linkage editor.

Unit V Editors and Debugging Systems

1. What is an interactive editor? Explain briefly, Structure of a typical editor with the help of suitable
block diagram.
2. Briefly discuss command language processor, traveling, editing, viewing and display functions
3. Explain the different debugging functions and debugging capabilities
4. List the important tasks to be accomplished by a text editor for an interactive user- computer
dialogue
5. With figure explain the structure of an editor
6. Briefly explain Debugging functions
7. Write a note on user interface criteria for interactive debugging systems
8.What is an interactive editor?
9.Explain the relationship between editing and viewing buffer?
Department of Information Science & Engineering, B M S Institute of Technology & Management

18

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
COUSE FILE (SK PUSHPA) / SUBJECT NAME: SYSTEM SOFTWARE

SUBJECT CODE: 10CS52

10.With figure explain the structure of an editor.


11.Explain the functions of interactive Debugging systems

Unit VI Macro Processor

1. What is a macro? Explain macro definition and expansion with example


2. Explain various data structures used in the design of a macro processor with an example
3. Explain (1) conditional macro expansion
(2) Generation of Unique labels
(3) Conditional Macro expansion
(4) Key word Macro Parameters
4. Explain recursive macro expansion with example
5. Write note on (1) General purpose Macro processors
(2) Macro processing with Language translator
6. Write a note on processing macro within language translators.
7. Explain algorithm for one pass macro processor
8. What is the problem in invocation of macros within macros? Explain with an example.
9. Explain with example concatenation of macro parameter and generation of unique labels .
10. Write a Note on : i) MASAM Macro processor ii) ANSI C Macro Language

Unit VII & VIII Lex and Yacc 1&2


Lex

1. Write a lex program to count characters, words, lines and blanks


Department of Information Science & Engineering, B M S Institute of Technology & Management

19

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
COUSE FILE (SK PUSHPA) / SUBJECT NAME: SYSTEM SOFTWARE

SUBJECT CODE: 10CS52

2. Explain regular expressions used in writing lex programs


3. Write a lex program to remove uppercase letters & white spaces in a file
4. What are the different phases of a complier? Explain.
5. Explain operator precedence parsing with an example.
6. Explain recursive descent parsing for assignment statement

Yacc

7. What is shift/reduce parsing? Explain the parsing of the input fred = 12+13 and represent it using
parse tree.
8. Explain the ambiguity while passing 2+3*4. Explain the solution for it.
9. Write yacc program to recognize the given arithmetic expression containing +, -,*,/,unimus operator
with + and having highest precedence.
10. What do you mean by ambiguous grammar? How it can be overcome? Illustrate with an example.
11. Explain the structure of a Yacc program
12. Write a short nite on Parser Lexer communication.
13. What is Yacc? Explain the different sections used in writing the yacc specification.
14. What are conflicts? Explain different types of conflicts in YACC with examples
15. Write a YACC program to evaluate the given expression
16. Explain how grammar conflicts are handled by yacc? Write a yacc program for a desktop calculator.
17. Explain with an example recursive grammer
18. Write a YACC program to recognize the grammar abn / n > 0.

Department of Information Science & Engineering, B M S Institute of Technology & Management

20

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: OPERATING SYSTEM

SUBJECT CODE: 10CS53

Vision of the Institute


To emerge as one of the finest technical institutions of higher learning to develop
engineering professionals who are technically competent, ethical and environment
friendly for betterment of society.
Mission of the Institute
Accomplish stimulating learning environment through high quality academic
instruction, innovation and industry-institute interface.

Department of Information Science and Engineering


Vision of the Department
Emerge as one of the premier department of higher learning and research in
Information Technology
Mission of the Department
1. To provide excellence in technical education through contemporary teaching
learning process .
2. To inculcate ethical values, leadership abilities, and research capabilities towards
progress of society
Program Educational Objectives:
Graduates of the program will,
PEO1

Equip with required knowledge and skills to resolve business problems to


provide reliable and secure IT solutions.

PEO2

Encourage and participate in multi-disciplinary environments

PEO3

Maintain ethical conduct and engage in lifelong learning in response to the


contemporary needs of the society.

Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: OPERATING SYSTEM

SUBJECT CODE: 10CS53

PROGRAMME OUTCOMES
Program outcomes are narrower statements that describe what students are expected to know and be
able to do by the time of graduation. These relate to the skills, knowledge and behavior. Bachelor of
Engineering Graduation students of Information science and Engineering program at B M S Institute of
Technology will attain the following program outcomes.

Program Outcomes:
After the successful completion of the course, the graduate will be able to
PO1: Engineering knowledge: Apply the knowledge of mathematics, science, engineering
fundamentals, and an engineering specialization to the solution of complex engineering problems.
PO2: Problem analysis: Identify, formulate, review research literature, and analyze complex
engineering problems reaching substantiated conclusions using first principles of mathematics, natural
sciences, and engineering sciences.
PO3: Design/development of solutions: Design solutions for complex engineering problems and
design system components or processes that meet the specified needs with appropriate consideration for
the public health and safety, and the cultural, societal, and environmental considerations.
PO4: Conduct investigations of complex problems: Use research-based knowledge and research
methods including design of experiments, analysis and interpretation of data, and synthesis of the
information to provide valid conclusions.
PO5: Modern tool usage: Create, select, and apply appropriate techniques, resources, and modern
engineering and IT tools including prediction and modeling to complex engineering activities with an
understanding of the limitations.
PO6: The engineer and society: Apply reasoning informed by the contextual knowledge to assess
societal, health, safety, legal and cultural issues and the consequent responsibilities relevant to the
professional engineering practice.
PO7: Environment and sustainability: Understand the impact of the professional engineering
Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: OPERATING SYSTEM

SUBJECT CODE: 10CS53

solutions in societal and environmental contexts, and demonstrate the knowledge of, and need for
sustainable development.
PO8: Ethics: Apply ethical principles and commit to professional ethics and responsibilities and norms
of the engineering practice.
PO9: Individual and team work: Function effectively as an individual, and as a member or leader in
diverse teams, and in multidisciplinary settings.
PO10: Communication: Communicate effectively on complex engineering activities with the
engineering community and with society at large, such as, being able to comprehend and write effective
reports and design documentation, make effective presentations, and give and receive clear instructions.
PO11: Project management and finance: Demonstrate knowledge and understanding of the
engineering and management principles and apply these to ones own work, as a member and leader in
a team, to manage projects and in multidisciplinary environments.
PO12: Life-long learning: Recognize the need for, and have the preparation and ability to engage in
independent and life-long learning in the broadest context of technological change.

A) Course Administrator Details


Course Title

Course Code

Core/Elective

Semester

Year

Operating System

10IS53

Core

2016

Contact Hours/ week

Lecture

Tutorials

Practical

Department

Information Science and Engineering

Name of the faculty with


Designation and mail ID

Vinutha K,
Assistant Professor,
Vinuthak_ise2014@bmsit.in

Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: OPERATING SYSTEM

SUBJECT CODE: 10CS53

Prerequisites for the Course 1. Programming in C


(exemption from the prerequisites2. Computer Organization
is provided only in exceptional
circumstances)

B) Course Related Specifics


Syllabus (from VTU manual www.vtu.in)

Operating system
Sub Code : 10IS72
Hrs/Week : 04
Total Hrs : 52

UNIT 1

IA Marks
:25
Exam Hours :03
Exam Marks :100

6 Hours

Introduction to Operating Systems, System structures: What operating systems do; Computer
System organization; Computer System architecture; Operating System structure; Operating System
operations; Process management; Memory management; Storage management; Protection and
security; Distributed system; Special-purpose systems; Computing environments.

System structures :Operating System Services; User - Operating System interface; System calls;
Types of system calls; System programs; Operating System design and implementation; Operating
System structure; Virtual machines; Operating System generation; System boot.

UNIT 2

7 Hours

Process Management: Process concept; Process scheduling; Operations on processes; Inter-process


communication.
Multi-Threaded Programming: Overview; Multithreading models; Thread Libraries; Threading
issues.
Process Scheduling: Basic concepts; Scheduling criteria; Scheduling algorithms; Multiple-Processor
scheduling, Thread scheduling.
Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: OPERATING SYSTEM

SUBJECT CODE: 10CS53

UNIT 3

7 Hours

Process Synchronization: Synchronization: The Critical section problem; Petersons solution;


Synchronization hardware; Semaphores; Classical problems of synchronization; Monitors.

UNIT 4

6 Hours

Deadlocks: Deadlocks: System model; Deadlock characterization; Methods for handling deadlocks;
Deadlock prevention; Deadlock avoidance; Deadlock detection and recovery from deadlock.

PART B
UNIT 5

7 Hours

Memory Management: Memory Management Strategies: Background; Swapping; Contiguous


memory allocation; Paging; Structure of page table; Segmentation. Virtual Memory Management:
Background; Demand paging; Copy-on-write; Page replacement; Allocation of frames; Thrashing.

UNIT 6

7 Hours

File System, Implementation of File System: File System: File concept; Access methods; Directory
structure; File system mounting; File sharing; Protection. Implementing File System: File system
structure; File system implementation; Directory implementation; Allocation methods; Free space
management

UNIT 7

6 Hours

Secondary Storage Structures, Protection : Mass storage structures; Disk structure; Disk attachment;
Disk scheduling; Disk management; Swap space management. Protection: Goals of protection,
Principles of protection,Domain of protection, Access matrix, Implementation of access matrix,
Access control, Revocation of access rights, Capability-Based systems.

Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: OPERATING SYSTEM

SUBJECT CODE: 10CS53

UNIT 8

6 Hours

Case Study: The Linux Operating System: Linux history; Design principles; Kernel modules; Process
management; Scheduling; Memory management; File systems, Input and output; Inter-process
communication.

Course Objectives

1. To teach the fundamental concepts, structure and functions of


Operating systems
2. To provide knowledge on Process, threads and synchronization
techniques
3. To make them understand the principles of concurrency and
Deadlock
4. To learn the basics of LINUX Operating Systems

Recommended Text Books:

1. Abraham Silberschatz, Peter Baer Galvin, Greg Gagne: Operating System Principles, 8th edition, Wiley India, 2009. (Chapte
9.1 to 9.6, 10, 11.1 to 11.5, 12.1 to 12.6, 17.1 to 17.8, 21.1 to 21.9)
Reference Books:
1. D.M Dhamdhere: Operating systems - A concept based Approach,2nd Edition, Tata McGraw- Hill, 2002.
2. P.C.P. Bhatt: Introduction to Operating Systems: Concepts and Practice, 2nd Edition, PHI, 2008.
3. Harvey M Deital: Operating systems, 3rd Edition, Pearson Education, 1990.

Recommended Reference Materials:


1. Notes
2. PPT
3. Videos
Web Resources:
1. http://nptel.ac.in/downloads/106108101/
2. http://www.vtuplanet.com/download.php?type=papers&dir=B.E+(Engineering)%2FInformation+Science+(I
OPERATING+SYSTEMS+%5B10CS53%5D-NOTES.pdf
Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: OPERATING SYSTEM

SUBJECT CODE: 10CS53

Course Outcomes
CO1:Understand various types of operating systems, its operations, services, virtual machines and their
structure
CO2:Identify difference between process and threads and synchronization issues
CO3:Describe the operations of process, file , disk, I/O and memory management techniques for various OS
CO4: Analyse how deadlock occurs and methods to prevent/detect/avoid and implement them in
multiprogramming system.
CO5:Solve process, memory and disk scheduling based problems
CO6:Develop software programs for various OS concepts

Course Outcomes - Program Outcomes mapping:


Program Outcomes

COS/
POS

PO1

PO2

CO1

CO2

CO3

CO4

CO5

CO6

PO3

PO4

PO5

PO6

PO7

PO8

PO9

PO10

PO11

PO12

1
2

Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: OPERATING SYSTEM

Total

18

18

12

SUBJECT CODE: 10CS53

NOTE: Mapping in terms of Slight (1), Moderate (2), Good (3) and Excellent (4) levels and COs need
not map all POS

Name of the Faculty: Prof.VINUTHA K

No. of Hours: 52

LESSON PLAN
Lecture
No

Learning
Objective

Topic to be covered

Remarks

Unit I
What operating systems do(user & sys
view), Computer System organization

Computer System architecture,


Operating System structure

Introduction to Operating Systems, System structures

Operating System operations; Process


management; Memory management;
Storage management
Protection and security; Distributed
system; Special-purpose systems;
Computing environments
Operating System Services; User Operating System interface; System calls
Types of system calls; System programs;
Operating System design and
implementation, Operating System
structure
Virtual machines; Operating System
generation; System boot

Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: OPERATING SYSTEM

SUBJECT CODE: 10CS53


UNIT II

Process concept; Process scheduling;


Operations on processes

Inter-process communication, Threading


Overview;

10
11

12

Process Management

Multithreading models; Thread Libraries


Threading issues, Process Scheduling:
Basic concepts
Scheduling criteria; Scheduling
algorithms

13

Scheduling algorithms

14

Multiple-Processor scheduling, Thread


scheduling.
UNIT III
Synchronization, The Critical section
problem

16

Petersons solution

17

Synchronization hardware

18

19

20

Process Synchronization

15

21

Semaphores (implementation, deadlock


and starvation)
Classical problems of synchronization:
bounded buffer problems
Classical problems of synchronization:
dining philosophers problem
Monitors

22
23

Deadlock
s

UNIT IV
Deadlocks: System model;
Deadlock characterization ,Methods for
handling deadlocks,

Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: OPERATING SYSTEM
24
Deadlock prevention

SUBJECT CODE: 10CS53

25

Deadlock avoidance: bankers algorithm

26

Deadlock detection

27

Recovery from deadlock


UNIT V
Memory Management Strategies:
Background;

29

Swapping; Contiguous memory


allocation;

30
31
32

33

Memory Management

28

Paging
Structure of page table; Segmentation
Virtual Memory Management:
Background; Demand paging
Copy-on-write; Page replacement
problems
UNIT VI

34

36
37
38
39

40

File System, Implementation of File System

35

File concept; Access methods


Directory structure
File system mounting; File sharing
Protection, File system structure
File system implementation
Directory implementation
Allocation methods; Free space
management.

Department of Information Science & Engineering, B M S Institute of Technology & Management

10

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: OPERATING SYSTEM

SUBJECT CODE: 10CS53


UNIT VII

Mass storage structures; Disk structure;


Disk attachment;

42

Disk scheduling

43

44

45

46

Secondary Storage Structures,


Protection

41

Disk management; Swap space


management
Goals of protection, Principles of
protection, Domain of protection
Access matrix, Implementation of access
matrix, Access control,
Revocation of access rights, CapabilityBased systems.

UNIT VIII
Linux history; Design principles, Kernel
modules

48
49
50
51
52

Case Study: The Linux


Operating System

47

Process management; Scheduling


Memory management
File systems
Input and output
Inter-process communication.

C) Course Assessment Procedure


Procedure for Internal Assessment
Best 2 out of 3 Tests
Maximum Marks for Internal Assessment

25

Procedure for External Assessment


Maximum Marks for Final Exam

100

Department of Information Science & Engineering, B M S Institute of Technology & Management

11

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: OPERATING SYSTEM

SUBJECT CODE: 10CS53

TOTAL

125

NOTE 4: The administration of the Final exam/s and their evaluation is carried out by VTU directly
and with little direct input from the College.
D) Other Important Details
D.1 Occupational Health & Safety (OH&S) Procedures
Since this course does not have a practical component, no need to undergo OH&S procedures

D.2 Ethics and Code of Conduct Policy


This course complies with the B M S Institute of Technology Policies on Ethics and Code of Conduct
as described in the website: www.bmsit.in/Ethics&CodeofConductPolicy.
Accordingly, plagiarism in any student submissions, copying during assessments of any form and other
such unethical practices will not be tolerated at any time and failure to follow the rules will result in
severe penalties, including exclusion from the College.
Course Materials Availability to Students and Others under the Right to Information Act (RTI)
of India
Materials
Course Objectives & Outcomes
Lecture notes & homes work
assignments, (mini)projects.
Sample solutions
Course performance (e.g., student
surveys, etc)

Students Assistants/Tutors Department/Higherups

Department of Information Science & Engineering, B M S Institute of Technology & Management

12

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: OPERATING SYSTEM

SUBJECT CODE: 10CS53

Question Bank
PART-A
UNIT-1
1. What are the three main purposes of an operating system?
2. What is the main advantage of multiprogramming?
3. What are the main differences between operating systems for mainframe computers and personal
computers?
4. Define the essential properties of the following types of operating systems:
a. Batch
b. Interactive
c. Time sharing
d. Real time
e. Network
f. Distributed
5.What are the differences between a trap and an interrupt? What is the use of each function?
6.What are the five major activities of an operating system in regard to process management?
7.What are the three major activities of an operating system in regard to secondary-storage management?
8.List five services provided by an operating system.
9.What is the main advantage of the layered approach to system design?
10. What is the main advantage for an operating-system designer of using a virtual-machine architecture?
11.What is the main advantage for a user?
UNIT-2
1. Describe the differences among short-term, medium-term, and long-term scheduling.
2. Describe the actions a kernel takes to context switch between processes.
3. What are two differences between user-level threads and kernel-level threads?
4. Describe the actions taken by a kernel to context switch between kernel-level threads.
5. What resources are used when a thread is created? How do they differ from those used when a process is
created?
6. Define the difference between preemptive and nonpreemptive scheduling
7. Consider the following set of processes, with the length of the CPU-burst time given in milliseconds:
Process Burst Time Priority P1 103
P2 11
P3 23
P4 14
P5 52
The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, all at time 0.
a. Draw four Gantt charts illustrating the execution of these processes using FCFS, SJF, a nonpreemptive
Department of Information Science & Engineering, B M S Institute of Technology & Management
13

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: OPERATING SYSTEM
SUBJECT CODE: 10CS53
priority (a smaller priority number implies a higher priority), and RR (quantum = 1) scheduling.
b. What is the turnaround time of each process for each of the scheduling algorithms in part a?
c. What is the waiting time of each process for each of the scheduling algorithms in part a?
d. Which of the schedules in part a results in the minimal average waiting time (over all processes)?
8. Suppose that the following processes arrive for execution at the times indicated. Each process will
run the listed amount of time. In answering the questions, use nonpreemptivescheduling and base
all decisions on the information you have at the time the decisionmust be made.
Process Arrival Time Burst Time P1 0.0 8 P2 0.4 4 P3 1.0 1
a. What is the average turnaround time for these processes with the FCFS scheduling
algorithm?
b.What is the average turnaround time for these processes with the SJF scheduling
algorithm?
c. The SJF algorithm is supposed to improve performance, but notice that we chose to run process P1 at time
0 because we did not know that two shorter processes would arrive soon. Compute what the average
turnaround time will be if the CPU is left idle for the first 1 unit and then SJF scheduling is used. Remember
that processes P1 and P2 are waiting during this idle time, so their waiting time may increase. This algorithm
could be known as future-knowledge scheduling.

UNIT-3
1. What is the meaning of the term busy waiting?
2. Explain semaphores with the help of an example.
3. Explain dining philosophers problem, and how it is solved.
4. What is race condition? Explain how it is handled.
5. Define process synchronization.
6. How is producer-consumer problem with the help of semaphores?

UNIT-4
For the following snapshot of the system find the safe sequence (using Bankersalgorithm).
a. Calculate the need of each process?
b. To find safe sequence?
2. Consider the following snapshot of the system and answer the following questions using
Bankersalgorithm?

a. Find the need of the allocation?


b. Is the system is in safe state?
Department of Information Science & Engineering, B M S Institute of Technology & Management

14

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: OPERATING SYSTEM
SUBJECT CODE: 10CS53
c. If the process P1 request (0,4,2,0) resources cam the request be granted immediately?
3. The operating system contains three resources. The numbers of instances of each resource type are (7, 7,
10). The current allocation state is given below.
a. Is the current allocation is safe?
b. find need?
c. Can the request made by the process P1(1,1,0) can be granted?

4. Explain different methods to recover from deadlock?


5. Write advantage and disadvantage of deadlock avoidance and deadlock prevention?

UNIT-5
1. Name two differences between logical and physical addresses.
2. Explain the difference between internal and external fragmentation.
3. Describe the following allocation algorithms:
a. First fit
b. Best fit
c. Worst fit
4. Given memory partitions of 100K, 500K, 200K, 300K, and 600K (in order), how would each of the
Firstfit,
Best-fit, and Worst-fit algorithms place processes of 212K, 417K, 112K, and 426K (in order)? Which
algorithm makes the most efficient use of memory?
5. Why are page sizes always powers of 2?
6. Consider a logical address space of eight pages of 1024 words each, mapped onto a physical memory of
32 frames.
a. How many bits are there in the logical address?
b. How many bits are there in the physical address?
7. Why are segmentation and paging sometimes combined into one scheme?
8. Under what circumstances do page faults occur? Describe the actions taken by the operating system
when a page fault occurs.
9. Which of the following programming techniques and structures are good for a demand paged
environment ?
10. Which are not good? Explain your answers.
a. Stack
b. Hashed symbol table
c. Sequential search
d. Binary search
Department of Information Science & Engineering, B M S Institute of Technology & Management

15

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: OPERATING SYSTEM
SUBJECT CODE: 10CS53
e. Pure code
f. Vector operations
g. Indirection
10. Consider the following page-replacement algorithms. Rank these algorithms on a Five point
scale from bad to perfect according to their page-fault rate. Separate those algorithms
that suffer from Beladys anomaly from those that do not.
a. LRU replacement
b. FIFO replacement
c. Optimal replacement d. Second-chance replacement

UNIT-6
1. Explain the purpose of the open and close operations.
2. Give an example of an application in which data in a file should be accessed in the following order:
a. Sequentially
b. Randomly
3. In some systems, a subdirectory can be read and written by an authorized user, just as ordinary files can
be.
a. Describe the protection problems that could arise.
b. Suggest a scheme for dealing with each of the protection problems you named in part a.
4. What is a file?
5. List sample file types, based on use, on the VAX under VMS.
6. What is a sequential file?
7. Can a direct access file be read sequentially? Explain.
8. List two types of system directories
9. List operations to be performed on directories
10. How do we overcome the disadvantages of the two-level directory?

UNIT-7
1. What are the main differences between capability lists and access lists?
2. What hardware features are needed for efficient capability manipulation? Can these be used for memory
protection? What protection problems may arise if a shared stack is used for parameter passing?
3. What is the need-to-know principle? Why is it important for a protection systemto adhere to this
principle?
4. Why is it difficult to protect a system in which users are allowed to do their own I/O?
5.. Describe how the Java protection model would be sacrificed if a Java program were allowed to directly
alter the annotations of its stack frame. What are two advantages of encrypting data stored in the
computer system.

UNIT-8
1.What are the main differences between capability lists and access lists?
Department of Information Science & Engineering, B M S Institute of Technology & Management

16

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: OPERATING SYSTEM
SUBJECT CODE: 10CS53
2. What hardware features are needed for efficient capability manipulation? Can these be used for memory
protection? What protection problems may arise if a shared stack is used for parameter passing?
3. What is the need-to-know principle? Why is it important for a protection systemto adhere to this
principle?
4.Why is it difficult to protect a system in which users are allowed to do their own I/O?
5. Describe how the Java protection model would be sacrificed if a Java program were allowed to directly
alter the annotations of its stack frame. What are two advantages of encrypting data stored in the computer
system.

Department of Information Science & Engineering, B M S Institute of Technology & Management

17

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
COUSE FILE (Dr. Manjunath T. N) / SUBJECT NAME: DBMS

SUBJECT CODE: 10CS54

Vision of the Institute


To emerge as one of the finest technical institutions of higher learning to develop engineering
professionals who are technically competent, ethical and environment friendly for betterment
of society.
Mission of the Institute
Accomplish stimulating learning environment through high quality academic instruction,
innovation and industry-institute interface.

Department of Information Science and Engineering


Vision of the Department
Emerge as one of the premier department of higher learning and research in Information
Technology
Mission of the Department
1. To provide excellence in technical education through contemporary teaching learning
process .
2. To inculcate ethical values, leadership abilities, and research capabilities towards
progress of society
Program Educational Objectives:
Graduates of the program will,
PEO1

Equip with required knowledge and skills to resolve business problems to


provide reliable and secure IT solutions.

PEO2

Encourage and participate in multi-disciplinary environments

PEO3

Maintain ethical conduct and engage in lifelong learning in response to the


contemporary needs of the society.

Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
COUSE FILE (Dr. Manjunath T. N) / SUBJECT NAME: DBMS

SUBJECT CODE: 10CS54

PROGRAMME OUTCOMES
Program outcomes are narrower statements that describe what students are expected to know and be able to do
by the time of graduation. These relate to the skills, knowledge and behavior. Bachelor of Engineering
Graduation students of Information Science & Engineering program at B M S Institute of Technology will
attain the following program outcomes.

Program Outcomes:
After the successful completion of the course, the graduate will be able to

PO1: Engineering knowledge: Apply the knowledge of mathematics, science, engineering fundamentals, and
an engineering specialization to the solution of complex engineering problems.
PO2: Problem analysis: Identify, formulate, review research literature, and analyze complex engineering
problems reaching substantiated conclusions using first principles of mathematics, natural sciences, and
engineering sciences.
PO3: Design/development of solutions: Design solutions for complex engineering problems and design
system components or processes that meet the specified needs with appropriate consideration for the public
health and safety, and the cultural, societal, and environmental considerations.
PO4: Conduct investigations of complex problems: Use research-based knowledge and research methods
including design of experiments, analysis and interpretation of data, and synthesis of the information to
provide valid conclusions.
PO5: Modern tool usage: Create, select, and apply appropriate techniques, resources, and modern
engineering and IT tools including prediction and modeling to complex engineering activities with an
understanding of the limitations.
PO6: The engineer and society: Apply reasoning informed by the contextual knowledge to assess societal,
health, safety, legal and cultural issues and the consequent responsibilities relevant to the professional
engineering practice.
PO7: Environment and sustainability: Understand the impact of the professional engineering solutions in
societal and environmental contexts, and demonstrate the knowledge of, and need for sustainable
development.
Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
COUSE FILE (Dr. Manjunath T. N) / SUBJECT NAME: DBMS

SUBJECT CODE: 10CS54

PO8: Ethics: Apply ethical principles and commit to professional ethics and responsibilities and norms of the
engineering practice.
PO9: Individual and team work: Function effectively as an individual, and as a member or leader in diverse
teams, and in multidisciplinary settings.
PO10: Communication: Communicate effectively on complex engineering activities with the engineering
community and with society at large, such as, being able to comprehend and write effective reports and design
documentation, make effective presentations, and give and receive clear instructions.
PO11: Project management and finance: Demonstrate knowledge and understanding of the engineering and
management principles and apply these to ones own work, as a member and leader in a team, to manage
projects and in multidisciplinary environments.
PO12: Life-long learning: Recognize the need for, and have the preparation and ability to engage in
independent and life-long learning in the broadest context of technological change.

A) Course Administrator Details


Course Title

Course Code

10CS54

DataBase Management System

Lecture
Contact Hours/ week

Department
Name of the faculty with
Designation and mail ID

Core/Elective

Core

Tutorials

Semester

Year

2016

Practical

Information Science and Engineering

Dr. Manjunath T.N


Professor
Manju.tn@bmsit.in

Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
COUSE FILE (Dr. Manjunath T. N) / SUBJECT NAME: DBMS

Prerequisites for the Course


(exemption from the prerequisites
is provided only in exceptional
circumstances)
.

SUBJECT CODE: 10CS54

1. Relations and Functions


2. Set Theory

B)Course Related Specifics


Syllabus (from VTU manual www.vtu.in)

Subject: DataBase Management System


Subject Code: 10CS54
I.A. Marks:
52
Hours/Week:
4
Exam Hours: 03
Total Hours :
52
Exam Marks: 100
SYLLABUS

PART - A
UNIT 1

6 Hours

Introduction: Introduction; An example; Characteristics of Database approach; Actors on the screen;


Workers behind the scene; Advantages of using DBMS approach; A brief history of database
applications; when not to use a DBMS. Data models, schemas and instances; Three-schema
architecture and data independence; Database languages and interfaces; The database system
environment; Centralized and client-server architectures; Classification of Database Management
systems.

UNIT 2

6 Hours

Entity-Relationship Model: Using High-Level Conceptual Data Models for Database Design; An
Example Database Application; Entity Types, Entity Sets, Attributes and Keys; Relationship types,
Relationship Sets, Roles and Structural Constraints; Weak Entity Types; Refining the ER Design;
ER Diagrams, Naming Conventions and Design Issues; Relationship types of degree higher than
two.

UNIT 3

8 Hours

Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
COUSE FILE (Dr. Manjunath T. N) / SUBJECT NAME: DBMS

SUBJECT CODE: 10CS54

Relational Model and Relational Algebra : Relational Model Concepts; Relational Model
Constraints and Relational Database Schemas; Update Operations, Transactions and dealing with
constraint violations; Unary Relational Operations: SELECT and PROJECT; Relational Algebra
Operations from Set Theory; Binary Relational Operations : JOIN and DIVISION; Additional
Relational Operations; Examples of Queries in Relational Algebra; Relational Database Design
Using ER- to-Relational Mapping.

UNIT 4

6 Hours

SQL 1: SQL Data Definition and Data Types; Specifying basic constraints in SQL; Schema
change statements in SQL; Basic queries in SQL; More complex SQL Queries.
PART - B

UNIT 5

6 Hours

SQL 2 : Insert, Delete and Update statements in SQL; Specifying constraints as Assertion and
Trigger; Views (Virtual Tables) in SQL; Additional features of SQL; Database programming issues
and techniques;
Embedded SQL, Dynamic SQL; Database stored procedures and SQL / PSM.

UNIT 6

6 Hours

Database Design 1: Informal Design Guidelines for Relation Schemas; Functional Dependencies;
Normal Forms Based on Primary Keys; General Definitions of Second and Third Normal Forms;
Boyce-Codd Normal Form

UNIT 7

6 Hours

Database Design -2: Properties of Relational Decompositions; Algorithms for Relational Database
Schema Design; Multivalued Dependencies and Fourth Normal Form; Join Dependencies and Fifth
Normal Form; Inclusion Dependencies; Other Dependencies and Normal Forms

UNIT 8

8 Hours

Transaction Management: The ACID Properties; Transactions and Schedules; Concurrent Execution
of Transactions; Lock- Based Concurrency Control; Performance of locking; Transaction support in
SQL; Introduction to crash recovery; 2PL, Serializability and Recoverability; Lock Management;
Introduction to ARIES; The log; Other recovery-related structures; The write-ahead log protocol;
Checkpointing; Recovering from a System Crash; Media Recovery; Other approaches and
interaction with concurrency control.

Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
COUSE FILE (Dr. Manjunath T. N) / SUBJECT NAME: DBMS

SUBJECT CODE: 10CS54

LABORATORY WORK
The following experiments should be practiced:
1.
2.
3.
4.

To Introduce the concept of database and file systems

To give an understanding of basic Entity relationship model


for database design

Course Objectives

To familiarize the student with relational algebra for


database design.
To impart the knowledge of structured query language
commands

To provide knowledge of normalization process for database


optimization

To understand the importance of transaction management


and issues related to transaction management.
Recommended Text Books:

1. Elmasri and Navathe: Fundamentals of Database Systems, 5th Edition, Pearson


Education, 2007.
(Chapters 1, 2, 3 except 3.8, 5, 6.1 to 6.5, 7.1, 8, 9.1, 9.2 except SQLJ, 9.4, 10)
2. Raghu Ramakrishnan and Johannes Gehrke: Database Management Systems, 3rd
Edition, McGraw-Hill, 2003.
(Chapters 16, 17.1, 17.2, 18)
Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
COUSE FILE (Dr. Manjunath T. N) / SUBJECT NAME: DBMS

SUBJECT CODE: 10CS54

Reference Books:
1. Silberschatz, Korth and Sudharshan: Data base System Concepts, 6th Edition, McGrawHill, 2010.
2. C.J. Date, A. Kannan, S. Swamynatham: An Introduction to Database Systems, 8th
Edition, Pearson Education, 2006.
Recommended Reference Materials:
1. Notes
2. PPT
3. Videos

Web Resources:

CO1
CO2
CO3

Understand the concepts of file system and database systems.


Demonstrate the Entity relationship model for database design
Illustrate the use of relational algebra for database design.

CO4
CO5
CO6

Master the Structured Query Language Commands.


Apply the normalization process for database design optimization.
Understand the transaction management issues.

Course Outcomes-Program Outcomes mapping:


COS/
POS

Program Outcomes
PO1

PO2

PO3

CO1

PO4

PO5

PO6

PO7

PO8

PO9

PO10

PO11

PO12

Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
COUSE FILE (Dr. Manjunath T. N) / SUBJECT NAME: DBMS
CO2

CO3

CO4

CO5

CO6

SUBJECT CODE: 10CS54

2
NOTE: Mapping in terms of Slight (1), Moderate (2), Good (3) and Excellent (4) levels and COs need not
map all POS

Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
COUSE FILE (Dr. Manjunath T. N) / SUBJECT NAME: DBMS
Name of the Faculty: Dr.Manjunath T N

SUBJECT CODE: 10CS54


No.of.Hours: 52

LESSON PLAN
Lecture
No

Learning
Objective

Topic to be covered

Remarks

UNIT I

Introduction; An example;

Unit-1: Introduction to Database

Characteristics of Database approach;


Actors on the screen
Workers behind the scene,Advantages
of using DBMS approach
A brief history of database
applications; when not to use a
DBMS.
Data models, schemas and instances

Three-schema architecture and data


independence

Database languages and interfaces;


The database system environment

10

11

To understand ER Model

UNIT II

Using High-Level Conceptual Data


Models for Database Design
An Example Database Application;
Entity Types, Entity Sets.
Attributes and Keys; Relationship
types, Relationship Sets, Roles and
Structural Constraints.
Weak Entity Types; Refining the ER
Design.

Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
COUSE FILE (Dr. Manjunath T. N) / SUBJECT NAME: DBMS
12

ER Diagrams, Naming Conventions


and Design Issues;

13

Relationship types of degree higher


than two.

SUBJECT CODE: 10CS54

UNIT III

15

Transactions and dealing with


constraint violations;

16

Unary Relational Operations:


SELECT and PROJECT

17

18

19

To understand Relational algebra

14

Relational Model Concepts &


Constraints and Relational Database
Schemas; Update Operations

SELECT and PROJECT; Relational


Algebra Operations from Set Theory,
JOIN and DIVISION
Additional Relational Operations,
Examples of Queries in Relational
Algebra.
Relational Database Design Using
ER- to-Relational Mapping.
UNIT IV

SQL Data Definition and Data Types

21

Specifying basic constraints in SQL

22
23
24
25
26

To understand SQL Scripting


Language

20

Schema change statements in SQL


Basic queries in SQL
More complex SQL Queries
SQL Data Definition and Data Types
Specifying basic constraints in SQL

Department of Information Science & Engineering, B M S Institute of Technology & Management

10

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
COUSE FILE (Dr. Manjunath T. N) / SUBJECT NAME: DBMS

SUBJECT CODE: 10CS54

Specifying basic constraints in SQL

28

Insert, Delete and Update statements


in SQL;

29

30

31
32
33

To Understand the advanced SQL Scripting

27

Specifying constraints as Assertion


and Trigger;
Views (Virtual Tables) in SQL;
Additional features of SQL;
Database programming issues and
techniques;
Embedded SQL, Dynamic SQL;
Database stored procedures and SQL
/PSM
UNIT VI

Informal Design
Relation Schemas

35

Functional Dependencies

36

Normal Forms Based on Primary


Keys

37

38

39

To understand DB design issues

34

Guidelines

for

General Definitions of Second and


Third Normal Forms

Boyce-Codd Normal Form

Boyce-Codd Normal Form with


example

Department of Information Science & Engineering, B M S Institute of Technology & Management

11

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
COUSE FILE (Dr. Manjunath T. N) / SUBJECT NAME: DBMS
UNIT VII

SUBJECT CODE: 10CS54

40

Properties
of
Decompositions.

42

Algorithms for Relational Database


Schema Design.

43

44
45

46

To Understand the DB advanced Isssues

41

Relational

Multivalued Dependencies and Fourth


Normal Form.
Join Dependencies and Fifth Normal
Form.
Inclusion Dependencies;
Other Dependencies and Normal
Forms & Properties of Relational
Decompositions;
UNIT VIII

The ACID Properties

48

Transactions and Schedules;

49

Concurrent Execution of
Transactions;

50

Lock- Based Concurrency Control;


Performance of locking;

51

52

To understand transaction system

47

2PL, Serializability and


Recoverability; Lock Management;
Introduction to ARIES; The log;
Other recovery-related structures;
The write-ahead log protocol; Check
pointing; Recovering from a System
Crash; Media Recovery; Other
approaches and interaction with
concurrency control

Department of Information Science & Engineering, B M S Institute of Technology & Management

12

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
COUSE FILE (Dr. Manjunath T. N) / SUBJECT NAME: DBMS

SUBJECT CODE: 10CS54

C) Course Assessment Procedure


Procedure for Internal Assessment
Best 2 out of 3 Assignments
Best 2 out of 3 Tests
Best 2 out of 3 Quizzes
Best 2 out of 3 (Name Assessment)

10%
50%
30%
10%

Maximum Marks for Internal Assessment

25

Procedure for External Assessment


Maximum Marks for Final Exam

100

TOTAL

125

NOTE 4: The administration of the Final exam/s and their evaluation is carried out by VTU directly
and with little direct input from the College.
D) Other Important Details
D.1 Occupational Health & Safety (OH&S) Procedures
Since this course has a practical component, students are required to undergo OH&S training PRIOR TO
ENTERING the laboratory. Students must undergo this training every year for use of this laboratory and their
successful completion will be documented. Students must follow the OH&S procedures meticulously and
failure to follow them will result in severe penalties, including exclusion from the College.
NOTE 5: Health and safety procedures have to be printed and displayed in the labs.

D.2 Ethics and Code of Conduct Policy


This course complies with the B M S Institute of Technology Policies on Ethics and Code of Conduct as
described in the website: www.bmsit.in/Ethics&CodeofConductPolicy.
Accordingly, plagiarism in any student submissions, copying during assessments of any form and other such
unethical practices will not be tolerated at any time and failure to follow the rules will result in severe
penalties, including exclusion from the College.
NOTE 6 D.2 to be included for all courses.
Department of Information Science & Engineering, B M S Institute of Technology & Management

13

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
COUSE FILE (Dr. Manjunath T. N) / SUBJECT NAME: DBMS

SUBJECT CODE: 10CS54

Course Materials Availability to Students and Others under the Right to Information Act (RTI) of
India

Materials
Course Objectives & Outcomes
Lecture notes & homes work assignments,
(mini)projects.
Sample solutions
Course performance (e.g., student surveys, etc)

Students Assistants/Tutors Department/Higherups

Question Bank
UNIT 1
1. What are the responsibilities of DBA and Database designer? (04 marks Dec 2013)
2. With a diagram explain the components modules of DBMS and their interactions.
(08 marks Dec 2013)
3. List the advantages and disadvantages of DBMS. Discuss any five advantages by
comparing with file systems.
(08 marks Dec 2013)
4. Define the following with examples

(10 marks Dec 2012)

Value set, Complex attribute, Data Model, Schema, Metadata


5. List and explain the main characteristics of database approach.(07 marks Dec2011)
6. Discuss the different types of user- friendly interfaces and the types of users who
typically use each.
UNIT 2
1. Define the following terms: Recursive relationship, weak entity type, Attribute,
Participation Role
(04 marks Dec 2013)
Department of Information Science & Engineering, B M S Institute of Technology & Management

14

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
COUSE FILE (Dr. Manjunath T. N) / SUBJECT NAME: DBMS

SUBJECT CODE: 10CS54

2. Discuss the conventions for displaying an ER schema as an ER diagram


(04 marks Dec 2013)
3. Draw an ER diagram for musicians who perform for album. Assume any 4 entities.
Indicate all keys and cardinality constraints and any assumptions that are made.
(12 marks Dec 2013)
4. Define and explain a partial key, with example.

(04 marks Dec 2011)

5. Draw an ER diagram for maintain a movie database taking into account at least four
entities.
(10 marks Dec 2013)
UNIT 3
1. What do you mean by recursive relationship? Can a foreign key exist, only for a single
table? Explain
(04 marks Dec 2011)
2. What is meant by integrity constraint? Explain the importance of referential integrity
constraint. How referential integrity constraint is implemented in SQL.
(10 marks Dec 2012)
3. Consider the following schema and write the relational algebra(10 marks Dec 2012)
SAILOR (SID, SNAME, RATING, AGE)
BOATS (BID, BNAME, COLOR)
RESERVE (SID, BID, DAY)
i.

Retrieve the sailors names who have reserved red green boats.

ii.

Retrieve the sailors names with age over 20years and reserved black boat.

iii.

Retrieve the sailors names who have reserved green boat on Monday

iv.

Retrieve the sailors names who is the oldest sailor with rating 10.

Department of Information Science & Engineering, B M S Institute of Technology & Management

15

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
COUSE FILE (Dr. Manjunath T. N) / SUBJECT NAME: DBMS

v.

SUBJECT CODE: 10CS54

Retrieve the number of boats which are not reserved.

4. How can an interaction operator be implemented using union and minus operator?
(03 marks Dec 2011)

5. Write a queries in relational algebra for the following

(12 marks Dec 2011)

i.

Retrieve the number of dependents for an employee named Ram

ii.

Retrieve the name of the managers working in location named XYZ who has
no female dependents.

iii.

Retrieve the names of employee who works in the same department as that of
Raj

UNIT 4
1. Explain all possible options that can be specified when a referential integrity constraint
is violated using suitable examples for all options. (08 marks Dec 2011)
2. Write queries in SQL for the following.

(12 marks Dec 2011)

Employee (Name, SSN, Salary, Super SSN, DNo)


Department (DNum, Dname, MgrSSN)
Dept-Locations (DNum, Dlocation)
Work ON (ESSN, PNo, Hours)
Dependent (ESSN, Dep Name, Sex)
i.

Retrieve the name of the employee who gets second highest salary

ii.

For each department that has more than five employees, retrieve the department
number of its employee who have salary more than Rs.5000

Department of Information Science & Engineering, B M S Institute of Technology & Management

16

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
COUSE FILE (Dr. Manjunath T. N) / SUBJECT NAME: DBMS

iii.

SUBJECT CODE: 10CS54

Retrieve the name of employees whose salary is greater than all the employees
working in either department 5 or 6

3. Consider the following schema and write the SQL queries

(10 marks Dec 2011)

STUDENT (STUDENT_ID, SNAME, MAJOR, GPA)


FACULTY (FACULTY_ID, FNAME, DEPT, DESIGNATION, SALARY)
COURSE (COURSE_ID, CNAME, FACULTY_ID)
ENROLL (COURSE_ID, STUDENT_ID, GRADE)
i.

Retrieve the student name who is studying under faculties of Mechanical dept.

ii.

Retrieve the student name who have enrolled under any of the courses in which
Kumar has enrolled

iii.

Retrieve the faculties name who earn salary which is greater than the average salary of
all the faculties

iv.

Retrieve the sname who are not been taught by faculty Kumar

v.

Retrieve the faculty names who are assistant professors of CS department.

4. Describe the six clauses in the syntax of SQL. Retrieval Query .Show what type of
constructs can be specified in each of the six clauses. Which of the six clauses is
required and which are optional.
(06 marks Dec 2013)
5. Explain how the group by clause works. What is the difference between the where and
Having clause?
(06 marks Dec 2013)
UNIT 5
1. List the differences between independent nested and co- related nested query.
(04 marks Dec 2013)

Department of Information Science & Engineering, B M S Institute of Technology & Management

17

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
COUSE FILE (Dr. Manjunath T. N) / SUBJECT NAME: DBMS

SUBJECT CODE: 10CS54

2. Discuss main approaches to database programming. What you mean by impedance


mismatch.
(08 marks Dec 2013)
3. With program segment, explain retrieving of tuples with embedded SQL.
(08 marks Dec 2013)
4. How is view created and dropped? What problems are associated with updating views?
(08 marks Dec 2012)
5. How are trigger and assertions defined in SQL? Explain.

(06 marks Dec 2012)

6. Explain the concept of stored procedure in brief.

(06 marks Dec 2012)

7. Discuss the significance of an assertion. Write an assertion to specify a constraint such


constraint such that the salary of an employee must not be greater than the salary of the
manager of the department that employee works for in SQL. (08 marks Dec 2013)

UNIT 6
1. Suggest and Explain three different techniques to achieve 1NF using a suitable example.
(08 marks Dec 2011)
2. Differentiate between prime and non-prime attribute, with example. (04 marks Dec
2011)
3. Consider the relation R(A,B,C,D,E,F) and the FD A->B, C-> DF,AC-> E,D-> F. what is
the key and highest normal from of R? If it is not in 3NF find a decomposition that is
lossless and dependency preserving? (08 marks Dec 2011)
4. Consider R={ABCDEF}; FDS {A->BC,C->E,CD->EF} show that AD->F
marks Dec 2012)
Department of Information Science & Engineering, B M S Institute of Technology & Management

(06

18

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
COUSE FILE (Dr. Manjunath T. N) / SUBJECT NAME: DBMS

SUBJECT CODE: 10CS54

5. What is the set of functional dependencies F said to be minimal? Give an algorithm for
finding a minimal cover G for F. (06 marks Dec 2012)
6. What do you mean by closure of attribute? Write an algorithm to find closure of
attributes.
(06 marks Dec 2013)

UNIT 7
1. What is dependency preservation property for decomposition? Why is it important?
(06 marks Dec 2013)
2. Define fourth normal form. When is it violated? Why is it useful? (06 marks Dec 2013)
3. Consider the following universal relation

(08 marks Dec 2013)

R={A,B,C,D,E,F,G,H,I,J} and a set of function dependencies.


F={{A,B}->C, A->{D,E}, B-> F, F->{G,H},D->{I,J}}what is the key of R? Decompose R
into 2NF, then 3NF relations.
4. Which normal form is based on the concept of multivalued functional dependency?
Explain the same with example. (10 marks Dec 2011)
5. Consider R={ABCDEF}
FDS{ AB->CD,A->CF,B->F,BGD->F,D->E,DE->F}
Find an irreducible cover for this set of FDs

(06 marks Dec 2012)

6. Explain the properties of Relational Decomposition.

(06 marks Dec 2012)

UNIT 8
1. What are anomalies occur due to interleave execution? Explain them with example.
(08 marks Dec 2013)

Department of Information Science & Engineering, B M S Institute of Technology & Management

19

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
COUSE FILE (Dr. Manjunath T. N) / SUBJECT NAME: DBMS

SUBJECT CODE: 10CS54

2. Describe the steps in crash recovery in Aries. What is the goal of each phase?
(04 marks Dec 2013)
3. Write short notes on :

(20 marks Dec 2011)

i.

Time stamp ordering algorithm

ii.

ARIES algorithm

iii.

Embedded SQL

iv.

Fifth normal form.

4. What are ACID properties? Explain.

(06 marks Dec 2011)

5. What is a schedule? Explain with example conflict serializable schedule. (08 marks Dec
2011)

6. What is two phase locking protocol? How does it guarantee serializability?


marks Dec 2013)

Department of Information Science & Engineering, B M S Institute of Technology & Management

(06

20

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering

SUBJECT NAME: COMPUTER NETWORKS -1

SUBJECT CODE: 10CS55

Vision of the Institute


To emerge as one of the finest technical institutions of higher learning to develop
engineering professionals who are technically competent, ethical and environment
friendly for betterment of society.
Mission of the Institute
Accomplish stimulating learning environment through high quality academic
instruction, innovation and industry-institute interface.

Department of Information Science and Engineering


Vision of the Department
Emerge as one of the premier department of higher learning and research in
Information Technology
Mission of the Department
1. To provide excellence in technical education through contemporary teaching
learning process .
2. To inculcate ethical values, leadership abilities, and research capabilities towards
progress of society
Program Educational Objectives:
Graduates of the program will,
PEO1

Equip with required knowledge and skills to resolve business problems to


provide reliable and secure IT solutions.

PEO2

Encourage and participate in multi-disciplinary environments

PEO3

Maintain ethical conduct and engage in lifelong learning in response to the


contemporary needs of the society.

Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering

SUBJECT NAME: COMPUTER NETWORKS -1


PROGRAMME OUTCOMES

SUBJECT CODE: 10CS55

Program outcomes are narrower statements that describe what students are expected to know and be
able to do by the time of graduation. These relate to the skills, knowledge and behavior. Bachelor of
Engineering Graduation students of Information science and Engineering program at B M S Institute
of Technology will attain the following program outcomes.

Program Outcomes:
After the successful completion of the course, the graduate will be able to

PO1: Engineering knowledge: Apply the knowledge of mathematics, science, engineering


fundamentals, and an engineering specialization to the solution of complex engineering problems.
PO2: Problem analysis: Identify, formulate, review research literature, and analyze complex
engineering problems reaching substantiated conclusions using first principles of mathematics, natural
sciences, and engineering sciences.
PO3: Design/development of solutions: Design solutions for complex engineering problems and
design system components or processes that meet the specified needs with appropriate consideration
for the public health and safety, and the cultural, societal, and environmental considerations.
PO4: Conduct investigations of complex problems: Use research-based knowledge and research
methods including design of experiments, analysis and interpretation of data, and synthesis of the
information to provide valid conclusions.
PO5: Modern tool usage: Create, select, and apply appropriate techniques, resources, and modern
engineering and IT tools including prediction and modeling to complex engineering activities with an
understanding of the limitations.
PO6: The engineer and society: Apply reasoning informed by the contextual knowledge to assess
societal, health, safety, legal and cultural issues and the consequent responsibilities relevant to the
professional engineering practice.
PO7: Environment and sustainability: Understand the impact of the professional engineering
solutions in societal and environmental contexts, and demonstrate the knowledge of, and need for
Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering

SUBJECT NAME: COMPUTER NETWORKS -1


sustainable development.

SUBJECT CODE: 10CS55

PO8: Ethics: Apply ethical principles and commit to professional ethics and responsibilities and norms
of the engineering practice.
PO9: Individual and team work: Function effectively as an individual, and as a member or leader in
diverse teams, and in multidisciplinary settings.
PO10: Communication: Communicate effectively on complex engineering activities with the
engineering community and with society at large, such as, being able to comprehend and write effective
reports and design documentation, make effective presentations, and give and receive clear instructions.
PO11: Project management and finance: Demonstrate knowledge and understanding of the
engineering and management principles and apply these to ones own work, as a member and leader in
a team, to manage projects and in multidisciplinary environments.
PO12: Life-long learning: Recognize the need for, and have the preparation and ability to engage in
independent and life-long learning in the broadest context of technological change.
A) Course Administrator Details

Course Title

Course Code

COMPUTER NETWORKS - 1

10CS55

Lecture
Contact Hours/ week

Core/Elective

Core

Tutorials

52

Semester

Year

V SEM

2016

Practical

Department

Information Science and Engineering

Name of the faculty with


Designation and mail ID

Gireesh Babu C N

Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering

SUBJECT NAME: COMPUTER NETWORKS -1


Assistant Professor

SUBJECT CODE: 10CS55

gireeshbabu@bmsit.in

Prerequisites for the Course 1.Students should possess the knowledge of Computers and its parts
(exemption from the prerequisites2. Basics of Network concepts.
is provided only in exceptional
circumstances)

B) Course Related Specifics


Syllabus (from VTU manual www.vtu.in)

Subject Code:
Hours/Week: 4
Total Hours : 52

Subject: Computer Networks - 1


10CS55

I.A. Marks: 25
Exam Hours: 3
Exam Marks: 100

SYLLABUS
PART A
UNIT 1:

7 Hours

Introduction: Data Communications, Networks, The Internet, Protocols & Standards,


Tasks, The OSI model, Layers in OSI model, TCP/IP Protocol suite, Addressing.

UNIT 2:

Layered

7 Hours

Physical Layer-1: Analog & Digital Signals, Transmission Impairment, Data Rate limits,
Performance, Digital-digital conversion (Only Line coding: Polar, Bipolar and Manchester
coding), Analog-to-digital conversion (only PCM), Transmission Modes, Digital-to -analog
conversion

Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering

SUBJECT NAME: COMPUTER NETWORKS -1

SUBJECT CODE: 10CS55

UNIT 3:

6 Hours

Physical Layer-2 and Switching: Multiplexing, Spread Spectrum, Introduction to switching,


Circuit Switched Networks, Datagram Networks, Virtual Circuit Networks.

UNIT 4:

6 Hours

Data Link Layer-1: Error Detection & Correction: Introduction, Block coding, linear block codes,
cyclic codes, Checksum.

PART B
UNIT 5:

07 Hours

Data Link Layer-2:Framing, Flow and Error Control, Protocols, Noiseless Channels, Noisy
channels, HDLC, PPP (Framing, Transition phases only)

UNIT 6:

06 Hours

Multiple Access & Ethernet: Random access, Controlled Access, Channelization, Ethernet: IEEE
standards, Standard Ethernet, Changes in the standard, Fast Ethernet, Gigabit Ethernet.

UNIT 7:

07 Hours

Wireless LANs and Cellular Networks: Introduction, IEEE 802.11, Bluetooth, Connecting devices,
Cellular Telephony.

UNIT 8:

7 Hours

Network Layer: Introduction, Logical addressing, IPv4 addresses, and IPv6 addresses, Internetwork
ing basics, IPv4, IPv6, Comparison of IPv4 and IPv6 Head ers.

Course Objectives

To provide knowledge about various types of


networking, networks, network topologies
Basics of Network Management.

Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering

SUBJECT NAME: COMPUTER NETWORKS -1

SUBJECT CODE: 10CS55


Concepts of OSI reference model and real world
protocol suite such as TCP/IP
Outline the basic network configurations.

Recommended Text Books:


1. Behrouz A. Forouzan,: Data Communication and Networking, 4 t h Edition Tata McGrawHill, 2006. (Chapters 1.1 to 1.4, 2.1 to 2 .5, 3.1 To 3.6, 4.1 to 4.3, 5.1, 6.1, 6.2, 8.1 to 8 .3, 10.1
to 10.5, 11.1 to 11 .7, 12.1 to 1 2.3, 13.1 to 13.5, 14.1, 14.2,15.1, 16.1, 19.1, 19.2, 20.1 to 20.3)

Recommended Reference Materials:


1. Alberto Leon-Garcia and IndraWidjaja: Communication Networks -Fundamental
Concepts and Key architectures, 2ndEdition TataMcGraw-Hill, 2004.
2. William Stallings: Data and Computer Co mmunication, 8th Edition,Pearson Education,
2007.
3. Larry L. Peterson and Bruce S. Davie: Computer Networks A Systems Approach, 4th
Edition, Elsevier, 2007.
4. Nader F. Mir: Computer andCommunication Network s, Pearson Education, 2007
5.Notes
6.PPTs

Web Resources:
1.VTU e-Learning
2.Youtube Videos on Networking
3.NPTEL Materials

Course Outcomes
CO1: Demonstrate the fundamental concepts of data communication
Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering

SUBJECT NAME: COMPUTER NETWORKS -1

SUBJECT CODE: 10CS55

CO2: Understand the functionalities of OSI/TCP-IP models


CO3: Understand the data representation and data handling in the network.
CO4: Identify the different types of network topologies, network devices and their functions
CO5: Apply the knowledge of different techniques during data transmission
CO6: Acquire the knowledge on wireless and cellular networks

Course Outcomes - Program Outcomes mapping:


COS/
POS

Program Outcomes
PO1

PO2

PO3

PO4

PO5

PO6

PO7

PO8

CO1

CO2

CO3

CO4

CO5

CO6

PO9

PO10

PO11

PO12

NOTE: Mapping in terms of Slight (1), Moderate (2), Good (3) and Excellent (4) levels and COs
need not map all POS

Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering

SUBJECT NAME: COMPUTER NETWORKS -1

SUBJECT CODE: 10CS55

Name of the Faculty: GIREESH BABU C N

No. of Hours: 52

LESSON PLAN
Lecture
No

Learning
Objective

Topic to be covered

Remarks

UNIT I
1

Data Communications, Networks

The Internet, Protocols and Standards

Layered Tasks, The OSI Model


Introduction

The Layers in the OSI Model

The Layers in the OSI Model

TCP/IP Protocol Suite

Addressing
UNIT II

Analog Signals & Digital Signals

Transmission Impairment, Data Rate


Limits, Performance

10

Digital to Digital Conversion(polar)

11

PHYSICAL
LAYER 1

Digital to Digital Conversion(bipolar &


manchester)

12

Analog to Digital Conversion

13

Transmission Modes

14

Digital to Analog Conversion


Transmission Modes
UNIT III

15

Multiplexing

Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering

SUBJECT NAME: COMPUTER NETWORKS -1


16

Multiplexing

17

Spread Spectrum

18
19

SUBJECT CODE: 10CS55

PHYSICAL
Circuit switched networks
LAYER 2,
SWITCHING
Datagram Networks
Virtual circuit Networks

20

UNIT IV
21

Error Detection & Correction

22

Block coding

23
24

DATA LINK
LAYER - 1

Block coding
Linear block codes

25

Cyclic codes

26

Checksum
UNIT V

27

Framing

28

Flow and Error control, Protocols,

29
30

Noiseless Channel
DATA LINK
Noisy Channel
LAYER 2

31

HDLC

32

Point to point Protocol Framing ,


Transition Phases

UNIT VI
33

Random Access

34

Controlled Access

Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering

SUBJECT NAME: COMPUTER NETWORKS -1

SUBJECT CODE: 10CS55

35

Channelization

36

Ethernet: IEEE Standards & Standard


Ethernet

37

MULTIPLE
ACCESS,
ETHERNET

Changes in the Standard,

38

Fast Ethernet

39

Gigabit Ethernet
UNIT VII
Introduction

40

IEEE 802.11

41
42
43

WIRELESS
LANs &
CELLULAR
NETWORKS

Bluetooth
Connecting Devices

44

Connecting Devices

45

Cellular Telephony
UNIT VIII

46

Introduction

47

Logical Addressing

48

IPv4 Addressing

49

NETWORK
LAYER

IPv6 Addressing

50

Internetworking basics, IPv4

51

IPv6

52

Comparison of IPv4 and IPv6 Headers

C) Course Assessment Procedure

Department of Information Science & Engineering, B M S Institute of Technology & Management

10

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering

SUBJECT NAME: COMPUTER NETWORKS -1


Procedure for Internal Assessment
Best 2 out of 3 Tests
Maximum Marks for Internal Assessment

SUBJECT CODE: 10CS55

25

Procedure for External Assessment


Maximum Marks for Final Exam

100

TOTAL

125

NOTE 4: The administration of the Final exam/s and their evaluation is carried out by VTU directly
and with little direct input from the College.
D) Other Important Details
D.1 Occupational Health & Safety (OH&S) Procedures
Since this course does not have a practical component, no need to undergo OH&S procedures
D.2 Ethics and Code of Conduct Policy
This course complies with the B M S Institute of Technology Policies on Ethics and Code of Conduct
as described in the website: www.Ethics&CodeofConductPolicy.
Accordingly, plagiarism in any student submissions, copying during assessments of any form and other
such unethical practices will not be tolerated at any time and failure to follow the rules will result in
severe penalties, including exclusion from the College.
NOTE 6 D.2 to be included for all courses.
Course Materials Availability to Students and Others under the Right to Information Act (RTI)
of India
Materials
Course Objectives & Outcomes
Lecture notes & homes work
assignments, (mini)projects.
Sample solutions
Course performance (e.g., student
surveys, etc)

Students Assistants/Tutors Department/Higherups

Department of Information Science & Engineering, B M S Institute of Technology & Management

11

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering

SUBJECT NAME: COMPUTER NETWORKS -1

SUBJECT CODE: 10CS55

Question Bank
UNIT I - Introduction to Networks
1 a. What is data communication? List and explain the five components of a data communication
system, with examples. 07 M
b. discuss the OSI-ISO layered model. Bringing out the functionalities of each layer. 10 M
c. define the key element of a protocol. 03 M
2 a. What is data communication? What are its characteristics and components? Explain. 06M
b. give the comparison between LAN,MAN and WAN with an example.06M
c. describe with a neat diagram. The functionalities of each layer in the TCP/IP model. 08M
3 a. What is data communication? What are its four important fundamental characteristics? 06M
b. What is a protocol? What are its key elements? 02M
c. Explain OSI reference model. With a neat figure explain. 08M
d. Differentiate between:04M
i. ARP and RARP
ii. ICMP and IGMP
iii. UDP and TCP
4 a. with neat diagram explain mesh topology with applications of each.06M
b. what are standards ? Name any four standard organizations.06M
c. explain OSI reference model with functions of following layers. 08M
i) Physical layer ii) Data link layer iii) Network layer

Department of Information Science & Engineering, B M S Institute of Technology & Management

12

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering

SUBJECT NAME: COMPUTER NETWORKS -1

SUBJECT CODE: 10CS55

5 a. what is data communication? What are its characteristics? Explain. 06M


b. define the following terms : i) protocol ii) internet 04M
c. describe with neat diagram the functionalities of each layer in the OSI model. 10M

UNIT II: Physical layer-1


1 a. an analog signal has a bandwidth of 40 kHz. If we use four levels in the signal. What is the minimum
bandwidth of the digital signal? 04M
b. what is the Nyquist sampling rate for each of the following signals?
i) A low pass signal with bandwidth of 200 kHz.
ii) A band pass signal with bandwidth of 300 kHz having lowest frequency of 200 kHz. 04M
c. write a descriptive note on the three causes of transmission impairment. 12M
2 a. explain the transmission modes 06M
b. we want to digitize the human voice. What is the bit rate, assuming 8 bits per sample? 04M
c. discuss 8b/10b coding scheme .04M
d. explain the delta modulation.06M
3 a. Suppose an application layer wants to send L-bytes message to its peer process using the existing
TCP connection. The TCP consists of message plus 20 bytes of header. The segment is encapsulated
into IP packet that has an additional 20 bytes of header. The IP packet in turn goes inside the Ethernet
frame that has 18 bytes of header and trailer. What percentages of the transmitted byte in the physical
layer correspond to the message information? L=100 byte. 06M
b. define bandwidth. A periodic signal has a bandwidth of 20 Hz. The highest frequency is 60Hz. What
is the lowest frequency? Draw the spectrum, if the signal contains all frequencies of the same
amplitude.04M
c. explain briefly, with neat figures, the two approaches for digital transmission.08M

Department of Information Science & Engineering, B M S Institute of Technology & Management

13

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering

SUBJECT NAME: COMPUTER NETWORKS -1


SUBJECT CODE: 10CS55
d. A signal travels through an amplifier and the power is increased 10 times. Calculate the power
gained. 02M
4 a. explain three causes of transmission impairments. 06M
b. describe with neat waveform any two polar line coding schemes.06M
c. give data rate formula suggested by Nyquist and Shannon. Low pass communication has BW of 1 m
Hz .what is the Shannon capacity of the channel if SNR is 40 db? What bit rate is attained using 8-level
pulses? 08M
5 a. calculate the Shannon channel capacity in the following cases: 06M
BW 20 kHz SNR dB 40
BW =200 kHz SNR dB 6
b. A file contains 3 million bytes. How long does it take to download this file using a 100 kbps channel?
04M
c. define line coding. Describe Unipolar NRZ, polar NRZ-L, Bipolar AMI and Manchester encoding
by applying on the information sequence 101011100. 10M

Unit-III: Physical layer 2 and switching


1 a. what is time division multiplexing? Explain how statistical TDM overcomes the disadvantages of
synchronous TDM. 08M
b. an analog signal has a bit rate of 10000 bps and the bandwidth of 2000 baud. How many data elements
are carried by each signal element? How many signal elements do we need? 04M
c. Explain phase shift keying in detail. 08M
2 a. an analog signal has a bit rate of 8000bps and a baud rate of 1000 baud. How many data elements
are carried by each signal element? How many signal elements do we need? 04M
b. define synchronous TDM. 12M

Department of Information Science & Engineering, B M S Institute of Technology & Management

14

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering

SUBJECT NAME: COMPUTER NETWORKS -1


SUBJECT CODE: 10CS55
c. explain the amplitude modulation.04M
3 a. A voice grade channel of a telephone network has a bandwidth of 3.4 kHz.06M
i) Calculate channel capacity for S/N=30Db
ii) Calculate S/N required to support information transfer at 4800 bps.
b. What is FDM? Briefly explain its multiplexing and demultiplexing process.06M
c. explain briefly the two spread spectrum techniques.08M
4 a. With a neat waveform. Explain three methods of digital to analog conversion. Draw waveform
with input data110100.06M
b. what is multiplexing? With neat diagram explain FDM.06M
c. what is TDM ? Four sources create 250 characters per second. The frame contains one character
from each source and one extra bit for synchronization. Find i) the data rate of each source. ii) duration
of each character in each source.iii) the frame rate iv) duration of output frame. v) Frame size in bits.
vi) Data rate of link. 08M
5 a. we have four sources, each creating 250 characters /sec. if the interleaved unit is one character and
1 synchronization bit is added to each frame, find 12M
i) The data rate of each source.
ii) The duration of each character in each source.
iii) The frame rate.
iv) The duration of each frame.
v) The no of bits in each frame.
vi) The data rate of the link.
b. define synchronous TDM. 02M
c. describe ASK, FSK and PSK mechanisms and apply them over the digital data 101101. 06M

UNIT- IV: Data Link Layer-1


1 a. what is reflection? Briefly explain the fiber optic cable media. With a neat sketch. 08M
b. Draw a CRC encoder and decoder for CRC code with C(7,4).Also explain how this CRC design
works, with an example. 10M
c. Define line of sight propagation. 02M
2 a. briefly explain twisted pair cable and optical fiber cable. With their applications .10M
b. Explain the checksum with an example. 06M
c. explain the types of errors. 04M
3 a. explain briefly the fiber optic cable with a neat figure. 08M
b. find the codeword C(x) for the information d(x)=x3 + 1 with the generator polynomial t(x)= x3 +x+1.
06M
c. what is internet checksum? With an example

Department of Information Science & Engineering, B M S Institute of Technology & Management

15

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering

SUBJECT NAME: COMPUTER NETWORKS -1


SUBJECT CODE: 10CS55
4 a. Describe the physical and transmission characteristics of the following:
i. Twisted pair cable
ii. Fiber optic cable
b. What is hamming distance? Explain simple parity check code C (5, 4) with d min =1. How many
bits can be corrected? 06M
c. What is CRC? If the generating polynomial for CRC code is x4+x3+1 and message word is 11110000
determine check bits and coded word. 08M
5 a. briefly explain the coaxial cable and optical fiber with their application. 10M
b. explain how CRC is used in detecting errors for the following polynomial, g(x)=x4+x+1. Consider
the information sequence 1101011011. 10M i) Find the codeword corresponding to this sequence.
ii) If the codeword has error in third bit. What does receiver obtain when it does its error checking?

UNIT- V: Data Link Layer-2


1 a. List the protocols for noisy channel s. explain stop and wait protocol for noiseless channels. 08M
b. Define piggybacking and its usefulness. 04M
c. Write explanatory note s on the different phases of PPP 08M
2 a. explain the selective repeat and stop and wait ARQ. 10M
b. discuss HDLC protocol. 10M
3a. explain briefly with neat figures stop and wait ARQ and Go back N ARQ. 12M
b. explain the frame format and transitional phases of point to point protocol. 08M
4a. Differentiate between character oriented protocol and bit oriented protocol frame format for
framing. 06M
b. Explain salient features of: 08M
i. stop and wait protocol
ii. Stop and wait ARQ protocol
c. Briefly explain about point to point protocol. 06M
5 a. explain selective repeat ARQ. Justify how selective repeat ARQ outperforms Go-Back-N and Stopand-Wait ARQ. 10M
b. explain point to point protocol frame format. Also briefly describe different transition phases of PPP
in establishing. 10M

UNIT- VI: Multiple Access & Ethernet


1 a. Describe the different controlled access methods. 10M
1b. Explain 802.3 MAC frame format and frame length. 10M
2 a. Explain i) CSMA ii) CSMA/CD. 10M
2b. what do you mean by channelization? Explain the protocols used for channelization. 10M

Department of Information Science & Engineering, B M S Institute of Technology & Management

16

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering

SUBJECT NAME: COMPUTER NETWORKS -1


SUBJECT CODE: 10CS55
3 a. A network transmits 200 bit frame on a shared channel of 200 kbps. For aloha and slotted aloha,
(i) what is the Requirement to make the frame collision free?
(ii) Throughput if the system produces 1000 frames/sec? 08M
3b. define channelization and list its three protocols? 10M
3c. how does p-persistent method improve efficiency? 02M
4 a. what is random access? Explain following random access protocols.
i) slotted ALOHA ii) CSMA/CD 06M
c. What is channelization? Explain CDMA. 06M
d. Describe frame format for IEEE 802.3 MAC frame. What are the salient features of fast Ethernet?
08M
5 a. Explain the following random access protocols: i) CSMA ii) CSMA/CD. 10M
5b. Discuss 802.3 MAC frame format. Mention the restriction imposed on minimum and maximum
lengths of a 802.3 frame. 10M

UNIT VII: Wireless LANs


1 a. Discuss the 802.11 MAC layer frame format 08M
b. Differentiate bus back-bone from star back bone. Explain each in detail. 10M
c. Differentiate between amplifier and repeater.02M
2 a. explain the IEEE 802.11 architecture. 08M
b. how does a virtual LAN helpful in providing security and reduce the network traffic? 08M
c. Explain the bridges. 04M
3 a. explain with a neat figure 802.3 MAC frame format. 08M
b. explain the hidden and exposed station problem in IEEE 802.11. 12M
4 a. Describe the MAC layers in IEEE 802.11 standard. 06M
b. In brief explain blue tooth layers. 06M
c. Bring out difference between repeaters, bridges, routers and gateways. 08M
5a. discuss Bluetooth technology. 10M
5b. explain the working mechanism of following devices used to connect LANs. 10M

UNIT VIII: CELLULAR TELEPHONY


1 a. Explain in detail the architecture of a SONET system. 10M
b. Write a note on byte interleaving.04M
c. Give the architecture of ATM. Show how VPs and VCs are established.06M
2 a. explain the SONET/SDH layer and frames. 12M
b. Find the data rate and duration of an STS-1 signal. 04M
Department of Information Science & Engineering, B M S Institute of Technology & Management

17

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering

SUBJECT NAME: COMPUTER NETWORKS -1


SUBJECT CODE: 10CS55
c. Explain the AMPS. 04M
3 a. explain briefly the three categories of satellites. 10M
b. explain briefly STS-1 frame format 10M
4 a. explain SONET multiplexing. 06M
b. With neat diagram describe ATM architecture.06M
c. Discuss SONET STS-1 frame format. Find data rate of an STS-3 signals.08M
5 a. what are the design goals of ATM? Briefly describe ATM layers. 12M
b. what is bit stuffing and unstuffing ? Apply bit stuffing to the sequence: 0110111111111100 apply
unstuffing: 01111110000111011111011111011001111110. 08M

Department of Information Science & Engineering, B M S Institute of Technology & Management

18

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: FORMAL LANGUAGES AND AUTOMATA THEORY

SUBJECT CODE: 10CS56

Vision of the Institute


To emerge as one of the finest technical institutions of higher learning to develop
engineering professionals who are technically competent, ethical and environment
friendly for betterment of society.
Mission of the Institute
Accomplish stimulating learning environment through high quality academic instruction,
innovation and industry-institute interface.

Department of Information Science and Engineering


Vision of the Department
Emerge as one of the premier department of higher learning and research in
Information Technology
Mission of the Department
1. To provide excellence in technical education through contemporary teaching
learning process .
2. To inculcate ethical values, leadership abilities, and research capabilities towards
progress of society
Program Educational Objectives:
Graduates of the program will,
PEO1

Equip with required knowledge and skills to resolve business problems to


provide reliable and secure IT solutions.

PEO2

Encourage and participate in multi-disciplinary environments

PEO3

Maintain ethical conduct and engage in lifelong learning in response to the


contemporary needs of the society.

Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: FORMAL LANGUAGES AND AUTOMATA THEORY

SUBJECT CODE: 10CS56

PROGRAMME OUTCOMES
Program outcomes are narrower statements that describe what students are expected to know and be
able to do by the time of graduation. These relate to the skills, knowledge and behavior. Bachelor of
Engineering Graduation students of Information science and Engineering program at B M S Institute of
Technology will attain the following program outcomes.

Program Outcomes:
After the successful completion of the course, the graduate will be able to
PO1: Engineering knowledge: Apply the knowledge of mathematics, science, engineering
fundamentals, and an engineering specialization to the solution of complex engineering problems.
PO2: Problem analysis: Identify, formulate, review research literature, and analyze complex
engineering problems reaching substantiated conclusions using first principles of mathematics, natural
sciences, and engineering sciences.
PO3: Design/development of solutions: Design solutions for complex engineering problems and
design system components or processes that meet the specified needs with appropriate consideration for
the public health and safety, and the cultural, societal, and environmental considerations.
PO4: Conduct investigations of complex problems: Use research-based knowledge and research
methods including design of experiments, analysis and interpretation of data, and synthesis of the
information to provide valid conclusions.
PO5: Modern tool usage: Create, select, and apply appropriate techniques, resources, and modern
engineering and IT tools including prediction and modeling to complex engineering activities with an
understanding of the limitations.
PO6: The engineer and society: Apply reasoning informed by the contextual knowledge to assess
societal, health, safety, legal and cultural issues and the consequent responsibilities relevant to the
professional engineering practice.
PO7: Environment and sustainability: Understand the impact of the professional engineering
solutions in societal and environmental contexts, and demonstrate the knowledge of, and need for
Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: FORMAL LANGUAGES AND AUTOMATA THEORY

SUBJECT CODE: 10CS56

sustainable development.
PO8: Ethics: Apply ethical principles and commit to professional ethics and responsibilities and norms
of the engineering practice.
PO9: Individual and team work: Function effectively as an individual, and as a member or leader in
diverse teams, and in multidisciplinary settings.
PO10: Communication: Communicate effectively on complex engineering activities with the
engineering community and with society at large, such as, being able to comprehend and write effective
reports and design documentation, make effective presentations, and give and receive clear instructions.
PO11: Project management and finance: Demonstrate knowledge and understanding of the
engineering and management principles and apply these to ones own work, as a member and leader in
a team, to manage projects and in multidisciplinary environments.
PO12: Life-long learning: Recognize the need for, and have the preparation and ability to engage in
independent and life-long learning in the broadest context of technological change.

A) Course Administrator Details


Course Title

Course Code

Core/Elective

Semester

Year

Formal Languages and Automata


Theory

10CS56

Core

2016

Contact Hours/ week

Lecture

Tutorials

Practical

Department

Information Science and Engineering

Name of the faculty with


Designation and mail ID

Ashwini N
Assistant Professor,

Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: FORMAL LANGUAGES AND AUTOMATA THEORY

SUBJECT CODE: 10CS56

ashwinilaxman@bmsit.in

Prerequisites for the Course 1. Discrete Mathematics


(exemption from the prerequisites
is provided only in exceptional
circumstances)

B) Course Related Specifics


Syllabus (from VTU manual www.vtu.in)

Formal Languages and Automata Theory


Sub Code : 10CS56
Hrs/Week : 04
Total Hrs : 52

IA Marks
:25
Exam Hours :03
Exam Marks :100

PART A
UNIT 1

7 Hrs

Introduction to Finite Automata: Introduction to Finite Automata; The central concepts of


Automata theory; Deterministic finite automata; Nondeterministic finite automat

UNIT 2

7 Hrs

Finite Automata, Regular Expressions: An application of finite automata; Finite automata with
Epsilon-transitions; Regular expressions; Finite Automata and Regular Expressions; Applications of
Regular Expressions.

UNIT 3

6 Hrs

Regular Languages, Properties of Regular Languages: Regular languages; Proving languages not
to be regular languages; Closure properties of regular languages; Decision properties of regular
languages; Equivalence and minimization of automata.

UNIT 4

6 Hrs

Context-Free Grammars And Languages: Context free grammars; Parse trees; Applications;
Ambiguity in grammars and Languages.

PART B
Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: FORMAL LANGUAGES AND AUTOMATA THEORY

UNIT 5

SUBJECT CODE: 10CS56

7Hrs

Pushdown Automata: Definition of the Pushdown automata; the languages of a PDA; Equivalence
of PDAs and CFGs; Deterministic Pushdown Automata.

UNIT 6

6 Hrs

Properties of Context-Free Languages: Normal forms for CFGs; The pumping lemma for CFGs;
Closure properties of CFLs.

UNIT 7

7 Hrs

Introduction To Turing Machine: Problems that Computers cannot solve; The turning machine;
Programming techniques for Turning Machines; Extensions to the basic Turning Machines; Turing
Machine and Computers.

UNIT 8

6 Hrs

Undecidability: A Language that is not recursively enumerable; An Undecidable problem that is RE;
Posts Correspondence problem; other undecidable problems.

Course Objectives

1. To provide students in-depth theoretical knowledge of finite


automata.
2. Explain and manipulate the different concepts in automata theory
and formal languages such as formal proofs, (non-)deterministic
automata, regular expressions, regular languages, context-free
grammars, context-free languages, Turing machines.
3. Prove properties of languages, grammars and automata with
rigorously formal mathematical method.
4. Describe the language accepted by an automata or generated by a
regular expression or a context-free grammar

Recommended Text Books:

Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: FORMAL LANGUAGES AND AUTOMATA THEORY

SUBJECT CODE: 10CS56

1. John E. Hop croft, Rajeev Motwani, Jeffrey D.Ullman: Introductionto Automata Theory,
Languages and Computation, 3rd Edition, Pearson Education, 2007.
(Chapters: 1.1, 1.5, 2.2 to 2.5, 3.1 to 3.3, 4, 5, 6, 7, 8.1 to8.4, 8.6, 9.1, 9.2, 9.4.1, 9.5)
Reference Books:
1. K.L.P. Mishra: Theory of Computer Science, Automata, Languages, and Computation, 3rd Edition,
PHI, 2007.
2. Raymond Greenlaw, H.James Hoover: Fundamentals of the Theory of Computation, Principles and
Practice, Morgan Kaufmann, 1998.
3. John C Martin: Introduction to Languages and Automata Theory, 3rd Edition, Tata McGraw-Hill,
2007.
4. Thomas A. Sudkamp: An Introduction to the Theory of Computer Science, Languages and
Machines, 3rd Edition, Pearson Education, 2006.
Recommended Reference Materials:
1. Notes
2. PPT
3. Videos
Web Resources:
1. http://www.ics.uci.edu/~goodrich/teach/cs162/notes/
2. https://www.iitg.ernet.in/dgoswami/Flat-Notes.pdf
3. http://nptel.ac.in/courses/111103016/

Course Outcomes
CO1: Design Deterministic finite automata, Nondeterministic finite automata, conversion of NFA to DFA,
design of E- NFA and regular expressions.
CO2: Obtain minimized DFA and convert automata to regular expressions and regular expression to automata
and proving languages are not regular.

CO3: Writing CFGs, Construction of parse trees, finding and removing ambiguity in grammars, designing
problems on Pushdown Automata.

CO4: Conversion of grammar to Chomsky Normal Form , Greibach normal form and conversion of grammar
to PDA .Prove that languages are not context free using pumping lemma.

CO5: Designing Turing machines, understanding the working of various types of Turing machines and solving
post correspondence problems.

Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: FORMAL LANGUAGES AND AUTOMATA THEORY

SUBJECT CODE: 10CS56

Course Outcomes - Program Outcomes mapping:


Program Outcomes

COS/
POS

PO1

PO2

CO1

CO2

PO3

Total

PO6

PO7

PO8

PO9

PO10

PO11

1
9

PO12

1
2

CO4

PO5

CO3

CO5

PO4

2
1
1

1
1

NOTE: Mapping in terms of Slight (1), Moderate (2), Good (3) and Excellent (4) levels and COs need
not map all POS
Name of the Faculty: Prof.Ashwini N

No. of Hours: 52

LESSON PLAN
Lecture
No

Learning
Objective

Topic to be covered

Remarks

1
2
3
4

Introduction to
Finite Automata

Unit I
Introduction to Finite Automata.
The central concepts of Automata
theory.
Deterministic finite automata.
Problems on Deterministic finite
automata.

Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: FORMAL LANGUAGES AND AUTOMATA THEORY
5
Nondeterministic finite automata.

SUBJECT CODE: 10CS56

Problems on Nondeterministic finite


automata.
Differences between DFA and NFA.

6
7

UNIT II
8

10
11
12
13

Finite Automata,
Regular Expressions

An application of finite automata


Finite automata with Epsilon-transitions
Problems on Finite automata with
Epsilon-transitions.
Finite Automata to Regular Expressions
Finite Automata to Regular Expressions
Regular Expressions to Finite Automata

14

Regular Expressions to Finite Automata

15

UNIT IV
Construction of Context-Free Grammars

16
17
18
19

ContextFree
Grammars
And
Languages

Construction of Context-Free Grammars


Parse trees
Derivation: LMD,RMD
Ambiguity in grammars and Languages

20

Applications

21

Normal forms for CFGs

22
23
24
25
26

Properties of ContextFree Languages

UNIT VI
CNF
GNF
The pumping lemma for CFGs
Closure properties of CFLs
Closure properties of CFLs

Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: FORMAL LANGUAGES AND AUTOMATA THEORY
The role of SCM, Benefits and
27
challenges of SCM, Trends in SCM
UNIT V
Definition of the Pushdown automata

30
31
32
33

Pushdown Automata

28
29

SUBJECT CODE: 10CS56

34

Problems on Pushdown automata


Problems on Pushdown automata
The languages of a PDA
Equivalence of PDAs and CFGs
Equivalence of PDAs and CFGs
Deterministic Pushdown Automata
UNIT III

35

Properties of Regular Languages

36

Regular

37

Languages,

Proving languages not to be regular


languages
Closure properties of regular languages

38

Properties

Decision properties of regular languages

39

of Regular

Equivalence and minimization of


automata
Problems on Equivalence and
minimization of automata

Languages
40

UNIT VII
Introduction To Turing Machine

42

Problems that Computers cannot solve

43
44
45
46

Introduction To Turing
Machine

41

Programming techniques for Turning


Machines
Programming techniques for Turning
Machines
Extensions to the basic Turning Machines
Extensions to the basic Turning Machines

Department of Information Science & Engineering, B M S Institute of Technology & Management

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: FORMAL LANGUAGES AND AUTOMATA THEORY
47
Turing Machine and Computers
UNIT VIII
Introduction to Undecidability

50
51
52

Undecidability

48
49

SUBJECT CODE: 10CS56

A Language that is not recursively


enumerable
An Undecidable problem that is RE
An Undecidable problem that is RE
Posts Correspondence problem

C) Course Assessment Procedure


Procedure for Internal Assessment
Best 2 out of 3 Tests
Maximum Marks for Internal Assessment

25

Procedure for External Assessment


Maximum Marks for Final Exam

100

TOTAL

125

NOTE 4: The administration of the Final exam/s and their evaluation is carried out by VTU directly
and with little direct input from the College.
D) Other Important Details
D.1 Occupational Health & Safety (OH&S) Procedures
Since this course does not have a practical component, no need to undergo OH&S procedures

D.2 Ethics and Code of Conduct Policy


This course complies with the B M S Institute of Technology Policies on Ethics and Code of Conduct
as described in the website: www.bmsit.in/Ethics&CodeofConductPolicy.
Accordingly, plagiarism in any student submissions, copying during assessments of any form and other
such unethical practices will not be tolerated at any time and failure to follow the rules will result in
severe penalties, including exclusion from the College.
Department of Information Science & Engineering, B M S Institute of Technology & Management

10

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: FORMAL LANGUAGES AND AUTOMATA THEORY

SUBJECT CODE: 10CS56

Course Materials Availability to Students and Others under the Right to Information Act (RTI)
of India
Materials
Course Objectives & Outcomes
Lecture notes & homes work
assignments, (mini)projects.
Sample solutions
Course performance (e.g., student
surveys, etc)

Students Assistants/Tutors Department/Higherups

Question Bank
1

Define the following terms:

(10 Marks)

i)
Alphabets and power of an alphabet
ii)
Language
iii)
DFA, NFA and -NFA
Define Finite automata and discuss why study automata?

(5 Marks)

Construct DFA s that accept the following languages on the alphabet = {a , b}

(10 Marks)

i)
All strings with exactly one a
ii)
All strings with at least one a
iii)
All strings except those which end with abb
Obtain a DFA to accept the language L = w | w (a + b)*; Na (w)mod 3 = 2 and Nb(w)
mod 2 = 1}

(8 Marks)

Convert the following NFA into an equivalent DFA

(6 Marks)

Convert the following NFA into an equivalent DFA

(10 Marks)

->p

{q, s}

{q}

Department of Information Science & Engineering, B M S Institute of Technology & Management

11

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: FORMAL LANGUAGES AND AUTOMATA THEORY
*q
{r}
{q,r}

{s}

{p}

*s

{p}

SUBJECT CODE: 10CS56

Obtain a DFA to accept the following languages

(8 Marks)

L = {w such that |w| mod 3 |w| mod 2 where w * and ={a,b}}


6

Design the DFA s for the following languages


i)
ii)

L = {w : |w| mod 3 = 0, w (a+b)*


Set of all strings on the alphabet = {0 , 1} that either begins or ends or both
with substring 01
iii)
Decimal strings divisible by 3
Convert the following NFA to DFA using LAZY evaluation scheme

(8 Marks)

Start

q0

(8 Marks)

0
1
q1

q1

q0

q1, q2

q2

q1

Write an algorithm to convert -NFA to DFA

(8 Marks)

Obtain an NFA to accept strings of as and bs ending with ab or ba. From this NFA obtain
an equivalent DFA using subset construction.

(8 Marks)

10a

Let r be a regular expression, show that there exists some NFA that accepts L(r)

(6 Marks)

10b

Give the RE for the following:

(4 Marks)

i)
ii)

strings of as and bs ending with ab or ba


strings of as and bs such that fourth symbol from the right end is a and fifth
symbol from the right end is b.
iii)
strings of as and bs containing no more than three as
iv)
strings of as and bs whose lengths are multiples of 3.
Obtain the RE for the following automata using state elimination method.

(6 Marks)

11a

Department of Information Science & Engineering, B M S Institute of Technology & Management

12

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: FORMAL LANGUAGES AND AUTOMATA THEORY

11b

12

SUBJECT CODE: 10CS56

Define RE. Write RE for the following languages


i)
l = { an.bm : (m + n) is even }
ii)
L = { an.bm : (m >=1, n>=1, nm >=3}
If the language L is accepted by a DFA then prove that there is a RE R for the language L
such that L = L(R).

(6 Marks)

(6 Marks)

13

Prove that there exists a finite automata to accept the language L(R) corresponding to
the RE R.

(6 Marks)

14

Obtain an NFA to accept the language consisting of as and bs ending with string ab or ba
and convert it into equivalent DFA.

(10Marks)

15

Define regular expressions and the languages accepted by the regular expressions.

(4 Marks)

16

Prove that every language defined by a regular expression is also defined by a finite
automation.

(10Marks)

17

Write the RE for the following languages.

(6 Marks)

18

i)
Strings with 0s and 1s containing substring 10.
ii)
Strings of as, bs containing at least one a in it.
Minimize the following DFA using Table filling algorithm.

(8 Marks)

->A

*D

Department of Information Science & Engineering, B M S Institute of Technology & Management

13

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: FORMAL LANGUAGES AND AUTOMATA THEORY
H
G
D
19

20

SUBJECT CODE: 10CS56

Minimize the following DFA using table-filling algorithm where A is the start state. The
states C, F, I are final states.
0

*C

*F

*I

Define CFG and write CFG for the following languages.

(10 Marks)

(7 Marks)

i) L = {aibjck: i+j = k, I >=0, j >=0}


21

Define CFG. Construct a CFG for the language L={anam: n m}

(10 Marks)

22

Consider the grammar G with productions

(10 Marks)

S ->AbB
A ->aA |
B->ab | bB |
Give leftmost derivation, rightmost derivation and parse tree for the string aaabab.
23

Consider the grammar.

(8 Marks)

E -> +EE | *EE | -EE | x | y


Find leftmost and rightmost derivation for the string +*-xyxy and write parse tree.
24

Consider the grammar G with productions,

(7 Marks)

Department of Information Science & Engineering, B M S Institute of Technology & Management

14

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: FORMAL LANGUAGES AND AUTOMATA THEORY
S ->aAB

SUBJECT CODE: 10CS56

A ->bBb
B -> A |
Construct the derivation tree.
25

Define Ambiguous grammar. Prove that the following grammar is ambiguous.

(5 Marks)

S ->aS | aSbS |
26

When the language is said to be inherently ambiguous? Show that the following grammar (7 Marks)
is ambiguous.
S-> AB | aaB
A -> a | aA
B -> b
Construct an unambiguous grammar equivalent to above grammar.

27

Discuss the languages accepted by a PDA. Design a PDA for the language that accepts the
strings with na(w) <nb(w).

(14 Marks)

28

Obtain a PDA to accept the language L = {anbn | n>=0} by a final state. Give the graphical
representation for PDA obtained. Show the moves made by the PDA for the aaabbb.

(10 Marks)

29

Design a PDA to accept the language L = {anb2n | n>= 1}. Give the graphical
representation for PDA obtained. Show the moves made by the PDA for the string
aabbbb.

(10 Marks)

30

For the following grammar construct a PDA.

(8 Marks)

S->aABB | aAA
A->aBB | a
B->bBB | A
C-> a
31

Obtain a PDA equivalent to the following grammar.

(4 Marks)

S ->aA
A ->aA | bA | a | b

Department of Information Science & Engineering, B M S Institute of Technology & Management

15

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: FORMAL LANGUAGES AND AUTOMATA THEORY
32
What are deterministic PDA and non-deterministic PDA?
33

SUBJECT CODE: 10CS56


(4 Marks)

Obtain a PDA equivalent to the following grammar.

(4 Marks)

E -> E + E
E -> E * E
E -> E / E
E -> E E
E -> (E) | a | b
34

Explain the following terms

(4 Marks)

35

i)
Languages of a PDA
ii)
Instantaneous Description
Write the CFG for the following languages:

(7 Marks)

36

i)
L = {aibjck:i+j=k,i0,j0}
ii)
L = { anbmck: n+2m=k}
Define CFG and write the grammar for the following languages.

(8 Marks)

37

i)
L = {anb2n: n1}
ii)
L = {anbn+3 : n>0}
Define CFG. Construct the CFG for the language

(10 Marks)

L = {anwwrbn: w{a,b}*}
38

Obtain the grammar for the languages shown below:


i)
ii)

(12 Marks)

L= { anbmck: n+2m=k for n0 and m0}


L = { xy | w (a+b)* and y(ab or ba)}. Show the RMD for the string aabbba
along with derivation tree.

39

Define the following terms:

(5 Marks)

40

i) Grammar ii) CFG iii)Leftmost Derivation iv) Rightmost derivation v)Derivation tree
Write the CFG for the following languages:

(9 Marks)

41

iii)

L = {aibjck:i+j=k,i0,j0}

iv)

L = { anbmck: n+2m=k}

Define CFG and write the grammar for the following languages.

(10

Department of Information Science & Engineering, B M S Institute of Technology & Management

Marks)

16

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: FORMAL LANGUAGES AND AUTOMATA THEORY
iii)
L = {anb2n: n1}
iv)
42

SUBJECT CODE: 10CS56

L = {anbn+3 : n>0}

Define CFG. Construct the CFG for the language

(10 Marks)

L = {anwwrbn: w{a,b}*}
43

44

Obtain the grammar for the languages shown below:


iii)

L= { anbmck: n+2m=k for n0 and m0}

iv)

L = { xy | w (a+b)* and y(ab or ba)}. Show the RMD for the string aabbba
along with derivation tree.

Define the following terms:

(12 Marks)

(5 Marks)

ii) Grammar ii) CFG iii)Leftmost Derivation iv) Rightmost derivation v)Derivation tree
45

Consider the grammar

(9 Marks)

S -> ABC | BaB


A ->aA | BaC | aaa
B ->bBb | a | D
C -> CA | AC
D ->

46

i)

Eliminate productions

ii)

Eliminate Unit productions in the resulting grammar

iii)

Eliminate Useless production in the resulting grammar.

What are useless symbols? Eliminate useless symbols and productions from the following
grammar.

(10 Marks)

S->abA | bB
A->aA|d
B->bB
Department of Information Science & Engineering, B M S Institute of Technology & Management

17

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: FORMAL LANGUAGES AND AUTOMATA THEORY
D->ab|Ea

SUBJECT CODE: 10CS56

E->aC|a
47

Eliminate the useless symbol from the following grammar. Also eliminate the useless
productions.

(6 Marks)

S->aB | aCD | aE
B->bC
C->aB | b
D ->aE
E->bCD
48

Find a CFG without -productions, unit productions and useless productions equivalent
to the grammar defined by

(12 Marks)

S->ABaC
A -> BC
B-> b |
C -> D |
D -> d
49

Define Unit, useless and -productions. Convert the following grammar into CNF. E ->
E+T|T, T->T*F|F, F->(E)|I, I->Ia|Ib|a|b.

(10 Marks)

50

What is Chomsky Normal Form? Convert the following grammar to Chomsky Normal
Form.

(5 Marks)

S ->ABa
A ->aab
B -> Ac
51

What are CNF and GNF of CFG? Give examples.

(4 Marks)

52

What are CNF and GNF? Obtain the following grammar in CNF.

(10 Marks)

S->aBa | abba
A ->ab | AA
Department of Information Science & Engineering, B M S Institute of Technology & Management

18

B M S INSTITUTE OF TECHNOLOGY AND MANAGEMENT


YELAHANKA BENGALURU 560064
Department of Information Science and Engineering
SUBJECT NAME: FORMAL LANGUAGES AND AUTOMATA THEORY
B->aB| a
53

SUBJECT CODE: 10CS56

What are CNF and GNF of grammar? Obtain the CNF notation for the following grammar.

(8 Marks)

S->ASB
A->aAS | a
B->SbS | aAS | a|bb
54

Transform the grammar with productions

(7 Marks)

S ->abAB
A->bAb |
B -> Baa | A| into CNF.
55

Obtain the following CFG in GNF notations.

(4 Marks)

S -> AB
A ->aA | bB | b
B -> b
56

If L1 and L2 are context free languages then prove that family of Context free languages
are closed under Union and concatenation operations.

(6 Marks)

57

If L1 and L2 are two context free languages then prove that L1UL2, L1.L2 and L1* are CFLs.

(6 Marks)

58

State and prove pumping lemma for CFLs.

(10 Marks)

59

Explain with neat diagram, the working of a Turing Machine model.

(6 Marks)

60

What is Turing Machine? With a neat sketch, explain the working of Turing Machine.

(8 Marks)

61

Design Turing Machine to accept all set of palindromes over {0,1}*. Also write its
transition diagram and instantaneous description on the string 10101

(14 Marks)

62

Define a Turing Machine. Design a Turing Machine to accept the language L={anbncn:n1}.
Draw the transition diagram. Show the moves made by this Turing Machine for the string
aabbcc.

(12 Marks)

Department of Information Science & Engineering, B M S Institute of Technology & Management

19

Database Application Laboratory

2016-2017

BMS Institute of Technology & Management


Yelahanka, Bangalore-560 064

Database Applications Lab (10CSL57)


Laboratory Manual
For
V Semester BE
Information Science & Engineering

Department of Information Science & Engineering


BMS Institute of Technology & Management
Yelahanka, Bangalore-560 064

Copyright Dept. of ISE, BMSIT-Bengaluru

Database Application Laboratory

2016-2017

BMS Institute of Technology & Management


Yelahanka, Bangalore-560 064

Database Applications Lab (10CSL57)


Laboratory Manual
For
V Semester BE
Information Science & Engineering

Prepared by
Dr.Manjunath T N

Reviewed by
HOD/ISE

Department of Information Science & Engineering

BMS Institute of Technology & Management


Yelahanka, Bangalore-560 064

Copyright Dept. of ISE, BMSIT-Bengaluru

Database Application Laboratory

2016-2017

DATABASE APPLICATIONS LABORATORY


Subject Code : 10CSL57
No. of Practical Hrs./ Week : 03
Total No. of Practical Hours : 42

IA Marks : 25
Exam Hours : 03
Exam Marks : 50

1. Consider the following relations containing student class information:


Student (snum: integer, sname: string, major: string, level: string, age: integer)
Class (cname: string, meets at: time, room: string, fid: integer)
Enrolled (snum: integer, cname: string)
Faculty (fid: integer, fname: string, deptid: integer)
1. Find the names of all juniors (Level = JR) who are enrolled in a class taught by Prof.Harshith.
2. Find the names of all classes that either meet in room R128 or have five or more students enrolled.
3. Find the names of all students who are enrolled in two classes that meet at the same time.
4. Find the names of faculty members who teach in every room in which some class is taught.
5. Find the names of faculty members for whom the combined enrollment of the courses that they teach is less
than five.
2. Consider the following relations containing airline flight information:
Flights(flno: integer, from: string, to: string, distance: integer, departs: time, arrives: time,price:real)
Aircraft(aid: integer, aname: string, cruisingrange: integer)
Certified(eid: integer, aid: integer)
Employees(eid: integer, ename: string, salary: integer)
Note that the Employees relation describes pilots and other kinds of employees as well;
every pilot is certified for some aircraft (otherwise, he or she would not qualify as a pilot), and only pilots are
certified to fly.Write each of the following queries in SQL.
1.Find the names of the aircraft such that all pilots certified to operate them have salaries more than
Rs.80,000.
2.For each pilot who is certified for more than three aircrafts,find the eid and the maximum cruising range of
the aircraft for which she or he is certified.
3.Find the names of pilots whose salary is ess than the price of the cheapest route from bengaluru to Frankfurt.
4.For all the aircraft with cruising range over 1000 kms,find the name of the aircraft and the average salary of
all pilot certified for this aircraft.
5.Find the name of pilots certified for some boeing aircraft.
6.Find the aircraft ids for all aircraft that can be used on routs fromm Bengaluru to New delhi.

Copyright Dept. of ISE, BMSIT-Bengaluru

Database Application Laboratory

2016-2017

3. Consider the following database of student enrollment in courses & books adopted for each course:
STUDENT (regno: string, name: string, major: string, bdate:date)
COURSE (course #:int, cname:string, dept:string)
ENROLL ( regno:string, course#:int, sem:int, marks:int)
BOOK _ ADOPTION (course# :int, sem:int, book-ISBN:int)
TEXT (book-ISBN:int, book-title:string, publisher:string,author:string)
(1) Create the above tables by properly specifying the primary key and the foreign keys.
(2) Enter at least five tuples for each relation.
(3) Demonstrate how you add a new text book to the database and make this book be adopted by some
department.
(4) Produce a list of text books (include Course #, Book-ISBN, Book-title) in the alphabetical order for
courses offered by the CS department that use more than two books.
(5) List any department that has all its adopted books published by a specific publisher.
(6) Generate suitable reports.
(7) Create suitable front end for querying and displaying the results.

4. The following tables are maintained by a book dealer:


AUTHOR (author-id:int, name:string, city:string, country:string)
PUBLISHER (publisher-id:int, name:string, city:string, country:string)
CATALOG (book-id:int, title:string, author-id:int, publisher-id:int, category-id:int, year:int, price:int)
CATEGORY (category-id:int, description:string)
ORDER-DETAILS (order-no:int, book-id:int, quantity:int)
(1) Create the above tables by properly specifying the primary keys and the foreign keys.
(2) Enter at least five tuples for each relation.
(3) Give the details of the authors who have 2 or more books in the catalog and the price of the books is
greater than the average price of the books in the catalog and the year of publication is after 2000.
(4) Find the author of the book which has maximum sales.
(5) Demonstrate how you increase the price of books published by a specific publisher by 10%.
(6) Generate suitable reports.
(7) Create suitable front end for querying and displaying the results.
5. Consider the following database for a banking enterprise:
BRANCH(branch-name:string, branch-city:string, assets:real)
ACCOUNT(accno:int, branch-name:string, balance:real)
DEPOSITOR(customer-name:string, accno:int)
CUSTOMER(customer-name:string, customer-street:string, customercity: string)
LOAN(loan-number:int, branch-name:string, amount:real)
BORROWER(customer-name:string, loan-number:int)
(1) Create the above tables by properly specifying the primary keys and the foreign keys
(2) Enter at least five tuples for each relation
(3) Find all the customers who have at least two accounts at the Main branch.
(4) Find all the customers who have an account at all the branches located in a specific city.
(5) Demonstrate how you delete tuples in ACCOUNT relation at every branch located in a specific city.
Copyright Dept. of ISE, BMSIT-Bengaluru

Database Application Laboratory

2016-2017

(6) Generate suitable reports.


(7) Create suitable front end for querying and displaying the results.

Instructions:
1. The exercises are to be solved in an RDBMS environment like Oracle or DB2.
2. Suitable tuples have to be entered so that queries are executed correctly.
3. Front end may be created using either VB or VAJ or any other similar tool.
4. The student need not create the front end in the examination. The results of the queries may be displayed
directly.
5. Relevant queries other than the ones listed along with the exercises may also be asked in the examination.
6. Questions must be asked based on lots.

Copyright Dept. of ISE, BMSIT-Bengaluru

Database Application Laboratory

2016-2017

Exercise-1:
1. Consider the following relations containing student class information:
Student (snum: integer, sname: string, major: string, level: string, age: integer)
Class (cname: string, meets at: time, room: string, fid: integer)
Enrolled (snum: integer, cname: string)
Faculty (fid: integer, fname: string, deptid: integer)
Step-1: ER Diagram Design

SNAME

SNUM
MEETS AT

SNUM

MAJOR

ROOM

NAME

STUDENT

CLASS

ENROLL

Dept
LEVEL

AGE

CNAME

TEACHES

FACULTY

FID

Copyright Dept. of ISE, BMSIT-Bengaluru

DEPTID
FNAMEE

Database Application Laboratory

2016-2017

Step-2: Schema Design:


STUDENT
Snum

Sname

Major

Level Age
FACULTY
Fname

Fid

CLASS
Cname

Meetsat

Room

deptid

fid

ENROLLED
Snum

Cname

Description of Schema Design:

The table STUDENT contains the attributes namely snum, sname, major, Level & age where the snum
is primary key.
The table CLASS contains the attributes such as cname, meetsat, room & fid where the primary key is
cname.
The table FACULTY contains the attributes such as fid,fname & deptid where the primary key is fid.
The table ENROLLED contains the attributes snum & cname, both the attributes are foreign key &
they together constitute the composite key.

Step-3: Data Model Creation:

STUDENT
Snum
Sname
Major
Level
Age

ENROLLED

Snum
Cname

Copyright Dept. of ISE, BMSIT-Bengaluru

CLASS

Cname
Meetsat
Room
Fid

FACULTY
Fid
Fname
Deptid

Database Application Laboratory

2016-2017

Step-4: DDLs Creation:

STUDENT TABLE:
===================
create table student
(snum number primary key,
sname varchar2(20),
major varchar2(10),
level1 varchar2(10),
age number);
CLASS TABLE:
================
create table class
(cname varchar2(10) primary key,
meetsat varchar2(10),
room varchar2(10),
fid number);

FACULTY TABLE:
==================
create table faculty
(fid number primary key,
fname varchar2(10),
deptid number);

ENROLLED TABLE:
===================
create table enrolled
(snum number,
cname varchar2(10)
foreign key(snum) references student(snum),
foreign key(cname) references class(cname),
primary key(snum,cname)
);

===============================================================

Copyright Dept. of ISE, BMSIT-Bengaluru

Database Application Laboratory

Step-5: Populating the data:

Copyright Dept. of ISE, BMSIT-Bengaluru

2016-2017

Database Application Laboratory

2016-2017

Step-6: SQL Scripts for the Questions:


1. Find the names of all Juniors (Level = JR) who are enrolled in a class taught by Prof.Harshith.
SQL>SELECT DISTINCT S.Sname
FROM Student S, Class C, Enrolled E, Faculty F
WHERE S.snum = E.snum AND E.cname = C.cname AND C.fid = F.fid AND
F.fname = 'Harshith' AND S.level1 = 'JR'

2. Find the names of all classes that either meet in room R128 or have five or more students enrolled.
SQL>SELECT C.cname
FROM Class C
WHERE C.room = 'R128'
OR C.cname IN (SELECT E.cname
FROM Enrolled E
GROUP BY E.cname HAVING COUNT (*) >= 5)

3. Find the names of all students who are enrolled in two classes that meet at the same time.
SQL> SELECT DISTINCT S.*
FROM Student S
Copyright Dept. of ISE, BMSIT-Bengaluru

Database Application Laboratory

2016-2017

WHERE S.snum IN (SELECT E1.snum


FROM Enrolled E1, Enrolled E2, Class C1, Class C2
WHERE E1.snum = E2.snum AND E1.cname <> E2.cname
AND E1.cname = C1.cname
AND E2.cname = C2.cname AND C1.meetsat = C2.meetsat)

4. Find the names of faculty members who teach in every room in which some class
is taught.
SQL> select * from faculty
where fid
in(select fid from
(select count(room) cnt,fid from class group by fid)
where cnt=(select count(distinct(room)) from class));

5. Find the names of faculty members for whom the combined enrollment of the courses that they teach is less
than five.
SQL> select fid,fname
From faculty
where fid in(
select fid from
(select count(1) cnt,fid
From (SELECT E.snum,c.fid
FROM Class C, Enrolled E
WHERE C.cname = E.cname)
group by fid) where cnt<5)

Copyright Dept. of ISE, BMSIT-Bengaluru

Database Application Laboratory

Copyright Dept. of ISE, BMSIT-Bengaluru

2016-2017

Database Application Laboratory

2016-2017

Exercise-2:
Consider the following relations containing airline flight information:
Flights (flno: integer, from: string, to: string, distance: integer, departs: time, arrives: time, price: real)
Aircraft (aid: integer, aname: string, cruisingrange: integer)
Certified (eid: integer, aid: integer)
Employees (eid: integer, ename: string, salary: integer)
Note that the Employees relation describes pilots and other kinds of employees as well; every pilot is certified for
some aircraft (otherwise, he or she would not qualify as a pilot), and only pilots are certified to fly.
Step-1: ER Diagram Design:
From

To

Ename
Fno

Flno

FLIGHTS

Departs

Arrives

EMPLOYEE

FLYS

Price

Salary

Eid
Distance

Eid

CERTIFIES

AIRCRAFT

Cruisingrange

Aid
Aname

Copyright Dept. of ISE, BMSIT-Bengaluru

Database Application Laboratory

2016-2017

Step-2: Schema Design:


FLIGHT
From
Fno

To

Distance departs arrives price


EMPLOYEE

AIRCRAFT
Aid

Aname

Eid

Cruisingrange

CERTIFIED
EID

AID

Step-3: Data Model Creation:

FLIGHT

AIRCRAFT

Fno
From
To
Distance
Departure
Arrival
Price

Aid
Aname
Cruisingrange

EMPLOYEE
CERTIFIED

Eid
Aid

Step-4: DDLs Creation:


FLIGHTS TABLE
================
create table Flights
(flno number primary key,
from1 varchar2(10),

Copyright Dept. of ISE, BMSIT-Bengaluru

Eid
Ename
Salary

Ename

Salary

Database Application Laboratory

2016-2017

to1 varchar2(10),
distance number,
departs date,
arrives date,
price number(10,2));
AIRCRAFT TABLE:
===================
create table Aircraft
(aid number primary key,
aname varchar2(10),
cruisingrange number);
CERTIFIED TABLE:
====================
create table Certified
(eid number,
aid number,
foreign key(eid) references employee(eid),
foreign key(aid) references aircraft(aid),
primary key(eid,aid));
EMPLOYEES TABLE:
===================
create table Employees
(eid number primary key,
ename varchar2(10),
salary number(10,2));

======================================================

Copyright Dept. of ISE, BMSIT-Bengaluru

Database Application Laboratory

Step-5: Populating the data:

Copyright Dept. of ISE, BMSIT-Bengaluru

2016-2017

Database Application Laboratory

2016-2017

Step-6: SQL Scripts for the Questions:


1.Find the names of the aircraft such that all pilots certified to operate them have salaries more than
Rs.80,000.
SQL> SELECT distinct E.ename,A.aname
FROM Aircraft A, Certified C, Employees E
WHERE A.AID=C.AID AND E.EID=C.EID AND E.SALARY>80000

Copyright Dept. of ISE, BMSIT-Bengaluru

Database Application Laboratory

2016-2017

2. For each pilot who is certified for more than three aircrafts, find the eid and the maximum cruising range of
the aircraft for which she or he is certified.
SQL> SELECT C.eid, MAX(A.cruisingrange)
FROM Certified C, Aircraft A
WHERE C.aid = A.aid
GROUP BY C.eid
HAVING COUNT (*) > 3

3.Find the names of pilots whose salary is less than the price of the cheapest route from bengaluru to
Frankfurt.
SQL>SELECT E.*
FROM Employees E, Flights F
WHERE F.from1 = 'BANGLORE' AND F.to1 = 'FRANKFURT' AND E.salary <F.price

4. For all the aircraft with cruising range over 1000 kms, find the name of the aircraft and the average salary
of all pilot certified for this aircraft.

Copyright Dept. of ISE, BMSIT-Bengaluru

Database Application Laboratory

2016-2017

SQL>select avg(salary),aname
from
(SELECT E.*,A.*
FROM Certified C, Employees E, Aircraft A
WHERE A.aid = C.aid AND E.eid = C.eid AND A.cruisingrange > 1000)
group by aname

5.Find the name of pilots certified for some boeing aircraft.


SQL> SELECT DISTINCT E.ename
FROM Employees E, Certified C, Aircraft A
WHERE E.eid = C.eid AND
C.aid = A.aid AND
A.aname = 'Boeing'

6.Find the aircraft ids for all aircraft that can be used on routes from Bengaluru to New delhi.
SQL> SELECT A.aid
FROM Aircraft A
WHERE A.cruisingrange >
( SELECT MIN (F.distance)
FROM Flights F
WHERE F.from1 = 'BANGLORE' AND F.to1 = 'DELHI' )

Copyright Dept. of ISE, BMSIT-Bengaluru

Database Application Laboratory

Copyright Dept. of ISE, BMSIT-Bengaluru

2016-2017

Database Application Laboratory

EXERCISE 3. STUDENT ENROLLMENT DATABASE


I.

CREATION OF THE TABLES WITH NECESSARY CONSTRAINTS


CREATE TABLE STUDENT
(
REGNO VARCHAR2 (10),
NAME VARCHAR2 (14),
MAJOR VARCHAR2 (10),
BDATE DATE,
PRIMARY KEY (REGNO)
);
CREATE TABLE COURSE
(
COURSE NUMBER (4), CNAME
VARCHAR2 (14), DEPT
VARCHAR2 (10),
PRIMARY KEY (COURSE)
);
CREATE TABLE ENROLL
(
REGNO VARCHAR2 (10),
COURSE NUMBER (4),
SEM
NUMBER (4),
MARKS NUMBER (3),
FOREIGN KEY (REGNO) REFERENCES STUDENT (REGNO),
FOREIGN KEY (COURSE) REFERENCES COURSE (COURSE)
);
CREATE TABLE TEXT
(
ISBN
NUMBER (5),
BOOK_TITLE VARCHAR2 (13) NOT NULL,
PUBLISHER
VARCHAR2
(12),
AUTHOR
VARCHAR2
(12),
PRIMARY KEY (ISBN));

Copyright Dept. of ISE, BMSIT-Bengaluru

2016-2017

Database Application Laboratory

2016-2017

CREATE TABLE BOOK_ADOPTION


(
COURSE NUMBER (5),
SEM
NUMBER (3),
ISBN
NUMBER (4),
FOREIGN KEY (COURSE) REFERENCES COURSE (COURSE),
FOREIGN KEY (ISBN) REFERENCES TEXT (ISBN)
);
II.

INSERTION OF RECORDS INTO THE RELATIONS


INSERT INTO STUDENT
VALUES ('&REGNO','&NAME','&MAJOR','&BDATE');
INSERT INTO COURSE
VALUES (&COURSE,'&CNAME','&DEPT');
INSERT INTO ENROLL
VALUES ('&REGNO', &COURSE, &SEM, &MARKS);
INSERT INTO TEXT
VALUES (&ISBN,'&BOOK_TITLE','&PUBLISHER','&AUTHOR');
INSERT INTO BOOK_ADOPTION
VALUES (&COURSE, &SEM, &ISBN);

III.

VIEW THE RECORDS OF THE RELATIONS

STUDENT
REGNO
---------------1AY01IS01
1AY01CS02
1AY01ME03
1AY01EC04

NAME
--------------VINOD
DIVYA
MAHESH
ARUN

Copyright Dept. of ISE, BMSIT-Bengaluru

MAJOR
-------------ISE
CSE
MECH
E&C

BDATE
--------------02-JAN-84
12-OCT-85
23-SEP-82
21-FEB-84

Database Application Laboratory

1AY01CS05

COURSE
COURSE_NO
----------------11
22
33
44
55

2016-2017

NANDU

CNAME
------------DCS
ADA
CN
TD
MUP

CSE

20-MAY-79

DEPT
--------------CSE
CSE
E&C
MECH
E&C

ENROLL
REGNO
COURSE
----------------- -------------1AY01IS01
11
1AY01IS01
22
1AY01CS02
33
1AY01ME03
22
1AY01CS05
44

SEM
-------5
3
6
5
5

MARKS
------------76
90
55
75
7

ISBN

PUBLISHER

TEXT

--------7722
1144
4400
5566
3388

BOOK_TITLE
-------------------VB
DSWITHC
CPROG
CN
MP

BOOK_ADOPTION
COURSE _NO
--------------11
22
11
11

----------------PHI
SAPNA
PHI
PHI
TATA

SEM
---------3
4
5
8

Copyright Dept. of ISE, BMSIT-Bengaluru

ISBN
----------7722
7722
4400
5566

AUTHOR
--------------------HOLZNER
NANDAGOPAL
BALAGURU
TENENBAUM
BREY

Database Application Laboratory

55
44
44
33

2016-2017

4
4
7
5

3388
5566
3388
3388

IV.
DEMONSTRATE HOW YOU ADD NEW TEXT BOOK TO THE DATABASE AND MAKE
THAT BOOK IS ADOPTED BY SOME DEPARTMENT.
INSERT INTO TEXT VALUES (1000,'ORACLE','MINIYA','BARY');
INSERT INTO COURSE VALUES (10,'ORACLE','ISE');
INSERT INTO BOOK_ADOPTION VALUES (10, 1, 1000);

V.
PRODUCE A LIST OF TEXTBOOKS (INCLUDE COURSE, BOOK_ISBN, BOOK_TITLE) IN
THE ALPHABETIC ORDER FOR COURSES OFFERED BY THE CSE DEPT THAT USE MORE
THAN TWO BOOKS.
SELECT C.COURSE, CNAME, B.ISBN, BOOK_TITLE
FROM COURSE C, BOOK_ADOPTION B, TEXT T
WHERE C.COURSE=B.COURSE AND B.ISBN=T.ISBN AND
C.COURSE IN (
SELECT C1.COURSE
FROM COURSE C1, BOOK_ADOPTION B1
WHERE DEPT=CSE AND C1.COURSE=B1.COURSE
GROUP BY C1.COURSE
HAVING COUNT (*)>2)
ORDER BY CNAME;
VI.
LIST ANY DEPARTMENT THAT HAS ALL ITS ADOPTED BOOKS PUBLISHED BY A
SPECIFIC PUBLISHER.
SELECT DISTINCT C.DEPT FROM COURSE C
WHERE C.DEPT
IN ( SELECT C1.DEPT
FROM COURSE C1, BOOK_ADOPTION B, TEXT T
WHERE T.PUBLISHER='PHI' AND B.ISBN=T.ISBN AND
C1.COURSE=B.COURSE)
AND C.DEPT NOT
IN ( SELECT C2.DEPT FROM COURSE C2, BOOK_ADOPTION B1,TEXT T1
WHERE T1.PUBLISHER! ='PHI' AND C2.COURSE=B1.COURSE
AND B1.ISBN=T1.ISBN
);
Copyright Dept. of ISE, BMSIT-Bengaluru

Database Application Laboratory

EXERCISE 4. BOOK DEALER DATABASE

I.

CREATE ALL THE TABLES WITH NECESSARY CONSTRAINTS

CREATE TABLE AUTHOR


(
AUTHORID NUMBER(5), ANAME
VARCHAR (15),
ACITY
VARCHAR2 (15),
ACOUNTRY VARCHAR (15),
PRIMARY KEY (AUTHORID)
);
CREATE TABLE PUBLISHER
(
PUBLISHERID NUMBER (5), PNAME
VARCHAR (15),
PCITY
VARCHAR2 (15),
PCOUNTRY
VARCHAR (15),
PRIMARY KEY (PUBLISHERID)
);
CREATE TABLE CATEGORY
(
CATEGORYID NUMBER (5),
DESCRIPTION VARCHAR (15),
PRIMARY KEY (CATEGORYID)
);

CREATE TABLE CATALOG


(
BOOKID
NUMBER (5),
TITLE
VARCHAR2 (15),
AUTHORID
NUMBER (5),
PUBLISHERID NUMBER (5),
CATEGORYID NUMBER (5), YEAR

Copyright Dept. of ISE, BMSIT-Bengaluru

2016-2017

Database Application Laboratory

2016-2017

NUMBER (5), PRICE


NUMBER (10,3),
PRIMARY KEY (BOOKID),
FOREIGN KEY (AUTHORID) REFERENCES AUTHOR(AUTHORID),
FOREIGN KEY(PUBLISHERID) REFERENCES PUBLISHER(PUBLISHERID),
FOREIGN KEY (CATEGORYID) REFERENCES CATEGORY(CATEGORYID)
);
CREATE TABLE ORDER_DETAILS
(
ORDERNO NUMBER (5),
BOOKID
NUMBER
(5),
QUANTITY NUMBER (5),
PRIMARY KEY (ORDERNO, BOOKID),
FOREIGN KEY (BOOKID) REFERENCES CATALOG (BOOKID)
);
II.

INSERT THE RECORDS INTO THE RELATIONS


INSERT INTO AUTHOR
VALUES (&AUTHORID,'&ANAME','&ACITY','&ACOUNTRY');
INSERT INTO PUBLISHER
VALUES (&PUBLISHERID,'&PNAME','&PCITY','&PCOUNTRY');
INSERT INTO CATEGORY
VALUES (&CATEGORYID,'&DESCRIPTION');
INSERT INTO CATALOG
VALUES (&BOOKID,'&TITLE', &AUTHORID, &PUBLISHERID,
&CATEGO RYID, &YEAR, &PRICE);
INSERT INTO ORDER_DETAILS
VALUES (&ORDERNO,&BOOKID,&QUANTITY);

III.

VIEW THE RELATIONS

AUTHOR

Copyright Dept. of ISE, BMSIT-Bengaluru

Database Application Laboratory

AUTHORID
---------------1000
2000
3000
4000
5000
PUBLISHER

2016-2017

ANAME
--------- -----MANJUNATH
TONY
TONIER
TENNENBAUM
BALGURU

PUBLISHERID
PNAME
----------- -------- ----- -------11
WEILY
22
PHI
33
SAPNA
44
TMH
55
WROX

ACITY
ACOUNTRY
---------------------------------------BANGALORE
INDIA
HAYHOOD
USA
NEWYORK
USA
LONDON
UK
CHENNAI
INDIA

PCITY
---- ---------------NEWDELHI
CALIFORNIA
BANGALORE
NEWYORK
TEXAS

PCOUNTRY
-----------INDIA
USA
INDIA
USA
USA

CATEGORY
CATEGORYID
---------- --------1
2
3
4
5

DESCRIPTIONM
-----------------------OS
LANGUAGES
HARDWARE
ALGORITHMS
INTERNET

CATALOG
BOOKID
-----------1
2
3
4
5

TITLE AUTHORID
PUBLISHERID CATEGORYID
YEAR
PRICE
---------- ------------------ ------------------------------------- --------- ----------DSC
1000
33
2
2000
190
N/W
4000
44
4
2002
365
VB-6
2000
11
2
2000
300
SE
4000
44
5
2002
500
ADA
1000
33
4
2000
200

ORDER_DETAILS

Copyright Dept. of ISE, BMSIT-Bengaluru

Database Application Laboratory

2016-2017

ORDERNO
BOOKID QUANTITY
--------- ---------- ---------------------------100
1
100
200
1
20
300
2
20
400
3
50
500
5
8
IV.
GIVE THE DETAILS OF THE AUTHORS WHO HAVE TWO OR MORE BOOKS IN THE
CATALOG AND THE PRICE OF THE BOOKS IS GREATER THAN THE AVERAGE PRICE OF THE
BOOKS IN THE CATALOG & THE YEAR OF PUBLICATION IS AFTER 2000.
SELECT * FROM AUTHOR A
WHERE A.AUTHORID
IN (SELECT C.AUTHORID
FROM CATALOG C
WHERE C.PRICE > (SELECT AVG (PRICE) FROM CATALOG)
AND
C.YEAR>2000
GROUP BY C.AUTHORID
HAVING COUNT (*)>=2
);
V.

FIND THE AUTHOR OF THE BOOK WHICH HAS MAXIMUN SALES


SELECT ANAME
FROM AUTHOR
WHERE AUTHORID
IN ( SELECT AUTHORID
FROM CATALOG
WHERE BOOKID
IN ( SELECT BOOKID
FROM ORDER_DETAILS
GROUP BY BOOKID
HAVING SUM (QUANTITY) >= ALL
( SELECT SUM (QUANTITY)
FROM ORDER_DETAILS GROUP BY BOOKID)
)
);

Copyright Dept. of ISE, BMSIT-Bengaluru

Database Application Laboratory

2016-2017

VI.
DEMONSTRATE HOW YOU INCREASE THE PRICE OF BOOK PUBLISHED BY A SPECIFIC
PUBLISHER BY 10%
UPDATE CATALOG SET PRICE = PRICE+PRICE*0.10
WHERE PUBLISHERID
IN (
SELECT P.PUBLISHERID
FROM PUBLISHER P
WHERE P.PNAME='&PNAME'
);

Copyright Dept. of ISE, BMSIT-Bengaluru

Database Application Laboratory

2016-2017

EXERCISE 5. BANKING ENTERPRISE DATABASE


I.

CREATION OF TABLES WITH NECESSARY CONSTRAINTS

CREATE TABLE BRANCH


(
BRANCH_NAME VARCHAR2 (15),
BRANCH_CITY
VARCHAR2
(15),
ASSETS
NUMBER (10, 3),
PRIMARY KEY (BRANCH_NAME)
);
CREATE TABLE CUSTOMER
(
CUSTOMER_NAME
VARCHAR2
CUSTOMER_ADDRESS
VARCHAR2
CUSTOMER_CITY
VARCHAR2
PRIMARY KEY (CUSTOMER_NAME)
);

(15),
(15),
(15),

CREATE TABLE ACCOUNT


(
ACCOUNT_NUMBER
VARCHAR2
(15),
BRANCH_NAME
VARCHAR2
(15),
BALANCE
NUMBER (11, 4),
PRIMARY KEY (ACCOUNT_NUMBER),
FOREIGN KEY (BRANCH_NAME) REFERENCES BRANCH (BRANCH_NAME) ON
DELETE CASCADE
);
CREATE TABLE DEPOSITOR
(
CUSTOMER_NAME
VARCHAR2 (15),
ACCOUNT_NUMBER VARCHAR2 (15),
FOREIGN KEY (CUSTOMER_NAME) REFERENCES CUSTOMER (CUSTOMER_NAME)
ON DELETE CASCADE,
FOREIGN KEY (ACCOUNT_NUMBER) REFERENCES ACCOUNT (ACCOUNT_NUMBER)
ON DELETE CASCADE);

Copyright Dept. of ISE, BMSIT-Bengaluru

Database Application Laboratory

2016-2017

CREATE TABLE LOAN


(
LOAN_NUMBER NUMBER(6),
BRANCH_NAME VARCHAR2 (15),
AMOUNT
NUMBER (10, 4),
PRIMARY KEY (LOAN_NUMBER),
FOREIGN KEY (BRANCH_NAME) REFERENCES BRANCH (BRANCH_NAME) ON
DELETE CASCADE
);
CREATE TABLE BORROWER
(
CUSTOMER_NAME VARCHAR2 (15),
LOAN_NUMBER
NUMBER (5),
FOREIGN KEY (CUSTOMER_NAME) REFERENCES CUSTOMER CUSTOMER_NAME) ON
DELETE CASCADE,
FOREIGN KEY (LOAN_NUMBER) REFERENCES LOAN (LOAN_NUMBER) ON DELETE
CASCADE
);
II.

INSERTION OF TUPLES INTO THE RELATION


INSERT INTO BRANCH
VALUES('&BRANCH_NAME','&BRANCH_CITY',&ASSETS);
INSERT INTO CUSTOMER
VALUES('&CUSTOMER_NAME','&CUSTOMER_ADDRESS',
'&CUSTOMER_CITY');
INSERT INTO ACCOUNT
VALUES('&ACCOUNT_NUMBER','&BRANCH_NAME',&BALANCE);
INSERT INTO DEPOSITOR
VALUES('&CUSTOMER_NAME','&ACCOUNT_NUMBER');
INSERT INTO LOAN
VALUES(&LOAN_NUMBER,'&BRANCH_NAME',&AMOUNT);
INSERT INTO BORROWER VALUES('&CUSTOMER_NAME',&LOAN_NUMBER);

Copyright Dept. of ISE, BMSIT-Bengaluru

Database Application Laboratory

III.

2016-2017

VIEW THE RECORDS

BRANCH
BRANCH_NAME
--------------------------KUMBALAGODU
JAYANAGAR
VIJAYANAGAR
KUVEMPUNAGAR
GOKULUM

BRANCH_CITY
-----------------------BANGALORE
BANGALORE
BANGALORE
MYSORE
MYSORE

ASSETS
------------200000
100000
300000
100000
100000

CUSTOMER
CUSTOMER_NAME
CUSTOMER_ADDRES
CUSTOMER_CITY
--------------- --------------- -------------------------------------------------------RAVI
VIJAYANAGAR
BANGALORE
HARISH
BULLTEMPLEROAD
BANGALORE
BHAVYA
GANDHIBAZAR
BANGALORE
SRIRAM
KUMBALAGODU
BANGALORE
RANI
MGROAD
BANGALORE
ACCOUNT
ACCOUNT_NUMBER
BRANCH_NAME
BALANCE
--------------- -----------------------------------------------------------------101
KUMBALAGODU
2000
102
KUMBALAGODU
3000
103
VIJAYANAGAR
4000
104
KUVEMPUNAGAR
5000
105
GOKULUM
5000
106
JAYANAGAR
6000
107
KUMBALAGODU
5000

Copyright Dept. of ISE, BMSIT-Bengaluru

Database Application Laboratory

2016-2017

DEPOSITOR
CUSTOMER_NAME
ACCOUNT_NUMBER
--------------- ----------------------------------------- RAVI
101
HARISH
102
RAVI
103
SRIRAM
104
RAVI
107
RAVI
106
LOAN
LOAN_NUMBER
BRANCH_NAME
----------- --------------- --------------------------201
KUMBALAGODU
202
JAYANAGAR
203
VIJAYANAGAR
204
KUVEMPUNAGAR
205
GOKULUM
BORROWER
CUSTOMER_NAME
-----------------------RAVI
HARISH
BHAVYA
SRIRAM
RANI

LOAN_NUMBER
-----------------------201
202
203
204
205

Copyright Dept. of ISE, BMSIT-Bengaluru

AMOUNT
----------10000
20000
30000
40000
50000

Database Application Laboratory

2016-2017

IV.
FIND ALL CUSTOMERS WHO HAVE ACCOUNT AT ALL THE BRANCHES LOCATED IN A
SPECIFIC CITY
SELECT * FROM CUSTOMER C
WHERE
NOT EXISTS ( SELECT BRANCH_NAME
FROM BRANCH
WHERE BRANCH_CITY ='&BRANCH_CITY'
MINUS
SELECT A.BRANCH_NAME
FROM ACCOUNT A, DEPOSITOR D
WHERE D.ACCOUNT_NUMBER=A.ACCOUNT_NUMBER
AND C.CUSTOMER_NAME=D.CUSTOMER_NAME
);
V.

FIND ALL CUSTOMERS WHO HAVE AT LEAST TWO ACCOUNTS AT THE MAIN BRANCH
SELECT * FROM CUSTOMER C
WHERE
EXISTS ( SELECT CUSTOMER_NAME,COUNT(D.CUSTOMER_NAME)
FROM
DEPOSITOR D, ACCOUNT A
WHERE D.ACCOUNT_NUMBER=A. ACCOUNT_NUMBER
AND C.CUSTOMER_NAME=D.CUSTOMER_NAME AND
A.BRANCH_NAME='KUMBALAGODU' GROUP BY
D.CUSTOMER_NAME
HAVING COUNT (D.CUSTOMER_NAME)>=2
);

VI.
DEMONSTRATE HOW YOU DELETE ALL THE TUPLES AT EVERY BRANCH LOCATED IN
A PARTICULAR CITY.
DELETE FROM ACCOUNT
WHERE BRANCH_NAME
IN ( SELECT B.BRANCH_NAME
FROM BRANCH B
WHERE B.BRANCH_CITY='BANGALORE'
);

Copyright Dept. of ISE, BMSIT-Bengaluru

Database Application Laboratory

2016-2017

Creation of suitable Front End using Visual Basic


for querrying and Displaying the results
STEP 1:

Create the necessary FORM using label, textbox & button controls.

STEP 2:

Establish connectivity between User interface screens & Database


1.
2.
3.
4.

Select components from the project menu


Select MS ADO Data Control 6.0 ( OLE DB) & click OK
Add the ADODC from the ToolBox to the form & name the control adcBranch
Set ConnectString, CommandType & Record Source properties of the ADO Data
Control as follows
5. Right click on adcBranch data control & select ADODC Properties

Copyright Dept. of ISE, BMSIT-Bengaluru

Database Application Laboratory

6. To set the connection [property click on BUILD button & You get a
Data Link Dialog box as follows

Copyright Dept. of ISE, BMSIT-Bengaluru

2016-2017

Database Application Laboratory

2016-2017

7. Select MS OLE DB Provider for Oracle & Click on NEXT button


8. Enter User name & Password & Test connection
9. Click OK. Click Authentication TAB & enter User Name & password & Click on
APPLY button.

Copyright Dept. of ISE, BMSIT-Bengaluru

Database Application Laboratory

2016-2017

10. Click on RecordSource TAB & select 2 - adCmdTable. Wait till the tables
are listed in the Table combo Box
Copyright Dept. of ISE, BMSIT-Bengaluru

Database Application Laboratory

2016-2017

11. Select the BRANCH table & click on APPLY


12. Click on OK button to complete the settings
STEP 3:

Binding the FORM Controls to the Table Fields


1. Select the txtBranchName control, right click & select properties.
2. In the properties windows set DataSource & DataField ( In that order)
Select adcBranch in DataSource & BRANCH_NAME in DataField as shown below.

Copyright Dept. of ISE, BMSIT-Bengaluru

Database Application Laboratory

STEP 4:

Add Events to BUTTON controls


1. Double click on the New button & add the following code
Private Sub New_Click()
adcBranch.Recordset.AddNew
End Sub
2. Double click on the Save button & add the following code
Private Sub Save_Click()
adcBranch.Recordset.Save
MsgBox "Record Added Successfully"
End Sub
3. Double click on the Update button & add the following code
Private Sub Update_Click()
adcBranch.Recordset.Updat
e adcBranch.Recordset.Save
MsgBox "Record Updated Successfully"
Copyright Dept. of ISE, BMSIT-Bengaluru

2016-2017

Database Application Laboratory

2016-2017

End Sub
4. Double click on the Delete button & add the following code
Private Sub Delete_Click()
adcBranch.Recordset.Delete
adcBranch.Recordset.Save
MsgBox "Record Deleted..."
adcBranch.Recordset.MoveNext
End Sub
5. Execute the program
1. Select Run menu
2. Click on start sub menu

*********

Copyright Dept. of ISE, BMSIT-Bengaluru

Database Application Laboratory

1. Define Database

2016-2017

VIVA Questions

2. Define Database Management System


3. List the advantages of DBMS approach
4. List the main characteristics of Database approach
5. What are the types of End users?
6. Define Conceptual Schema
7. Define Physical Schema
8. Define Program data independence
9. Define the term Metadata and catalog
10. What is meant by data abstraction?
11. Explain schema, instance & schema diagram
12. Define the following terms Entity, Strong Entity, Weak entity
13. Define Attribute
14. Difference between Strong and Weak entity
15. Difference between Relationship and Identifying Relationship
16. Define the following terms Cardinality Ratio, Total Participation , Partial participation
17. List different types of attributes
18. Difference between Stored and Derived attribute
19. Difference between Simple and Composite attribute
20. Difference between Single value and Multi value attribute
21. What is the role of DBA and DBD
22. Explain Data model
23. List Different types of Data Models
24. What is a candidate key? Give an example.
25. What is a primary key? Give an example.
26. What is an alternate key? Give an example.
27. What do you mean by foreign key?
28. What are domain constraints?
Copyright Dept. of ISE, BMSIT-Bengaluru

Database Application Laboratory

2016-2017

29. What is entity integrity?


30. What is a referential integrity?
31. Explain degree of relationship
32. Explain Primary Key, Foreign Key, Candidate Key
33. List Different types of Unary Operators
34. List Different types of Binary Operators
35. With syntax Explain the SELECT operator, PROJECT operator
36. Explain Join operation and different types of Join operations
37. Difference between JOIN and Cartesian Product
38. Explain with syntax Division and Cartesian Product operation
39. What is the difference between JOIN and Natural JOIN operation
40. What is normalization explain the importance of Normalization
41. Define Functional Dependence, Fully functional Dependence, and Transitive dependence
42. 1NF, 2NF,3NF are based on which property
43. Difference between 3NF and BCNF
44. Explain 4NF and 5NF are based on what concepts
45. List different DDL commands
46. List different DML commands
47. List different DCL commands
48. What are views? How they are created?
49. What is the purpose of group by clause in the SELECT statement?
50. What are Aggregate functions?
51. How many Aggregate functions are available in SQL and list them
52. Define group by clause
53. Define order by clause
54. Define nested query
55. List different types of data types available in SQL2
56. Define NULL value
57. Define Relation, Attribute, Tuple
Copyright Dept. of ISE, BMSIT-Bengaluru

Database Application Laboratory

58. Define Degree of a relation


59. Explain the ACID properties of a transaction
60. What is concurrency control?
61. What are different types of locks? Distinguish between them.
62. What is database recovery? Why backups are important?
63. Define triggers
64. Define assertion and how to implement in SQL
65. Define Embedded SQL
66. What is CHECK constraint
67. Write the syntax of Complete SELECT command
68. What would be the output of the following select statement:
SELECT * FROM A, B (A has 10 records and B has 2 records)

Copyright Dept. of ISE, BMSIT-Bengaluru

2016-2017

BMS Institute of Technology & Management


Yelahanka, Bangalore-560 064

System Software and Operating System Lab


(10CSL58)
Laboratory Manual
For
V Semester BE
Information Science & Engineering

Department of Information Science & Engineering


BMS Institute of Technology & Management
Yelahanka, Bangalore-560 064

BMS Institute of Technology & Management


Yelahanka, Bangalore-560 064

System Software and Operating System Lab


(10CSL58)
Laboratory Manual
For
V Semester BE
Information Science & Engineering

Prepared by
Mrs. Pushpha S K

Reviewed by
HOD/ISE

Department of Information Science & Engineering

BMS Institute of Technology & Management


Yelahanka, Bangalore-560 064

CONTENTS
Sl.No

1.

2.

5.
6.

Particulars
PART A
LEX and YACC Programs:
Design, develop, and execute the following programs using LEX:
1a: Program to count the number of characters, words, spaces and lines
in a given input file.
1b: Program to count the numbers of comment lines in a given C
program. Also eliminate them and copy the resulting program into
separate file.
2a. Program to recognize a valid arithmetic expression and to
recognize the identifiers and operators present. Print them
separately.
2b. Program to recognize whether a given sentence is simple or
compound.
Program to recognize and count the number of identifiers in a given
input file.
Design, develop and execute the following programs using YACC:
4a. Program to recognize a valid arithmetic expression nvolving
operators +,-,* and /.
4b. Program to recognize a valid variable which starts with a letter,
followed by any number of letters or digits.
5a. Program to evaluate an arithmetic expression involving operators
+, -, * and /.
5b. Program to recognize strings aaab, abbb, ab and a using
grammar (anbn, n>=0).
Program to recognize the grammar (anb, n>=10).
PART B
UNIX Programming:
Design, develop, and execute the following programs:
7a. Non-recursive shell scripts that accepts any number of arguments
and prints them in the reverse order, (For example, if scripts is named
rargs, then executing rargs A B C should produce C B A on the
Standard output)
7b. C Program that creates a child process to read commands from the
standard input and execute them ( a minimal implementation of a shelllike program). You can assume that no arguments will be passed to the
commands to be executed.
8a. Shell Script that accepts two file names as arguments, checks if the
permissions for these files are identical, outputs the common
permissions. Otherwise outputs each file name followed by its
permissions.
8b. C Program to create a file with 16 bytes of arbitrary data from the
beginning and another 16 bytes of arbitrary data from an offset of 48.
Display the file contents to demonstrate how the hole in file is handled.
9a. Shell Scripts that accepts file names specified as arguments and
creates a shell scripts that contains this file as well as the code to

Page.No

10

11

12
13

recreate these files. Thus if the script generated by your script is


executed it would recreate the original files (This is same as the
bundle script described by Brain W. Kernighan and Rob Pike in
The Unix Programming Environment, Prentice- Hall India)
9b. C Program to do the following: using fork() create a child process.
The child process prints its own process-id and id of its parent and then
exits. The parent process waits for its child to finish (by executing the
wait()) and prints its own process-id and the id of its child process and
then exits.
Operating Systems:
Design, develop and execute a program in C/C++ to simulate the
working of shortest remaining time and Round- Robin scheduling
Algorithms. Experiment with different quantum sizes for the RoundRobin Algorithm. In all cases, determine the average turn-around time.
The input can be read from keyboard or from a file.
Using OpenMP, Design, develop and run a multi-threaded program to
generate and print Fibonacci Series. One thread has to generate the
numbers up to the specified limit and another thread has to print them.
Ensure proper synchronization.
Design, Develop and run a program to implement the Bankers
Algorithm. Demonstrate its working with different data Values
Viva Questions

SS and OS Lab Manual


1

10CSL58

PART A
1 a: Program to count the number of characters, words, spaces and lines in a given input
file.
b: Program to count the numbers of comment lines in a given C program. Also eliminate
them and copy the resulting program into separate file.

1a.l
%{
#include <stdio.h>
int character=0, word=0, line=0, blank=0;
%}
%%
[^ \t\n]+
[\n]
[
]

{word++, character+=yyleng;}
{line++;}
{blank++;}

%%
int main(int argc ,char * argv)
{
if(argc==2)
{
yyin=fopen(argv[1],r);
yylex();
printf(number of characters=%d, word=%d, line=%d, blank=%d,character,
word,line, blank);
}
else
{
printf(usage file);
return 0;
}
}
Output:
lex 1a.l
cc lex.yy.c -ll
./a.out file.txt
no of chars=13,no of words=5,no of blanks=4,no of lines=1
file.txt
hi this is ss lab

Dept. of ISE, BMSIT&M

SS and OS Lab Manual


1

10CSL58

1b.l
%{
#include<stdio.h>
int c=0;
%}
%%
[/][*][^ "*/"]*[*][/] {c++;}
[/][/][a-zA-Z0-9]*[^ \n] {c++;}
[ a-zA-Z0-9] {fprintf(yyout,"%s",yytext);}
%%
int main(int argc,char *argv[])
{
if(argc>=3)
{
yyin=fopen(argv[1],"r");
yyout=fopen(argv[2],"w");
yylex();
printf("\n No of comment lines=%d",c);
}
return 0;
}
Output:
lex 1b.l
cc lex.yy.c -ll
./a.out 1b.c 1bb.c
no of comment lines=2
2. a) Program to recognize a valid arithmetic expression and to recognize the
identifiers and operators present. Print them separately.
2a.l
%{
#include<stdio.h>
#include<stdlib.h>

Dept. of ISE, BMSIT&M

SS and OS Lab Manual


1

10CSL58

int oper=0,b=0,id=0;
%}
%%
[ +-/* ] { oper++; printf("%s is an operator\n",yytext); }
[A-Za-z0-9]+ { id++; printf("%s is an operand.\n",yytext); }
[(] { b++; }
[)] { b--; }
%%
intyywrap()
{
return 1;
}
int main()
{
printf("\n enter expression");
yylex();
if( (b==0) && (oper==id-1) )
{
printf("\n valid expression.");
printf("\n There are %d operators.",oper);
printf("\n There are %d operands.",id);
exit(0);
}
else
{
printf("\n invalid expression");
return 0;
}
}

Output:
lex 2a.l
cc lex.yy.c -ll
./a.out

Dept. of ISE, BMSIT&M

SS and OS Lab Manual


1

10CSL58

Enter expression a+b*c


a is an operand.
+ is an operator
b is an operand.
* is an operator
c is an operand.
valid expression.

[ Press CTRL+D]

There are 2 operators.


There are 3 operands.

b) Program to recognize whether a given sentence is simple or compound.


%{
int flag=0;
%}
%%
(" "[aA][nN][dD]" ")|(" "[bB][uU][tT]" ")|(" "[oO][rR]" ")|(" "[nN][oO][tT]" ") { flag=1; }
.

%%
int main()
{
printf("\n enter the sentence");
yylex();
if(flag==1)
printf("compound sentence.");
else
printf("simple sentence.");
return 0;
}
Output:
lex 2b.l
cc lex.yy.c -ll
./a.out
enter the sentence ss and os lab
compound sentence.

Dept. of ISE, BMSIT&M

SS and OS Lab Manual


1

10CSL58

./a.out
enter the sentence this is ss lab
simple sentence.
3. Program to recognize and count the number of identifiers in a given input file.
3.l
%{
#include<stdio.h>
int id=0;
%}
%%
("int "|"float "|"char "|"long int "|"short int ") { int ch;
ch=input();
while(1)
{
if(ch==',')
id++;
else if(ch==';')
break;
ch=input();
}
id++;
}
%%
int main(int argc,char *argv[])
{
if(argc<=3)
{
yyin=fopen(argv[1],"r");
yylex();
printf("\n Number of ids=%d",id);
}
}
Output:
lex 3.l
cc lex.yy.c -ll
./a.out 3input.c
main()
{
}
Number of ids=7
3input.c
main()
{
Dept. of ISE, BMSIT&M

SS and OS Lab Manual


1

10CSL58

inta,b,c,d;
floate,f;
char g;
c=a+b;
printf("c=%d",c);
}

Design, develop, and execute the following programs using YACC:


4. a) Program to recognize a valid arithmetic expression that uses operators +, -, *
and /.
4a.l
%{
#include "y.tab.h"
%}
%%
[A-Za-z]+ {return L;}
[0-9]+

{return N;}

\n

{return 0;}

{return yytext[0];}

%%

4a.y
%{
#include<stdio.h>
#include<stdlib.h>
%}
%token N
%left

'+' '-'

%left

'*' '/'

%%
S:P
;
P : P '+' P
| P '-' P
| P '*' P
| P '/' P
Dept. of ISE, BMSIT&M

SS and OS Lab Manual


1

10CSL58

| '(' P ')'
|N
|L;
%%
main()
{
printf("enter an expression");
yyparse();
printf("\n valid.");
}
yyerror()
{
printf("INVALID EXPRESSION");
exit(0);
}
Output:
lex 4a.l
yacc -d 4a.y
cc lex.yy.c y.tab.c -ll -c
./a.out
enter an expression

a+b*c-d

valid.
./a.out
enter an expression

a+b-

Invalid Expression

b) Program to recognize a valid variable, which starts with a letter, followed by any
number of letters or digits.
4b.l
%{
#include"y.tab.h"
%}
%%
[a-zA-Z]+ {return C;}

Dept. of ISE, BMSIT&M

SS and OS Lab Manual


1

10CSL58

[0-9]+

{return N;}

\n

{return 0;}

{return

yytext[0];}

%%
4b.y
%{
#include<stdio.h>
#include<stdlib.h>
%}
%token

%%
s: C s1;
s1: N s1
| C s1
|

%%
main()
{
printf("enter a string:");
if(yyparse( )==0)
printf("valid string\n");
}
yyerror()
{
printf("\n invalid string");
exit(0);
}

Output:
lex 4b.l
yacc -d 4b.y
cc lex.yy.o

y.tab.o -ll

cc lex.yy.c

y.tab.c -c

./a.out

Dept. of ISE, BMSIT&M

SS and OS Lab Manual


1

10CSL58

enter a string:abc5657
valid string
./a.out
enter a string:45abc
invalid string

5. a) Program to evaluate an arithmetic expression involving operators +, -, * and /.


5a.l
%{
#include"y.tab.h"
extern

int

yylval;

%}
%%
[0-9]+

{yylval=atoi(yytext);

\n

return 0;

{return

return N;}

yytext[0];}

%%
5a.y
%{
#include<stdio.h>
#include<stdlib.h>
%}
%token

%left

'+' '-'

%left

'*' '/'

%%
S:P { printf("result is %d\n",$1);
exit(0); };

P:P'+'P{$$=$1+$3;}
| P'-'P{$$=$1-$3;}
|P'*'P{$$=$1*$3;}
|P'/'P{if($3==0)

Dept. of ISE, BMSIT&M

SS and OS Lab Manual


1

10CSL58

{
printf("DIVIDE BY ZERO.\n");
exit(0);
}
$$=$1/$3;
}
|'(' P ')' { $$=$2; }
|N { $$=yyval; }
;
%%
main()
{
printf("enter an arithmetic expression");
yyparse();
}
yyerror()
{
printf("invalid expression");
exit(0);
}

Output:
lex 5a.l
yacc -d 5a.y
cc lex.yy.cy.tab.c -ll -ly
./a.out
enter an arithmetic expression4+6-3*5
result is -5
./a.out
enter an arithmetic expression6*8+2-30/6
result is 45
b) Program to recognize strings aaab, abbb, ab and a using the grammar
anbn, n>= 0).

Dept. of ISE, BMSIT&M

10

SS and OS Lab Manual


1

10CSL58

5b.l
%{
#include "y.tab.h"
%}
%%
a

{return A;}

{return B;}

\n

{return 0;}

{return yytext[0];}

%%
5b.y
%{
#include<stdio.h>
#include<stdlib.h>
%}
%token

%%
s:AsB
|
;
%%
main( )
{
printf("\nEnter string:\n");
yyparse( );
printf("\nValidexp\n");
}
yyerror()
{
printf("\nInvalid expression\n");
exit(0);
}
Output:
lex 5b.l

Dept. of ISE, BMSIT&M

11

SS and OS Lab Manual


1

10CSL58

yacc -d 5b.y
cc lex.yy.c y.tab.c -ll -c
./a.out
1. Enter string:
aaab
Invalid expression
./a.out
2. Enter string:
ab
Valid exp

6. Program to recognize the grammar (anb, n>= 10).


6.l
%{
#include"y.tab.h"
%}
%%
a

{return A;}

{return B;}

\n

{return 0;}

{return yytext[0];}

%%
6.y
%{
#include<stdio.h>
#include<stdlib.h>
%}
%token A B
%%
s : A A A A A A A A A A s1 B ;
s1: A s1
|

%%
main()

Dept. of ISE, BMSIT&M

12

SS and OS Lab Manual


1

10CSL58

{
printf("enter a string\n");
yyparse( );
printf("\n valid\n");
}
yyerror()
{
printf("invalid expression\n");
exit(0);
}

Output:
lex 6.l
yacc -d 6.y
cc lex.yy.c y.tab.c -ll -c
./a.out
enter a string
aaaaaaaaaaaaaaaaaaab
valid
./a.out
enter a string
baaab
invalid expression

PART B
UNIX Programming:
Design, develop, and execute the following programs:
7a. Non-recursive shell scripts that accepts any number of arguments and prints them in
the reverse order, (For example, if scripts is named rargs, then executing rargs A B C should
produce C B A on the Standard output)
7b. C Program that creates a child process to read commands from the standard input
and execute them ( a minimal implementation of a shell- like program). You can assume
that no arguments will be passed to the commands to be executed.
7a.sh
#!/bin/sh
echo Total number of arguments are: $#
Dept. of ISE, BMSIT&M

13

SS and OS Lab Manual


1

10CSL58

echo All arguments are: $*


for x in $@
do
y=$x $y
done
echo The reverse: $y
OUTPUT:
sh 7a.sh A B C
Total Number of arguments are:3
All arguments are : A B C
The reverse : C B A

7b.c
#include<stdio.h>
#include<stdlib.h>
main()
{
int pid,i,n;
char cmd[15];
printf(Enter the no. Of commands \n);
scanf(%d,&n);
pid=fork();
if(!pid)
{
printf(Child process is created \n);
for(i=0;i<n;i++)
{
printf(Enter Command \n);
scanf(%s,cmd);
system(cmd);
}
printf(Child process is complete);
}
else
{
wait();
exit();
}
printf(Parent process is complete\n);
}
OUTPUT:

Enter the no of commands


2
Dept. of ISE, BMSIT&M

14

SS and OS Lab Manual


1

10CSL58

Child process is created


Enter Command
ls
1.c 2.c 3.c 7a.sh
Enter Command
date
Fri Aug 16 10:04:36 IST 2013

8a. Shell Script that accepts two file names as arguments, checks if the permissions for these
files are identical, outputs the common permissions. Otherwise outputs each file name
followed by its permissions.
8b. C Program to create a file with 16 bytes of arbitrary data from the beginning and
another 16 bytes of arbitrary data from an offset of 48. Display the file contents to
demonstrate how the hole in file is handled.

8a.sh
#!/bin/sh
f1=`ls -l $1| cut -c 2-10`
f2=`ls -l $2| cut -c 2-10`
if [ $f1 = $f2 ]
then
echo The two files have identical permission
echo Permission is $f1
else
echo The two files do not have identical permission
echo File $1 has $f1 permission
echo File $2 has $f2 permission
fi
OUTPUT:
sh 8a.sh 1.c 2.c
The two files have identical permission
rw_r_ _r _ _
sh 8a.sh 1.c 3.c
The two files do not have identical permission
File 1.c has rw_ r _ _r_ _
File 3.c has rwxrw_ r_ _

8b.c
#include<stdio.h>
#include<sys/stat.h>
#include<sys/types.h>
Dept. of ISE, BMSIT&M

15

SS and OS Lab Manual


1

10CSL58

#include<unistd.h>
#include<fcntl.h>
char buf1[]=abcdefghijklmnop;
char buf2[]=ABCDEFGHIJKLMNOP;
int main()
{
int fd;
fd=creat(file.dat,O_WRONLY|777);
write(fd,buf1,16);
lseek(fd,48,SEEK_SET);
write(fd,buf2,16);
system(cat file.dat);
}

OUTPUT:
gcc 8b.c
abcdefghijklmnopABCDEFGHIJKLMNOP

9a. Shell Scripts that accepts file names specified as arguments and creates a shell scripts
that contains this file as well as the code to recreate these files. Thus if the script generated
by your script is executed it would recreate the original files (This is same as the bundle
script described by Brain W. Kernighan and Rob Pike in The Unix Programming
Environment, Prentice- Hall India)
9b. C Program to do the following: using fork() create a child process. The child process
prints its own process-id and id of its parent and then exits. The parent process waits for
its child to finish (by executing the wait()) and prints its own process-id and the id of its
child process and then exits.
9a.sh:
#!/bin/sh
if [ $# -eq 0 ]
then
echoEnter two arguments
exit
fi
for i in $*
do
echo cat >$i<<HERE
abc
def

Dept. of ISE, BMSIT&M

16

SS and OS Lab Manual


1

10CSL58

ghi
HERE
done> recreate.sh
OUTPUT
Sh 9a.sh a.c b.c
Sh recreate.sh
Cat recreate.sh
Cat>a.c<<HERE
Abc
Def
HERE
Cat>b.c<<HERE
Abc
Def
HERE
Cat a.c
Abc
Def

Cat b.c
Abc
Def
9b.c:
#include<stdio.h>
#include<stdlib.h>
int main()
{
int pid;
pid=fork();
if(!pid)
{
printf(Child process is created\n);
printf(The pid of Child process is %d,getpid());
printf(The pid of parent process is %d,getppid());
exit():
}
else
{
Dept. of ISE, BMSIT&M

17

SS and OS Lab Manual


1

10CSL58

wait();
printf(Parent process\n);
printf(The pid of the parent process is %d, getpid());
printf(The pid of the child process is %d,pid);
exit();
}
}
OUTPUT:
cc 9b.c
Child process is created
The pid of Child process is 3823
The pid of parent process is 3822
Parent process
The pid of the parent process is 3822
The pid of the child process is 3823

10. Design, develop and execute a program in C/C++ to simulate the working of shortest
remaining time and Round- Robin scheduling Algorithms. Experiment with different
quantum sizes for the Round- Robin Algorithm. In all cases, determine the average turnaround time. The input can be read from keyboard or from a file.
#include<stdio.h>
#include<stdlib.h>
main()
{
for(;;)
{
int choice;
printf("enter the choice\n");
printf("1.ROUND ROBIN\n 2.SRT \n 3.EXIT \n");
scanf("%d",&choice);
switch(choice)
{
case 1:printf("round robin scheduling algo");
rr();
break;
case 2:printf("\n\n__SHORTEST REMAINING TIME NEXT___\n\n");
srtf();
break;
case 3:exit(0);
}
}
Dept. of ISE, BMSIT&M

18

SS and OS Lab Manual


1

10CSL58

}
int
{

rr()
int i, j, n, time, remain, flag=0, ts;
int sum_wait=0, sum_turnaround=0, at[10], bt[10], rt[10];
printf("Enter no of Processes : ");
scanf("%d",&n);
remain=n;
for(i=0;i<n;i++)
{
printf("Enter arrival time and burst time for Process P%d :",i+1);
scanf("%d",&at[i]);
scanf("%d",&bt[i]);
rt[i]=bt[i];
}
printf("Enter time slice");
scanf("%d",&ts);
printf("\n\nProcess\t|Turnaroundtime|waiting time\n\n");
for(time=0,i=0;remain!=0;)
{
if(rt[i]<=ts&&rt[i]>0)
{
time+=rt[i];
rt[i]=0;
flag=1;
}
else if(rt[i]>0)
{
rt[i]-=ts;
time+=ts;
}
if(rt[i]==0 && flag==1)
{
remain--;
printf("P[%d]\t|\t%d\t|\t%d\n",i+1,time-at[i],time-at[i]-bt[i]);
sum_wait+=time-at[i]-bt[i];
sum_turnaround+=time-at[i];
flag=0;
}
if(i==n-1)
i=0;
else if(at[i+1]<=time)
i++;
else
i=0;
}
printf("\nAvgsum_wait = %f\n",sum_wait*1.0/n);
printf("Avgsum_turnaround = %f",sum_turnaround*1.0/n);
return 0;

}
Dept. of ISE, BMSIT&M

19

SS and OS Lab Manual


1

10CSL58

int srtf()
{
int at[10],bt[10],rt[10],endTime,i,smallest;
int remain=0,n,time,sum_wait=0,sum_turnaround=0;
printf("Enter no of Processes : ");
scanf("%d",&n);
for(i=0;i<n;i++)
{
printf("Enter arrival time for Process P%d : ",i+1);
scanf("%d",&at[i]);
printf("Enter burst time for Process P%d : ",i+1);
scanf("%d",&bt[i]);
rt[i]=bt[i];
}
printf("\n\nProcess\t|Turnaround Time| Waiting Time\n\n");
rt[9]=9999;
for(time=0;remain!=n;time++)
{
smallest=9;
for(i=0;i<n;i++)
{
if(at[i]<=time &&rt[i]<rt[smallest] &&rt[i]>0)
{
smallest=i;
}
}
rt[smallest]--;
if(rt[smallest]==0)
{
remain++;
endTime=time+1;
printf("\nP[%d]\t|\t%d\t|\t%d",smallest+1,endTime-at[smallest],endTimebt[smallest]-at[smallest]);
sum_wait+=endTime-bt[smallest]-at[smallest];
sum_turnaround+=endTime-at[smallest];
}
}
printf("\n\nAverage waiting time = %f\n",sum_wait*1.0/n);
printf("Average Turnaround time = %f",sum_turnaround*1.0/n);
return 0;
}

11. Using OpenMP, Design, develop and run a multi-threaded program to generate and
print Fibonacci Series. One thread has to generate the numbers up to the specified limit
and another thread has to print them. Ensure proper synchronization.

11.c
#include<omp.h>
Dept. of ISE, BMSIT&M

20

SS and OS Lab Manual


1

10CSL58

#include<stdio.h>
int main()
{
int fib[100],n,i;
printf("enter range:");
scanf("%d",&n);
fib[0]=0;
fib[1]=1;
if(n<2)
printf("\n%d\n%d\n",fib[0],fib[1]);
else
{
printf("\nthread 1 generating fibonacci series..\n");
#pragma omp parallel num_threads(2)
for(i=2;i<n;i++)
fib[i]=fib[i-1]+fib[i-2];
}
printf("thread 2 printing fibonacci series..");
#pragma imp critical
printf("\n%d\n%d\n",fib[0],fib[1]);
for(i=2;i<n;i++)
{
printf("%d\n",fib[i]);
}
return 0;
}
OUTPUT:
cc -fopenmp 11.c
./a.out
enter range:5
thread 1 generating fibonacci series..
thread 2 printing fibonacci series..
0
1
Dept. of ISE, BMSIT&M

21

SS and OS Lab Manual


1

10CSL58

1
2
3
12. Design, Develop and run a program to implement the Bankers Algorithm.
Demonstrate its working with different data Values.
#include<stdio.h>
#include<stdlib.h>
int count=0,prc,k=0,i,j,comp[10],avail[10],total,work[10],reg[10][10],safe[10],a=1;
intrscr[10],safe[10],claim[10][10],alloc[10][10],p,r;

void banker()
{
for(i=1;i<=p;i++)
comp[i]=0;
for(j=1;j<=r;j++)
{
total=0;
avail[j]=0;
for(i=1;i<=p;i++)
total=total+alloc[i][j];
avail[j]=rscr[j]-total;
for(j=1;j<=r;j++)
work[j]=avail[j];
for(i=1;i<=p;i++)
for(j=1;j<=r;j++)
reg[i][j]=claim[i][j]-alloc[i][j];
printf("the request matrix");
for(i=1;i<=p;i++)
{
for(j=1;j<=r;j++)
{
printf("%d\t",reg[i][j]);
}
printf("\n");
}
while(count!=p && k<p)
{
k++;
for(i=1;i<=p;i++)
{
prc=0;
if(comp[i]==0)
{
for(j=1;j<=r;j++)
{
if(reg[i][j]<=work[j])
Dept. of ISE, BMSIT&M

22

SS and OS Lab Manual


1

10CSL58

prc=prc+1;
else
break;
}
if(prc==r)
{
count++;
safe[a]=i;
a++;
comp[i]=1;
for(j=1;j<=r;j++)
{
work[i]=work[j]+alloc[i][j];
claim[i][j]=0;
alloc[i][j]=0;
}
}
}
else
continue;
}
}
if(count!=p)
{
printf("sys is in unsafe state\n");
}
else
{
printf("sys is in safe state");
for(j=1;j<=p;j++)
printf("the safe sequence of the process is %d\n",safe[j]);
}
}
}
int main()
{
printf("enter the no of process\n");
scanf("%d",&p);
printf("enter the no of resources\n");
scanf("%d",&r);
printf("enter the rsrc instances array\n");
for(i=1;i<=r;i++)
{
scanf("%d",&rscr[i]);
}
printf("enter the claim matrix");
for(i=1;i<=p;i++)
for(j=1;j<=r;j++)
scanf("%d",&claim[i][j]);
printf("enter the alloc matrix\n");
for(i=1;i<=p;i++)
Dept. of ISE, BMSIT&M

23

SS and OS Lab Manual


1

10CSL58

for(j=1;j<=r;j++)
scanf("%d",&alloc[i][j]);
banker( );
}

Sample VIVA Questions:

1. Explain parser lexer communication


2. What is argc representing in main
3. What is argv representing in main
4. Explain fopen syntax
5. What is the role of yylex
6. What is the role of yyin
7. What is the role of yyout
8.What are the different sections of lex program
9. How to compile a lex program
10. What is the meaning of [a-zA-Z0-9]+
11. What is present in y.tab.h
12. How to generate y.tab.h
13. What does a regular expression . represents?
14. How do you specify left associatively?
15. How to specify the priority in lex specifications?
16. What is the role of yyerror?
17. Can we override yyerror?
18. What is the role of yywrap?
19. Can we override yywrap?
20. What is the job of yyparse?
Dept. of ISE, BMSIT&M

24

SS and OS Lab Manual


1

10CSL58

21. What does yytext[0] represents?


22. What values are stored in yytext?
23. What is the meaning of %nonassoc ?
24. What is shift reduce conflict?
25. How do you eliminate shift reduce conflict?
26. What does %Token represents?
27. What is the meaning of #!/bin/bash?
28. What is stored in $#?
29. What is stored in $*?
30. How do you create a child process?
31. What is the difference between fork and vfork?
32. What is the use of system call?
33. Explain ls l
34. Explain cut command with its options
35. What does lseek do?
36. Explain different file opening modes
37. Explain the different usage of cat command
38. What is turn around time?
39. How does SJF algorithm work?
40. How does round robin algorithm work?
41. What are threads?
42. Explain how threads are different from processes?
43. What are the differences between process and thread
44. Explain how do you create threads?
45. What does #pragma do?
46. Explain any 3 assembler directives
47. What is deadlock?
48. What is starvation?
49. What are the different methods of avoiding deadlock
50. Explain bankers algorithm

Dept. of ISE, BMSIT&M

25

Potrebbero piacerti anche