Solved-Program 6 -Solution

$35.00 $24.00

Write a program in VS C++ 2017 to determine the tag, set number, and offset for a memory address of a system supporting an N-way set-associative cache. Your program should first read in the information for N, memory capacity (in bytes), block/line size (in bytes), cache capacity (in bytes), and a memory address (in decimal).…

You’ll get a: . zip file solution

 

 
Categorys:
Tags:

Description

5/5 – (2 votes)

Write a program in VS C++ 2017 to determine the tag, set number, and offset for a memory address of a system supporting an N-way set-associative cache. Your program should first read in the information for N, memory capacity (in bytes), block/line size (in bytes), cache capacity (in bytes), and a memory address (in decimal). It then does the necessary mapping and displays the result to the screen. You may assume that all the information entered is power of 2 except the memory address. The following shows a scenario of running a sample program, 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!

Follow the criteria shown below to prepare and turn your program in to Canvas.

  1. You MUST use VS C++ 2017 to develop, compile, debug, test, and run your program.

  1. Submit only the source-code file to Canvas (on time or late).

  1. Make sure your program compiles successfully in order not to lose a major portion of total points.

  1. Your program will be tested using the test cases similar to those shown above.

Page 1 of 1