i decided to study for my exam (finally)…
while going through the notes i came over this cool subject how to convert Decimal to Binary and vice versa.
Example :
25 = ( 11001 )
Divide by 2 | Result | Remainder | |
25/2 | 12 | 1 | |
12/2 | 6 | 0 | |
6/2 | 3 | 0 | |
3/2 | 1 | 1 | |
1/2 | 0 | 1 |
if we take the remainders upwards we get 11001 which is the Binary value for 25
Now for the other way around ( 11001 ) starting from the right side first number is to the power of 1 next is 2 , 4, 8, 16 , 32, 64 ,…etc )
We take the same example 25
( 11001) = 16×1 + 8×1 + 4×0 + 2×0 + 1×1 = 25
Hope this turns out to be useful
2 Responses to Convert Dec to Bin / Bin to Dec