although the computer represents the exponent in base 2 as well as the rest of the number, to simplify the notation we show the exponent in decimal.a standard scientific notation for reals in normalized form offers three advantages. It simplifies exchange of data that includes floating point number: it simplifies the floating-point arithmetic algorithms to known that numbers will always be in this form. and it increases the accuracy of the number that can be stored in a word, since the unnecessary leading 0s are replaced by real digits to the right of the binary point.Floating point representation.a designer of floating point representation must find a compromise between the size of the fraction and the size of the exponent, because a fixed word size means you must take a bit from one to add bit to the other. This tradeoff is between precision and range; Increasing the size of the fraction enhances the precision of the fraction, while increasing the size of the exponent increases the range of the number thar can be represented. As our design guideline from chapter 2 remind us. good design demand good compromise.Floating=point number are usually a multiple of the size of a word. The representation of a MipS floating - point number is show below, where is the sign of the floating -point number(1 meaning negative) exponent is the value of the 8 bit exponent field < including the sign of the exponent> and fraction is the 23 BIT NUMBER. tHIS REPRESENTATION is called sign and magnitude, since the sign is a separate bit from the rest of the number.In general, floating-point number are of the formF involves the value in the fraction field and E ie exponent field.. the exact relationship to these fields will be spelled out soon. These chosen sizes of exponent and fraction give MipS computer arithmetic an extraordinary almost as large as2.0 can be represented in a computer. Alas, extraordinary differs from infinite, so it is still possible for number to be too large. Thus, overflow interrupts can occur in floating-point arithmetic as well as in integer arithmetic. Notice that overflow here means that the exponent is to large to be represented in the exponent field.Floting point offers a new kind of exceptional event as well. Just as programmers will want to known when they have calculated a number that is too large to be presented, they will want to known if the nonzero fraction they are calculating has become so small that it cannot be represented. either evenr could result in a program giving incorrect answers. To distinguish it from overflow, wa call this event underflow/ This stutuation ocuurs when negative exponent is too large to fit in the exponent field.one way to reduce chances of underflow or overflow is to offer another format thar has larger exponent. In C this numver is called double, and operation on doubles are called double precision floating-ponit arithmetic, single precison floating point is the name of the earlier format.The representation of a double precision floating point number takes two MIPS words, as show below, where os still the sign of the number , exponent is the value of the 11 bit exponent field/ and fraction is the 52 bit number in the fraction field. MNips double precision allows numbers almost as small as 2.0 and almosr as large as 2.-0. Although double precision does increase the exponent range. it is primary advantage is it greater precision because of the much larger signficand.These format go beyond MIPS. They are part of the IEEE 754 floating point standard.found in vitually every computer invented since 1980; This standard has greatly improved both the ease of porting floating ponit program and the quality of computer arithmetic.to pack even more bits into the significand. IEEE 754 makes the leading 1-bit of namalized binary number implicit. Hence, the number is actually 24 bits long in single precision. and 53 bit long in double precision<1+52> to be precise, we use the term signficand ti represent the 24-53 bit number that is 1 plus the fraction, and fraction when we mean the 23- or 52 bit number. Since 0 has no leading 1. it is given the reserved exponent value 0 so that the hard won't attach a leading 1 to it.Thus 00// represent 0. the presentation of the rest of the number uses the form from before with hidden 1 added.Where bits of the fraction represent a number between 0 and 1 E specifies the value in the exponent field. To be given in detail shortly. If we number the bits of the fraction from left to right s1,s2,s3...then the value is
Figure 3.14 shows the encoding of IRRR754 floating point number. Other feates of IEEE 754 are special symbols to represent unsual event. For example, instead of interrupting on a divide by 0. softwawe can set the result to a bit pattern representing . the largest exponent is reserved for these special symbols. When the programer prints the results, the program will print an infinity symbol. <<
For the mathetically trained. The purpose of infinity is to form topological closure of the reals>
A separate sign bit determines the sign. Denormalized number are described the ELABORA on page 270/ This information is also found in Colum 4 of the MIPS re DAta cad at the front of this book.
đang được dịch, vui lòng đợi..