Domanda

Here's an encoded memory address

9867640 

actual hex address (decoded):

0x969178

how is it encoded ? .. I tried ascii but doesn't seem like it

È stato utile?

Soluzione

This has nothing to do with encoding.

The first string shows the value in decimal system (base 10), the second string shows the value in hexadecimal system (base 16, as indicated by the 0x).

Altri suggerimenti

This is not encoding rather representation.

The first one is decimal( BASE 10) representation
9867640 = 9 8 6 7 6 4 0 = 9x10^6 +8x10^5 + 6x10^4 + 7x10^3 + 6x10^2 + 4x10 + 0x10^0

The second one is Hexadecimal( BASE 16) representation
0x969178 = 9 6 9 1 7 8 = 9x16^5 +6x16^4 + 9x16^3 + 1x16^2 + 7x16 + 8x16^0

Inorder to move from Hexadecimal base to decimal base you just multiply each digit with 16^n,

when n is the "place" of the digit in the number (starting from 0).

0x969178 becomes 8*16^0 + 7*16^1 + 1*16^2 +...

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top