pctechguide.com

  • Home
  • Guides
  • Tutorials
  • Articles
  • Reviews
  • Glossary
  • Contact

Number Systems 3

The basic unit of computer storage is the eight bit byte, which can store values in the decimal range 0 to 255. The problem when dealing with numbers in binary format is that they quickly become very long. For instance, the number 317 is represented as: 0b100111101, which is bad enough, but the number 17341 is no less than 0b100001110111101!

This is clearly going to be a headache, but there is another number system that comes to our rescue: hexadecimal. Hexadecimal (or hex) is a base 16 number system, so now our number columns increase in powers of 16. Now lets take the number 17341 expressed as a hex number:

4096 256 16 units
4 3 B D

Here, where decimal uses 5 digits, and binary uses 15 digits (bits), hex uses only 4 digits: 0x43BD. (Notice that the number is preceded with 0x, identifying it as a hex number in the same way that preceding a number 0b denotes a binary number.) Of course what’s confusing here is the use of the B and the D – how can these be part of a number? Well, remember that this is a base 16 number system, and we usually only use numbers 0 to 9. So, the numbers 10 to 15 in decimal need to be represented in hex using characters from the alphabet, A through to F.

The following table shows the values 0 to 15 in decimal, binary, and hexadecimal.

Decimal Binary Hex
0 0000 0
1 0001 1
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

How Does Hexadecimal Help?

So, you may think that’s all very well, but how does using hexadecimal help us to work with binary numbers? Well, two things. First, take a look at the representation of 87 again:

128 64 32 16 8 4 2 units
0 1 0 1 0 1 1 1

Notice that the one hundred and twenty-eights column has been included despite it being of value 0. This is the way that the computer stores numbers in RAM, because every number stored will take at least one byte. Now, also look at the table above showing the hex count 0 to F, and compare the binary column. Notice that each hex number is represented by four binary digits? And there’s the key. We can split each byte into two groups of four bits, and equate them to hex values.

binary 128 64 32 16 8 4 2 units
0 1 0 1 0 1 1 1
hex 16 units
5 7

So, what we’re saying here is that 87 = 0b01010111 = 0x57. The key here is that the 8 bit binary number has been split into two groups of 4 bits, and equated to the hexadecimal numbers. So, the first four bits: 0b0101=0x5, and the second four bits: 0b0111=0x7. And that’s really it – very quickly and simply, we have converted the binary to hex.

It’s simple to check by converting to decimal: we have five sixteens, and seven units. So, 5×16=80, and 80+7=87. Correct!

And there you have it. Because the hex number system so readily provides a shorthand for the byte, requiring only two characters to represent the bytes possible values, it is widely adopted for all sorts of computer purposes.

The simple fact is, anyone approaching computer science in pretty much any discipline will need to get themselves familiar with counting in base 16. But the good news is, with only a bit of practice it quickly becomes second nature, and on the next page you can test yourself, and get in some practice, with an interactive conversion tool. Or, you can just use it to convert numbers for you

  • Number Systems 2
  • Number Systems 3
  • Number Systems 4

Filed Under: Number Systems

Latest Articles

Pentium P5 microarchitecture – superscalar and 64 bit data

First introduced in 1993, the Pentium was the successor to Intel's 486 line of CPUs and the defining processor of the fifth generation. The original Pentium microprocessor had the internal code name P5, and was a pipelined in-order superscalar microprocessor, produced using a 0.8 µm … [Read More...]

How to Charge Your iPhone Faster

Yes it is a First World problem, but it is very frustrating to find your iPhone dead when you are getting ready to go out. You may see that dreaded red bar on your iphone and come to the realization that you have less than 20% of power and are going to be away from a charging station for a long … [Read More...]

Magnetic RAM

In late 2000 IBM and German semiconductor company Infineon Technologies AG announced plans to collaborate in the development of Magnetic Random Access Memory (MRAM) - a breakthrough memory technology that could significantly increase battery … [Read More...]

20 Cool Creative Commons Photographs About the Future of AI

AI technology is starting to have a huge impact on our lives. The market value for AI is estimated to have been worth $279.22 billion in 2024 and it … [Read More...]

13 Impressive Stats on the Future of AI

AI technology is starting to become much more important in our everyday lives. Many businesses are using it as well. While he has created a lot of … [Read More...]

Graphic Designers on Reddit Share their Views of AI

There are clearly a lot of positive things about AI. However, it is not a good thing for everyone. One of the things that many people are worried … [Read More...]

Redditors Talk About the Impact of AI on Freelance Writers

AI technology has had a huge impact on our lives. A 2023 survey by Pew Research found that 56% of people use AI at least once a day or once a week. … [Read More...]

11 Most Popular Books on Perl Programming

Perl is not the most popular programming language. It has only one million users, compared to 12 million that use Python. However, it has a lot of … [Read More...]

10 Exceptional Books on ChatGPT that Will Blow Your Mind

ChatGPT is a powerful new AI tool that is taking the world by storm. You are going to find a lot of amazing books that will teach you how to make the … [Read More...]

Guides

  • Computer Communications
  • Mobile Computing
  • PC Components
  • PC Data Storage
  • PC Input-Output
  • PC Multimedia
  • Processors (CPUs)

Recent Posts

i915 Chipset

Announced at the same time as the i925X Express, the i915 Express chipset family - codenamed Grantsdale and comprising the … [Read More...]

Parity Memory

Memory modules have traditionally been available in two basic flavours: non-parity and parity. Parity checking uses a ninth … [Read More...]

How to Use System Restore

What Is System Restore and Why You Should Use It Watch the video or just read the written guide [jwplayer config=player … [Read More...]

[footer_backtotop]

Copyright © 2025 About | Privacy | Contact Information | Wrtie For Us | Disclaimer | Copyright License | Authors