Module 3 - Data Representation
Module 3 - Data Representation
Data Representation
• Bytes store numbers using the position of each bit to represent a power
of 2.
– The binary system is also called the base-2 system.
– Our decimal system is the base-10 system. It uses powers of 10 for each position in a
number.
– Any integer quantity can be represented exactly using any base (or radix).
9 10 2 + 4 10 1 + 7 10 0
5 10 3 + 8 10 2 + 3 10 1 + 6 10 0 + 4 10 -1 + 7 10 -2
1 24+ 1 23 + 0 22 + 0 21 + 1 20
= 16 + 8 + 0 + 0 + 1 = 25
• When the radix of a number is something other than 10, the base is
denoted by a subscript.
– Sometimes, the subscript 10 is added for emphasis:
110012 = 2510
01111000
Dr. Bore Gowda S B, Additional Professor, Dept. of ECE, MIT, Manipal 11
Numbering Systems
• There are three ways in which signed binary integers may be expressed:
– Signed magnitude
– One’s complement
– Two’s complement
• In an 8-bit word, signed magnitude representation places the absolute
value of the number in the 7 bits to the right of the sign bit.
• Example:
– Using signed magnitude binary arithmetic, find the sum of 75 and 46.
• First, convert 75 and 46 to binary, and arrange as a sum, but separate the
(positive) sign bits from the magnitude bits.
• Although the “end carry around” adds some complexity, one’s complement is
simpler to implement than signed magnitude.
• But it still has the disadvantage of having two different representations for
zero: positive zero and negative zero.
• Two’s complement solves this problem.
• Two’s complement is the radix complement of the binary numbering system;
the radix complement of a non-zero number N in base r with d digits is rd – N.
• Example:
– Using two’s complement binary
arithmetic, find the sum of 23 and
-9.
– We see that there is carry into the
sign bit and carry out. The final
result is correct: 23 + (-9) = 14.
✓ Range: It can represent a wide range of values from the very large to very small numbers.
✓ Precision: It provides a good balance between the precision and range, making it suitable for
the scientific computations, graphics and other applications where exact values and wide
ranges are necessary.
✓ Flexibility: It adapts to different scales of numbers allowing for the efficient storage and
computation of real numbers in the computer systems.
Note: Many people use “significand” and “mantissa” terms interchangeably. We use the
term “significand” to refer to the fractional part of a floating point number.