Docsity

Solved Assignment for Computer Architecture | CS 35101, Assignments of Computer Architecture and Organization

Toggle sidebar
bg1
IEEE 754 Floating Point Worksheet: CS 35101
Thursday, March 6, 2008 (Due by Tuesday, March 11, 2008 at the start of class)
Convert the number 3.25 into the single-precision IEEE 754 FP format. Label the
different “parts” of the FP format above the boxes.
3.25 = 11.01 in base 2. To normalize, put it in the form (sign) 2exponent+bias *
1.fraction = 2127-1 * 1.101. Be sure to remember that the exponent is biased! The
biased exponent can be computed by adding (exponent + bias). Here we add 1 + 127 =
128.
Show the number 3.25 in double-precision format. Label the different parts of the FP
format above the boxes.
The exponent bias is 1023. You need to add 1023 to bump the exponent up to 1024.
Give two base 2 numbers that when added will cause an overflow error in single
precision.
The largest exponent is 254 (11111110). All ones indicates NaN. When the fraction is
all 1’s, the value is 3.4028234 x 1038. That plus anything, or two values whose sum is
larger than that would create an overflow situation.
+
= OVERFLOW
What is their base 10 (decimal) value?
s
exponent
fraction
31
30
29
28
27
26
23
22
21
20
17
14
11
10
9
8
7
6
5
4
3
2
1
0
0
1
0
0
0
0
0
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
s
exponent
Fraction
31
30
29
28
27
26
23
22
21
20
19
17
14
11
10
9
8
7
6
5
4
3
2
1
0
0
1
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
fraction (continued from abov e)
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
31
30
29
28
27
26
23
22
21
20
17
14
11
10
9
8
7
6
5
4
3
2
1
0
31
30
29
28
27
26
23
22
21
20
17
14
11
10
9
8
7
6
5
4
3
2
1
0

Partial preview of the text

Download Solved Assignment for Computer Architecture | CS 35101 and more Assignments Computer Architecture and Organization in PDF only on Docsity!

IEEE 754 Floating Point Worksheet: CS 35101

Thursday, March 6, 2008 (Due by Tuesday, March 11, 2008 at the start of class)

Convert the number 3.25 into the single-precision IEEE 754 FP format. Label the

different “parts” of the FP format above the boxes.

3.25 = 11.01 in base 2. To normalize, put it in the form (sign) 2exponent+bias^ *

1. fraction = 2^127 -^1 * 1.101. Be sure to remember that the exponent is biased! The

biased exponent can be computed by adding (exponent + bias). Here we add 1 + 127 =

Show the number 3.25 in double-precision format. Label the different parts of the FP

format above the boxes.

The exponent bias is 1023. You need to add 1023 to bump the exponent up to 1024.

Give two base 2 numbers that when added will cause an overflow error in single

precision.

The largest exponent is 254 (11111110). All ones indicates NaN. When the fraction is

all 1’s, the value is 3.4028234 x 10

. That plus anything, or two values whose sum is

larger than that would create an overflow situation.

= OVERFLOW

What is their base 10 (decimal) value?

s exponent fraction 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 s exponent Fraction 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 fraction (continued from above) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0