Presentation is loading. Please wait.

Presentation is loading. Please wait.

COMS 161 Introduction to Computing

Similar presentations


Presentation on theme: "COMS 161 Introduction to Computing"— Presentation transcript:

1 COMS 161 Introduction to Computing
Title: Numeric Processing Date: November 03, 2004 Lecture Number: 28

2 Announcements Research paper proposal 2 due November 8, 2004

3 Review Integers Big-endian Little-endian Overflow

4 Outline Real numbers Representation Limitations

5 Two’s complement 32 bit signed numbers: maxint minint
= 010 = + 110 = = + 2,147,483,64610 = + 2,147,483,64710 = – 2,147,483,64810 = – 2,147,483,64710 = – 2,147,483, = – 310 = – 210 = – 110 maxint minint

6 Real Numbers Scientific Notation Normalized scientific notation
Number times 10 to a power = * 103 Normalized scientific notation Zero to the left of the decimal point = * 106 Advantageous to store real numbers in 32 bits (word size)

7 Real Numbers 0.1012 = 0 * 20 + 1 * 2-1 + 0 * 2-2 + 1 * 2-3
/ / / /16 = 0 * * * * 2-3 = =

8 Real Numbers Decimal to binary conversion algorithm
1210 = 0 * * 23 1210 – 810 = 410 2 1 1 410 = 1 * 22 410 – 410 = 010

9 Real Numbers = 0.?????2 20 = 1 2 -1 = 0.5 1 = 1 * 2 -1 2 -2 = 0.25 – 0.5 = 2 -3 = 0.125 2 -4 = = 1 * 2 -2 1 2 -5 = – 0.25 = 2 -6 = = 1 * 2 -3 1 2 -7 = – = 010 2 -8 = 0. 2

10 Real (Decimal) Number Storage
Real numbers are stored in floating point representation IEEE Standard 754 Allows using data on different machines A sign An exponent A mantissa also called a significand (normalized decimal fraction) Single digit to the left of the decimal point


Download ppt "COMS 161 Introduction to Computing"

Similar presentations


Ads by Google