Thread: Do you know?
View Single Post
Old 08-09-2007, 09:51 PM   #30
MerF
Go Rays!
 
MerF's Avatar
 
Drives: 03 Trailblazer
Join Date: May 2007
Location: St Pete, Florida
Posts: 2,532
Quote:
Originally Posted by Dragoneye View Post
Okay, teacher, I still don't quite get this part. How do you get 128 out of 10111001, or 64 out of 10111001?


What do you teach, btw?
To put it simply, I teach electronics theory and maintenance to young sailors in the Navy.

Let's learn binary...once you get binary, you can get the rest from that.

Each digit of a binary value represents a value in decimal. Since there are only ones and zeros, the binary number gets pretty big pretty quickly. The way to determine what the binary number is "worth", is to see what each digit represents and add all the "1"s together.

Because, starting with the right-most digit, you double it's value. For example:

0000 = 0
0001 = 1 (the far-right digit is ALWAYS a 1!)
0010 = 2 (the second-from-the-right is ALWAYS WORTH 2, because I DOUBLED THE "1"!)
0011 = 3 (add BOTH VALUES TOGETHER [1+2] = 3!!!)
0100 = 4 (Double the value of the previous digit to get this value...2x2=4!!)
0101 = 5 (The "4" and the "1" digits are SET (1's) so we ADD THEM TOGETHER!)
0110 = 6 (The "4" and the "2" are now set (1's) so we ADD THEM TOGETHER!)

This goes on forever and always, the cycle never ever ends or changes.

So for my example I gave, 10111001...
Starting from the FAR RIGHT...so backwards from what you have always done in the past, I add together all the values that are "1", but don't forget to still double the count every single digit, even if it's a ZERO.

Sooo:

1+(skip 2 & 4, because they are "0")+8+16+32+(skip 64)+128 = THE DECIMAL VALUE OF THE BINARY NUMBER

I love being geeky.
MerF is offline   Reply With Quote