In the hexadecimal system , numbers are represented in a place value system based on 16. "Hexadecimal" (from Greek hexa "six" and Latin decem "ten") is a Latin-Greek mixed word; Another correct but seldom used designation is hexadecimal (from the Latin sedecim "sixteen"). Another alternative name is hexadecadic (Greek). On the other hand, the expression hexa ges imal, which is synonymous with sexa ges imal and denotes the number system based on base 60, is incorrect .
In the data processing the hexadecimal system is used very often, because it is ultimately up to a more comfortable administration of the binary system is. The data words exist in the computer science mostly of octets that can be held as an eight-digit binary numbers represented as two-digit hexadecimal numbers. In contrast to the decimal system, the hexadecimal system with its base as a fourth power of two (16 = 2 4 ) is suitable for simpler notation of binary numbers, as a fixed number of characters is always required to reproduce the data word. Nibbles can be represented exactly with one hexadecimal digit and bytes with two hexadecimal digits.
In the 1960s and 1970s, the octal system was also often used in computer science with its base as a third power of two (8 = 2 3 ), since it uses the usual digits from 0 to 7. However, it is rarely used today, for example to represent characters in the C programming language. There are also other number systems with different base values.
We are used to calculating in the decimal system . This means that our Indo-Arabic number system uses ten symbols for the notation of the digits ( 0 to 9 ). The hexadecimal system, on the other hand, contains sixteen digits. Since the mid-1950s, the letters A to F or a to f have been used as numerals to represent the six additional digits . This goes back to the practice of the IBM computer scientists at the time .
Representation of hexadecimal numbers
Common spellings are: 72 16 , 72 hex , 72h, 72H, 72 H , 0x72, $ 72, "72 and X'72 ', whereby the prefix 0x and the suffix h are particularly used in programming and technical informatics h to the hex number is also known as the Intel convention. The notation with the dollar prefix is common in the assembly languages of certain processor families , especially Motorola , for example the Motorola 68xx and 68xxx , but also the MOS 65xx ; the notation X '72' is common in the world of IBM mainframes , as in REXX .
Separation points for clarity can be set at all four places in hexadecimal numbers, thus separating groups of sixteen bits each . The meaning of the 1,0000 16 = 65,536 10 among the hexadecimal numbers corresponds to that of the 1,000 10 among the decimal numbers.
For comparison, a full sixty-four-bit bus with and without breakpoints: FFFF.FFFF.FFFF.FFFF and FFFFFFFFFFFFFFFF
Decimal numbers are indexed where they are not the normal case to be expected: 114 10
Counting in the hexadecimal system
It is counted as follows:
Pronunciation of hexadecimal numbers
No separate names are used for the hexadecimal digits and numbers. Hexadecimal numbers are therefore usually read digit by digit.
- 10 read: "one-zero" (rarely: "ten"),
- 1E say: "one-E",
- F112 read: "F-one-one-two".
Hexadecimal multiplication table (multiplication table)
Example: 2 • 5 = A
Go vertically down from the column with the value 2 to the intersection of the line with the value 5. Result: A
Since the hexadecimal system is a place value system , the places after the comma (which is also sometimes written as a comma, sometimes as a point) have the place value , with the decimal base being 16 and the position of the respective decimal place. The first decimal place (n = 1) has the value , the second decimal place (n = 2) has the value , the third decimal place (n = 3) has the value and so on.
|= 1||= 0, 3 16||= 0.1C7 16||= 0.13B 16|
|= 0.8 16||= 0.2 A 16||= 0.1 9 16||= 0.1 249 16|
|= 0 5 16||= 0.249 16||= 0.1745D 16||= 0, 1 16|
|= 0.4 16||= 0.2 16||= 0.1 5 16||= 0.1 16|
Negative numbers can also be displayed. In most cases, the two's complement representation is used for this. Due to their design, no changes need to be made to the mechanisms for calculations in the basic arithmetic operations.
The hexadecimal system is very suitable for representing sequences of bits (used in digital technology ). Four digits of a bit sequence (a nibble , also called a tetrad) are interpreted like a binary number and thus correspond to a digit in the hexadecimal system, since 16 is the fourth power of 2. The hexadecimal representation of the bit sequences is easier to read and faster to write:
Binär Hexadezimal Dezimal 1111 = F = 15 1.1111 = 1F = 31 11.0111.1100.0101 = 37C5 = 14.277 1010.1100.1101.1100 = ACDC = 44.252 1.0000.0000.0000.0000 = 1.0000 = 65.536 1010.1111.1111.1110.0000.1000.0001.0101 = AFFE.0815 = 2.952.661.013
In this illustration, the point is only used to group numbers .
Since the Bailey-Borwein-Plouffe formula for calculating π was developed in 1995, the hexadecimal system has also been important beyond computer science. This sum formula can calculate any hexadecimal digit of π without needing the preceding digits.
Conversion to other number systems
Many pocket calculators , but also the similarly named auxiliary programs on personal computers , offer conversions for changing the number base . In particular, the Windows and macOS programs “Calculator” calculate binary, hexadecimal and octal numbers into decimals and back if you select the menu item “Programmer” under “View” (Windows) or “Display” (macOS). Many Linux distributions come pre-installed with a calculator utility that includes such a “programmer option”, or you can use the printf command on the command line (as a built-in bash command or a separate utility).
Conversion of decimal numbers into hexadecimal numbers
One way of converting a number in the decimal system into a number in the hexadecimal system is to consider the division remainders that arise when the number is divided by the base 16; the method is therefore also called the division method or the residual value method.
In the example of the 1278 10 it would look like this:
1278 : 16 = 79 Rest: 14 (= E) (Nr:1278-(79*16)=14) 79 : 16 = 4 Rest: 15 (= F) (Nr:79-(4*16)=15) 4 : 16 = 0 Rest: 4 (Nr:4-(0*16)=4)
The hexadecimal number is read from bottom to top and thus gives 4.FE .
Conversion of hexadecimal numbers into decimal numbers
To convert a hexadecimal number into a decimal number , you have to multiply the individual digits by the respective power of the base . The exponent of the base corresponds to the place of the digit, whereby a zero is assigned to the number before the decimal point. To do this, however, you have to convert the digits A, B, C, D, E, F into the corresponding decimal numbers 10, 11, 12, 13, 14, 15.
Example for 4FE 16 :
Conversion from hexadecimal to octal
In order to convert numbers between the octal system, which used to be common in computer science, and the hexadecimal system used today, it is advisable to take the intermediate step using the binary system. This is quite easy, since both base 8 and base 16 are powers of two.
- The hexadecimal number is converted into a sequence of binary digits according to the table above.
- Convert the groups of four into groups of three.
- The binary sequence is then translated into an octal sequence.
Example for 8D53 16 :
Conversion from octal to hexadecimal
The conversion from octal to hexadecimal is just as easy, only here is the way
- Octal sequence → binary sequence in groups of three → binary sequence in groups of four → hexadecimal sequence
Mathematical representation of the hexadecimal system
Formulated in the decimal system:
Formulated in the hexadecimal system:
One- and two-handed counting with the fingertips and joints
Like the old Babylonian sexagesimal system, the hexadecimal system can also be counted with the fingers. The following technique is used to represent a byte with both hands together . Each hand represents a nibble . Its upper crumb shows on the used finger, while its lower crumb shows on the indicated joint or the fingertip. A bit flip can be brought about by mirroring the thumb position at the center of the finger surface.
One-handed counting from zero to F 16
If, like the ancient Babylonians, you use the thumb as a pointer and place it on the tip of the index finger, as with the OK sign of divers, and define this sign as the zero. Then you can define one on the upper joint of the index finger, followed by two on the middle and finally three on the lower joint. Likewise continued over the four at the tip of the middle finger, the eight at the tip of the ring finger and the twelve on the little one. You can then count to 15 = F 16 when the thumb has reached the lower joint of the little finger, where it has grown.
The two crumbs of the nibble are displayed orthogonally on the hand. So that the lower two bits can be read at the level of the thumb on the respective finger and the two upper bits on the finger in question. This means that both a thumb on the fingertip and on the index finger stand for 00 2 in the respective crumb. The upper joint and the middle finger stand for 01 2 , the middle joint and ring finger stand for 10 2 and the lower joint and the little finger stand for 11 2 . Only four combinations have to be memorized in order to convert manually between the hexadecimal and binary system instead of 16.
A bit flip is easy to achieve by mirroring the position of the thumb at the intersection of the imaginary axes between the ring and middle fingers and the upper and middle row of joints. An example is given at the end of the table below.
|Whole nibble||Upper crumb||finger||Lower crumb||Position of the thumb on the finger|
|0 16 = (00 00) 2||00 2||index finger||00 2||Great, ok sign|
|1 16 = (00 01) 2||00 2||index finger||01 2||Upper joint|
|2 16 = (00 10) 2||00 2||index finger||10 2||Middle joint|
|3 16 = (00 11) 2||00 2||index finger||11 2||Lower joint|
|4 16 = (01 00) 2||01 2||Middle finger||00 2||top|
|8 16 = (10 00) 2||10 2||Ring finger||00 2||top|
|C 16 = (11 00) 2||11 2||pinkie finger||00 2||top|
|Bit flip of 2 16 through point mirroring at the intersection of the aforementioned axes|
|D 16 = (11 01) 2||11 2||pinkie finger||01 2||Upper joint|
Two-handed counting from zero to FF 16
If you now count on the left hand with the procedure described above how often you have counted up to F 16 on the right hand , a byte can be represented with two hands. Since four elements are counted on each finger, it follows that multiples of four appear on the fingertips. This means that when the thumbs of the respective hands start to count at zero on the respective index finger tip, the value on the tips of the fingers of the right hand increases by four, whereas when counting over the fingertips of the left hand it increases by 40 16 or 64 increased. If the left hand is only moved forward or backward by a phalanx, the displayed value changes by 10 16 or 16.
- Hexadecimal color definition - the representation of a color with hexadecimal coding of the red, green and blue value
- Hex-Editor - an editor to edit any files that are represented as a sequence of hexadecimal numbers
- Hexadecimal time - a time format proposed in 1863 that has not caught on
- Hexspeak - special terms that can be represented by numbers and the letters A – F
- Place value system
- Unary system (1)
- Dual system (2).
- Ternary system (3)
- Quaternary (4)
- Quinary (5)
- Senary (6)
- Decimal system (10)
- Online converter for different number systems
- Number systems in comparison
- Historical mechanical calculator for the hexadecimal system on one day
- Conversion with different base values , accessed on October 30, 2018