https://ftp.romhacking.net/wikid/api.php?action=feedcontributions&user=201.25.178.210&feedformat=atomData Crystal - User contributions [en]2021-11-29T23:42:20ZUser contributionsMediaWiki 1.29.2https://ftp.romhacking.net/wikid/index.php?title=Hexadecimal&diff=1847Hexadecimal2005-10-24T17:38:52Z<p>201.25.178.210: </p>
<hr />
<div>'''Hexadecimal''' or '''base 16''' is a number system which uses the numerals 0-9 and letters A-F or a-f to represent digits. It is commonly used in ROM hacking, since it provides an easy way to write the [[binary]] numbers used by computers. Often representing numbers as [[decimal]] is either unwieldy and meaningless in the case of [[Pointer|pointers]] or obscures the meaning of data stored in bits. For example, a [[byte]] could be used as eight true/false flags, but reading the same [[byte]] as a [[decimal]] number would be meaningless.<br />
<br />
{{moreinfo wikipedia|page=hexadecimal}}<br />
<br />
== Working with Hexadecimal Numbers ==<br />
<br />
=== Converting Decimal values to Hexadecimal values ===<br />
{{stub}}</div>201.25.178.210https://ftp.romhacking.net/wikid/index.php?title=Binary&diff=798Binary2005-10-24T17:36:49Z<p>201.25.178.210: </p>
<hr />
<div>'''Binary''' or '''base 2''' is the number system used natively by computers. It uses only the digits 0 and 1. It is useful in ROM hacking especially when a value actually consists of multiple values, which do not take a multiple of eight [[#Bit|bits]] each. For example, the [[Super Nintendo:Color|SNES color]] format consists of fives bits for each of the red, green, and blue color components in a [[#Word|word]].<br />
<br />
{{moreinfo wikipedia|page=binary}}<br />
<br />
== Terminology ==<br />
<br />
=== Bit ===<br />
<br />
Each digit in a binary number is referred to as a '''bit'''.<br />
<br />
{{moreinfo wikipedia|page=bit}}<br />
<br />
=== Nybble ===<br />
<br />
A '''nybble''' or '''nibble''' is a group of four [[#Bit|bits]]. Most computers cannot read or write single nybbles, but they are notable since every [[hexadecimal]] digit represents exactly one nybble.<br />
<br />
=== Byte ===<br />
<br />
A '''byte''' is a group of eight [[#Bit|bits]]. This is the smallest grouping which most computers can work with directly. Some formats may involve smaller divisions like the [[Super Nintendo:Color|SNES color]] format mentioned above, but special code must be used to deal with this.<br />
<br />
{{moreinfo wikipedia|page=byte}}<br />
<br />
=== Word ===<br />
<br />
A '''word''' is the natural unit of data for a given architecture. Unlike the previous terms, the size of a word varies from system to system. A word is usually a power of two time the size of a byte - generally 16 [[#Bit|bits]] (two [[#Byte|bytes]]), 32 bits (four bytes) or 64 bits (8 bytes). For example, a word on a [[Nintendo Game Boy Advance|GBA]] is 32 bits, whereas on a [[Nintendo Entertainment System|NES]] it is 16 bits. The order of these bits depends on the [[endianness]] of the machine. From this term, comes '''halfword (hword)''', for a unit of data half of the word size, '''double word (dword)''' for double the word size and '''quadruple word (qword)''' for eight times the word size.<br />
<br />
{{moreinfo wikipedia|page=Word_(computer_science)}}<br />
<br />
== Working With Binary Values ==<br />
<br />
=== Converting a Decimal Value to a Binary Value ===<br />
<br />
It is useful to be able to convert between binary and decimal. When this calculation cannot be carried out mentally, there are simple methods of making the conversion on paper. Many operating systems also include a calculator which can convert between binary and decimal.<br />
<br />
Please note that this method does not cover floating point decimals, which are rare in ROM hacking.<br />
<br />
First, write the following table on any piece of paper:<br />
<br />
| 2^7 | 2^6 | 2^5 | 2^4 | 2^3 | 2^2 | 2^1 | 2^0<br />
<br />
Then under the ''2^7'', write the non-exponential eqivalent, ''128''. Repeat for all of them, remembering that ''2^0'' is ''1''.<br />
<br />
Now, the process is very simple. First, pick the decimal value you want to convert. Start from the left of the table. Now ask yourself, "If I take my number and take away 2^7 (128) from it, will it still be a positive number?" If yes, then do the subtraction and mark a ''1'' under the ''2^7'' on the table. Now, save the result from the previous subtraction and ask the same question to the next exponential ''2^6 = 64''. If it's true, then write another ''1'' in the table. If, by any chance, you get to a number where you cannot do the subtraction without getting a negative number as the answer, just write a 0 on the table and go on to the next number. When you are done with ''2^0 = 1'', you are all done. Results of DEC to BIN conversions:<br />
<br />
In the following examples, note that if the number on the table is 0, then you do not count its exponential towards the final sum.<br />
<br />
DEC - 217<br />
BIN - 11011001 (128 + 64 + 0 + 16 + 8 + 0 + 0 + 1)<br />
<br />
DEC - 128<br />
BIN - 10000000 (128 + 0 + 0 + 0 + 0 + 0 + 0 + 0)<br />
<br />
DEC - 127<br />
BIN - 01111111 (0 + 64 + 32 + 16 + 8 + 4 + 2 + 1)<br />
<br />
== See Also ==<br />
<br />
* [[Hexadecimal]]<br />
* [[Decimal]]<br />
* [[Endianness]]<br />
<br />
== External Links ==<br />
* [http://www.mistupid.com/computers/binaryconv.htm Online converter] between binary and decimal<br />
<br />
{{stub}}</div>201.25.178.210