l22 - Cache Organization Consider the following function:...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Cache Organization Consider the following function: void vec_add (int x[16], int y[16], int s[16]) { int i; for (i=0; i < 16; i++) s[i] = x[i] + y[i]; for (i=0; i < 16; i++) s[i] = s[i] + 1; } Simple direct-mapped cache: 128 byte cache, 16 byte blocks. Miss rate? Addresses Address of x : 0xc0 (tag=1, index=4) 00 2 3 25 2 00 100 0000000000000000000000001 Address of y : 0x200 (tag=4, index=0) 0000000000000000000000100 2 3 25 2 00 00 000 Address of s : 0x2a0 (tag=5, index=2) 0000000000000000000000101 2 3 25 2 00 00 010 Direct-Mapped Cache w3 1 2 3 4 5 6 7 V tag blocks w0 w1 w2 Request: load x[0] Addresses: x : tag=1, index=4 , y : tag=4, index=0 s : tag=5, index=2 Direct-Mapped Cache 2 3 4 5 6 7 V tag blocks w0 w1 w2 w3 1 1 x[1] x[2] x[3] x[0] 1 Request: load y[0] Addresses: x : tag=1, index=4 , y : tag=4, index=0 s : tag=5, index=2 Direct-Mapped Cache 2 3 4 5 6 7 V tag blocks w0 w1 w2 w3 1 1 x[1] x[2] x[3] 1 y[1] y[2] y[3] 4 y[0] x[0] 1 Request: store s[0] Addresses: x : tag=1, index=4 , y : tag=4, index=0 s : tag=5, index=2 Direct-Mapped Cache...
View Full Document

Page1 / 12

l22 - Cache Organization Consider the following function:...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online