Write 9,13,18,33 which are in base 10, in binary, octal and hex.
Can do this using the divide and remainer approach though that's not
what i would do in practice.
9/2 = 4 with remained 1. 4/2 = 2 with remainder 0. 2/2 = 1 with remainder
0 and 1/2=0 with remainder 1. So the remainders are 1,0,0,1 and
9 in base 2 is (1001)2
In practice i would write the number down. In base 2
the digit's units increase in powers of 2. So we want to write 9 as:
1*a+2*b+4*c+8*d+16*e+32*f. |
|
Clearly e and f must equal zero since 16 and 32 are greater than 9.
So we take d = 1(the digits can only be 0 or 1 in base 2). Then we
have to get 1 using a, b and c. Again b and c must equal zero since
2 and 4 are greater than one. So we need a=1.
Similarly 13 is 8+4+1, so d,b and a are equal to one. 18 is 16+2 and
33 is 32+1. In binary we break things into sums like this in the same
way that we do in base 10 where we look for 1+10+100 type combinations.
The difference there is that the digits are not limited to just 0 and 1.