1 / 5

Answer 1

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

Download Presentation

Answer 1

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 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…….

  2. 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

  3. 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.

  4. Answer 4 O p e r a t i o n a 0 R e s u l t 1 b 2 3

  5. 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

More Related