Respuesta :
What is base 2?
You know how we have 10 1's in 10, 10 10's in 100, 10 100's in 1000, etc.? That's because, in the decimal system, our base, which you can think of as our "grouping number," is 10. In base 2, that grouping number is 2. To get a feel for what that means, let's try counting in this system. I'll use parentheses for grouping, and we'll write the digits at the end!
o, (oo)
We've reached two units, so we group them together since 2 is our base.
(oo)o, ((oo)(oo))
We have two groups of 2 now, so we wrap that up in a larger group!
((oo)(oo))o, ((oo)(oo))(oo), ((oo)(oo))(oo)o
If we wanted to look at that last number in base 10 in this same style, using paretheses for grouping, it would look like
ooooooo
Or 7 in base 10. How do we write something like
((oo)(oo))(oo)o
In digits? One way, the stardard way, is to count the number of each type of group that isn't enclosed in a group. For ((oo)(oo))(oo)o, we have
((oo)(oo)) - 1
(oo) - 1
o - 1
So we could write this number as 111 in binary. What would happen if we added one more? Well, now we'd have
((oo)(oo))(oo)oo
We can group the two o's together:
((oo)(oo))(oo)(oo)
And the two (oo)'s together:
((oo)(oo))((oo)(oo))
And the two ((oo)(oo))'s:
(((oo)(oo))((oo)(oo)))
And now the ungrouped bits are 1 (((oo)(oo))((oo)(oo))), 0 ((oo)(oo))'s, 0 (oo)'s, and 0 o's. We'd write this number as 1000 in base 2, and going back to base 10, we still don't have one full group of ten, so we can strip away the parentheses to get:
oooooooo
Which can be written as 8 in decimal.
Going from Base 2 to Base 10
Let's say we're given the number 1010 in base 2, and we want to turn that into a number in base 10. What do each of the digit's mean here? let's break it down:
- 1010: Groups of 1
- 1010: Groups of 2
- 1010: Groups of 4
- 1010: Groups of 8
We can write this as the sum [tex]1\cdot8+0\cdot4+1\cdot2+0\cdot1[/tex], or [tex]8+2[/tex], which gives us the base 10 number 10 - 1 ten and 0 ones.
Why base 2?
At first glace, base 2 seems a little excessive; why do we need 4 digits to write out the number 8? Why go through the trouble? To be honest, we didn't have to pick 10 as our base of choice - it came about historically because we have 10 fingers, and fingers are our main tool for counting. Base 2 finds its use in computers, which, at their most basic level, are a bunch of tiny on-off switches. Since each switch has 2 states, base-2 is a natural way for computers to store and represent numbers. Remember that next time you see a movie hacker messing with 1's and 0's!