computer science engineering b.e.(4 th sem) c omputer system organization topic-floating and decimal...

12
Computer Science Engineering B.E.(4 th sem) computer system organization Topic-Floating and decimal arithmetic Submitted to– Prof. Shweta Agrawal Submitted by- Shivani jyotiki Prabha pal Sandhya uikey

Upload: gerald-maxwell

Post on 12-Jan-2016

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Computer Science Engineering B.E.(4 th sem) c omputer system organization Topic-Floating and decimal arithmetic S ubmitted to– Prof. Shweta Agrawal Submitted

Computer Science Engineering B.E.(4thsem) computer system organization Topic-Floating and decimal arithmetic

Submitted to– Prof. Shweta Agrawal Submitted by- Shivani jyotiki Prabha pal Sandhya uikey

Page 2: Computer Science Engineering B.E.(4 th sem) c omputer system organization Topic-Floating and decimal arithmetic S ubmitted to– Prof. Shweta Agrawal Submitted

Contents History Basic terms Real numbers Floating representation Floating point multiplication flowchart

Rounding and Errors

Page 3: Computer Science Engineering B.E.(4 th sem) c omputer system organization Topic-Floating and decimal arithmetic S ubmitted to– Prof. Shweta Agrawal Submitted

History The first floating point representation

was firstly used in “V1” machine (1945). It had 7-bit exponent, 16-bit mantissa, and a sign bit.

In 1954, floating point representation was used by IBM for the modern computing system.

In 1962, the UNIVAC 1100/2200 series was introduced. It contains single precision and double precision.

Page 4: Computer Science Engineering B.E.(4 th sem) c omputer system organization Topic-Floating and decimal arithmetic S ubmitted to– Prof. Shweta Agrawal Submitted

Defination of FlotingComputers are integer machines and are capable of representing real numbers only by using complex codes. The most popula code for reprasenting real numbers is called the IEEE FLOTING –POINT STANDARD. The floting point number is derived from the fact that there is no fixer number of digit before and after the decimal;That is, the decimal point can flot.if the no. of digit before and after the decimal point is set, called fixed point representation. Floting point is slower than fixed point.

Page 5: Computer Science Engineering B.E.(4 th sem) c omputer system organization Topic-Floating and decimal arithmetic S ubmitted to– Prof. Shweta Agrawal Submitted

Basic Terms Scientific notation: A notation that renders

numbers with a single digit to the left of the decimal point.

Normalized: A number in floating-point notation that has no leading 0s.

Floating point: Computer arithmetic that represents numbers in which the binary point is not fixed.

Fraction: The value, between 0 and 1, placed in the fraction field of the floating point.

Exponent: In the numerical representation system of floating-point arithmetic, the value that is placed in the exponent field.

Page 6: Computer Science Engineering B.E.(4 th sem) c omputer system organization Topic-Floating and decimal arithmetic S ubmitted to– Prof. Shweta Agrawal Submitted

Real Numbers Two’s complement representation deal

with signed integer values only.

Without modification, these formats are not useful in scientific or business applications that deal with real number values.

Floating-point representation solves this problem.

Page 7: Computer Science Engineering B.E.(4 th sem) c omputer system organization Topic-Floating and decimal arithmetic S ubmitted to– Prof. Shweta Agrawal Submitted

Floating-Point Representation

We introduce a hypothetical “Simple Model” to explain the concepts

In this model: A floating-point number is 14 bits in length The exponent field is 5 bits The significand field is 8 bits

Page 8: Computer Science Engineering B.E.(4 th sem) c omputer system organization Topic-Floating and decimal arithmetic S ubmitted to– Prof. Shweta Agrawal Submitted

Floating-point numbers allow an arbitrary number of decimal places to the right of the decimal point. For example: 0.5 0.25 = 0.125

They are often expressed in scientific notation. For example:

0.125 = 1.25 10-1

5,000,000 = 5.0 106

Floating Point Representation

Page 9: Computer Science Engineering B.E.(4 th sem) c omputer system organization Topic-Floating and decimal arithmetic S ubmitted to– Prof. Shweta Agrawal Submitted

Floating Point Representation

Computers use a form of scientific notation for floating-point representation

Numbers written in scientific notation have three components:

Page 10: Computer Science Engineering B.E.(4 th sem) c omputer system organization Topic-Floating and decimal arithmetic S ubmitted to– Prof. Shweta Agrawal Submitted

Floating Point Multiplication flowchart

Page 11: Computer Science Engineering B.E.(4 th sem) c omputer system organization Topic-Floating and decimal arithmetic S ubmitted to– Prof. Shweta Agrawal Submitted

Rounding and Errors Floating-point overflow and underflow can cause programs to crash.

Overflow occurs when there is no room to store the high-order bits resulting from a calculation.

Underflow occurs when a value is too small to store, possibly resulting in division by zero.

Page 12: Computer Science Engineering B.E.(4 th sem) c omputer system organization Topic-Floating and decimal arithmetic S ubmitted to– Prof. Shweta Agrawal Submitted