pctechguide.com

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

Number Systems 2

Decimal

The difficult for us when approaching computer number systems is that we’re conditioned in to counting with our familiar base 10 system, or decimal. This system has 10 unique digits that represent units, tens, hundreds, thousands and so on, all in neat multiples of 10.

It may seem a little awkward to express it this way, simply because it’s so familiar, but we’ll have all done the number columns at very early primary school. For instance, to represent the number five thousand and ninety-six, we’d write 5096. This simply means five thousands, nine tens and six units, like this:

1000 100 10 unit
5 0 9 6

It seems almost beyond question that this is the natural way to represent this value, but in fact it’s simply a representation that we’ve become familiar with. We could represent it in many ways, including even shapes, colours, tones, or touch. But this particular system of number representation, grown out of early abacus counting, works well in the human mind, is good for arithmetic and other math work, and so has become almost universally employed.

Binary

However, the decimal system doesn’t work at all within a computer, because the computer knows only 0 and 1. So how does the computer count? Simple – the solution is that the computer uses a binary number system.

This can cause some confusion for those new to computer science, but it needn’t. All that happens in the binary number system is that the column values change, so numbers are represented using columns of values increasing in powers of two, not ten.

Let’s take some very basic examples to try and make this clear. Take the binary number 0b101. Notice that we precede the number with 0b, which denotes that the number is going to be a binary number. This is important, as it helps to make clear what number base we’re dealing with. Now, as we did with the decimal number above, we’ll split the digits into their respective columns, like this:

fours twos units
1 0 1

Here we can see that the binary number 0b101 represents one four and one unit. The decimal equivalent of this number is therefore 4+1=5.

Too simple? Take the number 0b110111:

32 16 8 4 2 unit
1 1 0 1 1 1

Here we can see that to convert the binary number 0b110111 to decimal, we add the columns 32+16+4+2+1=55.

Converting Decimal to Binary

Now, remember, the only reason that we’re converting these numbers to decimal is for our own understanding. The computer has to work in completely the other direction, in fact converting the decimal numbers that human users input into binary. This is really very simple, though.

Take the number 13. The key is to start with the highest binary column that we can, and work from there. The low binary number columns are units, twos, fours, eights and sixteens, but since sixteen is greater than 13, we know we’re starting with the eights column. So, we start our binary number with a one, and subtract the eight, leaving 5. The next binary column from eights is fours, which we can subtract from our remaining 5. So, we add another one to our binary number (now 11) and subtract the four, leaving 1. The next binary column from fours is twos, but we can’t subtract a two from 1, so we add a zero to our binary number (now 110). Finally the units column, and we do have one unit remaining, so we add a one to our binary number and we now have our complete binary number: 0b1101.

For a slightly more complex example, let’s take the number 87. Here the highest possible binary column is 64 (columns are units, 2, 4, 8, 16, 32, 64) so that’s where we can start with a 1. We then subtract 64 from the number, leaving 23, and move on to the next binary column, which is 32. 32 is greater than 23, so we add a zero to our binary number and move on to 16. We can take 16 from 23, so we add a one to our binary number, and are left with 7. The next column is eight, which we can’t subtract, so we add a number 0, then add a one for each of the four, two and unit columns (4+2+1=7) and have reduced our number to zero.

So we can now represent 87 as a binary number:

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

Checking this, 64+16+4+2+1=87. Correct!

There’s an interactive script at the end of this article which will give you more practice with these decimal to binary and binary to decimal conversions.

So, that’s how computers store the numbers, but it’s clear that binary numbers can quickly become unwieldy for humans. So, to keep things in check, hexadecimal is used, which uses base 16. This might seem to be a step in the wrong direction, but next we’ll look at why, and how, hexadecimal helps.

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

Filed Under: Number Systems

Latest Articles

Developing a Python to Extract Data from Your Smartphone

Many times we ask ourselves: "What part of the universe is this phone from?", even if we already know where it is, but we don't know which operator. Let me tell you that in this little tutorial I'm going to show you how to extract information from a phone through an API with Python. To use the … [Read More...]

Ransomware

What is Ransomware

We talk a lot about different viruses and malware on PC Tech Guide. But, there is one particular strain of malware that is becoming increasingly troublesome. It is called ransomware. Simply put, ransomware is software that holds your PC hostage until you pay money to get your computer or files back. … [Read More...]

Top Computer Video Games in 2020

The PC gaming market is maturing, but it is also very robust. The market will be worth $30.71 billion by 2022. It is growing at a pace of 2.2% a year, but the sluggish growth reflects the fact that it is already so large. New gamers are often looking for new games to try. Some people like the … [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

The Fast Method to Remove Findpages.net Virus, the Browser Hijacker

If you already see the Findpages.net virus displaying as your home page, then your computer might be hijacked. This browser hijacker can infect even … [Read More...]

Recipe Search Toolbar Removal

RecipeSeach Toolbar is a plugin for your browser that comes from the Mindspark family of toolbars. This plugin may be a risk to your computer, so it … [Read More...]

How to Use Print Screen in Windows

There are times where you would like to show something on your screen to someone. I use this all the time in my tutorials and you may be wondering how … [Read More...]

[footer_backtotop]

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