We have seen that inside a computer, data is stored in a format that cannot be easily read by human beings. This is why I/O interfaces are required. Every computer stored numbers, letters and other special characters in a coded form. Before going into the details of the codes we must understand the number system.
Number system is of two types
- Positional
- non-positional
Non positional number system
In early days, human beings counted on fingers were not adequate, stone s, pebbles or sticks were used to indicate values. This method used an additive approach or the non-positional number system. In this approach we have symbols such as I for 1, II for 2, IIIII for 5 etc. Each symbol represents the same value regardless of its position in the number and the symbols are simply added to find out the value of a particular number. Since it is very difficult to perform arithmetic with such a number system, positional number systems were developed.
Positional number systems
In positional number system, there are only a few symbols called digits, and these symbols represent different values depending on the position they occupy in the number. The value of each digit in such a number is determined by three considerations
- the digit itself
- the position of the digit in the number
- The base of the number system (where base is defined as the total number of digits available in the number system).
The number system that we use in our daily life is called decimal number system. In this system, the base is equal to 10 because there are altogether 10 symbols 0,1,2,3,4,5,6,7,8,9 used in the system.
Binary number system
The binary number system is exactly like the decimal system
except that the base is 2 instead of 10. We have only two symbols or digits 0
and 1 that can be used in this number system. Note that the largest single
digit is 1 (one less than the base). Again, each position in a binary number
represents a power of the base (2). Ass system, the rightmost position is the
units (20) position, the second position from the right is the 2's
(21) position and proceeding in this way we have 4's (22),
8's (23) position, 16's (24) position, and so on. Thus
the decimal equivalent of binary number 10101 (written as 101012) is
(1 x 24) + (0 x 23) +(1 x 22)
+(0 x 21) +(1 x 20) = 16 + 0 + 4 + 0 +1 =21
In order to be specific about which system we are referring
to, it is common practice to indicate the base as a subscript. Thus we write:
101012= 2110
Binary digit or bit
"Binary digit" is often referred to by the common
abbreviation "bit”. Thus, a bit in computer terminology means either a 0
or a 1. A binary number consisting of n bit is called an n-bit number. Following
Table lists all the 3-bit numbers of along with their decimal equivalent. It
may be seen that a 3-nit number can have one of the 8 values ranging from 0 to
7. In fact it can be shown that any decimal number in the range of 0 to 2n
- 1 can be represented in the binary form as an n-bit number.
Binary | Decimal |
000 | 0 |
001 | 1 |
010 | 2 |
011 | 3 |
100 | 4 |
101 | 5 |
110 | 6 |
111 | 7 |
3-bit number with their decimal values
Every computer stores numbers, letters and other special characters in binary form. There are several occasions when computer professionals have to know the raw data contained in a computer’s memory. A common way of looking at the contents of a computer’s memory is to print out the memory contents on the line printer. This is called as memory dump. Because of the quantity of printout that would be required in a memory dump of binary digits and the lack of digit variety (0 and 1 only) two number system are used as short cut notation.
- octal
- hexa decimal
Octal number system
In the octal number system the base is 8. So in this system
there are only eight symbols or digits:0,1,2,3,4,5,6,7 (8 and 9 do not exist in
this system). Here the largest digit is 7. Each position in an octal number
represents a power of the base (8). Thus the decimal equivalent of the octal
number 2057 (written as 2057) is:
(2 x 83) + (0 x 82) +(5 x 81)
+(7 x 80) =1024 + 0 + 40 + 7 =1071
So we have,
20578= 1071110
You can see that since there are only 8 digits in the octal
number system, so 3 bits (23 = 8) are sufficient to represent any octal number
in binary.
Hexadecimal number system
The hexadecimal number system is one with a base of 16. The
base of 16 suggests choices of 16 symbols or character digits. The first 10 are
the digits from 0 to 9 i.e. 0,1,2,3,4,5,6,7,8,9. The remaining six digits are
denoted by A, B, C, D, E, F representing 10, 11, 12, 13, 14, 15 respectively.
In the hexadecimal number system, therefore, the letter A has a decimal
equivalent value of 10 and the hexadecimal F has a decimal equivalent value of
15. The largest single digit is F (15). Again, each position in a hexadecimal
system represents a power of the base (16). Thus the decimal equivalent of the
hexadecimal number 1AF (written as (1AF16) is:
=(1 x 162) + (A x 161) +(F x 160)
= (1 x 256) + (10 x 16) +(15 x 1)
=256 + 160 + 15 =431
Thus, 1AF16=431110
Since there are only 16 digits in the hexadecimal number
system, so 4 bits (24 =16) are sufficient to represent any
hexadecimal number in binary.
0 comments:
Post a Comment