therevsmall.jpg (1693 bytes)
 

 

Number Systems

NOTE: It may be necessary for the reader to read this article more then once for complete understanding.

Two of the most common number systems used in the world of computers are the Binary and Hexadecimal. However, Hexadecimal is the dominant one of the two.

Number systems use symbols to represent values. The ones covered in this article are as follows:

Number System
Symbols
Binary
1
0
Decimal
9
8
7
6
5
4
3
2
1
0
Hexadecimal
F
E
D
C
B
A
9
8
7
6
5
4
3
2
1
0

Base Values

The base value of a number system is the number of values it has before repeating itself. Binary has a base of 2 with digits ranging from 0 -1. Decimal has a base value of 10, meaning it has ten single digits ranging from 0 - 9. Hexadecimal has 16, ten of which are numerical (0 - 9) and the remaining six are alphabetic (A - F).

Excedance

When a single digit in any number system exceeds its Base value, it returns to zero, then the remainder is carried to its left one place.

Weighting Factor

BASEmultiplier value - A multiplier value is used in each column position of a number. It represents the weight factor. Its value determines how many times the Base value is multiplied by itself thus giving the placeholders seen below from right to left labelled as "Ones", "Tens", "Hundreds", "Thousands", "Ten Thousands" and so on. . . .

104
103
102
101
100
10,000
1,000
100
10
1

It is important to understand that the base number IS NOT multiplied by the weighting factor, rather the weighting factor shows how many copies of the base number are part of a sequence of multiplies ie; 104=10 x 10 x 10 x 10. Furthermore, any number to the zero power equals 1.

The least sigificant digit (LSD) is on the right and the most significant digit (MSD) is on the left.

Base 2 (Binary)

In the Binary numbering system each Binary place is weighted with the least significant bit on the right and the most significant bit on the left. Notice the 2's? In Binary there are only two single digits in its base as noted above, 0 and 1.

A single Binary digit is called a bit, four bits are called a "Nibble" and eight bits are called a "Byte". With eight bits you can represent any decimal number from 0 to 255 giving 256 possibilities.

27
26
25
24
23
22
21
20
1
1
1
1
0
1
0
0

Adding the sum of each of the corresponding places that have a one under them gives:

1×27 + 1×26 + 1×25 + 1×24 + 0×23 + 1×22 + 0×21 + 0×20 = 24410

or

1×128 + 1×64 + 1×32 + 1×16 + 0×8 + 1×4 + 0×2 + 0×1 = 24410

or

128 + 64 + 32 + 16 + 0 + 4 + 0 + 0 = 24410

With Excedance in mind you can see how the below Binary sums are derived at:

0
+0
==
0
0
+1
==
1
1
+0
==
1
1
+1
==
10
1
1
+1
==
11

Below is a table that shows another example for adding Binary digits:

1
1
1
1
1
<= Carry Over
1
0
0
1
1
1
0
1
b
+
0
1
0
1
0
1
1
1
b
=
=
=
=
=
=
=
=
=
1
1
1
1
0
1
0
0
b

Because Binary takes more placeholders then Decimal does to represent a number of the same value it is generally not used. Higher based number systems allow for the representation of a larger number with fewer digits then lower based number systems can.

Base 16 (Hexadecimal)

Decimal Binary Hexadecimal
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
Hexadecimal is commonly used to represent Red, Green and Blue color values on a web page or to make reference to physical memory locations within a computers memory. It is also alphanumeric including all decimal digits and alphabetic letters from A to F, "A" having a decimal value of decimal 10 and "B" being of value of decimal 11 and so on.

One Hexadecimal digit is equivelant to four Binary digits. Four Binary digits are also known as a Nibble.

00111111011110102 = 3F7A16

Converting from Binary to Hexadecimal is pretty simple. All you need to do is divide the Binary number into nibbles starting from the right side and find their corresponding equivelant on the table to the left.

3
F
7
A
0011
1111
0111
1010

This is the quickest way for conversion between Hexadecimal and Binary but I recommend learning how to do it the long way so that you get a better understanding of the mathematics involved.

As you can see below, the base is being referred to as 16 and the weights above and to the right tell how many times the Base is multiplied by itself giving the values below.

167
166
165
164
163
162
161
160
Decimal Equivalent. 268435456 16777216 1048576 65536 4096 256 16 1

There isn't much else to reflect on here because Hexadecimal is much like the other two numbering systems discussed, so I'll move on to converting between the three.

PART II - CONVERTING BETWEEN SYSTEMS

To convert from Decimal to Binary requires a series of divides. The Decimal number is divided by the Base value for the Binary numbering system which is 2. The remainders are kept track of during the division and reveal the single digits within the Binary number when the computation is complete.

As the divisions are calculated, the Binary digit is found through the remainder. The first remainder is the first digit in the Binary number and so on. So, the Binary conversion for 35710 is 1011001012.

Hexadecimal to Decimal conversion

Convert F9BD16 to decimal notation.

It is easiest to convert the single Hexadecimal digits to their corresponding Decimal values first; F=15 9=9 B=11 D=13.

Now do the multiplication and addition keeping in mind how weighting factors work.

15×163 + 9×162 + 11×161 + 13×160

=15×4096 + 9×256 + 11×16 + 13×1

=61440 + 2304 + 176 + 13

=6393310

With what you learned on this page you should be able to understand any Number system and convert between them .