dear sir im trying to do the theory of decimal to binary conversion
based on the fact that a decimal number may be represented by:
d= a n * 2 ^n + a n-1 * 2 ^n-1 + ....a 1 * 2 ^1 + a 0 * 2 ^0( note
a n is a with a subscript 1)
if we divide d by 2 we get
d / 2= a n * 2 ^n-1 + a n-1 * 2 ^n-2 + .....+a 1 * 2 ^0
i am attempting to put values into the variables
6 = a 1 * 2 ^1 + a 0 * 2 ^0 where n=1
= 3 1 * 2 ^1 + a 0 * 2 ^0 (note 3 1 is not the number 31 but 3 with
a subscript 1)
6 =6+ a 0 2 ^0............................................this is my
doubt is the a0 2 ^0 correct here what value should a 0
have is it 3??or is it equal to 1
6/2= a n * 2 ^n-1 + a n-1* 2 ^n-2+ a 1* 2 ^0
=3 1 * 2 ^n-1 where n=1
3 =3 1 * 2 ^0
i.e a 1 2 ^0
the above theory is for the following type of problem
eg convert the decimal number 19 to binary
19/2 remainder
9/2 1
4/2 1
2/2 0
2/2 0
0 0