Consider the following two 9-bit floating-point representations based on the IEE
ID: 3590239 • Letter: C
Question
Consider the following two 9-bit floating-point representations based on the IEEE floating-point format. 1. Format A a. b- c· There is 1 sign bit. There are k 5 exponent bits. The exponent bias is 15 There are n = 3 fraction bits. 2. Format B a. b- c· There is 1 sign bit. There are k 3 exponent bits. The exponent bias is 3 There are n = 5 fraction bits. In the following table, you are given some bit patterns in format A, and your task is to convert them to the closest value in format B. If rounding is necessary, you should round toward +infinity. In addition, give the values of numbers given by the format A and format B bit patterns (whole numbers or fractions). Format A Format B Bits Value Bits Value 1 01111 001 0 10110 011 100111 010 0 00000 111 1 11100 000 0 1011 100 9/8 1011 00100 -9/8Explanation / Answer
Solution:
Format A
Consider the following expression 0 10110 011
Sign bit is 0 which means the number is positive.
Exponent part is 10110.
Converting the exponent part in decimal part. The value is 24+22+21 = 22
The exponent bias is 15
The resultant exponent is 22-15=7
The fraction bits are 011
The number can be written as 1.011 x 27
The resultant binary number is 10110000.
Converting the resultant binary number into decimal
The decimal value is 176.
But the sign bit is 0 which indicate that number is positive.
Thus, the decimal value is 176
Consider the following expression 1 00111 010
Sign bit is 1 which means the number is negative.
Exponent part is 00111
Converting the exponent part in decimal part. The value is 22+21+20 = 7
The exponent bias is 15
The resultant exponent is 7-15 = -8
The fraction bits are 010
The number can be written as 1.010 x 2-8
The resultant binary number can be written as 101 x 2-10
Converting the resultant binary number into decimal
The decimal value is 5/1024.
But the sign bit is 1 which indicate that number is negative.
Thus, the decimal value is -5/1024.
Consider the following expression 0 00000 111
Sign bit is 0 which means the number is positive.
Exponent part is 00000.
Converting the exponent part in decimal part. The value is 0.
The exponent bias is 15
The resultant exponent is 0-15= -15
The fraction bits are 111
The number can be written as 1.111 x 2-15
The resultant binary number is 1111 x 2-18.
Converting the resultant binary number into decimal
The decimal value is 15/262144.
But the sign bit is 0 which indicate that number is positive.
Thus, the decimal value is 15 / 262144.
Consider the following expression 1 11100 000
Sign bit is 1 which means the number is negative.
Exponent part is 11100
Converting the exponent part in decimal part. The value is 24+23+22 = 28
The exponent bias is 15
The resultant exponent is 28-15 = 13
The fraction bits are 000
The number can be written as 1.000 x 213
The resultant binary number can be written as 10000000000000
Converting the resultant binary number into decimal
The decimal value is 8192
But the sign bit is 1 which indicate that number is negative.
Thus, the decimal value is -8192.
Consider the following expression 0 10111 100
Sign bit is 0 which means the number is positive.
Exponent part is 10111.
Converting the exponent part in decimal part. The value is 24+22+21+20 = 23
The exponent bias is 15
The resultant exponent is 23-15=8
The fraction bits are 100
The number can be written as 1.100 x 28
The resultant binary number is 110000000.
Converting the resultant binary number into decimal
The decimal value is 384.
But the sign bit is 0 which indicate that number is positive.
Thus, the decimal value is 384.
Format B
Consider the following expression 0 111 11110
Sign bit is 0 which means the number is positive.
Exponent part is 111.
Converting the exponent part in decimal part. The value is 22+21+20= 7
The exponent bias is 3
The resultant exponent is 7-3=4
The fraction bits are 11111
The number can be written as 1.11110 x 24
The resultant binary number is 11111.
Converting the resultant binary number into decimal
The decimal value is 31.
But the sign bit is 0 which indicate that number is positive.
Thus, the decimal value is 31
Consider the following expression 1 000 01000
Sign bit is 1 which means the number is negative.
Exponent part is 000
Converting the exponent part in decimal part. The value is 0
The exponent bias is 3
The resultant exponent is 0-3 = -3
The fraction bits are 11111
The number can be written as 1.01000 x 2-3
The resultant binary number can be written as 101000 x 2-8
Converting the resultant binary number into decimal
The decimal value is 40/256.
But the sign bit is 1 which indicate that number is negative.
Thus, the decimal value is -40/256.
Consider the following expression 0 000 00001
Sign bit is 0 which means the number is positive.
Exponent part is 00.
Converting the exponent part in decimal part. The value is 0.
The exponent bias is 3
The resultant exponent is 0-3= -3
The fraction bits are 111
The number can be written as 1.00001 x 2-3
The resultant binary number is 100001 x 2-8.
Converting the resultant binary number into decimal
The decimal value is 33/256.
But the sign bit is 0 which indicate that number is positive.
Thus, the decimal value is 33 / 256.
Consider the following expression 1 111 11110
Sign bit is 1 which means the number is negative.
Exponent part is 111
Converting the exponent part in decimal part. The value is 22+21+20= 7
The exponent bias is 3
The resultant exponent is 7-3 = 4
The fraction bits are 11111
The number can be written as 1.11110 x 24
The resultant binary number can be written as 11111
Converting the resultant binary number into decimal
The decimal value is 31
But the sign bit is 1 which indicate that number is negative.
Thus, the decimal value is -31.
Consider the following expression 0 111 00000
Sign bit is 0 which means the number is positive.
Exponent part is 111.
Converting the exponent part in decimal part. The value is 22+21+20= 7
The exponent bias is 3
The resultant exponent is 7-3=4
The fraction bits are 000
The number can be written as 1.00000 x 24
The resultant binary number is 10000.
Converting the resultant binary number into decimal
The decimal value is 16
But the sign bit is 0 which indicate that number is positive.
Thus, the decimal value is 16.
Format A
Format B
Bits
Value
Bits
Value
1 01111 001
-9/8
1 011 00100
-9/8
0 10110 011
176
0 111 11110
31
1 00111 010
-5/1024
1 000 01000
-40/256
0 00000 111
15/262144
0 000 00001
33/256
1 11100 000
-8192
1 111 11110
-31
0 10111 100
384
0 111 00000
16
Format A
Format B