Friday 2 September 2011

Introduction to Number Systems

1.2 Introduction to Number Systems :

                  We will begin our discussion on various number systems by briefly describing the parameters that are common to all number systems. An understanding of these parameters and their relevance to number systems is fundamental to the understanding of how various systems operate. Different characteristics that define a number system include the number of independent digits used in the number system, the place values of the different digits constituting the number and the maximum numbers that can
be written with the given number of digits. Among the three characteristic parameters, the most
fundamental is the number of independent digits or symbols used in the number system. It is known as
the radix or base of the number system. The decimal number system with which we are all so familiar
can be said to have a radix of 10 as it has 10 independent digits, i.e. 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9.
Similarly, the binary number system with only two independent digits, 0 and 1, is a radix-2 number
system. The octal and hexadecimal number systems have a radix (or base) of 8 and 16 respectively.
We will see in the following sections that the radix of the number system also determines the other
two characteristics. The place values of different digits in the integer part of the number are given by
r0, r1, r2, r3 and so on, starting with the digit adjacent to the radix point. For the fractional part, these
are r−1, r−2, r−3 and so on, again starting with the digit next to the radix point. Here, r is the radix
of the number system. Also, maximum numbers that can be written with n digits in a given number
system are equal to rn.
 
1.3 Decimal Number System :

                The decimal number system is a radix-10 number system and therefore has 10 different digits or
symbols. These are 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9. All higher numbers after ‘9’ are represented in terms
of these 10 digits only. The process of writing higher-order numbers after ‘9’ consists in writing the
second digit (i.e. ‘1’) first, followed by the other digits, one by one, to obtain the next 10 numbers
from ‘10’ to ‘19’. The next 10 numbers from ‘20’ to ‘29’ are obtained by writing the third digit (i.e.
‘2’) first, followed by digits ‘0’ to ‘9’, one by one. The process continues until we have exhausted all
possible two-digit combinations and reached ‘99’. Then we begin with three-digit combinations. The
first three-digit number consists of the lowest two-digit number followed by ‘0’ (i.e. 100), and the
process goes on endlessly.
The place values of different digits in a mixed decimal number, starting from the decimal point, are
100, 101, 102 and so on (for the integer part) and 10−1, 10−2, 10−3 and so on (for the fractional part).
Number Systems 3
The value or magnitude of a given decimal number can be expressed as the sum of the various digits
multiplied by their place values or weights.
As an illustration, in the case of the decimal number 3586.265, the integer part (i.e. 3586) can be
expressed as
3586 = 6×100 +8×101+5×102 +3×103 = 6+80+500+3000 = 3586
and the fractional part can be expressed as
265 = 2×10−1+6×10−2 +5×10−3 = 02+006+0005 = 0265
We have seen that the place values are a function of the radix of the concerned number system and
the position of the digits. We will also discover in subsequent sections that the concept of each digit
having a place value depending upon the position of the digit and the radix of the number system is
equally valid for the other more relevant number systems.

1.4 Binary Number System :
                 The binary number system is a radix-2 number system with ‘0’ and ‘1’ as the two independent digits.
