{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# HW7 - again stored in location 0 The cache contents of the...

This preview shows pages 1–2. Sign up to view the full content.

1 ECE 662 (Sp 2009) Homework 7-Solutions Due June 3, 2009 1. After A2 After Inner Loop After C 0 Set 0: Block 0 A 0 A 0 C 0 Block 1 B 0 B 0 Set 1: Block 0 A 1 A 1 A 1 Block 1 B 1 B 1 Set 2: Block 0 A 2 A 2 A 2 Block 1 B 2 Set 3: Block 0 Block 1 Miss 3+4x1 2+4x1 2+4x1 = 19 Hits 2x9 (3+2x9)x4 1x4 = 106 Hit Rate = 106/125 = 84.8% 2. Problem 5.7 of the textbook. 1) This is not an easy problem as it appears. In the first pass through the loop, the Add instruction is stored at address 4 in the cache, and its operand (A03C) at address 6. Then the operand is overwritten by the Decrement instruction. The BNE instruction is stored at address 0. In the second pass, the value 05D9 overwrites the BNE instruction, then BNE is read from the main memory and

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

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

Unformatted text preview: again stored in location 0. The cache contents of the first three passes are shown below: Pass 1 Pass 2 Pass 3 0 BNE BNE BNE 2 10D7 4 Add Add Add 6 Dec Dec Dec 2) From the above one can calculate: First pass has 4 main memory access, and 4 cache access with a total of 44 second pass has 2 main memory access and 4 cache access with a total of 24 third pass has 1 main memory access and 4 cache access with a total of 14 Note that you always have to access the cache regardless where if you have to access the main memory first. 2 3) Problem 5.13 of the textbook. a. Direct mapping b. Associate-mapping c. Set-associate mapping...
View Full Document

{[ snackBarMessage ]}