2
$\begingroup$

Many text books state that for a binary floating point representation in a computer byte, that if the mantissa is normalised, then a positive number must start with 01 from the left or a negative number with 10 from the left.This is nothing to do with IEEE standard but a common statement in English A level computing books. (A levels are the school leaving exams in most of the UK, and some other countries.)

They then ask you to spot normalised representations:

1) 100000000

2) 011111111

3) 110000000

In the rule above 1 and 2 would be normalised but not 3.  

Why does it have to be 10 and 01? How is this rule derived?

$\endgroup$
4
  • $\begingroup$ This is not IEEE standard but high school text books by Tony Piper and used many exam boards.I know it does not apply to IEEE as they use a bias of 127.I should have mentioned this and will now edit. $\endgroup$
    – pythonMan
    Commented Sep 19, 2015 at 23:21
  • $\begingroup$ Then those are non-standard definitions, and in the current state your question is not answerable without buying the book. $\endgroup$
    – orlp
    Commented Sep 19, 2015 at 23:36
  • $\begingroup$ It looks like a two's complement mantissa format with a non hidden leading 1. Normalised positives are between 01000000 and 01111111, normalised negatives are between 10111111 and 10000000. $\endgroup$
    – Grabul
    Commented Sep 20, 2015 at 1:49
  • $\begingroup$ I think TEMLIB 7 has spotted the question , can you explain how these limits are derived please? $\endgroup$
    – pythonMan
    Commented Sep 20, 2015 at 9:50

3 Answers 3

3
$\begingroup$

I'm assuming you're talking about IEEE754. Unless I'm missing something, your book is wrong.

Every number in IEEE754 is represented as normalized (starting with a 1), unless your number is subnormal. A number is only subnormal if the mantissa is minimal (all zeroes). Since the first bit is the sign bit, $10$ could be the start of a subnormal number.

For example $10000000000000000000000000000001$ is the subnormal number $-2^{-149}$.

$\endgroup$
1
  • $\begingroup$ "Binary FP in a byte". There is no single byte encoding for IEEE754. I don't understand either. $\endgroup$
    – Grabul
    Commented Sep 19, 2015 at 22:33
3
$\begingroup$

In answer to the OP, and looking around Tony Piper I found this page:

http://www.teach-ict.com/as_as_computing/ocr/H447/F453/3_3_4/floating_point/miniweb/pg10.htm

Essentially, a non-normalised 8 bit floating point is represented like:

Sign  Integer  Fraction  Exponent
 0     111       .0       010

The largest number this can represent is 111.1 with a 111 exponent which is 7.5 x 2^7, but fractionally you can only represent 0.5 any other fraction is not possible because you have only provided 1 bit in this scheme.

A Normalised floating point is represented as:

Sign  Integer  Fraction  Exponent
 0      1       .110        010

3 fractional bits instead of 1. The integer part can only be a 1 or a zero. The largest number that can be represented is 1.111 x 2^7 which is not that much less than the 7.5 x 2^7 above. And yet we can now represent 0.001 binary which is 1/8.

$\endgroup$
3
$\begingroup$

Historically, floating point binary formats have varied from machine to machine. For example, some put the exponent on the left and the mantissa on the right, and some use sign and magnitude instead of twos complement. It wasn’t until 1985 that the Institute of Electrical and Electronics Engineers agreed on the standard format used in most of today’s computers, the IEEE 754 standard. This website goes into some detail...

http://www.quadibloc.com/comp/cp0201.htm

The format you’re expected to know about if you sit an A level computer science exam in the United Kingdom illustrates the fundamental principles of floating point binary. You will be told how big the register is, how many bits have been allocated to the mantissa, and how many bits have been allocated to the exponent; both are usually in two’s complement. For example, you might be given an 16 bit register, with a 10 bit mantissa and a 6 bit exponent, both in two’s complement. Chances are, there is no such processor, but who’s to say that one day somebody might not design one like that, for a very specific purpose.

The objectives of normalisation are to maximise the precision of floating point numbers, and to achieve an unambiguous representation. This in turn simplifies processing when performing arithmetic with floating point numbers.

To achieve the most accurate representation of a positive number, for a given size mantissa, there should be no leading 0s to the left of the most significant bit.

0.000001001 000000 When normalised becomes 0.100100000 111011

All normalised positive numbers therefore start with 01

To achieve the most accurate representation of a negative number, for a given size mantissa, there should be no leading 1s to the left of the most significant bit.

1111100100 000011 When normalised becomes 1001000000 111111

All normalised negative numbers therefore start with 10

You should try converting both normalised and un-normalised forms of the same number back into base 10. You will get the same result.

Take a look at this

https://www.youtube.com/watch?v=5OuRbAsME1w

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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