20 likes | 105 Views
Quiz 2 -Answer 1. area: lwc1 $f2,0($gp) # $f2=PI mul.d $f0,$f12,$f12 # $f0=R 2 mul.d $f0,$f0,$f2 # $f0=R 2 *PI jr $ra #return 1 1000001 0110000… = -1.011*2 (129 - 127) = -1.011*2 2 = 101.1 = 5.5 63.75 = 111111.11 = 1.1111111* 2 5 =
E N D
Quiz 2 -Answer 1 area: lwc1 $f2,0($gp) # $f2=PI mul.d $f0,$f12,$f12 # $f0=R2 mul.d $f0,$f0,$f2 # $f0=R2*PI jr $ra #return 1 1000001 0110000… = -1.011*2(129 - 127)= -1.011*22 = 101.1 = 5.5 63.75 = 111111.11 = 1.1111111* 25 = 1.1111111* 2(1028 - 1023) = 0 10000000110 111111100000... Answer 2
Answer 3 addi $t0,$zero,0xa010 # $t0=0xa010 lui $t0,0x700d # $t0=0x700da010 The upper bits of both PCs are the same so we just have to convert the byte address to a word address. So the address in the jump instruction is: 0x20000. Performing a XOR operation on two numbers. If they are equal the result will be 0. The result bits are then ORed together. If they are all 0 the result will be 0. It is faster because all bits are computed in parallel. Not like subtraction where the higher bits are dependent on the lower bit carries. Answer 4