ECE-C490 Computer Arithmetic

advertisement
ECE-C490 Security in Computing
Winter Term 2005
Quiz #2 Solutions
Consider a hypothetical floating point system in radix 2 (binary) with the following
characteristics:



1 sign bit
8 bits for a biased exponent
20 bits for the mantissa
For this hypothetical system, find:



The precision
The range, and
The maximum and minimum exponent.
Explain all of your reasoning!
Precision can be defined in one of two ways: the number of bits for the mantissa (20) or
the smallest possible difference in magnitude between any two numbers represented by
the system, which would be the magnitude that can be contributed by the least significant
bit of the mantissa, or 2-20.
Range is the range of numbers that can be represented by the system. Obviously the
largest would be the positive number with the largest mantissa (all 1s) and the largest
exponent (all 1s). The actual value of this number would be 1.(1 - 220) * 2128.
The smallest number would have the same magnitude in the mantissa, but would be
negative.
Maximum and minimum exponent depend on the bias used for the exponent. Given 8
bits for the exponent, the bias would be 127. Thus we can represent exponents from –127
to +128.
Download