BLOGGER TEMPLATES AND TWITTER BACKGROUNDS »

Tuesday 16 October 2012

the Binary System


Conversion of binary to ….
Decimal:

The steps to convert the binary numbers to the decimal:

  • ·        Use the bit of binary number one-by-one (starting with the most significant (leftmost) bit. Begin with the value 0
  • ·         Then , repeatedly double the prior value
  • ·         Add the next bit to produce the next value
  • ·         The next value is taken down as the prior value and multiply the 2 and also add the next bit.
  •         Eg:  102
  •     (0×2)+1=1(  1  = this  value is then taken down to multiply 2 and adding the second bit,0 )
  •     (1×2)+0=2
  •       The operation is repeated until the last bit
Eg:
Prior value




×2and +
Next bit
Next value
0
1
1
1
0
2
2
1
5
5
1
11
11
0
22
22
1
45
45
0
90

1011010=  90 10
Step 2:
Binary        1         0         1          1         0          1          0
Decimal   1×26   0×25   1×2   1×23    0×22    1×21    0×20   = 90

Eg 2:
Step 1:

11111012

Prior value





×2 and+
Next bit
Next value
0
1
1
1
1
3
3
1
7
7
1
15
15
1
31
31
0
62
62
1
125
    
11111012  = 125 10
Step 2:
Binary         1          1          1          1           1          0           1
Decimal    1×26   1×25    1×2   1×23      1×22     0×21     1×20    =125


:The  conversion of binary fraction  to decimal fraction=

Eg :
0.110102
Weight
...20
2-1
    2-2
    2-3
      2-4
      2-5
   
Value represented
… 1
 0.5
   0.25
    0.125
   0.0625
 0.03125
Binary
…0
1
      1
      0
      1
      0

Converting the binary fraction to decimal fraction:
Binary           1             1            0           1           0
Decimal     1×2-1      1×2-2      0×2-3    1×2-4     0×2-5
=0.5 +  0.25  + 0.0625
=0.8125 10
:: therefore , 0.110102   =   0.8125 10

Eg:
0.112
Weight
…20
     2-1
     2-2
     2-3
Value represented
…1
   0.5
   0.25
   0.125
Binary
…0
      1
     1
      0

Converting binary fraction to decimal fraction=
Binary            1                1
Decimal      1×2-1        1×2-2    =    0.5 + 0.25  =  0.75  10
:: therefore,    0.11 =    0.7510


Hexadecimal:

The following below is the Number System Conversion between hexadecimal and binary:
Hexadecimal
Binary
0

0000

1
0001
2
0010
3
0011
4
0100
5
0101
6
0110
7
0111
8
1000
9
1001
A
1010
B
1011
C
1100
D
1101
E
1110
F
1111


To convert binary to hexadecimal:
·        

  •       Grouped  the binary into 4
        For example :   1100 00112 =  1100   |   00112

  • ·         If the binary not enough to group into 4, then insert an extra 0 bit  on the left side of binary (called padding )
         For example :   11000112  =   0110    |   00112    (0 is the extra 0 bits inserted )

  • ·         After grouping the binary ,  according the Number System Conversion ,convert the binary into hexadecimal

Eg :
1100 00112
First step :Grouping the binary into 4
1100 00112   =  1100    |   00112
Second step : According to the Number System Conversion…
1100 00112  =  C316

Eg 2:
1011002
First step : Grouping the binary into 4
                     Since 1011002  is not enough to divide into 4 each ,therefore insert two extra
                     0 bits on the left side of binary.
1011002 =    0010   |  11002Second step :According to the Number System Conversion…
1011002 =3C16


Eg 3:
1011.112
First step :  Grouping the binary into 4
                     Since 0.112 is a decimal point therefore insert 2 0 bits on the right side of the
                     decimal point…
1011 .112 = 1011. |11002
Second step : According to the Number System Conversion between hexadecimal and       
                         the binary…

1011.112 =B.  C16


Octal:
It is easy to convert the binary into octal numeral system.
The steps to convert the binary into octal numeral system are:

  • ·         Grouping the binary into 3 each
         For example: 1100112   =   110   |    0112

  • ·         Likes the hexadecimal , if there isn't enough  to group the binary into 3,then insert an extra 0 bit on the left side of the binary . This process is called padding.
        For example: 100112   =    010   |  0112 ( 0 is the extra 0 bit inserted)

  • ·         Then according to the table as below:

        Number System conversion between octal and binary:

Octal
Binary
0
000
1
001
2
010
3
011
4
100
5
101
6
110
7
111


Eg:
110 0112

1.       Grouping the binary into 3:

110 0112   =    110 | 0112
2.       According to the table above:

110  =  6 ;    011  = 3;
 So, 110 0112  =  638
        

 Apart of that , there is also a way to convert binary to octal :


Eg 2:
1.       Grouping the binary into 3 :

110 0112  =   110   |   0112
2.       Convert the binary by using 2n system:

110 = (1×22) + (1×21) + (0 ×20)          |       011= (0×22) + (1×21) + (1×20)
        =4+2+0                                          |              = 0 + 2 + 1
        =6                                                   |            =3

Therefore,

110 0112 = 638


 Eg 3:
                 10 0112
1.       Grouping the binary into 3… but this binary is not enough to group into 3 so we have to insert an extra 0 bit at the left side of this binary…

10 0112    =   010  | 0112 ( 0 is the extra 0 bit inserted )
2.       Then, convert the binary into octal either according to the Number System Conversion between octal and binary or by using the 2n system…

Method 1: According to Number System Conversion between octal and binary
010 = 2               |        011 =3
Therefore,
10 0112   =   238

Method 2 :By using 2n system           |

010 = (0×22) + ( 1×21) + (0×20)           |       011= ( 0×22) + (1×21) + (1×20)
        =2                                                   |               =2+1
                                                                                                         =3
                        10 0112 = 238

Eg 4:
                   100011.112
                   1. Grouping the binary into 3…
                        100011.112 = 100 | 011. |1102
                   2.By using 2n system
           100=  (1×22) + (0×21) + (0×20)  | 011=(0×22) +(1×21) +(1×20) .| 110= (1×22)+(1×21)+(0×20)  
                 = 4 +0 +0                               |        =0 + 2 +1                            |        =4 + 2 +0
                 = 4                                         |         = 3                                       |       =6
                  100011.112  =  43 .6 8

-Cai Ning 

0 comments: