assembly - Decimal to binary using sign, exponent, magnitude -
i have operating systems final later today , i'm looking on past exams. anyways long story short got wrong, isn't hw problem i'm unsure how it.
"suppose use 32 bits represent real number, 1 bit sign of number, 7 bits exponent, , 24 bits magnitude. show bit pattern number 0.5"
the way did on exam multiply number 2, keep first digit before decimal point , repeat process remainder if it's remainder not 0, otherwise done.
0.5 * 2 =1.0
0 * 2 =x
answer 1
but isn't correct, can me process? thank you.
assuming a bias of 63 on exponent , implicit leading 1 on mantissa, i'd conclude following bit pattern:
0 0111110 000000000000000000000000 (== 0x3e000000)
i.e.
+(1 + 0) * power(2, 62-63)
== +1 * power(2, -1)
== +1 * 0.5 == +0.5
Comments
Post a Comment