Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Any sort of help on these questions would be greatly appreciated. Given a byte-a

ID: 3721738 • Letter: A

Question

Any sort of help on these questions would be greatly appreciated.

Given a byte-addressable memory with 256 bytes, suppose a memory dump yields the results below. The address of each memory cell is determined by its row and column.

For instance, memory address 0x97 is the 9th row, 7th column, and contains the hexadecimal value 43. Memory location 0xA3 contains the hexadecimal value 58. The system from which this memory dump was produced has cache with 4 sets with 1 line per set where each block consists of 8 bytes. Assume the following sequence of memory address reads take place:

3D, BE, 44, 81, 3F, 47, 95, BA, B9, 57

a) When a reference is made to memory location 97, what is the block of bytes that are retrieved?

b) Assuming a direct mapped cache:

a. Show the format for a main memory address. Specify field names and sizes.

b. What does the cache look like after the 10 memory accesses have taken place?

c. What was the hit rate for this cache for the 10 memory accesses? ?

c) Assuming a set associative cache with 2 lines per set:

a. Show the format for a main memory address. Specify field names and sizes.

b. What does the cache look like after the 10 memory accesses have taken place?

c. What was the hit rate for this cache for the 10 memory accesses?

d) Assuming a fully associative cache:

a. Show the format for a main memory address. Specify field names and sizes.

b. Assuming all cache blocks are initially empty, blocks are loaded into the first available empty cache location, and cache uses a first-in-first-out replacement policy, what does cache look like after the 10 memory accesses have taken place?

c. What is the hit rate for this cache for the 10 memory accesses?

0 12 345 6789ABDE F De D59C 77 C1 99 90 AC 33 D1 3774 B5 82 38 EO 149 E2 23 FD DO A6 98 BB DE 9A 9E EB 04 AA 86 E5 2 |3? | 14 | F3 | 59 | 5C | 41 | B2 | 6D | 18 | 3C | 9D | 1F | 2F | 78 | 44 | 1E 4 6B 69 0256 7E DA 2A 76 89208588 72 92 E95B 5 |?9 | 16 | A8 | FAIAE | 68 | 21 | 25 | 34 | 24 | B6 | 48 | 17 | 83 | 75 | 0A 7 |31|AF | 30|97|A4 | FE | 09 | 60 | 4F | D7 | D9 | 97 | 2E | 6C | 94 | BC 961 28 5D D4 4A 10 A2 43 CC07 7D5A CO D3CE 67 A 52 57 A358 55 OF E8 F6 91 FO C3 19 F9 BD 8B 47 B 26 51 1C C6 3B ED7B EE 9512 7C DF B1 4D EC 42 D 50 35 A9 4C 6A00 8AD6 5F 7A EF 71 13 F4 F8 46 E 1B 4B 70 84 EE7 63 3F CA 45 65 7379 C9FC A5 FAB E6 2D 54 E4 8 36 6F C7 05 D8 F2AD 15 32 06

Explanation / Answer

a)

When a reference is made to memory location 97,
First CPU will check if it exists in cache, if it is there in cache then it will get from there and no extra blocks will be accessed from memory.

Second, if cache doesn't have this location contents, then CPU will get a block of 8 bytes from memory which has 97 location in it.(Note: 8 bytes because each block size in cache is 8 bytes)

So, CPU will get below block of information from memory to cache(Locations from 0x90 to 0x97)

61 28 5D D4 4A 10 A2 43

b)

Direct mapped cache:

a]

Main memory size 256 Bytes

so address bus size 8 bits

Block size 8 Bytes, so LSB 3 bits will be used to identify a single byte in Block data

Tag bits will be MSB 5(i.e, 8-3) bits

b]

reference string: 3D, BE, 44, 81, 3F, 47, 95, BA, B9, 57

Assuming cache is empty initially.

Cache has 4 blocks each with size 8 Bytes. (m = 4)

main memory blocks = 256/8 = 32 blocks (k)

cache mapping block number = k % m = k % 4

Access 0x3D: MISS

3D = 00111 101

main memory block number will be 7 (i.e, 00111)

7 % 4 = 3

byte number 5 (i.e, 101)

Access 0xBE: MISS

BE = 10111 110

10111 = 23

110 = 6

23 % 4 = 3

Access 0x44: MISS

44 = 01000 100

01000 = 8

100 = 4

8 % 4 = 0

Access 0x81: MISS

81 = 10000 001

10000 = 16

001 = 1

16 % 4 = 0

Access 0x3F: MISS

3F = 00111 111

00111 = 7

111 = 7

7 % 4 = 3

Access 0x47: MISS

47 = 01000 111

01000 = 8

111 = 7

8 % 4 = 0

Access 0x95: MISS

95 = 10010 101

10010 = 18

101 = 5

18 % 4 = 2

Access 0xBA: MISS

BA = 10111 010

10111 = 23

010 = 2

23 % 4 = 3

Access 0xB9: HIT

B9 = 10111 001

10111 = 23

001 = 1

23 % 4 = 3

Access 0x57: MISS

57 = 01010 111

01010 = 10

111 = 7

10 % 4 = 2

c]

hit ratio = 1 hit out of 10 accesses

= 1/10 = 0.1

This question is really big. I have answered enough for the time given.

Actually you should split the question.

I have answered first 4 sub questions.

Ping me if you have any doubt in understanding this.

Thank you.

Tag Block number Cache contents 0 1 2 00111 3 EF C5 CE BF 93 CB 39 7F
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote