Fixed point and floating-point numbers

8,229 views 13 slides Jul 19, 2015
Slide 1
Slide 1 of 13
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13

About This Presentation

Fixed point and floating-point numbers


Slide Content

FIXED-POINT AND FLOATING-POINT
NUMBERS
PRESENTED BY:
A.K.NAVEEN KUMAR
E.C.E. –THIRD YEAR
SRI SHANMUGHA COLLEGE OF
ENGINEERING & TECHNOLOGY

REPRESENTATIONS OF NUMBERS
Unsigned integers
Signed integers –1’s and 2’s complement
representation
Fixed-point numbers
Floating-point numbers
2

BASE-10 (DECIMAL) ARITHMETIC
Uses the ten numbers from 0 to 9
Each column represents a power of 10
3Thousands (10
3
) column
Hundreds (10
2
) column
Tens (10
1
) column
Ones (10
0
) column
1999.
10
= 1x10
3
+ 9x10
2
+ 9x10
1
+ 9x10
0

STANDARD BINARY REPRESENTATION
Uses the two numbers from 0 to 1
Every column represents a power of 2
41001.
2
= 1x2
3
+ 0x2
2
+ 0x2
1
+ 1x2
0
Eights (2
3
) column
Fours (2
2
) column
Twos (2
1
) column
Ones (2
0
) column

ADDITION
5 1. 2 5
+ 1. 5 0
2. 7 5
1. 0 1
+ 1. 1 0
1 0. 1 1

Base-10 Base-2

SCIENTIFIC NOTATION (1)
One billion
=1,000,000,000
=1 x 10
9
significand or mantissa: 1
base or radix: 10
exponent: 9
6

PRACTICE (BASE 10)
258 = 2.58 x 10
2
Mantissa = 258
Radix = 10
Exponent = 2
24.25 = 2.425 x 10
1
Mantissa = 2425
Radix = 10
Exponent = 1
7

8-BIT FLOATING POINT FORMAT (1)
sign
1 bit
exponent
3 bits
significand
4 bits
number
base 2
number
base 10
0 001 1001 1.001x2
1
2.25
0 011 1100 1.1 x 2
3
12.0
0 111 1110 1.11 x 2
7
224.0
1 001 1110 1.11 x 2
-1
0.875
8

IMPROVEMENTS
Bias the exponent
Always subtract a fixed amount, e.g., 3
Allows representation of negative exponents
Implicit one
-Leading one in a Phone number such as
1-619-556-0231 is redundant.
Why use a bit for the leading one?
9

IEEE STANDARD FLOATING-POINT
Singleprecision
32bits
sign: 1 bit
exponent: 8bits
significand: 23bits
Bias: 127
Doubleprecision
64bits
sign: 1 bit
exponent: 11bits
significand: 52bits
Bias: 511
10

PRACTICE( BASE 10)
13 = 1.3 x 10
1
= 1.011 x 2
3
1.25 = 1.25 x 10
0
= 1.010 x 2
0
11

12s exponent mantissa

3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0
1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
s exponent mantissa

3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0
1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0

THANK YOU
Tags