Definition of

Hexadecimal

Computing

One byte is equivalent to two hexadecimal digits.

Hexadecimal is an adjective that is used in the field of mathematics to refer to the numbering system whose base is the number sixteen ( 16 ). Currently this system is often used in computing since one byte (the basic unit of memory) is equivalent to two hexadecimal digits.

The hexadecimal system, which is abbreviated Hex , uses positional notation . This means that each of its digits acquires a value according to its relative position, which is determined by the base. This base, in turn, refers to the number of digits needed to write a number.

The digits of the hexadecimal system

Since the base of the hexadecimal system is sixteen, sixteen different digits are required for writing. Therefore, in addition to the ten digits of the decimal system ( 9 , 8 , 7 , 6 , 5 , 4 , 3 , 2 , 1 and 0 ), the first six letters of the Latin alphabet are used: A , B , C , D , E and F .

In this way, we can affirm that the set of symbols used by the hexadecimal system is made up of the numbers ranging from 0 to 9 and the letters from A to F. In this case, A equals 10 ; B , at 11 ; C , at 12 ; D , at 13 ; E , at 14 ; and F to 15 .

Because 2 is the only prime factor of 16 , those fractions that do not have a power of 2 in the denominator have a periodic hexadecimal expansion. For example: the fraction 1/3 in the hexadecimal system results in 0.555555

Just as various operations can be carried out in the decimal system , different mathematical operations can also be carried out in the hexadecimal system. The methods, however, are different.

Colors

The hexadecimal system is used to specify the colors of the RGB model.

Resource to name the colors of the RGB model

For many years now, in any field related to computer image design, the hexadecimal system has been used to specify colors. A hexadecimal color code, in this framework, allows expressing the values ​​corresponding to each of the three components in the chosen space; Generally you work with RGB , and therefore one value is expressed for red, another for green and another for blue.

By convention, the code usually begins with the pound sign ( # ), after which six digits are placed that can range from 00 to ff or, in decimal system, from 0 to 255. In other words, in each of the Three values ​​can represent up to 256 intensities, since zero also counts, if only to indicate a null value.

The total number of colors that we can represent with this type of hexadecimal code is 16,777,216, although in everyday speech it is usually rounded down and mentioned simply as "sixteen million colors" or, referring to the binary system and using a term more technical, "24 bits of color" (the number 24 corresponds to the fact that 2 raised to this power results in exactly 16,777,216 ).

How to interpret chromatic hexadecimal code

Understanding a hexadecimal color code is not difficult, although it requires certain knowledge related to light or a certain degree of experience in using digital painting tools. Let's look at some basic examples:

* the code #000000 represents black, since it is equivalent to the absence of all color or light ;

* On the contrary, #ffffff is white, which can also be understood as the sum of red, green and blue at their maximum intensity;

* If we think about the RGB space, since the acronym translates as "red green blue", we will quickly understand that in a hexadecimal code the pairs of digits belong to each of these colors, if we read it from left to right. For this reason, #ff0000 is the deepest red, #00ff00 is the deepest green, and #0000ff is the deepest blue;

* By combining two colors we obtain a third, as occurs with the code #ff00ff , which represents yellow.