




















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





















class10.ppt
int x = …;
float f = …;
double d = …;
Assume neither d nor f is NAN
bi bi –1 • • • b 2 b 1 b 0. b –1 b –2 b –3 • • • b – j
2 i –
2 i
2 – j
bk ⋅ 2 k k = − j
i
E = Exp – Bias
m = 1.xxx…x 2
Float F = 15213.0;
m = 1.1101101101101 2 sig = (^110110110110100000000002)
Bias = 127 Exp = 140 = (^100011002) Floating Point Representation (Class 02): Hex: 4 6 6 D B 4 0 0 Binary: 0100 0110 0110 1101 1011 0100 0000 0000 140: 100 0110 0 15213: 1 110 1101 1011 01
Description Exp Significand Numeric Value
Zero 00…00 00…00 0.
Smallest Pos. Denorm. 00…00 00…01 2 –^ {23,52}^ X 2–^ {126,1022}
Largest Denormalized 00…00 11…11 (1.0 – ε) X 2–^ {126,1022}
Smallest Pos. Normalized 00…01 00…00 1.0 X 2–^ {126,1022}
One 01…11 00…00 1.
Largest Normalized 11…10 11…11 (2.0 – ε) X 2{127,1023}
main () { long int a[2]; double d = 3.14; a[2] = 1073741824; / Out of bounds reference / printf("d = %.15g\n", d); exit(0); }
main () { long int a[2]; double d = 3.14; a[2] = 1073741824; / Out of bounds reference / printf("d = %.15g\n", d); exit(0); }
Alpha MIPS Sun -g 5.30498947741318e-315 3.1399998664856 3. -O 3.14 3.14 3.
long int a[2]; double d = 3.14; a[1] a[2] = 1073741824; a[0]
d
MIPS Stack Frame (-g)
(–1) s1^ m1 2 E (–1) s2^ m2 2 E
(–1) s^ m 2 E
(–1) s1^ m1 2 E (–1) s2^ m2 2 E
(–1) s^ m 2 E
(–1) s1^ m
(–1) s2^ m
E1 – E
(–1) s^ m