0. Let n = the number you are converting

1. Find p, the highest power of 16 which fits into n.

2. Divide n by p to get result q and remainder r.

3. Output q, which is a value between 0 and 15, as the next digit of the hex representation

4. Let n = r

5. Let p = p / 16

6. If p > 0, go to step 2

ok I understand that you find p%16 which is the next digit or remainder as you where saying in step one would be just be represented as 16 in the case of the hightest power of 16.

in ohter words r=n%16 or r=n/16 I guess I'm confused by the way you word it. cuz I know how to find the conversion from decimal to hex in the form of remainder for example

921 in decimal

what you mean by p=16 correct

q=921%16=57//next digit

r=921/16=57.5625 then .5625*16=9 remainder

q=57%16=3//next digit

r=57/16=3.5976 then .5976*16=9 remainder

q=3%16=3 //next digit but in this case remainder

solution is 399 in hex from 921 in dec