Find Jobs
Hire Freelancers

A question about cache

$10-30 CAD

Geschlossen
Veröffentlicht vor mehr als 8 Jahren

$10-30 CAD

Bezahlt bei Lieferung
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.
Projekt-ID: 8859858

Über das Projekt

6 Vorschläge
Remote Projekt
Aktiv vor 8 Jahren

Möchten Sie etwas Geld verdienen?

Vorteile einer Ausschreibung auf Freelancer

Legen Sie Ihr Budget und Ihren Zeitrahmen fest
Für Ihre Arbeit bezahlt werden
Skizzieren Sie Ihren Vorschlag
Sie können sich kostenlos anmelden und auf Aufträge bieten
6 Freelancer bieten im Durchschnitt $59 CAD für diesen Auftrag
Avatar des Nutzers
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 Tag
4,9 (105 Bewertungen)
6,8
6,8
Avatar des Nutzers
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 Tag
5,0 (2 Bewertungen)
4,5
4,5
Avatar des Nutzers
A proposal has not yet been provided
$66 CAD in 1 Tag
5,0 (5 Bewertungen)
2,4
2,4
Avatar des Nutzers
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 Tagen
0,0 (0 Bewertungen)
0,0
0,0
Avatar des Nutzers
A proposal has not yet been provided
$25 CAD in 1 Tag
0,0 (0 Bewertungen)
0,0
0,0

Über den Kunden

Flagge von CANADA
Canada
0,0
0
Mitglied seit Nov. 8, 2015

Kundenüberprüfung

Danke! Wir haben Ihnen per E-Mail einen Link geschickt, über den Sie Ihr kostenloses Guthaben anfordern können.
Beim Senden Ihrer E-Mail ist ein Fehler aufgetreten. Bitte versuchen Sie es erneut.
Registrierte Benutzer Veröffentlichte Jobs
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Vorschau wird geladen
Erlaubnis zur Geolokalisierung erteilt.
Ihre Anmeldesitzung ist abgelaufen und Sie wurden abgemeldet. Bitte melden Sie sich erneut an.