Chris Riesbeck, Fall 2011
Floating point
Today
! IEEE Floating Point Standard ! Rounding ! Floating Point Operations ! Mathematical properties
Next time
! The machine model
Monday, October 3, 2011
Floating point Today ! IEEE Floating Point Standard ! Rounding ! - - PowerPoint PPT Presentation
Floating point Today ! IEEE Floating Point Standard ! Rounding ! Floating Point Operations ! Mathematical properties Next time ! The machine model Chris Riesbeck, Fall 2011 Monday, October 3, 2011 Checkpoint Monday, October 3, 2011 IEEE
Chris Riesbeck, Fall 2011
! IEEE Floating Point Standard ! Rounding ! Floating Point Operations ! Mathematical properties
! The machine model
Monday, October 3, 2011
Monday, October 3, 2011
3
EECS 213 Introduction to Computer Systems Northwestern University
Monday, October 3, 2011
4
EECS 213 Introduction to Computer Systems Northwestern University
Monday, October 3, 2011
5
EECS 213 Introduction to Computer Systems Northwestern University
Monday, October 3, 2011
6
EECS 213 Introduction to Computer Systems Northwestern University
Monday, October 3, 2011
7
EECS 213 Introduction to Computer Systems Northwestern University
Monday, October 3, 2011
8
EECS 213 Introduction to Computer Systems Northwestern University
– 1 bit wasted
Monday, October 3, 2011
9
EECS 213 Introduction to Computer Systems Northwestern University
– Single precision: 127 (Exp: 1…254, E: -126…127) – Double precision: 1023 (Exp: 1…2046, E: -1022…1023) – in general: Bias = 2k-1 - 1, where k is number of exponent bits
Monday, October 3, 2011
10
EECS 213 Introduction to Computer Systems Northwestern University
Floating Point Representation: Hex: 4 6 6 D B 4 0 0 Binary: 0100 0110 0110 1101 1011 0100 0000 0000 140: 100 0110 0 15213: 110 1101 1011 01
Monday, October 3, 2011
11
EECS 213 Introduction to Computer Systems Northwestern University
Monday, October 3, 2011
12
EECS 213 Introduction to Computer Systems Northwestern University
Monday, October 3, 2011
Monday, October 3, 2011
14
EECS 213 Introduction to Computer Systems Northwestern University
Monday, October 3, 2011
15
EECS 213 Introduction to Computer Systems Northwestern University
NaN NaN
Monday, October 3, 2011
16
EECS 213 Introduction to Computer Systems Northwestern University
Denormalized Normalized Infinity
Monday, October 3, 2011
17
EECS 213 Introduction to Computer Systems Northwestern University
Monday, October 3, 2011
18
EECS 213 Introduction to Computer Systems Northwestern University
Monday, October 3, 2011
19
EECS 213 Introduction to Computer Systems Northwestern University
Normalized E = e - Bias Denormalized E = 1 - Bias
Monday, October 3, 2011
20
EECS 213 Introduction to Computer Systems Northwestern University
Zero $1 $1 $1 $2 –$1 Round down (-") $1 $1 $1 $2 –$2 Round up (+") $2 $2 $2 $3 –$1 Nearest Even (default) $1 $2 $2 $2 –$2
Monday, October 3, 2011
21
EECS 213 Introduction to Computer Systems Northwestern University
Monday, October 3, 2011
22
EECS 213 Introduction to Computer Systems Northwestern University
Monday, October 3, 2011
23
EECS 213 Introduction to Computer Systems Northwestern University
Monday, October 3, 2011
24
EECS 213 Introduction to Computer Systems Northwestern University
E1–E2
Monday, October 3, 2011
25
EECS 213 Introduction to Computer Systems Northwestern University
– (3.14+1e10)-1e10=0 (rounding) – 3.14+(1e10-1e10)=3.14
Monday, October 3, 2011
26
EECS 213 Introduction to Computer Systems Northwestern University
Monday, October 3, 2011
27
EECS 213 Introduction to Computer Systems Northwestern University
Monday, October 3, 2011
28
EECS 213 Introduction to Computer Systems Northwestern University
Monday, October 3, 2011