Your cart is currently empty!
Please submit individual source files for coding exercises (see naming conventions below) and a single solution document for non-coding exercises (.txt or .pdf only). Your code and answers need to be documented to the point that the graders can understand your thought process. Full credit will not be awarded if sufficient work is not shown.…
Please submit individual source files for coding exercises (see naming conventions below) and a single solution document for non-coding exercises (.txt or .pdf only). Your code and answers need to be documented to the point that the graders can understand your thought process. Full credit will not be awarded if sufficient work is not shown.
struct point_color {
int c;
int m;
int y;
int k;
};
struct point_color square[16][16];
Assume the following:
Determine the cache performance of the following code:
for (i = 0; i < 16; i++) {
for (j = 0; j < 16; j++) {
square[i][j].c = 1;
square[i][j].m = 0;
square[i][j].y = 0;
square[i][j].k = 0;
}
}
Include your answers in your solutions document.
new block being written.
tag mismatch).
Name your source file 8-1.c.
Here is output from a sample run of the application (your output does not need to match exactly):
Enter ‘r’ for read, ‘w’ for write, ‘p’ to print, ‘q’ to quit: w
Enter 32-bit unsigned hex address: 0x0
Enter 32-bit unsigned hex value: 0xaabb
wrote set: 0 – tag: 0 – valid: 1 – value: bb aa 00 00
Enter ‘r’ for read, ‘w’ for write, ‘p’ to print, ‘q’ to quit: w
Enter 32-bit unsigned hex address: 0x8
Enter 32-bit unsigned hex value: 0xbbcc
wrote set: 2 – tag: 0 – valid: 1 – value: cc bb 00 00
Enter ‘r’ for read, ‘w’ for write, ‘p’ to print, ‘q’ to quit: p
set: 0 – tag: 0 – valid: 1 – value: bb aa 00 00
set: 2 – tag: 0 – valid: 1 – value: cc bb 00 00
Enter ‘r’ for read, ‘w’ for write, ‘p’ to print, ‘q’ to quit: w
Enter 32-bit unsigned hex address: 0x40
Enter 32-bit unsigned hex value: 0xccdd
evicting block – set: 0 – tag: 0 – valid: 1 – value: bb aa 00 00
wrote set: 0 – tag: 1 – valid: 1 – value: dd cc 00 00
Enter ‘r’ for read, ‘w’ for write, ‘p’ to print, ‘q’ to quit: p
set: 0 – tag: 1 – valid: 1 – value: dd cc 00 00
set: 2 – tag: 0 – valid: 1 – value: cc bb 00 00
Enter ‘r’ for read, ‘w’ for write, ‘p’ to print, ‘q’ to quit: r
Enter 32-bit unsigned hex address: 0x0
looking for set: 0 – tag: 0
found set: 0 – tag: 1 – offset: 0 – valid: 1 – value: dd tags don’t match – miss!
Enter ‘r’ for read, ‘w’ for write, ‘p’ to print, ‘q’ to quit: r
Enter 32-bit unsigned hex address: 0x4
looking for set: 1 – tag: 0
no valid set found – miss!
Enter ‘r’ for read, ‘w’ for write, ‘p’ to print, ‘q’ to quit: r
Enter 32-bit unsigned hex address: 0x8
looking for set: 2 – tag: 0
found set: 2 – tag: 0 – offset: 0 – valid: 1 – value: cc hit!
Enter ‘r’ for read, ‘w’ for write, ‘p’ to print, ‘q’ to quit: r
Enter 32-bit unsigned hex address: 0x40
looking for set: 0 – tag: 1
found set: 0 – tag: 1 – offset: 0 – valid: 1 – value: dd hit!
Enter ‘r’ for read, ‘w’ for write, ‘p’ to print, ‘q’ to quit: r
Enter 32-bit unsigned hex address: 0x41
looking for set: 0 – tag: 1
found set: 0 – tag: 1 – offset: 1 – valid: 1 – value: cc hit!
Enter ‘r’ for read, ‘w’ for write, ‘p’ to print, ‘q’ to quit: q
Zip the source files and solution document (if applicable), name the .zip file <Your Full Name>Assignment8.zip (e.g., EricWillsAssignment8.zip), and upload the .zip file to Canvas (see Assignments section for submission link).