Login
Password

Forgot your password?

Counting in Binary, Octal, and Hexadecimal

By Edited Nov 13, 2013 0 0

In a world that is buzzing with technology, you've probably heard words like "binary" and "hexadecimal" thrown around a lot. These are the languages or numbering systems in which computers "think," so to speak. When the calculator figures out 283659028 x 93650283 in less than a second, it isn't doing the decimal multiplication you learned in grade school. It does math in binary. Binary and other similar numbering systems often have a stigma of being very difficult to understand and something that "only nerds can use." But these ways of counting are actually quite simple after just a little bit of study. In this quick guide, I'll show you how to read numbers in not just binary or hexadecimal, but in any base your mind can conjure up.


Just a Pinch of Theory: Counting in Base X

You can count to 10, right? 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, nice and simple. And what happens when you count higher? You get to 11, 12, 13…That is, you keep the 10 you just counted, and then you start again from 1, 2, 3, etc. Traditional math education leaves you thinking that this is the only way to count, but humor me for a minute while I provide a different perspective on what's happening when we count to 10.

Let's start with a number, like 134. Now, let's split it up into its digits: so 1, 3, and 4. What do each of these digits mean in the number 134? Well, 1 means 100, 3 means 30, and 4 means, um, 4. So think of it like this:

134 = 100 + 30 + 4 = (1 x 102) + (3 x 101) + (4 x 100)

So the 1 in 134 stands for 100, which is equal to 1 times 10 to the second power. Similarly, 3 stands for 30, which is equal to 3 times 10 to the first power. And finally, 4 stands for 4, which is equal to 4 times 10 to the zero power. What decides the exponents on the 10? The digit on the right gets an exponent of zero, and then each digit to the left gets an exponent that's one higher. You've probably heard your math teacher say that the 1 here is in the "hundreds place," the 3 in the "tens place," and the 4 in the "ones place." This is basically what your teacher was talking about: 1 is in the hundreds place so it stands for 100, 3 is in the tens place so it stands for 30, and 4 is in the ones place so it stands for 4.

Not too crazy, right? It's kind of a weird way to think about it, but it's not too tough. Let's take this idea just a bit further. The numbers that we use in our day-to-day lives are in base 10 (sometimes called radix 10) because the number under the exponent is 10. This is also called the "decimal" system because the root "deci-" means 10. So what if we changed that number to, say, 5? Well, let's try it:

134 (base 10) = (1 x 52) + (3 x 51) + (4 x 50) = 25 + 15 + 4 = 44 (base 5)

Wait, what? 134 = 44? Yep, that's right. But we have to remember to specify that it's 134 (base 10) that is equal to 44 (base 5), since 134 (base 10) is clearly not equal to 44 (base 10). One other important thing to notice is that we don't have numbers like 35 in a base 5 system. Why? That 5 digit in the ones place would be (5 x 50), which is the same as (1 x 51), so instead of 35 we would just write 40, which is (3 x 51) + (1 x 51). The take-away here is that any single digit in the number can go from zero to one less than the base. In our usual base 10, this means 0-9, and in our new base 5, this means 0-4.

That's pretty much it. We can choose any number we want to put in place of the 10 (5 in the second example), and we have a new numbering system in that base. Someone even suggested using base π to me once (pi = 3.14159.....). Can you imagine how utterly painful that would be?? Now, let's see what this all has to do with binary.


Digital Dreams
Credit: flaivoloka at stock.xchng

Binary

The word "binary" comes from the root word "bi-", which means 2, so this is a numbering system in base 2. That also means that any one digit in a binary number can only be zero or 1. Thus, we get numbers like this:

1010 (binary) = (1 x 23) + (0 x 22) + (1 x 21) + (0 x 20) = 8 + 0 + 2 + 0 = 10 (decimal)

So while binary might seem like something just for "nerds" at first glance, it's not really that complicated. As you might guess, however, binary numbers can get very looooong.

Here are some quick quiz questions to test your new knowledge. The answers are at the bottom of this page.

1a) 1101 (binary) = ? (decimal)

1b) 11010111 (binary) = ? (decimal)

1c) 33 (decimal) = ? (binary)

1d) 121 (decimal) = ? (binary)


Octal

The word "octal" comes from the root "oct-" meaning 8, so this is the system in base 8. Again, any single digit of an octal number can be zero, 1, 2, 3, 4, 5, 6, or 7. Let's try it:

362 (octal) = (3 x 82) + (6 x 81) + (2 x 80) = 192 + 48 + 2 = 242 (decimal)

That's it. Here's some practice:

2a) 111 (octal) = ? (decimal)

2b) 2732 (octal) = ? (decimal)

2c) 111 (decimal) = ? (octal)

2d) 1250 (decimal) = ? (octal)


Hexadecimal

You're a pro at this by now, so what's hexadecimal gonna be? You betcha: the root "hexadeci-" means 16, so this is the system in base 16. Digits in this system can be zero, 1, 2, 3, 4, 5, 6, 7, 8, 9, or---wait, we're out of numbers! And we can't just write 10, because that would be (1 x 161) or 16 (decimal) instead of the 10 (decimal) that we're looking for. So what do we do in math when numbers aren't enough? We add letters. Hexadecimal digits can be zero, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, or F, where A stands for 10 (decimal), all the way up through F which stands for 15 (decimal). Perhaps a little awkward at first, but easy to get used to. Let's do this!:

3BD (hexadecimal) = (3 x 162) + (B x 161) + (D x 160) = 768 + 176 + 13 = 957 (decimal)

Shablam! Done. Here's some practice:

3a) D (hexadecimal) = ? (decimal)

3b) AA3 (hexadecimal) = ? (decimal)

3c) 287 (decimal) = ? (hexadecimal)

4d) 3501 (decimal) = ? (hexadecimal)


Answers

Here are the answers for the practice questions. Thanks so much for reading!

(1a) 13      (1b) 215        (1c) 100001      (1d) 1111001   

(2a) 73     (2b) 1498     (2c) 157             (2d) 2342

(3a) 13     (3b) 2723     (3c) 11F             (3d) DAD

 


Advertisement
Advertisement

Comments

Add a new comment - No HTML
You must be logged in and verified to post a comment. Please log in or sign up to comment.

Explore InfoBarrel

Auto Business & Money Entertainment Environment Health History Home & Garden InfoBarrel University Lifestyle Sports Technology Travel & Places
© Copyright 2008 - 2016 by Hinzie Media Inc. Terms of Service Privacy Policy XML Sitemap

Follow IB Technology