Numeric Systems

(Learn How Your PC Processes Everything Using Only Zeroes and Ones)

Researched and Written by Joseph Nellis

INDEX:

(You can lower the music volume on your PC loudness button)


What is a numeric system?

A Numeric System is simply a set of characters and mathematical rules that are used to represent a particular number. Let's review how it all started.

Ancient Numeric Systems

Human beings have always needed to count. In the dim millennia of prehistory, people had to make do with counting on their fingers or scratching marks on bone. Numeric systems appeared about 4,000 years ago, and sophisticated numbering systems and counting tools began to develop later (see icon Abacus above). Some examples are the Roman numeric system (known as Roman Numerals), the Chinese numeric system, the Greek numeric system, and the Arabic numeric system, which gave birth to the numbers we use today.

Modern Numeric System

Of all ancient systems, there are only three modern numeric systems commonly used nowadays. The most widely used system is the base 10 or decimal system, which uses a base 10 for operations and is consequently very simple to use. The other two systems are the hexadecimal system and the binary system. These systems use a base 16 and a base 2, respectively. The hexadecimal and binary systems are presented below.

So how does it all work?

The Decimal System. Remember when you learned in school that each digit in a number corresponds to the number it represents times the value of its place. Each position to the left of the decimal point indicates an increased power of 10. For instance, 341 equals 341 because (3 x 100) + (4 x 10) + (1 x 1) = 341. Representing this graphically, we'd have:

100 10 1
3 4 1

As we observe, each place's value equals 10 times the place to the right of it. From there we have the designation base 10


THE BINARY SYSTEM

The binary system uses the simplest rules for a complex world because it assumes only two states in microscopic eletronic circuitry--on and off, representing the arabic digits zero and one. It was devised by the British mathematician George Boole in the 19th century. This system has a base 2, which means each column's value equals 2 times the value of the one to the right, starting with the rightmost digit, which equals 1. So, let's take the number 1000111101001, for instance. Representing it graphically we have:

4096 2048 1024 512 256 128 64 32 16 8 4 2 1
1 0 0 0 1 1 1 1 0 1 0 0 1

So we have: (1 x 4096) + (0 x 2048) + (0 x 1024) + (0 x 512) + (1 x 256) + (1 x 128) + (1 x 64) + (1 x 32) + (0 x 16) + (1 x 8) + (0 x 4) + (0 x 2) + (1 x 1) = 4096 + 256 + 128 + 64 + 32 + 8 + 1 = 4585 There! 1000111101001 in the binary system equals 4585 in the decimal system! Now for the complicated part.

The other way around: decimal to binary

You've seen how to convert numbers from binary to decimal. Well, how about vice-versa? That's what you'll see in this section. First subtract the largest possible power of two, and keep subtracting the next largest possible power from the remainder, marking 1s in each column where this is possible and Os where it is not. Example: let's convert the number 500 from decimal to binary. First write down the places from right to left until you get to a number higher than the one to be converted, like this:

512 256 128 64 32 16 8 4 2 1

Now, write down a zero under 512 (since you can not subtract 512 from 500):

512 256 128 64 32 16 8 4 2 1
0

From now on, the scheme is simple: take the place immediately to the right. If it's smaller than the number, then write a 1 under it, subtract the place value from the number and use the result on the next place. If it's bigger, write down a 0 , don't subtract, and go to the next place. On the table above, 256 is smaller than 500, so write down a 1 under 256 and subtract 256 from 500. Then use the result (244) on the next place. So we have:

512 256 128 64 32 16 8 4 2 1
0 1

128 is smaller than 244, so write down a 1 under 128 and subtract 128 from 244. Use the result (116) on the next house.

512 256 128 64 32 16 8 4 2 1
0 1 1

And so on for the rest of the calculation:

512 256 128 64 32 16 8 4 2 1
0 1 1 1 1 1 0 1 0 0

See? It's simple! From this simple algorithm, you converted a decimal number into a binary number. 500 in decimal equals 111110100 in binary.

