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

Wires-Only ADSL – Asymmetrical Digital Subscriber Line

Wires-only was one of the first of many BT initiatives during 2002 designed to kickstart the adoption of broadband, appearing on a wholesale basis at the start of the year and reaching consumers via ISPs over the following months. Also referred to as self-install - because there is no need … [Read More...]

Windows Secure Workstation

Windows Secure Workstation Welcome again to another weekly installment of our infection removal guide. If you've made your way to this page, you've probably been infected with Windows Secure Workstation. Infections of this type, while somewhat less than dangerous, do their their work … [Read More...]

Make Facebook Secure With These Steps

People love Facebook. They spend hours on this social website keeping up with friends and telling the world about what they have been doing. But, many people do not realize the security risks associated with using the site. They just enjoy using it and do not realize the implications of what a … [Read More...]

Best Laptops for Professional Writers in 2023

If you need a new laptop as a writer, you may find yourself bewildered by all the choices. For one thing, there are so many brands to choose from. … [Read More...]

What You Need to Know About Automation with Chrome

Automation is drastically changing the way we interact with the Internet. One survey found that 76% of businesses use automation to streamline … [Read More...]

9 Steps to Take When Building a Web Scraper in Python

Web scraping is a method for collecting, organizing and analyzing information that is spread over the Internet in a disorganized way. It can … [Read More...]

8 Steps To Streamline Your Business Operations with Virtual Data Rooms

With the increased reliance on networking and cloud computing, businesses generate and store an ever-increasing amount of sensitive information. As a … [Read More...]

Advantages and disadvantages of using Perl in web programming

Web pages are designed using programming codes and a number of technologies as tools to achieve the desired objectives. An example of the above … [Read More...]

Why Cross-Chain Trading Is the Future of Crypto Investing?

The rapid growth and evolution of the cryptocurrency market have opened up exciting opportunities for investors. Within this dynamic landscape, … [Read More...]

Guides

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

Recent Posts

Price Slicer Removal

Price Slicer may seem like a useful piece of software you can use to save money while shopping on the Internet. However, it is much more hassle than … [Read More...]

Bitdefender Internet Security Review

[starreviewmulti id=7 tpl=20] PROS: Allows parents to put control on internet options available to their children. CONS: Takes awhile to set up, … [Read More...]

Can Samsung Galaxy Alpha Contend Against The Best?

The Samsung Galaxy Alpha is still at the beginning of its sizzling days as it was only introduced in August 2014 and released in the market in … [Read More...]

[footer_backtotop]

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