Unformatted text preview: biased value: E = exp ‐ Bias § exp is an unsigned value ranging from 1 to 2k‐2 (k == # bits in exp) § Bias = 2k‐1 ‐ 1
§ Single precision: 127 (so exp: 1…254, E: ‐126…127) § Double precision: 1023 (so exp: 1…2046, E: ‐1022…1023) § These enable nega=ve values for E, for represen=ng very small values ¢ Signiﬁcand coded with implied leading 1: M = 1.xxx…x2 § xxx…x: the n bits of frac § Minimum when 000…0 (M = 1.0) § Maximum when 111…1 (M = 2.0 – ε) § Get extra leading bit for “free” IEEE Floang Point Standard University of Washington Normalized Encoding Example s E V = (–1) * M * 2 s exp frac
n k ¢ Value: float f = 12345.0; § 1234510 = 110000001110012 = 1.10000001110012 x 213 (normalized form) ¢ Signiﬁcand: M = frac = ¢ 1.10000001110012
100000011100100000000002 Exponent: E = exp ‐ Bias, so exp = E + Bias E = Bias = exp = ¢ 13 127 140 = 100011002 Result: 0 10001100 10000001110010000000000
s exp frac IEEE Floang Point Standard University of Washington Integer & Floang Point Numbers ¢
¢
¢
¢ ¢
¢
¢
¢ Representaon of integers: unsigned and signed Unsigned and signed integers in C Arithmec and shiBing Sign extension Background: fraconal binary numbers IEEE ﬂoang‐point standard Floang‐point operaons and rounding Floang‐point in C Floang Point Operaons University of Washington How do we do operaons? ¢ Unlike the representaon for integers, the representaon for ﬂoang‐point numbers is not exact Floang Point Operaons University of Washington Floang Point Operaons: Basic Idea s E V = (–1) * M * 2 s exp frac
k ¢ x +f y = Round(x + y) ¢ x *f y = Round(x * y) ¢ n Basic idea for ﬂoang point operaons: § First, compute the exact result § Then, round the result to...
View
Full Document
 Fall '09
 Exponential Function, Exponentiation, University of

Click to edit the document details