Professional Documents
Culture Documents
LP-1 Lab Manual
LP-1 Lab Manual
LP-1 Lab Manual
Lab Manual
of
Laboratory Practice I
(310248)
Class: TE
Semester: V
Pattern: 2019
INDEX
ASSN
TITLE
NO.
Part I: Systems Programming and Operating System
Group A
Design suitable Data structures and implement Pass-I and Pass-II of a two-pass
assembler for pseudo-machine. Implementation should consist of a few instructions
1 from each category and few assembler directives. The output of Pass-I (intermediate
code file and symbol table) should be input for Pass-II.
Design suitable data structures and implement Pass-I and Pass-II of a two-pass macro-
2 processor. The output of Pass-I (MNT, MDT and intermediate code file without any
macro definitions) should be input for Pass-II.
Group B
Write a program to simulate CPU Scheduling Algorithms: FCFS, SJF (Preemptive),
3
Priority (Non-Preemptive) and Round Robin (Preemptive).
4 Write a program to simulate Page replacement algorithm.
Part II : Elective I
Group C
Distributed System
Department of Computer Engineering , SITS Narhe Pune
TE: 310248: Laboratory Practice I
Assignment No- A1
Objectives:
• To study assembler.
• To understand algorithm of Pass-I.
• To implement assembler pass-I using JAVA programming language.
• To study Pass-II of a two pass assembler.
• To implement Pass-II using JAVA Programming language.
Problem Statement: Design suitable Data structures and implement Pass-I and Pass-II of a
two-pass assembler for pseudo-machine. Implementation should consist of a few instructions
from each category and few assembler directives. The output of Pass-I (intermediate code file
and symbol table) should be input for Pass-II.
Outcomes:
• Understand Pass I of two pass assembler.
• Implement Pass-I using JAVA.
• Understand Pass II of two pass assembler.
• Implement Pass-II using JAVA.
Software Requirements:
Hardware Requirements:
• 64 bit machine
• 4GB or 8 GB RAM
• 500 GB or 1TB HDD
Theory:
An assembler is a program that takes basic computer instructions and converts them into a
pattern of bits that the computer's processor can use to perform its basic operations. Some
people call these instructions assembler language and others use the term assembly language.
• Most computers come with a specified set of very basic instructions that correspond to
the basic machine operations that the computer can perform. For example, a "Load"
instruction causes the processor to move a string of bits from a location in the
processor's memory to a special holding place called a register. Assuming the processor has at
least eight registers, each numbered, the following instruction would move the value (string of
bits of a certain length) at memory location 3000 into the holding place called register 8:
L 8,3000
In this assignment we make use of Hashing for our Mneumonic table.This is to reduce the
overhead required to search a mneumonic in the mneumonic table.
The output of this program is going to be the input to Pass II hence we write all the tables and
IC to a File.
Thus the requisites for this assignment are File handling and Table handling method of
Hashing.
The Mneumonic table has been designed using hash function =([addition of ascii of all
alphabets of a mneumonic] mod 10 or 20)
f. If size!= 0 then
• Move contents of machine code buffer to the address code area+LC
• LC=LC+size
3. Processing of END statement
• Perform steps 2b and 2f
• Perform Error handling
• Write code to output file.
4. Stop.
Test Cases:
Test Case No. Test Case Expected Actual Output Result
Description Output
Conclusion: Thus we have successfully studied and implemented the pass I and pass II of two pass
assembler.
Assignment No- A2
Objectives:
• To study Pass-I of a two pass macro processor.
Problem Statement: Design suitable data structures and implement Pass-I and Pass-II of a
two-pass macro- processor. The output of Pass-I (MNT, MDT and intermediate code file
without any macro definitions) should be input for Pass-II.
Outcomes:
Software Requirements:
• 64 bit machine
• 4GB or 8 GB RAM
• 500 GB or 1TB HDD
Theory:
Macro instruction is a notational convenience for the programmer.
It allows the programmer to write shorthand version of a program (module programming)
The macro processor replaces each macro invocation with the corresponding sequence of
statements
Macro
» the statement of expansion are generated each time the macro are invoked
Argument substitutions
Dummy arguments
» Positional argument
MACRO
&LAB INCR &ARG1,&ARG2,&ARG3
&LAB ADD 1,&ARG1
ADD 2,&ARG2
ADD 3,&ARG3
MEND
Output:-
MNT
MDT
Index Label Instruction operands
1 #0 ADD 1, #1
2 ADD 1, #2
3 ADD 1, #3
4 MEND
ALA
Argument Dummy name
&Lab #0
&Arg1 #1
&Arg2 #2
&Arg3 #3
Steps to follow:-
2. Read the ALP word by word using fgetc.
The task of pass II is macro expansion i.e deal with macro calls. For this we use the tables created in pass I of a
macro-processor. Whenever a call to a macro is found for eg:-
ADD 2 , Data2
ADD 3 , Data3
ALA
Argument Actual
Parameters
#0 LOOP
#1 Data1
#2 Data2
#3 Data3
Using these values we expand the macro with the help of MNT and MDT.
Steps to follow:-
1. Read the source program.
2. If an macro name is encounterd it means there is a call to the macro so do the following.
Test Cases:
Conclusion:- Thus we have successfully studied and implemented the pass I and pass II of two pass
macro-processor.
Assignment No- B1
Title: Implement Scheduling Algorithms 1. FCFS 2. SJF(Preemptive)
Objectives:
• To study preemptive and non-preemptive scheduling algorithm.
• To implement FCFS and SJF with preemptive scheduling.
• To implement Priority and Round Robin non preemptive scheduling using JAVA
programming language.
Problem Statement: Write a program to simulate CPU Scheduling Algorithms: FCFS, SJF
(Preemptive), Priority (Non-Preemptive) and Round Robin (Preemptive).
Outcomes:
Software Requirements:
• Operating System : Ubuntu or Fedora
• Eclipse
• JDK/JRE
Hardware Requirements:
• 64 bit machine
• 4GB or 8 GB RAM
• 500 GB or 1TB HDD
Theory:-
1 Scheduling:
A multiprogramming operating system allows more than one process to be loaded into the executable memory
at a time and for the loaded process to share the CPU using time- multiplexing. Part of the reason for using
multiprogramming is that the operating system itself is implemented as one or more processes, so there must
be a way for the operating system and application processes to share the CPU. Another main reason is the
need for processes to perform I/O operations in the normal course of computation. Since I/O operations
ordinarily require orders of magnitude more time to complete than do CPU instructions, multiprograming
systems allocate the CPU to another process whenever a process invokes an I/O operation
Preemptive scheduling: The preemptive scheduling is prioritized. The highest priority process
should always be the process that is currently utilized.
Non-Preemptive scheduling: When a process enters the state of running, the state of that
process is not deleted from the scheduler until it finishes its service time.
Test Cases:
Test Case No. Test Case Expected Output Actual Output Result
Description
Conclusion: Thus we have successfully studied and implemented CPU scheduling algorithms like FCFS, SJF,
Priority and Round Robin.
Assignment No- B2
Objectives:
• To study page replacement strategies.
Outcomes:
• Understand page replacement policies.
• Handle LRU and optimal algorithm using JAVA Programming language.
Software Requirements:
• Operating System : Ubuntu or Fedora
• Eclipse
• JDK/JRE
Hardware Requirements:
• 64 bit machine
• 4GB or 8 GB RAM
• 500 GB or 1TB HDD
Theory:
Page Fault:-An interrupt that occurs when a program requests data that is not currently in real
memory. The interrupt triggers the operating system to fetch the data from a virtual memory
and load it into RAM.
The least recently used page (LRU) replacement algorithm, though similar in name to NRU,
differs in the fact that LRU keeps track of page usage over a short period of time, while NRU
just looks at the usage in the last clock interval. LRU works on the idea that pages that have
been most heavily used in the past few instructions are most likely to be used heavily in the
next few instructions too. While LRU can provide near-optimal performance in theory (almost
as good as Adaptive Replacement Cache), it is rather expensive to implement in practice.
When a page needs to be swapped in, the operating system swaps out the page whose next use
will occur farthest in the future. For example, a page that is not going to be used for the next 6
seconds will be swapped out over a page that is going to be used within the next 0.4 seconds.
This algorithm cannot be implemented in the general purpose operating system because it is
impossible to compute reliably how long it will be before a page is going to be used, except
when all software that will run on a system is either known beforehand and is amenable to the
static analysis of its memory reference patterns, or only a class of applications allowing run-
time analysis is allowed.
Test Cases:
Test Case No. Test Case Expected Output Actual Output Result
Description
Conclusion: Thus we have studied and implemented the page replacement algorithm.
FAQs
1. What is Demand Paging? And what is a page fault?
2. What is BELADY‟s ANAMOLY? Explain with example.
3. What is segmentation? Is it better than paging?
4. What is LFU page replacement algorithm? How is it different from LRU?
5. Is it possible to implement optimal page replacement algorithm in reality?
6. Total no. of page faults increase with an increase in no. of frames?
7. What is logical address? How is it converted to physical address?
8. What is TLB? Why is it used?
9. What are other page replacement algorithms you know?
10. How many page faults will occur using LRU and optimal page replacement
scheme. Compare the results.1, 2, 3, 4, 5, 3, 4, 1, 6, 7, 8, 7, 8, 9, 7, 8, 9, 5, 4, 5,
4, 2 (Note:- Reference string may be different)
Assignment No- C1
Title:
Objective:
Understand the basics of project planning & learn the Gantt project software to create the
project plan.
Problem Statement:
Outcomes:
Hardware Requirement: Any CPU with Pentium Processor or similar, 256 MB RAM or
more,1 GB Hard Disk or more
It’s created during the project planning phase and is a compilation of several other documents. It
is more than just a schedule or a task list, though it does include those things. The project
management plan is formally approved at the beginning of the project and then progressively
updated throughout the course of the project.
Project planning is a crucial stage that comes right after initiation in project management phases.
Through proper planning, you streamline the entire project into a series of steps and ensure the
availability of all the resources on time.
Project constraints such as time, scope, and costs are discussed in the project planning process,
and mitigation plans are developed after the identification of potential risks. By comparing the
actual progress with the project plan, you can also monitor the performance of your team and
take the necessary steps to improve it.
By default, the start date for all new projects is the current date. Of course, you can change
this to a different start time. You can also set the project to be scheduled from a finish date.
This can be as simple as creating a list of tasks that must be completed in order to deliver your
project. In the case of complex projects, it may be helpful to organize these tasks in the form of
at, a chart visualizing project tasks and their sub-tasks and to stay organized at work.
One challenge in this part of the project scheduling process is knowing how to divide activities.
Consider the 8/80 rule, which states that a single activity should take between eight and eighty
work hours.
In team task management, tasks requiring fewer than eight hours could be grouped with others
and tasks over eighty hours are likely too cumbersome and should be broken down further.
Activities should also be measurable, easily estimated, and related to both a project
deliverable and a budgeted cost.
Define duration of each project task:
This step is pretty obvious but very important. How long will each project activity
take? Underestimating will, of course, put you behind schedule and ultimately frustrate your
customer.
Overestimating could leave team members or other resources sitting idle as they wait for
antecedent tasks to be completed. The best way to estimate duration is to use data from similar
previous jobs.
If you don’t have any data to work from and there’s no industry standard to which you can refer,
an estimate based on the average of the best, worst, and most likely scenarios.
A milestone is a specific point in time within a project lifecycle used to measure the
progress of a project toward its ultimate goal. In project management, milestones are used
as signal posts for significant events, decision points, or deliverables such as: The project's
start date. Project end date.
You can use the best project management software to tackle project task dependencies by
engaging with stakeholders, brainstorming constraints related to dependencies.
Calendar:
The calendar can be used to depict the project timelines of all the tasks throughout the course of
the project. It’s a decent approach to view overlaps between activities. But, this approach suffers
from an inability to assign tasks and view dependencies
Every project requires resources to contribute to its implementation and ultimately its
success. The successful management of a project translates into efficient steering of the
various project resources. These must be determined as early as possible, ideally before the
project is even launched.
You have to make sure that you use the resources that are essential to the smooth running of
the project and make sure that you optimize its management.
#1: Human resources
Also known as "work resources", these are the most important because they are the ones
who do the work. They contribute to carrying out the tasks necessary for the smooth
running and completion of the project.
In addition, human resources are coupled with cognitive resources because they are the ones
who hold the knowledge and know-how:
• technical skills,
• knowledge,
• business expertise, etc.
They can be recruited internally or externally and can work on the entire duration of the
project or on an ad hoc basis.
• individual professionals,
• project managers,
• project teams,
• legal entities.
They can be goods that are temporarily made available for the project, which can be used
again later, but also consumables that can be used in a given quantity and that have a unit
cost.
For example, the goods consumed or the raw materials processed will not be available
for new use. The investment in these resources must be determined in terms of budget, time,
and desired quality.
• finance funds,
• project budgets,
• project grants.
Above resources are not inexhaustible: they have limits, hence the importance of knowing
how to manage them to achieve your objectives.
• project plan,
• project schedule,
• time invested.
Once a project schedule is created, it will usually have to be altered to avoid over allocating a
particular resource (for instance, a subcontractor), which will cause the schedule to be held
up. Assignments are the last step of data to enter into the project schedule and they reflect
who works on a task. Knowing how to allocate resources will help keep you in control of
your project from start to finish. By assigning resources to tasks, you can make sure that you
have enough resources to accomplish the tasks in your project. You assign people and
equipment in the same way. You assign resources to tasks to clarify responsibility for getting
those tasks done. Assigning resources also helps you determine how long it will take for a
task to get done, and, if you track costs, how much the task will cost.
A baseline in project management is a clearly defined starting point for your project plan. It is
a fixed reference point to measure and compare your project’s progress against. This allows
you to assess the performance of your project over time.
For example, let’s say your project is on target to finish in six weeks. Is that good or bad? If
your schedule baseline has a four-week completion, you can tell that there is a problem, and
your team may need to make adjustments to speed up your progress.
A project baseline typically has three components: schedule, cost, and scope. Often, these
three baselines are separately monitored, controlled, and reported to ensure each is on track.
When fully integrated, it may be referred to as a performance measurement baseline (PMB).
Conclusion/Analysis: Hence we are able to study Gantt Project Software and can create
Project Plan.
Assignment No- C2
Title:
Execute and Monitor Project Plan
Objective:
Understand the basics of how to execute and monitor project plan.
Problem Statement:
Execute and Monitor project plan using Gantt Project Software.
Outcomes:
1. Students will be able to demonstrate Installation of Gantt Project Software.
2. Students will be able to learn how to execute and monitor project plan in Gantt Project.
Hardware Requirement: Any CPU with Pentium Processor or similar, 256 MB RAM or
more,1 GB Hard Disk or more
Theory:
The project management lifecycle has five phases: initiating, planning, executing,
monitoring, and closing.
• During the initiating & planning phase, the project receives the necessary approvals, a
plan has been created, and the work actually begins on the tasks.
• The executing phase and the monitoring phase happen concurrently. This means that
you are monitoring your progress while you are completing tasks.
Once the project plan is finalized and approved, the project manager monitors the progress
making sure that the tasks are completed accordingly.
There are 4 main types of monitoring that the project manager should focus on:
1. Schedule monitoring
2. Change monitoring
3. Quality monitoring
4. Cost monitoring
1. Schedule monitoring
The project manager has a plan of tasks and an estimated duration period for each. Therefore,
at the end of each day, week, or month the project manager should be able to report on
whether the project is on track or not.
In order to report in this way, the project manager needs to know from each team member:
It is to be expected that some tasks take less time than expected and some tasks take a little
longer. A developer might tell the project manager that creating a web page took three hours
even though it was estimated to take ten. Similarly, a task may be estimated at five hours but
take eight. Because of this, tracking on a daily basis is useful but must be viewed in the
context of overall project progress.
While the project manager compares weekly completion of tasks to the planned completion
of tasks, stakeholders will focus on the overall project schedule and delivered milestones.
This is where a Gantt chart can be particularly helpful - as it gives a visible view of where
milestone lie within the calendar of the project timeline.
A Gantt chart showing milestones.
There are many project management software tools available that show thepercentage of
task completion using a horizontal bar. This helps to view progress and shows how likely
you are to complete enough tasks within schedule to achieve your major milestones.
2. Change Monitoring:
The section above illustrated how you can monitor actual task completion versus expected
task completion.
But what if the actual tasks change? What if the client changes their mind and wants
something completely different? What if you discover halfway through the project that the
law has changed and there are new requirements that will require extra work?
The project manager typically pushes back against a change of scope. Changing the list of
outcomes, deliverables, and mid-project tasks would require revising the project plan and
acquiring new sign-offs from the decision-makers. Therefore, change of scope and adding
tasks to the project is the exception rather than the norm.
The project manager will measure the number of change requests and additional tasks that are
added to any project. Some issues will also surface as team members discover unforeseen
problems while completing their tasks and building the solution. The project manager will
track these as well. If they require additional tasks, the project manager will investigate how
they can be done while keeping milestone commitments.
3. Quality Monitoring:
It is imperative that each deliverable meets the client's expectations. At minimum digital
products must be bug free. You must also make sure that the product performs as expected
(for example, it would not be acceptable for a web page to take five seconds to load).
There is often a member of team who tests deliverables to make sure they function as
expected. This person is usually a member of the Quality Assurance (QA) team, although
sometimes it can be the developers or the project manager who do a lot of the testing.
Testing should not be done at the end of the project. It is important that quality checks are
done consistently during the executing phase.
4. Cost Monitoring:
The project manager also needs to monitor the costs of the project. If the project incurs
additional costs, then it might not be profitable for your company.
Although team members taking longer to complete tasks is one source of increased cost, there
are other ways that project cost can exceed budget:
Conclusion/Analysis: Hence we are able to execute and monitor project plan in Gantt
Project Software.
Assignment No- C3
Title:
Objective:
Problem Statement:
Outcomes:
2. Students will be able to learn how to Generate Dashboard and Reportsin Gantt Project.
Hardware Requirement: Any CPU with Pentium Processor or similar, 256 MB RAM or
more,1 GB Hard Disk or more
A project management dashboard is a data-driven platform that displays metrics, stats, and
insights that are specific to a particular project or strategy by presenting a tailored mix of
KPIs in one central location in order to benefit the project's performance.
Such a dashboard is perfect for individual departments looking to monitor the success of their
projects and campaigns, spot past or present trends, and ultimately contribute to making the
organization more intelligent. Project dashboard software is also effective for
interdepartmental collaboration due to its flexible access and usability
This project dashboard template is the first project dashboard examples, and it
focuses on the steps and tasks involved in delivering a very specific strategic IT-
based initiative successfully from start to finish.
If your team shares resources across multiple projects, you need visibility into what
projects each resource is assigned, or who is assigned to each project, maybe you want to
set the resource's project-level resource type default or their role on the project.
A project status report is a document that describes the progress of a project within a
specific time period and compares it against the project plan. Project managers use
status reports to keep stakeholders informed of progress and monitor costs, risks, time
and work. Project status reports allow project managers and stakeholders to visualize project
data through charts and graphs.
Project status reports are taken repeatedly, throughout every phase of the project’s execution,
as a means to maintain your schedule and keep everyone on the same page.