Thursday, September 26, 2019

Floating point IEEE754 Coursework Example | Topics and Well Written Essays - 750 words

Floating point IEEE754 - Coursework Example This means that it can â€Å"float†. The point in which the radical point is located is indicated in the internal representation. There are various types of floating representation but the most common one is that of IEEE754. In a real computer, the representation of floating point numbers is through the Institute of Electrical and Electronic Engineers 754 (IEEE – 754) floating point number format. The features of this number format are that it uses 32 bits (single precision), the number y is represented as ?x(1.a1a2†¦..a23).2e, where y represents the number, whether positive or negative, ai is the mantissa entries and can only go up to 23, that is, i=1†¦.23. e is the exponent. There is a need to note the 1 that is given before the decimal (radix) point. This point represents the sign of the number that is being represented. 0 is a representation of a positive number while 1 is a representation of the negative number. The next eight bits forms the exponents. In this representation, there is no separate bit in the representation. The sign of the actual exponent is normally taken care of by adding 127 to actual exponent. An example is if the real number value is 6, then there will be an addition of 127, making it 133, that is 127 + 6. The reason as to why 127 is added is because in eight bit number representation, the maximum number that can be represented is (11111111)2 which is 255. Half of 255 is 127. This means that negative exponents of 127 can be represented and at the same time positive exponents of 127 can be represented. With this representation, the exponent will be represented as -127=128. The computer can also represent the numbers using another method other than the one stated in the paragraph above. In this regard, the computer can use eight bits for the exponent, reserving 1 bit for the sign of the exponent. In this case, the largest bit used for representation would be 127. By biasing the representation of the exponent the i nstances of getting a negative zero is avoided and also a positive zero. The effects of both are the same. The actual range of exponent in IEEE format is not 0 to 255 but 0 to 254. In this case then, the exponent has a range of -126127. In this case, -127 and 128 are used for other purposes. If e=128 and al the values of the mantissa are zeros, then the number is +- ?. The infinity bit is governed by the number before it. If e=128 and all the entries of the mantissa are not zeros, it will mean that the real number that is being represented is not a number (NaN). Because of the number that is at the lead in the floating number representation, the zero value cannot be precisely presented. This is the reason as to why the number zero is represented using -127 and all the entries of the mantissa are zero. The next bits, 23 in number, are used to represent the mantissa (Brewe 73) Representing double-precision numbers (64-bit) In double precision format, real numbers are represented in 64 bits. In this format, the computer uses the 1st bit as a sign bit. The next 11 bits are used to represent the exponent. The rest of the bits, which are 52 are used to represent the mantissa (Brewe 74). The process of converting a decimal number to IEEE754 format will undergo some steps. The first step is to check the sign of the number. If it is negative, then the sign will

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.