Floating point number,Mantissa,Exponent

10.2k Views Asked by At

In this computer, numbers are stored in $12$-bits. We will also assume that for a floating point (real) number, $6$ bits of these bits are reserved for the mantissa (or significand) with $2^{k-1}-1$ as the exponent bias (where $k$ is the number of bits for the characteristic).

$011100100110010111110011$

What pair of floating point numbers could be represented by these $24$-bits?

I have gone this far:

As described above that each number is of $12$ bit so we get each number

$011100100110$

First one is $0$ bit so it is positive and

Mantissa will be $100110$

Exponent will be $11100b=28$

my unbiased exponent will be $2^{28-15}=2^{13}$

How to find the floating point number from here?

2

There are 2 best solutions below

6
On

Usually the mantissa is considered to have a binary point after the first bit, so your mantissa would be $1.1100_2=\frac 74=1.75_{10}$. Sometimes a leading $1$ is assumed, so your mantissa would be $(1).11100_2=\frac{15}8=1.875_{10}$ This gives one more bit of precision. To find the exponent, you subtract the offset from the stored value. You probably meant $2^{k-1}-1$ as the offset. Can you do that?

0
On

I’m not an expert so please help me out if you find a mistake. Thank you in advance.

The 12-bit coding should be in this format:

  1. Bit 11, the sign
  2. Bit 10-6, the exponent
  3. Bit 5-0, the mantissa

Notes:

  1. As far as I know the exponent is not represented with sign but as 2’s complement
  2. The mantissa has the most significant bit (bit 5, the far-left) as $2^{-1}$ and the least significant bit (bit 0) as $2^{-6}$.

Now the first code: $011100100110$

  1. Bit 11=0: positive number
  2. Exponent: $11100_2=12$
  3. Mantissa: $100110\rightarrow 1.100110_2=1\frac{19}{32}$
  4. Final answer:$1\frac{19}{32}\cdot 2^{12}\approx 6528.$

Second code:$010111110011$

  1. Bit 11=0: positive number
  2. Exponent: $10111_2=7$
  3. Mantissa: $110011\rightarrow 1.110011_2=1\frac{51}{64}$
  4. Final answer: $1\frac{51}{64}\cdot 2^7=\frac{115}{32768}\approx 230.$