1. ans=0; while (n>1) { ans++; n=n/2; } load n test: sub one ; test n>1 ? brpos do halt ; n<=1 done do: load ans add one store ans ; ans++ load n div two store n ; n=n/2 br test n: number ???? ans: number 0 one: number 1 two: number 2 2. (a) C0900000-1=C08FFFFF -------- C08FFFFF=3F700000 C09000000=-3F700000 80000000 | 3F700000 = BF700000 (b) C08FFFFF = 1 100 0000 1 001 0000 0000 0000 0000 0000 (-1)^1*(1.001)*2^(129-127)=-1.125*4=-4.5=-4.5*10^0 3. +----------+ 0 | next | +----------+ 1 | previous | +----------+ 2 | x | +----------+ 3 | y | +----------+ move R1, 0(R2) ; R1:address of C move 0(R2), R0 ; B.next=A move 1(R0), R2 ; A.prev=B move 1(R1), R0 ; C.prev=A move 0(R0), R1 ; A.next=C 4. move R1, #temp ; move R1, #16 => content of R1 becomes 16 move (R1), #15 ; content of address 16(temp) becomes #15 or R1, #10 ; #16=10000 #10=1010, content of R1 becomes 10000|1010=11010 5. (a) 1 2 3 4 5 6 7 8 9 10 F D E1 E2 F D E1 E2 F D E1 E2 F D E1 E2 F D E1 E2 F D E1 E2 F D E1 E2 (b) nonpipelined: 4*7=28 time units pipelined: 10 time units