Menu

(Solved) : Using C Determine Tag Set Number Offset Memory Address System Supporting N Way Set Associa Q37298295 . . .

USING C++:

Determine the tag, set number, and offset for a memory addressof a system supporting an N-way set-associative cache. Write aprogram that will first read in the information for N, memorycapacity (in bytes), block/line size (in bytes), cache capacity (inbytes), and a memory address (in decimal). It then does thenecessary mapping and displays the result to the screen. You mayassume that all the information entered is power of 2 except thememory address. The following shows a scenario of running a sampleprogram, where user’s inputs are represented in boldface.

Enter N: 4

Enter memory capacity: 512

Enter block/line size: 8

Enter cache capacity: 128

Enter a memory address: 73

The tag, set number, and offset for the address are 2, 1, and 1,respectively More conversions (y or n): y

Enter N: 2

Enter memory capacity: 128

Enter block/line size: 4

Enter cache capacity: 64

Enter a memory address: 109

The tag, set number, and offset for the address are 3, 3, and 1,respectively More conversions (y or n): n

Good bye!

Expert Answer


Answer to USING C++: Determine the tag, set number, and offset for a memory address of a system supporting an N-way set-associativ…

OR