Decimal Conversion


    
 Decimal Conversion

a)   Decimal to Binary
1. Divide the decimal number by 2.
2. Take the remainder and record it on the side.
3. Divide the quotient by 2.
4. REPEAT UNTIL the decimal number cannot be divided further.
5. Record the remainders in reverse order and you get the resultant binary number.

Example
Convert the Decimal number (125)10 into its Binary equivalent.
125 / 2 = 62                1
62 / 2 =   31                0
31 / 2 =   15                1
15 / 2 =   7                  1
7 / 2 =     3                  1
3 / 2 =     1                  1
1 / 2 =     0                  1
Answer: (1111101)2

b)  Decimal Fraction to 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 the process till the required number of decimal places or till you get zero in the fraction part. Record the integers in the products from top to bottom.
Example
Convert (105.15)10 to binary
Let us convert 105 first.
(105)10 = (1101001)2
Let us convert (0.15)10
Multiply 0.15 by 2                        0.30               0
Multiply 0.30 by 2                        0.60               0
Multiply 0.60 by 2                        1.20               1
Multiply 0.20 by 2                        0.40               0
Multiply 0.40 by 2                        0.80               0
Multiply 0.80 by 2                        1.60               1
Reading the integers from top to bottom (0.15)10 = (0.001001)2
Final result (105.15)10 = (1101001.001001)2

c)     Decimal to Octal
1. Divide the decimal number by 8.
2. Take the remainder and record it on the side.
3. Divide the quotient by 8.
4. REPEAT UNTIL the decimal number cannot be divided further.
5. Record the remainders in reverse order and you get the resultant binary

Example
Convert the Decimal number (125)10 into its Octal.
125 / 8 =  15        5
15 / 8   =  1          7
    1 /8      =  0          1
= (175)8

d)  Decimal Fraction to Octal
Multiply the given fraction by 8. Keep the integer in the product as it is and multiply the new fraction in the product by 8. Continue the process and read the integers in the products from top to bottom.
Example
Convert (125.75)10 to Octal
(125)10 = (175)8
Let us convert (0.75)10
Multiply 0.75 by 8       6.00            6
Reading the integers from top to bottom (0.75)10 = (0.6)8
Final Result: (125.75)10 = (175.6)8

e)   Decimal to Hexadecimal
1. Divide the decimal number by 16.
2. Take the remainder and record it on the side.
3. REPEAT UNTIL the decimal number cannot be divided further.
4. Record the remainders in reverse order and you get the equivalent hexadecimal number.
Example
Convert the Decimal number (300)10 into its hexadecimal.
300 / 16 = 18          12        C
18 / 16   = 1            2
1 / 16     = 0            1
    = (12C)16

f)     Decimal Fraction to Hexadecimal
Multiply the given fraction by 16. Keep the integer in the product as it is and multiply the new fraction in the product by 16. Continue the process and read the integers in the products from top to bottom.
Example
Convert (300.75)10 to Hexadecimal
(300)10 = (12C)16
Let us convert (0.75)10
Multiply 0.75 by 16       12.00            12        C
Reading the integers from top to bottom (0.75)10 = (0.C)16
Final Result: (300.75)10 = (12C.C)16

Comments

Popular posts from this blog

ASCII / ISCII / UNICODE

CISC / RISC / EPIC

Evolution of Computers