Binary Conversion

DU

Binary Conversioniit

IIT, DU , Dhaka University IIT

kkkk

 

 

 


DECIMAL (BASE 10) TO BINARY (BASE 2)


Example 01: Convert the 1310 into ?2 base number.
Answer:

2|13                        .

    2|6      –   1              .

         2|3      –   0              .

               2|1      –   1              .

= 1101

1310 = 11012


Example 02: Convert the 9110 into ?2  base number.

Answer:

2|91                        .

    2|45      –   1              .

         2|22      –   1              .

               2|11      –   0              .

                    2|5      –   1              .

                          2|2      –  1              .

                                2| 1     –   0              .

= 1011011

9110 = 10110112


Example 03: Convert the 10110 into ?2  base number.

Answer:

2|101                        .

    2|50      –   1              .

         2|25      –   0              .

               2|12      –   1              .

                    2|6      –   0              .

                          2|3      –  0              .

                                2| 1     –   1              .

= 1100101

10110 = 11001012


Example 04: Convert the 22410 into ?2 base number.

Answer:

2|224                        .

    2|112      –   0              .

         2|56      –   0              .

               2|28      –   0              .

                    2|14      –   0              .

                          2|7      –  0              .

                                2|3      –   1              .

                                    2|1      –   1              .

= 11100000

22410 = 111000002


Example 05: Convert the 12110 into ?2  base number.

Answer:

2|121                        .

2|60      –   1              .

2|30      –   0              .

2|15      –   0              .

2|7      –   1              .

2|3      –  1              .

2| 1     –   1              .

= 1111001

12110 = 11110012


Example 6: Convert the 2710 into ?2  base number.

Answer:

2|27                        .

2|13      –   1              .

2|6      –   1              .

2|3      –   0              .

2|1      –   1              .

= 11011

2710 = 110112


BINARY (BASE 2) TO DECIMAL (BASE 10)


Example 07: Convert the 101012 into ?10 base number.

Answer:

101012  = (1×24)  + (0x23) + (1×22) + (0x21) + (1×20)

= (1 x 16) + (0 x 8) + (1 x 4) + (0 x 2) + (1 x 1)

= 16 + 0 +4 +0 +1

= 2110

Answer: 101012  = 2110


Example 08: Convert the 11101012 into ?10 base number.

Answer:

11101012  = (1×26)  + (1×25)  + (1×24)  + (0x23) + (1×22) + (0x21) + (1×20)

= (1 x 64) + (1 x 32) + (1 x 16) + (0 x 8) + (1 x 4) + (0 x 2) + (1 x 1)

= 64 + 32 + 16 + 0 + 4 + 0 + 1

= 11710

Answer: 101012  = 2110


Example 09: Convert the 11101012 into ?10 base number.

Answer:

11101012  = (1×26)  + (1×25)  + (1×24)  + (0x23) + (1×22) + (0x21) + (1×20)

= (1 x 64) + (1 x 32) + (1 x 16) + (0 x 8) + (1 x 4) + (0 x 2) + (1 x 1)

= 64 + 32 + 16 + 0 + 4 + 0 + 1

= 11710

Answer: 101012  = 2110


Example 10: Convert the 11010101012 into ?10 base number.

Answer:

11010101012  = (1×29)    + (1×28)     + (0x27)    + (1×26)  + (0x25)  + (1×24)  + (0x23) + (1×22) + (0x21) + (1×20)

= (1 x 512) + (1 x 256) + (0 x 128) + (1 x 64) + (0 x 32) + (1 x 16) + (0 x 8) + (1 x 4) + (0 x 2) + (1 x 1)

= 512 + 256  + 0 + 64 + 0 + 16 + 0 + 4 + 0 + 1

= 85310

Answer: 11010101012  = 85310


BINARY (BASE 4) TO DECIMAL (BASE 10)


Example 11: Convert the 10104 into ?10 base number.

Answer:

10104  =  (1×43) + (0x42) + (1×41) + (0x40)

= (1 x 64) + (0 x 16) + (1 x 4) + (0 x 1)

