# What Are the Smallest and Largest Numbers in an 8-bit Floating Point System?

• ver_mathstats
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.
ver_mathstats
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
 0 0 0 0 0 0 0 0
and then I would just convert this into decimal?

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

Or am I on the wrong track?

Thanks.

Hmm. Is 1 "smaller" than -1? Does the question as worded seem to require the exclusion of negative numbers?

Oops, this one DOES belong in computing!

berkeman
For the answer not to be trivial I would assume that it is asking for the number with the smallest non-zero magnitude.

ver_mathstats said:
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.

PeterDonis said:
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.

berkeman
Mark44 said:
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.

pbuk said:
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.

pbuk
Yes, that is another possible interpretation.

## 1. What is floating-point representation?

Floating-point representation is a method of representing real numbers in a computer system. It uses a fixed number of bits to store the number, with some bits used to represent the value and others used to represent the position of the decimal point.

## 2. How is floating-point representation different from integer representation?

Floating-point representation allows for the representation of numbers with decimal points, while integer representation only allows for whole numbers. Additionally, floating-point numbers have a limited precision and can only represent a certain range of numbers, while integers can represent a larger range of values.

## 3. What is the purpose of using floating-point representation?

Floating-point representation allows for more efficient storage and calculation of real numbers in a computer system. It also allows for a wider range of numbers to be represented compared to using integers.

## 4. What are some potential issues with floating-point representation?

One potential issue is that floating-point numbers are not always represented exactly, which can lead to rounding errors and inaccuracies in calculations. Another issue is that the precision of floating-point numbers is limited, which can cause problems when dealing with very large or very small numbers.

## 5. How can floating-point representation be optimized for better performance?

Floating-point representation can be optimized by using a larger number of bits to represent the number, which increases the precision and range of numbers that can be represented. Additionally, using specialized hardware or software algorithms can improve the speed and accuracy of floating-point calculations.

• Engineering and Comp Sci Homework Help
Replies
17
Views
635
• Computing and Technology
Replies
4
Views
1K
• Engineering and Comp Sci Homework Help
Replies
2
Views
2K
• Computing and Technology
Replies
4
Views
1K
• Engineering and Comp Sci Homework Help
Replies
10
Views
3K
• Engineering and Comp Sci Homework Help
Replies
8
Views
1K
• Engineering and Comp Sci Homework Help
Replies
3
Views
2K
• Engineering and Comp Sci Homework Help
Replies
2
Views
2K
• Engineering and Comp Sci Homework Help
Replies
5
Views
5K
• Engineering and Comp Sci Homework Help
Replies
6
Views
3K