Friday, November 27, 2009

Binary

1,2,3,4,5,6,7,8,9,10.

Base 10.
Everybody uses it, except for Middle Eastern countries, and even then, they use metrics.
Yes, the metrics system uses base ten.
Centimeters in a decimeter? 10

Decimeter in a meter? 10.
meters in a kilometer 1000 (10 to the third power).
You see where this is headed?
Even though America's measuring system isn't base ten (we use some random measuring system of 2.5000000001016 cm in an inch, 12 inches in a foot. Oddly enough, from there, we have a yard (3 feet) which is just short of a full meter (3.280839895 feet) which is probably what leads people to confuse a yard-stick with a meter-stick. Anyways. 5280 feet in a mile or 1760 yards.)
Anyways, the point is that base ten is a major counting system? Dunno why. Maybe because it's easy. Maybe because we have ten fingers and ten toes. Who knows?
That's not the subject. The subject of this is binary, which is base 2.
It's the same counting system computers use.
And I'm going to teach you.
Why?
Because, I've tried to find it online, and only see people who go a long way about doing it, or don't know what the heck they're talking about.
Get out your pencils and paper.
Write this down.
Don't go too fast.
Ready?

Binary uses two (2) numbers. It uses 0. And it uses 1.
That's right. A non-counting number is used as a number.
Because zero represents what's not a number.
Confused? All right, here we go.
01101001
Read it from right to left, not left to right.
The first number is a 1, not a zero.
That means, that digit is a number.
Now, the first number (on the far right) is 1. The second (the 0) is two. Except, we don't count the two, because it's a 0, not a one.
The third number would be a 4, except, once again, it's a zero.
The fourth number is 8.
You see the pattern? Every digit to the left, you double the number to the right. Even if a digit's a zero, which isn't added to the number as a whole, you still double it.
So.
0=128N
1=64Y
1=32Y
0=16N
1=8Y
0=4N
0=2N
1=1Y
N= not counted
Y= counted
So, the numbers counted are 1, 8, 32, and 64.
So, what do you do with these numbers, once you find out what they are?
Simple addition.
64
32
8
+1

First, we add the numbers on the right. 4+2+8+1= 15. Carry the one and add the left numbers which are 1+6+3= 10.
So, we get 105.
Now, an easy way to figure out if you have it right. If the number starts (reading right to left) with a 1, it's odd. If it starts with 0, it's even.
I have managed to easily add up strings of up to 27 numbers.
Of course, the higher it goes, the harder it is.
You try figuring out 100110101001001001001011010101010.
Go on, try.
You're going to end up with a number longer than 7 digits long, which is one-million.

-Xander

No comments: