# Difference between revisions of "Hexadecimal"

Customfiber (talk | contribs) |
(→Converting between Hex and Binary: wikification, grammar) |
||

Line 7: | Line 7: | ||

=== Converting between Hex and Binary === | === Converting between Hex and Binary === | ||

− | To convert from | + | To convert from [[binary]] to hex simply start from the right and seperate the binary number into [[Binary#Nybble|nibbles]] (groups of four bits) then simply change each nibble to its respective hex digit. To convert from hex to binary just change each hex digit to its respective nibble. Anyone who plans to spend a lot of time working with [[machine code]] or [[assembly]] should dedicate the below table to memory. |

{| border="1" cellpadding="1" | {| border="1" cellpadding="1" | ||

!Hex!! Binary | !Hex!! Binary |

## Latest revision as of 23:33, 1 January 2006

**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 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.

*More non-ROM hacking specific information can be found at Wikipedia's hexadecimal article.*

## Contents

## Working with Hexadecimal Numbers

### Converting between Hex and Binary

To convert from binary to hex simply start from the right and seperate the binary number into nibbles (groups of four bits) then simply change each nibble to its respective hex digit. To convert from hex to binary just change each hex digit to its respective nibble. Anyone who plans to spend a lot of time working with machine code or assembly should dedicate the below table to memory.

Hex | Binary |
---|---|

0 | 0000 |

1 | 0001 |

2 | 0010 |

3 | 0011 |

4 | 0100 |

5 | 0101 |

6 | 0110 |

7 | 0111 |

8 | 1000 |

9 | 1001 |

A | 1010 |

B | 1011 |

C | 1100 |

D | 1101 |

E | 1110 |

F | 1111 |