0% found this document useful (0 votes)
26 views2 pages

Solution To Problem1 of Assignment 2

some java topics

Uploaded by

chaubeyashu2005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views2 pages

Solution To Problem1 of Assignment 2

some java topics

Uploaded by

chaubeyashu2005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Computer Organization and Microprocessors- Assignment 2

1. Consider a memory system that uses a 32-bit address to address at the byte level, plus a cache
that uses a 64-byte line size.
a. Assume a direct mapped cache with a tag field in the address of 20 bits. Show the address
format and determine the following parameters: number of addressable units, number of
blocks in main memory, number of lines in cache, size of tag.
Solution :
The no. of addressable units = 232 bytes.

Tag field size = 20 bits (Given)


Line size = 64 bytes (Given) = Block size in main.
The no. of main memory blocks = 232 / 64 = 226 = 64M blocks.
Size of word field in memory address = 6 bits, as 2 6 = 64.

So, size of line field in main memory address = 32- 20 - 6 = 6 bits.


No. of lines in cache = 26 = 64 lines

b. Assume an associative cache. Show the address format and determine the following

parameters: number of addressable units, number of blocks in main memory,

number of lines in cache, size of tag.

Solution:
The no. of addressable units = 232 bytes.
Line size = 64 bytes (Given) = block size
Hence, size of word field = 6 bits, as 26 = 64.
The no. of main memory blocks = 232 / 64 = 226 = 64M blocks.

Thus, size of tag field = 32 – 6 = 26 bits.


No. of cache lines cannot be determined.

c. Assume a four-way set-associative cache with a tag field in the address of 9 bits.

Show the address format and determine the following parameters: number of addressable
units, number of blocks in main memory, number of lines in set, number

of sets in cache, number of lines in cache, size of tag.

Solution:
The no. of addressable units = 232 bytes.

Line size = 64 bytes (Given) = block size


The no. of main memory blocks = 232 / 64 = 226 = 64M blocks.

No. of lines in a set = 4 (Given)

Size of tag filed = 9 bits (Given)

Size of word field = 6 bits, as 64 bytes are present in a line.

Size of set field = 32 – 9 – 6 = 17 bits.

No. of sets = 217 sets

Total no. of cache lines = no. of sets X lines in a set = 2 17 X 4 = 219 lines.

You might also like