100 likes | 279 Views
Data Representation and Machine Concepts. Computer SCIENCE. Section 1.7. Instructor: Lin Chen. Sept 2013. 1 Data Storage. 1.7 Storing Fractions. Floating-Point Notation Truncation Errors. Pearson Custom: Computer Science, Data Representation and Machine Concepts.
E N D
Data Representation and Machine Concepts Computer SCIENCE Section 1.7 Instructor: Lin Chen Sept 2013
1 Data Storage 1.7 Storing Fractions Floating-Point Notation Truncation Errors Pearson Custom: Computer Science, Data Representation and Machine Concepts
1.6 Storing Fractions Floating-Point Notation Use 8 bits to represent the float number 1 1 0 1 1 0 1 0 Mantissa Sign bit Exponent Excess Notation 0, nonnegative 1, negative
1.6 Storing Fractions Floating-Point Notation Convert floating-point notation to decimal floating number 1 1 0 1 1 0 0 1 2 0.1011 2.75 +10.11
1.6 Storing Fractions Floating-Point Notation Questions: Convert 8 bits floating-point notation 00111100 to decimal floating number
1.6 Storing Fractions Floating-Point Notation Convert decimal floating number to binary floating number with 8 bit floating-point notation 1.001 1.125 1 0 1 0 1.001 to 0.1001, shift 1 101
1.6 Storing Fractions Floating-Point Notation Convert decimal floating number to binary floating number with 8 bit floating-point notation 1.001 1.125 1 1 1 0 1 0 0 0 1.001 to 0.1001, shift 1 101
1.6 Storing Fractions Floating-Point Notation Normalized Form 1.01 Starting with the leftmost 0 1 1 0 1 1 0
1.6 Storing Fractions Truncation Errors Convert 2.625 to floating-point notation
1.6 Storing Fractions Truncation Errors Calculate 2.5 + 0.125 + 0.125