All larger binary numbers are represented in terms of ‘0’ and ‘1’. The procedure for writing higherorder
binary numbers after ‘1’ is similar to the one explained in the case of the decimal number system.
For example, the first 16 numbers in the binary number system would be 0, 1, 10, 11, 100, 101, 110,
111, 1000, 1001, 1010, 1011, 1100, 1101, 1110 and 1111. The next number after 1111 is 10000, which
is the lowest binary number with five digits. This also proves the point made earlier that a maximum
of only 16 (= 24 numbers could be written with four digits. Starting from the binary point, the place
values of different digits in a mixed binary number are 20, 21, 22 and so on (for the integer part) and
2−1, 2−2, 2−3 and so on (for the fractional part).
 
Example 1.1
Consider an arbitrary number system with the independent digits as 0, 1 and X. What is the radix of
this number system? List the first 10 numbers in this number system.
Solution
• The radix of the proposed number system is 3.
• The first 10 numbers in this number system would be 0, 1, X, 10, 11, 1X, X0, X1, XX and 100.
1.4.1 Advantages
Logic operations are the backbone of any digital computer, although solving a problem on computer
could involve an arithmetic operation too. The introduction of the mathematics of logic by George
Boole laid the foundation for the modern digital computer. He reduced the mathematics of logic to a
binary notation of ‘0’ and ‘1’. As the mathematics of logic was well established and had proved itself
to be quite useful in solving all kinds of logical problem, and also as the mathematics of logic (also
known as Boolean algebra) had been reduced to a binary notation, the binary number system had a
clear edge over other number systems for use in computer systems. Yet another significant advantage of this number system was that all kinds of data could be conveniently represented in terms of 0s and 1s. Also, basic electronic devices used for hardware implementation could be conveniently and efficiently operated in two distinctly different modes. For example, a bipolar transistor could be operated either in cut-off or in saturation very efficiently. Lastly, the circuits required for performing arithmetic operations such as addition, subtraction, multiplication, division, etc., become a simple affair when the data involved are represented in the form of 0s and 1s.
1.5 Octal Number System :
 
         The octal number system has a radix of 8 and therefore has eight distinct digits. All higher-order
numbers are expressed as a combination of these on the same pattern as the one followed in the case
of the binary and decimal number systems described in Sections 1.3 and 1.4. The independent digits
are 0, 1, 2, 3, 4, 5, 6 and 7. The next 10 numbers that follow ‘7’, for example, would be 10, 11, 12,
13, 14, 15, 16, 17, 20 and 21. In fact, if we omit all the numbers containing the digits 8 or 9, or both,
from the decimal number system, we end up with an octal number system. The place values for the
different digits in the octal number system are 80, 81, 82 and so on (for the integer part) and 8−1, 8−2,
8−3 and so on (for the fractional part).
 
1.6 Hexadecimal Number System :
 
          The hexadecimal number system is a radix-16 number system and its 16 basic digits are 0, 1, 2, 3,
4, 5, 6, 7, 8, 9, A, B, C, D, E and F. The place values or weights of different digits in a mixed
hexadecimal number are 160, 161, 162 and so on (for the integer part) and 16−1, 16−2, 16−3 and so on
(for the fractional part). The decimal equivalent of A, B, C, D, E and F are 10, 11, 12, 13, 14 and 15
respectively, for obvious reasons.
The hexadecimal number system provides a condensed way of representing large binary numbers
stored and processed inside the computer. One such example is in representing addresses of different
memory locations. Let us assume that a machine has 64K of memory. Such a memory has 64K (= 216
= 65 536) memory locations and needs 65 536 different addresses. These addresses can be designated
as 0 to 65 535 in the decimal number system and 00000000 00000000 to 11111111 11111111 in the
binary number system. The decimal number system is not used in computers and the binary notation
here appears too cumbersome and inconvenient to handle. In the hexadecimal number system, 65 536
different addresses can be expressed with four digits from 0000 to FFFF. Similarly, the contents of the
memory when represented in hexadecimal form are very convenient to handle.
 
1.7 Number Systems – Some Common Terms
In this section we will describe some commonly used terms with reference to different number systems.
 
1.7.1 Binary Number System
Bit is an abbreviation of the term ‘binary digit’ and is the smallest unit of information. It is either ‘0’
or ‘1’. A byte is a string of eight bits. The byte is the basic unit of data operated upon as a single unit
in computers. A computer word is again a string of bits whose size, called the ‘word length’ or ‘word
size’, is fixed for a specified computer, although it may vary from computer to computer. The word
length may equal one byte, two bytes, four bytes or be even larger.
Number Systems 5
The 1’s complement of a binary number is obtained by complementing all its bits, i.e. by replacing
0s with 1s and 1s with 0s. For example, the 1’s complement of (10010110)2 is (01101001)2. The 2’s
complement of a binary number is obtained by adding ‘1’ to its 1’s complement. The 2’s complement
of (10010110)2 is (01101010)2.
 
1.7.2 Decimal Number System
Corresponding to the 1’s and 2’s complements in the binary system, in the decimal number system we
have the 9’s and 10’s complements. The 9’s complement of a given decimal number is obtained by
subtracting each digit from 9. For example, the 9’s complement of (2496)10 would be (7503)10. The
10’s complement is obtained by adding ‘1’ to the 9’s complement. The 10’s complement of (2496)10
is (7504)10.
 
1.7.3 Octal Number System
In the octal number system, we have the 7’s and 8’s complements. The 7’s complement of a given
octal number is obtained by subtracting each octal digit from 7. For example, the 7’s complement of
(562)8 would be (215)8. The 8’s complement is obtained by adding ‘1’ to the 7’s complement. The 8’s
complement of (562)8 would be (216)8.
 
1.7.4 Hexadecimal Number System
The 15’s and 16’s complements are defined with respect to the hexadecimal number system. The 15’s
complement is obtained by subtracting each hex digit from 15. For example, the 15’s complement of
(3BF)16 would be (C40)16. The 16’s complement is obtained by adding ‘1’ to the 15’s complement.
The 16’s complement of (2AE)16 would be (D52)16.

No comments:

Post a Comment

Newest