Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.64 KB | None | 0 0
  1. \documentclass[6pt]{article}
  2. \usepackage[margin=1in]{geometry}% Change the margins here if you wish.
  3. \setlength{\parindent}{0pt} % This is the set the indent length for new paragraphs, change if you want.
  4. \setlength{\parskip}{5pt} % This sets the distance between paragraphs, which will be used anytime you have a blank line in your LaTeX code.
  5.  
  6. \usepackage{amsmath,amsthm,amssymb, mathtools}
  7.  
  8. \usepackage{graphicx}
  9.  
  10. \usepackage{color}
  11. \usepackage{enumerate}
  12. \usepackage{multicol}
  13.  
  14. \usepackage{amssymb}
  15. \usepackage{bussproofs}
  16.  
  17. \begin{document}
  18.  
  19. \title{}
  20. \author{}
  21. \date{}
  22.  
  23. \maketitle
  24. \section{}
  25. A) The block size is 64B. 2$^x$ = 64. Solving for x will show that the offset will need 6 bits.
  26. \newline
  27. The number of indices needed are the equal to the number of sets required. The number of sets needed is 16KB/64B/1 = 256 sets. Solving 2$^x$ = 256 will show that the index needs 8 bits.
  28.  
  29. To get the tag bits, subtract the index and offset bits from the total memory address. 32-6-8 = 18 bits.
  30.  
  31. The binary string for the memory address is 0000 0000 1111 1111 1011 0000 0100 1000. Converting the address to hexadecimal and using the bits from above, the offset will be 0x8, the index will be 0xc1, and the tag will be 0x003fe.
  32. \newline
  33.  
  34. B) The block size is 16B, 2$^x$ = 16. Solving for x will show that the offset will need 4 bits.
  35. \newline
  36. The number of indices needed are the equal to the number of sets required. The number of sets needed is 512KB/16B/8 = 4096 sets. Solving 2$^x$ = 4096 will show that the index needs 12 bits.
  37.  
  38. To get the tag bits, subtract the index and offset bits from the total memory address. 32-4-12 = 16 bits.
  39.  
  40. The binary string for the memory address is 0001 1010 0010 1011 0011 1100 0100 1101. Converting the address to hexadecimal and using the bits from above, the offset will be 0xd, the index will be 0x3c4, and the tag will be 0x1a2b.
  41. \newline
  42.  
  43. C) Use the AMAT = t$_h$ + r$_m$ * t$_p$. The AMAT will be 4 + (1-0.75) $*$ (28-4) = 10 cycles
  44. \newline
  45.  
  46. D) Use the equation stated in part C. Calculating L2 cache AMAT: 10 + (0.5 * 80) = 50 cycles. Calculating overall AMAT by plugging in result from L2 cache AMAT into miss penalty: 2 + (0.25 * 50) = 14.5 cycles.
  47.  
  48. \section{}
  49. A) The code will grab a block which has two longs, since the block size is 16B and a long is 8B. Since it progresses by column, it will always have the next item it needs in the cache, resulting in a miss at first and then a hit. The hit rate is 50\%.
  50. \newline
  51.  
  52. B) The code now progresses by row. It does not use the entire cache, and only uses some of the total sets. By the time it comes back to try to use an element it stored and needed, it is overwritten because there are only 2 blocks per set. Every time would result in a miss. The hit rate is 0\%.
  53. \newline
  54.  
  55. C) Compulsory Misses due to 2D matrix not being in cache when code starts.
  56. \newline
  57.  
  58. D) Conflict Misses due to only parts of the cache being used and not all of it.
  59. \newline
  60.  
  61. E) Increase the block size so that you can fit more memory locations in a block.
  62. \newline
  63.  
  64. F) Increase the set associativity so that there are more blocks present in a set.
  65.  
  66. \section{}
  67. 3A:
  68. \newline
  69.  
  70. i)
  71. \newline
  72.  
  73. ii)
  74. \newline
  75.  
  76. iii)
  77. \newline
  78.  
  79. 3B)
  80.  
  81.  
  82. \section{}
  83. A) Each page is 2KB, the page offset will need 2$^x$ = 2048B. This will be 11 bits. The virtual memory address is 27 bits. The VPN is the remaining bits in the virtual address not including the offset. The VPN is 27-11 = 16 bits. Likewise the PPN is also the remaining bits in the physical address, so the PPN is 24-11 = 13 bits.
  84. \newline
  85.  
  86. B)
  87. \newline
  88.  
  89. D) Base and bounds registers are cheaper and faster.
  90.  
  91. \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement