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

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)

Related

Filed Under: Number Systems

Latest Articles

Internet Speed Test

How To Test Your Internet Speed

These days lots of people have high-speed Internet, thanks to the great Internet Installation they get from their provider. And, they hear the blazing fast speeds they are being offered by different Internet Service Providers (ISPs). But, is it really as fast as they claim? So, you may want to … [Read More...]

Preparing Installation – How to do a clean installation of Windows XP

In the Preparing installation phase, more files are copied to your computer in preparation for installation. After a while, the computer restarts with Setup identifying the existing partitions and unpartitioned space on the PC. Partitioning and formatting your hard drive Proceed as … [Read More...]

Object Oriented Programming 8

And that's it for our introduction to using Object Oriented (OO) design techniques. We've looked at inheritance, multiple inheritance and polymorphism, and you can see how designing the class tree structure in this way forces the designer to fully understand the problem. It also defines very … [Read More...]

Artificial Intelligence is Shaping the Solar Energy Field

The global market for solar power is expected to be worth $194.75 billion by 2027. As demand for solar energy solutions rises, solar product … [Read More...]

9 More Great Microsoft Word Hacks to Boost Productivity

We mentioned a few great Microsoft Word hacks in our last post. We wanted to follow up and share some more that can help improve productivity. … [Read More...]

7 Great Microsoft Word Hacks to Bolster Productivity

Today we are going to show you 24 Word tricks to get the most out of this text editor. Although there are many alternatives, Word is still the tool … [Read More...]

The Growing Importance of AI in Forestry Preservation

Artificial Intelligence as a key to environmental and forest industry preservation There are different types of Artificial Intelligence. On the one … [Read More...]

Machine Learning: the Future of the Hotel Industry

Do you operate a hotel chain and want to calculate budgets automatically? Does your hotel need to predict next week's purchase orders or how many … [Read More...]

5 Pieces of Technology to Boost Your Business in 2021

Let’s face it; running a business is not usually easy. Whether you are self-employed and running your own one-person operation or employing many … [Read More...]

Guides

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

Recent Posts

Motherboard IDE Connections

IDE connectors, like floppy drive and other connectors, are keyed to ensure proper connection. Connect your IDE devices to the motherboard IDE … [Read More...]

EDO and BEDO DRAM – History and Evolution of Product

Extended Data Out DRAM comes in 70ns, 60ns and 50ns speeds. 60ns is the slowest that should be used in a 66MHz bus speed system (i.e. Pentium … [Read More...]

A Guide to LED Screens

A Guide to LED Screens These days, there are countless different ways to grab a potential customer’s attention. Low prices, lots of advertising, an … [Read More...]

[footer_backtotop]

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