In: Computer Science
Represent the following in IEEE format. Express your answers in Hexadecimal Format (Base 16)
In Single Point IEEE-754 Floating Point Representation:
Sign = 1 bit
Exponent = 8 bits
Mantissa = 23 bits
In Single Point IEEE-754 Floating Point Representation:
Sign = 1 bit
Exponent = 11 bits
Mantissa = 52 bits
a) -10.5
Convert the number into binary form:
(10)10 =(1010)2
(0.5)10 = (1)2
10.5 = 1010.1
= 1.0101 * 23
Sign = 1 (as the number is negative)
Single Precision Representation:
Biased exponent = 127+(3) = 130
130 = 10000010
Normalised matissa = 0101
The IEEE 754 Single Precision : 1 10000010 01010000000000000000000
(add 0's to normalised matissa to make it 23 bits)
Hexadecimal Representation = C1280000
Double Precision Representation:
Biased exponent = 1023+(3) = 1026
1026 = 10000000010
Normalised Mantissa = 0101
The IEEE 754 Double Precision : 1 10000000010 0101000000000000000000000000000000000000000000000000
(add 0's to normalised matissa to make it 52 bits)
Hexadecimal Representation: C025000000000000
b) 9.999 x 101 + 1.610 x 10-1 = 99.99+0.1610 = 100.151
Convert the number into binary form:
(100)10 =(1100100)2
(0.151)10 = (00100110101001111111)2
100.151 = 1100100.0010011010100
= 1.100100001001101010100 * 26
Sign = 0 (as the number is negative)
Single Precision Representation:
Biased exponent = 127+(6) = 133
130 = 10000101
Normalised matissa = 1001000010011010101
The IEEE 754 Single Precision : 0 10000101 10010000100110101010000
(add 0's to normalised matissa to make it 23 bits)
Hexadecimal Representation = 42C84D50
Double Precision Representation:
Biased exponent = 1023+(6) = 1029
1029 = 10000000101
Normalised Mantissa = 1001000010011010100111111011111001110110110010001011
The IEEE 754 Double Precision : 0 10000000101 11001000010011010100111111011111001110110110010001011
(add 0's to normalised matissa to make it 52 bits
Hexadecimal Representation: 405909A9FBE76C8B
c) 0.5 x (-0.4375) = - 0.21875
Convert the number into binary form:
(0.21875)10 = (0.00111)2
0.21875 = 0.00111
= 1.11* 2-3
Sign = 1 (as the number is negative)
Single Precision Representation:
Biased exponent = 127+(-3) = 124
124 = 01111100
Normalised matissa = 11
The IEEE 754 Single Precision :1 01111100 11000000000000000000000
(add 0's to normalised matissa to make it 23 bits)
Hexadecimal Representation = BE600000
Double Precision Representation:
Biased exponent = 1023+(-3) = 1020
1020 = 01111111100
Normalised Mantissa = 11
The IEEE 754 Double Precision : 1 01111111100 1100000000000000000000000000000000000000000000000000
(add 0's to normalised matissa to make it 52 bits
Hexadecimal Representation: BFCC000000000000
d) (1.10 x 1010) x (9.2 x 10-5) = 11000000000 x 0.000092 = 1012000
Convert the number into binary form:
(1012000)10 = (11110111000100100000)2
1012000 = 11110111000100100000
= 1.1110111000100100000 * 219
Sign = 0 (as the number is negative)
Single Precision Representation:
Biased exponent = 127+(19) = 146
146 = 10010010
Normalised matissa = 1110111000100100000
The IEEE 754 Single Precision :0 10010010 11101110001001000000000
(add 0's to normalised matissa to make it 23 bits)
Hexadecimal Representation = 49771200
Double Precision Representation:
Biased exponent = 1023+(19) = 1042
1042 = 49771200
Normalised Mantissa = 1110111000100100000
The IEEE 754 Double Precision : 0 10000010010 1110111000100100000000000000000000000000000000000000
(add 0's to normalised matissa to make it 52 bits
Hexadecimal Representation: 412EE24000000000