2.
A. 69.625
First i am converting decimal to 32 bit single precision IEEE binary floating point.
in 32 bits: 1st bit for sign,next 8 bits for exponent,next 23 bits for mantissa
First converting 69 to binary:
we divide number by 2 and write quotient,remainder a side.
then repeat the process by dividing quotient by 2 and write quotient,remainder a side.
repeat process until quotient is 0.
69 ÷ 2 = 34 (quotient), remainder 1;
34 ÷ 2 = 17 (quotient), remainder 0;
17 ÷ 2 = 8 (quotient), remainder 1;
8 ÷ 2 = 4 (quotient), remainder 0;
4 ÷ 2 = 2 (quotient), remainder 0;
2 ÷ 2 = 1 (quotient), remainder 0;
1 ÷ 2 = 0 (quotient), remainder 1;
quotient is 0. so take the remainders in reverse order (100 0101)2.
Next convert fractional decimal into binary:
0.625:
Process : multiply fractional part with 2 continuously , write the integer part a side. Next repeat this process with new fractional part until the fractional part becomes 0.
0.625 × 2 = 1 (integer part), new fractional part 0.25;
0.25 × 2 = 0 (integer part), new fractional part 0.5;
0.5 × 2 = 1 (integer part), new fractional part 0;
take the integer parts from top to bottom (101)2
total number 69.625 = 100 0101.1012
Normalizing binary number:
shift the decimal point to left so that only one non zero digit will be left before decimal point:
Normalized the binary number = 1.000101101 X 26
up to this we have
sign bit : 0 positive number
exponent : 6 (unadjusted)
mantissa : 1.000101101
But as specified, exponent is of 8 - bits, so we need to adjust the exponent so that it will have 8 bits
We have a formula : Exponent adjusted = Exponent unadjusted + 2(8-1) (8 is the no of bits in exponent) - 1
= 6 + 127 -1
= 13310
now convert 133 to binary number :
33 ÷ 2 = 66 (quotient), remainder 1;
66 ÷ 2 = 33 (quotient), remainder 0;
33 ÷ 2 = 16 (quotient), remainder 1;
16 ÷ 2 = 8 (quotient), remainder 0;
8 ÷ 2 = 4 (quotient), remainder 0;
4 ÷ 2 = 2 (quotient), remainder 0;
2 ÷ 2 = 1 (quotient), remainder 0;
1 ÷ 2 = 0 (quotient), remainder 1;
writing in reverse order 133 = 1000 01012
Now Normalizing the mantissa, Remove the 1 to left of decimal and adjust the binary number so that it contains 23 bits
Normalized mantissa : 000101101000000000000002
Overall binary representation is:
69.62510 = 0 10000101 000101101000000000000002 (1st bit is sign bit, next 8 are exponent, next 23 are mantissa)
sign bit 0 means it is positive number
1 means it is negative number
binary | Hexa decimal |
0000 | 0 |
0001 | 1 |
0010 | 2 |
0011 | 3 |
0100 | 4 |
0101 | 5 |
0110 | 6 |
0111 | 7 |
1000 | 8 |
1001 | 9 |
1010 | A |
1011 | B |
1100 | C |
1101 | D |
1110 | E |
1111 | F |
Converting it into HEXA DECIMAL: ox428B4000 FROM TABLE
b.-123.7510
First i am converting decimal to 32 bit single precision IEEE binary floating point.
in 32 bits: 1st bit for sign,next 8 bits for exponent,next 23 bits for mantissa
First converting |-123| (take mod) to binary:
we divide number by 2 and write quotient,remainder a side.
then repeat the process by dividing quotient by 2 and write quotient,remainder a side.
123 ÷ 2 = 61 (quotient), remainder 1;
61 ÷ 2 = 30 (quotient), remainder 1;
30 ÷ 2 = 15 (quotient), remainder 0;
15 ÷ 2 = 7 (quotient), remainder 1;
7 ÷ 2 = 3 (quotient), remainder 1;
3 ÷ 2 = 1 (quotient), remainder 1;
1 ÷ 2 = 0 (quotient), remainder 1;
123 = 111 10112
Next convert fractional decimal into binary:
0.75:
Process : multiply fractional part with 2 continuously , write the integer part a side. Next repeat this process with new fractional part until the fractional part becomes 0.
0.75 × 2 = 1 (integer part), new fractional part 0.5
0.5 × 2 = 1 (integer part), new fractional part 0
0.7510 = 112
total number 123.7510 = 111 1011.112
Normalizing the binary number:
shift the decimal point to left so that only one non zero digit will be left before decimal point:
Normalized binary number = 1.11 101111 X 26
up to this we have
sign bit : 1 so it is negative number
exponent : 6 (unadjusted)
mantissa : 1.11 101111
But as specified exponent is of 8 - bits, we need to adjust the exponent so that it will have 8 bits
We have a formula : Exponent adjusted = Exponent unadjusted + 2(8-1) (8 is the no of bits in exponent) - 1
= 6 + 127 -1
= 13310
now convert 133 to binary number :
33 ÷ 2 = 66 (quotient), remainder 1;
66 ÷ 2 = 33 (quotient), remainder 0;
33 ÷ 2 = 16 (quotient), remainder 1;
16 ÷ 2 = 8 (quotient), remainder 0;
8 ÷ 2 = 4 (quotient), remainder 0;
4 ÷ 2 = 2 (quotient), remainder 0;
2 ÷ 2 = 1 (quotient), remainder 0;
1 ÷ 2 = 0 (quotient), remainder 1;
writing in reverse order 13310 = 1000 01012
Now Normalizing the mantissa, Remove the 1 to left of decimal and adjust the binary number so that it contains 23 bits.
Normalized mantissa : 11 1011110000000000000002
Overall binary representation is:
-123.7510 = 1 10000101 111011110000000000000002 (1st bit is sign bit, next 8 are exponent, next 23 are mantissa)
sign bit 0 means it is positive number
1 means it is negative number
Converting it into HEXA DECIMAL: oxC2F78000 (for every 4 bits)
3.
a. 0xc1be0000
Converting it to binary from table :
1 10000011 011111000000000000000002
1 - sign bit (so negative number)
10000011 -exponent
01111100000000000000000 - mantissa
Converting the binary to decimal for exponent:
multiply the bits from left side with their 2position number (position number starts from 0), add the all numbers
100000112 : 1 × 27 + 0 × 26 + 0 × 25 + 0 × 24 + 0 × 23 + 0 × 22 + 1 × 21 + 1 × 20 = 128 + 0 + 0 + 0 + 0 + 0 + 2 + 1=13110
As in the previous example we have adjusted the exponent, here also same thing ,
we need to subtract 131 from (2(8-1) (8 is the no of bits in exponent) - 1) (reverse process to the 2nd problems)
131-127 = 4 (adjusted exponent)
Convert mantissa to decimal :
011111000000000000000002 = 0 × 2-1 + 1 × 2-2 + 1 × 2-3 + 1 × 2-4 + 1 × 2-5 + 1 × 2-6 + 0 × 2-7 + 0 × 2-8 + 0 × 2-9 + 0 × 2-10 + 0 × 2-11 + 0 × 2-12 + 0 × 2-13 + 0 × 2-14 + 0 × 2-15 + 0 × 2-16 + 0 × 2-17 + 0 × 2-18 + 0 × 2-19 + 0 × 2-20 + 0 × 2-21 + 0 × 2-22 + 0 × 2-23 =
0 + 0.25 + 0.125 + 0.062 5 + 0.031 25 + 0.015 625 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 =
= 0.484 375(10)
Formula for converting binary to decimal : (-1)Sign bit × (1 + mantissa) × 2(adjusted Exponent )
= (-1)1 × (1 + 0.484 375) × 24 = - 23.7510
final answer is 0xc1be0000 = - 23.7510
b. 0x42c68000
Converting it to binary :
0 10000101 10001101000000000000000
0 - sign bit (so positive number)
10000101 -exponent
10001101000000000000000 - mantissa
Converting the binary to decimal for exponent:
multiply the bits from left side with their 2position number (position number starts from 0), add the all numbers
100001012 : 1 × 27 + 0 × 26 + 0 × 25 + 0 × 24 + 0 × 23 + 1 × 22 + 0 × 21 + 1 × 20 = 13310
As in the previous example (2nd problem) we have adjusted the exponent, here also same thing ,
we need to subtract 133 from (2(8-1) (8 is the no of bits in exponent) - 1) (reverse process to the 2nd problems)
133-127 = 6 (adjusted exponent)
Convert mantissa to decimal :
1 × 2-1 + 0 × 2-2 + 0 × 2-3 + 0 × 2-4 + 1 × 2-5 + 1 × 2-6 + 0 × 2-7 + 1 × 2-8 + 0 × 2-9 + 0 × 2-10 + 0 × 2-11 + 0 × 2-12 + 0 × 2-13 + 0 × 2-14 + 0 × 2-15 + 0 × 2-16 + 0 × 2-17 + 0 × 2-18 + 0 × 2-19 + 0 × 2-20 + 0 × 2-21 + 0 × 2-22 + 0 × 2-23
= 0.5 + 0 + 0 + 0 + 0.031 25 + 0.015 625 + 0 + 0.003 906 25 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0
100011010000000000000002 =0.550 781 2510
Formula for converting binary to decimal : (-1)Sign bit × (1 + mantissa) × 2(adjusted Exponent )
(-1)0 × (1 + 0.550 781 25) × 26
=1.550 781 25 × 26
=99.2510
final answer is 99.2510
2. Convert the following real numbers into single precision IEEE floating point format. Give the final...
(2 pts) Express the base 10 numbers 16.75 in IEEE 754 single-precision floating point format. Express your answer in hexadecimal. Hint: IEEE 754 single-precision floating-point format consists of one sign bit 8 biased exponent bits, and 23 fraction bits) Note:You should show all the steps to receive full credits) 6.7510 Type here to search
If we use the IEEE standard floating-point single-precision representation (1 sign bit, 8 bit exponent bits using excess-127 representation, 23 significand bits with implied bit), then which of the following hexadecimal number is equal to the decimal value 3.875? C0780000 40007800 Oo 40780000 40A80010 The binary string 01001001110000 is a floating-point number expressed using a simplified 14-bit floating-point representation format (1 sign bit, 5 exponent bits using excess-15 representation, and 8 significand bits with no implied bit). What is its...
2.Convert the following binary numbers to floating-point format using single-precision IEEE 754 format. Convert your answer to hexadecimal format. a) 11001.0101 b) -101.111101 c) -0.0101001
1. Convert the following decimal numbers in IEEE single-precision format. Give the result as eight hexadecimal digits. a) -69/32 (-69 divide by 32) b) 13.625 2. Convert the following floating IEEE single-precision floating-point numbers from hex to decimal: a) 42E48000 b) C6F00040
P8 (12 points): Convert the following numbers from IEEE 754 Single- Precision Floating Point format to decimal. Note that each number is given in hexadecimal. You may leave the result as a fraction. A: BF00000016 B: 4208000016 C: BD60000016
(30 pts) In addition to the default IEEE double-precision format (8 byte 64 bits) to store floating-point numbers, MATLAB can also store the numbers in single-precision format (4 bytes, 32 bits). Each value is stored in 4 bytes with 1 bit for the sign, 23 bits for the mantissa, and 8 bits for the signed exponent: Sign Signed exponent Mantissa 23 bits L bit 8 bits Determine the smallest positive value (expressed in base-10 number) that can be represented using...
6. The exponent in IEEE format floating point numbers are not represented in 2's complement format. Why not? What number is indicated if the value stored in the exponent is zero? What exponent and fraction are used to represent "not-a-number"? 7. This question deals with two numbers in IEEE format (A - 0x3F400000, B 0x3DB00000 (a) Calculate A+B using the floating-point addition procedure discussed in class. Determine the single precision result and express your answer in IEEE floating-point format. Convert...
Please show steps EXERCICE4 The following real numbers are given in single precision (ieee-754 floating point) format. Negate each of them. Single Precision FP Inverse (negated) value in single precision FP Ox3FCO0000 OxAFC00000 0x43806000 0xC3906000 0x41200000 0xF1200000 0x3F7F0000 EXERCICE 5 Express the following real numbers (single precision ieee-754 floating point) in decimal notation Single Precision FP Value in base 10 0x3FC00000 0xBFC00000 0x43806000 0xC3806000 0x41200000 0xC1200000 0x3F7F0000
Convert the following numbers to 32b IEEE 754 Floating Point format. Show bits in diagrams below. a) -769.0234375 Mantissa Exponent b) 8.111 Mantissa Exponent
Show how each of the following floating-point values would be stored for -127.625 using IEEE-754 single precision be sure to indicate the sign bit, the exponent, and the significand fields