Skip to content

Computing 102: Binary and Hex Math Mystery Cache

This cache has been archived.

gallaghd: This one is probably gone.

More
Hidden : 4/22/2013
Difficulty:
2 out of 5
Terrain:
1.5 out of 5

Size: Size:   micro (micro)

Join now to view geocache location details. It's free!

Watch

How Geocaching Works

Please note Use of geocaching.com services is subject to the terms and conditions in our disclaimer.

Geocache Description:

Every field has its own terminology. The computer field employs a terminology with concepts such as binary, hexadecimal, 7-bit ASCII, 8-bit ASCII, bits, bytes, etc., which can be quite confusing when you first hear them. These concepts are actually quite simple, and I am creating a series of caches intended to demystify them.

Good morning again, students! I hope you remember what we talked about in our last class; if not, please review the material from GC4A8Z8. During class today we will be taking another quiz, and the answers to the quiz will fill in the numbers for North A B.CD West E F.G

In our last class, we learned that computers use transistors (similar to switches), and therefore the "natural" language of computers is binary, or base-2. We learned how to represent binary numbers and then we looked at hexadecimal, or base-16. Today we are going to learn how math is performed on binary numbers as well as hexadecimal numbers. We will see that it is similar to the math you do every day in decimal. What? Oh, ok. The math everyone BUT janata does every day.

We'll start with addition. First, we'll think about what happens when we add in decimal. If the sum is less than 10, then there is no carry to the next digit. However, if the sum is 10 or greater, we must perform a carry to the next digit. For example, if we add 8 + 7, we get 15. Well, some of us do. We make the sum of this digit 5, and carry the 10 into the next more significant digit. So, if I add 27 + 28, the least significant digit of the sum is 5; then we go to the next column and add 2 + 2 + carry, and get 5. Thus the sum is 55. Yes, CitySlickerOH? No, that's not right ... the sum is 55, not 39 ... yes, I'm sure. Any other dumb remarks anyone?

OK, time for the first quiz. If your initials are CSOH, what do you think 27 + 28 equals? Use this number as A.

Let's think about adding two binary numbers. Hey FolboterJAF, pay attention! Yes, I know you are a math teacher, but the real question is whether you can DO math. So far, I'm not convinced! Since the only legal values of digits is 0 and 1, the sum of two digits must be between 0 and 2, inclusive. If the sum is 0 or 1, then there is no carry. However, for a sum of 2 we must carry. In base-10, we carried forward a 10; here in base-2 we carry a 2. So, if the sum is 2, we carry a 2, subtracting 2 from the current sum. For example, let's say we were adding 001 and 011. See the example below. (Note that in decimal, we are adding 1 and 3, and so the result better be the binary equivalent of 4!) We start with the least significant digits, which are both 1. The sum is 2, so we carry forward to the next column, and the sum for this first column is 0. Now in the 2nd column, we add 0 and 1, plus the carry. The sum of this column is again 2, and we carry to the next column. There, we add 0 + 0 + carry, and get 1. Thus, the sum is 100, or binary 4. Easy huh?

c c
0 0 1
0 1 1
1 0 0

OK, time for another question. What is the sum of 011111 + 001110? Use this number as B.

Ok, let's move on to subtraction. ATE, what do you want? Yes, it is important that you learn this. Abby is going to study this stuff, and you need to help her! Remember that in decimal, when you look at a particular column of the subtraction and have x - y, if y > x then there will be a borrow out of the next digit. The same thing happens in binary. If in the first column you have 0 - 1, then you will need to borrow a 2; then you can subtract 2 - 1 = 1. Because of the borrow, you will need to subtract 1 when you do the subtraction on the next column. For example, if you subtract:

   b
1 1 0
0 0 1
1 0 1

you will subtract 0 - 1 in the first column, borrowing from the 2nd column. In the second column, you subtract 1 - 0, but you must also subtract 1 for the borrow, and the result is 0 with no borrow. In the third column, you simply subtract 1 - 0 = 1.

OK, time for another question. What is 11000 - 10011? Use this number as C.

And now D. What is 101000101 - 100001000? Use this number as D.

Thank you for raising your hand, MTMAN2 ... unlike many of your rude classmates. Yes, bicycle and binary start with the same 2 letters. Any guess why? Yep, exactly! Ok, don't want to scare you, but now it's time for multiplication! Multiplication in binary is similar to decimal, but actually it's simpler. You only have to multiply by 0 and 1. Multiply A * 0, and yep, you get 0. Multiply A * 1, and you get A. Just like you would expect. Just like multiplication in decimal, each digit you multiply creates a result that must be shifted left each time. For example,

      1 0 0 1 0
            1 0 1
      1 0 0 1 0
   0 0 0 0 0
1 0 0 1 0
1 0 1 1 0 1 0

So, when we multiply by the first 1, we just reproduce 10010. We shift to the left each time we multiply, so when we multiply by the second 1, we have shifted twice. Now, simply do binary addition and you are done. Cake!

Let's warm up our multiplication with decimal. What is 21 * 4? Use this number as E.

Now binary. What is 0001 * 0010? Use this number as F.

Well, we saved hex for last. No, twilli1629, there's no reason to be scared. Hex has nothing to do with spells. Well, maybe there is some reason to be scared of hex .... We add hex pretty much like we do decimal. Just remember that you don't overflow and need a carry to the next digit unless the sum of your digits is >= 16. So,

   6 D
+ 9 5
1 0 2

Adding the first digit, D + 5, you are adding 13 + 5 = 18 = 12 hex. So, the sum is 2 with a carry to the next digit. Got it? Ready for a quiz?

NO WAY! We're gonna make you do hex subtraction!.

So, hex subtraction is nothing new. If we need to borrow, we borrow 16 from the next digit. So, 25 - 1F = 6. The 5-F in the first column requires a borrow, and we add 16 to 5 to get 21, then subtract F (15) from this to get 6. Man this stuff is easy! Let's see ....

  2 5
- 1 F
     6

Last quiz! What is 31C2 - 2A3D? Use the hex result as if it were an integer as G.

Hope you learned a lot today. Tomorrow we will be learning some new concepts: truth tables and Boolean logic. A fun time will be had by all!



You can validate your puzzle solution with certitude.


Additional Hints (Decrypt)

Uvag #1: 0 - 1 = 1, jvgu n obeebj Uvag #2: Jnvfg uvtu; vs fvqrjnyx vf 6'bpybpx, pnpur vf ng 5 b'pybpx

Decryption Key

A|B|C|D|E|F|G|H|I|J|K|L|M
-------------------------
N|O|P|Q|R|S|T|U|V|W|X|Y|Z

(letter above equals below, and vice versa)