Wednesday, October 16, 2019
Numerical Precision Assignment Example | Topics and Well Written Essays - 1000 words
Numerical Precision - Assignment Example 32 bits. Floating point numbers is composed of two components that is, the mantissa and the exponent. The exponent consists of eight bits value which ranges from zero to 255. On the other hand, the mantissa is twenty four bit long with 1 being its most significant bit which is usually never stored. Also, there is a sign bit (+ and -) which is used to indicate whether the number is negative or positive Floating point numbers in arithmetic calculations Floating point numbers calculations vary from machine to machine depending on the precision of the machine. Precision is the degree of correctness a given quantity can be expressed; this includes 32-bit single precision and 64-bit double precision that are stored as 8 and 10 bytes respectively. This representation makes it very easy for hardware manipulation. Assignment of these values doesnââ¬â¢t require the knowledge of how the various numbers are stored in memory. For calculation purposes, this requires the pulling of individual pa rts of the numbers involved and manipulating them accordingly. Floating point used in arithmetic computations are easy to work with since they are expressed to base 2 and the exponent is a decimal value that can be expressed as binary within the computer. The fixed number notation of representing floating point numbers may lead to loss of precision such as expressing results in form of 32 bits and they may be greater than 32 bits. Floating point arithmetic is slow and hence less efficient compared to integer arithmetic. Also, floating point arithmetic is less accurate due to round off errors. Floating point format is not memory efficient at all. This is because the results of computation will require additional storage in memory which may be limited. This is usually the case with majority of computers especially personal computers and itââ¬â¢s therefore advisable to let dedicated devices to perform floating point computations. Binary Coded Decimal format This format is a format f or representing decimal numbers such that each number is represented by a number of bits (four or eight bits).There is the packed and unpacked varied binary coded decimal formats. In the packed format, each decimal number is represented using 4 bits (nibble) while in the unpacked format each decimal is represented using a byte (8 bits). For example to represent a number like 41 in binary coded decimal format will be Packed format: 0100 0001 and the unpacked format will be 0000 0100 0001 The packed BCD format is more memory efficient since it reduces on the number of unused bits added to a number. Comparison of the BCD format to the floating point format Precision BCD values are very accurate as compared to floating point numbers. This is because BCD numbers are simply decimal numbers expressed in terms of bits and floating point number format is a scientific notation of large and small values. Performance in calculations BCD numbers are easy to convert and use in arithmetic hence th e overall arithmetic computation is always very fast and efficient. Floating point format numbers must undergo various steps of conversion before they can be used in any computation. These results in some overhead in terms of memory and time hence the computations will be slow. Memory Usage BCD format is efficient in memory usage if the packed version is used. The unpacked version results
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.