Concepts of Adding in Base 2Date: 08/18/98 at 10:52:34 From: Andre Ross Subject: Base 2 Dr. Math, I don't understand the whole concept of base 2 or how to add in base 2. Please help. Thank you, Andre Ross Date: 08/19/98 at 12:52:56 From: Doctor Peterson Subject: Re: Base 2 Hi, Andre. Let's see if we can relate base two to something you can picture easily. You've probably seen an odometer in a car, or a tape counter in a cassette player, or things like that. They have a set of wheels, each of which has the ten digits 0, 1, ... 9 on it. The one on the right is turned by whatever is being counted, and each time it finishes a turn, going from 9 back to 0, it pulls the wheel to its left one space, say from 3 to 4: +-+-+-+-+ |0|0|3|9| +-+-+-+-+ /| +-+-+-+-+ |0|0|4|0| +-+-+-+-+ When that digit reaches 9, then rolls around to 0, it pulls the next digit forward one place with it: +-+-+-+-+ |0|0|9|9| +-+-+-+-+ / /| +-+-+-+-+ |0|1|0|0| +-+-+-+-+ This way, the rightmost wheel counts "ones," the second counts "tens," and so on. A binary counter would work the same way, but would only have two digits on each wheel: 0 and 1. So when one digit rolled around from 1 to 0, it would pull the next digit forward: +-+-+-+-+ |0|0|0|1| = 1 +-+-+-+-+ /| +-+-+-+-+ |0|0|1|0| = 2 +-+-+-+-+ | +-+-+-+-+ |0|0|1|1| = 3 +-+-+-+-+ / /| +-+-+-+-+ |0|1|0|0| = 4 +-+-+-+-+ This is the binary system: representing numbers with nothing but 0 and 1. We can interpret a binary number by noticing that the rightmost digit counts every time (counting "ones"); the next digit counts every second time (counting "twos"); the next counts "fours," and so on. So for instance, the binary number 0011 means 1 one and 1 two, which is 1 + 2 = 3. Now how do you add? Again, it's the same as for ordinary decimal numbers, except that you go by twos. Picture one of those little plastic money counters you may have seen, that look like the odometer I've just been talking about but have a button above every digit that moves that wheel once for every push. To add 23 to the total, I push the rightmost button three times (adding 3 "ones") and the second button twice (adding 2 "tens"). If either wheel is pushed past 9, it moves the wheel next to it, just as when it's counting. (We call that "carrying".) +-+-+-+-+ |0|0|3|9| + 3 +-+-+-+-+ /| +-+-+-+-+ |0|0|4|2| + 20 +-+-+-+-+ | +-+-+-+-+ |0|0|6|2| 39 + 23 = 62 +-+-+-+-+ A binary counter would work the same, but we'd never have to push any button more than once, since each digit we have to add would be a 0 or a 1! +-+-+-+-+ |0|0|1|0| + 1 +-+-+-+-+ | +-+-+-+-+ |0|0|1|1| + 10 +-+-+-+-+ /| +-+-+-+-+ |0|1|0|1| 10 + 11 = 101 +-+-+-+-+ ( 2 + 3 = 5 ) When we write this down, it looks just like adding decimal numbers, except that we only write ones and zeroes, and when we add 1 + 1 we get 10, so we write down 0 and carry 1: 1 <-- carry 10 + 11 ---- 101 So working with binary is actually much easier than decimal because you hardly have to remember any addition facts, but everything else is the same. If you want more, here's a nice explanation of how to add, subtract, multiply, and divide in binary, from our Dr. Math archives: http://mathforum.org/dr.math/problems/matt4.7.97.html - Doctor Peterson, The Math Forum Check out our web site! http://mathforum.org/dr.math/ |
Search the Dr. Math Library: |
[Privacy Policy] [Terms of Use]
Ask Dr. Math^{TM}
© 1994- The Math Forum at NCTM. All rights reserved.
http://mathforum.org/dr.math/