Home  »  Articles   »   Understanding the Hexadecimal Numbers System

Understanding the Hexadecimal Numbers System

Counting as you learned when you had barely gotten up on your two feet as a toddler has been a no brainer and to be honest presented not much to think about. Be it Binary, Decimal or Hexadecimal numbers systems it did not matter.

The reason why we stuck to a single number system in our formative years is best explained with the fact that we are designed with ten fingers and therefore it is so natural to make use of the decimal system as human. Again this system is a good round number that works quite well in our analog world.

Wait a minute. There is another world better known as the digital world. This has all to do with computers and memory and electricity. When in this realm we begin to land into some inconveniences holding on to the decimal system.

We therefore have to look at the likes of the binary numbers system. Why binary? Because binary represents the digital world perfectly. Digital is based on the two states of electricity which is either on or off. Electricity drives electronic devices. It is therefore fitting that binary which has two digits is the perfect fit for this.

The problem with Binary is that is may be a little bit too awkward for human beings to grapple with especially when we start dealing with large numbers where a long string of 1s and 0s are needed to represent that number. So what’s an elegant solution to this?

Enter the Hexadecimal Numbers System

The natural properties of Hexadecimal numbers system is the perfect compliment to the binary numbers system. A single hexadecimal number can represent up to two to the power of four in binary. Therefore the number 15 in binary would expand to 1111. In Hexadecimal the same number would shrink and be represented by the character “F“.

Hexadecimal Explained

Hexadecimal is also known as base 16 or simply hex. It is normally used in mathematics and computing. It uses sixteen distinct symbols. 0–9 represent values zero to nine. A, B, C, D, E, F (or a, b, c, d, e, f) represent values ten to fifteen.

In practical use in computing, each hex digital represents four bits which is also known as half a byte or a nibble. To represent bytes, you can used a pair of hex digits for example 00 to represent Decimal zero (binary 00000000) while FF represents decimal 255 (binary 11111111) which is the highest number that can be stored in a byte.

Hex is also used to represent computer memory addresses usually in the form 0xFFA25AFF for a 32bit long address on a 32bit system. The details of this are beyond the scope of this article.

The Hexadecimal numbers system is widely adopted for humans to represent binary because it can directly map to the binary system and therefore facilitates conversions to and fro without much mental acrobatics.

Take for instance the following number 24768 decimal. In binary that number would be 110000011010010. Now lets examine the same number and convert it to Hex.

(0)110000011010010 = 0110 0000 1101 0010

First split it into groups of four. starting from right to left and padding zeros if necessary on the far left.

The sets of four zeros can then be converted to Hexadecimal directly:

0110 = 6
0000 = 0
1101 = D
0010 = 2

24768 decimal in Hex is 60D2.

To apply hexadecimal arithmetic to this number system like all number systems is similar to the way you would do it in binary decimal.

Found this article interesting? Follow Brightwhiz on Facebook, Twitter, and YouTube to read and watch more content we post.

Available under:
Articles