1. Definitions
b. data forwarding A technique for resolving data hazards by getting the result of a previous instruction from internal resources rather than waiting for the instruction to complete.
c. spatial locality The locality principle stating that if a data location is referenced, data locations with nearby addresses will tend to be referenced soon.
d. write-back cache A scheme that handles writes by updating values only to the block in the cache, then writing the modified block to the lower level of the hierarchy when the block is replaced.
e. pipelining stall Also called bubble. A stall initiated in order to resolve a hazard.
2.2: d There's no such thing as cylinder alignment time.
2.3: b or c Immediate addressing and PC-relative addressing can be safely ignored by the linker.
2.4: c There's no such thing as a conditional miss.
b. This is a data hazard, because the results of the first add are needed by the second one. The hazard can be resolved with data forwarding.
c. There's no hazard here; the second add does not rely on the results of the first.
b. To find the number of bits in the tag, follow the four-step procedure outlined in email. Start with the 32 bits in the address. Throw away 2 because the memory is byte addressed and 2 because the block size is 4 = 2^2. Throw away 8 more for the size of the cache index, and you're left with 32-2-2-8 = 20 bits.
c. The address 0x00543210 was just referenced. To decide whether the next reference X is present in the cache, we have to look at two things. First, do the indices match? Next, do the tags match? We know that the lower 4 bits (lowest hex digit) don't matter from part b. The next 8 bits (next 2 hex digits) form the index, and the top 20 bits (top 5 hex digits) form the tag.
c.2 Here the index is 0x21 and the tag is 0x00543. The index matches and the tag matches, so we know that this data item is present in the cache.
c.3 Here the index is 0x21 and the tag is 0x00555. The index matches but the tag doesn't match, so we know that this data item is absent from the cache.
b. If the cache hit rates aren't high enough, you might increase the size of the cache (combatting capacity misses) or change the associativity of the cache (combatting conflict misses). There's really not much you can do about compulsory misses, though associativity will help a little with that too.
b. FUN returns 1 if $a0 is 1.
c. FUN computes the Fibonacci numbers: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, and so on. Each Fibonacci number is the sum of the previous two. Expressed as a formula, FUN(a0) = FUN(a0-1) + FUN(a0-2).