You are on page 1of 3

Assignment No.

2 Solution CS 604
Student ID: Bc210409807
Question No. 01

Solution:
As we know the formula to calculate Need is Need = Max Need – Allocated
So,

Process Max Need Allocated Need


P0 11 4 7
P1 6 3 3
P2 13 4 9
P3 15 3 12
P4 7 2 5
Now,

Here’s the Need Matrix

Need Matrix:

P0 P1 P2 P3 P4

C 7 3 9 12 5

Question No. 01
Solution:
Given Information:
logical address space of 64 pages of 2048 words.
Physical memory of 32 frames

To Find:
No. of bits needed for p = ? bits
No. of bits needed for f = ? bits
No. of bits needed for d = ? bits
Logical address size = ? bits
Physical address size = ? bits

Now, to calculate No. of bits needed for p we can use this formula
log2 (64) = 6 bits for the page number
P = 6 bits
To calculate f,
log2 (32) = 5 bits frame number
To calculate d,
log2 (2048) = 11 bits
Now to calculate logical address size we can use this formula
Logical address size = P + d = 6+11 = 17 bits
And for calculating physical address size we use this formula,
Physical address size = f + d = 5 + 11 = 16 bits
So,
P = 6 bits
f = 5 bits
d = 11 bits
Logical address size = 17 bits
Physical address size = 16 bits
Question No. 03

The performance measure in paging is the effective memory access time. With part of the page table in
the TLB and the rest in the main memory. In the context of paging, you are required to calculate the
Teffective by considering the following factors.

Given Information:
Tmem = 200 nsec
TTLB = 20 nsec
Hit ratio = 90%
Solution:

Here is the formula of Teffective,

Teffective = HR (TTLB + Tmem) + MR (TTLB + 2Tmem)

To find MR we use formula,

Miss ratio (MR) = 1 – HR = 1 – 0.9 = 0.1

NOW,

Teffective = 0.9 (20 +200) + 0.1(20 + 2*200)

Teffective = 0.9 (220) + 0.1(420)

Teffective = 198+ 42

Teffective = 240 nsec

You might also like