= 64 +0 +4 +0

= 6810

Answer: 10104  = 6410 


Example 12: Convert the 110014 into ?10 base number.

Answer:

110014  = (1×44)  + (1×43) + (0x42) + (0x41) + (1×40)

= (1 x 256) + (1 x 64) + (0 x 16) + (0 x 4) + (1 x 1)

= 256 + 64 +0 +0 +1

= 32110

Answer: 110014  = 32110


Example 13: Convert the 111114 into ?10 base number.

Answer:

111114  = (1×44)  + (1×43) + (1×42) + (1×41) + (1×40)

= (1 x 256) + (1 x 64) + (1 x 16) + (1 x 4) + (1 x 1)

= 256 + 64 +16 +4 +1

= 34110

Answer: 110014  = 34110


Example 14: Convert the 10101014 into ?10 base number.

Answer:

10101014  = (    1×46     ) + (    0x45    )  + (   1×4) + (  0x43 ) + (  1×42 ) + (0x41)  + (1×40)

= (1 x 4096) + (0 x 1024) + (1 x 256) + (0 x 64) + (1 x 16) + (0 x 4)  + (1 x 1)

= 4096 + 0 +256 +0 +16+0+1

= 436910

Answer: 10101014  = 436910


BINARY (BASE 8) TO DECIMAL (BASE 10)


Example 15: Convert the 10108 into ?10 base number.

Answer:

10108  =  (   1×83    ) + ( 0x8)  + (1×81) + (0x80)

= (1 x 512) + (0 x 64) + (1 x 8) + (0 x 1)

= 512 +0 +8 +0

= 52010

Answer: 10108  = 52010 


Example 16: Convert the 110018 into ?10 base number.

Answer:

110018  = (    1×84    ) + (   1×83   ) + (  0x8) + (0x81) + (1×80)

= (1 x 4096) + (1 x 512) + (0 x 64) + (0 x 8) + (1 x 1)

= 4096 + 512 +0 +0 +1

= 460910

Answer: 110018  = 460910


Example 17: Convert the 111118 into ?10 base number.

Answer:

111118  = (    1×84    ) + (   1×83   ) + (  1×8) + (1×81) + (1×80)

= (1 x 4096) + (1 x 512) + (1 x 64) + (1 x 8) + (1 x 1)

= 4096 + 512 +64 +8 +1

= 468110

Answer: 110018  = 468110


Example 18: Convert the 10101018 into ?10 base number.

Answer:

10101018  = (       1×86       ) + (     0x85       )  + (   1×84     ) + (   0x83   ) + ( 1×82   ) + (0x81)  + (1×80)

= (1 x 262144) + (0 x 32768) + (1 x 4096) + (0 x 512) + (1 x 64) + (0 x 8)  + (1 x 1)

= 262144 + 0 +4096 +0 +64+0+1

= 26630510

Answer: 10101018  = 26630510


BINARY (BASE 16) TO DECIMAL (BASE 10)


Example 19: Convert the 101016 into ?10 base number.

Answer:

101016  = (   1×163    ) + ( 0x16) + (1×161) + (0x160)

= (1 x 4096) + (0 x 256) + (1 x 16) + (0 x 1)

= 4096 +0 +16 +0

= 411210

Answer: 101016  = 411210 


Example 20: Convert the 1100116 into ?10  base number.

Answer:

1100116  = (   1×164    ) + (   1×163   ) + ( 0x16) + (0x161) + (1×160)

= (1 x 65536) + (1 x 4096) + (0 x 256) + (0 x 16) + (1 x 1)

= 65536 + 4096 +0 +0 +1

= 6963310

Answer: 1100116  = 6963310


Example 21: Convert the 1111116 into ?10  base number.

Answer:

1111116  = (   1×164    ) + (  1×163    ) + ( 1×16)  + (1×161) + (1×160)

= (1 x 65536) + (1 x 4096) + (1 x 256) + (1 x 16) + (1 x 1)

= 65536 + 4096 +256 +16 +1

= 6990510

