Zero representation in dummy floating point number system? - Page 1
Forum section: electronics / beginners

author: shivajikobardan
author_rank: Contributor
timestamp: August 20, 2025, 07:30:04 am
content: Here is a context. I am studying John P. Hayes textbook on Computer Organization and Architecture.Hayes claims:> In a floating point number system represented by M x 2^E where M and E are both 3-bit, sign-magnitude integers, zero is represented by binary words of the form (M,E)=(x00,xxx) where x denotes either 0 or 1.I was going through this for the second time(I studied this earlier and now revising).While I get for mantissa as x00 means 100 or 000 which is +0 and -0. I think that the exponent could have been anything. Isn't it? Why specifically hayes picked 111 and 000 for the exponent? i.e. -3 and 0. Some might say -3 is the smallest exponent that's why. But why is zero included then?I hope I am not making a fool out of myself.

author: macboy
author_rank: Super Contributor
timestamp: August 20, 2025, 07:42:27 am
content: 2's complement is usually used for signed numbers, so all zeros (000 here) is zero and all ones (111) is one smaller than zero, i.e. -1.Knowing that, does it makes more sense now?

author: gf
author_rank: Super Contributor
timestamp: August 20, 2025, 07:49:53 am
content: The way you represent floating-point numbers is more a matter of definition.One common representation is defined by the IEEE 754 standard.Of course, the answer to whether it could have been defined differently is yes; there were many other possibilities.

author: shivajikobardan
author_rank: Contributor
timestamp: August 20, 2025, 07:55:33 am
content: Number in decimal, 2's complement counterpart-3,101-2,110-1,1110,000-0,0001,0012,0103,011So for zero to occur M should be 000; M=000And E can be anything. Isn't it? Because anything multiplied by 000 is going to be zero.

author: brucehoult
author_rank: Super Contributor
timestamp: August 20, 2025, 08:10:51 am
content: Quote from: shivajikobardan on August 20, 2025, 07:30:04 amYou can choose to represent numbers -- and therefore interpret bit-patterns -- in any way that you want, if you are building your own hardware or writing your own software. With only 6 bits and therefore 64 different values you could simply keep a list 00000 = something, 000001 = something else, ... 111111 = whatever. But the author has choose to make the six bits mean MMMEEE where each of MMM and EEE is defined as ...Code:000 = 0001 = 1010 = 2011 = 3100 = -0101 = -1110 = -2111 = -3... and the whole number isM x 2^E.It should be noted that this does not follow the usual pattern used by floating point numbers of various sizes since IEEE 754 in 1985, but no one stops you doing whatever you want in the privacy of your own computer.QuoteWhy? No reason. Hayes can do whatever he wants.But you are confused: "zero is represented by binary words of the form (M,E)=(x00,xxx)"Here is it the mantissa that is "x00, and the exponent "xxx" can indeed be anything."Why specifically hayes picked 111 and 000 for the exponent? i.e. -3 and 0." -- no, "xxx" means the exponent can be any of the 8 values of three bits.

author: golden_labels
author_rank: Super Contributor
timestamp: August 20, 2025, 08:50:13 am
content: I believe the confusion comes from the assumption, that ‘x’ indicates the same digit in all positions. Instead, it’s just a wildcard indicator.That mistake may be used to introduce a relevant tangent. In IEEE-754 and similar floats, the exponent value is relevant. +0 and -0 are subnormal numbers, which differ in representation from normal IEEE-754 floats and are indicated by all bits in exponent being unset. For all other exponent values the mantissa has an implicit 1 added in the beginning, making representing 0 impossible.

author: shivajikobardan
author_rank: Contributor
timestamp: August 20, 2025, 09:02:52 am
content: If x is wildcard then it does makes sense.