.

Thursday, July 25, 2019

Investigate data representations Essay Example | Topics and Well Written Essays - 1000 words

Investigate data representations - Essay Example The above scheme can work fine as long as there are â€Å"unsigned† numbers. A strategy had to be evolved to represent â€Å"signed† numbers with consistent representation of negative as well as positive numbers. Several representation systems exist to represent signed numbers like the sign-and-magnitude, one’s complement, two’s complement, etc. Sign-and-magnitude and one’s complement both use the most significant bit to represent the sign of the number with 0 for positive and 1 for negative sign. An anomaly arises in the representation of the number zero itself. Since the most significant bit denotes the sign, a zero can be both â€Å"negative†, as in 10000000, as well as â€Å"positive†, as in 00000000. This ambiguity has led modern computer systems design to adopt the two’s complement which does not have this ambiguity. Two’s complement represents positive numbers by converting simply from decimal to binary. So, a decimal 4 in 4-bit representation would become 0100. Zero is uniquely represented by 0000. Negative numbers are first complemented and then a 1 is added to the result. A generic formula would be 2N-A+1 where N is the number of bits used and A is the number to be converted. See example of converting decimal -3 to two’s complement below: Arithmetic functions can be purely addition based and no subtraction remains necessary. Subtraction can be performed by adding the two’s complement representations. The resulting number is the two’s representation of final result. The range of uniquely representable numbers in N-bit systems are -2N-1 to +-2N-1-1 (Dandamudi 886). Floating point numbers are represented differently. They are divided into three parts, the sign bits for exponent and mantissa, the exponent and the mantissa. For example, if 205.347 is to be represented, it is first brought to a â€Å"normal form† of 2.05347 x 102 where 205347 is the mantissa and the power of 2 is the

No comments:

Post a Comment