In: Computer Science
a) IEEE single
Convert -26.25 to IEEE 32-bit floating point format.
Start with the positive version of the number
|-26.25| = 26.25
Step1: The integral part is 26 = 11010
The fractional .25= 01
so we get 26.25 in binary as = 11010.01
step 2: Normalize the binary representation of the number
11010.01 = 1.1010 01*2^4
step 3:find exponent
as we get 2^4 so add 4 to 127 127+4=131 =10000011
step 4:
Mantissa is(23 bit) : 101 0010 0000 0000 0000 0000
step 5: 32 bit number is
sign bit(1 bit): 1 as number is negative
exponent(8 bit): 1000 0011
mantisaa(23 bit): 101 0010 0000 0000 0000 0000
1 1000 0011 101 0010 0000 0000 0000 0000
=====================================================================================
a) IEEE double
Convert -26.25 to IEEE 64-bit floating point format.
Start with the positive version of the number
|-26.25| = 26.25
Step1: The integral part is 26 = 11010
The fractional .25= 01
so we get 26.25 in binary as = 11010.01
step 2: Normalize the binary representation of the number
11010.01 = 1.1010 01*2^4
step 3:find exponent
as we get 2^4 so add 4 to 1023
1023+4=1027 =100 0000 0011
step 4:
Mantissa is(52 bit) : 1010 0100 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000
step 5: 64 bit number is
sign bit(1 bit): 1 as number is negative
exponent(11 bit): 100 0000 0011
mantisaa(52 bit): 1010 0100 0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000
1 100 0000 0011 1010 0100 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
=====================================================================================
b) IEEE single
15/2=7.5
Convert 7.5 to IEEE 32-bit floating point format.
Step1: The integral part is 7 = 111
The fractional .5= 0.1
so we get 7.5 in binary as = 111.1
step 2: Normalize the binary representation of the number
111.1= 1.111*2^2
step 3:find exponent
as we get 2^2 so add 2 to 127
127+2=129 =1000 0001
step 4:
Mantissa is(23 bit) : 111 0000 0000 0000 0000 0000
step 5: 32 bit number is
sign bit(1 bit): 0 as number is positive
exponent(8 bit): 1000 0001
mantisaa(23 bit): 111 0000 0000 0000 0000 0000
0 1000 0001 111 0000 0000 0000 0000 0000
=====================================================================================
b) IEEE double
Convert 7.5 to IEEE 64-bit floating point format.
Step1: The integral part is 7 = 111
The fractional .5= 0.1
so we get 7.5 in binary as = 111.1
step 2: Normalize the binary representation of the number
111.1= 1.111*2^2
step 3:find exponent
as we get 2^2 so add 2 to 1023
1023+2=1025 =100 0000 0001
step 4:
Mantissa is(52 bit) : 1110 0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000
step 5: 64 bit number is
sign bit(1 bit): 0 as number is positive
exponent(11 bit): 100 0000 0001
mantisaa(52 bit): 1110 0000 0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000
0 100 0000 0001 1110 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000