CS代考 Final Exam Solutions

Final Exam Solutions
15-213 / 18-213 Fall 2011

1-a 2-b 3-c 4-b 5-c 6-a 7-b 8-b 9-a 10-c

Copyright By PowCoder代写 加微信 powcoder

Value FP bits Rounded value
2 100 00 2 normalized, exact
13 110 10 12 normalized, round down
1/8 000 10 1/8 exact, denorm
15/4 101 00 4 normalized, round up

int loopy(int a[], int n) {
int x = 0;

for(i = 0; x < n; i++) { if (x < a[i]) A. eax=0x8048395 B. eip=0x804839b 0xffffd824: 0x4 arg2 0xffffd820: 0x2 arg1 0xffffd81c: UNKNOWN return addr 0xffffd818: 0xffffd838 old ebp 0xffffd814: 0x3 arg2 0xffffd810: 0x2 arg1 0xffffd80c: 0x8048398 return addr D. ebp=0xffffd818 Child: sum=30 Parent: sum=15 B. There are three possible outputs: 1. Child: sum=30 Parent: sum=15 2. Parent: sum=15 Child: sum=30 3. Child: sum=15 (if fork fails and returns -1) C. The possible outputs are any variant of "5030" interspersed with "9". E.g., 95030, 59030, 50930, 50390 (a) 20 bits to represent virtual address space (b) 18 bits to represent physical address space (c) 12 bits to reprsent page table offset TLBT: 0x07 TLB Hit: N Page Fault: N Physical Address: 0x15213 TLBT: 0x05 TLB Hit: Y Page Fault: N Physical Address: 0x13213 ********** Problem 10 ********** A. Output: buf = foobar B. Output: buf = foofoo ********** Problem 11 ********** A. mutex=1, items=0, slots=10 add_item(item) item = remove_item return item 程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com