selvaraj wrote:Dear All,
Kindly spare your valuable time to suggest me to do the solutions of the Question.I shall wait for your valuable suggestions.
The Question is ,
(1) A computer stores a number in a 16-bit word using floating-point arrangement. Given that the first bit is reserved for the sign, followed by 6 bits for the exponent having a biased of (+31) and the remaining bits for the mantissa with a hidden bit. Show how the computer stores -0.625.
Before anyone reading this starts to panic, you will absolutely never see a question like this on the GMAT, so unless you have an interest in floating point binary representations of numbers, you don't need to read any further.
On to the question. I don't normally work in this area, so I'm not an expert, but if I understand floating point conventions properly, the conversion should work like this:
In fixed point binary, we'd write 0.625 = 1/2 + 1/2^3 as:
0.101
The question asks about a 'floating point' binary representation of this number. Floating point representation is very much like scientific notation for traditional numbers. Here,
0.101 = 1.01 x 2^(-1)
Now, we need to convert that to a 16-bit string using the formatting restrictions provided:
- The first digit is the sign. I'll assume the standard convention is used, so that 0 is used for a positive sign, and 1 for a negative sign. Our first digit is 1, since our number is negative;
- The next six digits are used for the exponent. Normally, instead of storing negative and positive exponents, exponents are stored as positive numbers, but the exponent will be 'biased'. The computer will subtract the bias value before performing any calculation. Here, we want an exponent of -1 with a bias of +31. We should therefore store the exponent as 30, and the computer will convert that to -1. In binary, 30 = 11110, and as a six-digit string, we need to add a zero at the beginning: 011110
- Finally, we need to store the significant digits of our number, the 1.01 part. This would normally be stored as 101 if there is no hidden digit, but since the first digit in binary scientific notation is always '1', it can be omitted to compress our data. So the significant digits of our number will be stored simply as 01, followed by seven zeros because we have to fill nine digits.
So our number would be stored as:
1011110010000000