Answer: 1100116  = 6990510


Example 22: Convert the 101010116 into ?10  base number.

Answer:

10101018  = (        1×166         ) + (       0x165        )  + (   1×164     ) + (   0x163   ) + ( 1×162   ) + (0x161)  + (1×160)

= (1 x 16777216) + (0 x 1048576) + (1 x 65536) + (0 x 4096) + (1 x 256) + (0 x 16)  + (1 x 1)

= 16777216 + 0 +65536 +0 +256+0+1

= 1684300910

Answer: 101010116  = 1684300910


DECIMAL (BASE 10) TO NUMBER (BASE 4)


Example 23: Convert the 4610 into ?4 base number.

Checking:

2324= (2×42) + (3 x 41) +(2 x 40)

=  (2×16) +(3×4)+(2×1)

=  32 + 12 + 2

=  46

Answer:

4|46                        .

4|11      –   2              .

4|2      –   3              .

0      –   2

= 232

4610 = 2324 


Example 24: Convert the 9110 into ?4 base number.

Checking:

11238 = (1×43) + (1×42) + (2 x 41) +(3 x 40)

=  (1×64) +(1×16)+(2×4)+ (3×1)

=  64 + 16 + 8  + 3

=  91

Answer:

4|91                        .

4|22      –   3              .

4| 5       –   2              .

4| 1       –   1              .

0      –   1

= 1123

9110 = 11238


Example 25: Convert the 10110 into ?4 base number.

Checking:

12114 = (1×43) + (2×42) + (1 x 41) +(1 x 40)

=  (1×64) +(2×16)+(1×4)+ (1×1)

=  64 + 32 + 4  + 1

=  101

Answer:

4|101                        .

4|25      –   1              .

4| 6       –   1              .

4| 1       –   2              .

0      –   1

= 1211

10110 = 12114


Example 26: Convert the 95210 into ?4 base number.

Checking:

323204 = (3×44) +(2×43) + (3×42) + (2 x 41) +(0 x 40)

=  (1×256) +(2×64)+(3×16)+ (2×4)+(0x1)

=  768 + 128 + 48  + 8 + 0

=  952

Answer:

4|952                        .

4|238     –   0              .

4|59      –    2              .

4|14     –   3              .

4|3     –   2              .

0     –   3.

= 32320

95210 = 323204


DECIMAL (BASE 10) TO NUMBER (BASE 8)


Example 27: Convert the 4610 into ?8 base number.

Checking:

568  = (5 x 81) +(6 x 80)

=  (5×8) +(6×1)

=  40 + 6

=  46

Answer:

8|46                        .

8|5      –   6              .

0      –   5

= 56

4610 = 568 


Example 28: Convert the 9110 into ?8 base number.

Checking:

1338= (1 x 82) +(3 x 81) +(3 x 80)

=  (1×64) +(3×8) + (3×1)

=  64 + 24 + 3

=  91

Answer:

8|91                        .

8|11      –   3              .

2| 1       –   3              .

0      –   1

= 133

9110 = 1338


Example 29: Convert the 10110 into ?8 base number.

Checking:

1458= (1 x 82) +(4 x 81) +(5 x 80)

=  (1×64) +(4×8) + (5×1)

=  64 + 32 + 5

=  101

Answer:

8|101                        .

8|12      –   5              .

8| 1       –   4              .

0      –   1

= 145

10110 = 1458


Example 30: Convert the 95210 into ?8 base number.

Checking:

16708 = (1 x 83) +(6 x 82) +(7 x 81) + (0x80)

=  (1×512) +(6×64) + (7×8) + (0x1)

=  512 + 384 + 56 + 0

=  952

Answer:

8|952                        .

8|119     –   0              .

8|14      –    7              .

8|1     –   6              .

0     –   1.

= 1670

95210 = 16708


DECIMAL (BASE 10) TO NUMBER (BASE 16) 


Example 27: Convert the 4610 into ?16 base number.

Checking:

2E16    = (2 x 161) +(E x 160)

=  (2×16) +(14×1)

