Lecture 10

# On university of washington but now how do i know

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Cache Organiza?on Tag 00 ?? 01 01 Data University of Washington What’s a cache block? (or cache line) Byte Address Block (line) number 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 Index 0 1 2 3 3 4 5 6 7 Cache Organiza?on University of Washington A puzzle.         What can you infer from this: Cache starts empty Access (addr, hit/miss) stream (10, miss), (11, hit), (12, miss) Cache Organiza?on University of Washington Problems with direct mapped caches?   What happens if a program uses addresses 2, 6, 2, 6, 2, …? Memory Address 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 Cache Organiza?on Index 00 01 10 11 University of Washington Associa?vity     What if we could store data in any place in the cache? But that might slow down caches… so we do something in between. 1-way 8 sets, 1 block each Set 0 1 2 3 4 5 6 7 2-way 4 sets, 2 blocks each Set 8-way 1 set, 8 blocks 4-way 2 sets, 4 blocks each Set Set 0 0 1 0 2 1 3 direct mapped fully associative Cache Organiza?on University of Washington But now how do I know where data goes? (m-k-n) bits m-bit Address k bits Tag Index n-bit Block Offset Our example used a 22-block cache with 21 bytes per block. Where would 13 (1101) be stored? ? bits 4-bit Address Cache Organiza?on ? bits ?-bits Block Offset University of Washington Example placement in set-associative caches   Where would data from address 0x1833 be placed?   Block size is 16 bytes.   0x1833in binary is 00...0110000 011 0011. (m-k-n) bits k bits Tag Index m-bit Address k=? n-bit Block Offset k=? k=? 1-way associativity 8 sets, 1 block each 2-way associativity 4 sets, 2 blocks each 4-way associativity 2 sets, 4 blocks each Set 0 1 2 3 4 5 6 7 Set Set 0 0 1 2 1 3 Cache Organiza?on University of Washington Example placement in set-associative caches   Where would data from address 0x1833 be placed?   Block size is 16 bytes.   0x1833i...
View Full Document

## This document was uploaded on 04/04/2014.

Ask a homework question - tutors are online