Back

Conference Topic:

Pick the amount from one of the checks in your checkbook.

1) Convert the decimal number into a binary number with three places to the right of the binary point.

2) Convert the binary number into a hexadecimal number.

3) Calculate the 32-bit IEEE Standard 754 floating-point number for your binary number.

Response:

Theresa L. Ford on 03-22-2004

1. Convert 1972.2310 to binary with three places to the right of the binary point.

1.A. Whole number: 1972

1972 / 2 = 986 R 0
 986 / 2 = 493 R 0
 493 / 2 = 246 R 1
 246 / 2 = 123 R 0
 123 / 2 =  61 R 1
  61 / 2 =  30 R 1
  30 / 2 =  15 R 0
  15 / 2 =   7 R 1
   7 / 2 =   3 R 1
   3 / 2 =   1 R 1
   1 / 2 =   0 R 1

197210 = 111101101002

1.B. Fraction: .23

.23 * 2 = 0.46
.46 * 2 = 0.92
.92 * 2 = 1.84
...
The rest is truncated.

.2310 = ~0012 = .12510

1.C. Combine whole number with fraction:

11110110100.0012

2. Convert 11110110100.001 to hexadecimal.
(Add leading and trailing zeros as needed.)

0111 1011 0100 . 0010
   7    B    4 .    2

3. Calculate the 32-bit IEEE Standard 754 for 011110110100.00102.

3.A. Trim unnecessary zeros.

11110110100.001


3.B. Determine sign.

0 for positive sign

3.C. Count the decimal shift to determine exponent section.

11110110100.0012
to
1.11101101000012 x 210

1010

3.D. Add 12710 for the bias.

1010 + 12710 = 13710

3.E. Convert to 8 bit binary to get exponent section.

13710 = 100010012

3.F. Shift decimal point 1010 places left.

1.1110110100001

3.G. Chop off the whole 1, as it's defined by format.

1110110100001

3.H. Fill in right zeros to 23 bits.
(Right because this is on the right side of the decimal place.)

11101101000010000000000

3.I. Combine sign bit, 8 bit binary exponent, and fraction.

0 10001001 11101101000010000000000

1972.12510 = IEEE Std 754 01000100111101101000010000000000

Back