15 213 The course that gives CMU its Zip Floating Point Sept 2 2008 Topics class03 ppt IEEE Floating Point Standard Rounding Floating Point Operations Mathematical properties 15 213 F 08 Creating Floating Point Number Steps 7 6 Normalize to have leading 1 Round to fit within fraction Postnormalize to deal with effects of rounding s 0 3 2 exp frac Case Study 28 Convert 8 bit unsigned numbers to tiny floating point format Example Numbers 128 10000000 15 00001101 33 00010001 35 00010011 138 10001010 63 00111111 15 213 F 08 Normalize 7 6 s 0 3 2 exp frac Requirement Set binary point so that numbers of form 1 xxxxx Adjust all to have leading one Decrement exponent as shift left 29 Value Binary Fraction Exponent 128 10000000 1 0000000 7 15 00001101 1 1010000 3 17 00010001 1 0001000 5 19 00010011 1 0011000 5 138 10001010 1 0001010 7 63 00111111 1 1111100 5 15 213 F 08 Rounding 1 BBGRXXX Guard bit LSB of result Sticky bit OR of remaining bits Round bit 1 bit removed st Round up conditions 30 Round 1 Sticky 1 0 5 Guard 1 Round 1 Sticky 0 Round to even Value Fraction GRS Incr Rounded 128 1 0000000 000 N 1 000 15 1 1010000 100 N 1 101 17 1 0001000 010 N 1 000 19 1 0011000 110 Y 1 010 138 1 0001010 011 Y 1 001 63 1 1111100 111 Y 10 000 15 213 F 08 Postnormalize Issue 31 Rounding may have caused overflow Handle by shifting right once incrementing exponent Value Rounded Exp Adjusted 128 1 000 7 128 15 1 101 3 15 17 1 000 4 16 19 1 010 4 20 138 1 001 7 134 63 10 000 5 1 000 6 Result 64 15 213 F 08
View Full Document