We are starting the UIL Computer Science season by looking at 4 major numbering systems. We are looking at the Base-2 (binary), Base-8 (octal), Base-10 (decimal), and Base-16 (hexadecimal) numbering systems.

### Base-10

Base-10 is also known as **decimal** or abbreviated to **dec**.

This system is comprised of 10 unique digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9.

The decimal numbering system is arguably the easiest numbering system since it is what we are the most familiar with.

In the decimal numbering system, numbers are read from left-to right, but the place-values run from right-to-left. Each place-value position is 10 times larger than the position to its right.

Let’s examine the decimal number 1,222_{10}

In this case, the 2 that is in the tens place is 10 times larger than the 2 that is in the ones place.

The 2 that is in the hundreds place is 10 times larger than the 2 that is in the tens place and 100 times larger than the 2 in the ones place.

The decimal numbering system working in multiples and fractions of 10.

### Base 2

Base-2 is also known as *binary *or abbreviated to *bin*.

This system is comprised of 2 unique digits: 0 and 1.

Binary numbers are read from left-to-right like decimal numbers and the place-values run from right-to-left.

**Place Value Position** |
**0**_{2} = Base-10 Value |
**1**_{2} = Base-10 Value |

1 |
0_{10} |
1_{10} |

2 |
0_{10} |
2_{10} |

3 |
0_{10} |
4_{10} |

4 |
0_{10} |
8_{10} |

5 |
0_{10} |
16_{10} |

6 |
0_{10} |
32_{10} |

7 |
0_{10} |
64_{10} |

8 |
0_{10} |
128_{10} |

Let’s look at the following binary number: 101_{2}

When reading from right-to-left, the first place value holds a 1_{2} and has a Base-10 value of 1_{10}.

The second place value holds a 0_{2} and has a Base-10 value of 0_{10}.

The third place value holds a 1_{2} and had a Base-10 value of 4_{10}.

To calculate the Base-10 value, we add the values of each place value together (1_{10} + 0_{10} + 4_{10}). In this case, the binary number 101_{2} has a Base-10 value of 5_{10}.

Let’s take a look at another binary number: 10011101_{2}

- Place Value 1 – 1
_{2} = Base-10 Value = 1_{10}
- Place Value 2 – 0
_{2} = Base-10 Value = 0_{10}
- Place Value 3 – 1
_{2} = Base-10 Value = 4_{10}
- Place Value 4 – 1
_{2} = Base-10 Value = 8_{10}
- Place Value 5 – 1
_{2} = Base-10 Value = 16_{10}
- Place Value 6 – 0
_{2} = Base-10 Value = 0_{10}
- Place Value 7 – 0
_{2} = Base-10 Value = 0_{10}
- Place Value 8 – 1
_{2} = Base-10 Value = 128_{10}

Add all of the Base-10 values together (128_{10} + 16_{10} + 8_{10} + 4_{10} + 1_{10}) and we get 157_{10}. So, in this case, the binary number 10011101_{2} has a Base-10 value of 157_{10}.

### Base-8

Base-8 is also known as *octal *or abbreviated to *oct*.

This system is comprised of 8 unique digits: 0, 1, 2, 3, 4, 5, 6, and 7.

Octal numbers are read from left-to-right, like Base-10 numbers but we must read the place-value position from right-to-left, like Base-2 numbers.

Let’s examine the octal 2561_{8}.

(2_{8} X 8^{3}) + (5_{8} X 8^{2}) + (6_{8} X 8^{1}) + (1_{8} X 8^{0})

1024_{10} + 320_{10} + 48_{10} + 1_{10} = 1,393_{10}

So, the octal 2561_{8} has a Base-10 value of 1,393_{10}.

In the solution, note the first digit in each set of parenthesis corresponds to the digits in the octal (2, 5, 6, and 1). We multiplied each of those by 8 raised to the power of their position in the octal from right-to-left with the first position having a power of 0.

### Base 16

Base-16 is also known as *hexadecimal *or abbreviated to *hex*.

This system is comprised of 16 unique digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F.

Hexadecimal numbers can be written one of two ways and either way is considered acceptable.

**Method 1:** 2AF3_{16}

**Method 2:** 0x2AF3

To convert a hexadecimal to Base-10 is very similar to the process for converting an octal to Base-10.

Let’s examine the hex 2AF3_{16 }

(2_{16} X 16^{3}) + (A_{16} X 16^{2}) + (F_{16} X 16^{1}) + (3_{16} X 16^{0})

Before we can continue, we need to discuss the Base-10 equivalents of the hexadecimal digits.

- 0
_{16} = 0_{10}
- 1
_{16} = 1_{10}
- 2
_{16} = 2_{10}
- 3
_{16} = 3_{10}
- 4
_{16} = 4_{10}
- 5
_{16} = 5_{10}
- 6
_{16} = 6_{10}
- 7
_{16} = 7_{10}
- 8
_{16} = 8_{10}
- 9
_{16} = 9_{10}
- A
_{16} = 10_{10}
- B
_{16} = 11_{10}
- C
_{16} = 12_{10}
- D
_{16} = 13_{10}
- E
_{16} = 14_{10}
- F
_{16} = 15_{10}

Now, we can continue:

(2_{16} X 16^{3}) + (A_{16} X 16^{2}) + (F_{16} X 16^{1}) + (3_{16} X 16^{0})

(2_{10} X 16^{3}) + (10_{10} X 16^{2}) + (15_{10} X 16^{1}) + (3_{10} X 16^{0})

8,192_{10} + 2,560_{10} + 240_{10} + 3_{10} = 10,995_{10}

### Where Are They Used?

**Base-10** is used as our standard counting and arithmetic system of the world around us. While it works great for our natural purposes, it does not lend itself to adequate use for internal processes of computer applications.

**Base-2** is used as the fundamental basis of computing and boolean logic. Since Base-2 only has 2 digits this can equate to yes/no, on/off, true/false and any other absolute polar response query.

**Base-8** is used in computer systems that parse 12-bit, 24-bit, and 36-bit binary words. Many of these computer systems are no longer in use and have been replaced with 32-bit and 64-bit binary word systems. As such, octal-based computing is no longer considered an efficient way to process data.

**Base-16** is used to represent numerical data in a more concise manner for programming purposes that isn’t as fundamental as Base-2.

An example is the HEX color system. Let’s look at the HEX color 9FBDDF_{16}. HEX colors are broken into 3 parts (1st 2 character represent amount of red, 2nd 2 characters represent amount of green, and 3rd 2 characters represent the amount of blue).

9F_{16} is the amount of red in the color. BD_{16} is the amount of green in the color. DF_{16} is the amount of blue in the color.

- In this example, we have 9F
_{16} equal to 159_{10}.
- If we continue, we have BD
_{16} equal to 189_{10}.
- Finally, we have DF
_{16} equal to 223_{10}.

It is much easier for a programmer to enter the following:

background-color: #9FBDDF;

as compared to:

background-color: rgb(159, 189, 223);