

















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


















Final: 12/11 at 12:00pm in VN
Example Problem 1
Which of the following changes due to pipeliningminiMIPS require NO revisions to the Instruction SetArchitecture (ISA, i.e. the instruction’s behavior
or
performance)?A)^
Branch delay slots B)
Pipeline interlocks on lw instructions C)
Adding branch annulment D)
Adding early branch decision logic E)
Adding register by-passes
Example Problem 3
Which of the following is an advantage of the5-stage miniMIPS pipeline over the 4-stage miniMIPSpipeline?A)^
It has greater instruction execution latency B)
It has more register bypasses C)
It decreases the number of branch delay slots D)
It allows nearly 2-cycle for memory accesses E)
Two instruction following each load could insertNOPs if pipeline interlocking is implemented
Suppose we designed a 16-locationdirect-mapped cache for miniMIPS whereeach cache line includes a valid bit(V), a tag field, and a 32-bit datafield. Lower-order address bits of theaddress select the cache line; theremaining bits are compared againstthe tag field.
Recall that miniMIPS
produces a 32-bit
byte
address, so the
bottom 2 bits are always “0” and arenot used by the cache.
Assume the
cache is used for both instruction anddata accesses and uses a
write-through
strategy on writes.
V^1514131211109876543210
Tag^
Data =? HIT^
CPU Data
CPU Addr
0x0108 1
0xDEADBEEF
Example Problem 5
Example Problem 6
Example Problem 8
What is the 32-bit byteaddress of the memorydata currently cachedin entry 3?
Assume
that high-order bitsunspecified by hexconstants are zero. (A)^
0x (B)
0x (C)
0x (D)
0x420C (E)
Can’t
tell
from
the
information
provided
V^1514131211109876543210
Tag^
Data =? HIT^
CPU Data
CPU Addr
0x0108 1
0xDEADBEEF
Example Problem 9
Example Problem 11
Example Problem 12
Example Problem 14
The table on the rightshows the first 8 entriesin the page map.
Recall
that the valid bit is 1if the page is residentin physical memory and 0if the page is on disk orhasn’t been allocated.
1
1
7
4
0
6
5
0
5
5
1
4
2
1
3
3
0
2
9
1
1
7
0
0
Physical page
Valid bit
Virtual page
Example Problem 17
Consider the implementation of akernel handler for the ReadKey()service call shown on the right.ReadKey() will return the nextavailable keystroke from theuser’s keyboard, waiting until oneis available if necessary.ReadKey() {
if(BufferEmpty()) {
User.R27 = User.R27 – 4;scheduler(); } else
User.R2 =
ReadInputBuffer();} Recall that “User” is the kerneldata structure used to save thevalues of the user’s registersduring a trap or interrupthandler.
the top of the userstack (B)
the top of the kernelstack (C)
the $a0 slot of theUser structure (D)
the $a0 register (E)
the $v0 register
Example Problem 18
Consider the implementation of akernel handler for the ReadKey()service call shown on the right.ReadKey() will return the nextavailable keystroke from theuser’s keyboard, waiting until oneis available if necessary.ReadKey() {
if(BufferEmpty()) {
User.R27 = User.R27 – 4;scheduler(); } else
User.R2 =
ReadInputBuffer();} Recall that “User” is the kerneldata structure used to save thevalues of the user’s registersduring a trap or interrupthandler.
18)The
reason
for
the
call
to
scheduler()
in
this
routine
is (A)
it
avoids
a^
kernel-mode
loop
with
interrupts
disabled (B)
it
ensures
that
all
processes
get
an
equal
amount
of
CPU
time
(C)
it
gives
a^
chance
for
the
keyboard
interrupt
handler
to
run
(D)
it
gives
other
processes
a^ chance
to
run
while
waiting
for
the
next
keystroke
(E)
all
of
the
above