Find Jobs
Hire Freelancers

A question about cache

$10-30 CAD

Closed
Posted over 8 years ago

$10-30 CAD

Paid on delivery
We have two functions : /* * Sum the array elements, one way. */ long sumA(long *a, int numrows, int numcols) { int i, j; long sum = 0; for (i = 0; i < numrows; i++) for (j = 0; j < numcols; j ++) sum += cache_read(cache, &a[i * numcols + j]); return sum; } /* * Sum the array elements, another way. */ long sumB(long *a, int numrows, int numcols) { int i, j; long sum = 0; for (j = 0; j < numcols; j ++) for (i = 0; i < numrows; i++) sum += cache_read(cache, &a[i * numcols + j]); return sum; } This problem tests your ability to predict the cache behavior of C code. For each of the following caches, array sizes and functions, firrst determine the miss rate using your cache implementation from the previous question (or my reference solution contained in the le cache-reference.o), and then explain how you would have derived the miss rate given only the program code and the characteristics of the cache (that is, using pencil and paper only). Assume that we execute the code under the following conditions:  sizeof(long) = 8  The cache contains 32 blocks; each block is 64 bytes long.  The arrays are stored in row-major order.  The only memory accesses are to the entries of the array a. a. An array of long with 4 rows of 128 columns, a direct-mapped cache, and the function sumA from the program cache-test from question 1. [3] b. An array of long with 4 rows of 128 columns, a direct-mapped cache, and the function sumB from the program cache-test from question 1. [3] c. An array of long with 4 rows of 128 columns, a direct-mapped cache, and the function sumC from the program cache-test from question 1. [3] d. An array of long with 4 rows of 128 columns, a two-way set-associative cache, and the function sumB from the program cache-test from question 1. [3] e. An array of long with 4 rows of 128 columns, a four-way set-associative cache, and the function sumB from the program cache-test from question 1. [3] f. An array of long with 4 rows of 120 columns, a direct-mapped cache, and the function sumB from the program cache-test from question 1. Sample solution should look like : The miss rate is 25%: we are traversing the array by increasing memory address of the elements, and hence every miss is followed by three hits accessing elements that are in the same cache line.
Project ID: 8859858

About the project

6 proposals
Remote project
Active 8 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
6 freelancers are bidding on average $59 CAD for this job
User Avatar
I am very proficient in c, c++. I have 15 years c++ developing experience now, and I have worked for 5 years. My work is online game developing, and mainly focus on server side, the language is c++ under linux. I used c++ to make many great projects, for example, I made the tools which can convert java files to c++ scripts which has the same effect, of course garbage collection included. I also made our own mobile game using c++, I even can show you the demo of client. Trust me, please let expert help you.
$80 CAD in 1 day
4.9 (105 reviews)
6.8
6.8
User Avatar
Dear Sir. I'm very interested in your job post involving these skills. I have 7 years experience in C/C++. I have consistently delivered projects on time and under budget, which has earned us many positive ratings, as you'll see in work history. I believe that my skills would be ideal for your project. Regards.
$105 CAD in 1 day
5.0 (2 reviews)
4.5
4.5
User Avatar
A proposal has not yet been provided
$66 CAD in 1 day
5.0 (5 reviews)
2.4
2.4
User Avatar
I would love the chance to talk more about the project and what it is that you would need me to do. I am new on freelancer but am looking for a chance to prove myself.
$50 CAD in 2 days
0.0 (0 reviews)
0.0
0.0
User Avatar
A proposal has not yet been provided
$25 CAD in 1 day
0.0 (0 reviews)
0.0
0.0

About the client

Flag of CANADA
Canada
0.0
0
Member since Nov 8, 2015

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.