
68
I
^7^$
The
memory
architecture
of
a
machine
X
is
summarized
in
the
Table.
\'irlual
Address
54
bits
Page
Size
16
K
bytes
t
)
PTE
Size
4
bytes
(a)
Assume
that
there
are
8
bits
reserved
for
the
operating
system
functions
(protection,
replacement,
valid,
modified,...)
other
than
required
by
the
hardware
translation
algorithm.
Derive
the
largest
physical
memory
size
(in
bytes)
allowed
by
this
PTE
format.
Make
sure
you
consider
all
the
fields
required
by
the
translation
algorithm.
(b)
How
large
(in
bytes)
is
the
page
table?
(c)
Assuming
1
application
exists
in
the
system
and
the
maximum
physical
memory
is
devoted
to
the
process,
how
much
physical
space
(in^y^)
is
there
for
the
application's
data
and
code.
Answer
(a)
Physical
page
number
=
32
-
8
=
24
bits,
k'
The
largest
physical
memory
size
=
2^4
x
16
Kbytes
=
256
GB
i?
(b)
The
virtual
page
number
has
54
-
14
=
40
bits.
The
number
of
page
table
entries
are
24o.
Each
PTE
has
4
bytes.
So
the
total
size
of
the
page
table
is
2^2
bytes
which
is
4
terabytes.
^
(c)
The
application's
page
table
has
an
entry
for
every
physical
page
that
exists
on
the
system,
which
means
the
page
table
size
is
224
x
4
bytes.
This
leaves
the
remaining
physical
space
to
the
process:
224
x
16K
-
226
bytes
=
23®
-
226
bytes.

Consider
a
machine
with
32-bit
virtual
addresses,
32-bit
physical
addresses,
and
a
4KB
page
size.
Consider
a
i^wo-leveli
page
table
system
where
each
table
occupies
one
full
page.
Assume
each
page
table
entry
is
32
bits
long.
To
map
the
full
virtual
address
space,
how
much
memory
will
be
used
by
the
page
tables?
Answer:
The
number
of
entries
in
the
page
table
=
4KB/4B
=
1024
)
Amount
of
memory
used
=
4
KB
+
1024
x
(4
KB)
=
4.1
MB
\/
AH
5
,
Virtual
address
size
Page
size
Page
table
entry
size
a.
32
bits
4KB
4
bytes
b.
64
bits
16KB
8
bytes
Given
the
table
above,
calculate
the
total
page
table
size
for
a
system
running
5
applications
that
utilize
half
of
the
memory
available.
Answer
a.
1/
b.
4
KB
page
-^12
offset
bits,
20
page
number
bits
220
=
1
M
page
table
entries
1
M
entries
x
4
bytes/entry
=
4
MB
4
MB
X
5
=
20
MB
16
KB
(214)
page
size,
8
(23)
bytes
per
page
table
entry
64
-
14
=
50
bits
or
25°
page
table
entries
with
8
bytes
per
entry,
yields
total
of
253
bytes
for
each
page
table
Total
for
5
applications
=
5
x
253
bytes