a=10 à0000 1010
So
a=10->0000 1010
b=11->0000 1011
Steps:
Divide this number by 2 and ignore the remainder, keep repeating this process till we get 1
(1.) 10 divide by 2 which gives 5
5 <--10 <---
(2.) Divide by 2 we get 2, ignore remainder 1
i.e 2<-- 5 <--10
(3.) 2 divide by 2 we get 1, ignore remainder 0
i.e 1<-- 2<-- 5<-- 10
(4.) Now we are going to write 1 below any of the odd number
and 0 below any of the even number.
i.e write 1 for odd numbers; 0 for even number
1 2 5 10
i.e 1 0 1 0
so 10=1010 (In binary)
No comments:
Post a Comment