Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

If the floating-point representation on a certain system has a sign bit, a 3-bit

ID: 3530951 • Letter: I

Question

If the floating-point representation on a certain system has a sign bit, a 3-bit exponent and a 4-bit significand: a) what is the largest positive and the smallest positive number that can be stored on the system if the storage is normalized? (assume no bits are implied, there is no biasing, exponents us 2s complement notation, and exponents of all zeros and all ones are allowed). b) What bias should be used in the exponent if we prefer all exponents to be non-negative? Why would you chose this bias? PS. I've looked this question up and the following is considered as an answer: Largest Positive: 0.1111(binary) x 2^3 = 111.1(binary) = 7.5 Smallest Positive: 0.1(binary) x 2^-4 = .00001(binary) = 1/32 = 0.03125 But why would 3 be the highest exponent that you can use, shouldn't the highest exponent be 7 and not 3? As well as -7 for finding smallest positive? The sign bit is separate from the 3 exponent bits. If you can please find the smallest negative number as well.

Explanation / Answer

The reason that 0 011 1111 is the largest positive is because they tell you that exponent bits use 2's complement notation. If the exponent bits was 111, that is actually -4+2+1 = -1 and not 7. All 1's in the exponent bits is a special case anyways, a case of infinities and NaN. So in fact the largest is 011 in the exponent bits.

Same thing applies with the smallest positive(normalized). Since the exponent bits follow 2's compliment the largest negative number you can get is 100, which equals -4. If you tack on anything after the initial 1, you're actually adding to it and lowering the negative exponent bit. So the smallest positive(normalized) is 0 100 0000

for b) the bias would be 4.

The smallest negative would be the largest positive with a sign bit 1. so 1 011 111 is your floating-point representation of the smallest negative.