Sei sulla pagina 1di 9

3/21/2019 Hexadecimal Numbers and Hexadecimal Numbering System

Home / Binary Numbers / Hexadecimal Numbers

Hexadecimal Numbers
Hexadecimal Numbers group binary numbers into sets of four allowing for the conversion of 16
different binary digits

The one main disadvantage of binary numbers is that the binary string equivalent of a large decimal base-10
number can be quite long.

When working with large digital systems, such as computers, it is common to nd binary numbers consisting
of 8, 16 and even 32 digits which makes it dif cult to both read or write without producing errors especially
when working with lots of 16 or 32-bit binary numbers.

One common way of overcoming this problem is to arrange the binary numbers into groups or sets of four
bits (4-bits). These groups of 4-bits uses another type of numbering system also commonly used in computer
and digital systems called Hexadecimal Numbers.

The “Hexadecimal” or simply “Hex” numbering system uses the Base of 16


system and are a popular choice for representing long binary values
because their format is quite compact and much easier to understand
compared to the long binary strings of 1’s and 0’s.

Being a Base-16 system, the hexadecimal numbering system therefore


uses 16 (sixteen) different digits with a combination of numbers from 0
Hexadecimal Number String
through to 15. In other words, there are 16 possible digit symbols.

However, there is a potential problem with using this method of digit notation caused by the fact that the
decimal numerals of 10, 11, 12, 13, 14 and 15 are normally written using two adjacent symbols. For
example, if we write 10 in hexadecimal, do we mean the decimal number ten, or the binary number of two (1
https://www.electronics-tutorials.ws/binary/bin_3.html 1/9
+ 0). To get around this tricky problem hexadecimal
3/21/2019 numbers
Hexadecimal Numbers that identify
and Hexadecimal theSystem
Numbering values of ten, eleven, . . . ,
fteen are replaced with capital letters of A, B, C, D, E and F respectively.

Then in the Hexadecimal Numbering System we use the numbers from 0 to 9 and the capital letters A to F
to represent its Binary or Decimal number equivalent, starting with the least signi cant digit at the right
hand side.

As we have just said, binary strings can be quite long and dif cult to read, but we can make life easier by
splitting these large binary numbers up into even groups to make them much easier to write down and
understand. For example, the following group of binary digits 1101  0101  1100  11112 are much easier to
read and understand than 11010101110011112  when they are all bunched up together.

In the everyday use of the decimal numbering system we use groups of three digits or 000’s from the right
hand side to make a very large number such as a million or trillion, easier for us to understand and the same is
also true in digital systems.

Hexadecimal Numbers is a more complex system than using just binary or decimal and is mainly used when
dealing with computers and memory address locations. By dividing a binary number up into groups of 4 bits,
each group or set of 4 digits can now have a possible value of between “0000” (0) and “1111”
( 8+4+2+1 = 15 ) giving a total of 16 different number combinations from 0 to 15. Don’t forget that “0” is also
a valid digit.

We remember from our rst tutorial about Binary Numbers that a 4-bit group of digits is called a “nibble”
and as 4-bits are also required to produce a hexadecimal number, a hex digit can also be thought of as a
nibble, or half-a-byte. Then two hexadecimal numbers are required to produce one full byte ranging from 00
to FF.

Also, since 16 in the decimal system is the fourth power of 2 ( or 24 ), there is a direct relationship between

the numbers 2 and 16 so one hex digit has a value equal to four binary digits so now q is equal to “16”.

Because of this relationship, four digits in a binary number can be represented with a single hexadecimal
digit. This makes conversion between binary and hexadecimal numbers very easy, and hexadecimal can be
used to write large binary numbers with much fewer digits.

The numbers 0 to 9 are still used as in the original decimal system, but the numbers from 10 to 15 are now
represented by capital letters of the alphabet from A to F inclusive and the relationship between decimal,
binary and hexadecimal is given below.

Hexadecimal Numbers

Decimal Number 4-bit Binary Number Hexadecimal Number

0 0000 0

1 0001 1

https://www.electronics-tutorials.ws/binary/bin_3.html 2/9
3/21/2019 Hexadecimal Numbers and Hexadecimal Numbering System
2 0010 2

