Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Homework Solutions for CPSC 2105: Introduction to Computer Organization, Assignments of Computer Architecture and Organization

Answers and comments for homework set 8 of the cpsc 2105 course, which covers computer organization. It includes solutions for questions related to direct-mapped and fully-associative caches, cache block sizes, and effective access times.

Typology: Assignments

Pre 2010

Uploaded on 08/04/2009

koofers-user-4yr
koofers-user-4yr ๐Ÿ‡บ๐Ÿ‡ธ

3

(1)

10 documents

1 / 2

Toggle sidebar

Related documents


Partial preview of the text

Download Homework Solutions for CPSC 2105: Introduction to Computer Organization and more Assignments Computer Architecture and Organization in PDF only on Docsity! CPSC 2105 Introduction to Computer Organization Homework Set 8 Due Monday, April 3, 2006 HOMEWORK KEY WITH ANSWERS AND COMMENTS. 1. Suppose a computer using direct mapped cache has 232 words of main memory and a cache of 1024 blocks, where each cache block contains 32 words. a) How many blocks of main memory are there? b) What is the format of a memory address as seen by the cache, that is, what are the sizes of the tag, block, and word fields? c) To which cache block will the memory reference 0000 63FA map? ANSWER: Recall that 1024 = 210 and 32 = 25, from which we may conclude 1024 = 32 ๏‚ท 32. a) The number of blocks is 232 / 25 = 2(32 โ€“ 5) = 227 = 27 ๏‚ท 220 = 128 M = 134, 217, 728. b) 32 words per cache line ๏ƒž Offset address is 5 bits. 1024 blocks in the cache ๏ƒž Block number is 10 bits. 232 words ๏ƒž 32 bit address ๏ƒž 32 โ€“ (5 + 10) = 10 โ€“ 15 = 17 bit tag. Bits 31 15 14 5 4 0 Contents Tag Block Number Offset within block c) The number of bits allocated to the block number and offset are 15. We examine the last four hex digits of 0000 63FA, as they correspond to 16 binary bits. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Hex 6 3 F A Binary 0 1 1 0 0 0 1 1 1 1 1 1 1 0 1 0 11 0001 1111 = 0x31F 1 1010 = 0x1A = 26 0x31F = 3๏‚ท256 + 1๏‚ท16 + 15 = 768 + 16 + 15 = 799. 2. Suppose a computer using fully associative cache has 224 words of main memory and a cache of 128 blocks, where each cache block contains 64 words. a) How many blocks of main memory are there? b) What is the format of a memory address as seen by the cache, that is, what are the sizes of the tag and word fields? Answer: Recall that 128 = 27 and 64 = 26. a) The number of blocks is 224 / 26 = 2(24 โ€“ 6) = 218 = 28 ๏‚ท 210 = 256 K = 262, 144. b) For associative mapping the address has only tag and word offset in the block. 64 word block ๏ƒž 6 bit offset. 24 bit address ๏ƒž (24 โ€“ 6) = 18 bit tag. Bits 23 6 5 0 Contents Tag Offset in block
Docsity logo



Copyright ยฉ 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved