Documentos de Académico
Documentos de Profesional
Documentos de Cultura
April 9, 2013
Conversion
Conversion between base 10 and base 2
Process left and right separately
Examples
a) b) c) d) 7.00 0.375 12.25 0.1
Conversion
Why it works? Let 0< a <1 How to find x-1?
x-k
Conversion
Why it works? Let 0< a <1 How to find x-1? Compute 2a
0 . x-1 x-2 x-3 x-4 x-k x 2
Conversion
Why it works? Let 0< a <1 How to find x-1? Compute 2a
0 . x-1 x-2 x-3 x-4 x-k x-k x 2
Representable Numbers
Each base has numbers that are not representable with finite number of digits
Decimal
Finite: 1/10 = 0.1 Infinite: 1/3 = 0.33 [3]
Base 3
Finite: 1/3 = 0.1 Infinite: 1/10 = 0.00220022 [0022]
Binary
Finite: 1/2 = 0.1 Infinite: 1 / 3 = 0.0101 [01]
Floating Point
Finite-length encodings cannot represent numbers such as 1/3 and 5/7
Fractional binary notation can only represent numbers in the form V = M 2E Examples:
a) 7 x 24 = b) 9 x 214 = c) 21 x 223 =
Floating Point
More examples:
a) 5 2-3 = 5/8 = b) 5 2-4 = 5/16 = c) 5 2-8 = 5/256 =
A simple fact
We can write any positive binary number in the normalized form: 1.b1b2b3. x 2E
Examples: 1101.01 = 0.0010101 =
Significand M
Exponent E
Significand M
Exponent E
s
exp
frac
Standards
Single precision: 8 exp bits, 23 frac bits
32 bits total
exp
frac
s
s ek-1
frac
f2 f1 f0
Normalized Form
Examples:
a) b) c) d) k=2, n=3: k=3, n=4: K=3, n=4: k=4, n=?: 101101 01011100 10110011 01001010111
s
s ek-1
frac
f2 f1 f0
s
s 0
frac
f2 f1 f0
Denormalized Form
Examples:
s
s ek-1
frac
f2 f1 f0
Situation #2: f0
NAN (Not a Number)
s
s 1
frac
f2 f1 f0
More Examples
k=3, n=4
a) 10001001= b) 11110000= c) 01110100= d) 01110000=
e) 01010101=
18
20