3 0011 3

4 0100 4

5 0101 5

6 0110 6

7 0111 7

8 1000 8

9 1001 9

10 1010 A

11 1011 B

12 1100 C

13 1101 D

14 1110 E

15 1111 F

16 0001 0000 10 (1+0)

17 0001 0001 11 (1+1)

Continuing upwards in groups of four

Using the original binary number from above 1101 0101 1100 11112 this can now be converted into an
equivalent hexadecimal number of  D5CF which is much easier to read and understand than a long row of
1’s and 0’s that we had before.

So by using hexadecimal notation, digital numbers can be written using fewer digits and with a much less
likelihood of an error occurring. Similarly, converting hexadecimal based numbers back into binary is simply
the reverse operation.

Then the main characteristics of a Hexadecimal Numbering System is that there are 16 distinct counting
digits from 0 to F with each digit having a weight or value of 16 starting from the least signi cant bit (LSB). In
order to distinguish Hexadecimal numbers from Denary numbers, a pre x of either a “#”, (Hash) or a “$”
(Dollar sign) is used before the actual Hexadecimal Number value, #D5CF or $D5CF.

https://www.electronics-tutorials.ws/binary/bin_3.html 3/9
As3/21/2019
the base of a hexadecimal system is 16, which also
Hexadecimal represents
Numbers the Numbering
and Hexadecimal numberSystem
of individual symbols used in
the system, the subscript 16 is used to identify a number expressed in hexadecimal. For example, the
previous hexadecimal number is expressed as:  D5CF16

Counting using Hexadecimal Numbers


So we now know how to convert 4 binary digits into a hexadecimal number. But what if we had more than 4
binary digits how would we count in hexadecimal beyond the nal letter F. The simple answer is to start over
again with another set of 4 bits as follows.

0…to…9, A,B,C,D,E,F, 10…to…19, 1A, 1B, 1C, 1D, 1E, 1F, 20, 21….etc
Do not get confused, 10 or 20 is NOT ten or twenty it is 1 + 0 and 2 + 0 in hexadecimal. In fact twenty does
not even exist in hex. With two hexadecimal numbers we can count up to FF which is equal to decimal 255.
Likewise, to count higher than FF we would add a third hexadecimal digit to the left so the rst 3-bit
hexadecimal number would be 10016, (25610) and the last would be FFF16, (409510). The maximum 4-digit
hexadecimal number is FFFF16 which is equal to 65,535 in decimal and so on.

Representation of a Hexadecimal Number

MSB Hexadecimal Number LSB

168 167 166 165 164 163 162 161 160

4.3G 2.6G 16M 1M 65k 4k 256 16 1

This adding of additional hexadecimal digits to convert both decimal and binary numbers into an
Hexadecimal Number is very easy if there are 4, 8, 12 or 16 binary digits to convert. But we can also add
zero’s to the left of the most signi cant bit, the MSB if the number of binary bits is not a multiple of four.

For example, 110010110110012 is a fourteen bit binary number that is to large for just three hexadecimal
digits only, yet too small for a four hexadecimal number. The answer is to ADD additional zero’s to the left
most bit until we have a complete set of four bit binary number or multiples thereof.

Adding of Additional 0’s to a Binary Number

Binary Number 0011 0010 1101 1001

Hexadecimal Number 3 2 D 9

 
The main advantage of a Hexadecimal Number is that it is very compact and by using a base of 16 means that
the number of digits used to represent a given number is usually less than in binary or decimal. Also, it is
quick and easy to convert between hexadecimal numbers and binary.
https://www.electronics-tutorials.ws/binary/bin_3.html 4/9
Hexadecimal
3/21/2019 Numbers ExampleHexadecimal
No1 Numbers and Hexadecimal Numbering System
Convert the following Binary number 1110 10102 into its Hexadecimal number equivalent.

Binary Number = 111010102

 Group the bits into four’s starting from the right hand side

  =  1110  1010  

 Find the Decimal equivalent of each individual group

  =  14  10 (in decimal)

 Convert to Hexadecimal using the table above

  =  E  A (in Hex)

 Then, the hexadecimal equivalent of the binary number

1110 10102  is  #EA16

