Problem Set A

Problem Set A

1 .
A cache has an access time of 1 cycle. The computer with that cache experienced an average memory access time of 4 cycles, and the hit rate is 70%. What is the access time of the main memory? Did we benefit from having a cache in this system?
2 .
Research and explain a few key responsibilities of operating systems.
Given X = 01100110,
3 .
What is the value of X once you logically shift X to the right by two digits?
4 .
What is the value of X once you arithmetically shift X to the right by two digits?
Given X = 10100110,
5 .
What is the value of X once you logically shift X to the right by two digits?
6 .
What is the value of X once you arithmetically shift X to the right by two digits?
7 .
What is the value of X if you arithmetically shift it to the right by eight digits?
Perform the following number conversions:
8 .
hexadecimal value 40A5F916 to binary
9 .
binary value 11011010011010111010 to hexadecimal
10 .
Considering the arguments passed in, what does the following assembly language program do?
Register Use(s)
%rdi Argument x
%rsi Argument y
%rax Return value
movq %rdi, %rax
subq %rsi, %rax
movq %rsi, %rdx
subq %rdi, %rdx
cmpq %rsi, %rdi
cmovle %rdx, %rax
ret  
11 .
Suppose that we have a system with memory access time of 8 cycles. We need to add to that system a cache with 2 cycles access time. What is the smallest hit rate needed to make that cache beneficial? (Hint: avg access time must always be an integer number not floating point.)
12 .
A cache has an access time of 1 cycle. The computer with that cache experienced an average memory access time of 4 cycles, and the hit rate is 70%. What is the access time of the main memory? Did we benefit from having a cache in this system?