Question

Question 3: Represent the following numbers in the memory using 32-bit floating-point representation, then in Hexadecimal. 1.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

To convert the decimal into floating point, we have 3 elements in a 32-bit floating point representation:
i) Sign (MSB)
ii) Exponent (8 bits after MSB)
iii) Mantissa (Remaining 23 bits)

a) -1313.3125

Since -1313.3125 is a negative number therefore sign bit=1

Exponent is decided by the nearest smaller or equal to 2n number. Since 210 = 1024 which is the nearest smaller number to 1313.3125 , therefore n=10.127 is the unique number for 32 bit floating point representation. It is known as bias

Thus 127 + 10 =137 = 10001001 in binary representation.

Mantissa. Convert the decimal represenatation of number -1313.3125 to binary i.e -10100100001.0101 and move the decimal point so that there is only one number present at the left

-10100100001.0101 = -1.01001000010101 x 210

Now, consider the fractional part and represented as 23 bits by adding zeros.

therefore mantissa = 01001000010101000000000

Thus the floating point representation of -1313.3125 is 1 10001001 01001000010101000000000

**************************************************************************************

By hexadecimal method :

-1313.3125 = -521.5

Steps:

  • Divide the number by 16.
  • Get the integer quotient for the next iteration.
  • Get the remainder for the hex digit.
  • Repeat the steps until the quotient is equal to 0.
division by 16 Quotient Remainder(decimal) Remainder(hex)
1313/16 82 1 1
82/16 5 2 2
5/16 0 5 5

The fractional part of number is found by multiplying .3125 and 16 = .3125 x 16 = 5

Thus 0.312510 = 0.5000000000016

Therfore hexadecimal of whole number + fractional number = -521.5

------------------------------------------------------------------------------------------------------------------------------------

b) (0.00011011)2 = 0.10546875( Decimal value)

Since 0.10546875 is a positive number therefore sign bit=0

Exponent is decided by the nearest smaller or equal to 2n number. Since 20 = 1 which is the nearest smaller number to 0.10546875 , therefore n=0.127 is the unique number for 32 bit floating point representation. It is known as bias

Thus 127 + 0 =127 = 1111111 in binary representation.

Mantissa.(0.00011011)2 is binary , move the decimal point so that there is only one number present at the left. Since already there is only one number in the left, so no changes

0.00011011 = 0.00011011

Now, consider the fractional part and represented as 23 bits by adding zeros.

therefore mantissa = 00011011000000000000000

Thus the floating-point representation of -1313.3125 is 0 1111111 00011011000000000000000

**************************************************************************************

By hexadecimal method :

(0.00011011)2 =  0.1B

Steps:

  • Take 4 binary digits and convert them using binary to hexadecimal
  • 0001 = 1 in hexadecimal
  • 1011 = B in hexadecimal
Add a comment
Know the answer?
Add Answer to:
Question 3: Represent the following numbers in the memory using 32-bit floating-point representation, then in Hexadecimal....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT