Sign in Join
Wiki copytemporary

Hexadecimal: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: Hexadecimal

OldNewLine
1+Hexadecimal (hex) is number system to the base 16. In hexadecimal the decimal numbers 0–15 are represented by the symbols 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E and F. Hexadecimal numbers are easy to convert to the computer's internal binary code and are more compact than [[Binary numeral system|binary numbers]]. One hexadecimal digit stands in place of four binary bits (4-bits).
2+
3+In [[Pascal]] a hexadecimal literal is indicated by using a [[Dollar sign|$]] prefix.
4+
5+# Conversion Table
6+
7+| Hexadecimal | Decimal | Binary |
8+|----|----|----|
9+|   \$0000   |   0   |   [[Percent sign|%]]0000000000000000   |
10+|   \$0001   |   1   |   %0000000000000001   |
11+|   \$0002   |   2   |   %0000000000000010   |
12+|   \$0003   |   3   |   %0000000000000011   |
13+|   \$0004   |   4   |   %0000000000000100   |
14+|   \$0005   |   5   |   %0000000000000101   |
15+|   \$0006   |   6   |   %0000000000000110   |
16+|   \$0007   |   7   |   %0000000000000111   |
17+|   \$0008   |   8   |   %0000000000001000   |
18+|   \$0009   |   9   |   %0000000000001001   |
19+|   \$000a   |   10   |   %0000000000001010   |
20+|   \$000b   |   11   |   %0000000000001011   |
21+|   \$000c   |   12   |   %0000000000001100   |
22+|   \$000d   |   13   |   %0000000000001101   |
23+|   \$000e   |   14   |   %0000000000001110   |
24+|   \$000f   |   15   |   %0000000000001111   |
25+|   \$0010   |   16   |   %0000000000010000   |
26+|   \$0011   |   17   |   %0000000000010001   |
27+|   \$0012   |   18   |   %0000000000010010   |
28+|   \$0013   |   19   |   %0000000000010011   |
29+|   \$0014   |   20   |   %0000000000010100   |
30+|   ...   |   ...   |   ...   |
31+|   \$009f   |   159   |   %0000000010011111   |
32+|   \$00a0   |   160   |   %0000000010100000   |
33+|   ...   |   ...   |   ...   |
34+|   \$00ff   |   255   |   %0000000011111111   |
35+|   \$0100   |   256   |   %0000000100000000   |
36+|   \$0101   |   257   |   %0000000100000001   |
37+| | | |
38+
39+# See also
40+
41+[[Function|Functions]]:
42+
43+- [[doc:rtl/strutils/hex2dec.html|Hex2Dec]] Converts a hexadecimal [[String|string]] to a decimal value.
44+- [[doc:rtl/strutils/hextobin.html|HexToBin]] Convert a hexadecimal string to a binary buffer.
45+- [[doc:rtl/sysutils/inttohex.html|IntToHex]] Convert an [[Integer|integer]] value to a hexadecimal string.
46+
47+[[Procedure]]
48+
49+- [[doc:rtl/strutils/bintohex.html|BinToHex]] Convert a binary buffer to a hexadecimal string.
50+
51+---
52+*From the Free Pascal wiki, page "Hexadecimal", as it stood on 2023-10-11 after a change by FPC user, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history