Jump to content

Hexadecimal: Difference between revisions

no edit summary
>Abwayax
(New page: {{wikipedia}} ''"HEX" and "hex" redirect here. For another use of the term, see identifier''. The '''hexadecimal''' or '''base sixteen''' number system has the number sixteen as its b...)
 
No edit summary
 
(6 intermediate revisions by 2 users not shown)
Line 2:
''"HEX" and "hex" redirect here. For another use of the term, see [[identifier]]''.
 
The '''hexadecimal''' or '''base sixteen''' number system (HEX for short) has the number sixteen as its base. The hexadecimal number system has few day-to-day uses andIt is usuallycommonly used only in the mathematics or computer science fields. Hexadecimal numbers have the digits 0 through 9 and A through F (corresponding to [[decimal]] values ten through fifteen).
 
Hexadecimal numbers arehave usedthe to represent bytes, which can hold a value ofdigits 0 through 255.9 Twoand hexadecimalA digitsthrough representF a(corresponding byte;to FF[[decimal]] invalues hexadecimalten isthrough equal to 255 in decimalfifteen).
 
The purpose of hexadecimal is to store binary encoded values in a more human friendly notation than decimal.{{clarify}}
In the Pokémon glitch community, hexadecimal is the preferred system for [[identifiers]]. As such, the term "HEX" is synonymous with "identifier." Hexadecimal identifiers are used in cheat codes for [[cheating device]]s. In the first two generations of Pokémon games, identifiers were one byte long and thus had a maximum value of 255. In later generations, they are two bytes long.
 
One digit (known as a nybble) can hold 4 bits, and two hexadecimal digits represent the whole of a byte (8 bits).
 
Hexadecimal numbers are used to represent bytes, which can hold a value of 0 through 255. Two hexadecimal digits represent a byte; FF in hexadecimal is equal to 255 in decimal. A hexadecimal value for an address may be known as a hexadecimal identifier or index number, but 'index number' may refer to a decimal value too.
 
In relation to Pokémon glitches, hexadecimal values are used for memory addresses, hex editors and [[cheating device]]s, such as the GameShark.
 
For example, the code 011559D0 is the instant encounter code for Mew in ''Pokémon Red and Blue''. The third and fourth digits are for the value, and the fifth-eighth digits are for the address that the code changes (in little endian). 15 here is a hexadecimal value, which when converted to decimal is 21; Mew's index number. 59D0 is also a hexadecimal value. The fact that it uses the digit 'D' is a hint.
 
When someone wants to show that a value is in hexadecimal, they can put the prefix "0x" or "$" before it, or the letter "h" after it. For example, "0x15", "$15" or "15h" means 15 in hexadecimal.
 
On rare occasions, a hexadecimal value may represent a value in 'human representation', meaning it is managed as a decimal value. This is the case for money values in [[bp:Generation I|Generation I]]. The player's current money is stored in memory addresses D347-D349 in ''Pokémon Red and Blue'' or D346-D348 in ''Pokémon Yellow''. This is problematic for values that do not show something in decimal, such as 0D, which represents the number 0 and a 'glitch digit'.
 
==Converting from hexadecimal to decimal==
A 'by hand' conversion process is demonstrated by [http://pad3.whstatic.com/images/thumb/0/04/Convert-Hexadecimal-to-Binary-or-Decimal-Step-2-Version-2.jpg/629px-Convert-Hexadecimal-to-Binary-or-Decimal-Step-2-Version-2.jpg this image].
 
Take for example the hexadecimal number D9. D is 13 in decimal, because you can count up from 9 and think of the number 10 being 'A', and the number 11 being 'B', and so on. 9 needs no conversion.
 
We then do: (13*16^1)+(9*16^0). The result is 208+9=217. The number 16 is constant. The power (^x) is taken from the number of digits that followed one of the hexadecimal digits.
 
Let's take for another example the hexadecimal number 49BD.
 
We would do (4*16^3)+(9*16^2)+(11*16^1)+(13*16^0)= 16384+2304+176+13=18877
 
B and D were converted into 11 and 13, respectively.
 
Converting from decimal to hexadecimal by hand is more complex, but is described [http://www.wikihow.com/Convert-from-Decimal-to-Hexadecimal here].
 
An easier method (but requiring a computer) to convert from hexadecimal to decimal or decimal to hexadecimal is through Windows Calculator. One can go on Windows Calculator, click 'view', click 'programmer', click 'hex', enter a number, and then switch to 'dec' to convert a hexadecimal number into decimal.
 
To convert from decimal to hexadecimal follow the same steps above but enter a number in decimal first then switch to hexadecimal.
 
Alternatively, [http://www.binaryhexconverter.com/hex-to-decimal-converter this online tool] can be used.
 
[[Category: Terminology]]
Cookies help us deliver our services. By using our services, you agree to our use of cookies.