Hexadecimal Numbers Example No2


Convert the following Hexadecimal number #3FA716 into its Binary equivalent, and also into its Decimal or
Denary equivalent using subscripts to identify each numbering system.

  #3FA716

 = 0011 1111 1010 01112

 = (8192 + 4096 + 2048 + 1024 + 512 + 256 + 128 + 32 + 4 + 2 + 1)

 = 16,29510

 
Then, the Decimal number of 16,295 can be represented as:-

#3FA716   in Hexadecimal

or

0011 1111 1010 01112   in Binary.

Hexadecimal Numbers Summary


https://www.electronics-tutorials.ws/binary/bin_3.html 5/9
Then to summarise. The Hexadecimal, orHexadecimal
3/21/2019 Hex, numbering
Numbers andsystem is commonly
Hexadecimal used in computer and digital
Numbering System

systems to reduce large strings of binary numbers into a sets of four digits for us to easily understand. The
word “Hexadecimal” means sixteen because this type of digital numbering system uses 16 different digits
from 0-to-9, and A-to-F.

To convert binary numbers into hexadecimal numbers we must rst divide the binary number up into a 4-bit
binary word which can have any value from 010 ( 00002 ) to 1510 ( 11112 ) representing the hexadecimal
equivalent of  0 through to F.

In the next tutorial about Binary Logic we will look at converting strings of binary numbers into another
digital numbering system called Octal Numbers and vice versa.

93 Comments

Join the conversation

Your Name

Email Address

Write your comment here

SUBMIT

NZIZA PRINCE
I would like to known the bene
https://www.electronics-tutorials.ws/binary/bin_3.html ts of using octal and hexadecimal number system 6/9
3/21/2019
Posted on March 12th 2019 | 9:50 am Hexadecimal Numbers and Hexadecimal Numbering System
 Reply

shashank
i want source code on this please any one can keep this BCD-code
i want to print the all the data at a time by using BCD format
eg:
0000 0000 0001-1
0000 0000 0010-2
so like this i want to print all the values at atime by using c code can any one post

Regards,
shashank patchalla

Posted on February 06th 2019 | 9:27 am


 Reply

Ejaygigo
Great article with easy to understand explanations. Thank you very much.

Posted on February 04th 2019 | 11:22 pm


 Reply

manab kalita
Nice material for non science students who are willing to learn computers

India

Posted on January 29th 2019 | 12:47 pm


 Reply

Tasnim Hossain
Nice
https://www.electronics-tutorials.ws/binary/bin_3.html 7/9
3/21/2019
Posted on December 28th 2018 | 3:43 pmHexadecimal Numbers and Hexadecimal Numbering System
 Reply

Betram Mushi
I am also an engineer

Posted on December 22nd 2018 | 11:51 am


 Reply

Vaibhav
Great information and very helpful, thanks for this article.

Posted on December 17th 2018 | 3:28 am


 Reply

Brijesh Singh
nice description… helpful

Posted on December 10th 2018 | 3:28 pm


 Reply

Jameel
I do IT and I am getting dif culties with equations such as the following, can you help me with them?

3FA7 16
= 0011 1111 1010 0111 2
= (8192 + 4096 + 2048 + 1024 + 512 + 256 + 128 + 32 + 4 + 2 + 1)
= 16,29510
how did you get this line to work out?
(8192 + 4096 + 2048 + 1024 + 512 + 256 + 128 + 32 + 4 + 2 + 1)

Posted on November 07th 2018 | 2:57 pm


 Reply
https://www.electronics-tutorials.ws/binary/bin_3.html 8/9
3/21/2019 Hexadecimal Numbers and Hexadecimal Numbering System

Heavenly
Your comment is awaiting moderation.

(8192 + 4096 + 2048 + 1024 + 512 + 256 + 128 + 32 + 4 + 2 + 1)

Are the equivalent of 1 in the Binary Code.

Posted on March 21st 2019 | 1:59 am


 Reply

bumbo yusuf
thanks for that educative message

Posted on November 07th 2018 | 6:36 am


 Reply

View More

https://www.electronics-tutorials.ws/binary/bin_3.html 9/9

Potrebbero piacerti anche