Every Computer store numbers, letters, and other special
characters in a coded form. Before going into the details of these codes, it is
essential to have a basic understanding of number system. This topic also
introduces some of commonly used number system by computer professionals and
the relationship between them.
Binary
Number System-
The Binary number system is exactly like the decimal
system except that the base is 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 then base). Again, each position in a binary number
represents a power of the base (2). As such, in this system, the rightmost
position is the unit’s position, the second position from the right Is the
s (
) position and proceeding in this way we have 4’s
position, 8’s
position, 16’s
position, and so on. Thus, the decimal equivalent of
the binary number 10101 written a
is
Or 16+0+4+0+1
Or 21
In order to be specific about which system we are referring to, it is common practice to indicate the base as subscript. Thus we write
Binary digit is often referred to by the common abbreviation
bit. A binary number consisting of n bits is called an n-bit number. Table 1-1
lists all the 3bit numbers along with their decimal equivalent.
3 bit numbers with their Decimal values.
Binary |
Decimal
Equivalent |
000 |
0 |
001 |
1 |
010 |
2 |
011 |
3 |
100 |
4 |
101 |
5 |
110 |
6 |
111 |
7 |
Remember that we have only two digit, o and 1, in the
binary system, and hence the binary equivalent of the decimal number 2 has to
be stated as 10 (read as one, zero). It may be seen that a 3-bit number can
have one of the 8 values. In fact. It can be shown that any decimal number in
the range can be represented in the binary form as an n-bit
number.
Octal Number System –
In the Octal number system the base is 8. So in this
system there are only eight symbol or digits: 0,1,2,3,4,5,6,7. Here also the
largest single digit is 7 (one less than the base). Again each position in an
octal number represents a power of the base (8). Thus the decimal equivalent of
the octal number 2057 written as is:
Or 1024+0+40+7
Or 1071
So we have
Observe that since there are only 8 digits in the
octal number system, so 3 bits 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 16 suggests choices of 16 single character digits or symbols. The first
10 digit are the digit of decimal system 0,1,2,3,4,5,6,7,8,9. The remaining six
digits are denoted by A,B,C,D,E,F representing the decimal values 10,11,12,13,14,15
receptively. Therefore, the letters A through F are number digits in
hexadecimal number system. Thus largest single digit is F or 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 is :
Or (1*256)+(10*16)+(15*1)
Or 256+160+15
Or 431
Thus
Since there are only 16 digit in the hexadecimal
number system, so 4 bit are sufficient to represent any hexadecimal number in
binary.
Check also - DBMS Management System in hindi
Converting from one number system to another
Number expressed in decimal are much meaningful to us
than are values expressed in any other number system. However, any number value
in one number system can be represented in any other number system. Because the
input and the final output values are to be in decimal, so we are required to
convert number system in other system to decimal and vice-versa. There are many
methods or techniques that can be used to convert number from one base to
another.
Converting to Decimal number system from another
number system – the following
three steps are used to convert to a base 10 value from any other number
system:
Step 1- Determine the column (positional) value of
each digit (this depends on the position of the digit and the base of the
number system).
Step 2- Multiply the obtained column values in step 1
by the digits in the corresponding column.
Step 3- sum the products calculated in step 2. The total
is the equivalent value in decimal.
Solution
Step 1- Determine column values.
Column number |
Column value (from right) |
1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
Step 2- multiple column value by corresponding column
digits.
16 8 4 2 1
*1
*1 *0 *0 *1
16 8
0 0 1
Step 3- Sum the product
16+8+0+0+1=25
Example 2 -
Solution
Step 1-
Column number |
Column value (from right) |
1 |
|
2 |
|
3 |
|
4 |
|
Step 2- multiple column value by corresponding column digits.
*4 *7 *0 *6
2048 448 0 6
Step 3- Sum the product
2048+448+0+6=2502
Example 3-
Solution –
Converting from base 10 to a
new base (Division – remainder technique)
following four step are used to convert a number from base 10 to a new base-
Step 1- Divide the decimal
number to be converted by the value of the new base:
Step 2- Record the remainder
from step 1 as the rightmost digit of the new base
number.
Step 3- Divide the quotient
of the previous divide by the new base.
Step 4- Record the remainder
from step 3 as the next digit of the new base
number.
Repeat step 3 and 4
recording remainder from right to left, until the quotient
Becomes zero in step 3. Note
that the last remainder thus obtained will be the
most significant digit of
the new base number.
Example 1.
Solution :
Step 1 & 2: 25/2 =12 and remainder 1
Step 3 & 4: 12/2 =6 and remainder 0
Step 3 & 4: 6/2 = 3 and remainder 0
Step 3 & 4: 3/2 =1 and remainder 1
Step 3 & 4: 1/2 = 0 and remainder 1
Example 2.
Solution: 2 42 remainder
2 21 0
2 10 1
2 5
0
2 2 1
2 1 0
0 1
Example 3.
Solution: 8 952 remainder
8 119 0
8 14 7
8 1
6
0 1
Example 4.
Solution: 16 428 12 = C remainder
16 26 10 = A
16
1 1
0
Example 5.
Solution: 5 100 0 remainder
5 20
0
5
4 4
0
Converting from a base other
than 10 to a base other then 10.
The following two step are used to convert a number
from a base other than 10 to a base other than 10.
Step 1. Convert the original number to a decimal
Step 2. Convert the decimal number so obtained to the
new base
Solution- Step 1. Convert from base 6 to a base 10
4 209
1 remainder
4 52 0
4 13
1
4 3 3
0
Shortcut method for Binary
to Octal Conversion.
Step- 1. Divide the binary
digits into groups of three (staring from the right)
Step- 2. Convert each group of tree binary digit into
one octal digit. Since there are only digits (0 to 7) in the octal number
system, so 3 bits are sufficient to represent any octal number in binary.
Step- 1. Divide the binary
digits into groups of three (staring from the right)
Step- 2. Convert each group of tree binary digit into
one octal digit. Since there are only digits (0 to 7) in the octal number
system, so 3 bits are sufficient to represent any octal number in binary.
Step 1. Divide
the binary digits into group of 3 starting from right
101 110
Step 2. Convert
each group into one digit of octal (use binary to decimal conversion)
Shortcut method for Octal to
Binary Conversion.
Step 1. Convert
each octal digit to a 3 digit binary number
Step 2. Combine
all the resulting binary group into a single binary number.
Example 1-
Solution –
Step 1. Convert
each octal digit to 3 binary digits.
Step 2. Combine
the binary group
Shortcut method for Binary
to Hexadecimal Conversion.
Step 1. Divide
the binary digits into group of four (staring from the right)
Step 2. Convert
each group of four binary digits to one Hexadecimal digit. Remember that
Hexadecimal digits 0 to 9 are equal to decimal digit 0 to 9, and hexadecimal
digits A to F are equal to decimal digits 10 to 15.
Example 1-
Solution –
Step 1. Divide
the binary digit into groups of 4.
1101 0011
Step 2. Convert
each group of 4 binary digits to 1 hexadecimal digit.
Shortcut method for Hexadecimal to Binary Conversion.
Step 1. Convert
the decimal equivalent to each Hexadecimal digit to 4 binary digit.
Step 2. Combine all the resulting binary group (of 4 digit each into a single binary number)
Example 1
Solution –
Step 1. Convert the decimal equivalent to each Hexadecimal digit to 4 binary digit.
Step 2. Combine all the resulting binary group
Fractional number.
In binary number system, fractional numbers are formed in the same general way as in the decimal system. Just as in the decimal system.
0 comments:
Post a Comment