15-347 Spring '98, Final Exam Official solution --------------------------------------------------------------------------- PROBLEM 1. A. $31 B. -1 C. E7FFFFFF --------------------------------------------------------------------------- PROBLEM 2. No. When \verb@p == 0@, the {\tt ldl} would attempt to read from virtual address 0. This is never a legal address in an Alpha processor. --------------------------------------------------------------------------- PROBLEM 3. A - E: miss / hit / hit / miss / miss --------------------------------------------------------------------------- PROBLEM 4. A - D: miss 16 / hit 0 / miss 32 / miss 32 --------------------------------------------------------------------------- PROBLEM 5. A. 1/2 B. (a) 12.5% (b) 25% (c) 25% --------------------------------------------------------------------------- PROBLEM 6. A. Error. Cannot have TLB valid and page table entry invalid B. Error. Aliasing---VPN 05 also maps to PPN 16. C. OK. Not valid, so translation does not matter D. OK. TLB and page table both map to PPN 11. --------------------------------------------------------------------------- PROBLEM 7. A. When exp = 1 will turn number into denorm. Maintains same exponent weight but eliminates implied 1. Value is +- (x - 2^-126) B. Always wrong. Wraps +-0 to +-infinity. Others to NaN C. Always wrong. Maps to +-2^127 D. Always wrong. Maps to +-(1.sig)*2^127, --------------------------------------------------------------------------- PROBLEM 8. struct s1: t 0 4 | y 4 4 | l 8 4 | h 16 8 | struct s2: k 0 8 | m 8 8 | r 16 8 | c 24 8 | struct s3: a 0 8 | o 8 8 | union u1: e 0 4 | d 0 8 | --------------------------------------------------------------------------- PROBLEM 9. p1: c->r->a->y p2: c->o->c->k->e p3: a->m->d->a->h->l --------------------------------------------------------------------------- PROBLEM 10. CYCLE 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 addq $31, 0x8, $1: F D E$1 M W cmoveq $1, $1, $2: F D $1E M W beq $2, target: F D E M W stq $1, 0x0($31): F D E stq $1, 0x8($31): F D stq $1, 0x10($31): F target: ldq $1, 0x8($1): F D E M$1 W stq $1,0x10($1): F D D $1E M W addq $1, $2, $3: F F D E M W call_pal halt: F D E M W A. BRK B. call_pal halt C. c14 --------------------------------------------------------------------------- PROBLEM 11. CYCLE 0 1 2 3 4 5 6 7 8 9 addq $30, 0x8, $31: F D E M W beq $31, target: F D E M W ldq $1, -0x8($31): F D E call_pal halt: F D target: stq $31, 0x4($31): F F D E M W call_pal cflush F D E M addq $30, $30, $31: F D E call_pal halt F D A. ADR (address 0x4 is unaligned) B. stq $31, 0x4($31) C. c9 --------------------------------------------------------------------------- PROBLEM 12. A. 1000 * p / (10 + 0.025p) B. p >= 100 --------------------------------------------------------------------------- PROBLEM 13. A. h * (10 + 0.025p) B. h <= 8 --------------------------------------------------------------------------- PROBLEM 14. A. 60% B. 60% --------------------------------------------------------------------------- PROBLEM 15. A. 80% B. 80% --------------------------------------------------------------------------- PROBLEM 16. Small line size: Not exploiting spatial locality of reference Large line size: Getting false sharing Medium: Exploiting spatial locality without false sharing --------------------------------------------------------------------------- PROBLEM 17. 9.6 X 10^9 B/sec --------------------------------------------------------------------------- PROBLEM 18. Notation: { ix, iy | iw, iz } means either: ix, iy, iw, iz, or iw, iz, ix, iy A. { i1, i2 | i4, i5 }, { i3 | i6 } B. { i1 | i4 }, { i2, i3 | i5, i6 } or { i1 | i4 }, { i2 | i5 } | { i3, i6 } C. i4, i5, { i1 | i6 }, i2, i3 ---------------------------------------------------------------------------