Computer Science Stack Exchange is a question and answer site for students, researchers and practitioners of computer science. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to represent $0.148 * 2^{14}$ in normalized floating point arithmetic with the format

1 - Sign bit
7 - Exponent in Excess-64 form
8 - Mantissa

$(0.148)_{10} = (0.00100101\;111...)_2$

We shift it 3 bits to left to make it normalized $(1.00101\;111)_2 * 2^{11}$.

Exponent = $11+64 = (75)_{10} = (1001011)_2$ and Mantissa = $(01001\;111)_2$.

So floating point representation is $(0\;1001011\;00101111)_2 = (4B2F)_{16}$ Representation A

But if we store the denormalized mantissa into 8 bit register, then it won't have stored the last three $1$s and then the mantissa would have normalized from $(0.00100101)_2$ to $(1.00101\;000)_2$ by inserting 3 $0$s instead of $1$s.

The representation would have been $(0\;1001011\;00101000)_2 = (4B28)_{16}$ Representation B

So while normalizing, does the processor takes into account the denormalized mantissa bits beyond 8 bits too? Or just rounds it off? Which one is correct: A or B?

Does it store the mantissa in fixed point representation? How does it all work?

share|cite|improve this question
up vote 1 down vote accepted

The correct binary representation of $0.145$ is $0.00100101000111...$

Normalized: $1.00101000111...$

The 8 bit mantissa is $00101000 = 0\mbox{x}28$

share|cite|improve this answer
I made a mistake while calculating the binary representation. But how it would have worked if the binary number would be as I showed? – Shashwat Jan 9 '13 at 11:29
@Shashwat: 0x29 (remember that constants are usually converted to floating point representation at compile time or using routines like scanf() or parseFloat() so the processor is "unaware" of the representation of the number before the conversion ) – Vor Jan 9 '13 at 11:42
The answer to the new question is Representation A (compiler (or scanf) does the dirty work and converts your number to its closest floating point normalized representation rounding it if necessary) – Vor Jan 9 '13 at 11:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.