Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Problem Bank 3
The assignment has three parts.
Part I deals with Cache Memory Management,
Part II deals with Pipeline Architecture and
Part III deals with scheduling algorithm.
Resource for Part I : Webinar by Prof. Chandra Shekar and following are the video
links:
Part -1
https://wilp-bits-pilani.webex.com/wilp-bits-pilani/ldr.php?
RCID=b247c211c32ef1437dc48e435a96f82a
Part-2
https://wilp-bits-pilani.webex.com/wilp-bits-pilani/ldr.php?
RCID=5f24bcf08916c161c84eed3c1435ce56
Part-3
https://wilp-bits-pilani.webex.com/wilp-bits-pilani/ldr.php?
RCID=e66dd7d7ba4002bbaf05a2ac17701756
Resource for Part II: Webinar by Prof. Vaibhav and following are the video links:
COSS Webinar-P-1-->
https://dams.bits-
pilani.ac.in/download/715811658aa1643b0a326971305973a4bbfd5f56
COSS Webinar-P-2-->
https://dams.bits-
pilani.ac.in/download/0d9ca13b18c84bcdb317576438b6322dab4a6a8
5
In case of any issues, please drop an email to my TA, Ms. Michelle Gonsalves
(michelle.gonsalves@wilp.bits-pilani.ac.in). Please refrain from sending emails to center
coordinators or faculty who is teaching you.
Caution!!!
We expect you to submit your original work. You are not allowed to share document / other
details about your assignment with other batches implementing the same problem. Any
evidence of such practice will attract severe penalty. We will not distinguish plagiarism as
less or more.
Evaluation:
program BubbleSort
var a array(5) byte
a(0) = 5
a(1) = 4
a(2) = 3
a(3) = 2
a(4) = 1
len = 5
l1 = len - 1
for i = 0 to l1
l2 = len - i - 1
for j=0 to l2
j1 = j + 1
x1 = a(j)
x2 = a(j1)
if x1 > x2 then
temp = a(j1)
a(j1) = a(j)
a(j) = temp
end if
next
for k =0 to 4
write(a(k)," ")
next
writeln("")
next
end
32 16 NA NA NA
16 32 98 529 15.6%
32 32 95 532 15.1%
Plot the graph of Cache miss ratio Vs Block size with respect to cache size = 16 and 32.
Comment on the graph that is obtained.
Graph Comments
Execute the above program using non-pipelined processor and pipelined processor and
answer the following questions:
Non-pipelined Processor:
To enable non-pipelined processor, check “No instruction pipeline” check box in control
panel.
c) What are the contents of Register R00, R01 and R02 registers after the execution of the
program?
10, 19, 41
Pipelined processor:
To enable pipelined processor, uncheck “No instruction pipeline” check box in control panel.
a) Fill in the following table with respect to pipelined processor execution of the above
program:
b) Is there a way to improve the CPI and Speed up factor? If so give the solution.
Solution:
Fill in the following table for the above solution.
Clocks Instruction Count CPI Speed up Factor
Part III: Process Scheduling
Consider the following 4 source codes:
Source Code 1:
program My_Pgm1
i=1
for n = 1 to 10
x=i+n
next
end
Source Code 2:
program My_Pgm2
i = 10
for n = 1 to 8
x=i+n
next
end
Source Code 3:
program My_Pgm3
i = 10
for n = 1 to 15
x=i+n
next
end
Source Code 4:
program My_Pgm4
i = 10
for n = 1 to 5
x=i+n
next
end
Create 4 processes P1, P2. P3 and P4 from source codes 1, 2, 3and 4 respectively with
following properties. Fill up the following table:
Scheduling Algorithm : FCFS
Process Arrival Time Waiting time
P1 1
P2 5
P3 3
P4 6
Average waiting time
Scheduling Algorithm : Round Robin with time quantum 5
Process Arrival Time Waiting time
P1 1
P2 5
P3 3
P4 6
Average waiting time
Scheduling Algorithm : Round Robin with time quantum 10
Process Arrival Time Waiting time
P1 1
P2 5
P3 3
P4 6
Average waiting time
Out of three cases, which one is better and why?