Thursday, 11 September 2014

Decimal to any base conversion & Hexa to any base conversion (Class on 11-09-14 for CSE-A &B)


Decimal to any base (Radix) conversion:
1.      Decimal to binary number conversion                         * * * * * * * * * * * * * * * * * *


Take the remainders from bottom to top,
The result of 5710 is =(111001)2

Ex:2 Convert 0.7510to binary
            Multiply the given fraction by 2.
Keep the integer in the product as it is and multiply the new fraction in the product by 2. Continue this process & read the integers in the products from the top to bottom.
             
                 Given fraction                    0.75

            Multiply 0.75 by 2                  1.50
            Multiply 0.50 by 2                  1.00
Reducing the integers from top to bottom (0.75)10=(0.11)2

Ex (3): Convert (105.15)10 to binary.
Sol:      Conversion of integer 105

Remainder from bottom to Top = 1101001   

This particular fraction can never be expressed exactly in binary. This process may be terminated after few steps.
                        Therefore (105.15)10= (1101001.001001)2

Ex (4): Convert (13)10 to an equivalent base-2 number.


Ex (5): Convert (0.65625)10 to an equivalent base-2 number.


1.      Decimal to Octal number conversion                         * * * * * * * * * * * * * * * * * * *

  Ex (1): (574)10  

                                            Thus  (574)10  = (1076)8
Ex (2): (247)10  


Ex (3): Convert (0.6875)10 into Octal number.

Ex (4): Convert (3287.5100098)10  into Octal number.


Fractional Part 0.5100098

1.      Decimal to Hexadecimal number conversion                         * * * * * * * * * * * * * * *
Ex (1):    (95.5)10
Ex (2):    (675.625)10


Hexa decimal to any base (Radix) conversion:
1.      Hexadecimal to binary number conversion                                * * * * * * * * * * * * *



1.      Hexadecimal to Octal number conversion                                * * * * * * * * * * * * *

Ex 1:convert (A72E)16 to octal number
                    A      7       2       E
   
     1010  0111 0010 1110

  = 001 010 011 100 101 110
        1     2     3    4     5    6

   = (123456)8

Ex 2: Convert (0.BF85)16 to octal number
            0.1011111110000101
           
            0.101|111|111|000|010|100
           
           0.   5    7     7    0      2    4

Thus (0.BF85)16=(0.577024)8

Ex 3: Convert B9F.AE16 to octal
Given hex number is              B        9        F       .    A           E

Convert hex digit to binary  1011  1001   1111   .  1010     1110

Groups of three bits are                   101 110 011 111. 101 011 100

Convert each 3 bit group to octal      5     6      3     7   .   5      3      4
           
The result is (5637.534)8

Ex 4: (2AB)16 -------(  )8

             

Ex 5: (42FD)16--------(   )8
                
          =   4        2         F        D
            0100   0010  1111  1101
            
          = 000|100|001|011|111|101
            
              0      4     1    3      7    5

Thus (42FD)16=(41375)8


2.      Hexadecimal to decimal number conversion                                * * * * * * * * * * * * *

Ex 1: convert 5C716 to decimal
            =(5x162)+(12x161)+(7x160)
            =1280+192+7             
            =(1479)10
Ex 2: convert A0FP.0EB16 to decimal
            =(10x163)+(0+162)+(15x161)+(9x160).(0x16-1)+(14x16-2)+(11x16-3)
            =(40960+0+240+9)+(0+0.0546+0.0026)
            =(41209.0572)10
Ex 3: convert AB6 to decimal
            =10x162+11x161+6x160
             =(2742)10
Ex 4: convert 2EB7 to decimal
            =2x163+14x162+11x161+7x160            
            =(11959)10
Ex 5: convert A08F.EA to decimal
            =(10x163+0x162+8x161+15x160 ) + (14x16-1+11x16-2)
            =(41103.0.917)10
Ex 6: (8E47.AB)16------(   )10
            =(8x163+14x162+4x161+7x160 ) + (10x16-1+11x16-2)
            =(36423.667)10

Ex 7: obtain decimal equivalent of hexadecimal(3A.2F)16
            =(3x161+10x160)  + (2x16-1+15x16-2)
            =48+10+(2/16)+(15/162)
            =(58.1836)10





No comments:

Post a Comment