Here is a fun note: the capital letter "A" is represented by the decimal 65, which translates into binary 01000001; and the lower case "a" is the decimal 97, or binary 01100001.

As you may have guessed, your computer is not really writing down the letter "a", but merely representing it with a bunch of zeroes and ones, which in turn are tiny magnetized slots or "bits" on the diskette or hard drive. Further, when you format a disk you are simply making "roads" or tracks for zillion of bits to be lined up.


The Hexadecimal System

OK, you've learned the binary system, how to calculate decimal->binary and vice-versa, and now it gets a bit more complicated. The hexadecimal system, or hex, has a base 16, which means that each column equals 16 times the one to its right, starting with the rightmost column, which equals 1. Like this:

4096 256 16 1

The hexadecimal system, besides the digits 1 to 9, also uses A, B, C, D, E, F; which equal 10, 11, 12, 13, 14 and 15; respectively.

Hex -> Decimal

Let's start with an example: here we'll convert the hexadecimal number 7EF. Remember that the rightmost digit equals one and each digit to the left equals sixteen times the digit to its right. Write out the column headers from right to left until you have achieved the number of digits in the number. (if there are three digits in the number write three columns, for instance). Then write the number 1 at the rightmost column, like this:

1

Then write 16 (1 x 16) on the column to the left of 1; and 256 (16 x 16) on the column to the left of 16.

256 16 1

Next, write each of the digits of the number in the table.

256 16 1
7 E F

Now multiply each hexadecimal digit by the number on its respective header (remember that A-F represent 10-15 respectively)

256 x 7 = 1792 16 x 14 (E) = 224 1 x 15 (F) = 15 Then add up the results: 1792 + 224 + 15 = 2031

And there you have it! 7EF in hex equals 2031 in decimal.

The other way around

Now to convert from decimal to hex, it's somewhat more complicated. First, let's choose a number to convert. For this example we can use 293. Next, write down a table just like the last topic: from right to left, each table header with a number 16 times larger than the number to the left, starting with 1: Note: write down headers until the header is higher than the number to be converted.

4096 256 16 1

Now, place a 0 under any table header that is larger than the number to be converted. Then, divide the number to be converted by 256, which is the highest header which is lower than the number. In this case:

293 |256

37 1

Next, write down the result (1) and use the remainder (37) for the next calculation.

4096 256 16 1
0 1

Now divide the remainder of the last calculation (37) by the next header (16):

37|16

5 2

Put the result (2) under 16 and divide the remainder (5) by the next header (1)

4096 256 16 1
0 1 2

5 divided by 1 equals 5 with no remainder, so put 5 under 1 and it's done. note: if in any of the calculations the result has no remainder, simply place the result under the respective header and put 0 under all the other headers to the right.

4096 256 16 1
0 1 2 5
There! 293 in decimal equals 125 in hex.


How is Music Digitized?

Computers also deal with forms of information that do not, on their face, have anything to do with numbers and logic. For example, they can process sounds coming in through a microphone and reproduce them through speakers and special CD ROM disks. In this case, the computer must first "digitize" the information--translate it into binary digits. To digitize music the computer takes periodic measurements of the sound waves and records each measurement as a binary number. By performing these measuremts at precise and extremely short intervals, a computer can record the sound output of an entire symphony orchestra--and then reproduce the music with astonishing fidelity simply by reversing the digitizing process. That's how the Beethoven's 5th symphony you're listening was done! What better example to show you? And that's why I put it here!

So, on a CD disk the sound information is carried by concentric circles of pits and spaces. The laser beam in a digital record player reads the pits as zeros and the spaces as ones. Eletronic circuitry eventually reconverts this stream of digits into music, in a series of wave patterns, coded pulses of electricity, and precise voltages, which in turn drive the speakers of the sound system.

Now, aren't you happy you've read this page?

This page has been visited ........ HSPACE=10> times since January 11, 1998.
Click=>SIGN GUESTBOOK <= and => VIEW GUESTBOOK

GIUSEPPE'S HOME PAGE

E-mail