• Best of luck to the class of 2024 for their HSC exams. You got this!
    Let us know your thoughts on the HSC exams here
  • YOU can help the next generation of students in the community!
    Share your trial papers and notes on our Notes & Resources page
MedVision ad

ieee 754 (1 Viewer)

crammy90

Member
Joined
Mar 26, 2006
Messages
264
Gender
Male
HSC
2008
so as the exponent could be neg or pos
i.e. (-1 for 1x10^-1 i.e. 0.1) or (1 for 1x10^1 i.e. 10) there has to be away to when way to move the decimal point along the real number (i.e. if it is a large number or a small number)
I get this is because we represent numbers in scientific notation and what not.
QUESTION:
"The standard specifies that the exponent is represented as the actual value plus 127. As we have 8 bits for the exponent we can represent integer values from 0 to 255. Subtracting 127 gives us a better range from -127 to 128".
(from same davis)
i dont understand why we are subtracting 127 from 255 to get 128.
MY THOUGHT: i dont see why if we do this we cant represent range 0-127 (1 from 128 as 1 have to be 0) and -1 to -128 (like the range for all other numbers i.e. 2's comp).

So just say we had to represent -128 exponent (according to my though) we would add the 127 to get -1 which is still negative. Is this why its from -127 - 128 rather than -128 to 127?
Also if we have to represent 127 exponent, thats 127 + 127 = 254. Is this why the range is max positive of 128 so 128 + 127 = 255 = the max number for 8-bit?

so yeh
just wondering
a) why its that range of -127 - 128 instead of -128 - 127 like usual
b) why it is we subtract the 127 to get the range and then add it on again when we are encoding the exponent into ieee 754 form.
c) for the exponent to be negative when we are putting it into ieee 754 is it in 2's complement and then we have to put it back into normal form and then add the 127 or do we add the 127 to the 2's compliment
thanks to any1 that can help i really need this!!!
 

zvyx

Member
Joined
Aug 10, 2006
Messages
95
Location
NSW
Gender
Male
HSC
2008
good day again crammy :)

IEEE 754-1985 32-bit floating point has two points to consider in regards to the exponent section (8 bits).

1) It's in excess form, not 2's complement, or sign and modulus; it's a different representation altogether. The funny thing though is that the end results are so similar to sign and modulus that you have to wonder why they had to make yet another way to represent binary numbers (lol).
You've answered how excess form works yourself;
As we have 8 bits for the exponent we can represent integer values from 0 to 255. Subtracting 127 gives us a better range from -127 to 128
I don't know why they choose subtracting 127 instead of 128. lol :p

2) The range is not -127 to 128. There are two reasons why:
i) 0000 0000 is a special value, whereby a combination of all bits = 0 means the value of the whole number is 0. makes sense.
ii) 1111 1111 is also a special value, indicating an error, or infinity, or not a number.
So out of 256 values for an 8-bit code, 2 are special. That leaves 254 values, of which one of them is 0. So the range is actually 127 to -126.

that should answer a and c..

b) why it is we subtract the 127 to get the range and then add it on again when we are encoding the exponent into ieee 754 form.
When you're trying to represent a decimal number into this floating point standard, you increase it by 127, and enter in the binary version of that.

If you're trying to find out what the exponent is in decimal, given the floating point binary code, then obviously you need to decrease it by 127 to find out the decimal exponent.
 

crammy90

Member
Joined
Mar 26, 2006
Messages
264
Gender
Male
HSC
2008
zvyx said:
good day again crammy :)

IEEE 754-1985 32-bit floating point has two points to consider in regards to the exponent section (8 bits).

1) It's in excess form, not 2's complement, or sign and modulus; it's a different representation altogether. The funny thing though is that the end results are so similar to sign and modulus that you have to wonder why they had to make yet another way to represent binary numbers (lol).
You've answered how excess form works yourself;

I don't know why they choose subtracting 127 instead of 128. lol :p

2) The range is not -127 to 128. There are two reasons why:
i) 0000 0000 is a special value, whereby a combination of all bits = 0 means the value of the whole number is 0. makes sense.
ii) 1111 1111 is also a special value, indicating an error, or infinity, or not a number.
So out of 256 values for an 8-bit code, 2 are special. That leaves 254 values, of which one of them is 0. So the range is actually 127 to -126.

that should answer a and c..


When you're trying to represent a decimal number into this floating point standard, you increase it by 127, and enter in the binary version of that.

If you're trying to find out what the exponent is in decimal, given the floating point binary code, then obviously you need to decrease it by 127 to find out the decimal exponent.
hello :p
thankyou heaps for all u effort it is really helpful :):):)
ps whats excess form?
0000 0000 is a special value
so this means the the actual entire number is 0 yeh? so then there shouldnt be numbers in the mantissa ?
and then what would be the value for 0?
So the range is actually 127 to -126.
so 256 - 2 special characters = 254.
254/2 = 127 numbers for positive and 127 for negative.
One of the positives is reserved for 0 yeh?
so then theres 126 positives and 127 negatives?
so range is -127 to 126?
i know im wrong cuz u know what ur talking about aha but just showing you how i am interpreting it so u can tell me where im going wrong :)
 
Last edited:

zvyx

Member
Joined
Aug 10, 2006
Messages
95
Location
NSW
Gender
Male
HSC
2008
excess form was what you stated in the opening post :p
the exponent is represented as the actual value plus 127. As we have 8 bits for the exponent we can represent integer values from 0 to 255. Subtracting 127 gives us a better range from -127 to 128
I can't think of any better explanation for excess form.. lol. That's pretty much it.

0000 0000 is just a special value. on its own it doesn't do anything, but if the sign bit and the mantissa are also 0 then everything is 0.

the value for 0 is 127 in binary (0111 1111), since 127 - 127 = 0

no, actually you could be right. 127 for negative numbers, 127 for non-negative numbers, and since 0 is a non-negative number, a range from -127 to 126 is in effect. that sounds logical :)
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top