In: Computer Science
Suppose we want to define an analogue of the IEEE 754 standard for 14 bits, with 1 bit for sign, 6 bits for (biased) exponent, and 7 bits for the significand. Assume exponent 000000 and 111111 are reserved for 0, denormal, NaN and infinity, just like IEEE 754 standard.
a) What is the bias for the exponent? Express it in decimal.
b) What is the smallest positive denormalized number?
c) What is the smallest positive normalized number?
d) What is the largest positive normalized number (excluding infinity)?
Examples of IEEE 754 standards with normalized and De-normalized and other special numbers:
Required solution is highlighted in orange:
Type |
Sign |
Actual Exponent |
Exp (biased) |
Exponent field |
Fraction field |
Value |
Zero |
0 |
-126 |
0 |
0000 0000 |
000 0000 0000 0000 0000 0000 |
0.0 |
Negative zero |
1 |
-126 |
0 |
0000 0000 |
000 0000 0000 0000 0000 0000 |
-0.0 |
One |
0 |
0 |
127 |
0111 1111 |
000 0000 0000 0000 0000 0000 |
1.0 |
Minus One |
1 |
0 |
127 |
0111 1111 |
000 0000 0000 0000 0000 0000 |
-1.0 |
Smallest denormalized number |
* |
-126 |
0 |
0000 0000 |
000 0000 0000 0000 0000 0001 |
±2−23 × 2−126 = ±2−149 ≈ ±1.4×10−45 |
"Middle" denormalized number |
* |
-126 |
0 |
0000 0000 |
100 0000 0000 0000 0000 0000 |
±2−1 × 2−126 = ±2−127 ≈ ±5.88×10−39 |
Largest denormalized number |
* |
-126 |
0 |
0000 0000 |
111 1111 1111 1111 1111 1111 |
±(1−2−23) × 2−126 ≈ ±1.18×10−38 |
Smallest normalized number |
* |
-126 |
1 |
0000 0001 |
000 0000 0000 0000 0000 0000 |
±2−126 ≈ ±1.18×10−38 |
Largest normalized number |
* |
127 |
254 |
1111 1110 |
111 1111 1111 1111 1111 1111 |
±(2−2−23) × 2127 ≈ ±3.4×1038 |
Positive infinity |
0 |
128 |
255 |
1111 1111 |
000 0000 0000 0000 0000 0000 |
+∞ |
Negative infinity |
1 |
128 |
255 |
1111 1111 |
000 0000 0000 0000 0000 0000 |
-∞ |
Not a number |
* |
128 |
255 |
1111 1111 |
non zero |
NaN |
* Sign bit can be either 0 or 1 . |
Some examples of IEEE 754 standards for reference:
Sign |
Exponent |
Fraction |
Value |
0 |
00000000 |
00000000000000000000000 |
0 |
1 |
00000000 |
00000000000000000000000 |
-0 |
0 |
11111111 |
00000000000000000000000 |
Infinity |
1 |
11111111 |
00000000000000000000000 |
-Infinity |
0 |
11111111 |
00000100000000000000000 |
NaN (signaling) |
1 |
11111111 |
00100010001001010101010 |
NaN (signaling) |
0 |
11111111 |
10000000000000000000000 |
NaN (quiet) |
1 |
11111111 |
10100011010101000001010 |
NaN (quiet) |
0 |
10000000 |
00000000000000000000000 |
+1 * 2**(128-127) * 1.0 = 2 |
0 |
10000001 |
10100000000000000000000 |
+1 * 2**(129-127) * 1.101 = 6.5 |
1 |
10000001 |
10100000000000000000000 |
-1 * 2**(129-127) * 1.101 = -6.5 |
0 |
00000001 |
00000000000000000000000 |
+1 * 2**(1-127) * 1.0 = 2**(-126) |
0 |
00000000 |
10000000000000000000000 |
+1 * 2**(-126) * 0.1 = 2**(-127) |
0 |
00000000 |
00000000000000000000001 |
+1 * 2**(-126) * 0.00000000000000000000001 = 2**(-149) (Smallest positive value) |