It's very easy, i do it a long way but it's fast for me and i'm comfortable with it
Dec - Bin
Say the number 129, i first write down my power's of 2's
128 64 32 16 8 4 2 1 (You start from the right and continuously double the number)
ok so for 129 we know that 'a' 128 is in it, so therfore in the place value we put a 1, there's no 64 because 128 + 64 wouldn't equal to 129, so we put a zero there, and moving down all the place values none of them added onto 128 gives the output of until we meet the last place value which is 1, 1+ 128 = 129, so we bit a 1 in it. so the result will be
Code:
128 64 32 16 8 4 2 1
1 0 0 0 0 0 0 1
now that we know the binary equivalent we can then convert to hexadecimal
we know that for a fact hexadecimal works in 4-Bits, so we break that binary equivalent into 4-bits
[1000] [0001]
We now convert these two binary sets back to normal digits
so 1000 = 8
0001 = 1
therefore the hexadecimal equivalent is 81
Some notes on Hexadecimal conversion, when you break the binary equivalent into 4 bits if your left with say for example
01 [0001] [0100]
you can add the zero's up for 01 to make it a 4 bit, i.e. 0001
And in Hexadecimal
say if the if you converted your 4 bit equivalent binary number back into a normal number
if it's 10 it will equal A this is the letters representation for Hex
0 = 0
1 = 1
2 = 2
3 = 3
4 = 4
5 = 5
6 = 6
7 =7
8 = 8
9 = 9
10 = A
11 = B
12 = C
13 = D
14 = E
15 = F
It stops there that's the whole number system for Hexdecimal, as it's base 16 meaning there's only 16 numbers in it's number system
so let's say we had a binary equivalent set as
[0011] [1010]
then 0011 = 3
1010 = 10, but this is Hex so we know 10 = A
Thefore the hexdecimal equivalent is 3A
As for reversing the process
if they gave you a Hexdecimal number, lets take 3A again as the example
we write the binary equiavlent for each digit, in 4 Bit's
so 3 = 0011
A = 1010
then we just join them back up
00111010
and work out the decimal equivalent
Hope this helped you out
As for Octal, it's not in the syllabus but if it's not hard to learn
In octal the number system is based on 8 numbers, so it's 0 to 7
You do it the exact method i taught you above, convert decimal to Binary, but this time we don't split them up into 4 bits, we split them up into 3 bits, and then convert each 3 bit to a decimal equivalent