# Whats the easiest way to learn Different bases

Pavneet Kaur

Greenhorn

Posts: 1

Nidhi Juneja

Greenhorn

Posts: 27

posted 13 years ago

Hi Pavneet...there r 2 options which i know....

first method:

1)for hex-divide the number by 16 and keep the remainder aside.

2)repeat step 1 again and again till u get a number smaller than 16 in which case this will be the remainder.

3)change 10 to A ,11 to B and so on for the remainders.

3)now start traversing the remainders in the reverse order than they were produced.

resulting number is hex equivalent

do the same for octal conversion but this time divide by 8.

second method:

1)convert decimal in to binary

2)for hex-start from the rightmost bit and make groups of 4 bits each. write the hex eq of each group. resulting is the converted value.

3)for octal-make groups of 3 from the right.

we don't get direct questions on conversion but it important to know for fns like tohexstring,tooctalstring and for unicode characters as well...

hope it is clear.

first method:

1)for hex-divide the number by 16 and keep the remainder aside.

2)repeat step 1 again and again till u get a number smaller than 16 in which case this will be the remainder.

3)change 10 to A ,11 to B and so on for the remainders.

3)now start traversing the remainders in the reverse order than they were produced.

resulting number is hex equivalent

do the same for octal conversion but this time divide by 8.

second method:

1)convert decimal in to binary

2)for hex-start from the rightmost bit and make groups of 4 bits each. write the hex eq of each group. resulting is the converted value.

3)for octal-make groups of 3 from the right.

we don't get direct questions on conversion but it important to know for fns like tohexstring,tooctalstring and for unicode characters as well...

hope it is clear.