Unsigned SX Ux 31 Unsigned Sy Uy 31 : / Get The Sign Bits
Unsigned SX Ux 31 Unsigned Sy Uy 31 : / Get The Sign Bits
2.84 ◆
Given a floating-point format with a k-bit exponent and an n-bit fraction, write
formulas for the exponent E, significand M, the fraction f , and the value V for
the quantities that follow. In addition, describe the bit representation.
A. The number 7.0
B. The largest odd integer that can be represented exactly
C. The reciprocal of the smallest positive normalized value
2.85 ◆
Intel-compatible processors also support an “extended precision” floating-point
format with an 80-bit word divided into a sign bit, k = 15 exponent bits, a single
integer bit, and n = 63 fraction bits. The integer bit is an explicit copy of the
implied bit in the IEEE floating-point representation. That is, it equals 1 for
normalized values and 0 for denormalized values. Fill in the following table giving
the approximate values of some “interesting” numbers in this format:
Extended precision
Description Value Decimal
Smallest positive denormalized
Smallest positive normalized
Largest normalized
2.86 ◆
Consider a 16-bit floating-point representation based on the IEEE floating-point
format, with one sign bit, seven exponent bits (k = 7), and eight fraction bits
(n = 8). The exponent bias is 27−1 − 1 = 63.
Fill in the table that follows for each of the numbers given, with the following
instructions for each column:
2.87 ◆◆
Consider the following two 9-bit floating-point representations based on the IEEE
floating-point format.
1. Format A
There is one sign bit.
There are k = 5 exponent bits. The exponent bias is 15.
There are n = 3 fraction bits.
2. Format B
There is one sign bit.
There are k = 4 exponent bits. The exponent bias is 7.
There are n = 4 fraction bits.
Below, 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 +∞. In addition, give the values of numbers given by the Format A and
Format B bit patterns. Give these as whole numbers (e.g., 17) or as fractions (e.g.,
17/64 or 17/26).
Format A Format B
Bits Value Bits Value
−9 −9
1 01111 001 8 1 0111 0010 8
0 10110 011
1 00111 010
0 00000 111
1 11100 000
0 10111 100
2.88 ◆
We are running programs on a machine where values of type int have a 32-
bit two’s-complement representation. Values of type float use the 32-bit IEEE
format, and values of type double use the 64-bit IEEE format.
130 Chapter 2 Representing and Manipulating Information
2.89 ◆
You have been assigned the task of writing a C function to compute a floating-
point representation of 2x . You decide that the best way to do this is to directly
construct the IEEE single-precision representation of the result. When x is too
small, your routine will return 0.0. When x is too large, it will return +∞. Fill in the
blank portions of the code that follows to compute the correct result. Assume the
function u2f returns a floating-point value having an identical bit representation
as its unsigned argument.
float fpwr2(int x)
{
if (x < ) {
/* Too small. Return 0.0 */
exp = ;
frac = ;
} else if (x < ) {