Module 1c Number Systems and Presentation
Module 1c Number Systems and Presentation
We know that for n-bit number, the range for natural number is from 0
to (2^(n))-1 .
For n-bit, we have all together 2^n different combination, and we use
these different combination to represent 2^n
numbers, which ranges from 0 to (2^(n))-1 .
If we want to include the negative number, naturally, the range will
decrease. Half of the combinations are used for
positive number and other half is used for negative number.
For n-bit represenatation, the range is from .
For example, if we consider 8-bit number, then range
for natural number is from 0 to 255; but
for signed integer the range is from -127 to +127.
Representation of signed integer
We know that for n-bit number, the range for natural number is from 0 to (2^n)-1 .
There are three different schemes to represent negative number:
l Signed-Magnitude form.
l 1’s complement form.
l 2’s complement form.
Signed magnitude form:
In signed-magnitude form, one particular bit is used to indicate the sign of the number,
whether it is a positive number
or a negative number. Other bits are used to represent the magnitude of the number.
For an n-bit number, one bit is used to indicate the signed information and remaining (n-1)
bits are used to represent
the magnitude. Therefore, the range is from –(2^(n-1))-1 to +(2^(n-1))-1.
Generally, Most Significant Bit (MSB) is used to indicate the sign and it is termed as signed
bit. 0 in signed bit
indicates positive numvber and 1 in signed bit indicates negative number.
For example, 01011001 represents + 169 and
11011001 represents - 169
What is 00000000 and 10000000 in signed magnitude form?
The concept of complement
The concept of complements is used to represent signed number.
Consider a number system of base-r or radix-r. There are two types of complements,
l The radix complement or the r’s complement.
l The diminished radix complement or the (r - 1)’s complement.
Diminished Radix Complement :
Given a number N in base r having n digits, the (r - 1)’s complement of N is defined
as (r^n-1)-N .
For decimal numbers, r = 10 and r - 1 = 9, so the 9’s complement of N is (10^n-1)-N.
e.g., 9’s complement of 5642 is 9999 - 5642 = 4357.
• Radix Complement :
• The r’s complement of an n-digit number in base r is defined as r^N-N for N != 0 and 0 for N = 0.
• r’s complement is obtained by adding 1 to the ( r - 1 )’s complement, since (r^N-N)=[(r^N-1)-N]+1
• e.g., 10's complement of 5642 is 9's complement of 5642 + 1, i.e., 4357 + 1 = 4358
• e.g., 2's complement of 1010 is 1's complement of 1010 + 1, i.e., 0101 + 1 = 0110.
• Representation of Signed integer in 1's complement form:
• Consider the eight bit number 01011100, 1's complements of this
• number is 10100011. If we perform the following addition:
• If we add 1 to the number, the result is 100000000.
• 01011100
• 10100011
• ----------------------------
• 11111111
• Since we are considering an eight bit number, so the 9th bit (MSB) of the result can not be stored. Therefore,
the final
• result is 00000000.
• Since the addition of two number is 0, so one can be treated as the negative of the other number. So, 1's
• complement can be used to represent negative number.
Representation of Signed integer in 2's complement form:
Consider the eight bit number 01011100, 2's complements of this number is
10100100. If we perform the follwoing
addition:
01011100
10100011
--------------------------------
100000000
Since we are considering an eight bit number, so the 9th bit (MSB) of the result
can not be stored. Therefore, the final
result is 00000000.
Since the addition of two number is 0, so one can be treated as the negative of
the other number. So, 2's
complement can be used to represent negative number.
Decimal 2's Complement 1's complement Signed Magnitude
+7 0111 0111 0111
+6 0110 0110 0110
+5 0101 0101 0101
+4 0100 0100 0100
+3 0011 0011 0011
+2 0010 0010 0010
+1 0001 0001 0001
+0 0000 0000 0000
-0 ----- 1111 1000
-1 1111 1110 1001
-2 1110 1101 1010
-3 1101 1100 1011
-4 1100 1011 1100
-5 1011 1010 1101
-6 1010 1001 1110
-7 1001 1000 1111
-8 1000 ------ -------
Representation of Real Number
Since we are working with 0's and 1's only, to represent character in computer we use strings of 0's
and 1's only.
To represent character we are using some coding scheme, which is nothing but a mapping function.
Some of standard coding schemes are: ASCII, EBCDIC, UNICODE.
ASCII : American Standard Code for Information Interchange.
It uses a 7-bit code. All together we have 128 combinations of 7 bits and we can represent 128
character.
As for example 65 = 1000001 represents character 'A'.
EBCDIC : Extended Binary Coded Decimal Interchange Code.
It uses 8-bit code and we can represent 256 character.
UNICODE : It is used to capture most of the languages of the world. It uses 16-bit
Unicode provides a unique number for every character, no matter what the platform, no matter what
the program, no
matter what the language. The Unicode Standard has been adopted by such industry leaders as
Apple, HP, IBM,
JustSystem, Microsoft, Oracle, SAP, Sun, Sybase, Unisys and many others.