Question

1. Compute the decimal value for the following bit pattern, assuming it is a single-precision floating...

1. Compute the decimal value for the following bit pattern, assuming it is a single-precision floating point number (show major steps):
1100 0011 0001 0010 0100 1001 0010 0100

2. Convert the decimal -2118.75 into single-precision floating point number (show major steps).

3. Assume -75 and -122 are signed decimal integers stored in 8-bit
sign-magnitude binary format. Calculate -75 + -122. Is there overflow, underflow,
or neither?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer 1: Convert 1100 0011 0001 0010 0100 1001 0010 0100 to Decimal
============================


Enter the 32 bit IEEE single precision number:
11000011000100100100100100100100


IEEE 32 bit format is of the form <sign bit> <8 bit biased exponent> <23 bit fraction>
Sign bit: 1, so the number is -ve

Exponent in binary = 10000110 = 134 in decimal
Decode the exponent by subtracting 127 = 134 - 127 = 7

Significand = 00100100100100100100100
Add the implicit 24th bit to significand, so 24 bit significand = 100100100100100100100100

The 24 bits from bit 23 to bit 0 represent a value, starting at 1 and halves for each bit
Add up the corresponding values for 1 bits
bit 23 = 1.0
bit 20 = 0.125
bit 17 = 0.015625
bit 14 = 0.001953125
bit 11 = 2.44140625E-4
bit 8 = 3.0517578125E-5
bit 5 = 3.814697265625E-6
bit 2 = 4.76837158203125E-7
Decoded significand = 1.0 + 0.125 + 0.015625 + 0.001953125 + 2.44140625E-4 + 3.0517578125E-5 + 3.814697265625E-6 + 4.76837158203125E-7 = 1.1428570747375488
Multiply this with base 2 to power of exponent i.e 2^7
= 1.1428570747375488 x 2^7 = 146.28570556640625
The decimal number along with sign is -146.28570556640625


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

Answer 2: Convert -2118.75 to IEEE format
================
Enter a decimal number:
-2118.75
The given number -2118.75 has Integral part = 2118, Fractional part = 0.75
Step 1:
----------------------------------
Convert integral part using repeated division by 2, accumulating remainders
Divide 2118 by 2, now n = 1059, remainder = 0
Divide 1059 by 2, now n = 529, remainder = 1
Divide 529 by 2, now n = 264, remainder = 1
Divide 264 by 2, now n = 132, remainder = 0
Divide 132 by 2, now n = 66, remainder = 0
Divide 66 by 2, now n = 33, remainder = 0
Divide 33 by 2, now n = 16, remainder = 1
Divide 16 by 2, now n = 8, remainder = 0
Divide 8 by 2, now n = 4, remainder = 0
Divide 4 by 2, now n = 2, remainder = 0
Divide 2 by 2, now n = 1, remainder = 0
Divide 1 by 2, now n = 0, remainder = 1
The binary equivalent of 2118 is 100001000110
----------------------------------


Step 2:
----------------------------------
Convert fractional part using repeated multiplication by 2, accumulating integral parts (until fraction part becomes zero or upto 23 accumulated digits)
Multiply 0.5 * 2 = 1.5, accumulate 1, next use fraction 0.5
Multiply 0.0 * 2 = 1.0, accumulate 1, next use fraction 0.0
The fractional part 0.75 in binary is .11
----------------------------------


The decimal number -2118.75 is equivalent to binary 100001000110.11


Step 3:
----------------------------------
Normalize the binary number by writing in the form 1.XXXXX * 2^exponent
Shift decimal point to left by 11 digits
Normalized form is 1.0000100011011 x 2^11
From the normalized form, we find that exponent = 11 and fraction = 0000100011011
Exponent is 11. Add 127 to exponent to get the biased form i.e 11 + 127 = 138


IEEE 32 bit format is of the form <sign bit> <8 bit biased exponent> <23 bit fraction>
The number is -ve, so sign bit = 1
The biased exponent 138 in 8 bit binary is 10001010
The fraction in 23 bit binary is 00001000110110000000000

The IEEE 32-bit single precision format is 1-10001010-00001000110110000000000

Add a comment
Know the answer?
Add Answer to:
1. Compute the decimal value for the following bit pattern, assuming it is a single-precision floating...
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