Floating-Point Representation

In summary, there are different interpretations of the given information, so it is difficult to give a precise answer. However, based on the information given, the smallest and largest numbers that can be represented in this 8-bit floating point representation are 0 and 1.9375, respectively. This is assuming that the exponent is biased by 3 and that the mantissa is normalized with a leading 1.f
  • #1
260
21
Homework Statement:: We have an 8-bit floating point representation, one bit for the sign, 3-bit biased exponent, and 4-bit for the normalized mantissa. What is the smallest and largest number you can represent?
Relevant Equations:: -

Would the smallest number just be
00000000
and then I would just convert this into decimal?

And then would the largest number just be
01111111
and then I would also just convert this into decimal?

Or am I on the wrong track?

Thanks.
 
  • #2
Hmm. Is 1 "smaller" than -1? Does the question as worded seem to require the exclusion of negative numbers?
 
  • #3
Oops, this one DOES belong in computing!
 
  • #4
For the answer not to be trivial I would assume that it is asking for the number with the smallest non-zero magnitude.
 
  • #6
am I on the wrong track?
Yes, you are. You need to think about what "largest" and "smallest" (assuming that this really means absolute value, i.e., ignoring the sign bit) translate to in terms of mantissa and exponent.
 
  • #7
Yes, you are. You need to think about what "largest" and "smallest" (assuming that this really means absolute value, i.e., ignoring the sign bit) translate to in terms of mantissa and exponent.
To the OP, you also need to consider the fact that the exponent is biased. Post #1 doesn't state what the bias is, but since there are only 3 bits used, I'm assuming that the possible exponent values are in the range of -4 through +3. IOW, to get the three-bit exponent field, you need to add 4 to the actual exponent.

Based on my assumption, here are the calculations for the representation of 4.5:
##4.5 = 100.1_2 = 1.001_2 \times 2^2## (normalized form, similar to scientific notation, but in binary)
Actual exponent = 2
Biased exponent = Actual exponent + 4 = 6 = ##110_2##
Sign = 0 (positive number)
Exponent field = 110
Mantissa = 1001

Representation for 4.5: 0 110 1001 (spaces included only to separate sign bit field, exponent field, and mantissa)

As a side note, the 32-bit and 64-bit floating point representations (as mandated by IEE 754) have an "invisible bit" of 1 that results from assuming that the normalized form always looks like ##1.xxx\dots_2##, so including a bit for the leading 1 digit isn't necessary. Since this optimization wasn't mentioned in the problem statement, I haven't included it in my calculation above.
 
  • #8
As a side note, the 32-bit and 64-bit floating point representations (as mandated by IEE 754) have an "invisible bit" of 1 that results from assuming that the normalized form always looks like ##1.xxx\dots_2##, so including a bit for the leading 1 digit isn't necessary. Since this optimization wasn't mentioned in the problem statement, I haven't included it in my calculation above.
The problem statement did say that the mantissa is normalized, and I would assume that means insertion of a leading 1. However the problem statement does not say what happens when the exponent is the minimum (i.e. most negative) i.e. whether subnormals exist.

In other words @ver_mathstats there is not enough information here to properly answer the question, however the Wikipedia article https://en.wikipedia.org/wiki/IEEE_754 covers all of this quite well.
 
  • #9
The problem statement did say that the mantissa is normalized, and I would assume that means insertion of a leading 1.
I interpreted "normalized" to mean that numbers would be in the form +/- ##1.xxx_2 \times 2^N##, where N is the biased 3-bit exponent. I didn't take this to mean that the leftmost 1 was implied, as is the case in the IEEE 754 standard.
 
  • #10
Yes, that is another possible interpretation.
 

Suggested for: Floating-Point Representation

Replies
21
Views
1K
Replies
2
Views
428
Replies
2
Views
395
Replies
3
Views
598
Replies
1
Views
115
Replies
1
Views
785
Replies
2
Views
1K
Replies
5
Views
666
Replies
7
Views
814
Back
Top