Converting from base 10 to any other base:
Seeing that today is a very mathematical day I figured that I would share some math/tech fun.
If you have any more questions email me at scott[at]smalltowngeeks[dot]net
First I want to recap on positional notation.
For example:
The number 78(seventy eight) in decimal(base ten).
The 8 represents the number of ones. And the 7 represents the number of tens.
This is because the first column represents 10^0(the ones), and the second column represents 10^1(the tens).
If this makes sense then we can continue to convert. When you convert, you can always think of the conversion as giving someone change with the smallest amount of bills.
I will convert 78 from decimal(XX) to hexadecimal(XX).
Hexadecimal columns are represented as 16^0(number of ones), 16^1(number of sixteens), 16^2(number of 256′s), 16^3…and so on.
So looking at the number sheet we see that the third column is the number of 256′s in a number. This is too big so we know that there will be nothing in the third column of our hexadecimal number.
Now we can move on to the second column. We see that is the number of 16′s in a number. 16 goes into 78 4 times, with a remainder of 14.
So we can write down a 4 in our left column(16′s column)
(4X)
Now we can take our remainder to the next number, the number of ones. This is the easy part. We see that there are 14 1′s. But we can’t write the number fourteen. Look at the number chart to find the representation for 14. It’s E, so we put an E in the 1′s column.
(4E)
So 78 decimal(base ten) = 4E hexadecimal(base sixteen)
And finally if this still makes sense. You know that you can do this for any base.
So base 5 starts out 5^0(number of ones), 5^1(number of fives), 5^2(number of 25′s)…and so on…
Base 7 is 7^0(number of 1′s), 7^1(number of 7′s), and 7^2(number of 49′s)…and so on…
Scott

Recent Comments