The Student Room Group

Help: Floating Point Exam Question

I got part b of this question wrong in my test. I didn't know how to work it out so I guessed. Can anyone explain how to get the right answer? image-22f571ba-8cfc-40ce-947e-f6dc46df00f56233193922146883965-compressed.jpg.jpeg
I feel like it's meant to be 00000001 in the mantissa and 1000 in the exponent. I don't have a method tbh. I just tried to get the most negative exponent and the smallest number in the mantissa. Am I on the right track?
(edited 5 years ago)
The exponent in floating-point arithmetic doesn't use two's complement, instead, the exponent is already negative-biased. Therefore unlike two's complement, the smallest possible negative exponent is represented by all-zeroes in binary.

So the smallest possible value that can be stored using a 4-bit exponent would be represented by decimal -7 which is binary 0000

There's not really any method to answering that question though - it's just a matter of whether or not you understand that the exponent is negative-biased.

However, you're right that the mantissa would be binary 00000001 which is a decimal value of 2^(-8).

(and together, those would give you a decimal value of 2^(-8) * 2^(-7) which of course is equal to 2^(-15).)
Original post by winterscoming
The exponent in floating-point arithmetic doesn't use two's complement, instead, the exponent is already negative-biased. Therefore unlike two's complement, the smallest possible negative exponent is represented by all-zeroes in binary.

So the smallest possible value that can be stored using a 4-bit exponent would be represented by decimal -7 which is binary 0000

There's not really any method to answering that question though - it's just a matter of whether or not you understand that the exponent is negative-biased.

However, you're right that the mantissa would be binary 00000001 which is a decimal value of 2^(-8).

(and together, those would give you a decimal value of 2^(-8) * 2^(-7) which of course is equal to 2^(-15).)


Can you explain how 0000 is - 7 please?
Original post by niclawrence01
Can you explain how 0000 is - 7 please?

It's negative-biased, and based on the smallest possible number which can be represented with a signed 4-bit exponent which is -7

I.e. instead of using binary to count from zero upwards, binary is used to count from -7 upwards.

So:
0000 is -7.
0001 is -6
0010 is -5
0011 is -4
etc.
(edited 5 years ago)
OK thanks for the help

Quick Reply

Latest

Trending

Trending