Numbers are simply numbersIt may seem strange, but there is not much to learn in hexadecimal that is different from the mathematics you already know.The mathematics of binaries, decimals, hexadecimals (which is the same as "base 16"), base 32, base 36, base 64, as well as any other base, is the same. What changes is the amount of symbols for represent the numerals." By chance", as our common Arabic digits go only from 0 to 9, it was chosen to add the letters from A to F to represent the extra digits, since hexadecimal is a 16-digit notation rather than the 10 we are accustomed to.Instead of creating a new collection of drawings to represent the numbers after 9, we used what we had already done, for convenience - the letters - but giving a new meaning to them.In decimal, we use the Arabic digits 0 1 2 3 4 5 6 7 8 9;in hexadecimal, we use the digits 0 1 2 3 4 5 6 7 8 9 A B C D E F 1;on base 36 we go further, from 0 until the letter Z!in binary, it goes only 0 a 1but logic is still the same.Just like the last number of the decimal, which is 9, added to 1 turn 10 (i.e. go back to zero and win a new "house" next door), if we take the last "number" of the Hexa, which is "F" and add "1", the result is 10 in hexadecimal. Similarly, in the binary (which consists of 2 digits, "0" and "1" respectively), adding 1 + 1 we have 10 in binary.DECIMAL HEXADECIMAL BASE36
9 + 1 = 10 F + 1 = 10 Z + 1 = 10
Abstract: Mathematics is the same.1. Before the hexadecimal, there was a "sexadecimal" system whose digits were respectively 0 1 2 3 4 5 6 7 8 9 K S N J F L. Both work exactly the same, although the letters chosen for the representation of the 10th to the 15th digits are different.ComputersHexadecimal is very present in informatics for the ease it has to represent the numbers of another basis: the binary.As both hexadecimal and binary are two-powered numbers, you can reconcile some concepts from both bases interestingly. For this, we're leaving this tabelinha:Decimal Hexa Binário
0 0 0
1 1 1
2 2 10
3 3 11
4 4 100
5 5 101
6 6 110
7 7 111
8 8 1000
9 9 1001
10 A 1010
11 B 1011
12 C 1100
13 D 1101
14 E 1110
15 F 1111 <-- Atenção a este caso!
16 10 10000
17 11 10001
18 12 10010
19 13 10011
...
Note that when arriving at the 15 decimal, both the hexadecimal and the binary arrived in the last house before "turning" another house. As this "turn" coincides, the hexadecimal became a very practical way to represent binary numbers.For each of the 4-digit binaries (0000 to 1111), we have exactly a hexadecimal numeral. Knowing or understanding how to count these 16 digits, we convert any hexadecimal to binary and vice versa.Thus, looking at the table above, it is easy to convert a binary number: 111010110110110 -> original em binário
111 0101 1011 0110 -> dividido em grupos de nibbles
7 5 B 6 -> substituído pelos números da tabela.
75B6 -> reescrito em hexadecimal
Where does the hexadecimal enter that story then?Binary is the basis of current technology, as both in HDs and in memory, or in processors, the information is represented as "linked" or "unconnected" only (the hungry bits).This does not apply to quantum processors, but wait a little longer to have one of those on your table.It's been a while since processors and memory in general use spaces to store information organized in 4 bit packages (called the nibble), 8 bits (♪), 16 bits (Word), 32 bits (Dword), and so on.To represent a nibble (0000 to 1111), it is enough exactly a hexadecimal numeral (0 to F);to represent a byte, two of them are enough, from 00 to FF;and so we follow, for the "measures" as 0000 to FFFF, and larger.Examples "Visuals":It's much easier to write 5F than 01011111, isn't it?One MAC Address network plate: 00-5F-FF-E0-AA-FF instead of 0-95-255-224-170-255Color #FF00CC instead of rgb(255,0,204);maybe in this case the hexadecimal causes strangeness initially, but as the colors for the web palette 216 are multiple of 51 decimal (which is the same as 33 hexadecimal), we have the most common digits being 00, 33, 66, 99, cc and ff, which are abbreviated to a digit each (#33cc00 is the same as #3c0 for the browsers).A hexdump would be very confused if we represented the bytes from 0 to 255 instead of 00 to FFExample of hexdump:00000000 255044462D312E34 0A312030206F626A %PDF-1.4.1 0 obj
00000010 0A3C3C0A2F426173 65466F6E74202F48 .<<./BaseFont /H
00000020 656C766574696361 0A2F456E636F6469 elvetica./Encodi
00000030 6E67202F57696E41 6E7369456E636F64 ng /WinAnsiEncod
...
Imagine if we had to use 3 houses, or separators to identify the numbers.Thus, he was convinced to use hexadecimal for many things in which it facilitates reading and the context of information.How to "read" the hexadecimal?A: No fear Just as in decimal each "home" is multiplied by powers of ten:279 = ( 2 * 10 * 10 ) + ( 7 * 10 ) + ( 9 )
In hexadecimal it is enough to multiply by powers of 16:3AF = ( 3 * 16 * 16 ) + ( A * 16 ) + ( F )
é o mesmo que ( 3 * 16 * 16 ) + ( 10 * 16 ) + ( 15 ) em decimal.
It seems complex at first sight, but after you get used to the values of A to F, the rest becomes habit (as we get used to the example from 0 to 9 on day-to-day).Just to complete the reasoning, see another example, this time in binary:1101 = ( 1 * 2 * 2 * 2 ) + ( 1 * 2 * 2 ) + ( 0 * 2 ) + ( 1 )
Saved due proportions, it's like that Cypher scene in Matrix: "I don't even see the code. All I see now is blonde, brunette, redhead." 22. "I don't even see the code anymore. Now I just see blonde, brunette, redhead. "