=  32 + 14

=  46

Answer:

16|46                        .

16|2      –   14       (E)       .

0       –   2

= 2E                                   [ E = 14 ]

4610 = 2E16

 


Example 28: Convert the 9110 into ?16 base number.

Checking:

5B16 = (5 x 161) +(B x 160)

=  (5×16) + (11×1)

=  80 + 11

=  91

Answer:

16|91                        .

16|5      –   11    (B)         .

0      –   5

= 5B

9110 = 5B16


Example 29: Convert the 10110 into ?16 base number.

Checking:

6516 = (6 x 161) +(5 x 160)

=  (6×16) + (5×1)

=  96 + 5

=  101

Answer:

16|101                        .

16|6      –   5              .

0      –   6

= 65

10110 = 6516


Example 30: Convert the 95210 into ?16 base number.

Checking:

1670  = (1 x 83) +(6 x 82) +(7 x 81) + (0x80)

=  (1×512) +(6×64) + (7×8) + (0x1)

=  512 + 384 + 56 + 0

=  952

Answer:

16|952                        .

16|119     –   0              .

16|14      –    7              .

8|1     –   6              .

0     –   1.

= 1670

95210 = 16708


Example 31: Convert 1100112 = ?8 base number.

Answer:

Step 1: Divide the binary number into groups containing 3 elements from right.

110                  011

Step 2: Convert each group into one octal digit

110= (1×22) +(1×21)+ (0x20) = 4+2+0 =6

011= (0x22) +(1×21)+ (1×20) = 0+2+1 =3

Hence 1100112 = 638 


 Example 32: Convert 11010102 = ?8 base number.

Answer:

Step 1: Divide the binary number into groups containing 3 starting from right.

001                  101                  010

Step 2: Convert each group into octal digit

001= (0x22) +(0x21)+ (1×20) = 0+0+1 =1

101= (1×22) +(0x21)+ (1×20) = 4+0+1 =5

010= (0x22) +(1×21)+ (0x20) = 0+2+0 =2

Hence 11010102 = 1528


Example 33: Convert 1101101102 = ?8 base number.

Answer:

Step 1: Divide the binary number into groups containing 3 starting from right.

110                  110                  110

Step 2: Convert each group into octal digit

110= (1×22) +(1×21)+ (0x20) = 4+2+0 =6

110= (1×22) +(1×21)+ (0x20) = 4+2+0 =6

110= (1×22) +(1×21)+ (0x20) = 4+2+0 =6

Hence 1101101102 = 6668


 Example 34: Convert 1100112 = ?16 base number.

Answer:

Step 1: Divide the binary number into groups containing 4 starting from right.

0011                0011

Step 2: Convert each group into hexadecimal digit

0011= (0x23) + (0x22) +(1×21)+ (1×20) = 0+0+2+1 = 3

0011= (0x23) + (0x22) +(1×21)+ (1×20) = 0+0+2+1 = 3

Hence 1100112 = 3316 


Example 32: Convert 1111012 = ?16 base number.

Answer:

Step 1: Divide the binary number into groups containing 4 starting from right.

0011                1101

Step 2: Convert each group into hexadecimal digit

0011= (0x23) + (0x22) +(1×21)+ (1×20) = 0+0+2+1 = 3

1101= (1×23) + (1×22) +(0x21)+ (1×20) = 8+4+0+1 = 13 = D

Hence 1111012 = 3D16


Example 33: Convert 1101101102 = ?16 base number.

Answer:

Step 1: Divide the binary number into groups containing 4 starting from right.

0001                1011                0110

Step 2: Convert each group into hexadecimal digit

0001= (0x23) + (0x22) +(0x21)+ (1×20) = 0+0+0+1 = 6

1011= (1×23) + (0x22) +(1×21)+ (1×20) = 8+0+2+1 = 11 = B

0110= (0x23) + (1×22) +(1×21)+ (0x20) = 0+4+2+0 = 6

Hence 1101101102 = 6B616 


 Example 34: Convert 5628 =  ?2 base number.

Answer:

Step 1: Convert each octal number to 3 binary digit

5628

58 = 1012                      68 = 1102                      28 = 0102

Step 2: Combine the binary groups

5628 =  1011100102


Example 35: Convert 7548 =  ?2 base number.

Answer:

Step 1: Convert each octal number to 3 binary digit

7548

78 = 1112                      58 = 1012                      48 = 1002

Step 2: Combine the binary groups

7548 =  1111011002


Example 36: Convert 5318 =  ?2 base number.

Answer:

Step 1: Convert each octal number to 3 binary digit

5318

58 = 1012                      38 = 0112                      18 = 0012

Step 2: Combine the binary groups

Hence 5318 =  1010110012


Example 37: Convert 3D16 =  ?2 base number.

Answer:

Step 1: Convert each hexadecimal number to 4 binary digit

3D16

316 = 00112                   D16 =1316 = 11012

Step 2: Combine the binary groups (First bit 0 is ignorable)

3D8 =  001111012 =  1111012


Example 38: Convert 2AB16 =  ?2 base number.

Answer:

Step 1: Convert each octal number to 4 binary digit

2AB16

216 = 00102                   A16 = 1016 = 10102         B16 = 1116 = 10112

Step 2: Combine the binary groups

2AB16 =  0010101010112


Example 39: Convert ABC16 =  ?2 base number.

Answer:

Step 1: Convert each octal number to 4 binary digit

ABC16

A16 = 1016 = 10102                     B16 = 1116 = 10112                     C16 = 1216 = 11002

Step 2: Combine the binary groups

Hence ABC16 =  1010101111002


BINARY DECIMAL (BASE 2) TO DECIMAL DECIMAL (BASE 10) 


Example 07: Convert the 110.1012 into ?10 base number.

Answer:

110.1012  =  (1×22) + (0x21) + (1×20)  +  (1×2-1) + (0x2-2) + (1×2-3)

=  (1 x 4) + (0 x 2) + (1 x 1) + (1 / 2) + (0 / 4) + (1 / 8)

= 4  + 0  + 1  + 0.5 + 0 + 0.125

= 5.62510

Answer: 101012  = 2110


Example 08: Convert the 11101012 into ?10 base number.

Answer:

1110.1012  = (1×23) + (1×22) + (1×21) + (0x20) +(1×2-1) + (0x2-2) + (1×2-3)

= (1 x 8) + (1 x 4) + (1 x 2) + (0 x 1)+ (1/2) + 0 + (1/8)

= 8 + 4 + 2 + 0 + 0.5 + 0 + 0.125

= 14.62510

Answer: 1110.1012    = 14.62510


Example 09: Convert the 111.0112 into ?10 base number.

Answer:

111.0112  =  (1×22) + (1×21) + (1×20) + (0x2-1) + (1×2-2) + (1×2-3)

= (1 x 4) + (1 x 2) + (1 x 1) + (0 /2) + (1 / 4) + (1 / 8)

= 4 + 2 + 1 + 0 + 0.25 + 0.125

= 7.37510

Answer: 111.0112  = 7.37510


Example 10: Convert the 11010.101012 into ?10 base number.

Answer:

11010.101012   = (1×24)  + (1×23) + (0x22) + (1×21) + (0x20)+ (1×2-1)  + (0x2-2) + (1×2-3) + (0x2-4) + (1×2-5)

= (1 x 16) + (1 x 8) + (0 x 4) + (1 x 2) + (0 x 1) + (1/2) + (0/4) + (1 / 8) + (0/16) + (1/32)

= 16 + 8 + 0 + 2 + 0 + 0.5 + 0 + 0.125 + 0 +  0.03125

= 26.6562510

Answer: 11010.101012  = 26.6562510

 


copy righy @ Md. Abdullah Al Kamal
MIT
, PGDIT, IIT, IT, BSC (CSE), DU, University of Dhaka, BUET
CCIE (R&S), CCNP, CCNA-Security, CCNA-Voice, CCNA (R&S), CCNA Vendor

%d bloggers like this: