The so-called ASCII and 16 are only conceptual things, and they are all binary in the computer. Transformation should be the transformation of output, and it is also a number. The representation in computer memory is the same, but the output is different. ASCII is the encoding of characters, almost the encoding of characters on the keyboard.
Mathematical calculation method:
Main entry: binary conversion
Decimal to hexadecimal
Decomposition by remainder theorem, such as converting 4877 10 into hexadecimal:
4877÷ 16=304.... 13(D)
304÷ 16= 19....0
19÷ 16= 1....3
1÷ 16=0.... 1
This makes it 487710 =130d16.