Question
The following problem is used to demonstrate the limitation of FLP in computers. A computer uses 8-bit for FLP (1bit for sign, 3 bit for
The following problem is used to demonstrate the limitation of FLP in computers.
A computer uses 8-bit for FLP (1bit for sign, 3 bit for exponent with excess-3 rep., rest for fraction). Assume Excess-3 is used to represent exponents, and 000 and 111 in exponent field are reserved.
EXCESS_3
Decimal | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
Unsigned | 000 | 001 | 010 | 011 | 100 | 101 | 110 | 111 |
Excess-3 | reserved | -2 | -1 | 0 | 1 | 2 | 3 | reserved |
Only 12*16 + 31 (+ 3 special) = 223 numbers can be represented
| REPRESENTATION | Decimal Value | ||
[Special Exponent 000]
Denormal numbers
| 0 | 000 | 0000 | +0 |
0 | 000 | 0001 | .0001 = 0.0625 | |
0 | 000 | 0010 | .0010 = 0.125 | |
|
|
|
| |
0 | 000 | 1111 | 0.1111 = 0.5+0.25+0.125+0.625 = 0.9375 | |
|
| 16 combinations |
| |
1 | 000 | 0000 | -0 | |
1 | 000 | 0001 | -0.0001 = - 0.0625 | |
1 | 000 | 0010 | -0.0010 = -0.125 | |
|
|
|
| |
1 | 000 | 1111 | -0.1111 = 0.5+0.25+0.125+0.625 = -0.9375 | |
|
| 16 combinations |
| |
|
|
|
|
|
[Special Exponent 111]
| 0 | 111 | 0000 | + ? |
1 | 111 | 0000 | - ? | |
X | 111 | X 1 X | NaN | |
|
|
|
| 3 numbers |
NORMALIZED POSITIVE FLPs | ||||
min +ve fra | 0 | 001 | 0000 | 1 * 2 -2 = 0.25 |
Next | 0 | 001 | 0001 | (1+ 1/16) * 2 -2 = 0.25+1/64 |
| 0 | 001 | 0010 | (1+ 1/8) * 2 -2 = 0.25+ 2/64 |
| 0 | 001 | 0011 | (1+ 1/8+ 1/16) * 2 -2 = 0.25+3/64 |
|
|
|
|
|
| 0 | 001 | 1111 | (1+ + 1/4+1/8+ 1/16) * 2 -2 = 0.25+15/64 |
|
|
| 16 combinations |
|
| 0 | 010 | 0000 | 1 * 2 -1 = 0.5 [ = 0.25+ 16/64] |
| 0 | 010 | 0001 | (1+ 1/16) * 2 -1 = 0.5+1/32 |
| 0 | 010 | 0010 | (1+ 1/8) * 2 -1 = 0.5+ 2/32 |
| 0 | 010 | 0011 | (1+ 1/8+ 1/16) * 2 -1 = 0.5+3/32 |
|
|
|
|
|
| 0 | 010 | 1111 | (1+ + 1/4+1/8+ 1/16) * 2 -1 = 0.5 +15/32 |
|
|
| 16 combinations |
|
| 0 | 011 | 0000 | 1 * 2 0 = 1 [ =0.5+ 16/32] |
| 0 | 011 | 0001 | (1+ 1/16) * 2 0 = 1 + 1/16 |
| 0 | 011 | 0010 | (1+ 1/8) * 2 0 = 1 + 2 /16 |
| 0 | 011 | 0011 | (1+ 1/8+ 1/16) * 2 0 = 1 + 3/16 |
|
|
|
|
|
| 0 | 011 | 1111 | (1+ + 1/4+1/8+ 1/16) * 2 -1 = 1 +15/16 |
|
|
| 16 combinations |
|
| 0 | 100 | 0000 | 1 * 2 1 = 2 [ =1 + 16/16] |
| 0 | 100 | 0001 | (1+ 1/16) * 2 1 = 2 + 1/8 |
| 0 | 100 | 0010 | (1+ 1/8) * 2 1 = 2 + 2/8 |
| 0 | 100 | 0011 | (1+ 1/8+ 1/16) * 2 1 = 2 + 3/8 |
|
|
|
|
|
| 0 | 100 | 1111 | (1+ + 1/4+1/8+ 1/16) * 2 1 = 2 + 15/8 |
|
|
| 16 combinations |
|
| 0 | 101 | 0000 | 1 * 2 2 = 4 [= 2 + 16/8] |
| 0 | 101 | 0001 | (1+ 1/16) * 2 2 = 4 + |
| 0 | 101 | 0010 | (1+ 1/8) * 2 2 = 4 + 2/4 |
| 0 | 101 | 0011 | (1+ 1/8+ 1/16) * 2 2 = 4 + |
|
|
|
|
|
| 0 | 101 | 1111 | (1+ + 1/4+1/8+ 1/16) * 2 2 = 4 + 15/4 |
|
|
| 16 combinations |
|
| 0 | 110 | 0000 | 1 * 2 3 = 8 [ 4 + 16/16] |
| 0 | 110 | 0001 | (1+ 1/16) * 2 3 = 8 + |
| 0 | 110 | 0010 | (1+ 1/8) * 2 3 = 8 + 2/2 = 9 |
| 0 | 110 | 0011 | (1+ 1/8+ 1/16) * 2 3 = 8 + 3/2 = 9.5 |
|
|
|
|
|
nextLargest | 0 | 110 | 1110 | (1+ + 1/4+1/8+ 0) * 2 3 = 8+ 14/2 =15 |
Largest | 0 | 110 | 1111 | (1+ + 1/4+1/8+ 1/16) * 2 3 = 8+ 15/2 =15.5 |
|
|
| 16 combinations |
|
| Positive numbers- 6 * 16 | |||
NORMALIZED NEGATIVE FLPs | ||||
min ve fra | 1 | 001 | 0000 | -1 * 2 -2 = - 0.25 |
next | 1 | 001 | 0001 | -(1+ 1/16) * 2 -2 = - (0.25 + 1/64) |
|
|
|
|
|
|
|
|
|
|
nextLargest | 1 | 110 | 1110 | -(1+ + 1/4+1/8+ 0) * 2 3 = 8+ 14/2 =15 |
Largest | 1 | 110 | 1111 | -(1+ + 1/4+1/8+ 1/16) * 2 3 = 8+ 15/2 =15.5 |
| Negative - 6 * 16 numbers |
Observation: Big gap (0.25=1/4) between 0 and next numbers(+ve and ve)
The gap (precision) is 1/64 in between 0.25 and 0.5 (16 numbers)
The precision is 1/32 from 0.5 to 1 (16 numbers)
The precision continuously decreases, and finally it will be 0.5 in between 8 and 15.5.
| -1 |
| -0.5 | -0.25 | 0 | 0.25 | 0.5 |
| 1 |
|
| 16 numbers | 16 numbers | No normalized numbers. Denormalized numbers are used | 16 numbers | 16 numbers |
|
|
e. What is 11000000?
1 | 100 | 0000 | -1 .0 * 2 1 = -2 |
f. How 1 will be represented?
0 | 011 | 0000 | 1.0 * 2 0 = 1 |
g. What is the smallest positive number in this representation? (without denormal)
min +ve | 0 | 001 | 0000 | 1 * 2 -2 = 0.25 |
h. What is the maximum number?
Max | 0 | 110 | 1111 | 1 .1111 * 2 3 = - 1.9375 * 8 = 15.5 |
i. What is the smallest negative number (in absolute value)? (without denormal)
max -ve | 0 | 001 | 0000 | 1 * 2 -2 = 0.25 |
j. What is the minimum number?
Min | 1 | 110 | 1111 | -1 .1111 * 2 3 = - 1.9375 * 8 = -15.5 |
k. How 0.2 will be represented?
0.2 = 0.00110011 = 1.110011 * 2 -3 ; cannot be represented- need to be rounded
Closest possible number is 0.01 = 0.25 (similar to rounding 0.0099, = 0.01)
~0.2=0.25 | 0 | 001 | 0000 | 1 * 2 -2 = 0.25 |
l. How 0 will be represented.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started