# convert decimal 1024 to hexadecimal

I need to convert the decimal number 1024 to an hexadecimal number, I do this using these steps http://www.wikihow.com/Convert-from-Decimal-to-Hexadecimal#steps

However, whenever I divide 1024 by 16 I get as result the integer 64, now I'm kind of stuck as how to continue from here since every step from hereon onwards will just be an endless loop (*16, /16, *16, etc).

My math is really bad so a detailed explanation would be greatly appreciated!

-
How come you deleted your answer showing that you had figured out how to do it yourself? –  Tara B Feb 17 '13 at 13:46
it's not as clear as Hanno's answer (and I would be able to select it as answer in only 2 days..) –  xorinzor Feb 17 '13 at 13:48
Oh, I see. If I were you I would have just deleted the whole question, but not after Henno had already written an answer, I guess. –  Tara B Feb 17 '13 at 13:50
I could delete the question, but he already answered, so I might as well select it as the correct answer, perhaps this question can help someone else like me. –  xorinzor Feb 17 '13 at 13:52
And I quote, "My math is really bad so a detailed explanation would be greatly appreciated!" What I said wasn't very hard, if you studied it for a few minutes then it would make sense and then you'd have a better intuitive understanding of what you were learning. I know it sounds like I'm preaching but when it comes to math, putting in the extra effort makes all the difference between seeing a drop of water versus the whole lake. –  user39898 Feb 17 '13 at 17:45

Using the first procedure: 1024 / 16 = 64, exactly, so no remainder. So we write a 0.

64 / 16 = 4, no remainder, so we write a 0.

4 / 16 = 0, remainder 4, so we have (the digits in reverse order, as said:) 1024 (decimal) = 400 in hexadecimal.

-

I think you may have misread the step-by-step solution that you gave as a link. Remark that: $\frac{1024}{16} = 64 \Rightarrow \frac{64}{16} = 4$. If you try to divide 4 by 16 you you get a 'remainder' of 4. You did two divisions so you shift the 4 over 2 indices (as in, you get the remainder 4, and because you divided your original number twice before you got a remainder $\neq 0$), your remainder 4 becomes 400 (again, the two zeros being the result of the two divisions). This 400 is the hexademical representation of the number 1024 in decimal representation.

Keep in mind that the reason you're dividing your original number by 16 is because you're transforming that number into 'base' 16. In other words, if you have a number $x*y*z$ in hexademical notation, this is equivalent to $16^{2}*x + 16*y + 16^{0}*z$ in decimal notation. I hope that makes sense.

-