50 likes | 56 Views
Answer 1. 1. a. 1 10000000 01000000000000000000000 float = (-1) 1 *(1 + .01)*2 (128-127) = -(1 + 0.25)*2 1 = -1.25*2 = -2.5 unsigned = 1 1000000001000000000000000000000 = (2 31 + 2 30 + 2 21 ) = 2147483648 + 1073741824 + 2097152
E N D
Answer 1 1.a. 1 10000000 01000000000000000000000float = (-1)1*(1 + .01)*2(128-127) = -(1 + 0.25)*21 = -1.25*2 = -2.5 unsigned = 11000000001000000000000000000000 = (231 + 230 + 221) = 2147483648 + 1073741824 + 2097152 = 3,223,322,624 b. -6 char = -00000110 = 11111001+1 = 11111010 double = -110 = -1.10*22 = (-1)1*(1 + .1)*2(1025-1023) = 1 10000000001 100000000000…….
Answer 2 float circle_area(float radius) { return(radius*radius*3.14); } circle_area: mul.s $f0,$f12,$f12 #$f0=radius2 lwc1 $f2,0($gp) #$gp[0] holds # 3.14 mul.s $f0,$f0,$f2 # $f0=$f0*3.14 jr $ra #return
Answer 3 Register $s0 contains1111 1111 1111 1111 1111 1111 1111 1111 Register $s1 contains1000 0000 0000 0000 0000 0000 0000 0001 slt $t0,$s0,$s1 compares 2 signed numbers. $s0 contains -1 and $s1 contains -231-1. -1> -231-1 so $t0 equals 0. sltu $t1,$s0,$s1 compares 2 unsigned numbers. $s0 contains 232-1 and $s1 contains 231 . 232-1 > 231 so $t1 equals 0 as well.
Answer 4 O p e r a t i o n a 0 R e s u l t 1 b 2 3
0 1 Answer 4, 2nd Solution O p e r a t i o n not a 0 R e s u l t 1 b 2