Professional Documents
Culture Documents
Number Systems
Number Systems
INTRODUCTION
There is centuries of mental eort and sheer good
luck which had gone into the development of the
number system we use. Our present number sys-
tem provides modern mathematicians and scien-
tists with a great advantage over those of pre-
vious civilizations and is an important factor in
our rapid advancement. Since hands are the most
convenient tools nature has provided, human be-
ings have always tended to use them in counting.
so the decimal number system followed naturally
from this usage.
1
Figure 4: Power of 2.
2
the letters of the alphabet, punctuation marks, over other text code systems is its compatibility
and other symbols. This standard code system with ASCII codes. The rst 256 codes in Unicode
would enable any programmer or program to use are identical to the 256 codes used by the ASCII
the same combination of numbers to represent and Extended ASCII systems.
the same individual pieces of data. A few most
popular text code systems invited are the follow-
ing:
DECIMAL SYSTEM
As mentioned in the intro that our present system
EBCDIC of numbers, the decimal system, has 10 separate
symbols which are used to construct the remain-
EBCDIC stands forExtended Binary Coded
ing numbers. In decimal system the number 4728
Decimal Interchange Code. It is an eight-bit
means four thousands, seven hundreds, two tens,
code that denes 256 symbols. It is still used in
and eight ones:
IBM mainframe and mid-range systems, but it is
rarely encountered in personal computers.
4728 = (4 × 1000) + (7 × 100) + (2 × 10) + (8 × 1)
Extended ASCII is an eight-bit code that spec- 0.4728 = (4×10−1 )+(7×10−2 )+(2×10−3 )+(8×10−4 )
ies the characters from values from 128 to 255.
The rst 40 symbols represent pronunciation and Similarly 192.685 in decimal format would be:
special punctuation. The remaining symbols are
graphic symbols.
192.685 = (1 × 102 ) + (9 × 101 ) + (2 × 100 )
+(6 × 10−1 ) + (8 × 10−2 ) + (5 × 10−3 )
Unicode In general, the decimal representation of X
would be as:
The Unicode Worldwide Character Stan-
dard provides up to four bytes (32 bits) to rep- X = . . . + (d2 × 102 ) + (d1 × 101 ) + (d0 × 100 )
resent each letter, number, or symbol. With four +(d−1 × 10−1 ) + (d−2 × 10−2 ) + . . .
bytes, enough Unicode codes can be created to
represent more than 4 billion dierent characters , and/or in more compact form X can be rep-
or symbols. This total is enough for every unique resented as:
character and symbol in the world, including the X
vast Chinese, Korean, and Japanese character set X= (di × 10i ) (1)
and those found in known classical and historical i
texts. In addition to world letters, special math- where i = . . . , 3, 2, 1, 0, −1, −2, −3, . . ..
ematical and scientic symbols are represented in The Romans and Greeks had their own nu-
Unicode. One major advantage that Unicode has meral systems as illustrated in Table 2. It was
3
Table 1: ASCII Codes
4
Table 2: Roman and Greek number system.
BINARY SYSTEM
Figure 5: Abacus device.
In binary system, only two digits, 1 and 0 are
used to construct all the remaining numerals.
very dicult to do the basic arithmetic opera- Thus, number in the binary system are repre-
tions in these early systems. It was this clumsi- sented to the base 2. In order to avoid confusion
ness of these systems and others like these, that between decimal number system and binary num-
forced mathematicians of the time to perform ber system or for that instant any other number
arithmetic operations almost entirely on abacus, system, we put subscript on a number to indi-
as shown in Figure 5, or counting boards, trans- cate its base. For example if we write the number
lating their results back to Roman and Greek nu- 1001 then it might create confusion that whether
merals form. Pencil-and-paper computation are its a decimal number or binary. On the other
unbelievably intricate and dicult in such sys- hand, if the same number is written in the for-
tems. In fact, the ability to perform such opera- mat 100110 and 10012 then it is much more clear,
tions as addition and multiplication was consid- that which family of number it belong to. As was
ered a great accomplishment in earlier civiliza- previously explained, the number 12510 actually
tions. means
5
digit. The only case in which this occurs with
binary numbers is when 1 is subtracted from 0.
111.1012 = (1 × 22 ) + (1 × 21 ) + (1 × 20 )
The remainder is 1, but it is necessary to borrow
+(1 × 2−1 ) + (0 × 2−2 ) + (1 × 2−3 )
1 from the next column to the left. The complete
set of binary subtraction is as following:
In general, the binary representation of Y
would be as:
0 − 0 = 0
Y = . . . + (d2 × 22 ) + (d1 × 21 ) + (d0 × 20 )
1 − 0 = 1
+(d−1 × 2−1 ) + (d−2 × 2−2 ) + . . .
1 − 1 = 0
and/or in more compact form Y can be repre-
0 − 1 = 1 with a borrow of 1
sented as:
Examples of binary addition of larger numbers
X
i
Y = (di × 10 ) (2) is given below:
i
1 1 0 . 0 12
0 + 0 = 0
− 1 0 0 . 12
0 + 1 = 1
_ _ _ _ _ _ _
1 + 0 = 1
1 . 1 12
1 + 1 = 0 plus a carry − over of 1
+ 1 1 02
_ _ _ _ 0 × 0 = 0
1 0 1 12 1 × 0 = 0
0 × 1 = 0
1 × 1 = 1
1 1 . 1 12
+ 1 1 . 1 02
_ _ _ _ _ _ In binary multiplication it is only necessary to
6
1 1 0 0
× 1 0 1 0
_ _ _ _ _ _ _
0 0 0 0
1 1 0 0
0 0 0 0
1 1 0 0
_ _ _ _ _ _ _
1 1 1 1 0 0 0
1 1 0 0 1 1 0
× 1 0 0 0
_ _ _ _ _ _ _ _ _ _
1 1 0 0 1 1 0 0 0 0
1 . 0 1
× 1 0 . 1
_ _ _ _ _ _
1 0 1
0 0 0
1 0 1
Figure 7: Binary division.
_ _ _ _ _ _
1 1 . 0 0 1
0 ÷ 1 = 0
1 ÷ 1 = 1 • Shift Y one bit to the right and go to step 2
in Figure 7.
7
125 ÷ 2 = 62 + remainder of 1 102 ÷ 2 = 51 + remainder of 0
62 ÷ 2 = 31 + remainder of 0 51 ÷ 2 = 25 + remainder of 1
31 ÷ 2 = 15 + remainder of 1 25 ÷ 2 = 12 + remainder of 1
15 ÷ 2 = 7 + remainder of 1 12 ÷ 2 = 6 + remainder of 0
7 ÷ 2 = 3 + remainder of 1 6 ÷ 2 = 3 + remainder of 0
3 ÷ 2 = 1 + remainder of 1 3 ÷ 2 = 1 + remainder of 1
1 ÷ 2 = 0 + remainder of 1 1 ÷ 2 = 0 + remainder of 1
Now the binary number is obtained from the So the binary representation for 10210 is
remainders in the division process such that the 11001102 . Now the fraction part 0.437510 has
remainder at the bottom will be the MSB of to converted into binary. Dierent methods can
the binary number and the remainder at the top be adopted but the most easiest and straight for-
would be the LSB of the primary number. By ward method is adopted here as illustrated below.
follwing this procedure the binary representation
of 12510 is, therefore, 11111012 . binary representation
The conversion of binary number 11111012 ob- 2 × 0.4375 = 0.8750 0.0
tained in the last example to a decimal is illus- 2 × 0.8750 = 1.750 0.01
trated as following: 2 × 0.750 = 1.50 0.011
2 × 0.50 = 1.0 0.0111
1 × 26 = 64
1 × 25 = 32 It can be seen in the above example that the
8
are present e.g. Binary-coded-decimal (BCD),
Excess-3 codes, Octal, and Hexadecimal num-
bers, are few examples.